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
Display a listing of the resource.
public function index() { $items = User::all(); return response()->json([ 'data' => $items ], 200); }
{ "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
Store a newly created resource in storage.
public function store(Request $request) { $item = User::create($request->all()); return response()->json([ 'data' => $item ], 201); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n 'description' => 'nullable|string',\n ]);\n\n $resource = Resource::create($request->all());\n\n if ( $request->hasFile('file') ) {\n $resourceFile = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resourceFile);\n $resource->file = $resourceFile;\n $resource->save();\n }\n\n if ( $request->submit == 'Save' ) {\n return redirect()->route('admin.resources.index')->with('success','Resource Successfully Uploaded');\n } else {\n return redirect()->route('admin.resources.create')->with('success','Resource Successfully Uploaded');\n }\n }", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72857565", "0.714571", "0.71328056", "0.66390204", "0.6620437", "0.6567189", "0.6526738", "0.65074694", "0.64491314", "0.63734114", "0.6370837", "0.63628685", "0.63628685", "0.63628685", "0.6342026", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964" ]
0.0
-1
Display the specified resource.
public function show(Request $request, User $user) { $email = $request->email; $user = User::find($email); $item = User::find($user); if($item) { return response()->json([ 'data' => $item ], 200); } else { return response()->json([ 'message' => 'Not found', ], 404); } }
{ "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 }", "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 }", "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 $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 }", "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 }", "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 edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\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 showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show(Resena $resena)\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 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 edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "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 display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\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\t{\n\t\tparent::display();\n\t}", "public function show()\n\t{\n\t\t\n\t}", "public function get_resource();", "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 }", "public function display() {\n echo $this->render();\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 show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n {\n //\n $this->_show($id);\n }", "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()\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 abstract function display();", "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 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}", "abstract public function resource($resource);", "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.8232636", "0.81890994", "0.68296117", "0.64987075", "0.649589", "0.64692974", "0.64633286", "0.63640857", "0.6307513", "0.6281809", "0.621944", "0.61926234", "0.61803305", "0.6173143", "0.61398774", "0.6119022", "0.61085826", "0.6106046", "0.60947937", "0.6078597", "0.6047151", "0.60409963", "0.6021287", "0.5989136", "0.5964405", "0.5962407", "0.59518087", "0.59309924", "0.5921466", "0.5908002", "0.5908002", "0.5908002", "0.59051657", "0.5894554", "0.5871459", "0.5870088", "0.586883", "0.5851384", "0.58168566", "0.58166975", "0.5815869", "0.58056176", "0.5799148", "0.5795126", "0.5791158", "0.57857597", "0.5783371", "0.5761351", "0.57592535", "0.57587147", "0.5746491", "0.57460666", "0.574066", "0.5739448", "0.5739448", "0.57295275", "0.57293373", "0.5729069", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57214445", "0.57149816", "0.5712036", "0.5710076", "0.57073003", "0.5707059", "0.5705454", "0.5705454", "0.5700382", "0.56997055", "0.5693362", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, User $user) { $update = [ 'name' => $request->name, 'email' => $request->email, 'password' => $request->password, ]; $item = User::where('id', $user->id)->update($update); if($item) { return response()->json([ 'message' => 'Updated successfully', ], 200); } else { return response()->json([ 'message' => 'Not found', ], 404); } }
{ "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(User $user) { $item = User::where('id', $user->id)->delete(); if($item) { return response()->json([ 'message' => 'Deleted successfully', ], 200); } else { return response()->json([ 'message' => 'Not found', ], 404); } }
{ "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
Handle an incoming request. This middleware checks whether loggedin user is related with any account and: 1) has "write" permissions within this account 2) this account has kids to quote
public function handle(Request $request, Closure $next) { $permissions = AccountUserPermission::whereHas('permission', function(Builder $query){ $query->where('allow_write','=','1'); })->has('account.kids') ->where('user_id','=',Auth::id())->count(); if($permissions>0) { return $next($request); } return redirect(route('welcome')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle( $request, Closure $next, ...$guards )\n {\n if( auth()->user()->isAdmin() ) {\n return $next($request);\n } else {\n abort(403);\n }\n }", "public static function handleRequest()\n {\n if(isset($_SESSION['user']) && $_SESSION['user'] !== NULL)\n return true;\n return false;\n }", "public function handle($request, Closure $next) //一定要在 tokenMiddleware 后面\n {\n $role = $request->user->role;\n if ($role == 66)\n {\n return $next($request);\n\n }\n else\n {\n return response([\n 'code' =>304,\n 'message' => '此账号不是安保处总负责人账号,无权'\n ]);\n\n }\n }", "public function handle($request, Closure $next, $roles, $param_user_id = null)\n {\n\n $roles = explode(\"|\", $roles);\n\n //allow user if current user is url param user\n if( $request->user()->user_id == $param_user_id ){\n return $next($request);\n }\n\n //allow user if current user has the corect role\n foreach($roles as $role){\n if( $request->user()->hasRole($role) ){\n return $next($request);\n }\n }\n\n //block everithing else\n return response()->json('You do not have permission to access this', 403);\n }", "public function handle($request, Closure $next)\n {\n if(JWTAuth::parseToken()->authenticate()->hasRole('User'))\n {\n\n return $next($request);\n\n }//end of if\n \n }", "public function handle(Request $request, Closure $next)\n {\n // Below code would allow moderators to also edit posts\n// foreach (auth()->user()->roles as $role) {\n// if($role->name == \"Moderator\") {\n// return $next($request);\n// }\n// }\n\n if(Auth::id() == $request->post->created_by){\n return $next($request);\n }\n\n session()->flash('status','Denied - You do not have permissions to edit other users\\' posts');\n return redirect()->back();\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function handle($request, Closure $next)\n {\n $usuario = $request->user();\n $ruta = Route::getRoutes()->match($request)->uri();\n $metodo = $request->method();\n\n if($usuario->hasAcceso($ruta, $metodo)){\n return $next($request);\n }else{\n abort(403);\n }\n }", "public function user_is_allowed()\n {\n //check if the record exist\n if (! $this->record) {\n $this->build_error('These record does not exist or it may not belong to you',404);\n }\n\n //check if the user is the owner of the entry\n if(!isOwner($this->record)) {\n $this->build_error('you are not the owner of this task');\n }\n\n //check if the incomming entries type is Array\n if (!is_array($this->request->entries)) {\n $this->build_error('Please the entries must be an Array');\n }\n }", "public function handle(Request $request, Closure $next)\n { //check current user is admin or not\n //check current user is premium user or not\n // check this post is current user post ?\n $id = request('id'); //post id \n $author_id = Post::find($id)->user_id; //authorId in current post\n\n if(auth()->user()->isAdmin == \"1\" || auth()->user()->isPremium==\"1\" || auth()->user()->id == $author_id){\n return $next($request); //delete or update post\n }\n else{\n return redirect()->route('home')->with('errors',\"Sorry,you are not both Premium User and Admin!\");\n }\n \n }", "public function handle($request, Closure $next)\n {\n # $userId = $request->user()->id;\n #$user = App\\User::find($userId);\n\n if($request->user() == null || !$request->user()->isAdmin()){\n return redirect('/');\n }\n\n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n $user = User::all()->count();\n if (!($user == 1)) {\n if (!Auth::user()->hasPermissionTo('View User')) //If user does //not have this permission\n {\n// abort('401');\n return redirect('/home');\n }\n }\n\n if ($request->is('users/create'))\n {\n if (!Auth::user()->hasPermissionTo('Add User'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->is('users'))\n {\n if (!Auth::user()->hasPermissionTo('View User'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->is('users/*/edit'))\n {\n if (!Auth::user()->hasPermissionTo('Edit User'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->isMethod('Delete'))\n {\n if (!Auth::user()->hasPermissionTo('Delete User'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->is('permissions/create'))\n {\n if (!Auth::user()->hasPermissionTo('Add Permission'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->is('permissions'))\n {\n if (!Auth::user()->hasPermissionTo('View Permission'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->is('permissions/*/edit'))\n {\n if (!Auth::user()->hasPermissionTo('Edit Permission'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->isMethod('Delete'))\n {\n if (!Auth::user()->hasPermissionTo('Delete Permission'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->is('roles/create'))\n {\n if (!Auth::user()->hasPermissionTo('Add Role'))\n {\n return redirect('/home');\n }\n }\n\n// if ($request->is('roles'))\n// {\n// if (!Auth::user()->hasPermissionTo('View Role'))\n// {\n// return redirect('/home');\n// }\n// }\n\n if ($request->is('roles/*/edit'))\n {\n if (!Auth::user()->hasPermissionTo('Edit Role'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->isMethod('Delete'))\n {\n if (!Auth::user()->hasPermissionTo('Delete Role'))\n {\n return redirect('/home');\n }\n }\n\n return $next($request);\n }", "public function process(Request $request, RequestHandlerInterface $handler) : ResponseInterface\n {\n $token = $this->session->get('token');\n\n if ($token) {\n $user = $this->repository->findByToken($token);\n\n if ($user !== null && $user->isAdmin() === true) {\n return $handler->handle($request->withAttribute('user', $user));\n }\n }\n\n return $this->responseFactory->createResponse(404);\n }", "public function handle($request, Closure $next) {\n if(Auth::user()->hasPermissionTo(Route::getCurrentRoute()->getName())) {\n return $next($request);\n }\n abort(403, 'You are not authorized for this page');\n }", "public function handle($request, Closure $next, $role_id)\n {\n if($request->user() === null){\n return response('Please Login', 401);\n }\n $permission=$request->user()->AllowToAccess($role_id);\n\n\n if($permission==true){\n return $next($request);\n }\n \n return redirect('home');\n //return new Response(view('NotFoundPage'));\n }", "public function handle($request, Closure $next, ...$level)\n {\n\n if (Auth::check()) {\n\n if (!empty($level)) {\n\n $whoIs = $this->meWithRole(Auth::user()->id,$level);\n\n if (!$whoIs) {\n\n return response()->json([\"code\"=>401,\"msg\"=>\"Unauthorized\"],401);\n\n }\n\n\n }else {\n\n return response()->json([\"code\"=>500,\"msg\"=>\"Wrong Route Configuration\"],500);\n\n }\n\n $response = $next($request);\n\n return $response;\n\n }else {\n return response()->json([\"code\"=>401,\"msg\"=>\"Unauthorized\"],401);\n }\n\n\n // Post-Middleware Action\n\n }", "public function handle($request, Closure $next)\n {\n $userid = ProductServices::getProductById($request->pid)->user_id;\n if (Auth::user()->role_id == UserRoles::ADMIN)\n return $next($request);\n else if (Auth::user()->id == $userid) {\n return $next($request);\n } else\n return \"<div class=\\\"alert alert-danger\\\" role=\\\"alert\\\">\n You don't have permission to do this!\n </div>\";\n }", "public function handle($request, Closure $next)\n {\n if (Auth::user()->hasRole('ROD')) {\n $rodProfile = RodProfile::where('user_id', Auth::user()->id)->get();\n if ($rodProfile->count()==0) {\n Auth::logout();\n return redirect()->route('login')->with([\n 'actionError'=>'Rod Profile must be assigned to this account before usage',\n ]);\n }\n }\n if (Auth::user()->hasRole('ZBM')) {\n $zbmProfile = ZbmProfile::where('user_id', Auth::user()->id)->get();\n if ($zbmProfile->count()==0) {\n Auth::logout();\n return redirect()->route('login')->with([\n 'actionError'=>'Zbm Profile must be assigned to this account before usage',\n ]);\n }\n }\n if (Auth::user()->hasRole('ASM')) {\n $asmProfile = AsmProfile::where('user_id', Auth::user()->id)->get();\n if ($asmProfile->count()==0) {\n Auth::logout();\n return redirect()->route('login')->with([\n 'actionError'=>'Asm Profile must be assigned to this account before usage',\n ]);\n }\n }\n if (Auth::user()->hasRole('MD')) {\n $mdProfile = MdProfile::where('user_id', Auth::user()->id)->get();\n if ($mdProfile->count()==0) {\n Auth::logout();\n return redirect()->route('login')->with([\n 'actionError'=>'Md Profile must be assigned to this account before usage',\n ]);\n }\n }\n\n //If a user attempts to access account creation page\n if ($request->is('users/create')) {\n if (!Auth::user()->hasRole('HR')) {\n return redirect()->route('dashboard.index')->with(['authorizationError'=>'Access Denied. You do not have the authorization for the request']);\n } \n }\n\n if ($request->is('rolepermission')) {\n if (!Auth::user()->hasRole('HR')) {\n return redirect()->route('dashboard.index')->with(['authorizationError'=>'Access Denied. You do not have the authorization for the request']);\n } \n }\n if ($request->is('location')) {\n if (!Auth::user()->hasRole('GeoMarketing')) {\n return redirect()->route('dashboard.index')->with(['authorizationError'=>'Access Denied. You do not have the authorization for the request']);\n } \n }\n if ($request->is('retrieve')) {\n if (!Auth::user()->hasRole('HR')) {\n return redirect()->route('dashboard.index')->with(['authorizationError'=>'Access Denied. You do not have the authorization for the request']);\n }\n }\n if ($request->is('targetsprofile')) {\n if (Auth::user()->hasRole('HR') || Auth::user()->hasRole('HQ') || Auth::user()->hasRole('GeoMarketing')) {\n // return $next($request);\n } else {\n return redirect()->route('dashboard.index')->with(['authorizationError'=>'Access Denied. You do not have the authorization for the request']);\n }\n }\n if ($request->is('targets')) {\n if (Auth::user()->hasRole('HR') || Auth::user()->hasRole('GeoMarketing')) {\n return redirect()->route('dashboard.index')->with(['authorizationError'=>'Access Denied. You do not have the authorization for the request']);\n }\n }\n if ($request->is('role/movement/*')) {\n if (!Auth::user()->hasRole('HR')) {\n return redirect()->route('dashboard.index')->with(['authorizationError'=>'Access Denied. You do not have the authorization for the request']);\n }\n }\n $role = Auth::user()->roles()->pluck('name')[0];\n JavaScript::put([\n 'currentRoleFromMaster'=>$role\n ]);\n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n //If user has this permission\n if (Auth::user()->hasPermissionTo('Administer roles & permissions'))\n {\n return $next($request);\n }\n\n if ($request->is('posts/create')) //if user is creating post\n {\n if (!Auth::user()->hasPermissionTo('Create Post'))\n {\n abort('401');\n } else {\n return $next($request);\n }\n }\n\n if ($request->is('posts/*/edit')) //if user editing post\n {\n if (!Auth::user()->hasPermissionTo('Edit Post'))\n {\n abort('401');\n } else {\n $next($request);\n }\n }\n\n if ($request->isMethod('Delete')) //if user deleting post\n {\n if (!Auth::user()->hasPermissionTo('Delete Post'))\n {\n abort('401');\n } else {\n return $next($request);\n }\n }\n\n return $next($request);\n }", "public function access(AccountInterface $account) {\n $tide_config = $this->configFactory->get('tide_authenticated_content.module');\n $jsonapiUserRoutes = $tide_config->get(\"jsonapi_user_route\");\n $currentPath = $this->pathStack->getPath();\n $currentQuery = $this->requestStack->getCurrentRequest()->query;\n $protectRoute = FALSE;\n // Loop through any user based routes that need to be protected.\n foreach ($jsonapiUserRoutes as $jsonapiUserRoute) {\n if (strpos($currentPath, $jsonapiUserRoute) === 0) {\n $protectRoute = TRUE;\n }\n }\n if ($protectRoute) {\n // Check if the user is requesting access via a filter.\n if ($filter = $currentQuery->get('filter')) {\n if (isset($filter[\"anon\"][\"condition\"][\"value\"])) {\n $uid = $filter[\"anon\"][\"condition\"][\"value\"];\n $user = $this->entityManager->getStorage('user')->load($uid);\n }\n }\n // Check if this is an exact user request via JSONAPI.\n $uuid = substr($currentPath, strrpos($currentPath, '/') + 1);\n if (strlen($uuid) == 36) {\n $user = $this->entityManager->getStorage('user')->loadByProperties(['uuid' => $uuid]);\n if (is_array($user)) {\n $user = reset($user);\n }\n }\n if (!empty($user) && $user->id() != 0) {\n // If the current user is requesting their own account, allow it.\n if ($user->id() !== 0 && $user->id() == $account->id()) {\n return AccessResult::allowed();\n }\n return AccessResult::forbidden();\n }\n // If this is the generic user collection route, block it.\n if (!$account->hasPermission('administer users')) {\n return AccessResult::forbidden();\n }\n }\n return AccessResult::allowed();\n }", "public function handle(Request $request, Closure $next)\n {\n // get user roles\n $roles = auth()->user()->roles;\n\n if(auth()->user()->id == 1){\n return $next($request);\n }\n\n // get requested action\n $actionName = class_basename($request->route()->getActionname());\n\n foreach ($roles as $key => $role) {\n \n $modules = $role->modules;\n\n // check if requested action is in modules list\n foreach ($modules as $module)\n {\n if(!empty($module->controller)){\n $_namespaces_chunks = explode('\\\\', $actionName);\n $namespace = end($_namespaces_chunks);\n $controller = explode('@', $namespace);\n\n if (reset($controller) == $module->controller)\n {\n // authorized request\n return $next($request);\n }\n }\n }\n }\n // none authorized request\n return abort(403);\n }", "public function handle($request, Closure $next)\n {\n \tif (Auth::user()->access !== 'editor' || Auth::user()->id === $request->route('id')) {\n\t\t return response()->json(['message' => 'Insufficient Access Level'], 403);\n\t }\n\n \treturn $next($request);\n }", "public function handle($request, Closure $next)\n {\n //\\Auth::user() => object App\\User {...}\n // code kiem tra quyen\n $data1 = \\Auth::check(); //true or false\n $user = \\Auth::user(); // object App\\User {...} or null\n $userID = \\Auth::id(); // userID dang login or null\n // $listRoleIDOfUser = $user->roles->pluck('id')->toArray(); // array chứa all role id cua user\n // $check= in_array(1, $listRoleIDOfUser); //true or false| 1=Admin , 2=User\n // dd($data1, $user,$userID, $listRoleIDOfUser, $check);\n \n if (\\Auth::check() && in_array(1,\\Auth::user()->roles->pluck('id')->toArray())){\n return $next($request);\n }\n return redirect()->back()->with(['error' => 'You do not have permission']);\n }", "public function hasAccess() {\n // This is the TokenAuthUser.\n // The Publisher role is not assigned to the user,\n // it is only used to scope the consumer.\n /** @var \\Drupal\\Core\\Session\\AccountProxyInterface $user */\n $userAccount = $this->currentUser();\n // Verify permission against User entity.\n $userEntity = User::load($userAccount->id());\n if ($userEntity->hasPermission('access publisher')) {\n return new JsonResponse([\n 'access' => TRUE,\n ], 200);\n }\n else {\n return new JsonResponse([\n 'access' => FALSE,\n ], 403);\n }\n }", "public function handle($request, Closure $next)\n {\n $post_user_id = Post::findOrFail($request->post)->user_id;\n if(Auth::user()->id !== $post_user_id && Auth::user()->role->type !== 'admin'){\n abort(403,'Brak dostępu');\n }\n return $next($request);\n }", "public function handle($request, Closure $next, $permissions = null)\n {\n// $permissions = explode('|', $permissions);\n\n if ($request->user() === null) {\n abort(401, 'This action is unauthorized.');\n }\n\n if($request->user()->hasAnyPermission($permissions)){\n return $next($request);\n }\n abort(401, 'This action is unauthorized.');\n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n $user = $request->user();\n\n $rootPath = url('api/user/');\n\n $url = $request->url();\n $method = $request->method();\n\n $features = $user->role->features;\n\n foreach ($features as $feature) {\n $prefix = $rootPath . $feature->prefix;\n $access = json_decode($feature->pivot->access);\n\n $prefixCheck = explode($prefix, $url);\n\n $readCheck = $method === 'GET';\n $createCheck = $method === 'POST' && in_array('c', $access);\n $updateCheck = in_array($method, ['PATCH', 'PUT']) && in_array('u', $access);\n $deleteCheck = $method === 'DELETE' && in_array('d', $access);\n\n $globalCheck = $prefixCheck && ($readCheck || $createCheck || $updateCheck || $deleteCheck);\n\n if ($globalCheck) return $next($request);\n }\n\n return response()->json([\n 'message' => UtilController::message(\"You don't have permission.\", 'danger'),\n ], 403);\n }", "public function handle($request, Closure $next)\n {\n // $user = User::find($request->input('id'));\n // FIXME: temp for dev\n if (env('STAGE') == 'test') {\n return $next($request);\n }\n\n $user = User::find($request->route('id'));\n if (!$user) {\n return response(['error' => 'should have id input']);\n }\n\n $auser = auth()->user();\n if ($auser->id == $user->id || $auser->is_super) {\n return $next($request);\n }\n\n return response(['error' => 'you have no access right to this resource']);\n }", "public function handle(Request $request, Closure $next)\n {\n $logged_flag=false;\n foreach (['buyer','admin','owner'] as $guard){\n $logged_flag=auth($guard)->check();\n if ($logged_flag) {\n Auth::shouldUse($guard);\n break;\n }\n }\n\n if($logged_flag == false){\n return response()->json([\"unauthenticated .\"]);\n }\n\n return $next($request);\n }", "public function authorize() {\n\n\t\t// the anonymous user's id is 0 - user has not logged in.\n\t\tif ($this->user->get('id') === 0) {\n\n\t\t\t// does the user have permission to perform the desired action on the requested model?\n\t\t\tif ( ! $this->user->has_permission($this->model, $this->method)) {\n\n\t\t\t\t// no. does the user have permission to be redirected to the login?\n\t\t\t\tif ($this->user->has_permission($this->model, 'login')) {\n\t\t\t\t\t$response = new Response(303, Config::get('base_uri','/') . 'login');\n\t\t\t\t}\n\t\t\t\t// no. respond with 401.\n\t\t\t\telse {\n\t\t\t\t\t$response = new Response(401, array(\n\t\t\t\t\t\t'error'\t=>\t'You do not have permission to do that.'\n\t\t\t\t\t), $this->format, '401');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// the user's id is something other than 0 - the user has logged in.\n\t\telse {\n\t\t\t// does the user have permission to perform the desired action on the requested model?\n\t\t\tif ( ! $this->user->has_permission($this->uri->get('model'), $this->method)) {\n\t\t\t\t// no. respond with 403.\n\t\t\t\t$response = new Response(403, array(\n\t\t\t\t\t'error'\t=>\t'You do not belong to a group that has permission to do that.'\n\t\t\t\t), $this->format, '403');\n\t\t\t}\n\t\t}\n\n\t\t// if we've made it this far, the user has the proper permissions.\n\t\t//\tnow we check for CSRF on any request that may alter the database.\n\t\tif (in_array($this->method, array('create','update','delete'))) {\n\n\t\t\t// the client must pass a CSRF token.\n\t\t\t$client_token = $this->data['csrf'] || false;\n\n\t\t\t// which must match the token stored in the session.\n\t\t\t$session_token = $this->session['csrf'] || false;\n\n\t\t\t// no client token or tokens that don't match generates an error.\n\t\t\tif ($client_token === false || $client_token !== $session_token) {\n\t\t\t\t$response = new Response(401, array(\n\t\t\t\t\t'error'\t=>\t'Cross Site Request Forgery'\n\t\t\t\t), $this->format, '401');\n\t\t\t}\n\t\t}\n\t}", "public function authorize()\n {\n\n return true;\n\n if ($this->route('self_report')) { // If ID we must be changing an existing record\n return Auth::user()->can('self_report update');\n } else { // If not we must be adding one\n return Auth::user()->can('self_report add');\n }\n\n }", "public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }", "public function handle($request, Closure $next, $guard = 'web')\n { \n\n // dd(Auth::guard('admin')->attempt($credentials,true));\n if (!Auth::guard('admin')->user()) {\n return $next($request);\n }\n \n $validAccess =false;\n $user = Auth::guard($guard)->user();\n $role_type = isset($user->role_type) && $user->role_type?$user->role_type:'Guest';\n $role = \\App\\Role::find($role_type);\n $controllerAction = class_basename(Route::getCurrentRoute()->getActionName());\n list($controller, $action) = explode('@', $controllerAction);\n $routeName = Route::currentRouteName();\n \n $controller = str_replace('Controller', '', $controller);\n \n $permission =$role?(array)json_decode($role->permission):array();\n \n $isControllerExist= key_exists($controller,$permission);\n if($controller && $isControllerExist){\n $accessMode= $permission[$controller];\n $userCanRead= isset($accessMode->read)?true:false;\n $userCanWrite= isset($accessMode->write)?true:false;\n $userCanDelete= isset($accessMode->delete)?true:false;\n switch ($request->method()){\n case 'POST': $validAccess =$userCanWrite;\n break;\n case 'PUT':\n $validAccess =$userCanWrite;\n break;\n case 'PATCH':\n $validAccess =$userCanWrite;\n break;\n case 'DELETE':\n $validAccess =$userCanDelete;\n break;\n case 'GET': \n $validAccess =$userCanRead;\n break;\n default :\n break;\n \n }\n }else if(in_array($controller,array('Admin','Role'))){\n $validAccess=$request->method()=='GET'?true:false;\n }else{\n $validAccess =TRUE; \n }\n \n if($validAccess){\n return $next($request);\n }else{\n $page_title = '403';\n $heading = 'Permission Denied.';\n $sub_page_title = '403';\n $page_action = '403'; \n $route_url = Route::getCurrentRoute()->getPath(); \n return view('packages::errors.403', compact('route_url','heading','page_title', 'page_action','sub_page_title'));\n }\n \n \n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function handle($request, Closure $next)\n { /**/\n if(Auth::user() && CheckAllowedPrivileges::checkUserHasPrivilege(Auth::user()->role_id,5)) {\n if (CheckAllowedPrivileges::checkRevokedPrivilege(Auth::user()->user_id, 5)) {\n return 'Unauthorized: You no longer have this privilege';\n }\n return $next($request);\n }\n if(Auth::user()){\n return \"Unauthorized 401\";\n }\n else{\n return redirect('/auth/user/login');\n }\n }", "public function handle($request, Closure $next)\n {\n $event = Event::find($request->route('id'));\n $user = JWTAuth::parseToken()->authenticate();\n if($event->organization_id != $user->id)\n {\n return response()->json([\n 'status' => \"Access denied. You do not own this resource\"\n ]);\n }\n\n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n $order = Order::find($request->order);\n $userId = $order->user_id;\n\n if(!roles('Administrator'))\n {\n if(Auth::user()->id != $userId)\n return response(view('warnings.unauthorized'));\n }\n\n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n if (Auth::check()) {//if the user is logged in\n if(Auth::user()->user_type_id != 1 && Auth::user()->user_type_id != 2) {//if the user is NOT an admin or receptionist\n \\Session::flash('error', '¡No posee permiso para acceder a esa sección!');\n return redirect('/'); \n } else {//if the user is an administrator or receptionist redirect to the page\n return $next($request);\n }\n } else {//if the user is not logged in\n \\Session::flash('error', '¡Por favor inicie sesión!');\n return redirect('/'); \n }\n }", "public function handle($request, Closure $next)\n {\n // ---------------\n // return $next($request); // no filters set, anyone can access /admin\n // -----------------------\n\n // Easy way to Restrict Access is to use AUTH FACADE\n if(!Auth::check()) \n {\n return redirect('users/login');\n } \n else \n {\n $user = Auth::user(); // Fetch logged in user\n\n if($user->hasRole('manager'))\n {\n return $next($request);\n } \n else\n {\n return redirect('/');\n }\n }\n\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'DELETE':\n {\n return true;\n }\n case 'POST':\n {\n return true;\n }\n case 'PUT':\n {\n if (Auth::user()->hasPermissionTo('post_update', 'blog')) {\n return true;\n } else {\n return true;\n }\n }\n default:\n break;\n }\n return true;\n }", "public function handle($request, Closure $next )\n {\n if( !Auth::check() ){\n return abort(403, 'Bạn không đủ phân quyền để truy cập.');\n }\n $curUser = Auth::guard('user')->user();\n $uid = $request->user;\n if( $curUser->id != $uid ){\n return abort(403, 'Bạn không đủ phân quyền để truy cập.');\n }\n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n $device = device::where('deviceID','=',$request->input('device_id'))->firstOrFail();\n if( $device->user_id == $request->user()->id || $request->user()->role->id == 1){\n return $next($request);\n }\n return response()->json(['Message' => 'Not Allowed To Control This Device'],401);\n \n }", "public function handle($request, Closure $next)\n {\n $me = session('user');\n $role = session('role');\n if (!$me) {\n return redirect('login');\n }\n $auth = session('auth');\n $current = '/' . $request->path();\n $admin = [\n '/user/list', '/user/add',\n '/menu/list', '/menu/add', '/menu/edit',\n '/role/list', '/permission/list', '/oprate/logs',\n '/api/menu/save', '/api/menu/change', '/api/menu/delete',\n '/api/permission/save', '/api/permission/change', '/api/permission/delete',\n '/api/role/save', '/api/role/change', '/api/role/delete', '/api/role/one',\n '/api/user/save','/api/user/delete',\n ];\n $dev = [\n '/demo/table/list','/demo/form/base','/demo/form/advance','/demo/icons',\n ];\n $user_info = ['/user/edit', '/api/user/change', '/api/upload/avatar'];\n if ($current != '//') {\n if (in_array($current, $admin)) {\n if (!in_array(1, $role)) {\n echo 'not admin';\n die;\n }\n } else if (in_array($current, $dev)) {\n if (!in_array(2, $role)) {\n echo 'not developer';\n die;\n }\n } else if (in_array($current, $user_info)) {\n if (!in_array(1, $role) && $request->id != $me['id']) {\n echo 'no permissions';\n die;\n }\n } else if (!in_array($current, $auth)) {\n echo 'forbidden';\n die;\n }\n }\n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n \n // Perform action\n if(isset($_SESSION) && isset($_SESSION['WHILLO']['COMPAnyID']))\n {\n $userid=$_SESSION['WHILLO']['USERID'];\n $companyid=$_SESSION['WHILLO']['COMPAnyID'];\n $type= $companyid=$_SESSION['WHILLO']['TYPE'];\n $res = DB::table('commaster') \n ->where('userId', $userid )\n ->first();\n if($res->accountStatus == 0 && $type=\"C\")\n {\n //return response('frontend.myaccount.companyplans');\n //return redirect()->route('company/choose_plans');\n return redirect('company/choose_plans');\n }\n else if($res->accountStatus == 2 && $type=\"C\")\n {\n //return response('frontend.myaccount.companyplans');\n //return redirect()->route('company/choose_plans');\n return redirect('company/plan_expiry');\n }\n else\n {\n return $next($request);\n }\n } \n return $next($request);\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function handle($request, Closure $next)\n {\n if(Auth::user()->status_account_id == 1) {\n Session::flash('message', 'Sorry You Cannot Access User Teacher !!'); \n Session::flash('alert-class', 'alert-danger'); \n return redirect('app/');\n }\n return $next($request);\n }", "public function authorize()\n {\n if(!isset($this->action)){\n return false;\n }\n\n if($this->action === \"add\"){\n return Auth::guard('api')->check();\n }else if($this->action === \"update\" || $this->action === \"delete\"){\n if(empty($this->income) || Helper::getStringType($this->income) !== \"integer\"){\n return false;\n }\n\n // not existing or deleted\n if(empty((new Income)->income($this->income))){\n return false;\n }\n\n return Income::canModify(Auth::guard('api')->id(), $this->income) && Auth::guard('api')->check();\n }\n\n return false;\n }", "public function handle($request, Closure $next)\n {\n\n $this->repo->find($request->id);\n\n $resource = $this->repo->getModel();\n\n $user = JWTAuth::parseToken()->toUser();\n\n if($resource->doctor->user && $user && $resource->doctor->user->id != $user->id){\n return ApiResponse::Unauthorized(Lang::get(\"dinkoapi.middleware.owner_failed\"));\n }\n\n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n if ($request->user('admin') === null){\n return response('Insufficient permissions',401);\n }\n $actions =$request->route()->getAction();\n $roles =is_array($actions['role'])? $actions['role']:null;\n if ($roles != null){\n $state=false;\n foreach ($roles as $role){\n if($role == Auth::guard('admin')->user()->type){\n $state=true;\n break;\n }\n $state=false;\n }\n if ($state == false){\n return redirect()->back();\n }\n }\n $permissions =is_array($actions['permission'])?$actions['permission']:null;\n if ($request->user('admin')->hasAllPermissions($permissions) || !$permissions){\n return $next($request);\n }\n return redirect()->back();\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n {\n $token_sent = request()->bearerToken();\n\n if (empty(auth()->user()) && !empty($token_sent)) {\n $token = CompanyToken::whereToken($token_sent)->first();\n\n $user = $token->user;\n Auth::login($user);\n }\n\n return auth()->user()->can('create', Invoice::class);\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "function check_user_permissions($request, $actionName = NULL, $id = NULL)\n{\n /* Get currently logged in user */\n $currentUser = $request->user();\n\n /* Current Action Name */\n if ($actionName) {\n $currentActionName = $actionName;\n }\n\n /* Get current controller and method name */\n $currentActionName = $request->route()->getActionName();\n\n /* Get controller and action name from the action name */\n list($controller, $method) = explode('@', $currentActionName);\n $controller = str_replace([\"App\\\\Http\\\\Controllers\\Api\\\\\", \"Controller\"], \"\", $controller);\n\n /* Create, Read, Update, Delete mapping to controller actions */\n $crudPermissionMap = [\n 'create' => ['create', 'store'],\n 'update' => ['edit', 'update'],\n 'delete' => ['destroy', 'restore', 'forceDestroy'],\n 'read' => ['index', 'view'],\n 'cancel' => ['cancelRequest'],\n 'acceptance' => ['acceptDeliveryOffer'],\n ];\n\n foreach ($crudPermissionMap as $permission => $methods) {\n if (in_array($method, $methods)) {\n\n /**\n * If you have a specific restriction you want to make on a user not accessing\n * Another persons resource replicate this code below\n * Retrieve the route parameter check whether the current user id and\n * the foreign id of the user in the resource match, they donot match return a\n * 403 abort error message\n * Turn the down if into an if else\n */\n /*if (from_camel_case($controller) == 'service_request' && in_array($method, ['edit', 'update', 'destroy', 'restore', 'forceDestroy', 'view', 'index'])) {\n\n $id = !is_null($id) ? $id : $request->route('');\n\n // If the current user has no permission to access other people's service requests permission\n // Make sure he/she only modifies his/her service requests\n if (($id) && (!$currentUser->can(\"\") || !$currentUser->can(\"\"))) {\n $serviceRequest = ServiceRequest::find($id);\n if($serviceRequest->customer_id !== $currentUser->id) {\n return false;\n }\n }\n\n }*/\n // If user has no permission donot allow next request\n /*else if (! $currentUser->can(from_camel_case($controller).\".{$permission}\")) {\n return false;\n }*/\n\n if (from_camel_case($controller) == 'service_request' && in_array(\n $method,\n ['edit', 'update', 'destroy', 'restore', 'forceDestroy', 'view', 'index', 'acceptRequest', 'cancelRequest']\n )) {\n if ($request->is('api/services/requests/cancelled')) {\n $id = !is_null($id) ? $id : $request->id;\n\n // If the current user has no permission to access other people's service requests permission\n // Make sure he/she only modifies his/her service requests\n if (($id)) {\n $serviceRequest = ServiceRequest::find($id);\n if ($serviceRequest->customer_id !== $currentUser->id) {\n return false;\n }\n }\n }\n\n\n }\n\n if (from_camel_case($controller) == 'service_delivery_offer' && in_array(\n $method,\n ['edit', 'update', 'destroy', 'restore', 'forceDestroy', 'view', 'index', 'acceptDeliveryOffer']\n )) {\n if ($request->is('api/delivery/offers/acceptance')) {\n $id = !is_null($id) ? $id : $request->id;\n\n // If the current user has no permission to access other people's service requests permission\n // Make sure he/she only modifies his/her service requests\n if (($id)) {\n $serviceDeliveryOffer = ServiceDeliveryOffer::find($id);\n if ($serviceDeliveryOffer->provider_id !== $currentUser->id) {\n return false;\n }\n }\n }\n\n\n }\n\n\n\n break;\n\n }\n }\n\n return true;\n}", "public function handle($request, Closure $next)\n {\n if(Auth::user()->roles_id==1||Auth::user()->roles_id==2){\n return $next($request);\n }else{\n return redirect('/home')->with(['fail'=>'The requested action is not authorised. Contact your teacher/librarian']);\n }\n\n }", "public function handle($request, Closure $next)\n {\n if(\\Auth::check())\n {\n $userId = \\Auth::id(); \n $userRole = Userrole::where('user_id',$userId)->first();\n $role = Role::find($userRole->role_id);\n if($role->name != \"support\")\n {\n return new Response(view('support.login'));\n } \n }\n else\n {\n return new Response(view('support.login')); \n }\n return $next($request);\n }", "public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface\n {\n $user = $this->auth->getUser();\n if (is_null($user)) {\n throw new ForbiddenException();\n }\n return $handler->handle($request->withAttribute('user', $user));\n }", "public function handle($request, Closure $next,$moduel_id,$permission_id)\n {\n\n $role_id=Auth::user()->role_id;\n $data=RolePermission::where('permission_id',$permission_id)\n ->where('role_id',$role_id)\n ->where('moduel_id',$moduel_id)\n ->first();\n if($data){\n return true;\n }else{\n return false;\n }\n\n }", "public function filter() {\n $value = null;\n\n if (func_num_args() > 2) {\n $args = func_get_args();\n $value = array_slice($args, 2)[0];\n }\n\n $userId = $this->getSessionUserId();\n\n if ($this->tokenParam !== false && is_null($userId)) {\n $token = $this->getAccessToken();\n\n if (!empty($token)) {\n $userId = call_user_func($this->getCallback(), $token);\n }\n }\n\n if (!empty($userId)) {\n $ret = $this->acl->isRouteAllowed($userId, $value);\n } else {\n $msg = ($this->tokenParam !== false) ? ' ' . trans('acl-manager-laravel::messages.token_not_found') : '.';\n throw new AclServerErrorException(trans('acl-manager-laravel::messages.userid_not_found') . $msg);\n }\n\n if (!$ret) {\n throw new AclPolicyException($value);\n }\n }", "public function handle(Request $request, Closure $next)\n { \n //can add register path \n if ($request->path()==\"login\" && $request->session()->has(\"user\")) {\n return redirect(\"/crud\");\n }\n\n //no auth user prevent access\n if(($request->is(\"add\") || \n $request->is(\"delete/*\") \n || $request->is(\"edit/*\") \n || $request->is(\"update\")\n || $request->is(\"crud\"))\n && \n !$request->session()->has(\"user\")) {\n return redirect(\"/login\");\n }\n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n //current User\n $currentUser = $request->user();\n\n //get the current action name\n $currentActionName = $request->route()->getActionName();\n //separate controller name and function name \n list($controller, $method) = explode('@', $currentActionName);\n //replace string from this: \"App\\Http\\Controllers\\Backend\\PermissionsController\n // to be like this: Permissions \n $controller = str_replace([\"App\\\\Http\\\\Controllers\\\\Backend\\\\\", \"Controller\"], \"\", $controller);\n \n \n $classesMap = [\n 'Permissions' => 'permission',\n 'Roles' => 'role',\n 'Users' => 'user',\n 'Rooms' => 'room',\n 'Home' => 'home',\n 'Events' => 'event',\n 'Calendar' => 'calendar',\n 'Bookings' => 'booking',\n 'Balance' => 'balance',\n 'Transactions' => 'transaction',\n\n ];\n\n $className = $classesMap[$controller];\n\n //check if te current user has permission\n //dd(\"{$className}-{$method}\");\n if(!$currentUser->isAbleTo(\"{$className}-{$method}\"))\n {\n abort(403, \"Forbidden acces!\");\n }\n\n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n if(!Auth::check()){\n return redirect('/login');\n }\n // teacher 2 \n // student 0\n if(Auth::user()->role==0 || Auth::user()->role==2){\n return redirect('/home');\n }\n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n $response = redirect(action('HomeController@welcome'));\n\n\n $user = $request->user();\n $permissions = [];\n if(isset($user)){\n if( $user->roles() !== null && $user->roles()->first() !== null && $user->roles()->first()->permissions() !== null ){\n $permissions = $user->roles()->first()->permissions()->pluck('name')->toArray();\n }\n else\n return $response;\n }\n \n if($request->route()->getName() == 'employees.index' && in_array('view_employees', $permissions)){\n $response = $next($request);\n }else \n \n if($request->route()->getName() == 'employees.show' && in_array('view_employees', $permissions)){\n \n \n $response = $next($request);\n }else\n\n if($request->route()->getName() == 'employees.create' && in_array('create_employees', $permissions)){\n\n $response = $next($request);\n }else\n\n if($request->route()->getName() == 'employees.store' && in_array('create_employees', $permissions)){\n\n $response = $next($request);\n }else\n\n if($request->route()->getName() == 'employees.edit' && in_array('update_employees', $permissions)){\n \n $response = $next($request);\n }else\n\n if($request->route()->getName() == 'employees.update' && in_array('update_employees', $permissions)){\n \n $response = $next($request);\n }else\n\n if($request->route()->getName() == 'employees.destroy' && in_array('delete_employees', $permissions)){\n \n $response = $next($request);\n }else\n\n if($request->route()->getName() == 'employees_gates_index_ajax' && in_array('view_employees', $permissions)){\n\n $response = $next($request);\n }\n\n else\n {\n flash()->warning('<h3><img src=\"'.asset(\"images/helper_images/logo-accessdenied.png\").'\" width=\"80\"> Ask IT Manager for Permission!</h3>');\n }\n\n return $response;\n }", "public function handle($request, Closure $next)\n {\n $user = $request->user(); \n if ($user && ($user->role_id == 'inventory' || $user->role_id == 'admin') ) {\n return $next($request);\n }else if ($user && $user->role_id == 'hr') {\n return redirect('admin/manpower');\n }else if ($user && $user->role_id == 'venue') {\n return redirect('admin/venue');\n }else if ($user && $user->role_id == 'reservation') {\n return redirect('/admin/reservation');\n }else if ($user && $user->role_id == 'sales') {\n return redirect('/admin/sales');\n }else if ($user && $user->role_id == 'audit') {\n return redirect('/admin/audit');\n }else if ($user && $user->role_id == 'account') {\n return redirect('/admin/user');\n }\n return redirect('/admin');\n \n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function handle($request, Closure $next, $guard = null)\n {\n\t\t$user = Auth::user();\n\n\t\tif (!$user && Session::get('journalist_id')) {\n\t\t\t$user_id = Session::get('journalist_id');\n\t\t\t$user = User::find($user_id);\n\t\t}\n\n if (!$user || $user->role != User::ROLE_JOURNALIST) {\n return redirect()->guest('login');\n }\n\n//\t\tif (!$user || $user->role != User::ROLE_JOURNALIST) {\n//\t\t\treturn redirect('/');\n//\t\t}\n\n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n $result = parent::handle($request, $next);\n $token = $this->auth->setRequest($request)->getToken();\n $user = $this->auth->authenticate($token);\n $currentRoute = $request->route()->getName();\n $userPermissions = $user->userPermissions()->get()->contains(function ($item) use ($currentRoute) {\n return $item->name === $currentRoute;\n });\n\n if ($userPermissions){\n return $result;\n }\n\n return $this->respondUnauthorized(\n 'User has no system access',\n 40118\n );\n }", "public function readmit(User $user, Request $request)\n {\n return $user->isAdmin();\n }", "public function handle(Request $request, Closure $next,...$guards)\n {\n // return dd($guards);\n foreach($guards as $index=>$guard){\n if(Auth::guard($guard)->check()){\n return $next($request);\n }\n }\n // return $next($request);\n return response(['message'=>\"Unauthorzied User Role\"],Response::HTTP_UNAUTHORIZED);\n \n \n \n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function handle($request, Closure $next)\n {\n if (empty($request->session()->get('user'))){\n return redirect()->route('login');\n }\n if(Session::get('user')['user_id'] !== 1){\n// var_dump(Session::get('user')['user_id']);\n// die;\n if(self::hasAuth(Session::get('user')['user_id']) === false) {\n return redirect()->route('error');\n }\n }\n// $auth = Route::current()->getActionName();\n// dump($auth);\n return $next($request);\n }", "public function handle(Request $request, Closure $next)\n {\n //the token is valid we check now the abilities attached\n $u = user();\n\n $role = $u->roles->first();\n\n $abilities = get_site_key('restApi.token_capacities.'.$role->name);\n\n\n $abilities_user = $u->getCurrentAbilities();\n\n if(!array_equal($abilities, $abilities_user)) {\n abort(403);\n }\n\n return $next($request);\n }", "public function authorize() {\n\t\tif (Auth::user()->user_type == \"S\" || Auth::user()->user_type == \"O\") {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tabort(404);\n\t\t}\n\t}", "public function authorize()\n\t{\n\t\t// Compile the rules\n\t\t$this->compile();\n\t\t\t\n\t\t// Check if this user has access to this request\n\t\tif ($this->user_authorized())\n\t\t\treturn TRUE;\n\n\t\t// Set the HTTP status to 403 - Access Denied\n\t\t$this->request->status = 403;\n\n\t\t// Execute the callback (if any) from the compiled rule\n\t\t$this->perform_callback();\n\n\t\t// Throw a 403 Exception if no callback has altered program flow\n\t\tthrow new Kohana_Request_Exception('You are not authorized to access this resource.', NULL, 403);\n\t}", "public function handle($request, Closure $next)\n {\n\n $user = User::where('username', $request->username)->first();\n // dd($request->input('username'));\n $isDel = ((isset($user))?$user->activated:1);\n //$isQuit =((isset($user))?$user->role_id:3);\n if ($isDel==0 ){\n abort(401);\n } \n // elseif ($isQuit==3) {\n \n // }\n else {\n return $next($request);\n }\n \n }", "public function handle(Request $request, Closure $next)\n {\n $allowable = PermissionHelper::allowable();\n\n $route_name = \\Route::currentRouteName();\n\n $contains = \\Str::contains($route_name, $allowable);\n\n if ($contains) { // will has permissions\n $key = PermissionHelper::generateKey($route_name);\n\n $permission = Permissions::where('key', $key)->first();\n if (!$permission) {\n return $next($request);\n }\n\n $user_roles = PermissionHelper::getUserRoles();\n\n if (!count($user_roles)) {\n PermissionHelper::unAuthorized();\n }\n\n $user_roles->load('permissions');\n\n $has_permission = $this->validatePermission($user_roles, $permission);\n\n if (!$has_permission) {\n PermissionHelper::unAuthorized();\n }\n }\n\n return $next($request);\n }", "public function authorize()\n // can access chef member who is 'logined' and 'chefprofile null === false'\n {\n $loginedUser = Auth::user();\n\n return $loginedUser->user_type === 'chef' && (\n\n is_null($loginedUser->chef) === false\n );\n }", "public function handle($request, Closure $next)\n\t{\n\n\t\tif(Entrust::hasRole(['Admin','Project Manager','Project Lead'])){\n\t\treturn $next($request);\n\t}\n\t\telse return view('app')->with('permissionerror',\"You don't have permission to access this page\");\n\t}", "public function handle($request, Closure $next, $permissions)\n {\n $permissions = explode('|',$permissions);\n \n $user = Auth::user();\n\n\n foreach ($permissions as $permission){\n\n if($user->hasPermission($permission)) {\n return $next($request);\n }\n }\n\n Session::flash('error', \"You're Not Authorised for that function!\");\n return redirect('/dashboard');\n }", "public function handle($request, Closure $next, $roles)\n {\n //echo \\Cookie::get(session()->getId());die;\n if(Auth::check())\n {\n $user = Auth::user();\n if($user->hasRole('client')) // ower\n {\n if(in_array($user->roles, explode(\"|\",$roles))) // client\n return $next($request);\n abort(403, 'Unauthorized action.');\n }\n else{\n return $next($request);\n\n }\n }\n else\n return redirect()->route(\"auth.educator\");\n \n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return \\Auth::check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return \\Auth::check();\n }", "public function handle($request, Closure $next){\n\t\t//get users from the requested token\n\t\ttry {\n if (! $user = JWTAuth::parseToken()->authenticate()) {\n return response()->json(['user_not_found'], 404);\n }\n }\n\t\tcatch (Tymon\\JWTAuth\\Exceptions\\TokenExpiredException $e) {\n return response()->json(['token_expired'], $e->getStatusCode());\n }\n\t\tcatch (Tymon\\JWTAuth\\Exceptions\\TokenInvalidException $e) {\n return response()->json(['token_invalid'], $e->getStatusCode());\n }\n\t\tcatch (Tymon\\JWTAuth\\Exceptions\\JWTException $e) {\n return response()->json(['token_absent'], $e->getStatusCode());\n }\n\t\t\n\t\t//get controller from route\n\t\t$currentAction = \\Route::currentRouteAction();\n\t\t\n\t\t//explode the route above into method and controller\n\t\tlist($controller, $method) = explode('@', $currentAction);\n\n\t\t//replace the redundant information\n\t\t$controller = preg_replace('/.*\\\\\\/', '', $controller);\t\n\t\t\n\t\t//check if the requested controller and user's group id are matched\n\t\t$permissionID\t=\tDB::select(\"select permissions.id from permissions, controllers \n\t\t\t\t\t\t\t\t\t\twhere permissions.groupid = ?\n\t\t\t\t\t\t\t\t\t\tand permissions.controllerid = controllers.id\n\t\t\t\t\t\t\t\t\t\tand controllers.name = ?\" \n\t\t\t\t\t\t\t\t\t\t,\t[(int)$user->groupid , $controller]\n\t\t\t\t\t\t\t\t\t); \n\t\t//if nothing found, terminate the request\n\t\tif($permissionID == NULL){\n\t\t\t$returnArray\t=\tarray(\t\"result\"\t=>\tfalse,\n\t\t\t\t\t\t\t\t\t\t\"reason\"\t=>\t\"Permission denied\"\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\treturn response()->json($returnArray , 400);\t\t\t\n\t\t}\n\t\t\n return $next($request);\n }", "public function authorize()\n {\n return $this->user()->can('update', \\App\\Models\\Member::withTrashed()->find($this->id));\n }", "public function handle($request, Closure $next) {\n //check if user is a team member. If user is not, show errors\n if (strtolower(auth()->user()->type) != 'team') {\n abort(403);\n }\n //continue\n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n $roles = array_slice(func_get_args(), 2);\n\n foreach ($roles as $role) {\n if($request->auth->hasRole($role)){\n return $next($request);\n }\n }\n \n return response()->json(['error' => 'Access denied'], 403);\n }", "public function accountInfo(): Response\n {\n // logged in, or are logged in via a remember me cookie\n $this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');\n\n // ...\n }", "public function authorize()\n {\n // all who has permission\n return true;\n }", "public function handle($request, \\Closure $next)\n\t{\n\t\t$userId = Token::getId($request);\n\t\tif($userId != $request->id ) {\n\t\t\t$user = User::find($userId);\n\t\t\tif(!$user->hasRole('admin') && !$user->hasRole('owner')) {\n\t\t\t\treturn response()->error('Unauthorized', 401);\n\t\t\t}\n\t\t}\n\n\t\treturn $next($request);\n\t}", "public function authorize()\n {\n //Get the 'mark' id\n switch ((int) request()->segment(6)) {\n case 0:\n return access()->allow('deactivate-users');\n break;\n\n case 1:\n return access()->allow('reactivate-users');\n break;\n }\n\n return false;\n }", "public function handle($request, Closure $next)\n {\n if (auth()->guard('admin')->check()){\n $user = auth()->guard('admin')->user();\n $routeName = $request->route()->getName();\n $errorMessage = Reply::error('messages.notAllowed');\n $errorView = 'errors.403';\n\n // region Campaigns\n if($routeName == 'admin.campaigns.index' && !$user->ability('admin', 'campaign_view,campaign_view_all'))\n {\n return response()->view($errorView);\n }else if($routeName == 'admin.campaigns.create' && !$user->ability('admin', 'campaign_create'))\n {\n return response()->view($errorView);\n } else if($routeName == 'admin.campaigns.store' && !$user->ability('admin', 'campaign_create'))\n {\n return response()->json($errorMessage);\n } else if($routeName == 'admin.campaigns.edit' && !$user->ability('admin', 'campaign_edit'))\n {\n return response()->view($errorView);\n } else if($routeName == 'admin.campaigns.update' && !$user->ability('admin', 'campaign_edit'))\n {\n return response()->json($errorMessage);\n } else if($routeName == 'admin.campaigns.destroy' && !$user->ability('admin', 'campaign_delete'))\n {\n return response()->json($errorMessage);\n }\n //endregion\n\n // region Staff Member\n if($routeName == 'admin.users.create' && !$user->ability('admin', 'staff_create'))\n {\n return response()->view($errorView);\n } else if($routeName == 'admin.users.store' && !$user->ability('admin', 'staff_create'))\n {\n return response()->json($errorMessage);\n } else if($routeName == 'admin.users.edit' && !$user->ability('admin', 'staff_edit'))\n {\n return response()->view($errorView);\n } else if($routeName == 'admin.users.update' && !$user->ability('admin', 'staff_edit'))\n {\n return response()->json($errorMessage);\n } else if($routeName == 'admin.users.destroy' && !$user->ability('admin', 'staff_delete'))\n {\n return response()->json($errorMessage);\n }\n //endregion\n\n // region Sales Member\n if($routeName == 'admin.sales-users.create' && !$user->ability('admin', 'sales_member_create'))\n {\n return response()->view($errorView);\n } else if($routeName == 'admin.sales-users.store' && !$user->ability('admin', 'sales_member_create'))\n {\n return response()->json($errorMessage);\n } else if($routeName == 'admin.sales-users.edit' && !$user->ability('admin', 'sales_member_edit'))\n {\n return response()->view('errors.403');\n } else if($routeName == 'admin.sales-users.update' && !$user->ability('admin', 'sales_member_edit'))\n {\n return response()->json($errorMessage);\n } else if($routeName == 'admin.sales-users.destroy' && !$user->ability('admin', 'sales_member_delete'))\n {\n return response()->json($errorMessage);\n }\n //endregion\n\n // region Email Templates\n if($routeName == 'admin.email-templates.index' && !$user->ability('admin', 'email_template_view,email_template_view_all'))\n {\n return response()->view($errorView);\n } else if($routeName == 'admin.email-templates.create' && !$user->ability('admin', 'email_template_create'))\n {\n return response()->view($errorView);\n } else if($routeName == 'admin.email-templates.store' && !$user->ability('admin', 'email_template_create'))\n {\n return response()->json($errorMessage);\n } else if($routeName == 'admin.email-templates.edit' && !$user->ability('admin', 'email_template_edit'))\n {\n return response()->view('errors.403');\n } else if($routeName == 'admin.email-templates.update' && !$user->ability('admin', 'email_template_edit'))\n {\n return response()->json($errorMessage);\n } else if($routeName == 'admin.email-templates.destroy' && !$user->ability('admin', 'email_template_delete'))\n {\n return response()->json($errorMessage);\n }\n //endregion\n\n // region Forms\n if($routeName == 'admin.forms.index' && !$user->ability('admin', 'form_view,form_view_all'))\n {\n return response()->view($errorView);\n } else if($routeName == 'admin.forms.create' && !$user->ability('admin', 'form_create'))\n {\n return response()->view($errorView);\n } else if($routeName == 'admin.forms.store' && !$user->ability('admin', 'form_create'))\n {\n return response()->json($errorMessage);\n } else if($routeName == 'admin.forms.edit' && !$user->ability('admin', 'form_edit'))\n {\n return response()->view('errors.403');\n } else if($routeName == 'admin.forms.update' && !$user->ability('admin', 'form_edit'))\n {\n return response()->json($errorMessage);\n } else if($routeName == 'admin.forms.destroy' && !$user->ability('admin', 'form_delete'))\n {\n return response()->json($errorMessage);\n }\n //endregion\n\n // region Import Leads\n\n if($routeName == 'admin.campaigns.import-leads' && !$user->ability('admin', 'import_lead'))\n {\n return response()->view($errorView);\n }else if(($routeName == 'admin.campaigns.import-lead-data' || $routeName == 'admin.campaigns.save-lead-data') && !$user->ability('admin', 'import_lead'))\n {\n return response()->json($errorMessage);\n }\n\n // endregion\n\n // region Export Leads\n\n if(($routeName == 'admin.campaigns.export-leads' ||\n $routeName == 'admin.campaigns.get-export-leads' ||\n $routeName == 'admin.campaigns.download-export-leads'\n ) && !$user->ability('admin', 'export_lead'))\n {\n return response()->view($errorView);\n }\n\n // endregion\n }\n\n return $next($request);\n }", "public function handle($request, Closure $next,...$permissions_array)\n {\n\n foreach($permissions_array as $permission){\n if (!$request->user()->hasPermissions($permission)){\n // return redirect()->back(); \n return abort('403'); \n }\n } \n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n $user = $request->user();\n $articleId = $request->route('articles');\n\n if (!Article::whereId($articleId)->whereAuthorId($user->id)->exists() and !$user->isAdmin()) {\n flash()->error(trans('errors.forbidden') .\":\". trans('errors.forbidden_description'));\n\n return back();\n }\n\n return $next($request);\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->hasAnyRol([\n 'contractor-superadmin',\n 'contractor-manager',\n 'contractor-worker',\n 'contractor-admin',\n ]);\n }", "public function handle($request, Closure $next)\n {\n if (!JWTAuth::user() || JWTAuth::user()->is_admin != true) {\n return response()->json([\n 'success' => false,\n 'message' => 'Sorry, you can not look this article.',\n 'data' => '',\n ], 403);\n }\n return $next($request);\n }", "public function handle($request, Closure $next, $guard = null)\n {\n // if the user is not authenticated\n if (Auth::guard($guard)->guest()) {\n if ($request->ajax() || $request->wantsJson()) {\n return response('Unauthorized.', 401);\n } else {\n return redirect()->guest(route('login'));\n }\n }\n\n // if the user is authenticated, but not a guild member (ie. they were deleted)\n if ( !$this->guild->isApprovedMember(Auth::user()->discord_id) ) {\n Auth::logout();\n return redirect(route('splash'))\n ->with('status', 'Sorry, this area is for guild members only! If you were recently added to the guild, please wait for a GM to approve your account.');\n }\n\n return $next($request);\n }", "public function handle($request, Closure $next, $guard = null)\n {\n $user = $request->user();\n\n if ($this->isAuthorized($user)) {\n return $next($request);\n }\n\n abort(401);\n }", "public function handle($request, Closure $next, $permissions)\n {\n if (1==1) {\n if (!JWTAuth::parseToken()->authenticate()->can($permissions)) {\n // if ($request->ajax()) {\n return response()->json([\n 'status'=> false,\n 'message' => 'no tienes permiso para => '.$permissions\n ],403);\n // }\n }\n } else {\n $guest = Role::whereSlug('guest')->first();\n\n if ($guest) {\n if (!$guest->can($permissions)) {\n if ($request->ajax()) {\n return response('Unauthorized.', 403);\n }\n\n abort(403, 'Unauthorized action.');\n }\n }\n }\n\n return $next($request);\n /*\n echo $user = JWTAuth::parseToken()->authenticate();\n\n $roles = DB::table('roles as r')\n ->join('role_user as ru','r.id','=','ru.role_id')\n ->select('r.slug','r.id')\n ->where('ru.user_id','=', $user->id)->get();\n //$user = User::find(1);\n\n echo \"query\".$roles;\n //echo $user = User::find(1)->roles();\n if ($user) {\n if($roles){\n foreach ($roles as $role) {\n $r = Role::whereSlug($role->slug);\n echo $role;\n if(!$r->can($permissions)){\n return response()->json([\n \"msj\" => \"No autorizado\",\n \"description\" => \"No tienes permiso para \".$permissions\n ],403);\n }else\n return $next($request);\n }\n }\n /* if (!$user->user()->can($permissions)) {\n if ($request->ajax()) {\n return response('Unauthorized.', 403);\n }\n\n abort(403, 'Unauthorized action.');\n }*/\n /* } else {\n $guest = Role::whereSlug('guest')->first();\n\n if ($guest) {\n if (!$guest->can($permissions)) {\n if ($request->ajax()) {\n return response('Unauthorized.', 403);\n }\n\n abort(403, 'Unauthorized action.');\n }\n }\n }\n*/\n }", "public function handle($request, Closure $next)\n { \n //firstly run request to get user data\n $response = $next($request);\n \n \n \n //if has Rbac admin role (version for Zizaco/Entrust regular http RBAC check)\n /* if(!Auth::user()->hasRole('admin')){ \n throw new \\App\\Exceptions\\myException('You have No rbac rights to Admin Panel');\n\t\t}*/\n \n //version for Zizaco/Entrust REST API RBAC check\n $userX = User::where('api_token', '=', $request->bearerToken())->first(); //$request->bearerToken() is an access token sent in headers in ajax\n if(!$userX->hasRole('admin')){ \n //throw new \\App\\Exceptions\\myException('You have No REST API rbac rights to Admin Panel');\n return response()->json(['error' => true, 'data' => 'You have No REST API rbac rights to Admin Panel']);\n }\n\n \n //return $next($request);\n return $response;\n }" ]
[ "0.59198695", "0.58551884", "0.5820321", "0.5749536", "0.57371", "0.5719621", "0.57120746", "0.56859833", "0.56594825", "0.5657772", "0.5640749", "0.56337804", "0.5631338", "0.56286514", "0.56004035", "0.5599671", "0.55985546", "0.55821586", "0.55723053", "0.5567394", "0.55666023", "0.553813", "0.55292606", "0.55145895", "0.5508739", "0.5498305", "0.54947674", "0.54927903", "0.548712", "0.5472826", "0.5471469", "0.5466515", "0.54660505", "0.54594684", "0.5456107", "0.54543966", "0.54452413", "0.5419508", "0.5418252", "0.5407804", "0.54059994", "0.539573", "0.53952456", "0.53926843", "0.5391842", "0.5373086", "0.53650594", "0.53645974", "0.536252", "0.5360474", "0.53551733", "0.535481", "0.5352821", "0.53513783", "0.5351339", "0.53482974", "0.53465766", "0.5344445", "0.5339477", "0.53394186", "0.5333785", "0.5331236", "0.5329772", "0.5328385", "0.53237855", "0.53191525", "0.53167874", "0.5312265", "0.5308721", "0.5308721", "0.53068626", "0.5306756", "0.53056985", "0.5300689", "0.5296274", "0.52948433", "0.5286268", "0.5286258", "0.5282509", "0.5280696", "0.52800643", "0.5279738", "0.5279738", "0.52765095", "0.5276277", "0.52713394", "0.526986", "0.5264961", "0.5264844", "0.52633226", "0.52631474", "0.52625847", "0.5262536", "0.526248", "0.5260759", "0.5260133", "0.52563155", "0.52559704", "0.5254566", "0.52538" ]
0.641371
0
Return true if it's a normal move.
public function isNormal();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isValidMove()\n {\n if ($this->getXCor() != $this->getEndXCor()\n && $this->getYCor() != $this->getEndYCor()\n ) {\n return false;\n }\n\n return true;\n }", "private function beforeMove(): bool\n {\n $event = new MoveEvent();\n $this->trigger(self::EVENT_BEFORE_MOVING, $event);\n\n return $event->canMove;\n }", "protected static function isAllowdMove(array $move){\r\n\t\tif (!empty($move) && self::ALLOWD_MOVE == count($move)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "abstract public function moveAsFirst(): bool;", "private function shouldHookBeMoved(): bool\n {\n return !empty($this->moveExistingTo);\n }", "function tryMove($place){\n if($this->goNoGoForLaunch($place)){\n $this->move($place);\n return TRUE;\n }else{\n return False;\n }\n }", "public function hasMovementType()\n {\n return $this->movement_type !== null;\n }", "public function canMoveDown () {\n\t\treturn $this->canMoveDown;\n\t}", "protected function userMove() {\n echo \"Your move: \";\n $move = FALSE;\n while ($move === FALSE) {\n $move = $this->isValidMove();\n if ($move === FALSE)\n echo $this->promptMessage('invalid_move');\n }\n if (strtoupper($move) == self::QUIT_BUTTON)\n return TRUE;\n\n\n echo \"Your move is '\" . $this->_userMark . \"' at box \" . $move . PHP_EOL;\n $this->_markers[$this->_userMark][] = $move;\n $this->drawBoard($this->_markers);\n if ($this->isWon($this->_userMark) || $this->isBoardFull())\n return TRUE;\n return FALSE;\n }", "function isNormal()\n\t\t{\n\t\t\t$this->value = 0;\n\t\t\tif($this->normalValue === $this->value)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}", "public function canMoveUp () {\n\t\treturn $this->canMoveUp;\n\t}", "protected function computerTurn(){ \r\n\t\t$getMinMaxResult = new MinMax($this); \r\n\t\tif ($getMinMaxResult->move) {\r\n\t\t\treturn $this->_move = $getMinMaxResult->move;\r\n\t\t}\r\n\t\treturn false; \r\n\t}", "public function isNormal() {\n return $this->getStatus() === Status::NORMAL;\n }", "protected function isValidMove($move = NULL) {\n $hasValidMove = FALSE;\n if (isset($move)) {\n if (isset($this->_boardResponse[$move]) && $this->isCellOpen($move))\n return $move;\n return false;\n } else {\n while (TRUE) {\n $move = strtoupper($this->userInput());\n if (isset($this->_boardResponse[$move]) && $this->isCellOpen($move))\n return $move;\n return false;\n }\n }\n }", "private function get_next_move() {\n\t\t$move = $this->can_put_a_card_up();\n\t\tif($move !== false) return $move;\n\t\t\n\t\t// Test si une carte peut être déplacée\n\t\t$move = $this->can_move_cards();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Test si la carte du deck peut descendre\n\t\t$move2 = $this->can_put_deck_card_down();\n\t\tif($move !== false && $move2 !== false) {\n\t\t\tarray_push($move, $move2);\n\t\t\treturn $move;\n\t\t} \n\t\tif($move !== false) return $move;\n\t\tif($move2 !== false) return $move2;\n\t\t\n\t\t// Test si une carte peut être montée suite à un déplacement spécial\n\t\t//$move = $this->can_put_a_card_up_after_move();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Pioche\n\t\t$move = $this->can_turn_from_deck();\n\t\tif($this->infinite_move($move)) return false;\n\t\tif($move !== false) return $move;\n\t\t\n\t\treturn false;\n\t}", "public function isDirectionValid()\n {\n if ($this->_direction == 'up' || $this->_direction == 'down') {\n return true;\n }\n return false;\n }", "abstract public function hasAvailableMoves(): bool;", "public function hasNormal()\n {\n return !empty($this->normalStates);\n }", "public function move(string $direction)\n {\n switch ($direction) {\n case 'E':\n $newXposition = $this->currentXPosition + 1;\n if ($this->room->isCellVisitable($newXposition, $this->currentYPosition)) {\n ++$this->currentXPosition;\n $this->addCellToVisited();\n\n return true;\n } else {\n return false;\n }\n break;\n case 'W':\n $newXposition = $this->currentXPosition - 1;\n if ($this->room->isCellVisitable($newXposition, $this->currentYPosition)) {\n --$this->currentXPosition;\n $this->addCellToVisited();\n\n return true;\n } else {\n return false;\n }\n break;\n case 'S':\n $newYposition = $this->currentYPosition + 1;\n if ($this->room->isCellVisitable($this->currentXPosition, $newYposition)) {\n ++$this->currentYPosition;\n $this->addCellToVisited();\n\n return true;\n } else {\n return false;\n }\n break;\n case 'N':\n $newYposition = $this->currentYPosition - 1;\n if ($this->room->isCellVisitable($this->currentXPosition, $newYposition)) {\n --$this->currentYPosition;\n $this->addCellToVisited();\n\n return true;\n } else {\n return false;\n }\n break;\n default:\n return true;\n break;\n }\n }", "protected function _move($source, $targetDir, $name) {\r\n\t\treturn false;\r\n\t}", "public function hasMovementTimerS()\n {\n return $this->movement_timer_s !== null;\n }", "public function isDraw()\n {\n return !$this->hasAvailableMoves() &&\n !$this->isWinner('X') &&\n !$this->isWinner('O');\n }", "public function checkValidMove($userMove){\r\n if(!is_numeric($userMove) ||$userMove < 1 || $userMove > Board::COLUMNS){ \r\n invalidInputMsg($this->currentPlayer);\r\n return false;\r\n }\r\n return true;;\r\n }", "public function hasMotion()\n {\n return $this->motion !== null;\n }", "private function move() {\n if ($this->facing === 'N') {\n $this->y++;\n } else if ($this->facing === 'E') {\n $this->x++;\n } else if ($this->facing === 'S') {\n $this->y--;\n } else if ($this->facing === 'W') {\n $this->x--;\n }\n \n // Check if we are still on the planet.\n if (($this->x < 0 || $this->x > $this->maxX) || ($this->y < 0 || $this->y > $this->maxY)) {\n // Out of safe planet boundaries.\n $this->crash = true;\n }\n }", "protected function _canMove($case)\n {\n if ($case === '#' || (!$this->bIsBeer && $case === 'X')) {\n return false;\n }\n return true;\n }", "protected function AIMove() {\n $botMove = $this->botMove();\n echo \"Computer's move is '\" . $this->_botMark . \"' at box \" . $botMove . PHP_EOL;\n $this->_markers[$this->_botMark][] = $botMove;\n $this->drawBoard($this->_markers);\n if ($this->isWon($this->_botMark) || $this->isBoardFull())\n return true;\n return false;\n }", "public function gameWon()\n {\n return $this->countStones() === 1;\n }", "public function isInternal() {\n\t\treturn $this->movedTo !== NULL && $this->removed === TRUE;\n\t}", "public function isHit()\n {\n return false;\n }", "public function move($SrcPos, $DestPos) {\n\n\t\tif (is_null($this->_mpd->PLMoveTrack($SrcPos, $DestPos))) { return false; }\n\n \treturn true;\n\t}", "public function issetMovementType(): bool\n {\n return isset($this->movementType);\n }", "public function hasReceivedMoved()\n {\n return (\n $this->_movedSignal instanceof Streamwide_Engine_Signal\n && $this->_movedSignal->getName() === Streamwide_Engine_Signal::MOVED\n );\n }", "public function moveNorth($player) {\n $position = $player->getPosition();\n // check if move is legal if the 'players' field exists there\n if(isset($this->dungeon[$position[0]]->row[$position[1] - 1]->col[$position[2]]->players)) {\n // remove that player from the current position\n $this->removePlayerFromPosition($player, $position);\n array_push($this->dungeon[$position[0]]->row[$position[1] - 1]->col[$position[2]]->players, $player->getName());\n return true;\n }\n return false;\n }", "public function moveToFirstAttribute(): bool\n {\n $moved = FALSE;\n \n if ($this->currentNode instanceof \\DOMElement) {\n $node = $this->currentNode->attributes->item(0);\n \n if ($node instanceof \\DOMAttr) {\n $this->currentNode = $node;\n $moved = TRUE;\n }\n }\n \n return $moved;\n }", "public function isWoman()\n {\n return !$this->isMan();\n }", "public function isWin() {\n\t\tif ($_SESSION['game']->getState()==\"correct\") {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static function checkDirectionIn($token)\n {\n return true;\n }", "function bbps_is_topic_move_enabled(){\n\treturn get_option( '_bbps_enable_topic_move' );\n}", "public function move()\n {\n }", "public function playing(): bool\n {\n\n return $this->state !== SELF::STATE_GAMEOVER;\n }", "public function treeMove($direction) {\n\t\t$model = $this->Controller->modelClass;\n\t\t$check = $this->Controller->{$model}->find('first', array(\n\t\t\t'fields' => array($model . '.id'),\n\t\t\t'conditions' => array($model . '.id' => $this->Controller->data[$model]['id']),\n\t\t\t'recursive' => -1,\n\t\t\t'callbacks' => false\n\t\t));\n\n\t\tif (empty($check[$model]['id'])) {\n\t\t\t$this->Controller->notice(__d('libs', 'Nothing found to move'), array(\n\t\t\t\t'redirect' => false\n\t\t\t));\n\t\t\treturn false;\n\t\t}\n\n\t\t$message = __d('libs', 'Error occured reordering the records');\n\t\tswitch(strtolower($direction)) {\n\t\t\tcase 'up':\n\t\t\t\t$message = __d('libs', 'The record was moved up');\n\t\t\t\tif (!$this->Controller->{$model}->moveUp($check[$model]['id'], abs(1))) {\n\t\t\t\t\t$message = __d('libs', 'Unable to move the record up');\n\t\t\t\t} else {\n\t\t\t\t\t$this->Controller->{$model}->afterSave(false);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'down':\n\t\t\t\t$message = __d('libs', 'The record was moved down');\n\t\t\t\tif (!$this->Controller->{$model}->moveDown($check[$model]['id'], abs(1))) {\n\t\t\t\t\t$message = __d('libs', 'Unable to move the record down');\n\t\t\t\t} else {\n\t\t\t\t\t$this->Controller->{$model}->afterSave(false);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$this->Controller->notice($message, array('redirect' => false));\n\n\t\treturn true;\n\t}", "protected function reachedMaxMoves(){\r\n if($this->totalMoves == $this->board->getMaxMoves()){\r\n return true;\r\n }\r\n return false;\r\n }", "public function moveToFirstChildNode(): bool\n {\n $moved = FALSE;\n $node = $this->currentNode->firstChild;\n \n if ($node instanceof \\DOMNode) {\n $this->currentNode = $node;\n $moved = TRUE;\n }\n \n return $moved;\n }", "public function moveToParentNode(): bool\n {\n $moved = FALSE;\n $node = $this->currentNode->parentNode;\n \n if ($node instanceof \\DOMNode) {\n $this->currentNode = $node;\n $moved = TRUE;\n }\n \n return $moved;\n }", "public function getMove()\n {\n if (array_key_exists(\"move\", $this->_propDict)) {\n return $this->_propDict[\"move\"];\n } else {\n return null;\n }\n }", "public function moveForward ();", "public function testComputerMove()\n {\n $this->assertFalse($this->game->computerMove(3));\n $this->game->startNextTurn();\n $this->assertTrue($this->game->computerMove(3));\n\n // Add points to currentPoints enough to pass treshhold\n // computerMove should return false\n $this->diceHand->addToSerie(6);\n $this->diceHand->addToSerie(6);\n $this->game->checkHand($this->diceHand);\n $this->game->checkHand($this->diceHand);\n $this->assertFalse($this->game->computerMove(3.5));\n }", "public function testMoveMessage()\n {\n $this->assertSame($this->funcForTestMove(), \"\");\n }", "public function isRouted() {\n\t\treturn $this->routed;\n\t}", "public function isMall()\n {\n return false;\n }", "public function setCanMoveUp ($value) {\n\t\tif (is_bool($value)) {\n\t\t\t$this->canMoveUp = $value;\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function move($direction)\n\t{\n\t\t$cid\t= JRequest::getVar('cid', array(), 'post', 'array');\n\n\t\t$row = & JTable::getInstance('frontpage', 'Table');\n\t\tif (!$row->load((int) $cid[0])) {\n\t\t\t$this->setError($this->_db->getErrorMsg());\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$row->move($direction, ' 1 ')) {\n\t\t\t$this->setError($this->_db->getErrorMsg());\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function isHit(): bool;", "public function isForced() : bool {\n return $this->isForced;\n }", "public function impliesPositioningCursorAtTheBeginning()\n {\n return $this->base != 'a';\n }", "public function is_item_normal($itemID) {\n\t\t$itemtype = $this->get_itemtype($itemID);\n\t\treturn ItemMasterItem::is_itemtype_normal($itemtype);\n\t}", "public function isNearestSingleAssignmentMethod()\n {\n return ($this->getSingleAssignmentMethodCode() == 'nearest') ? true : false;\n }", "public function hasNotBeforeMs()\n {\n return $this->not_before_ms !== null;\n }", "public function moveToNextNode(): bool\n {\n $moved = FALSE;\n $node = $this->currentNode->nextSibling;\n \n if ($node instanceof \\DOMNode) {\n $this->currentNode = $node;\n $moved = TRUE;\n }\n \n return $moved;\n }", "public function hasWalking()\n {\n return $this->walking !== null;\n }", "public function isForced()\n {\n return (bool) ($this->get('isForced') > 0);\n }", "function isOver()\n\t{\n\t\tif ($this->won)\n\t\t\treturn true;\n\t\t\t\n\t\tif ($this->over)\n\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t}", "public function hasNotTransformed(): bool\n {\n return !empty($this->notTransformed);\n }", "abstract public function isWalkable();", "function zg_pre_move_ai($game, $game_user, $game_name_full, &$ai_output) {\n\n global $game, $ai_output, $bt_skip;\n\n if (zg_server_is_distressed()) {\n zg_ai_out(zg_get_loadavg(), 'not performing AI moves because load average is');\n return FALSE;\n }\n\n db_set_active();\n lock_init();\n\n if (!lock_acquire('ai_move', 1.0)) {\n zg_slack($game_user, 'bots', 'warning',\n 'not performing AI moves for ' .\n $game_name_full . \" since lock could not be acquired\");\n db_set_active('game_' . $game);\n return FALSE;\n }\n\n db_set_active('game_' . $game);\n $ai_output = '';\n $bt_skip = count(debug_backtrace());\n\n return TRUE;\n}", "public function moveToNextAttribute(): bool\n {\n $moved = FALSE;\n $node = $this->currentNode->nextSibling;\n \n if ($node instanceof \\DOMAttr) {\n $this->currentNode = $node;\n $moved = TRUE;\n }\n \n return $moved;\n }", "public function hasCameraDistance()\n {\n return $this->camera_distance !== null;\n }", "public function testMovementThroughPlayfield ()\n {\n $playfield = (new Canvas(2,2))->getPlayfield();\n $position = $playfield->getAnt()->getPosition();\n\n // Attempt to move in the allowed directions.\n if (0 === $position['y']) {\n $this->assertEquals($playfield->moveAnt('down'), true);\n $this->assertEquals($playfield->moveAnt('up'), true);\n } else {\n $this->assertEquals($playfield->moveAnt('up'), true);\n $this->assertEquals($playfield->moveAnt('down'), true);\n }\n\n if (0 === $position['x']) {\n $this->assertEquals($playfield->moveAnt('right'), true);\n $this->assertEquals($playfield->moveAnt('left'), true);\n } else {\n $this->assertEquals($playfield->moveAnt('left'), true);\n $this->assertEquals($playfield->moveAnt('right'), true);\n }\n\n // Now try to move in an illegal direction.\n $this->assertNotEquals($playfield->moveAnt('diagonal'), true);\n }", "public function has_goal() {\r\n\t\treturn 0 < $this->get( 'goal' );\r\n\t}", "public function MoveFirst()\r\n\t{\r\n\t\t$this->ResetError();\r\n\t\tif( !$this->Seek(0) )\r\n\t\t{\r\n\t\t\t$this->SetError();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->activeRow = 0;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function moveIsValid($m, $n, $board)\n {\n // Guard against out of range m coordinate.\n if ($m < 0 || $m > count($board) - 1) {\n return false;\n }\n\n // Guard against out of range n coordinate.\n if ($n < 0) {\n return false;\n }\n\n return substr($board[$m], $n) != false;\n }", "public function getWinner(){\n $this->game->UpdateStatus();\n if ($this->game->getWinner()!=$this->game->get_current_turn()){\n return false;\n }else{\n return true;\n }\n }", "public function isRidden(): bool\n {\n return $this->rider !== null;\n }", "protected function winCheck($userMove){\r\n // Check if we have reached the minimum steps to have a win\r\n if($this->totalMoves < Board::COLUMNS){\r\n return false;\r\n }\r\n //check vertical Horizontal Positive Diagonal Negative Diagona win\r\n if(($this->checkVerticalWin($userMove)) \r\n || ($this->checkHorizontalWin($userMove))\r\n || ($this->checkPositiveDiagonalWin($userMove))\r\n || ($this->checkNegativeDiagonalWin($userMove))\r\n ){\r\n //winning message \r\n winningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n return;\r\n }\r\n }", "public function setCanMoveDown ($value) {\n\t\tif (is_bool($value)) {\n\t\t\t$this->canMoveDown = $value;\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isFinished()\n {\n return $this->isWinner('X') || $this->isWinner('O') || $this->isDraw();\n }", "public function isModifierPosition($position) {\n if ($this->isNull($position)) {\n return false;\n }\n return $this->dictionary->isModifier($this->words[$position]['word']);\n }", "function is_equal(log_op_move $other): bool {\n return $this == $other;\n }", "public function isEatenUp()\n {\n return $this->eaten >= 100;\n }", "public function checkRang(){\n if($this->_rang <= 0){\n return false;\n }\n return true;\n }", "public function hasPos(){\n return $this->_has(1);\n }", "public function hasPos(){\n return $this->_has(1);\n }", "public function is_rtl() {\n\t\treturn is_rtl();\n\t}", "private function moveToNextLine()\n {\n if ($this->currentLineNb >= count($this->lines) - 1) {\n return false;\n }\n\n $this->currentLine = $this->lines[++$this->currentLineNb];\n\n return true;\n }", "protected function checkMortality()\n {\n if ($this->health <= static::MINIMUM_HEALTH) {\n $this->alive = false;\n $this->health = 0.0;\n }\n\n return $this->alive;\n }", "public function hasMovedTo(array $positions)\n {\n return in_array($this->getHead(), $positions);\n }", "public function valid() : bool\n {\n // dd($this->position >= 65 && $this->position <= 90);\n return $this->position >= 65 && $this->position <= 90;\n }", "public function isGotPromotion()\n {\n return $this->promotion->checkCondition()?true:false;\n }", "function MoveFirst() \n\t{\n\t\tif ($this->_currentRow == 0) return true;\n\t\treturn $this->Move(0);\t\t\t\n\t}", "function MoveFirst() {}", "public function impliesPositioningCursorAtTheEnd()\n {\n return $this->base == 'a';\n }", "public function getConsideredMoves()\n {\n return $this->state->getValidMoves();\n }", "public function isMoveToCartEnabled()\n {\n return (boolean)$this->scopeConfig->getValue(\n self::XML_PATH_MOVE_TO_CART,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "public function shouldSortByDistance()\n {\n return $this->sortByDistance;\n }", "public function isLocked()\n {\n return !!$this->special;\n }", "function movefirst() {\n\t\tif(mysql_data_seek($this->rstemp,0)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function testCannotMoveWhenMove()\r\n {\r\n $this->myTestcar = new Car(new moveCarState());\r\n $this->myTestcar->move();\r\n }", "abstract public function moveAfter(ActiveRecord $model): bool;" ]
[ "0.73498464", "0.7245079", "0.6420864", "0.6253832", "0.6139606", "0.6091213", "0.60480785", "0.6007321", "0.5970578", "0.5961628", "0.5919585", "0.5915018", "0.5771028", "0.56230366", "0.5593105", "0.5588063", "0.55361557", "0.5521612", "0.5503647", "0.55028903", "0.5470142", "0.5455356", "0.54533374", "0.53090566", "0.5306711", "0.53050023", "0.5294099", "0.5281956", "0.5272666", "0.52672905", "0.52563655", "0.5237985", "0.52342", "0.5206141", "0.51928395", "0.51926064", "0.51031315", "0.50964826", "0.50799114", "0.5052596", "0.49624157", "0.4953449", "0.4930537", "0.4930399", "0.49202257", "0.4912783", "0.49109972", "0.490532", "0.48973447", "0.48820636", "0.4879842", "0.4870108", "0.4854947", "0.48448262", "0.48396793", "0.48389757", "0.48340142", "0.48222542", "0.4812324", "0.48025835", "0.47994855", "0.4795436", "0.47937712", "0.47868353", "0.47848514", "0.47848117", "0.47792658", "0.47513762", "0.47463015", "0.47404438", "0.4737578", "0.473573", "0.47324142", "0.47237045", "0.4711627", "0.4701062", "0.4696663", "0.469018", "0.46886525", "0.46874508", "0.46802798", "0.4677316", "0.4677316", "0.46770328", "0.4671448", "0.46713465", "0.46483952", "0.4644501", "0.4640498", "0.46337226", "0.46337155", "0.4622951", "0.46219632", "0.46120304", "0.46103868", "0.46004227", "0.45972344", "0.45970684", "0.45929307" ]
0.53612494
24
Return true if it's a special move.
public function isSpecial();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isValidMove()\n {\n if ($this->getXCor() != $this->getEndXCor()\n && $this->getYCor() != $this->getEndYCor()\n ) {\n return false;\n }\n\n return true;\n }", "private function beforeMove(): bool\n {\n $event = new MoveEvent();\n $this->trigger(self::EVENT_BEFORE_MOVING, $event);\n\n return $event->canMove;\n }", "abstract public function moveAsFirst(): bool;", "abstract public function hasAvailableMoves(): bool;", "private function shouldHookBeMoved(): bool\n {\n return !empty($this->moveExistingTo);\n }", "protected static function isAllowdMove(array $move){\r\n\t\tif (!empty($move) && self::ALLOWD_MOVE == count($move)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function tryMove($place){\n if($this->goNoGoForLaunch($place)){\n $this->move($place);\n return TRUE;\n }else{\n return False;\n }\n }", "protected function userMove() {\n echo \"Your move: \";\n $move = FALSE;\n while ($move === FALSE) {\n $move = $this->isValidMove();\n if ($move === FALSE)\n echo $this->promptMessage('invalid_move');\n }\n if (strtoupper($move) == self::QUIT_BUTTON)\n return TRUE;\n\n\n echo \"Your move is '\" . $this->_userMark . \"' at box \" . $move . PHP_EOL;\n $this->_markers[$this->_userMark][] = $move;\n $this->drawBoard($this->_markers);\n if ($this->isWon($this->_userMark) || $this->isBoardFull())\n return TRUE;\n return FALSE;\n }", "protected function isValidMove($move = NULL) {\n $hasValidMove = FALSE;\n if (isset($move)) {\n if (isset($this->_boardResponse[$move]) && $this->isCellOpen($move))\n return $move;\n return false;\n } else {\n while (TRUE) {\n $move = strtoupper($this->userInput());\n if (isset($this->_boardResponse[$move]) && $this->isCellOpen($move))\n return $move;\n return false;\n }\n }\n }", "public function hasMovementType()\n {\n return $this->movement_type !== null;\n }", "public function canMoveUp () {\n\t\treturn $this->canMoveUp;\n\t}", "private function get_next_move() {\n\t\t$move = $this->can_put_a_card_up();\n\t\tif($move !== false) return $move;\n\t\t\n\t\t// Test si une carte peut être déplacée\n\t\t$move = $this->can_move_cards();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Test si la carte du deck peut descendre\n\t\t$move2 = $this->can_put_deck_card_down();\n\t\tif($move !== false && $move2 !== false) {\n\t\t\tarray_push($move, $move2);\n\t\t\treturn $move;\n\t\t} \n\t\tif($move !== false) return $move;\n\t\tif($move2 !== false) return $move2;\n\t\t\n\t\t// Test si une carte peut être montée suite à un déplacement spécial\n\t\t//$move = $this->can_put_a_card_up_after_move();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Pioche\n\t\t$move = $this->can_turn_from_deck();\n\t\tif($this->infinite_move($move)) return false;\n\t\tif($move !== false) return $move;\n\t\t\n\t\treturn false;\n\t}", "protected function _canMove($case)\n {\n if ($case === '#' || (!$this->bIsBeer && $case === 'X')) {\n return false;\n }\n return true;\n }", "public function move(string $direction)\n {\n switch ($direction) {\n case 'E':\n $newXposition = $this->currentXPosition + 1;\n if ($this->room->isCellVisitable($newXposition, $this->currentYPosition)) {\n ++$this->currentXPosition;\n $this->addCellToVisited();\n\n return true;\n } else {\n return false;\n }\n break;\n case 'W':\n $newXposition = $this->currentXPosition - 1;\n if ($this->room->isCellVisitable($newXposition, $this->currentYPosition)) {\n --$this->currentXPosition;\n $this->addCellToVisited();\n\n return true;\n } else {\n return false;\n }\n break;\n case 'S':\n $newYposition = $this->currentYPosition + 1;\n if ($this->room->isCellVisitable($this->currentXPosition, $newYposition)) {\n ++$this->currentYPosition;\n $this->addCellToVisited();\n\n return true;\n } else {\n return false;\n }\n break;\n case 'N':\n $newYposition = $this->currentYPosition - 1;\n if ($this->room->isCellVisitable($this->currentXPosition, $newYposition)) {\n --$this->currentYPosition;\n $this->addCellToVisited();\n\n return true;\n } else {\n return false;\n }\n break;\n default:\n return true;\n break;\n }\n }", "public function canMoveDown () {\n\t\treturn $this->canMoveDown;\n\t}", "public function checkValidMove($userMove){\r\n if(!is_numeric($userMove) ||$userMove < 1 || $userMove > Board::COLUMNS){ \r\n invalidInputMsg($this->currentPlayer);\r\n return false;\r\n }\r\n return true;;\r\n }", "protected function computerTurn(){ \r\n\t\t$getMinMaxResult = new MinMax($this); \r\n\t\tif ($getMinMaxResult->move) {\r\n\t\t\treturn $this->_move = $getMinMaxResult->move;\r\n\t\t}\r\n\t\treturn false; \r\n\t}", "public function isInternal() {\n\t\treturn $this->movedTo !== NULL && $this->removed === TRUE;\n\t}", "public function hasMovementTimerS()\n {\n return $this->movement_timer_s !== null;\n }", "abstract public function isWalkable();", "public function isSpecial()\n\t{\n\t\t return false;\n\t}", "public function isSpecial()\n\t{\n\t\t return false;\n\t}", "protected function AIMove() {\n $botMove = $this->botMove();\n echo \"Computer's move is '\" . $this->_botMark . \"' at box \" . $botMove . PHP_EOL;\n $this->_markers[$this->_botMark][] = $botMove;\n $this->drawBoard($this->_markers);\n if ($this->isWon($this->_botMark) || $this->isBoardFull())\n return true;\n return false;\n }", "function no_double_moves(int $spareMoves, int $movesX, int $movesO): bool\n{\n return [\n [5, 4],\n [4, 4],\n [4, 3],\n [3, 3],\n [3, 2],\n [2, 2],\n [2, 1],\n [1, 1],\n [1, 0],\n [0, 0],\n ][$spareMoves] === [$movesX, $movesO];\n}", "public function issetMovementType(): bool\n {\n return isset($this->movementType);\n }", "public function isLocked()\n {\n return !!$this->special;\n }", "public function isDraw()\n {\n return !$this->hasAvailableMoves() &&\n !$this->isWinner('X') &&\n !$this->isWinner('O');\n }", "public function testComputerMove()\n {\n $this->assertFalse($this->game->computerMove(3));\n $this->game->startNextTurn();\n $this->assertTrue($this->game->computerMove(3));\n\n // Add points to currentPoints enough to pass treshhold\n // computerMove should return false\n $this->diceHand->addToSerie(6);\n $this->diceHand->addToSerie(6);\n $this->game->checkHand($this->diceHand);\n $this->game->checkHand($this->diceHand);\n $this->assertFalse($this->game->computerMove(3.5));\n }", "function bbps_is_topic_move_enabled(){\n\treturn get_option( '_bbps_enable_topic_move' );\n}", "public function isWin() {\n\t\tif ($_SESSION['game']->getState()==\"correct\") {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isHit()\n {\n return false;\n }", "protected function _move($source, $targetDir, $name) {\r\n\t\treturn false;\r\n\t}", "private function canMoveTo($direction, $i, $j)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\n\t\t\tswitch($direction)\n\t\t\t{\n\t\t\t\tcase 'up':\n\t\t\t\t\t$jump = & $this->board[$i + 1][$j];\n\t\t\t\t\t$dest = & $this->board[$i + 2][$j];\n\t\t\t\t\t$return = array($i + 2, $j);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'right':\n\t\t\t\t\t$jump = & $this->board[$i][$j + 1];\n\t\t\t\t\t$dest = & $this->board[$i][$j + 2];\n\t\t\t\t\t$return = array($i, $j + 2);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'down':\n\t\t\t\t\t$jump = & $this->board[$i - 1][$j];\n\t\t\t\t\t$dest = & $this->board[$i - 2][$j];\n\t\t\t\t\t$return = array($i - 2, $j);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'left':\n\t\t\t\t\t$jump = & $this->board[$i][$j - 1];\n\t\t\t\t\t$dest = & $this->board[$i][$j - 2];\n\t\t\t\t\t$return = array($i, $j - 2);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) // Some board position doesn't exists\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(\t$hole && $hole->hasMarble )\n\t\t{\n\t\t\tif(\t(!empty($jump) && $jump->hasMarble) && (!empty($dest) && !$dest->hasMarble) )\n\t\t\t{\n\t\t\t\treturn $return;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function isSpecial()\n {\n static $special = false;\n\n if ($special === false) {\n $this->resetSpecial();\n $special = true;\n }\n\n return $this->special;\n }", "function tie() {\n for ($i = 0; $i < 9; $i++) {\n if($this->position[$i] == '-') {\n return false;\n }\n }\n return true;\n }", "public function testComplexMove(){\n $gm = new GamesManager();\n\n $game = $this->generateGameObjectWithTwoPlayers();\n\n\n $game->gameState->currentPlayer = 0;\n $game->gameState->isGameGoing = true;\n $game->gameState->selectChecker = false;\n $game->gameState->pickedChecker = [4, 3];\n $game->gameState->possibleGoChoices = [array(\"row\"=>2, \"col\"=>5), array(\"row\"=>4, \"col\"=>3)];\n $game->gameState->boardState = $this->getMultipleBeat();\n\n $gm->userMove(2, 5, 1, $game );\n $gm->userMove(0, 3, 1, $game );\n $gm->userMove(3, 0, 1, $game );\n $result = $gm->userMove(7, 4, 1, $game );\n\n\n $this->assertEquals(0, $result[\"gameState\"]->boardState[4][3]);//initial\n $this->assertEquals(0, $result[\"gameState\"]->boardState[3][4]);//beaten\n $this->assertEquals(-1, $result[\"gameState\"]->boardState[1][6]);//still there due to turkish turn rule\n $this->assertEquals(0, $result[\"gameState\"]->boardState[1][4]);//beaten\n $this->assertEquals(0, $result[\"gameState\"]->boardState[2][1]);//beaten\n $this->assertEquals(0, $result[\"gameState\"]->boardState[4][1]);//beaten\n $this->assertEquals(2, $result[\"gameState\"]->boardState[7][4]);//end position of the hero checker\n\n }", "public function isWoman()\n {\n return !$this->isMan();\n }", "public function isDirectionValid()\n {\n if ($this->_direction == 'up' || $this->_direction == 'down') {\n return true;\n }\n return false;\n }", "public function gameWon()\n {\n return $this->countStones() === 1;\n }", "public function hasWalking()\n {\n return $this->walking !== null;\n }", "public function hasReceivedMoved()\n {\n return (\n $this->_movedSignal instanceof Streamwide_Engine_Signal\n && $this->_movedSignal->getName() === Streamwide_Engine_Signal::MOVED\n );\n }", "function checkWinner($shot){\r\n\t\t\tforeach ( $this->ships as $shipNumber => $ship ) {\r\n\t\t\t\tif( !$ship->isShipSunk() ){\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}", "public function hasPos(){\n return $this->_has(1);\n }", "public function hasPos(){\n return $this->_has(1);\n }", "function pick_move() {\r\n $fill = false;\r\n do {\r\n //picks a random \"-\" spot and will fill it with \"x\" to represent opponent's move\r\n $next = rand(0, 8);\r\n if ($this->position[$next] == '-') {\r\n $this->position[$next] = 'x';\r\n $fill = true;\r\n }\r\n //keep filling until winning condition is found\r\n } while (!$fill);\r\n }", "public function testMoveMessage()\n {\n $this->assertSame($this->funcForTestMove(), \"\");\n }", "public function equals(MoveInterface $otherMove);", "public function isFinished()\n {\n return $this->isWinner('X') || $this->isWinner('O') || $this->isDraw();\n }", "public function isWormhole() : bool {\n return ($this->typeId->id === 1);\n }", "private function findSimpleMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif(\t$hole )\n\t\t\t\t{\n\t\t\t\t\tif($hole->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($this->moveDestinations as $direction)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->canMoveTo($direction, $i, $j))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$moves[] = array(array($direction, $i, $j));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}", "protected function isStick($word)\n {\n return mb_strpos(mb_strtolower($word), 'клюшк') !== false;\n }", "protected function winCheck($userMove){\r\n // Check if we have reached the minimum steps to have a win\r\n if($this->totalMoves < Board::COLUMNS){\r\n return false;\r\n }\r\n //check vertical Horizontal Positive Diagonal Negative Diagona win\r\n if(($this->checkVerticalWin($userMove)) \r\n || ($this->checkHorizontalWin($userMove))\r\n || ($this->checkPositiveDiagonalWin($userMove))\r\n || ($this->checkNegativeDiagonalWin($userMove))\r\n ){\r\n //winning message \r\n winningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n return;\r\n }\r\n }", "public function isHit(): bool;", "protected function reachedMaxMoves(){\r\n if($this->totalMoves == $this->board->getMaxMoves()){\r\n return true;\r\n }\r\n return false;\r\n }", "function isSpecial(){\r\n\t\tif($this->user_type == 'Special'){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function isWellformed(){\n return ($this->toString() === $this->location);\n }", "private function move() {\n if ($this->facing === 'N') {\n $this->y++;\n } else if ($this->facing === 'E') {\n $this->x++;\n } else if ($this->facing === 'S') {\n $this->y--;\n } else if ($this->facing === 'W') {\n $this->x--;\n }\n \n // Check if we are still on the planet.\n if (($this->x < 0 || $this->x > $this->maxX) || ($this->y < 0 || $this->y > $this->maxY)) {\n // Out of safe planet boundaries.\n $this->crash = true;\n }\n }", "public function hasWalkDistance(){\n return $this->_has(6);\n }", "public function playing(): bool\n {\n\n return $this->state !== SELF::STATE_GAMEOVER;\n }", "public function valid() : bool\n {\n // dd($this->position >= 65 && $this->position <= 90);\n return $this->position >= 65 && $this->position <= 90;\n }", "public function isMall()\n {\n return false;\n }", "public function isGotPromotion()\n {\n return $this->promotion->checkCondition()?true:false;\n }", "public function has_goal() {\r\n\t\treturn 0 < $this->get( 'goal' );\r\n\t}", "public static function checkDirectionIn($token)\n {\n return true;\n }", "public function qualifyToStart(): bool;", "public function moveIsValid($m, $n, $board)\n {\n // Guard against out of range m coordinate.\n if ($m < 0 || $m > count($board) - 1) {\n return false;\n }\n\n // Guard against out of range n coordinate.\n if ($n < 0) {\n return false;\n }\n\n return substr($board[$m], $n) != false;\n }", "abstract protected function move($board);", "function is_equal(log_op_move $other): bool {\n return $this == $other;\n }", "function isOver()\n\t{\n\t\tif ($this->won)\n\t\t\treturn true;\n\t\t\t\n\t\tif ($this->over)\n\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t}", "public function isExpectedToken(int $symbol): bool\n {\n $atn = $this->interpreter()->atn;\n /** @var ParserRuleContext $ctx */\n $ctx = $this->ctx;\n $s = $atn->states[$this->getState()];\n $following = $atn->nextTokens($s);\n\n if ($following->contains($symbol)) {\n return true;\n }\n\n if (!$following->contains(Token::EPSILON)) {\n return false;\n }\n\n while ($ctx !== null && $ctx->invokingState >= 0 && $following->contains(Token::EPSILON)) {\n /** @var ATNState $invokingState */\n $invokingState = $atn->states[$ctx->invokingState];\n /** @var RuleTransition $rt */\n $rt = $invokingState->getTransition(0);\n\n $following = $atn->nextTokens($rt->followState);\n\n if ($following->contains($symbol)) {\n return true;\n }\n\n $ctx = $ctx->getParent();\n }\n\n return $following->contains(Token::EPSILON) && $symbol === Token::EOF;\n }", "public function move($SrcPos, $DestPos) {\n\n\t\tif (is_null($this->_mpd->PLMoveTrack($SrcPos, $DestPos))) { return false; }\n\n \treturn true;\n\t}", "public function checkWinning($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') {\n $playerUnit = 'O';\n } else {\n $playerUnit = 'X';\n }\n }\n\n if ($this->checkWiningDiagonal($playerUnit, 'right') || $this->checkWiningDiagonal($playerUnit, 'left') || $this->checkWiningRowColumn($playerUnit, false) || $this->checkWiningRowColumn($playerUnit, true)) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n\n $rightDiagonal = $this->checkWiningDiagonal($playerUnit, 'right', true);\n if (count($rightDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $leftDiagonal = $this->checkWiningDiagonal($playerUnit, 'left', true);\n if (count($leftDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInLeftDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitColumn = $this->checkWiningRowColumn($playerUnit, false, true);\n if ($playerUnitColumn && $playerUnitColumn[0] == true) {\n $coordinates = $this->findEmptyItemInColumn($this->ticTacToeBoard, $playerUnitColumn[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitRow = $this->checkWiningRowColumn($playerUnit, true, true);\n if ($playerUnitRow && $playerUnitRow[0] == true) {\n $coordinates = $this->findEmptyItemInRow($this->ticTacToeBoard,$playerUnitRow[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->checkWinning($playerUnit, true);\n if (empty($this->nextMove)) {\n $this->nextMove($playerUnit);\n }\n }\n\n if ($this->message == \"\") $this->setMessage($player . \" played.\");\n return false;\n }", "function game_check() {\r\n $this->invalid_char = array_diff($this->position, $this->valid_char);\r\n if ($this->grid_size % 2 == 0 || $this->grid_size < 3 || $this->grid_size > 15) {\r\n $this->game_message('invalid-size');\r\n } else if (count($this->invalid_char, COUNT_RECURSIVE) > 0) {\r\n $this->game_message('invalid-character');\r\n } else if (strlen($this->board) <> pow($this->grid_size, 2)) {\r\n $this->game_message('invalid-board');\r\n } else if ($this->board == str_repeat('-', pow($this->grid_size, 2))) {\r\n $this->game_play(true);\r\n $this->game_message('new-game');\r\n } else if (substr_count($this->board, 'x') - substr_count($this->board, 'o') > 1) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-x');\r\n } else if (substr_count($this->board, 'o') - substr_count($this->board, 'x') > 0) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-o');\r\n } else if ($this->win_check('x')) {\r\n $this->game_play(false);\r\n $this->game_message('x-win');\r\n } else if ($this->win_check('o')) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else if (stristr($this->board, '-') === FALSE) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('tie-game');\r\n } else {\r\n $this->pick_move();\r\n if ($this->win_check('o')) {\r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else {\r\n $this->game_play(true);\r\n $this->game_message('ongoing-game');\r\n }\r\n }\r\n }", "private function movement_check($data) {\n if ($this->SQL->GetPlayerData(Session::get('PlayerGUID'))->AP == 0){\n $data['location_err'] = true;\n }\n // Get Player Gameboard location\n $location = $this->SQL->GetPlayerLocation(Session::get('PlayerGUID'));\n // Look up Gameboard data\n $MapData = $this->SQL->GetMap($location->ID);\n // Check if desired destination is in GetMap (stop teleportation)\n $isTooFar = true;\n foreach ($MapData as $value) {\n if ($value->ID == $data['location']){$isTooFar = false;}\n }\n // Set error flag if an error was found\n $data['HAS_ERRORS'] = true;\n if (\n empty($data['location_err']) &&\n $isTooFar == false\n ) {\n $data['HAS_ERRORS'] = false;\n }\n // Return to the controller\n return($data);\n }", "public function automated() : bool;", "public function hasMotion()\n {\n return $this->motion !== null;\n }", "public function hasGmcmd(){\n return $this->_has(16);\n }", "public function getConsideredMoves()\n {\n return $this->state->getValidMoves();\n }", "public function impliesPositioningCursorAtTheBeginning()\n {\n return $this->base != 'a';\n }", "public function getMove()\n {\n if (array_key_exists(\"move\", $this->_propDict)) {\n return $this->_propDict[\"move\"];\n } else {\n return null;\n }\n }", "public function move()\n {\n }", "public function isWormhole() : bool {\n return ($this->scope === 'wh');\n }", "function Move($rowNumber = 0) \n\t{\n\t\tif ($rowNumber == $this->_currentRow) return true;\n\t\t$this->EOF = false;\n \t\tif ($this->_numOfRows > 0){\n\t\t\tif ($rowNumber >= $this->_numOfRows - 1){\n\t\t\t\t$rowNumber = $this->_numOfRows - 1;\n\t\t\t}\n \t\t}\n\n\t\tif (array_key_exists($this->rows,$rowNumber)) {\n\t\t\t$this->_currentRow = $rowNumber;\n\t\t\tif ($this->_fetch()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t$this->fields = false;\t\n\t\t}\n\t\t$this->EOF = true;\n\t\treturn false;\n\t}", "private function enablesDoubleQwirkle(Move $move, Board $board) {\n foreach ($move->lines($board) as $line) {\n if ($line->length() === count(Color::colors()) - 2) {\n $missingPieces = $this->missingPieces($line);\n if ($this->notAccountedFor($missingPieces[0], $board)\n && $this->notAccountedFor($missingPieces[1], $board)) {\n return true;\n }\n }\n }\n return false;\n }", "private function enablesQwirkle(Move $move, Board $board) {\n foreach ($move->lines($board) as $line) {\n if ($line->length() === count(Color::colors()) - 1) {\n $missingPiece = $this->missingPieces($line)[0];\n if ($this->notAccountedFor($missingPiece, $board)) {\n return true;\n }\n }\n }\n return false;\n }", "public function hasJumpTimeS()\n {\n return $this->jump_time_s !== null;\n }", "abstract protected function isGameOver();", "protected function isSpecialName($name)\n {\n return in_array($name, array('default', 'root', 'parent'));\n }", "public function isFinish()\n {\n\t $countSide = $this->getSideCount();\n\n for ($y = 1; $y <= $countSide; $y++) {\n $this->processPositions('Horizontal', $y);\n\t if ($this->winnerType) {\n\t\t return true;\n\t }\n\n $this->processPositions('Vertical', $y);\n\t if ($this->winnerType) {\n\t\t return true;\n\t }\n }\n\n $this->processPositions('LeftBisector');\n\t if ($this->winnerType) {\n\t\t return true;\n\t }\n\n $this->processPositions('RightBisector');\n\t if ($this->winnerType) {\n\t\t return true;\n\t }\n\n\t // All cells fill\n\t if (!in_array(null, $this->kitCells)) {\n\t\t return true;\n\t }\n\n return false;\n }", "function movefirst() {\n\t\tif(mysql_data_seek($this->rstemp,0)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getWinner(){\n $this->game->UpdateStatus();\n if ($this->game->getWinner()!=$this->game->get_current_turn()){\n return false;\n }else{\n return true;\n }\n }", "public function isSunk()\r\n {\r\n return $this->squares == $this->hits;\r\n }", "private function validateSchedulingTimeStep($step) {\n\t\tif ((!isset($this->source[$this->pos - 2]) && !isset($this->source[$this->pos - 3]))\n\t\t\t\t|| (strlen($step) != 1 && strlen($step) != 2)\n\t\t\t\t|| ($this->source[$this->pos - 2] !== '/' && isset($this->source[$this->pos - 3])\n\t\t\t\t\t&& $this->source[$this->pos - 3] !== '/')\n\t\t\t\t|| ($this->source[$this->pos - 2] !== '/' && !isset($this->source[$this->pos - 3]))) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function testGetConsideredMovesReturnsCorrectMoveFromConsideredWithOneBlockSolution()\n {\n //Return True only on $this->moves[2]\n $this->nextState->expects($this->exactly(count($this->moves)))\n ->method('isEndGame')\n ->will($this->onConsecutiveCalls(false, false, true, false, false, false, false, false, false));\n\n $consideredMoves = $this->mockEngine->getConsideredMoves();\n $this->assertNotContains($this->moves[0], $consideredMoves);\n $this->assertContains($this->moves[2], $consideredMoves);\n $this->assertCount(1, $consideredMoves);\n }", "abstract protected function play(array $move = array());", "public function match() {\r\n\t\treturn false;\r\n\t}", "public function allowsWrite()\n {\n if ($this->plus) {\n return true;\n }\n\n return $this->base != 'r';\n }", "public function isKingSafeIfPieceMoved($firstsquare,$lastsquare){\n\t\t$firstsquare_piececode = $this->chessposition[$firstsquare[0]][$firstsquare[1]];\n\t\t$lastsquare_piececode = $this->chessposition[$lastsquare[0]][$lastsquare[1]];\n\t\t$this->chessposition[$firstsquare[0]][$firstsquare[1]] = 0;\n\t\t$this->chessposition[$lastsquare[0]][$lastsquare[1]] = $firstsquare_piececode;\n\t\tif (abs($firstsquare_piececode) == 6)\n\t\t\t$result = $this->IsKingAllowedOnSquare($lastsquare[0], $lastsquare[1]);\n\t\telse\n\t\t\t$result = $this->IsKingAllowedOnSquare($this->kingindex[0], $this->kingindex[1]);\n\t\t$this->chessposition[$firstsquare[0]][$firstsquare[1]] = $firstsquare_piececode;\n\t\t$this->chessposition[$lastsquare[0]][$lastsquare[1]] = $lastsquare_piececode;\n\t\treturn $result;\n\t}", "private function _pass()\n\t{\n\t\t// Save move\n\t\t$this->Move->create();\n\t\t$this->Move->set('game_id', $this->id);\n\t\t$this->Move->set('player_id', $this->data['Game']['active_player']);\n\t\t$this->Move->set('notation', 'pass');\n\t\t$this->Move->save();\n\t\t\n\t\t// Change active player\n\t\t$this->_changeActivePlayer();\n\t\t\n\t\t// Success\n\t\treturn true;\n\t}", "function is_robot()\n {\n return dev::isRobot();\n }" ]
[ "0.73054177", "0.68649215", "0.67157906", "0.6661825", "0.6585481", "0.6514646", "0.65125597", "0.6414061", "0.6243739", "0.61357415", "0.61193675", "0.6025962", "0.5985392", "0.59344375", "0.5776747", "0.57428735", "0.5714055", "0.570844", "0.5604848", "0.5599082", "0.5518907", "0.5518907", "0.55132943", "0.54621935", "0.54409266", "0.5425341", "0.54035807", "0.539614", "0.5386805", "0.5381539", "0.53684616", "0.53609616", "0.53144467", "0.52983856", "0.5289736", "0.52691215", "0.5266851", "0.52664924", "0.52613807", "0.5231401", "0.5223536", "0.5191266", "0.5183977", "0.5183977", "0.5183776", "0.51488554", "0.51428646", "0.5137399", "0.5124561", "0.5121367", "0.51198834", "0.5101998", "0.5093098", "0.50878227", "0.5085025", "0.5077647", "0.50712883", "0.507078", "0.50675327", "0.5040083", "0.50361115", "0.50204563", "0.5006901", "0.49980032", "0.4980425", "0.49763662", "0.49703324", "0.4968978", "0.49651644", "0.4962335", "0.49503753", "0.49497908", "0.49419236", "0.49353763", "0.4932251", "0.49288198", "0.49171576", "0.49155968", "0.49099863", "0.4903905", "0.4895221", "0.4894932", "0.48916158", "0.48899153", "0.48886234", "0.48850667", "0.48763117", "0.4875821", "0.48618358", "0.4853779", "0.4852918", "0.48409453", "0.48404995", "0.48147133", "0.48140776", "0.4813242", "0.4809782", "0.4805721", "0.48042476", "0.4801085" ]
0.54220587
26
Return true if it's a super move.
public function isSuper();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isSuper(): bool\n {\n return $this->hasRole('super');\n }", "public function isSuper() {\n\t\treturn ($this->isAdmin() || $this->Session->read('Acl.isSuper'));\n\t}", "private function beforeMove(): bool\n {\n $event = new MoveEvent();\n $this->trigger(self::EVENT_BEFORE_MOVING, $event);\n\n return $event->canMove;\n }", "public static function isSuper(){\n if ( isset($_SESSION['super']) && ($_SESSION['super'] == 1)){\n return true;\n } else {\n return false;\n }\n }", "public function isSuper()\n {\n return $this->isConfigurable() || $this->isGrouped();\n }", "abstract public function moveAsFirst(): bool;", "private function shouldHookBeMoved(): bool\n {\n return !empty($this->moveExistingTo);\n }", "public function canMoveUp () {\n\t\treturn $this->canMoveUp;\n\t}", "public function isValidMove()\n {\n if ($this->getXCor() != $this->getEndXCor()\n && $this->getYCor() != $this->getEndYCor()\n ) {\n return false;\n }\n\n return true;\n }", "public function isSuperAdmin()\n {\n return ('superadmin' == $this->role);\n }", "public function canMoveDown () {\n\t\treturn $this->canMoveDown;\n\t}", "protected function isSuperAdmin(): bool {\n\t\treturn true;\n\t}", "public function isSuperAdmin() {\n return $this->getGuardUser() ? $this->getGuardUser()->getIsSuperAdmin() : false;\n }", "public function isSuperAdmin()\r\n {\r\n return $this->getGuardUser() ? $this->getGuardUser()->getIsSuperAdmin() : false;\r\n }", "public function isCurrentChild(): bool;", "public function isParent();", "function eSuper() {\n if ($this->flaSuper==1 || $this->flaSuper==\"S\")\n return 1;\n else return 0;\n }", "public function isSuperAdmin() {\n return $this->admin == 2;\n }", "public function isChild(): bool\n {\n return false;\n }", "public function isChild(): bool;", "public function isSuperAdmin()\n {\n return ($this->hasRole(HakAkses::SUPER_ADMIN));\n }", "public function isSuperUser()\n\t{\n\t\treturn $this->hasPermission('superuser');\n\t}", "public function isParent() {\n\t\treturn $this->isParent;\n\t}", "public function isSuperAdmin() : bool\n\t{\n\t\tif ($this->id == VENUS_SUPER_ADMIN_ID) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function isSuperAdmin() {\n return ((int) $this->curUserInfo->is_admin == 1) ? true : false;\n }", "public function isSuperAdmin()\n {\n return in_array($this->type, [self::SUPER_ADMIN_TYPE]);\n }", "public function isChild() {\n\t\treturn $this->_parent !== null;\n\t}", "function is_child($parent) {\n\tglobal $wp_query;\n\tif ($wp_query->post->post_parent == $parent) { $return = true; } else { $return = false; }\n\treturn $return;\n}", "public static function isSuperModerator() {\n return (int)$_SESSION['user']['supermoderator'] === 1;\n }", "public function isAncestor()\n {\n $model_ticket_forwarded_to = self::find()->andWhere(['forwarded_from_id' => $this->id])->one();\n\n return !is_null($model_ticket_forwarded_to);\n }", "public function isInternal() {\n\t\treturn $this->movedTo !== NULL && $this->removed === TRUE;\n\t}", "public function hasActiveSubClass(): bool;", "private function isSuperAdmin()\n {\n return $this->authorizationChecker->isGranted('ROLE_SUPER_ADMIN');\n }", "private function is_parent()\n\t{\n\t\treturn is_null($this->category_id);\n\t}", "function getIsSuperAdmin(){\r\n\t\tif(!isset($this->user->permissions))\r\n\t\t\treturn false;\r\n\t\treturn ($this->user && $this->user->permissions>=11);\r\n\t}", "public function otherOrSelf()\n\t{\n\t\treturn FALSE;\n\t}", "public function canCopy()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn ( !$this->parent() and static::canAddRoot() ) or ( $this->parent() and $this->parent()->canAdd() );\n\t}", "public static function currentUserisParent()\n {\n return (check_user_role('parent')) ? true : false;\n }", "private function isLoggedInAsSuper($request)\n {\n return ($request->session()->has('super') || $request->user()->isSuper());\n }", "protected function computerTurn(){ \r\n\t\t$getMinMaxResult = new MinMax($this); \r\n\t\tif ($getMinMaxResult->move) {\r\n\t\t\treturn $this->_move = $getMinMaxResult->move;\r\n\t\t}\r\n\t\treturn false; \r\n\t}", "public function hasPos(){\n return $this->_has(1);\n }", "public function hasPos(){\n return $this->_has(1);\n }", "public function getIsSuperAdmin()\r\n\t{\r\n\t\tif($this->isGuest) return false;\r\n\t\treturn isset($this->superAdmins[$this->identity->username]);\r\n\t}", "public function isChild()\n {\n if (false === $this->parent_category) {\n return false;\n }\n\n return true;\n\n }", "public function hasParent() {}", "public function qualifyToStart(): bool;", "public function prefixSelf(): bool\n {\n return $this->prefixSelf;\n }", "protected static function check_parent_class( $class ) {\n\t\tif ( is_subclass_of( $class, 'ht_dms\\api\\internal\\actions\\action' ) ) {\n\t\t\treturn true;\n\n\t\t}\n\n\t}", "protected function _canMove($case)\n {\n if ($case === '#' || (!$this->bIsBeer && $case === 'X')) {\n return false;\n }\n return true;\n }", "public function moveToFirstChildNode(): bool\n {\n $moved = FALSE;\n $node = $this->currentNode->firstChild;\n \n if ($node instanceof \\DOMNode) {\n $this->currentNode = $node;\n $moved = TRUE;\n }\n \n return $moved;\n }", "function isSuperAdmin(){\n\t\tif(isset($_SESSION['type']) && $_SESSION['type']=='superadmin'){\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function hasMovementType()\n {\n return $this->movement_type !== null;\n }", "public function isDraggable() {}", "public function getIsParent() {\n\t\treturn $this->isParent;\n\t}", "public function setCanMoveUp ($value) {\n\t\tif (is_bool($value)) {\n\t\t\t$this->canMoveUp = $value;\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isMenu()\n {\n // todo: it might be better to move this method to trait.\n return false;\n }", "public function tieneSuperior(){\n $sql = \"SELECT uid_empresa_superior FROM \". $this->tabla.\"_relacion WHERE uid_empresa_inferior = \".$this->getUID().\" LIMIT 1\";\n $uid = $this->db->query($sql, 0, 0);\n return ( $uid ) ? true : false;\n }", "function hasParent() {\n\t\treturn (bool) ($this->parentID);\n\t}", "public function isSuperUser()\n {\n return $this->superUser;\n }", "public function hasAnotherStep()\n {\n return $this->instance->current_step < (count($this->steps) - 1);\n }", "public function canStick()\n {\n if ($this->isArchived()) {\n return false;\n }\n\n if ($this->container instanceof Space) {\n return ($this->container->isAdmin());\n } elseif ($this->container instanceof User) {\n return (Yii::$app->user->id == $this->container->id);\n }\n\n return false;\n }", "public function isMappedSuperclass()\n {\n return $this->isMappedSuperclass;\n }", "public function getIsSuperAdminAttribute()\n {\n return $this->hasRole(Role::superAdmin());\n }", "public function hasParent()\n {\n }", "public function hasParent();", "public function hasParent();", "public function hasParent();", "public function isInheritance()\n {\n return $this->isInheritance;\n }", "public function impliesPositioningCursorAtTheBeginning()\n {\n return $this->base != 'a';\n }", "public function isChildOfMine(Route $route)\n {\n return (boolean) $this->children[$route->getName()];\n }", "function is_superadmin()\n{\n\tif (! is_login()) {\n\t\treturn false;\n\t}\n\n\tif (isset($_SESSION['_user_role']) &&\n\t\t$_SESSION['_user_role'] == '100'\n\t) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "public function moveToParentNode(): bool\n {\n $moved = FALSE;\n $node = $this->currentNode->parentNode;\n \n if ($node instanceof \\DOMNode) {\n $this->currentNode = $node;\n $moved = TRUE;\n }\n \n return $moved;\n }", "public function beforeSave()\n {\n //Cannot edit role id == 1 because Supper Administrator access all permission\n $auth = Users::getCurrentUser();\n if ($this->is_super_admin == 1 && $auth['is_super_admin'] != 1) {\n return false;\n }\n return true;\n }", "public function hasParent() {\n return isset($this->_parent);\n }", "function tie() {\n for ($i = 0; $i < 9; $i++) {\n if($this->position[$i] == '-') {\n return false;\n }\n }\n return true;\n }", "abstract public function hasAvailableMoves(): bool;", "abstract public function isWalkable();", "public function isSuperAdmin();", "public function isSupervisor() {\n\t\tif ($this->getLevelId() == 1)\n\t\t\treturn true;\n\t\t$groups = $this->getGroups();\n\t\tforeach ($groups as $group){\n\t\t\tif ($group->getGroupId() == 1)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "protected function hasParentMenuItem() {}", "public function hasParent()\n\t{\n\t\treturn !empty($this->parent);\n\t}", "public function isSuperAdmin(){\r\n if($this->user_type == 'SuperAdmin'){\r\n return true;\r\n }\r\n return false;\r\n}", "public function getAllowSubfolderPlacement() : bool\n {\n return $this->getProperty()->allowSubfolderPlacement;\n }", "private function get_next_move() {\n\t\t$move = $this->can_put_a_card_up();\n\t\tif($move !== false) return $move;\n\t\t\n\t\t// Test si une carte peut être déplacée\n\t\t$move = $this->can_move_cards();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Test si la carte du deck peut descendre\n\t\t$move2 = $this->can_put_deck_card_down();\n\t\tif($move !== false && $move2 !== false) {\n\t\t\tarray_push($move, $move2);\n\t\t\treturn $move;\n\t\t} \n\t\tif($move !== false) return $move;\n\t\tif($move2 !== false) return $move2;\n\t\t\n\t\t// Test si une carte peut être montée suite à un déplacement spécial\n\t\t//$move = $this->can_put_a_card_up_after_move();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Pioche\n\t\t$move = $this->can_turn_from_deck();\n\t\tif($this->infinite_move($move)) return false;\n\t\tif($move !== false) return $move;\n\t\t\n\t\treturn false;\n\t}", "function is_parent()\n{ \n global $post;\n\n if ( is_page() && $post->post_parent ) {\n // This is a subpage\n return;\n\n } else {\n // This is not a subpage\n return true;\n }\n \n}", "public function hasChildActions() {}", "public function hasParent()\n {\n return $this->currentParent !== null;\n }", "abstract public function isCurrent();", "public function isSelf(){\n\t\t$db = new DB_WE();\n\n\t\tif($this->ID){\n\t\t\t$count = 0;\n\t\t\t$parentid = $this->ParentID;\n\t\t\twhile($parentid != 0){\n\t\t\t\tif($parentid == $this->ID){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t$parentid = f('SELECT ParentID FROM ' . escape_sql_query($this->_table) . ' WHERE ID=' . intval($parentid), '', $db);\n\t\t\t\t$count++;\n\t\t\t\tif($count == 9999){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isFirstChild(): bool\n {\n return $this->is_first_child;\n }", "final public function allowsParent() {\n\t\treturn true;\n\t}", "function tryMove($place){\n if($this->goNoGoForLaunch($place)){\n $this->move($place);\n return TRUE;\n }else{\n return False;\n }\n }", "public function isChild()\n {\n return $this->parentId != null;\n }", "public function isChildOnly();", "public function accept() {\n\t\t$f = parent::current();\n\t\treturn (\n\t\t\t!$f->isDot()\n\t\t\t&& !$f->isDir()\n\t\t\t&& $f->isExecutable()\n\t\t\t&& ($f->getBasename() !== $this->selfName)\n\t\t);\n\t}", "protected static function isAllowdMove(array $move){\r\n\t\tif (!empty($move) && self::ALLOWD_MOVE == count($move)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function isHit()\n {\n return false;\n }", "public function isOnlyChild(): bool\n {\n if ($this->isFirstChild() === true && $this->isLastChild() === true) {\n return true;\n } else {\n return false;\n }\n }", "public function isWoman()\n {\n return !$this->isMan();\n }", "public function isSuperclassOf($other){\n\t\tif( $other === NULL )\n\t\t\treturn FALSE;\n\t\tif( $this === $other )\n\t\t\treturn FALSE;\n\t\treturn $other->isSubclassOf($this);\n\t}" ]
[ "0.6505717", "0.6404016", "0.63249946", "0.6279315", "0.6269793", "0.6145727", "0.6029503", "0.58672625", "0.5802306", "0.57306886", "0.57066023", "0.5700708", "0.56229925", "0.5618475", "0.55848074", "0.5540841", "0.5534597", "0.55284506", "0.5527662", "0.55159444", "0.5510918", "0.55080795", "0.5488727", "0.5465252", "0.54549295", "0.5389009", "0.5344398", "0.5341271", "0.53311294", "0.5324129", "0.5314008", "0.5306615", "0.5304751", "0.5282925", "0.5280532", "0.5276323", "0.52556604", "0.5247394", "0.52318573", "0.5230613", "0.5180342", "0.5180342", "0.51662", "0.51649594", "0.51602966", "0.5157723", "0.51509535", "0.5147938", "0.5147399", "0.5125114", "0.51194036", "0.5117059", "0.5110758", "0.51105386", "0.5107614", "0.5107265", "0.5092177", "0.50908166", "0.50831825", "0.5082311", "0.50667864", "0.50632334", "0.50592744", "0.50573653", "0.5050486", "0.5050486", "0.5050486", "0.50434136", "0.50321805", "0.5022279", "0.5017696", "0.5016096", "0.50100917", "0.50037605", "0.5000853", "0.5000794", "0.49988848", "0.4996166", "0.49901053", "0.49899703", "0.4979703", "0.49795684", "0.49678797", "0.49607363", "0.49562904", "0.4956259", "0.4952622", "0.49506027", "0.4923787", "0.49223536", "0.49164614", "0.49065897", "0.48994958", "0.4891276", "0.4887489", "0.48828387", "0.48801875", "0.4877032", "0.4867446", "0.4867338" ]
0.6597946
0
Return the type of the move.
public function getType();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMove()\n {\n if (array_key_exists(\"move\", $this->_propDict)) {\n return $this->_propDict[\"move\"];\n } else {\n return null;\n }\n }", "private function get_next_move() {\n\t\t$move = $this->can_put_a_card_up();\n\t\tif($move !== false) return $move;\n\t\t\n\t\t// Test si une carte peut être déplacée\n\t\t$move = $this->can_move_cards();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Test si la carte du deck peut descendre\n\t\t$move2 = $this->can_put_deck_card_down();\n\t\tif($move !== false && $move2 !== false) {\n\t\t\tarray_push($move, $move2);\n\t\t\treturn $move;\n\t\t} \n\t\tif($move !== false) return $move;\n\t\tif($move2 !== false) return $move2;\n\t\t\n\t\t// Test si une carte peut être montée suite à un déplacement spécial\n\t\t//$move = $this->can_put_a_card_up_after_move();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Pioche\n\t\t$move = $this->can_turn_from_deck();\n\t\tif($this->infinite_move($move)) return false;\n\t\tif($move !== false) return $move;\n\t\t\n\t\treturn false;\n\t}", "public function getTipoMovimiento()\n {\n return $this->tipoMovimiento;\n }", "function get_type() \n\t\t{\t\t\n\t\t \t return $thisShift->type;\t\t\n\t\t }", "function positionType()\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n return $this->PositionType;\n }", "public function getType()\n {\n if ($this->isReady) {\n if ($strReturn = $this->matchRegex($this->_strSource, IMDB::IMDB_TYPE, 1)) {\n // some cases there's no info in that place\n if (is_string($strReturn)) {\n $strReturn = str_replace(\"&nbsp;-&nbsp;\", '', $strReturn);\n $strReturn = str_replace(\"&nbsp;\", '', $strReturn);\n $type = trim($strReturn, \" \");\n $isTVSpecial = preg_match('/releaseinfo.+>TV Special \\d+/', $this->_strSource);\n\n return (empty($type) || $isTVSpecial) ? \"Movie\" : $this->typeMap[$type];\n }\n }\n\n throw new IMDBException(\"Can't get type\");\n }\n\n return false;\n }", "public function getWinnerType()\n {\n return $this->winnerType;\n }", "public function getType()\r\n {\r\n return $this->m_type;\r\n }", "public function hasMovementType()\n {\n return $this->movement_type !== null;\n }", "public function getType(){\n return get_class($this->current());\n }", "public function getType()\n {\n return $this->source['type'];\n }", "protected function type()\n {\n $this->match(Lexer::T_TYPE);\n\n return $this->lexer->value();\n }", "public function chooseMove()\n {\n return $this->getMoveFactory()->getMove(array_rand($this->getMoveFactory()->getAvailableMoves()));\n }", "protected function funcForTestMove($type = \"\")\n {\n\n\n $account = $this->getTestUserStub()->getMailAccount(\"dev_sys_conjoon_org\");\n $mailFolderId = \"DRAFTS\";\n $messageItemId = \"989786\";\n $toMailFolderId = \"SENT\";\n $newMessageItemId = \"24\";\n\n $messageKey = new MessageKey($account, $mailFolderId, $messageItemId);\n $folderKey = new FolderKey($account, $toMailFolderId);\n $cmpMessageKey = new MessageKey($account, $toMailFolderId, $newMessageItemId);\n\n $client = $this->createClient();\n\n $rangeList = new Horde_Imap_Client_Ids();\n $rangeList->add($messageKey->getId());\n\n $imapStub = Mockery::mock(\"overload:\" . Horde_Imap_Client_Socket::class);\n $proc = $imapStub->shouldReceive(\"copy\")\n ->with(\n $mailFolderId,\n $toMailFolderId,\n [\"ids\" => $rangeList, \"move\" => true, \"force_map\" => true]\n );\n\n if ($type === \"exception\") {\n $this->expectException(ImapClientException::class);\n $proc->andThrow(new Exception(\"foo\"));\n $client->moveMessage($messageKey, $folderKey);\n } elseif ($type === \"noarray\") {\n $proc->andReturn(false);\n $this->expectException(ImapClientException::class);\n $client->moveMessage($messageKey, $folderKey);\n } else {\n $proc->andReturn([$messageItemId => $newMessageItemId]);\n $res = $client->moveMessage($messageKey, $folderKey);\n $this->assertEquals($res, $cmpMessageKey);\n }\n\n return $type;\n }", "function _get_type() {\n\t\treturn $this->type();\n\n\t}", "function getType()\t { return $this->type;\t }", "function getType() { \n\t\treturn $this->_type; \n\t}", "function getType () {\n\t\treturn $this->type;\n\t}", "function getType() {\n\t\treturn $this->_type;\n\t}", "function getType() { return $this->readType(); }", "public function getType() {\n\t\treturn $this->eventType;\n\t}", "function last_move ()\n {\n return static::$_last_move;\n }", "public function getType() {\n\t\treturn self::$_type;\n\t}", "private function get_type(){\n\t\treturn $this->_type;\n\t}", "function getType() { return $this->_type; }", "function getType() {\n\t\treturn $this->_Type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->_type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->_type;\n\t}", "public function getType()\n {\n\treturn $this->type;\n }", "function getType() ;", "function getType() ;", "function getType() ;", "public function type()\n {\n return $this->_type;\n }", "public function getType()\r\n {\r\n return $this->_type;\r\n }", "public function get_type() {\n return $this->_type;\n }", "function getType() {\n\t\treturn $this->type;\n\t}", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "function type () {\r\n return $this->_type;\r\n }", "public function getType()\n {\n return $this->baseEvent->getType();\n }", "public function getType() {\n return $this->_type;\n }", "public function getType() {\n return $this->_type;\n }", "public function getType() \n {\n return $this->_type;\n }", "public function type() {\n\t\t\treturn $this->_type;\n\t\t}", "public function getType()\n {\n return $this->getResolved()->getType();\n }", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}", "final public function GetExpectedType() { return $this->type; }", "public function get_type(){\n\t\treturn $this->_type;\n\t}", "final protected function get_type() {\n return $this->type;\n }", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public static function move($field_id, $field_move, $field_type)\n\t{\t\t\n\t\t$sql = 'SELECT pf_order\n\t\t\t\tFROM ' . SQL_PREFIX . 'profil_fields\n\t\t\t\tWHERE pf_id = ' . $field_id . '\n\t\t\t\t\tAND pf_type = ' . $field_type;\n\t\t$pf_order = Fsb::$db->get($sql, 'pf_order');\n\t\t\n\t\t$move = intval($pf_order) + $field_move;\n\t\t$sql = 'SELECT pf_order, pf_id\n\t\t\t\tFROM ' . SQL_PREFIX . 'profil_fields\n\t\t\t\tWHERE pf_order = ' . $move . '\n\t\t\t\t\tAND pf_type = ' . $field_type;\n\t\t$result = Fsb::$db->query($sql);\n\t\t$dest = Fsb::$db->row($result);\n\t\tFsb::$db->free($result);\n\t\t\n\t\tif ($dest)\n\t\t{\n\t\t\tFsb::$db->update('profil_fields', array(\n\t\t\t\t'pf_order' =>\t$dest['pf_order'],\n\t\t\t), 'WHERE pf_id = ' . $field_id);\n\t\t\t\n\t\t\tFsb::$db->update('profil_fields', array(\n\t\t\t\t'pf_order' =>\t$pf_order,\n\t\t\t), 'WHERE pf_id = ' . $dest['pf_id']);\n\t\t}\n\t}", "public function GetType()\n {\n return ( $this->type );\n }", "public function getType()\n {\n return $this->_Type;\n }", "public function getType()\n\t{\n\t\treturn empty($this->type) ? $this->guessType() : $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type; \n\n\t}", "public function get_type() {\n\t\treturn $this->type;\n\t}", "function getType();", "function getType();", "function getType();", "function getType();", "function getType();", "public function getType()\n\t\t{\n\t\t\treturn $this->type;\n\t\t}", "public abstract function getType();", "protected abstract function getType();", "public function get_trajectory_type()\n {\n return $this->get_default_property(self::PROPERTY_TRAJECTORY_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function type()\n {\n return $this->type;\n }", "public function type()\n {\n return $this->type;\n }", "public function type()\n {\n return $this->type;\n }", "public function getNextHopType()\n {\n return $this->next_hop_type;\n }" ]
[ "0.6646843", "0.5818897", "0.5778825", "0.5775583", "0.57714504", "0.576759", "0.5518396", "0.5512248", "0.55006105", "0.5498009", "0.5436956", "0.54041797", "0.53889924", "0.53629047", "0.53382635", "0.5328027", "0.5327686", "0.5321066", "0.5318682", "0.5314865", "0.5314283", "0.528539", "0.52841043", "0.5263733", "0.5258349", "0.52559394", "0.52545375", "0.52545375", "0.52499485", "0.524937", "0.52491003", "0.5248895", "0.52420324", "0.52349126", "0.52337164", "0.52302045", "0.5229748", "0.5229748", "0.5229748", "0.5229748", "0.5229748", "0.5229748", "0.5229748", "0.5227635", "0.5225831", "0.52250373", "0.52250373", "0.5225013", "0.5216267", "0.5207344", "0.52068317", "0.52068317", "0.52068317", "0.52068317", "0.5205061", "0.5203246", "0.51955074", "0.51940316", "0.51940316", "0.51940316", "0.51940316", "0.51940316", "0.51940316", "0.51940316", "0.51940316", "0.51940316", "0.51940316", "0.51940316", "0.51940316", "0.5188465", "0.51789623", "0.5178806", "0.51735604", "0.51725453", "0.51723623", "0.51692283", "0.51692283", "0.51692283", "0.51692283", "0.51692283", "0.5163349", "0.51601845", "0.514546", "0.5139796", "0.5135749", "0.5135749", "0.5135749", "0.51351625", "0.51351625", "0.51351625", "0.51351625", "0.51351625", "0.51351625", "0.51351625", "0.51351625", "0.51351625", "0.51351625", "0.51303375", "0.51303375", "0.51303375", "0.5122094" ]
0.0
-1
Return the common name.
public function getName();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_name() {\n\t\treturn 'common';\n\t}", "private function commonNames()\n {\n return [\n\n 'Aphids',\n\n 'Armyworms',\n\n 'Asparagus Beetle',\n\n 'Cabbage Looper',\n\n 'Grasshopper',\n\n 'Psyllid',\n\n 'Slug & Snail',\n\n 'Thrips',\n\n 'Whiteflies',\n\n 'Wireworm',\n\n 'Earwig',\n\n 'Fungus Gnats',\n\n 'Leafminer',\n\n 'Mealybugs',\n\n 'Root Aphids',\n\n 'Russet Mites',\n\n 'Scale Insects',\n\n 'Spider Mites',\n\n 'Thrips',\n\n 'Whiteflies'\n\n ];\n\n }", "public function getServerCertificateCommonName()\n {\n if (array_key_exists(\"serverCertificateCommonName\", $this->_propDict)) {\n return $this->_propDict[\"serverCertificateCommonName\"];\n } else {\n return null;\n }\n }", "private function namebase() {\n return $this->module->name;\n }", "public static function getName() {\n return isset(self::$name)\n ? self::$name\n : (self::$name = base_convert(crc32(self::getBaseDir()),16,32));\n\t}", "public function getName()\n {\n switch ($this->queriedContext) {\n case $this->i8n('context-keyword'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-keyword') . ' : ' . $this->getInput('q');\n break;\n case $this->i8n('context-group'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-group') . ' : ' . $this->getKey('group');\n break;\n case $this->i8n('context-talk'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-talk') . ' : ' . $this->getTalkTitle();\n break;\n default: // Return default value\n return static::NAME;\n }\n }", "public static function get_name() : string ;", "public static function get_name() : string ;", "abstract public function getApplicationName();", "protected function name() {\n\t\treturn strtolower(str_replace('\\\\', '_', get_class($this)));\n\t}", "function getConstName() \n {\n $name = $this->getName();\n \n return strtoupper( $name );\n }", "public function getNodename();", "public function get_name();", "public function get_name();", "public function get_name();", "abstract public function get_name();", "abstract public function get_name();", "abstract public function get_name();", "public static function getName(): string\n {\n return static::$name;\n }", "public function get_name() {\r\n\t\treturn '';\r\n\t}", "static public function getName(): string\n {\n return static::$name;\n }", "static public function getName();", "public static function name()\n {\n return isset(static::$name) ? static::$name : self::getClassShortName();\n }", "function get_name() {\n\t\treturn $this->get_name_from_vtec();\t\n\t}", "public function getApplicationName();", "public function get_name() {\n\t\treturn 'main-clients';\n\t}", "function siteName() {\n\t\treturn $GLOBALS[\"siteName\"];\n\t}", "public static function getName();", "public static function getTitle()\n {\n global $application_name;\n return $application_name;\n }", "function getNameHelper(){\n\treturn 'Ejercicio de aprendizaje';\n}", "public function name() : string\n {\n return call_user_func([get_called_class(), 'resolveName']);\n }", "public static function name()\n {\n return lcfirst(self::getClassShortName());\n }", "public function getInternalName();", "static function Name()\n {\n return self::Variable('SERVER_NAME');\n }", "public function getInternalName()\n {\n return ($this->isGlobal() ? 'g_' : 'f_') . str_replace('\\\\', '_', $this->namespace) . '_' . $this->getName();\n }", "protected static function _getName()\n {\n return isset(static::$_name) ? static::$_name : get_called_class();\n }", "public function getSiteName();", "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 }", "public function getRealName() {}", "abstract public static function getName(): string;", "public function get_name() {\n\t\treturn 'hello-world';\n\t}", "public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}", "private function getClassName() {\n return (new \\ReflectionClass(static::class))->getShortName();\n }", "public function getSconame()\n {\n return $this->sconame;\n }", "private static function get_site_name()\n {\n }", "public function getShareableUsername(): string\n {\n $username = $this->getUsername();\n $discriminator = $this->getDiscriminator();\n return \"${username}#${discriminator}\";\n }", "public function getName() {\r\n\t\treturn self::title;\r\n\t}", "protected function _getClientName() {\n //return \"TEST STRING\";\n $mageVersion = Mage::getVersion();\n $mageVerParts = explode('.', $mageVersion, 2);\n\n $opVersion = Mage::getResourceModel('core/resource')->getDbVersion('upop_setup');\n $opVerParts = explode('.', $opVersion, 2);\n\n $part = array();\n $part[] = self::CONFIG_KEY;\n $part[] = $mageVerParts[0];\n $part[] = $mageVerParts[1];\n $part[] = self::APP_NAME;\n $part[] = $opVerParts[0];\n $part[] = $opVerParts[1];\n return implode(',', $part);\n }", "public function getName(): string\n {\n return self::NAME;\n }", "public function getName(): string\n {\n return self::NAME;\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}", "public function get_name() : string\n {\n return $this->additional['name'] ?? '';\n }", "public function getName()\n {\n return implode(',', $this->components['CN']);\n }", "public function get_name()\n {\n // TODO: Implement get_name() method.\n }", "public static abstract function getName() : string;", "function MyApp_Interface_HEAD_Title()\n {\n $comps=preg_split('/::/',parent::MyApp_Interface_HEAD_Title());\n $keys=array(\"Initials\",\"Name\",\"Title\");\n \n $unit=$this->Unit();\n foreach ($keys as $key)\n {\n $name=$this->GetRealNameKey($unit,$key);\n \n if (!empty($name))\n {\n array_push($comps,$name);\n break;\n }\n }\n \n $event=$this->Event();\n foreach ($keys as $key)\n {\n $name=$this->GetRealNameKey($event,$key);\n \n if (!empty($name))\n {\n array_push($comps,$name);\n break;\n }\n }\n\n return join(\"::\",array_reverse($comps)); \n }", "public function get_name()\n {\n }", "public function get_name()\n {\n }", "public function className()\n {\n return static::CONSTANCE_CLASS;\n }", "public abstract function getName();", "public function getCompleteName()\n {\n return $this->namespace . '\\\\' . $this->name;\n }", "public function getComponentName()\n {\n $component = $this->argument('component') ?: app('components')->getUsedNow();\n\n $component = app('components')->findOrFail($component);\n\n return $component->getStudlyName();\n }", "public function getFileName()\n {\n return $this->prefix.$this->scope.'_'.$this->comName;\n }", "public static function getName()\n {\n }", "public abstract function get_amd_name();", "protected function getComponentName(): string {\n if ($this->isPageTemplate()) {\n return \"{$this->layout}-{$this->post->post_type}\";\n }\n\n if (str_contains($this->componentId, '-')) {\n return implode('', \\__::chain($this->componentId)\n ->split('-')\n ->map(fn ($string) => \\__::capitalize($string))\n ->value());\n }\n\n return \\__::chain($this->componentId)\n ->camelCase()\n ->capitalize()\n ->value();\n }", "public function getName()\n {\n return '';\n }", "public function getName()\n {\n return '';\n }", "public function getName(): string\n {\n return static::class;\n }", "public function getName()\n {\n return $this->str_name;\n }", "public function getPackagedName()\n {\n return Generator::getPackageName() . $this->getContextualPart() . ucfirst(self::uniqueName($this->getCleanName(), $this->getContextualPart()));\n }", "function get_application_name()\r\n {\r\n return self :: APPLICATION_NAME;\r\n }", "function get_application_name()\r\n {\r\n return self :: APPLICATION_NAME;\r\n }", "function get_application_name()\r\n {\r\n return self :: APPLICATION_NAME;\r\n }", "public function getFullname(): string\n {\n return $this->product->lang->title . ' ' . $this->lang->title;\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 getName()\n {\n $class = get_class($this);\n\n return str_replace($this->getObjectType(), '',\n str_replace(CADRE_appNameSpace.$this->getObjectTypePlural().'\\\\', '', $class));\n }", "function basel_compare_cookie_name() {\n\t\t$name = 'basel_compare_list';\n\n\t\tif ( is_multisite() ) {\n\t\t\t$name .= '_' . get_current_blog_id();\n\t\t}\n\n\t\treturn $name;\n\n\t}", "abstract function getName();", "public static function getName()\n\t{\n\t\treturn static::getMessage('NAME');\n\t}", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "abstract public function getName();", "protected function filterName(): string\n {\n return Str::snake(class_basename($this));\n }", "public function get_name() {\n\t\treturn esc_html__( $this->title, 'dashwp' );\n\t}", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function 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 }" ]
[ "0.88629067", "0.729078", "0.7201265", "0.697414", "0.6943736", "0.68064225", "0.67835194", "0.67835194", "0.6780109", "0.6769386", "0.67483836", "0.674683", "0.669805", "0.669805", "0.669805", "0.66906565", "0.66906565", "0.66906565", "0.66632766", "0.6621132", "0.66174316", "0.66168946", "0.6604922", "0.6576389", "0.6539723", "0.653883", "0.65277433", "0.65241385", "0.65169424", "0.65091985", "0.64933753", "0.6473886", "0.6461106", "0.6453741", "0.6452527", "0.6450828", "0.6450749", "0.6445548", "0.64309967", "0.6429991", "0.64221954", "0.6411628", "0.63934875", "0.6390882", "0.6369429", "0.63639516", "0.6353386", "0.6321197", "0.6313639", "0.6313639", "0.63109165", "0.63109165", "0.63100076", "0.63059175", "0.6303223", "0.6297807", "0.62857276", "0.6281746", "0.62810534", "0.62670225", "0.625154", "0.6251186", "0.6248203", "0.6245508", "0.6237482", "0.62370896", "0.6234525", "0.62330747", "0.62330747", "0.62291896", "0.622706", "0.6226214", "0.62254936", "0.62254936", "0.62254936", "0.6225215", "0.6216389", "0.62115633", "0.6210434", "0.6198672", "0.6198004", "0.61972547", "0.61972547", "0.61972547", "0.61972547", "0.61972547", "0.61972547", "0.61972547", "0.61972547", "0.61972547", "0.61972547", "0.61972547", "0.61944795", "0.61940277", "0.61891854", "0.61891854", "0.61891854", "0.61891854", "0.61891854", "0.61891854", "0.61891854" ]
0.0
-1
Return the initial position of the character.
public function getInitialPosition();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCharStart();", "public function getFirstCharIndex() {}", "public function findFirstPosition()\n {\n $string = readline(\"Please enter a string to find the first position of character 'a' (ex: mystringwitha) : \");\n $str = \"\\n\\n Input String: \" . $string;\n \n // as per current requirement, desired character was a\n // we can make this character dynamic as method will work in both ways\n $position = $this->getPosition($string, 'a');\n $str .= \"\\n Character Position: \" . $position;\n return $str;\n }", "function alphabet_position($char) {\r\n\t$asc = ord($char);\r\n\r\n\tif ($asc >= 65 and $asc <= 90) {\r\n\t\treturn $asc - 65;\r\n\t}\r\n\telse if ($asc >= 97 and $asc <= 122) {\r\n\t\treturn $asc - 71;\r\n\t}\r\n\telse {\r\n\t\treturn false;\r\n\t}\r\n}", "public function getDefaultChar() {}", "public function getStartPosition()\n\t{\n\t\treturn -1;\n\t}", "public function getStartPosition()\n\t{\n\t\treturn $this->startPosition;\n\t}", "public function getInitialSequence()\n {\n return $this->initial_sequence;\n }", "public function getOffsetStart()\n\t{\n\t\treturn $this->start + 1;\n\t}", "private function GetPreviousChar() {\n\t\tif ($this->positionInFile > 0)\n\t\t\t$this->positionInFile--;\n\n\t\treturn $this->ReadChar($this->file);\n\t}", "public function getCaretOffset() {}", "public function FirstCharacter() {\n\t\t$ch = substr($this->Title, 0, 1);\n\t\tif (is_numeric($ch)) {\n\t\t\treturn '#';\n\t\t} else {\n\t\t\treturn strtolower($ch);\n\t\t}\n\n\t}", "public function getLastCharIndex() {}", "public function getCodePosition() {\n return $this->codeAtEnd ? self::END : self::START;\n }", "public function getStartOffset() {}", "protected function getX0($char)\n\t{\n\t\t$int = $this->convertCharToDecimal($char);\n\n\t\treturn ($int % $this->shapesCountX) * $this->shapeX;\n\t}", "public function getStartPosition() {\r\n return $this->startPosition;\r\n }", "function getPosition() {\n return sprintf(\"%010d\", $this->_position);\n }", "public function getSuperscriptXOffset() {}", "public function getInitial()\n {\n return $this->initial;\n }", "private function findInitialTokenPosition( $input )\n\t{\n\t\t$pos = 0;\n\n\t\t// search for first valid annotation\n\t\twhile ( ( $pos = strpos( $input, '@', $pos ) ) !== false )\n\t\t{\n\t\t\t// if the @ is preceded by a space or * it is valid\n\t\t\tif ( $pos === 0 || $input[$pos - 1] === ' ' || $input[$pos - 1] === '*' )\n\t\t\t\treturn $pos;\n\n\t\t\t$pos++;\n\t\t}\n\n\t\treturn null;\n\t}", "function getInitialValue () {\n\t\treturn $this->initialValue;\n\t}", "public static function initial(string $filename = \"<input>\"): Position\n {\n return new Position($filename, 1, 1);\n }", "protected function get_offset(): int\n\t{\n\t\treturn $this->start;\n\t}", "public function getFirstLetter()\n {\n return $this->data['fields']['first_letter'];\n }", "public function get_position()\n {\n\n if ( $file = fopen($this->path,\"r\") ) {\n\n $string_number = 0;\n $position = 0;\n while(($line = fgets($file,4096)) !== false && !$position) {\n\n $string_number++;\n if(strpos($line,$this->str) !== false) {\n\n $position = strpos($line,$this->str);\n }\n }\n echo 'номер строки: ' . $string_number . ', позиция: ' . ($position+1);\n\n } else {\n\n echo 'ничего не вышло';\n\n }\n\n }", "public static function getNextNotWhiteChar($content,$pos)\r\n\t{\r\n\t\t$len = strlen($content);\r\n\t\t//Get next char\r\n\t\twhile($pos < $len && ($content[$pos] === ' ' || $content[$pos] === \"\\t\" || $content[$pos] === \"\\n\" || $content[$pos] === \"\\0\"))\r\n\t\t\t{$pos++;}\r\n\t\treturn $pos;\r\n\t}", "public function getLineCharacter(): string\n {\n return $this->lineCharacter;\n }", "public function current(): string\n {\n // Clamp the position to 0 so we don't go 'behind'' the first character\n $position = max(0, $this->position - 1);\n\n return substr($this->string, $position, 1);\n }", "public function getMinimumOffset() {\r\n return $this->minimumOffset;\r\n }", "public function getLastCharacter()\n {\n return $this->last_character;\n }", "public function getStartColumn()\n {\n return $this->start_column;\n }", "protected function _findStartOffset() {}", "function GetStart()\n {\n $this->Set_Getvar_val();\n $this->start = (($this->getvar_val-1)*$this->length);\n }", "public function getStartCursor()\n {\n return $this->start_cursor;\n }", "public function getStartLine(): int\n {\n return $this->node->getStartLine();\n }", "public function getStartBeginning();", "function getCharNumber(&$text) {\n\t\tif ($this->_currentClass == self::CLASS_B)\n\t\t{\n\t\t\t$retval = ord($text[0]) - 32;\n\t\t\t$text = substr($text, 1);\n\t\t}\n\t\telse if ($this->_currentClass == self::CLASS_C)\n\t\t{\n\t\t\t$retval = intval(substr($text, 0, 2));\n\t\t\t$text = substr($text, 2);\n\t\t}\n\t\treturn $retval;\n\t}", "public function getStartLine(): int\n {\n return $this->node->getAttribute('startLine');\n }", "function get_begin()\n {\n return $this->get_default_property(self :: PROPERTY_BEGIN);\n }", "public function peek(): string\n {\n // Grab the next character\n $next = substr($this->string, $this->position, 1);\n\n // Do not advance the pointer\n return $next;\n }", "protected function get() {\n $c = $this->lookAhead;\n $this->lookAhead = null;\n\n if ($c === null) {\n if ($this->inputIndex < $this->inputLength) {\n $c = substr($this->input, $this->inputIndex, 1);\n $this->inputIndex += 1;\n } else {\n $c = null;\n }\n }\n\n if ($c === \"\\r\") {\n return \"\\n\";\n }\n\n if ($c === null || $c === \"\\n\" || ord($c) >= self::ORD_SPACE) {\n return $c;\n }\n\n return ' ';\n }", "public function getPosition(): string;", "public function getCharacter() {\n return $this->character;\n }", "public function getInitialMarking() {\n\t\treturn $this->initialMarking;\n\t}", "public function getTextPosition()\n\t{\n\t\treturn $this->textPosition;\n\t}", "public function getStartIndex()\n {\n return $this->start_index;\n }", "public function getPosition() : int\n {\n $rtn = $this->data['position'];\n\n return $rtn;\n }", "public function getPosX($c)\n {\n $x = $this->getWidthOfBorder();\n\n # Beim 1. Feld brauchen wir sonst keinen Abstand\n if($c == 1)\n {\n $x += 0;\n }\n if($c >= 2)\n {\n $x += $this->getFieldsWidthBrutto() * ($c-1);\n }\n if($c >= 3)\n {\n $x += 12;\n }\n if($c >= 5)\n {\n $x += 12;\n }\n\n # Offset left zu x dazu\n $x += $this->getFieldsOffsetLeft();\n\n # Richtiger X Wert wird zurückgegeben\n return $x;\n }", "function first_space_before(string $string, int $offset = null) {\n\treturn mb_strrpos(substr($string, 0, $offset), ' ') + 1;\n}", "function letter2Index(string $letter): int\n{\n // Could add a check if the letter is uppercase\n return ord($letter) - ord('a');\n}", "public function getFirstCompletionAt()\n {\n return $this->firstCompletionAt;\n }", "public function get_start_offset()\n {\n }", "function char_at_position($n) {\r\n\tif ($n >= 0 and $n <= 25) {\r\n\t\treturn chr($n + 65);\r\n\t}\r\n\telse if ($n >= 26 and $n <= 51) {\r\n\t\treturn chr($n + 71);\r\n\t}\r\n\telse {\r\n\t\treturn false;\r\n\t}\r\n}", "public function getMinchar() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(2, $this->_result)) return (string) $this->_result[2];\n\t\t\telse parent::throwGetColException('Not set CampaignDefinitionsModel::getMinchar', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From CampaignDefinitionsModel::getMinchar', __LINE__, __FILE__);\n\t}", "function char_pre($chars)\n\t{\n\t\tglobal $wowdb, $roster_conf, $addon_conf, $wordings;\n\t\t\n\t}", "private function getPosition($string, $character = 'a', $position = 1)\n {\n if (!isset($string[$position - 1]))\n return 'N/A';\n else if ($string[$position - 1] == $character)\n return $position;\n \n return $this->getPosition($string, $character, ++$position);\n }", "public function current() : string\n {\n return chr($this->position);\n }", "public function getStart(): int\n {\n return $this->start;\n }", "public function getStart(): int\n {\n return $this->start;\n }", "public function getStart(): int\n {\n return $this->start;\n }", "public function key() : int\n {\n return $this->position - 65;\n }", "function substrBefore($string,$char) {\n $pos = strpos($string, $char);\n if($pos===false) {return $string;}\n else {return substr($string, 0, $pos);}\n}", "public static function getAlphabeticalPosition(string $str)\n {\n $arr = str_split('abcdefghijklmnopqrstuvwxyz');\n $v = array_search(strtolower($str), $arr);\n if ($v !== false) {\n return $v + 1;\n }\n return 0;\n }", "public function getPlacePosition()\n {\n return substr($this->place, 0, 1);\n }", "private function characters_interval_for_single_charset($character) {\n if (strrpos($character, '-') > -1) {\n return preg_split('/-/', $character)[0];\n }\n return $character;\n }", "private function getStart()\n\t{\n//\t\tprint '#'.$this->getPage().'-'.$this->getRowsPerPage().'#';\n\t\t$iStart = ( ($this->getPage() - 1) * $this->getRowsPerPage() );\n\t\tif($iStart < 0)\n\t\t{\n\t\t\t$iStart = 0;\n\t\t}\n//\t\tprint $iStart.'*';\n\t\treturn $iStart;\n//\t\tprint $this->start .'*';\n\t}", "public function element_start_position(){\n return ($this->amount_per_page * $this->current_page) - $this->amount_per_page;\n }", "public function getStart($decimal = false)\n {\n return $decimal ? $this->istart : $this->start;\n }", "function getPosition() { return $this->readText(); }", "function getPosition() { return $this->readText(); }", "public function getStart()\n {\n return ($this->curPage - 1) * $this->nbPerPage;\n }", "public function get_footnotes_generated_start() {\n return $this->footnotes_generated_start;\n }", "public function getMainCharacters(): ?string\n {\n return $this->MainCharacters;\n }", "protected static function cp(string $char): int\n\t{\n\t\t$cp = ord($char[0]);\n\t\tif ($cp >= 0xF0)\n\t\t{\n\t\t\t$cp = ($cp << 18) + (ord($char[1]) << 12) + (ord($char[2]) << 6) + ord($char[3]) - 0x3C82080;\n\t\t}\n\t\telseif ($cp >= 0xE0)\n\t\t{\n\t\t\t$cp = ($cp << 12) + (ord($char[1]) << 6) + ord($char[2]) - 0xE2080;\n\t\t}\n\t\telseif ($cp >= 0xC0)\n\t\t{\n\t\t\t$cp = ($cp << 6) + ord($char[1]) - 0x3080;\n\t\t}\n\n\t\treturn $cp;\n\t}", "public function getInitial()\n {\n return ucwords(trim($this->first_name . ' ' . substr($this->last_name, 0, 1)));\n }", "public function getStart() {\n\t\treturn $this->attributes['start'];\n\t}", "public function getStartLine()\n\t{\n\t\treturn $this->startLine;\n\t}", "public function getOffset()\n {\n if (! isset($this->offset)) {\n $this->offset = (int)$this->getXPath($this->getDom())->query($this->getOffsetQuery())->item(0)->value;\n }\n return $this->offset;\n }", "private function getErrorPosition(): string\n {\n if ($this->displayErrorLine) {\n $pieces = preg_split('/\\\\r\\\\n|\\\\n\\\\r|\\\\n|\\\\r/', substr($this->data, 0, $this->position));\n $line = count($pieces);\n $column = strlen(end($pieces));\n\n return \" at line {$line} column {$column}\";\n }\n\n return \" at byte {$this->position}\";\n }", "public function getPosition()\n {\n $value = $this->get(self::POSITION);\n return $value === null ? (string)$value : $value;\n }", "protected function nodeStart(Node $node)\n {\n $attributes = $node->getAttributes();\n if (!isset($attributes['startFilePos'])) {\n throw new \\LogicException(\"replaceNode requires startFilePos and endFilePos to be set. \"\n . \"Check your Lexer usedAttributes option!\");\n }\n return $attributes['startFilePos'];\n }", "function getInitials($name){\r\n $words=explode(\" \",$name);\r\n $inits='';\r\n //loop through array extracting initial letters\r\n\tforeach($words as $word){\r\n\t $inits.=strtoupper(substr($word,0,1));\r\n\t}\r\n return $inits;\t\r\n}", "public function getPosition()\n {\n return -1;\n }", "function getX() {\n $pt = $this->getFirstPoint();\n if ( empty($pt) ) return FALSE;\n \n $poslist = $pt->getPosList();\n $cs = explode(' ',$poslist);\n return $cs[1];\n }", "public function GetPosition()\n\t{\n\t\tif($this->position['horizontal'] != '' && $this->position['verticle'] != '')\n\t\t\treturn $this->position['horizontal'].$this->position['verticle'];\n\t\telse\n\t\t\treturn 'Invalid Position';\n\t}", "public function getFirstMarker()\n {\n $this->currentMarker = 0;\n return $this->getCurrentMarker();\n }", "public function getCursorX()\n {\n return $this->moveToLocal_h($this->pdf->GetCursorX());\n }", "public function calculate_number_of_equal_first_characters(){\n $counter = 0;\n for ($key=0; $key<strlen($this->initial_word); $key++) {\n if($this->initial_word[$key] == $this->final_word[$key]){\n $counter += 1;\n }else{\n $this->number_of_equal_first_characters = $counter;\n return;\n }\n }\n $this->number_of_equal_first_characters = $counter;\n }", "protected function readChar()\n {\n if ($this->length > $this->pos) {\n return $this->string[$this->pos++];\n }\n\n return false;\n }", "protected function getY0($char)\n\t{\n\t\t$int = $this->convertCharToDecimal($char);\n\n\t\treturn ($int % $this->shapesCountY) * $this->shapeY;\n\t}", "public function getCurrentPosition(): int;", "public function getStartAtMin(): ?string\n {\n return $this->startAtMin;\n }", "function firstCharOf($s1, $chars){\n\t\t$array = preg_split('//u', $s1, -1, PREG_SPLIT_NO_EMPTY);\n\t\tforeach($array as $ch){\n\t\t\tif(in_array($ch, $chars)){\n\t\t\t\treturn $ch;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "public function getPos()\n {\n return $this->pos;\n }", "private function ReadChar() {\n\t\tif (($char = substr($this->file, $this->positionInFile, 1)) !== false) {\n\t\t\t$this->positionInFile++;\n\t\t\treturn $char;\n\t\t}\n\n\t\t$this->EOF = true;\n\t\treturn \"\";\n\t}", "public function getPosCur()\n {\n return $this->pos_cur;\n }", "function findPositionOfChar($search_string, $search) {\n if( strpos($search, $search_string) !== false ) {\n return 1;\n }\n return 0;\n }", "public function position()\r\n\t{\r\n\t\treturn ftell($this->getPointer());\r\n\t}", "public function getStart()\n {\n return isset($this->transaction['start']) ? $this->transaction['start'] : '';\n }" ]
[ "0.7260019", "0.7257306", "0.6666091", "0.6189447", "0.6160194", "0.6145134", "0.59980524", "0.5969157", "0.5936159", "0.5924991", "0.5921556", "0.58812565", "0.5874424", "0.5832538", "0.5817409", "0.5793523", "0.5785584", "0.5772775", "0.571568", "0.5712163", "0.5622826", "0.55954653", "0.55183053", "0.5502311", "0.5492633", "0.54748726", "0.54642975", "0.54535145", "0.54438555", "0.54395807", "0.5421689", "0.5419614", "0.54171467", "0.54153484", "0.5404392", "0.53989685", "0.5383727", "0.5370872", "0.5354179", "0.53422946", "0.53240794", "0.5323414", "0.5314075", "0.52976054", "0.52821624", "0.52787596", "0.52773887", "0.5274645", "0.5270999", "0.52670145", "0.5266615", "0.524682", "0.522837", "0.52211046", "0.52125293", "0.52061886", "0.52061206", "0.51949984", "0.51947737", "0.51947737", "0.51947737", "0.5192215", "0.5171164", "0.5169577", "0.5169161", "0.51495063", "0.51480365", "0.5139971", "0.51354957", "0.5133173", "0.51322514", "0.5125101", "0.5114036", "0.51126045", "0.5107136", "0.5101763", "0.50999564", "0.5097729", "0.5095688", "0.5087739", "0.50829667", "0.50762284", "0.50723153", "0.50716335", "0.5054763", "0.5054275", "0.50537956", "0.5052653", "0.5046356", "0.50027317", "0.5000782", "0.49826524", "0.4979518", "0.4976518", "0.49745885", "0.49712142", "0.49710938", "0.49710262", "0.49691662", "0.49507967" ]
0.68704224
2
Return a collection of inputs required to accomplish the move.
public function getInputs($asString = false);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function inputs()\n {\n return [];\n }", "public function getInputs()\n {\n return $this->inputs;\n }", "public function inputs()\n {\n return $this->inputs;\n }", "public function getInputs()\n {\n return array();\n }", "public function inputs();", "public function getInputs()\r\n {\r\n $this->inputs = $this->getReflection('inputs');\r\n }", "public function getInputsArray()\n\t{\n\t return $this->arrInputs;\n\t}", "abstract protected function inputs(): array;", "protected function compileInputs()\n {\n if ([] !== $this->inputs) {\n foreach ($this->inputs as $key => $input) {\n// Add collection group\n if (is_numeric($key)) {\n\n } else {\n $this->buildInput($key, $this->getColumnInfo($key), $input);\n }\n }\n }\n }", "public function getInputList()\n {\n return [\n new InputArgument(\n self::SMS_PHONE_NUMBER,\n InputArgument::REQUIRED,\n 'SMS telephone number'\n ),\n new InputArgument(\n self::SMS_TEXT_MESSGAE,\n InputArgument::REQUIRED,\n 'SMS text message'\n )\n ];\n }", "public function getInputValues();", "public function getConsideredMoves()\n {\n return $this->state->getValidMoves();\n }", "public function input()\n\t{\n\t\treturn $this->parameters;\n\t}", "public function args(): array\n {\n $inputTypeName = Utils::typename($this->name()).'Input';\n\n return [\n 'input' => $this->registry->type($inputTypeName)->nullable(false),\n ];\n }", "public function getInputNames();", "final public function GetValidInputs() { return $this->valid; }", "function getInputParams()\n {\n $params = array();\n parse_str( $this->getInput() , $params );\n return $params;\n }", "public function getRequiredParameters();", "public function getRequiredParameters();", "public function getInputPaths ()\n {\n return $this->paths;\n }", "public function inputSlots(): array;", "private function collectRequiredParams() {\n $dst = array();\n foreach ($this->getAllOptions() as $param) \n {\n if ($this->paramIsRequired($param) === true) \n {\n $dst[] = $this->clearParam($param); \n }\n \n }\n\n return $dst;\n }", "function getMandatoryInputParams_() {\n return $this->__inMandatoryParams;\n }", "public function newInputs($inputs = array())\n {\n return new RapidShare_MoveRealFolder_Inputs($inputs);\n }", "public function getInputValues()\n {\n return $this->input_values;\n }", "protected function getArguments()\n\t{\n\n\t\treturn array(\n\t\t\tarray('target', InputArgument::REQUIRED, 'Target number without + before number.'),\n\t\t);\n\t}", "public function inputs(bool $lowerCaseKeys = false) : array\n {\n return $lowerCaseKeys ? $this->inputLowerCaseKeys : $this->input;\n }", "protected function getArguments()\n {\n return [\n ['to-type', InputArgument::REQUIRED, 'The mapping type to be converted.'],\n ['dest-path', InputArgument::REQUIRED, 'The path to generate your entities classes.'],\n ];\n }", "public static function getInput(){\n $inputs = [];\n\n if ($_SERVER['REQUEST_METHOD'] == 'POST'){\n\n $args = [\n 'wpmg' => [\n 'filter' => FILTER_SANITIZE_STRING,\n 'flags' => FILTER_REQUIRE_ARRAY\n ]\n ];\n\n $inputs = filter_input_array(INPUT_POST, $args);\n }\n\n if ($_SERVER['REQUEST_METHOD'] == 'GET'){\n $inputs['pg'] = filter_input(INPUT_GET, 'pg', FILTER_VALIDATE_INT);\n\n\n $tax_type = get_query_var('wpmg_tax_type');\n $tax_value = get_query_var('wpmg_tax_value');\n\n if($tax_type && $tax_value){\n $inputs['wpmg']['tax'][$tax_type] = $tax_value;\n }\n\n\n }\n\n\n return $inputs;\n }", "public function newInputs($inputs = array())\n {\n return new RapidShare_MoveFilesToRealFolder_Inputs($inputs);\n }", "protected function getOldInput(): array\n\t{\n\t\tif($this->input === null)\n\t\t{\n\t\t\t$oldInput = $this->request->getData()->all();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$oldInput = $this->input->getOldInput();\n\t\t}\n\n\t\treturn array_diff_key($oldInput, array_flip($this->dontInclude));\n\t}", "function getInputValues();", "protected function required(): array\n {\n return $this->required;\n }", "public function getUserInputs(array $inputs) : array\n {\n return $this->inputs = $inputs;\n }", "private static function getInputVars() {\n\t\tif (static::$vars === null) {\n\t\t\t// take those vars only once\n\t\t\tparse_str(static::getRawData(), $vars);\n\t\t\tstatic::$vars = (array) $vars;\n\t\t}\n\t\t\n\t\treturn static::$vars;\n\t}", "public function getInputFields() {\n\t\treturn $this->inputFields;\n\t}", "private static function getRawInputs(): array\n {\n $inputParams = [];\n\n if (in_array(self::$__method, ['PUT', 'PATCH', 'DELETE'])) {\n\n $input = file_get_contents('php://input');\n\n if (self::$server->contentType()) {\n switch (self::$server->contentType()) {\n case 'application/x-www-form-urlencoded':\n parse_str($input, $inputParams);\n break;\n case 'application/json':\n $inputParams = json_decode($input);\n break;\n default :\n $inputParams = parse_raw_http_request($input);\n break;\n }\n }\n }\n\n return (array) $inputParams;\n }", "public function args(): array\n {\n $relation = $this->relation->getRelationName();\n\n if ($this->getPivotModelSchema()) {\n $typename = Str::studly($relation).'PivotInput';\n $type = $this->registry->type($typename)->list();\n } else {\n $type = $this->registry->ID()->list();\n }\n\n return $this->modelSchema->getLookupFields()->map(function (Field $field) {\n return $field->getType();\n })->merge(['input' => $type])->toArray();\n }", "private function getAllInputParameters () {\n// \t\t$params = $this->getInputParameters();\n\t\t$params = array();\n\t\t$catalogId = $this->session->getCourseCatalogId();\n\t\tif (!$catalogId->isEqual($this->session->getCombinedCatalogId()))\n\t\t\t$params[':catalog_id'] = $this->session->getCatalogDatabaseId($catalogId);\n\t\t\n\t\t$params[':subj_code'] = $this->session->getSubjectFromCourseId($this->courseId);\n\t\t$params[':crse_numb'] = $this->session->getNumberFromCourseId($this->courseId);\n\t\t\n\t\treturn $params;\n\t}", "public static function getRequiredParams();", "protected function inputSources()\n {\n if ($this->allowMultipleSources) {\n $sources = $this->sources;\n } else {\n $sources = [$this->source];\n }\n\n return $sources;\n }", "abstract public function getInput();", "public function newInputs($inputs = array())\n {\n return new Google_Directions_GetWalkingDirections_Inputs($inputs);\n }", "public function getAppliesTo()\n\t{\n\t\t$coveredElements = array(\n\t\t\t'input'\n\t\t);\n\n\t\treturn $coveredElements;\n\t}", "public function getAppliesTo()\n\t{\n\t\t$coveredElements = array(\n\t\t\t'input'\n\t\t);\n\n\t\treturn $coveredElements;\n\t}", "protected function getArguments()\n {\n return [\n ['stations', InputArgument::REQUIRED, 'The IDs of the station.'],\n ];\n }", "function getParameters() {\n\t\treturn $this->inputParameters;\n\t}", "public static function getRegisterInputs()\n\t{\n\t\treturn Input::newCollection([\n\t\t\t['login', 'Login', 'text'],\n\t\t\t['password', 'Password', 'password']\n\t\t]);\n\t}", "public function newInputs($inputs = array())\n {\n return new Google_DistanceMatrix_WalkingDistanceMatrix_Inputs($inputs);\n }", "public function newInputs($inputs = array())\n {\n return new Google_Directions_GetDrivingDirections_Inputs($inputs);\n }", "function collectNavigationFromInput()\n\t{\n\t\t// Get parameters from whatever input we need.\n\t\t$startnum= (int) FormUtil :: getPassedValue('startnum', null, 'GET');\n\t\t$active= FormUtil :: getPassedValue('license_status', null);\n\t\t$clear= FormUtil :: getPassedValue('clear');\n\n\t\tif ($clear)\n\t\t{\n\t\t\t$active= null;\n\t\t}\n\n\t\t$ignoreml= FormUtil :: getPassedValue('ignoreml', true);\n\n\t\t// get all module vars\n\t\t$modvars= pnModGetVar('crpLicense');\n\n\t\t$data= compact('startnum', 'active', 'clear', 'modvars');\n\n\t\treturn $data;\n\t}", "public function getInputIndexes()\n {\n return $this->input_indexes;\n }", "function get_input_array () {\n\t$input = array();\n\n\t// collect input values from the form\n\t$input['maker'] = isset($_POST['maker']) ? $_POST['maker'] : '';\n\t$input['model'] = isset($_POST['model']) ? $_POST['model'] : '';\n\t$input['speed'] = isset($_POST['speed']) ? $_POST['speed'] : '';\n\t$input['ram'] = isset($_POST['ram']) ? $_POST['ram'] : '';\n\t$input['hd'] = isset($_POST['hd']) ? $_POST['hd'] : '';\n\t$input['price'] = isset($_POST['price']) ? $_POST['price'] : '';\n\n\t// use the new_maker field instead of the maker field if it's set\n\t$new_maker = isset($_POST['new_maker']) ? $_POST['new_maker'] : '';\n\tif (!empty($new_maker)) {\n\t\t$input['maker'] = $new_maker;\n\t}\n\n\treturn $input;\n}", "protected function getArguments()\n {\n\n return [\n ['bot-id', InputArgument::REQUIRED, 'Bot ID'],\n ['destination', InputArgument::REQUIRED, 'Destination Address'],\n ];\n }", "public function processInput()\n {\n $directionsArray = explode(',', $this->input[0]);\n $allVisitedCoordinates = [];\n $currentPositionX = 0;\n $currentPositionY = 0;\n # This represents an angle\n $currentDirection = 0;\n foreach ($directionsArray as $step) {\n $step = trim($step);\n $turn = substr($step, 0, 1);\n $distance = substr($step, -1 * (strlen($step) - 1));\n // Check where we're facing\n $currentDirection += ($turn == 'L' ? -90 : 90);\n if ($currentDirection % 360 == 0) {\n $currentDirection = 0;\n }\n // Move by given distance changing the coordinates\n switch ($currentDirection) {\n case 0:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = $currentPositionX . ':' . ($currentPositionY + $i);\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionY += $distance;\n break;\n case 90:\n case -270:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = ($currentPositionX + $i) . ':' . $currentPositionY;\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionX += $distance;\n break;\n case -90:\n case 270:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = ($currentPositionX - $i) . ':' . $currentPositionY;\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionX -= $distance;\n break;\n case 180:\n case -180:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = $currentPositionX . ':' . ($currentPositionY - $i);\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionY -= $distance;\n break;\n }\n }\n $countArray = [];\n foreach ($allVisitedCoordinates as $key => $coordinates) {\n if (array_key_exists($coordinates, $countArray)) {\n $countArray[$coordinates]++;\n $c = $coordinates;\n break;\n } else {\n $countArray[$coordinates] = 1;\n }\n }\n $coordinates = explode(':', $c);\n $this->distanceTotal = abs($coordinates[0]) + abs($coordinates[1]);\n }", "public static function getLoginInputs()\n\t{\n\t\treturn Input::newCollection([\n\t\t\t['login', 'login', 'text'],\n\t\t\t['password', 'password', 'password']\n\t\t]);\n\t}", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public static function get_input_fields()\n {\n }", "public function getActionRequiredParameters()\r\n {\r\n return array();\r\n }", "function getMandatoryInputFields_() {\n return $this->__inMandatoryFields;\n }", "abstract protected function requiredArguments(): array;", "protected function getArguments()\n {\n return [\n ['ip', InputArgument::REQUIRED, 'The IP address to be added.'],\n ];\n }", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t[\n\t\t\t\t'modelClass',\n\t\t\t\tInputArgument::REQUIRED,\n\t\t\t\t'Model class name.'\n\t\t\t],\n\t\t];\n\t}", "protected function getArguments()\n {\n return array(\n array('name', InputArgument::REQUIRED, false),\n array('type', InputArgument::OPTIONAL, false),\n array('folder', InputArgument::OPTIONAL, false),\n );\n }", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\tarray('step' , InputArgument::REQUIRED, 'Step of the demo.'),\n\t\t);\n\t}", "protected function processInput(array $request) : array\n {\n return $request;\n }", "public function getInput();", "public function getInput();", "public function getInput();", "protected function getInputs(Request $request)\n {\n $inputs = $request->all();\n return $inputs;\n }", "protected function getArguments()\n {\n return array(\n array('action', InputArgument::REQUIRED, 'Keystone action (get, put, pluck, range...)'),\n array('key', InputArgument::OPTIONAL, 'Keystone key (namespace optional)'),\n );\n }", "public function arguments() : array\n {\n return $this->input->getArguments();\n }", "public function newInputs($inputs = array())\n {\n return new Google_DistanceMatrix_DrivingDistanceMatrix_Inputs($inputs);\n }", "public function compile(CompilationParams $params): array\n {\n /** @var Variable $inputVariable */\n $inputVariable = current($this->getInputPorts())->getVariableValue();\n /** @var Variable $outputVariable */\n $outputVariable = current($this->getOutputPorts())->getVariableValue();\n\n // check for emptiness or same values, in those cases nothing has to be done\n if (\n ($inputVariable->getDirectory() === $outputVariable->getDirectory()) ||\n ($inputVariable->isEmpty() && $outputVariable->isEmpty())\n ) {\n return [];\n }\n\n // output variable is empty, that means it was not known during creation of copy box\n // so set it now from the input variable\n if ($outputVariable->isEmpty()) {\n $outputVariable->setValue($inputVariable->getValue());\n }\n\n if (count($inputVariable->getValue()) !== count($outputVariable->getValue())) {\n throw new ExerciseCompilationException(\"Different count of files (source vs dest) in copy box\");\n }\n\n $inputs = array_values($inputVariable->getDirPrefixedValueAsArray(ConfigParams::$SOURCE_DIR));\n\n $tasks = [];\n for ($i = 0; $i < count($inputs); ++$i) {\n $task = new Task();\n $task->setPriority(Priorities::$DEFAULT);\n $task->setCommandBinary(TaskCommands::$COPY);\n $task->setCommandArguments(\n [\n $inputs[$i],\n ConfigParams::$SOURCE_DIR . $outputVariable->getDirectory()\n ]\n );\n $tasks[] = $task;\n }\n return $tasks;\n }", "private function questionList()\n {\n \t$requiredQuestions = [];\n\n \tfor ($x = 1; $x <= count($this->questions); $x++) {\n \t\t$requiredQuestions[ config('constants.questionInputPrefix') . $x] = 'required';\n \t}\n\n \treturn $requiredQuestions;\n }", "protected function getArguments()\n {\n return [\n ['name', InputArgument::REQUIRED, 'The name of the contract.'],\n ];\n }", "protected function getArguments()\n\t{\n return array(\n array('baseCurrency', InputArgument::REQUIRED, 'Base currency.'),\n array('compCurrency', InputArgument::REQUIRED, 'Currency you want to compare to.')\n );\n\t}", "public function getValues(): array\n {\n $values = [];\n foreach ($this->getInputNames() as $name) {\n $values[$name] = $this->$name;\n }\n return $values;\n }", "public function getRequiredParameters() {\n return array('loops');\n }", "protected function getArguments()\n {\n return [\n ['path', InputArgument::REQUIRED, 'path'],\n ];\n }", "protected function getArguments()\n {\n return [\n ['name', InputArgument::REQUIRED, 'The name of the command.'],\n ];\n }", "protected function getArguments()\n {\n return array(\n array('types', InputArgument::IS_ARRAY),\n );\n }", "public function get_input()\n {\n }", "public static function only() {\n $args = func_get_args();\n if(count($args) == 0) {\n throw new Exception(\"Must to supply at least one key\", 1);\n\n }\n $filteredInputs = [];\n foreach ($args as $key) {\n if(self::has($key)) {\n $filteredInputs[$key] = $_REQUEST[$key];\n }\n }\n return $filteredInputs;\n }", "protected function getArguments()\n\t{\n\t\treturn [\n ['id', InputArgument::REQUIRED, 'Driver ID'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t['queue', InputArgument::REQUIRED, 'Queue name.']\n\t\t];\n\t}", "public function newInputs($inputs = array())\n {\n return new Google_Drive_Files_Copy_Inputs($inputs);\n }", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\tarray('name', InputArgument::REQUIRED, 'Name of the model to generate.'),\n\t\t);\n\t}", "protected function getArguments()\n {\n return [\n ['name', InputArgument::REQUIRED, 'Controller name'],\n ];\n }" ]
[ "0.6605077", "0.653998", "0.65192395", "0.6468249", "0.62849355", "0.62433934", "0.6223721", "0.61885995", "0.5697644", "0.56367093", "0.55909437", "0.5577046", "0.5556838", "0.55526006", "0.55460435", "0.5511374", "0.5500526", "0.5499236", "0.5499236", "0.54801285", "0.5466493", "0.54562145", "0.5419544", "0.53953254", "0.533209", "0.53242004", "0.5309569", "0.53025144", "0.5301178", "0.5294179", "0.5290718", "0.5250315", "0.52406085", "0.5237514", "0.522168", "0.5215881", "0.5198878", "0.51679164", "0.5155758", "0.51380205", "0.5125", "0.5121638", "0.5116414", "0.5112342", "0.5112342", "0.5109321", "0.5107822", "0.5088138", "0.5030582", "0.50170016", "0.5012643", "0.50112915", "0.5005508", "0.49995226", "0.49926725", "0.49905014", "0.49854738", "0.49854738", "0.49854738", "0.49854738", "0.49854738", "0.49854738", "0.49854738", "0.49854738", "0.49854738", "0.49854738", "0.49854738", "0.49854738", "0.49854738", "0.49367538", "0.49357235", "0.49265546", "0.4923448", "0.48979178", "0.48947725", "0.48925477", "0.4885872", "0.48806113", "0.48806113", "0.48806113", "0.48789966", "0.4874308", "0.48657873", "0.4856138", "0.48506248", "0.4827849", "0.48260745", "0.48241508", "0.48217493", "0.48152027", "0.48076984", "0.48004067", "0.4797501", "0.4795793", "0.47952443", "0.47941682", "0.4784369", "0.47827423", "0.47792637", "0.4767509" ]
0.5222452
34
Return the damage value dealt to the target.
public function getDamage();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function damage() {\r\n\t\tif ($this->isWeapon()) {\r\n\t\t\treturn $this->techData['damage'];\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}", "public function damage() {\n return $this->damageMultiplier * $this->weapon->damage();\n }", "public function getDamage()\n {\n return $this->get(self::_DAMAGE);\n }", "public function getDamage()\n {\n return $this->get(self::_DAMAGE);\n }", "public function getDamage()\n {\n return $this->damage;\n }", "public function getDamage()\n {\n return $this->_damage;\n }", "public function getAttackDamage(): float\n {\n return $this->attackDamage;\n }", "public function getInstanceDamage()\n {\n return $this->get(self::_INSTANCE_DAMAGE);\n }", "function giveDamage($target) :int {\n //si on ne ce tape pas nous meme\n if ($target->getId() !== $this->getId()) {\n return $target->receiveDamage($this->getAttack());\n } else {\n // TODO: return something?????\n }\n }", "public function getDamageMod($damage, $shooter, $target, $sourceHex, $gamedata){\n\t\t$modifiedDmg = parent::getDamageMod($damage, $shooter, $target, $sourceHex, $gamedata);\n\t\tif($target->Enormous) $modifiedDmg = floor($modifiedDmg/2);\n\t\treturn $modifiedDmg;\n\t}", "public function applyDamage(){\n\t\tif($this->horseDead === false)\n\t\t\treturn $this->getRandomApplyingDamageValue($this->minDmg, $this->maxDmg);\n\t\telse return $this->minDmg;\n\t}", "public function getTargetAmount()\n {\n return $this->target_amount;\n }", "public function getBaseDamage()\n {\n return floor(self::MULT * $this->strength);\n }", "public function getDamageMultiplier() {\n return $this->damageMultiplier();\n }", "public function getOffenseEffectiveness()\n {\n return $this->attacker->getStats()->getStrength();\n }", "function receiveDamage(int $value) :int {\n $this->setDamageReceived($this->getDamageReceived() + $value);\n if ($this->getDamageReceived() >= $this->getLife()) {\n return $this->dead;\n }\n return $this->hit;\n }", "public function damage()\n {\n if (!$this->damage) {\n $this->damage = array(\n 'resistant' => array(),\n 'immunity' => array()\n );\n foreach (monsterToDamage::select('dtype', 'damage')->where('mid', '=', $this->id)->get() as $r) {\n if ($r->dtype == 'immunities') {\n $this->damage['immunity'][] = $r->damage;\n } else {\n $this->damage['resistant'][] = $r->damage;\n }\n };\n }\n return $this->damage;\n }", "public function getDefense()\n {\n return $this->defense;\n }", "public function getTotalArtifactDamage(): int {\n return $this->getArtifactDamage();\n }", "public function getTotalSpellDamage(): int {\n return $this->getSpellDamage();\n }", "public function setDamage($value)\n {\n return $this->set(self::_DAMAGE, $value);\n }", "public function setDamage($value)\n {\n return $this->set(self::_DAMAGE, $value);\n }", "public function getDefense()\n {\n return $this->_bonusDefense;\n }", "public function getEquipmentDamageType()\n {\n return $this->equipmentDamageType;\n }", "public function damagePerRound() {\r\n\t\tif ($this->isWeapon()) {\r\n\t\t\t$fullDamage = $this->amount() * $this->damage() * $this->burst();\r\n\t\t\treturn ($fullDamage / $this->reload());\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}", "public function getDamage($fireOrder){ return 10; }", "public function hurtPlayer($damageToGive){\n $this->currentHP -= $damageToGive;\n echo \"health decreased - \" . $damageToGive . \", current HP \" . $this->currentHP . \"<br>\";\n return $this->currentHP;\n }", "public function takeDamage(Character $target)\n {\n $target->totalStrength = 0;\n $random = rand(1, 5);\n\n if ($random == 1) {\n $target->totalStrength = $target->strength + $target->critical;\n $target->bonus();\n } else {\n $target->totalStrength = $target->strength;\n }\n\n $this->healthPoints = $this->healthPoints - $target->totalStrength;\n }", "public function getGold()\n {\n $value = $this->get(self::GOLD);\n return $value === null ? (integer)$value : $value;\n }", "public function getChargeValueModifier()\n {\n $value = 0;\n\n if ($this->isCompleted() || $this->isPending()) {\n $value += $this->getValue();\n }\n\n if ($this->getBackendTransactions()) {\n foreach ($this->getBackendTransactions() as $transaction) {\n if ($transaction->isRefund() && $transaction->isSucceed()) {\n $value -= abs($transaction->getValue());\n }\n }\n }\n\n return max(0, $value);\n }", "function execute($modifier = null)\n {\n $halfDamage = $modifier / 2;\n UI::actionMessage(\"{$this->getOwner()->getName()} used magic shield on {$this->getTarget()->getName()} , halfing the damage to: {$halfDamage}\");\n return $halfDamage;\n }", "public function getAttack()\n {\n return $this->attack;\n }", "public function discountOrChargeValue()\n {\n return $this->discountOrChargeValueBoleta();\n }", "public function getHealth()\t\t\t\t\t{ return (string)$this->charXMLObj->characterTab->characterBars->health->attributes()->effective; }", "public function getDisruptionBudget()\n {\n return $this->disruption_budget;\n }", "public function gold(): int\n {\n return $this->pluck('definedTrophies.gold');\n }", "public function getDiscountedAmount()\n\t{\n\t\t$amount = $this->getAmount();\n\n\t\treturn $amount - ($amount * $this->discount);\n\t}", "public function takeDamage()\n\t\t{\n\t\t\tif ($this->_illness)\n\t\t\t{\n\t\t\t\t$this->_health -= $this->_damage; \n\t\t\t}\n\t\t}", "public function spellDamageSingleTarget(SR_Player $player, SR_Player $target, $level, $key='10000', $damage, $arg4='')\n\t{\n\t\t$maxhp = $target->getMaxHP();\n\t\t$damage = round($damage, 1);\n\t\tif ($damage <= 0)\n\t\t{\n// \t\t\t$append = $append_ep = $player->lang('but no damge');\n// \t\t\t$append = $append_ep = ' but caused no damage';\n\t\t\t$hp = $target->getHP();\n\t\t\t$this->announceADV($player, $target, $level, $key, $damage, $hp, $maxhp, $arg4);\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t$p = $player->getParty();\n\t\t$mc = $p->getMemberCount();\n\t\t\n\t\t\n\t\t$target->dealDamage($damage);\n\t\tif ($target->isDead())\n\t\t{\n// \t\t\t$append = $append_ep = ' and kills them with '.$damage.' damage';\n\t\t\t\n\t\t\t$this->announceADV($player, $target, $level, $key, $damage, '0', $maxhp, $arg4);\n\n\t\t\t# Loot him!\n\t\t\t$xp = $target->isHuman() ? 0 : $target->getLootXP();\n//\t\t\t$xp = $target->getLootXP();\n\t\t\t$ny = round($target->getLootNuyen() / $mc, 1);\n\t\t\t$pxp = 0;\n\t\t\tif ($player->isNPC())\n\t\t\t{\n\t\t\t\t$target->resetXP();\n\t\t\t}\n\t\t\t\n\t\t\tforeach ($p->getMembers() as $member)\n\t\t\t{\n\t\t\t\t$lxp = $xp/$mc;\n\t\t\t\t$leveldiff = ($target->getBase('level')+1) / ($member->getBase('level')+1);\n\t\t\t\t$lxp *= $leveldiff;\n\t\t\t\t$lxp = round(Common::clamp($lxp, 0.01), 2);\n\t\t\t\t$pxp += $lxp;\n\t\t\t\t$member->giveXP($lxp);\n\t\t\t\t$member->giveNuyen($ny);\n\t\t\t\t$member->msg('5105', array(Shadowfunc::displayNuyen($ny), $lxp));\n// \t\t\t\t$member->message(sprintf('You loot %s Nuyen and %s XP.', $ny, $lxp));\n\t\t\t}\n\t\t\t\n\t\t\t$p->givePartyXP($pxp);\n\t\t\t\n\t\t\t$target->gotKilledBy($player);\n\n\t\t}\n\t\telse # just some dmg\n\t\t{\n\t\t\t$hp = $target->getHP();\n// \t\t\t$maxhp = $target->getMaxHP();\n// \t\t\t$append = \" and caused {$damage} damage\";\n// \t\t\t$append_ep = \"{$append} ($hp/$maxhp)HP left.\";\n\t\t\t$this->announceADV($player, $target, $level, $key, $damage, $hp, $maxhp, $arg4);\n\t\t}\n\n\t\treturn true;\n\t}", "public function buildHealFor(): int {\n $classBonus = $this->prophetHealingBonus($this->character) + $this->getVampiresHealingBonus($this->character);\n\n $classType = new CharacterClassValue($this->character->class->name);\n\n $healingAmount = $this->fetchHealingAmount();\n $dmgStat = $this->character->class->damage_stat;\n\n if ($classType->isVampire()) {\n $healingAmount += $this->character->{$dmgStat} - $this->character->{$dmgStat} * .025;\n }\n\n if ($classType->isProphet()) {\n $hasHealingSpells = $this->prophetHasHealingSpells($this->character);\n\n if ($hasHealingSpells) {\n $healingAmount += $this->character->{$dmgStat} * .025;\n }\n }\n\n return round($healingAmount + ($healingAmount * ($this->fetchSkillHealingMod() + $classBonus)));\n }", "public function getTarget()\n {\n $value = $this->get(self::TARGET);\n return $value === null ? (integer)$value : $value;\n }", "public function getGold() {\n\t\treturn $this->gold;\n\t}", "public function getAttack() {\n\n return $this->attack;\n\n }", "public function getDropGive()\n {\n return $this->get(self::_DROP_GIVE);\n }", "public function getRefundableAmount()\n {\n $amount = $this->getAmount()->subtract($this->getRefundedAmount());\n\n return $amount->isNegative() ? new Money(0, $this->amount->getCurrency()) : $amount;\n }", "public function getDice()\n {\n return $this->value;\n }", "static public function mdlTargetCompletion($idTarget)\n {\n $stmt = Connection::connect()->prepare(\"SELECT ROUND (SUM(completion*weight/100), 0) FROM indicators WHERE idTarget = :idTarget\");\n $stmt->bindParam(\"idTarget\", $idTarget, PDO::PARAM_INT);\n $stmt->execute();\n return $stmt->fetch();\n }", "public function getGold()\n {\n return $this->get(self::_GOLD);\n }", "public function getGold()\n {\n return $this->get(self::_GOLD);\n }", "public function getMinSpellBonusDamage(){\r\n\t $result = min($this->getSpellBonusDamageArcane(),\r\n \t\t\t\t\t$this->getSpellBonusDamageFire(),\r\n \t\t\t\t\t$this->getSpellBonusDamageFrost(),\r\n\t\t\t\t\t$this->getSpellBonusDamageHoly(),\r\n \t\t\t\t\t$this->getSpellBonusDamageNature(),\r\n \t\t\t\t\t$this->getSpellBonusDamageShadow());\r\n\t return $result;\r\n\t}", "public function getMaxHealth()\n {\n return $this->maxHealth;\n }", "public function getMaxHealth()\n {\n return $this->maxHealth;\n }", "public function attack(EntityDamageEvent $source) : void{\n\t\t$damage = $this->getDamage();\n\t\tPureEntities::logOutput(\"$this: attacked with original damage of $damage\", PureEntities::DEBUG);\n\t\t$reduceDamagePercent = 0;\n\t\tif($this->getMobEquipment() !== null){\n\t\t\t$reduceDamagePercent = $this->getMobEquipment()->getArmorDamagePercentToReduce();\n\t\t}\n\t\tif($reduceDamagePercent > 0){\n\t\t\t$reduceBy = $damage * $reduceDamagePercent / 100;\n\t\t\tPureEntities::logOutput(\"$this: reduce damage by $reduceBy\", PureEntities::DEBUG);\n\t\t\t$damage = $damage - $reduceBy;\n\t\t}\n\n\t\tPureEntities::logOutput(\"$this: attacked with final damage of $damage\", PureEntities::DEBUG);\n\n\t\tparent::attack($source);\n\t}", "public function getHp()\n {\n $value = $this->get(self::HP);\n return $value === null ? (integer)$value : $value;\n }", "public function getRemainingAttribute()\n {\n return $this->basePrice*(100-$this->discount)/100.0 - $this->deposit;\n }", "public function getItemDiscountAmount()\n {\n return $this->itemDiscountAmount;\n }", "public function getTargetServicePercent()\n {\n return $this->targetServicePercent;\n }", "public function getTargetInventoryQuantity()\n {\n return $this->targetInventoryQuantity;\n }", "public function getLiabilityAmount()\n {\n return $this->liabilityAmount;\n }", "public function getDailyDefenderBonusPerPokemon()\n {\n return $this->daily_defender_bonus_per_pokemon;\n }", "public function setInstanceDamage(Down_GuildInstanceDamage $value)\n {\n return $this->set(self::_INSTANCE_DAMAGE, $value);\n }", "public function getDiscountAmount()\n\t{\n\t\treturn $this->discount_amount;\n\t}", "public function getMoney()\n {\n return $this->money;\n }", "public function getMoney()\n {\n return $this->money;\n }", "public function getMoney()\n {\n return $this->money;\n }", "public function getMoney()\n {\n return $this->money;\n }", "public function maxHealth()\n {\n return $this->getMaxHealth();\n }", "protected function getDeductableIncome()\n {\n return $this->salary->getGross('year');\n }", "public function getAttackTimeout()\n {\n return $this->get(self::_ATTACK_TIMEOUT);\n }", "public function get_donated_amount() {\r\n\t\tif ( ! isset( $this->donated_amount ) || is_null( $this->donated_amount ) ) {\r\n\r\n\t\t\t/**\r\n\t\t\t * Try to fetch from cache first. \r\n\t\t\t */\r\n\t\t\t$this->donated_amount = get_transient( $this->get_donations_cache_key( $this->ID ) . '_amount' );\r\n\r\n\t\t\tif ( $this->donated_amount === false ) {\r\n\t\t\t\t$this->donated_amount = charitable()->get_db_table('campaign_donations')->get_campaign_donated_amount( $this->ID );\r\n\r\n\t\t\t\tset_transient( $this->get_donations_cache_key( $this->ID ) . '_amount', $this->donated_amount, 0 );\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\r\n\t\treturn $this->donated_amount;\r\n\t}", "public function percentKnockedOut() : float\n\t{\n\t\treturn $this->percentKnockedOut;\n\t}", "public function getDiscount(): int\n {\n return $this->discount;\n }", "public function getresistanceValue()\n {\n return $this->value;\n }", "public function getRefundAmount()\n {\n return $this->refund_amount;\n }", "public function getSpecialAbilityValue($args)\n {\n Debug::log(\"calling stealth getSpecialAbilityValue\");\n if (!isset($args[\"shooter\"]) || !isset($args[\"target\"]))\n throw new InvalidArgumentException(\"Missing arguments for Stealth getSpecialAbilityValue\");\n \n $shooter = $args[\"shooter\"];\n $target = $args[\"target\"];\n \n if (! ($shooter instanceof BaseShip) || ! ($target instanceof BaseShip))\n throw new InvalidArgumentException(\"Wrong argument type for Stealth getSpecialAbilityValue\");\n \n if (Mathlib::getDistanceOfShipInHex($shooter, $target) > 5)\n {\n return 1;\n }\n \n \n return 0;\n \n }", "public function getSpecialAbilityValue($args)\n {\n Debug::log(\"calling stealth getSpecialAbilityValue\");\n if (!isset($args[\"shooter\"]) || !isset($args[\"target\"]))\n throw new InvalidArgumentException(\"Missing arguments for Stealth getSpecialAbilityValue\");\n \n $shooter = $args[\"shooter\"];\n $target = $args[\"target\"];\n \n if (! ($shooter instanceof BaseShip) || ! ($target instanceof BaseShip))\n throw new InvalidArgumentException(\"Wrong argument type for Stealth getSpecialAbilityValue\");\n \n if (Mathlib::getDistanceOfShipInHex($shooter, $target) > 5)\n {\n return 1;\n }\n \n \n return 0;\n \n }", "public function getDamagesCount()\n {\n return $this->count(self::_DAMAGES);\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function amount() {\r\n\t\treturn $this->amount;\r\n\t}", "public function getAmount()\n {\n return $this->getSource()->getDataUsingMethod($this->getSourceField());\n }", "public function getEffectivePrice()\n {\n return $this->effective_price;\n }", "private function getCurrentHumidity() {\n $statement = $this->db->prepare('SELECT \"amount\" FROM \"humidity\" ORDER BY \"created\" DESC LIMIT 1');\n $result = $statement->execute();\n return $result->fetchArray(SQLITE3_ASSOC)['amount'];\n }", "public function attack(Character $target) {\n $rand = rand(1, 100);\n if ($rand < 10 ) {\n $status = $this->potion(); // On regénère la vie !\n }\n else if ($rand > 10 && $rand < 25) {\n $status = $this->diablotin($target); // diablotin\n }\n else if ($rand > 25 && $rand < 37) {\n $status = $this->siphonAme($target); // Siphon d'Ames\n }\n else if ($rand > 37 && $rand < 65) {\n $status = $this->drainVie($target); // Drain de vie\n }\n else if ($rand > 65 && $rand < 85) {\n $status = $this->gangreFeu($target); // GangreFeu\n }\n else{\n $status = $this->coupBaguette($target); // Attaque à la baguette !\n }\n return $status;\n }", "public function getamount()\n {\n return $this->amount;\n }", "public function getRefundAmount()\n {\n return $this->refundAmount;\n }", "public function getDiscountPercent() {\n return $this->item->getDiscountPercent();\n }", "public function getAmount(): Money\n {\n return $this->amount;\n }", "public function getDiscountAmount() {\n return $this->item->getDiscountAmount();\n }", "public function getSpecialAbilityValue($args)\n {\n if (!isset($args[\"shooter\"]) || !isset($args[\"target\"]))\n throw new InvalidArgumentException(\"Missing arguments for Jammer getSpecialAbilityValue\");\n \n $shooter = $args[\"shooter\"];\n $target = $args[\"target\"];\n \n if (! ($shooter instanceof BaseShip) || ! ($target instanceof BaseShip))\n throw new InvalidArgumentException(\"Wrong argument type for Jammer getSpecialAbilityValue\");\n \n if ($shooter->team === $target->team)\n return 0;\n \n return $this->getOutput();\n }", "public function getSpecialAbilityValue($args)\n {\n if (!isset($args[\"shooter\"]) || !isset($args[\"target\"]))\n throw new InvalidArgumentException(\"Missing arguments for Jammer getSpecialAbilityValue\");\n \n $shooter = $args[\"shooter\"];\n $target = $args[\"target\"];\n \n if (! ($shooter instanceof BaseShip) || ! ($target instanceof BaseShip))\n throw new InvalidArgumentException(\"Wrong argument type for Jammer getSpecialAbilityValue\");\n \n if ($shooter->team === $target->team)\n return 0;\n \n return $this->getOutput();\n }", "public function reactToOnAfterDealtDamage($event) { }", "public function discountOrChargeValueBoleta()\n {\n if($this->discount_or_charge_value > 0)\n return $this->discount_or_charge_value;\n else if ($this->discount_or_charge_percentage > 0)\n return (int) round( ($this->discount_or_charge_percentage / 100) * ($this->price * $this->quantity));\n else //pos sale without discount\n return 0;\n }", "public function silver(): int\n {\n return $this->pluck('definedTrophies.silver');\n }", "public function getTotaldiscount()\n {\n return $this->totaldiscount;\n }", "public function getOilBonus() // 1% expa = 0.3% bonusu\n\t{\n\t\treturn $this->getExperience() * 0.2;\n\t}" ]
[ "0.7764828", "0.775929", "0.7616235", "0.7616235", "0.7542312", "0.7431034", "0.73036134", "0.71504366", "0.70668304", "0.6966652", "0.66361195", "0.6603825", "0.6550421", "0.63395", "0.62346226", "0.6167983", "0.61129886", "0.6105344", "0.604269", "0.6008831", "0.5981238", "0.5981238", "0.5940982", "0.5886505", "0.58759975", "0.577488", "0.57601", "0.56987625", "0.5654263", "0.5566931", "0.55157596", "0.54788554", "0.5467848", "0.5463114", "0.54426837", "0.5441181", "0.5421235", "0.5418247", "0.54122555", "0.5406687", "0.53943485", "0.5390788", "0.5366243", "0.5364225", "0.53530496", "0.5348625", "0.5322986", "0.53085965", "0.53085965", "0.5305555", "0.53024083", "0.53024083", "0.5300745", "0.5290352", "0.528953", "0.52855986", "0.52838385", "0.5277147", "0.5272668", "0.5252383", "0.5241981", "0.523183", "0.522849", "0.522849", "0.522849", "0.522849", "0.5224364", "0.5212881", "0.5209821", "0.52068645", "0.5200426", "0.51923984", "0.5189049", "0.5174454", "0.5158621", "0.5158621", "0.5158607", "0.5148511", "0.5148511", "0.5148511", "0.5148511", "0.5148511", "0.5148511", "0.51356393", "0.5133948", "0.51335925", "0.51303905", "0.5129358", "0.51291144", "0.51134086", "0.5111387", "0.51060456", "0.5095534", "0.5087876", "0.5087876", "0.50874746", "0.5080149", "0.50775224", "0.5073984", "0.5072399" ]
0.73793036
6
Return the meter gain value earned by the dealer.
public function getMeterGain();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_deliveredEnergyMeter(): float\n {\n // $res is a double;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::DELIVEREDENERGYMETER_INVALID;\n }\n }\n $res = $this->_deliveredEnergyMeter;\n return $res;\n }", "public function getEnergyAttribute()\n {\n $energy = 0;\n\n if (! empty($this->attributes['energy'])) {\n $energy = $this->attributes['energy'];\n }\n\n $produced = round(\n $this->production_rate / 3600 * Carbon::now()->diffInSeconds($this->last_energy_changed)\n );\n\n return $energy + $produced;\n }", "public function get_receivedEnergyMeter(): float\n {\n // $res is a double;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::RECEIVEDENERGYMETER_INVALID;\n }\n }\n $res = $this->_receivedEnergyMeter;\n return $res;\n }", "private function woodGain(int $deltaTime) : float\n {\n $gain = $this->buildings['woodcutter']* 2 * 750 ;\n // liczymy zysk na sekunde (godzina/3600)\n $perSecondGain = $gain / 3600;\n //zwracamy zysk w czasie $deltaTime\n return $perSecondGain * $deltaTime;\n }", "public function getMetermaintenancecharge()\n {\n return $this->metermaintenancecharge;\n }", "public function get_meter(): float\n {\n // $res is a double;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::METER_INVALID;\n }\n }\n $res = $this->_meter;\n return $res;\n }", "public function getUtilityMeter()\n {\n return $this->utilityMeter;\n }", "private function ironGain(int $deltaTime) : float\n {\n $gain = $this->buildings['ironMine']*2 * 125;\n // liczymy zysk na sekunde (godzina/3600)\n $perSecondGain = $gain / 3600;\n //zwracamy zysk w czasie $deltaTime\n return $perSecondGain * $deltaTime;\n }", "private function goldGain(int $deltaTime) : float\n {\n $gain = $this->buildings['Bank']* 2 * 0.5 ;\n // liczymy zysk na sekunde (godzina/3600)\n $perSecondGain = $gain / 3600;\n //zwracamy zysk w czasie $deltaTime\n return $perSecondGain * $deltaTime;\n }", "public function getMeasurement()\n {\n return $this->measurement;\n }", "public function getDollarPriceChange(): float;", "public function getAdditionalCharge(){\n return $this->AdditionalCharge;\n }", "public function damage() {\n return $this->damageMultiplier * $this->weapon->damage();\n }", "public function getCharge(){\n return $this->Charge;\n }", "public function getGwPrice() {\n return $this->item->getGwPrice();\n }", "private function getWeight()\n\t{\n\t\treturn $this->cart->getWeight();\n\t}", "function calculateEnergyUse(){\n $this->boilerEnergy = $this->outletSteam->energyFlow + $this->blowdown->energyFlow - $this->feedwater->energyFlow;\n $this->fuelEnergy = $this->boilerEnergy / $this->boilerEff; \n $this->checkWarnings();\n }", "public function countConsumedMoney()\n {\n if( $this -> hasAlreadyUsedUpMoney() )\n {\n return $this -> target_price;\n }\n \n if( count( $this -> payments ) == 0 )\n {\n return 0.0;\n }\n \n $chargerType = $this -> charger_connector_type -> determineChargerType();\n \n $consumedMoney = $chargerType == ChargerTypeEnum :: FAST \n ? $this -> countConsumedMoneyByTime()\n : $this -> countConsumedMoneyByKilowatt();\n \n $consumedMoney = round ( $consumedMoney, 2 );\n\n return $consumedMoney;\n }", "public function getAttackDamage(): float\n {\n return $this->attackDamage;\n }", "private function kamienGain(int $deltaTime) : float\n {\n $gain = $this->buildings['kopalniaKamienia']*2 * 500;\n // liczymy zysk na sekunde (godzina/3600)\n $perSecondGain = $gain / 3600;\n //zwracamy zysk w czasie $deltaTime\n return $perSecondGain * $deltaTime;\n }", "public function getWeightTotal(): float;", "public function discountOrChargeValue()\n {\n return $this->discountOrChargeValueBoleta();\n }", "protected function getMoneyWorth($dkk = 1)\r\n {\r\n return $dkk / floatval(get_option('fanpoint_options', false)['FP_Worth']);\r\n }", "public function percentKnockedOut() : float\n\t{\n\t\treturn $this->percentKnockedOut;\n\t}", "protected function giveCost()\n {\n $novoValor = 4;\n $this->valueNow = 210.54 / $novoValor;\n return $this->valueNow;\n }", "public function amount(): float\n {\n return $this->amount;\n }", "public function getAmount(): float;", "public function getDamageMultiplier() {\n return $this->damageMultiplier();\n }", "public function getFabricQuantity() {\r\n \r\n return doubleVal($this->quantity / 100);\r\n }", "public function getBluetoothAvg() {\n return $this->bluetoothAvg;\n }", "public function getGoodsPrice()\n {\n return $this->goods_price;\n }", "public function getMemberGoodsPrice()\n {\n return $this->member_goods_price;\n }", "public function getOffenseEffectiveness()\n {\n return $this->attacker->getStats()->getStrength();\n }", "public function rate()\n {\n return $this->rate;\n }", "public function rate()\n {\n return $this->rate;\n }", "public function getCurrentCharge()\n {\n return $this->current_charge;\n }", "public function getAmount(): float\n {\n return $this->_amount;\n }", "public function getWeight() {\n return $this->item->getWeight();\n }", "public function getresistanceValue()\n {\n return $this->value;\n }", "protected function giveCost()\n\t{\n\t\t$solarSaving = 2;\n\t\t$this->valueNow = 210.54 / $solarSaving;\n\t\treturn $this->valueNow;\n\t}", "public function getGold()\n {\n return $this->get(self::_GOLD);\n }", "public function getGold()\n {\n return $this->get(self::_GOLD);\n }", "public function getUnitValue(): float\n\t{\n\t\treturn $this->unitValue;\n\t}", "public function getCharge()\n {\n return $this->_fields['Charge']['FieldValue'];\n }", "public function getWeight() {\n }", "public function getGold() {\n\t\treturn $this->gold;\n\t}", "public function getDamage()\n {\n return $this->_damage;\n }", "public function getWeight() : float\n\t{\n\t\treturn $this->weight;\n\t}", "public function getDamage()\n {\n return $this->damage;\n }", "public function damage() {\r\n\t\tif ($this->isWeapon()) {\r\n\t\t\treturn $this->techData['damage'];\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}", "public function getDefense()\n {\n return $this->_bonusDefense;\n }", "public function getLow(): float\n {\n return $this->low;\n }", "public function getGold()\n {\n $value = $this->get(self::GOLD);\n return $value === null ? (integer)$value : $value;\n }", "public function getBalance()\n {\n return (float)$this->client->requestExecute(\"credit\");\n }", "public function getDefense()\n {\n return $this->defense;\n }", "public function getHigh(): float\n {\n return $this->high;\n }", "public function getUnitsconsumed()\n {\n return $this->unitsconsumed;\n }", "public function getVol(): float\n {\n return $this->vol;\n }", "private function getCurrentDewPoint() {\n $t = $this->getCurrentTemp();\n $h = $this->getCurrentHumidity();\n\n return $t - (100 - $h) / 5;\n }", "function getWeight() {\n return $this->weight;\n }", "public function getUsagePercent() : float\n\t{\n\t\treturn $this->usagePercent;\n\t}", "public function getDecreasePrice() {\r\n $decrease = Mage::getStoreConfig(\r\n 'giftwrap/general/decrease_price_wrapall');\r\n if (is_numeric($decrease)) {\r\n return $decrease;\r\n } else {\r\n return 0;\r\n }\r\n }", "public function getUnitCost()\n {\n return $this->producer->getUnitCost();\n }", "public function getServiceCharge()\n {\n return $this->service_charge;\n }", "public function getChargeValueModifier()\n {\n $value = 0;\n\n if ($this->isCompleted() || $this->isPending()) {\n $value += $this->getValue();\n }\n\n if ($this->getBackendTransactions()) {\n foreach ($this->getBackendTransactions() as $transaction) {\n if ($transaction->isRefund() && $transaction->isSucceed()) {\n $value -= abs($transaction->getValue());\n }\n }\n }\n\n return max(0, $value);\n }", "public function getDeviation(): float\n {\n return $this->deviation;\n }", "public function getValue()\n {\n return (float) $this->value;\n }", "public function weight() {\r\n\t\treturn (int)$this->techData['weight'];\r\n\t}", "public function getEffectivePrice()\n {\n return $this->effective_price;\n }", "private function getTotalCharge() {\n $result = 0;\n\n foreach ($this->rentals as $rental) {\n $result += $rental->getCharge();\n }\n return $result;\n\n }", "public function calculate()\n {\n $nationalInsurance = 0.0;\n $nationalInsurance += $this->calculateBand('basic');\n $nationalInsurance += $this->calculateBand('higher');\n return $nationalInsurance;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getDollarPrice(): float;", "public function getCurrentBalance(): float\n {\n return $this->currentBalance;\n }", "public function getTotalWeight(): float\n {\n return $this->totalWeight;\n }", "public function getStrength()\n {\n return $this->strength;\n }", "public function getStrength()\n {\n return $this->strength;\n }", "public function getPothexchrate()\n {\n return $this->pothexchrate;\n }", "public function carFuel()\n {\n return parent::getFuel();\n }", "public function getCurrentPrice() : float;", "public function getRate() {\n return $this->rate;\n }", "public function getBaseDamage()\n {\n return floor(self::MULT * $this->strength);\n }", "public function getFee(): float;", "public function getAverageAudioDegradation()\n {\n if (array_key_exists(\"averageAudioDegradation\", $this->_propDict)) {\n return $this->_propDict[\"averageAudioDegradation\"];\n } else {\n return null;\n }\n }", "public function getAmountRate()\n {\n return $this->amountRate;\n }", "function spectra_money_supply ()\n\t{\n\t\tif (system_flag_get (\"balance_rebuild\") > 0)\n\t\t{\n\t\t\treturn \"Re-Balancing\";\n\t\t}\n\t\t\n\t\t$response = $GLOBALS[\"db\"][\"obj\"]->query (\"SELECT SUM(`balance`) AS `supply` FROM `\".$GLOBALS[\"tables\"][\"ledger\"].\"`\");\n\t\t$result = $response->fetch_assoc ();\n\t\t\n\t\tif (!isset ($result[\"supply\"]))\n\t\t{\n\t\t\treturn \"Unavailable\";\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\treturn $result[\"supply\"];\n\t\t}\n\t}", "public function getExchangeRate()\n {\n return $this->exchange_rate;\n }", "public function amount() {\r\n\t\treturn $this->amount;\r\n\t}", "function getWeight(){return $this->weight;}", "public function getWeight()\n {\n }", "public function getWeight()\n {\n }", "function getUtilisation(){\n\n $total = $this-> getTotalWeight() ;\n \n return round(($total / $this->capacity) * 100, 2);\n\n }", "public function estimate(){\n\t\t$speed = $this->speed();\n\t\tif($speed === 0 || $this->elapsed() === 0)\n\t\t\treturn 0;\n\n\t\treturn round($this->total / $speed);\n\t}", "public function getWeight()\n {\n return $this->weight;\n }", "public function getWeight()\n {\n return $this->weight;\n }", "public function getWeight()\n {\n return $this->weight;\n }" ]
[ "0.6608715", "0.63203067", "0.62981546", "0.62909436", "0.6197732", "0.61832464", "0.6118515", "0.6077072", "0.60670114", "0.60651124", "0.606058", "0.60189724", "0.59712094", "0.5930064", "0.59287155", "0.5925734", "0.59255564", "0.5923893", "0.5911628", "0.5908714", "0.5900055", "0.5894061", "0.5875588", "0.58747894", "0.5870111", "0.5862592", "0.58537185", "0.5847194", "0.58402306", "0.5829544", "0.5828872", "0.5823601", "0.5810142", "0.58088046", "0.58088046", "0.57985115", "0.579512", "0.5790726", "0.57900876", "0.5775134", "0.57708585", "0.57708585", "0.5763727", "0.57620174", "0.57603246", "0.57589376", "0.575758", "0.5755938", "0.574191", "0.57350326", "0.5730345", "0.5718386", "0.5714285", "0.5713217", "0.57119536", "0.57101136", "0.57092065", "0.57054836", "0.5703053", "0.56923676", "0.5688392", "0.567248", "0.56697255", "0.5668783", "0.5668139", "0.56572074", "0.56509554", "0.564942", "0.5648882", "0.5637021", "0.5633581", "0.56280047", "0.56280047", "0.56280047", "0.56280047", "0.56280047", "0.5627682", "0.5621466", "0.5613932", "0.561247", "0.561247", "0.56048954", "0.5598124", "0.5582907", "0.5580756", "0.55805284", "0.55768704", "0.5573104", "0.557045", "0.55669004", "0.5562584", "0.5554766", "0.555408", "0.55539936", "0.55539936", "0.5553967", "0.5553878", "0.5547299", "0.5547299", "0.5547299" ]
0.8184569
0
Return the hit level on the target.
public function getHitLevel();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLevel() {}", "public function getLevel();", "public function getLevel();", "public function GetLevel()\n {\n return $this->level;\n }", "public function getLevel()\n {\n return $this->level;\n }", "public function getLevel()\n {\n return $this->level;\n }", "public function getLevel()\n {\n return $this->level;\n }", "public function getLevel()\n {\n return $this->level;\n }", "public function getLevel()\n {\n return $this->level;\n }", "public function getLevel()\n {\n return $this->level;\n }", "public function getLevel()\n {\n return $this->level;\n }", "public function getLevel() {\n return intval($this->level);\n }", "public function getLevel(): int\n {\n return $this->level;\n }", "public function getLevel(): int\n {\n return $this->level;\n }", "public function getLevel(): int {\n return $this->level;\n\n }", "public function getLevel() {\n return $this->level;\n }", "public function getLevel() {\n\t\treturn isset($this->level) ? (int) $this->level : 1;\n\t}", "public function getLevel()\n {\n return$this->level;\n }", "public function getLevel() : int\n\t{\n\t\treturn $this->level;\n\t}", "public function getLevel()\n {\n $value = $this->get(self::LEVEL);\n return $value === null ? (integer)$value : $value;\n }", "public function getLevel()\n\t{\n\t\treturn $this->token->level;\n\t}", "public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }", "public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }", "public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }", "public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }", "public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }", "public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }", "function getLevel() {\n\t\treturn $this->_level;\n\t}", "function getLevel();", "public function getLevel()\n {\n return isset($this->level) ? $this->level : null;\n }", "public function getLevel()\n {\n $level = 0;\n if (!is_null($this->boss)) {\n $memberTmp = $this;\n while (!is_null($memberTmp = $memberTmp->getBoss())) {\n $level++;\n } ;\n }\n\n return $level;\n }", "public function getLevel() : Level {\r\n\r\n return $this->level;\r\n\r\n }", "public function getPlayerLevel()\n {\n return $this->get(self::_PLAYER_LEVEL);\n }", "public static function currentLevel()\n\t{\n\t\tif (!auth()->check()) return 0;\n\t\t$member = \\PanicHDMember::find(auth()->user()->id);\n\t\tif ($member->isAdmin()){\n\t\t\treturn 3;\n\t\t}elseif($member->isAgent()){\n\t\t\tif (session()->exists('panichd_filter_currentLevel') and session('panichd_filter_currentLevel')==1){\n\t\t\t\treturn 1;\n\t\t\t}else{\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t}else\n\t\t\treturn 1;\n\t}", "private function getActualLevel(): int\n {\n return (int)array_key_last($this->levels);\n }", "public function getOppoLevel()\n {\n return $this->get(self::_OPPO_LEVEL);\n }", "protected function get_level()\n {\n return $this->m_voxy_connect->_get_list_voxy_level();\n }", "public function getLevel()\n\t{\n $criteria = new CDbCriteria;\n $criteria->condition = \" idUser = $this->idUser \";\n $criteria->order = ' t.level DESC ';\n \n $userCoins = VerifIdentity::model()->find($criteria);\n \n return $userCoins === null ? 1 : $userCoins['level']; \n }", "public function level($skills)\n {\n return $this->getStat('level', $skills);\n }", "function getLevel($gid)\n {\n return 0;\n }", "public static function maxLevel()\n\t{\n\t\tif (!auth()->check()) return 0;\n\t\t$member = \\PanicHDMember::find(auth()->user()->id);\n\t\tif ($member->isAdmin()){\n\t\t\treturn 3;\n\t\t}elseif($member->isAgent()){\n\t\t\treturn 2;\n\t\t}else\n\t\t\treturn 1;\n\t}", "public function loadLevel() {\n\t\tswitch(true){\n\t\t\tcase ($this->data['level_pts'] >= 5000):\n\t\t\t\t$level = floor($this->data['level_pts'] / 1000) + 7;\n\t\t\t\tbreak;\n\t\t\tcase ($this->data['level_pts'] >= 1000):\n\t\t\t\t$level = floor($this->data['level_pts'] / 500) + 2;\n\t\t\t\tbreak;\n\t\t\tcase ($this->data['level_pts'] >= 600):\n\t\t\t\t$level = 3;\n\t\t\t\tbreak;\n\t\t\tcase ($this->data['level_pts'] >= 300):\n\t\t\t\t$level = 2;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$level = 1;\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $level;\n\t}", "public function totalLevel()\n {\n if ($this->noTotalLevelFound) {\n $sum = 0;\n foreach($this instanceof OSRSPlayer ? OSRSHiscores::SKILL_MAP : RS3Hiscores::SKILL_MAP as $skill) {\n if ($skill === 'Overall') {\n // 'Overall' is a cumulative so we skip it for the sum.\n continue;\n }\n $sum += $this->get($skill)->level ?: 1;\n }\n return $sum;\n }\n return $this->get('overall')->level;\n }", "public function getLevelForExperience($experience)\n {\n $level = sqrt($experience+10000)-99;\n return floor($level);\n }", "public function getActionLevel() {\n return $this->actionLevel;\n }", "public function getHit()\n {\n return $this->hit;\n }", "public function toInt()\n {\n return $this->level;\n }", "public function level() {\n\n\t\t$this->count_attempts( 300 );\n\n\t\tswitch ( TRUE ) {\n\t\t\tcase ( $this->attempts > 2 && $this->attempts <= 100 ) :\n\t\t\t\treturn Logger::NOTICE;\n\t\t\tcase ( $this->attempts > 100 && $this->attempts <= 590 ) :\n\t\t\t\treturn Logger::WARNING;\n\t\t\tcase ( $this->attempts > 590 && $this->attempts <= 990 ) :\n\t\t\t\treturn Logger::ERROR;\n\t\t\tcase ( $this->attempts > 990 ) :\n\t\t\t\treturn Logger::CRITICAL;\n\t\t}\n\n\t\treturn 0;\n\t}", "public function getSkillLevelUp()\n {\n return $this->get(self::_SKILL_LEVEL_UP);\n }", "public function getSkillLevelUp()\n {\n return $this->get(self::_SKILL_LEVEL_UP);\n }", "public function getLevel()\n {\n return PMA_Message::$level[$this->getNumber()];\n }", "public function getLevel() {\n\t\tif (empty($this->_level) && $this->_hasCategory) {\n\t\t\t$this->_level = $this->_getCategory()->getLevel();\n\t\t}\n\t\t//Remove 1 level, Home is considered L1.\n\t\treturn $this->_level -1;\n\t}", "public function GetSteamLevel()\n {\n $this->setApiDetails(__FUNCTION__, 'v0001');\n\n // Set up the arguments\n $arguments = ['steamId' => $this->steamId];\n\n // Get the client\n $client = $this->getServiceResponse($arguments);\n\n return $client->player_level;\n }", "public function getPercentLevel()\n { \n $experience_level = $this->getExperienceShortMax();\n\n $experience_current_level = $this->getExperienceShort();\n\n $percent = ($experience_current_level * 100)/$experience_level;\n\n return $percent;\n }", "public function level($uid = 0)\r\n {\r\n global $db, $_SMALLURL;\r\n if ($uid === 0) {\r\n if (isset($_SMALLURL['UID'])) {\r\n $uid = $_SMALLURL['UID'];\r\n }\r\n }\r\n $udat = db::get_array(\"users\", array(\"id\" => $uid), \"role\");\r\n if (count($udat) > 0) {\r\n $role = $udat[0]['role'];\r\n $rdat = db::get_array(\"roles\", array(\"id\" => $role));\r\n if (count($rdat) > 0) {\r\n return (int)$rdat[0]['level'];\r\n } else {\r\n return 0;\r\n }\r\n } else {\r\n return 0;\r\n }\r\n }", "public function getSkillLevelupChance()\n {\n return $this->get(self::_SKILL_LEVELUP_CHANCE);\n }", "public function getReadableLevel()\n {\n // we need to keep LEVEL array in this inverted format because of Symfony form elements\n return array_search($this->level, self::LEVELS);\n }", "public function getLevel(BaseObject $node)\n {\n if (!isset($node->level))\n {\n $peer_name = get_class($node->getPeer());\n\n $con = Propel::getConnection();\n\n $scope_sql = '';\n if (!is_null($node->getScopeIdValue())) {\n $scope_sql = sprintf(' AND %s = \\'%s\\'', self::getColumnConstant(get_class($node), 'scope'), $node->getScopeIdValue());\n }\n\n $sql = sprintf('SELECT COUNT(*) AS level FROM %s WHERE (%s < %d AND %s > %d) %s',\n constant(\"$peer_name::TABLE_NAME\"),\n self::getColumnConstant(get_class($node), 'left'),\n $node->getLeftValue(),\n self::getColumnConstant(get_class($node), 'right'),\n $node->getRightValue(),\n $scope_sql\n );\n\n $stmt = $con->prepareStatement($sql);\n $resultset = $stmt->executeQuery();\n $resultset->next();\n\n $level = $resultset->getInt('level');\n $node->level = $level;\n }\n else\n {\n $level = $node->level;\n }\n\n return $level;\n }", "public function getLevelMap()\n {\n return $this->levelMap;\n }", "function getUserLevel() {\n\t\tif(!$this->user_level_id) {\n\t\t\t$this->sql(\"SELECT access_level_id FROM \".UT_USE.\" WHERE id = \".$this->user_id);\n\t\t\t$this->user_level_id = $this->getQueryResult(0, \"access_level_id\");\n \t\t}\n\t\treturn $this->user_level_id;\n\t}", "public function getLevel() {\n return Logger::$LOG_LEVELS[$this->logLevel];\n }", "abstract public function getMinimumLevel()\n\t{\n\t\treturn 0.5;\n\t}", "function getLastlevel() {\n return $this->lastlevel;\n }", "protected function getThreshold()\n {\n return isset($this->threshold) ? $this->threshold : 1;\n }", "public function getLevelId(){\n\t\treturn $this->level_id;\n\t}", "public function getAccessLevel()\n\t{\n\t\tif (!is_null($this->accessLevel))\n\t\t\treturn $this->accessLevel;\n\n\t\t$this->accessLevel = 0;\n\n\t\tif ($this->access_level > $this->accessLevel)\n\t\t\t$this->accessLevel = $this->access_level;\n\n\t\tforeach ($this->roles as $role)\n\t\t{\n\t\t\tif ($role->access_level > $this->accessLevel)\n\t\t\t\t$this->accessLevel = $role->access_level;\n\t\t}\n\n\t\treturn $this->accessLevel;\n\t}", "public function getLogLevel()\r\n {\r\n return $this->level;\r\n }", "public function getLogLevel()\n {\n return $this->level;\n }", "public function getPreferLevel()\n {\n return $this->preferLevel;\n }", "protected function getPathLevel() : string\n {\n return $this->path_level;\n }", "public function getSkillLevelsCount()\n {\n return $this->count(self::_SKILL_LEVELS);\n }", "private static function getLevel() {\n if (empty(static::$level)) {\n static::$level = Conf::getIniVal(Conf::LOG_LEVEL, 3);\n }\n return static::$level;\n }", "public function getTotalAccess() {\n\t\t$userLevel = $this->getLevelId();\n\t\t$baseLevel = 1;\n\t\twhile ($userLevel > 1) {\n\t\t\t$baseLevel += $userLevel;\n\t\t\t$userLevel = $userLevel / 2;\n\t\t}\n\t\treturn $baseLevel;\n\t}", "public function getMessageLevel() {\r\n\t\treturn($this->level);\r\n\t}", "public function getLevel()\n {\n return sizeof($this->getParentsID());\n }", "function getLevel()\n {\n return $this->errorLevel;\n }", "function getLevelTruck()\r\n {\r\n static $level;\r\n if (!isset($level)) $level = new CustomLoggerLevel(LOG4PHP_LEVEL_TRUCK_INT, 'TRUCK', 0);\r\n return $level;\r\n }", "public function getDepthCurrent(): PositiveInteger;", "public function getSupportLevel()\n {\n return $this->supportLevel;\n }", "abstract public function combatLevel();", "public function getTargetAmount()\n {\n return $this->target_amount;\n }", "function giveDamage($target) :int {\n //si on ne ce tape pas nous meme\n if ($target->getId() !== $this->getId()) {\n return $target->receiveDamage($this->getAttack());\n } else {\n // TODO: return something?????\n }\n }", "public function getVipLevel()\n {\n return $this->VipLevel;\n }", "public function getVerbLevel(): int\n {\n if ($this->app) {\n return $this->app->getVerbLevel();\n }\n\n // return (int)$this->input->getLongOpt('debug', Console::VERB_ERROR);\n $envVal = OS::getEnvStrVal(Console::DEBUG_ENV_KEY);\n return $envVal !== '' ? (int)$envVal : Console::VERB_ERROR;\n }", "public function getDefaultLevel()\n {\n return 5; # level binh thuong\n }", "function killpointsFromDueling() {\n\tglobal $target_level,$attacker_level,$starting_target_health,$killpoints,$duel;\n\n\t$levelDifference = ($target_level-$attacker_level);\n\n\tif ($levelDifference > 10) {\n\t\t$levelDifferenceMultiplier = 5;\n\t} else if ($levelDifference > 0) {\n\t\t$levelDifferenceMultiplier = ceil($levelDifference/2); //killpoint return of half the level difference.\n\t} else {\n\t\t$levelDifferenceMultiplier = 0;\n\t}\n\n\t$killpoints = 1+$levelDifferenceMultiplier;\n}", "abstract public function getHitCount() : string;", "public function level()\n {\n // Define variables for use\n $counter = 0;\n $total_checklist_points = $this->checklist->sections->sum('total_points');\n $unwanted = array(Question::idById('providersenrolled'), Question::idById('correctiveactionproviders')); // do not contribute to total score\n $notapplicable = Question::idById('dbsapply'); // dbsapply will reduce total points to 65 if corresponding answer = 0\n // Begin processing\n $reductions = 0;\n $calculated_points = 0.00;\n $percentage = 0.00;\n $sqtns = $this->sqs()->whereNotIn('question_id', $unwanted) // remove non-contributive questions\n ->join('survey_data', 'survey_questions.id', '=', 'survey_data.survey_question_id')\n ->whereIn('survey_data.answer', Answer::lists('score'));\n $calculated_points = $sqtns->whereIn('question_id', array_unique(DB::table('question_responses')->lists('question_id')))->sum('answer'); \n if($sq = SurveyQuestion::where('survey_id', $this->id)->where('question_id', $notapplicable)->first())\n {\n if($sq->sd->answer == '0')\n $reductions++;\n }\n \n if($reductions>0)\n $percentage = round(($calculated_points*100)/($total_checklist_points-5), 2);\n else\n $percentage = round(($calculated_points*100)/$total_checklist_points, 2);\n return $percentage;\n }", "public function get_penalty()\n {\n return $this->penalty;\n }", "public function getTarget()\n {\n $value = $this->get(self::TARGET);\n return $value === null ? (integer)$value : $value;\n }", "public function levelName() {\n if (isset($this->level)) return self::$levels[$this->level];\n }", "public function getAuthLevel() {\n }", "public function transactionLevel();", "public function getDefaultLevel()\n {\n\n return 2.2;\n }", "public function getAdminLevel()\n {\n $userId = Auth::user()->id;\n // admin or not\n $level = 99;\n $user = DB::table('admins')->where('uid', $userId)->first();\n if ($user !== null) {\n $level = $user->level;\n }\n\n return $level;\n }", "function level($Pts){\n $grid = array(\n 1 => 50,\n 2 => 200,\n 3 => 600,\n 4 => 1000,\n 5 => 2500\n );\n $lvl = 0;\n foreach($grid as $k=>$v):\n if($Pts >= $v){\n $lvl = $k;\n }\n endforeach;\n return 'lvl '.$lvl;\n }", "public function logLevel()\n {\n return $this->logLevel ?: self::LOG_LEVEL_INFO;\n }", "public function getPowerLevel(){\n\t\t$request = $this->_sendPacketToController(self::GET_POWER_LEVEL);\n\t\tif ($request->getState() == self::STATE_OK) // If the packet is send sucefully\n\t\t\treturn $this->_getResponse();\n\t\telse\n\t\t\treturn $request;\n\t}", "public function spellDamageSingleTarget(SR_Player $player, SR_Player $target, $level, $key='10000', $damage, $arg4='')\n\t{\n\t\t$maxhp = $target->getMaxHP();\n\t\t$damage = round($damage, 1);\n\t\tif ($damage <= 0)\n\t\t{\n// \t\t\t$append = $append_ep = $player->lang('but no damge');\n// \t\t\t$append = $append_ep = ' but caused no damage';\n\t\t\t$hp = $target->getHP();\n\t\t\t$this->announceADV($player, $target, $level, $key, $damage, $hp, $maxhp, $arg4);\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t$p = $player->getParty();\n\t\t$mc = $p->getMemberCount();\n\t\t\n\t\t\n\t\t$target->dealDamage($damage);\n\t\tif ($target->isDead())\n\t\t{\n// \t\t\t$append = $append_ep = ' and kills them with '.$damage.' damage';\n\t\t\t\n\t\t\t$this->announceADV($player, $target, $level, $key, $damage, '0', $maxhp, $arg4);\n\n\t\t\t# Loot him!\n\t\t\t$xp = $target->isHuman() ? 0 : $target->getLootXP();\n//\t\t\t$xp = $target->getLootXP();\n\t\t\t$ny = round($target->getLootNuyen() / $mc, 1);\n\t\t\t$pxp = 0;\n\t\t\tif ($player->isNPC())\n\t\t\t{\n\t\t\t\t$target->resetXP();\n\t\t\t}\n\t\t\t\n\t\t\tforeach ($p->getMembers() as $member)\n\t\t\t{\n\t\t\t\t$lxp = $xp/$mc;\n\t\t\t\t$leveldiff = ($target->getBase('level')+1) / ($member->getBase('level')+1);\n\t\t\t\t$lxp *= $leveldiff;\n\t\t\t\t$lxp = round(Common::clamp($lxp, 0.01), 2);\n\t\t\t\t$pxp += $lxp;\n\t\t\t\t$member->giveXP($lxp);\n\t\t\t\t$member->giveNuyen($ny);\n\t\t\t\t$member->msg('5105', array(Shadowfunc::displayNuyen($ny), $lxp));\n// \t\t\t\t$member->message(sprintf('You loot %s Nuyen and %s XP.', $ny, $lxp));\n\t\t\t}\n\t\t\t\n\t\t\t$p->givePartyXP($pxp);\n\t\t\t\n\t\t\t$target->gotKilledBy($player);\n\n\t\t}\n\t\telse # just some dmg\n\t\t{\n\t\t\t$hp = $target->getHP();\n// \t\t\t$maxhp = $target->getMaxHP();\n// \t\t\t$append = \" and caused {$damage} damage\";\n// \t\t\t$append_ep = \"{$append} ($hp/$maxhp)HP left.\";\n\t\t\t$this->announceADV($player, $target, $level, $key, $damage, $hp, $maxhp, $arg4);\n\t\t}\n\n\t\treturn true;\n\t}", "public function isHit()\n {\n return $this->hit;\n }" ]
[ "0.68071246", "0.6727809", "0.6727809", "0.6630325", "0.66138345", "0.66138345", "0.66138345", "0.66138345", "0.66138345", "0.66138345", "0.66138345", "0.6604302", "0.65856564", "0.65856564", "0.65646714", "0.6550286", "0.65243006", "0.65175945", "0.6508514", "0.64722013", "0.6448676", "0.64403903", "0.64403903", "0.64403903", "0.64403903", "0.64403903", "0.64403903", "0.6432447", "0.64323664", "0.6430741", "0.6365473", "0.6306704", "0.6238017", "0.61889315", "0.6134477", "0.6083399", "0.6055504", "0.6030401", "0.60146147", "0.60102326", "0.6003655", "0.5915252", "0.5906168", "0.5894079", "0.58771396", "0.5856217", "0.58109504", "0.57734203", "0.5751657", "0.5751657", "0.5700729", "0.5673516", "0.567307", "0.56473154", "0.56329364", "0.56290007", "0.56221294", "0.55876404", "0.55700636", "0.55290383", "0.5528572", "0.5528136", "0.5522007", "0.55139416", "0.5507313", "0.54644936", "0.5461855", "0.5451694", "0.5427659", "0.54197073", "0.5417944", "0.54005915", "0.5392409", "0.53876776", "0.5376996", "0.5370599", "0.53547615", "0.53385943", "0.53348464", "0.5332555", "0.533167", "0.5322316", "0.53104943", "0.5304582", "0.5291373", "0.5257746", "0.5242396", "0.5236871", "0.52318907", "0.5220474", "0.521673", "0.5201052", "0.519314", "0.5191371", "0.51884687", "0.51815706", "0.5176956", "0.51690835", "0.5168567", "0.51575434" ]
0.8134625
0
Return the move able to cancel the active and recovery frames.
public function getCancelAbilities();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dockCancel(){\n\t\treturn $this->_sendPacketToController(self::DOCK_CANCEL);\n\t}", "private function get_next_move() {\n\t\t$move = $this->can_put_a_card_up();\n\t\tif($move !== false) return $move;\n\t\t\n\t\t// Test si une carte peut être déplacée\n\t\t$move = $this->can_move_cards();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Test si la carte du deck peut descendre\n\t\t$move2 = $this->can_put_deck_card_down();\n\t\tif($move !== false && $move2 !== false) {\n\t\t\tarray_push($move, $move2);\n\t\t\treturn $move;\n\t\t} \n\t\tif($move !== false) return $move;\n\t\tif($move2 !== false) return $move2;\n\t\t\n\t\t// Test si une carte peut être montée suite à un déplacement spécial\n\t\t//$move = $this->can_put_a_card_up_after_move();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Pioche\n\t\t$move = $this->can_turn_from_deck();\n\t\tif($this->infinite_move($move)) return false;\n\t\tif($move !== false) return $move;\n\t\t\n\t\treturn false;\n\t}", "public function cancel(): int;", "public function cancel();", "public function canceled()\n {\n return $this->cancelled();\n }", "public function nextPossibleMove()\n {\n $x = $this->snake['pos']['x'];\n $y = $this->snake['pos']['y'];\n \n $moves = [\n 'up' => [$x, $y - 1],\n 'right' => [$x + 1, $y],\n 'down' => [$x, $y + 1],\n 'left' => [$x - 1, $y],\n ];\n\n $moves = $this->removeDeadMoves($moves);\n\n if (empty($moves)) {\n return $moves;\n }\n\n $moves = $this->calcThresholds($moves);\n\n if (!empty($safe = array_diff_key($moves, $this->getDangerMoves($moves)))) {\n $danger = array_intersect_key($moves, $this->getDangerMoves($moves));\n\n $threshold = array_first($safe)[2];\n\n if ($threshold > 7 && !empty($danger)) {\n return $danger;\n }\n\n if ($threshold > 5) {\n if (!empty($tail = $this->getTailMoves($safe))) {\n return $tail;\n }\n }\n\n if ($threshold > 5 && $this->snake['health'] < 95) {\n $result = $this->getFoodMoves($safe);\n\n if (!empty($result)) {\n return $result;\n }\n }\n\n return $safe;\n }\n\n if (!empty($head = $this->getHeadMoves($moves))) {\n return $head;\n }\n\n if (!empty($tail = $this->getTailMoves($moves))) {\n return $tail;\n }\n\n return $moves;\n }", "public function getCanceled(): int;", "public function selectMove(){\r\n \r\n do {\r\n $userMsg = readlineUserInputMsg($this->currentPlayer);\r\n $userMove = readline($userMsg);\r\n } while (!$this->checkValidMove($userMove));\r\n\r\n return $userMove;\r\n }", "public function chooseMove()\n {\n return $this->getMoveFactory()->getMove(array_rand($this->getMoveFactory()->getAvailableMoves()));\n }", "public function cancel(): void;", "public function getMove()\n {\n if (array_key_exists(\"move\", $this->_propDict)) {\n return $this->_propDict[\"move\"];\n } else {\n return null;\n }\n }", "protected function _cancelOperation() {}", "public function cancel()\n {\n }", "public function cancel()\n {\n }", "public function getConsideredMoves()\n {\n return $this->state->getValidMoves();\n }", "public function cancellationRequested() : bool;", "public function cancel(){\n\t\t$this->getBasics();\n\t\t$this->getParams();\n\t\t$this->getLanguage();\n\n\t\t// load additonal language (for breadcrumbs)\n\t\t$this->language->load( 'checkout/success' );\n\n\t\t$this->load->library( 'encryption' );\n\t\t$encryption = new Encryption( $this->config->get( 'config_encryption' ) );\n\n\t\t// get order id\n\t\tif( isset( $this->request->get['order_id'] ) ) {\n\t\t\t$order_id = $encryption->decrypt( $this->request->get['order_id'] );\n\t\t}else{\n\t\t\t$order_id = 0;\n\t\t}\n\n\t\t// get project id\n\t\t$project_id = $this->getRequest( 'pid', 0 );\n\n\t\t// write log\n\t\t$msg = sprintf( $this->language->get( 'text_log_return_cancel'), $project_id, $order_id );\n\t\t$this->writeLog( $msg, 4 );\n\n\t\t$this->data['heading_title']\t= $this->language->get( 'text_cancel' );\n\t\t$this->data['text_message']\t\t= sprintf(\n\t\t\t$this->language->get( 'text_cancel_message' ),\n\t\t\t$this->buildUrl( 'information/contact' )\n\t\t);\n\t\t$this->data['button_continue']\t= $this->language->get( 'button_continue' );\n\t\t$this->data['continue']\t\t\t= $this->buildUrl( 'common/home' );\n\n\t\tif( $this->_ocversion == '1.4' ) {\n\t\t\t$breadcrumbs = array(\n\t\t\t\tarray(\n\t\t \t'href' => $this->buildUrl( 'common/home' ),\n\t\t \t'text' => $this->language->get( 'text_home' ),\n\t\t \t'separator' => false\n\t\t \t),\n\t\t \tarray(\n\t\t \t'href' => $this->buildUrl( 'checkout/cart' ),\n\t\t \t'text' => $this->language->get( 'text_basket' ),\n\t\t \t'separator' => $this->language->get( 'text_separator' )\n\t\t \t)\n\t\t\t);\n\n\t\t\tif( $this->customer->isLogged() ) {\n\t\t\t\t$breadcrumbs_add = array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'href' => $this->buildUrl( 'checkout/shipping' ),\n\t\t\t\t\t\t'text' => $this->language->get( 'text_shipping' ),\n\t\t\t\t\t\t'separator' => $this->language->get( 'text_separator' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'href' => $this->buildUrl( 'checkout/payment' ),\n\t\t\t\t\t\t'text' => $this->language->get( 'text_payment' ),\n\t\t\t\t\t\t'separator' => $this->language->get( 'text_separator' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'href' => $this->buildUrl( 'checkout/confirm' ),\n\t\t\t\t\t\t'text' => $this->language->get( 'text_failed' ),\n\t\t\t\t\t\t'separator' => $this->language->get( 'text_separator' )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}else{\n\t\t\t\t$breadcrumbs_add = array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'href' => $this->buildUrl( 'checkout/guest' ),\n\t\t\t\t\t\t'text' => $this->language->get( 'text_guest' ),\n\t\t\t\t\t\t'separator' => $this->language->get( 'text_separator' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'href' => $this->buildUrl( 'checkout/guest/confirm' ),\n\t\t\t\t\t\t'text' => $this->language->get( 'text_failed' ),\n\t\t\t\t\t\t'separator' => $this->language->get( 'text_separator' )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$breadcrumbs = array_merge( $breadcrumbs, $breadcrumbs_add );\n\n\t \t$breadcrumbs[] = array(\n\t \t'href' => $this->buildUrl( 'checkout/success' ),\n\t \t'text' => $this->language->get( 'text_failed' ),\n\t \t'separator' => $this->language->get( 'text_separator' )\n\t \t);\n\t\t}else{\n\t\t\t$breadcrumbs = array(\n\t\t\t\tarray(\n\t\t\t\t\t'href' => $this->buildUrl( 'common/home' ),\n\t\t \t'text' => $this->language->get( 'text_home' ),\n\t\t \t'separator' => false\n\t\t\t\t),\n\t \tarray(\n\t\t \t'href' => $this->buildUrl( 'checkout/cart' ),\n\t\t \t'text' => $this->language->get( 'text_basket' ),\n\t\t \t'separator' => $this->language->get( 'text_separator' )\n\t\t \t),\n\t\t \tarray(\n\t\t\t\t\t'href' => $this->buildUrl( 'checkout/checkout', '', 'SSL' ),\n\t\t\t\t\t'text' => $this->language->get( 'text_checkout' ),\n\t\t\t\t\t'separator' => $this->language->get( 'text_separator' )\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t \t'href' => $this->buildUrl( 'checkout/success' ),\n\t\t \t'text' => $this->language->get( 'text_failed' ),\n\t\t \t'separator' => $this->language->get( 'text_separator' )\n\t\t \t)\n\t \t);\n\t\t}\n\n\t\t$this->getTemplate( '/template/common/success.tpl' );\n\t\t$this->buildBreadcrumbs( $breadcrumbs );\n\t\t$this->buildTitle( $this->language->get( 'text_cancel' ) );\n\t\t$this->getChildren();\n\t\t$this->buildResponse();\n\t}", "public function cancel () {\n\t\t$this->opts['cancel'] = true;\n\t\treturn $this;\n\t}", "function cancel() {\n\n\t\tif (KRequest::getVar('return')) {\n\t\t\t$url = KLink::base64UrlDecode(KRequest::getVar('return'));\n\t\t}\n\t\telse {\n\t\t\t$controllerName = KenedoController::getControllerNameFromClass(get_class($this));\n\t\t\t$url = KLink::getRoute('index.php?option='.$this->component.'&controller='.$controllerName, false);\n\t\t}\n\n\t\t$this->setRedirect($url);\n\n\t}", "protected function computerTurn(){ \r\n\t\t$getMinMaxResult = new MinMax($this); \r\n\t\tif ($getMinMaxResult->move) {\r\n\t\t\treturn $this->_move = $getMinMaxResult->move;\r\n\t\t}\r\n\t\treturn false; \r\n\t}", "public function cancelAction()\n\t{\n\t\t$this->processToken = null;\n\t\t$this->isNewProcess = true;\n\n\t\t$this->dropTempFile();\n\n\t\t$this->instanceBucket();\n\n\t\tif ($this->bucket instanceof \\CCloudStorageBucket)\n\t\t{\n\t\t\tif ($this->bucket->FileExists($this->uploadPath))\n\t\t\t{\n\t\t\t\tif (!$this->bucket->DeleteFile($this->uploadPath))\n\t\t\t\t{\n\t\t\t\t\t$this->addError(new Error('Cloud drop error.'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->clearProgressParameters();\n\n\t\t$result = $this->preformAnswer(self::ACTION_CANCEL);\n\n\t\t$result['STATUS'] = self::STATUS_COMPLETED;\n\n\t\treturn $result;\n\t}", "final public function cancel(): string {\n $this->generator = null;\n return $this->buffer;\n }", "public function getHoldBeforeState();", "public static function cruise ($available_moves)\n {\n $scores = static::evaluate_moves($available_moves);\n if ( array_key_exists(Map::last_move(), $scores) && $scores[Map::last_move()] > 0 ) {\n return ['move' => Map::last_move(), 'logmsg' => \"cruise; \" . Map::last_move() . \"; xy:\" . Map::current('x') . \",\" . Map::current('y')];\n }\n // This direction is no longer valid or is negatively scored.\n return ['move' => array_keys($scores)[0], 'logmsg' => \"cruise; \" . array_keys($scores)[0] . \"; xy:\" . Map::current('x') . \",\" . Map::current('y')];\n }", "public function cancel() {\n # cleanup code before cancellng job\n $ret = array('message'=>'You cancelled this job at '.date('H:i:s'));\n return $ret;\n }", "protected function cancelEdit()\n {\n if ($this->backup == NULL && $this->current) {\n $this->plugins[$this->current] = new $this->current($this->dn, $this);\n $this->plugins[$this->current]->set_acl_base($this->acl_base);\n $this->plugins[$this->current]->set_acl_category(preg_replace(\"/\\/$/\", \"\", $this->acl_category));\n\n } elseif (is_array($this->backup)) {\n foreach ($this->backup as $name => $value) {\n $this->plugins[$this->current]->$name = $value;\n }\n }\n $this->backup = NULL;\n $this->current = \"\";\n $this->closeDialogs();\n }", "protected function cancel()\n\t{\n\t\t$this->executeTask('Rollback');\n\n\t\treturn false;\n\t}", "function cancelObject($in_rep = false)\n\t{\n\t\tilUtil::sendInfo($this->lng->txt('msg_cancel'), true);\n\t\t// TODO: check this\n\t\tilUtil::redirect('repository.php?cmd=frameset&ref_id='.$_GET['ref_id']);\n\t}", "public function chargeStop(){\n\t\treturn $this->_sendPacketToController(self::CHARGE_STOP);\n\t}", "public function isCanceled()\n {\n return $this->stateData['canceled'];\n }", "public function cancel() {\n $this->__lastActions__[] = array();\n $this->__dbo__->rollback($this->__instanceId__);\n return $this;\n }", "function pick_move() {\r\n $fill = false;\r\n do {\r\n //picks a random \"-\" spot and will fill it with \"x\" to represent opponent's move\r\n $next = rand(0, 8);\r\n if ($this->position[$next] == '-') {\r\n $this->position[$next] = 'x';\r\n $fill = true;\r\n }\r\n //keep filling until winning condition is found\r\n } while (!$fill);\r\n }", "public function getCancelTime()\n {\n return $this->cancel_time;\n }", "public function cancel($value) {\n return $this->setProperty('cancel', $value);\n }", "function ParseCancelMsg() \n\t{\n\t\t$this->log->WriteLog( INFO, \"Parse Cancel Msg Start\" );\n\t\tif( strcmp( $this->REQUEST[\"AuthTy\"], \"card\" ) == 0 )\n\t\t{\n\t\t\tif( strcmp( $this->REQUEST[\"SubTy\"], \"isp\" ) == 0 )\n\t\t\t{\n\t\t\t\t/* [1-1] 안전결제ISP 처리 */\t\t\t\t\t\n\n\t\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[0];\n\t\t\t\t$this->RESULT[\"rApprNo\"] = $this->RecvValArray[1];\n\t\t\t\t$this->RESULT[\"rApprTm\"] = $this->RecvValArray[2];\n\t\t\t\t$this->RESULT[\"rBusiCd\"] = $this->RecvValArray[3];\n\t\t\t\t$this->RESULT[\"rDealNo\"] = $this->RecvValArray[4];\n\t\t\t\t$this->RESULT[\"rCancelSuccYn\"] = $this->RecvValArray[5];\n\t\t\t\t$this->RESULT[\"rCancelResMsg\"] = $this->RecvValArray[6];\n\t\t\t\t\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\"-\".$this->REQUEST[\"SubTy\"].\" \".\"RECV MSG Parsing OK \" );\n\t\t\t}\n\t\t\telse if( ( strcmp( $this->REQUEST[\"SubTy\"], \"visa3d\" ) == 0 ) || ( strcmp( $this->REQUEST[\"SubTy\"], \"normal\" ) == 0 ) )\n\t\t\t{\n\t\t\t\t/* [1-2] 안심클릭 or 일반결제 처리 */\t\n\t\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[0];\n\t\t\t\t$this->RESULT[\"rApprNo\"] = $this->RecvValArray[1];\n\t\t\t\t$this->RESULT[\"rApprTm\"] = $this->RecvValArray[2];\n\t\t\t\t$this->RESULT[\"rBusiCd\"] = $this->RecvValArray[3];\n\t\t\t\t$this->RESULT[\"rCancelSuccYn\"] = $this->RecvValArray[4];\n\t\t\t\t$this->RESULT[\"rOrdNo\"] = $this->RecvValArray[5];\n\t\t\t\t$this->RESULT[\"rInstmt\"] = $this->RecvValArray[6];\n\t\t\t\t$this->RESULT[\"rAmt\"] = $this->RecvValArray[7];\n\t\t\t\t$this->RESULT[\"rCardNm\"] = $this->RecvValArray[8];\n\t\t\t\t$this->RESULT[\"rCardCd\"] = $this->RecvValArray[9];\n\t\t\t\t$this->RESULT[\"rMembNo\"] = $this->RecvValArray[10];\n\t\t\t\t$this->RESULT[\"rAquiCd\"] = $this->RecvValArray[11];\n\t\t\t\t$this->RESULT[\"rAquiNm\"] = $this->RecvValArray[12];\n\t\t\t\t$this->RESULT[\"rDealNo\"] = $this->RecvValArray[13];\n\n\t\t\t\tif($this->RESULT[\"rCancelSuccYn\"] == \"y\")\n\t\t\t\t{\n\t\t\t\t\t$this->RESULT[\"rCancelResMsg\"] = \"정상취소\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->RESULT[\"rCancelResMsg\"] = \"취소실패\";\n\t\t\t\t}\n\n\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\"-\".$this->REQUEST[\"SubTy\"].\" \".\"RECV MSG Parsing OK \" );\n\t\t\t}\n\t\t\n\t\t}\n\t\telse if( strcmp( $this->REQUEST[\"AuthTy\"], \"iche\" ) == 0 && strcmp( $this->REQUEST[\"ICHE_SOCKETYN\"], \"Y\" ) == 0)\n\t\t{\n\t\t\t/* [2-1] 계좌이체 인터넷뱅킹 취소*/\t\n\t\t\t/* \t[RB-CanRes|상점ID|posmTid|주문번호|y|취소성공|] */\n\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[1];\n\t\t\t$this->RESULT[\"ICHE_POSMTID\"] = $this->RecvValArray[2];\n\t\t\t$this->RESULT[\"rOrdNo\"] = $this->RecvValArray[3];\n\t\t\t$this->RESULT[\"rCancelSuccYn\"] = $this->RecvValArray[4];\n\t\t\t$this->RESULT[\"rCancelResMsg\"] = $this->RecvValArray[5];\t\t\t\t\n\n\t\t}\n\t\telse if( strcmp( $this->REQUEST[\"AuthTy\"], \"iche\" ) == 0 && strcmp( $this->REQUEST[\"ICHEARS_SOCKETYN\"], \"Y\" ) == 0)\n\t\t{\n\t\t\t/* [2-2] 계좌이체 텔레뱅킹 취소*/\t\n\t\t\t/* \t[TB-CanRes|상점ID|posmTid|주문번호|y|취소성공|] */\n\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[1];\n\t\t\t$this->RESULT[\"rMTid\"] = $this->RecvValArray[2];\n\t\t\t$this->RESULT[\"rCancelSuccYn\"] = $this->RecvValArray[3];\n\t\t\t$this->RESULT[\"rCancelResMsg\"] = $this->RecvValArray[4];\t\t\t\t\t\t\n\t\t\t\n\t\t}\n\t\telse if( strcmp( $this->REQUEST[\"AuthTy\"], \"hp\" ) == 0 )\n\t\t{\n\t\t\t/****************************************************************************\n\t\t\t*\n\t\t\t* [4] 핸드폰 결제 취소\n\t\t\t*\n\t\t\t* -- 취소 응답 전문 포멧\n\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다.\n\t\t\t* |\tMobileCanRes\t|\t업체ID(20)\t| 성공여부(1)\t|\t결과메세지\t|\t취소처리일시\t|\t이용기관주문번호\t|\n\t\t\t*\t\t \n\t\t\t****************************************************************************/\n\t\t\t\n\t\t\t/* \t[MobileCanRes|상점ID|결과(y/n)|결과메세지|취소일시|이용기관주문번호|] */\n\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[1];\n\t\t\t$this->RESULT[\"rCancelSuccYn\"] = $this->RecvValArray[2];\n\t\t\t$this->RESULT[\"rCancelResMsg\"] = $this->RecvValArray[3];\n\t\t\t$this->RESULT[\"rCancelDate\"] = $this->RecvValArray[4];\n\t\t\t$this->RESULT[\"rTid\"] = $this->RecvValArray[5];\t\t\t\t\t\t\n\t\t\t\n\t\t}\n\t\telse if( strcmp( $this->REQUEST[\"AuthTy\"], \"ars\" ) == 0 )\n\t\t{\n\t\t\t/****************************************************************************\n\t\t\t*\n\t\t\t* [5] ARS 결제 취소\n\t\t\t*\n\t\t\t* -- 취소 응답 전문 포멧\n\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다.\n\t\t\t* |\tArsCanRes\t|\t업체ID(20)\t| 성공여부(1)\t|\t결과메세지\t|\t취소처리일시\t|\t이용기관주문번호\t|\n\t\t\t*\t\t \n\t\t\t****************************************************************************/\n\t\t\t\n\t\t\t/* \t[ArsCanRes|상점ID|결과(y/n)|결과메세지|취소일시|이용기관주문번호|] */\n\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[1];\n\t\t\t$this->RESULT[\"rCancelSuccYn\"] = $this->RecvValArray[2];\n\t\t\t$this->RESULT[\"rCancelResMsg\"] = $this->RecvValArray[3];\n\t\t\t$this->RESULT[\"rCancelDate\"] = $this->RecvValArray[4];\n\t\t\t$this->RESULT[\"rTid\"] = $this->RecvValArray[5];\t\t\t\t\t\t\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"Parse CancelMSG Passed \" );\n\t\t\t$this->RESULT[\"rCancelSuccYn\"] = \"n\";\n\t\t\t$this->RESULT[\"rCancelResMsg\"] = \"Cannot Cancel AuthTy[\".$this->REQUEST[\"AuthTy\"].\"]\";\t\n\t\t\treturn false;\n\t\t}\n\t\t$this->log->WriteLog( INFO, \"Parse Cancel Msg End\" );\n\t\treturn true;\n\t}", "public function getBaseShippingCanceled();", "public function cancelBoleto(){\n $cancelamento = Mage::getStoreConfig( 'payment/gwap_boleto/cancelamento' );\n if( is_numeric($cancelamento) && $cancelamento > 0 ){ \n $cancelamento++;\n $due_date = Mage::getModel('core/date')->timestamp( '-'.$cancelamento.' days' );\n }else{\n $due_date = Mage::getModel('core/date')->timestamp( '-2 days' );\n }\n \n $mGwap = Mage::getModel('gwap/order')->getCollection()\n ->addExpireFilter( $due_date )\n ->addTypeFilter('boleto')\n ->addStatusFilter(Indexa_Gwap_Model_Order::STATUS_CAPTUREPAYMENT);\n \n if( $mGwap->count() ){\n foreach ($mGwap as $mGwapitem){\n \n $mGwapitem->setStatus('canceled');\n $mGwapitem->save();\n \n $can_cancel = Mage::getStoreConfig( 'payment/gwap_boleto/cancelar_expirado' );\n \n if( $can_cancel ){\n \n $order = Mage::getModel('sales/order')->load( $mGwapitem->getOrderId() );\n /* var $order Mage_Sales_Model_Order */\n $order->cancel();\n $order->save();\n \n }\n \n }\n }\n return $this;\n }", "protected function cancel(): void\n {\n }", "public function cancelTransaction() {\n return $this->conn->rollBack();\n }", "function last_move ()\n {\n return static::$_last_move;\n }", "public function getShippingCanceled();", "public function getCancelType()\n {\n return $this->cancelType;\n }", "function cancel(){\n\t\t//echo \"In Cancel\";\n\t\t\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ';\n\t\t//echo JFactory::getDate('now', JFactory::getApplication()->getCfg('offset'))->toFormat() . \"\\n<br/><br/>\";\n\t\t\n\t\t//$date = JFactory::getDate();\n\t\t//$date->setOffset(JFactory::getApplication()->getCfg('offset'));\n\t \n\t \t//echo \"Offset: \" . JFactory::getApplication()->getCfg('offset');\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ' . $date->toFormat() . \"\\n\";\n\t\t$date =& JFactory::getDate($time= 'now', $tzOffset=0);\n\n\t\t//$date->setOffset($mainframe->getCfg('offset'));\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ' . $date->toFormat();\n\t\t\n\t\t//echo \"New date: \" . date('Y-m-d H:i:s');\n\n\t\t//return false;\n\t\t\n\t\t$insData =new stdClass();\n\t\t$insData->idt_drivin_event_apply = $_POST['appCanId'];\n\n\t\t//$date = new DateTime();\n\t\t$insData->dt_cancel = date('Y-m-d H:i:s'); //'CURRENT_TIMESTAMP';//$date->getTimestamp();\n\t\t\n\t\t$db = JFactory::getDBO();\n\t\tif(!$db->updateObject( '#__jevent_events_apply', $insData, 'idt_drivin_event_apply' )){\n\t\t\techo $database->stderr();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;//resendCancelEmailById($insData->idt_drivin_event_apply);\n\t}", "public static function diagonallyDismissOpponents($prevX, $prevY, $newX, $newY, $playerNumber, &$boardRows, $direction, &$removedPawnIds, &$errorMsg)\n\t{\n\t\tswitch($direction)\n\t\t{\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_LEFT_UP_DIR : \n\t\t\t\t$diffX = -1;\n\t\t\t\t$diffY = -1;\n\t\t\t\tbreak;\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_RIGHT_UP_DIR : \n\t\t\t\t$diffX = 1;\n\t\t\t\t$diffY = -1;\n\t\t\t\tbreak;\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_LEFT_DOWN_DIR : \n\t\t\t\t$diffX = -1;\n\t\t\t\t$diffY = 1;\n\t\t\t\tbreak;\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_RIGHT_DOWN_DIR : \n\t\t\t\t$diffX = 1;\n\t\t\t\t$diffY = 1;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn null; \n\t\t}\n\n\t\tfor($possiblePosition = self::MIN_POSITION; $possiblePosition <= self::MAX_POSITION; $possiblePosition++)\n\t\t{\n\t\t\tif($prevX+($diffX*$possiblePosition) === $newX && $prevY+($diffY*$possiblePosition) === $newY)\n\t\t\t{\n\t\t\t\tif(($possiblePosition % 2) !== 0)\n\t\t\t\t{\n\t\t\t\t\t$errorMsg = self::ILLEGAL_POS_TEXT . $possiblePosition;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twhile(true)\n\t\t\t\t{\n\t\t\t\t\tif(\t$prevY+$diffY < 0 || \n\t\t\t\t\t\t$prevX+$diffX < 0 || \n\t\t\t\t\t\t$prevY+$diffY > count($boardRows)-1 || \n\t\t\t\t\t\t$prevX+$diffX > count($boardRows)-1)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t//it should not search further if previous and new positions are the same\n\t\t\t\t\tif($prevX === $newX && $prevY === $newY)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t$posEvaluation = $playerNumber === FIRST_PLAYER ? \n\t\t\t\t\t\t($boardRows[$prevY+$diffY][$prevX+$diffX] > PLAYER_PAWNS_AMOUNT) : \n\t\t\t\t\t\t($boardRows[$prevY+$diffY][$prevX+$diffX] > 0 && $boardRows[$prevY+$diffY][$prevX+$diffX] <= PLAYER_PAWNS_AMOUNT);\n\n\t\t\t\t\t//checking if an opponent pawn had been spotted\n\t\t\t\t\tif($posEvaluation)\n\t\t\t\t\t{\n\t\t\t\t\t\t$removedPawnIds[] = intval($boardRows[$prevY+$diffY][$prevX+$diffX]);\n\t\t\t\t\t\t$boardRows[$prevY+$diffY][$prevX+$diffX] = 0;\n\t\t\t\t\t\t$prevX+=$diffX*2;\n\t\t\t\t\t\t$prevY+=$diffY*2;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//if the algorithm didn't reach the end that means that the chosen position is \n\t\t\t\t\t\t//illegal since newX and newY and the last opponent are too far apart\n\t\t\t\t\t\tif($prevX !== $newX && $prevY !== $newY)\n\t\t\t\t\t\t\t$errorMsg = self::ILLEGAL_POS_TEXT . $possiblePosition;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function statusAfterNonPenalizedPlayerMove($currentPlayer, $currentPlace, $currentCategory) {\n\t}", "function MakeCancelMsg() \n\t{\n\t\t$this->log->WriteLog( INFO, \"Make Cancel Msg Start\" );\n\t\tif( strcmp( $this->REQUEST[\"AuthTy\"], \"card\" ) == 0 )\n\t\t{\n\t\t\tif( strcmp( $this->REQUEST[\"SubTy\"], \"isp\" ) == 0 )\n\t\t\t{\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t*\n\t\t\t\t* [1-1] 신용카드승인취소 - ISP\n\t\t\t\t*\n\t\t\t\t* -- 이부분은 취소 승인 처리를 위해 PG서버Process와 Socket통신하는 부분이다.\n\t\t\t\t* 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다.\n\t\t\t\t* -- 데이터 길이는 매뉴얼 참고\n\t\t\t\t*\t \n\t\t\t\t* -- 취소 승인 요청 전문 포멧\n\t\t\t\t* + 데이터길이(6) + 암호화여부(1) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.\n\t\t\t\t* 결제종류(6)\t| 업체아이디(20) \t| 승인번호(20) \t| 승인시간(8)\t| 거래고유번호(6) |\n\t\t\t\t*\n\t\t\t\t* -- 취소 승인 응답 전문 포멧\n\t\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.\n\t\t\t\t* 업체ID(20)\t| 승인번호(20)\t| 승인시각(8)\t| 전문코드(4)\t| 거래고유번호(6)\t| 성공여부(1)\t|\n\t\t\t\t*\t\t \n\t\t\t\t****************************************************************************/\n\t\t\t\t\n\t\t\t\t$this->ENCTYPE = 2;\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* 전송 전문 Make\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\t\t\t\t\t\t\n\t\t\t\t$this->sDataMsg = $this->ENCTYPE.\n\t\t\t\t\"cancel\".\"|\".\n\t\t\t\t$this->GetResult(\"StoreId\").\"|\".\n\t\t\t\t$this->GetResult(\"rApprNo\").\"|\".\n\t\t\t\tsubstr($this->GetResult(\"rApprTm\"),0,8).\"|\".\n\t\t\t\t$this->GetResult(\"rDealNo\").\"|\".\n\t\t\t\t$this->GetResult(\"NetCancID\").\"|\";\n \n\t\t\t\t$this->sSendMsg = sprintf( \"%06d%s\", strlen( $this->sDataMsg ), $this->sDataMsg );\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\"-\".$this->REQUEST[\"SubTy\"].\" \".\"Make Cancel MSG OK \" );\n\t\t\t}\n\t\t\telse if( ( strcmp( $this->REQUEST[\"SubTy\"], \"visa3d\" ) == 0 ) || ( strcmp( $this->REQUEST[\"SubTy\"], \"normal\" ) == 0 ) )\n\t\t\t{\n\t\t\t\t/****************************************************************************\n\t\t\t\t*\n\t\t\t\t* [1-2] 신용카드승인취소 - VISA3D, 일반\n\t\t\t\t*\n\t\t\t\t* -- 이부분은 취소 승인 처리를 위해 암호화Process와 Socket통신하는 부분이다.\n\t\t\t\t* 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다.\n\t\t\t\t*\n\t\t\t\t* -- 취소 승인 요청 전문 포멧\n\t\t\t\t* + 데이터길이(6) + 암호화여부(1) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 하며 카드번호,유효기간,비밀번호,주민번호는 암호화된다.)\n\t\t\t\t* 결제종류(6)\t| 업체아이디(20) \t| 승인번호(8) \t| 승인시간(14) \t| 카드번호(16) \t|\n\t\t\t\t*\n\t\t\t\t* -- 취소 승인 응답 전문 포멧\n\t\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다.\n\t\t\t\t* 업체ID(20)\t| 승인번호(8)\t| 승인시각(14)\t| 전문코드(4)\t| 성공여부(1)\t|\n\t\t\t\t* 주문번호(20)\t| 할부개월(2)\t| 결제금액(20)\t| 카드사명(20)\t| 카드사코드(4) \t|\n\t\t\t\t* 가맹점번호(15)\t| 매입사코드(4)\t| 매입사명(20)\t| 전표번호(6)\n\t\t\t\t*\t\t \n\t\t\t\t****************************************************************************/\n\t\t\t\t\n\t\t\t\t$this->ENCTYPE = 0;\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* 전송 전문 Make\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\n\t\t\t\t$this->sDataMsg = $this->ENCTYPE.\n\t\t\t\t\"cancel\".\"|\".\n\t\t\t\t$this->GetResult(\"StoreId\").\"|\".\n\t\t\t\t$this->GetResult(\"rApprNo\").\"|\".\n\t\t\t\tsubstr($this->GetResult(\"rApprTm\"),0,8).\"|\".\n\t\t\t\t$this->GetResult(\"rDealNo\").\"|\".\n\t\t\t\t$this->GetResult(\"NetCancID\").\"|\";\n\n\t\t\t\t$this->sSendMsg = sprintf( \"%06d%s\", strlen( $this->sDataMsg ), $this->sDataMsg );\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\"-\".$this->REQUEST[\"SubTy\"].\" \".\"Make Cancel MSG OK \" );\n\t\t\t}\n\t\t}else if( strcmp( $this->REQUEST[\"AuthTy\"], \"iche\" ) == 0 && strcmp( $this->REQUEST[\"ICHE_SOCKETYN\"], \"Y\" ) == 0){\n\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* [2-1] 인터넷뱅킹 계좌이체(소켓) 취소처리\n\t\t\t\t* \n\t\t\t\t* -- 이부분은 인터넷뱅킹 결제 취소처리를 위해 암호화Process와 Socket통신하는 부분이다.\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* + 데이터길이(6) + 암호화여부(1) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.)\n\t\t\t\t* 결제종류(10)\t\t| 업체ID(20)\t\t| MTID(계좌이체결제 결과값)\t\t| 결제금액(8)\t\t| 은행코드(2)\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\n\t\t\t\t$this->ENCTYPE = R;\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* 전송 전문 Make\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\n\t\t\t\t$this->sDataMsg = $this->ENCTYPE.\n\t\t\t\t\t\"RB-CanReq\".\"|\".\n\t\t\t\t\t$this->GetResult(\"StoreId\").\"|\".\n\t\t\t\t\t$this->GetResult(\"ICHE_POSMTID\").\"|\".\n\t\t\t\t\t$this->GetResult(\"Amt\").\"|\".\n\t\t\t\t\t$this->GetResult(\"ICHE_OUTBANKNAME\").\"|\".\n\t\t\t\t\t$this->GetResult(\"NetCancID\").\"|\";\n\t\t\t\t\t\n\t\t\t\t$this->sSendMsg = sprintf( \"%06d%s\", strlen( $this->sDataMsg ), $this->sDataMsg );\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"Make Cancel MSG OK \" );\n\t\t\n\t\t}else if( strcmp( $this->REQUEST[\"AuthTy\"], \"iche\" ) == 0 && strcmp( $this->REQUEST[\"ICHEARS_SOCKETYN\"], \"Y\" ) == 0){\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* [2-1] 텔레뱅킹 계좌이체(소켓) 취소처리\n\t\t\t\t* \n\t\t\t\t* -- 이부분은 텔레뱅킹 결제 취소처리를 위해 암호화Process와 Socket통신하는 부분이다.\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* + 데이터길이(6) + 암호화여부(1) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.)\n\t\t\t\t* 결제종류(10)\t\t| 업체ID(20)\t\t| MTID(계좌이체결제 결과값)\t\t| 결제금액(8)\t\t| 은행코드(2)\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\n\t\t\t\t$this->ENCTYPE = B;\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* 전송 전문 Make\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\n\t\t\t\t$this->sDataMsg = $this->ENCTYPE.\n\t\t\t\t\t\"TB-CanReq\".\"|\".\n\t\t\t\t\t$this->GetResult(\"StoreId\").\"|\".\n\t\t\t\t\t\"\".\"|\".\n\t\t\t\t\t\"\".\"|\".\n\t\t\t\t\t$this->GetResult(\"NetCancID\").\"|\";\n\t\t\t\t\t\n\t\t\t\t$this->sSendMsg = sprintf( \"%06d%s\", strlen( $this->sDataMsg ), $this->sDataMsg );\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"Make Cancel MSG OK \" );\n\t\t\n\t\t}else if( strcmp( $this->REQUEST[\"AuthTy\"], \"hp\" ) == 0 ){\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* [3] 핸드폰 취소처리\n\t\t\t\t* \n\t\t\t\t* -- 이부분은 핸드폰 결제 취소처리를 위해 암호화Process와 Socket통신하는 부분이다.\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* + 데이터길이(6) + 암호화여부(1) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.)\n\t\t\t\t* 결제종류(10)\t\t| 업체ID(20)\t| NetCancID\t\t|\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\n\t\t\t\t$this->ENCTYPE = H;\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* 전송 전문 Make\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\t\t\t\t$this->sDataMsg = $this->ENCTYPE.\n\t\t\t\t\t\"MobileCanReq\".\"|\".\n\t\t\t\t\t$this->GetResult(\"StoreId\").\"|\".\n\t\t\t\t\t$this->GetResult(\"NetCancID\").\"|\";\n\t\t\t\t\t\n\t\t\t\t$this->sSendMsg = sprintf( \"%06d%s\", strlen( $this->sDataMsg ), $this->sDataMsg );\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"Make Cancel MSG OK \" );\n\t\t\n\t\t}else if( strcmp( $this->REQUEST[\"AuthTy\"], \"ars\" ) == 0 ){\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* [4] ARS 취소처리\n\t\t\t\t* \n\t\t\t\t* -- 이부분은 ARS 결제 취소처리를 위해 암호화Process와 Socket통신하는 부분이다.\n\t\t\t\t* 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다.\n\t\t\t\t* -- 데이터 길이는 매뉴얼 참고\n\t\t\t\t* \n\t\t\t\t* -- ARS 결제 요청 전문 포멧\n\t\t\t\t* + 데이터길이(6) + 암호화여부(1) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.)\n\t\t\t\t* 결제종류(10)\t\t| 업체ID(20)\t| NetCancID\t\t|\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\n\t\t\t\t$this->ENCTYPE = A;\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* 전송 전문 Make\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\t\t\t\t$this->sDataMsg = $this->ENCTYPE.\n\t\t\t\t\t\"ARSCanReq\".\"|\".\n\t\t\t\t\t$this->GetResult(\"StoreId\").\"|\".\n\t\t\t\t\t$this->GetResult(\"NetCancID\").\"|\";\n\t\t\t\t\t\n\t\t\t\t$this->sSendMsg = sprintf( \"%06d%s\", strlen( $this->sDataMsg ), $this->sDataMsg );\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"Make Cancel MSG OK \" );\n\t\t\n\t\t}else{\n\t\t\t//신용카드,계좌이체 이외의 결제수단은 취소기능 적용되지 않음.\n\t\t\t$this->log->WriteLog( WARN, \"Cancel Passed. AuthTy : [\".$this->REQUEST[\"AuthTy\"].\"-\".$this->REQUEST[\"SubTy\"].\"] \" );\n\t\t\t$this->RESULT[\"rCancelSuccYn\"] = \"n\";\n\t\t\t$this->RESULT[\"rCancelResMsg\"] = \"Cannot Cancel AuthTy[\".$this->REQUEST[\"AuthTy\"].\"]\";\t\t\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\t$this->log->WriteLog( INFO, \"Make Cancel Msg End\" );\n\t\treturn true;\n\t}", "public function cancel()\n {\n $user = Auth::user();\n\n if ( $user->cancel_rank() )\n flash('Your place request was canceled.')->success()->important();\n\n if ( $user->cancel_place() )\n flash('Your place as been removed.')->success()->important();\n\n return redirect()->back();\n }", "public function cancelOrder(Mage_Sales_Model_Order $order)\n {\n try {\n // works for 1.8 and 1.9\n $order->registerCancellation();\n } catch (Mage_Core_Exception $e) {\n // exist for backward compatibility with Magento 1.7\n $cancelState = Mage_Sales_Model_Order::STATE_CANCELED;\n /** @var Mage_Sales_Model_Order_Item $item */\n foreach ($order->getAllItems() as $item) {\n if ($cancelState != Mage_Sales_Model_Order::STATE_PROCESSING && $item->getQtyToRefund()) {\n if ($item->getQtyToShip() > $item->getQtyToCancel()) {\n $cancelState = Mage_Sales_Model_Order::STATE_PROCESSING;\n } else {\n $cancelState = Mage_Sales_Model_Order::STATE_COMPLETE;\n }\n }\n $item->cancel();\n }\n\n $order->setSubtotalCanceled($order->getSubtotal() - $order->getSubtotalInvoiced());\n $order->setBaseSubtotalCanceled($order->getBaseSubtotal() - $order->getBaseSubtotalInvoiced());\n\n $order->setTaxCanceled($order->getTaxAmount() - $order->getTaxInvoiced());\n $order->setBaseTaxCanceled($order->getBaseTaxAmount() - $order->getBaseTaxInvoiced());\n\n $order->setShippingCanceled($order->getShippingAmount() - $order->getShippingInvoiced());\n $order->setBaseShippingCanceled($order->getBaseShippingAmount() - $order->getBaseShippingInvoiced());\n\n $order->setDiscountCanceled(abs($order->getDiscountAmount()) - $order->getDiscountInvoiced());\n $order->setBaseDiscountCanceled(\n abs($order->getBaseDiscountAmount()) - $order->getBaseDiscountInvoiced()\n );\n\n $order->setTotalCanceled($order->getGrandTotal() - $order->getTotalPaid());\n $order->setBaseTotalCanceled($order->getBaseGrandTotal() - $order->getBaseTotalPaid());\n\n $order->setState($cancelState, true);\n }\n\t $order->save();\n }", "public function getCancelReason()\n {\n return $this->cancel_reason;\n }", "public function actionCancel()\n {\n }", "function userActionMove( $actionRequest ) {\n\t\n\t// Find the location of all possible commands issued\n\t$pos[\"go to the\"] = strpos( $actionRequest, \"go to the \");\n\t$pos[\"go to\"] = strpos( $actionRequest, \"go to \");\n\t$pos[\"goto\"] = strpos( $actionRequest, \"goto \");\n\t$pos[\"go\"] = strpos( $actionRequest, \"go \");\n\t$pos[\"move\"] = strpos( $actionRequest, \"move \");\n\t\n\t// Figure out which one it was, and record start position\n\tif( $pos[\"go to\"] == 0 && $pos[\"go to\"] !== false ) {\n\t\t$itemStart = 6;\n\t} else if ( $pos[\"go to the\"] == 0 && $pos[\"go to the\"] !== false ) {\n\t\t$itemStart = 5;\n\t} else if ( $pos[\"goto\"] == 0 && $pos[\"goto\"] !== false ) {\n\t\t$itemStart = 5;\n\t} else if ( $pos[\"go\"] == 0 && $pos[\"go\"] !== false ) {\n\t\t$itemStart = 3;\n\t} else if ( $pos[\"move\"] == 0 && $pos[\"move\"] !== false ) {\n\t\t$itemStart = 5;\n\t} else {\n\t\t// No keyword, ie. user typed \"north\"\n\t\t$itemStart = 0;\n\t\taddServerMessageToXML(\"----userActionMove function with no move keyword\");\n\t}\n\t\n\t// Find the exit\n\t$exitName = substr( $actionRequest, $itemStart );\n\t$result = $exit = getEntity( $exitName, $_SESSION['location'], \"exit\", true);\n\t\n\t// Try to go through the exit\n\tif( $exit ) {\n\t\t\t// TODO: If user passes lock\n\t\t\t$user['id'] = $_SESSION['userID'];\n\t\t\t$user['type'] = \"user\";\n\t\t\t$user['name'] = $_SESSION['username'];\n\t\t\tif( moveUser( $exit ) ) {\n\t\t\t\tuserActionFullUpdate();\n\t\t\t}\n\t\t\t// If user fails lock\n\t\t\t\t// addNarrativeToXML( $exit['fail'] );\n\n\t}\n\treturn $result;\n}", "public function cancel() {\n\t\t$this->workflowActivitySpecification->setState(WorkflowActivityStateEnum::CANCELLED);\n\n\t\tif ($this->runtimeContext)\n\t\t\t$this->workflowActivity->onCancel($this->runtimeContext);\n\t}", "public static function find_move ()\n {\n // Initialize the default value functions. These apply starting values\n // to each position on the board. The starting values are then used\n // in calculating the overall value of moving in each direction.\n $my_color = Map::current('color');\n static::$_value_functions = [\n '^c.$' => config::SCORE_OTHER_BOTS,\n \"^.$my_color\\$\" => config::SCORE_OWN_COLOR,\n '^.*$' => config::SCORE_OTHER_COLOR,\n ];\n // Initialize a default value matrix.\n static::$_value_matrix = static::_generate_value_matrix();\n // Load the default available commands.\n $commands = config::VALID_MOVES;\n // Retrieve coordinates for available moves from the current map.\n // Any invalid moves will get set to null.\n $available_moves = [];\n foreach ($commands as $command) {\n $available_moves[$command] = Map::get(Map::translate($command, Map::current('x'), Map::current('y')));\n }\n // Remove invalid directions -- edges of map and any adjacent tiles\n // containing another bot (and, for now, the \"idle\" command too).\n unset($available_moves['idle']);\n $available_moves = array_filter($available_moves, function($move){\n if ( is_null($move) || substr($move, 0, 1) == 'c' ) {\n return false;\n }\n return true;\n });\n // For now, let's continue this helpful debugging output. TODO.\n print_r($available_moves);\n // Select a strategy.\n // If there is only one move (or no moves), fall back to the \"stuck\"\n // strategy. In the future this strategy might do something cool.\n if ( count($available_moves) < 2 ) {\n return static::stuck($available_moves);\n }\n // If the bot is surrounded by its own color and all moves have negative\n // values, try escaping.\n if ( count(preg_grep(\"/^.$my_color\\$/\", $available_moves)) == count($available_moves) ) {\n echo \"Yipes! Surrounded by own color...\\n\";\n $positive_scores = array_filter(static::evaluate_moves($available_moves), function($score){\n return $score > 0;\n });\n if ( count($positive_scores) == 0 ) {\n return static::escape($available_moves);\n }\n }\n // Now that urgent situations are resolved, look at nearby bots and\n // consider their behavior.\n $bots = Map::get_bots();\n $my_bot = $bots[Map::current('x') . '/' . Map::current('y')];\n foreach ($bots as $location => $bot) {\n if ( $bot->color != $my_color && Map::distance($bot->x, $bot->y, Map::current('x'), Map::current('y')) < 10 && $bot->status() != 'inactive' ) {\n echo \"Nearby active opponent: \" . $bot->name . \"\\n\";\n // Check their move history against this bot's move history;\n // if they share more than 5 moves out of the last 20...\n $my_moves = array_filter($my_bot->get_recent_moves(20));\n $their_moves = array_filter($bot->get_recent_moves(20));\n $my_overlap = array_intersect($my_moves, $their_moves);\n $their_overlap = array_intersect($their_moves, $my_moves);\n // ...then try to figure out who's following who, and if the\n // other bot is following this bot, then switch to the \"punish\"\n // strategy.\n if ( count($their_overlap) > 5 && array_sum(array_keys($my_overlap)) > array_sum(array_keys($their_overlap)) ) {\n // If this bot's matching movement indices are generally\n // higher than the other bot's, then that means they've made\n // matching moves more recently, so the other bot can be\n // assumed to be following this one.\n return static::punish($available_moves, $bot);\n }\n }\n }\n // If more than 20% of the tiles on the map are unclaimed, then select\n // a friendlier, less aggressive movement pattern.\n if ( Map::count('ux') > array_product(Map::size()) * .2 ) {\n return static::cruise($available_moves);\n }\n // Default strategy: best local move.\n return static::aggressive($available_moves);\n }", "public function cancel()\n {\n $this->resetInput();\n $this->updateMode = false;\n }", "function cancel() \r\n\t\t{\r\n\t $msg = JText::_('COM_QRCODE_CANCEL');\r\n\t $this->setRedirect(JRoute::_('index.php?option=com_qrcode', false), $msg);\r\n\t }", "public function cancelAction()\n {\n \n $po_order_id = $this->getRequest()->getParam('po_order_id');\n \n Mage::dispatchEvent('purchase_order_stockmovement_cancel_po', array('po_order_id'=>$po_order_id)); \n \n //move to 'purchase_order_stockmovement_cancel' event to handle.\n /*$collection = mage::getModel('Purchase/StockMovement')\n ->getCollection()\n ->addFieldToFilter('sm_po_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n }\n */\n /*\n $order = mage::getModel('Purchase/Order')->load($po_num);\n foreach ($order->getProducts() as $item)\n {\n $productId = $item->getpop_product_id();\n Mage::dispatchEvent('purchase_update_supply_needs_for_product', array('product_id'=>$productId));\n }\n */\n \n //Move to order cancel funciton.\n /*$collection = mage::getModel('purchase/orderitem')\n ->getCollection()\n ->addFieldToFilter('pop_order_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n } */\n \n \n $purchaseOrder = Mage::getModel('purchase/order')->load($po_order_id);\n\n $purchaseOrder->cancel();\n \n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Purchase order successfully Canceled'));\n \n $this->_redirect('purchase/orders/list');\n }", "public function getPreviousState();", "public function _consumeFrame() {\n if (\\count($this->frames) == 0) return false;\n $frame = $this->frames[0];\n $this->frames = array_slice($this->frames, 1);\n return $frame;\n }", "public function getClearExcavateBattleReply()\n {\n return $this->get(self::_CLEAR_EXCAVATE_BATTLE_REPLY);\n }", "public function cancelAction() {\n\n return $this->_redirect('/order_basis/payment');\n }", "public function cancelAction()\n {\n $params = $this->getRequest()->getParams();\n if (array_key_exists('shipment', $params)) {\n $shipment = Mage::getModel('sales/order_shipment')->load($params['shipment']);\n if (Mage::helper('iparcel/api')->cancelShipment($shipment)) {\n Mage::getSingleton('adminhtml/session')->addSuccess('Shipment canceled');\n }\n }\n\n $this->_redirectReferer();\n return true;\n }", "function cancelar()\r\n\t{\r\n\t\t$this->_log->debug( $this->get_txt() . \"[ cancelar ]\", 'toba');\r\n\t\t$this->limpiar_memoria();\r\n\t}", "function suspendCurrent()\n {\n $this->currentTcb->markAsSuspended();\n return $this->currentTcb;\n }", "public function cancel()\n {\n session()->flash('warning', trans('saassubscription::app.super-user.plans.payment-cancel'));\n\n return redirect()->route($this->_config['redirect']);\n }", "public function getMovedSignal()\n {\n return $this->_movedSignal;\n }", "public function getCancelledMessage(){\n \treturn $this->canc_message;\n }", "function cancelPending() {\n\t\tself::$_db->saveQry(\"SELECT `ID` FROM `#_reservations` \".\n\t\t\t\t\"WHERE (`status` = 'pending' OR `status` = 'prefered') \".\n\t\t\t\t\"AND ? >= `startTime` \",\n\t\t\t\tCalendar::startCancel());\n\t\t\n\n\t\twhile($res = self::$_db->fetch_assoc())\n\t\t\tReservation::load($res['ID'])->failed();\n\t\t\n\t\t\n\t\t// TagesEnde - BuchungsCancelZeit ist kleiner als Aktueller Zeitblock\n\t\tif(Calendar::calculateTomorrow()) {\n\t\t\t$opening = Calendar::opening(date('Y-m-d', strtotime(\"tomorrow\")));\n\t\t\tself::$_db->saveQry(\"SELECT * FROM `#_reservations` \".\n\t\t\t\t\t\"WHERE (`status` = 'pending' OR `status` = 'prefered') \".\n\t\t\t\t\t\"AND ? <= `startTime` AND `startTime` <= ? \",\n\t\t\t\t\t$opening->format(\"Y-m-d H:i\"), \n\t\t\t\t\tCalendar::startCancel($opening));\n\t\t\t\n\t\t\twhile($res = self::$_db->fetch_assoc())\n\t\t\t\tReservation::load($res['ID'])->failed();\n\t\t}\n\t\t\n\t}", "function ostGetCanceledStatusId()\r\n{\r\n\treturn 1;\r\n}", "public function isCanceled(): bool\n {\n return $this->status == 'canceled';\n }", "protected function changeStateCheck()\n {\n if (empty($this->boardNewMoves)) {\n throw new BoardException(Yii::t('app', 'No move detected.'));\n }\n // Make sure 1 move has been made.\n if (count($this->boardNewMoves) > 1) {\n throw new BoardException(Yii::t('app', 'Only one move per request allowed.'));\n }\n\n // Make sure proper character used.\n $allowedCharacter = $this->moveCharacterMap[($this->getTotalMoves() + 1) % 2];\n if (($moveCharacter = $this->getNewMoveCharacter()) != $allowedCharacter) {\n throw new BoardException(Yii::t('app', 'You have to use character \"{allowedCharacter}\" instead of \"{moveCharacter}\"', [\n 'allowedCharacter' => $allowedCharacter,\n 'moveCharacter' => $moveCharacter,\n ]));\n }\n\n // Make sure that character has been placed into the proper position (not overriding existing).\n if (in_array($this->boardArr[$this->getNewMovePosition()], $this->moveCharacterMap)) {\n throw new BoardException(Yii::t('app', 'You are not allowed to override existing moves.'));\n }\n }", "public function getHoldBeforeStatus();", "function lightseek_move_yoast() {\n return 'low';\n}", "public static function stuck ($available_moves)\n {\n if ( count($available_moves) == 1 ) {\n $direction = array_keys($available_moves)[0];\n return ['move' => $direction, 'logmsg' => \"stuck; $direction; xy:\" . Map::current('x') . \",\" . Map::current('y')];\n }\n // TODO: This should check for multiple recent stucks and attempt a\n // teleportation if nothing else is working.\n return ['move' => 'idle', 'logmsg' => \"stuck; idle; xy:\" . Map::current('x') . \",\" . Map::current('y')];\n }", "public function message()\n {\n return 'You can not cancel this session, please check cancellation policy.';\n }", "function getPreviousState();", "function move($original, $destination)\n{\n require(\"../includes/global.php\");\n\n // get the up to date board and turns information\n $board = $_SESSION['board'];\n $turns = $_SESSION['turns'];\n \n if ($board[$destination[0]][$destination[1]][\"piece\"] != \"empty\" && \n $board[$original[0]][$original[1]][\"white\"] == $board[$destination[0]][$destination[1]][\"white\"])\n {\n echo(\"<h3 id='h3'>You can't capture your own piece!</h3>\");\n render(\"playchess.php\");\n }\n if ($board[$destination[0]][$destination[1]][\"piece\"] == \"king\")\n {\n echo(\"<h3 id='h3'>You can't capture a king!</h3>\");\n render (\"playchess.php\");\n }\n \n // stores the contents of the destination square, just in case you've put yourself into check and need to change things back\n $temp = $board[$destination[0]][$destination[1]];\n // puts chess piece into destination square\n $board[$destination[0]][$destination[1]] = $board[$original[0]][$original[1]];\n // makes original square empty\n $board[$original[0]][$original[1]] = [\"ascii\" => \"\", \"white\" => \"nope not quite\", \"piece\" => \"empty\"];\n\n $_SESSION['board'] = $board;\n \n // if you've put yourself into check\n if (($turns % 2 == 0 && iswhitechecked() == true) || ($turns % 2 == 1 && isblackchecked() == true))\n {\n\n // the move is illegal, so you need to restore the board back to its original position\n $board[$original[0]][$original[1]] = $board[$destination[0]][$destination[1]];\n $board[$destination[0]][$destination[1]] = $temp;\n $_SESSION['board'] = $board;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>That move puts you in check!</h3>\");\n render(\"playchess.php\");\n }\n else\n {\n $turns++;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>The overlords approve.</h3>\");\n render(\"playchess.php\");\n }\n}", "public function canceledit($value) {\n return $this->setProperty('canceledit', $value);\n }", "public function canceledit($value) {\n return $this->setProperty('canceledit', $value);\n }", "public static function escape ($available_moves)\n {\n $destination = static::nearest_exit();\n if ( empty($destination) ) {\n // Something has gone terribly wrong.\n return static::stuck([]);\n }\n $current_x = Map::current('x');\n $current_y = Map::current('y');\n $current_distance = Map::distance($current_x, $current_y, $destination['x'], $destination['y']);\n foreach ($available_moves as $direction => $value) {\n list($move_x, $move_y) = Map::translate($direction, $current_x, $current_y);\n if ( Map::distance($move_x, $move_y, $destination['x'], $destination['y']) < $current_distance ) {\n return ['move' => $direction, 'logmsg' => \"escape; $direction; xy:$current_x,$current_y\"];\n }\n }\n // Okay, can't get there from here right now.\n return static::stuck([]);\n }", "public function move(){\r\n\t\t\tif( empty($lastShot) ){\r\n\t\t\t\t$lastShot = new Play( $initialRow, $initialRow );\r\n\t\t\t\treturn $lastShot;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t//if it is not empty, and is on the last cell\r\n\t\t\t\t//go to the first column of next row\r\n\t\t\t\tif( $lastShot.getX() == 10 ){\r\n\t\t\t\t\t$lastShot.setX( $initialRow );\r\n\t\t\t\t\t$lastShot.setY( $lastShot.getY() + 1 );\r\n\t\t\t\t}\r\n\t\t\t\t//if it is not in the last cell, then move 1 cell to the right.\r\n\t\t\t\telse{\r\n\t\t\t\t\t$lastShot.setX( $lastShot.getX() + 1 );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public function Cancel()\n {\n $prevMode = $this->m_Mode;\n $this->SetDisplayMode(MODE_R);\n if ($prevMode == MODE_N) // NEW mode to READ mode, has record change, need to refresh the subforms\n return $this->ReRender(true, true);\n // EDIT to READ, no record change\n return $this->ReRender(true,false);\n }", "function getNextAction($myPositionX, $myPositionY, $game, $map, $bombs, $opponents, $bonuses, $allObstacles, $allActions, $logger, $directionToAvoid = null)\n{\n\t$thereIsABomb = false;\n\t$coordinatesInfo = getCoordinatesInfo($myPositionX, $myPositionY, $game, $map, $bombs, $opponents, $bonuses);\n\t$typeOfObstacle = $coordinatesInfo[\"typeOfObstacle\"];\n\t$moveAvailable = $coordinatesInfo[\"moveAvailable\"];\n\n\tif(in_array($allObstacles[\"bomb\"], $typeOfObstacle) || $game->state->findActiveBombAt($myPositionX, $myPositionY)) //bomb discovered\n\t{\n\t\t$action = runFromBomb($moveAvailable, $typeOfObstacle, $allActions, $allObstacles, $game, $logger);\n\t\t$thereIsABomb = true;\n\t}\n\telseif(in_array($allObstacles[\"opponent\"], $typeOfObstacle)) //opponent discovered \n\t{\n\t\t$action = huntOpponent($moveAvailable, $typeOfObstacle, $allActions, $allObstacles, $logger);\n\t}\n\telseif(in_array($allObstacles[\"destroyable_block\"], $typeOfObstacle)) //destroyable block discovered\n\t{\n\t\t$action = destroyBlock($moveAvailable, $typeOfObstacle, $allActions, $allObstacles, $logger, $directionToAvoid);\n\t}\n\telse{ //just free path\n\t\t$action = runRandom($moveAvailable, $typeOfObstacle, $allActions, $allObstacles, $logger);\n\t}\n\n\treturn [\n\t\t'action' => $action,\n\t\t'thereIsABomb' => $thereIsABomb,\n\t\t'typeOfObstacle' => $typeOfObstacle,\n\t\t'moveAvailable' => $moveAvailable\n\t];\n}", "public function getCancelHoldDetails($holdDetails)\n {\n return $holdDetails['available'] || $holdDetails['in_transit'] ? ''\n : $holdDetails['item_id'];\n }", "public function cancel()\n {\n $message = new MailMessage;;\n $message->greeting(\"Hi {$this->post->user->name}!\");\n $message->line(\"The post {$this->post->titile} has been cancelled successfully.\"); \n foreach ($this->workflow as $key => $value) {\n if ($key == 0) {\n $message->action($value->action, url('workflows/workflow/' . $value->id));\n continue;\n }\n $message->line('<a href=\"'.url('workflows/workflow/' . $value->id).'\">'.$value->action.'</a>');\n }\n\n return $message;\n }", "protected function botMove() {\n $key = $this->thinkBot();\n return $key;\n }", "public function currentPlayer() {\n $p = 'x';\n foreach ($this->moves as $move) {\n $p = ($move->player == 'x') ? 'o' : 'x';\n }\n return $p;\n }", "public function cancelorder($order,$rmaid){\n $flag = 0;\n if ($order->canCancel()) {\n $order->getPayment()->cancel();\n $flag = $this->mpregisterCancellation($order,$rmaid);\n }\n\n return $flag;\n }", "function getCurTrackRemaining(){\n\t}", "protected function cancelAppointmentRequest($args) {\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '2');\n\n if (is_array($returned))\n return $returned;\n\n $checkBookingsQry = \"select appointment_id from appointment where slave_id = '\" . $this->User['entityId'] . \"' and status IN (6,7,8)\";\n $checkBookingsRes = mysql_query($checkBookingsQry, $this->db->conn);\n\n if (mysql_num_rows($checkBookingsRes) > 0)\n return $this->_getStatusMessage(93, 93);\n\n if ($this->_updateSlvApptStatus($this->User['entityId'], '3') == 0)\n return $this->_getStatusMessage(74, 74);\n else\n return $this->_getStatusMessage(3, 1);\n }", "public function cancel()\n {\n $this->confirmationArchived = false;\n }", "public function cancel_experience_booking_payment()\n\t{\t\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect('admin');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t$this->data['heading'] = 'Experience Cancellation Payments';\n\t\t\t\n\t\t\t$condition = array('cancelled','Yes');\n\t\t\t$CustomerDetails = $this->review_model->get_all_experienced_cancelled_users();\t\t\n\t\t\t\n\t\t\tforeach($CustomerDetails->result() as $customer)\n\t\t\t{\n\t\t\t\t$customer_id = $customer->id;\n\t\t\t\t$cancel[] = $this->review_model->get_all_experience_commission_tracking($customer_id);\n\t\t\t\t$this->data['paypalData'][$HostEmail] = $customer->paypal_email;\t\t\t\t\n\t\t\t}\n\n\t\t\t$this->data['trackingDetails'] = $cancel;\n\t\t\t$this->load->view('admin/dispute/display_experience_cancel_payment_lists',$this->data);\n\t\t}\n\t}", "public function isCanceled()\n {\n return static::STATUS_CANCELED == $this->getStatus();\n }", "public function getCancelUrl() {\n return $this->getReturnUrl();\n }", "abstract protected function play(array $move = array());", "public function cancelOperation() {\n printf(\"Cancelling...\\n\");\n $this->_cancelled = true;\n posix_kill($this->_pid, SIGKILL);\n pcntl_signal_dispatch();\n }", "protected function userMove() {\n echo \"Your move: \";\n $move = FALSE;\n while ($move === FALSE) {\n $move = $this->isValidMove();\n if ($move === FALSE)\n echo $this->promptMessage('invalid_move');\n }\n if (strtoupper($move) == self::QUIT_BUTTON)\n return TRUE;\n\n\n echo \"Your move is '\" . $this->_userMark . \"' at box \" . $move . PHP_EOL;\n $this->_markers[$this->_userMark][] = $move;\n $this->drawBoard($this->_markers);\n if ($this->isWon($this->_userMark) || $this->isBoardFull())\n return TRUE;\n return FALSE;\n }", "protected function isValidMove($move = NULL) {\n $hasValidMove = FALSE;\n if (isset($move)) {\n if (isset($this->_boardResponse[$move]) && $this->isCellOpen($move))\n return $move;\n return false;\n } else {\n while (TRUE) {\n $move = strtoupper($this->userInput());\n if (isset($this->_boardResponse[$move]) && $this->isCellOpen($move))\n return $move;\n return false;\n }\n }\n }", "public function holdingBack(){\n\t\treturn $this->_sendPacketToController(self::HOLDING_BACK);\n\t}", "function action_spipbb_move()\n{\n\tglobal $spip_lang_left, $spipbb_fromphpbb, $dir_lang, $time_start;\n\t$securiser_action = charger_fonction('securiser_action', 'inc');\n\t$arg = $securiser_action();\n\n\tlist($objet, $id_item, $statut) = preg_split('/\\W/', $arg);\n\n\t$id_item = intval($id_item);\n\t$redirige = urldecode(_request('redirect'));\n\t$id_rubrique = _request('id_rubrique');\n\n\tif (!empty($id_rubrique)) $redirige = parametre_url($redirige, 'id_rubrique', $id_rubrique, '&') ;\n\tif (!$id_item) {\n\t\tredirige_par_entete($redirige);\n\t\texit;\n\t}\n\n\t$row = sql_fetsel(\"id_\".$objet.\" , titre\", \"spip_\".$objet.\"s\", \"id_\".$objet.\"='$id_item'\");\n\tif (!$row) {\n\t\tredirige_par_entete($redirige);\n\t\texit;\n\t}\n\n\tswitch ($statut) {\n\tcase \"up\" :\n\t\t$move_increment = -15;\n\t\tbreak;\n\tcase 'down' :\n\t\t$move_increment = +15;\n\t\tbreak;\n\tdefault :\n\t\t$move_increment = 0;\n\t\tbreak;\n\t}\n\tif (!function_exists('recuperer_numero')) include_spip('inc/filtres');\n\n\t$ancien_numero = recuperer_numero($row['titre']) ;\n\t$nouveau_numero = $ancien_numero + $move_increment;\n\n\tif ( ($move_increment==0) OR ($nouveau_numero<5)) {\n\t\tredirige_par_entete($redirige);\n\t\texit;\n\t}\n\n\t$titre = supprimer_numero($row['titre']);\n\tif ($nouveau_numero<10) $titre = \"0\" . $nouveau_numero . \". \".trim($titre);\n\telse $titre = $nouveau_numero . \". \".trim($titre);\n\n\t@sql_updateq(\"spip_\".$objet.\"s\", array(\n\t\t\t\t\t'titre'=>$titre\n\t\t\t\t\t),\n\t\t\t\"id_$objet='$id_item'\");\n\n\tspipbb_renumerote();\n}", "public function bestMove(Board $board): ?string\n {\n $moves = $board->getMoves();\n $ryMove = $board->ryMove;\n $bestValue = $ryMove ? 99999 : -99999;\n $bestMove = null;\n if (count($moves) === 1) {\n return reset($moves);\n }\n $this->apiHandler->clear();\n foreach ($moves as $move) {\n $board->move($move);\n $newValue = $this->minimax($this->depth - 1, -100000, 100000, $board);\n if ($ryMove ? $newValue < $bestValue : $newValue > $bestValue) {\n $bestMove = $move;\n $bestValue = $newValue;\n if ($this->shouldSendArrows) {\n $this->apiHandler->clear();\n $this->apiHandler->arrow($move[0], $move[1]);\n }\n }\n $board->undo();\n }\n return $bestMove;\n }" ]
[ "0.58322465", "0.5823302", "0.5767278", "0.53100234", "0.52965194", "0.52627516", "0.5233544", "0.51913166", "0.5189763", "0.5069623", "0.50340456", "0.5015053", "0.4858796", "0.4858796", "0.48449868", "0.48411712", "0.48077136", "0.47916982", "0.47732615", "0.4769645", "0.47553325", "0.47463915", "0.47355756", "0.47098365", "0.47044864", "0.4704098", "0.47009802", "0.4686301", "0.46699566", "0.4668372", "0.4666108", "0.4657315", "0.46572092", "0.46470308", "0.4643813", "0.46395537", "0.46388155", "0.4617835", "0.46138555", "0.46120843", "0.46118855", "0.46077994", "0.45944503", "0.45931122", "0.45929426", "0.45879495", "0.45864528", "0.45854962", "0.45819575", "0.456926", "0.45481083", "0.45389503", "0.4532931", "0.45230407", "0.45192346", "0.45134866", "0.4512631", "0.45015988", "0.44925046", "0.44912654", "0.44726843", "0.44707164", "0.44686854", "0.44621158", "0.44618323", "0.44564775", "0.44554964", "0.44440353", "0.44376728", "0.44313216", "0.44292277", "0.44280672", "0.44227135", "0.44005686", "0.43985945", "0.43966857", "0.43768758", "0.43768758", "0.43652782", "0.43625292", "0.4358711", "0.43582433", "0.4358161", "0.43568724", "0.43458664", "0.4343783", "0.43355283", "0.43350697", "0.43277082", "0.43259656", "0.43197122", "0.43186063", "0.43165928", "0.43151167", "0.43122134", "0.43118307", "0.42990732", "0.4298478", "0.42977452", "0.42959824" ]
0.44221786
73
Return the breakdown of frames.
public function getFrameData();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFrames()\n {\n return $this->frames;\n }", "public function getFrame(): string;", "public function getFrame() {}", "public function getSourceFrames() {\n return $this->sourceFrames;\n }", "private function readFrames() {\n\t\twhile (($type = $this->buffer->getByte()) !== 7) {\n\t\t\t$tick = $this->buffer->getInteger();\n\n\t\t\tif ($type == 3) {\n\t\t\t\t// No data\n\t\t\t\tcontinue;\n\t\t\t} else if ($type == 1 || $type == 2) {\n\t\t\t\t$this->buffer->skip(0x54);\n\t\t\t} else if ($type == 5) {\n\t\t\t\t$this->buffer->skip(0x4);\n\t\t\t}\n\n\t\t\t$this->buffer->skip($this->buffer->getInteger());\n\t\t}\n\t}", "public function getFrame($framenumber) {}", "public function stackFrames()\n {\n return $this->stackFrames;\n }", "public function createFrames()\n {\n $this->boundingBox = imagettfbbox($this->fontSettings['size'], 0, $this->fontSettings['path'], '00:00:00:00');\n $this->characterDimensions = imagettfbbox($this->fontSettings['size'], 0, $this->fontSettings['path'], '0');\n $this->characterWidth = $this->characterDimensions[2];\n $this->characterHeight = abs($this->characterDimensions[1] + $this->characterDimensions[7]);\n\n $this->base = $this->applyTextToImage($this->base, $this->fontSettings, $this->date);\n\n // create each frame\n for ($i = 0; $i <= $this->seconds; $i++) {\n $layer = imagecreatetruecolor($this->width, $this->height);\n $this->createFilledBox($layer);\n\n $layer = $this->applyTextToImage($layer, $this->fontSettings, $this->date);\n }\n\n $this->showImage();\n }", "public function getFrames()\n {\n if($this->frames === null) {\n $frames = $this->exception->getTrace();\n\n // If we're handling an ErrorException thrown by Whoops,\n // get rid of the last frame, which matches the handleError method,\n // and do not add the current exception to trace. We ensure that\n // the next frame does have a filename / linenumber, though.\n if($this->exception instanceof ErrorException && empty($frames[1]['line'])) {\n $frames[1] = isset($frames[1]) ? $frames[1] + $frames[0] : $frames[0];\n array_shift($frames);\n } else {\n $firstFrame = $this->getFrameFromException($this->exception);\n array_unshift($frames, $firstFrame);\n }\n $this->frames = new FrameCollection($frames);\n }\n\n return $this->frames;\n }", "public function getFrames()\n {\n if($this->frames === null) {\n $frames = $this->exception->getTrace();\n\n // If we're handling an ErrorException thrown by Whoops,\n // get rid of the last frame, which matches the handleError method,\n // and do not add the current exception to trace. We ensure that\n // the next frame does have a filename / linenumber, though.\n if(($this->exception instanceof ErrorException || $this->exception instanceof Object) && empty($frames[1]['line'])) {\n $frames = array($this->getFrameFromError($this->exception));\n } else {\n $firstFrame = $this->getFrameFromException($this->exception);\n array_unshift($frames, $firstFrame);\n }\n $collection = array();\n\n if (count($frames)) {\n foreach ($frames as $frame) {\n array_push($collection, new Frame($frame));\n }\n }\n\n $this->frames = new Database\\Collection($collection);\n }\n\n return $this->frames;\n }", "public function getFrameDesign(){\n return $this->frameDesign;\n }", "public function getFrameNumber() {}", "public function createFrames() {}", "public function getFrameHeight() {}", "public function getFrameType(){\n return $this->frameType; \n }", "public function frameTable() {\n if ($this->_m_frameTable !== null)\n return $this->_m_frameTable;\n $_pos = $this->_io->pos();\n $this->_io->seek($this->frameTableOfs());\n $this->_m__raw_frameTable = $this->_io->readBytes($this->frameTableLen());\n $_io__raw_frameTable = new \\Kaitai\\Struct\\Stream($this->_m__raw_frameTable);\n $this->_m_frameTable = new \\MicrosoftNetworkMonitorV2\\FrameIndex($_io__raw_frameTable, $this, $this->_root);\n $this->_io->seek($_pos);\n return $this->_m_frameTable;\n }", "public function frameSet() {}", "public function supportBFrames()\n {\n return true;\n }", "public function getFrameCount() {}", "public function getFrameCount() {}", "function render()\n {\n $res = \"\";\n foreach($this->m_childs as $abstractframe)\n {\n $res.=$abstractframe->render(false);\n }\n return $res;\n }", "public function getCaptureList()\n {\n return $this->captureList;\n }", "protected function getPreviewFrameWidths() {}", "public function getFrameType(){\n return $this->frameType;\n }", "public function getFrameRate() {}", "public function countFrames()\n {\n return count($this->frames);\n }", "public function build(): string\n {\n $this->verifyBom($this->encoding, $this->description);\n $this->_handleDefaultValues();\n\n $frame = $this->encoding->getCode();\n $frame .= $this->mimeType;\n $frame .= \"\\x00\";\n $frame .= $this->pictureType;\n $frame .= $this->description;\n $frame .= $this->encoding->getDelimiter();\n $frame .= $this->pictureData;\n\n return $frame;\n }", "function render()\n {\n return '<frame name=\"'.$this->m_name.'\" scrolling=\"'.$this->m_scrolling.'\" '.(!$this->m_resize?\"noresize\":\"\").\n ' src=\"'.$this->m_src.'\" marginwidth=\"'.$this->m_margin.'\" marginheight=\"'.$this->m_margin.'\">'.\"\\n\";\n }", "public function countFrames()\n {\n return count($this->getFrames());\n }", "public function getFormat_GetAllTextFramesResult()\n {\n return isset($this->Format_GetAllTextFramesResult) ? $this->Format_GetAllTextFramesResult : null;\n }", "function getTargetFrame()\n\t{\n\t\treturn $this->il_target_frame;\n\t}", "public function supportBFrames()\n\t{\n\t\treturn FALSE;\n\t}", "public function worms()\n\t{\n\t\tif (preg_match('/^(\\[U4A]) (.+?)\\[\\d+(\\/\\d+\\]) - \".+?\" yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//(38/57) \"Fright.Night.2.New.Blood.2013.UNRATED.BluRay.810p.DTS.x264-PRoDJi.part26.rar\" - 4,81 GB - yEnc\n\t\t//(14/20) \"Jack.the.Giant.Slayer.2013.AC3.192Kbps.23fps.2ch.TR.Audio.BluRay-Demuxed.by.par2\" - 173,15 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/(\\d+\\)) (\"|#34;)(.+)(\\.[vol|part].+)?\\.(par2|nfo|rar|nzb)(\"|#34;) - \\d+[.,]\\d+ [kKmMgG][bB] - yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[3];\n\t\t} //(01/40) - Description - \"Cloudy.with.a.Chance.of.Meatballs.2009.AC3.23Fps.640Kbps.6Ch.TR.Audio.BD-Demuxed.by.DWA.nfo\" - 454,60 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) - Description - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(151/161) \"Troy.2004.Directors.Cut.1080p.BluRay.x264.DTS.vol064+21.PAR2.bad\" - 18,64 GB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//[Macguffin Proudly Presents] (33/75) -Reservoir Dogs 1992 720p BDRip AC3 x264 MacGuffin - \"macguffin-redog720p.r30\" - 3.06 GB - yEnc\n\t\t//[Request][MacGuffin Proudly Presents](056/229) - LOTR The Trilogy EXTENDED REPOST 720p BRRip AC3 x264 MacGuffin - \"macguffin-tfotr720p.r53\" - 18.54 GB - yEnc\n\t\t//[REPOST][MacGuffin Proudly Presents](44/54) - Flight 2012 720p BRRip REPOST AC3 x264 MacGuffin - \"macguffin-flit720p.rar\" - 4.09 GB - yEnc\n\t\tif (preg_match('/^(\\[(Request|Repost)\\])?\\[Macguffin Proudly Presents\\][-_\\s]{0,3}\\(\\d+\\/\\d+\\)[-_\\s]{0,3}(.+?) MacGuffin[-_\\s]{0,3}\".+' .\n\t\t\t\t\t $this->e0 . '[- ]{0,4}\\d+[.,]\\d+ [kKmMgG][bB][-_\\s]{0,3}yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[3];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "function frame_decode($frame_ref, $offset) { return Frame::frame_decode($this, $frame_ref, $offset); }", "public static function trace()\n\t{\n\t\tob_start();\n\t\tdebug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n\t\t$trace = ob_get_clean();\n\t\t$trace = str_replace('#','<br/><div><b><u>',$trace);\n\t\t$trace = str_replace('called at [','called at : </u></b><ul><li>File : ',$trace);\n\t\t$trace = preg_replace('/:([0-9]*)\\]/','</li><li>Ligne : $1</li></ul></div>',$trace);\n\t\techo $trace;\n\t\treturn $trace;\n\t}", "public function getScreenshotData();", "public function getStackFrameList(){\n return $this->_get(1);\n }", "public function readFrame()\n {\n $this->connect();\n return $this->frameFactory->createFromClientFrame($this->stomp->readFrame());\n }", "public function GetCapture ();", "public function getAnimatedSteps() {\r\n return $this->animatedSteps;\r\n }", "public function getFrameWidth() {}", "public function getCapHeight() {}", "public function getCapHeight() {}", "public function getCapHeight() {}", "public function __debugInfo() {\n\t\t$keys = array_keys($this->start);\n\t\tforeach ($keys as $key) {\n\t\t\t$end = isset($this->end[$key]) ? $this->end[$key] : FALSE;\n\t\t\t$output[$key] = [\n\t\t\t\t'start' => $this->start[$key],\n\t\t\t\t'end' => ($end !== FALSE ? $end : '*'), \n\t\t\t\t'duration' => ($end !== FALSE ? $end - $this->start[$key] : '*'),\n\t\t\t];\n\t\t}\n\t\treturn $output;\t\t\n\t}", "public function getTab() {\n\t\t$count = $this->mailer->getMessageCount();\n\n\t\treturn '<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAITSURBVBgZpcHLThNhGIDh9/vn7/RApwc5VCmFWBPi1mvwAlx7BW69Afeu3bozcSE7E02ILjCRhRrds8AEbKVS2gIdSjvTmf+TYqLu+zyiqszDMCf75PnnnVwhuNcLpwsXk8Q4BYeSOsWpkqrinJI6JXVK6lSRdDq9PO+19vb37XK13Hj0YLMUTVVyWY//Cf8IVwQEGEeJN47S1YdPo4npDpNmnDh5udOh1YsZRcph39EaONpnjs65oxsqvZEyTaHdj3n2psPpKDLBcuOOGUWpZDOG+q0S7751ObuYUisJGQ98T/Ct4Fuo5IX+MGZr95jKjRKLlSxXxFxOEmaaN4us1Upsf+1yGk5ZKhp8C74H5ZwwCGO2drssLZZo1ouIcs2MJikz1oPmapHlaoFXH1oMwphyTghyQj+MefG+RblcoLlaJG/5y4zGCTMikEwTctaxXq/w9kuXdm9Cuzfh9acujXqFwE8xmuBb/hCwl1GKAnGccDwIadQCfD9DZ5Dj494QA2w2qtQW84wmMZ1eyFI1QBVQwV5GiaZOpdsPaSwH5HMZULi9UmB9pYAAouBQbMHHrgQcnQwZV/KgTu1o8PMgipONu2t5KeaNiEkxgAiICDMCCFeEK5aNauAOfoXx8KR9ZOOLk8P7j7er2WBhwWY9sdbDeIJnwBjBWBBAhGsCmiZxPD4/7Z98b/0QVWUehjkZ5vQb/Un5e/DIsVsAAAAASUVORK5CYII=\">' .\n\t\t$count . ' sent email' . ($count === 1 ? '' : 's');\n\t}", "public function getRenderDataInnslag()\n {\n $renderData = $this->getRenderData();\n $this->_collected = [];\n if ($renderData->harGrupper()) {\n foreach ($renderData->getGrupper() as $gruppe) {\n if ($gruppe->harGrupper()) {\n foreach ($gruppe->getGrupper() as $undergruppe) {\n $this->_collectInnslag($undergruppe);\n }\n } else {\n $this->_collectInnslag($gruppe);\n }\n }\n } else {\n $this->_collectInnslag($renderData);\n }\n\n return $this->_collected;\n }", "public function getFrameRate()\n {\n return $this->frameRate;\n }", "public function getScreenshot(): string\n {\n return $this->screenshot;\n }", "public function run()\n {\n Timeline::byTitle('88 keys')->frames()->saveMany([\n\t\t\tnew Frame([\n\t\t\t\t'background' => 'blue',\n\t\t\t\t'title' => '1720', \n\t\t\t\t'content' => 'Bartolomeo Cristofori introduced the first hammer-action pianoforte, and is credited by many as the “inventor” of the piano'\n\t\t\t]),\n\t\t\tnew Frame([\n\t\t\t\t'background' => 'teal',\n\t\t\t\t'title' => '1760', \n\t\t\t\t'content' => 'The square piano was introduced by Johannes Zumpe in London, England'\n\t\t\t]),\n\t\t\tnew Frame([\n\t\t\t\t'background' => 'pink',\n\t\t\t\t'title' => '1780', \n\t\t\t\t'content' => 'The Stein and Stein-Streicher piano hammer changes improved the tone of grand pianos and were preferred by many contemporary composers'\n\t\t\t]),\n\t\t\tnew Frame([\n\t\t\t\t'background' => 'green',\n\t\t\t\t'title' => '1811', \n\t\t\t\t'content' => 'Several European manufacturers introduced upright pianos. Wornum’s upright became popular for its improved sound quality from others'\n\t\t\t]),\n\t\t\tnew Frame([\n\t\t\t\t'background' => 'orange',\n\t\t\t\t'title' => '1853', \n\t\t\t\t'content' => 'Foundation of the Steinway & Sons piano company. Regarded as one of the best piano company of all time, it still functions to this day.'\n\t\t\t]),\n\t\t\tnew Frame([\n\t\t\t\t'background' => 'indigo',\n\t\t\t\t'title' => '1855', \n\t\t\t\t'content' => 'Steinway & Sons introduced the first square piano with a new scale that revolutionized the sound quality and was adopted by all future manufacturers'\n\t\t\t]),\n\t\t\tnew Frame([\n\t\t\t\t'background' => 'purple',\n\t\t\t\t'title' => '1880', \n\t\t\t\t'content' => 'The square piano was officially “extinct” in both Europe and America. Uprights were the go-to space-saving pianos for the industrialization of urban cities'\n\t\t\t]),\n\t\t\tnew Frame([\n\t\t\t\t'background' => 'green',\n\t\t\t\t'title' => '1891', \n\t\t\t\t'content' => 'Foundation of Carnegie Hall, one of the most famous musical buildings in the world.'\n\t\t\t])\n\t\t]);\n\n\t\tTimeline::byTitle('Nicknames explained')->frames()->saveMany([\n\t\t\tnew Frame([\n\t\t\t\t'background' => 'teal',\n\t\t\t\t'title' => 'Moonlight Sonata', \n\t\t\t\t'subtitle' => 'Piano sonata no 14, op 27 no 2 by Beethoven',\n\t\t\t\t'content' => 'This nickname was given by the music critic Ludwig Rellstab, five years after Beethoven’s death. He claimed that the serenity of the first movement brought to mind the calm of Lake Lucerne under a moonlit sky. '\n\t\t\t]),\n\t\t\tnew Frame([\n\t\t\t\t'background' => 'green',\n\t\t\t\t'title' => 'Pastoral Symphony',\n\t\t\t\t'subtitle' => 'Symphony no 6, op 68 by Beethoven',\n\t\t\t\t'content' => 'The composer himself gave this work its title: pastoral symphony or recollections of country life. Nature was immensely important to Beethoven, and he spent a great deal of time walking alone in the woods.'\n\t\t\t]),\n\t\t\tnew Frame([\n\t\t\t\t'background' => 'orange',\n\t\t\t\t'title' => 'Raindrop prelude', \n\t\t\t\t'subtitle' => 'Prelude in Db major, op 28 no 15 by Chopin',\n\t\t\t\t'content' => 'There is a legend that the piece was written during a storm, and that the “dripping” motif comes from a nightmarish vision the composer had of himself drowned in a lake, with icy water falling on his breast in heavy drops.'\n\t\t\t]),\n\t\t\tnew Frame([\n\t\t\t\t'background' => 'purple',\n\t\t\t\t'title' => 'Emperor Concerto', \n\t\t\t\t'subtitle' => 'Piano concerto no 5, op 73 by Beethoven',\n\t\t\t\t'content' => 'The majesty of this concerto, even in this quiet slow movement, seems perfectly expressed in its nickname, the Emperor. So it is ironic that Beethoven himself found the title abhorrent.'\n\t\t\t]),\n\t\t\tnew Frame([\n\t\t\t\t'background' => 'indigo',\n\t\t\t\t'title' => 'Unfinished Symphony', \n\t\t\t\t'subtitle' => 'Symphony no 8 in B minor, D 759 by Schubert',\n\t\t\t\t'content' => 'There is no ambiguity about this nickname! Schubert just never finished writing this symphony. He wrote just 2 movements; a 3rd movement was written but not orchestrated. What is not known is why it was left unfinished.'\n\t\t\t]),\n\t\t\tnew Frame([\n\t\t\t\t'background' => 'pink',\n\t\t\t\t'title' => 'Trout Quintet', \n\t\t\t\t'subtitle' => 'Piano Quinteto, D 667 by Schubert',\n\t\t\t\t'content' => '<i>The Trout</i> is the name of one of Schubert’s many songs: a light-hearted story of a fisherman trying to catch a fish. Much of the charm of the song comes from the piano accompaniment, which burbles merrily along just like the water of the stream.'\n\t\t\t]),\n\t\t\tnew Frame([\n\t\t\t\t'background' => 'red',\n\t\t\t\t'title' => 'Pathétique Symphony', \n\t\t\t\t'subtitle' => 'Symphony no 6 in B minor, op 74 by Tchaikovsky',\n\t\t\t\t'content' => 'We know the symphony by the French title <i>Pathétique</i>, which means poignant, full of pathos. Tchaikovsky, however, called the symphony <i>Patetičeskaja</i>, which is the Russian word for passionate or emotional.'\n\t\t\t])\n\t\t]);\n }", "public function get_blocks ()\n {\n return $this->_blocks;\n }", "public function get_frame_details($frame_id = null) {\n return $this->db->select('frame_id,frame_title,frame_price,frame_description,status')\n ->select('CONCAT(\"'.SITE_URL.FRAMES_PATH.'\",frame_image) as frame_image',false)\n ->from($this->frame_table)->where(['status' => '1', 'is_deleted' => '0','frame_id' => $frame_id])->get();\n }", "function render($embedded=false)\n {\n $res = '<frameset '.($this->m_id!=''?'id=\"'.$this->m_id.'\"':'').' '.($this->m_orientation==FRAMESET_VERTICAL?'rows':'cols').'=\"'.$this->getDimensions().'\" frameborder=\"'.$this->m_border.'\" border=\"'.$this->m_border.'\">';\n foreach($this->m_childs as $abstractFrame)\n {\n $res.= $abstractFrame->render(true);\n }\n if (!$embedded&&$this->m_noframes!=\"\")\n {\n $res.= \"<noframes>\\n\".$this->m_noframes.\"</noframes>\\n\";\n }\n $res.= \"</frameset>\\n\";\n return $res;\n }", "public function getframe($frameID)\n {\n\n $frame = $this->sitemodel->getSingleFrame($frameID);\n if (!$frame) {\n return FALSE;\n }\n $frameContent = $frame->frames_content;\n if (!stristr($frameContent, '<link href=\"' . base_url('elements'))) {\n $frameContent = str_replace('<link href=\"', '<link href=\"' . base_url('elements') . '/', $frameContent);\n }\n if (stristr($frameContent, '<link href=\"' . base_url('elements') . '/https://')) {\n $frameContent = str_replace('<link href=\"' . base_url('elements') . '/https://', '<link href=\"https://', $frameContent);\n }\n if (!stristr($frameContent, '<script src=\"js' . base_url('elements'))) {\n $frameContent = str_replace('<script src=\"js', '<script src=\"' . base_url('elements') . '/js', $frameContent);\n }\n if (!stristr($frameContent, 'src=\"' . base_url('elements') . '/images')) {\n $frameContent = str_replace('src=\"images', 'src=\"' . base_url('elements') . '/images', $frameContent);\n }\n if (stristr($frameContent, 'url(images')) {\n $frameContent = str_replace('url(images', 'url(' . base_url('elements') . '/images', $frameContent);\n }\n if (stristr($frameContent, 'src=\"./images')) {\n $frameContent = str_replace('src=\"./images', 'src=\"' . base_url('elements') . '/images', $frameContent);\n }\n if (stristr($frameContent, 'src=\"images')) {\n $frameContent = str_replace('src=\"images', 'src=\"' . base_url('elements') . '/images', $frameContent);\n }\n if (stristr($frameContent, 'href=\"./images')) {\n $frameContent = str_replace('href=\"./images', 'href=\"' . base_url('elements') . '/images', $frameContent);\n }\n echo $frameContent;\n }", "public function get_framerate()\n {\n }", "public function getDomainBreakdown() {\n $requests = null;\n return getDomainBreakdown($this->testInfo->getId(), $this->testInfo->getRootDirectory(), $this->run,\n $this->cached ? 1 : 0, $requests);\n }", "public function getPTS() {}", "public function glimpse()\n {\n $peek = $this->peek();\n $this->peek = 0;\n return $peek;\n }", "public function getFrameVideo(){\n return $this->frameVideo; \n }", "function GetAnimation() {\n return ($this->GIF);\n }", "function trace(){\n\t\techo($this->get_trace()/(1024*1024).\" MB\");\n\t}", "public function getOutput() {\n $output = array();\n $output[] = '<style>.rb-debug td, .rb-debug th { border: 1px solid #aaa; padding: 3px;}.rb-debug td { text-align: left; }.rb-debug th { font-weight: bold; background-color: #eee; vertical-align: top; }.rb-debug { border: 1px solid #aaa; }</style>';\n $output[] = '<table class=\"rb-debug\" cellspacing=\"0\">';\n\n $output[] = $this->renderRow($this->modx->lexicon('rowboat.debug.header'));\n\n if (!empty($this->query)) {\n $output[] = $this->renderRow($this->modx->lexicon('rowboat.debug.table'),$this->query->getTable());\n $output[] = $this->renderRow($this->modx->lexicon('rowboat.debug.query'),nl2br($this->query->toSql()));\n $output[] = $this->renderRow($this->modx->lexicon('rowboat.debug.pdo_query'),nl2br($this->query->toSql(false)));\n $output[] = $this->renderRow($this->modx->lexicon('rowboat.debug.params'),'<pre>'.var_export($this->query->getParams(),true).'</pre>');\n $output[] = $this->renderRow($this->modx->lexicon('rowboat.debug.total'),$this->total);\n }\n\n if (!empty($this->messages)) {\n $output[] = $this->renderRow($this->modx->lexicon('rowboat.debug.messages'));\n foreach ($this->messages as $message) {\n $output[] = $this->renderRow('',$message);\n }\n }\n \n $output[] = $this->renderRow($this->modx->lexicon('rowboat.debug.results'));\n\n $idx = 0;\n foreach ($this->results as $result) {\n $row = array();\n $row[] = '<table>';\n foreach ($result as $col => $val) {\n $row[] = $this->renderRow($col,$val == '' ? ' ' : $val);\n }\n $row[] = '</table>';\n $output[] = $this->renderRow('#'.$idx,implode(\"\\n\",$row));\n $idx++;\n }\n $output[] = '</table>';\n return implode(\"\\n\",$output);\n }", "public function getPrintClip() {}", "public function getBreakHistory()\n {\n return $this->get(self::_BREAK_HISTORY);\n }", "public function getDifferencesRect() {}", "public function getNoTimeframes()\n {\n return $this->noTimeframes;\n }", "public function blocks() { return $this->_m_blocks; }", "public function getCaptureName()\n {\n return $this->captureName;\n }", "public function getBacktrace()\n {\n $backtrace = $this->get_debug_backtrace();\n\n $output = \"\";\n\n $count = 0;\n foreach ($backtrace as $line) {\n if ($count <= 1) {\n $count++;\n continue;\n }\n\n $output .= \"#{$count}: \";\n\n if (isset($line['type']) && $line['type'] != \"\") {\n $output .= $line['class'] . $line['type'];\n }\n\n $output .= $line['function'] . \"(...)\";\n $output .= \" [{$line['file']}#{$line['line']}\\r\\n\";\n\n $count++;\n }\n\n return $output;\n }", "function firstWebMFrame($segment, $trackNumber, $skip=0) {\n foreach($segment as $x1) {\n if ($x1->name() == 'Cluster') {\n $cluserTimecode = $x1->Get('Timecode');\n foreach($x1 as $blockGroup) {\n $blockRaw = NULL;\n if ($blockGroup->name() == 'SimpleBlock') {\n $blockRaw = $blockGroup->value();\n } elseif ($blockGroup->name() == 'BlockGroup') {\n $blockRaw = $blockGroup->get('Block');\n }\n if (isset($blockRaw)) {\n $block = new MatroskaBlock($blockRaw);\n if ($block->trackNumber == $trackNumber && $block->keyframe) {\n if (!isset($cluserTimecode) || $cluserTimecode + $block->timecode >= $skip) {\n return $blockGroup;\n } elseif (!isset($frame1)) {\n $frame1 = $blockGroup;\n }\n }\n }\n }\n }\n }\n return isset($frame1) ? $frame1 : NULL;\n}", "public function getMimeTypeBreakdown() {\n $requests = null;\n return getBreakdown($this->testInfo->getId(), $this->testInfo->getRootDirectory(), $this->run,\n $this->cached ? 1 : 0, $requests);\n }", "private function writeframes($prepend = 'f')\n {\n //$prepend = 'f';\n for ($i = 0; $i < count($this->imagedata); $i++) {\n file_put_contents(self::$temp_dir.'/frame_'.$prepend.'_'.str_pad($i + 1, 3, '0', STR_PAD_LEFT).'.gif', $this->imageinfo['gifheader'].$this->imagedata[$i]['graphicsextension'].$this->imagedata[$i]['imagedata'].chr(0x3b));\n $this->parsedfiles[] = self::$temp_dir.'/frame_'.$prepend.'_'.str_pad($i + 1, 3, '0', STR_PAD_LEFT).'.gif';\n }\n }", "public function dump() {\n $fmt = \"%-25s | %s | %2s | %s\\n\";\n foreach ($this->blocks as $block) {\n printf(\"Team: %25s\\n Rep: %s\\n\", $block->team, $block->representative);\n foreach (array('A', 'B', 'C', 'D') as $div) {\n foreach (array(RP::SKIPPER, RP::CREW) as $role) {\n $section = sprintf('%s_%s', $role, $div);\n foreach ($block->$section as $s) {\n printf($fmt,\n $s->getSailorName(),\n $s->division,\n $s->getSailorYear(),\n DB::makeRange($s->races_nums));\n }\n print(\"\\n\");\n }\n print(\"--------------------\\n\");\n }\n print(\"--------------------\\n\");\n }\n }", "public static function toFrames ($time)\n\t\t{\n\t\t\t// 06:23:16.213\n\t\t\tpreg_match('/(\\d{2}):(\\d{2}):(\\d{2})[\\.:](\\d{3})/', $time, $match);\n\t\t\tif (count($match) == 5)\n\t\t\t\treturn (int) ( self::$fps * ( $match[ 4 ] / 1000 + $match[ 3 ] + $match[ 2 ] * 60 + $match[ 1 ] * 3600 ) );\n\n\t\t\t// 06:23:16.21\n\t\t\tpreg_match('/(\\d{2}):(\\d{2}):(\\d{2})[\\.:](\\d{2})/', $time, $match);\n\t\t\tif (count($match) == 5)\n\t\t\t\treturn $match[ 4 ] + self::$fps * ( $match[ 3 ] + $match[ 2 ] * 60 + $match[ 1 ] * 3600 );\n\n\t\t\t// 06:23:16\n\t\t\tpreg_match('/(\\d{2}):(\\d{2}):(\\d{2})/', $time, $match);\n\t\t\tif (count($match) == 4)\n\t\t\t\treturn self::$fps * ( $match[ 3 ] + $match[ 2 ] * 60 + $match[ 1 ] * 3600 );\n\n\t\t\treturn null;\n\t\t}", "function cb_frameRendered($length)\n{\n global $rIndex, $r, $g, $b, $ledStrip;\n\n $b[$rIndex] = 0;\n\n if ($rIndex == NUM_LEDS - 1) {\n $rIndex = 0;\n } else {\n $rIndex++;\n }\n\n $b[$rIndex] = 255;\n\n $ledStrip->setRGBValues(0, NUM_LEDS, $r, $g, $b);\n}", "public function _consumeFrame() {\n if (\\count($this->frames) == 0) return false;\n $frame = $this->frames[0];\n $this->frames = array_slice($this->frames, 1);\n return $frame;\n }", "public function getHtml()\n {\n if ($html = $this->forgeIframe()) return $html;\n if ($html = $this->forgeVideo()) return $html;\n if ($html = $this->forgeObject()) return $html;\n }", "private static function getPastBrackets() {\r\n $pastBrackets = Api\\Bracket::queryReturnAll([\r\n 'state' => BS_FINAL,\r\n 'hidden' => 0\r\n ], [ 'score' => 'desc' ], 5);\r\n $winnerIds = array_map(function($bracket) {\r\n return $bracket->winnerCharacterId;\r\n }, $pastBrackets);\r\n $tmp = Api\\Character::queryReturnAll([ 'id' => [ 'in' => $winnerIds ] ]);\r\n $winners = [];\r\n foreach ($tmp as $character) {\r\n $winners[$character->id] = $character;\r\n }\r\n\r\n foreach ($pastBrackets as $bracket) {\r\n $bracket->winner = $winners[$bracket->winnerCharacterId];\r\n }\r\n\r\n return $pastBrackets;\r\n }", "function getTrace(){\n\t$array = debug_backtrace();\n\tunset($array[0]);\n\t$html = '';\n\tforeach ($array as $row) {\n\t\tif (isset($row['file']) && isset($row['line']) && isset($row['function']))\n\t\t\t$html .= $row['file'] . ':' . $row['line'] . '行,调用方法:' . $row['function'] . \"\\n\";\n\t}\n\treturn $html;\n}", "public function movies_x264()\n\t{\n\t\tif (preg_match('/^http:\\/\\/nzbroyalty\\.com - (.+?) - \\[\\d+\\/(\\d+\\]) - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Scream.4.2011.WS.720p.BluRay.X264-AMIABLE - [000/106] - \"Scream.4.2011.WS.720p.BluRay.X264-AMIABLE.nzb\" yEnc\n\t\tif (preg_match('/^([a-zA-Z0-9._-]+ - ?\\[)\\d+\\/(\\d+\\]) - \"(.+?)\\.(nzb|rar|par2)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[3];\n\t\t} //The Beaver 2011 720p BluRay DD5.1 x264-CtrlHD - [00/65] - \"The Beaver 2011 720p BluRay DD5.1 x264-CtrlHD.nzb\" yEnc\n\t\tif (preg_match('/^([a-zA-Z0-9].+?)( - )\\[\\d+(\\/\\d+\\] - \").+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"The.Hudsucker.Proxy.1994.1080p.Blu-ray.Remux.AVC.DTS.HD.MA.2.0-KRaLiMaRKo\"(127/132) \"The.Hudsucker.Proxy.1994.1080p.Blu-ray.Remux.AVC.DTS.HD.MA.2.0-KRaLiMaRKo.vol379+20.par2\" - 24.61 GB - yEnc\n\t\tif (preg_match('/(\"|#34;)(.+)(\"|#34;)[-_\\s]{0,3}[\\(\\[]\\d+\\/(\\d+[\\)\\]])[-_\\s]{0,3}(\"|#34;).+?(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4})(\"|#34;)[-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //(Amour.2012.1080p.BluRay.x264-EbP)(002/337) \"Amour.2012.1080p.BluRay.x264-EbP.part001.rar\" - 16.58 GB - yEnc\n\t\tif (preg_match('/^\\([\\w.-]+\\)[\\(\\[]\\d+\\/\\d+[\\]\\)] \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(La.pianiste.(aka.The.Piano.Teacher).(2001).720p.BluRay.AC3.x264-MandR) [085/101] - \"La.pianiste.(aka.The.Piano.Teacher).(2001).720p.BluRay.AC3.x264-MandR.part084.rar\" yEnc\n\t\tif (preg_match('/^\\([\\w .()-]+\\) [\\(\\[]\\d+\\/\\d+[\\]\\)] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[00/56] - \"The.Last.Days.On.Mars.720p.BluRay.x264-DR.nzb\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //< Michael.Jackson.Bad.25.2012.720p.BluRay.x264-PHD > - \"Michael.Jackson.Bad.25.2012.720p.BluRay.x264-PHD.par2\" (01/64) yEnc\n\t\tif (preg_match('/^< [\\w.() -]+ > - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' \\(\\d+\\/\\d+\\) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //:Waga.Haha.no.Ki.2012.BluRay.720p.DTS.x264 - Chronicle.Of.My.Mother.2012 - [55/56] - \"waha.720p.vol063+64.par2\" yEnc\n\t\tif (preg_match('/^:([\\w.-]+)[-_\\s]{0,3}[\\w.-]+[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"Cat Ballou (1965) Multi-Dub AVC 480p.MKV.001\" 01 of 11 yEnc\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' \\d+ of \\d+[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Fly.With.The.Gold.2012.720p.BluRay.x264-WiKi [03/73] - \"wiki-fwtg.par2\" yEnc\n\t\tif (preg_match('/^([\\w.-]+)[-_\\s]{0,3}\\[\\d+\\/(\\d+\\])[-_\\s]{0,3}\".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Parker.2013.MULTi.720p.BluRay.x264-GAIA - \"Parker.2013.MULTi.720p.BluRay.x264-GAIA.nfo\" yEnc\n\t\tif (preg_match('/^([\\w.-]+)[-_\\s]{0,3}\".+?' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "function displayBoilerDetails(){\n $mS = Steam_MeasurementSystem::getInstance();\n $translator = Zend_Registry::get('Zend_Translate');\n $details = \"<table class='data'>\n <tr><th>\".$translator->_('Blowdown Rate').\"</th><td>\".number_format(100*$this->blowdownRate,1).\" \".$mS->label('%').\"</td></tr>\n <tr><th>\".$translator->_('Boiler Energy').\"</th><td>\".$mS->displayEnergyflowLabeled($this->boilerEnergy).\"</td></tr>\n <tr><th>\".$translator->_('Combustion Efficiency').\"</th><td>\".number_format(100*$this->boilerEff,1).\" \".$mS->label('%').\"</td></tr>\n <tr><th>\".$translator->_('Fuel Energy').\"</th><td>\".$mS->displayEnergyflowLabeled($this->fuelEnergy).\"</td></tr>\n </table>\";\n return $details;\n }", "public function generateGameLayout()\r\n {\r\n $board = $this->board;\r\n $board->loopLayout(function($val, $row, $col) use (&$layout) {\r\n if ($val === self::POINT_NO_SHOT || $val === self::POINT_SHIP) {\r\n $layout[$row][$col] = '.';\r\n } else {\r\n $layout[$row][$col] = $val;\r\n }\r\n });\r\n\r\n return $this->makeGamingEdges($layout, $board->getRows(), $board->getColumns());\r\n }", "public function getCaptureProbability()\n {\n return $this->capture_probability;\n }", "public function getWinDescent() {}", "static function get_backtrace()\r\n {\r\n $html = array();\r\n $backtraces = debug_backtrace();\r\n foreach ($backtraces as $backtrace)\r\n {\r\n $html[] = implode(' ', $backtrace);\r\n }\r\n return implode('<br/>', $html);\r\n }", "public function getNextKeyFrame() {}", "public function getStructure()\n {\n return $this->getStructure();\n }", "public function getTopLevelGlyphs() {}", "public function x264()\n\t{\n\t\tif (preg_match('/^\"(.+?)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\") \\(\\d+\\/(\\d+\\)) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(001/108) \"Wizards.of.Waverly.Place.720p.S04E01.by.sugarr.par2\" - 5,15 GB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/(\\d+\\)) \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' - \\d+[,.]\\d+ [mMkKgG][bB]( -)? yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //[NZBsRus.com]-[Arthur.Christmas.2011.BDRip.AC3-5.1.x264-AKS74u] [18/74] - \"ac-bdrip-aks74u.r15\" yEnc\n\t\tif (preg_match('/^\\[NZBsRus\\.com.+\\]-\\[(.+)\\][-_\\s]{0,3}\\[\\d+\\/\\d+\\] - \".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[Entourage.S05.720p.WEB-DL.DD5.1.H.264-BTN]-[167/193] - \"Entourage.S05E11.Playn.With.Fire.720p.WEB-DL.DD5.1.h.264-BTN.part05.rar\" yEnc\n\t\tif (preg_match('/^\\[.+\\]-\\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //CTW487678426 | Get.the.Gringo.1080p.BluRay.x264.DTS-HDChina.r43-CTW yEnc\n\t\tif (preg_match('/^CTW\\d+ \\| (.+) yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //(????) [0/8] - Crionics Post - Alice In Chains - Dirt REPOST\"Alice In Chains - Dirt.nzb\" yEnc\n\t\tif (preg_match('/^.+?\\[\\d+\\/(\\d+\\][-_\\s]{0,3}.+?)[-_\\s]{0,3}(\"|#34;)(.+?)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}(\"|#34;))[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[3];\n\t\t} //(????) [001/153] - \"C4 House Party Horse Meat Disco Set 6.nfo\" C4 House Party Horse Meat Disco Set 6 yEnc\n\t\tif (preg_match('/^\\(\\?+\\) \\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '.+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(????) [19/22] - C.K.N. Demo 85 \"19-rotten system.mp3\" yEnc\n\t\tif (preg_match('/^\\(\\?+\\) \\[\\d+\\/\\d+\\] - (.+)[-_\\s]{0,3}\".+?' . $this->e0 . '.+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "function get_inner_html($number,$frame=-1)\n\t{\n\t\treturn $this->get_inner_html_by_number($number,$frame);\n\t}", "public function getStructure()\n {\n // TODO: Implement getStructure() method.\n }", "public function spans()\n {\n return $this->spans;\n }", "public function getTraces()\n {\n return $this->traces;\n }", "function packShowFrameTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packShowFrameTag\");\n\n\t\t$TagID = 1;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}", "public function getIframe()\n {\n return $this->forgeIframe();\n }", "public function getTab()\n\t{\n\t\treturn '<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABh0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzT7MfTgAAAY9JREFUOI2lkj1rVUEQhp93d49XjYiCUUFtgiBpFLyWFhKxEAsbGy0ErQQrG/EHCII/QMTGSrQ3hY1FijS5lQp2guBHCiFRSaLnnN0di3Pu9Rpy0IsDCwsz8+w776zMjP+J0JV48nrufMwrc2AUbt/CleMv5ycClHH1UZWWD4MRva4CByYDpHqjSgKEETcmHiHmItW5STuF/FfAg8HZvghHDDMpkKzYXScPgFcx9XBw4WImApITn26cejEAkJlxf7F/MOYfy8K3OJGtJlscKsCpAJqNGRknd+jO6TefA8B6WU1lMrBZ6fiE1R8Zs7hzVJHSjvJnNMb/hMSmht93IYIP5Qhw99zSx1vP+5eSxZmhzpzttmHTbcOKk+413Sav4v3J6ZsfRh5sFdefnnhr2Gz75rvHl18d3aquc43f1/BjaN9V1wn4tq6eta4LtnUCQuPWHmAv0AOKDNXstZln2/f3zgCUX8oFJx1zDagGSmA1mn2VmREk36pxw5NgzVqDhOTFLhjtOgMxmqVOE/81fgFilqPyaom5BAAAAABJRU5ErkJggg==\">callback';\n\t}", "function generate_tooltip_frame($portion='start')\n{\n\tif($portion == 'start')\n\t{\n\t\t$tiphtml = \"<table border='0' cellspacing='0' cellpadding='0'>\n\t\t<tr><td colspan='3' style='padding-left:12px;padding-bottom:0px;'><img src='\".IMAGE_URL.\"layer_tip.png'></td></tr>\n\t\t\n\t\t<tr><td valign='bottom' style='padding-top:0px;'><img src='\".IMAGE_URL.\"layer_top_left_corner.png'></td>\n\t\t<td style='background-image: url(\".IMAGE_URL.\"top_border.png);background-repeat: repeat-x;background-position: center bottom;padding-top:0px;'><img src='\".IMAGE_URL.\"spacer.gif' height='12' width='1'></td>\n\t\t<td valign='bottom' style='padding-top:0px;'><img src='\".IMAGE_URL.\"layer_top_right_corner.png'></td></tr>\n\t\t\n\t\t<tr>\n\t\t<td style='background-image: url(\".IMAGE_URL.\"right_border.png);background-repeat: repeat-y;background-position: right center;'></td>\n\t\t\n\t\t\n\t\t<td>\";\n\t}\n\t\n\telse if($portion == 'end')\n\t{\n\t\t$tiphtml = \"</td>\n\t\t<td style='background-image: url(\".IMAGE_URL.\"left_border.png);background-repeat: repeat-y;background-position: left center;'></td>\n\t\t</tr>\n\t\t\n\t\t<tr><td valign='top'><img src='\".IMAGE_URL.\"layer_bottom_left_corner.png'></td>\n\t\t<td style='background-image: url(\".IMAGE_URL.\"bottom_border.png);background-repeat: repeat-x;background-position: center top;'>&nbsp;</td>\n\t\t<td valign='top'><img src='\".IMAGE_URL.\"layer_bottom_right_corner.png'></td></tr>\n\t\t</table>\";\n\t}\n\t\n\treturn $tiphtml;\n}", "public function getGfxData()\n {\n return $this->barList;\n }", "public function game()\n\t{\n\t\tif (preg_match('/(\\[[\\d#]+\\]-\\[.+?\\]-\\[.+?\\]-)\\[ (.+?) \\][- ]\\[\\d+\\/\\d+\\] - \"(.+?)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "public function parse()\n {\n $Version = $this->getVer();\n $LanguageMap_en = $this->languagemap(\"en\");\n\n $RankedDivision = $this->json(\"RankedDivision\");\n\n // (optional) start a progress bar\n $IconArray = [];\n $LoadingIconArray = [];\n //get evolutions array\n\n // loop through data\n $Output[] = \"<tabber>\\n\"; \n foreach ($RankedDivision as $id => $Rank) {\n switch ($id) {\n case '1':\n $Division = $LanguageMap_en[$Rank[1]['Name']];\n break;\n case '2':\n $Division = $LanguageMap_en[$Rank[4]['Name']];\n break;\n case '3':\n $Division = $LanguageMap_en[$Rank[8]['Name']];\n break;\n case '4':\n $Division = $LanguageMap_en[$Rank[13]['Name']];\n break;\n case '5':\n $Division = $LanguageMap_en[$Rank[18]['Name']];\n break;\n case '6':\n $Division = $LanguageMap_en[$Rank[23]['Name']];\n break;\n }\n $Output[] = \"$Division=\\n\"; \n $Table = [];\n $Table[] = \"{| class=\\\"wikitable\\\"\";\n $Table[] = \"!Class!!Rank Up Points!!Protect Points!!Profile Border!!Trophy\";\n $Table[] = \"|-\";\n foreach($Rank as $Subdivision){\n $LoadingIcon = $Subdivision[\"NameLoadingIcon\"];\n $LoadingIconArray[] = $LoadingIcon;\n $Class = \"\";\n if (!empty($LanguageMap_en[$Subdivision['StageNameSP']])) {\n $Class = $LanguageMap_en[$Subdivision['StageNameSP']];\n }\n $FullName = $LanguageMap_en[$Subdivision['StageName']];\n $MaxPerformancePoints = $Subdivision['ActivePointLimit'];\n $PerformancePointsProtect = $Subdivision['ActivePointRankedDivisionProtect'];\n $MedalIcon = $Subdivision['SeasonAwardIcon'];\n $IconArray[] = $MedalIcon;\n $string =\"{{Superimpose2\";\n $string .=\" | base = RankBGShield.png\";\n $string .=\" | base_width = 250px\";\n $string .=\" | base_style = float: right\";\n $string .=\" | base_alt =\";\n $string .=\" | base_caption = \";\n $string .=\" | base_link = \";\n $string .=\" | float = $MedalIcon.png\";\n $string .=\" | float_width = 180px\";\n $string .=\" | float_alt = \";\n $string .=\" | float_caption = \";\n $string .=\" | link = \";\n $string .=\" | t = \";\n $string .=\" | x = 33\";\n $string .=\" | y = 30\";\n $string .=\" }}\";\n $Table[] = \"|$Class||$MaxPerformancePoints||$PerformancePointsProtect||[[File:$LoadingIcon.png|link=]]||$string\";\n $Table[] = \"|-\";\n }\n $Table[] = \"|}\";\n $Output[] = implode(\"\\n\",$Table);\n $Output[] = \"|-|\\n\"; \n }\n $Output[] = \"</tabber>\\n\"; \n if (!empty($IconArray)) {\n $this->copyImages($IconArray,\"RankedDivision\");\n }\n if (!empty($LoadingIconArray)) {\n $this->copySprites($LoadingIconArray,\"RankedDivision\");\n }\n // (optional) finish progress bar\n $this->saveExtra(\"Output\\RankedDivision.txt\",implode(\"\\n\\n\",$Output));\n\n // save\n $this->io->text('Saving data ...');\n }" ]
[ "0.6677494", "0.65331894", "0.64417964", "0.6130419", "0.6076972", "0.5945863", "0.5876855", "0.5849335", "0.581683", "0.5680984", "0.55814785", "0.5524665", "0.53319097", "0.53252286", "0.5307469", "0.5294087", "0.52919793", "0.5284259", "0.5274163", "0.5274163", "0.52738845", "0.52261865", "0.5213109", "0.5209962", "0.52000463", "0.5197129", "0.51753515", "0.51586145", "0.5107548", "0.50869787", "0.5038793", "0.5022907", "0.50200856", "0.5003434", "0.49761352", "0.4932234", "0.4929188", "0.49015117", "0.48597115", "0.48570678", "0.48563457", "0.4820387", "0.4820387", "0.4820387", "0.47954142", "0.47899848", "0.47789842", "0.4773137", "0.4772595", "0.47421724", "0.47238722", "0.47227976", "0.47188237", "0.46964586", "0.4690086", "0.46864346", "0.46842533", "0.46818787", "0.46685526", "0.46616736", "0.4647044", "0.46464482", "0.46293375", "0.46282783", "0.45954007", "0.45921287", "0.45843935", "0.458401", "0.45770067", "0.4575611", "0.45746174", "0.45684922", "0.45678008", "0.45640975", "0.45569038", "0.45457554", "0.45316577", "0.45232943", "0.4522568", "0.45171228", "0.45139465", "0.45109537", "0.4498856", "0.4493966", "0.44899017", "0.44853702", "0.44794267", "0.44738314", "0.44535422", "0.44471708", "0.44419122", "0.44350737", "0.44319326", "0.44168425", "0.44142127", "0.4412874", "0.44066113", "0.4391551", "0.43895155", "0.43875647" ]
0.59658194
5
Compares move by inputs.
public function equals(MoveInterface $otherMove);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testComplexMove(){\n $gm = new GamesManager();\n\n $game = $this->generateGameObjectWithTwoPlayers();\n\n\n $game->gameState->currentPlayer = 0;\n $game->gameState->isGameGoing = true;\n $game->gameState->selectChecker = false;\n $game->gameState->pickedChecker = [4, 3];\n $game->gameState->possibleGoChoices = [array(\"row\"=>2, \"col\"=>5), array(\"row\"=>4, \"col\"=>3)];\n $game->gameState->boardState = $this->getMultipleBeat();\n\n $gm->userMove(2, 5, 1, $game );\n $gm->userMove(0, 3, 1, $game );\n $gm->userMove(3, 0, 1, $game );\n $result = $gm->userMove(7, 4, 1, $game );\n\n\n $this->assertEquals(0, $result[\"gameState\"]->boardState[4][3]);//initial\n $this->assertEquals(0, $result[\"gameState\"]->boardState[3][4]);//beaten\n $this->assertEquals(-1, $result[\"gameState\"]->boardState[1][6]);//still there due to turkish turn rule\n $this->assertEquals(0, $result[\"gameState\"]->boardState[1][4]);//beaten\n $this->assertEquals(0, $result[\"gameState\"]->boardState[2][1]);//beaten\n $this->assertEquals(0, $result[\"gameState\"]->boardState[4][1]);//beaten\n $this->assertEquals(2, $result[\"gameState\"]->boardState[7][4]);//end position of the hero checker\n\n }", "private function get_next_move() {\n\t\t$move = $this->can_put_a_card_up();\n\t\tif($move !== false) return $move;\n\t\t\n\t\t// Test si une carte peut être déplacée\n\t\t$move = $this->can_move_cards();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Test si la carte du deck peut descendre\n\t\t$move2 = $this->can_put_deck_card_down();\n\t\tif($move !== false && $move2 !== false) {\n\t\t\tarray_push($move, $move2);\n\t\t\treturn $move;\n\t\t} \n\t\tif($move !== false) return $move;\n\t\tif($move2 !== false) return $move2;\n\t\t\n\t\t// Test si une carte peut être montée suite à un déplacement spécial\n\t\t//$move = $this->can_put_a_card_up_after_move();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Pioche\n\t\t$move = $this->can_turn_from_deck();\n\t\tif($this->infinite_move($move)) return false;\n\t\tif($move !== false) return $move;\n\t\t\n\t\treturn false;\n\t}", "public function isValidMove()\n {\n if ($this->getXCor() != $this->getEndXCor()\n && $this->getYCor() != $this->getEndYCor()\n ) {\n return false;\n }\n\n return true;\n }", "function test_concurrent_moves() {\n $r1 = new replica();\n $r2 = new replica();\n\n // Setup initial tree state.\n $ops = [new op_move($r1->tick(), null, \"root\", $root_id = new_id()),\n new op_move($r1->tick(), $root_id, \"a\", $a_id = new_id()),\n new op_move($r1->tick(), $root_id, \"b\", $b_id = new_id()),\n new op_move($r1->tick(), $root_id, \"c\", $c_id = new_id()),\n ];\n\n $r1->apply_ops($ops); // applied own ops\n $r2->apply_ops($ops); // merged ops from r1.\n\n echo \"Initial tree state on both replicas\\n\";\n print_tree($r1->state->tree);\n\n // replica_1 moves /root/a to /root/b\n $repl1_ops = [new op_move($r1->tick(), $b_id, \"a\", $a_id)];\n\n // replica_2 \"simultaneously\" moves /root/a to /root/c\n $repl2_ops = [new op_move($r2->tick(), $c_id, \"a\", $a_id)];\n\n // replica_1 applies his op, then merges op from replica_2\n $r1->apply_ops($repl1_ops);\n echo \"\\nreplica_1 tree after move\\n\";\n print_tree($r1->state->tree);\n $r1->apply_ops($repl2_ops);\n\n // replica_2 applies his op, then merges op from replica_1\n $r2->apply_ops($repl2_ops);\n echo \"\\nreplica_2 tree after move\\n\";\n print_tree($r2->state->tree);\n $r2->apply_ops($repl1_ops);\n\n // expected result: state is the same on both replicas\n // and final path is /root/c/a because last-writer-wins\n // and replica_2's op has a later timestamp.\n if ($r1->state->is_equal($r2->state)) {\n echo \"\\nreplica_1 state matches replica_2 state after each merges other's change. conflict resolved!\\n\";\n print_replica_trees($r1->state, $r2->state);\n } else {\n echo \"\\nwarning: replica_1 state does not match replica_2 state after merge\\n\";\n print_replica_trees($r1->state, $r2->state);\n file_put_contents(\"/tmp/repl1.json\", json_encode($r1, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/repl2.json\", json_encode($r2, JSON_PRETTY_PRINT));\n }\n $r1->state->check_log_is_descending();\n return;\n}", "public function processInput()\n {\n $directionsArray = explode(',', $this->input[0]);\n $allVisitedCoordinates = [];\n $currentPositionX = 0;\n $currentPositionY = 0;\n # This represents an angle\n $currentDirection = 0;\n foreach ($directionsArray as $step) {\n $step = trim($step);\n $turn = substr($step, 0, 1);\n $distance = substr($step, -1 * (strlen($step) - 1));\n // Check where we're facing\n $currentDirection += ($turn == 'L' ? -90 : 90);\n if ($currentDirection % 360 == 0) {\n $currentDirection = 0;\n }\n // Move by given distance changing the coordinates\n switch ($currentDirection) {\n case 0:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = $currentPositionX . ':' . ($currentPositionY + $i);\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionY += $distance;\n break;\n case 90:\n case -270:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = ($currentPositionX + $i) . ':' . $currentPositionY;\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionX += $distance;\n break;\n case -90:\n case 270:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = ($currentPositionX - $i) . ':' . $currentPositionY;\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionX -= $distance;\n break;\n case 180:\n case -180:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = $currentPositionX . ':' . ($currentPositionY - $i);\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionY -= $distance;\n break;\n }\n }\n $countArray = [];\n foreach ($allVisitedCoordinates as $key => $coordinates) {\n if (array_key_exists($coordinates, $countArray)) {\n $countArray[$coordinates]++;\n $c = $coordinates;\n break;\n } else {\n $countArray[$coordinates] = 1;\n }\n }\n $coordinates = explode(':', $c);\n $this->distanceTotal = abs($coordinates[0]) + abs($coordinates[1]);\n }", "public static function find_move ()\n {\n // Initialize the default value functions. These apply starting values\n // to each position on the board. The starting values are then used\n // in calculating the overall value of moving in each direction.\n $my_color = Map::current('color');\n static::$_value_functions = [\n '^c.$' => config::SCORE_OTHER_BOTS,\n \"^.$my_color\\$\" => config::SCORE_OWN_COLOR,\n '^.*$' => config::SCORE_OTHER_COLOR,\n ];\n // Initialize a default value matrix.\n static::$_value_matrix = static::_generate_value_matrix();\n // Load the default available commands.\n $commands = config::VALID_MOVES;\n // Retrieve coordinates for available moves from the current map.\n // Any invalid moves will get set to null.\n $available_moves = [];\n foreach ($commands as $command) {\n $available_moves[$command] = Map::get(Map::translate($command, Map::current('x'), Map::current('y')));\n }\n // Remove invalid directions -- edges of map and any adjacent tiles\n // containing another bot (and, for now, the \"idle\" command too).\n unset($available_moves['idle']);\n $available_moves = array_filter($available_moves, function($move){\n if ( is_null($move) || substr($move, 0, 1) == 'c' ) {\n return false;\n }\n return true;\n });\n // For now, let's continue this helpful debugging output. TODO.\n print_r($available_moves);\n // Select a strategy.\n // If there is only one move (or no moves), fall back to the \"stuck\"\n // strategy. In the future this strategy might do something cool.\n if ( count($available_moves) < 2 ) {\n return static::stuck($available_moves);\n }\n // If the bot is surrounded by its own color and all moves have negative\n // values, try escaping.\n if ( count(preg_grep(\"/^.$my_color\\$/\", $available_moves)) == count($available_moves) ) {\n echo \"Yipes! Surrounded by own color...\\n\";\n $positive_scores = array_filter(static::evaluate_moves($available_moves), function($score){\n return $score > 0;\n });\n if ( count($positive_scores) == 0 ) {\n return static::escape($available_moves);\n }\n }\n // Now that urgent situations are resolved, look at nearby bots and\n // consider their behavior.\n $bots = Map::get_bots();\n $my_bot = $bots[Map::current('x') . '/' . Map::current('y')];\n foreach ($bots as $location => $bot) {\n if ( $bot->color != $my_color && Map::distance($bot->x, $bot->y, Map::current('x'), Map::current('y')) < 10 && $bot->status() != 'inactive' ) {\n echo \"Nearby active opponent: \" . $bot->name . \"\\n\";\n // Check their move history against this bot's move history;\n // if they share more than 5 moves out of the last 20...\n $my_moves = array_filter($my_bot->get_recent_moves(20));\n $their_moves = array_filter($bot->get_recent_moves(20));\n $my_overlap = array_intersect($my_moves, $their_moves);\n $their_overlap = array_intersect($their_moves, $my_moves);\n // ...then try to figure out who's following who, and if the\n // other bot is following this bot, then switch to the \"punish\"\n // strategy.\n if ( count($their_overlap) > 5 && array_sum(array_keys($my_overlap)) > array_sum(array_keys($their_overlap)) ) {\n // If this bot's matching movement indices are generally\n // higher than the other bot's, then that means they've made\n // matching moves more recently, so the other bot can be\n // assumed to be following this one.\n return static::punish($available_moves, $bot);\n }\n }\n }\n // If more than 20% of the tiles on the map are unclaimed, then select\n // a friendlier, less aggressive movement pattern.\n if ( Map::count('ux') > array_product(Map::size()) * .2 ) {\n return static::cruise($available_moves);\n }\n // Default strategy: best local move.\n return static::aggressive($available_moves);\n }", "function test_concurrent_moves_cycle() {\n $r1 = new replica();\n $r2 = new replica();\n\n // Setup initial tree state.\n $ops = [new op_move($r1->tick(), null, \"root\", $root_id = new_id()),\n new op_move($r1->tick(), $root_id, \"a\", $a_id = new_id()),\n new op_move($r1->tick(), $root_id, \"b\", $b_id = new_id()),\n new op_move($r1->tick(), $a_id, \"c\", $c_id = new_id()),\n ];\n\n $r1->apply_ops($ops); // applied own ops\n $r2->apply_ops($ops); // merged ops from r1.\n\n echo \"Initial tree state on both replicas\\n\";\n print_tree($r1->state->tree);\n\n // replica_1 moves /root/b to /root/a\n $repl1_ops = [new op_move($r1->tick(), $a_id, \"b\", $b_id)];\n\n // replica_2 \"simultaneously\" moves /root/a to /root/b\n $repl2_ops = [new op_move($r2->tick(), $b_id, \"a\", $a_id)];\n\n // replica_1 applies his op, then merges op from replica_2\n $r1->apply_ops($repl1_ops);\n\n echo \"\\nreplica_1 tree after move\\n\";\n print_tree($r1->state->tree);\n $r1->apply_ops($repl2_ops);\n\n // replica_2 applies his op, then merges op from replica_1\n $r2->apply_ops($repl2_ops);\n echo \"\\nreplica_2 tree after move\\n\";\n print_tree($r2->state->tree);\n $r2->apply_ops($repl1_ops);\n\n // expected result: state is the same on both replicas\n // and final path is /root/c/a because last-writer-wins\n // and replica_2's op has a later timestamp.\n if ($r1->state->is_equal($r2->state)) {\n echo \"\\nreplica_1 state matches replica_2 state after each merges other's change. conflict resolved!\\n\";\n print_replica_trees($r1->state, $r2->state);\n } else {\n echo \"\\nwarning: replica_1 state does not match replica_2 state after merge\\n\";\n print_replica_trees($r1->state, $r2->state);\n file_put_contents(\"/tmp/repl1.json\", json_encode($r1, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/repl2.json\", json_encode($r2, JSON_PRETTY_PRINT));\n }\n $r1->state->check_log_is_descending();\n return;\n}", "public function testComputerMove()\n {\n $this->assertFalse($this->game->computerMove(3));\n $this->game->startNextTurn();\n $this->assertTrue($this->game->computerMove(3));\n\n // Add points to currentPoints enough to pass treshhold\n // computerMove should return false\n $this->diceHand->addToSerie(6);\n $this->diceHand->addToSerie(6);\n $this->game->checkHand($this->diceHand);\n $this->game->checkHand($this->diceHand);\n $this->assertFalse($this->game->computerMove(3.5));\n }", "function is_equal(log_op_move $other): bool {\n return $this == $other;\n }", "function no_double_moves(int $spareMoves, int $movesX, int $movesO): bool\n{\n return [\n [5, 4],\n [4, 4],\n [4, 3],\n [3, 3],\n [3, 2],\n [2, 2],\n [2, 1],\n [1, 1],\n [1, 0],\n [0, 0],\n ][$spareMoves] === [$movesX, $movesO];\n}", "function components_move()\n\t{\n\t\t//--------------------------------------------\n\t\t// INIT\n\t\t//--------------------------------------------\n\n\t\t$com_id \t= intval($this->ipsclass->input['com_id']);\n\t\t$move \t= trim($this->ipsclass->input['move']);\n\t\t$components = array();\n\t\t$final_coms = array();\n\t\t$used_pos = array();\n\t\t$max_pos = 0;\n\n\t\t//--------------------------------------------\n\t\t// Checks...\n\t\t//--------------------------------------------\n\n\t\tif ( ! $com_id OR ! $move )\n\t\t{\n\t\t\t$this->ipsclass->main_msg = \"No ID was passed, please try again\";\n\t\t\t$this->components_list();\n\t\t\treturn;\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t// Get components from database\n\t\t//--------------------------------------------\n\n\t\t$this->ipsclass->DB->build_query( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'components',\n\t\t\t\t\t\t\t\t\t\t\t\t 'order' => 'com_position ASC' ) );\n\t\t$this->ipsclass->DB->exec_query();\n\n\t\twhile( $c = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$max_pos += 1;\n\n\t\t\tif ( in_array( $c['com_position'], $used_pos ) )\n\t\t\t{\n\n\t\t\t\t$c['com_position'] = $max_pos;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$used_pos[] = $c['com_position'];\n\t\t\t}\n\n\t\t\t$components[ $c['com_id'] ] = $c['com_position'];\n\t\t}\n\n\t\tasort($components);\n\n\t\t$i \t\t = 0;\n\t\t$did_move = 0;\n\n\t\tforeach( $components as $k => $v )\n\t\t{\n\t\t\t$i++;\n\n\t\t\tif( $k == $com_id )\n\t\t\t{\n\t\t\t\tif( $move == 'up' )\n\t\t\t\t{\n\t\t\t\t\t// Move up (lower #)\n\t\t\t\t\t$last = array_pop( $final_coms );\n\t\t\t\t\t$final_coms[ $k ] = $i - 1;\n\n\t\t\t\t\tforeach( $components as $k2 => $v2 )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( $v2 == $last )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$final_coms[ $k2 ] = $i;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Move down (higher #)\n\n\t\t\t\t\t$final_coms[ $k ] = $i + 1;\n\t\t\t\t\t$did_move = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( $did_move == 1 )\n\t\t\t\t{\n\t\t\t\t\t$final_coms[ $k ] = $i - 1;\n\t\t\t\t\t$did_move = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$final_coms[ $k ] = $i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/*echo \"<pre>\";\n\t\tprint_r($final_coms);\n\t\texit;*/\n\n\t\tforeach( $final_coms as $k => $v )\n\t\t{\n\t\t\t$this->ipsclass->DB->do_update( 'components', array( 'com_position' => $v ), 'com_id='.$k );\n\t\t}\n\n\t\t$this->components_rebuildcache();\n\n\t\t$this->ipsclass->main_msg = \"Component item repositioned\";\n\t\t$this->components_list();\n\t}", "private function beforeMove(): bool\n {\n $event = new MoveEvent();\n $this->trigger(self::EVENT_BEFORE_MOVING, $event);\n\n return $event->canMove;\n }", "function _compareActions($a,$b){\n\t\tif ( @$a['order'] < @$b['order'] ) return -1;\n\t\telse return 1;\n\t}", "public static function evaluate_moves ($moves)\n {\n $scores = [];\n foreach ($moves as $direction => $value) {\n $scores[$direction] = 0;\n $x = Map::current('x');\n $y = Map::current('y');\n $weight = config::SCORE_WEIGHT_FACTOR;\n $score = 0;\n $spread = 0;\n $lookahead_iteration = 0;\n while ( true ) {\n $lookahead_iteration++;\n // Expand the lookahead beam a bit.\n if ( $lookahead_iteration % 2 != 0 ) {\n $spread++;\n }\n // Adjust weighting for distance from current position.\n $weight /= 2;\n // Transform coordinates.\n list($x, $y) = Map::translate($direction, $x, $y);\n // Calculate scores in this direction.\n $score = static::score($x, $y, $weight);\n if ( $score === 0 ) {\n // score() returns exactly 0 if the coordinates are not valid.\n break;\n }\n // If this direction is the opposite of the last direction, brutally\n // penalize it to prevent oscillations.\n if ( Map::last_move() != 'idle' && $direction == Map::opposite(Map::last_move()) ) {\n $score -= $weight;\n }\n // Calculate the final score for this iteration of this direction.\n $scores[$direction] += ($score + static::area_score($direction, $x, $y, $weight, $spread));\n }\n }\n var_dump($scores);\n arsort($scores);\n return $scores;\n }", "public function testVerifyToWin()\n {\n $match = $this->createMatch();\n\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n foreach([0, 1, 2] as $position) {\n\n $move = Move::where('position', $position)\n ->where(\"match_id\", $match->id)\n ->first();\n\n $move->value = 1;\n $move->save();\n\n }\n\n $winner = new Winner();\n $winner->verify($match, $position, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(1, $matchFound->winner);\n\n }", "function Move(){\n //--get request values\n $move_library = $this->Request->Value(\"move_library\");\n $item_id = $this->Request->Value(\"item_id\");\n $move_id = $this->Request->Value(\"move_id\");\n\n if (intval($move_id) == 0)\n return false;\n //--get move config file and move storage object\n $move_config = Engine::getLibrary($this->Kernel, $move_library, \"move_library_config_\" . $this->move_library);\n $move_Storage = DataFactory::GetStorage($this, $move_config->GetItem(\"MAIN\", \"TABLE\"));\n\n //--get move field\n if ($move_config->HasItem(\"MAIN\", \"MOVE_FIELD\")) {\n $move_field = $move_config->GetItem(\"MAIN\", \"MOVE_FIELD\");\n }\n else {\n if ($move_Storage->HasColumn(\"_priority\") !== false) {\n $move_field = \"_priority\";\n }\n else {\n $inc_column = $move_Storage->GetIncrementalColumn();\n $move_field = $inc_column[\"name\"];\n }\n }\n\n //get key field\n $inc_column = $move_Storage->GetIncrementalColumn();\n $key_field = $inc_column[\"name\"];\n //get current item\n $item = $move_Storage->Get(array(\n $key_field => $item_id));\n $move_item = $move_Storage->Get(array($key_field => $move_id));\n\n //--if near item not found\n if (intval($move_item[$key_field]) == 0) {\n return false;\n }\n\n if ($move_field != $key_field) { //-- change records (if priority field not a key field)\n $upd_array = array(\n $key_field => $item[$key_field] ,\n $move_field => $move_item[$move_field]);\n\n $move_Storage->Update($upd_array);\n $upd_array = array(\n $key_field => $move_item[$key_field] ,\n $move_field => $item[$move_field]);\n $move_Storage->Update($upd_array);\n }\n else { //-- change records (if priority field is a key field)\n $move_Storage->exchangeIncrementals($item_id, $move_id);\n\n //--check if library have a sub-categories\n if ($move_config->HasItem(\"MAIN\", \"USE_SUB_CATEGORIES\")) {\n $use_sub_categories = $move_config->GetItem(\"MAIN\", \"USE_SUB_CATEGORIES\");\n }\n else {\n $use_sub_categories = false;\n }\n\n //--if library use subcategories\n if ($use_sub_categories) {\n $sub_categories_count = $move_config->GetItem(\"MAIN\", \"SUB_CATEGORIES_COUNT\");\n for ($i = 0; $i < sizeof($sub_categories_count); $i ++) {\n $library = $move_config->GetItem(\"sub_category_\" . $i, \"APPLY_LIBRARY\");\n $link_field = $move_config->GetItem(\"sub_category_\" . $i, \"LINK_FIELD\");\n $sub_listSettings = Engine::getLibrary($this->Kernel, $library, \"sub_ListSettings_\" . $library);\n $sub_table = $sub_listSettings->GetItem(\"MAIN\", \"TABLE\");\n $this->Kernel->ImportClass(\"data.\" . strtolower($sub_table), $sub_table);\n $sub_Storage = new $sub_table($this->Kernel->Connection, $this->Kernel->Settings->GetItem(\"database\", $sub_table));\n $_sub_column = $sub_Storage->getIncrementalColumn();\n\n $upd_array1 = array();\n $upd_array2 = array();\n\n //move first record subitems\n $_list = $sub_Storage->GetList(array(\n $key_field => $item_id));\n if ($_list->RecordCount != 0) {\n while ($_sub_item = $_list->Read())\n $upd_array1[] = $_sub_item[$_sub_column[\"name\"]];\n }\n\n //move second record subitems\n $_list = $sub_Storage->GetList(array(\n $key_field => $move_id));\n if ($_list->RecordCount != 0) {\n while ($_sub_item = $_list->Read())\n $upd_array2[] = $_sub_item[$_sub_column[\"name\"]];\n }\n }\n //--move group for second and first record\n if (count($upd_array1))\n $sub_Storage->GroupUpdate($_sub_column[\"name\"], $upd_array1, array(\n $key_field => $move_id));\n if (count($upd_array2))\n $sub_Storage->GroupUpdate($_sub_column[\"name\"], $upd_array2, array(\n $key_field => $item_id));\n\n }\n\n //check if library is multiple\n if ($move_config->HasItem(\"MAIN\", \"IS_MULTILEVEL\")) {\n $is_multilevel = $move_config->GetItem(\"MAIN\", \"IS_MULTILEVEL\");\n if ($is_multilevel) {\n $parent_field = $move_config->GetItem(\"MAIN\", \"PARENT_FIELD\");\n $upd_array1 = array();\n $upd_array2 = array();\n //move first record childs\n $_list = $move_Storage->GetList(array(\n $parent_field => $item_id));\n if ($_list->RecordCount != 0) {\n while ($_sub_item = $_list->Read())\n $upd_array1[] = $_sub_item[$key_field];\n }\n\n //move second record childs\n $_list = $move_Storage->GetList(array(\n $parent_field => $move_id));\n if ($_list->RecordCount != 0) {\n while ($_sub_item = $_list->Read())\n $upd_array2[] = $_sub_item[$key_field];\n }\n if (count($upd_array1))\n $move_Storage->GroupUpdate($key_field, $upd_array1, array(\n $parent_field => $move_id));\n if (count($upd_array2))\n $move_Storage->GroupUpdate($key_field, $upd_array2, array(\n $parent_field => $item_id));\n }\n }\n return true;\n }\n\n }", "function _check ($from_lines, $to_lines) {\r\n if (serialize($from_lines) != serialize($this->orig()))\r\n trigger_error(\"Reconstructed original doesn't match\", E_USER_ERROR);\r\n if (serialize($to_lines) != serialize($this->_final()))\r\n trigger_error(\"Reconstructed final doesn't match\", E_USER_ERROR);\r\n\r\n $rev = $this->reverse();\r\n if (serialize($to_lines) != serialize($rev->orig()))\r\n trigger_error(\"Reversed original doesn't match\", E_USER_ERROR);\r\n if (serialize($from_lines) != serialize($rev->_final()))\r\n trigger_error(\"Reversed final doesn't match\", E_USER_ERROR);\r\n\r\n\r\n $prevtype = 'none';\r\n foreach ($this->edits as $edit) {\r\n if ( $prevtype == $edit->type )\r\n trigger_error(\"Edit sequence is non-optimal\", E_USER_ERROR);\r\n $prevtype = $edit->type;\r\n }\r\n\r\n $lcs = $this->lcs();\r\n trigger_error(\"Diff okay: LCS = $lcs\", E_USER_NOTICE);\r\n }", "function test_concurrent_moves_no_conflict() {\n $r1 = new replica();\n $r2 = new replica();\n\n // Setup initial tree state.\n $ops = [new op_move($r1->tick(), null, \"root\", $root_id = new_id()),\n new op_move($r1->tick(), $root_id, \"a\", $a_id = new_id()),\n new op_move($r1->tick(), $root_id, \"b\", $b_id = new_id()),\n ];\n\n $r1->apply_ops($ops); // applied own ops\n $r2->apply_ops($ops); // merged ops from r1.\n\n echo \"Initial tree state on both replicas\\n\";\n print_tree($r1->state->tree);\n\n // replica_1 moves /root/a to /root/c\n $repl1_ops = [new op_move($r1->tick(), $root_id, \"c\", $a_id)];\n\n // replica_2 \"simultaneously\" moves /root/b to /root/d\n $repl2_ops = [new op_move($r2->tick(), $root_id, \"d\", $b_id)];\n\n // replica_1 applies his op, then merges op from replica_2\n $r1->apply_ops($repl1_ops);\n\n echo \"\\nreplica_1 tree after move\\n\";\n print_tree($r1->state->tree);\n $r1->apply_ops($repl2_ops);\n\n // replica_2 applies his op, then merges op from replica_1\n $r2->apply_ops($repl2_ops);\n echo \"\\nreplica_2 tree after move\\n\";\n print_tree($r2->state->tree);\n $r2->apply_ops($repl1_ops);\n\n // expected result: state is the same on both replicas\n // and final path is /root/c/a because last-writer-wins\n // and replica_2's op has a later timestamp.\n if ($r1->state->is_equal($r2->state)) {\n echo \"\\nreplica_1 state matches replica_2 state after each merges other's change. conflict resolved!\\n\";\n print_replica_trees($r1->state, $r2->state);\n } else {\n echo \"\\nwarning: replica_1 state does not match replica_2 state after merge\\n\";\n print_replica_trees($r1->state, $r2->state);\n file_put_contents(\"/tmp/repl1.json\", json_encode($r1, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/repl2.json\", json_encode($r2, JSON_PRETTY_PRINT));\n }\n $r1->state->check_log_is_descending();\n return;\n}", "abstract public function hasAvailableMoves(): bool;", "protected function computerTurn(){ \r\n\t\t$getMinMaxResult = new MinMax($this); \r\n\t\tif ($getMinMaxResult->move) {\r\n\t\t\treturn $this->_move = $getMinMaxResult->move;\r\n\t\t}\r\n\t\treturn false; \r\n\t}", "function mmrpg_action_sort_switch($info1, $info2){\n if ($info1['robot_position'] == 'active'){ return -1; }\n elseif ($info2['robot_position'] == 'active'){ return 1; }\n elseif ($info1['robot_key'] < $info2['robot_key']){ return -1; }\n elseif ($info1['robot_key'] > $info2['robot_key']){ return 1; }\n else { return 0; }\n }", "public function testCompareReturnValues()\n\t{\n\t\t/** @var AbstractCollectorCommand $mock */\n\t\t$mock = $this->getAbstractCollectorMock();\n\n\t\t$this->assertEquals( -1, $mock->compare( 1, 2 ) );\n\t\t$this->assertEquals( 0, $mock->compare( 2, 2 ) );\n\t\t$this->assertEquals( 1, $mock->compare( 2, 1 ) );\n\t}", "protected function changeStateCheck()\n {\n if (empty($this->boardNewMoves)) {\n throw new BoardException(Yii::t('app', 'No move detected.'));\n }\n // Make sure 1 move has been made.\n if (count($this->boardNewMoves) > 1) {\n throw new BoardException(Yii::t('app', 'Only one move per request allowed.'));\n }\n\n // Make sure proper character used.\n $allowedCharacter = $this->moveCharacterMap[($this->getTotalMoves() + 1) % 2];\n if (($moveCharacter = $this->getNewMoveCharacter()) != $allowedCharacter) {\n throw new BoardException(Yii::t('app', 'You have to use character \"{allowedCharacter}\" instead of \"{moveCharacter}\"', [\n 'allowedCharacter' => $allowedCharacter,\n 'moveCharacter' => $moveCharacter,\n ]));\n }\n\n // Make sure that character has been placed into the proper position (not overriding existing).\n if (in_array($this->boardArr[$this->getNewMovePosition()], $this->moveCharacterMap)) {\n throw new BoardException(Yii::t('app', 'You are not allowed to override existing moves.'));\n }\n }", "public function testGetConsideredMovesReturnsCorrectMoveFromConsideredWithMultipleBlockSolutions()\n {\n //Return True only on $this->moves[2], $this->moves[4]\n $this->nextState->expects($this->exactly(count($this->moves)))\n ->method('isEndGame')\n ->will($this->onConsecutiveCalls(false, false, true, false, true, false, false, false, false));\n\n $consideredMoves = $this->mockEngine->getConsideredMoves();\n $this->assertNotContains($this->moves[0], $consideredMoves);\n $this->assertContains($this->moves[2], $consideredMoves);\n $this->assertContains($this->moves[4], $consideredMoves);\n $this->assertCount(2, $consideredMoves);\n }", "public function reorder_onMove()\n {\n $sourceNode = Page::find(post('sourceNode'));\n $targetNode = post('targetNode') ? Page::find(post('targetNode')) : null;\n\n if ($sourceNode == $targetNode) {\n return;\n }\n\n switch (post('position')) {\n case 'before':\n $sourceNode->moveBefore($targetNode);\n break;\n case 'after':\n $sourceNode->moveAfter($targetNode);\n break;\n case 'child':\n $sourceNode->makeChildOf($targetNode);\n break;\n default:\n $sourceNode->makeRoot();\n break;\n }\n }", "function compare($x, $y) {\n if($x[0] == \"N\" && $x[0] == $y[0]) return 0;\n if($x[0] == \"N\" && $y[0] == \"Y\") return 1;\n if($x[0] == \"Y\" && $y[0] == \"N\") return -1;\n $type1 = intval($x[3]);\n $type2 = intval($y[3]);\n if($type1 > $type2) return -1;\n if($type1 < $type2) return 1;\n $time1 = (float)$x[1];\n $time2 = (float)$y[1];\n if($time1 > $time2) return 1;\n if($time1 < $time2) return -1;\n $len1 = intval($x[2]);\n $len2 = intval($y[2]);\n if($len1 > $len2) return 1;\n if($len1 < $len2) return -1;\n return 0;\n}", "public function getConsideredMoves()\n {\n return $this->state->getValidMoves();\n }", "function compete2($a,$b){\n $p = intval(100 * getWinProb($a['elo']-$b['elo']));\n $expected = ($a['elo']>=$b['elo']) ? $a['name'] : $b['name'];\n $percent = ($a['elo']>=$b['elo']) ? $p.'%' : (100-$p).'%';\n $tempo = round(($a['tempo']+$b['tempo'])/2);\n $a_score = 0;\n $b_score = 0;\n echo sprintf(\"Now Playing: %s (%s) vs. %s (%s) \\n\", $a['name'], $a['elo'], $b['name'], $b['elo']);\n echo sprintf(\"Expected winner: %s (%s)\\n\", $expected, $percent);\n \n //echo sprintf(\"------------\\n\");\n //echo sprintf(\"| Game Log |\\n\");\n //echo sprintf(\"------------\\n\");\n //echo sprintf(\"Playing %s possessions\\n\\n\",$tempo);\n for($i=0;$i<$tempo;$i++){\n $a_points = playPosession($a['off'],$b['def']);\n $a_score += $a_points;\n $b_points = playPosession($b['off'],$a['def']);\n $b_score += $b_points;\n //echo sprintf(\"Possession #%s\\n\",$i);\n //echo sprintf(\"%s scored %s points\\n\",$a['name'],$a_points);\n //echo sprintf(\"%s scored %s points\\n\",$b['name'],$b_points);\n //echo sprintf(\"Score is %s %s-%s %s\\n\\n\", $a['name'], $a_score, $b_score, $b['name']);\n }\n while($a_score==$b_score){\n $ot = round($tempo/8);\n //echo sprintf(\"Overtime\\n\");\n //echo sprintf(\"Playing %s possessions\\n\", $ot);\n for($i=0;$i<$ot;$i++){\n $a_points = playPosession($a['off'],$b['def']);\n $a_score += $a_points;\n $b_points = playPosession($b['off'],$a['def']);\n $b_score += $b_points;\n //echo sprintf(\"Possession #%s\\n\",$i);\n //echo sprintf(\"%s scored %s points\\n\",$a['name'],$a_points);\n //echo sprintf(\"%s scored %s points\\n\",$b['name'],$b_points);\n //echo sprintf(\"Score is %s %s-%s %s\\n\\n\", $a['name'], $a_score, $b_score, $b['name']);\n }\n }\n $winner = ($a_score>$b_score) ? $a['name'] : $b['name'];\n $a_ppp = number_format($a_score/$tempo,3);\n $b_ppp = number_format($b_score/$tempo,3);\n echo sprintf(\"Final score is %s-%s, %s wins\\n\\n\", max($a_score,$b_score), min($a_score,$b_score), $winner);\n //echo sprintf(\"Points per Possession: %s: %s %s: %s\\n\\n\", $a['name'], $a_ppp, $b['name'], $b_ppp);\n return ($a_score>$b_score) ? $a : $b;\n}", "function test_apply_ops_random_order() {\n\n $r1 = new replica();\n $r2 = new replica();\n\n // Generate initial tree state.\n $ops = [new op_move($r1->tick(), null, \"root\", $root_id = new_id()),\n new op_move($r1->tick(), null, \"trash\", $trash_id = new_id()),\n new op_move($r1->tick(), $root_id, \"home\", $home_id = new_id()),\n new op_move($r1->tick(), $home_id, \"dilbert\", $dilbert_id = new_id()),\n new op_move($r1->tick(), $home_id, \"dogbert\", $dogbert_id = $dilbert_id),\n new op_move($r1->tick(), $dogbert_id, \"cycle_not_allowed\", $home_id),\n ];\n\n $r1->apply_ops($ops);\n $r1->state->check_log_is_descending();\n\n $start = microtime(true);\n $num_ops = count($ops);\n\n printf(\"Applying move operations from replica1 to replica2 in random orders...\\n\");\n $all_equal = true;\n\n for($i = 0; $i < 100000; $i ++) {\n $ops2 = $ops;\n shuffle($ops2);\n\n $r2 = new replica();\n $r2->apply_ops($ops2);\n\n if($i % 10000 == 0) {\n printf(\"$i... \");\n }\n $r2->state->check_log_is_descending();\n\n if (!$r1->state->is_equal($r2->state)) {\n file_put_contents(\"/tmp/repl1.json\", json_encode($r1, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/repl2.json\", json_encode($r2, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/ops1.json\", json_encode($ops, JSON_PRETTY_PRINT));\n file_put_contents(\"/tmp/ops2.json\", json_encode($ops2, JSON_PRETTY_PRINT));\n printf( \"\\nreplica_1 %s replica_2\\n\", $r1->state->is_equal($r2->state) ? \"is equal to\" : \"is not equal to\");\n $all_equal = false;\n break;\n }\n }\n $end = microtime(true);\n $elapsed = $end - $start;\n \n if($all_equal) {\n echo \"\\n\\nStates were consistent and log timestamps descending after each apply. :-)\\n\";\n } else {\n echo \"\\n\\nFound an inconsistent state. Check /tmp/ops{1,2}.json and /tmp/repl{1,2}.json.\\n\";\n }\n\n $tot_ops = $num_ops*$i;\n printf(\"\\nops_per_apply: %s, applies: %s, total_ops: %s, duration: %.8f, secs_per_op: %.8f\\n\", $num_ops, $i, $tot_ops, $elapsed, $elapsed / $tot_ops);\n}", "public function compare($inputImg, $scrapeImg) {\n\n \n if (!$this->validImage($this->folder.\"/local/\".$inputImg)) {\n return false;\n }\n\n // Compared to cryptographic hash functions like MD5 and SHA1 between two image\n if ($this->compareHash($inputImg, $scrapeImg)) {\n return true;\n }\n \n /**\n * Compare 2 images and get their hamming distance\n * The hamming distance is used to compare hashes. Low values will indicate that the images are similar or the same, high values indicate that the images are different. \n */\n if ($this->hammingDistance($inputImg, $scrapeImg)) {\n return true;\n }\n \n /*\n # Compute signatures for two images\n $cvec1 = puzzle_fill_cvec_from_file($this->folder.\"/local/logo_small_health_1.png\");\n $cvec2 = puzzle_fill_cvec_from_file($this->folder.\"/scrape/logo_small_health_1.png\");\n\n # Compute the distance between both signatures\n $d = puzzle_vector_normalized_distance($cvec1, $cvec2);\n\n # Are pictures similar?\n if ($d < PUZZLE_CVEC_SIMILARITY_LOWER_THRESHOLD) {\n echo \"Pictures are looking similar\\n\";\n } else {\n echo \"Pictures are different, distance=$d\\n\";\n }\n\n # Compress the signatures for database storage\n //$compress_cvec1 = puzzle_compress_cvec($cvec1);\n //$compress_cvec2 = puzzle_compress_cvec($cvec2);\n */\n\n // Get GIS for each\n //$image1Gis = getimagesize($image1);\n //$image2Gis = getimagesize($image2);\n\n // Both the same kind of file? -- No need \n /*if ($image1Gis['mime'] !== $image2Gis['mime']) {\n //'Not the same kind of file'\n return false;\n }*/\n\n // Same shape?\n /*$image1Ratio = $image1Gis[0]/$image1Gis[1];\n $image2Ratio = $image2Gis[0]/$image2Gis[1];\n $ratioDiff = abs($image1Ratio - $image2Ratio);\n if ($ratioDiff >= IMAGE_COMPARE_SHAPE_RATIO_THRESHOLD) {\n //'Not the same shape. Ratios: '.$image1Ratio.' '.$image2Ratio.'; Difference: '.$ratioDiff);\n return false;\n }*/\n\n // init the image objects\n $image1 = new \\Imagick();\n $image2 = new \\Imagick();\n\n // set the fuzz factor (must be done BEFORE reading in the images)\n //$image1->SetOption('fuzz', '2%');\n \n // read in the images\n $image1->readImage($this->folder.\"/local/\".$inputImg);\n $handle = fopen($scrapeImg, 'rb');\n $image2->readImageFile($handle);\n //$image2->readImage($this->folder.\"/scrape/\".$scrapeImg);\n\n // compare the images using METRIC=1 (Absolute Error)\n $result = $image1->compareImages($image2, \\Imagick::METRIC_MEANSQUAREERROR);\n //->compareImages($image2, 1);\n\n // compare the difference result with threshold value\n if (isset($result[1]) && $result[1] > IMAGE_COMPARE_SIMILARITY_THRESHOLD) {\n return false;\n }\n\n return true;\n }", "public function compareAction() {}", "function getMovesForMatch ()\r\n{\r\n\t//array of chess moves assuming a few things:\r\n\t/* \t- light/dark take turns \r\n\t\t- the moves are set up to take a piece and move it to another,\r\n\t\t\tso moving pawn e2 -> e4 would be stored as the first 2 elements in a multidimensional array.\r\n\t\t- there are many things that would need to be done to support algebraic chess notation, \r\n\t\t\tI didn't go into that here.\t\t\r\n\t\t\r\n\t*/\r\n\t$matchMoves = array();\r\n\t\r\n\t/*\r\n\t$matchMoves [0]['from'] = \"e2\";\r\n\t$matchMoves [0]['to'] \t= \"e4\";\r\n\t$matchMoves [1]['from'] = \"c7\";\r\n\t$matchMoves [1]['to']\t= \"c5\";\r\n\t\r\n\t$matchMoves [2]['from'] = \"g1\";\r\n\t$matchMoves\t[2]['to']\t= \"f3\";\r\n\t$matchMoves [3]['from'] = \"b8\";\r\n\t$matchMoves [3]['to']\t= \"c6\";\r\n\t\r\n\t//begin invalid off board examples\r\n\t$matchMoves [4]['from'] = \"c6\";\r\n\t$matchMoves [4]['to'] \t= \"c9\";\r\n\t\r\n\t$matchMoves [5]['from'] = \"c6\";\r\n\t$matchMoves [5]['to'] \t= \"c0\";\r\n\t\r\n\t$matchMoves [6]['from'] = \"c6\";\r\n\t$matchMoves [6]['to'] \t= \"z9\";\r\n\t*/\r\n\t//begin invalid examples for particular pieces\r\n\t\r\n\t//king =======================\r\n\t//bad move\r\n\t$matchMoves [7]['from'] = \"e8\";\r\n\t$matchMoves [7]['to'] \t= \"g7\";\r\n\t\r\n\t//bad move because pieces are in the way\r\n\t$matchMoves [8]['from'] = \"e8\";\r\n\t$matchMoves [8]['to'] \t= \"f7\";\r\n\t\r\n\t//rook =========================\r\n\t//bad move\r\n\t$matchMoves [9]['from'] = \"h8\";\r\n\t$matchMoves [9]['to'] \t= \"h5\";\r\n\t\r\n\t//move pawn first\r\n\t$matchMoves [10]['from'] = \"h7\";\r\n\t$matchMoves [10]['to'] \t = \"h6\";\t\r\n\t$matchMoves [11]['from'] = \"h6\";\r\n\t$matchMoves [11]['to'] \t = \"h5\";\r\n\t$matchMoves [12]['from'] = \"h5\";\r\n\t$matchMoves [12]['to'] \t = \"h4\";\r\n\t$matchMoves [13]['from'] = \"h8\";\r\n\t$matchMoves [13]['to'] \t = \"h5\";\r\n\t\r\n\t//bishop ========================\r\n\t//bad move\r\n\t$matchMoves [14]['from'] \t= \"c8\";\r\n\t$matchMoves [14]['to'] \t\t= \"b8\";\r\n\t\r\n\t//bad move because pieces are in the way\r\n\t$matchMoves [15]['from'] \t= \"c8\";\r\n\t$matchMoves [15]['to'] \t\t= \"c7\";\r\n\t\r\n\t//move pawn first\r\n\t$matchMoves [16]['from'] \t= \"b7\";\r\n\t$matchMoves [16]['to'] \t\t= \"b6\";\r\n\t$matchMoves [17]['from'] \t= \"c8\";\r\n\t$matchMoves [17]['to'] \t\t= \"a6\";\r\n\t\r\n\t//queen ==========================\r\n\t$matchMoves [18]['from'] \t= \"d8\";\r\n\t$matchMoves [18]['to'] \t\t= \"c8\";\r\n\t\r\n\t\t\r\n\t//setting up a check for between functions - rook\r\n\t$matchMoves [19]['from'] \t= \"f2\";\r\n\t$matchMoves [19]['to'] \t\t= \"f3\";\r\n\t$matchMoves [20]['from'] \t= \"f3\";\r\n\t$matchMoves [20]['to'] \t\t= \"f4\";\r\n\t$matchMoves [21]['from'] \t= \"f4\";\r\n\t$matchMoves [21]['to'] \t\t= \"f5\";\r\n\t\r\n\t$matchMoves [22]['from'] \t= \"h5\";\r\n\t$matchMoves [22]['to'] \t\t= \"e5\";\r\n\t\r\n\t//demonstrating capture move a pawn to capture\r\n\t$matchMoves [23]['from'] \t= \"f7\";\r\n\t$matchMoves [23]['to'] \t\t= \"f6\";\r\n\t$matchMoves [24]['from'] \t= \"g7\";\r\n\t$matchMoves [24]['to'] \t\t= \"g6\";\r\n\t$matchMoves [25]['from'] \t= \"f5\";\r\n\t$matchMoves [25]['to'] \t\t= \"g6\";\r\n\t\r\n\r\n\treturn ($matchMoves);\r\n}", "function movefile($POSTfrom, $POSTto, $currentdir) {\n\tif(count($POSTto) == 1) { //if the user selected only one \"move to\" location\n\t\tforeach($POSTfrom as $fromItem => $n1) { //$fromItem returns selected file/folder name to be moved, $n is checkbox status\n\t\t\tforeach($POSTto as $toItem => $n2) {//$toItem returns selected folder to have the files put in\n\t\t\t\tif(!file_exists($currentdir . \"/\" . $toItem . \"/\" . $fromItem)) {\n\t\t\t\t\tif(rename($currentdir . \"/\" . $fromItem, $currentdir . \"/\" . $toItem . \"/\" . $fromItem)) { //if rename worked, do nothing. Else, echo an error. Since rename() can rename a folder, it is possible to rename a file/folder to its new directory and have linux move it accourdingly\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else if ($fromItem == $toItem) { //if user tries to move the same folder into its self\n\t\t\t\t\t\techo \"<p><b>Error</b>: Could not move file or folder <b>\" . $fromItem . \"</b>. You cannot move a file into its self. Everything before it was moved.</p>\";\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"<p><b>Error</b>: Could not move file or folder <b>\" . $fromItem . \"</b>. Everything before it was moved.</p>\";\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\techo \"<p><b>Error</b>: File already exists in the folder you want to move it to. Everything before <b>\" . $fromItem . \"</b> has been moved.</p>\";\n\t\t\t\t\techo \"<p>Rename file if you want to move it.</p>\";\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\techo \"<p><b>Error</b>: You selected more than one destination folder, or none at all. Or, you might have not selected anything to move.</p>\";\n\t\treturn false;\n\t}\n\t\n\treturn true; // If everything worked out, return true\n}", "public function testGetConsideredMovesReturnsCorrectMoveFromConsideredWithOneBlockSolution()\n {\n //Return True only on $this->moves[2]\n $this->nextState->expects($this->exactly(count($this->moves)))\n ->method('isEndGame')\n ->will($this->onConsecutiveCalls(false, false, true, false, false, false, false, false, false));\n\n $consideredMoves = $this->mockEngine->getConsideredMoves();\n $this->assertNotContains($this->moves[0], $consideredMoves);\n $this->assertContains($this->moves[2], $consideredMoves);\n $this->assertCount(1, $consideredMoves);\n }", "function mm_ui_content_copymove_validate($form, &$form_state, $restore = FALSE) {\n _mm_ui_content_copymove_get_values($form_state['values'], $src_mmtid, $modes, $src_parent_mmtid, $dest_mmtid);\n $nodes_only = $modes['move_nodes'] || $modes['copy_nodes'] && !$modes['copy_page'];\n\n if ($modes['copy_page'] || $modes['move_page']) {\n mm_ui_validate_fake_required($form['name_alias']['name'], trim($form_state['values']['name']));\n mm_ui_validate_fake_required($form['name_alias']['alias'], trim($form_state['values']['alias']));\n }\n\n if (!$src_mmtid || !is_numeric($src_mmtid)) {\n form_set_error('', t('Missing one or more required fields'));\n return;\n }\n\n $x = mm_ui_strings(mm_content_is_group($src_mmtid));\n\n if ($modes['move_page'] && !mm_content_user_can($src_mmtid, 'w'))\n $message = t('You do not have permission to modify this @thing.', $x);\n\n if ($modes['move_page'] && !$restore && !mm_content_user_can($src_parent_mmtid, 'a'))\n $message = t('You do not have permission to modify the source @thingpos parent.', $x);\n\n if (!is_numeric($dest_mmtid) || !mm_content_user_can($dest_mmtid, $nodes_only ? 'u' : 'a'))\n $message = t('You do not have permission to modify the destination @thing.', $x);\n\n if (mm_content_is_normal($src_mmtid) != mm_content_is_normal($dest_mmtid) || mm_content_is_group($src_mmtid) != mm_content_is_group($dest_mmtid))\n $message = t('Source and destination are not of the same type.');\n\n if (mm_content_user_can($dest_mmtid, 'IS_RECYCLED'))\n if ($modes['copy_nodes'] || $modes['copy_page']) {\n $message = 'You cannot copy to a recycle bin.';\n }\n else {\n $message = 'You cannot move to a recycle bin using this option. Please use the Delete option, instead.';\n }\n\n if ($message) {\n watchdog('mm', $message, array(), WATCHDOG_WARNING, \"source: $src_mmtid, dest: $dest_mmtid\");\n form_set_error('', t($message));\n return;\n }\n\n if (mm_content_is_vgroup($src_mmtid) != mm_content_is_vgroup($dest_mmtid)) {\n form_set_error('dest', mm_content_is_vgroup($src_mmtid) ? t('Pre-defined groups can only be moved to create sub-groups of other pre-defined groups.') : t('You cannot copy/move a regular group inside the pre-defined groups list.'));\n }\n\n if (!$nodes_only && !_mm_ui_validate_entry($src_mmtid, $dest_mmtid, $form_state['values'], TRUE, TRUE)) {\n return;\n }\n\n if ($dest_mmtid == $src_parent_mmtid && $modes['move_page']) {\n form_set_error('', t('Instead of moving a @thing within the same parent @thing, rename it using Settings-&gt;Edit.', $x));\n }\n else if ($dest_mmtid == $src_mmtid && $nodes_only && $modes['move_nodes']) {\n form_set_error('', t('Moving just a @thingpos contents to itself results in no change.', $x));\n }\n else if ($dest_mmtid == $src_mmtid && !$modes['move_nodes'] && ($modes['move_page'] || $modes['copy_recur'])) {\n form_set_error('', t('You cannot copy or move a @thing within itself.', $x));\n }\n else if (mm_content_is_child($dest_mmtid, $src_mmtid)) {\n if ($modes['move_page']) {\n form_set_error('dest', t('You cannot move a @thing into a @subthing of itself. Please choose another destination.', $x));\n }\n else if ($modes['copy_recur']) {\n form_set_error('dest', t('You cannot copy a @thing and any @subthings into a child of itself. Please choose another destination.', $x));\n }\n }\n else if ($modes['move_nodes'] && mm_content_is_archive($dest_mmtid)) {\n form_set_error('dest', t('You cannot move content into an archive. Move the content into the main @thing, instead, and the archive will be updated automatically.', $x));\n }\n}", "protected function isValidMove($move = NULL) {\n $hasValidMove = FALSE;\n if (isset($move)) {\n if (isset($this->_boardResponse[$move]) && $this->isCellOpen($move))\n return $move;\n return false;\n } else {\n while (TRUE) {\n $move = strtoupper($this->userInput());\n if (isset($this->_boardResponse[$move]) && $this->isCellOpen($move))\n return $move;\n return false;\n }\n }\n }", "function legalMovesFromState(string $state): Generator\n{\n foreach (ROOMTOPS as $type => $pos) {\n if ($state[$pos] === $type && $state[$pos+1] === '.') {\n yield switchPositions($state, $pos, $pos+1) => COSTS[$type];\n }\n }\n\n // move 'em up should they not be in their room, and the top position is empty\n foreach (ROOMTOPS as $type => $pos) {\n if ($state[$pos+1] !== $type && $state[$pos+1] !== '.' && $state[$pos] === '.') {\n yield switchPositions($state, $pos, $pos+1) => COSTS[$state[$pos+1]];\n }\n }\n\n // go over things in the hallway and move them to the rooms -- only if the way is free.\n for ($i = 0; $i < 11; $i++) {\n if ($state[$i] === '.') { // empty tiles we can ignore\n continue;\n }\n\n $currentCritter = $state[$i];\n $targetTile = ROOMTOPS[$currentCritter];\n if ($state[$targetTile] !== '.') { // topmost tile in target room occupied -- can't move\n continue;\n }\n if ($state[$targetTile + 1] !== '.' && $state[$targetTile + 1] !== $currentCritter ) { // bottom part in target room occupied by different race\n continue;\n }\n\n $entrance = ENTRANCES[$currentCritter];\n if ($entrance > $i) {\n $checkAgainst = str_pad('.', ($entrance - $i), '.');\n if (substr($state, $i+1, $entrance - $i) === $checkAgainst) {\n yield switchPositions($state, $i, $targetTile) => (COSTS[$currentCritter] * ($entrance - $i + 1));\n }\n } elseif ($entrance < $i) {\n $checkAgainst = str_pad('.', ($i - $entrance), '.');\n $actual = substr($state, $entrance, $i - $entrance);\n if ($actual === $checkAgainst) {\n yield switchPositions($state, $i, $targetTile) => (COSTS[$currentCritter] * ($i - $entrance + 1));\n }\n }\n\n }\n\n // find all possible places to move into from the top of the room - only if top of room is occupied\n // and critter is not\n foreach (ROOMTOPS as $critterType => $position) {\n if ($state[$position] === '.') { // empty tiles we can ignore\n continue;\n }\n\n $currentCritter = $state[$position];\n $tileContentBelow = $state[$position+1];\n // making sure the things stay in their room when they are already in their target room and do not block something.\n if ($critterType === $currentCritter && ($tileContentBelow === '.' || $tileContentBelow === $critterType)) {\n continue;\n }\n\n // now we go left and right, skipping the roomtops and aborting the mission should we encounter an\n // occupied tile\n\n $entrance = ENTRANCES[$critterType];\n //left\n for ($pos = $entrance; $pos >= 0; $pos--) {\n if ($state[$pos] !== '.') { // topmost tile in target room occupied -- can't move\n break;\n }\n if (in_array($pos, ENTRANCES)) {\n continue;\n }\n yield switchPositions($state, $position, $pos) => (COSTS[$currentCritter] * ($entrance - $pos + 1));\n }\n\n //right\n for ($pos = $entrance; $pos < 11; $pos++) {\n if ($state[$pos] !== '.') { // topmost tile in target room occupied -- can't move\n break;\n }\n if (in_array($pos, ENTRANCES)) {\n continue;\n }\n yield switchPositions($state, $position, $pos) => (COSTS[$currentCritter] * ($pos - $entrance + 1));\n }\n }\n}", "public function compare();", "function makeOpponentMove($x,$y){\n if ($this->strategy == \"Random\"){\n $rand = new RandomStrategy();\n $place = $rand->pickPlace($x,$y);\n return $place;\n }\n $smart = new SmartStrategy();\n $place = $smart->pickPlace($x,$y);\n return $place;\n }", "function do_op(op_move $op, tree $t): array {\n\n // When a replica applies a Move op to its tree, it also records\n // a corresponding LogMove op in its log. The t, p, m, and c\n // fields are taken directly from the Move record, while the oldp\n // field is filled in based on the state of the tree before the move.\n // If c did not exist in the tree, oldp is set to None. Otherwise\n // oldp records the previous parent and metadata of c.\n $oldp = $t->find($op->child_id);\n $log = new log_op_move($op, $oldp);\n\n // ensures no cycles are introduced. If the node c\n // is being moved, and c is an ancestor of the new parent\n // newp, then the tree is returned unmodified, ie the operation\n // is ignored.\n // Similarly, the operation is also ignored if c == newp\n if($op->child_id === $op->parent_id ||\n is_ancestor($t, $op->parent_id, $op->child_id)) {\n// echo \"tree unchanged!\\n\";\n return [$log, $t];\n }\n\n // Otherwise, the tree is updated by removing c from\n // its existing parent, if any, and adding the new\n // parent-child relationship (newp, m, c) to the tree.\n $t->rm_child($op->child_id);\n $tt = new tree_node($op->parent_id, $op->metadata);\n $t->add_node($op->child_id, $tt);\n// echo \"tree changed!\\n\";\n return [$log, $t];\n}", "public function nextPossibleMove()\n {\n $x = $this->snake['pos']['x'];\n $y = $this->snake['pos']['y'];\n \n $moves = [\n 'up' => [$x, $y - 1],\n 'right' => [$x + 1, $y],\n 'down' => [$x, $y + 1],\n 'left' => [$x - 1, $y],\n ];\n\n $moves = $this->removeDeadMoves($moves);\n\n if (empty($moves)) {\n return $moves;\n }\n\n $moves = $this->calcThresholds($moves);\n\n if (!empty($safe = array_diff_key($moves, $this->getDangerMoves($moves)))) {\n $danger = array_intersect_key($moves, $this->getDangerMoves($moves));\n\n $threshold = array_first($safe)[2];\n\n if ($threshold > 7 && !empty($danger)) {\n return $danger;\n }\n\n if ($threshold > 5) {\n if (!empty($tail = $this->getTailMoves($safe))) {\n return $tail;\n }\n }\n\n if ($threshold > 5 && $this->snake['health'] < 95) {\n $result = $this->getFoodMoves($safe);\n\n if (!empty($result)) {\n return $result;\n }\n }\n\n return $safe;\n }\n\n if (!empty($head = $this->getHeadMoves($moves))) {\n return $head;\n }\n\n if (!empty($tail = $this->getTailMoves($moves))) {\n return $tail;\n }\n\n return $moves;\n }", "public function compare($t1, $t2)\n {\n // Zwangsabstieg prüfen\n if ($t1['static_position']) {\n return 1;\n }\n if ($t2['static_position']) {\n return -1;\n }\n\n // Zuerst die Punkte\n if ($t1['points'] == $t2['points']) {\n // tx_rnbase_util_Debug::debug($t1,'compare'.__LINE__);\n // Die gewonnenen Spiele prüfen\n if ($t1['winCount'] == $t2['winCount']) {\n // Jetzt den Satzquotient prüfen\n $t1setquot = $t1['sets_quot'];\n $t2setquot = $t2['sets_quot'];\n if ($t1setquot == $t2setquot) {\n // Jetzt der Ballquotient\n $t1balls = $t1['balls_quot'];\n $t2balls = $t2['balls_quot'];\n if ($t1balls == $t2balls) {\n // Und jetzt der direkte Vergleich\n $baseData = Util::prepareH2H($this->_teamData, $t1, $t2);\n $t1vst2 = $baseData['t1vst2'];\n $t2vst1 = $baseData['t2vst1'];\n $t1H2HPoints = $baseData['t1H2HPoints'];\n $t2H2HPoints = $baseData['t2H2HPoints'];\n if ($t1H2HPoints == $t2H2HPoints) {\n // dann eben zuerst die Satzdifferenz der 2 Spiele prüfen (Hin- und Rückspiel)\n $t1H2HDiff = 0 + $t1vst2[0] + $t2vst1[1] - $t1vst2[1] - $t2vst1[0];\n $t2H2HDiff = 0 + $t1vst2[1] + $t2vst1[0] - $t1vst2[0] - $t2vst1[1];\n if ($t1H2HDiff == $t2H2HDiff) {\n return 0; // Gleichstand. Entscheidungsspiel wird nicht beachtet\n }\n\n return $t1H2HDiff > $t2H2HDiff ? -1 : 1;\n }\n\n return $t1H2HPoints > $t2H2HPoints ? -1 : 1;\n }\n\n return $t1balls > $t2balls ? -1 : 1;\n }\n\n return $t1setquot > $t2setquot ? -1 : 1;\n }\n\n return $t1['winCount'] > $t2['winCount'] ? -1 : 1;\n }\n\n return $t1['points'] > $t2['points'] ? -1 : 1;\n }", "function move($source, $destination);", "protected function userMove() {\n echo \"Your move: \";\n $move = FALSE;\n while ($move === FALSE) {\n $move = $this->isValidMove();\n if ($move === FALSE)\n echo $this->promptMessage('invalid_move');\n }\n if (strtoupper($move) == self::QUIT_BUTTON)\n return TRUE;\n\n\n echo \"Your move is '\" . $this->_userMark . \"' at box \" . $move . PHP_EOL;\n $this->_markers[$this->_userMark][] = $move;\n $this->drawBoard($this->_markers);\n if ($this->isWon($this->_userMark) || $this->isBoardFull())\n return TRUE;\n return FALSE;\n }", "function cmp($a, $b)\n {\n if ($a->points == $b->points) {\n return 0;\n }\n return ($a->points > $b->points) ? -1 : 1;\n }", "function calculate_winners($stdin){\r\n\r\n if (isset($_POST['single'])){\r\n\r\n // Setting the stdin to the value input by the user \r\n $stdin = $_POST['input'];\r\n\r\n // Getting the vars that will store the total wins\r\n global $x;\r\n global $o;\r\n global $d; \r\n\r\n // Replacing all line breaks with nothing so we get one big long string with all results inside\r\n $stdin = str_replace(\"\\\\n\",\"\",$stdin);\r\n \r\n // create a variable equal to the length of the string so that we can separate out individual games easily\r\n $length = strlen($stdin);\r\n\r\n // loop through the entire input (here $i is set as individual moves as this point)\r\n for ($i=1; $i<=$length; $i++) {\r\n\r\n if ($i % 9 === 0){\r\n\r\n // Separate out each individual 9 game move and set it to the $outcome var\r\n $outcome = substr($stdin, $i-9, 9);\r\n\r\n // Calculate the outcome of the winner of each 9 move game\r\n // Probably an ineffient way to do this **REVISIT**\r\n if ($outcome[0] === \"x\" && $outcome[1] === \"x\" && $outcome[2] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[3] === \"x\" && $outcome[4] === \"x\" && $outcome[5] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[6] === \"x\" && $outcome[7] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[3] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[1] === \"x\" && $outcome[4] === \"x\" && $outcome[7] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[5] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[4] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[4] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"o\" && $outcome[1] === \"o\" && $outcome[2] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[3] === \"o\" && $outcome[4] === \"o\" && $outcome[5] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[6] === \"o\" && $outcome[7] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[3] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[1] === \"o\" && $outcome[4] === \"o\" && $outcome[7] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[5] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[4] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[4] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else {\r\n $winner = \"draw\";\r\n self::add_game($winner, $outcome);\r\n $d++;\r\n } \r\n }\r\n }\r\n \r\n // End of for loop for individual input\r\n // This will take the amount of wins and call a function that will display to the end user\r\n // No need for SQL input at this point as this information is just displayed and then not needed\r\n // All relevant information has already been added to the db \r\n self::calculate_single_input($x, $o, $d);\r\n }\r\n }", "function validateCompare ($input, $input2, $option = 'same') {\n if($input === $input2) {\n return true;\n } else {\n return false;\n }\n}", "abstract protected function play(array $move = array());", "function move($original, $destination)\n{\n require(\"../includes/global.php\");\n\n // get the up to date board and turns information\n $board = $_SESSION['board'];\n $turns = $_SESSION['turns'];\n \n if ($board[$destination[0]][$destination[1]][\"piece\"] != \"empty\" && \n $board[$original[0]][$original[1]][\"white\"] == $board[$destination[0]][$destination[1]][\"white\"])\n {\n echo(\"<h3 id='h3'>You can't capture your own piece!</h3>\");\n render(\"playchess.php\");\n }\n if ($board[$destination[0]][$destination[1]][\"piece\"] == \"king\")\n {\n echo(\"<h3 id='h3'>You can't capture a king!</h3>\");\n render (\"playchess.php\");\n }\n \n // stores the contents of the destination square, just in case you've put yourself into check and need to change things back\n $temp = $board[$destination[0]][$destination[1]];\n // puts chess piece into destination square\n $board[$destination[0]][$destination[1]] = $board[$original[0]][$original[1]];\n // makes original square empty\n $board[$original[0]][$original[1]] = [\"ascii\" => \"\", \"white\" => \"nope not quite\", \"piece\" => \"empty\"];\n\n $_SESSION['board'] = $board;\n \n // if you've put yourself into check\n if (($turns % 2 == 0 && iswhitechecked() == true) || ($turns % 2 == 1 && isblackchecked() == true))\n {\n\n // the move is illegal, so you need to restore the board back to its original position\n $board[$original[0]][$original[1]] = $board[$destination[0]][$destination[1]];\n $board[$destination[0]][$destination[1]] = $temp;\n $_SESSION['board'] = $board;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>That move puts you in check!</h3>\");\n render(\"playchess.php\");\n }\n else\n {\n $turns++;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>The overlords approve.</h3>\");\n render(\"playchess.php\");\n }\n}", "function mindist($r1) {\r\n $debug = 0;\r\n if (($this->max->x() >= $r1->min->x()) and ($this->min->x() <= $r1->max->x())) { // Les X s'intersectent\r\n if (($this->max->y() >= $r1->min->y()) and ($this->min->y() <= $r1->max->y())) { // Les Y s'intersectent\r\n if ($debug) echo \"cas 1 : les 2 rectangles s'intersectent\\n\";\r\n return 0; // cas 1 : les 2 rectangles s'intersectent\r\n } else { // Les Y ne s'intersectent pas\r\n if ($debug) echo \"cas 3 : X s'intersectent mais pas les Y \\n\";\r\n return min (abs($this->max->y() - $r1->min->y()), abs($r1->max->y() - $this->min->y())); // cas 3: X s'intersectent mais pas les Y \r\n }\r\n } elseif (($this->max->y() >= $r1->min->y()) and ($this->min->y() <= $r1->max->y())) { // Les Y s'intersectent\r\n if ($debug) echo \"cas 2: Y s'intersectent mais pas les X\\n\";\r\n return min (abs($this->max->x() - $r1->min->x()), abs($r1->max->x() - $this->min->x())); // cas 2: Y s'intersectent mais pas les X\r\n } elseif ($this->min->x() < $r1->min->x()) {\r\n if ($this->min->y() < $r1->min->y()) { // cas 4a : r1 au NE de this\r\n if ($debug) echo \"cas 4a : r1 au NE de this\\n\";\r\n return $this->max->distance($r1->min);\r\n } else { // cas 4b : r1 au SE de this\r\n if ($debug) echo \"cas 4b : r1 au SE de this\\n\";\r\n return sqrt(square($r1->min->x() - $this->max->x()) + square($this->min->y() - $r1->max->y()));\r\n }\r\n } else {\r\n if ($this->min->y() < $r1->min->y()) { // cas 4d : r1 au NW de this\r\n if ($debug) echo \"cas 4d : r1 au NW de this\\n\";\r\n return sqrt(square($r1->max->x() - $this->min->x()) + square($this->max->y() - $r1->min->y()));\r\n } else { // cas 4c : r1 au SW de this\r\n if ($debug) echo \"cas 4c : r1 au SW de this\\n\";\r\n return $this->min->distance($r1->max);\r\n }\r\n }\r\n die(\"erreur\");\r\n }", "abstract protected function move($board);", "abstract public function moveAsFirst(): bool;", "public function testMove(): void\n {\n $this->document1->setResourceSegment('/products/news/content1-news');\n $this->phpcrMapper->save($this->document1);\n $this->sessionManager->getSession()->save();\n\n // move\n $this->document1->setResourceSegment('/products/asdf/content2-news');\n $this->phpcrMapper->save($this->document1);\n $this->sessionManager->getSession()->save();\n\n $oldNode = $this->defaultSession->getNode('/cmf/sulu_io/routes/de/products/news/content1-news');\n $newNode = $this->defaultSession->getNode('/cmf/sulu_io/routes/de/products/asdf/content2-news');\n\n $oldNodeMixins = $oldNode->getMixinNodeTypes();\n $newNodeMixins = $newNode->getMixinNodeTypes();\n\n $this->assertEquals('sulu:path', $newNodeMixins[0]->getName());\n $this->assertEquals('sulu:path', $oldNodeMixins[0]->getName());\n\n $this->assertTrue($oldNode->getPropertyValue('sulu:history'));\n $this->assertEquals($newNode, $oldNode->getPropertyValue('sulu:content'));\n $this->assertEquals(\n $this->documentInspector->getNode($this->document1),\n $newNode->getPropertyValue('sulu:content')\n );\n\n // get content from new path\n $result = $this->phpcrMapper->loadByResourceLocator('/products/asdf/content2-news', 'sulu_io', 'de');\n $this->assertEquals($this->document1->getUuid(), $result);\n\n // get content from history should throw an exception\n $this->expectException(ResourceLocatorMovedException::class);\n $this->phpcrMapper->loadByResourceLocator('/products/news/content1-news', 'sulu_io', 'de');\n }", "public function testMoveMessage()\n {\n $this->assertSame($this->funcForTestMove(), \"\");\n }", "public function testCheckWinner()\n {\n $rawBoard = [2,2,1,0,1,1,2,2,2];\n $feedback = [0=>8, 1=>1, 2=>6, 3=>3, 4=>5, 5=>7, 6=>4, 7=>9, 8=>2];\n $formatedBoardRow = 0;\n foreach ($feedback as $index=>$value) {\n if ($index%3==0) {\n $formatedBoardRow++;\n }\n if ($rawBoard[$index] == 1) {\n $formatedBoard[$formatedBoardRow][$value] = \"X\";\n }\n if ($rawBoard[$index] == 2) {\n $formatedBoard[$formatedBoardRow][$value] = \"O\";\n }\n }\n $this->_board = $formatedBoard;\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n //$this->assertGreaterThan($this->_maxScore, $this->_scorePlayerOne);\n //$this->assertEquals($this->_scorePlayerTwo, 10);\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertEquals(2, $whoHasWon);\n }", "protected function _move($source, $targetDir, $name) {\r\n\t\treturn false;\r\n\t}", "public function testMoveTwice()\n {\n $this->rlpMapper->save($this->content1, '/products/news/content1-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n // first move\n $this->rlpMapper->move('/products/news/content1-news', '/products/news/content2-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n // second move\n $this->rlpMapper->move('/products/news/content2-news', '/products/asdf/content2-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n $oldNode = $this->session->getNode('/cmf/default/routes/de/products/news/content1-news');\n $newNode = $this->session->getNode('/cmf/default/routes/de/products/asdf/content2-news');\n\n $oldNodeMixins = $oldNode->getMixinNodeTypes();\n $newNodeMixins = $newNode->getMixinNodeTypes();\n\n $this->assertEquals('sulu:path', $newNodeMixins[0]->getName());\n // FIXME after change mixin works: $this->assertEquals('sulu:history', $oldNodeMixins[0]->getName());\n\n $this->assertEquals($newNode, $oldNode->getPropertyValue('sulu:content'));\n $this->assertEquals($this->content1, $newNode->getPropertyValue('sulu:content'));\n\n // get content from new path\n $result = $this->rlpMapper->loadByResourceLocator('/products/asdf/content2-news', 'default', 'de');\n $this->assertEquals($this->content1->getIdentifier(), $result);\n\n // get content from history should throw an exception\n $this->setExpectedException('Sulu\\Component\\Content\\Exception\\ResourceLocatorMovedException');\n $result = $this->rlpMapper->loadByResourceLocator('/products/news/content1-news', 'default', 'de');\n }", "function pawn($original_position, $new_position){\n\t\t//if($vector == 1 move ahead\n\t\t//X movement\n\t\t//Y movement\n\t\t//E2 to E4\n\t\t//E minus the E\n\t\t//4 minus 2\n\t\n\t}", "private function findLineMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif(\t$hole )\n\t\t\t\t{\n\t\t\t\t\tif($hole->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('up', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i + 3][$j]) &&\n\t\t\t\t\t\t\t$this->board[$i + 3][$j]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\t\t$moves[0][] = array('up', $i, $j);\n\t\t\t\t\t\t\t$moves[0][] = array('down', $i + 3, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('right', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i][$j + 3]) &&\n\t\t\t\t\t\t\t$this->board[$i][$j + 3]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\t\t$moves[1][] = array('right', $i, $j);\n\t\t\t\t\t\t\t$moves[1][] = array('left', $i, $j + 3);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('down', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i - 3][$j]) &&\n\t\t\t\t\t\t\t$this->board[$i - 3][$j]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\t\t$moves[2][] = array('down', $i, $j);\n\t\t\t\t\t\t\t$moves[2][] = array('top', $i - 3, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('left', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i][$j - 3]) &&\n\t\t\t\t\t\t\t$this->board[$i][$j - 3]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\t\t$moves[3][] = array('left', $i, $j);\n\t\t\t\t\t\t\t$moves[3][] = array('right', $i, $j - 3);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}", "public function check($from_lines, $to_lines) {\n if (serialize($from_lines) != serialize($this->orig())) {\n trigger_error(\"Reconstructed original doesn't match\", E_USER_ERROR);\n }\n if (serialize($to_lines) != serialize($this->closing())) {\n trigger_error(\"Reconstructed closing doesn't match\", E_USER_ERROR);\n }\n\n $rev = $this->reverse();\n if (serialize($to_lines) != serialize($rev->orig())) {\n trigger_error(\"Reversed original doesn't match\", E_USER_ERROR);\n }\n if (serialize($from_lines) != serialize($rev->closing())) {\n trigger_error(\"Reversed closing doesn't match\", E_USER_ERROR);\n }\n\n $prevtype = 'none';\n foreach ($this->edits as $edit) {\n if ( $prevtype == $edit->type ) {\n trigger_error(\"Edit sequence is non-optimal\", E_USER_ERROR);\n }\n $prevtype = $edit->type;\n }\n\n $lcs = $this->lcs();\n trigger_error('Diff okay: LCS = ' . $lcs, E_USER_NOTICE);\n }", "function pick_move() {\r\n $fill = false;\r\n do {\r\n //picks a random \"-\" spot and will fill it with \"x\" to represent opponent's move\r\n $next = rand(0, 8);\r\n if ($this->position[$next] == '-') {\r\n $this->position[$next] = 'x';\r\n $fill = true;\r\n }\r\n //keep filling until winning condition is found\r\n } while (!$fill);\r\n }", "static function compare(Transfer $a, Transfer $b) {\n\t\treturn $a->value - $b->value;\n\t}", "private function move() {\n if ($this->facing === 'N') {\n $this->y++;\n } else if ($this->facing === 'E') {\n $this->x++;\n } else if ($this->facing === 'S') {\n $this->y--;\n } else if ($this->facing === 'W') {\n $this->x--;\n }\n \n // Check if we are still on the planet.\n if (($this->x < 0 || $this->x > $this->maxX) || ($this->y < 0 || $this->y > $this->maxY)) {\n // Out of safe planet boundaries.\n $this->crash = true;\n }\n }", "function move_list ( )\t\t\t\t\t\t\t\t\t\t\t\t// We're going to generate our move list (for generation I).\n\t{\n\t\tglobal $config;\n\t\t$moves1\t= \tarray(\n\t\t\t\"Pound\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// Move name,\n\t\t\t\t\"type\"\t=>\t\"Normal\",\t\t\t\t\t\t\t\t\t// Move type, which will be used for type effectiveness,\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\t\t\t\t\t\t\t\t\t// Type of attack, which attack stat is used (Attack or Sp. Attack) and defense stat (Defense, Sp. Defense).\n\t\t\t\t\"pp\"\t=>\t35,\t\t\t\t\t\t\t\t\t\t\t// Power points, pp, how many times it can be used,\n\t\t\t\t\"pwr\"\t=>\t40,\t\t\t\t\t\t\t\t\t\t\t// Power, it's base damage,\n\t\t\t\t\"acc\"\t=>\t100,\t\t\t\t\t\t\t\t\t\t// Accuracy, the move's base accuracy.\n\t\t\t\t\"pri\"\t=>\t0,\t\t\t\t\t\t\t\t\t\t\t// Priority. Priority ignores the speed calcs.\n\t\t\t\t\"multi\"\t=>\t\"no\",\t\t\t\t\t\t\t\t\t\t// Will it multihit? \n\t\t\t\t\"recoil\"=>\t\"no\",\t\t\t\t\t\t\t\t\t\t// Will it cause Recoil?\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\t\t\t\t\t\t\t\t\t\t// Is there any effects the move has?\n\t\t\t),\n\t\t\t\"Karate Chop\"\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Fighting\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t25,\n\t\t\t\t\"pwr\"\t=>\t50,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"yes\",\t\t\t\t\t\t\t\t\t\t// Does it have a higher Critical hit ratio?\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Double Slap\"\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t15,\n\t\t\t\t\"acc\"\t=>\t85,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\" =>\t\"yes\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Comet Punch\"\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t18,\n\t\t\t\t\"acc\"\t=>\t85,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"yes\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Mega Punch\"\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t80,\n\t\t\t\t\"acc\"\t=>\t85,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Pay Day\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// Note: Drops money for the winner. Will add something for that later. \n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t40,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Fire Punch\"\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Fire\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t75,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"burn\"\t=>\t10,\t\t\t\t\t\t\t\t\t\t// 10% chance of burning.\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Ice Punch\"\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Ice\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t75,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"freeze\"\t=>\t10,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Thunder Punch\"\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Electric\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t75,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"paralyze\"\t=>\t10,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Scratch\"\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t35,\n\t\t\t\t\"pwr\"\t=>\t40,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Vice Grip\"\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t55,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Guillotine\"\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t5,\n\t\t\t\t\"pwr\"\t=>\t0,\t\t\t\t\t\t\t\t\t\t\t// This move will kill in one hit if it lands.\n\t\t\t\t\"acc\"\t=>\t$lvl - $olvl + 30,\t\t\t\t\t\t\t// This move depends on the level of the user and opponent for its chance of hitting.\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Razor Wind\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move takes two turns to execute.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t80,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"yes\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Swords Dance\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move affects the user.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Cut\"\t\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t50,\n\t\t\t\t\"acc\"\t=>\t95,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Gust\"\t\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Flying\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\t\t\t\t\t\t\t\t\t// This move will affect users in stage one of Fly.\n\t\t\t\t\"pp\"\t=>\t35,\n\t\t\t\t\"pwr\"\t=>\t40,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Wing Attack\"\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Flying\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t35,\n\t\t\t\t\"pwr\"\t=>\t60,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Whirlwind\"\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\t\t\t\t\t\t\t\t\t// Will end the battle when used against wild pokemon. Otherwise, switch pokemon.\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"pri\"\t=>\t-6,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Fly\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// Takes two turns, one is invulnerable to *most* attacks.\n\t\t\t\t\"type\"\t=>\t\"Flying\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t90,\n\t\t\t\t\"acc\"\t=>\t95,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Bind\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// Trapping move. Goes for 4-5 turns doing 1/16th HP after original damage.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t15,\n\t\t\t\t\"acc\"\t=>\t85,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Slam\"\t\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t80,\n\t\t\t\t\"acc\"\t=>\t75,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Vine Whip\"\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Grass\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t25,\n\t\t\t\t\"pwr\"\t=>\t45,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Stomp\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 30% flinch chance, and will never miss on minimized opponents.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t65,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Double Kick\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// Move always hits twice. (damage calculated independantly).\n\t\t\t\t\"type\"\t=>\t\"Fighting\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t30,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"yes\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Mega Kick\"\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t5,\n\t\t\t\t\"pwr\"\t=>\t120,\n\t\t\t\t\"acc\"\t=>\t75,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Jump Kick\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// Will cause recoil of 1/2 the user's MAX HP if it misses.\n\t\t\t\t\"type\"\t=>\t\"Fighting\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t100,\n\t\t\t\t\"acc\"\t=>\t95,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Rolling Kick\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has 30% Flinch chance.\n\t\t\t\t\"type\"\t=>\t\"Fighting\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t60,\n\t\t\t\t\"acc\"\t=>\t85,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Sand Attack\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// Lowers the accuracy of target. Works on all pokemon.\n\t\t\t\t\"type\"\t=>\t\"Ground\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Headbutt\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 30% flinch chance.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t70,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Horn Attack\"\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t25,\n\t\t\t\t\"pwr\"\t=>\t65,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Fury Attack\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move hits 2-5 times.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t15,\n\t\t\t\t\"acc\"\t=>\t85,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"yes\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Horn Drill\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move will take all current HP of target on connect.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t5,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Tackle\"\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t35,\n\t\t\t\t\"pwr\"\t=>\t50,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Body Slam\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 30% chance of causing paralysis.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t85,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"paralyze\"\t=> 30,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Wrap\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t\t// Trapping move, affects 4-5 turns, doing 1/16 max HP damage.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t15,\n\t\t\t\t\"acc\"\t=>\t90,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Take Down\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move's recoil damage is 1/4th the damage they did.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t90,\n\t\t\t\t\"acc\"\t=>\t85,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"yes\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Thrash\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move goes for 2 - 3 turns, confuses the user upon conclusion.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t120,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Double Edge\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move causes recoil of 1/3rd the damage done.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t120,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"yes\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Tail Whip\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// Reduces target's defense by one level. \n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Poison Sting\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 30% Poison chance.\n\t\t\t\t\"type\"\t=>\t\"Poison\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t35,\n\t\t\t\t\"pwr\"\t=>\t15,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"poison\"\t=> 30,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Twineedle\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move hits twice, with two chances to poison.\n\t\t\t\t\"type\"\t=>\t\"Bug\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t35,\n\t\t\t\t\"pwr\"\t=>\t50,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"yes\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"poison\" => 20,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Pin Missile\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move hits two to five times.\n\t\t\t\t\"type\"\t=>\t\"Bug\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t25,\n\t\t\t\t\"acc\"\t=>\t95,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Leer\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move lowers the target defense by one level.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Bite\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 10% flinch chance.\n\t\t\t\t\"type\"\t=>\t\"Dark\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t25,\n\t\t\t\t\"pwr\"\t=>\t60,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Growl\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move lowers the target attack by one level.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t40,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Roar\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move will make your pokemon (or the wild opponent, run.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"pri\"\t=>\t-6,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Sing\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// If it lands, will always put the target to sleep.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t55,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"sleep\"\t=> 100,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Supersonic\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move causes confusion, if the target isn't already so.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t55,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"confuse\"\t=>\t100,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Sonic Boom\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move always causes 20 HP of damage, bypassing damage calcs, but misses ghost types.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t90,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Disable\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move disables a move that may currently be used. ( has PP left ).\n\t\t\t\t\"type\"\t=>\t\"Normal\",\t\t\t\t\t\t\t\t\t// This move lasts four to seven turns.\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Acid\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 10% chance of lowering target's Special Defense by 1 stage.\n\t\t\t\t\"type\"\t=>\t\"Poison\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t40,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Ember\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 10% chance of burning the target.\n\t\t\t\t\"type\"\t=>\t\"Fire\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t25,\n\t\t\t\t\"pwr\"\t=>\t40,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"burn\"\t=>\t10,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Flamethrower\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 10% chance of burning the target.\n\t\t\t\t\"type\"\t=>\t\"Fire\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t90,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"burn\"\t=>\t10,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Mist\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move prevents stat altering moves from affecting, for five turns.\n\t\t\t\t\"type\"\t=>\t\"Ice\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Water Gun\"\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Water\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t25,\n\t\t\t\t\"pwr\"\t=>\t40,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Hydro Pump\"\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Water\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t5,\n\t\t\t\t\"pwr\"\t=>\t110,\n\t\t\t\t\"acc\"\t=>\t80,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Surf\"\t\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Water\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t90,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Ice Beam\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 10% chance of freezing the target.\n\t\t\t\t\"type\"\t=>\t\"Ice\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t90,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"freeze\"\t=>\t10,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Blizzard\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 10% chance of freezing the target.\n\t\t\t\t\"type\"\t=>\t\"Ice\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t5,\n\t\t\t\t\"pwr\"\t=>\t110,\n\t\t\t\t\"acc\"\t=>\t70,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"freeze\"\t=>\t10,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Psybeam\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 10% chance of confusing the target.\n\t\t\t\t\"type\"\t=>\t\"Psychic\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t65,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"confuse\"\t=>\t10,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Bubble Beam\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 10% chance of dropping target's speed by one level.\n\t\t\t\t\"type\"\t=>\t\"Water\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t65,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Aurora Beam\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 10% chance of dropping target's attack by one level.\n\t\t\t\t\"type\"\t=>\t\"Ice\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t65,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Hyper Beam\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move requires two turns in most situations, with the second being recharge.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t5,\n\t\t\t\t\"pwr\"\t=>\t150,\n\t\t\t\t\"acc\"\t=>\t90,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Peck\"\t\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Flying\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t35,\n\t\t\t\t\"pwr\"\t=>\t35,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Drill Peck\"\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Flying\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t80,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Submission\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move hits the user with 25% of the damage done in recoil.\n\t\t\t\t\"type\"\t=>\t\"Fighting\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t25,\n\t\t\t\t\"pwr\"\t=>\t80,\n\t\t\t\t\"acc\"\t=>\t80,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"yes\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Low Kick\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move's damage varies by the weight of the target (20 - 120).\n\t\t\t\t\"type\"\t=>\t\"Fighting\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t0,\t\t\t\t\t\t\t\t\t\t\t// Weight calculations to be added later.\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Counter\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move returns double the damage of a physical attack done to the user.\n\t\t\t\t\"type\"\t=>\t\"Fighting\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"pri\"\t=>\t-5,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Seismic Toss\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move's power is equal to the level of the user, and receives no STAB.\n\t\t\t\t\"type\"\t=>\t\"Fighting\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Strength\"\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t80,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Absorb\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move returns 50% of the damage dealt in HP to the user.\n\t\t\t\t\"type\"\t=>\t\"Grass\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t25,\n\t\t\t\t\"pwr\"\t=>\t20,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Mega Drain\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move returns 50% of the damage dealt in HP to the user.\n\t\t\t\t\"type\"\t=>\t\"Grass\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t40,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Leech Seed\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move takes 1/8th the HP of the target and gives them to the user's current active pokemon.\n\t\t\t\t\"type\"\t=>\t\"Grass\",\t\t\t\t\t\t\t\t\t// All grass type pokemon are immune to this move.\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t90,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Growth\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move will increase both the attack and sp. attack of the user one stage.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Razor Leaf\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a high critical hit ratio.\n\t\t\t\t\"type\"\t=>\t\"Grass\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t25,\n\t\t\t\t\"pwr\"\t=>\t55,\n\t\t\t\t\"acc\"\t=>\t95,\n\t\t\t\t\"crit\"\t=>\t\"yes\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Solar Beam\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move requires a waiting turn before the attack.\n\t\t\t\t\"type\"\t=>\t\"Grass\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t120,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Poison Powder\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// Grass types are immune to this move.\n\t\t\t\t\"type\"\t=>\t\"Poison\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t35,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t75,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"poison\" => 100,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Stun Spore\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// Grass types are immune to this move.\n\t\t\t\t\"type\"\t=>\t\"Grass\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t75,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"paralyze\" => 100,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Sleep Powder\"\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Grass\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t75,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"sleep\"\t=>\t100,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Petal Dance\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move will go for two to three turns, and confuse the user afterwards.\n\t\t\t\t\"type\"\t=>\t\"Grass\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t120,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Stringshot\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move lowers the speed of the target by two stages.\n\t\t\t\t\"type\"\t=>\t\"Bug\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t40,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t95,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Dragon Rage\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move always does 40HP of damage, regardless of stats.\n\t\t\t\t\"type\"\t=>\t\"Dragon\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Firespin\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move traps the target, lasts for four to five turns taking 1/16th of the target's HP.\n\t\t\t\t\"type\"\t=>\t\"Fire\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t35,\n\t\t\t\t\"acc\"\t=>\t85,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Thunder Shock\"\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Electric\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t40,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"paralyze\"\t=> 10,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Thunderbolt\"\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Electric\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t90,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"paralyze\"\t=> 10,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Thunder Wave\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move will paralyze the target. Electric types are immune.\n\t\t\t\t\"type\"\t=>\t\"Electric\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"paralyze\"\t=> 100,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Thunder\"\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Electric\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t110,\n\t\t\t\t\"acc\"\t=>\t70,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"paralyze\"\t=> 30,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Rock Throw\"\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Rock\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t50,\n\t\t\t\t\"acc\"\t=>\t90,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Earthquake\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move affects users of dig by double.\n\t\t\t\t\"type\"\t=>\t\"Ground\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t100,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Fissure\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move will have a one-hit kill.\n\t\t\t\t\"type\"\t=>\t\"Ground\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t5,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Dig\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move requires two turns to execute.\n\t\t\t\t\"type\"\t=>\t\"Ground\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t80,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Toxic\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move badly poisons the target. It also never misses when a poison-type uses it.\n\t\t\t\t\"type\"\t=>\t\"Poison\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t90,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"poison2\"\t=>\t100,\t\t\t\t\t\t\t\t// Poison2 will be badly poisoned, for the increasing damage algorithm holder.\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Confusion\"\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Psychic\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t25,\n\t\t\t\t\"pwr\"\t=>\t50, \n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"confuse\"\t=>\t10,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Psychic\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 10% chance of lowering Sp. Defense by one level.\n\t\t\t\t\"type\"\t=>\t\"Psychic\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t90,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Hypnosis\"\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Psychic\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t60,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"sleep\"\t=>\t100,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Meditate\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move raises the user's attack by one level.\n\t\t\t\t\"type\"\t=>\t\"Psychic\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t40,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Agility\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move sharply raises the user's speed two levels.\n\t\t\t\t\"type\"\t=>\t\"Psychic\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Quick Attack\"\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t40,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"pri\"\t=>\t1,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Rage\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move gains attack bonus when the user is hit, as long as the move is used.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t20,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Teleport\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move only works on wild pokemon.\n\t\t\t\t\"type\"\t=>\t\"Psychic\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Night Shade\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move will always do equal to the user's level in damage.\n\t\t\t\t\"type\"\t=>\t\"Ghost\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Mimic\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move will copy the last used move by the target, unless the user already knows it.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\t\t\t\t\t\t\t\t\t// The move will revert back to mimic following a switch or battle ending.\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Screech\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move will sharply lower the target's defense two levels.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t40,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t85,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Double Team\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move raises the evasion of the user by one level.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Recover\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move recovers 50% of the user's HP. \n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Harden\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move increases the user's defense by one level.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Minimize\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move raises the user's evasiveness one level. \n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Smokescreen\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move reduces the target's accuracy one level.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Confuse Ray\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move confuses the victim for two to five turns. \n\t\t\t\t\"type\"\t=>\t\"Ghost\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"confuse\"\t=>\t100,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Withdraw\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move raises the user's defense one level. \n\t\t\t\t\"type\"\t=>\t\"Water\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t40,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Defense Curl\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move raises the user's defense one level. \n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t40,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Barrier\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move raises the user's defense two levels. \n\t\t\t\t\"type\"\t=>\t\"Psychic\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Light Screen\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move cuts special move damage in half for five turns. \n\t\t\t\t\"type\"\t=>\t\"Psychic\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Haze\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move removes all stat changes to the pokemon on the field. \n\t\t\t\t\"type\"\t=>\t\"Ice\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Reflect\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move cuts physical move damage in half for five turns. \n\t\t\t\t\"type\"\t=>\t\"Psychic\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Focus Energy\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move increases the user's critical hit ratio two levels. \n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Bide\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move makes the user endure two rounds of damage, then returns double the damage.\t\t\t\t\t \n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"pri\"\t=>\t1,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Metronome\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move will call up any move at random, with all regular effects. \n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Mirror Move\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move will copy the last move the opponent used. \n\t\t\t\t\"type\"\t=>\t\"Flying\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Self-Destruct\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move causes the user to faint. \n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t5,\n\t\t\t\t\"pwr\"\t=>\t200,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"yes\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Egg Bomb\"\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t100,\n\t\t\t\t\"acc\"\t=>\t75,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Lick\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 30% chance of paralyzing targets.\n\t\t\t\t\"type\"\t=>\t\"Ghost\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t20,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"paralyze\"\t=>\t30,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Smog\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 40% chance of poisoning the target.\t\n\t\t\t\t\"type\"\t=>\t\"Poison\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t30,\n\t\t\t\t\"acc\"\t=>\t70,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"poison\"\t=>\t40,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Sludge\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 30% chance of poisoning the target.\t\n\t\t\t\t\"type\"\t=>\t\"Poison\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t65,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"poison\"\t=>\t30,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Bone Club\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 10% flinch chance.\n\t\t\t\t\"type\"\t=>\t\"Ground\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t65,\n\t\t\t\t\"acc\"\t=>\t85,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Fire Blast\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 10% burn chance, down from 30.\n\t\t\t\t\"type\"\t=>\t\"Fire\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t5,\n\t\t\t\t\"pwr\"\t=>\t110,\n\t\t\t\t\"acc\"\t=>\t85,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"burn\"\t=>\t10,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Waterfall\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 20% Flinch chance.\n\t\t\t\t\"type\"\t=>\t\"Water\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t80,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Clamp\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move lasts four to five turns, and is trapping.\n\t\t\t\t\"type\"\t=>\t\"Water\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t35,\n\t\t\t\t\"acc\"\t=>\t85,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Swift\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move never misses.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t60,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Skull Bash\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move requires two turns to complete.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t130,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Spike Cannon\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move lands two to five times.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t20,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"yes\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Constrict\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 10% chance of reducing speed.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t35,\n\t\t\t\t\"pwr\"\t=>\t10,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Amnesia\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move raises the user's Sp. Defense by two levels.\n\t\t\t\t\"type\"\t=>\t\"Psychic\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Kinesis\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move lowers the target's accuracy one level.\n\t\t\t\t\"type\"\t=>\t\"Psychic\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t80,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Soft-Boiled\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move returns 50% HP to the user.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"High Jump Kick\"=>\tarray(\t\t\t\t\t\t\t\t\t// This move will take 50% HP in recoil if it misses.\n\t\t\t\t\"type\"\t=>\t\"Fighting\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t130,\n\t\t\t\t\"acc\"\t=>\t90,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Glare\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move will paralyze the target.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"paralyze\"\t=>\t100,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Soft-Boiled\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move returns 50% HP to the user.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Dream Eater\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move returns 50% damage in HP to the user, target must be sleeping.\n\t\t\t\t\"type\"\t=>\t\"Psychic\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t100,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Poison Gas\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move poisons the target.\n\t\t\t\t\"type\"\t=>\t\"Poison\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t40,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t90,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"paralyze\"\t=>\t100,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Barrage\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move hits the target two to five times.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t15,\n\t\t\t\t\"acc\"\t=>\t85,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Leech Life\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move returns 50% of the damage in HP to the user.\n\t\t\t\t\"type\"\t=>\t\"Bug\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t20,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Lovely Kiss\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move puts the target to sleep.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t75,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"sleep\"\t=>\t100,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Sky Attack\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move takes two turns to execute, and has a 30% flinch opportunity.\n\t\t\t\t\"type\"\t=>\t\"Flying\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t5,\n\t\t\t\t\"pwr\"\t=>\t140,\n\t\t\t\t\"acc\"\t=>\t90,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Transform\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move changes the user into the target pokemon entirely.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Bubble\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 10% chance to lower the speed by one level.\n\t\t\t\t\"type\"\t=>\t\"Water\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t40,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Dizzy Punch\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 20% chance of confusing the target.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t70,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"confuse\"\t=>\t20,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Spore\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move will put the opponent to sleep, sans grass types.\n\t\t\t\t\"type\"\t=>\t\"Grass\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"sleep\"\t=>\t100,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Flash\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move lowers to accuracy of the target by one level.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Psywave\"\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Psychic\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Splash\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move does absolutely nothing.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t40,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Acid Armor\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move raises the user's defense by two levels. \n\t\t\t\t\"type\"\t=>\t\"Poison\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Crabhammer\"\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Water\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t100,\n\t\t\t\t\"acc\"\t=>\t90,\n\t\t\t\t\"crit\"\t=>\t\"yes\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Explosion\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move will cause the user to faint.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t5,\n\t\t\t\t\"pwr\"\t=>\t250,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"yes\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Fury Swipes\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move hits two to five times.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t18,\n\t\t\t\t\"acc\"\t=>\t80,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"yes\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Bonemerang\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move will hit twice.\n\t\t\t\t\"type\"\t=>\t\"Ground\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t50,\n\t\t\t\t\"acc\"\t=>\t90,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"yes\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Rest\"\t\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move causes the user to sleep two turns, wipes all status ailments, and restores HP.\n\t\t\t\t\"type\"\t=>\t\"Psychic\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"sleep\"\t=>\t100,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Rockslide\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 30% flinch chance.\n\t\t\t\t\"type\"\t=>\t\"Rock\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t75,\n\t\t\t\t\"acc\"\t=>\t90,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Hyperfang\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move has a 10% flinch chance. \n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t15,\n\t\t\t\t\"pwr\"\t=>\t80,\n\t\t\t\t\"acc\"\t=>\t90,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Sharpen\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move raises the user's attack by one level.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Conversion\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move changes the user's types into the target's. \n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t30,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Tri Attack\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move may burn, freeze, or paralyze the target. \n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Special\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t80,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\tarray(\n\t\t\t\t\t\"burn\"\t\t=>\t10,\n\t\t\t\t\t\"freeze\"\t=>\t10,\n\t\t\t\t\t\"paralyze\"\t=>\t10,\n\t\t\t\t),\n\t\t\t),\n\t\t\t\"Super Fang\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move takes half the target's HP.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t90,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Slash\"\t\t\t=>\tarray(\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t20,\n\t\t\t\t\"pwr\"\t=>\t70,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"yes\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Substitute\"\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move takes 25% of the user's HP and creates a decoy that absorbs damage.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Status\",\n\t\t\t\t\"pp\"\t=>\t10,\n\t\t\t\t\"pwr\"\t=>\t0,\n\t\t\t\t\"acc\"\t=>\t0,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t\t\"Struggle\"\t\t=>\tarray(\t\t\t\t\t\t\t\t\t// This move will be triggered automatically upon all moves having 0 PP.\n\t\t\t\t\"type\"\t=>\t\"Normal\",\n\t\t\t\t\"cat\"\t=>\t\"Physical\",\n\t\t\t\t\"pp\"\t=>\t0,\n\t\t\t\t\"pwr\"\t=>\t50,\n\t\t\t\t\"acc\"\t=>\t100,\n\t\t\t\t\"crit\"\t=>\t\"no\",\n\t\t\t\t\"multi\"\t=>\t\"no\",\n\t\t\t\t\"recoil\"=>\t\"no\",\n\t\t\t\t\"extra\"\t=>\t\"no\",\n\t\t\t),\n\t\t);\n\t\tforeach( $moves1 as $name => $stats )\n\t\t{\n\t\t\tif( !isset( $stats['pri'] ) )\n\t\t\t{\n\t\t\t\t$stats['pri'] = 0;\n\t\t\t}\n\t\t\t$sname = array(\n\t\t\t\t\"name\"\t=> $name,\n\t\t\t);\n\t\t\t$moves2[strtolower( $name )] = array_merge( $sname, $stats );\n\t\t}\n\t\t$config->df['pokemoves']['gen1'] = $moves2;\n\t\t$config->save_config( \"./config/pokemoves.df\", $config->df['pokemoves'] );\n\t}", "private function move($from, $to)\n\t{\n\t\t$marble = & $this->board[$from[0]][$from[1]];\n\t\t$dest = & $this->board[$to[0]][$to[1]];\n\t\t\n\t\t$jump0 = $from[0];\n\t\t$jump1 = $from[1];\n\t\t\n\t\tif($from[0] < $to[0])\n\t\t{\n\t\t\t$jump0++;\n\t\t}\n\t\telseif($from[0] > $to[0])\n\t\t{\n\t\t\t$jump0--;\n\t\t}\n\t\telseif($from[1] < $to[1])\n\t\t{\n\t\t\t$jump1++;\n\t\t}\n\t\telseif($from[1] > $to[1])\n\t\t{\n\t\t\t$jump1--;\n\t\t}\n\t\t\n\t\t$jump = & $this->board[$jump0][$jump1];\n\t\t\n\t\ttry\n\t\t{\n\t\t\tif($marble->hasMarble && $jump->hasMarble && !$dest->hasMarble)\n\t\t\t{\n\t\t\t\t$marble->hasMarble = false;\n\t\t\t\t$jump->hasMarble = false;\n\t\t\t\t$dest->hasMarble = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif($this->renderPlay)\n\t\t\t{\n\t\t\t\techo $this->renderBoard();\n\t\t\t}\n\t\t\t\n\t\t\t$this->moves[] = array($from, $to);\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\tcatch(Exception $e) // Not a valid move\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function comparePlace($place){\n if($place==$this->place){\n $this->state_place=0;\n }\n elseif($place==0){\n $this->state_place=0;\n }\n elseif($place>$this->place){\n $this->state_place=$place-$this->place;\n }\n }", "public function solved() {\r\n\t\treturn $this->current == $this->expected;\r\n\t}", "protected static function isAllowdMove(array $move){\r\n\t\tif (!empty($move) && self::ALLOWD_MOVE == count($move)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function testMove()\n {\n $this->rlpMapper->save($this->content1, '/products/news/content1-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n // move\n $this->rlpMapper->move('/products/news/content1-news', '/products/asdf/content2-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n $oldNode = $this->session->getNode('/cmf/default/routes/de/products/news/content1-news');\n $newNode = $this->session->getNode('/cmf/default/routes/de/products/asdf/content2-news');\n\n $oldNodeMixins = $oldNode->getMixinNodeTypes();\n $newNodeMixins = $newNode->getMixinNodeTypes();\n\n $this->assertEquals('sulu:path', $newNodeMixins[0]->getName());\n $this->assertEquals('sulu:path', $oldNodeMixins[0]->getName());\n\n $this->assertTrue($oldNode->getPropertyValue('sulu:history'));\n $this->assertEquals($newNode, $oldNode->getPropertyValue('sulu:content'));\n $this->assertEquals($this->content1, $newNode->getPropertyValue('sulu:content'));\n\n // get content from new path\n $result = $this->rlpMapper->loadByResourceLocator('/products/asdf/content2-news', 'default', 'de');\n $this->assertEquals($this->content1->getIdentifier(), $result);\n\n // get content from history should throw an exception\n $this->setExpectedException('Sulu\\Component\\Content\\Exception\\ResourceLocatorMovedException');\n $result = $this->rlpMapper->loadByResourceLocator('/products/news/content1-news', 'default', 'de');\n }", "private function findLMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif($hole && !$hole->hasMarble)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[0][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[0][] = array('up', $i - 2, $j + 1);\n\t\t\t\t\t\t\t$moves[0][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[1][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[1][] = array('right', $i + 1, $j - 2);\n\t\t\t\t\t\t\t$moves[1][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[2][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[2][] = array('left', $i - 1, $j + 2);\n\t\t\t\t\t\t\t$moves[2][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[3][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[3][] = array('right', $i - 1, $j - 2);\n\t\t\t\t\t\t\t$moves[3][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[4] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[4][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[4][] = array('left', $i + 1, $j + 2);\n\t\t\t\t\t\t\t$moves[4][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[5] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[5][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[5][] = array('down', $i + 2, $j + 1);\n\t\t\t\t\t\t\t$moves[5][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[6] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[6][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[6][] = array('down', $i + 2, $j - 1);\n\t\t\t\t\t\t\t$moves[6][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[7] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[7][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[7][] = array('up', $i - 2, $j - 1);\n\t\t\t\t\t\t\t$moves[7][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}", "public function testCannotMoveWhenMove()\r\n {\r\n $this->myTestcar = new Car(new moveCarState());\r\n $this->myTestcar->move();\r\n }", "function cmp($a, $b) {\n $valueA = getCompareValue($a);\n $valueB = getCompareValue($b);\n return $valueA - $valueB;\n }", "public function move($source, $target)\n {\n \n }", "public function consistencyCheck(): bool\n {\n $output_model = $this->output()->first();\n $first_media_model = $this->getFirstInput();\n /* @var $output_media Video */\n $output_media = $first_media_model->getMedia();\n\n $input_list = ProjectInputs::query()->where('project', $this->id)->get();\n\n $brocken_count = 0;\n /* @var $input_model ProjectInputs */\n foreach ($input_list as $input_model) {\n /* @var $media_model MediaFiles */\n $media_model = $input_model->media_file()->first();\n\n if (! $media_model->checkIfSameRatio($output_model)) {\n // when trying to convert we should use input of the same ratio as output model\n $input_model->status = InputStatuses::WRONG_RATIO;\n $input_model->save();\n $brocken_count ++;\n } elseif (count($input_list) > 1 && ! $media_model->checkIfSameRatio($first_media_model, true)) {\n // when trying to concatenate we should use inputs of the same ratio and scale\n /* @TODO should remove this check when automated multitask would be complete */\n $input_model->status = InputStatuses::WRONG_RATIO;\n $input_model->save();\n $brocken_count ++;\n } elseif (count($input_list) > 1 && ! $media_model->checkIfSameCodec($first_media_model)) {\n // when trying to concatenate we should use inputs of the same codecs\n $input_model->status = InputStatuses::WRONG_CODEC;\n $input_model->save();\n $brocken_count ++;\n } else {\n $input_model->status = InputStatuses::READY;\n $input_model->save();\n }\n }\n\n return $brocken_count == 0;\n }", "public function move()\n {\n }", "public function testMoveTwice(): void\n {\n $this->document1->setResourceSegment('/products/news/content1-news');\n $this->phpcrMapper->save($this->document1);\n $this->sessionManager->getSession()->save();\n\n // first move\n $this->document1->setResourceSegment('/products/news/content2-news');\n $this->phpcrMapper->save($this->document1);\n $this->sessionManager->getSession()->save();\n\n // second move\n $this->document1->setResourceSegment('/products/asdf/content2-news');\n $this->phpcrMapper->save($this->document1);\n $this->sessionManager->getSession()->save();\n\n $oldNode = $this->defaultSession->getNode('/cmf/sulu_io/routes/de/products/news/content1-news');\n $newNode = $this->defaultSession->getNode('/cmf/sulu_io/routes/de/products/asdf/content2-news');\n\n $oldNodeMixins = $oldNode->getMixinNodeTypes();\n $newNodeMixins = $newNode->getMixinNodeTypes();\n\n $this->assertEquals('sulu:path', $newNodeMixins[0]->getName());\n // FIXME after change mixin works: $this->assertEquals('sulu:history', $oldNodeMixins[0]->getName());\n\n $this->assertEquals($newNode, $oldNode->getPropertyValue('sulu:content'));\n $this->assertEquals(\n $this->documentInspector->getNode($this->document1),\n $newNode->getPropertyValue('sulu:content')\n );\n\n // get content from new path\n $result = $this->phpcrMapper->loadByResourceLocator('/products/asdf/content2-news', 'sulu_io', 'de');\n $this->assertEquals($this->document1->getUuid(), $result);\n\n // get content from history should throw an exception\n $this->expectException(ResourceLocatorMovedException::class);\n $this->phpcrMapper->loadByResourceLocator('/products/news/content1-news', 'sulu_io', 'de');\n }", "public function setResByMatch($m, $r, $s1, $s2)\r\n {\r\n\r\n // Test if input is valid.\r\n if (!$this->isMatchCreated($m, $r) || // Valid round and match?\r\n $this->bracket[$r][$m]['s1'] == -1 || $this->bracket[$r][$m]['s2'] == -1 || // Are competitors \"ready\"/exist?\r\n !is_int($s1) || !is_int($s2) || $s1 < 0 || $s2 < 0 || $s1 == $s2) { // Valid scores?\r\n return false;\r\n }\r\n\r\n // Insert data.\r\n $this->bracket[$r][$m]['s1'] = $s1;\r\n $this->bracket[$r][$m]['s2'] = $s2;\r\n\r\n // Was the updated match the final? If yes, noting is left to be done. Note though, that round 0, the play-in round, is allowed to have one match only!\r\n if ($r !== 0 && $this->roundsInfo[$r][1] == 2) // Is n = 2 ? where n is the number of players in the round.\r\n return true;\r\n\r\n /* Update the match(es) in the following round(s). */\r\n\r\n list($nm, $nc) = $this->getNextMatch($m);\r\n $nr = $r+1;\r\n\r\n // Was match $m in round $r not already played?\r\n if (!$this->isMatchCreated($nm, $nr) || $this->bracket[$nr][$nm]['s'.$nc] == -1) {\r\n\r\n // Place winner of match in next match in next round.\r\n $this->bracket[$nr][$nm]['c'.$nc] = ($s1 > $s2) ? $this->bracket[$r][$m]['c1'] : $this->bracket[$r][$m]['c2']; // $s1 and $s2 are never equal due to input testing.\r\n $this->bracket[$nr][$nm]['s'.$nc] = 0;\r\n\r\n // If the match does not already exist, then the second competitor is missing. If so, we create an \"undecided\" marker by setting the score = -1.\r\n if (!array_key_exists('c' . ($ncs = ($nc == 1) ? 2 : 1), $this->bracket[$nr][$nm])) { // $ncs = Next match competitor (second).\r\n $this->bracket[$nr][$nm]['c'.$ncs] = null;\r\n $this->bracket[$nr][$nm]['s'.$ncs] = -1;\r\n }\r\n }\r\n else {\r\n\r\n /*\r\n Match $m in round $r had already been played...\r\n Now, if the new match result changes the match winner, we must update all match winners from match $m in round $r and on.\r\n */\r\n for (; $this->isMatchCreated($nm, $nr); $r++, $nr++, $m = $nm, list($nm, $nc) = $this->getNextMatch($m)){\r\n $this->bracket[$nr][$nm]['c'.$nc] = ($this->bracket[$r][$m]['s1'] > $this->bracket[$r][$m]['s2'])\r\n ? $this->bracket[$r][$m]['c1']\r\n : $this->bracket[$r][$m]['c2'];\r\n }\r\n }\r\n\r\n return true;\r\n }", "protected function _render_state_move()\n\t{\n\t\t$this->_ci->load->model('admin/grocery_order_model');\n\n\t\t$item_id = intval($this->_ci->input->get('item', TRUE));\n\t\t$previous_id = intval($this->_ci->input->get('previous', TRUE));\n\n\t\t$data['success'] = TRUE;\n\n\t\t// get order previous item\n\t\tif($previous_id == 0)\n\t\t{\n\t\t\t$item_order = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$previous_item = $this->_ci->grocery_order_model->get_item($this->_table, $this->_primary_key_field, $previous_id);\n\t\t\tif(!empty($previous_item))\n\t\t\t{\n\t\t\t\t$item_order = intval($previous_item[$this->_order_field]) + 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['success'] = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// update items\n\t\tif($data['success'] === TRUE)\n\t\t{\n\t\t\t// update item with new order\n\t\t\t$update_item_success = $this->_ci->grocery_order_model->update_item($this->_table, $this->_primary_key_field, $item_id, array($this->_order_field => $item_order));\n\n\t\t\tif($update_item_success)\n\t\t\t{\n\t\t\t\t// update everything after item order\n\t\t\t\t$this->_ci->grocery_order_model->update_order_items_after($this->_table, $this->_primary_key_field, $item_id, $this->_order_field, $item_order, $this->_where);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['success'] = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// set error\n\t\tif($data['success'] === FALSE)\n\t\t{\n\t\t\t$data['message'] = \"Er is iets fout gegaan bij het verplaatsen van het item. Probeer nogmaals.\";\n\t\t}\n\n\t\t// after move callback\n\t\tif(!is_null($this->_callback_after_move))\n\t\t{\n\t\t\t$this->_callback_after_move['class']->{$this->_callback_after_move['method']}($item_id);\n\t\t}\n\n\t\t$this->_json_response($data);\n\t}", "private function rotate() {\r\n $temp = $this->teams_1[1];\r\n for($i = 1; $i < (count($this->teams_1) - 1); $i++) {\r\n $this->teams_1[$i] = $this->teams_1[$i + 1];\r\n }\r\n $this->teams_1[count($this->teams_1) - 1] = end($this->teams_2);\r\n for($i = (count($this->teams_2) - 1); $i > 0; $i--) {\r\n $this->teams_2[$i] = $this->teams_2[$i - 1];\r\n }\r\n $this->teams_2[0] = $temp;\r\n return true;\r\n }", "function _assignMatchesDo() {\n\t\tdefined('_JEXEC') or die( 'Invalid Token' );\n\n\t\t// Turnierdaten!\n\t\t$tournament = new CLMTournament($this->id, true);\n\t\t// $tournament->data->typ\n\n\t\tif (($tournament->data->tl != clm_core::$access->getJid() AND $clmAccess->access('BE_tournament_edit_round') !== true) OR $clmAccess->access('BE_tournament_edit_round') === false) {\n\t\t\t$this->app->enqueueMessage( JText::_('TOURNAMENT_NO_ACCESS'),'warning' );\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($tournament->data->typ == 2) {\n\t\t\t// Vollturnier nur via Rundenerstellung!\n\t\t\t$this->app->enqueueMessage( CLMText::errortext(JText::_('MATCHES_ASSIGN'), 'IMPOSSIBLE' ),'warning' );\n\t\t\treturn false;\n\t\t\n\t\t} elseif ($tournament->data->typ == 3) { // KO\n\t\t\t// maximal bestätige Runde holen - ist hier MIN(nr)\n\t\t\t$query = 'SELECT MIN(nr) FROM #__clm_turniere_rnd_termine'\n\t\t\t\t. ' WHERE turnier = '.$this->id.' AND tl_ok = 1';\n\t\t\t$this->_db->setQuery( $query );\n\t\t\tif ($tlokMin = $this->_db->loadResult()) {\n\t \t\t\t$roundToDraw = $tlokMin-1;\n\t \t\t} else {\n\t \t\t\t$roundToDraw = $tournament->data->runden;\n\t\t\t}\n\t\t\t// nächste zu vervollständigende Runde ermittelt\n\t\t\tif ($roundToDraw == 0) { // dann gibt es nichts mehr zu tun\n\t\t\t\t$this->app->enqueueMessage( JText::_('NO_ROUND_LEFT'),'warning' );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// Frage: sind in dieser Runde schon Partien angesetzt?\n\t\t\t$query = 'SELECT COUNT(*)'\n\t\t\t\t\t. ' FROM #__clm_turniere_rnd_spl'\n\t\t\t\t\t. ' WHERE turnier = '.$this->id.' AND runde = '.$roundToDraw.' AND ((spieler >= 1 AND gegner >= 1) OR ergebnis = 8)';\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$matchesAssigned = $this->_db->loadResult();\n\t\t\t\n\t\t\tif ($matchesAssigned > 0) { // bereits Matches angelegt\n\t\t\t\t$this->app->enqueueMessage( JText::_('MATCHES_ASSIGNED_ALREADY'),'warning' );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// OKay, jetzt kann angesetzt werden\n\t\t\t// alle Spieler, die 'in' sind holen\n\t\t\t$query = \"SELECT snr \"\n\t\t\t\t\t. \" FROM #__clm_turniere_tlnr\"\n\t\t\t\t\t. \" WHERE turnier = \".$this->id.\" AND koStatus = '1'\";\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$playersIn = $this->_db->loadAssocList('snr');\n\t\t\t\n\t\t\t// wieviele Matches werden benötigt? \n\t\t\t// Spielerzahl - (maximale Matches der Runde / 2)\n\t\t\t// maximale Matches der Runde: 2^Runde\n\t\t\t$neededMatches = (count($playersIn) - pow(2, $roundToDraw)/2);\n\t\t\t\n\t\t\t// TODO: Sicherheitscheck, ob diese Boards wirklich vorhanden!\n\t\t\t\n\t\t\t// jetzt setzen wir an jedes Board eine Zufallspaarung\n\t\t\t\n\t\t\t// Matches zusammenstellen\n\t\t\t$sid = $tournament->data->sid;\n\t\t\tfor ($m=1; $m<=$neededMatches; $m++) {\n\t\t\t\t// Spieler 1\n\t\t\t\t$player1 = array_rand($playersIn);\n\t\t\t\tunset($playersIn[$player1]);\n\t\t\t\t// Spieler 2\n\t\t\t\t$player2 = array_rand($playersIn);\n\t\t\t\tunset($playersIn[$player2]);\n\t\t\t\t// SQL\n\t\t\t\t$query = \"UPDATE #__clm_turniere_rnd_spl\"\n\t\t\t\t\t\t. \" SET tln_nr = \".$player1.\", spieler = \".$player1.\", gegner = \".$player2\n\t\t\t\t\t\t. \" WHERE turnier = \".$this->id.\" AND runde = \".$roundToDraw.\" AND brett = \".$m.\" AND heim = '1'\";\n//\t\t\t\t$this->_db->setQuery($query);\n//\t\t\t\tif (!$this->_db->query()) { \n\t\t\t\tif (!clm_core::$db->query($query)) { \n\t\t\t\t\t$this->app->enqueueMessage( JText::_('MATCH: ').$m.\": \".$this->_db->getErrorMsg(),'error' );\n\t\t\t\t}\n\n\t\t\t\t$query = \"UPDATE #__clm_turniere_rnd_spl\"\n\t\t\t\t\t\t. \" SET tln_nr = \".$player2.\", spieler = \".$player2.\", gegner = \".$player1\n\t\t\t\t\t\t. \" WHERE turnier = \".$this->id.\" AND runde = \".$roundToDraw.\" AND brett = \".$m.\" AND heim = '0'\";\n//\t\t\t\t$this->_db->setQuery($query);\n//\t\t\t\tif (!$this->_db->query()) { \n\t\t\t\tif (!clm_core::$db->query($query)) { \n\t\t\t\t\t$this->app->enqueueMessage( JText::_('MATCH: ').$m.\": \".$this->_db->getErrorMsg(),'error' );\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t$this->app->enqueueMessage( JText::_('ROUND_KO_'.$roundToDraw).\": \".JText::_('TOURNAMENT_MATCHES_ASSIGNED') );\n\t\n\t\t\t// Log\n\t\t\t$clmLog = new CLMLog();\n\t\t\t$clmLog->aktion = JText::_('ROUND_KO_'.$roundToDraw).\": \".JText::_('TOURNAMENT_MATCHES_ASSIGNED');\n\t\t\t$clmLog->params = array('sid' => $tournament->data->sid, 'tid' => $this->id, 'rnd' => $roundToDraw); // TurnierID wird als LigaID gespeichert\n\t\t\t$clmLog->write();\n\t\n\t\n\t\t} elseif ($tournament->data->typ == 1) { // CH\n\t\t\t$this->app->enqueueMessage( CLMText::errortext(JText::_('MATCHES_ASSIGN'), 'NOTIMPLEMENTED' ),'warning' );\n\t\t\treturn false;\n\t\t\n\t\t}\n\t\n\t}", "function timestamps_find_movement($tsA, $tsB, $threshold, &$movement){\n foreach ($tsA as $tsA_i => $tsA_v){\n foreach ($tsB as $tsB_i => $tsB_v){\n if (strtotime($tsB_v) > strtotime($tsA_v)){\n $diff = (strtotime($tsB_v) - strtotime($tsA_v));\n if ($diff < $threshold){\n $movement[] = array($tsA_v, $tsB_v, $diff);\n }\n break;\n }\n }\n } \n}", "function _test_attack($type, $i, $opponent_color, $try_move) {\n/*\nprintf(\"try_move['from']: %s\\n\", $try_move['from']);\nprintf(\"try_move['to']: %s\\n\", $try_move['to']);\nprintf(\"try_move['piece']: %s\\n\", $try_move['piece']);\nprintf(\"this->enpa: %s\\n\", $this->enpa);\n*/\n $p = null;\n if ($try_move) {\n\n if ($i === $try_move['from']) {\n $p = 0;\n } \n elseif ($i === $try_move['to']) {\n // The trial move takes the piece being considered\n $p = $try_move['piece'];\n } \n elseif ( $try_move['piece'] === 'p' \n && intval($this->enpa) === intval($try_move['to'])\n && intval($i) === intval($this->enpa) + 10\n ) {\n $p = 0;\n }\n elseif ( $try_move['piece'] === 'P' \n && intval($this->enpa) === intval($try_move['to'])\n && intval($i) === intval($this->enpa) - 10\n ) {\n $p = 0;\n }\n else {\n $p = $this->pos[$i];\n }\n } \n else {\n $p = $this->pos[$i];\n }\n \n if ($p === null) {\n//print(\"A\\n\");\n return 1;\n }\n\n if ($p && $this->piece_color($p) === $opponent_color && strpos($type, strtolower($p)) !== FALSE) {\n//printf(\"p:%s\\n\", $p);\n//print(\"B\\n\");\n return -1;\n }\n//print(\"C\\n\");\n return $p;\n }", "function cmp($a, $b) {\n\treturn $a['posi'] - $b['posi'];\n}", "function compare_distance($a, $b) {\n return $a['distance'] - $b['distance'];\n }", "abstract protected function _compare($val1, $val2);", "static function add_castling_moves_to_moves_list(\n array $moves,\n ChessPiece $piece,\n ChessBoard $board\n ): array {\n // I tried using strings instead of ChessSquares, but it breaks stuff.\n // Not worth the trouble.\n $castling_rules = array (\n array(\n 'boolean_to_check' => 'white_can_castle_kingside',\n 'color_to_move' => ChessPiece::WHITE,\n 'rook_start_square' => new ChessSquare('h1'),\n 'king_end_square' => new ChessSquare('g1'),\n 'cannot_be_attacked' => array(\n new ChessSquare('e1'),\n new ChessSquare('f1'),\n new ChessSquare('g1')\n ),\n 'cannot_be_occupied' => array(\n new ChessSquare('f1'),\n new ChessSquare('g1')\n )\n ),\n array(\n 'boolean_to_check' => 'white_can_castle_queenside',\n 'color_to_move' => ChessPiece::WHITE,\n 'rook_start_square' => new ChessSquare('a1'),\n 'king_end_square' => new ChessSquare('c1'),\n 'cannot_be_attacked' => array(\n new ChessSquare('e1'),\n new ChessSquare('d1'),\n new ChessSquare('c1')\n ),\n 'cannot_be_occupied' => array(\n new ChessSquare('d1'),\n new ChessSquare('c1'),\n new ChessSquare('b1')\n )\n ),\n array(\n 'boolean_to_check' => 'black_can_castle_kingside',\n 'color_to_move' => ChessPiece::BLACK,\n 'rook_start_square' => new ChessSquare('h8'),\n 'king_end_square' => new ChessSquare('g8'),\n 'cannot_be_attacked' => array(\n new ChessSquare('e8'),\n new ChessSquare('f8'),\n new ChessSquare('g8')\n ),\n 'cannot_be_occupied' => array(\n new ChessSquare('f8'),\n new ChessSquare('g8')\n )\n ),\n array(\n 'boolean_to_check' => 'black_can_castle_queenside',\n 'color_to_move' => ChessPiece::BLACK,\n 'rook_start_square' => new ChessSquare('a8'),\n 'king_end_square' => new ChessSquare('c8'),\n 'cannot_be_attacked' => array(\n new ChessSquare('e8'),\n new ChessSquare('d8'),\n new ChessSquare('c8')\n ),\n 'cannot_be_occupied' => array(\n new ChessSquare('d8'),\n new ChessSquare('c8'),\n new ChessSquare('b8')\n )\n ),\n );\n \n foreach ( $castling_rules as $value ) {\n // only check castling for current color_to_move\n if ( $value['color_to_move'] != $board->color_to_move ) {\n continue;\n }\n \n // make sure the FEN has castling permissions\n $boolean_to_check = $value['boolean_to_check'];\n if ( ! $board->castling[$boolean_to_check] ) {\n continue;\n }\n \n // check all cannot_be_attacked squares\n $enemy_color = self::invert_color($board->color_to_move);\n foreach ( $value['cannot_be_attacked'] as $square_to_check ) {\n if ( self::square_is_attacked($enemy_color, $board, $square_to_check) ) {\n continue 2;\n }\n }\n \n // check all cannot_be_occupied_squares\n foreach ( $value['cannot_be_occupied'] as $square_to_check ) {\n if ( $board->square_is_occupied($square_to_check) ) {\n continue 2;\n }\n }\n \n // Make sure the rook is still there. This case should only occur in damaged FENs. If the rook isn't there, throw an invalid FEN exception (to prevent a clone error later on).\n $rook_start_square = $value['rook_start_square'];\n $rank = $rook_start_square->rank;\n $file = $rook_start_square->file;\n $piece_to_check = $board->board[$rank][$file];\n if ( ! $piece_to_check ) {\n throw new Exception('Invalid FEN - Castling permissions set to TRUE but rook is missing');\n }\n if (\n $piece_to_check->type != ChessPiece::ROOK ||\n $piece_to_check->color != $board->color_to_move\n ) {\n throw new Exception('Invalid FEN - Castling permissions set to TRUE but rook is missing');\n }\n \n // The ChessMove class handles displaying castling notation, taking castling privileges out of the FEN, and moving the rook into the right place on the board. No need to do anything extra here.\n $moves[] = new ChessMove(\n $piece->square,\n $value['king_end_square'],\n $piece->color,\n $piece->type,\n FALSE,\n $board\n );\n }\n \n return $moves;\n }", "function cmp($a,$b) {\r\rif($a > $b){\r $x=put_string($a,\">\",$b,\"\\n\");\r}\rif ($a >= $b ) {\r $x=put_string($a,\">=\",$b,\"\\n\");\r}\rif ($a === $b ) {\r $x=put_string($a,\"===\",$b,\"\\n\");\r}\rif ($b < $a ) {\r $x=put_string($b,\"<\",$a,\"\\n\");\r}\rif ($b <= $a ) {\r $x=put_string($b,\"<=\",$a,\"\\n\");\r}\rif ($b === $a ) {\r $x=put_string($b,\"===\",$a,\"\\n\");\r}\rif ($a > $a ) {\r $x=put_string($a,\">\",$a,\"\\n\");\r}\rif ($a < $a ) {\r $x=put_string($a,\"<\",$a,\"\\n\");\r}\rif ($a !== $a ) {\r $x=put_string($a,\"!==\",$a,\"\\n\");\r}\rif ($b > $b ) {\r $x=put_string($b,\">\",$b,\"\\n\");\r}\rif ($b < $b ) {\r $x=put_string($b,\"<\",$b,\"\\n\");\r}\rif ($b !== $b ) {\r $x=put_string($b,\"!==\",$b,\"\\n\");\r}\r\r}", "public static function compare($a,$b);", "function _casetravel($previousloc_X, $previousloc_Z, $previousaisle_X, $previousaisle_Z, $currentaisle_X, $currentaisle_Z, $FIRSTLOC_X, $FIRSTLOC_Z) {\n\n $outeraisle = abs($previousloc_X - $previousaisle_X) + abs($previousloc_Z - $previousaisle_Z); //previous last location to previous parking spot\n $outeraisle += abs($previousaisle_X - $currentaisle_X) + abs($previousaisle_Z - $currentaisle_Z); //previous parking spot to current parking spot\n $outeraisle += abs($currentaisle_X - $FIRSTLOC_X) + abs($currentaisle_Z - $FIRSTLOC_Z);\n\n return $outeraisle;\n}", "function compete($a,$b){\n $p = intval(100 * getWinProb($a['elo']-$b['elo']));\n $expected = ($a['elo']>=$b['elo']) ? $a['name'] : $b['name'];\n $percent = ($a['elo']>=$b['elo']) ? $p.'%' : (100-$p).'%';\n $n = mt_rand(1,100);\n $winner = ($n<=$p) ? $a['name'] : $b['name'];\n \n //echo sprintf(\"Now Playing: %s (%s) vs. %s (%s) \\n\", $a['name'], $a['elo'], $b['name'], $b['elo']);\n //echo sprintf(\"Expected winner: %s (%s)\\n\", $expected, $percent);\n //echo sprintf(\"Actual winner: %s\\n\\n\", $winner);\n return ($n<=$p) ? $a : $b;\n}", "function do_compare($before = BEFORE,$after = AFTER){\n\tglobal $debug;\n\tglobal $before_path;\n\tglobal $after_path;\n\tglobal $compare_path;\n\tif(!is_dir($compare_path)){\n\t\tmkdir($compare_path);\n\t}\n\techo \"comparing..\\n\";\n\t$urls = get_urls();\n\tforeach ($urls as $url){\n\t\t$url = str_replace(array(\"\\n\", \"\\r\"), '', $url);\n\t\t$bi = $before_path.\"/\".md5($url).\".jpg\";\n\t\t$ai = $after_path.\"/\".md5($url).\".jpg\";\n\t\t$report = $compare_path.\"/\".md5($url).\".txt\";\n\t\t$ci = $compare_path.\"/\".md5($url).\".jpg\";\n\t\timg_compare($bi,$ai,$report,$ci);\n\t}\n\t\n}", "function _mbox_cmp($a, $b) {\n $a = $a['nameX']; // Added to work with intranet office\n $b = $b['nameX']; // Added to work with intranet office\n /* Always return INBOX as \"smaller\". */\n if ($this->_sortinbox) {\n if (strcasecmp($a, 'INBOX') == 0) {\n return -1;\n } \n elseif (strcasecmp($b, 'INBOX') == 0) {\n return 1;\n }\n }\n \n // Hack to place Trash folde right after Inbox\n if (strcasecmp($a, 'Trash') == 0) {\n return -1;\n } \n elseif (strcasecmp($b, 'Trash') == 0) {\n return 1;\n }\n\n $a_parts = explode($this->_delimiter, $a);\n $b_parts = explode($this->_delimiter, $b);\n\n $a_count = count($a_parts);\n $b_count = count($b_parts);\n\n $iMax = min($a_count, $b_count);\n\n for ($i = 0; $i < $iMax; $i++) {\n if ($a_parts[$i] != $b_parts[$i]) {\n /* If only one of the folders is under INBOX, return it as\n * \"smaller\". */\n if ($this->_sortinbox && ($i == 0)) {\n $a_base = (strcasecmp($a_parts[0], 'INBOX') == 0);\n $b_base = (strcasecmp($b_parts[0], 'INBOX') == 0);\n if ($a_base && !$b_base) {\n return -1;\n } \n elseif (!$a_base && $b_base) {\n return 1;\n }\n }\n $cmp = strnatcasecmp($a_parts[$i], $b_parts[$i]);\n if ($cmp == 0) {\n return strcmp($a_parts[$i], $b_parts[$i]);\n }\n return $cmp;\n }\n }\n\n return ($a_count - $b_count);\n }", "public function playMoves()\n\t{\n\t\t$this->resetBoard();\n\t\t$moves = unserialize(serialize($this->moves));\n\t\t$this->resetMoves();\n\t\t\n\t\tforeach($moves as $move)\n\t\t{\n\t\t\t$this->move($move[0], $move[1]);\n\t\t}\n\t}", "public function movedElementsCanNotBeFoundAtTheirOrigin() {}", "function maksim($x, $y, $z){\n if ($x > $y && $x > $z){\n return $x;\n } elseif ($y > $x && $y > $z) {\n return $y;\n } else {\n return $z;\n }\n }", "public function secondMove($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') $playerUnit = 'O';\n if ($playerUnit == 'O') $playerUnit = 'X';\n }\n\n $rightDiagonalSum = 0;\n $leftDiagonalSum = 0;\n\n for ($i = 0; $i <= $this->maxIndex; $i++) {\n $column = array_column($this->board, $i);\n\n $rowSum = 0;\n\n foreach ($this->board[$i] as $item) {\n if ($item == $playerUnit) $rowSum++;\n\n if ($rowSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInRow($this->board, $i);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $columnSum = 0;\n\n foreach ($column as $item) {\n if ($item == $playerUnit) $columnSum++;\n\n if ($columnSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInColumn($this->board, $i);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n if ($this->board[$i][$i] == $playerUnit) $rightDiagonalSum++;\n if ($this->board[$i][$this->maxIndex - $i] == $playerUnit) $leftDiagonalSum++;\n\n if ($rightDiagonalSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->board);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($leftDiagonalSum == 1 && empty($this->nextMove)) {\n $coordinates = $this->findEmptyItemInleftDiagonal($this->board);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n for($j = 0; $j <= $this->maxIndex; $j++){\n if ($block && $this->board[$i][$j] == $playerUnit){\n $coordinates = $this->getFirstEmptyNeighboor($i, $j);\n if (!empty($coordinates)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->secondMove($playerUnit, true);\n }\n return false;\n }", "private function seeIfPossible()\n {\n $correct = true;\n if(Parser::onlyNumbersString($_GET['o'])){\n if($_GET['o'] == User::get_currentCityId()){\n $this->cityTroopsInfo = DataBaseManager::fetchArray(DataBaseManager::query(\"SELECT * FROM {troops_movements} WHERE\n reciver_id = $_GET[o] and movement_type = 0\"));\n }else{\n $this->cityTroopsInfo = DataBaseManager::fetchArray(DataBaseManager::query(\"SELECT * FROM {troops_movements} WHERE\n reciver_city_id = $_GET[o] and owner_city_id = \".User::get_currentCityId().\" and movement_type = 10\"));\n }\n $correct = $correct && (!(Parser::onlyNumbersString($_GET['t']) && $_GET['t'] >= 0 && $_GET['t'] <= 6));\n $i = 1;\n $ttrops = 0;\n while($correct && $i<12){\n if(!(isset($_GET['tr'.$i]) && Parser::onlyNumbersString($_GET['tr'.$i]) && $_GET['tr'.$i] >= 0 && $this->cityTroopsInfo['tr'.$i] >= $_GET['tr'.$i] )){\n $correct = false;\n }else{\n $ttrops += $_GET['tr'.$i];\n }\n $i++;\n }\n $correct = $correct && ($ttrops > 0) && Parser::onlyNumbersString($_GET['d'] && $_GET['d'] > 0);\n if($correct){\n $exsistsd = DataBaseManager::query(\"SELECT owner_user_id FROM {map} WHERE box_id = $_GET[d]\");\n $this->calculateDistance();\n $oil = DataBaseManager::fetchArray(DataBaseManager::query(\"SELECT oil FROM {materials} WHERE city_id = \".User::get_currentCityId()));\n $oil = $oil[0];\n $this->finalOil = $oil - $this->calculateOil();\n $correct = ($this->finalOil >= 0 && DataBaseManager::numRows($exsistsd));\n $reciverUserId = DataBaseManager::fetchArray($exsistsd);\n $this->reciverUserId = $reciverUserId[0];\n }\n }else{\n $correct = false;\n }\n return $correct;\n\n }", "public function runTestEquals(): void\n {\n $result = call_user_func($this->runFn, $this->in);\n $this->assertEquals($this->expected, $result);\n }", "public function test_normal()\n {\n $origin = [\n 'coordinates' => '1,5',\n 'direction' => Compass::EAST,\n ];\n\n $this->postJson('/api/set-coordinates', $origin);\n\n $command = [\n 'command' => Navigation::TEST_COMMAND,\n 'obstacles' => false,\n ];\n\n $response = $this->postJson('api/send-command', $command);\n\n $coordinates = Coordinate::all();\n\n $positions = [\n [1, 5],\n [2, 5],\n [3, 5],\n [3, 4],\n [3, 3],\n [4, 3],\n [5, 3],\n [6, 3],\n [6, 2],\n ];\n\n $error = false;\n foreach ($positions as $position) {\n $this->assertDatabaseHas(Coordinate::class, [Coordinate::X_AXIS=> $position[0] , Coordinate::Y_AXIS => $position[1]]);\n }\n\n $this->assertDatabaseCount(Movement::class, 10);\n\n $last_movement = Movement::orderBy('id', 'desc')->first();\n\n $last_movement_error_check = false;\n if ($last_movement->coordinates->position_x != 6 || $last_movement->coordinates->position_y != 3) {\n $last_movement_error_check = true;\n }\n\n $this->assertFalse($last_movement_error_check);\n\n $data = [\n 'movements' => Movement::orderBy('id', 'desc')->get()->toArray(),\n 'obstacles' => Coordinate::orderBy('id', 'asc')->where('has_obstacle', 1)->get()->toArray(),\n ];\n\n $response->assertJson($data);\n }", "private function findSimpleMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif(\t$hole )\n\t\t\t\t{\n\t\t\t\t\tif($hole->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($this->moveDestinations as $direction)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->canMoveTo($direction, $i, $j))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$moves[] = array(array($direction, $i, $j));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}" ]
[ "0.5544087", "0.54747665", "0.5387154", "0.5273328", "0.52665716", "0.52562845", "0.5227192", "0.5180332", "0.5176289", "0.5160502", "0.51169616", "0.50695074", "0.50054425", "0.49992335", "0.49589285", "0.4948577", "0.49212882", "0.49166873", "0.49122447", "0.4900638", "0.4891615", "0.4849811", "0.48402715", "0.48334366", "0.47854787", "0.47808594", "0.47660127", "0.4756772", "0.4751143", "0.47510833", "0.47306705", "0.47188416", "0.46957678", "0.46908855", "0.46808752", "0.46564677", "0.46549487", "0.46484125", "0.46379364", "0.46128416", "0.45985076", "0.45960093", "0.45889938", "0.45876798", "0.45809662", "0.45782998", "0.45713738", "0.45428103", "0.45335072", "0.45291948", "0.4522661", "0.45139745", "0.45126075", "0.45081913", "0.45043236", "0.44789135", "0.44676116", "0.44549698", "0.4446822", "0.4445312", "0.44361255", "0.44287908", "0.4409685", "0.4407282", "0.44058052", "0.44026846", "0.43897882", "0.43870977", "0.43776724", "0.43741938", "0.43643454", "0.4351536", "0.4346821", "0.43413427", "0.43376213", "0.4334981", "0.43303874", "0.43255237", "0.43244544", "0.4322694", "0.43130872", "0.43078187", "0.43055844", "0.429995", "0.42982295", "0.4291426", "0.4289631", "0.42891505", "0.42840695", "0.42820066", "0.42635953", "0.42565656", "0.42545155", "0.4254102", "0.42519045", "0.42497885", "0.42483374", "0.4242097", "0.42328292", "0.4229795" ]
0.5747808
0
ADD O STYLE O SCRIPT DO SITE
function rt_theme_styles(){ /** priemrio o nome segundo o diretorio */ wp_enqueue_style('bootstrap-css', get_template_directory_uri() . '/vendor/bootstrap/css/bootstrap.min.css?ver=1'); wp_enqueue_style('clean-blog', get_template_directory_uri() . '/css/clean-blog.css?ver=1'); wp_enqueue_style('font-awesome', get_template_directory_uri() . '/vendor/font-awesome/css/font-awesome.min.css'); // FONTES wp_enqueue_style('google-font-lora', 'https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic'); wp_enqueue_style('google-font-open-sans', 'https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800'); // SCRIPTS wp_enqueue_script('theme-jquery', get_template_directory_uri() . '/vendor/jquery/jquery.min.js'); wp_enqueue_script('theme-js', get_template_directory_uri() . '/vendor/jquery/jquery.js', array('jquery'), '', true); wp_enqueue_script('bootstrap-js', get_template_directory_uri() . '/vendor/bootstrap/js/bootstrap.bundle.min.js'); wp_enqueue_script('clean-blog-js', get_template_directory_uri() . '/js/clean-blog.min.js'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "function elegirScript($script){\r\n\techo \"<script type='text/javascript' src='http://www.sindicatoclicks.net/$script'></script>\";\r\n}", "public function add_scripts_and_styles()\n {\n // Estilos css \n wp_register_style( 'wiAjustesStyles', WI_PLUGIN_URL . '/style.css', null, WI_VERSION );\n wp_enqueue_style( 'wiAjustesStyles' );\n\n // Scripts de javascript\n wp_enqueue_script('wiAjustesStylesJs', WI_PLUGIN_URL . '/script.js' , array('jquery'));\n }", "function add_admin_styles(){\n\t?>\t\n\t<script type=\"text/javascript\" src=\"<?php echo BBO_POSTS_URL ?>scripts.js\"></script>\n\t<script type=\"text/javascript\" src=\"<?php echo BBO_POSTS_URL ?>smille-script.js\"></script>\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"<?php echo BBO_POSTS_URL ?>styles.css\" />\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"<?php echo BBO_POSTS_URL ?>simple-styles.css\" />\n\t<?php\n}", "function loadStyleScript() {\n # Sike\n}", "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}", "function painter_head() {\n\t\techo '<script>window.ideaspace_site_path = \"' . url('/') . '\";</script>';\n\n\t\techo '<script src=\"' . url('public/a-painter/vendor/aframe-input-mapping-component.js') . '\"></script>';\n echo '<script src=\"' . url('public/a-painter/build.js') . '\"></script>';\n echo '<script src=\"' . url('public/a-painter/vendor/aframe-teleport-controls.min.js') . '\"></script>';\n echo '<script src=\"' . url('public/a-painter/vendor/aframe-tooltip-component.min.js') . '\"></script>';\n echo '<link rel=\"stylesheet\" href=\"' . url('public/a-painter/css/main.css') . '\">';\n echo '<link rel=\"manifest\" href=\"' . url('public/a-painter/manifest.webmanifest') . '\">';\n}", "function Serialize_description_shop_script_style(){\n if (get_admin_page_title() === 'Modifier la catégorie') {\n\twp_enqueue_style('Serialize_description_shop_style', get_template_directory_uri() . '-child/css/serialize-description-shop.css');\n \twp_enqueue_script( 'Serialize_description_shop_script', get_template_directory_uri(). '-child/js/serialize-description-shop.js', array('jquery', 'wp-color-picker') );\n }\n}", "function pushScript ($script) {\n\t\t$this->_roof[\"cuerpo\"][] = \"<script type=\\\"text/javascript\\\" src=\\\"\".$script.\"\\\"></script>\";\n\t}", "function script()\n {\n }", "function links_insert_head_css($flux) {\r\n\t$links = links_configuration();\r\n\r\n\t//Styles\r\n\tif($links['style'] == 'on'){\r\n\t\t$flux .= '<link rel=\"stylesheet\" href=\"'.find_in_path('css/links.css').'\" type=\"text/css\" media=\"all\" />';\r\n\t}\r\n\t//Ouverture d'une nouvelle fenetre : insertion des init js inline, en amont des CSS (perf issue)\r\n\tif($links['window'] == 'on'){\r\n\t\t$js = 'var js_nouvelle_fenetre=\\''._T('links:js_nouvelle_fenetre').'\\';';\r\n\t\t//Ouverture dune nouvelel fenetre sur les liens externes\r\n\t\tif($links['external'] == 'on'){\r\n\t\t\t// quand un site fait du multidomaine on prend en reference le domaine de la page concernee :\r\n\t\t\t// sur www.example.org : autre.example.org est external\r\n\t\t\t// sur autre.example.org : www.example.org est external\r\n\t\t\t// sur un site mono-domaine ca ne change rien :)\r\n\t\t\t// ca marche parce que le cache change quand le HTTP_HOST change (donc quand le domaine change)\r\n\t\t\t$js .= 'var links_site = \\'' . protocole_implicite(url_de_base()) . '\\';';\r\n\t\t}\r\n\t\t//Ouverture d'une nouvelle fenetre sur les documents (extensions a preciser)\r\n\t\tif(($links['download'] == 'on')&&($links['doc_list'])){\r\n\t\t\t$js .= 'var links_doc = \\''.$links['doc_list'].'\\';';\r\n\t\t}\r\n\t\t$flux = '<script type=\"text/javascript\">'.$js.'</script>' . \"\\n\" . $flux;\r\n\t}\r\n\r\n\treturn $flux;\r\n}", "function cssAndJs() {\r\n\t\t$siteurl = get_bloginfo('wpurl');\r\n\t\t// include css in any case. e.g. for widget\r\n\t\tprint '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.$siteurl.'/wp-content/plugins/uwr1results/uwr1results.css\" />'.\"\\n\";\r\n\t\tif (!defined('IS_UWR1RESULTS_VIEW')) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$siteurlPath = substr($siteurl, strlen('http://'.$_SERVER['HTTP_HOST']));\r\n\t\tif ('/' != $siteurlPath{0}) {\r\n\t\t\t$siteurlPath = '/'.$siteurlPath;\r\n\t\t}\r\n\t\t//print '<script type=\"text/javascript\" src=\"'.$siteurl.'/wp-content/plugins/uwr1results/uwr1results.js.php?siteurl='.urlencode($siteurlPath)./*($https?'ssl=1':'').*/'\"></script>'.\"\\n\";\r\n\t}", "public function register_scripts()\n {\n wp_register_style(\n 'fau-oembed-style',\n plugins_url('assets/css/fau-oembed.css', plugin()->getBasename()),\n [],\n plugin()->getVersion()\n ); \n }", "public function loadScripts() {\n $graphcss = $this->getProperty('graphcss');\n $customcss = $this->getProperty('customcss');\n $loadjquery = $this->getProperty('loadjquery');\n\n $cssUrl = $this->sekug->config['cssUrl'].'web/';\n $jsUrl = $this->sekug->config['jsUrl'].'web/';\n\n if($loadjquery == 1){\n $this->modx->regClientStartupScript($jsUrl.'libs/'.$this->sekug->config['jqueryFile']);\n }\n if($customcss>''){\n $this->modx->regClientCSS($this->modx->getOption('assets_url').$customcss);\n } else {\n $this->modx->regClientCSS($cssUrl.'gallery.structure.css');\n }\n if($graphcss>''){\n $this->modx->regClientCSS($this->modx->getOption('assets_url').$graphcss);\n } else {\n $this->modx->regClientCSS($cssUrl.'directory.graph.css');\n }\n }", "function add_script($name, $file)\n{\n\tglobal $scripts_included;\n\t$scripts_included[$name] = \"<script type='text/javascript' src='\".site_url.$file.\"'></script>\\n\";\n}", "function add_style_script(){\r\n wp_enqueue_style('glv-style', plugins_url(\"GLV-Prospectos/admin/include/css/\").'glv-style.css');\r\n wp_enqueue_style('select2-style', plugins_url(\"GLV-Prospectos/admin/include/css/\").'select2.css');\r\n wp_enqueue_script('select-script', plugins_url(\"GLV-Prospectos/admin/include/js/\").'select2.js');\r\n wp_enqueue_script('glv-script', plugins_url(\"GLV-Prospectos/admin/include/js/\").'function.js');\r\n \r\n }", "function add_ordin_widget_scripts() {\n if( ! apply_filters( 'add_ordin_widget_scripts', true, $this->id_base ) )\n return;\n ?>\n <script>\n jQuery(document).ready(function( $ ) {\n\n });\n </script>\n <?php\n }", "public function script() {\r\n\t\tif ($this->scriptable === true || $this->scriptable === 'true') {\r\n\t\t\t$page = pzk_page();\r\n\t\t\tif ($page) {\r\n\t\t\t\t$page->addJsInst($this->toArray());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function my_own_little_ebay_style_and_magic(){\n\techo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.myOwnLittleEbayShopPluginURLDirect().'/my-own-little-ebay-shop-option-css.css\" />';\n\t//A Bit of magic\n\techo '<script type=\"text/javascript\" src=\"'.myOwnLittleEbayShopPluginURLDirect().'/my-own-little-ebay-shop-option-js.js\" /></script>';\n}", "public static function action__admin_print_scripts() {\n\n\t\t\tif ( 'off' === WPGlobus::Config()->toggle ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filter for using canonical URL field. Return false to disable field handling.\n\t\t\t *\n\t\t\t * Returning string.\n\t\t\t * @since 1.1.41\n\t\t\t *\n\t\t\t * @param value True by default.\n\t\t\t */\t\n\t\t\t$canonical_url = apply_filters( 'wpglobus_plus_wpseo_canonical_url', self::$_wpseo_canonical_input_id );\n\t\t\t\n\t\t\tif ( WPGlobus_WP::is_pagenow( array( 'post.php', 'post-new.php' ) ) ) {\n\n\t\t\t\t$scr_version = '30';\n\t\t\t\tif ( version_compare( WPSEO_VERSION, '3.3.0', '>=' ) ) {\n\t\t\t\t\t$scr_version = '33';\n\t\t\t\t}\n\n\t\t\t\twp_register_script(\n\t\t\t\t\t'wpglobus-plus-yoastseo',\n\t\t\t\t\tWPGlobusPlus_Asset::url_js( 'wpglobus-plus-yoastseo' . $scr_version ),\n\t\t\t\t\tarray( 'jquery', 'wpglobus-admin' ),\n\t\t\t\t\tWPGLOBUS_PLUS_VERSION,\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t\twp_enqueue_script( 'wpglobus-plus-yoastseo' );\n\t\t\t\twp_localize_script(\n\t\t\t\t\t'wpglobus-plus-yoastseo',\n\t\t\t\t\t'WPGlobusPlusYoastSeo',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'wpglobus_plus_version' => WPGLOBUS_PLUS_VERSION,\n\t\t\t\t\t\t'wpseo_version' => WPSEO_VERSION,\n\t\t\t\t\t\t'canonicalUrl'\t\t\t=> $canonical_url\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t}", "public function scripts()\n {\n foreach ($this->controller->scripts as $value)\n echo \"\\t<script src='\" . DOMAIN . $value . \"' ></script>\\n\";\n echo \"</body>\\n</html>\";\n }", "public function addStaticJavascript()\n {\n JHTML::_('behavior.mootools');\n\n $document = JFactory::getDocument();\n $document->addStyleSheet(JURI::root() . \"/media/com_cedtag/css/jquery-ui-base-1.8.20.css\");\n $document->addStyleSheet(JURI::root() . \"/media/com_cedtag/css/tagit-stylish-yellow.css\");\n\n $document->addScript(JURI::root() . \"media/com_cedtag/js/jquery.1.7.2.min.js\");\n $document->addScript(JURI::root() . \"media/com_cedtag/js/jquery-ui.1.8.20.min.js\");\n $document->addScript(JURI::root() . \"media/com_cedtag/js/tagit.js\");\n $document->addScriptDeclaration(\"jQuery.noConflict();\");\n }", "public function script($script) {\n\t\tif (strpos($script, 'http') === false) {\n\t\t\techo \"<script src='http://\".Config::$baseurl.\"js/{$script}'></script>\";\n\t\t} else {\n\t\t\techo \"<script src='{$script}'></script>\";\n\t\t}\n\t}", "public function frontEndStyleScripts(): void\n {\n wp_enqueue_style('users-data-bootstrap', plugin_dir_url(dirname(__FILE__)) . 'assets/css/bootstrap.min.css', [], UsersListing::getVersion());\n wp_enqueue_style('users-data-fontawsome', plugin_dir_url(dirname(__FILE__)) . 'assets/css/font-awesome.min.css', [], UsersListing::getVersion());\n wp_enqueue_style('users-data-styles', plugin_dir_url(dirname(__FILE__)) . 'assets/css/users-data.css', [], UsersListing::getVersion());\n //\n wp_enqueue_script('jquery-min', plugin_dir_url(dirname(__FILE__)) . 'assets/js/jquery.min.js', ['jquery'], UsersListing::getVersion(), false);\n wp_enqueue_script('jquery-popper', plugin_dir_url(dirname(__FILE__)) . 'assets/js/popper.min.js', ['jquery'], UsersListing::getVersion(), false);\n wp_enqueue_script('bootstrap-min', plugin_dir_url(dirname(__FILE__)) . 'assets/js/bootstrap.min.js', ['jquery'], UsersListing::getVersion(), false);\n }", "private function addScripts() {\n global $CFG; \n $script = \"<script type=\\\"text/javascript\\\">\n jQuery(document).ready(function() {\n codeActivity.initEdit(); \n codeActivity.ajaxURL = '\" . $CFG->wwwroot . \"/mod/codeactivity/ajax.php';\n codeActivity.lang = {\n empty_name: '\" . addslashes(get_string('js_empty_name', 'codeactivity')) . \"',\n empty_test_code: '\" . addslashes(get_string('js_empty_test_code', 'codeactivity')).\"',\n error_add: '\" . addslashes(get_string('js_error_add', 'codeactivity')).\"',\n error_delete: '\" . addslashes(get_string('js_error_delete', 'codeactivity')).\"',\n error_forbidden: '\" . addslashes(get_string('js_error_forbidden', 'codeactivity')).\"'\n }\n });\n </script>\";\n \n $this->_form->addElement('html', $script);\n }", "function add_head() {\r\n\t\tglobal $locale;\r\n\t\t$wpca_settings = get_option('wpcareers');\r\n\t\techo \"<link rel=\\\"stylesheet\\\" href=\\\"\" . $this->plugin_url . \"/themes/default/css/default.css\\\" type=\\\"text/css\\\" media=\\\"screen\\\">\";\r\n\t\tif($wpca_settings['edit_style']==null || $wpca_settings['edit_style']=='plain') {\r\n\t\t\t// nothing\r\n\t\t} elseif($wpca_settings['edit_style']=='tinymce') {\r\n\t\t\t// activate these includes if the user chooses tinyMCE on the settings page\r\n\t\t\t$mce_path = get_option('siteurl');\r\n\t\t\t$mce_path .= '/wp-includes/js/tinymce/tiny_mce.js';\r\n\t\t\techo '<script type=\"text/javascript\" src=\"' . $mce_path . '\"></script>';\r\n\t\t}\r\n\t}", "function head_content()\n{\n?>\n <style type=\"text/css\">\nb a\t{text-decoration: none;\n\tcolor: #57f;}\nb a:visited {color: #57f;}\n\n.box\t{font-size: 10pt;}\n </style>\n\n <script type=\"text/javascript\">\n </script>\n<?php\n}", "function optionsproduits_insert_head($flux) {\n\t$flux .= \"<script type='text/javascript' src='\".timestamp(find_in_path('javascript/optionsproduits.js')).\"'></script>\";\n\treturn $flux;\n}", "public function insert_inline_scripts() {\n }", "public function insert_inline_scripts() {\n }", "public function insert_inline_scripts() {\n }", "function scripts() {\n\twp_register_script(\n\t\t'bootstrap',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/lib/bootstrap/dist/js/bootstrap.min.js\",\n\t\tarray( 'jquery' ),\n\t\tVINCENTRAGOSTA_COM_VERSION,\n\t\ttrue\n\t);\n\n\twp_enqueue_script(\n\t\t'vincentragosta_com',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/js/vincentragosta---twenty-seventeen.js\",\n\t\tarray( 'jquery', 'bootstrap' ),\n\t\tVINCENTRAGOSTA_COM_VERSION,\n\t\ttrue\n\t);\n\n\twp_localize_script( 'vincentragosta_com', 'themeUrl', VINCENTRAGOSTA_COM_TEMPLATE_URL );\n}", "function add_scripts_to_front() {\n $media = get_option('smfn_option_3') ? get_option('smfn_option_3') : \"1023\";\n wp_register_style('smfn-dynamic-css', plugin_dir_url(SMFN_FILE).'assets/css/dynamic.css.php?media=' . $media);\n wp_enqueue_style( 'smfn-dynamic-css');\n wp_enqueue_script('smfn-actions', plugin_dir_url(SMFN_FILE) . 'assets/js/smfnfunctions.js', array(), '1.0.0', true);\n }", "function skudo_admin_head_add(){\n\n\tif(isset($_GET['page']) && $_GET['page']==SKUDO_OPTIONS_PAGE){\n\t\t//init the options js functionality\n\t\t$skudo_admin_inline_script = (isset($skudo_admin_inline_script)) ? $skudo_admin_inline_script : \"\";\n\t\t$skudo_admin_inline_script .= '\n\t\t\tjQuery(document).ready(function(){\n\t\t\t\t\"use strict\";\n\t\t\t\tjQuery(\".slider\").each(function(){\n\t\t\t\t\tvar value = parseInt(jQuery(this).siblings(\".slider-input\").val());\n\t\t\t\t\tjQuery(this).empty().slider({\n\t\t\t\t\t\trange: \"min\",\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tmin: 0,\n\t\t\t\t\t\tmax: 100,\n\t\t\t\t\t\tslide: function( event, ui ) {\n\t\t\t\t\t\t\tjQuery( \"#\"+jQuery(this).attr(\"title\") ).val( ui.value + \" px\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tskudoOptions.init({cookie:true});\n\t\t\t});\n\t\t';\n\t\twp_add_inline_script('skudo-admin', $skudo_admin_inline_script, 'after');\n\t}\n\t\n\tif(isset($_GET['page']) && $_GET['page']==SKUDO_STYLE_OPTIONS_PAGE){\n\t\t//init the options js functionality\n\t\t\n\t\t$skudo_admin_inline_script = (isset($skudo_admin_inline_script)) ? $skudo_admin_inline_script : \"\";\n\t\t$skudo_admin_inline_script .= '\n\t\t\tjQuery(document).ready(function(){\n\t\t\t\t\"use strict\";\n\t\t\t\tjQuery(\".slider\").each(function(){\n\t\t\t\t\tvar value = parseInt(jQuery(this).siblings(\".slider-input\").val());\n\t\t\t\t\tjQuery(this).empty().slider({\n\t\t\t\t\t\trange: \"min\",\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tmin: 0,\n\t\t\t\t\t\tmax: 100,\n\t\t\t\t\t\tslide: function( event, ui ) {\n\t\t\t\t\t\t\tif (jQuery(this).hasClass(\"opacity-slider\")){\n\t\t\t\t\t\t\t\tjQuery( \"#\"+jQuery(this).attr(\"title\") ).val( ui.value + \"%\" );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery( \"#\"+jQuery(this).attr(\"title\") ).val( ui.value + \" px\" );\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tskudo_StyleOptionsManager.init({cookie:true});\n\t\t\t});\n\t\t';\n\t\tif (isset($_GET['dgtt'])){\n\t\t\t$skudo_admin_inline_script .= '\n\t\t\t\tjQuery(window).load(function(){\n\t\t\t\t\tjQuery(\"a[href=\\'#tab_navigation-1-'.esc_js(esc_html($_GET['dgtt'])).'\\']\").trigger(\"click\");\n\t\t\t\t});\n\t\t\t';\n\t\t}\n\t\twp_add_inline_script('skudo-admin', $skudo_admin_inline_script, 'after');\n\t}\n}", "function css_js_dinamico () {\n $nombre = 'jonmircha';\n $color = 'greenyellow';\n $bg_color = '#333';\n\n echo \"\n <style>\n html {\n background-color: $bg_color;\n color: $color;\n }\n </style>\n <script>\n alert('Hola $nombre')\n </script>\n \";\n }", "function fresh_text_add_js()\n\t{\n\t\techo '<script>';\n\t\techo require_once 'replacement.php';\n\t\techo '</script>';\n\t}", "public function scripts()\n\t\t{\n\t\t}", "function jehaann_scripts(){\n\n\n wp_register_script('scripts',RutaTema.'/js/scripts.js','','1.0','True');\n wp_enqueue_script('scripts');\n\n\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 chocorocco_options_override_add_scripts() {\n\t\t$screen = function_exists('get_current_screen') ? get_current_screen() : false;\n\t\tif (is_object($screen) && chocorocco_options_allow_override(!empty($screen->post_type) ? $screen->post_type : $screen->id)) {\n\t\t\twp_enqueue_style( 'chocorocco-fontello', chocorocco_get_file_url('css/fontello/fontello-embedded.css') );\n\t\t\twp_enqueue_script('jquery-ui-tabs', false, array('jquery', 'jquery-ui'), null, true);\n\t\t\twp_enqueue_script( 'chocorocco-meta-box', chocorocco_get_file_url('theme-options/theme.override.js'), array('jquery'), null, true );\n\t\t\twp_localize_script( 'chocorocco-meta-box', 'chocorocco_dependencies', chocorocco_get_theme_dependencies() );\n\t\t}\n\t}", "function cookiebar_insert_head($flux){\n //$js_cookiebar = parametre_url(generer_url_public('jquery.cookiebar.js'), 'lang', $lang); \n if (!$lang) $lang = $GLOBALS[\"spip_lang\"];\n $js_cookiebar = produire_fond_statique(\"jquery.cookiebar.js\", array(\"lang\"=>$lang));\n\n $flux .= \n \"<script type='text/javascript' src='$js_cookiebar'></script>\\n\"\n . \"<script type='text/javascript' src='\".find_in_path('js/jquery.cookiebar.call.js').\"'></script>\";\n \n return $flux;\n}", "function inject_js() {\nglobal $wp;\n$current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );\nif($current_url == 'url zeljene stranice stranice'){\n\techo '<script src=\"'. esc_url( plugins_url( __FILE__ ) ).'/imeJSfajlaGdeSeNalazi.js\"></script>';\n \t }\n}", "function goodrds_admin_scripts() {\n\t\t// only on our backend page\n\t\tif (get_current_screen()->base == 'settings_page_goodrds') {\n\t wp_register_style( 'goodrds_css', plugins_url('goodrds-admin.css', __FILE__), false, '0.1' );\n\t wp_enqueue_style( 'goodrds_css' );\n\n\t wp_register_script( 'goodrds_js', plugins_url('goodrds-admin.js', __FILE__), array('jquery'), '0.1', true );\n\t wp_enqueue_script( 'goodrds_js' );\n\t }\n\t}", "function add_js() {\n // È possibile aggiungere un file js presente nella cartella del tema\n wp_register_script('main_js', get_template_directory_uri() . '/js/main.js', array('jquery'), null, true);\n wp_enqueue_script('main_js');\n\n // È possibile aggiungere un url remoto (es. CDN)\n // wp_register_script('select2', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/js/select2.min.js', array('jquery'), null, true);\n // wp_enqueue_script('select2');\n\n // Inoltre è possibile aggiungere un css solo se una determinata condizione è vera\n // In questo esempio aggiungiamo il file home.css solo se ci troviamo sulla pagina di home\n // if(is_home()) {\n // wp_register_script('home_js', get_template_directory_uri() . '/js/home.js', array('jquery'), null, true);\n // wp_enqueue_script('home_js');\n // }\n}", "public function registerScripts()\r\n\t{\r\n\t\twp_register_style('social-shares', plugins_url('assets/social-shares.css', __FILE__));\r\n\t\twp_register_script('social-shares', plugins_url('assets/social-shares.js', __FILE__), array('jquery'), false, true);\r\n\t}", "private function register_scripts_and_styles()\n\t\t\t{\n\n\t\t\t\tif( is_admin() )\n\t\t\t\t{\n\n\t\t \t\t//$this->load_file('friendly_widgets_admin_js', '/themes/'.THEMENAME.'/admin/js/widgets.js', true);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ \n\n\t\t \t\t//$this->load_file('friendly_widgets', '/themes/'.THEMENAME.'/theme_assets/js/widgets.js', true);\n\n\t\t\t\t}\n\n\t\t\t}", "private function register_scripts_and_styles()\n\t\t\t{\n\n\t\t\t\tif( is_admin() )\n\t\t\t\t{\n\n\t\t \t\t//$this->load_file('friendly_widgets_admin_js', '/themes/'.THEMENAME.'/admin/js/widgets.js', true);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ \n\n\t\t \t\t//$this->load_file('friendly_widgets', '/themes/'.THEMENAME.'/theme_assets/js/widgets.js', true);\n\n\t\t\t\t}\n\n\t\t\t}", "static function include_scripts(){\n\t\t//self::include_css();\n\t\tself::include_js();\n\t}", "public function register_styles_scripts(){\n\t\t\tglobal $eventon_rs;\n\t\t\t\n\t\t\tif(is_admin()) return false;\n\t\t\t\n\t\t\t$evOpt = evo_get_options('1');\n\t\t\tif( evo_settings_val('evcal_concat_styles',$this->evoopt1, true))\n\t\t\t\twp_register_style( 'evo_RS_styles',$eventon_rs->assets_path.'RS_styles.css', '', $eventon_rs->version);\n\t\t\t\n\t\t\twp_register_script('evo_RS_script',$eventon_rs->assets_path.'RS_script.js', \n\t\t\t\tarray('jquery','jquery-ui-core'), \n\t\t\t\t$eventon_rs->version, true );\n\n\t\t\twp_localize_script( \n\t\t\t\t'evo_RS_script', \n\t\t\t\t'evors_ajax_script', \n\t\t\t\tarray( \n\t\t\t\t\t'ajaxurl' => admin_url( 'admin-ajax.php' ) , \n\t\t\t\t\t'postnonce' => wp_create_nonce( 'evors_nonce' )\n\t\t\t\t)\n\t\t\t);\n\t\t}", "public static function inclureJS() {\r\n \r\n foreach (Page::getInstance()->script as $link) {\r\n \r\n ?>\r\n <script type=\"text/javascript\" src=\"<?php echo $link; ?>\" ></script>\r\n <?php\r\n \r\n }\r\n }", "public function frontendScripts() {\r\n global $Tema;\r\n \r\n // Adiciona os scripts\r\n wp_enqueue_script('startr-slider-js', $Tema->URL('modules/slider/assets/idangerous.swiper.min.js'));\r\n \r\n // Adicionamos o CSS também\r\n wp_enqueue_style('startr-slider-css', $Tema->URL('modules/slider/assets/idangerous.swiper.css'));\r\n }", "function nameless_sheep_scripts() {\n\t\t// Get the theme data.\n\t\t$the_theme = wp_get_theme();\n\t\t$theme_version = $the_theme->get( 'Version' );\n\n\t\t$css_version = $theme_version . '.' . filemtime( get_template_directory() . '/css/theme.min.css' );\n\t\twp_enqueue_style( 'nameless_sheep-styles', get_template_directory_uri() . '/css/theme.min.css', array(), $css_version );\n\n\t\twp_enqueue_script( 'jquery' );\n\t}", "function addHeaderCode() {\r\n echo '<link type=\"text/css\" rel=\"stylesheet\" href=\"' . plugins_url('css/bn-auto-join-group.css', __FILE__).'\" />' . \"\\n\";\r\n}", "public function css() {\r\n\t\tif ($this->cssLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.BASE_REQUEST.'/default/skin/'.pzk_app()->name.'/css/'.$this->cssLink.'.css\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page())\r\n\t\t\t\t\t$page->addObjCss($this->cssLink);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tif ($this->cssExternalLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.$this->cssExternalLink.'\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page()) {\r\n\t\t\t\t\t$page->addExternalCss($this->cssExternalLink);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "function links_insert_head($flux) {\r\n\t$links = links_configuration();\r\n\r\n\t//Ouverture d'une nouvelle fenetre\r\n\tif($links['window'] == 'on'){\r\n\t\t$flux .= '<script src=\"'.find_in_path('links.js').'\" type=\"text/javascript\"></script>'. \"\\n\";\r\n\t}\r\n\treturn $flux;\r\n}", "public function add_script($data){\n\t\tif(filter_var($data, FILTER_VALIDATE_URL)){\n\t\t\t$this->add_content_var(new elem(\"script\",\"\",array(\"src\"=>$data,\"type\"=>\"text/javascript\")));\n\t\t}\n\t\telse{\n\t\t\t$this->add_content_var(new elem(\"script\",$data,array(\"type\"=>\"text/javascript\")));\n\t\t}\n\t}", "function of_admin_head() {\n\t\tdo_action( 'lcarsframework_custom_scripts' );\n\t}", "function sem_usaepay_js_header()\r\n{\r\n\twp_print_scripts( array('sack') );\r\n\t?>\r\n\t<script type='text/javascript'>\r\n\r\n\t</script>\r\n\t<?php\r\n}", "function cjpopups_frontend_scripts(){\n\t$wp_version = get_bloginfo('version');\n\t$item_version = cjpopups_item_info('item_version');\n\tif(!is_admin()){\n\t\twp_register_style( 'cj-frontend-css', cjpopups_item_path('framework_url').'/assets/frontend/css/cj-global.css', null, $item_version, 'screen' );\n\t\twp_enqueue_style( 'cj-frontend-css' );\n\t}\n}", "function cpt_webtonio_head(){\t\n\techo \"<link type='text/css' rel='stylesheet' href='\" . get_bloginfo(\"template_url\") . \"/css/cpt-admin.css\".\"' />\";\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 front_scripts() {\n FWP()->display->assets['future-past-front.js'] = plugins_url( '', __FILE__ ) . '/assets/js/front.js';\n }", "public function add_scripts() {\n\t\twp_enqueue_script(\n\t\t\t'heweb17',\n\t\t\tplugins_url( '/js/heweb17.js', __FILE__ ),\n\t\t\tarray( 'jquery' ) );\t}", "function sobrapaev() {\n\t if (!is_admin()) {\n\t wp_enqueue_script('sobrapaev', WP_PLUGIN_URL . '/sobrapaev/' . 'sobrapaev.js', false, '1.41');\n\t }\n\t}", "function head(){\n\t?><head>\n\t<meta charset=\"UTF-8\">\n\t<title>EEMS</title>\n\t<link rel=\"stylesheet\" href=\"css/style_web.css\" type=\"text/css\">\n\t</head><?php\n}", "function script()\n {\n return '<script type=\"text/javascript\" src=\"' . $this->URL . '\"></script>';\n }", "function as_on_add_scripts() {\n // enqueue backbonejs, underscore\n add_existed_script('backbone');\n add_existed_script('underscore');\n if (as_option('as_option_smooth_scroll', '1')) {\n // Smoothscroll JS\n add_script('smoothscroll', TEMPLATEURL . '/js/smoothscroll.js', array(\n 'jquery'));\n }\n // Modernize JS\n add_script('modernizr', TEMPLATEURL . '/js/libs/modernizr.custom.js', array(\n 'jquery'));\n if (as_option('as_option_retina_img', '1')) {\n add_script('retina', TEMPLATEURL . '/js/libs/retina.min.js', array(\n 'jquery'));\n }\n add_script('front', TEMPLATEURL . '/js/front.js', array(\n 'jquery',\n 'backbone',\n 'underscore'));\n add_script('js-appear', TEMPLATEURL . '/js/libs/main.js', array(\n 'jquery',\n 'jquery'));\n //add js easing when plugin not active\n if (!(function_exists('dslc_register_modules'))) {\n //add js easing\n add_script('js-easing', TEMPLATEURL . '/js/libs/jquery.easing.js', array(\n 'jquery',\n 'jquery'));\n }\n wp_localize_script('front', 'as_globals', array(\n 'ajaxURL' => admin_url('admin-ajax.php'),\n 'imgURL' => get_template_directory_uri() . '/img/'\n ));\n // Custom\n add_script('main', TEMPLATEURL . '/js/main.js', array(\n 'jquery'));\n // add style demo\n if (file_exists(TEMPLATE_DIR . '/demo/js/custom_panel.js')) {\n add_script('custom_panel', TEMPLATEURL . '/demo/js/custom_panel.js', array(\n 'jquery'));\n }\n}", "function skudo_scripts(){\n\t\n\t\tif (!is_admin()){\n\t\t\tglobal $vc_addons_url, $wp_query, $post;\n\t\t\t\n\t\t\tif ( is_singular() ) wp_enqueue_script( 'comment-reply' );\n\t\t\t\n\t \t wp_enqueue_script( 'skudo-upper-modernizr', SKUDO_JS_PATH .'utils/upper-modernizr.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-waypoint', SKUDO_JS_PATH .'utils/upper-waypoint.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-stellar', SKUDO_JS_PATH .'utils/upper-stellar.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-flex', SKUDO_JS_PATH .'utils/upper-flex.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-iso', SKUDO_JS_PATH .'utils/upper-iso.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-qloader', SKUDO_JS_PATH .'utils/upper-qloader.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-tweet', SKUDO_JS_PATH .'utils/upper-tweet.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-bootstrap', SKUDO_JS_PATH .'utils/upper-bootstrap.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-dlmenu', SKUDO_JS_PATH .'utils/upper-dlmenu.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-greyscale', SKUDO_JS_PATH .'utils/upper-greyscale.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-simpleselect', SKUDO_JS_PATH .'utils/upper-simpleselect.js', array('jquery'),'1.0',$in_footer = true);\n\t \t wp_enqueue_script( 'jquery-effects-core', array('jquery') );\n\t \t wp_register_script( 'skudo-global', SKUDO_JS_PATH .'global.js', array('jquery'), '1',$in_footer = true);\n\t\t\t\n\t\t\tif (is_archive() || is_single() || is_search() || is_page_template('blog-template.php') || is_page_template('blog-masonry-template.php') || is_page_template('blog-masonry-grid-template.php') || is_front_page()) {\n\n\t\t\t\t$nposts = get_option('posts_per_page'); $skudo_more = 0; $skudo_pag = 0; $max = 0; $orderby=\"\"; $category=\"\"; $nposts = \"\"; $order = \"\";\n\t\t\t\t$skudo_pag = $wp_query->query_vars['paged'];\n\t\t\t\tif (!is_numeric($skudo_pag)) $skudo_pag = 1;\n\t\t\t\t\n\t\t\t\t$skudo_reading_option = get_option('skudo_blog_reading_type');\n\n\t\t\t\tswitch ($skudo_reading_option){\n\t\t\t\t\tcase \"scrollauto\": \n\t\t\t\t\t\t\t// Add code to index pages.\n\t\t\t\t\t\t\tif( !is_singular() ) {\t\n\t\t\t\t\t\t\t\tif (is_search()){\n\t\t\t\t\t\t\t\t\t$se = get_option(\"skudo_enable_search_everything\");\n\t\t\t\t\t\t\t\t\t$nposts = get_option('posts_per_page');\n\t\t\t\t\t\t\t\t\t$skudo_pag = $wp_query->query_vars['paged'];\n\t\t\t\t\t\t\t\t\tif (!is_numeric($skudo_pag)) $skudo_pag = 1;\n\n\t\t\t\t\t\t\t\t\tif ($se == \"on\"){\n\t\t\t\t\t\t\t\t\t\t$args = array( 'showposts' => get_option('posts_per_page'), 'post_status' => 'publish', 'paged' => $skudo_pag, 's' => esc_html($_GET['s']));\n\t\t\t\t\t\t\t\t\t $skudo_the_query = new WP_Query( $args );\n\t\t\t\t\t\t\t\t\t $args2 = array( 'showposts' => -1, 'post_status' => 'publish', 'paged' => $skudo_pag, 's' => esc_html($_GET['s']) );\n\t\t\t\t\t\t\t\t\t\t$counter = new WP_Query($args2);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$args = array('showposts' => get_option('posts_per_page'),'post_status' => 'publish','paged' => $skudo_pag,'post_type' => 'post','s' => esc_html($_GET['s']));\n\t\t\t\t\t\t\t\t\t $skudo_the_query = new WP_Query( $args );\n\t\t\t\t\t\t\t\t\t $args2 = array('showposts' => -1,'post_status' => 'publish','paged' => $skudo_pag,'post_type' => 'post','s' => esc_html($_GET['s']));\n\t\t\t\t\t\t\t\t\t\t$counter = new WP_Query($args2);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$max = ceil($counter->post_count / $nposts);\n\t\t\t\t\t\t\t\t\t$skudo_paged = ( get_query_var('paged') > 1 ) ? get_query_var('paged') : 1;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$max = $wp_query->max_num_pages;\n\t\t\t\t\t\t\t\t\t$skudo_paged = ( get_query_var('paged') > 1 ) ? get_query_var('paged') : 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$skudo_inline_script = '\n\t\t\t\t\t\t\t\t\tjQuery(document).ready(function($){\n\t\t\t\t\t\t\t\t\t\t\"use strict\";\n\t\t\t\t\t\t\t\t\t\tif (window.skudoOptions.reading_option === \"scrollauto\" && !jQuery(\"body\").hasClass(\"single\") && typeof skudo_monitorScrollTop == \"function\"){ \n\t\t\t\t\t\t\t\t\t\t\twindow.skudo_loadingPoint = 0;\n\t\t\t\t\t\t\t\t\t\t\t//monitor page scroll to fire up more posts loader\n\t\t\t\t\t\t\t\t\t\t\twindow.clearInterval(window.skudo_interval);\n\t\t\t\t\t\t\t\t\t\t\twindow.skudo_interval = setInterval(\"skudo_monitorScrollTop()\", 1000 );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t';\n\t\t\t\t\t\t\t\twp_add_inline_script('skudo-global', $skudo_inline_script, 'after');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t $args = array('showposts' => $nposts,'orderby' => $orderby,'order' => $order,'cat' => $category,'paged' => $skudo_pag,'post_status' => 'publish');\n\t\t\t\t \t\t $skudo_the_query = new WP_Query( $args );\n\t\t\t\t\t \t\t$max = $skudo_the_query->max_num_pages;\n\t\t\t\t\t \t\t$skudo_paged = ( get_query_var('paged') > 1 ) ? get_query_var('paged') : 1;\n\t\t\t\t\t \t\t$skudo_inline_script = '\n\t\t\t\t\t\t\t\t\tjQuery(document).ready(function($){\n\t\t\t\t\t\t\t\t\t\t\"use strict\";\n\t\t\t\t\t\t\t\t\t\tif (window.skudoOptions.reading_option === \"scrollauto\" && !jQuery(\"body\").hasClass(\"single\") && typeof skudo_monitorScrollTop == \"function\"){ \n\t\t\t\t\t\t\t\t\t\t\twindow.skudo_loadingPoint = 0;\n\t\t\t\t\t\t\t\t\t\t\t//monitor page scroll to fire up more posts loader\n\t\t\t\t\t\t\t\t\t\t\twindow.clearInterval(window.skudo_interval);\n\t\t\t\t\t\t\t\t\t\t\twindow.skudo_interval = setInterval(\"skudo_monitorScrollTop()\", 1000 );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t';\n\t\t\t\t\t\t\t\twp_add_inline_script('skudo-global', $skudo_inline_script, 'after');\n\n\t\t\t\t \t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"scroll\": \n\t\t\t\t\t\t\tif( !is_singular() ) {\t\n\t\t\t\t\t\t\t\tif (is_search()){\n\t\t\t\t\t\t\t\t\t$nposts = get_option('posts_per_page');\n\t\t\t\t\t\t\t\t\t$se = get_option(\"skudo_enable_search_everything\");\n\t\t\t\t\t\t\t\t\tif ($se == \"on\"){\n\t\t\t\t\t\t\t\t\t\t$args = array('showposts' => get_option('posts_per_page'),'post_status' => 'publish','paged' => $skudo_pag,'s' => esc_html($_GET['s']));\n\t\t\t\t\t\t\t\t\t $skudo_the_query = new WP_Query( $args );\n\t\t\t\t\t\t\t\t\t $args2 = array('showposts' => -1,'post_status' => 'publish','paged' => $skudo_pag,'s' => esc_html($_GET['s']));\n\t\t\t\t\t\t\t\t\t\t$counter = new WP_Query($args2);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$args = array('showposts' => get_option('posts_per_page'),'post_status' => 'publish','paged' => $skudo_pag,'post_type' => 'post','s' => esc_html($_GET['s']));\n\t\t\t\t\t\t\t\t\t $skudo_the_query = new WP_Query( $args );\n\t\t\t\t\t\t\t\t\t $args2 = array('showposts' => -1,'post_status' => 'publish','paged' => $skudo_pag,'post_type' => 'post','s' => esc_html($_GET['s']));\n\t\t\t\t\t\t\t\t\t\t$counter = new WP_Query($args2);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$max = ceil($counter->post_count / $nposts);\n\t\t\t\t\t\t\t\t\t$skudo_pag = 1;\n\t\t\t\t\t\t\t\t\t$skudo_pag = $wp_query->query_vars['paged'];\n\t\t\t\t\t\t\t\t\tif (!is_numeric($skudo_pag)) $skudo_pag = 1;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$max = $wp_query->max_num_pages;\n\t\t\t\t\t\t\t\t\t$skudo_paged = $skudo_pag;\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$orderby = \"\"; $category = \"\";\n\t\t\t\t\t\t\t $args = array('showposts' => $nposts,'orderby' => $orderby,'order' => $order,'cat' => $category,'post_status' => 'publish');\n\t\t\t\t \t\t $skudo_the_query = new WP_Query( $args );\n\t\t\t\t\t \t\t$max = $skudo_the_query->max_num_pages;\n\t\t\t\t\t \t\t$skudo_pag = 1;\n\t\t\t\t\t\t\t\t$skudo_pag = $wp_query->query_vars['paged'];\n\t\t\t\t\t\t\t\tif (!is_numeric($skudo_pag)) $skudo_pag = 1;\n\t\t\t\t \t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} \n\t\t\t\n\t\t\t/* pass needed options values to JS */\n\t\t\t$skudoOptions = array(\n\t\t\t\t\"templatepath\" => esc_url(get_template_directory_uri()).\"/\",\n\t\t\t\t\"homePATH\" => ABSPATH,\n\t\t\t\t\"styleColor\" => \"#\".esc_html(get_option(\"skudo_style_color\")),\n\t\t\t\t\"skudo_no_more_posts_text\" => function_exists('icl_t') ? sprintf(esc_html__(\"%s\", \"skudo\"), icl_t( 'skudo', 'No more posts to load.', get_option('skudo_no_more_posts_text'))) : sprintf(esc_html__(\"%s\", \"skudo\"), get_option('skudo_no_more_posts_text')),\n\t\t\t\t\"skudo_load_more_posts_text\" => function_exists('icl_t') ? sprintf(esc_html__(\"%s\", \"skudo\"), icl_t( 'skudo', 'Load More Posts', get_option('skudo_load_more_posts_text'))) : sprintf(esc_html__(\"%s\", \"skudo\"), get_option('skudo_load_more_posts_text')),\n\t\t\t\t\"skudo_loading_posts_text\" => function_exists('icl_t') ? sprintf(esc_html__(\"%s\", \"skudo\"), icl_t( 'skudo', 'Loading posts.', get_option('skudo_loading_posts_text'))) : sprintf(esc_html__(\"%s\", \"skudo\"), get_option('skudo_loading_posts_text')),\n\t\t\t\t\"searcheverything\" => get_option(\"skudo_enable_search_everything\"),\n\t\t\t\t\"skudo_header_shrink\" => get_option('skudo_fixed_menu') == 'on' && get_option('skudo_header_after_scroll') == 'on' && get_option('skudo_header_shrink_effect') == 'on' ? 'yes' : 'no',\n\t\t\t\t\"skudo_header_after_scroll\" => get_option('skudo_fixed_menu') == 'on' && get_option('skudo_header_after_scroll') == 'on' ? 'yes' : 'no',\n\t\t\t\t\"skudo__portfolio_grayscale_effect\" => get_option(\"skudo_enable_portfolio_grayscale\"),\n\t\t\t\t\"skudo__instagram_grayscale_effect\" => get_option(\"skudo_enable_instagram_grayscale\"),\n\t\t\t\t\"skudo_enable_ajax_search\" => get_option(\"skudo_enable_ajax_search\"),\n\t\t\t\t\"skudo_newsletter_input_text\" => function_exists('icl_t') ? esc_html(icl_t( 'skudo', 'Enter your email here', get_option('skudo_newsletter_input_text'))) : esc_html(get_option('skudo_newsletter_input_text')),\n\t\t\t\t\"skudo_update_section_titles\" => get_option('skudo_update_section_titles'),\n\t\t\t\t\"skudo_wpml_current_lang\" => function_exists('icl_t') ? ICL_LANGUAGE_CODE : \"\",\n\t\t\t\t\"reading_option\" => isset($skudo_reading_option) ? $skudo_reading_option : \"paged\",\n\t\t\t\t\"loader_startPage\" => isset($skudo_pag) ? $skudo_pag : 0,\n\t\t\t\t\"loader_maxPages\" => isset($max) ? $max : 0,\n\t\t\t\t\"skudo_grayscale_effect\" => get_option(\"skudo_enable_grayscale\")\n\t\t\t);\n\t\t\t\n\t\t\twp_localize_script( 'skudo-global', 'skudoOptions', $skudoOptions );\n\t\t\twp_enqueue_script( 'skudo-global' );\n\t\t\tadd_action( 'wp_footer', 'skudo_set_import_fonts' );\n\t\t\t\n\t \t wp_enqueue_script( 'skudo-jquery-twitter', SKUDO_JS_PATH .'twitter/jquery.tweet.js', array(),'1.0',$in_footer = true);\n\t \t \n\t \t\twp_enqueue_script('cubeportfolio-jquery-js',$in_footer = false);\n\t\t\twp_enqueue_style('cubeportfolio-jquery-css',$in_footer = false);\n\t\t\t\n\t\t\tif (class_exists('Ultimate_VC_Addons')) {\n\t\t\t\twp_enqueue_script('ultimate', plugins_url().'/Ultimate_VC_Addons/assets/min-js/ultimate.min.js', array('jquery'),'3.19.4');\n\t\t\t\twp_enqueue_style('ultimate-style-min', plugins_url().'/Ultimate_VC_Addons/assets/min-css/ultimate.min.css', '3.19.4');\n\t\t\t}\n\n\t\t\tif (is_single()){\n\t\t\t\twp_enqueue_style( 'prettyphoto'); wp_enqueue_script( 'prettyphoto'); \n\t\t\t}\n\t\t\tif (isset($post->ID)) $template = get_post_meta( $post->ID, '_wp_page_template' ,true );\n\t\t\t\t\t\t\n\t\t\tif (isset($template) && ( $template == 'template-blank.php' || $template == 'template-under-construction.php' || $template == 'template-home.php' ) || is_404()){\n\t\t\t\tif (class_exists('Ultimate_VC_Addons')) {\n\t\t\t\t\twp_enqueue_script('ultimate', plugins_url().'/Ultimate_VC_Addons/assets/min-js/ultimate.min.js', array('jquery'),'3.19.4');\n\t\t\t\t\twp_enqueue_style('ultimate-style-min', plugins_url().'/Ultimate_VC_Addons/assets/min-css/ultimate.min.css','3.19.4');\n\t\t\t\t\twp_enqueue_script('ultimate-script');\n\t\t\t\t\twp_enqueue_script('ultimate-vc-params');\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (isset($template) && ($template == 'one-page-template.php' || $template == 'template-home.php')){\n\t\t\t\twp_enqueue_script('googleapis');\n\t\t\t}\n\t\t\t\n\t\t\tif ((isset($template) && ($template == 'blog-masonry-template.php' || $template == 'blog-template.php')) || is_archive() || is_front_page()){\n\t\t\t\twp_enqueue_script( 'skudo-blog', SKUDO_JS_PATH .'blog.js', array('jquery'), '1',$in_footer = true);\n\t\t\t}\n\t\t\t\n\t\t\twp_dequeue_style( 'wp-mediaelement' );\n\t\t\twp_dequeue_script( 'wp-mediaelement' ); \n\t\t\t\n\t\t}\n\t}", "function add_myscript(){\n}", "function addUtilityScripts() {\n global $wgOut;\n $wgOut->addScript(\"<script type=\\\"text/javascript\\\">/*<![CDATA[*/function fixUrlForSparqlExtension(url) { return url.replace(/\\&amp;/g,'&'); } /*]]>*/</script>\\n\");\n $wgOut->addScript(\"<script type=\\\"text/javascript\\\" src=\\\"http://www.google.com/jsapi\\\"></script>\\n\");\n}", "function apsa_load_style_script_admin($admin_page) {\n\n global $apsa_admin_labels;\n if (strpos($admin_page, \"apsa-\") !== FALSE) {\n // set view count in plugin pages\n $apsa_extra_options = get_option('apsa_extra_options');\n if ($apsa_extra_options !== FALSE) {\n if (isset($apsa_extra_options['apsa_view_count']) && intval($apsa_extra_options['apsa_view_count']) > 30) {\n ?>\n <script type=\"text/javascript\">\n apsa_new = false;\n </script>\n <?php\n } else {\n // set anticache notice in plugin pages\n $active_plugins = get_option('active_plugins');\n $has_cache_plugin = apsa_cache_installed();\n\n if (isset($apsa_extra_options['apsa_cache_enabled']) && $apsa_extra_options['apsa_cache_enabled'] != 'true' && empty($_COOKIE['apsa_anticache_notice']) && $has_cache_plugin) {\n\n function apsa_notice() {\n global $apsa_admin_labels;\n ?>\n <div class=\"update-nag notice apsa-anticache-notice\">\n <p><?php echo str_replace('%gen_settings%', '<a class=\"apsa-href-general\" href=\"' . menu_page_url('apsa-manage-general-settings', false) . '\">' . $apsa_admin_labels[\"general_settings\"] . '</a>', $apsa_admin_labels[\"anticache_notice\"]); ?></p>\n <span class=\"apsa-dismissible\"></span>\n </div>\n <?php\n }\n\n add_action('admin_notices', 'apsa_notice');\n }\n\n $apsa_extra_options['apsa_view_count'] = isset($apsa_extra_options['apsa_view_count']) ? intval($apsa_extra_options['apsa_view_count']) + 1 : 0;\n update_option('apsa_extra_options', $apsa_extra_options);\n }\n }\n\n // adding styles to all pages\n wp_register_style('apsa-general-styles', plugin_dir_url(__FILE__) . 'view/admin/apsa-general-styles.css');\n wp_enqueue_style('apsa-general-styles');\n\n // adding general scripts to all pages\n wp_register_script('apsa-general-scripts', plugin_dir_url(__FILE__) . 'view/admin/apsa-general-scripts.js', array('wp-color-picker'), false, true);\n wp_enqueue_script('apsa-general-scripts');\n\n wp_enqueue_script('jquery-ui-datepicker');\n\n /** Localize month names and day names */\n $dyn_month_names = array();\n $month_names = array(\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\");\n foreach ($month_names as $month_name) {\n $dyn_month_names[] = date_i18n('F', strtotime('01-' . $month_name));\n }\n\n $dyn_day_names = array();\n $day_names = array(\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\");\n foreach ($day_names as $day_name) {\n $dyn_day_names[] = date_i18n('l', strtotime($day_name));\n }\n\n $dyn_month_short_names = array();\n $month_names = array(\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\");\n foreach ($month_names as $month_name) {\n $dyn_month_short_names[] = date_i18n('M', strtotime('01-' . $month_name));\n }\n\n $dyn_day_short_names = array();\n $day_names = array(\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\");\n foreach ($day_names as $day_name) {\n $dyn_day_short_names[] = date_i18n('D', strtotime($day_name));\n }\n\n wp_localize_script('apsa-general-scripts', 'apsa_month_names', $dyn_month_names);\n wp_localize_script('apsa-general-scripts', 'apsa_day_names', $dyn_day_names);\n wp_localize_script('apsa-general-scripts', 'apsa_month_short_names', $dyn_month_short_names);\n wp_localize_script('apsa-general-scripts', 'apsa_day_short_names', $dyn_day_short_names);\n\n /** Localize start of week */\n $start_of_week = get_option('start_of_week');\n\n wp_localize_script('apsa-general-scripts', 'apsa_start_of_week', $start_of_week);\n\n //convert wp date format to jquery\n $date_format_options = array(\n // Day\n 'd' => 'dd',\n 'D' => 'D',\n 'j' => 'd',\n 'l' => 'DD',\n 'N' => '',\n 'S' => '',\n 'w' => '',\n 'z' => 'o',\n // Week\n 'W' => '',\n // Month\n 'F' => 'MM',\n 'm' => 'mm',\n 'M' => 'M',\n 'n' => 'm',\n 't' => '',\n // Year\n 'L' => '',\n 'o' => '',\n 'Y' => 'yy',\n 'y' => 'y',\n // Time\n 'a' => '',\n 'A' => '',\n 'B' => '',\n 'g' => '',\n 'G' => '',\n 'h' => '',\n 'H' => '',\n 'i' => '',\n 's' => '',\n 'u' => ''\n );\n\n /** Localize date format */\n wp_localize_script('apsa-general-scripts', 'apsa_date_format', str_replace(array_keys($date_format_options), array_values($date_format_options), get_option('date_format')));\n\n\n wp_register_style('apsa-admin-styles', plugin_dir_url(__FILE__) . 'view/admin/apsa-admin-styles.css');\n wp_enqueue_style('apsa-admin-styles');\n\n wp_register_style('apsa-admin-mobile-styles', plugin_dir_url(__FILE__) . 'view/admin/apsa-admin-mobile.css');\n wp_enqueue_style('apsa-admin-mobile-styles');\n }\n\n if (strpos($admin_page, \"apsa-manage-campaigns\") === FALSE && strpos($admin_page, \"apsa-manage-general-settings\") === FALSE) {\n return;\n }\n\n\n wp_register_style('jquery-ui-styles', plugin_dir_url(__FILE__) . 'view/admin/jquery-ui/jquery-ui.min.css');\n wp_enqueue_style('jquery-ui-styles');\n\n wp_enqueue_script('jquery');\n\n wp_enqueue_script('jquery-ui-sortable');\n\n wp_enqueue_media();\n\n if (strpos($admin_page, \"apsa-manage-general-settings\") !== FALSE) {\n wp_register_script('apsa-admin-settings-scripts', plugin_dir_url(__FILE__) . 'view/admin/apsa-admin-settings-scripts.js');\n wp_enqueue_script('apsa-admin-settings-scripts');\n /** localize admin labels in apsa-admin-settings-scripts */\n wp_localize_script('apsa-admin-settings-scripts', 'apsa_admin_labels', $apsa_admin_labels);\n } else {\n wp_register_script('apsa-admin-scripts', plugin_dir_url(__FILE__) . 'view/admin/apsa-admin-scripts.js', array('wp-color-picker'), false, true);\n wp_enqueue_script('apsa-admin-scripts');\n /** localize admin labels in apsa-admin-scripts */\n wp_localize_script('apsa-admin-scripts', 'apsa_admin_labels', $apsa_admin_labels);\n }\n // localize ajax url in apsa-admin-scripts\n // $lang added only for qtranslate(NOT X) as it doesn't detect language in ajax (WPML and qtranslateX do it well)\n $lang = (apsa_qtranslate_old_available() != false) ? '?lang=' . apsa_get_language() : '';\n wp_localize_script('apsa-admin-scripts', 'apsa_ajax_url', admin_url('admin-ajax.php' . $lang));\n wp_localize_script('apsa-admin-settings-scripts', 'apsa_ajax_url', admin_url('admin-ajax.php'));\n\n //localize extra options in apsa-admin-scripts and apsa-admin-settings-scripts\n $apsa_extra_options = get_option('apsa_extra_options');\n $apsa_extra_options['apsa_custom_css'] = stripslashes($apsa_extra_options['apsa_custom_css']);\n wp_localize_script('apsa-admin-scripts', 'apsa_extra_options', $apsa_extra_options);\n wp_localize_script('apsa-admin-settings-scripts', 'apsa_extra_options', $apsa_extra_options);\n\n // Localize animation effects\n global $apsa_effects;\n wp_localize_script('apsa-admin-scripts', 'apsa_effects', $apsa_effects);\n\n // Localize plugin data\n global $apsa_plugin_data;\n wp_localize_script('apsa-admin-scripts', 'apsa_plugin_data', $apsa_plugin_data);\n\n // Localize framework event name\n global $apsa_fr_event_name;\n wp_localize_script('apsa-admin-scripts', 'apsa_fr_event_name', $apsa_fr_event_name);\n\n wp_register_script('highcharts-scripts', plugin_dir_url(__FILE__) . 'view/admin/highcharts/highcharts.min.js');\n wp_enqueue_script('highcharts-scripts');\n\n wp_register_script('highcharts-export', plugin_dir_url(__FILE__) . 'view/admin/highcharts/exporting.min.js');\n wp_enqueue_script('highcharts-export');\n\n wp_register_script('highcharts-export', plugin_dir_url(__FILE__) . 'view/admin/highcharts/offline-exporting.min.js');\n wp_enqueue_script('highcharts-export');\n\n wp_register_script('jspdf', plugin_dir_url(__FILE__) . 'view/admin/highcharts/jspdf.min.js');\n wp_enqueue_script('jspdf');\n\n wp_register_script('rgbcolor', plugin_dir_url(__FILE__) . 'view/admin/highcharts/rgbcolor.min.js');\n wp_enqueue_script('rgbcolor');\n\n wp_register_script('canvg', plugin_dir_url(__FILE__) . 'view/admin/highcharts/canvg.js');\n wp_enqueue_script('canvg');\n\n /** Include Codemirror */\n wp_register_script('codemirror-scripts', plugin_dir_url(__FILE__) . 'view/admin/codemirror/lib/codemirror.js');\n wp_enqueue_script('codemirror-scripts');\n\n wp_register_style('codemirror-styles', plugin_dir_url(__FILE__) . 'view/admin/codemirror/lib/codemirror.css');\n wp_enqueue_style('codemirror-styles');\n\n wp_register_script('codemirror-mode-htmlmixed', plugin_dir_url(__FILE__) . 'view/admin/codemirror/mode/htmlmixed/htmlmixed.js');\n wp_enqueue_script('codemirror-mode-htmlmixed');\n\n wp_register_script('codemirror-mode-javascript', plugin_dir_url(__FILE__) . 'view/admin/codemirror/mode/javascript/javascript.js');\n wp_enqueue_script('codemirror-mode-javascript');\n\n wp_register_script('codemirror-mode-css', plugin_dir_url(__FILE__) . 'view/admin/codemirror/mode/css/css.js');\n wp_enqueue_script('codemirror-mode-css');\n\n wp_register_script('codemirror-mode-xml', plugin_dir_url(__FILE__) . 'view/admin/codemirror/mode/xml/xml.js');\n wp_enqueue_script('codemirror-mode-xml');\n\n /** Include Tagsinput */\n wp_register_style('bootstrap-css', plugin_dir_url(__FILE__) . 'view/admin/bootstrap-tagsinput/bootstrap-styles.css');\n wp_enqueue_style('bootstrap-css');\n\n wp_register_style('bootstrap-tagsinput-css', plugin_dir_url(__FILE__) . 'view/admin/bootstrap-tagsinput/dist/bootstrap-tagsinput.css');\n wp_enqueue_style('bootstrap-tagsinput-css');\n\n wp_register_style('bootstrap-app-css', plugin_dir_url(__FILE__) . 'view/admin/bootstrap-tagsinput/tagsinput-app.css');\n wp_enqueue_style('bootstrap-app-css');\n\n wp_register_script('bootstrap-js', plugin_dir_url(__FILE__) . 'view/admin/bootstrap-tagsinput/bootstrap-scripts.js');\n wp_enqueue_script('bootstrap-js');\n\n wp_register_script('typeahead-js', plugin_dir_url(__FILE__) . 'view/admin/bootstrap-tagsinput/typeahead-scripts.js');\n wp_enqueue_script('typeahead-js');\n\n wp_register_script('bootstrap-tagsinput-js', plugin_dir_url(__FILE__) . 'view/admin/bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js');\n wp_enqueue_script('bootstrap-tagsinput-js');\n\n /** Include colorpicker */\n // Add the color picker css file \n wp_enqueue_style('wp-color-picker');\n}", "function starkers_script_enqueuer() {\n\t\twp_register_script( 'site', get_template_directory_uri().'/js/scripts.min.js', array( 'jquery' ) );\n\t\twp_enqueue_script( 'site' );\n\n\t\twp_register_style( 'screen', get_stylesheet_directory_uri().'/style.css', '', '', 'screen' );\n\t\twp_enqueue_style( 'screen' );\n\t}", "function asc_default_scripts( &$scripts ) {\n\tinclude ABSPATH . ASC_CORE . '/version.php'; // include an unmodified $asc_version\n\n\t$develop_src = false !== strpos( $asc_version, '-src' );\n\n\tif ( ! defined( 'SCRIPT_DEBUG' ) ) {\n\t\tdefine( 'SCRIPT_DEBUG', $develop_src );\n\t}\n\n\tif ( ! $guessurl = admin_storefront_url() ) {\n\t\t$guessed_url = true;\n\t\t$guessurl = site_url();\n\t}\n\n\t$scripts->base_url = $guessurl;\n\t$scripts->content_url = defined('ASC_CONTENT_URL')? ASC_CONTENT_URL : '';\n\t$scripts->default_version = PRODUCT_VERSION_NUMBER;\n\t$scripts->default_dirs = array('avactis-system/admin/js/', 'includes/js/');\n\n\t$suffix = SCRIPT_DEBUG ? '' : '.min';\n\t$dev_suffix = $develop_src ? '' : '.min';\n\n\t$scripts->add( 'prototype', '//ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js', array(), '1.7.1');\n\t$scripts->add( 'scriptaculous-root', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js', array('prototype'), '1.9.0');\n\t$scripts->add( 'scriptaculous-builder', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/builder.js', array('scriptaculous-root'), '1.9.0');\n\t$scripts->add( 'scriptaculous-dragdrop', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/dragdrop.js', array('scriptaculous-builder', 'scriptaculous-effects'), '1.9.0');\n\t$scripts->add( 'scriptaculous-effects', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/effects.js', array('scriptaculous-root'), '1.9.0');\n\t$scripts->add( 'scriptaculous-slider', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/slider.js', array('scriptaculous-effects'), '1.9.0');\n\t$scripts->add( 'scriptaculous-sound', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/sound.js', array( 'scriptaculous-root' ), '1.9.0' );\n\t$scripts->add( 'scriptaculous-controls', '//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/controls.js', array('scriptaculous-root'), '1.9.0');\n\t$scripts->add( 'scriptaculous', false, array('scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls') );\n\n\t// jQuery\n\t$scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '1.11.0' );\n\t$scripts->add( 'jquery-core', 'includes/jquery/jquery.js', array(), '1.11.0' );\n\t$scripts->add( 'jquery-migrate', \"includes/jquery/jquery-migrate$suffix.js\", array(), '1.2.1' );\n\n\t// full jQuery UI\n\t$scripts->add( 'jquery-ui-core', 'includes/jquery/ui/jquery.ui.core.min.js', array('jquery'), '1.10.4');\n\t$scripts->add( 'jquery-effects-core', 'includes/jquery/ui/jquery.ui.effect.min.js', array('jquery'), '1.10.4', 1 );\n\n\t$scripts->add( 'jquery-effects-blind', 'includes/jquery/ui/jquery.ui.effect-blind.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-bounce', 'includes/jquery/ui/jquery.ui.effect-bounce.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-clip', 'includes/jquery/ui/jquery.ui.effect-clip.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-drop', 'includes/jquery/ui/jquery.ui.effect-drop.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-explode', 'includes/jquery/ui/jquery.ui.effect-explode.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-fade', 'includes/jquery/ui/jquery.ui.effect-fade.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-fold', 'includes/jquery/ui/jquery.ui.effect-fold.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-highlight', 'includes/jquery/ui/jquery.ui.effect-highlight.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-pulsate', 'includes/jquery/ui/jquery.ui.effect-pulsate.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-scale', 'includes/jquery/ui/jquery.ui.effect-scale.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-shake', 'includes/jquery/ui/jquery.ui.effect-shake.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-slide', 'includes/jquery/ui/jquery.ui.effect-slide.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-effects-transfer', 'includes/jquery/ui/jquery.ui.effect-transfer.min.js', array('jquery-effects-core'), '1.10.4', 1 );\n\n\t$scripts->add( 'jquery-ui-accordion', 'includes/jquery/ui/jquery.ui.accordion.min.js', array('jquery-ui-core', 'jquery-ui-widget'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-autocomplete', 'includes/jquery/ui/jquery.ui.autocomplete.min.js', array('jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position', 'jquery-ui-menu'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-button', 'includes/jquery/ui/jquery.ui.button.min.js', array('jquery-ui-core', 'jquery-ui-widget'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-datepicker', 'includes/jquery/ui/jquery.ui.datepicker.min.js', array('jquery-ui-core'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-dialog', 'includes/jquery/ui/jquery.ui.dialog.min.js', array('jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-button', 'jquery-ui-position'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-draggable', 'includes/jquery/ui/jquery.ui.draggable.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.10.4');\n\t$scripts->add( 'jquery-ui-droppable', 'includes/jquery/ui/jquery.ui.droppable.min.js', array('jquery-ui-draggable'), '1.10.4');\n\t$scripts->add( 'jquery-ui-menu', 'includes/jquery/ui/jquery.ui.menu.min.js', array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-mouse', 'includes/jquery/ui/jquery.ui.mouse.min.js', array('jquery-ui-widget'), '1.10.4');\n\t$scripts->add( 'jquery-ui-position', 'includes/jquery/ui/jquery.ui.position.min.js', array('jquery'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-progressbar', 'includes/jquery/ui/jquery.ui.progressbar.min.js', array('jquery-ui-widget'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-resizable', 'includes/jquery/ui/jquery.ui.resizable.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-selectable', 'includes/jquery/ui/jquery.ui.selectable.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-slider', 'includes/jquery/ui/jquery.ui.slider.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-sortable', 'includes/jquery/ui/jquery.ui.sortable.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.10.4');\n\t$scripts->add( 'jquery-ui-spinner', 'includes/jquery/ui/jquery.ui.spinner.min.js', array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-button' ), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-tabs', 'includes/jquery/ui/jquery.ui.tabs.min.js', array('jquery-ui-core', 'jquery-ui-widget'), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-tooltip', 'includes/jquery/ui/jquery.ui.tooltip.min.js', array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.10.4', 1 );\n\t$scripts->add( 'jquery-ui-widget', 'includes/jquery/ui/jquery.ui.widget.min.js', array('jquery'), '1.10.4');\n\n\t// deprecated, not used in core, most functionality is included in jQuery 1.3\n\t$scripts->add( 'jquery-form', \"includes/jquery/jquery.form$suffix.js\", array('jquery'), '3.37.0', 1 );\n\n\t// jQuery plugins\n\t$scripts->add( 'jquery-color', \"includes/jquery/jquery.color.min.js\", array('jquery'), '2.1.1', 1 );\n\t$scripts->add( 'suggest', \"includes/jquery/suggest$suffix.js\", array('jquery'), '1.1-20110113', 1 );\n\t$scripts->add( 'schedule', 'includes/jquery/jquery.schedule.js', array('jquery'), '20m', 1 );\n\t$scripts->add( 'jquery-query', \"includes/jquery/jquery.query.js\", array('jquery'), '2.1.7', 1 );\n\t$scripts->add( 'jquery-serialize-object', \"includes/jquery/jquery.serialize-object.js\", array('jquery'), '0.2', 1 );\n\t$scripts->add( 'jquery-hotkeys', \"includes/jquery/jquery.hotkeys$suffix.js\", array('jquery'), '0.0.2m', 1 );\n\t$scripts->add( 'jquery-table-hotkeys', \"includes/jquery/jquery.table-hotkeys$suffix.js\", array('jquery', 'jquery-hotkeys'), false, 1 );\n\t$scripts->add( 'jquery-touch-punch', \"includes/jquery/jquery.ui.touch-punch.js\", array('jquery-ui-widget', 'jquery-ui-mouse'), '0.2.2', 1 );\n\n/*\t$scripts->add( 'thickbox', \"/wp-includes/js/thickbox/thickbox.js\", array('jquery'), '3.1-20121105', 1 );\n\tdid_action( 'init' ) && $scripts->localize( 'thickbox', 'thickboxL10n', array(\n\t\t\t'next' => __('Next &gt;'),\n\t\t\t'prev' => __('&lt; Prev'),\n\t\t\t'image' => __('Image'),\n\t\t\t'of' => __('of'),\n\t\t\t'close' => __('Close'),\n\t\t\t'noiframes' => __('This feature requires inline frames. You have iframes disabled or your browser does not support them.'),\n\t\t\t'loadingAnimation' => includes_url('js/thickbox/loadingAnimation.gif'),\n\t) );*/\n\n\t// common bits for both uploaders\n\t$max_upload_size = ( (int) ( $max_up = @ini_get('upload_max_filesize') ) < (int) ( $max_post = @ini_get('post_max_size') ) ) ? $max_up : $max_post;\n\n\tif ( empty($max_upload_size) )\n\t\t$max_upload_size = __('not configured');\n/*\n\t// error message for both plupload and swfupload\n\t$uploader_l10n = array(\n\t\t'queue_limit_exceeded' => __('You have attempted to queue too many files.'),\n\t\t'file_exceeds_size_limit' => __('%s exceeds the maximum upload size for this site.'),\n\t\t'zero_byte_file' => __('This file is empty. Please try another.'),\n\t\t'invalid_filetype' => __('This file type is not allowed. Please try another.'),\n\t\t'not_an_image' => __('This file is not an image. Please try another.'),\n\t\t'image_memory_exceeded' => __('Memory exceeded. Please try another smaller file.'),\n\t\t'image_dimensions_exceeded' => __('This is larger than the maximum size. Please try another.'),\n\t\t'default_error' => __('An error occurred in the upload. Please try again later.'),\n\t\t'missing_upload_url' => __('There was a configuration error. Please contact the server administrator.'),\n\t\t'upload_limit_exceeded' => __('You may only upload 1 file.'),\n\t\t'http_error' => __('HTTP error.'),\n\t\t'upload_failed' => __('Upload failed.'),\n\t\t'big_upload_failed' => __('Please try uploading this file with the %1$sbrowser uploader%2$s.'),\n\t\t'big_upload_queued' => __('%s exceeds the maximum upload size for the multi-file uploader when used in your browser.'),\n\t\t'io_error' => __('IO error.'),\n\t\t'security_error' => __('Security error.'),\n\t\t'file_cancelled' => __('File canceled.'),\n\t\t'upload_stopped' => __('Upload stopped.'),\n\t\t'dismiss' => __('Dismiss'),\n\t\t'crunching' => __('Crunching&hellip;'),\n\t\t'deleted' => __('moved to the trash.'),\n\t\t'error_uploading' => __('&#8220;%s&#8221; has failed to upload.')\n\t);\n*/\n\n/**\n\tAvactis additional js\n*/\n\t\t$scripts->add( 'bootstrap', 'includes/bootstrap/js/bootstrap.min.js', array( 'jquery' ), '3.2.0');\n\t\t$scripts->add( 'bootstrap-switch', 'includes/bootstrap-switch/js/bootstrap-switch.min.js', array( 'bootstrap' ), false);\n\t\t$scripts->add( 'bootstrap-hover-dropdown', 'includes/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js', array( 'bootstrap' ), false);\n\t\t$scripts->add( 'jquery-ui-custom', 'includes/jquery-ui/jquery-ui-1.10.3.custom.min.js', array( 'jquery' ), '1.10.3');\n\t\t$scripts->add( 'jquery-slimscroll', 'includes/jquery-slimscroll/jquery.slimscroll.min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'jquery-blockui', 'includes/jquery/jquery.blockui.min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'jquery-cokie', 'includes/jquery/jquery.cokie.min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'jquery-uniform', 'includes/uniform/jquery.uniform.min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'jquery-pulsate', 'includes/jquery/jquery.pulsate.min.js', array( 'jquery' ), false);\n\n\t\t$scripts->add( 'flot', 'includes/flot/jquery.flot.min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'flot-categories', 'includes/flot/jquery.flot.categories.min.js', array( 'flot' ), false);\n\t\t$scripts->add( 'flot-resize', 'includes/flot/jquery.flot.resize.min.js', array( 'flot' ), false);\n\n\t\t$scripts->add( 'daterangepicker', 'includes/bootstrap-daterangepicker/daterangepicker.js', array( 'bootstrap' ), false);\n\t\t$scripts->add( 'moment', 'includes/bootstrap-daterangepicker/moment.min.js', array(), false);\n\t\t$scripts->add( 'bootstrap-datepicker', 'includes/bootstrap-datepicker/js/bootstrap-datepicker.js', array( 'bootstrap' ), false);\n $scripts->add( 'bootstrap-datetimepicker','includes/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js',array( 'bootstrap' ), false);\n\t\t$scripts->add( 'bootstrap-dataTables', 'includes/datatables/plugins/bootstrap/dataTables.bootstrap.js', array( 'bootstrap' ), false);\n\t\t$scripts->add( 'bootstrap-toastr', 'includes/bootstrap-toastr/toastr.min.js', array( 'bootstrap' ), false);\n\t\t$scripts->add( 'jquery-dataTables', 'includes/datatables/media/js/jquery.dataTables.min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'dataTables', 'includes/datatable.js', array(), false);\n\t\t$scripts->add( 'bootbox', 'includes/bootbox/bootbox.min.js', array(), false);\n\n\t\t$scripts->add( 'fullcalendar', 'includes/fullcalendar/fullcalendar.min.js', array( 'jquery-ui-resizable', 'jquery-ui-draggable' ), false);\n\t\t$scripts->add( 'jquery-easypiechart', 'includes/jquery-easypiechart/jquery.easypiechart.min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'jquery-sparkline', 'includes/jquery/jquery.sparkline.min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'jquery-gritter', 'includes/gritter/js/jquery.gritter.min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'jquery-colorbox', 'includes/colorbox/jquery.colorbox-min.js', array( 'jquery' ), false);\n\t\t$scripts->add( 'asc-admin', 'includes/asc-admin.js', array(), false);\n $scripts->add( 'component-pickers', 'includes/components-pickers.js', array(), false);\n\n\t\t$scripts->add( 'ie9-excanvas', 'includes/excanvas.min.js', array(), false);\n\t\t$scripts->add( 'ie9-respond', 'includes/respond.min.js', array(), false);\n\n\t\t$scripts->add( 'jquery.validate', 'includes/jquery-validation/jquery.validate.min.js', array('jquery'), false);\n\t\t$scripts->add( 'validate-additional-methods', 'includes/jquery-validation/additional-methods.min.js', array('jquery'), false);\n\t\t$scripts->add( 'jquery-bootstrap-wizard', 'includes/bootstrap-wizard/jquery.bootstrap.wizard.min.js', array('jquery'), false);\n\t\t$scripts->add( 'jquery-backstretch', 'includes/backstretch/jquery.backstretch.min.js', array('jquery'), false);\n\t\t$scripts->add( 'select2', 'includes/select2/select2.min.js', array(), false);\n\n\t\t$scripts->add( 'jquery-iframe-transport', 'avactis-system/admin/js/jquery.iframe-transport.js', array(), false);\n\t\t$scripts->add( 'sanitize_tags', 'avactis-system/admin/js/sanitize_tags.js', array(), false);\n\t\t$scripts->add( 'admin-index', 'avactis-system/admin/js/index.js', array(), false);\n\t\t$scripts->add( 'admin-tasks', 'avactis-system/admin/js/tasks.js', array(), false);\n\t\t$scripts->add( 'admin-layout', 'avactis-system/admin/js/layout.js', array(), false);\n\t\t$scripts->add( 'form-wizard', 'avactis-system/admin/js/form-wizard.js', array('jquery'), false);\n\t\t$scripts->add( 'admin-login-soft', 'avactis-system/admin/js/login-soft.js', array(), false);\n\n\t\t$scripts->add( 'admin-avactis-main', 'avactis-system/admin/js/main.js', array(), false);\n\t\t$scripts->add( 'admin-avactis-md5', 'avactis-system/admin/templates/modules/users/md5.js', array(), false);\n\t\t$scripts->add( 'admin-avactis-dtree', 'avactis-system/admin/dtree/dtree.js', array(), false);\n\t\t$scripts->add( 'admin-avactis-validate', 'avactis-system/admin/js/validate.js', array(), false);\n\t\t$scripts->add( 'admin-avactis-new-window', 'avactis-system/admin/js/new_window.js', array(), false);\n\t\t$scripts->add( 'admin-avactis-countries-states', 'avactis-system/admin/js/countries_states.js', array(), false);\n\t\t$scripts->add( 'admin-avactis-tree-css', 'avactis-system/admin/jstree/css.js', array(), false);\n\t\t$scripts->add( 'admin-avactis-tree-component', 'avactis-system/admin/jstree/tree_component.js', array(), false);\n\t\t$scripts->add( 'admin-avactis-categories', 'avactis-system/admin/js/categories.js', array(), false);\n\t\t$scripts->add( 'admin-avactis-utility', 'avactis-system/admin/js/utility.js', array(), false);\n $scripts->add( 'admin-toastr-notification', 'avactis-system/admin/js/toastr-notification.js', array(), false);\n\t}", "function addlinks(){\n Vtiger_Link::addLink(0, 'HEADERSCRIPT', 'LSWYSIWYG', 'modules/LSWYSIWYG/resources/WYSIWYG.js','','','');\n\n\t}", "function add_clranger_scripts () {\n\t\t\n\t\t$base_url = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on' ? 'https' : 'http' ) . '://' . $_SERVER['HTTP_HOST'];\n\t\t$url = $base_url . $_SERVER[\"REQUEST_URI\"];\n\t\t\n wp_enqueue_style( 'seo-bot-font', 'https://fonts.googleapis.com/css2?family=Oswald&display=swap' );\n\n\n if(isset($_GET['page'])){\n $page = $_GET['page'];\n if(in_array($page,CLRANGER_PATHS)){\n \n }\n }\n\n if(isset($_GET['page'])){\n $page = $_GET['page'];\n if($page == 'clarity-ranger'){\n wp_enqueue_script('script-name', 'https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/10.12.0/sweetalert2.min.js' , array(), '10.12.0', true);\n wp_enqueue_style( 'style-sweetalert2', \"https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/10.12.0/sweetalert2.css\" );\n wp_enqueue_style( 'font-awesome-5', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css' );\n\n wp_enqueue_style( 'clranger_ilink_style', CLARITY_URL . 'css/clranger-ilinks.css',\n array(),\n date(\"h:i:s\") );\n\n wp_register_script( 'clranger_ilink_script', CLARITY_URL . 'js/internallinks.js',\n array(),\n date(\"h:i:s\"), true );\n\n wp_localize_script( 'clranger_ilink_script', 'myobject',\n array(\n 'myajaxurl' => admin_url( 'admin-ajax.php' ),\n\t\t\t\t\t\t\t'import_backlinks_action' => admin_url('admin-ajax.php?action=import_backlinks_csv'),\n\t\t\t\t\t\t\t'current_url' => $url,\n\t\t\t\t\t\t\t'setting_hide_show' => array(\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t'word_count' \t=> (get_option(\"word_count\") == \"false\")? 0 : 1 ,\n\t\t\t\t\t\t\t\t'il_topic' \t\t=> (get_option(\"il_topic\") == \"false\")? 0 : 1 ,\n\t\t\t\t\t\t\t\t'il_type' \t\t=> (get_option(\"il_type\") == \"false\")? 0 : 1 ,\n\t\t\t\t\t\t\t\t'anchortext' \t=> (get_option(\"anchortext\") == \"false\")? 0 : 1 ,\n\t\t\t\t\t\t\t\t'intl_incoming' => (get_option(\"intl_incoming\") == \"false\")? 0 : 1 ,\n\t\t\t\t\t\t\t\t'backlinks_anchortext' \t=> (get_option(\"backlinks_anchortext\") == \"false\")? 0 : 1 ,\n\t\t\t\t\t\t\t\t'backlinks' \t=> (get_option(\"backlinks\") == \"false\")? 0 : 1 ,\n\t\t\t\t\t\t\t\t'total_links' \t=> (get_option(\"total_links\") == \"false\")? 0 : 1 ,\n\t\t\t\t\t\t\t\t'intl_outgoing' => (get_option(\"intl_outgoing\") == \"false\")? 0 : 1 ,\n\t\t\t\t\t\t\t\t'extl_links' \t=> (get_option(\"extl_links\") == \"false\")? 0 : 1 \n\t\t\t\t\t\t\t)\n ) );\n wp_enqueue_script('clranger_ilink_script');\n\n wp_enqueue_style( 'clranger_tabulator_style', CLARITY_URL . 'css/tabulator.min.css',\n array(),\n \"4.8.4\" );\n wp_enqueue_script( 'clranger_tabulator_script', CLARITY_URL . 'js/tabulator.min.js',\n array(),\n \"4.8.4\" );\n }\n\t\t \n\t\t \n }\n\t\t\n\t if(isset($_GET['page'])){\n\t\t $page = $_GET['page'];\n\t\t if($page == 'clarity-reverse-silo'){\n\t\t\t \n\t\t\t \n\t\t\t wp_enqueue_style( 'clranger_reverse_silo_style', CLARITY_URL . 'css/clranger-reverse-silo.css',array(),\"4.8.4\" );\n\t\t\t \n\t\t\t\t wp_enqueue_script('script-name', 'https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/10.12.0/sweetalert2.min.js' , array(), '10.12.0', true);\n wp_enqueue_style( 'style-sweetalert2', \"https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/10.12.0/sweetalert2.css\" );\n wp_enqueue_style( 'font-awesome-5', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css' );\n\t\t\t \n\t\t\t\t wp_register_script( 'clranger_ilink_script', CLARITY_URL . 'js/reverse-silo.js',\n\t\t\t\t\t\tarray(),\n\t\t\t\t\t\t date(\"h:i:s\"), true );\n\n\t\t\t\twp_localize_script( 'clranger_ilink_script', 'objectsilo',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'myajaxurl' => admin_url( 'admin-ajax.php' ),\n\t\t\t\t\t\t\t\t'tabulator_data' => $this->clranger_tabulator_silo(),\n\t\t\t\t\t\t\t\t'filter_rs_topic' => get_option( 'rs_topic' ),\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t) );\n\t\t\t\twp_enqueue_script('clranger_ilink_script');\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t wp_enqueue_style( 'clranger_tabulator_style', CLARITY_URL . 'css/tabulator.min.css',\n array(),\n \"4.8.4\" );\n\t\t\t\t\n wp_enqueue_script( 'clranger_tabulator_script', CLARITY_URL . 'js/tabulator.min.js',\n array(),\n \"4.8.4\" );\n\t\t\t\t\n\t\t }\n\t }\n }", "function scripts_tag_handler( $style = \"\" ) {\n\t\t\t\n\t\t\t// Since 1.7 - convert old style name to new settings\n\t\t\tif ( $style == \"styleA\" || $style == \"styleE\" ) {\t$style = \"styleF\"; }\n\t\t\tif ( $style == \"styleB\" ) { $style = \"styleG\"; }\n\t\t\tif ( $style == \"styleC\" ) { $style = \"styleH\"; }\n\t\t\tif ( $style == \"styleD\" ) { $style = \"styleI\"; }\n\t\t\t\n\t\t\t$this->stylesheet = ( $style == \"\" ) ? $this->theSettings['player_theme'] : $style;\n\t\t\t$this->scriptsflag = \"true\";\n\t\t\treturn;\n\t\t}", "function javascript(){\n\techo '';\n\t?>\n <script src='https://code.jquery.com/jquery-2.1.4.min.js'></script>\n\t<?php\n\tglobal $AllowPublicEdit;\n\techo \"<script>\";\n\techo \"\\n\";\n\techo file_get_contents('./js/index.js');\n\techo \"</script>\";\n\techo \"\\n\";\n\t\n\t\n}", "function addScriptsStyles(){\n\t\twp_enqueue_script( 'dashicons-picker', plugins_url( 'post_icon/vendor/dashicons-picker/js/dashicons-picker.js' ), array( 'jquery' ) );\n\t\twp_enqueue_style( 'dashicons-picker', plugins_url( 'post_icon/vendor/dashicons-picker/css/dashicons-picker.css' ), array( 'dashicons' ) );\n\t\twp_enqueue_script( 'post_icon_script', plugins_url( 'post_icon/js/post_icon.js' ), array( 'jquery' ) );\n\t}", "function calvero_scripts() {\n \n wp_enqueue_style( 'style', get_stylesheet_uri() );\n \n if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n wp_enqueue_script( 'comment-reply' );\n }\n \n wp_enqueue_script( 'navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );\n \n if ( is_singular() && wp_attachment_is_image() ) {\n wp_enqueue_script( 'keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' );\n }\n \n wp_enqueue_script( 'jquery', get_template_directory_uri() . '/js/jquery-1.11.3.min.js' , false , false , true );\n \n wp_enqueue_script( 'menu', get_template_directory_uri() . '/js/menu-funcao.js' , 'jquery' , false , true );\n}", "function gwself_scripts() {\n\tglobal $post;\n\t//default script - needed everywhere\n\twp_enqueue_script( 'theme-jquery', get_template_directory_uri() . '/dist/js/theme.js', array('jquery'), 20190529, true);\n\twp_localize_script('theme-jquery', 'WPURLS', array('siteurl' => get_option('siteurl')));\n\t//header, footer, global css\n\twp_enqueue_style( 'theme-style', get_template_directory_uri() . '/dist/css/theme.css', array(), date(\"H:i:s\"));\n\n\t//section specific styles and scripts\n\tif(is_front_page()) {\n\t\t//FRONT PAGE SCRIPTS\n\t\twp_enqueue_script( 'fp-script', get_template_directory_uri() . '/dist/js/frontpage.js', array('jquery'), 20190529, true);\n\t\twp_enqueue_style( 'frontpage-style', get_template_directory_uri() . '/dist/css/frontpage.css', array(), date(\"H:i:s\"));\n\t} elseif(is_singular()) {\n\t\t$type = $post->post_type;\n\t\twp_enqueue_style( $type.'-style', get_template_directory_uri() . '/dist/css/type_'.$type.'.css', array(), date(\"H:i:s\"));\n\t} else {\n\t\twp_enqueue_style( 'page-style', get_template_directory_uri() . '/dist/css/type_page.css', array(), date(\"H:i:s\"));\n\t}\n}", "function insert_head()\n{\n echo \"<script type='text/javascript' src='javascript/jquery-2.1.4.min.js'></script>\";\n echo \"<link href='css/css_file.css' rel='stylesheet' type='text/css'>\";\n}", "function dfcg_help_scripts() {\n?>\n\t<h3><?php _e( 'Dynamic Content Gallery - Quick Help - Javascript and Load Scripts', DFCG_DOMAIN ); ?></h3>\n\t\n\t<p><?php _e( 'Go to the DCG Settings > Javascript Options tab to set the choice of mootools (default) or jQuery scripts. Note that after changing this settings, click Save, then return to the Javascript Options tab to configure the other options in this tab. You have to do this because the javascript options are not identical for both scripts.', DFCG_DOMAIN ); ?></p>\n\t\n\t<p><?php _e( 'The DCG Settings > Load Scripts tab allows you to specify in which pages the javascript and gallery CSS are loaded. These settings ensure that the javascript and CSS are only loaded where needed, and therefore will not slow down the page load on all the other pages on your site.', DFCG_DOMAIN ); ?></p>\n\t\n\t<p><?php _e( 'In 99.9% of cases users will display the DCG on their home page. Therefore, if this is the case you for, select the Home page option in the DCG Settings > Load Scripts tab.', DFCG_DOMAIN ); ?></p>\n\n<?php\n}", "function addthis_scripts(){\n ?>\n <script type=\"text/javascript\" src=\"//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-546f51e739399f5b\" async=\"async\"></script>\n<?php\n}", "function vacatures_single_style_scripts() {\n //wp_enqueue_style( 'vacatures-single-page-template-theme-style' );\n wp_enqueue_style('vacatures-single-page-template-theme-style',content_url( 'templates/assets/css/vacatures-single-page-template-theme-style.css' , __FILE__ ) );\n}", "function bcm_add_scripts() {\t\r\n\t\tglobal $bcmDirPath;\r\n\t\tif (function_exists('wp_enqueue_script') && function_exists('wp_register_script')) {\r\n\t\t\twp_enqueue_script('bcm_edit_script', $bcmDirPath.'/editcomments.js.php');\r\n\t\t\twp_enqueue_script('prototype');\r\n\t\t\twp_enqueue_script('scriptaculous-effects');\r\n\t\t\twp_enqueue_script( 'admin-comments' );\r\n\t\t} else {\r\n\t\t\twpau_add_scripts_legacy();\r\n\t\t}\r\n\t}", "function mgr_add_scripts(){\n wp_enqueue_style('mgr-main-style',plugins_url().'/includes/my-github-repos/css/style.css');\n wp_enqueue_script('mgr-main-script',plugins_url().'/includes/my-github-repos/js/main.js');\n}", "public function enqueue_scripts() {\n\t\twp_add_inline_style( 'at-main', $this->inline_css() );\n\t}", "function oursavior_scripts() {\n\twp_enqueue_style( 'oursavior-style', get_stylesheet_uri() );\n\n\twp_enqueue_script( 'oursavior-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );\n\n\twp_enqueue_script( 'oursavior-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );\n\n\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\twp_enqueue_script( 'comment-reply' );\n\t}\n}", "function elytra_scripts() {\n\n\t// Theme stylesheet.\n\twp_enqueue_style( 'elytra-style', get_stylesheet_uri() );\n\n}", "static function wck_fep_dashboard_print_script() {\n\t\t/* if the static var set by the shortcode isn't true do nothing */\n\t\tif ( ! self::$wck_fep_dashboard_add_scripts )\n\t\t\treturn;\n\n\t\twp_print_scripts('jquery-ui-tabs');\n\t\twp_print_scripts('wck-fep');\n\t\twp_print_styles('wck-fep-css');\n\n\t\t/* ajax url for frontend */\n\t\techo '<script type=\"text/javascript\">var wckAjaxurl = \"'. admin_url('admin-ajax.php') .'\";</script>';\n\t}", "function addLittleShopCSS(){\n if(littleShopTakeEffect() === TRUE){\n\t echo '<link media=\"screen\" type=\"text/css\" href=\"'.myOwnLittleEbayShopPluginURL().'/my-own-little-ebay-shop-css.css\" rel=\"stylesheet\"/>';\n\t\n\t}\n}", "function addLittleShopJS(){\n if(littleShopTakeEffect() === TRUE){\n \techo '<script type=\"text/javascript\" src=\"'.myOwnLittleEbayShopPluginURL().'/jquery-1.4.1.min.js\" rel=\"javascript\"/></script>';\n\t echo '<script type=\"text/javascript\" src=\"'.myOwnLittleEbayShopPluginURL().'/my-own-little-ebay-shop-js.js\" rel=\"javascript\"/></script>';\n\t\n\t}\n}", "function add_javascript() {\n echo '<script type=\"text/javascript\" src=' .\n plugins_url('dc-admin.js', __FILE__) . '></script>';\n}", "function charity_is_hope_template_gallery_add_scripts($style) {\n\t\tif (charity_is_hope_substr($style, 0, 8) == 'gallery_') {\n\t\t\twp_enqueue_script( 'isotope', charity_is_hope_get_file_url('js/jquery.isotope.min.js'), array(), null, true );\n\t\t\twp_enqueue_script( 'classie', charity_is_hope_get_file_url('js/core.gallery/classie.js'), array(), null, true );\n\t\t\twp_enqueue_script( 'imagesloaded', charity_is_hope_get_file_url('js/core.gallery/imagesloaded.js'), array(), null, true );\n\t\t\twp_enqueue_script( 'gallery-script', charity_is_hope_get_file_url('js/core.gallery/core.gallery.js'), array(), null, true );\n\t\t\twp_enqueue_style( 'gallery-style', charity_is_hope_get_file_url('css/core.gallery.css'), array(), null );\n\t\t}\n\t}", "public function load_admin_scripts_styles(){\n\t\t\n\t}", "function wpdocs_theme_name_scripts() {\n wp_enqueue_style('pva-style', get_stylesheet_uri());\n wp_enqueue_style('pva-bootstrap', get_stylesheet_directory_uri() . '/css/bootstrap.min.css', array(), '1.0.0', 'all');\n wp_enqueue_script('pva-script', get_template_directory_uri() . '/js/sitescript.js', array(), '1.0.0', true);\n}", "function _barony_base_file_additions() {\n // Add Font Awesome\n drupal_add_js('//use.fontawesome.com/76948938e9.js', 'external');\n // Add Google Fonts\n drupal_add_css('//fonts.googleapis.com/css?family=Uncial+Antiqua|Metamorphous', array('group' => CSS_THEME));\n\n // Custom additions\n drupal_add_js(drupal_get_path('theme', 'barony_base') . '/js/header-movement.js', array('type' => 'file', 'scope' => 'footer'));\n}", "function thememount_customizer_script(){\n\tglobal $wp_customize;\n\tif ( isset( $wp_customize ) ) {\n\t\tglobal $howes;\n\t\t?>\n\t\t<style type=\"text/css\">\n\t\theader .thememount-topbar{\n\t\t\tbackground-color: <?php echo $howes['topbarbgcolor']; ?>;\n\t\t}\n\t\theader .headerblock .header-inner, #stickable-header-sticky-wrapper{\n\t\t\tbackground-color: <?php echo $howes['headerbgcolor']; ?>;\n\t\t}\n\t\tfooter.site-footer > div.footer{\n\t\t\tbackground-color: <?php echo $howes['footerwidget_bgcolor']; ?>;\n\t\t}\n\t\tfooter.site-footer > div.site-info{\n\t\t\tbackground-color: <?php echo $howes['footertext_bgcolor']; ?>;\n\t\t}\n\t\t</style>\n\t\t\n\t\t<?php\n\t}\n}", "function scripts(){\n\n\t\t// this handy function checks a post or page to see if your component exists beore enqueueing assets\n\t\tif ( function_exists('aesop_component_exists') && aesop_component_exists('reveal') ) {\n\n\t\t\twp_enqueue_style('reveal-style', \t\tAESOP_REVEAL_URL.'/css/twentytwenty.css', AESOP_REVEAL_VERSION );\n\t\t\twp_enqueue_script('reveal-script', \t\tAESOP_REVEAL_URL.'/js/jquery.event.move.js', array('jquery'), AESOP_REVEAL_VERSION, true);\n\t\t\twp_enqueue_script('reveal-script-more', AESOP_REVEAL_URL.'/js/jquery.twentytwenty.js', array('jquery'), AESOP_REVEAL_VERSION, true);\n\n\t\t}\n\n\t}", "public function set_script_styling(){\r\n /**\r\n * enqueue css styling here\r\n */\r\n wp_enqueue_style('before-after-comparison-styling', plugin_dir_url( __FILE__ ) . 'css/before-after.css', array(), '1.0');\r\n\r\n /**\r\n * enqueue custom js / javascript library here\r\n */\r\n wp_enqueue_script('before-after-comparison-javascript', plugin_dir_url( __FILE__ ) . 'js/before-after.js', array('jquery'), '1.0' , false);\r\n\r\n \r\n }", "function hugomitoire_scripts() {\n wp_enqueue_style( 'appStyles', get_template_directory_uri() . '/dist/css/style.min.css' );\n wp_enqueue_script( 'Js', get_template_directory_uri() . '/dist/js/all.js', array(), '1.0.0', true );\n wp_enqueue_script( 'Swiper', get_template_directory_uri() . '/dis/js/all.js', array(), '4.4.2', true);\n}" ]
[ "0.6894319", "0.6789533", "0.6706804", "0.6699865", "0.66399884", "0.6562567", "0.65094155", "0.65065926", "0.6492275", "0.64448756", "0.6408584", "0.6382151", "0.63815767", "0.63522875", "0.6336021", "0.63351876", "0.6318364", "0.63116705", "0.63051814", "0.6303926", "0.6303171", "0.63000023", "0.62935954", "0.62892187", "0.6281625", "0.62763697", "0.62718004", "0.626942", "0.62232816", "0.62232816", "0.62232816", "0.62230086", "0.6204788", "0.6202668", "0.6202132", "0.619803", "0.61771125", "0.617568", "0.6173061", "0.61727136", "0.6169687", "0.6169648", "0.6164598", "0.61553454", "0.6153827", "0.615076", "0.615076", "0.61474067", "0.61469895", "0.6131386", "0.613106", "0.6125549", "0.6116223", "0.6109365", "0.6100079", "0.60984075", "0.6092765", "0.60927486", "0.6080721", "0.60747176", "0.60733557", "0.60702914", "0.6062725", "0.60554165", "0.60446864", "0.6039184", "0.6038747", "0.6038111", "0.6034292", "0.6031344", "0.60306525", "0.6025864", "0.60189646", "0.60178745", "0.60175604", "0.60057884", "0.6005784", "0.6004251", "0.60038686", "0.60016143", "0.59933263", "0.5989748", "0.59851503", "0.5978316", "0.5976378", "0.59726477", "0.59726274", "0.5972581", "0.5970886", "0.596879", "0.5965344", "0.59646267", "0.5964622", "0.5963334", "0.59619427", "0.59591454", "0.5954074", "0.5953157", "0.59485155", "0.5947608", "0.5938304" ]
0.0
-1
ADD MENUS AO TEMA
function rt_after_setup(){ // SUPORTE PARA IMAGENS add_theme_support('post-thumbnails'); //SUPORTE PARA TITLE DO TEMA add_theme_support('title-tag'); //LOGO CUSTOMIZADA add_theme_support('custom-logo'); //SUPORTE PARA MENUS add_theme_support('menus'); register_nav_menu('primary', __('Primary Menu','temaOne')); register_nav_menu('footer', 'Menu Rodapé'); // REMOVENDO A BARRA DO ADMIN show_admin_bar(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addMetaboxes() {}", "function insertarMaquinaria(){\n\t\t$this->procedimiento='snx.ft_maquinaria_ime';\n\t\t$this->transaccion='SNX_MAQ_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('potencia','potencia','numeric');\n\t\t$this->setParametro('peso','peso','numeric');\n\t\t$this->setParametro('maquinaria','maquinaria','varchar');\n\t\t$this->setParametro('id_factorindexacion','id_factorindexacion','int4');\t\t\n\t\t$this->setParametro('id_tipopreciomaquinaria','id_tipopreciomaquinaria','int4');\n\t\t$this->setParametro('id_ambitoprecio','id_ambitoprecio','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function autorizar_pm_acumulado_servicio_tecnico($id_mov){\r\n\r\nglobal $db;\t\r\n \r\n $db->starttrans();\r\n \r\n //traigo el deposito origen\r\n $sql = \"select deposito_origen from movimiento_material where id_movimiento_material = $id_mov\"; \r\n $res = sql($sql) or fin_pagina();\r\n $id_deposito_oriden = $res->fields[\"deposito_origen\"];\r\n \t \r\n //traigo el detalle de los movimientos a liberar \t \r\n $sql=\"select * from detalle_movimiento where id_movimiento_material=$id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n\r\n $comentario = \" Autorizacion de PM acumulado de servicio tecnico nro: $id_mov\";\r\n $id_tipo_movimiento = 7;\r\n\r\n //por cada detalle voy liberando las reservas del pm autorizado \r\n for($i=0;$i<$res->recordcount();$i++) {\r\n \t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n $cantidad = $res->fields[\"cantidad\"];\r\n $id_detalle_movimiento = $res->fields[\"id_detalle_movimiento\"];\r\n descontar_reserva($id_prod_esp,$cantidad,$id_deposito_oriden,$comentario,$id_tipo_movimiento,\"\",$id_detalle_movimiento,\"\");\r\n $res->movenext(); \r\n }//del for\r\n \t \r\n \t \r\n //Inserto la Mercaderia entrante en el stock de RMA \r\n $sql = \"select * from mercaderia_entrante where id_movimiento_material = $id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n\t\t\t \r\n\t\t\t \r\n $comentario = \"Producto de lista de mercaderia entrante del PM nro: $id_mov\";\r\n\t\t\t \r\n for($i=0;$i<$res->recordcount();$i++){\r\n\t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n\t $cantidad = $res->fields[\"cantidad\"];\r\n\t $descripcion = $res->fields[\"descripcion\"]; \t\r\n\t incrementar_stock_rma($id_prod_esp,$cantidad,\"\",$comentario,1,\"\",$descripcion,1,\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",$id_mov);\r\n\t $res->movenext();\r\n }//del \r\n $db->completetrans();\r\n\r\n }", "function autorizar_esp_pm_acumulado_servicio_tecnico($id_mov){\r\n\r\nglobal $db;\t\r\n \r\n $db->starttrans();\r\n \r\n //traigo el deposito origen\r\n $sql = \"select deposito_origen from movimiento_material where id_movimiento_material = $id_mov\"; \r\n $res = sql($sql) or fin_pagina();\r\n $id_deposito_oriden = $res->fields[\"deposito_origen\"];\r\n \t \r\n //traigo el detalle de los movimientos a liberar \t \r\n $sql=\"select * from detalle_movimiento where id_movimiento_material=$id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n\r\n $comentario = \" Autorizacion de PM acumulado de servicio tecnico nro: $id_mov\";\r\n $id_tipo_movimiento = 7;\r\n\r\n //por cada detalle voy liberando las reservas del pm autorizado \r\n for($i=0;$i<$res->recordcount();$i++) {\r\n \t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n $cantidad = $res->fields[\"cantidad\"];\r\n $id_detalle_movimiento = $res->fields[\"id_detalle_movimiento\"];\r\n descontar_reserva($id_prod_esp,$cantidad,$id_deposito_oriden,$comentario,$id_tipo_movimiento,\"\",$id_detalle_movimiento,\"\");\r\n $res->movenext(); \r\n }//del for\r\n \t \r\n \t \r\n //Inserto la Mercaderia entrante en el stock BS AS \r\n \r\n $sql = \"select * from mercaderia_entrante where id_movimiento_material = $id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n\t\t\t \r\n\t\t\t \r\n $comentario = \"Producto de lista de mercaderia entrante del PM nro: $id_mov, a travez de una Autorizacion Especial\";\r\n\t\t\t \r\n for($i=0;$i<$res->recordcount();$i++){\r\n\t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n\t $cantidad = $res->fields[\"cantidad\"];\r\n\t $descripcion = $res->fields[\"descripcion\"]; \r\n\t //el deposito origen es Buenos Aires que es igual a 2 segun la tabla general.depositos \r\n\t $deposito_origen='2';\r\n\t //el id_tipo_movimiento le hardcodeo uno de la tabla stock.tipo_movimiento\r\n\t $id_tipo_movimiento='13';\r\n\t //el ingreso del producto es a \"disponible\" por lo tanto la funcion no toma en cuenta los parametros que siguen\r\n\t $a_stock='disponible';\r\n\t agregar_stock($id_prod_esp,$cantidad,$deposito_origen,$comentario,$id_tipo_movimiento,$a_stock,$id_tipo_reserva,\"\",$id_detalle_movimiento,$id_licitacion,$nro_caso);\r\n\t $res->movenext();\r\n }//del for\r\n $db->completetrans();\r\n\r\n }", "function reg_Auto($mtl, $mar, $mod, $col, $ant, $pot, $vel, $pre) {\n\t\t\t$bit = false;\n\t\t\t$existe = $this->query_Registro('autos','matricula',$mtl);\n\t\t\tif ($existe) {\n\t\t\t\techo \"<script>alert('La clave para el Empleado ya se encuentra registrada, intente de nuevo.');</script>\";\n\t\t\t}else{\n\t\t\t\t$sql_add = \"INSERT INTO autos (matricula, marca, modelo, color, antiguedad, potencia, velocidad, precio)\" .\n\t\t\t\t\t\t\t\"VALUES ('\".$mtl.\"', '\".$mar.\"', '\".$mod.\"', '\".$col.\"', '\".$ant.\"', '\".$pot.\"', '\".$vel.\"', '\".$pre.\"')\";\n\t\t\t\t$res_add = $this->conn->query($sql_add);\t\t\n\t\t\t\tif ($res_add) {\n\t\t\t\t\t$bit = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $bit;\n\t\t\t$this->conn->close();\n\t\t}", "function set_tema($prop,$valor,$replace=TRUE){\n $CI =& get_instance();\n $CI->load->library('sistema');\n if($replace):\n $CI->sistema->tema[$prop] = $valor;\n else:\n if(!isset($CI->sistema->tema[$prop]))$CI->sistema->tema[$prop] = '' ;\n $CI->sistema->tema[$prop] .= $valor;\n endif;\n}", "function add_tt_1_alkes() {\n//\t\tif (! $this->get_permission('fill_this')) return $this->intruder();\n\t\tglobal $_POST, $adodb, $ses;\n\t\t$record = $_POST;\n\t\tforeach ($record as $k => $v) $record[$k] = trim($v);\n\n\t\t$rsx = $adodb->Execute(\"SELECT * FROM tt_1_alkes ORDER by no_tt DESC LIMIT 1\");\n\t\t$tahun_data = date('Y',$rsx->fields['date_insert']);\n\t\t$tahun_now = date('Y');\n\n\n\t\tif($rsx->fields['urut_no_tt'] == ''){\n\t\t\t$urut_no_tt = 1;\n\t\t}else{\n\t\t\tif($tahun_data == $tahun_now){\n\t\t\t\t$urut_no_tt = $rsx->fields['urut_no_tt'] + 1;\n\t\t\t}else{\n\t\t\t\t$urut_no_tt = 1;\n\t\t\t}\n\t\t}\n\n\t\t$sqly = \"SELECT\n\t\t\tsubdit\n\t\tFROM\n\t\t\tsubdit\n\t\tWHERE\n\t\t\tid_subdit = '\".$_POST['kode_subdit'].\"'\n\t\t\";\n\t\t//print $sqly;\n\t\t$lastno = $rsx->fields['urut_no_tt'];\n\t\t$lastno = $lastno[2].$lastno[3].$lastno[4].$lastno[5].$lastno[6];\n\t\t$lastno = intval($lastno);\n\t\t$lastno = $lastno + $urut_no_tt;\n\n\t\t$rsy = $adodb->Execute($sqly);\n\t\t$subdit = $rsy->fields['subdit'];\n\t\t$a = date('d-m/Y');\n\t\t$no = str_pad($lastno, 5, \"0\", STR_PAD_LEFT);\n\t\t$urut_no_tt = $subdit.\"/\".$no.\"/\".$a;\n\n \t\t$record['urut_no_tt'] = $urut_no_tt;\n\n\n\t\t$rs = $adodb->Execute(\"SELECT * FROM tt_1_alkes WHERE no_tt = '{$record['oldpkvalue']}'\");\n\t\tif ($rs && ! $rs->EOF) {\n\t\t\t$adodb->Execute($adodb->GetUpdateSQL($rs, $record, 1));\n\t\t\t$st = \"Updated\";\n\t\t} else {\n\t\t\t$record['insert_by'] = $ses->loginid;\n\t\t\t$record['date_insert'] = time();\n\t\t\t$rs = $adodb->Execute(\"SELECT * FROM tt_1_alkes WHERE no_tt = NULL\");\n\t\t\t$adodb->Execute($adodb->GetInsertSQL($rs, $record));\n\t\t\t$st = \"Added\";\n\t\t}\n\t\t//print_r($st);exit();\n\t\t$status = \"Successfull $st '<b>{$record['urut_no_tt']}</b>'\";\n\t\t$this->log($status);\n\n\t\t$_block = new block();\n\t\t$_block->set_config('title', 'Status');\n\t\t$_block->set_config('width', \"90%\");\n\t\t$_block->parse(array(\"*\".$status));\n\t\treturn $_block->get_str();\n\t}", "function add()\n\t{\n\t\t$data[\"title\"] = _e(\"Language\");\t\n\t\t$CFG = $this->config->item('language_configure');\n\t\t\n\t\t ## for check admin or not\t ##\t\n\t\t$data[\"response\"] = addPermissionMsg( $CFG[\"sector\"][\"add\"] );\t\t\t\n\t\t\t\t\t\n\t\t## Other auxilary variable ##\n\t\t$data['var'] = array();\t\t\t\t\n\t\t$data[\"top\"] = $this->template->admin_view(\"top\", $data, true, \"language\");\t\n\t\t$data[\"content\"] = $this->template->admin_view(\"language_add\", $data, true, \"language\");\n\t\t$this->template->build_admin_output($data);\n\t}", "public function add_tema($ln = null){\n if($ln != null){\n return $this->db->insert('temas', $ln);\n }\n }", "function autorizar_esp_ckd_pm_acumulado_servicio_tecnico($id_mov){\r\n\r\nglobal $db;\t\r\n \r\n $db->starttrans();\r\n \r\n //traigo el deposito origen\r\n $sql = \"select deposito_origen from movimiento_material where id_movimiento_material = $id_mov\"; \r\n $res = sql($sql) or fin_pagina();\r\n $id_deposito_oriden = $res->fields[\"deposito_origen\"];\r\n \t \r\n //traigo el detalle de los movimientos a liberar \t \r\n $sql=\"select * from detalle_movimiento where id_movimiento_material=$id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n\r\n $comentario = \" Autorizacion de PM acumulado de servicio tecnico nro: $id_mov\";\r\n $id_tipo_movimiento = 7;\r\n\r\n //por cada detalle voy liberando las reservas del pm autorizado \r\n for($i=0;$i<$res->recordcount();$i++) {\r\n \t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n $cantidad = $res->fields[\"cantidad\"];\r\n $id_detalle_movimiento = $res->fields[\"id_detalle_movimiento\"];\r\n descontar_reserva($id_prod_esp,$cantidad,$id_deposito_oriden,$comentario,$id_tipo_movimiento,\"\",$id_detalle_movimiento,\"\");\r\n $res->movenext(); \r\n }//del for\r\n \t \r\n \t \r\n //Inserto la Mercaderia entrante en el stock BS AS \r\n \r\n $sql = \"select * from mercaderia_entrante where id_movimiento_material = $id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n\t\t\t \r\n\t\t\t \r\n $comentario = \"Producto de lista de mercaderia entrante del PM nro: $id_mov, a travez de una Autorizacion Especial\";\r\n\t\t\t \r\n for($i=0;$i<$res->recordcount();$i++){\r\n\t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n\t $cantidad = $res->fields[\"cantidad\"];\r\n\t $descripcion = $res->fields[\"descripcion\"]; \r\n\t //el deposito origen es San Luis que es igual a 1 segun la tabla general.depositos \r\n\t $deposito_origen='1';\r\n\t //el id_tipo_movimiento le hardcodeo uno de la tabla stock.tipo_movimiento\r\n\t $id_tipo_movimiento='13';\r\n\t //el ingreso del producto es a \"disponible\" por lo tanto la funcion no toma en cuenta los parametros que siguen\r\n\t $a_stock='disponible';\r\n\t agregar_stock($id_prod_esp,$cantidad,$deposito_origen,$comentario,$id_tipo_movimiento,$a_stock,$id_tipo_reserva,\"\",$id_detalle_movimiento,$id_licitacion,$nro_caso);\r\n\t $res->movenext();\r\n }//del for\r\n $db->completetrans();\r\n\r\n }", "function berinamateman($teman){\n\t\t$this->nama_teman=$teman;\n\t}", "function agregarMiembroMC($data) {\n \t\n $apiKey = ''; // Llave de APi de Mailchimp, ejemplo: xxxxxxxxxxxxxxxxxxxx-us7\n $servidorMC = ''; // Sólo colocar la última parte de la llave, ejemplo: us7\n $lista = '' // Colocar el número de la lista a la que quieres suscribir al usuario\n\n \t$ch = curl_init('https://'. $servidorMC .'.api.mailchimp.com/3.0/lists/'. $lista .'/members/'.md5(strtolower($data['email_address'])));\n \tcurl_setopt($ch, CURLOPT_USERPWD, 'user:' . $apiKey);\n \tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_TIMEOUT, 10);\n \tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n \tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n \tcurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));\n \t$result = curl_exec($ch);\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n return $httpCode;\n \n }", "public function addPaketTo($UUID=''){\t\n\t\tif ($UUID!=null) {\n\t\t\t$this->cek_PaketTo($UUID);\n\t\t} else {\n\t\t\t$data['files'] = array(\n\t\t\t\tAPPPATH . 'modules/templating/views/v-data-notfound.php',\n\t\t\t\t);\n\n\t\t\t$data['judul_halaman'] = \"Bundle Paket\";\n\t\t\t#START cek hakakses#\n\t\t\t$hakAkses=$this->session->userdata['HAKAKSES'];\n\n\t\t\tif ($hakAkses =='admin') {\n\t // jika admin\n\t\t\t\tif ($babID == null) {\n\t\t\t\t\tredirect(site_url('admin'));\n\t\t\t\t} else {\n\t\t\t\t\t$this->parser->parse('admin/v-index-admin', $data);\n\t\t\t\t}\n\t\t\t} else if($hakAkses=='guru'){\n\t\t\t\tif ($babID == null) {\n\t\t\t\t\tredirect(site_url('guru/dashboard/'));\n\t\t\t\t} else {\n\t\t\t\t\t// notification\n\t\t\t\t\t$data['datKomen']=$this->datKomen();\n\t\t\t\t\t$id_guru = $this->session->userdata['id_guru'];\n // get jumlah komen yg belum di baca\n\t\t\t\t\t$data['count_komen']=$this->mkomen->get_count_komen_guru($id_guru);\n\n\t\t\t\t\t$this->parser->parse('templating/index-b-guru', $data);\n\t\t\t\t}\n\t\t\t}else{\n\t // jika siswa redirect ke welcome\n\t\t\t\tredirect(site_url('welcome'));\n\t\t\t}\n\t #END Cek USer#\n\t\t}\n\t}", "public function plus_abonados();", "public function SetMaqOp($data){\n\t\t$data = (array)$data;\n\t\t\t\t\t$command = \\Yii::$app->db_mysql;\n\t\t\t$result = $command->createCommand()->insert('maquina_operador',[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'maquina' => $data['maquina'], \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'operador' => $data['operador']\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t])->execute();\n\t\t\n\t}", "public function addShortcode()\n {\n WPShortcode::addShortCode('acoBolsista', $this->todo->getController('indicacao'), 'acoBolsistaShortcode');\n WPShortcode::addShortCode('acoVoluntario', $this->todo->getController('indicacao'), 'acoVoluntarioShortcode');\n WPShortcode::addShortCode('acoColaborador', $this->todo->getController('indicacao'), 'acoColaboradorShortcode');\n WPShortcode::addShortCode('pibexBolsista', $this->todo->getController('indicacao'), 'pibexBolsistaShortcode');\n WPShortcode::addShortCode('pibexVoluntario', $this->todo->getController('indicacao'), 'pibexVoluntarioShortcode');\n WPShortcode::addShortCode('pibexColaborador', $this->todo->getController('indicacao'), 'pibexColaboradorShortcode');\n }", "public function mass_add()\n {\n }", "function setAgregarUnPais(){\n\t\t$this->comienza_con++;\n\t}", "public function add_data_mahasiswa()\n\t{\n\t\t$save = $this->input->post('add_mahasiswa');\n\t\t$kelas = 't_kelas';\n\t\t$tahun = 't_tahun_akademik';\n\t\t$prodi = \"t_prodi\";\n\t\t$data['kelas'] = $this->m_aka->get_all($kelas);\n\t\t$data['tahun_aka'] = $this->m_aka->get_all($tahun);\n\t\t$data['prodi'] = $this->m_aka->get_all($prodi);\n\t\t$data['content'] = 'mahasiswa/tambah_mahasiswa';\n\t\t$this->load->view('content', $data);\n\t}", "function insertarMetodologia(){\n\t\t$this->procedimiento='gem.f_metodologia_ime';\n\t\t$this->transaccion='GEM_GEMETO_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('codigo','codigo','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function modificarMaquinaria(){\n\t\t$this->procedimiento='snx.ft_maquinaria_ime';\n\t\t$this->transaccion='SNX_MAQ_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_maquinaria','id_maquinaria','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('potencia','potencia','numeric');\n\t\t$this->setParametro('peso','peso','numeric');\n\t\t$this->setParametro('maquinaria','maquinaria','varchar');\n\t\t$this->setParametro('id_factorindexacion','id_factorindexacion','int4');\n\t\t$this->setParametro('id_tipopreciomaquinaria','id_tipopreciomaquinaria','int4');\n\t\t$this->setParametro('id_ambitoprecio','id_ambitoprecio','int4');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function addC(){\n \t$re = new DbManager();\n \t$result = $re -> addColumn();\n \tif ($result == true){\n \t\techo 'colone bien ajouter ';\n \t}\n }", "function insertarSolicitudMayor500000(){\n\t\t$this->procedimiento='mat.ft_solicitud_mayor_500000_ime';\n\t\t$this->transaccion='MAT_SMI_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('nro_po','nro_po','varchar');\n\t\t$this->setParametro('fecha_solicitud','fecha_solicitud','date');\n\t\t$this->setParametro('funcionario','funcionario','text');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('fecha_po','fecha_po','date');\n\t\t$this->setParametro('monto_dolares','monto_dolares','numeric');\n\t\t$this->setParametro('nro_tramite','nro_tramite','varchar');\n\t\t$this->setParametro('proveedor','proveedor','varchar');\n\t\t$this->setParametro('monto_bolivianos','monto_bolivianos','numeric');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "private function mettiOffertaInMercato() {\n\n $offerte = new MOfferte;\n\n $nomeRisorsaOfferta = $_POST['nomeRisorsaOfferta'];\n $quantitaOfferta = $_POST['quantitaOfferta'];\n $nomeRisorsaCercata = $_POST['nomeRisorsaCercata'];\n $quantitaCercata = $_POST['quantitaCercata'];\n\n $offerte->create(array(\n 'idutente' => (int) UtenteWeb::status()->user->id,\n 'risorsaofferta' => $nomeRisorsaOfferta,\n 'quantitaofferta' => (int) $quantitaOfferta,\n 'risorsacercata' => $nomeRisorsaCercata,\n 'quantitacercata' => (int) $quantitaCercata,\n ));\n }", "function auto_menguji_ta(){\n\t\t\t\t$ta = $this->session->userdata('kd_ta');\n\t\t\t\t$smt = $this->session->userdata('kd_smt');\n\n\t\t\t\t$data = $this->get_current_ujian_ta(2); //mengambil data menguji tugas akhir pada semester ini (2)\n\n\t\t\t\tforeach ($data as $ta) {\n\t\t\t\t\t$cek_nilai_mhs = $this->get_status_ta($ta['NIM']);\n\t\t\t\t\tif($cek_nilai_mhs){\n\t\t\t\t\t\t$nim = $ta['NIM'];\n\t\t\t\t\t\t$judul_ta = $ta['JUDUL'];\n\t\t\t\t\t\t$kd_kur_mhs = $this->kurikulum_mahasiswa($nim);\n\t\t\t\t\t\t$temp = $this->get_data_mhs($nim);\n\t\t\t\t\t\t$jenjang = $temp[0]['NM_JENJANG'];\n\t\t\t\t\t\t$prodi = $temp[0]['NM_PRODI'];\n\t\t\t\t\t\t$prodi = str_replace(\"'\", \"\", $prodi);\n\t\t\t\t\t\t$prodi = strip_tags($prodi);\n\n\t\t\t\t\t\t$list_mk = $this->api->get_api_json(\n\t\t\t\t\t\t\tURL_API_SIA.'sia_kurikulum/data_search',\n\t\t\t\t\t\t\t'POST',\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'api_kode'=>40000,\n\t\t\t\t\t\t\t\t'api_subkode' => 15,\n\t\t\t\t\t\t\t\t'api_search' => array($kd_kur_mhs)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tforeach ($list_mk as $mk) {\n\t\t\t\t\t\t\t$get_makul = strtoupper($mk['NM_MK']);\n\t\t\t\t\t\t\t$get_jenjang = strtoupper($mk['NM_PEND']);\n\t\t\t\t\t\t\tif($get_jenjang == \"S0\"){\n\t\t\t\t\t\t\t\tif($get_makul == \"TUGAS AKHIR\" || $get_makul == \"SKRIPSI\" || $get_makul == \"TUGAS AKHIR/SKRIPSI\" || $get_makul == \"SKRIPSI/TUGAS AKHIR\"){\n\t\t\t\t\t\t\t\t\t$jml_sks = $mk['SKS_MK'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}else if($get_jenjang == \"S1\"){\n\t\t\t\t\t\t\t\tif($get_makul == \"TUGAS AKHIR\" || $get_makul == \"SKRIPSI\" || $get_makul == \"TUGAS AKHIR/SKRIPSI\" || $get_makul == \"SKRIPSI/TUGAS AKHIR\"){\n\t\t\t\t\t\t\t\t\t$jml_sks = $mk['SKS_MK'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}else if($get_jenjang==\"S2\"){\n\t\t\t\t\t\t\t\tif($get_makul == \"TESIS\" || $get_makul == \"TESIS/TUGAS AKHIR\" || $get_makul == \"TUGAS AKHIR/TESIS\"){\n\t\t\t\t\t\t\t\t\t$jml_sks = $mk['SKS_MK'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}else if($get_jenjang==\"S3\"){\n\t\t\t\t\t\t\t\tif($get_makul == \"DISERTASI\" || $get_makul == \"DISERTASI/TUGAS AKHIR\" || $get_makul == \"TUGAS AKHIR/DISERTASI\"){\n\t\t\t\t\t\t\t\t\t$jml_sks = $mk['SKS_MK'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//BUAT NARASI + INPUT DATA KE DB + ADA CEK DUPLUKASI DATA :\n\n\t\t\t\t\t\t$narasi = \"Menguji Tugas Akhir \".$jenjang.\", Program Studi \".$prodi.\", Judul \".$judul_ta.\", \".$jml_sks.\" SKS\";\n\t\t\t\t\t\t$narasi = str_replace(\"'\", \"\", $narasi);\n\t\t\t\t\t\t$narasi = strip_tags($narasi);\n\t\t\t\t\t\t//$narasi = str_replace(\",\", \"\", $narasi);\n\t\t\t\t\t\t//$sks_rule = round($this->aturan_beban_sks2(strtoupper($jenjang), $jml_sks, 1, 'TUGAS_AKHIR'),2);\n\t\t\t\t\t\t$jml_mhs = 1;\n\n\t\t\t\t\t\t//ATURAN SKS_RULE UNTUK MENGUJI TA\n\t\t\t\t\t\t$kd_kat = '74'; //4 untuk menguji (sebagai ketua dan anggota)\n\t\t\t\t\t\tif($jenjang == 'S0'){\n\t\t\t\t\t\t\t//sks_rule sementara untuk menguji TA S0 \n\t\t\t\t\t\t\t//$sks_rule = round(($sks_rule*(0.5)), 2);\n\t\t\t\t\t\t\t$sks_rule \t= $this->sksrule->_nilai_sks($jml_mhs, 1003, 2);\n\t\t\t\t\t\t\t$kd_kat = '74';\n\t\t\t\t\t\t}elseif($jenjang == 'S1'){\n\t\t\t\t\t\t\t//sks_rule sementara untuk menguji TA S0 \n\t\t\t\t\t\t\t//$sks_rule = round(($sks_rule*(0.5)), 2);\n\t\t\t\t\t\t\t$sks_rule \t= $this->sksrule->_nilai_sks($jml_mhs, 1003, 2);\n\t\t\t\t\t\t\t$kd_kat = '74';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($jenjang == 'S2'){\n\t\t\t\t\t\t\t//$sks_rule = round(($sks_rule*(0.5)), 2);\n\t\t\t\t\t\t\t$sks_rule \t= $this->sksrule->_nilai_sks($jml_mhs, 1003, 3);\n\t\t\t\t\t\t\t$kd_kat = '74'; //74 untuk menguji sebagai anggota\n\t\t\t\t\t\t}elseif($jenjang == 'S3'){\n\t\t\t\t\t\t\t//$sks_rule = round(($sks_rule*(0.5)), 2);\n\t\t\t\t\t\t\t$sks_rule \t= $this->sksrule->_nilai_sks($jml_mhs, 1003, 4);\n\t\t\t\t\t\t\t$kd_kat = '74'; //74 untuk menguji sebagai anggota\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$smt = $this->session->userdata('kd_smt');\n\t\t\t\t\t\t$ta = $this->session->userdata('kd_ta');\n\n\t\t\t\t\t\t// $kd_jbk = 'A';\n\t\t\t\t\t\t$kd_dosen = $this->session->userdata('kd_dosen');\n\t\t\t\t\t\t$jenis_kegiatan = $narasi;\n\t\t\t\t\t\t/*$jenis_kegiatan ='test';*/\n\t\t\t\t\t\t$bukti_penugasan = '-';\n\t\t\t\t\t\t// $sks_penugasan = $sks_rule;\n\t\t\t\t\t\t$masa_penugasan = '1 Semester';\n\t\t\t\t\t\t$bkt_dokumen = '-';\n\t\t\t\t\t\t$kd_jbk \t\t= 'A';\n\t\t\t\t\t\t$bkt_penugasan \t= '-';\n\t\t\t\t\t\t$bkt_dokumen \t= '-';\n\t\t\t\t\t\t$rekomendasi \t= 'LANJUTKAN';\n\t\t\t\t\t\t$capaian \t\t= 100;\n\t\t\t\t\t\t$jml_jam \t\t= 1;\n\t\t\t\t\t\t$outcome \t\t= '-';\n\t\t\t\t\t\t$file_penugasan = '-';\n\t\t\t\t\t\t$file_capaian \t= '-';\n\t\t\t\t\t\t// $sks_bkt = $sks_rule;\n\t\t\t\t\t\t$thn = $this->session->userdata('ta');\n\t\t\t\t\t\tif($smt == 2) $semester = 'GENAP'; else $semester = 'GANJIL';\n\n\n\n\t\t\t\t\t\t//cek kemana data akan pergi :)\n\t\t\t\t\t\t$kewajiban_serdos = $this->cek_kewajiban_serdos($kd_dosen);\n\n\t\t\t\t\t\t$status_pindah = $this->get_status_pindah($kd_kat);\n\n\t\t\t\t\t\t$jalur_data = 0;\n\t\t\t\t\t\tif($status_pindah == 0){\n\t\t\t\t\t\t\t$jalur_data = $this->cek_jalur_data_kat($kd_kat);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$sts_pakai = 1;\n\t\t\t\t\t\tif($status_pindah == 0){\n\t\t\t\t\t\t\tif($kewajiban_serdos == 0){\n\t\t\t\t\t\t\t\t$sts_pakai = 0;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tif($jalur_data != 0){\n\t\t\t\t\t\t\t\t\t$sts_pakai = 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t//cek apakah sudah ada data atau belum ?\n\t\t\t\t\t\t $cek_mhs_bimbingan = $this->cek_api_mhs_ujian($nim);\n\n\t\t\t\t\t\t //cek nilai mahasiswa ta sudah ada apa belum :\n\t\t\t\t\t\t //$cek_nilai_mhs = $this->get_status_ta($nim);\n\t\t\t\t\t\t $cek_mhs_ujian_ta = $this->cek_api_data_pendidikan($kd_dosen, $ta, $smt, $kd_kat, $nim);\n\t\t\t\t\t\t $cek_status_ketua_ta = $this->cek_api_data_pendidikan($kd_dosen, $ta, $smt, '73', $nim);\n\t\t\t\t\t\t \n\t\t\t\t\t\t//if(!$cek_mhs_bimbingan){\n\t\t\t\t\t\tif(!$cek_mhs_ujian_ta && !$cek_status_ketua_ta){\n\n\t\t\t\t\t\t\t$api_url \t= URL_API_BKD.'bkd_beban_kerja/simpan_beban_kerja_sia_ta_maps';\n\t\t\t\t\t\t\t$parameter = array('api_search'=>array($kd_jbk, $kd_dosen, $jenis_kegiatan, $bkt_penugasan, $sks_rule, $masa_penugasan, $bkt_dokumen, $sks_rule, $thn, $semester, $rekomendasi, $jml_jam, $capaian, $outcome, $file_penugasan, $file_capaian, $ta, $smt, $sts_pakai));\n\t\t\t\t\t\t\t$simpan = $this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\t\t\t\t\t\t\tif($simpan){\n\n\t\t\t\t\t\t\t\t$getid = $simpan;\n\t\t\t\t\t\t\t\t$nm_keg = $jenis_kegiatan;\n\n\t\t\t\t\t\t\t\t$status_pindah = $this->get_status_pindah($kd_kat);\n\n\t\t\t\t\t\t\t\t$api_url \t= URL_API_BKD.'bkd_beban_kerja/simpan_data_pendidikan_ta';\n\t\t\t\t\t\t\t\t$parameter\t= array('api_search' => array($getid, $kd_kat, $nm_keg, $jenjang, '-', '1', $jml_sks, '1', '1', 'A', '1', $prodi, $nim, $status_pindah));\n\t\t\t\t\t\t\t\t$simpan = $this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\t\t\t\t\t\t\t\tif($simpan){\n\t\t\t\t\t\t\t\t\t//echo 'simpan ke data pendidikan sukses'; echo '<br>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\t\t\n\t\t}", "function berinamateman ($teman) {\n $this->nama_teman=$teman;\n }", "function agregarMarca()\r\n\t{\r\n\t\t$mkNombre= $_POST['mkNombre'];\r\n\t\t$link = conectar();\r\n\t\t// EDITOR DE TEXTO al seleccionar $mkNombre y click en ' encierra entre '' idem click en \" al pulsarla\r\n\t\t// No puedo dejar así una variable dentro de las comillas (aunque funcione) PERO ademas debe tener el SQL\r\n\t\t// las comillas que encierren el string\r\n\t\t$sql = \"INSERT INTO marcas (mkNombre) VALUE ('\" . $mkNombre . \"')\"; \r\n\t\t$resultado = mysqli_query ($link, $sql)\r\n\t\t\t\t\t\tor die(mysqli_error($link));\r\n\t\treturn $resultado; \t// true si insertó, false si falló\r\n\r\n\t\t/* si quisiera id y otras cosas las meto en un array para el return y uso el array AFUERA\r\n\t\tif ($resultado){\r\n\t\t\t$id = mysql_insert_id($link);\r\n\t\t\t$salida = [$resultado, $id, $ mkNombre];\r\n\t\t}\r\n\t\treturn $salida; \r\n\t\t*/\r\n\t}", "function cc_set_in_vetrina(){\n\t\n\t$path = ABSPATH . \"import/\";\n\t$file = FILE_XML_IMMOBILI; // nome del file\n\t$cometa = cc_get_unique_post_meta_values(\"_id_cometa\");\n\n\t$xml = @simplexml_load_file($path.$file);\t\n\n\tif($xml){\t\t\n\t\t\n\t\t$offerte = $xml->Offerte;\n\n\t\tif($offerte){\n\t\t\t\n\t\t\tforeach($offerte as $offerta){\n\t\t\t\t\n\t\t\t\t$idunique = (int) $offerta->Idimmobile; // campo univoco Cometa\n\t\t\t\t$post_id = array_search($idunique, $cometa);\n\t\t\t\t\n\t\t\t\tif(empty($post_id)) continue;\n\t\t\t\t\n\t\t\t\t$vetrina = (int) $offerta->Vetrina;\n\t\t\t\t\n\t\t\t\tupdate_post_meta( $post_id, \"fave_featured\", $vetrina );\n\n\t\t\t}\n\t\t\t\n\t\t\t$dbg = var_export($results, true);\n\t\n\t\t\tcc_import_immobili_error_log($dbg);\n\n\t\t\t\n\t\t}else{\n\t\t\tcc_import_immobili_error_log(\"no offerte!\");\n\t\t}\n\t\t\n\t}else{\n\t\tcc_import_immobili_error_log(\"no xml!\");\n\t}\n\t\n}", "function evt__agregar()\n\t{\n\t\t$this->set_pantalla('pant_edicion');\n\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}", "function transaccion_registrar_alumno($alumno, $matricula_alumno, $antecentes_alumno, $familiares_padre, $familiares_madre, $antecentes_familiares, $jefe_hogar, $apoderado)\n {\n $mensaje = new stdClass();\n $this->db->trans_begin();\n $id_alumno = $this->ingresar_alumno($alumno);\n\n $matricula_alumno[\"TB_ALUMNO_ID\"] = $id_alumno;\n $this->ingresar_matricula_alumno($matricula_alumno);\n $antecentes_alumno[\"TB_ALUMNO_ID\"] = $id_alumno;\n $this->ingresar_antecedentes_alumno($antecentes_alumno);\n $antecentes_familiares[\"TB_ALUMNO_ID\"] = $id_alumno;\n $this->ingresar_antecedentes_familiares_alumno($antecentes_familiares);\n $apoderado[\"TB_ALUMNO_ID\"] = $id_alumno;\n $this->ingresar_apoderado($apoderado);\n // todo --> Datos Opcionales Que pueden venir vacios\n $familiares_padre[\"TB_ALUMNO_ID\"] = $id_alumno;\n $this->ingresar_datos_familiar_alumno($familiares_padre);\n $familiares_madre[\"TB_ALUMNO_ID\"] = $id_alumno;\n $this->ingresar_datos_familiar_alumno($familiares_madre);\n $jefe_hogar[\"TB_ALUMNO_ID\"] = $id_alumno;\n $this->ingresar_jefe_hogar($jefe_hogar);\n // todo --> ----------------------------------------\n if ($this->db->trans_status() === FALSE) {\n $this->db->trans_rollback();\n $mensaje->respuesta = \"N\";\n $mensaje->data = \" No se pudo procesar la transacci�n\";\n } else {\n $this->db->trans_commit();\n }\n return $mensaje;\n }", "function meteo($saison, $temperature) {\n $debut = 'Nous sommes en ' . $saison;\n\n $suite = ' et il fait ' . $temperature . ' degré(s)';\n\n return $debut . $suite . '<hr>';\n }", "function berinamaTeman($teman){\r\n\t\t\t$this->nama_teman = $teman;\r\n\t\t}", "public function addPaketToTO(){\n\t\t$id_paket=$this->input->post('idpaket');\n\t\t$id_tryout=$this->input->post('id_to');\n\t\t\n\t\t//testing\n\t\t$dat_paket=array();\n\t\tforeach ($id_paket as $key) {\n\t\t\t$dat_paket[] = array(\n\t\t\t\t'id_tryout'=>$id_tryout,\n\t\t\t\t'id_paket'=>$key);\t\t\t\n\t\t}\n\t\t$this->Mtoback->insert_addPaket($dat_paket);\n\t}", "private function updateCustomMicroarticlesDelta() {\n $importedMaIds = $this->getMicroarticles(FALSE, ['uid' => 0]);\n\n $orderedMaTargets = [];\n if (!empty($importedMaIds)) {\n foreach ($importedMaIds as $id) {\n $orderedMaTargets[] = ['target_id' => $id];\n }\n\n $customMaIds = $this->getMicroarticles(FALSE, ['uid' => [0, '<>']]);\n foreach ($customMaIds as $id) {\n $orderedMaTargets[] = ['target_id' => $id];\n }\n\n $this->set('os2web_borgerdk_microarticles', $orderedMaTargets);\n }\n }", "function addUsuarios($USUAID, $USUANOMB, $USUAAPEL, $USUATELE, $USUAIDENT, $USUADIRE, $USUAEMAI, $USUAPASS, $USUAESTA, $ROLID, $CIUDID, $TIPOSID,$FECHACREA,$FECHAACTUALIZA,$USUAEMPR)\n\t{\n\t\t$sql = \"INSERT INTO usuarios VALUES(0,'$USUANOMB','$USUAAPEL','$USUATELE','$USUAIDENT','$USUAEMPR','$USUADIRE','$USUAEMAI','$USUAPASS','$CIUDID',$USUAESTA,$ROLID,$TIPOSID,'$FECHACREA','$FECHAACTUALIZA')\";\n\t\t///print_r($sql);\n\t\t$this->consult = $this->connection->Execute($sql);\n\n\t\treturn $this->consult;\n\t}", "public function attachMatkul(){\n return Mahasiswa::find(1)->mata_kuliah()->attach([3,4,6]);\n }", "function hieu($p_tuso, $p_mauso)\n {\n $ps = new PHAN_SO();\n $ps->khoitao_ps($p_tuso, $p_mauso);\n $ps->tuso = ($this->tuso*$ps->mauso) - ($ps->tuso*$this->mauso);\n $ps->mauso = $this->mauso*$ps->mauso;\n // $ps->toigian_ps();\n return $ps;\n }", "function addChiphi($MANT, $GiaNuoc, $GiaDien, $GiaGXe, $GiaWifi, $GiaRac)\n {\n $data = array('MANT' => $MANT, 'GiaNuoc' => $GiaNuoc, 'GiaDien' => $GiaDien, 'GiaGXe' => $GiaGXe, 'GiaWifi' => $GiaWifi, 'GiaRac' => $GiaRac);\n $this->db->insert('chiphi', $data);\n return $this->db->affected_rows();\n }", "public function free_add()\n\t\t{\n\t\t\t// $data['master_libur'] = $this->general->getData($data);\n\t\t\t// echo $data->judul;\n\t\t\t$this->general->load('absent/free/add');\n\t\t}", "function add_kunjungan_pasien($no_rm){\n $kunjungan = $this->db->query(\"select kunjungan from pasien where no_rm = '\".$no_rm.\"' \")->row()->kunjungan;\n \n $data = array(\n 'kunjungan' => ($kunjungan + 1)\n );\n\n $this->db->where('no_rm', $no_rm);\n $this->db->update('pasien',$data);\n }", "public function tambah_toko(){\n\t}", "public function nuevo()\n {\n log_message('DEBUG','#TRAZA | #TRAZ-PROD-TRAZASOFT | ETAPA | nuevo()');\n \n $this->load->model(TST.'Tareas');\n $this->Tareas->eliminarTareasSinOrigen(empresa());\n #Snapshot\n $user = userNick();\n $view = 'etapa/abm';\n $data['key'] = $view . $user;\n\n $data['fecha'] = date('Y-m-d');\n $data['id'] = $this->input->get('op');\n $data['etapa'] = $this->Etapas->nuevo($data['id'])->etapa;\n $data['idetapa'] = $data['etapa']->id;\n $data['accion'] = 'Nuevo';\n $data['op'] = $data['etapa']->titulo;\n\n $this->load->model(ALM . 'Articulos');\n #$data['materias'] = $this->Articulos->obtenerXTipos(array('Proceso', 'Final', 'Materia Prima'));\n // $data['productos'] = $this->Articulos->obtenerXTipos(array('Proceso', 'Producto'));\n\n #FORMULARIO GENERICO\n $data['form_id'] = $data['etapa']->form_id;\n\n #Obtener Proucto por Etapa\n $data['productos_etapa'] = $this->Etapas->obtenerArticulos($data['etapa']->id)['data'];\n $data['productos_entrada_etapa'] = $this->Etapas->getEntradaEtapa($data['etapa']->id)['data'];\n $data['formulas'] = $this->Formulas->getFormulas()->formulas->formula;\n $data['lang'] = lang_get('spanish', 5);\n $data['tareas'] = []; //$this->Tareas->listar()->tareas->tarea;\n $data['templates'] = []; //$this->Templates->listar()->templates->template;\n $data['establecimientos'] = $this->Establecimientos->listar($data['id'])->establecimientos->establecimiento; // listo\n $data['recursosmateriales'] = []; //;$this->Recursos_Materiales->listar()->recursos->recurso;\n $data['rec_trabajo'] = $this->Recursos->obtenerXTipo('TRABAJO')['data'];\n $this->load->view($view, $data);\n }", "protected function convertirMayuscula(){\n $cadena=strtoupper($this->tipo);\n $this->tipo=$cadena;\n }", "function evt__Agregar()\n\t{\n\t\t$this->tabla()->resetear();\n\t\t$this->set_pantalla('pant_edicion');\n\t}", "function wtsadd2caddie($ar){\n $dps = array();\n $dos = array();\n $persByType = array();\n $switchTo = array();\n $p = new XParam($ar, array());\n $oldcaddie = $this->getCaddie();\n $linesid = $p->get('lineid');\n $formparms = array('personpackid', 'validfrom', 'offreoid', 'productoid',\n 'card', 'CHIPID', 'ACCNO', 'CRC', 'assurance',\n 'NEWCARDLabel', 'joursbonus', 'justphotoidentnom',\n 'justphotoidentprenom', 'justphotoident', 'justphotoidentdob',\n 'justetatciv', 'justdomicile', 'justgrp', 'justgrpname','customercard');\n $lineparms = array('validfrom', 'offreoid', 'productoid');\n foreach($formparms as $parm){\n $$parm = $p->get($parm);\n }\n $season = $this->getSeason();\n $lines = array();\n $cptf = 1;\n foreach($linesid as $lineid){\n $id1 = date('dhis').$cptf.uniqid('_');\n $cptf ++;\n $line = array('type'=>'forfait');\n foreach($lineparms as $parm){\n $v = $$parm;\n if (isset($v[$lineid]))\n $line[$parm]=$v[$lineid];\n else\n $line[$parm]=NULL;\n }\n // passage d'options par prog seulement\n if (isset($ar['linesOptions'][$lineid])){\n $line['options'] = $ar['linesOptions'][$lineid];\n }\n // lecture du produit et des produits associés\n if (!isset($dps[$line['productoid']])){\n\t$dps[$line['productoid']] = $this->productInfos($line['productoid'], $line['validfrom']);\n\t// cause est utilisé directement ...\n\t$dpc = $dps[$line['productoid']]['dpc'];\n }\n // lecture des offre (la meme ... ) pour avoir le flash\n if (!isset($dos[$line['offreoid']])){\n $dos[$line['offreoid']] = $this->modcatalog->displayOffre(array('_options'=>array('local'=>true),\n\t\t\t\t\t\t\t\t\t'tplentry'=>TZR_RETURN_DATA,\n\t\t\t\t\t\t\t\t\t'offre'=>$line['offreoid'],\n\t\t\t\t\t\t\t\t\t'caddie'=>false)); // le stock importe pas ici\n }\n\n // remplacement du produit si existe (fidelite - voir wtssaisieforfaits)\n if ($this->modcustomer->loyaltyActive()){\n\n // carte du forfait (!! mêmes tests que dessous)\n $rpcard2 = substr($card[$lineid], 0, 8);\n if ($rpcard2 == 'NEWCARD_'){\n $rpwtp['cardoid'] = substr($card[$lineid], 8);\n $rpwtp['cardlabel'] = $NEWCARDLabel[$lineid];\n } elseif($card[$lineid] == 'WTPCARD'){\n //$rpnewwtp = strtoupper($CHIPID[$lineid].'-'.$CRC[$lineid].'-'.$ACCNO[$lineid]);\n $rpnewwtp = $this->modresort->formatWTPParts(array($CHIPID[$lineid], $CRC[$lineid], $ACCNO[$lineid]));\n $rpwtp['cardlabel'] = $rpnewwtp;\n $rpwtp['cardoid'] = NULL;\n } elseif(!empty($card[$lineid])){ \n $rpwtp['cardlabel'] = $NEWCARDLabel[$lineid];\n $rpwtp['cardoid'] = NULL;\n $rpcardid = $card[$lineid];\n if (isset($oldcaddie['bycards']) && $oldcaddie['bycards'][$rpcardid]['newcard'] !== false){\n $rplineid = $oldcaddie['bycards'][$rpcardid]['newcard'];\n $rpwtp['cardoid'] = $oldcaddie['lines'][$rplineid]['productoid'];\n }\n }\n\n list($loyaltymess, $loyaltyprice, $loyaltyProductOid) = $this->modcustomer->checkLoyaltyReplacementProduct(array('season'=>$season, 'doffre'=>$dos[$line['offreoid']]['doffre'], 'dp'=>$dps[$line['productoid']], 'dpc'=>$dps[$line['productoid']]['dpc'], 'validfrom'=>$line['validfrom'], 'availablesNewCards'=>$dps[$line['productoid']]['availablesNewCards'],'wtp'=>$rpwtp));\n if ($loyaltyProductOid != NULL){\n XLogs::notice(get_class($this), '::wtsadd2caddie replace product '.$line['productoid'].' -> '.$loyaltyProductOid.' '.$loyaltyprice);\n $ldps = $this->productInfos($loyaltyProductOid , $line['validfrom']);\n // on remplace ... \n \n $line['productoid'] = $loyaltyProductOid;\n $dps[$line['productoid']] = $ldps;\n } else {\n XLogs::notice(get_class($this), '::wtsadd2caddie no replacement product '.$line['productoid']);\n }\n }\n // top des des produtis non dates - date si rechargement\n $line['validfrom_hidden'] = 0;\n if ($dps[$line['productoid']]['dpc']['ocalendar']->link['otype']->raw == 'NO-DATE'){\n list($drech, $dnew, $dliv) = $this->getFirstDayNoDate(date('Y-m-d h:i:s'));\n $line['validfrom_hidden'] = 1;\n if ($card[$lineid] == 'WTPCARD'){\n $line['validfrom'] = $drech;\n $line['calendar-NO-DATE'] = 0;\n } else {\n $line['calendar-NO-DATE'] = 1;\n }\n }\n // ajout d'un top flash et de l'id de la vente\n if ($dos[$line['offreoid']]['doffre']['oflash']->raw == 1){\n $line['isflash'] = true;\n foreach($dos[$line['offreoid']]['doffre']['_flash']['ventes'] as $i=>$vente){\n if (in_array($line['validfrom'], $vente['dates'])){\n $line['flashoid'] = $vente['oid'];\n break;\n }\n }\n } else {\n $line['isflash'] = false;\n }\n // ajout de l'id packpersonne et du type de personne (pour la suppression)\n if (isset($personpackid[$lineid])){\n $line['ispersonpack'] = true;\n $line['personpackid'] = $personpackid[$lineid];\n // replacement type de personne suivant composition pack\n $personType = $dps[$line['productoid']]['owtsperson']->raw;\n $persByType[$personType]++;\n if ($dos[$line['offreoid']]['persons'][$personType]->switchTo && $dos[$line['offreoid']]['persons'][$personType]->switchLimit && $persByType[$personType] == $dos[$line['offreoid']]['persons'][$personType]->switchLimit) {\n $personType = $dos[$line['offreoid']]['persons'][$personType]->switchTo;\n if (!isset($switchTo[$personType])) {\n $switchTo[$personType] = selectQuery(\"select WTSCATALOG.koid from WTSCATALOG join WTSCATALOG c2 using (wtsticket) where WTSCATALOG.wtsperson='$personType' and c2.koid='{$line['productoid']}'\")->fetch(PDO::FETCH_COLUMN);\n // lecture du produit et des produits associés\n if (!isset($dps[$switchTo[$personType]])){\n $dps[$switchTo[$personType]] = $this->productInfos($switchTo[$personType], $line['validfrom']);\n // cause est utilisé directement ...\n $dpc = $dps[$switchTo[$personType]]['dpc'];\n }\n }\n $line['productoid'] = $switchTo[$personType];\n }\n $line['wtsperson'] = $personType;\n } else {\n $line['ispersonpack'] = false;\n $line['personpackid'] = NULL;\n $line['wtsperson'] = NULL;\n }\n // ajout des champs issus du produit etc ...\n $line['validtill'] = $this->getValidtill($line['validfrom'], $dps[$line['productoid']], $dps[$line['productoid']]['dpc']);\n $line['price'] = $dps[$line['productoid']]['price']['tariff'];\n $line['label'] = $dps[$line['productoid']]['label'];\n\n // ajout carte du forfait\n $line['cardid'] = $card[$lineid];\n $line['lineid'] = $lineid;\n\n // traitement des justifs (cartes ce/ coupons ..)\n if (isset($dpc['ojustgrps']) && $dpc['ojustgrps']->raw == 1){\n $line['justifgrps'] = $justgrpname[$lineid].' '.$justgrp[$lineid];\n }\n // traitement des pièces justficaves\n if ($dpc['ojustphotoident']->raw == 1 \n && $dps[$line['productoid']]['owtsticket']->link['oduree']->raw >= $dpc['ojustphotonbjour']->raw){\n $needphotoident = true;\n } else {\n $needphotoident = false;\n }\n if (($justphotoidentnom[$lineid] && $justphotoidentprenom[$lineid])\n\t || $justphotoidentdob[$lineid]\n\t || $dpc['ojustetatciv']->raw == 1\n\t || $dpc['ojustdomicile']->raw == 1\n\t || $needphotoident){\n\t$nom = $justphotoidentnom[$lineid];\n\t$prenom = $justphotoidentprenom[$lineid];\n\t$dob = $justphotoidentdob[$lineid];\n\tif ($this->dsjustifs == NULL)\n\t $this->dsjustifs = XDataSource::objectFactoryHelper8('BCLASS=XDSTable&SPECS='.self::$tableJUSTIFS);\n\t$jar = array('lineid'=>$lineid, 'nom'=>$nom, 'prenom'=>$prenom, 'dob'=>$dob, 'photoident'=>0, 'etatciv'=>0, 'domicile'=>0, 'customercard'=>0);\n\t// utilisation d'une carte client\n\tif (isset($customercard[$lineid])){\n\t $jar['customercard'] = $customercard[$line_id];\n\t if ($needphotoident){\n\t if (!isset($dscustomercards)){\n\t $dscustomercards = XDataSource::objectFactoryHelper8('BCLASS=XDSTable&SPECS='.self::$tableCUSTOMERCARDS);\n\t }\n\t $dcard = $dscustomercards->rdisplay($customercard[$lineid]);\n\t $tmpfile = TZR_TMP_DIR.uniqid('customercard');\n\t copy($dcard['ophoto']->filename, $tmpfile);\n\t $_FILES['justphotoident']['tmp_name'][$lineid] = $tmpfile;\n\t $_FILES['justphotoident']['type'][$lineid] = $dcard['ophoto']->mime;\n\t $_FILES['justphotoident']['name'][$lineid] = $dcard['ophoto']->originalname;\n\t $_FILES['justphotoident']['type'][$lineid] = filesize($tmpfile);\n\t }\n\t}\n\tif ($dpc['ojustetatciv']->raw == 1)\n\t $jar['etatciv'] = 1;\n\tif ($dpc['ojustdomicile']->raw == 1)\n\t $jar['domicile'] = 1;\n\tif ($dpc['ojustphotoident']->raw == 1){\n\t $jar['photoident'] = 1;\n\t}\n\t$justifoid = $this->saveJustif($jar);\n\t$line['justifoid'] = $justifoid;\n }\n // ajout des lignes cartes : NEWCARD = commander; WTPCARD = saisie du WTP; autres : id de cartes deja dans le panier\n // !!! NEWCARD_WTSCATLOG:xxx = ajouter nouvelle carte, NEWCARDuniqid = nouvelle carte du panier - sera rattachée\n // !!! on a la meme chose (ou presque pour le remplacement de produit)\n $card2 = substr($line['cardid'], 0, 8);\n if ($card2 == 'NEWCARD_'){\n $cardid = uniqid('NEWCARD');\n $line['cardid'] = $cardid;\n $cardoid = substr($card[$lineid], 8);\n // trouver le bon prix et intitulé des cartes en commande\n $cardok = 0;\n foreach($dps[$line['productoid']]['availablesNewCards'] as $acarddesc){\n if($cardoid == $acarddesc['oid']){\n $cardok=1;\n break;\n }\n }\n if ($cardok !== 1){ // on doit trouver !!! sauf si on enlève\n XLogs::notice(get_class($this), '::wtsadd2caddie erreur recherche produit carte');\n //die('An error occured'.$cardoid);\n // on cherche le prix directement (DSR : rp + produit public ...)\n $ct = $this->modcatalog->getProductTariff(NULL, $line['validfrom'], $cardoid);\n if ($ct['tariff'] == 'NOT FOUND'){\n XLogs::critical(get_class($this), '::wtsadd2caddie erreur recherche produit carte');\n die('An error occured'.$cardoid);\n } else {\n $acarddesc['price'] = $ct['tariff'];\n }\n }\n $lines[$id1.'_0000'] = array('linesid'=>$lineid, 'type'=>'carte',\n\t\t\t\t 'label'=>$NEWCARDLabel[$lineid], 'cardid'=>$cardid,\n\t\t\t\t 'productoid'=>$cardoid,\n\t\t\t\t 'price'=>$acarddesc['price']);\n //les cartes ne sont pas dans le pack car elle peuvent avoir d'autres forfaits dessus\n $line['cardlabel'] = $NEWCARDLabel[$lineid];\n\t/*saisie WTP */\n } elseif($line['cardid'] == 'WTPCARD'){\n $newwtp = $this->modresort->formatWTPParts(array($CHIPID[$lineid], $CRC[$lineid], $ACCNO[$lineid]));\n // regarder si cette carte n'est pas déjà dans le panier si oui recup de sont cardid\n $cardid = array_search($newwtp, $oldcaddie['cards']);\n if ($cardid === false)\n $cardid = uniqid('WTPCARD');\n $line['cardlabel'] = $newwtp;\n $line['cardid'] = $cardid;\n\t/* autres cas : cartes du panier (WTPCARDuniq ou cartes en commandes NEWCARuniqid)*/\n } elseif(!empty($line['cardid'])){ \n $line['cardlabel'] = $NEWCARDLabel[$lineid];\n $line['cardid'] = $card[$lineid];\n }\n // ajout des lignes assurances\n if (isset($assurance[$lineid])){\n $lines[$id1.'_0020'] = array('lineid'=>$lineid, 'type'=>'assurance',\n\t\t\t\t 'label'=>$dps[$line['productoid']]['assur']['label'],\n\t\t\t\t 'productoid'=>$dps[$line['productoid']]['assur']['oid'],\n\t\t\t\t 'price'=>$dps[$line['productoid']]['assur']['price'], \n\t\t\t\t 'options'=>array());\n if (isset($dps[$line['productoid']]['assur']['options'])){\n $lines[$id1.'_0020']['options'] = $dps[$line['productoid']]['assur']['options'];\n }\n $lines[$id1.'_0020']['ispersonpack'] = $line['ispersonpack'];\n $lines[$id1.'_0020']['personpackid'] = $line['personpackid'];\n }\n // ajout des lignes bonus et calcul du bonus\n if (isset($joursbonus[$lineid]) && $joursbonus[$lineid]>0){\n // calcul du forfait bonus\n list($rline, $bline) = $this->modloyalty->getForfaitBonus($line, $joursbonus[$lineid], $dps[$line['productoid']]);\n if ($bline != NULL && $rline != NULL){\n $bline['jours'] = $joursbonus[$lineid];\n // ev garder ... $line[$id1.'_0009'] = $line\n $bline['ispersonpack'] = $line['ispersonpack'];\n $bline['personpackid'] = $line['personpackid'];\n $line = $rline;\n $lines[$id1.'_0015'] = $bline;\n }\n if ($bline != NULL && $rline == NULL){\n $bline['ispersonpack'] = $line['ispersonpack'];\n $bline['personpackid'] = $line['personpackid'];\n $lines[$id1.'_0010'] = $bline;\n $line = NULL;\n }\n }\n if ($line != NULL){\n $lines[$id1.'_0010'] = $line;\n }\n }\n // ajout des lignes au caddie\n $this->addLines2Caddie($lines);\n }", "function autorizar_entregar_pm($id_movimiento_material) {\r\n global $_ses_user,$db,$id_stock_rma;\r\n \r\n\r\n //$db->StartTrans();\r\n $sql=\"select id_deposito from general.depositos where nombre='RMA-Produccion-San Luis' \";\r\n $res = sql($sql) or fin_pagina();\r\n $id_stock_rma = $res->fields[\"id_deposito\"];\r\n \r\n $titulo_pagina = \"Movimiento de Material\";\r\n $fecha_hoy = date(\"Y-m-d H:i:s\",mktime());\r\n \r\n \r\n $sql = \"select deposito_origen,deposito_destino from movimiento_material \r\n where id_movimiento_material = $id_movimiento_material\";\r\n $res = sql($sql) or fin_pagina();\r\n \r\n $deposito_origen = $res->fields[\"deposito_origen\"];\r\n $deposito_destino = $res->fields[\"deposito_destino\"];\r\n \r\n $sql = \" select id_detalle_movimiento,cantidad,id_prod_esp from detalle_movimiento \r\n where id_movimiento_material = $id_movimiento_material\";\r\n $detalle_mov = sql($sql) or fin_pagina();\r\n \r\n for($i=0; $i < $detalle_mov->recordcount(); $i++){ \t \r\n \t $id_detalle_movimiento = $detalle_mov->fields[\"id_detalle_movimiento\"];\t\r\n \t $cantidad = $detalle_mov->fields[\"cantidad\"];\r\n \t $id_prod_esp = $detalle_mov->fields[\"id_prod_esp\"];\r\n $sql = \"select id_recibidos_mov,cantidad\r\n from recibidos_mov where id_detalle_movimiento=$id_detalle_movimiento \r\n and ent_rec=0\";\r\n $detalle_rec = sql($sql) or fin_pagina();\r\n $id_recibido_mov = $detalle_rec->fields[\"id_recibidos_mov\"];\r\n\r\n if($id_recibido_mov==\"\") {\r\n\t \t //insert\r\n\t\t $sql = \"select nextval('recibidos_mov_id_recibidos_mov_seq') as id_recibido_mov\";\r\n\t\t $res_1 = sql($sql) or fin_pagina();\r\n\t\t $id_recibido_mov = $res_1->fields[\"id_recibido_mov\"];\r\n\t\t $sql=\"insert into recibidos_mov(id_recibidos_mov,id_detalle_movimiento,cantidad,ent_rec)\r\n\t\t values($id_recibido_mov,$id_detalle_movimiento,$cantidad,0)\";\r\n }else {\r\n\t //update\r\n\t $sql=\"update recibidos_mov set cantidad=cantidad+$cantidad\r\n\t where id_recibidos_mov=$id_recibido_mov\";\r\n }//del else\r\n sql($sql) or fin_pagina();\r\n $sql =\"insert into log_recibidos_mov(id_recibidos_mov,usuario,fecha,cantidad_recibida,tipo)\r\n values($id_recibido_mov,'\".$_ses_user[\"name\"].\"','$fecha_hoy',$cantidad,'entrega')\";\r\n sql($sql) or fin_pagina();\r\n //eliminamos las reservas hechas para este movimiento\r\n $comentario_stock=\"Utilización de los productos reservados por el $titulo_pagina Nº $id_movimiento\";\r\n $id_tipo_movimiento=7;\r\n descontar_reserva($id_prod_esp,$cantidad,$deposito_origen,$comentario_stock,$id_tipo_movimiento,$id_fila=\"\",$id_detalle_movimiento);\r\n //ahora incremento el stock destino\r\n \r\n if($deposito_destino==$id_stock_rma) {\r\n\t $comentario_rma=\"Ingreso de productos a RMA mediante el $titulo_pagina Nº $id_movimiento\";\r\n $tipo_log=\"Creacion MM Nº $id_movimiento\";\r\n $cb_insertados=array();\r\n $rma_san_luis = 1;\r\n incrementar_stock_rma($id_prod_esp,$cantidad,\"\",$comentario_rma,\"\",$cb_insertados,\"\",1,\"\",\"\",\"\",\"null\",\"\",$nro_caso,\"\",$tipo_log,\"\",$id_movimiento_material,$rma_san_luis);\r\n //guardamos el id de proveedor elegido para RMA, en la fila del PM o MM (en la tabla detalle_movimiento)\r\n /*\r\n $query=\"update mov_material.detalle_movimiento set id_proveedor=$id_proveedor_rma where id_detalle_movimiento=$id_detalle_movimiento\";\r\n sql($query,\"<br>Error al actualizar el proveedor de RMA del producto<br>\") or fin_pagina();\r\n */\r\n }\r\n else { \r\n $comentario = \" Ingreso de Productos mediante PM N°: $id_movimiento_material\";\r\n agregar_stock($id_prod_esp,$cantidad,$deposito_destino,$comentario,13,\"disponible\");\r\n } \r\n \r\n $detalle_mov->movenext(); \r\n }//del for\r\n \r\n}", "function add()\n\t{\n\t\t$data[\"title\"] = _e(\"Permission Modify\");\t\n\t\t$CFG = $this->config->item('permission_modify_configure');\n\t\t## for check admin or not\t##\t\n\t\t$data[\"response\"] = addPermissionMsg( $CFG[\"sector\"][\"add\"] );\n\t\t\t\t\t\n\t\t## Other auxilary variable ##\n\t\t$data['var'] = array();\t\t\t\t\n\t\t$data[\"top\"] = $this->template->admin_view(\"top\", $data, true, \"permission_modify\");\t\n\t\t$data[\"content\"] = $this->template->admin_view(\"permission_modify_add\", $data, true, \"permission_modify\");\n\t\t$this->template->build_admin_output($data);\n\t}", "public function add($_Marca,$_ID_Empresa,$_Logo){\n\t\t$array=array(\"Marca\"=>$_Marca,\"IDEmpresa\"=>$_ID_Empresa,\"logo\"=>$_Logo);\n\t\t$this->db->insert(\"marcas\",$array);\n\n\t}", "public function enregistrerMauvaisEssaiMDP() {\n\t\t\n\t\t$this->log->debug(\"Usager::enregistrerMauvaisEssaiMDP() Début\");\n\t\t\n\t\t// Incrémenter le compteur\n\t\t$nbEssais = $this->get(\"nb_mauvais_essais\");\n\t\t$nbEssais++;\n\t\t$this->set(\"nb_mauvais_essais\", $nbEssais);\n\t\t\n\t\t// Si plus du nombre d'essais maximum verrouiller le compte\n\t\tif ($nbEssais > SECURITE_NB_MAUVAIS_ESSAIS_VERROUILLAGE) {\n\t\t\t$this->set(\"statut\", 1);\t\n\t\t}\n\t\t\n\t\t// Enregistrer\n\t\t$this->enregistrer();\n\t\t\t\t\n\t\t$this->log->debug(\"Usager::enregistrerMauvaisEssaiMDP() Fin\");\n\t}", "function ativaEtiquetas($item)\n\t{\n\t\tif(!$this->layer){return \"erro\";}\n\t\t$this->layer->setmetadata(\"IDENTIFICA\",\"\");\n\t\t$this->layer->setmetadata(\"TIP\",$item);\n\t\treturn(\"ok\");\n\t}", "public function hapus_toko(){\n\t}", "function add($nombre, $apellidopaterno = \"\", $apellidomaterno = \"\",\n\t\t\t$rfc = \"\", $curp = \"\", $cajalocal = DEFAULT_CAJA_LOCAL,\n\t\t\t$fecha_de_nacimiento = false, $lugar_de_nacimiento = \"\",\n\t\t\t$tipo_de_ingreso = FALLBACK_PERSONAS_TIPO_ING, $estado_civil = DEFAULT_ESTADO_CIVIL,\n\t\t\t$genero = DEFAULT_GENERO, $dependencia = FALLBACK_CLAVE_EMPRESA, $regimen_conyugal = DEFAULT_REGIMEN_CONYUGAL,\n\t\t\t$personalidad_juridica = PERSONAS_FIGURA_FISICA, $grupo_solidario = DEFAULT_GRUPO, $observaciones = \"\",\n\t\t\t$identificado_con = 1, $documento_de_identificacion = \"0\", $codigo = false, $sucursal = false,\n\t\t\t$movil\t= \"\", $correo = \"\", $dependientes = 0, $fecha = false, $riesgo = AML_PERSONA_BAJO_RIESGO, $clave_fiel = \"\", \n\t\t\t$pais = EACP_CLAVE_DE_PAIS, $regimen_fiscal = DEFAULT_REGIMEN_FISCAL){\n\t\t$sucess\t\t\t\t\t= false;\n\t\t$xF\t\t\t\t\t\t= new cFecha();\n\t\t$xLoc\t\t\t\t\t= new cLocal();\n\t\t//$ql\t\t\t\t\t\t= new MQL();\n\t\t//Reparando\n\t\t$fecha_de_entrevista \t= $xF->getFechaISO($fecha);\n\t\t$fecha_de_alta\t\t\t= $xF->getFechaISO($fecha);\n\t\t$fecha_de_revision\t\t= $xF->getFechaISO($fecha);\n\t\t$estatus\t\t\t\t= FALLBACK_PERSONAS_ESTADO;\n\t\t$region\t\t\t\t\t= FALLBACK_PERSONAS_REGION;\n\t\t\n\t\t$nombre\t\t\t\t\t= addslashes($nombre);\n\t\t$apellidomaterno\t\t= addslashes($apellidomaterno);\n\t\t$apellidopaterno\t\t= addslashes($apellidopaterno);\n\t\t\n\t\t$nombre\t\t\t\t\t= utf8_decode( strtoupper($nombre) );\n\t\t$apellidopaterno\t\t= utf8_decode( strtoupper($apellidopaterno) );\n\t\t$apellidomaterno\t\t= utf8_decode( strtoupper($apellidomaterno) );\n\t\t$dependientes\t\t\t= setNoMenorQueCero($dependientes);\n\t\t$eacp\t\t\t\t\t= EACP_CLAVE;\n\t\t$sucursal\t\t\t\t= ($sucursal == false) ? getSucursal() : $sucursal;\n\t\t$usuario\t\t\t\t= getUsuarioActual();\n\t\t$codigo\t\t\t\t\t= ($codigo == false) ? $this->mCodigo : $codigo;\n\t\t$fecha_de_nacimiento\t= $xF->getFechaISO($fecha_de_nacimiento);\n\t\t$cajalocal\t\t\t\t= setNoMenorQueCero($cajalocal);\n\t\t$cajalocal\t\t\t\t= ($cajalocal == 0) ? $xLoc->getCajaLocal() : $cajalocal;\n\t\tif($codigo == false){\n\t\t\t$xCL\t\t\t\t= new cCajaLocal($cajalocal); $xCL->init();\n\t\t\t$codigo\t\t\t\t= $xCL->getUltimoSocioRegistrado(true)+1;\n\t\t\t$this->mCodigo\t\t= $codigo;\n\t\t}\n\t\t//purgar RFC\n\t\tif($pais == \"MX\"){\n\t\t\t$xMex\t= new cReglasDePais();\n\t\t\t$rfc\t= $xMex->getValidIDFiscal($rfc);\n\t\t\t\n\t\t}\n\t\t$rfc\t\t= ($rfc == \"\") ? DEFAULT_PERSONAS_RFC_GENERICO : $rfc;\n\t\t$sql = \"INSERT INTO socios_general(codigo, nombrecompleto, apellidopaterno, apellidomaterno, rfc, curp, \n\t\t\t\t\tfechaentrevista, fechaalta, estatusactual, region, cajalocal,\n\t\t\t\t\tfechanacimiento, lugarnacimiento, tipoingreso,\n\t\t\t\t\testadocivil, genero, eacp, observaciones, idusuario,\n\t\t\t\t\tgrupo_solidario, personalidad_juridica, dependencia,\n\t\t\t\t\tregimen_conyugal, sucursal, fecha_de_revision, tipo_de_identificacion, documento_de_identificacion,\n\t\t\t\t\tcorreo_electronico, telefono_principal, dependientes_economicos, pais_de_origen, nivel_de_riesgo_aml, clave_de_firma_electronica,\n\t\t\tregimen_fiscal)\n \t\t\tVALUES\n\t\t\t\t\t($codigo, '$nombre', '$apellidopaterno', '$apellidomaterno', '$rfc', '$curp',\n\t\t\t\t\t'$fecha_de_entrevista', '$fecha_de_alta', $estatus, $region, $cajalocal,\n\t\t\t\t\t'$fecha_de_nacimiento', '$lugar_de_nacimiento', $tipo_de_ingreso,\n\t\t\t\t\t$estado_civil, $genero, '$eacp', '$observaciones', $usuario,\n\t\t\t\t\t$grupo_solidario, $personalidad_juridica, $dependencia,\n\t\t\t\t\t'$regimen_conyugal', '$sucursal', '$fecha_de_revision', $identificado_con, '$documento_de_identificacion',\n\t\t\t\t\t'$correo', '$movil', $dependientes, '$pais', $riesgo, '$clave_fiel', $regimen_fiscal)\";\n\t\t\n\t\t$x\t\t\t= my_query($sql);\n\t\t$this->mCodigo\t= $codigo;\n\t\tif ($x[\"stat\"] == false){\n\t\t\t$this->mMessages .= \"ERROR\\tSe fallo al agregar la persona $codigo\\r\\n\";\n\t\t\t$sucess\t\t\t= false;\n\t\t} else {\n\t\t\t$this->mMessages .= \"OK\\tSe agrego el Socio $codigo con Nombre $nombre $apellidopaterno $apellidomaterno \\r\\n\";\n\t\t\t$this->init();\t\t//Iniciar\n\t\t\t//Agregar en la Tabla de Grupos Solidarios si aplica\n\t\t\t//2012-06-20 si es grupo y es persojna moral\n\t\t\tif ( $tipo_de_ingreso == TIPO_INGRESO_GRUPO AND $personalidad_juridica == PERSONAS_FIGURA_MORAL ){\n\t\t\t\t$xGrup\t\t= new cGrupo($codigo);\n\t\t\t\t$this->addToGrupos(DEFAULT_SOCIO, DEFAULT_SOCIO, $sucursal, $fecha);\n\t\t\t\t//$xGrup->add($nombre, \"\", DEFAULT_SOCIO, DEFAULT_SOCIO, 10, 1, $codigo, $sucursal, $fecha_de_alta, $codigo);\n\t\t\t\t//$this->mMessages .= \"OK\\tSe Agrega Nuevo Grupo con clave $codigo\\r\\n\";\n\t\t\t}\n\t\t\tif(MODULO_AML_ACTIVADO == true){\n\t\t\t\tif( $this->mNoAML == false ){\n\t\t\t\t\t\n\t\t\t\t\t//checar lista negra\n\t\t\t\t\t$xAml\t= new cAMLPersonas($codigo);\n\t\t\t\t\t$xAml->init($codigo);\n\t\t\t\t\t$ln\t\t= $xAml->getBuscarEnListaNegra($nombre, $apellidopaterno, $apellidomaterno);\n\t\t\t\t\tif($ln == true){\n\t\t\t\t\t\t$xCM\t= new cAML();\n\t\t\t\t\t\t$xCM->sendAlerts($codigo, AML_OFICIAL_DE_CUMPLIMIENTO, 901001, $xAml->getMessages());\n\t\t\t\t\t}\n\t\t\t\t\tif($pais != EACP_CLAVE_DE_PAIS){\n\t\t\t\t\t\t//verificar persona extranjera\n\t\t\t\t\t\t$xCM\t= new cAML();\n\t\t\t\t\t\t$xCM->sendAlerts($codigo, AML_OFICIAL_DE_CUMPLIMIENTO, 801009, \"PERSONA EXTRANJERA REGISTRADA\");\n\t\t\t\t\t}\n\t\t\t\t\tif($riesgo == AML_PERSONA_ALTO_RIESGO){\n\t\t\t\t\t\t//verificar persona extranjera\n\t\t\t\t\t\t$xCM\t= new cAML();\n\t\t\t\t\t\t$xCM->sendAlerts($codigo, AML_OFICIAL_DE_CUMPLIMIENTO, 901001, \"PERSONA ALTAMENTE RIESGOSA REGISTRADA\");\n\t\t\t\t\t}\n\t\t\t\t\t//buscar persona SDN\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sucess\t= true;\n\t\t}\n\t\treturn $sucess;\n\t}", "function addAlias()\r\n{\r\n\t// --------- GLOBALIZE ---------\r\n\tglobal $db,$user;\r\n\t// --------- CHECK ---------\r\n\tif ( !GET_INC('uid') )\r\n\t{\r\n\t\techo '请先登录';\r\n\t\treturn;\r\n\t}\r\n\t// --------- CONVERT TO INT ---------\r\n\t$id = intval(GET_INC('id'));\r\n\t$name = GET_INC('name');\r\n\t$dire = GET_INC('direction');\r\n\t$uid = intval(GET_INC('uid'));\r\n\t// --------- INSERT ---------\r\n\t$db->connDB();\r\n\t$db->query(\"INSERT INTO bus_sname VALUES ({$id},'{$name}',0,'{$dire}');\");\r\n\t$db->closeDB();\r\n\t// --------- ADD CREDIT ---------\r\n\t$user->add_credit('alias',1,$uid);\r\n}", "function addInformacije($data){\n\t\tglobal $db; global $_M;\n\t\t$data = mysql_real_escape_string($data);\n\n\t\t$db->e(\"UPDATE nalog SET nalog_informacije='\".$data.\"' WHERE nid='\".$_M->nid.\"';\");\n\t}", "function add(){\n\t\t\tif(!is_super_admin_login())\n\t\t\t\treturn $this->vista->acceso_restringido();\n if(!empty($this->params['programa'])){\n TPrograma::add($this->params['programa']);\n }\n }", "function wpopal_add_megamenu_setting() {\n}", "function update_tt_1_alkes() {\n\t\treturn $this->add_tt_1_alkes();\n\t}", "public function setoran_tunai()\n\t{\n\t\t$data['container'] = 'transaction/setoran_tunai';\n\t\t$data['rembugs'] = $this->model_cif->get_cm_data();\n\t\t$data['current_date'] = $this->format_date_detail($this->current_date(),'id',false,'/');\n\t\t$data['account_cash'] = $this->model_transaction->get_account_cash();\n\t\t$this->load->view('core',$data);\n\t}", "function add_smaakbeschrijvinglang_metabox(){\n\tadd_meta_box(\n\t\t'smaakbeschrijvinglang_metabox',//id\n\t\t'Lange smaakbeschrijving',//title\n\t\t'content_smaakbeschrijvinglang_metabox',//callback\n\t\t'smaak',//page\n\t\t'normal', //context\n\t\t'high'//priority\n\t\t);\n}", "public function addMo()\n\t{\n\t\n\t\t$this->Checklogin();\n\t\tif (isset($_POST ['btnSubmit']))\n\t\t{\n\t\n\t\t\t$data ['admin_section']='MO';\n\t\t\t$id=$this->setting_model->addMo();\n\t\t\tif ($id)\n\t\t\t{\n\t\t\t\t$this->session->set_flashdata('success','Mobile has been added successfully.');\n\t\t\t\tredirect('admin/setting/moRegistration');\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$this->session->set_flashdata('success','Unable to save mobile.');\n\t\t\t\tredirect('admin/setting/moRegistration');\n\t\t\t}\n\t\t} else\n\t\t{\n\t\t\tredirect('admin/setting/moRegistration');\n\t\t}\n\t\n\t}", "public function atualiza_tema($ln = array()){\n if(isset($ln['disciplina'])){\n $this->db->set('iddisciplinas', $ln['disciplina']);\n }\n if(isset($ln['nome'])){\n $this->db->set('nomeTema', $ln['nome']);\n }\n \n $this->db->where('idtema', $ln['id']);\n return $this->db->update('temas');\n }", "function fast_plugin_affiche_milieu($flux){\r\n\t$flux['data'] .= flux_data_fast_plugin('milieu');\r\n\treturn $flux;\r\n}", "public function marcarPunto( ) {\n $this->addNumeroIP(\".\");\n\n }", "function AddArtikelAuftrag($artikel,$auftrag)\n {\n\n }", "function addPOSEntry()\n{\n\n}", "private function sellTrasactionAddsMoney(){\n\n }", "public function addMember($v, $a, $e, $t) {\n \n //if (isset($v, $a, $e, $t)) {\n // echo \"Vul alle velden in.\";\n //}\n \n $v = $this->con->real_escape_string($v);\n $a = $this->con->real_escape_string($a);\n $e = $this->con->real_escape_string($e);\n $t = $this->con->real_escape_string($t);\n \n $sql = \"INSERT INTO inschrijvingen (voornaam, achternaam, email, telefoonnummer) VALUES ('$v','$a','$e','$t')\";\n $this->con->query($sql);\n \n }", "public function themmh($loai=\"\")\r\n {\r\n $khoa_result=$this->mmonhoc->get_khoa();\r\n $loai_monhoc_result=$this->mmonhoc->get_loai_monhoc();\r\n $nhom_monhoc_result=$this->mmonhoc->get_ma_monhoc_nhom();\r\n $data[\"khoa_result\"]=$khoa_result;\r\n $data[\"loai_monhoc_result\"]=$loai_monhoc_result;\r\n $data[\"nhom_monhoc_result\"]=$nhom_monhoc_result;\r\n $data[\"loai\"]=$loai; \r\n \r\n \r\n $data[\"data_title\"]=\"Thao tác thêm môn học\";\r\n \r\n \r\n $data[\"title\"]=\"Trang thêm môn học\"; \r\n $this->load->view(\"admin/vmonhoc_add\",$data); \r\n }", "public function engordar($quilos){\n $this->peso = $this->peso + $quilos;\n}", "public function modelDoAdd(){\n\t\t\t$tenphongban = $_POST[\"tenphongban\"];\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//chuan bi truy van\n\t\t\t$query = $conn->prepare(\"insert into phongban set tenphongban=:ten\");\n\t\t\t$query->execute(array(\"ten\"=>$tenphongban));\n\t\t}", "public function changeToOrdine()\n {\n\n //crea la tabella degli ordini verso i fornitori\n //Rielabora\n $preventivatore = $this->getPreventivatore();\n $result = $preventivatore->elabora();\n $imponibile = $result['prezzo_cliente_senza_iva'];\n $iva = $result['prezzo_cliente_con_iva'] - $result['prezzo_cliente_senza_iva'];\n $importo_trasportatore = $result['costo_trazione'];\n $importo_depositario = $result['deposito'];\n $importo_traslocatore_partenza = $result['costo_scarico_totale'] ;\n $importo_traslocatore_destinazione = $result['costo_salita_piano_totale'] + $result['costo_montaggio_totale'] + $result['costo_scarico_ricarico_hub_totale'];\n\n $totali = array();\n $totali[$this->id_trasportatore] = 0;\n $totali[$this->id_depositario] = 0;\n $totali[$this->id_traslocatore_destinazione] = 0;\n $totali[$this->id_traslocatore_partenza] = 0;\n\n $totaliMC = array();\n $totaliMC[$this->id_trasportatore] = 0;\n $totaliMC[$this->id_depositario] = 0;\n $totaliMC[$this->id_traslocatore_destinazione] = 0;\n $totaliMC[$this->id_traslocatore_partenza] = 0;\n\n\n $totali[$this->id_trasportatore] = $totali[$this->id_trasportatore] + $importo_trasportatore;\n $totali[$this->id_depositario] = $totali[$this->id_depositario] + $importo_depositario;\n $totali[$this->id_traslocatore_partenza] = $totali[$this->id_traslocatore_partenza] + $importo_traslocatore_partenza;\n $totali[$this->id_traslocatore_destinazione] = $totali[$this->id_traslocatore_destinazione] + $importo_traslocatore_destinazione;\n\n\n $mc = $preventivatore->getMC();\n\n $totaliMC[$this->id_trasportatore] = $totaliMC[$this->id_trasportatore] + $mc;\n $totaliMC[$this->id_depositario] = $totaliMC[$this->id_depositario] + $mc;\n $totaliMC[$this->id_traslocatore_destinazione] = $totaliMC[$this->id_traslocatore_destinazione] + $mc;\n $totaliMC[$this->id_traslocatore_partenza] = $totaliMC[$this->id_traslocatore_partenza] + $mc;\n\n $imponibile = round($totali[$this->id_trasportatore]/(1+ Parametri::getIVA()),2);\n $iva = round($totali[$this->id_trasportatore] - $imponibile,2);\n\n $ordine_trasportatore = new OrdineFornitore($this->id_preventivo, $this->id_trasportatore, $totali[$this->id_trasportatore], $imponibile, $iva, $totaliMC[$this->id_trasportatore], date('Y-m-d'), OrdineFornitore::TIPO_SERVIZIO_TRASPORTO);\n $ordine_trasportatore->save();\n\n $imponibile = round($totali[$this->id_traslocatore_partenza]/(1+ Parametri::getIVA()),2);\n $iva = round($totali[$this->id_traslocatore_partenza] - $imponibile,2);\n\n $ordine_traslocatore_partenza = new OrdineFornitore($this->id_preventivo, $this->id_traslocatore_partenza, $totali[$this->id_traslocatore_partenza], $imponibile, $iva, $totaliMC[$this->id_traslocatore_destinazione], date('Y-m-d'), OrdineFornitore::TIPO_SERVIZIO_TRASLOCO_PARTENZA);\n $ordine_traslocatore_partenza->save();\n\n $imponibile = round($totali[$this->id_traslocatore_destinazione]/(1+ Parametri::getIVA()),2);\n $iva = round($totali[$this->id_traslocatore_destinazione] - $imponibile,2);\n $ordine_traslocatore_destinazione = new OrdineFornitore($this->id_preventivo, $this->id_traslocatore_destinazione, $totali[$this->id_traslocatore_destinazione], $imponibile, $iva, $totaliMC[$this->id_traslocatore_partenza], date('Y-m-d'), OrdineFornitore::TIPO_SERVIZIO_TRASLOCO_DESTINAZIONE);\n $ordine_traslocatore_destinazione->save();\n\n if ($this->giorni_deposito>10) {\n $imponibile = round($totali[$this->id_depositario]/(1+ Parametri::getIVA()),2);\n $iva = round($totali[$this->id_depositario] - $imponibile,2);\n\n $ordine_depositario = new OrdineFornitore($this->id_preventivo, $this->id_depositario, $totali[$this->id_depositario], $imponibile, $iva, $totaliMC[$this->id_depositario], date('Y-m-d'), OrdineFornitore::TIPO_SERVIZIO_DEPOSITO);\n $ordine_depositario->save();\n }\n\n\n\n $data_ordine = date('Y-m-d');\n $con = DBUtils::getConnection();\n $sql =\"UPDATE preventivi SET tipo=\".OrdineBusiness::TIPO_ORDINE.\" , data='\".$data_ordine.\"' ,\n importo_commessa_trasportatore ='\".$totali[$this->id_trasportatore].\"',\n importo_commessa_traslocatore_partenza ='\".$totali[$this->id_traslocatore_partenza].\"',\n importo_commessa_traslocatore_destinazione ='\".$totali[$this->id_traslocatore_destinazione].\"',\n importo_commessa_depositario ='\".$totali[$this->id_depositario].\"',\n imponibile ='\".$imponibile.\"',\n iva ='\".$iva.\"'\n WHERE id_preventivo=\".$this->id_preventivo;\n\n $res = mysql_query($sql);\n //echo \"\\nSQL: \".$sql;\n DBUtils::closeConnection($con);\n\n return new OrdineCliente($this->id_preventivo);\n }", "public function add_fakul() {\r\n $data = array(\r\n 'KD_UNIV' => $this->get_kode_univ(),\r\n 'NM_FAKUL' => $this->get_nama(),\r\n 'ALMT_FAKUL' => $this->get_alamat(),\r\n 'TELP_FAKUL' => $this->get_telepon()\r\n );\r\n $this->validate();\r\n if (!$this->get_valid())\r\n return false;\r\n if (!is_array($data))\r\n return false;\r\n $this->db->insert($this->_table, $data);\r\n }", "function tambah()\n\t{\n\t\t$data['departemen'] = $this->Mdepartemen->tampil_departemen();\n\t\t//mengambil data dari fungsi tampil_pegawai\n\t\t$data['pegawai'] = $this->Mpegawai->tampil_pegawai();\n\t\t//mengambil data dari fungsi tampil_kategori\n\t\t$data['kategori'] = $this->Mkategori->tampil_kategori();\n\t\t//mengambil data dari fungsi tampil_hardware\n\t\t$data['hardware'] = $this->Mhardware->tampil_hardware();\n\n\t\t$data['judul'] = \"Form Tambah Hardware\";\n\t\t//Menampilkan form tambahhardware\n\t\t$this->theme->set_ui(\"admin/tambahhardware\", $data);\n\n\t\t//menyimpan inputan dari form tambahhardware\n\t\t$inputan = $this->input->post();\n\n\t\t//jika ada inputan dari form\n\t\tif($inputan)\n\t\t{\n\t\t\t//menjalankan fungsi simpan_hardware\n\t\t\t$this->Mhardware->simpan_hardware($inputan);\n\n\t\t\tredirect(\"admin/hardware\");\n\t\t}\n\t\t\n\n\t}", "function autorizar_producto_san_luis($id_mov){\r\n\r\nglobal $db;\t\r\n \r\n $db->starttrans();\r\n $fecha_hoy=date(\"Y-m-d H:i:s\",mktime());\r\n \r\n //traigo el deposito origen\r\n $sql = \"select deposito_origen,deposito_destino\r\n from movimiento_material where id_movimiento_material = $id_mov\"; \r\n $res = sql($sql) or fin_pagina();\r\n $id_deposito_origen = $res->fields[\"deposito_origen\"];\r\n $id_deposito_destino = $res->fields[\"deposito_destino\"];\r\n \t \r\n //traigo el detalle de los movimientos a liberar \t \r\n $sql=\"select * from detalle_movimiento where id_movimiento_material=$id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n\r\n $comentario = \" Autorizacion de PM Producto San Luis nro: $id_mov\";\r\n $id_tipo_movimiento = 7;\r\n\r\n //por cada detalle voy liberando las reservas del pm autorizado \r\n for($i=0;$i<$res->recordcount();$i++) {\r\n \t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n $cantidad = $res->fields[\"cantidad\"];\r\n $id_detalle_movimiento = $res->fields[\"id_detalle_movimiento\"]; \r\n ///////////////////////////////////////\r\n $sql = \"select id_recibidos_mov,cantidad\r\n from recibidos_mov where id_detalle_movimiento=$id_detalle_movimiento \r\n and ent_rec=0\";\r\n $detalle_rec = sql($sql) or fin_pagina();\r\n $id_recibido_mov = $detalle_rec->fields[\"id_recibidos_mov\"];\r\n if($id_recibido_mov==\"\") {\r\n\t \t //insert\r\n\t\t $sql = \"select nextval('recibidos_mov_id_recibidos_mov_seq') as id_recibido_mov\";\r\n\t\t $res_1 = sql($sql) or fin_pagina();\r\n\t\t $id_recibido_mov = $res_1->fields[\"id_recibido_mov\"];\r\n\t\t $sql=\"insert into recibidos_mov(id_recibidos_mov,id_detalle_movimiento,cantidad,ent_rec)\r\n\t\t values($id_recibido_mov,$id_detalle_movimiento,$cantidad,0)\";\r\n }else {\r\n\t //update\r\n\t $sql=\"update recibidos_mov set cantidad=cantidad+$cantidad\r\n\t where id_recibidos_mov=$id_recibido_mov\";\r\n }//del else\r\n sql($sql) or fin_pagina();\r\n $sql =\"insert into log_recibidos_mov(id_recibidos_mov,usuario,fecha,cantidad_recibida,tipo)\r\n values($id_recibido_mov,'\".$_ses_user[\"name\"].\"','$fecha_hoy',$cantidad,'entrega')\";\r\n sql($sql) or fin_pagina();\r\n /////////////////////////////////////// \r\n descontar_reserva($id_prod_esp,$cantidad,$id_deposito_origen,$comentario,$id_tipo_movimiento,\"\",$id_detalle_movimiento,\"\");\r\n $res->movenext(); \r\n }//del for\r\n \t \r\n //Inserto la Mercaderia entrante en el stock BS AS \r\n $sql = \"select * from mercaderia_entrante where id_movimiento_material = $id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n $comentario = \"Producto San Luis perteneciente al PM nro: $id_mov\";\r\n for($i=0;$i<$res->recordcount();$i++){\r\n\t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n\t $cantidad = $res->fields[\"cantidad\"];\r\n\t $descripcion = $res->fields[\"descripcion\"]; \r\n\t //el id_tipo_movimiento le hardcodeo uno de la tabla stock.tipo_movimiento\r\n\t $id_tipo_movimiento='13';\r\n\t //el ingreso del producto es a \"disponible\" por lo tanto la funcion no toma en cuenta los parametros que siguen\r\n\t $a_stock='disponible';\r\n\t agregar_stock($id_prod_esp,$cantidad,$id_deposito_destino,$comentario,$id_tipo_movimiento,$a_stock,$id_tipo_reserva,\"\",$id_detalle_movimiento,$id_licitacion,$nro_caso);\r\n\t $res->movenext();\r\n }//del for\r\n $db->completetrans();\r\n\r\n }", "public function add() \n { // metodo add, complementar\n $str = \"insert into \".self::$tablename.\"(nitHotel, idCiudad, nomHotel, dirHotel, telHotel1, telHotel2, correoHotel, tipoHotel, Administrador, idRedes, aforo, tipoHabitaciones, status)\";\n $str.= \" values ('$this->nitHotel', $this->idCiudad, '$this->nomHotel', '$this->dirHotel', '$this->telHotel1', '$this->telHotel2', '$this->correoHotel', $this->tipoHotel, '$this->Administrador', $this->idRedes, $this->aforo, $this->tipoHabitaciones, $this->status);\";\n }", "function addThemengebietes(){\n\t\t$status = $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_topic_detail', array('title'=>htmlentities(t3lib_div::_POST('title'),ENT_QUOTES, 'UTF-8')));\n\t\treturn $status;\n\t}", "function add_tt_1_alkes_form() {\n\t\tinclude_once 'class.xform.inc.php';\n\t\t//if (! $this->get_permission('fill_this')) return $this->intruder();\n\t\tglobal $_SESSION, $_GET, $adodb, $ses;\n\t\t$record = $_GET;\n\t\t$label_arr = $this->tt_1_alkes_label;\n\t\t$optional_arr = $this->optional_arr;\n\n\t\tif($_GET['no_tt']){$field_arr[] = xform::xf('urut_no_tt','C','255');}\n\t\t$field_arr[] = xform::xf('kode_subdit','C','255');\n\t\t$field_arr[] = xform::xf('kode_pendaftar','C','255');\n\t\t$field_arr[] = xform::xf('insert_by','C','255');\n\t\t$field_arr[] = xform::xf('date_insert','N','8');\n\t\t$field_arr[] = xform::xf('jenis_izin_produksi','N','8');\n\n\t\t$rs = $adodb->Execute(\"SELECT * FROM tt_1_alkes WHERE no_tt='{$record['no_tt']}'\");\n\t\tif ($rs && ! $rs->EOF) {\n\t\t\t$value_arr = $rs->fields;\n\t\t\t$optional_arr['no_tt'] = 'protect';\n\t\t\t$mode = 'edit';\n\n\t\t} else {\n\t\t\t$value_arr = array ();\n\t\t\t$mode = 'add';\n\t\t}\n\n\t\t$optional_arr['nama_tt_1_alkes_rule'] = '';\n\t\t$optional_arr['insert_by_rule'] = '';\n\t\t$optional_arr['date_insert_rule'] = '';\n\t\t\n\t\tglobal $adodb;\n\t\t$rsx = $adodb->Execute(\"SELECT no_tt FROM tt_1_alkes ORDER BY no_tt DESC LIMIT 1\");\n\t\t$no_ttx = $rsx->fields['no_tt'];\n\t\t$no_ttx = $no_ttx +1;\n\t\teval($this->save_config);\n\t\t$optional_arr['urut_no_tt'] = 'user_defined';\n\t\t$value_arr['urut_no_tt'] = '<input type=\"text\" name=\"urut_no_tt\" value=\"'.$value_arr['urut_no_tt'].'\" readonly class=\"text\">';\n\t\tif($value_arr['jenis_izin_produksi']==\"0\"){$select1 = \"selected\";$select2 = \"\";}else{if($value_arr['jenis_izin_produksi']==\"1\"){$select1 = \"\";$select2 = \"selected\";}else{$select1 = \"\";$select2 = \"\";}}\n\t\t$optional_arr['jenis_izin_produksi'] = 'user_defined';\n\t\t$value_arr['jenis_izin_produksi'] = '<select name=\"jenis_izin_produksi\" class=\"text\"><option>- Jenis Izin Produksi -</option><option value=\"0\" '.$select1.'>Izin Produksi Alkes</option><option value=\"1\" '.$select2.'>Izin Produksi PKRT</option></select>';\n\t\t$this->subdit_form($config);\n\t\t$this->pendaftar_form($config);\n\n\n\n\t\t$label_arr['submit_val'] = \"Submit\";\n\t\t$label_arr['form_extra'] = \"<input type=hidden name=action value='post$mode'>\"; // default null\n\t\t$label_arr['form_extra'] .= \"<input type=hidden name=oldpkvalue value='{$record['no_tt']}'>\";\n\t\t$label_arr['form_title'] = \"Form \".ucwords($mode).\" Tanda Terima Registrasi Izin Produksi\";\n\t\t$label_arr['form_width'] = '100%';\n\t\t$label_arr['form_name'] = 'theform';\n\n\t\t$_form = new form();\n\t\t$_form->set_config(\n\t\t\tarray (\n\t\t\t\t'field_arr'\t=> $field_arr,\n\t\t\t\t'label_arr'\t=> $label_arr,\n\t\t\t\t'value_arr'\t=> $value_arr,\n\t\t\t\t'optional_arr'\t=> $optional_arr\n\t\t\t)\n\t\t);\n\t\treturn $_form->parse_field();\n\t}", "public function setNameAdd($name = NULL ){\n\t\t$this->nameAddNew = $name ? $name : \"Adicionar \".$this->name;\n\t}", "function add_is_cetak_kartu($no_rm) {\n // update \n $data = $this->get_by_no_rm($no_rm);\n $update = array(\n 'is_cetak_kartu' => '1'\n );\n\n\n $this->db->where('no_rm', $no_rm);\n $this->db->update('pasien', $update);\n }", "function AddUSTIDPruefungKunde($kunde)\n {\n\n\n }", "public function matricular(Aluno $a){\n $this->alunos[] = $a;\n \n }", "public function test_medio_boleto_viaje_plus(){\n $tiempo = new Tiempo();\n $tiempo->avanzar(36000);\n $medio_boleto = new Tarjeta_Medio_Boleto( Null );\n $colectivo = new Colectivo( 'mixta', '133', 420 );\n\t\t\n $this->assertEquals( $medio_boleto->getViajesPlus(), 2 );\n\t\t\n $medio_boleto->pagarConTarjeta( $colectivo , $tiempo );\n $this->assertEquals( $medio_boleto->getViajesPlus(), 1 );\n\t\t\n $medio_boleto->gastarPlus();\n $this->assertEquals( $medio_boleto->getViajesPlus(), 0 );\n\t\t\n $boleto = $medio_boleto->pagarConTarjeta( $colectivo , $tiempo );\n $this->assertEquals( $boleto->getTipoBoleto(), 'Saldo Insuficiente' );\n }", "function addVivienda($calle, $numero_exterior, $codigo_postal = false, $numero_interior = \"\", $referencia = \"\", $telefono_fijo = \"0\", $telefono_movil = \"0\",\n\t\t\t$es_principal = false, $regimen = FALLBACK_PERSONAS_REGIMEN_VIV, $tipo = FALLBACK_PERSONAS_TIPO_VIV, $tiempo_de_residir = DEFAULT_TIEMPO, \n\t\t\t$colonia = \"\", $TipoDeAcceso = \"\", $gps = \"\",\n\t\t\t$clave_de_localidad = false, $clave_de_pais = EACP_CLAVE_DE_PAIS, \n\t\t\t$nombre_pais = \"\", $nombre_estado = \"\", $nombre_municipo = \"\", $nombre_localidad = \"\"){\n\t\t\n\t\t//$xViv\t\t\t\t= new cPersonasVivienda($this->getCodigo(), $tipo);\n\t\t\n\t\t$fechaalta \t\t\t= fechasys();\n\t\t$eacp\t\t\t\t= EACP_CLAVE;\n\t\t$socio\t\t\t\t= $this->mCodigo;\n\t\t$xT\t\t\t\t\t= new cTipos();\n\t\t$xLc\t\t\t\t= new cLocal();\n\t\t$xQL\t\t\t\t= new MQL();\n\t\t//depurar calle y numero 18Jul2013\n\t\t$calle\t\t\t\t= str_replace(\"CALLE\", \"\", strtoupper($calle));\n\t\t//Inicia al Socio 20120620\n\t\t$this->init();\n\t\t$DSocio\t\t\t\t= $this->getDatosInArray();\n\t\t$TipoDeIngreso\t\t= $DSocio[\"tipoingreso\"];\n\t\t$codigo_postal\t\t= setNoMenorQueCero($codigo_postal);\n\t\t$sucursal\t\t\t= getSucursal();\n\t\t$sucess\t\t\t\t= true;\n\t\t$usuario\t\t\t= getUsuarioActual();\n\t\t//Fixed\n\n\t\t\n\t\t\n\t\t$msg\t\t\t\t= \"\";\n\t\t$TipoDeAcceso\t\t= ($TipoDeAcceso == \"\") ? \"calle\" : $TipoDeAcceso;\n\t\t$clave_de_municipio\t= $xLc->DomicilioMunicipioClave();\n\t\t$clave_de_estado\t= $xLc->DomicilioEstadoClaveNum();\n\t\t$clave_de_localidad\t= setNoMenorQueCero($clave_de_localidad);\n\t\t$clave_de_pais\t\t= (trim($clave_de_pais) == \"\") ? EACP_CLAVE_DE_PAIS : $clave_de_pais;\n\t\t/* 1 part 2 fiscal 3 laboral*/\n\t\t//verifica los codigos postales\n\t\t$xCol\t\t\t\t= new cDomiciliosColonias();\n\t\tif($clave_de_pais == EACP_CLAVE_DE_PAIS){\n\t\t\tif( $xCol->existe($codigo_postal) == true){\n\t\t\t\t$estado\t\t\t\t\t= $xCol->getNombreEstado();\n\t\t\t\t$nombre_localidad\t\t\t\t= $xCol->getNombreLocalidad();\n\t\t\t\t$municipio\t\t\t\t= $xCol->getNombreMunicipio();\n\t\t\t\t$colonia\t\t\t\t= ( trim($colonia) == \"\" ) ? $xCol->getNombre() : $xT->cChar( $colonia );\t\n\t\t\t\t$clave_de_estado\t\t= $xCol->getClaveDeEstado();\n\t\t\t\t$clave_de_municipio\t\t= $xCol->getClaveDeMunicipio();\n\t\t\t\t$msg\t\t\t\t\t.= \"WARN\\t$socio\\tEl CP queda en $codigo_postal, Localidad en $nombre_localidad, municipio en $municipio, Colonia $colonia\\r\\n\";\n\t\t\t} else {\n\t\t\t\t$msg\t\t\t.= \"WARN\\tEL C.P.($codigo_postal) No existe, se carga el de la Caja Local\\r\\n\";\n\t\t\t\t\n\t\t\t\t\tif( SISTEMA_CAJASLOCALES_ACTIVA == true){\n\t\t\t\t\t\t$this->init();\n\t\t\t\t\t\t$xCL\t\t\t= new cCajaLocal($this->mCajaLocal);\n\t\t\t\t\t\t$DCols\t\t\t= $xCL->getDatosInArray();\n\t\t\t\t\t\t$codigo_postal\t\t= ( isset($DCols[\"codigo_postal\"]) ) ? setNoMenorQueCero(($DCols[\"codigo_postal\"])) : $xLc->DomicilioCodigoPostal();\n\t\t\t\t\t\t$msg\t\t\t.= \"WARN\\tSe obtiene el C.P. por caja Local ($codigo_postal) \\r\\n\";\n\t\t\t\t\t\tif( $xCol->existe($codigo_postal) == true){\n\t\t\t\t\t\t\t$estado\t\t\t\t\t= $xCol->getNombreEstado();\n\t\t\t\t\t\t\t$nombre_localidad\t\t\t\t= $xCol->getNombreLocalidad();\n\t\t\t\t\t\t\t$municipio\t\t\t\t= $xCol->getNombreMunicipio();\n\t\t\t\t\t\t\t$colonia\t\t\t\t= ( trim($colonia) == \"\" ) ? $xCol->getNombre() : $xT->cChar( $colonia );\n\t\t\t\t\t\t\t$clave_de_estado\t\t= $xCol->getClaveDeEstado();\n\t\t\t\t\t\t\t$clave_de_municipio\t\t= $xCol->getClaveDeMunicipio();\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif($codigo_postal <= 0){\n\t\t\t\t\t\t$msg\t\t\t.= \"ERROR\\tEL C.P.($codigo_postal) No existe, se carga el de la Sucursal\\r\\n\";\n\t\t\t\t\t\t$codigo_postal\t= $xLc->DomicilioCodigoPostal();\n\t\t\t\t\t}\n\t\n\t\t\t}\n\t\t} else {\n\t\t\t$clave_de_estado\t\t\t\t= FALLBACK_PERSONAS_DOMICILIO_ID_ESTADO;\n\t\t\t$clave_de_municipio\t\t\t\t= FALLBACK_PERSONAS_DOMICILIO_ID_MUNICIPIO;\n\t\t\tif($codigo_postal <= 0){\t$codigo_postal = 1; } \n\t\t}\n\n\t\t$xLoc\t\t\t\t\t= new cDomicilioLocalidad($clave_de_localidad);\n\t\tif( $clave_de_localidad <= 0 ){\n\t\t\t$clave_de_localidad\t= $xLoc->setBuscar($nombre_localidad, $clave_de_estado, $clave_de_municipio);\n\t\t\tif( setNoMenorQueCero($clave_de_localidad) <= 0 ){\n\t\t\t\t$clave_de_localidad\t\t\t= $xLc->DomicilioLocalidadClave();\n\t\t\t}\n\t\t\t$xLoc->set($clave_de_localidad);\n\t\t} else {\n\t\t\t$xLoc->init();\n\t\t}\n\t\t$nombre_localidad\t\t\t\t= ($nombre_localidad == \"\") ? $xLoc->getNombre() : $nombre_localidad;\n\t\t//Tipos de Acceso calle, avenida, callejon privada, andador\n\t\tif($nombre_pais == \"\"){\n\t\t\t$xPais\t= new cDomiciliosPaises($clave_de_pais);\n\t\t\t//$xPais->getPaisPorMoneda($moneda)\n\t\t\t$xTP\t= new cPersonas_domicilios_paises();\n\t\t\t$xTP->setData( $xTP->query()->initByID($clave_de_pais) );\n\t\t\t$nombre_pais\t= $xTP->nombre_oficial()->v();\n\t\t\t$municipio\t\t= ($nombre_municipo == \"\") ? $nombre_localidad : strtoupper($nombre_municipo);\n\t\t\t$estado\t\t\t= ($nombre_estado == \"\") ? $nombre_localidad : strtoupper($nombre_estado);\n\t\t}\n\t\t\n\t\t$estado\t\t\t\t= ($nombre_estado == \"\") ? $xLc->DomicilioEstado() : strtoupper($nombre_estado);\n\t\t$nombre_localidad\t= ($nombre_localidad == \"\") ? $xLc->DomicilioLocalidad() : strtoupper($nombre_localidad);\n\t\t$municipio\t\t\t= ($nombre_municipo == \"\") ? $xLc->DomicilioMunicipio() : strtoupper($nombre_municipo);\n\t\t\n\t\t$calle\t\t\t\t= setCadenaVal($calle);\n\t\t$colonia\t\t\t= setCadenaVal($colonia);\n\t\t$estado\t\t\t\t= setCadenaVal($estado);\n\t\t$nombre_localidad\t= setCadenaVal($nombre_localidad);\n\t\t$municipio\t\t\t= setCadenaVal($municipio);\n\t\t$sql\t\t= \"INSERT INTO socios_vivienda(socio_numero, tipo_regimen, calle, numero_exterior, numero_interior, colonia,\n\t\t\t\tlocalidad, estado, municipio, telefono_residencial, telefono_movil,\n\t\t\t\ttiempo_residencia, referencia, idusuario, principal, tipo_domicilio, codigo_postal,\n\t\t\t\tfecha_alta, codigo , sucursal,\n\t\t\t\teacp, coordenadas_gps, tipo_de_acceso, fecha_de_verificacion, oficial_de_verificacion, estado_actual, clave_de_localidad,\n\t\t\t\tclave_de_pais, nombre_de_pais)\n\t\t\t\tVALUES\n\t\t\t\t($socio, $regimen, '$calle', '$numero_exterior', '$numero_interior', '$colonia',\n\t\t\t\t'$nombre_localidad', '$estado', '$municipio', '$telefono_fijo','$telefono_movil',\n\t\t\t\t$tiempo_de_residir, '$referencia', $usuario, '$es_principal', $tipo, '$codigo_postal',\n\t\t\t\t'$fechaalta', $socio, '$sucursal',\n\t\t\t\t'$eacp', '$gps', '$TipoDeAcceso', '$fechaalta', $usuario, 99, $clave_de_localidad,\n\t\t\t\t'$clave_de_pais', '$nombre_pais')\";\n\t\t$sucess\t\t= $xQL->setRawQuery($sql);\n\t\tif ( $sucess != false ){\n\t\t\t$id\t\t\t\t\t= $xQL->getLastInsertID();\n\t\t\t$this->mIDVivienda\t= $id;\n\t\t\t$msg\t\t\t.= \"OK\\tSe agrega la Vivienda con ID $id CP $codigo_postal y Localidad $clave_de_localidad del pais $nombre_pais\\r\\n\";\n\t\t\t//Actualiza el Dato de Domicilio del Grupo Solidario\n\t\t\tif( ($TipoDeIngreso == TIPO_INGRESO_GRUPO) AND (intval($es_principal) == SYS_UNO) ){\n\t\t\t\t$xGrp\t= new cGrupo($this->mCodigo);\n\t\t\t\t$DDom\t= $this->getDatosDomicilio();\n\t\t\t\t$arrUp\t= array(\n\t\t\t\t\t\t\"direccion_gruposolidario\" => $this->getDomicilio(),\n\t\t\t\t\t\t\"colonia_gruposolidario\" => $DDom[\"colonia\"]\n\t\t\t\t);\n\t\t\t\t$xGrp->setUpdate($arrUp);\n\t\t\t\t$msg\t.= $xGrp->getMessages();\n\t\t\t}\n\t\t\t$this->setCuandoSeActualiza();\n\t\t}\n\t\t$this->mMessages\t.= $msg;\n\t\treturn $sucess;\n\t}", "public function semAulasDadas ($oTurma, $oEtapa) {\n\n $oTurma->getDisciplinas();\n\n $oDaoRegenciaPeriodo = db_utils::getDao(\"regenciaperiodo\");\n /**\n * Verificamos se a turma possui todos as aulas dos periodos de avaliacao informados\n */\n $sCamposRegPer = \" ed78_i_regencia,ed78_i_procavaliacao, \";\n $sCamposRegPer .= \" ed78_i_aulasdadas, trim(ed09_c_descr) as ed09_c_descr , ed232_c_descr, ed59_i_ordenacao\";\n $sWhereRegPer = \" ed59_i_turma = {$oTurma->getCodigo()} \";\n $sWhereRegPer .= \" AND ed59_i_serie = {$oEtapa->getCodigo()} AND ed59_c_freqglob !='A' \";\n $sWhereRegPer .= \" AND ed59_c_condicao = 'OB'\";\n $sSqlRegenciaPeriodo = $oDaoRegenciaPeriodo->sql_query_verifica_periodos(\"\",\n $sCamposRegPer,\n \"ed09_i_sequencia,ed59_i_ordenacao\",\n $sWhereRegPer\n );\n\n $rsRegenciaPeriodo = $oDaoRegenciaPeriodo->sql_record($sSqlRegenciaPeriodo);\n $lSemAulas = false;\n for ($x = 0; $x < $oDaoRegenciaPeriodo->numrows; $x++) {\n\n $oDadosRegencia = db_utils::fieldsmemory($rsRegenciaPeriodo, $x);\n if ($oDadosRegencia->ed78_i_aulasdadas == \"\") {\n\n $sMensagemPeriodo = \" nos períodos de aula \";\n if ($oDadosRegencia->ed09_c_descr != \"\") {\n $sMensagemPeriodo = \"no período {$oDadosRegencia->ed09_c_descr}\";\n }\n $sMensagem = \"Falta informar aulas dadas{$sMensagemPeriodo} \";\n if ($this->oLogger == null) {\n $sMensagem .= \" na disciplina {$oDadosRegencia->ed232_c_descr}\";\n }\n\n $oErroMensagem = new stdClass();\n $oErroMensagem->disciplina = $oDadosRegencia->ed232_c_descr;\n $oErroMensagem->turma = $oTurma->getCodigo();\n $oErroMensagem->mensagem = \"{$sMensagem}.\";\n $this->informarErro($oErroMensagem);\n $lSemAulas = true;\n }\n }\n return $lSemAulas;\n }", "function cnew_custom_metabox_add() {\r\n add_meta_box(\r\n 'cnew_custom_metabox_workshop', \r\n __( 'Informações da Oficina', 'cnew' ), \r\n 'cnew_workshop_custom_metabox_callback', \r\n 'cnew_workshop', \r\n 'normal',\r\n 'high'\r\n );\r\n\r\n add_meta_box(\r\n 'cnew_custom_metabox_registration', \r\n __( 'Formulário de Inscrição', 'cnew' ), \r\n 'cnew_registration_custom_metabox_callback', \r\n 'cnew_registration', \r\n 'normal',\r\n 'high'\r\n );\r\n }", "private function addTo(){\n\t\t$element = 'to';\n\t\t$options = array('required'=>false,'readonly' => true,'filters'=>array('StringTrim'),'label'=>'to');\n\t\t$this->addElement('text',$element,$options);\n\t\t//$prefix = array();\n\t\t//$decorator = array('DivForm');\n\t\t//$this->addCustomDecorator($prefix,$decorator,$element);\n\t\t$this->applyDecorator($element,true);\n\t\t$this->addToGroup($element);\n\t}", "public function add($model) {\n $model['nombre'] = mysql_escape_string(htmlentities(strip_tags($model['nombre'])));\n $model['empresa_id'] = $model['empresa_id'] + 0;\n $model['fecha_creacion'] = \"NOW()\";\n \n foreach($model['carreras'] as $k=>$v)\n $model['carreras'][$k] = $v + 0;\n\n $query = \"INSERT INTO {$this->con->prefTable}pasantias(NOMBRE,EMPRESA_ID,FECHA_CREACION) \" .\n \"VALUES('{$model['nombre']}','{$model['empresa_id']}',{$model['fecha_creacion']})\";\n $result = mysql_query($query, $this->con->link);\n if (!$result) {\n Utils::logQryError($query, mysql_error($this->con->link), __FUNCTION__, __CLASS__);\n return false;\n }\n if (mysql_affected_rows($this->con->link)) {\n //verificar la cantidad de carreras que aplica esta pasantia\n $values = \"\";\n $pasantia_id = mysql_insert_id($this->con->link);\n foreach ($model['carreras'] as $carrera_id) {\n if ($values != \"\")\n $values .= \",\";\n $values .= \"($pasantia_id,$carrera_id)\";\n }\n $query = \"INSERT INTO {$this->con->prefTable}pasantias_carreras(PASANTIA_ID,CARRERA_ID)\" .\n \" VALUES $values\";\n $result = mysql_query($query);\n if (!$result)\n Utils::logQryError($query, mysql_error($this->con->link), __FUNCTION__, __CLASS__);\n return true;\n }\n return false;\n }", "public static function transformatorUscatJT(){\n $joasaTensiune=array(\n \"loj\" => Converter::from('length.mm')->to('length.m')->convert(1.5)->getValue(),\n \"g_oj\" => Converter::from('length.mm')->to('length.m')->convert(1)->getValue(),\n //2*0.5carton mm\n \"aoj\" => Converter::from('length.mm')->to('length.m')->convert(10)->getValue(),\n );\n return $joasaTensiune;\n }", "function AgenteInsert($Nombre, $Contacto, $Notas, $NombreArchivo, $Uuid, $IdInmobiliaria) {\r\n\tglobal $Cfg;\r\n\r\n\t$sql = \"insert $Cfg[SqlPrefix]agentes set\r\n\t\tNombre = '$Nombre',\r\n\t\tContacto = '$Contacto',\r\n\t\tNotas = '$Notas',\r\n\t\tNombreArchivo = '$NombreArchivo',\r\n\t\tUuid = '$Uuid',\r\n\t\tIdInmobiliaria = $IdInmobiliaria\";\r\n\r\n\tDbExecuteUpdate($sql);\r\n\r\n\treturn DbLastId();\r\n}", "function setMeGustaId($id, $id_usuario, $valor_megusta) {\n $c = new Conexion();\n $resultado = $c->query(\"INSERT INTO valoracion_mg (`id`, `id_usuario`, `id_contenido`, `megusta`) VALUES (NULL, $id_usuario, $id, $valor_megusta)\");\n}", "function aggiungiNews($titolo,$cod_ut,$data,$testo)\n {\n $database=$this->database;\n // chiamata alla funzione di connessione\n $database->connetti();\n //nome della tabella\n $t = \"newsletter\"; \n //valori da inserire\n $v = array (\"$titolo\",\"$cod_ut\",\"$data\",\"$testo\"); \n //campi da popolare\n $r = \"titolo,codice_utente, data, testo\"; \n // chiamata alla funzione per l’inserimento dei dati\n $database->inserisci($t,$v,$r);\n \n // chiusura della connessione a MySQL\n $database->disconnetti(); \n \n }", "public function test_medio_boleto_trasbordo_plus(){\n $tiempo = new Tiempo();\n $tiempo->avanzar( 36000 );\n $medio_boleto = new Tarjeta_Medio_Boleto( Null );\n $colectivo = new Colectivo( 'mixta', '133', 420 );\n $colectivo2 = new Colectivo( 'mixta', '102', 421 );\n $medio_boleto->recargar( 50.0 );\n\t\t\n $boleto = $medio_boleto->pagarConTarjeta( $colectivo , $tiempo );\n $this->assertEquals( $boleto->getValor(), $this->getCostoMedioBoleto() );\n\t\t\n $medio_boleto->gastarPlus();\n $medio_boleto->gastarPlus();\n $tiempo->avanzar( 300 );\n\t\t\n $boleto = $medio_boleto->pagarConTarjeta( $colectivo2 , $tiempo );\n $this->assertEquals( $boleto->getValor(), $this->getCostoViaje()*2 );\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 addAction() {\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('groups', $groups);\n $this->assign(\"meunOn\", \"sys_user\");\n }", "function alta_unidad_m(){\n\t\t$u= new Unidad_medida();\n\t\t$u->fecha_alta=date(\"Y-m-d\");\n\t\t$u->estatus_general_id=1;\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$related = $u->from_array($_POST);\n\n\t\t// save with the related objects\n\t\tif($u->save($related))\n\t\t{\n\t\t\techo \"<html> <script>alert(\\\"Se han registrado los datos de la Unidad de Medida.\\\"); window.location='\".base_url().\"index.php/inicio/acceso/\".$GLOBALS['ruta'].\"/menu';</script></html>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}", "public function actionMasaze_i_tretmani()\n\t{\n\t $this->getLang();\n\t\t$this->base('masaze_i_tretmani');\n $this->naslovStranice = 'Masaže i Tretmani';\n\t\t$this->render('clanak');\n \n\t}", "function set_idioma($code = 'es')\n\t{\n\t\tif ($code != '' && $code != $this->config->item('language'))\n\t\t{\n\t\t\t$this->config->set_item('language', $code);//CAMBIO EL IDIOMA DEL CONFIG\n\t\t}\n\t\t$this->session->set_userdata('idioma',$code); //adicional por hector en 30/10/2013 para sol y luna\n\t\t$this->session->set_userdata('id_idioma',$this->idioma_model->get_id($code));//AGREGADO POR HECTOR\n\t}", "function maquetacioItemsAgendaHoudini($model, $columna, $nomCaixa, $tipusCaixa, $ordre, $estilCaixa, $estilLlistat, $estilElement, $id_registre, $id_newsletter, $registre, $pathEditora)\n{\n global $CONFIG_URLBASE , $CONFIG_URLUPLOADIM; \n $parametres = '<input type=\"hidden\" name=\"newsletter['.htmlspecialchars($model).']['.htmlspecialchars($columna).']['.htmlspecialchars($nomCaixa).']['.htmlspecialchars($tipusCaixa).'][]['.htmlspecialchars($estilCaixa).']['.htmlspecialchars($estilLlistat).']['.htmlspecialchars($estilElement).']\" value=\"'.htmlspecialchars($id_registre).'\" />';\n \n $registre['ORIGEN'] = '<h4><a href=\"'.$CONFIG_URLBASE . $pathEditora . $registre['ID'] . '/' . $registre['URL_TITOL'] . '\" rel=\"external\" style=\"text-decoration:none;\">'.$registre['TITOL'].'</a></h4>';\n $imatge = $registre['IMATGE1'] != '' ? '<img src=\"' . $CONFIG_URLUPLOADIM . $registre['IMATGE1'] . '\" style=\"width: 159px;\" class=\"left\"/>' : '';\n \n return '<li id=\"ageh_reg' . $id_registre . '\" class=\"box removable stylable '.$estilElement.'\">\n\t\t\t'.$parametres.'\n\t\t\t<div class=\"spacer clearfix\">\n\t\t\t ' . $imatge . '\n\t\t\t\t'.$registre['ORIGEN'].'\n\t\t\t\t'.$registre['RESUM'].'\n\t\t\t</div>\n\t\t</li>';\n}", "private function muatObjekFileMasukan()\n {\necho \"<br/><br/>**********MEMUAT UNIT STRING SESUAI UNIT STRING PILIHAN*********<br/><br/>\";\n for($i=0; $i < count($this->array_nama_file_masukan); $i++)\n {\n $objek = new Unit($this->array_nama_file_masukan[$i], $this->folderMasukan,$this->penanda_unit_string,$this->penanda_filter_token_entity);\n array_push($this->array_objek_unit, $objek);\n }\n }", "public function almacenarVenta($venta){\n if($venta>0){\n $this->ventas[]=$venta;\n }\n }" ]
[ "0.5607881", "0.55981183", "0.55648494", "0.5558524", "0.55545455", "0.55468494", "0.5539828", "0.55150074", "0.54974186", "0.5478723", "0.54755807", "0.5463267", "0.54545456", "0.54353255", "0.54344356", "0.54136294", "0.54089004", "0.54042214", "0.54027086", "0.54026973", "0.5362746", "0.5326358", "0.53228265", "0.5297248", "0.52824485", "0.52769375", "0.5272091", "0.52710193", "0.52329844", "0.5222922", "0.5220283", "0.5220139", "0.52131045", "0.5196114", "0.5195497", "0.5193214", "0.51877725", "0.5186663", "0.5177999", "0.5172842", "0.51711774", "0.5170066", "0.5157868", "0.51568234", "0.5152574", "0.51468575", "0.5136654", "0.51320654", "0.5127627", "0.511772", "0.51126903", "0.5111526", "0.51107496", "0.5098863", "0.5097106", "0.5091796", "0.5083626", "0.5082775", "0.50783366", "0.5076858", "0.50760376", "0.50720584", "0.5070276", "0.5068905", "0.506679", "0.50639826", "0.50639224", "0.5062521", "0.5057325", "0.50563455", "0.5056228", "0.50483567", "0.5041955", "0.5035565", "0.5032792", "0.5032041", "0.5025873", "0.50230634", "0.50213355", "0.50189006", "0.5017176", "0.50152266", "0.5013624", "0.5003963", "0.50024545", "0.50005454", "0.4999766", "0.49985346", "0.49947342", "0.4993984", "0.49939668", "0.49929324", "0.4992093", "0.49887004", "0.49811167", "0.49757868", "0.49651223", "0.49475303", "0.4947405", "0.49465308", "0.49394652" ]
0.0
-1
COLOCANDO CSS NOS BOTOES PREV E NEXT PAGE
function posts_link_attributes(){ return ' class="btn btn-primary float-right" '; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNextPage();", "function nextPrev($curpage, $pages) \n { \n $next_prev = \"\"; \n\n if (($curpage-1) <= 0) \n { \n $next_prev .= \"Previous\"; \n } \n else \n { \n $next_prev .= \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?page=\".($curpage-1).\"\\\" alt=\\\"Halaman sebelumnya ...\\\">Previous</a>\"; \n } \n\n $next_prev .= \" | \"; \n\n if (($curpage+1) > $pages) \n { \n $next_prev .= \"Next\"; \n } \n else \n { \n $next_prev .= \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?page=\".($curpage+1).\"\\\" alt=\\\"Halaman berikut ...\\\">Next</a>\"; \n } \n\n return $next_prev; \n }", "public function getPreviousPage();", "abstract protected function setPreviousPage();", "function page_navigation2($cpage=1,$url)\r\n{\r\n if($cpage<1||$cpage>$this->page_count) $cpage=1;\r\n if($cpage>1)\r\n {\r\n $before=$cpage-1;\r\n $str=\"<a href='\".str_replace(\"{page}\",$before,$url).\" '>Previous</a>\";\r\n }\r\n if($cpage<$this->page_count){\r\n\t$next=$cpage+1;\r\n\t$str.=\" <a href='\".str_replace(\"{page}\",$next,$url).\" '>Next</a> \";\r\n }\r\n $ib=($cpage-$this->prepage)>1?($cpage-$this->prepage):1 ;\r\n $ie=($cpage + $this->nextpage)<=$this->page_count ? ($cpage + $this->nextpage):$this->page_count; \r\n for($i=$ib;$i<=$ie;$i++){\r\n if($i== $cpage)\r\n $str .= \"&nbsp; <a href='\".str_replace(\"{page}\",$i,$url).\"'><font color=red>\".$i.\"</font></a>&nbsp;\";\r\n else{\r\n $str .= \"&nbsp; <a href='\".str_replace(\"{page}\",$i,$url).\"'>\".$i.\"</a>&nbsp;\";\r\n }\r\n }\r\n $str.='&nbsp;Total Records:'.$this->item_count;\r\nreturn $str;\r\n\r\n}", "private function prev() {\n if ($this->currentPage > 1) {\n print '<li><a href=\"' . $this->url . '&page=' . ($this->currentPage - 1) . '\">&lt;</a></li>';\n }\n }", "private function nextPage() {\n $this->lastPage = array(\n \"vOffset\" => $this->vOffset,\n \"hOffset\" => $this->hOffset,\n );\n $footerToAppend = false;\n $this->currentPageNumber++;\n if (isset($this->pages[$this->currentPageNumber])) {\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->vOffset = $this->currentFontSize;\n $this->hOffset = 0;\n } else {\n $this->pages[$this->currentPageNumber] = $this->haruDoc->addPage();\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->currentPage->setTextRenderingMode(\\HaruPage::FILL);\n $this->vOffset = $this->currentFontSize;\n $this->hOffset = ($this->hOffset ? $this->hOffset : 0);\n $footerToAppend = true;\n }\n if ($this->currentFont && $this->currentFontSize && $this->currentFontColor) {\n $this->currentPage->setFontAndSize($this->currentFont, $this->currentFontSize);\n $this->setColor($this->currentFontColor[0], $this->currentFontColor[1], $this->currentFontColor[2]);\n }\n if ($footerToAppend && $this->currentPageNumber > 1) {\n $this->currentPage->beginText();\n $this->setFont(self::FONT_NORMAL, 12, array(0,0,0));\n $this->currentPage->textOut($this->PAGE_WIDTH - self::HMARGIN - $this->currentPage->getTextWidth($this->currentPageNumber),\n self::VMARGIN - 30, $this->currentPageNumber);\n $this->revertFont();\n $this->setFont(self::FONT_BOLD, 12, array(0,0,0));\n $this->currentPage->textOut(self::HMARGIN,\n self::VMARGIN - 30, $this->currentBookName);\n $this->revertFont();\n $this->currentPage->endText();\n\n }\n\n }", "function register_block_core_comments_pagination_previous()\n {\n }", "function thb_single_prev_custom_pagination() {\n\t\t$post = get_previous_post();\n\n\t\tif ( $post == '' ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo \"<div class='thb-single-previous-nav-wrapper'>\";\n\t\t\techo \"<a href='\" . get_permalink( $post->ID ) . \"'>\";\n\t\t\t\techo \"<span>\" . __( 'Previous post', 'thb_text_domain' ) . \"</span>\";\n\t\t\t\techo \"<p class='thb-single-nav-title'>\" . thb_text_format( esc_html( $post->post_title ) ) . \"</p>\";\n\t\t\techo \"</a>\";\n\t\techo \"</div>\";\n\t}", "public function genPrevLink()\n\t{\n\t\t$this->pagination['prevLink'] = \"\";\t\n\t\tif($this->page > 1)\n\t\t{\n\t\t\t$page = $this->page-1;\n\t\t\t$item = $this->itemTpl;\n\t\t\t$item = str_replace(array('{pageclass}','{pagelink}', '{pagetext}'),\n\t\t\t\t\t\t\t\tarray('page page_prev',$this->prepend.$page.$this->append, '&lt;'),\n\t\t\t\t\t\t\t\t$item);\n\t\t\t$this->pagination['prevLink'] = $item;\n\t\t}\n\t}", "function firstArrow(){\n\t\tglobal $paged;\n\n\t\t\n\t\t// This firs set of if's ads the arrows to the pagination\n // if there are more than 2 pages and the page is outside the range, before show the <<\n\t\t \n if($paged > 2 && $paged > $this->range+1 && $this->count < $this->pages) \n\t\t {\n\t\t\t $this->content .= \"<li><a href='\".get_pagenum_link($page).\"'>&laquo;</a></li>\";\n\t\t }\n\t\t\t\t \n\t\t\n\t}", "public function PrevPage()\n {\n if ($this->m_CurrentPage <= 1)\n $this->m_CurrentPage = 1;\n else \n $this->m_CurrentPage--;\n return $this->ReRender();\n }", "function tinymce_nextpage( $mce_buttons ) {\n\t\t $pos = array_search( 'wp_more', $mce_buttons, true );\n\t\t if ( $pos !== false ) {\n\t\t\t $tmp_buttons = array_slice( $mce_buttons, 0, $pos + 1 );\n\t\t\t $tmp_buttons[] = 'wp_page';\n\t\t\t $mce_buttons = array_merge( $tmp_buttons, array_slice( $mce_buttons, $pos + 1 ) );\n\t\t }\n\t\t return $mce_buttons;\n\t }", "function prevPage() {\n\tglobal $activePages, $currentView, $currentArticle, $currentArticlePage;\n\t\n\t$root = '/' . $_GET['language'] . '/';\n\t\n\t// If we're on the home page, the prev button should be inactive\n\tif( $currentView == 'home' ) {\n\t\treturn false;\n\t}\n\t// If we're on the credits page, the prev button should point to the last article\n\telse if( $currentView == 'credits' ) {\n\t\treturn $root . getArrayLastIndex( $activePages );\n\t}\n\n\tif( empty(nextPrevArticleName('prev')) && $currentArticlePage == '1' ){\n\t\treturn $root;\n\t} elseif( $currentArticlePage == '1' ) {\n\t\treturn $root . nextPrevArticleName('prev') . '/' . $activePages[nextPrevArticleName('prev')]['numberOfPages'];\n\t} elseif($activePages[$currentArticle]['numberOfPages'] >= $currentArticlePage) {\n\t\treturn $root . $currentArticle . '/' . (string)($currentArticlePage-1);\n\t} else {\n\t\treturn $root . $currentArticle;\t\t\n\t}\n}", "function prevPage() {\n\t\treturn $this->hasPrevPage() ? $this->url(array('p' => $this->p + 1)) : null;\n\t}", "function render_block_core_comments_pagination_previous($attributes, $content, $block)\n {\n }", "function getPagingfront($refUrl, $aryOpts, $pgCnt, $curPg) {\n $return = '';\n $return.='<div class=\"pagination\"><ul>';\n if ($curPg > 1) {\n $aryOpts['pg'] = 1;\n $return.='<li class=\"prev\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\">First</a></li>';\n\n $aryOpts['pg'] = $curPg - 1;\n $return.='<li class=\"prev\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Prev</a></li>';\n }\n for ($i = 1; $i <= $pgCnt; $i++) {\n $aryOpts['pg'] = $i;\n $return.='<li><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"graybutton pagelink';\n if ($curPg == $i)\n $return.=' active';\n $return.='\" >' . $i . '</a></li>';\n }\n if ($curPg < $pgCnt) {\n $aryOpts['pg'] = $curPg + 1;\n $return.='<li class=\"prev\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Next</a></li>';\n $aryOpts['pg'] = $pgCnt;\n $return.='<li class=\"prev\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Last</a></li>';\n }\n $return.='</ul></div>';\n return $return;\n}", "function NewPage()\n {\n $ypos = $this->GetY();\n if ($ypos > 230){\n $this->AddPage();\n }\n }", "private function beginning()\n {\n if ($this->current_page - 1 >= 1) {\n return '<li><a href=\"' . ($this->current_page - 1) . '\">«</a></li>';\n } else {\n return '<li class=\"disabled\"><a href=\"#\">«</a></li>';\n }\n }", "function pagenavi( $p = 2 ) { // 取當前頁前後各 2 頁\r\n if ( is_singular() ) return; // 文章與插頁不用\r\n global $wp_query, $paged;\r\n $max_page = $wp_query->max_num_pages;\r\n if ( $max_page == 1 ) return; // 只有一頁不用\r\n if ( empty( $paged ) ) $paged = 1;\r\n echo '<span class=\"pages\">页面: ' . $paged . '/' . $max_page . ' </span> '; // 頁數\r\n if ( $paged > $p + 1 ) p_link( 1, '最前頁' );\r\n if ( $paged > $p + 2 ) echo '... ';\r\n for( $i = $paged - $p; $i <= $paged + $p; $i++ ) { // 中間頁\r\n if ( $i > 0 && $i <= $max_page ) $i == $paged ? print \"<span class='page-numbers current'>{$i}</span> \" : p_link( $i );\r\n }\r\n if ( $paged < $max_page - $p - 1 ) echo '... ';\r\n if ( $paged < $max_page - $p ) p_link( $max_page, '最後頁' );\r\n}", "public function prePageContent();", "function nextPage() {\n\t\treturn $this->hasNextPage() ? $this->url(array('p' => $this->p + 1)) : null;\n\t}", "static public function NavBarTop() {\n\t\t$show_back = (strlen(self::$prev_page) > 0);\n\t\t$show_home = (strlen(self::$first_page) > 0);\n\t\t$show_next = (strlen(self::$next_page) > 0);\n\n\t\tif (!$show_back && !$show_home && !$show_next) {\n\t\t\treturn null;\n\t\t}\n\n\t\techo '<div class=\"center\" style=\"margin-top:-12px;margin-bottom:-18px;height:30px;\">';\n\t\tif ($show_back) {\n\t\t\techo '<a href=\"', self::$prev_page, '\">';\n\t\t\techo '<img alt=\"', (self::isGerman() ? 'Zurück' : 'Back'), '\" title=\"', (self::isGerman() ? 'Zurück' : 'Back'), '\" class=\"arrow_left {PNGCSS}\" src=\"', self::getImageURL(), '/arrow_left.png\" width=\"30\" height=\"15\" />';\n\t\t\techo '</a>';\n\t\t}else {\n\t\t\techo '<img alt=\"dummy\" title=\"\" src=\"', self::getImageURL(), '/blank.gif\" width=\"30\" height=\"30\" />';\n\t\t}\n\t\tif ($show_home) {\n\t\t\techo '<a href=\"', self::$first_page, '\">';\n\t\t\techo '<img alt=\"', (self::isGerman() ? 'Inhalt' : 'Content'), '\" title=\"', (self::isGerman() ? 'Inhalt' : 'Content'), '\" class=\"arrow_content {PNGCSS}\" src=\"', self::getImageURL(), '/arrow_info.png\" width=\"30\" height=\"26\" />';\n\t\t\techo '</a>';\n\t\t}else {\n\t\t\techo '<img alt=\"dummy\" title=\"\" src=\"', self::getImageURL(), '/blank.gif\" width=\"30\" height=\"30\" />';\n\t\t}\n\t\tif ($show_next) {\n\t\t\techo '<a href=\"', self::$next_page, '\">';\n\t\t\techo '<img alt=\"', (self::isGerman() ? 'Weiter' : 'Next'), '\" title=\"', (self::isGerman() ? 'Weiter' : 'Next'), '\" class=\"arrow_right {PNGCSS}\" src=\"', self::getImageURL(), '/arrow_right.png\" width=\"30\" height=\"15\" />';\n\t\t\techo '</a>';\n\t\t}else {\n\t\t\techo '<img alt=\"dummy\" title=\"\" src=\"', self::getImageURL(), '/blank.gif\" width=\"30\" height=\"30\" />';\n\t\t}\n\t\techo '</div>';\n\t}", "function fc_pagination_prevpage($paged, $max_page, $prevpage) {\n if( $max_page > 1 && $paged > 1 )\n $pagingString = '<li class=\"prev\"><a href=\"'.get_pagenum_link($paged-1). '\">'.$prevpage.'</a></li>';\n return $pagingString;\n}", "public function getPreviousPageNumber(): int;", "public function gridSetPagesUrlPrev($url = ''){\n if(!empty($url)){\n $this->setVar('PAGES_URL_PREV', $url);\n $this->setVar('PREV_PAGE_TAG', __('Previuos page'));\n }\n }", "function render_block_core_query_pagination_previous($attributes, $content, $block)\n {\n }", "public function getNextPageUrl();", "public function getNextPageUrl();", "public function previousPage()\n {\n return$this->currentPage - 1;\n }", "function register_block_core_query_pagination_previous()\n {\n }", "private function lastPage() {\n $this->currentPageNumber--;\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->vOffset = $this->lastPage[\"vOffset\"];\n $this->hOffset = $this->lastPage[\"hOffset\"];\n }", "public function previous_page(){\n if($this->current_page > 1){\n return $this->current_page - 1;\n }\n else{\n return NULL;\n }\n }", "public function getNav() \n {\n //@return : $stri_html : affichage du html de la navigation\n \n\t\t$stri_html =\"\";\n \n //**** START - navigation previous\n //si la page précédente > 1 alors affichage du lien sinon affichage du label (if previous page > 1 then put link else label)\n\t\t$stri_html .= ($this->int_page_prev > 0) ? $this->obj_a_prev->htmlValue() : $this->obj_lb_prev->htmlValue(); \n\t\t$stri_html .= \" | \";\n\t\t//**** END - navigation previous\n\t\t\n\t\t\n //**** DEBUT corps navigator\n\n // calcule le milieu pour les liens de page dans le but d'avoir la page courante au centre de la navigation (determine the middle of link to post courant page in middle)\n\t\t$int_middle = floor($this->int_limit_page / 2);\n\n\t\t// calcule la page minimum à afficher dans les liens (determine the min page)\n $minpage = (($this->int_page - $int_middle)<1) ? 1 : $this->int_page - $int_middle;\t\t\n\n // calcule la page maximum à afficher dans les liens (determine the max page)\n\t\t$maxpage = (($this->int_page + $int_middle)> $this->int_pages)? $this->int_pages : ($this->int_page + $int_middle);\n\n // pour chaque lien de navigation (post each page)\n\t\tforeach (range($minpage, $maxpage) as $i) \n {\n\t\t\tif ($i == $this->int_page) \n { \n // selected page\n $this->obj_lb_courant_page->setValue($i);\n\t\t\t\t$stri_html .= $this->obj_lb_courant_page->htmlValue(); \n\t\t\t} \n else \n {\n // other page\n $this->obj_a_page->setValue($i);\n $this->obj_a_page->setOnClick(\"document.form_page.start.value=\".$i.\";document.form_page.submit();\");\n \n\t\t\t\t$stri_html.=\" \".$this->obj_a_page->htmlValue().\" \";\n\t\t\t}\n\t\t}\n\n //**** END corps navigation\n \n \n //**** START - navigation next\n //si la page suivante <= nb de pages alors affichage du lien sinon affichage du label (if next page <= number of page then put link else label)\n\t\t$stri_html .= \" | \";\n\t\t$stri_html .= ($this->int_page_next <= $this->int_pages) ? $this->obj_a_next->htmlValue() : $this->obj_lb_next->htmlValue(); \n //**** END - navigation next\n\n\t\treturn $stri_html;\n\t}", "function pb_single_next_prev() {\n\t// Only show on single post pages (not plants)\n\tif( !is_singular('post') ) {\n\t\treturn;\n\t}\n\n\t$previouspost_text = __( 'Older Posts', 'lean-kickstart' );\n\t$nextpost_text = __( 'Newer Posts', 'lean-kickstart' );\n\n\techo '<div class=\"archive-pagination pagination\">';\n\t\tprevious_post_link( '<div class=\"pagination-previous alignleft\">%link</div>', $previouspost_text );\n\t\tnext_post_link( '<div class=\"pagination-next alignright\">%link</div>', $nextpost_text );\n\techo '</div>';\n}", "public function prevpage() {\n return $this->current_page - 1;\n }", "static function page_previous($startpage, $config)\n {\n return static::page_link($startpage, $config, \"previous\");\n }", "private function getPaginatorType2($current_page = 0, $total_pages = 1, $conditions = \"\", $condition_encode = false){\n $cuppa = Cuppa::getInstance();\n $language = $cuppa->language->load();\n if($total_pages == 1) return \"\";\n $field = \"<div class='paginator'>\";\n //++ Page info\n if($this->pages_info)\n $field .= \"<div class='page_numbers'>\".$cuppa->language->getValue(\"Page\",$language).\" \".($current_page+1).\" \".$cuppa->language->getValue(\"of\",$language).\" \".$total_pages.\"</div>\";\n //--\n //++ Pages\n $field .= \"<div class='pages'>\";\n //++ Firs page\n if($current_page != 0)\n $field .= \"<a class='first_page' onclick='\".$this->function_name.\"(0,\\\"\".$this->submit_form.\"\\\",\\\"\".$this->limit.\"\\\")' ><span>\".$cuppa->language->getValue(\"First\",$language).\"</span></a>\";\n //--\n //++ add apges\n $j = 0;\n for($i = $current_page - $this->max_numbers; $i < $total_pages; $i++){\n if($i < 0) $i = 0;\n if($i > $current_page + $this->max_numbers) break;\n if($j > 0) $field .= \"<div class='separator'></div>\"; \n if($i == $current_page)\n $field .= \"<a class='page_item selected'><span>\".($i+1).\"</span></a>\";\n else \n $field .= \"<a class='page_item' onclick='\".$this->function_name.\"(\".$i.\",\\\"\".$this->submit_form.\"\\\",\\\"\".$this->limit.\"\\\")' ><span>\".($i+1).\"</span></a>\";\n $j++;\n }\n //--\n //++ Last page\n if($current_page+1 != $total_pages)\n $field .= \"<a class='last_page' onclick='\".$this->function_name.\"(\".($total_pages-1).\",\\\"\".$this->submit_form.\"\\\",\\\"\".$this->limit.\"\\\")' ><span>\".$cuppa->language->getValue(\"Last\",$language).\"</span></a>\";\n //--\n $field .= \"</div>\";\n //-- Pages\n $field .= \"</div>\";\n $field .= \"<input type='hidden' value='\".$current_page.\"' id='page' name='page' />\";\n $field .= \"<input type='hidden' value='' id='page_item_start' name='page_item_start' />\";\n if($condition_encode) $field .= '<input type=\"hidden\" id=\"conditions\" name=\"conditions\" value=\"'.base64_encode($conditions).'\"/>';\n else $field .= '<input type=\"hidden\" id=\"conditions\" name=\"conditions\" value=\"'.$conditions.'\"/>';\n return $field;\n }", "private function next() {\n if ($this->currentPage < $this->totalPage) {\n print '<li><a href=\"' . $this->url . '&page=' . ($this->currentPage + 1) . '\">&gt;</a></li>';\n }\n }", "function posts_next() \n\t{\n\t return 'class=\"red darken-2 btn z-depth-1\"';\n\t}", "function page_advance( $link, $total, $range, $current, $html = array() ) {\r\n $range = max(1, ceil($range));\r\n $total_page = ceil($total / $range);\r\n $current = max(0, ceil($current));\r\n $bar = \"\";\r\n\r\n $title = str_replace(array(\"{link}\", \"{from}\", \"{to}\", \"{total}\"), array($link, min(($current - 1) * $range + 1, $total), min($current * $range, $total), $total), $html['title']);\r\n\r\n if ( $current >= 3 ) {\r\n $bar .= str_replace(\"{link}\", $html['first']);\r\n }\r\n\r\n if ( $current >= 2 ) {\r\n $bar .= str_replace(array(\"{link}\", \"{i}\"), array($link, $current - 1), $html['pre']);\r\n }\r\n\r\n $bar .= $title;\r\n\r\n if ( $current <= $total_page - 2 ) {\r\n $bar .= str_replace(array(\"{link}\", \"{i}\"), array($link, $current + 1), $html['last']);\r\n }\r\n\r\n if ( $current < $total_page ) {\r\n $bar .= str_replace(array(\"{link}\", \"{i}\"), array($link, $current + 1), $html['next']);\r\n }\r\n\r\n return $bar;\r\n\r\n}", "function getPagingSup($refUrl, $aryOpts, $pgCnt, $curPg) {\n if (in_array('[__atuvc]', $aryOpts)) {\n unset($aryOpts[array_search('[__atuvc]')]);\n array_values($aryOpts);\n }\n $return = '';\n if ($curPg > 1) {\n $aryOpts['pg'] = 1;\n //$return.='<li class=\"pre\"><a href=\"'.$refUrl.getQueryString($aryOpts).'\">First</a></li>';\n\n $aryOpts['pg'] = $curPg - 1;\n $return.='<li ><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"pre\">Previous</a></li>';\n }\n for ($i = 1; $i <= $pgCnt; $i++) {\n $aryOpts['pg'] = $i;\n if ($pgCnt == $i && $curPg >= $pgCnt)\n $class.=' bordernone';\n $return.='<li class=\"' . $class . '\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"';\n if ($curPg == $i)\n $return.=' active';\n $return.='\" >' . $i . '</a></li>';\n }\n if ($curPg < $pgCnt) {\n $aryOpts['pg'] = $curPg + 1;\n $return.='<li class=\"last\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"nextal\">Next</a></li>';\n $aryOpts['pg'] = $pgCnt;\n //$return.='<li class=\"last\"><a href=\"'.$refUrl.getQueryString($aryOpts).'\" class=\"nextal\">Last</a></li>';\n }\n return $return;\n}", "function navigate_images($total) {\r\n\tglobal $section, $Image, $prev, $next, $end, $pg, $html_files\r\n\t , $CatBody, $css_files, $sec_url_php, $modal, $url_home\r\n\t\t , $pub_header_title, $pub_welcome_message, $pub_welcome_message2;\r\n\t$query = !empty($Image) ? '?file='.rawurlencode($Image).'&pg=' : '?pg=';\r\n\t$pages = $total <= $section ? 1 : ceil($total / $section);\r\n\t$p = '<li><a href=\"'.SELF.$query.$prev.'\">Prev</a></li>';\r\n\t$n = '<li><a href=\"'.SELF.$query.$next.'\">Next</a></li>';\r\n\t$c = '<li><p>Page '.$pg.' of '.$pages.'</p></li>';\r\n\t\r\n\t//echo('<div class=\"navigate_images\">'.\"\\r\\n\");\r\n\t//echo('<div class=\"left\">'.\"\\r\\n\".'<ul>'.\"\\r\\n\");\r\n\tif(($pg == 1 && $end >= $total)){\r\n\t\techo($c.\"\\r\\n\");\r\n\t}elseif($pg == 1){\r\n\t\t//echo($n.' '.$c);\r\n\t\techo ($n.\"\\r\\n\");\r\n\t\techo ($c.\"\\r\\n\");\r\n\t}elseif($end < $total){\r\n\t\techo($p.\"\\r\\n\");\r\n\t\techo($n.\"\\r\\n\");\r\n\t\techo($c.\"\\r\\n\");\r\n\t\t// echo($p.' '.$n.' '.$c);\r\n\t}else{\r\n\t\t//echo($p.' '.$c);\r\n\t\techo($p.\"\\r\\n\");\r\n\t\techo($c.\"\\r\\n\");\r\n\t}\r\n\t// print($c);\r\n\t// echo('</div>');\r\n\t// compensate for 1px style image borders, i feel dirty\r\n\t// $mainwidth = COLS * THMBWIDTH;\r\n\t//print('<div id=\"main\" style=\"width: '.$mainwidth.'px;\">'.\"\\r\\n\");\r\n\tinclude $html_files.'pageBody.html';\r\n\t//print('<div class=\"content\">'.\"\\r\\n\");\r\n\t//echo('<h2>Browse '.$CatBody.'</h2>'.\"\\r\\n\");\r\n}", "private function print_previous_page_link() {\n\n\t\t$this->print_anchor(\n\t\t\t$this->get_paged_url( max( 1, $this->current_page - 1 ) ),\n\t\t\t__( 'Go to the previous page', 'multilingual-press' ),\n\t\t\t'prev-page' . $this->disable_first,\n\t\t\t'&lsaquo;'\n\t\t);\n\t}", "function get_html_pre_page_end();", "function set_pagination(){\n\t\tif ($this->rpp>0)\n\t\t{\n\t\t\t$compensation= ($this->num_rowset % $this->rpp)>0 ? 1 : 0;\n\t\t\t$num_pages = (int)($this->num_rowset / $this->rpp) + $compensation;\n\t\t} else {\n\t\t\t$compensation = 0;\n\t\t\t$num_pages = 1;\n\t\t}\n\n\t\tif ($num_pages>1){\n\t\t\t$this->tpl->add(\"pagination\", \"SHOW\", \"TRUE\");\n\n\t\t\tfor ($i=0; $i<$num_pages; $i++){\n\t\t\t\t$this->tpl->add(\"page\", array(\n\t\t\t\t\t\"CLASS\"\t=> \"\",\n\t\t\t\t\t\"VALUE\"\t=> \"\",\n\t\t\t\t));\n\t\t\t\t$this->tpl->parse(\"page\", true);\n\t\t\t}\n\t\t}\n/*\n\t\t\t<patTemplate:tmpl name=\"pagination\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t<div class=\"pagination\">\n\t\t\t\t<ul>\t\n\t\t\t\t\t<patTemplate:tmpl name=\"prev_page\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t\t\t<li class=\"disablepage\"><a href=\"javascript: return false;\">« Предишна</a></li>\n\t\t\t\t\t</patTemplate:tmpl>\n\t\t\t\t\t<patTemplate:tmpl name=\"page\">\n\t\t\t\t\t<li {CLASS}>{VALUE}</li>\n\t\t\t\t\t</patTemplate:tmpl>\n<!--\n\t\t\t\t\t<li class=\"currentpage\">1</li>\n\t\t\t\t\t<li><a href=\"?page=1&sort=date&type=desc\">2</a></li>\n\t\t\t\t\t<li><a href=\"?page=2&sort=date&type=desc\">3</a></li>\n//-->\n\t\t\t\t\t<patTemplate:tmpl name=\"next_page\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t\t\t<li><a href=\"?page=1&sort=date&type=desc\">Следваща »</a></li>\n\t\t\t\t\t</patTemplate:tmpl>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t</patTemplate:tmpl>\n*/\n\t}", "public function previousPageUrl()\n {\n $this->resetQuery();\n\n if ($this->currentPage() > 2) {\n $this->appends('end', session()->get('accountant.api.end'));\n }\n\n return parent::previousPageUrl();\n }", "function honeycomb_paging_nav() {\n\t\tglobal $wp_query;\n\n\t\t$args = array(\n\t\t\t'type' \t => 'list',\n\t\t\t'next_text' => _x( 'Next', 'Next post', 'honeycomb' ),\n\t\t\t'prev_text' => _x( 'Previous', 'Previous post', 'honeycomb' ),\n\t\t\t);\n\n\t\tthe_posts_pagination( $args );\n\t}", "function thb_single_next_custom_pagination() {\n\t\t$post = get_next_post();\n\n\t\tif ( $post == '' ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo \"<div class='thb-single-next-nav-wrapper'>\";\n\t\t\techo \"<a href='\" . get_permalink( $post->ID ) . \"'>\";\n\t\t\t\techo \"<span>\" . __( 'Next post', 'thb_text_domain' ) . \"</span>\";\n\t\t\t\techo \"<p class='thb-single-nav-title'>\" . thb_text_format( esc_html( $post->post_title ) ) . \"</p>\";\n\t\t\techo \"</a>\";\n\t\techo \"</div>\";\n\t}", "public function loadPreviousPage()\n {\n $prevPage = $this->results->getPreviousPage();\n $this->search($prevPage);\n }", "private function compilePager() {\n \t\n \t\n \t$this->_tmp_page = '<p '.$this->_config['css_page'].'>';\n \tif ($this->_all_page > 1 && $this->_config['cur_page'] > 1) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].'1\">'.$this->_config['first'].'</a>';\n \t}\n \tif ($this->_all_page > 1 && $this->_config['cur_page'] > 1) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].($this->_config['cur_page'] - 1).'\">'.$this->_config['previous'].'</a>';\n \t}\n \t\n \tif ($this->_all_page <= $this->_config['scr_page']) {\n \tif($this->_config['all_recs'] <= $this->_config['per_page']) {\n \t$this->_start = 1;\n $this->_stop = $this->_all_page;\n } else {\n \t\t$this->_start = 1;\n $this->_stop = $this->_all_page;\n }\n } else {\n \tif($this->_config['cur_page'] < intval($this->_config['scr_page'] / 2) + 1) {\n\t $this->_start = 1; \n\t \t$this->_stop = $this->_config['scr_page'];\n } else {\n \t$this->_start = $this->_config['cur_page'] - intval($this->_config['scr_page'] / 2);\n $this->_stop = $this->_config['cur_page'] + intval($this->_config['scr_page'] / 2);\n if($this->_stop > $this->_all_page) $this->_stop = $this->_all_page;\n }\n }\n if ($this->_all_page > 1) {\n\t for ($i = $this->_start; $i <= $this->_stop; $i++) {\n\t \tif ($i == $this->_config['cur_page']) {\n\t \t$this->_tmp_page .= '<span '.$this->_config['act_page'].'>'.$i.'</span>';\n\t } else {\n\t $this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].$i.'\">'.$i.'</a>';\n\t }\n\t }\n }\n \n \tif ($this->_config['cur_page'] < $this->_all_page) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].($this->_config['cur_page'] + 1).'\">'.$this->_config['next'].'</a>';\n \t}\n \tif ($this->_config['cur_page'] < $this->_all_page) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].$this->_all_page.'\">'.$this->_config['last'].'</a>';\n \t}\n \treturn $this->_tmp_page.'</p>';\n }", "public function getLastPage() {}", "public function advanceLabelPage ()\r\n {\r\n $return = '';\r\n $this->label_column = 1;\r\n $this->label_row =1;\r\n ++$this->label_page;\r\n $return .= '\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"labelpage\">\r\n <div class=\"labelrow\">\r\n <div class=\"labelbody\">';\r\n return $return;\r\n }", "public function getNextPageNumber(): int;", "public function prePageHeader();", "public function fixPage(){\r\n\t\t$page=$this->_vars['current_page'];\r\n\t\t$total=$this->_vars['total_pages'];\r\n\t\tif ($page<=0){\r\n\t\t\t$page=$this->_vars['current_page']=1;\r\n\t\t}else if ($page>$total) {\r\n\t\t\t$page=$this->_vars['current_page']=$total;\r\n\t\t}\r\n\t\t$this->_vars['current_offset']=$page>0?(($page-1)*$show):0;\r\n\t\treturn $this;\r\n\t}", "public function previousPage() {\r\n\t\t$intReturn = ($this->getCurrentPage() - 1 > 0) ? ($this->getCurrentPage() - 1) : 1;\r\n\r\n\t\treturn $intReturn;\r\n\t}", "public function startNewPage()\n {\n }", "function style(){\r\n\t\tif (isset($_GET[\"page\"]) && is_numeric($_GET[\"page\"])) {\r\n\t\t\t$getPage = $_GET[\"page\"];\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$getPage = 0;\r\n\t\t}\r\n\t\techo \"#li\".$getPage.\"nk{color: #3e8958; text-decoration: underline;}\";\r\n\t}", "public function getPreviousPageUrl();", "public function getPreviousPageUrl();", "function page_counter($page, $total_pages, $limit, $path, $pn = '', $style = array()) {\n if (!$style[3])\n $style[3] = 'btn btn-mini btn-inverse';\n if (!$style[4])\n $style[4] = 'pagination';\n if (!$style[2])\n $style[2] = 'btn btn-mini';\n $pattern = '/page_' . $pn . '=(.*?)[\\&]/';\n $path = preg_replace($pattern, \"\", $path);\n\n if ($total_pages >= $limit) {\n\n $adjacents = \"2\";\n if ($page)\n $start = ($page - 1) * $limit;\n else\n $start = 0;\n\n if ($page == 0)\n $page = 1;\n $prev = $page - 1;\n $next = $page + 1;\n $lastpage = ceil($total_pages / $limit);\n $lpm1 = $lastpage - 1;\n\n\n $pagination = \"\";\n if ($lastpage > 1) {\n $pagination .= \"<div class='$style[4]'>\";\n if ($page > 1)\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=$prev'> &#171; </a>\";\n else\n $pagination.= \"<span class='disabled $style[2]'> &#171; </span>\";\n\n if ($lastpage < 7 + ($adjacents * 2)) {\n for ($counter = 1; $counter <= $lastpage; $counter++) {\n if ($counter == $page)\n $pagination.= \"<a href='\" . $path . \"page_$pn=$counter' class='$style[3]'>$counter</a>\";\n else\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=$counter'>$counter</a>\";\n }\n }\n elseif ($lastpage > 5 + ($adjacents * 2)) {\n if ($page < 1 + ($adjacents * 2)) {\n for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++) {\n if ($counter == $page)\n $pagination.= \"<a href='\" . $path . \"page_$pn=$counter' class='$style[3]'>$counter</a>\";\n else\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=$counter'>$counter</a>\";\n }\n $pagination.= \"...\";\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=$lpm1'>$lpm1</a>\";\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=$lastpage'>$lastpage</a>\";\n }\n elseif ($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2)) {\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=1'>1</a>\";\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=2'>2</a>\";\n $pagination.= \"...\";\n for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++) {\n if ($counter == $page)\n $pagination.= \"<a href='\" . $path . \"page_$pn=$counter' class='$style[3]'>$counter</a>\";\n else\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=$counter'>$counter</a>\";\n }\n $pagination.= \"..\";\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=$lpm1'>$lpm1</a>\";\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page=$lastpage'>$lastpage</a>\";\n }\n else {\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=1'>1</a>\";\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=2'>2</a>\";\n $pagination.= \"..\";\n for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++) {\n if ($counter == $page)\n $pagination.= \"<a href='\" . $path . \"page_$pn=$counter' class='$style[3]'>$counter</a>\";\n else\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=$counter'>$counter</a>\";\n }\n }\n }\n\n if ($page < $counter - 1)\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=$next'> &#187; </a>\";\n else\n $pagination.= \"<span class='disabled $style[2]'> &#187; </span>\";\n $pagination.= \"</div>\\n\";\n }\n return $pagination;\n }\n}", "function get_previous_page(){\n\t\t$query = \"SELECT * FROM \" . Database::$table . \" ORDER BY timestamp DESC LIMIT 1\";\n\t\treturn Database::get_all_results($query);\n\t}", "public function genNextLink()\n\t{\n\t\t$this->pagination['nextLink'] = \"\";\t\n\t\tif($this->page < $this->numofpages)\n\t\t{\n\t\t\t$page = $this->page+1;\t\t\t\t\n\t\t\t$item = $this->itemTpl;\n\t\t\t$item = str_replace(array('{pageclass}','{pagelink}', '{pagetext}'),\n\t\t\t\t\t\t\t\tarray('page page_next',$this->prepend.$page.$this->append, '&gt;'),\n\t\t\t\t\t\t\t\t$item);\t\t\t\t\t\t\t\n\t\t\t$this->pagination['nextLink'] = $item;\n\t\t}\n\t}", "function msdlab_scrollie_page(){\n global $post;\n $edit = get_edit_post_link($post->ID) != ''?'<a href=\"'.get_edit_post_link($post->ID).'\"><i class=\"icon-edit\"></i></a>':'';\n $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );\n $background = $thumbnail?' style=\"background-image:url('.$thumbnail[0].');\"':'';\n remove_filter('the_content','wpautop',12);\n print '<div id=\"intro\" class=\"scrollie parent div-intro div0\">\n <div class=\"background-wrapper\"'.$background.'>\n <div class=\"wrap\">\n <div class=\"page-content\">\n <div class=\"entry-content\">';\n print apply_filters('the_content', $post->post_content);\n print ' </div>\n '.$edit.'\n </div>\n </div>\n </div>\n </div>';\n print '<div id=\"callout\"><p>'.get_option('blogdescription').'</p></div>';\n\n add_filter('the_content','wpautop',12);\n $my_wp_query = new WP_Query();\n $args = array(\n 'post_type' => 'page',\n 'order' => 'ASC',\n 'orderby' => 'menu_order',\n 'tax_query' => array(\n array(\n 'taxonomy' => 'msdlab_scrollie',\n 'field' => 'slug',\n 'terms' => 'home'\n )\n )\n );\n $children = $my_wp_query->query($args);\n $i = 1;\n foreach($children AS $child){\n $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id($child->ID), 'full' );\n $background = $thumbnail?' style=\"background-image:url('.$thumbnail[0].');\"':'';\n $form = $child->post_name=='contact-us'?do_shortcode('[gravityform id=\"1\" name=\"Untitled Form\" title=\"false\" ajax=\"true\"]'):'';\n $edit = get_edit_post_link($child->ID) != ''?'<a href=\"'.get_edit_post_link($child->ID).'\"><i class=\"icon-edit\"></i></a>':'';\n print '<div id=\"'.$child->post_name.'\" class=\"scrollie child div-'.$child->post_name.' div'.$i.' trigger\" postid=\"'.$child->ID.'\">\n <div class=\"background-wrapper\"'.$background.'>\n <div class=\"wrap\">'.$form.'\n <div class=\"page-content\">\n <h2 class=\"entry-title\">'.$child->post_title.'</h2>\n <div class=\"entry-content\">'.apply_filters('the_content', $child->post_content).'</div>\n '.$edit.'\n </div>\n </div>\n </div>\n </div>';\n $i++;\n }\n}", "function create_links()\n\t{\n\t\t$output = '';\n\t\t\n\t\t/*if($this->block > 1){\n\t\t\t$this->prev = $this->first-1; \n\t\t\t$output .= '<a href=\"'.$this->url.'/page/1\" class=\"pBtn prev2\">처음</a>'.chr(10);\n\t\t}else{\n\t\t\t$output .= '<a href=\"javascript:void(0);\"class=\"pBtn prev2\">처음</a>'.chr(10);\n }*/\n\n\t\tif($this->page>1){\n\t\t\t$this->go_page=$this->page-1;\n\t\t\t$output .= '<a href=\"'.$this->url.'/page/'.$this->go_page.$this->querystring.'\"><img src=\"'.$this->theme.'/images/prev1.gif\" alt=\"Prev\" /></a>'.chr(10);\n\t\t}else{\n\t\t\t$output .= '<a href=\"javascript:void(0);\"><img src=\"'.$this->theme.'/images/prev1.gif\" alt=\"Prev\" /></a>'.chr(10);\n\t\t}\n\t\t\n\t\t$pgNum = '';\n\t\tfor($this->pagelnk=$this->first+1; $this->pagelnk <= $this->last; $this->pagelnk++)\n\t\t{\n\t\t\tif($this->first+1 < $this->pagelnk) $pgNum .= \"\t\"; \n\t\t\tif($this->pagelnk==$this->page){\n\t\t\t\t$pgNum .='<strong>'.$this->pagelnk.'</strong>'.chr(10);\n\t\t\t}else{\n\t\t\t\t$pgNum .='<a href=\"'.$this->url.'/page/'.$this->pagelnk.$this->querystring.'\">'.$this->pagelnk.'</a>'.chr(10);\n\t\t\t}\n \n if($this->paglnk!=$this->first+1 && $this->paglnk!=$this->last){\n $pgNum .= '';\n }\n\t\t}\n\t\t\n\t\t//$output .= $pgNum;\n $output .= '<span class=\"num\">'.$pgNum.'</span>';\n\n\t\tif($this->total_page>$this->page){\n\t\t\t$this->go_page=$this->page+1;\n\t\t\t$output .= '<a href=\"'.$this->url.'/page/'.$this->go_page.$this->querystring.'\"><img src=\"'.$this->theme.'/images/next1.gif\" alt=\"Next\" /></a>'.chr(10);\n\t\t}else{\n\t\t\t$output .= '<a href=\"javascript:void(0);\"><img src=\"'.$this->theme.'/images/next1.gif\" alt=\"Next\" /></a>'.chr(10);\n\t\t}\n\n\t\t/*if($this->block < $this->total_block){\n\t\t\t$this->next=$this->last+1;\n\t\t\t$output .= '<a href=\"'.$this->url.'/page/'.$this->total_page.'\" class=\"pBtn next2\">마지막</a>';\n\t\t}else{\n $output .= '<a href=\"javascript:void(0);\" class=\"pBtn next2\">마지막</a>';\n }*/\n\t\t\n\t\tif($this->total_page <= 1) $output =null;\n\n\t\treturn $output;\n\t}", "function cl_previden() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"previden\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function getLastPage();", "public static function get_pgnnav( $rtbl = 0, $mtd_to_inc_view = '/i/home/', $uriq, $rblk = 5 ) //paginator\n{\n $qs = QS;\n $total_pages = ceil($rtbl / $rblk);\n\n\n // ~ 1. P A G I N A T I O N V A R I A B L E S ~\n\n if (isset($uriq->p)) {\n $_SESSION['filter_tbl']['pgordno_from_url'] = $uriq->p ;\n } else {$_SESSION['filter_tbl']['pgordno_from_url'] = 1 ;}\n $pgordno_from_url = $_SESSION['filter_tbl']['pgordno_from_url'] ;\n\n //$show_all_r = isset($u riq->pgn) and $u riq->pgn == 'ALL' ? '1' : '' ;\n //if($show_all_r){ $first_rinblock = 0; } else\n if($pgordno_from_url < 2){ $first_rinblock = 1; } \n else{$first_rinblock = ($pgordno_from_url * $rblk) - $rblk + 1; }\n\n //if($show_all_r){ $last_rinblock = $rtbl ; } else\n $last_rinblock = $first_rinblock + $rblk - 1 ;\n if ($last_rinblock > $rtbl) $last_rinblock = $rtbl ;\n\n\n\n // ~ 2. N A V B A R P G N L I N K S ~\n // eg $req_uri is /zbig/04knjige/...paginator_navbar_no_rows.php?p/15/i/home\n // $_SERVER[\"PHP_SELF\"] is $req_uri without ?p/15/i/home\n\n // Link to first page 11111\n //$n avbar = \"<center><div id='pagination'>\"\n $navbar = \"<div>\"\n .\" <a class='button' href='{$qs}p/1$mtd_to_inc_view'>&lt;&lt;</a>\";\n \n // Link to prev page -11111\n $navbar .= \n \" <a class='button' \n href='{$qs}p/'\n \"\n . ( ($pgordno_from_url > 1) ? $pgordno_from_url-1 : $pgordno_from_url).$mtd_to_inc_view\n . \"'>&nbsp;&lt;&nbsp;</a>\";\n\n // Link to pages between first and last page\n for ($pg=1; $pg<=$total_pages; $pg++) { // 11111...l a s t\n\n $fmt_tmp1=''; $fmt_tmp2='';\n // currpg is italic\n if ($pg==$pgordno_from_url) {$fmt_tmp1='<b><i>*'; $fmt_tmp2='</i></b>';}\n\n $navbar .= \n \" <a class='button'\n href='{$qs}p/{$pg}{$mtd_to_inc_view}'\n \" .'>';\n $navbar .= $fmt_tmp1.str_pad((string)($pg), 3, '0', STR_PAD_LEFT).$fmt_tmp2 ;\n $navbar .= '</a>';\n }\n\n\n // Link to next page +11111\n $navbar .= \" <a class='button' href='{$qs}p/\"\n . ( ($pgordno_from_url < $total_pages) ? $pgordno_from_url+1 : $pgordno_from_url) . $mtd_to_inc_view\n . \"'>&nbsp;&gt;&nbsp;</a>\";\n \n // Link to last page .l a s t\n$navbar .= \" <a class='button' \n href='{$qs}p/{$total_pages}{$mtd_to_inc_view}'>&gt;&gt;</a>\"\n .\" &nbsp;&nbsp; \n <a class='button' \n title='Rows {$first_rinblock} - {$last_rinblock}'\n \" . '</a>'\n .' Total count '.$rtbl .' (eg 25 on page)'\n //.\"href='{$qs}p/1/pgn/all$mtd_to_inc_view'>ALL\"\n //title='No pagination (f or c t r l + F)'\n //.' Tot.pages '.$total_pages\n;\n\n //$navbar .= '</center></div>' ;\n $navbar .= '</div>' ;\n\n\n\n return [\n 'navbar'=>$navbar //'<h2>'.'aaaaaaaa'.'</h2>';\n , 'pgordno_from_url'=>$pgordno_from_url\n , 'first_rinblock'=>$first_rinblock\n , 'last_rinblock'=>$last_rinblock\n ]; \n\n}", "static public function NavBarBottom() {\n\t\t$show_back = (strlen(self::$prev_page) > 0);\n\t\t$show_next = (strlen(self::$next_page) > 0);\n\n\t\techo '<p class=\"center\">';\n\t\tif ($show_back) {\n\t\t\techo '<a href=\"', self::$prev_page, '\">';\n\t\t\techo '<img alt=\"', (self::isGerman() ? 'Zurück' : 'Back'), '\" title=\"', (self::isGerman() ? 'Zurück' : 'Back'), '\" class=\"arrow_left {PNGCSS}\" src=\"', self::getImageURL(), '/arrow_left.png\" width=\"30\" height=\"15\" />';\n\t\t\techo '</a>';\n\t\t}else {\n\t\t\techo '<img alt=\"dummy\" title=\"\" src=\"', self::getImageURL(), '/blank.gif\" width=\"30\" height=\"22\" />';\n\t\t}\n\t\techo '<a href=\"#top\">';\n\t\techo '<img alt=\"', (self::isGerman() ? 'nach oben' : 'top'), '\" title=\"', (self::isGerman() ? 'nach oben' : 'top'), '\" class=\"arrow_up {PNGCSS}\" src=\"', self::getImageURL(), '/arrow_up.png\" width=\"15\" height=\"22\" />';\n\t\techo '</a>';\n\t\tif ($show_next) {\n\t\t\techo '<a href=\"', self::$next_page, '\">';\n\t\t\techo '<img alt=\"', (self::isGerman() ? 'Weiter' : 'Next'), '\" title=\"', (self::isGerman() ? 'Weiter' : 'Next'), '\" class=\"arrow_right {PNGCSS}\" src=\"', self::getImageURL(), '/arrow_right.png\" width=\"30\" height=\"15\" />';\n\t\t\techo '</a>';\n\t\t}else {\n\t\t\techo '<img alt=\"dummy\" title=\"\" src=\"', self::getImageURL(), '/blank.gif\" width=\"30\" height=\"22\" />';\n\t\t}\n\t\techo '</p>';\n\t}", "function nextPage() {\n\tglobal $activePages, $currentView, $currentArticle, $currentArticlePage;\n $root = '/' . $_GET['language'] . '/';\n\t\n\t// If we're on the home page, the next button should point to the first article\n\tif( $currentView == 'home' ) {\n\t\treturn $root . getArrayFirstIndex( $activePages );\n\t}\n\t// If we're on the credits page, the next button should be inactive\n\telse if( $currentView == 'credits' ) {\n\t\treturn false;\n\t}\n\t// If we're on the last page, send to credits\n\telse if( $currentArticle == 'theend' ) {\n\t\treturn $root . 'credits';\n\t}\n\t// If we're on a regular article page get the next one\n\tif($activePages[$currentArticle]['numberOfPages'] == $currentArticlePage) {\n\t\tif( !$activePages[nextPrevArticleName('next')]['active'] ) return $root . 'theend';\n\t\treturn $root . nextPrevArticleName('next');\n\t} elseif($activePages[$currentArticle]['numberOfPages'] > $currentArticlePage) {\n\t\treturn $root . $currentArticle . '/' . (string)($currentArticlePage+1);\n\t}\n}", "function foucs_pagination_number () {\n global $wp_query; // Make [$wp_query] Globale\n\t$all_pages = $wp_query->max_num_pages; // Get All Posts\n $current_pages = esc_html(max(1, get_query_var('paged'))); //Get Current Page\n \n if($all_pages > 1) { // Check If Total Page >1\n\t\treturn paginate_links(array(\n\t\t\t'base' \t\t\t => esc_url(get_pagenum_link() . '%_%'),\n\t\t\t'format' => '?paged=%#%',\n\t\t\t'current' \t\t => $current_pages,\n\t\t\t'mid_size' => 2,\n 'end_size' \t\t\t => 3,\n\t\t\t'prev_text' => __('<i class=\"fas fa-angle-double-left\"></i>'),\n\t\t\t'next_text' => __('<i class=\"fas fa-angle-double-right\"></i>'),\n\t\t));\n\t}\n}", "function paging_2($str,$width,$course)\n{\n global $currenttotal,$limit,$offset,$showed,$last,$PHP_SELF,$align;\n\n if($currenttotal>0)\n {\n #### PAGING STARTS\n print \"<table width='$width' cellpadding='2' cellspacing='0' align='right'>\";\n\tprint \"<tr>\";\n\t#---------------------------------------\n print \"<td width='30%' valign='top' align='right'>\";\n if($offset>=$limit)\n print \"<a href='$PHP_SELF?offset=$last&currenttotal=$currenttotal&course=\".$course.\"' class='pagingtextlink' style='font-size:12px'>Previous</a>&nbsp;&nbsp;&nbsp;&nbsp;\";\n\tif(isset($align))\n\t{\n print \"<span class='astro'>Pic:</span>&nbsp;&nbsp; \";\n\t}\n\telse\n\t{\n print \"<span class='gottopage' style='font-size:12px'>Page:</span>&nbsp;&nbsp; \";\n\t}\n\t$pages=$currenttotal%$limit;\n\tif($pages==0)\n $pages=$currenttotal/$limit;\n\telse\n\t{\n $pages=$currenttotal/$limit;\n $pages=(int)$pages+1;\n\t}\t\t\n\t$m=\"0\";\n\tfor($i=1;$i<=$pages;$i++)\n\t{\n $pageoff=($i-1)*$limit;\n if($showed==($i*$limit))\n {\n\t\tprint \"<span class'pagingtext' style='font-size:12px'>$i </span>&nbsp;\";\n }\n else\n {\n\t\tprint \"<a href='$PHP_SELF?offset=$pageoff&currenttotal=$currenttotal&course=\".$course.\"' class='pagingtextlink' style='font-size:12px'>$i</a>&nbsp;\";\n }\n if($m==\"29\")\n {\n\t\t$m=\"0\";\n\t\tprint \"<br>\";\n }\n\t\t$m++;\n\t}\n\t#---------------------------------------\n\tprint \"&nbsp;&nbsp;&nbsp;&nbsp;<a href='$PHP_SELF?offset=$showed&currenttotal=$currenttotal&course=\".$course.\"' class='pagingtextlink' style='font-size:12px'>\";\n\tif($showed<$currenttotal)\n print \"Next</a>\";\n\tprint \"</td>\";\n\t#---------------------------------------\n\tprint \"</tr>\";\n\tprint \"</table><br>\";\n#### PAGING ENDS\n }\n\n}", "function previousPage()\n\t\t{\n\t\t\tif(!$this->hasPrevious())\n\t\t\t\tthrow new Exception(\"Page out of bounds\");\n\t\t\t\t\n\t\t\t$this->currentPage--;\n\t\t}", "function BeforeMoveNextList(&$data, &$row, &$record, &$pageObject)\n{\n\n\t\t$record[\"DisplayRoute_css\"]='color:red';\n\n// Place event code here.\n// Use \n;\t\t\n}", "function ninja_forms_mp_breadcrumb_update_current_page(){\r\n\tglobal $ninja_forms_processing;\r\n\r\n\t$form_id = $ninja_forms_processing->get_form_ID();\r\n\t$nav = '';\r\n\t$all_extras = $ninja_forms_processing->get_all_extras();\r\n\tif( is_array( $all_extras ) AND !empty( $all_extras ) ){\r\n\t\tforeach( $all_extras as $key => $val ){\r\n\t\t\tif( strpos( $key, '_mp_page_' ) !== false ){\r\n\t\t\t\t$nav = str_replace( '_mp_page_', '', $key );\r\n\t\t\t\t$ninja_forms_processing->update_extra_value( '_current_page', $nav );\r\n\t\t\t\t$show = ninja_forms_mp_check_page_conditional( $form_id, $nav );\r\n\t\t\t\tif( !$show ){\r\n\t\t\t\t\t$ninja_forms_processing->update_extra_value( '_prev', 'Previous' );\r\n\t\t\t\t\tninja_forms_mp_nav_update_current_page();\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn $nav;\r\n}", "protected function prepareNextPrevButtons() \n\t{\n\t}", "public function prev_link()\n\t{\n\t\treturn $this->link_to_page($this->get_cur_page() - 1);\n\t}", "function register_block_core_comments_pagination_next()\n {\n }", "function renderPrev($tag = '&lt;&lt;') {\r\n\t\tif ($this->total_rows == 0)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\tif ($this->page > 1) {\r\n\t\t\treturn ' <a style=\" float:none;\" href=\"' . $this->php_self . '?page=' . ($this->page - 1) . '' . $this->append . '\">' . $tag . '</a>';\r\n\t\t} else {\r\n\t\t\treturn \" $tag\";\r\n\t\t}\r\n\t}", "function truethemes_remove_nextpage($content){\n\n\tglobal $wp_query;\n\t$is_posts_page = $wp_query->is_posts_page;\n\t\t\n\t//check if is posts page, archive, category or tag.\n\tif(is_home()||$is_posts_page==1||is_archive()||is_category()||is_tag()||is_page_template('index.php')){\n\t\n\t//we explode content and use only first part of array.\n \t$content = explode('<!--nextpage-->',$content);\n \t//return back first part of content to WordPress.\n\treturn $content[0];\n\t}else{\n\t//other pages, we do nothing to it.\n\treturn $content;\n\t}\n\n\n}", "function getPaging($refUrl, $aryOpts, $pgCnt, $curPg) {\n $return = '';\n $return.='<div class=\"box-bottom\"><div class=\"paginate\">';\n if ($curPg > 1) {\n $aryOpts['pg'] = 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">First</a>';\n\n $aryOpts['pg'] = $curPg - 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Prev</a>';\n }\n for ($i = 1; $i <= $pgCnt; $i++) {\n $aryOpts['pg'] = $i;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"';\n if ($curPg == $i)\n $return.='active';\n $return.='\" >' . $i . '</a>';\n }\n if ($curPg < $pgCnt) {\n $aryOpts['pg'] = $curPg + 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Next</a>';\n $aryOpts['pg'] = $pgCnt;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Last</a>';\n }\n $return.='<div class=\"clearfix\"></div></div></div>';\n return $return;\n}", "function addPageBegin($item) {\r\n global $_CMDEVEL;\r\n $_CMDEVEL['page']['pag_begin'][] = $item;\r\n }", "private function refreshCurrentPage()\n {\n $this->_currentPage = $this->_limit ? floor($this->_offset/$this->_limit) + 1 : 1;\n }", "private function getPaginatorType1($current_page = 0, $total_pages = 2, $conditions = \"\", $condition_encode = false){\n \t\t\t\t$cuppa = Cuppa::getInstance();\n $language = $cuppa->language->load();\n if($total_pages <= 1) return \"\";\n \t\t\t\t$field = \"<div class='paginator'>\";\n \t\t\t\t\t$field .= \"<ul>\";\n \t\t\t\t\t\tif($current_page > 0) $field .= \"<li><a onclick='\".$this->function_name.\"(0, \\\"\".$this->submit_form.\"\\\",\\\"\".$this->limit.\"\\\")'><div title='First page' class='paging_far_left'></div></a></li>\";\n \t\t\t\t\t\tif($current_page > 0) $field .= \"<li><a onclick='\".$this->function_name.\"(\".($current_page-1).\", \\\"\".$this->submit_form.\"\\\",\\\"\".$this->limit.\"\\\")'><div title='Prev page' class='paging_left'></div></a></li>\";\n \t\t\t\t\t\tif($this->pages_info) $field .= \"<li><div title='' class='current_page'>\".$cuppa->language->getValue(\"Page\",$language).\" <b>\".(@$current_page+1).\"</b> / $total_pages</div></li>\";\n \t\t\t\t\t\tif($current_page < $total_pages-1) $field .= \"<li><a onclick='\".$this->function_name.\"(\".($current_page+1).\",\\\"\".$this->submit_form.\"\\\",\\\"\".$this->limit.\"\\\")'><div title='Next page' class='paging_right'></div></a></li>\";\n \t\t\t\t\t\tif($current_page < $total_pages-1) $field .= \"<li><a onclick='\".$this->function_name.\"(\".($total_pages-1).\",\\\"\".$this->submit_form.\"\\\",\\\"\".$this->limit.\"\\\")'><div title='Last page' class='paging_far_right'></div></a></li>\";\n \t\t\t\t\t\t$field .= \"<li><div class='select_page_div'>\".$this->getPagesList($current_page, $total_pages).\"</div></li>\";\n \t\t\t\t\t$field .= \"</ul>\"; \n \t\t\t\t\t$field .= \"<input type='hidden' value='\".$current_page.\"' id='page' name='page' />\";\n $field .= \"<input type='hidden' value='' id='page_item_start' name='page_item_start' />\";\n if($condition_encode) $field .= '<input type=\"hidden\" id=\"conditions\" name=\"conditions\" value=\"'.base64_encode($conditions).'\"/>';\n else $field .= '<input type=\"hidden\" id=\"conditions\" name=\"conditions\" value=\"'.$conditions.'\"/>';\n \t\t\t\t$field .= \"</div>\";\n \t\t\t\treturn $field;\n \t\t\t}", "public function previousAction()\n {\n $this->pageAction('goToPreviousPage');\n }", "function get_one_page(){\n\t\t$this->m_n_current_page_number = gf_get_value_n('v_current_page_number');\n\t}", "private function pagProbleem()\n\t{\n\t\t$pageOutput = $this->menu();\n\t\t$pageOutput.= $this->div('open', 'id=\"inhoud\"');\n\t\t$pageOutput.= $this->h1('full', '', 'Er is iets misgelopen!');\n\t\t$pageOutput.= $this->div('close');\n\t\treturn $pageOutput;\n\t}", "public static function next_prev_item() {\n\t\t\t$cpt = self::get_post_type();\n\t\t\t$tax = ( $cpt === 'post' ) ? 'category' : $cpt . '_cat';\n\t\t\t$prevPost = get_previous_post( true, '', $tax ) ? get_previous_post( true, '', $tax ) : get_previous_post();\n\t\t\t$nextPost = get_next_post( true, '', $tax ) ? get_next_post( true, '', $tax ) : get_next_post();\n\n\t\t\tob_start();\n\t\t\tif ( $prevPost || $nextPost ) { ?>\n\t\t\t\t<ul class=\"next_prev clr\">\n\t\t\t\t\t<?php if( $prevPost ) { ?>\n\t\t\t\t\t\t<li class=\"previous\">\n\t\t\t\t\t\t\t<?php $prevthumbnail = get_the_post_thumbnail( $prevPost->ID, 'thumbnail' ); ?>\n\t\t\t\t\t\t\t<?php previous_post_link( '%link', '<i class=\"fa fa-angle-' . ( self::$is_rtl ? 'right' : 'left' ) . '\"></i><h4><small>' . esc_html( do_shortcode( self::option( 'prev_' . $cpt, self::option( 'prev_post' ) ) ) ) . '</small>%title</h4>' ); ?>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t<?php } if( $nextPost ) { ?>\n\t\t\t\t\t\t<li class=\"next\">\n\t\t\t\t\t\t\t<?php $nextthumbnail = get_the_post_thumbnail( $nextPost->ID, 'thumbnail' ); ?>\n\t\t\t\t\t\t\t<?php next_post_link( '%link', '<h4><small>' . esc_html( do_shortcode( self::option( 'next_' . $cpt, self::option( 'next_post' ) ) ) ) . '</small>%title</h4><i class=\"fa fa-angle-' . ( self::$is_rtl ? 'left' : 'right' ) . '\"></i>' ); ?>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t<?php } \n\n\t\t\t\t\t\t$archive_icon = false; //self::option( 'next_prev_archive_icon' );\n\t\t\t\t\t\tif ( $archive_icon ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<li class=\"cz-next-prev-archive\">\n\t\t\t\t\t\t<a href=\"<?php echo esc_url( get_post_type_archive_link( $cpt ) ); ?>\" title=\"<?php echo ucwords( $cpt ); ?>\"><i class=\"<?php echo esc_attr( $archive_icon ); ?>\"></i></a>\n\t\t\t\t\t</li>\n\t\t\t\t\t<?php \n\t\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</ul>\n\t\t\t<?php \n\t\t\t}\n\n\t\t\treturn ob_get_clean();\n\t\t}", "function page_navi($before = '', $after = '') {\n\tglobal $wpdb, $wp_query;\n\t$request = $wp_query->request;\n\t$posts_per_page = intval(get_query_var('posts_per_page'));\n\t$paged = intval(get_query_var('paged'));\n\t$numposts = $wp_query->found_posts;\n\t$max_page = $wp_query->max_num_pages;\n\tif ( $numposts <= $posts_per_page ) { return; }\n\tif(empty($paged) || $paged == 0) {\n\t\t$paged = 1;\n\t}\n\t$pages_to_show = 7;\n\t$pages_to_show_minus_1 = $pages_to_show-1;\n\t$half_page_start = floor($pages_to_show_minus_1/2);\n\t$half_page_end = ceil($pages_to_show_minus_1/2);\n\t$start_page = $paged - $half_page_start;\n\tif($start_page <= 0) {\n\t\t$start_page = 1;\n\t}\n\t$end_page = $paged + $half_page_end;\n\tif(($end_page - $start_page) != $pages_to_show_minus_1) {\n\t\t$end_page = $start_page + $pages_to_show_minus_1;\n\t}\n\tif($end_page > $max_page) {\n\t\t$start_page = $max_page - $pages_to_show_minus_1;\n\t\t$end_page = $max_page;\n\t}\n\tif($start_page <= 0) {\n\t\t$start_page = 1;\n\t}\n\techo $before.'<nav class=\"page-navigation\"><ol class=\"grav_page_navi clearfix\">'.\"\";\n\tif ($start_page >= 2 && $pages_to_show < $max_page) {\n\t\t$first_page_text = \"First\";\n\t\techo '<li class=\"bpn-first-page-link\"><a href=\"'.get_pagenum_link().'\" title=\"'.$first_page_text.'\">'.$first_page_text.'</a></li>';\n\t}\n\techo '<li class=\"bpn-prev-link\">';\n\tprevious_posts_link('<<');\n\techo '</li>';\n\tfor($i = $start_page; $i <= $end_page; $i++) {\n\t\tif($i == $paged) {\n\t\t\techo '<li class=\"bpn-current\">'.$i.'</li>';\n\t\t} else {\n\t\t\techo '<li><a href=\"'.get_pagenum_link($i).'\">'.$i.'</a></li>';\n\t\t}\n\t}\n\techo '<li class=\"bpn-next-link\">';\n\tnext_posts_link('>>');\n\techo '</li>';\n\tif ($end_page < $max_page) {\n\t\t$last_page_text = \"Last\";\n\t\techo '<li class=\"bpn-last-page-link\"><a href=\"'.get_pagenum_link($max_page).'\" title=\"'.$last_page_text.'\">'.$last_page_text.'</a></li>';\n\t}\n\techo '</ol></nav>'.$after.\"\";\n}", "function get_previous_posts_page_link()\n {\n }", "function antica_next_prev_post_link ($output, $format, $link, $post, $adjacent) {\n $previous = $adjacent;\n\n // Only applies changes if EDDis active\n if ( ! class_exists('EDD_Download') ) {\n return $output;\n }\n if ( ! is_single() || ! get_post_type() == \"download\" ) {\n return $output;\n }\n\n /**\n * Saving the initial Referrer\n * To allow scroll the posts and\n * return to the original caller\n * Option 2 - onclick=\"history.back()\" Easier\n * The page should verify $_GET['back_refr']\n */\n\n $url_back_refr = '';\n // If GET is set the same Template\n if ( isset( $_GET['back_refr'] ) ) {\n $url_back_refr = $_GET['back_refr'];\n // echo '<br>Original: ' . $url_back_refr;\n\n } else {\n if ( isset( $_SERVER['HTTP_REFERER'] ) ) {\n // $back_pth = parse_url( $_SERVER['HTTP_REFERER'], PHP_URL_PATH );\n // $back_qry = parse_url( $_SERVER['HTTP_REFERER'], PHP_URL_QUERY );\n // echo '<br>Initial: ' . $back_qry;\n // $url_back_refr = add_query_arg( 'back_refr' , base64_encode ( $back_pth . $back_qry ) );\n // $url_back_refr = base64_encode ( $back_pth . $back_qry );\n $url_back_refr = base64_encode ( $_SERVER['HTTP_REFERER'] );\n // echo '<br>Aditional: ' . $url_back_refr ;\n }\n }\n\n // echo '<br>encoded: ' . $url_back_refr . '<----';\n // echo '<br>decoded: ' . base64_decode($url_back_refr) . '<----';\n /**\n * https://developer.wordpress.org/reference/functions/get_adjacent_post_link/\n */\n if ( ! $post ) {\n $output = '';\n } else {\n $title = $post->post_title;\n\n if ( empty( $post->post_title ) ) {\n $title = $previous ? __( 'Previous Post' ) : __( 'Next Post' );\n }\n\n /** This filter is documented in wp-includes/post-template.php */\n $title = apply_filters( 'the_title', $title, $post->ID );\n\n $date = mysql2date( get_option( 'date_format' ), $post->post_date );\n $rel = $previous ? 'prev' : 'next';\n\n $string = '<a href=\"';\n $string .= get_permalink( $post ) ;\n $string .= '?back_refr=' . $url_back_refr;\n $string .= '\" rel=\"' . $rel . '\">';\n $inlink = str_replace( '%title', $title, $link );\n $inlink = str_replace( '%date', $date, $inlink );\n $inlink = $string . $inlink . '</a>';\n\n $output = str_replace( '%link', $inlink, $format );\n }\n\n return $output;\n}", "function prevPage($text='prev')\n\t{\n\t\tif (empty($this->_pageDetails)) { return false; }\n\t\tif ( !empty($this->_pageDetails['previousPage']) )\n\t\t{\n\t\t\tif($this->style == 'ajax')\n\t\t\t{\t\n\t\t\t\t//$t = $this->Ajax->linkToRemote($text, array(\"fallback\"=>$this->action.\"#\",\"url\" => $this->link.$this->_pageDetails['previousPage'],\"update\" => \"ajax_update\",\"method\"=>\"get\"));\n\t\t\t\t$t = $this->Ajax->link($text, $this->link.$this->_pageDetails['previousPage'],array(\"update\" => \"ajax_update\",\"method\"=>\"get\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$t = $this->Html->link('<strong>' . $text . '</strong>',$this->link.$this->_pageDetails['previousPage'], false, false, false);\n\t\t\t}\n\t\t\treturn $t;\n\t\t}\t\n\t\t//return '<span><strong>' . $text . '</strong></span>';\n\t\treturn false;\n\t}", "function scrap_page_prev($url)\n {\n $page = curl_get_file($url);\n $regex = '@(?s)<h2.*?Add to Compare@';\n preg_match_all($regex,$page,$match);\n if($match == null)\n echo \"No match found!!\";\n else\n {\n foreach($match[0] as $m)\n scrap($m);\n }\n \n //To find prev url\n $regex = '@<link\\s*rel=\"prev\"\\s*href=\"(.*)?\"@';\n preg_match($regex,$page,$u);\n if($u == null)\n return null;\n else \n return $u[1]; \n }", "protected function renderPageNextPrev()\n {\n $pageCount = $this->pagination->getPageCount();\n if ($pageCount < 2 && $this->hideOnSinglePage) {\n return '';\n }\n\n $buttons = [];\n $currentPage = $this->pagination->getPage();\n\n // first page\n $firstPageLabel = $this->firstPageLabel === true ? '1' : $this->firstPageLabel;\n if ($firstPageLabel !== false) {\n $buttons[] = $this->renderPageButton($firstPageLabel, 0, $this->firstPageCssClass, $currentPage <= 0, false);\n }\n\n // prev page\n if ($this->prevPageLabel !== false) {\n if (($page = $currentPage - 1) < 0) {\n $page = 0;\n }\n $buttons[] = $this->renderPageButton($this->prevPageLabel, $page, $this->prevPageCssClass, $currentPage <= 0, false);\n }\n\n // next page\n if ($this->nextPageLabel !== false) {\n if (($page = $currentPage + 1) >= $pageCount - 1) {\n $page = $pageCount - 1;\n }\n $buttons[] = $this->renderPageButton($this->nextPageLabel, $page, $this->nextPageCssClass, $currentPage >= $pageCount - 1, false);\n }\n\n // last page\n $lastPageLabel = $this->lastPageLabel === true ? $pageCount : $this->lastPageLabel;\n if ($lastPageLabel !== false) {\n $buttons[] = $this->renderPageButton($lastPageLabel, $pageCount - 1, $this->lastPageCssClass, $currentPage >= $pageCount - 1, false);\n }\n\n return Html::tag('ul', implode(\"\\n\", $buttons), $this->options);\n }", "function firstPage()\n\t\t{\n\t\t\t$this->currentPage = 1;\n\t\t}", "function custom_pagination($max_num_pages = '', $range = 1) {\n $showitems = ($range * 2)+1;\n\n global $paged;\n if(empty($paged)) $paged = 1;\n\n if($max_num_pages == '') {\n global $wp_query;\n // 最後のページ\n $max_num_pages = $wp_query->max_num_pages;\n if(!$max_num_pages) {\n $max_num_pages = 1;\n }\n }\n\n if(1 != $max_num_pages) {\n echo '<div class=\"paging\">'.\"\\n\";\n\n // Prevリンク\n // 現在のページが2ページ目以降の場合\n if ($paged > 1) echo '<a class=\"prev_link\" href=\"'.get_pagenum_link($paged - 1).'\">&laquo;</a>'.\"\\n\";\n\n // 今のページからレンジを引いて2以上ある場合 && 最大表示アイテム数より最第ページ数が大きい場合\n // (レンジ数のすぐ次の場合は表示する)\n // 1...345\n if ( $paged-$range >= 2 && $max_num_pages > $showitems ) echo '<a href=\"'.get_pagenum_link(1).'\">1</a>'.\"\\n\";\n // 今のページからレンジを引いて3以上ある場合 && 最大表示アイテム数より最第ページ数が大きい場合\n if ( $paged-$range >= 3 && $max_num_pages > $showitems ) echo '<span class=\"txt_hellip\">&hellip;</span>'.\"\\n\";\n\n // レンジより前に追加する数\n $addPrevCount = $paged+$range-$max_num_pages;\n // レンジより後に追加する数\n $addNextCount = -($paged-1-$range); // 今のページ数を遡ってカウントするために-1\n // アイテムループ\n for ($i=1; $i <= $max_num_pages; $i++) {\n // 表示するアイテム\n if ($paged == $i) {\n $pageItem = '<span class=\"current\">'.$i.'</span>'.\"\\n\";\n } else {\n $pageItem = '<a href=\"'.get_pagenum_link($i).'\" class=\"inactive\">'.$i.'</a>'.\"\\n\";\n }\n\n // 今のページからレンジを引いた数~今のページからレンジを足した数まで || 最大ページ数が最大表示アイテム数以下の場合\n if ( ( $paged-$range <= $i && $i<= $paged+$range ) || $max_num_pages <= $showitems ) {\n echo $pageItem;\n // 今のページからレンジを引くと負数になる場合 && 今のページ+レンジ+負数をレンジに加算した数まで\n } else if ( $paged-1-$range < 0 && $paged+$range+$addNextCount >= $i ) {\n echo $pageItem;\n // 今のページからレンジを足すと 最後のページよりも大きくなる場合 && 今のページ+レンジ+負数をレンジに加算した数まで\n } else if ( $paged+$range > $max_num_pages && $paged-$range-$addPrevCount <= $i ) {\n echo $pageItem;\n }\n }\n\n // 現在のページにレンジを足しても最後のページ数より2以上小さい時 && 最大表示アイテム数より最第ページ数が大きい場合\n if ( $paged+$range <= $max_num_pages-2 && $max_num_pages > $showitems ) echo '<span class=\"txt_hellip\">&hellip;</span>'.\"\\n\";\n if ( $paged+$range <= $max_num_pages-1 && $max_num_pages > $showitems ) echo '<a href=\"'.get_pagenum_link($max_num_pages).'\">'.$max_num_pages.'</a>'.\"\\n\";\n // Nextリンク\n if ($paged < $max_num_pages) echo '<a class=\"next_link\" href=\"'.get_pagenum_link($paged + 1).'\">&raquo;</a>'.\"\\n\";\n echo \"</div>\\n\";\n }\n }", "public function printPagination(){\n\t\tif ($_GET['id'] > 1) { \n\t\t\t$this->returnPagination .= \"<a class='page-link' href='\".ROOT_URL. \"\" .$this->tablePagination.\"/1'> Prva </a>\";\n\t\t\t $this->returnPagination .= \"<a class='page-link' href='\".ROOT_URL. \"\" .$this->tablePagination.\"/\".($this->pageid-1).\"'> < </a>\";\n\t\t\t if ($_GET['id'] > 4) { \n\t\t\t $this->returnPagination .= \"<a class='page-link'> ... </a>\";}\n\t\t}\n\n\t\tif ($_GET['id']>3) {\n\t\t\tif ($_GET['id']>($this->brredova-3)){\n\t\t\t\t$start = $_GET['id'] - 3;\n\t\t \t\t$end = $this->brredova;\n\t\t\t} else {\n\t\t\t\t$start = $_GET['id'] - 3;\n\t\t \t\t$end = $_GET['id'] + 3;\n\t\t\t}\t\n\t\t } else {\n\t\t \t$start = 1;\n\t\t \t$end = 7;\n\t\t }\n\n\t\tfor ( $this->pageid = $start; $this->pageid<=$end; $this->pageid++) {\n\n\n\t\t\tif ($_GET['id'] == $this->pageid) {\n\t\t\t\t$this->returnPagination .= \"<a class='page-link' style='color: red;' href='\".ROOT_URL. \"\" .$this->tablePagination.\"/\".$this->pageid.\"'>\" . $this->pageid . \"</a>\";\n\t\t\t}else{\n\t\t\t\t $this->returnPagination .= \"<a class='page-link' href='\".ROOT_URL. \"\" .$this->tablePagination.\"/\".$this->pageid.\"'>\" . $this->pageid . \"</a>\";\n\t\t\t}\n\t\t \n\t\t}\n\n\t\tif ($_GET['id'] < $this->brredova) { \n\t\t\t if ($_GET['id'] < $this->brredova - 3) { $this->returnPagination .= \"<a class='page-link'> ... </a>\";}\n\t\t\t $this->returnPagination .= \"<a class='page-link' title='Next' href='\".ROOT_URL. \"\" .$this->tablePagination.\"/\".($_GET['id']+1).\"'> > </a>\";\n\t\t\t $this->returnPagination .= \"<a class='page-link' href='\".ROOT_URL. \"\" .$this->tablePagination.\"/\".$this->brredova.\"'> Poslednja <span class='badge badge-primary'>\". $this->brredova .\"</span></a>\";\n\t\t}\n\n\t\treturn $this->returnPagination;\n\t}", "function render_block_core_comments_pagination_next($attributes, $content, $block)\n {\n }", "function lastPage()\n\t\t{\n\t\t\t$this->currentPage = $this->numberOfPages();\n\t\t}", "function Pagina() {\r\n extract($GLOBALS);\r\n\r\n if ($w_menu == '') {\r\n $sql = new db_getLinkData; $RS = $sql->getInstanceOf($dbms, $w_cliente, $SG);\r\n $w_modulo = f($RS,'sq_modulo');\r\n $sql = new db_getMenuData; $RS_Menu = $sql->getInstanceOf($dbms,f($RS,'sq_menu'));\r\n } else {\r\n $sql = new db_getMenuData; $RS_Menu = $sql->getInstanceOf($dbms,$w_menu);\r\n $w_modulo = f($RS_Menu,'sq_modulo');\r\n } \r\n\r\n Cabecalho();\r\n head();\r\n ShowHTML('<TITLE>'.$conSgSistema.' - Ajuda - '.f($RS_Menu,'nome').'</TITLE>');\r\n ShowHTML('</HEAD>');\r\n BodyOpenClean('onLoad=this.focus();');\r\n ShowHTML('<B><FONT COLOR=\"#000000\">'.$w_TP.'</font></B>');\r\n\r\n ShowHTML('<div align=center><center>');\r\n if ($w_sq_modulo>\"\") {\r\n ShowHTML('<center><B>Clique <a class=\"HL\" href=\"javascript:history.back(1);\">aqui</a> para voltar à tela anterior</b></center>');\r\n } \r\n\r\n\r\n ShowHTML('<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">');\r\n\r\n ShowHTML(' <tr valign=\"top\"><td colspan=2>');\r\n ShowHTML(' <font face=\"Arial\" size=\"3\"><b>'.upper(f($RS_Menu,'nome')).'</font></b><hr>');\r\n ShowHTML(' <font size=\"2\"><DL><DT><b>Finalidade:</b><DD>'.f($RS_Menu,'finalidade').'</DD></DT>');\r\n if (f($RS_Menu,'tramite')=='S') ShowHTML(' <DT><br><b>Como funciona:</b><DD>'.crlf2br(f($RS_Menu,'como_funciona')));\r\n ShowHTML(' </td></tr>');\r\n ShowHTML(' <tr><td colspan=\"2\"><br></td></tr>');\r\n \r\n // Verifica se tem sub-menu e exibe\r\n $SQL = new db_getLinkdataHelp; $RS = $SQL->getInstanceOf($dbms, $w_cliente,$w_modulo,0,f($RS_Menu,'sq_menu'));\r\n if (count($RS)>0) {\r\n ShowHTML(' <tr><td colspan=\"2\"><br><font size=\"2\"><b>TELAS CONTIDAS<hr NOSHADE color=#000000 SIZE=1></b></font></td></tr>');\r\n ShowHTML(' <tr valign=\"top\"><td colspan=2><font size=2><DL>');\r\n $w_cont1 = 0;\r\n foreach ($RS as $row) {\r\n $w_cont1++;\r\n ShowHTML(' <DT><B>'.$w_cont1.'. '.f($row,'nome').'</B><DD>'.crlf2br(f($row,'finalidade')));\r\n }\r\n ShowHTML(' </DL>');\r\n }\r\n \r\n // Verifica se tem trâmites e exibe\r\n if (f($RS_Menu,'tramite')=='S') {\r\n $SQL = new db_getTramiteList; $RS_Tramite = $SQL->getInstanceOf($dbms, f($RS_Menu,'sq_menu'),null, null, null);\r\n if (count($RS_Tramite) > 0) {\r\n ShowHTML(' <tr><td colspan=\"2\"><font size=\"2\"><b>FASES<hr NOSHADE color=#000000 SIZE=1></b></font></td></tr>');\r\n ShowHTML(' <tr valign=\"top\"><td colspan=2><table width=100% border=\"1\" bordercolor=\"#00000\">');\r\n ShowHTML(' <tr align=\"center\" valign=\"top\">');\r\n ShowHTML(' <td><b>Ordem</td>');\r\n ShowHTML(' <td><b>Nome</td>');\r\n ShowHTML(' <td><b>Descricao</td>');\r\n ShowHTML(' <td><b>Quem cumpre</td>');\r\n ShowHTML(' </tr>');\r\n foreach ($RS_Tramite as $row_tramite) {\r\n ShowHTML(' <tr valign=\"top\">');\r\n ShowHTML(' <td align=\"center\">'.f($row_tramite,'ordem').'</td>');\r\n ShowHTML(' <td>'.f($row_tramite,'nome').'</td>');\r\n ShowHTML(' <td>'.Nvl(f($row_tramite,'descricao'),\"---\").'</td>');\r\n ShowHTML(' <td>'.Nvl(f($row_tramite,'nm_chefia'),\"---\").'</td>');\r\n ShowHTML(' </td>');\r\n ShowHTML(' </tr>');\r\n } \r\n ShowHTML(' </table>');\r\n } \r\n } \r\n ShowHTML(' </table></td></tr>');\r\n ShowHTML(' </tr></tr></td></table>');\r\n ShowHTML(' </table>');\r\n ShowHTML('</table>');\r\n\r\n if ($w_sq_modulo>'') {\r\n ShowHTML('<center><B>Clique <a class=\"HL\" href=\"javascript:history.back(1);\">aqui</a> para voltar à tela anterior</b></center>');\r\n } \r\n\r\n ShowHTML('</center>');\r\n Rodape();\r\n\r\n return $function_ret;\r\n}" ]
[ "0.6356417", "0.6252179", "0.6216892", "0.6206911", "0.620456", "0.620232", "0.61108106", "0.60750604", "0.6031225", "0.6011953", "0.60092854", "0.6005445", "0.5969607", "0.59592575", "0.59471613", "0.5922548", "0.59047884", "0.58750904", "0.5865265", "0.58580863", "0.5856539", "0.58334816", "0.5816826", "0.5813118", "0.581016", "0.5796634", "0.5786538", "0.57751936", "0.57751936", "0.5767186", "0.5763043", "0.5757943", "0.5757115", "0.57347953", "0.57336193", "0.5721749", "0.57181275", "0.56910944", "0.568528", "0.5676614", "0.5656283", "0.5652185", "0.5641061", "0.56324947", "0.56199646", "0.5616088", "0.5615904", "0.56148684", "0.56048894", "0.5589791", "0.55881757", "0.558469", "0.55818206", "0.55683434", "0.5559489", "0.5526795", "0.5522864", "0.55217505", "0.5515171", "0.54982156", "0.54982156", "0.54940265", "0.54786843", "0.5472886", "0.5471292", "0.5469946", "0.54676485", "0.5460235", "0.5441434", "0.54378784", "0.5437842", "0.543477", "0.54319036", "0.5423616", "0.5419623", "0.5419568", "0.54192346", "0.5416278", "0.5408382", "0.5402719", "0.5398957", "0.53972155", "0.5384562", "0.53838843", "0.5378764", "0.5375878", "0.5373767", "0.5371364", "0.53698224", "0.53674954", "0.53624064", "0.5360794", "0.53559124", "0.5351801", "0.5349054", "0.5347496", "0.534276", "0.5340933", "0.5337658", "0.5336263", "0.5332929" ]
0.0
-1
CUSTOMIZANDO O LEIA MAIS
function new_excerpt_more($length) { return 18; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function masodik()\n {\n }", "public function mostra(){\n }", "public function abono();", "public function obtenerViajesplusAbonados();", "public static function metodo_estatico () {\n }", "public function obtener()\n {\n }", "public function hapus_toko(){\n\t}", "public function getMarca(){ return $this->marca;}", "public function getMilage()\n {\n }", "function cl_moblevantamentoedi() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"moblevantamentoedi\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function elso()\n {\n }", "function cl_moblevantamento() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"moblevantamento\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function obtenerViajesplus();", "public function getMataPelajaran();", "public abstract function Ataca();", "public function AggiornaPrezzi(){\n\t}", "public function boleta()\n\t{\n\t\t//\n\t}", "public function pasaje_abonado();", "function lagarto() {\n $this->name=\"lagarto\";\n $this->title=\"Lagarto (panStamp)\";\n $this->module_category=\"<#LANG_SECTION_DEVICES#>\";\n $this->checkInstalled();\n}", "function fast_plugin_affiche_milieu($flux){\r\n\t$flux['data'] .= flux_data_fast_plugin('milieu');\r\n\treturn $flux;\r\n}", "function miguel_MCourse() \r\n {\t\r\n $this->base_Model();\r\n }", "public function metodo_publico() {\n }", "public function custom()\n\t{\n\t}", "public function acessarRelatorios(){\n\n }", "public function accueil()\n {\n }", "abstract public function getPasiekimai();", "function cl_bensetiquetaimpressa() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"bensetiquetaimpressa\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function Immobile(){\n\t\t\t$this->database=new Database();\n\t\t\t$approvato=false;\n\t\t}", "public function alimentar()\n {\n }", "public function jalan() {\n echo \"method jalan() berisi : Hewan ini terbang\";\n }", "function vimport_abonnes_autoriser() {\n}", "public function baseSlajderi()\n {\n \n $this->linija = Slajderi::model()->findAllByAttributes(array('jezik'=>Yii::app()->session[\"lang\"]),array('order'=>'id'));\n $this->nalovSlajderi = $this->linija[0] -> naslov;\n \n \n }", "public function getUtilisateurs();", "public function catalogos() \n\t{\n\t}", "function cilien_autoriser(){}", "public function __construct() {\n $this->noticia_modelo = $this->modelo('NoticiaModelo');\n }", "public function nom_alien()\r\n{\r\n return $this->_nom_alien;\r\n}", "function insertarMetodologia(){\n\t\t$this->procedimiento='gem.f_metodologia_ime';\n\t\t$this->transaccion='GEM_GEMETO_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('codigo','codigo','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function FicheMemo()\n{\n\t$this->type_moi = \"fiche_memo\";\n}", "private function metodo_privado() {\n }", "static function definisiMeni(){\n\t\t $stavke[0]=array('naziv'=>'home','link'=>'/pilot/home');\n\t\t $stavke[1]=array('naziv'=>'o nama','link'=>'/pilot/onama');\n\t\t if(session_id()!='pilot1sesija1'){\n\t\t\tsession_id('pilot1sesija1');\n\t\t\tsession_start();\n\t\t }\n\t\t if(isset($_SESSION['pravo'])){\n\t\t\t if($_SESSION['pravo']==1 || $_SESSION['pravo']==2){ \n\t\t\t\t$stavke[2]=array('naziv'=>'clanci','link'=>'/pilot/clanci'); \n\t\t\t\t$stavke[3]=array('naziv'=>'korisnici','link'=>'/pilot/korisnici'); \n\t\t\t }\n\t\t \n\t\t }\n\t\t return $stavke;\n\t}", "function accesrestreintobjets_affiche_milieu($flux){\n\tif ($flux[\"args\"][\"exec\"] == \"configurer_accesrestreint\") {\n\t\t$flux[\"data\"] = recuperer_fond('prive/squelettes/inclure/configurer',array('configurer'=>'configurer_accesrestreintobjets')).$flux[\"data\"];\n\t}\n\t// Ajouter la config des zones sur la vue de chaque objet autorisé\n\telseif (\n\t\t$exec = trouver_objet_exec($flux['args']['exec'])\n\t\tand include_spip('inc/config')\n\t\tand include_spip('inc/autoriser')\n\t\tand $objets_ok = lire_config('accesrestreintobjets/objets')\n\t\t// Si on a les arguments qu'il faut\n\t\tand $type = $exec['type']\n\t\tand $id = intval($flux['args'][$exec['id_table_objet']])\n\t\t// Si on est sur un objet restrictible\n\t\tand in_array($exec['table_objet_sql'], $objets_ok)\n\t\t// Et que l'on peut configurer le site\n\t\tand autoriser('configurer')\n\t) {\n\t\t$liens = recuperer_fond(\n\t\t\t'prive/objets/editer/liens',\n\t\t\tarray(\n\t\t\t\t'table_source'=>'zones',\n\t\t\t\t'objet' => $type,\n\t\t\t\t'id_objet' => $id,\n\t\t\t)\n\t\t);\n\t\tif ($liens){\n\t\t\tif ($pos = strpos($flux['data'],'<!--affiche_milieu-->'))\n\t\t\t\t$flux['data'] = substr_replace($flux['data'], $liens, $pos, 0);\n\t\t\telse\n\t\t\t\t$flux['data'] .= $liens;\n\t\t}\n\t}\n\t\n\treturn $flux;\n}", "function cl_ensino() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"ensino\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_sau_agendaexames() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_agendaexames\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function RellenarMinuta()\r\n {\r\n $this->AddPage();\r\n\r\n $this->RellenarTitulo();\r\n\r\n $this->RellenarAsistentes();\r\n\r\n $this->RellenarStatusCompromisosYAsistencias();\r\n\r\n $this->RellenarIndice();\r\n\r\n $this->RellenarDesarrolloReunion();\r\n }", "function cl_criterioavaliacaodisciplina() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"criterioavaliacaodisciplina\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function getLeja(){\r\n return $this->leja;\r\n }", "public function getCustom();", "public function getCustom();", "public function getCustom();", "function archobjet_autoriser() {\n}", "public function manga(){\t\n\t\t\t$LimitRowPegination = 4;\n\t\t\t$API_LastUpdateManga = SiteMap::LastUpdateManga(18,0,$LimitRowPegination);\n\t\t\t$PTR_API['API_LastUpdateManga'] = $API_LastUpdateManga;\n\t\t\t$this->load->view('seo/sitemap_manga',$PTR_API);\n\t\t}", "function cl_sau_triagemavulsa() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_triagemavulsa\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function mots_autoriser() {\n}", "function configurar() {\n //SOLO EL ADMINISTRADOR PUEDE MATRICULAR\n if(!$this->AppUser->isRoot())\n return $this->vista->acceso_restringido();\n\n $this->includeModel('TComponente');\n\n //TODO: actualizar el codigo del programa a matricular.\n $cod_programa = $this->params['cod_programa'];\n $this->vista->addJS('jquery.dataTable');\n\n $tiene_cursos = $this->TPrograma->tieneCursos($cod_programa);\n \n $this->vista->set('tiene_cursos', $tiene_cursos);\n if(!$tiene_cursos){\n if($this->TPersona == null)\n $this->TPersona = new TPersona();\n $tiene_participantes = $this->TPersona->hayAdmitidos();\n $this->vista->set('tiene_participantes', $tiene_participantes);\n }\n \n $this->vista->display();\n }", "function conf(){\n $this->s__perfil = toba::manejador_sesiones()->get_perfiles_funcionales();\n // print_r($this->s__perfil); \n \n $p = array_search('autoridad_mesa', $this->s__perfil);\n if($p !== false){//Es autoridad de mesa\n //Cargar datos del usuario especifico\n //obtengo el nombre de usuario logueado\n $usr = toba::manejador_sesiones()->get_id_usuario_instancia();\n \n $id_mesa = $this->dep('datos')->tabla('mesa')->get_de_usr($usr);\n if(sizeof($id_mesa)>0){\n $this->s__id_mesa = $id_mesa[0]['id_mesa'];\n $datos['id_mesa'] = $this->s__id_mesa;\n $this->dep('datos')->tabla('mesa')->cargar($datos);\n $this->s__mesa = $this->dep('datos')->tabla('mesa')->get();\n \n if($this->s__mesa['estado'] >= 2){//Ya fue validado por la secretaria\n $this->controlador()->evento('procesar')->ocultar();\n $this->controlador()->evento('enviar')->ocultar();\n }\n }\n else//No se encuentra mesa asociada al usuario logueado\n toba::notificacion()->agregar(\"No se encuentra el usuario ingresado\",\"info\");\n }\n else{\n $this->s__id_mesa = toba::memoria()->get_parametro('c');//el parametro c tiene el id mesa\n \n $this->s__retorno = toba::memoria()->get_parametro('k');//el parametro k tiene la dir de retorno\n $this->s__retorno_estado = toba::memoria()->get_parametro('f');\n \n \n $datos['id_mesa'] = $this->s__id_mesa;\n $this->dep('datos')->tabla('mesa')->cargar($datos);\n $this->s__mesa = $this->dep('datos')->tabla('mesa')->get();\n \t\n $p = array_search('junta_electoral', $this->s__perfil);\n if($p !== false){//Es junta electoral\n $this->controlador()->evento('procesar')->set_etiqueta('Confirmar');\n $this->controlador()->evento('enviar')->ocultar();\n\n if($this->s__mesa['estado'] > 3){//Ya fue validado por la secretaria\n// $this->dep('form_ml_directivo')->set_solo_lectura('votos');\n// $this->dep('form_ml_superior')->set_solo_lectura('votos');\n// $this->dep('form_ml_extra')->set_solo_lectura('votos');\n $this->controlador()->evento('procesar')->ocultar();\n $this->controlador()->evento('enviar')->ocultar();\n }\n }\n else{\n $p = array_search('secretaria', $this->s__perfil);//print_r(isset($p)?'no es false':'es false');\n if($p !== false){//Es secretaria\n $this->controlador()->evento('procesar')->set_etiqueta('Validar');\n $this->controlador()->evento('enviar')->ocultar();\n\n }\n \n }\n }\n \n if(isset($this->s__id_mesa)){//Si el pedido viene de la operacion Confirmar/Cargar// \n $this->s__claustro = $this->s__mesa['id_claustro'];\n $this->s__id_nro_ue = $this->dep('datos')->tabla('sede')->get_unidad($this->s__mesa['id_sede']);\n $this->s__id_sede = $this->s__mesa['id_sede'];\n }\n }", "function cc_set_in_vetrina(){\n\t\n\t$path = ABSPATH . \"import/\";\n\t$file = FILE_XML_IMMOBILI; // nome del file\n\t$cometa = cc_get_unique_post_meta_values(\"_id_cometa\");\n\n\t$xml = @simplexml_load_file($path.$file);\t\n\n\tif($xml){\t\t\n\t\t\n\t\t$offerte = $xml->Offerte;\n\n\t\tif($offerte){\n\t\t\t\n\t\t\tforeach($offerte as $offerta){\n\t\t\t\t\n\t\t\t\t$idunique = (int) $offerta->Idimmobile; // campo univoco Cometa\n\t\t\t\t$post_id = array_search($idunique, $cometa);\n\t\t\t\t\n\t\t\t\tif(empty($post_id)) continue;\n\t\t\t\t\n\t\t\t\t$vetrina = (int) $offerta->Vetrina;\n\t\t\t\t\n\t\t\t\tupdate_post_meta( $post_id, \"fave_featured\", $vetrina );\n\n\t\t\t}\n\t\t\t\n\t\t\t$dbg = var_export($results, true);\n\t\n\t\t\tcc_import_immobili_error_log($dbg);\n\n\t\t\t\n\t\t}else{\n\t\t\tcc_import_immobili_error_log(\"no offerte!\");\n\t\t}\n\t\t\n\t}else{\n\t\tcc_import_immobili_error_log(\"no xml!\");\n\t}\n\t\n}", "function cl_alunos() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"alunos\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function ambas()\n {\n print \"Ejecución de la función ambas<br>\";\n # mediante $this-> requerimos la ejecución de metodo prueba\n # de la clase actual\n $this->prueba();\n # al señalar parent:: requerimos la ejecución de metodo prueba\n # de la clase padre\n parent::prueba();\n }", "function cl_sau_agendaexames() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_agendaexames\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function medias_autoriser(){}", "function cl_sau_receitamedica() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_receitamedica\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function modificarMaquinaria(){\n\t\t$this->procedimiento='snx.ft_maquinaria_ime';\n\t\t$this->transaccion='SNX_MAQ_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_maquinaria','id_maquinaria','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('potencia','potencia','numeric');\n\t\t$this->setParametro('peso','peso','numeric');\n\t\t$this->setParametro('maquinaria','maquinaria','varchar');\n\t\t$this->setParametro('id_factorindexacion','id_factorindexacion','int4');\n\t\t$this->setParametro('id_tipopreciomaquinaria','id_tipopreciomaquinaria','int4');\n\t\t$this->setParametro('id_ambitoprecio','id_ambitoprecio','int4');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function cl_liccomissao() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"liccomissao\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_aguacoletorexporta() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"aguacoletorexporta\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_rhsolicita() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhsolicita\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_empagemovslips() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"empagemovslips\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function tampilDataGalang(){\n\t\t\n\t}", "function cl_avaliacaoestruturanota() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"avaliacaoestruturanota\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_alunoaltcampos() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"alunoaltcampos\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function insertarMaquinaria(){\n\t\t$this->procedimiento='snx.ft_maquinaria_ime';\n\t\t$this->transaccion='SNX_MAQ_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('potencia','potencia','numeric');\n\t\t$this->setParametro('peso','peso','numeric');\n\t\t$this->setParametro('maquinaria','maquinaria','varchar');\n\t\t$this->setParametro('id_factorindexacion','id_factorindexacion','int4');\t\t\n\t\t$this->setParametro('id_tipopreciomaquinaria','id_tipopreciomaquinaria','int4');\n\t\t$this->setParametro('id_ambitoprecio','id_ambitoprecio','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function cl_cemiteriorural() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"cemiteriorural\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function mostraPagina()\n\t\t{\n\t\t$this->aggiungiElemento(\"Scheda argomento\", \"titolo\");\n\t\t$this->aggiungiElemento($this->modulo);\n\t\t$this->mostra();\n\t\t\t\n\t\t}", "function modificarMetodologia(){\n\t\t$this->procedimiento='gem.f_metodologia_ime';\n\t\t$this->transaccion='GEM_GEMETO_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_metodologia','id_metodologia','int4');\n\t\t$this->setParametro('codigo','codigo','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function __construct() {\n self::$presidencia=new Camara(\"CamaraPresidencia\");\n self::$alumnos1=new Camara(\"CamaraAlumnos1\");\n self::$alumnos2=new Camara(\"CamaraAlumnos2\");\n }", "public static function stockAttribu() {\n $results = ModelStockAttribu::getAllIdcentre();\n $results1= ModelStockAttribu::getAllIdvaccin();\n // ----- Construction chemin de la vue\n include 'config.php';\n $vue = $root . '/app/view/stock/viewAttribution.php';\n require ($vue);\n }", "function I4Web_LMS() {\n return I4Web_LMS::instance();\n}", "public function liebiao()\n {\n\n // $this->assign('articles',$articles);\n // $info['cate'] = Db::name('article_cate')->select();\n // $info['admin'] = Db::name('admin')->select();\n $liebiao=\"fdsfds\";\n $this->assign('liebiao',$liebiao);\n return $this->fetch();\n }", "function cl_pcorcamfornelic() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"pcorcamfornelic\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function contrato()\r\n\t{\r\n\t}", "function add_smaakbeschrijvinglang_metabox(){\n\tadd_meta_box(\n\t\t'smaakbeschrijvinglang_metabox',//id\n\t\t'Lange smaakbeschrijving',//title\n\t\t'content_smaakbeschrijvinglang_metabox',//callback\n\t\t'smaak',//page\n\t\t'normal', //context\n\t\t'high'//priority\n\t\t);\n}", "function metas_autoriser() {\n}", "public function leer(){\n }", "public function leer(){\n }", "protected function _construct()\n {\n \t$this->_isEnabled = Mage::getStoreConfig('ceesenco_maattabel/configuration/enabled');\n \t$this->_accountid = Mage::getStoreConfig('ceesenco_maattabel/configuration/accountid');\n \t$this->_width = Mage::getStoreConfig('ceesenco_maattabel/configuration/width');\n \t$this->_height = Mage::getStoreConfig('ceesenco_maattabel/configuration/height');\n \t$this->_label = Mage::getStoreConfig('ceesenco_maattabel/configuration/label');\n \t$this->_lang = Mage::getStoreConfig('ceesenco_maattabel/configuration/lang');\n\n \t$this->_categorie = Mage::getSingleton(\"eav/config\")->getAttribute(\"catalog_category\", 'maattabel_categorie')->getSource()->getOptionText(Mage::getSingleton('catalog/layer')->getCurrentCategory()->getData('maattabel_categorie'));\n \tif ($this->_categorie == \"\") {\n\t\t $current_product = Mage::registry('current_product');\n\t\t if(is_object($current_product))\n\t\t {\n\t\t $categories = $current_product->load($current_product->getId())->getCategoryIds();\n\t\t if (is_array($categories) and count($categories))\n\t\t {\n \t\t\t\t\t$this->_categorie = Mage::getSingleton(\"eav/config\")->getAttribute(\"catalog_category\", 'maattabel_categorie')->getSource()->getOptionText(Mage::getModel('catalog/category')->load($categories[count($categories)-1])->getData('maattabel_categorie'));\n\t\t }\n\t\t }\n \t}\n \t$temp = explode(\" - \", $this->_categorie);\n \t$this->_categorie = $temp[0];\n }", "public function __construct(){\n //Se solicita informacion a la BD, se llama al metodo modelo de la clase Controlador, que devuelve una instacia del objeto \n $this->ConsultaLogin_M = $this->modelo(\"Login_M\");\n }", "function index(){\n\t\t$this->load->library('lita');\n\t\t// code ini untuk memanggil method yang ada pada library lita\n\t\t$this->lita->nama_saya();\n\t\t\t\techo \"<br/>\";\n\t\t\t\t// code ini untuk memanggil method dengan parameter\n $this->lita->nama_kamu(\"Lita\");\n\t}", "function cl_aguacalc() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"aguacalc\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function News()\n{\n\t$this->type_moi = \"news\";\n}", "function cl_tfd_bpamagnetico() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tfd_bpamagnetico\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function maquetacioItemsAgendaHoudini($model, $columna, $nomCaixa, $tipusCaixa, $ordre, $estilCaixa, $estilLlistat, $estilElement, $id_registre, $id_newsletter, $registre, $pathEditora)\n{\n global $CONFIG_URLBASE , $CONFIG_URLUPLOADIM; \n $parametres = '<input type=\"hidden\" name=\"newsletter['.htmlspecialchars($model).']['.htmlspecialchars($columna).']['.htmlspecialchars($nomCaixa).']['.htmlspecialchars($tipusCaixa).'][]['.htmlspecialchars($estilCaixa).']['.htmlspecialchars($estilLlistat).']['.htmlspecialchars($estilElement).']\" value=\"'.htmlspecialchars($id_registre).'\" />';\n \n $registre['ORIGEN'] = '<h4><a href=\"'.$CONFIG_URLBASE . $pathEditora . $registre['ID'] . '/' . $registre['URL_TITOL'] . '\" rel=\"external\" style=\"text-decoration:none;\">'.$registre['TITOL'].'</a></h4>';\n $imatge = $registre['IMATGE1'] != '' ? '<img src=\"' . $CONFIG_URLUPLOADIM . $registre['IMATGE1'] . '\" style=\"width: 159px;\" class=\"left\"/>' : '';\n \n return '<li id=\"ageh_reg' . $id_registre . '\" class=\"box removable stylable '.$estilElement.'\">\n\t\t\t'.$parametres.'\n\t\t\t<div class=\"spacer clearfix\">\n\t\t\t ' . $imatge . '\n\t\t\t\t'.$registre['ORIGEN'].'\n\t\t\t\t'.$registre['RESUM'].'\n\t\t\t</div>\n\t\t</li>';\n}", "function getAmbiente()\n {\n return $this->ambi;\n }", "public function getModele()\n{\nreturn $this->modele;\n}", "function cl_far_listacontroladomed() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"far_listacontroladomed\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function ini__operacion (){\n \n //obtenemos el arreglo almacenado en la operacion \"aulas disponibles\". Su formato es :\n //Array ('id_aula'=>x 'hora_inicio'=>x 'hora_fin'=>x)\n $datos_ad=toba::memoria()->get_parametros();\n //esta condicion es fundamental para no quedarnos en la misma pantalla\n if(isset($datos_ad['id_aula'])){\n $this->s__accion=\"Vinculo\";\n $this->s__aula_disponible=$datos_ad;\n \n //eliminamos la informacion guardada en el arreglo $_SESSION\n toba::memoria()->limpiar_memoria();\n $this->set_pantalla('pant_persona');\n }\n }", "private function mauteur() {\n\t\t$id = intval(Utils::getGet('id'));\n\t\tif($id > 0) {\n\t\t\t$this->_ctrlAuteur = new ControleurAuteur();\n\t\t\t$this->_ctrlAuteur->auteurModifie($id);\n\t\t} else {\n\t\t\tthrow new Exception('Id incorrect !!!');\n\t\t\t}\n\t}", "function cl_ouvidoriaatendimento() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"ouvidoriaatendimento\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function formulaires_ajouter_abonne_traiter_dist(){\r\n\tinclude_spip('inc/gestionml_api');\r\n\treturn gestionml_api_ajouter_email(_request('liste'),_request('email')) ;\r\n}", "public function bersuara(){\n return \"miawww\";\n}", "public function themLoaiMon(){\n \treturn view(\"admin.loaimon.them\");\t\n }", "public function luas()\n {\n return $this->panjang * $this->lebar;\n }" ]
[ "0.6340477", "0.63033456", "0.5978593", "0.59154034", "0.590642", "0.5850214", "0.5848934", "0.5823389", "0.5803323", "0.579613", "0.5783415", "0.57683945", "0.57295746", "0.5727861", "0.57224286", "0.5694523", "0.5663771", "0.56549394", "0.56521326", "0.5650222", "0.56457776", "0.5642734", "0.56426954", "0.56042886", "0.56019044", "0.55820435", "0.55627984", "0.553855", "0.55323243", "0.5526685", "0.5512284", "0.5490504", "0.5484666", "0.54792476", "0.54779536", "0.5467452", "0.5454701", "0.545432", "0.54088223", "0.540654", "0.5406322", "0.5405963", "0.54037756", "0.5401912", "0.53975576", "0.5388646", "0.5376204", "0.5374986", "0.5374986", "0.5374986", "0.5369335", "0.5368144", "0.5358237", "0.5357996", "0.5350747", "0.5348787", "0.53449595", "0.53434896", "0.5339268", "0.53264827", "0.5323042", "0.5319592", "0.5318135", "0.5313763", "0.53066075", "0.52956814", "0.5284585", "0.52844375", "0.52839386", "0.52816373", "0.5280735", "0.5279922", "0.5276643", "0.5275671", "0.5254182", "0.52519846", "0.5250881", "0.52479804", "0.5239414", "0.5239068", "0.52371013", "0.5234466", "0.5228105", "0.5228105", "0.5227908", "0.52276623", "0.5226494", "0.5222902", "0.52187574", "0.52159697", "0.5196959", "0.5193629", "0.51884097", "0.5186828", "0.5179658", "0.5174949", "0.5173614", "0.516945", "0.5169079", "0.51660466", "0.5166001" ]
0.0
-1
/ Users details get cache data or query db
public function getUserDetailsAction($userId) { $service = $this->get('users.users_service_cache'); try { $userDetails = $service->getUserDetails($userId); } catch (\Exception $ex) { throw $ex; } return $this->render('UsersBundle:Users:details.html.twig', array('userDetails' => $userDetails)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDataByDatabase()\n {\n $condition = [\n ['user_id', '>', '39454']\n ];\n db()->table('tp_users')->where($condition)->cache('userList', 60)->select();\n $data = Cache::get('userList');\n dump($data);die;\n }", "public function info($key) {\n\t\t$cacheInfo = apc_cache_info('user');\n\t\tDebug::dump($cacheInfo);\t\t\n\t\t//return $dataInfo;\n\t}", "public function listUsers()\n {\n global $db;\n $user_db_data = array();\n $cache = Cache::getInstance();\n // $cache->flush();\n if($cache->exists(\"user_info_data\"))\n {\n $user_db_data = $cache->get(\"user_info_data\");\n } else { \n $e = $db->prepare(\"SELECT * FROM user_info\");\n $e->execute();\n $user_data = $e->fetchAll(); \n // cache will clear in every 1 min.\n $cache->set(\"user_info_data\", $user_data, 60 * 60 * 0.1);\n $user_db_data = $user_data;\n }\n return $user_db_data;\n }", "function fetch_user_by_id($id) {\n if(!cache_isset('taxi_!uid_'.$id)) {\n if(cache_isset('taxi_uid_'.$id)) {\n return cache_get('taxi_uid_'.$id);\n } else {\n global $DB;\n connect_db();\n $result=$DB->users->findOne(['id'=>$id]);\n if(is_array($result)) {\n cache_set('taxi_uid_'.$id,$result);\n } else {\n cache_set('taxi_!uid_'.$id,true)\n }\n return $result;\n }\n }\n}", "public function stats(){\n\t\treturn apc_cache_info('user',true);\n\t}", "public function userdatatable(){\n $this->load->model('Admin_Model');\n\n // $this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file'));\n\n // if ( ! $user = $this->cache->get('foo'))\n // {\n // echo 'Saving to the cache!<br />';\n // $this->output->cache(1);\n $user = $this->Admin_Model->getuserdata();\n\n // Save into the cache for 5 minutes\n // $this->cache->save('foo', $user, 300);\n $this->load->view('userdatatable',array('user'=>$user));\n // }\n\n\n\n \n}", "function metadata()\r\n {\r\n Cache::variable($this->metadata, function() {\r\n return (array)DB::object('userMetadataById', $this->id);\r\n });\r\n }", "public function getFromCache() {}", "public function getAccount($cache = TRUE);", "function update_user_caches($user)\n {\n }", "public static function user()\n\t{\n return IoC::resolve( 'user_cache', array( Auth::user()->username ) );\n\t}", "function cache_users($user_ids)\n {\n }", "abstract protected function cacheData();", "public static function get_user_data()\n {\n }", "private function cacheFetch() {\n //$data = cache_get($this->id, 'cache');;\n $data = NULL;\n if ($data) {\n foreach ($this->properties as $prop) {\n if (isset($data->data[$prop]) && !empty($data->data[$prop])) {\n $this->$prop = $data->data[$prop];\n }\n }\n }\n }", "function fetch_user_by_nick($nick) {\n if(!cache_isset('taxi_!un_'.$nick)) {\n if(cache_isset('taxi_un_'.$nick)) {\n return fetch_user_by_id(cache_get('taxi_un_'.$nick));\n } else {\n global $DB;\n connect_db();\n $result=$DB->users->findOne(['nick'=>$nick]);\n if(is_array($result)) {\n cache_set('taxi_uid_'.$result['id'],$result);\n cache_set('taxi_un_'.$result['nick'],$result['id']);\n } else {\n cache_set('taxi_!un_'.$nick);\n }\n return $result;\n }\n }\n}", "protected function fetch_data(&$cache)\n {\n }", "public function cacheGet() {\n }", "public function getCache();", "public function actionIndex()\n {\n// $cache->name = './a/txt';\n//\n// $data = $cache->get();\n// $cache->add('abcd',$data);\n\n\n $page = isset($_GET['page'])?$_GET['page']:1;\n $limit=($page-1)*5;\n $user = M('UserModel');\n $uid = isset($_COOKIE['uid']) ? $_COOKIE['uid'] : '';\n $users=[];\n if ($uid) {\n $users = $user->find(['u_id' => $uid]);\n }\n $article = M('ArticleModel');\n $nums = $article->field('count(*) as nums')->join(['user', 'article.user_id', 'user.u_id'])->select();\n $article = M('ArticleModel');\n $data = $article->field('*')->join(['user', 'article.user_id', 'user.u_id'])->orderBy('add_time desc')->limit($limit,5)->select();\n $page_nums = $nums[0]['nums'];\n $page_num = floor($page_nums/5);\n if(IS_AJAX){\n Response::$format=Response::FORMAT_JSON;\n return ['code'=>200,'data'=>$data,'page_num'=>$page_num];\n }else{\n return $this->render('index', ['data' => $data,'user'=>$users,'page_num'=>$page_num]);\n }\n }", "public function getFromCache_queryRow() {}", "function paces_get_users_all_details( $user_id ){\n return get_metadata( 'user', $user_id );\n}", "function all_settings( $key ) {\n \n $CI = & get_instance();\n $cache_key = get_cache_id().'user_info';\n $cache_data = get_cache_data( $cache_key );\n \n if( $cache_data ) {\n $all_settings = $cache_data;\n \n }else{\n \n $CI->load->model('users_model');\n $user_information = $CI->users_model->get_user_information_by_id( get_user_id() );\n \n set_cache_data( $cache_key ,$user_information);\n \n $all_settings = $user_information;\n }\n \n \n if( $key ){\n return (isset($all_settings[$key]))?$all_settings[$key]:\"\";\n }\n \n return $all_settings;\n}", "function getUser(){\n $db=new connect();\n $select=\"select * from users\";\n return $db->getList($select);\n }", "private function getUserInfo()\n {\n // TODO This could be cached\n return $this->userInfoApi->getUserInfo();\n }", "protected function fetchUserSessionFromDB() {}", "public function getUserData($userId);", "abstract public function getUserInfo();", "public function getUserInfo() {}", "private function get_userInfo() {\n $params = [ 'user_ids' => $this->user_id ];\n $result = $this->api->users->get($params);\n $params['fields'] = '';\n $result2 = $this->api2->users->get($params);\n $result['hidden'] = (int)array_has($result2, 'hidden');\n return $result;\n }", "function user_details() {\r\n\t\t\t$query = $this->pdo->prepare(\"select * from user_account\");\r\n\t\t\t$query->execute();\r\n\t\t\treturn $query->fetchAll();\r\n\t\t}", "public function getUserInfo()\n {\n $CI = &get_instance();\n if (!$this->loggedIn()) {\n return null;\n } else {\n $id = $CI->session->userdata('user_id');\n return $CI->user_model->get($id);\n }\n }", "function getUsers(){\n }", "function getUsers(){\n }", "public function getUserDetails() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n $username = $this->request->input(\"username\");\n if ($username) {\n $where[] = [\"username\", \"=\", $username];\n }\n\n $userIdEqual = $this->request->input(\"user_id_equal\");\n if ($userIdEqual) {\n $where[] = [\"user_id\", \"=\", $userIdEqual];\n }\n\n $userIdNotEqual = $this->request->input(\"user_id_not_equal\");\n if ($userIdNotEqual) {\n $where[] = [\"user_id\", \"!=\", $userIdNotEqual];\n }\n\n\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getData();\n\n return $users;\n }", "public function cachePerUser(array $access_rules);", "public function getUser( $data )\r\n\t\t{\r\n\t\t\treturn DB::query( \"SELECT * FROM user WHERE username=:username AND password_hash=:password_hash AND status=1\", $data, true );\t\t\r\n\t\t}", "function cache_get($cid, $table = 'cache') {\n global $trampoline_cache;\n\n //Use a simple variable based cache.\n //Cache will automatically expire after request completion\n if (is_array($trampoline_cache) && array_key_exists($table . '_' . $cid, $trampoline_cache) && $trampoline_cache[$table.'_'.$cid]) {\n return array('data' => $trampoline_cache[$table.'_'.$cid]);\n } else {\n return FALSE;\n }\n}", "public function user_list($key_word,$type,$type_id,$offset,$per_page,$deletekey,$cache_type=0){\n ##Cach Toools Start######\n if($type_id==null){$typeid='all';}else{$typeid=$type_id;}\n $cachekey=\"key-tbl-user-2018-rows-keyword-\".$key_word.'-type-'.$type.'-typeid-'.$typeid.'-offset-'.$offset.'-per_page-'.$per_page;\n $cachetime=60*60*60*1;\n $cache_day=$cachetime/(60*60*60*1);\n //cachefile \n $cachetype='2'; \n $this->load->model('Cachtooluser_model');\n $sql=null;\n $dir='usertype';\n $cachechk=$this->Cachtooluser_model->cachedbgetkey($sql,$cachekey,$cachetime,$cachetype,$deletekey,$dir);\n $cachechklist=$cachechk['list'];\n //echo' Form Cache <hr> <pre> cachechklist =>';print_r($cachechklist);echo'<pre>'; //Die();\n if($cachechklist!=null && $cache_type!=0){\n #echo' Form Cache <hr> <pre> cachechk =>';print_r($cachechk);echo'<pre>'; \n $list=$cachechk['list'];\n #echo' Form Cache <hr> <pre> list =>';print_r($list);echo'<pre>'; \n $list=$cachechk['list'];\n $message=$cachechk['message'];\n $status=$cachechk['status'];\n $count=$cachechk['count'];\n $cachetime=$cachechk['cachetime'];\n $cache_key=$cachechk['cachekey'];\n $rs=$list;\n $dataresult=$rs;\n $cache_msg='Form Cache File Results';\n $dataresult_all=array('rs'=>$dataresult,\n 'cache_msg'=>$cache_msg,\n 'cache_key'=>$cache_key,\n 'cachetime'=>$cachetime,\n 'cache_day'=>$cache_day);\n }\n elseif($cachechklist==null || $cache_type==0){\n ################################\n $this->db->cache_off();\n //$this->db->cache_delete_all();\n $this->db->select('tbl_user_2018.*,sd_user_type.user_type_title');\n $this->db->from('tbl_user_2018');\n $this->db->join('sd_user_type', 'sd_user_type.user_type_id=tbl_user_2018.user_type_id');\n if($type_id!==null){\n $this->db->where('sd_user_type.user_type_id',$type_id); \n } \n if($key_word!==null){\n $this->db->like('tbl_user_2018.name',$key_word); \n $this->db->or_like('tbl_user_2018.surname',$key_word); \n $this->db->or_like('tbl_user_2018.email',$key_word); \n $this->db->or_like('tbl_user_2018.position',$key_word); \n $this->db->or_like('tbl_user_2018.company',$key_word);\n $this->db->or_like('tbl_user_2018.company_group',$key_word);\n }\n $order_by='asc';\n $this->db->order_by('tbl_user_2018.user_idx',$order_by);\n\n $this->db->limit($per_page,$offset);\n $query_get=$this->db->get();\n $num=$query_get->num_rows();\n $query_result=$query_get->result(); \n $rs=$query_result;\n $dataresult=$rs;\n ################################\n $cache_msg='Form SQL Query Results';\n $dataresult_all=array('rs'=>$dataresult,'cache_msg'=>$cache_msg);\n $dataresult_all=array('rs'=>$dataresult,\n 'cache_msg'=>$cache_msg,\n 'cache_key'=>$cachekey,\n 'cachetime'=>$cachetime,\n 'cache_day'=>$cache_day);\n \n //echo'<hr> <pre> $dataresult_all=>';print_r($dataresult_all);echo'<pre>'; Die();\n \n ################################\n if($cache_type!=0){\n $this->load->model('Cachtooluser_model');\n $sql=null;\n $dir='usertype';\n $cacheset=$this->Cachtooluser_model->cachedbsetkey($sql,$dataresult,$cachekey,$cachetime,$cachetype,$deletekey,$dir);\n //echo'<hr><pre> $cacheset=>';print_r($cacheset);echo'<pre> <hr>';die();\n $rs=$cacheset['list'];\n $num=count($rs);\n $cache_msg=$cacheset['message'];\n }\n\n }\n ##Cach Toools END######\n ################################################ \n return $dataresult_all;\n }", "public function anyData()\n {\n $users = \\Cache::remember('users', 10, function () {\n $query = \\DB::table('users')->select(DB::raw('id, name, email, last_logged_in_at, created_at, updated_at'))->get();\n\n return $query;\n });\n\n return Datatables::of($users)->make(true);\n }", "function user_details ()\n\t\t{\n\t\t $query = \"select * from user_details\" ; \n\t\t\t$data = mysql_query($query) ;\n\t\t\treturn $data ; \n\t\t}", "function getMembersOnline(): int\n{\n return cache()->remember('i.membersOnline', getCacheILifetime('membersOnline'), function () {\n $onlinePeriod = 10; // minutes\n return \\App\\Models\\PageViews::select('user_ip')\n ->distinct()\n ->where('created_at', '>', now()->subMinutes($onlinePeriod))\n ->where('user_id', '!=', '')\n ->count(['user_ip']);\n });\n}", "function get_user_info(){\t\t\n\t\t// Fetch user data from database\n\t\t$user_data_array=$this->UserModel->get_user_data(array('member_id'=>$this->session->userdata('member_id')));\n\t\techo $user_data_array[0]['company'].\"|\".$user_data_array[0]['address_line_1'].\"|\".$user_data_array[0]['city'].\"|\".$user_data_array[0]['state'].\"|\".$user_data_array[0]['zipcode'].\"|\".$user_data_array[0]['country_id'].\"|\".$user_data_array[0]['country_name'];\n\t}", "public function getUserInfo()\n {\n }", "function getUserInfo(){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$user = $this->askFlickr('people.getinfo','user_id='.$this->user);\n\n\t\t/* Return User info */\n\t\treturn $user;\n\t}", "function user_get()\n {\n $id = $this->get('id');\n if ($id == '') {\n $user = $this->db->get('auth_user')->result();\n } else {\n $this->db->where('id', $id);\n $user = $this->db->get('auth_user')->result();\n }\n $this->response($user, 200);\n }", "public function index()\n {\n ini_set ('memory_limit', '800M');\n\n $vo [0]=[\n 'user'=>111,\n 'name'=>222,\n 'phone'=>333\n ];\n $vo [1]=[\n 'user'=>111,\n 'name'=>222,\n 'phone'=>333\n ];\n\n Cache::set('listtest',$vo,0);\n\n // $vo=json_encode($vo);也可以存json字符串\n\n $res = Cache::get('listtest');\n\n dump($res);\n\t\techo 'lalalalal';\n }", "function getUserInfo() {\n\t$page = $this -> get('http://vk.com/al_profile.php') -> body;\n\n\t$pattern = '/\"user_id\":([0-9]*),\"loc\":([\"a-z0-9_-]*),\"back\":\"([\\W ]*|[\\w ]*)\",.*,\"post_hash\":\"([a-z0-9]*)\",.*,\"info_hash\":\"([a-z0-9]*)\"/';\n\tpreg_match($pattern, $page, $matches);\n\tarray_shift($matches);\n\t\n\t$this -> user['id'] = $matches[0];\n\t$this -> user['alias'] = $matches[1];\n\t$this -> user['name'] = $matches[2];\n\t$this -> user['post_hash'] = $matches[3];\n\t$this -> user['info_hash'] = $matches[4];\n\n\treturn $this -> user;\n\t}", "public function getUserData()\n {\n exit(json_encode(['data' => $this->users_model->get_users()]));\n }", "public static function getCache() {}", "public function getAll($cache = true) {}", "public function fetchData(){\n\n\t\t//get all the users'\n $user = DB::table('users')->get();\n\n //admin dashboard.\n $title = 'Fetch.';\n\n return View('accounts.fetchData', compact('user'))\n ->with('title', $title);\n\t}", "function ambil_data(){\n\t\treturn $this->db->get('user');\n\t}", "public function getSocialRecordFromCache($gid);", "function App_Cache() {\n\t\t\treturn App_Cache::instance()->getAdapter();\n\t\t}", "public function fetchStats()\n\t{\n\t\t$statsData = array();\n\t\t\n\t\t// Get all cache action\n\t\t$select = $this->_statsTable->select()\n\t\t\t\t\t\t\t\t\t->where('session_id = ?', $this->_sessionId);\n\t\t$rowSet = $this->_statsTable->fetchall($select);\n\t\t$statsData['AllActionCount'] = 0;\n\t\tforeach ($rowSet as $row)\n\t\t{\n\t\t\t$statsData['AllAction'][] = $row->toArray();\n\t\t\t$statsData['AllActionCount'] += 1;\n\t\t}\n\t\t\n\t\t// Calculate current cache use for every scope;\n\t\t//SELECT * FROM stats_ivc_cache WHERE session_id = 12 AND (action = \"insert\" OR action = \"cache_hit\") GROUP BY full_key;\n\t\t$select = $this->_statsTable->select()\n\t\t\t\t\t\t\t\t\t->where('session_id = ?', $this->_sessionId)\n\t\t\t\t\t\t\t\t\t->where('action = \"insert\" OR action = \"cache_hit\" OR action = \"replace\"')\n\t\t\t\t\t\t\t\t\t->group('full_key');\n\t\t$rowSet = $this->_statsTable->fetchall($select);\n\t\t$statsData['totalUse'] = 0;\n\t\t$statsData['ivcUse'] = 0;\n\t\t$statsData['clubUse'] = 0;\n\t\t$statsData['userUse'] = 0;\n\t\tforeach ($rowSet as $row)\n\t\t{\n\t\t\t$statsData['keyUseList'][$row['full_key']] = $row->toArray();\n\t\t\t$statsData['totalUse'] += $row['size'];\n\t\t\t$statsData[$row['scope'] . 'Use'] += $row['size'];\n\t\t}\n\t\t\n\t\t// Calculate average use of user session ... need user session for that\n\t\t\n\t\treturn ($statsData);\n\t}", "public function get($cache_name);", "public static function getCache() {\n\n if (Config::get('app.cache') != 0 && !Auth::check()) { //\n $page = (Paginator::getCurrentPage() > 1 ? Paginator::getCurrentPage() : '');\n $key = 'route-' . Str::slug(Request::fullurl()) . $page;\n\n if (Cache::has($key)) {\n die(Cache::get($key));\n }\n }\n }", "public static function getAllAppUser()\n {\n $key = self::getCacheKey('getAllAppUser');\n\n if (!$result = Bll_Cache::get($key)) {\n $_dalUser = self::getDalUser();\n $result = $_dalUser->getAllAppUser();\n\n if ($result) {\n //5 minute\n Bll_Cache::set($key, $result, 5*60);\n }\n }\n\n return $result;\n }", "public function fetchAll()\r\n {\r\n \t// get from mem if available\r\n \t$memcache = new \\Memcached();\r\n \t$memcache->addServer('localhost', 11211);\r\n \t$key = md5(catalogProductList::MEMCACHED_FETCH_ALL);\r\n \t$cache_data = $memcache->get($key);\r\n \tif ($cache_data) {\r\n \t\t$this->log->addInfo('cache hit', array(\"key\" => $key));\r\n \t\t$this->data = $cache_data;\r\n \t} else {\r\n\t\t\t$this->data = $this->client->catalogProductList($this->sessionid);\r\n\t\t\t$memcache->set($key, $this->data, 60*1);\r\n \t}\r\n }", "public function getData()\n {\n return $this->db->get('user')->result();\n }", "public function getData()\n\t{\n\t\t$cacheManager = Application::getInstance()->getManagedCache();\n\t\t$result = NULL;\n\t\t\n\t\tif ($cacheManager->read(self::CACHE_TTL, $this->cacheId))\n\t\t{\n\t\t\t$result = $cacheManager->get($this->cacheId);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $this->getDataFromVk();\n\t\t\t\n\t\t\t$cacheManager->set($this->cacheId, $result);\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "protected function obtainCacheDependentData()\n\t{\n\t}", "protected function getUserInfo($app, $accessToken)\n\t{\n\t\t// exists in cache?\n\t\t$memcached = $app['memcached'];\n\t\t$userInfo = $memcached->get('myroutes_userinfo');\n\n\t\t// not a cache hit, fetch live data\n\t\tif($userInfo === false)\n\t\t{\n\t\t\t$endpoint = $app['url_generator']->generate('user_me', array('access_token' => $accessToken), true);\n\n\t\t\t$response = $app['http_client']->get($endpoint, null)->send();\n\t\t\t$json = json_decode((string) $response->getBody(), true);\n\n\t\t\tif(array_key_exists('user', $json))\n\t\t\t{\n\t\t\t\t$userInfo = $json['user'];\n\t\t\t\t$memcached->set('myroutes_userinfo', $userInfo);\n\t\t\t}\n\t\t}\n\n\t\treturn $userInfo;\n\t}", "public function readUserAuth(){\n $user = new \\Filebase\\Database([\n 'dir' => $this->getDataSource()\n ]);\n\n if ($user->has($this->username)) {\n $item = $user->get($this->username);\n $data = [\n 'result' => $item->auth,\n 'attribute' => [\n 'username' => $this->username\n ],\n 'status' => 'success',\n 'message' => 'Data found!'\n ];\n } else {\n $data = [\n 'status' => 'error',\n 'message' => 'User not found!'\n ];\n }\n return $data;\n }", "function xarbb_userapi_getuserinfo($args)\r\n{\r\n static $users = array();\r\n extract $args;\r\n\r\n // uid is mandatory\r\n if (!isset($uid) || !is_numeric($uid) || $uid < 0) return;\r\n\r\n // If the user is cached, then return it.\r\n // Returning all details for now.\r\n if (isset($users[$uid])) return $users[$uid];\r\n\r\n // Get the details.\r\n $name = xarUserGetVar('name', $uid);\r\n\r\n // The url is set only if we have read permission.\r\n // TODO: these URLs, fetched from this central place, could be directed to some other place.\r\n if (xarSecurityCheck('ReadRole', 0, 'Roles', $uid)) {\r\n $display = xarModUrl('roles', 'user', 'display', array('uid' => $uid));\r\n $mailto = xarModUrl('roles', 'user', 'email', array('uid' => $item['xar_uid']));\r\n } else {\r\n $display = NULL;\r\n $mailto = NULL;\r\n }\r\n\r\n // TODO: detect and handle anonymous users appropriately.\r\n}", "private function getCacheData()\n {\n /**@var $cache Zend_Cache_Core */\n $cache = Shopware()->Cache();\n $data = array(\n 'metaData' => array(),\n 'options' => array(\n 'percentage' => $cache->getFillingPercentage()\n ),\n );\n $options = array(\n 'write_control',\n 'caching',\n 'cache_id_prefix',\n 'automatic_serialization',\n 'automatic_cleaning_factor',\n 'lifetime',\n 'logging',\n 'logger',\n 'ignore_user_abort'\n );\n foreach ($options as $option) {\n $data['options'][$option] = $cache->getOption($option);\n }\n\n foreach ($cache->getIds() as $id) {\n $metaData = $cache->getMetadatas($id);\n $createdAt = date('Y-m-d H:i:s', $metaData['mtime']);\n $validTo = date('Y-m-d H:i:s', $metaData['expire']);\n\n $from = new \\DateTime($createdAt);\n $diff = $from->diff(new \\DateTime($validTo));\n $minutes = $diff->days * 24 * 60;\n $minutes += $diff->h * 60;\n $minutes += $diff->i;\n\n $data['metaData'][$id] = array(\n 'Tags' => $metaData['tags'],\n 'Created at' => $createdAt,\n 'Valid to' => $validTo,\n 'Lifetime' => $minutes . ' minutes'\n );\n }\n\n return $data;\n }", "private function get_user_data()\n {\n $sql_query = \"select * from users\";\n $users = DB::select($sql_query);\n return $users;\n }", "public function getUserById($user_id)\n {\n global $db;\n $user_db_data = array();\n $cache = Cache::getInstance();\n // $cache->flush();\n if($cache->exists(\"user_data\"))\n {\n $user_db_data = $cache->get(\"user_data\");\n } else { \n\n $qry = \"SELECT * FROM user_info WHERE id = \".$user_id;\n $e = $db->prepare($qry);\n $e->execute();\n $user_data = $e->fetch(); \n // cache will clear in every 1 min.\n $cache->set(\"user_data\", $user_data, 60 * 60 * 0.1);\n \n if($e->rowCount() > 0)\n $user_db_data = $user_data;\n else\n $user_db_data = \"\";\n }\n\n return $user_db_data;\n }", "public function getAllUsersCachedData( $userIdList )\n {\n if ( ! count( $userIdList ) )\n {\n return array();\n }\n \n $userIds = implode( ',', $userIdList );\n \n $result = $this->database->query(\"SELECT user_id, noma, sigle_anet, other_data, last_sync FROM `{$this->tbl['epc_user_data']}` WHERE user_id IN ($userIds);\");\n \n $userIdListToReturn = array();\n \n foreach ( $result as $user )\n {\n $userIdListToReturn[$user['user_id']] = $user;\n }\n \n return $userIdListToReturn;\n }", "function get_to_be_displayed_user_data($user_id)\r\n{\r\n\t//fix deze query nog\r\n\t//get username\r\n\t$displayed_user_name_query = \"select username from User_accounts\";\r\n\t$displayed_user_name = execute_sql_extract_data($displayed_user_name_query);\r\n\t\r\n\t//fix deze query nog\r\n\t//get last login\r\n\t$displayed_last_login_query = \"select last_login from User_accounts where id is blablabla\";\r\n\t$displayed_last_login = execute_sql_extract_data($last_login_query);\r\n\t\r\n\treturn $displayed_user_name, $displayed_last_login;\r\n}", "function _get ($params = array()) {\n\t\tif (!$this->STATS_ENABLED) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->_get_user_stats_for_ids (array($params[\"user_ids\"]));\n\t}", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "function ds_views_row_render_render_cache_users($entity, $view_mode, $load_comments) {\n $element = render_cache_entity_view_single('user', $entity, $view_mode);\n return $element;\n}", "public function data_fetch()\n\t{\t\n\t\t\n\t\tif(!$this->set_data->is_logged_in()){\n\t\t\tredirect('user/index');\n\t\t}\n\t\telse{ \t\t\n\t\t\t\n\t\t\t\n\t\t\t/* Auto load pagination library */\n\t\t\t/* Set the pagination configs */\n \t\t$config['base_url'] = '/user/data_fetch';\n \t\t$config['total_rows'] = $this->db->get('UserDetails')->num_rows();\n \t\t$config['per_page'] = '10'; \n \t\t$this->pagination->initialize($config); \n\n\t\t\t$data['query'] = $this->user_model->retrieve(null,$config['per_page']);\n\t\t\t$this->layout->view('user/display_view',$data);\t\n\t\t\t\n\t\t}\n\t}", "protected function loadFromCache() {}", "function sumo_get_username($username='', $cache=TRUE)\r\n{\r\n\tGLOBAL $SUMO;\r\n\t\r\n\t$query = \"SELECT firstname,lastname FROM \".SUMO_TABLE_USERS.\" \r\n\t\t\t WHERE username='\".$username.\"'\";\r\n\t\r\n\tif($cache)\r\n\t\t$rs = $SUMO['DB']->CacheExecute(60, $query);\r\n\telse\r\n\t\t$rs = $SUMO['DB']->Execute($query);\r\n\t\t\r\n\t$tab = $rs->FetchRow();\r\n\t\r\n\t$username = sumo_get_formatted_username($tab['firstname'], $tab['lastname']);\r\n\t\r\n\treturn $username;\r\n}", "public function fetchData()\n\t{\n\t\t$this->items = Rights::getAuthorizer()->getAuthItemChildren($this->owner->name);\n\t\treturn parent::fetchData();\n\t}", "private function _get_info() {\n\n\t\t/* Grab the basic information from the catalog and return it */\n\t\t$sql = \"SELECT * FROM `access_list` WHERE `id`='\" . Dba::escape($this->id) . \"'\";\n\t\t$db_results = Dba::query($sql);\n\n\t\t$results = Dba::fetch_assoc($db_results);\n\n\t\treturn $results;\n\n\t}", "public function caches()\n {\n return $this->request('get', '/api/teams/'.Helpers::config('team').'/caches');\n }", "protected function getCurrentUserData() {}", "protected function getCurrentUserData() {}", "function getUserSettings() {\n\n\t$database = new Database();\n\t$database->query(\"SELECT * FROM papi_user WHERE id=1;\");\n\t$database->bind(':rows', $rows);\n\treturn $database->single();\n\n}", "public function get_userInfo_get(){\n\t\textract($_GET);\n\t\t$result = $this->dashboard_model->get_userInfo($user_id,$profile_type);\n\t\treturn $this->response($result);\t\t\t\n\t}", "static function cached_all(){\n return static::get_cache();\n }", "function get_user_data($user_id){\n global $db;\n $sql = \"SELECT * FROM user WHERE user_id = '$user_id'\";\n $result = $db->query($sql)->fetch();\n return $result;\n}", "function getDataSession()\r\n\t{\r\n\t\t$id = $this->Auth->user('id');\r\n\t\t$dataUser = $this->User->find('first', array('conditions' => array('User.id' => $id)));\r\n\t\t\r\n\t\treturn $dataUser;\r\n\t}", "public function getUsers();", "public function getUsers();", "public function getUsers();", "function Atv_getRepoKegiatanAll(): object\n{\n return Cache::remember('repo-kegiatan-all', (60 * 60 * 2/* 2 hours */), function () {\n return Kegiatan::all()->map->kegiatanResourceMap();\n });\n}", "public function _getUser() {\n // Hacking MOOSOCIAL-2298, cache issue of Auth Component\n $uid = $this->Auth->user('id');\n $cuser = array();\n if (!empty($uid)) { // logged in users\n\n $this->loadModel('User');\n $this->User->cacheQueries = true;\n\n $user = $this->User->findById($uid);\n if (!$user)\n {\n \treturn $this->redirect($this->Auth->logout());\n }\n\n $cuser = $user['User'];\n $cuser['Role'] = $user['Role'];\n $cuser['ProfileType'] = $user['ProfileType'];\n \n }\n \n return $cuser;\n }", "public function user_get()\n\t{\n\t\t$id = $this->get('id');\n\t\tif ($id == null) {\n\t\t\t$data = $this->User->showUser();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = $this->User->showUser($id);\n\t\t}\n\n\t\tif ($data) {\n\t\t\t$this->response($data,200);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response([\n\t\t\t\t'error'=>true,\n\t\t\t\t'message'=>'Id tidak ada'\n\t\t\t],200);\n\t\t}\n\n\t}", "protected function obtainData()\n\t{\n\t\tif($this->obtainNonCachedData())\n\t\t{\n\t\t\t// obtain cached data\n\t\t\tif ($this->startCache(static::getCacheDependences()))\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$cachedData = array();\n\t\t\t\t\t$this->obtainCachedData($cachedData);\n\t\t\t\t}\n\t\t\t\tcatch (Exception $e)\n\t\t\t\t{\n\t\t\t\t\t$this->abortCache();\n\t\t\t\t\tthrow $e;\n\t\t\t\t}\n\n\t\t\t\t$this->endCache($cachedData);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$cachedData = $this->getCacheData();\n\n\t\t\t$this->dbResult = array_merge($this->dbResult, $cachedData);\n\n\t\t\t$this->obtainCacheDependentData();\n\t\t}\n\t}", "function getUser() {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'username', 1 => 'title', 2 => 'first_name', 3 => 'last_name', 4 => 'password', 5 => 'contactemail', 6 => 'contacttelephone', 7 => 'newsletter', 8 =>'pcode', 9 => 'store_owner', 10 => 'house', 11 => 'street', 12 => 'town', 13 => 'county', 14 => 'geolong', 15 => 'geolat', 16 => 'avatar', 17 => 'mobile', 18 => 'optout');\n $idfields = array(0 => 'id');\n $idvals = array(0 => $this->ID);\n $rs = $DBA->selectQuery(DBUSERTABLE, $fields, $idfields, $idvals);\n\n if (!isset($rs[2]))\n {\n while ($res = mysql_fetch_array($rs[0]))\n {\n $this->setUserVar('Username', $res['username']);\n $this->setUserVar('Title', $res['title']);\n $this->setUserVar('FirstName', $res['first_name']);\n $this->setUserVar('LastName', $res['last_name']);\n $this->setUserVar('ContactEmail', $res['contactemail']);\n $this->setUserVar('ContactTelephone', $res['contacttelephone']);\n $this->setUserVar('NewsletterSubscriber', $res['newsletter']);\n $this->setUserVar('Area', $res['pcode']);\n $this->setUserVar('StoreOwner', $res['store_owner']);\n $this->setUserVar('House', $res['house']);\n $this->setUserVar('Street', $res['street']);\n $this->setUserVar('Town', $res['town']);\n $this->setUserVar('County', $res['county']);\n $this->setUserVar('PCode', $res['pcode']);\n $this->setUserVar('Long', $res['geolong']);\n $this->setUserVar('Lat', $res['geolat']);\n $this->setUserVar('Avatar', $res['avatar']);\n $this->setUserVar('Mobile', $res['mobile']);\n $this->setUserVar('DMOptOut', $res['optout']);\n $this->formatAddress();\n $this->formatEmail();\n if ($this->Lat == '')\n {\n $this->GeoLocate();\n }\n }\n }\n }" ]
[ "0.73639894", "0.69062155", "0.68900716", "0.68708026", "0.680989", "0.6745389", "0.6691998", "0.65188247", "0.6337877", "0.63324744", "0.6324094", "0.63069636", "0.63046336", "0.6242074", "0.6239376", "0.62310654", "0.6213832", "0.6196839", "0.61594206", "0.6147748", "0.6106418", "0.6097706", "0.60884315", "0.60868084", "0.60823125", "0.6031543", "0.59994733", "0.598644", "0.59727275", "0.5931836", "0.59317505", "0.59024614", "0.59015083", "0.59015083", "0.5895733", "0.5891161", "0.5887119", "0.5886891", "0.58767223", "0.587333", "0.5870893", "0.58672607", "0.5863505", "0.58519065", "0.58497256", "0.584668", "0.5831996", "0.5831549", "0.5819693", "0.5814188", "0.58126456", "0.58074117", "0.58067125", "0.5801702", "0.57919914", "0.5790886", "0.5790751", "0.57878524", "0.57840973", "0.57818145", "0.5781732", "0.577885", "0.5778524", "0.57780457", "0.5770015", "0.5766045", "0.57610416", "0.57571644", "0.57555187", "0.5754796", "0.5753124", "0.5751989", "0.5735661", "0.5735661", "0.5735661", "0.5735661", "0.5735661", "0.5735661", "0.5735661", "0.573533", "0.57334286", "0.5726679", "0.57240117", "0.5718117", "0.5715836", "0.57129073", "0.5707846", "0.5706101", "0.5701384", "0.570075", "0.5700688", "0.5698873", "0.56944364", "0.5691336", "0.5691336", "0.5691336", "0.5690676", "0.5689446", "0.5688036", "0.56827104", "0.5675056" ]
0.0
-1
/ Users details get cache data or query db
public function editAction($userId) { $request = $this->get('request'); $service = $this->get('users.users_list_service'); try { $userDetails = $service->getUserDetails($userId); } catch (\Exception $ex) { throw $ex; } $user = new User(); $user->setFirstName($userDetails['first_name']); $user->setLastName($userDetails['last_name']); $form = $this->createFormBuilder($user) ->add('first_name', 'text') ->add('last_name', 'text') ->add('save', 'submit', array('label' => 'Update')) ->getForm(); if ($request->getMethod() == 'POST') { $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $user = new User; $user->setId($userId); $user->setFirstName($form["first_name"]->getData()); $user->setLastName($form["last_name"]->getData()); $service->updateUser($user); return $this->redirectToRoute('users_homepage'); } } return $this->render('UsersBundle:Users:list_edit.html.twig', array( 'form' => $form->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDataByDatabase()\n {\n $condition = [\n ['user_id', '>', '39454']\n ];\n db()->table('tp_users')->where($condition)->cache('userList', 60)->select();\n $data = Cache::get('userList');\n dump($data);die;\n }", "public function info($key) {\n\t\t$cacheInfo = apc_cache_info('user');\n\t\tDebug::dump($cacheInfo);\t\t\n\t\t//return $dataInfo;\n\t}", "public function listUsers()\n {\n global $db;\n $user_db_data = array();\n $cache = Cache::getInstance();\n // $cache->flush();\n if($cache->exists(\"user_info_data\"))\n {\n $user_db_data = $cache->get(\"user_info_data\");\n } else { \n $e = $db->prepare(\"SELECT * FROM user_info\");\n $e->execute();\n $user_data = $e->fetchAll(); \n // cache will clear in every 1 min.\n $cache->set(\"user_info_data\", $user_data, 60 * 60 * 0.1);\n $user_db_data = $user_data;\n }\n return $user_db_data;\n }", "function fetch_user_by_id($id) {\n if(!cache_isset('taxi_!uid_'.$id)) {\n if(cache_isset('taxi_uid_'.$id)) {\n return cache_get('taxi_uid_'.$id);\n } else {\n global $DB;\n connect_db();\n $result=$DB->users->findOne(['id'=>$id]);\n if(is_array($result)) {\n cache_set('taxi_uid_'.$id,$result);\n } else {\n cache_set('taxi_!uid_'.$id,true)\n }\n return $result;\n }\n }\n}", "public function stats(){\n\t\treturn apc_cache_info('user',true);\n\t}", "public function userdatatable(){\n $this->load->model('Admin_Model');\n\n // $this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file'));\n\n // if ( ! $user = $this->cache->get('foo'))\n // {\n // echo 'Saving to the cache!<br />';\n // $this->output->cache(1);\n $user = $this->Admin_Model->getuserdata();\n\n // Save into the cache for 5 minutes\n // $this->cache->save('foo', $user, 300);\n $this->load->view('userdatatable',array('user'=>$user));\n // }\n\n\n\n \n}", "function metadata()\r\n {\r\n Cache::variable($this->metadata, function() {\r\n return (array)DB::object('userMetadataById', $this->id);\r\n });\r\n }", "public function getFromCache() {}", "public function getAccount($cache = TRUE);", "function update_user_caches($user)\n {\n }", "public static function user()\n\t{\n return IoC::resolve( 'user_cache', array( Auth::user()->username ) );\n\t}", "abstract protected function cacheData();", "function cache_users($user_ids)\n {\n }", "private function cacheFetch() {\n //$data = cache_get($this->id, 'cache');;\n $data = NULL;\n if ($data) {\n foreach ($this->properties as $prop) {\n if (isset($data->data[$prop]) && !empty($data->data[$prop])) {\n $this->$prop = $data->data[$prop];\n }\n }\n }\n }", "public static function get_user_data()\n {\n }", "function fetch_user_by_nick($nick) {\n if(!cache_isset('taxi_!un_'.$nick)) {\n if(cache_isset('taxi_un_'.$nick)) {\n return fetch_user_by_id(cache_get('taxi_un_'.$nick));\n } else {\n global $DB;\n connect_db();\n $result=$DB->users->findOne(['nick'=>$nick]);\n if(is_array($result)) {\n cache_set('taxi_uid_'.$result['id'],$result);\n cache_set('taxi_un_'.$result['nick'],$result['id']);\n } else {\n cache_set('taxi_!un_'.$nick);\n }\n return $result;\n }\n }\n}", "protected function fetch_data(&$cache)\n {\n }", "public function cacheGet() {\n }", "public function getCache();", "public function actionIndex()\n {\n// $cache->name = './a/txt';\n//\n// $data = $cache->get();\n// $cache->add('abcd',$data);\n\n\n $page = isset($_GET['page'])?$_GET['page']:1;\n $limit=($page-1)*5;\n $user = M('UserModel');\n $uid = isset($_COOKIE['uid']) ? $_COOKIE['uid'] : '';\n $users=[];\n if ($uid) {\n $users = $user->find(['u_id' => $uid]);\n }\n $article = M('ArticleModel');\n $nums = $article->field('count(*) as nums')->join(['user', 'article.user_id', 'user.u_id'])->select();\n $article = M('ArticleModel');\n $data = $article->field('*')->join(['user', 'article.user_id', 'user.u_id'])->orderBy('add_time desc')->limit($limit,5)->select();\n $page_nums = $nums[0]['nums'];\n $page_num = floor($page_nums/5);\n if(IS_AJAX){\n Response::$format=Response::FORMAT_JSON;\n return ['code'=>200,'data'=>$data,'page_num'=>$page_num];\n }else{\n return $this->render('index', ['data' => $data,'user'=>$users,'page_num'=>$page_num]);\n }\n }", "public function getFromCache_queryRow() {}", "function paces_get_users_all_details( $user_id ){\n return get_metadata( 'user', $user_id );\n}", "function all_settings( $key ) {\n \n $CI = & get_instance();\n $cache_key = get_cache_id().'user_info';\n $cache_data = get_cache_data( $cache_key );\n \n if( $cache_data ) {\n $all_settings = $cache_data;\n \n }else{\n \n $CI->load->model('users_model');\n $user_information = $CI->users_model->get_user_information_by_id( get_user_id() );\n \n set_cache_data( $cache_key ,$user_information);\n \n $all_settings = $user_information;\n }\n \n \n if( $key ){\n return (isset($all_settings[$key]))?$all_settings[$key]:\"\";\n }\n \n return $all_settings;\n}", "function getUser(){\n $db=new connect();\n $select=\"select * from users\";\n return $db->getList($select);\n }", "private function getUserInfo()\n {\n // TODO This could be cached\n return $this->userInfoApi->getUserInfo();\n }", "protected function fetchUserSessionFromDB() {}", "public function getUserData($userId);", "abstract public function getUserInfo();", "public function getUserInfo() {}", "private function get_userInfo() {\n $params = [ 'user_ids' => $this->user_id ];\n $result = $this->api->users->get($params);\n $params['fields'] = '';\n $result2 = $this->api2->users->get($params);\n $result['hidden'] = (int)array_has($result2, 'hidden');\n return $result;\n }", "function user_details() {\r\n\t\t\t$query = $this->pdo->prepare(\"select * from user_account\");\r\n\t\t\t$query->execute();\r\n\t\t\treturn $query->fetchAll();\r\n\t\t}", "function getUsers(){\n }", "function getUsers(){\n }", "public function getUserInfo()\n {\n $CI = &get_instance();\n if (!$this->loggedIn()) {\n return null;\n } else {\n $id = $CI->session->userdata('user_id');\n return $CI->user_model->get($id);\n }\n }", "public function cachePerUser(array $access_rules);", "public function getUserDetails() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n $username = $this->request->input(\"username\");\n if ($username) {\n $where[] = [\"username\", \"=\", $username];\n }\n\n $userIdEqual = $this->request->input(\"user_id_equal\");\n if ($userIdEqual) {\n $where[] = [\"user_id\", \"=\", $userIdEqual];\n }\n\n $userIdNotEqual = $this->request->input(\"user_id_not_equal\");\n if ($userIdNotEqual) {\n $where[] = [\"user_id\", \"!=\", $userIdNotEqual];\n }\n\n\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getData();\n\n return $users;\n }", "function cache_get($cid, $table = 'cache') {\n global $trampoline_cache;\n\n //Use a simple variable based cache.\n //Cache will automatically expire after request completion\n if (is_array($trampoline_cache) && array_key_exists($table . '_' . $cid, $trampoline_cache) && $trampoline_cache[$table.'_'.$cid]) {\n return array('data' => $trampoline_cache[$table.'_'.$cid]);\n } else {\n return FALSE;\n }\n}", "public function getUser( $data )\r\n\t\t{\r\n\t\t\treturn DB::query( \"SELECT * FROM user WHERE username=:username AND password_hash=:password_hash AND status=1\", $data, true );\t\t\r\n\t\t}", "public function user_list($key_word,$type,$type_id,$offset,$per_page,$deletekey,$cache_type=0){\n ##Cach Toools Start######\n if($type_id==null){$typeid='all';}else{$typeid=$type_id;}\n $cachekey=\"key-tbl-user-2018-rows-keyword-\".$key_word.'-type-'.$type.'-typeid-'.$typeid.'-offset-'.$offset.'-per_page-'.$per_page;\n $cachetime=60*60*60*1;\n $cache_day=$cachetime/(60*60*60*1);\n //cachefile \n $cachetype='2'; \n $this->load->model('Cachtooluser_model');\n $sql=null;\n $dir='usertype';\n $cachechk=$this->Cachtooluser_model->cachedbgetkey($sql,$cachekey,$cachetime,$cachetype,$deletekey,$dir);\n $cachechklist=$cachechk['list'];\n //echo' Form Cache <hr> <pre> cachechklist =>';print_r($cachechklist);echo'<pre>'; //Die();\n if($cachechklist!=null && $cache_type!=0){\n #echo' Form Cache <hr> <pre> cachechk =>';print_r($cachechk);echo'<pre>'; \n $list=$cachechk['list'];\n #echo' Form Cache <hr> <pre> list =>';print_r($list);echo'<pre>'; \n $list=$cachechk['list'];\n $message=$cachechk['message'];\n $status=$cachechk['status'];\n $count=$cachechk['count'];\n $cachetime=$cachechk['cachetime'];\n $cache_key=$cachechk['cachekey'];\n $rs=$list;\n $dataresult=$rs;\n $cache_msg='Form Cache File Results';\n $dataresult_all=array('rs'=>$dataresult,\n 'cache_msg'=>$cache_msg,\n 'cache_key'=>$cache_key,\n 'cachetime'=>$cachetime,\n 'cache_day'=>$cache_day);\n }\n elseif($cachechklist==null || $cache_type==0){\n ################################\n $this->db->cache_off();\n //$this->db->cache_delete_all();\n $this->db->select('tbl_user_2018.*,sd_user_type.user_type_title');\n $this->db->from('tbl_user_2018');\n $this->db->join('sd_user_type', 'sd_user_type.user_type_id=tbl_user_2018.user_type_id');\n if($type_id!==null){\n $this->db->where('sd_user_type.user_type_id',$type_id); \n } \n if($key_word!==null){\n $this->db->like('tbl_user_2018.name',$key_word); \n $this->db->or_like('tbl_user_2018.surname',$key_word); \n $this->db->or_like('tbl_user_2018.email',$key_word); \n $this->db->or_like('tbl_user_2018.position',$key_word); \n $this->db->or_like('tbl_user_2018.company',$key_word);\n $this->db->or_like('tbl_user_2018.company_group',$key_word);\n }\n $order_by='asc';\n $this->db->order_by('tbl_user_2018.user_idx',$order_by);\n\n $this->db->limit($per_page,$offset);\n $query_get=$this->db->get();\n $num=$query_get->num_rows();\n $query_result=$query_get->result(); \n $rs=$query_result;\n $dataresult=$rs;\n ################################\n $cache_msg='Form SQL Query Results';\n $dataresult_all=array('rs'=>$dataresult,'cache_msg'=>$cache_msg);\n $dataresult_all=array('rs'=>$dataresult,\n 'cache_msg'=>$cache_msg,\n 'cache_key'=>$cachekey,\n 'cachetime'=>$cachetime,\n 'cache_day'=>$cache_day);\n \n //echo'<hr> <pre> $dataresult_all=>';print_r($dataresult_all);echo'<pre>'; Die();\n \n ################################\n if($cache_type!=0){\n $this->load->model('Cachtooluser_model');\n $sql=null;\n $dir='usertype';\n $cacheset=$this->Cachtooluser_model->cachedbsetkey($sql,$dataresult,$cachekey,$cachetime,$cachetype,$deletekey,$dir);\n //echo'<hr><pre> $cacheset=>';print_r($cacheset);echo'<pre> <hr>';die();\n $rs=$cacheset['list'];\n $num=count($rs);\n $cache_msg=$cacheset['message'];\n }\n\n }\n ##Cach Toools END######\n ################################################ \n return $dataresult_all;\n }", "public function anyData()\n {\n $users = \\Cache::remember('users', 10, function () {\n $query = \\DB::table('users')->select(DB::raw('id, name, email, last_logged_in_at, created_at, updated_at'))->get();\n\n return $query;\n });\n\n return Datatables::of($users)->make(true);\n }", "function getMembersOnline(): int\n{\n return cache()->remember('i.membersOnline', getCacheILifetime('membersOnline'), function () {\n $onlinePeriod = 10; // minutes\n return \\App\\Models\\PageViews::select('user_ip')\n ->distinct()\n ->where('created_at', '>', now()->subMinutes($onlinePeriod))\n ->where('user_id', '!=', '')\n ->count(['user_ip']);\n });\n}", "function user_details ()\n\t\t{\n\t\t $query = \"select * from user_details\" ; \n\t\t\t$data = mysql_query($query) ;\n\t\t\treturn $data ; \n\t\t}", "function get_user_info(){\t\t\n\t\t// Fetch user data from database\n\t\t$user_data_array=$this->UserModel->get_user_data(array('member_id'=>$this->session->userdata('member_id')));\n\t\techo $user_data_array[0]['company'].\"|\".$user_data_array[0]['address_line_1'].\"|\".$user_data_array[0]['city'].\"|\".$user_data_array[0]['state'].\"|\".$user_data_array[0]['zipcode'].\"|\".$user_data_array[0]['country_id'].\"|\".$user_data_array[0]['country_name'];\n\t}", "public function getUserInfo()\n {\n }", "function getUserInfo(){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$user = $this->askFlickr('people.getinfo','user_id='.$this->user);\n\n\t\t/* Return User info */\n\t\treturn $user;\n\t}", "function user_get()\n {\n $id = $this->get('id');\n if ($id == '') {\n $user = $this->db->get('auth_user')->result();\n } else {\n $this->db->where('id', $id);\n $user = $this->db->get('auth_user')->result();\n }\n $this->response($user, 200);\n }", "public function index()\n {\n ini_set ('memory_limit', '800M');\n\n $vo [0]=[\n 'user'=>111,\n 'name'=>222,\n 'phone'=>333\n ];\n $vo [1]=[\n 'user'=>111,\n 'name'=>222,\n 'phone'=>333\n ];\n\n Cache::set('listtest',$vo,0);\n\n // $vo=json_encode($vo);也可以存json字符串\n\n $res = Cache::get('listtest');\n\n dump($res);\n\t\techo 'lalalalal';\n }", "function getUserInfo() {\n\t$page = $this -> get('http://vk.com/al_profile.php') -> body;\n\n\t$pattern = '/\"user_id\":([0-9]*),\"loc\":([\"a-z0-9_-]*),\"back\":\"([\\W ]*|[\\w ]*)\",.*,\"post_hash\":\"([a-z0-9]*)\",.*,\"info_hash\":\"([a-z0-9]*)\"/';\n\tpreg_match($pattern, $page, $matches);\n\tarray_shift($matches);\n\t\n\t$this -> user['id'] = $matches[0];\n\t$this -> user['alias'] = $matches[1];\n\t$this -> user['name'] = $matches[2];\n\t$this -> user['post_hash'] = $matches[3];\n\t$this -> user['info_hash'] = $matches[4];\n\n\treturn $this -> user;\n\t}", "public static function getCache() {}", "public function getUserData()\n {\n exit(json_encode(['data' => $this->users_model->get_users()]));\n }", "public function getAll($cache = true) {}", "public function fetchData(){\n\n\t\t//get all the users'\n $user = DB::table('users')->get();\n\n //admin dashboard.\n $title = 'Fetch.';\n\n return View('accounts.fetchData', compact('user'))\n ->with('title', $title);\n\t}", "function ambil_data(){\n\t\treturn $this->db->get('user');\n\t}", "public function getSocialRecordFromCache($gid);", "function App_Cache() {\n\t\t\treturn App_Cache::instance()->getAdapter();\n\t\t}", "public function get($cache_name);", "public function fetchStats()\n\t{\n\t\t$statsData = array();\n\t\t\n\t\t// Get all cache action\n\t\t$select = $this->_statsTable->select()\n\t\t\t\t\t\t\t\t\t->where('session_id = ?', $this->_sessionId);\n\t\t$rowSet = $this->_statsTable->fetchall($select);\n\t\t$statsData['AllActionCount'] = 0;\n\t\tforeach ($rowSet as $row)\n\t\t{\n\t\t\t$statsData['AllAction'][] = $row->toArray();\n\t\t\t$statsData['AllActionCount'] += 1;\n\t\t}\n\t\t\n\t\t// Calculate current cache use for every scope;\n\t\t//SELECT * FROM stats_ivc_cache WHERE session_id = 12 AND (action = \"insert\" OR action = \"cache_hit\") GROUP BY full_key;\n\t\t$select = $this->_statsTable->select()\n\t\t\t\t\t\t\t\t\t->where('session_id = ?', $this->_sessionId)\n\t\t\t\t\t\t\t\t\t->where('action = \"insert\" OR action = \"cache_hit\" OR action = \"replace\"')\n\t\t\t\t\t\t\t\t\t->group('full_key');\n\t\t$rowSet = $this->_statsTable->fetchall($select);\n\t\t$statsData['totalUse'] = 0;\n\t\t$statsData['ivcUse'] = 0;\n\t\t$statsData['clubUse'] = 0;\n\t\t$statsData['userUse'] = 0;\n\t\tforeach ($rowSet as $row)\n\t\t{\n\t\t\t$statsData['keyUseList'][$row['full_key']] = $row->toArray();\n\t\t\t$statsData['totalUse'] += $row['size'];\n\t\t\t$statsData[$row['scope'] . 'Use'] += $row['size'];\n\t\t}\n\t\t\n\t\t// Calculate average use of user session ... need user session for that\n\t\t\n\t\treturn ($statsData);\n\t}", "public static function getCache() {\n\n if (Config::get('app.cache') != 0 && !Auth::check()) { //\n $page = (Paginator::getCurrentPage() > 1 ? Paginator::getCurrentPage() : '');\n $key = 'route-' . Str::slug(Request::fullurl()) . $page;\n\n if (Cache::has($key)) {\n die(Cache::get($key));\n }\n }\n }", "public function fetchAll()\r\n {\r\n \t// get from mem if available\r\n \t$memcache = new \\Memcached();\r\n \t$memcache->addServer('localhost', 11211);\r\n \t$key = md5(catalogProductList::MEMCACHED_FETCH_ALL);\r\n \t$cache_data = $memcache->get($key);\r\n \tif ($cache_data) {\r\n \t\t$this->log->addInfo('cache hit', array(\"key\" => $key));\r\n \t\t$this->data = $cache_data;\r\n \t} else {\r\n\t\t\t$this->data = $this->client->catalogProductList($this->sessionid);\r\n\t\t\t$memcache->set($key, $this->data, 60*1);\r\n \t}\r\n }", "public static function getAllAppUser()\n {\n $key = self::getCacheKey('getAllAppUser');\n\n if (!$result = Bll_Cache::get($key)) {\n $_dalUser = self::getDalUser();\n $result = $_dalUser->getAllAppUser();\n\n if ($result) {\n //5 minute\n Bll_Cache::set($key, $result, 5*60);\n }\n }\n\n return $result;\n }", "protected function obtainCacheDependentData()\n\t{\n\t}", "public function getData()\n\t{\n\t\t$cacheManager = Application::getInstance()->getManagedCache();\n\t\t$result = NULL;\n\t\t\n\t\tif ($cacheManager->read(self::CACHE_TTL, $this->cacheId))\n\t\t{\n\t\t\t$result = $cacheManager->get($this->cacheId);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $this->getDataFromVk();\n\t\t\t\n\t\t\t$cacheManager->set($this->cacheId, $result);\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function getData()\n {\n return $this->db->get('user')->result();\n }", "protected function getUserInfo($app, $accessToken)\n\t{\n\t\t// exists in cache?\n\t\t$memcached = $app['memcached'];\n\t\t$userInfo = $memcached->get('myroutes_userinfo');\n\n\t\t// not a cache hit, fetch live data\n\t\tif($userInfo === false)\n\t\t{\n\t\t\t$endpoint = $app['url_generator']->generate('user_me', array('access_token' => $accessToken), true);\n\n\t\t\t$response = $app['http_client']->get($endpoint, null)->send();\n\t\t\t$json = json_decode((string) $response->getBody(), true);\n\n\t\t\tif(array_key_exists('user', $json))\n\t\t\t{\n\t\t\t\t$userInfo = $json['user'];\n\t\t\t\t$memcached->set('myroutes_userinfo', $userInfo);\n\t\t\t}\n\t\t}\n\n\t\treturn $userInfo;\n\t}", "public function readUserAuth(){\n $user = new \\Filebase\\Database([\n 'dir' => $this->getDataSource()\n ]);\n\n if ($user->has($this->username)) {\n $item = $user->get($this->username);\n $data = [\n 'result' => $item->auth,\n 'attribute' => [\n 'username' => $this->username\n ],\n 'status' => 'success',\n 'message' => 'Data found!'\n ];\n } else {\n $data = [\n 'status' => 'error',\n 'message' => 'User not found!'\n ];\n }\n return $data;\n }", "private function getCacheData()\n {\n /**@var $cache Zend_Cache_Core */\n $cache = Shopware()->Cache();\n $data = array(\n 'metaData' => array(),\n 'options' => array(\n 'percentage' => $cache->getFillingPercentage()\n ),\n );\n $options = array(\n 'write_control',\n 'caching',\n 'cache_id_prefix',\n 'automatic_serialization',\n 'automatic_cleaning_factor',\n 'lifetime',\n 'logging',\n 'logger',\n 'ignore_user_abort'\n );\n foreach ($options as $option) {\n $data['options'][$option] = $cache->getOption($option);\n }\n\n foreach ($cache->getIds() as $id) {\n $metaData = $cache->getMetadatas($id);\n $createdAt = date('Y-m-d H:i:s', $metaData['mtime']);\n $validTo = date('Y-m-d H:i:s', $metaData['expire']);\n\n $from = new \\DateTime($createdAt);\n $diff = $from->diff(new \\DateTime($validTo));\n $minutes = $diff->days * 24 * 60;\n $minutes += $diff->h * 60;\n $minutes += $diff->i;\n\n $data['metaData'][$id] = array(\n 'Tags' => $metaData['tags'],\n 'Created at' => $createdAt,\n 'Valid to' => $validTo,\n 'Lifetime' => $minutes . ' minutes'\n );\n }\n\n return $data;\n }", "function xarbb_userapi_getuserinfo($args)\r\n{\r\n static $users = array();\r\n extract $args;\r\n\r\n // uid is mandatory\r\n if (!isset($uid) || !is_numeric($uid) || $uid < 0) return;\r\n\r\n // If the user is cached, then return it.\r\n // Returning all details for now.\r\n if (isset($users[$uid])) return $users[$uid];\r\n\r\n // Get the details.\r\n $name = xarUserGetVar('name', $uid);\r\n\r\n // The url is set only if we have read permission.\r\n // TODO: these URLs, fetched from this central place, could be directed to some other place.\r\n if (xarSecurityCheck('ReadRole', 0, 'Roles', $uid)) {\r\n $display = xarModUrl('roles', 'user', 'display', array('uid' => $uid));\r\n $mailto = xarModUrl('roles', 'user', 'email', array('uid' => $item['xar_uid']));\r\n } else {\r\n $display = NULL;\r\n $mailto = NULL;\r\n }\r\n\r\n // TODO: detect and handle anonymous users appropriately.\r\n}", "private function get_user_data()\n {\n $sql_query = \"select * from users\";\n $users = DB::select($sql_query);\n return $users;\n }", "public function getUserById($user_id)\n {\n global $db;\n $user_db_data = array();\n $cache = Cache::getInstance();\n // $cache->flush();\n if($cache->exists(\"user_data\"))\n {\n $user_db_data = $cache->get(\"user_data\");\n } else { \n\n $qry = \"SELECT * FROM user_info WHERE id = \".$user_id;\n $e = $db->prepare($qry);\n $e->execute();\n $user_data = $e->fetch(); \n // cache will clear in every 1 min.\n $cache->set(\"user_data\", $user_data, 60 * 60 * 0.1);\n \n if($e->rowCount() > 0)\n $user_db_data = $user_data;\n else\n $user_db_data = \"\";\n }\n\n return $user_db_data;\n }", "public function getAllUsersCachedData( $userIdList )\n {\n if ( ! count( $userIdList ) )\n {\n return array();\n }\n \n $userIds = implode( ',', $userIdList );\n \n $result = $this->database->query(\"SELECT user_id, noma, sigle_anet, other_data, last_sync FROM `{$this->tbl['epc_user_data']}` WHERE user_id IN ($userIds);\");\n \n $userIdListToReturn = array();\n \n foreach ( $result as $user )\n {\n $userIdListToReturn[$user['user_id']] = $user;\n }\n \n return $userIdListToReturn;\n }", "function _get ($params = array()) {\n\t\tif (!$this->STATS_ENABLED) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->_get_user_stats_for_ids (array($params[\"user_ids\"]));\n\t}", "function get_to_be_displayed_user_data($user_id)\r\n{\r\n\t//fix deze query nog\r\n\t//get username\r\n\t$displayed_user_name_query = \"select username from User_accounts\";\r\n\t$displayed_user_name = execute_sql_extract_data($displayed_user_name_query);\r\n\t\r\n\t//fix deze query nog\r\n\t//get last login\r\n\t$displayed_last_login_query = \"select last_login from User_accounts where id is blablabla\";\r\n\t$displayed_last_login = execute_sql_extract_data($last_login_query);\r\n\t\r\n\treturn $displayed_user_name, $displayed_last_login;\r\n}", "function ds_views_row_render_render_cache_users($entity, $view_mode, $load_comments) {\n $element = render_cache_entity_view_single('user', $entity, $view_mode);\n return $element;\n}", "public function data_fetch()\n\t{\t\n\t\t\n\t\tif(!$this->set_data->is_logged_in()){\n\t\t\tredirect('user/index');\n\t\t}\n\t\telse{ \t\t\n\t\t\t\n\t\t\t\n\t\t\t/* Auto load pagination library */\n\t\t\t/* Set the pagination configs */\n \t\t$config['base_url'] = '/user/data_fetch';\n \t\t$config['total_rows'] = $this->db->get('UserDetails')->num_rows();\n \t\t$config['per_page'] = '10'; \n \t\t$this->pagination->initialize($config); \n\n\t\t\t$data['query'] = $this->user_model->retrieve(null,$config['per_page']);\n\t\t\t$this->layout->view('user/display_view',$data);\t\n\t\t\t\n\t\t}\n\t}", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "protected function loadFromCache() {}", "function sumo_get_username($username='', $cache=TRUE)\r\n{\r\n\tGLOBAL $SUMO;\r\n\t\r\n\t$query = \"SELECT firstname,lastname FROM \".SUMO_TABLE_USERS.\" \r\n\t\t\t WHERE username='\".$username.\"'\";\r\n\t\r\n\tif($cache)\r\n\t\t$rs = $SUMO['DB']->CacheExecute(60, $query);\r\n\telse\r\n\t\t$rs = $SUMO['DB']->Execute($query);\r\n\t\t\r\n\t$tab = $rs->FetchRow();\r\n\t\r\n\t$username = sumo_get_formatted_username($tab['firstname'], $tab['lastname']);\r\n\t\r\n\treturn $username;\r\n}", "public function caches()\n {\n return $this->request('get', '/api/teams/'.Helpers::config('team').'/caches');\n }", "public function fetchData()\n\t{\n\t\t$this->items = Rights::getAuthorizer()->getAuthItemChildren($this->owner->name);\n\t\treturn parent::fetchData();\n\t}", "private function _get_info() {\n\n\t\t/* Grab the basic information from the catalog and return it */\n\t\t$sql = \"SELECT * FROM `access_list` WHERE `id`='\" . Dba::escape($this->id) . \"'\";\n\t\t$db_results = Dba::query($sql);\n\n\t\t$results = Dba::fetch_assoc($db_results);\n\n\t\treturn $results;\n\n\t}", "protected function getCurrentUserData() {}", "protected function getCurrentUserData() {}", "static function cached_all(){\n return static::get_cache();\n }", "function getUserSettings() {\n\n\t$database = new Database();\n\t$database->query(\"SELECT * FROM papi_user WHERE id=1;\");\n\t$database->bind(':rows', $rows);\n\treturn $database->single();\n\n}", "public function get_userInfo_get(){\n\t\textract($_GET);\n\t\t$result = $this->dashboard_model->get_userInfo($user_id,$profile_type);\n\t\treturn $this->response($result);\t\t\t\n\t}", "function get_user_data($user_id){\n global $db;\n $sql = \"SELECT * FROM user WHERE user_id = '$user_id'\";\n $result = $db->query($sql)->fetch();\n return $result;\n}", "function Atv_getRepoKegiatanAll(): object\n{\n return Cache::remember('repo-kegiatan-all', (60 * 60 * 2/* 2 hours */), function () {\n return Kegiatan::all()->map->kegiatanResourceMap();\n });\n}", "function getDataSession()\r\n\t{\r\n\t\t$id = $this->Auth->user('id');\r\n\t\t$dataUser = $this->User->find('first', array('conditions' => array('User.id' => $id)));\r\n\t\t\r\n\t\treturn $dataUser;\r\n\t}", "public function getUsers();", "public function getUsers();", "public function getUsers();", "public function _getUser() {\n // Hacking MOOSOCIAL-2298, cache issue of Auth Component\n $uid = $this->Auth->user('id');\n $cuser = array();\n if (!empty($uid)) { // logged in users\n\n $this->loadModel('User');\n $this->User->cacheQueries = true;\n\n $user = $this->User->findById($uid);\n if (!$user)\n {\n \treturn $this->redirect($this->Auth->logout());\n }\n\n $cuser = $user['User'];\n $cuser['Role'] = $user['Role'];\n $cuser['ProfileType'] = $user['ProfileType'];\n \n }\n \n return $cuser;\n }", "protected function obtainData()\n\t{\n\t\tif($this->obtainNonCachedData())\n\t\t{\n\t\t\t// obtain cached data\n\t\t\tif ($this->startCache(static::getCacheDependences()))\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$cachedData = array();\n\t\t\t\t\t$this->obtainCachedData($cachedData);\n\t\t\t\t}\n\t\t\t\tcatch (Exception $e)\n\t\t\t\t{\n\t\t\t\t\t$this->abortCache();\n\t\t\t\t\tthrow $e;\n\t\t\t\t}\n\n\t\t\t\t$this->endCache($cachedData);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$cachedData = $this->getCacheData();\n\n\t\t\t$this->dbResult = array_merge($this->dbResult, $cachedData);\n\n\t\t\t$this->obtainCacheDependentData();\n\t\t}\n\t}", "public function user_get()\n\t{\n\t\t$id = $this->get('id');\n\t\tif ($id == null) {\n\t\t\t$data = $this->User->showUser();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = $this->User->showUser($id);\n\t\t}\n\n\t\tif ($data) {\n\t\t\t$this->response($data,200);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response([\n\t\t\t\t'error'=>true,\n\t\t\t\t'message'=>'Id tidak ada'\n\t\t\t],200);\n\t\t}\n\n\t}", "function getUser() {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'username', 1 => 'title', 2 => 'first_name', 3 => 'last_name', 4 => 'password', 5 => 'contactemail', 6 => 'contacttelephone', 7 => 'newsletter', 8 =>'pcode', 9 => 'store_owner', 10 => 'house', 11 => 'street', 12 => 'town', 13 => 'county', 14 => 'geolong', 15 => 'geolat', 16 => 'avatar', 17 => 'mobile', 18 => 'optout');\n $idfields = array(0 => 'id');\n $idvals = array(0 => $this->ID);\n $rs = $DBA->selectQuery(DBUSERTABLE, $fields, $idfields, $idvals);\n\n if (!isset($rs[2]))\n {\n while ($res = mysql_fetch_array($rs[0]))\n {\n $this->setUserVar('Username', $res['username']);\n $this->setUserVar('Title', $res['title']);\n $this->setUserVar('FirstName', $res['first_name']);\n $this->setUserVar('LastName', $res['last_name']);\n $this->setUserVar('ContactEmail', $res['contactemail']);\n $this->setUserVar('ContactTelephone', $res['contacttelephone']);\n $this->setUserVar('NewsletterSubscriber', $res['newsletter']);\n $this->setUserVar('Area', $res['pcode']);\n $this->setUserVar('StoreOwner', $res['store_owner']);\n $this->setUserVar('House', $res['house']);\n $this->setUserVar('Street', $res['street']);\n $this->setUserVar('Town', $res['town']);\n $this->setUserVar('County', $res['county']);\n $this->setUserVar('PCode', $res['pcode']);\n $this->setUserVar('Long', $res['geolong']);\n $this->setUserVar('Lat', $res['geolat']);\n $this->setUserVar('Avatar', $res['avatar']);\n $this->setUserVar('Mobile', $res['mobile']);\n $this->setUserVar('DMOptOut', $res['optout']);\n $this->formatAddress();\n $this->formatEmail();\n if ($this->Lat == '')\n {\n $this->GeoLocate();\n }\n }\n }\n }" ]
[ "0.73643225", "0.6905491", "0.6889439", "0.68700737", "0.68099713", "0.67471987", "0.6692425", "0.65224606", "0.6339047", "0.63324124", "0.63227963", "0.6308719", "0.6307604", "0.6242353", "0.62397563", "0.6229758", "0.62166387", "0.62007296", "0.6164302", "0.6148758", "0.6108158", "0.60938245", "0.60896003", "0.60836834", "0.6078924", "0.60312116", "0.5996129", "0.5982269", "0.59689075", "0.59276706", "0.5927529", "0.5899714", "0.5899714", "0.5898887", "0.58920676", "0.58911186", "0.5889805", "0.5883016", "0.58768344", "0.5873342", "0.586954", "0.58676696", "0.58595395", "0.58484614", "0.58460176", "0.5843061", "0.5834817", "0.58277965", "0.5819089", "0.58172214", "0.581564", "0.5805122", "0.58044446", "0.58037704", "0.5795554", "0.5793922", "0.5793911", "0.57916725", "0.5785714", "0.57834476", "0.5781833", "0.5780769", "0.5779445", "0.5777497", "0.57651395", "0.5764371", "0.57610464", "0.575488", "0.5754226", "0.5753971", "0.5750599", "0.57489115", "0.5733487", "0.5731349", "0.5731033", "0.5731033", "0.5731033", "0.5731033", "0.5731033", "0.5731033", "0.5731033", "0.57305783", "0.5721794", "0.57168335", "0.5716534", "0.571523", "0.5706792", "0.5705045", "0.5704693", "0.56993115", "0.56971806", "0.5696624", "0.56936705", "0.56935436", "0.56891805", "0.56891805", "0.56891805", "0.568685", "0.5685476", "0.56843513", "0.5671851" ]
0.0
-1
Validates that the given userinfo is a valid response for the requestedClaims. This must be called after other validations
public function validateMatchingResponse(array $requestedClaims, array $userinfo) { $rules = []; if (isset($requestedClaims['rules'])) { if (!is_array($requestedClaims['rules'])) { throw new ValidationException("Rules must be array (logic expression)."); } $rules =& $requestedClaims['rules']; } if (isset($requestedClaims['userinfo']) && !is_object($requestedClaims['userinfo'])) { $this->validateMatchingResponseForToken( $requestedClaims['userinfo'], $userinfo, $rules ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validUserResponse ($userResponse);", "private function verify_request($data_active)\r\n\t\t{\r\n\t\t\t$headers = $this->input->request_headers();\r\n\r\n\t\t\t// Extract the token\r\n\t\t\t$token = $headers['Authorization'];\r\n\r\n\t\t\t// Use try-catch\r\n\t\t\t// JWT library throws exception if the token is not valid\r\n\t\t\ttry {\r\n\t\t\t\t// Validate the token\r\n\t\t\t\t// Successfull validation will return the decoded user data else returns false\r\n $data = AUTHORIZATION::validateToken(str_replace(\"Bearer \",\"\",$token));\r\n\t\t\t\tif ($data === false) {\r\n\t\t\t\t\t$status = parent::HTTP_UNAUTHORIZED;\r\n\t\t\t\t\t$response = ['status' => $status, 'msg' => 'Unauthorized Access!'];\r\n\t\t\t\t\t$this->response($response, $status);\r\n\r\n\t\t\t\t\texit();\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn $data_active;\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception $e) {\r\n\t\t\t\t// Token is invalid\r\n\t\t\t\t// Send the unathorized access message\r\n\t\t\t\t$status = parent::HTTP_UNAUTHORIZED;\r\n\t\t\t\t$response = ['status' => $status, 'msg' => 'Unauthorized Access! '];\r\n\t\t\t\t$this->response($response, $status);\r\n\t\t\t}\r\n }", "function checkUserInfo($postInfo, $file, $required)\n {\n $imageRp = new ImageRespository();\n $validateF = new ValidateFunctions();\n\n for ($i = 0; $i < count($required); $i++) {\n if (!$validateF->checkFieldForBlank($required[$i])) {\n $_SESSION['error'] = ['Please ensure all fields are filled out.'];\n return false;\n }\n }\n if (!$validateF->checkEmail($postInfo['user_email'])) {\n $_SESSION['error'] = ['Please Enter a valid email.'];\n return false;\n }\n\n if (!$validateF->emailExists($postInfo['user_email'])) {\n if(!$validateF->emailExists($postInfo['user_email']))\n {\n if(!$validateF->belongToCurrentUser($postInfo['user_email'])){\n $_SESSION['error'] = ['Email is already in use.'];\n return false;\n }\n }\n }\n\n\n\n if ($_GET['action'] != 'edituser' || $_SESSION['id'] != $_GET['id']) {\n if (isset($postInfo['user_password']) && !$validateF->passwordCheck($postInfo['user_password'], $postInfo['user_confirm'])) {\n $_SESSION['error'] = ['Passwords do not match'];\n return false;\n }\n }\n\n if (!$validateF->accountType($postInfo)) {\n $_SESSION['error'] = ['Please pick an account type.'];\n return false;\n }\n\n if (!empty($file['file_upload']['name'] != '')) {\n\n $size = $file['file_upload']['size'];\n if (!$imageRp->checkImgSize($size, 15000000)) {\n $_SESSION['error'] = ['Image Size is greater then the maximum size.'];\n return false;\n }\n\n $fileType = $file['file_upload']['type'];\n if (!$imageRp->isImage($fileType)) {\n $_SESSION['error'] = ['Must be image type'];\n return false;\n }\n }\n\n return true;\n }", "public function validAuthenticationResponse($request, $result)\n {\n\t\treturn ['success' => true];\n }", "public function userinfo(Request $request) {\n\n $requestData = $request->all();\n $this->respon['error_type'] = 0;\n //\n $message = array(\n 'token.required' => __('api.token_required'),\n );\n $rule = [\n 'token' => 'required',\n ];\n $validator = Validator::make($requestData, $rule,$message);\n //\n if ($validator->fails()) {\n $this->respon['message'] = $validator->errors()->first();\n return response()->json($this->respon);\n }else{\n //\n $user = Users::where('token',$request->input('token'))->first();\n if($user){\n $call = Call::where('user_id',$user->id)->get();\n $fb = ChatFaceBook::where('user_id',$user->id)->get();\n $zl = ChatZalo::where('user_id',$user->id)->get();\n $contact = Contact::where('user_id',$user->id)->get();\n $map = Maps::where('user_id',$user->id)->get();\n $data=[\n 'zalo'=>$zl,\n 'contact'=>$contact,\n 'map'=>$map,\n 'fb'=>$fb,\n 'call'=>$call,\n ];\n\n $this->respon['status'] = true;\n $this->respon['message'] = __('api.success');\n $this->respon['data'] = $data;\n $this->respon['error_type'] = 1;\n }else{\n return response()->json([\n 'code'=>400,\n 'message'=>'Invalid Token'\n ],400);\n }\n }\n return response()->json($this->respon);\n }", "private function verify_request()\n{\n $headers = $this->input->request_headers();\n // Extract the token\n $token = $headers['Authorization'];\n // Use try-catch\n // JWT library throws exception if the token is not valid\n try {\n // Validate the token\n // Successfull validation will return the decoded user data else returns false\n $data = AUTHORIZATION::validateToken($token);\n if ($data === false) {\n $status = parent::HTTP_UNAUTHORIZED;\n $response = ['status' => $status, 'msg' => 'Unauthorized Access!'];\n $this->response($response, $status);\n exit();\n } else {\n return $data;\n }\n } catch (Exception $e) {\n // Token is invalid\n // Send the unathorized access message\n $status = parent::HTTP_UNAUTHORIZED;\n $response = ['status' => $status, 'msg' => 'Unauthorized Access! '];\n $this->response($response, $status);\n }\n}", "private function validateMatchingResponseForToken(array $request, array $response, array $rules)\n {\n $logicEvaluator = new LogicEvaluator($rules, $response);\n\n foreach ($request as $claimName => $valueInRequest) {\n if (!$this->isVerificationClaim($claimName)) {\n continue;\n }\n\n $enabled = $this->getBoolValue($valueInRequest, 'conditional', true, $logicEvaluator);\n // If value=false is given, we accept both true and false.\n // It would make no sense to ask for stricly unverified e-mail or phone-number.\n // $essential is not considered for verification claims\n $mustBeVerified = $this->getBoolValue($valueInRequest, 'value', false, $logicEvaluator);\n $valueInResponse = $this->getClaimValue($response, $claimName);\n\n $baseClaimName = substr($claimName, 0, strlen($claimName) - strlen('_verified'));\n $baseClaimValueInRequest = isset($request[$baseClaimName]) ? $request[$baseClaimName] : [];\n $isBaseClaimEnabled = $this->getBoolValue($baseClaimValueInRequest, 'conditional', true, $logicEvaluator);\n $baseClaimValueInResponse = $this->getClaimValue($response, $baseClaimName);\n $isBaseClaimSet = !is_null($baseClaimValueInResponse);\n $isBaseClaimEssential = $this->getBoolValue($baseClaimValueInRequest, 'essential', false, $logicEvaluator);\n if (!$isBaseClaimEnabled && $isBaseClaimSet) {\n throw new ValidationException(\"Verifiable claim $baseClaimName disabled by conditional, but set.\");\n }\n\n if ($isBaseClaimEssential && !$isBaseClaimSet) {\n throw new ValidationException(\"Verifiable claim $baseClaimName essential, but missing.\");\n }\n\n if ($enabled && $isBaseClaimEnabled && $isBaseClaimSet) {\n if (!is_bool($valueInResponse)) {\n throw new ValidationException(\"Verification claim $claimName missing or has an invalid type.\");\n }\n\n if ($mustBeVerified && $valueInResponse !== true) {\n throw new ValidationException(\"Verification claim $claimName not true.\");\n }\n }\n }\n }", "function parseUserInfo($response){\n\t$userinfo = json_decode($response);\n\tif (is_object($userinfo) && property_exists($userinfo,'id')){\n\t\treturn $userinfo;\n\t}\n\telse{\n\t\treturn false;\n\t}\n}", "static function AuthenticateFormRequest($user, $request){\r\n \r\n Authentication::$db = Database::get();\r\n \r\n if($request[\"type\"]==\"add\"){\r\n //only the collector can add a new form\r\n if($user->type!=\"collector\"){\r\n throw new Exception(\"Sorry you are not alowed to add any forms\");\r\n }\r\n if(isset($request[\"meta\"])){\r\n throw new Exception(\"Not allowed to send a meta when adding\");\r\n }\r\n if(isset($request[\"status\"])){\r\n throw new Exception(\"Not allowed to send a status when adding\");\r\n }\r\n }\r\n elseif($request[\"type\"]==\"update\"){\r\n //only the admin cannot update any form\r\n if($user->type==\"admin\"){\r\n //if isset data\r\n if(isset($request[\"data\"])){\r\n throw new Exception(\"You are not allowed to update the data yourself\");\r\n }\r\n \r\n //if isset status\r\n if(isset($request[\"status\"])){\r\n throw new Exception(\"You are not allowed to update the status yourself\");\r\n }\r\n echo \"asdasdasda\";\r\n //check the allowed meta tags\r\n if(isset($request[\"meta\"]))\r\n Authentication::metaCheck($request[\"meta\"], array(\"admin_comments\"));\r\n \r\n }\r\n elseif($user->type==\"supervisor\"){\r\n //check to see if status is available\r\n if(!isset($request[\"status\"])){\r\n throw new Exception(\"Please return a status\");\r\n }\r\n \r\n //if isset data\r\n if(isset($request[\"data\"])){\r\n throw new Exception(\"You are not allowed to update the data yourself\");\r\n }\r\n \r\n //check to see if the form is in 3->pending, 3->accepted state and the users destrict match\r\n $counter = Authentication::$db->countRecords(\"_sync_user\", \"_form_id = :formid and _district_id = :districtid and status in (3,1)\",\r\n array(\r\n \":formid\"=>$request[\"form_id\"],\r\n \":districtid\"=>$user->districtId\r\n )\r\n );\r\n if($counter!=1){\r\n throw new Exception(\"Sorry you are not allowed to update this form\");\r\n }\r\n \r\n //check the allowed meta tags\r\n if(isset($request[\"meta\"]))\r\n Authentication::metaCheck($request[\"meta\"], array(\"comments\", \"fields\"));\r\n \r\n \r\n if(isset($request[\"meta\"])&&!isset($request[\"status\"])){\r\n throw new Exception(\"Please send a status along with your meta data\");\r\n }\r\n \r\n }\r\n elseif($user->type==\"collector\"){\r\n //collector cannot send the meta data\r\n if(isset($request[\"meta\"]))\r\n throw new Exception(\"Sorry you are not allowed to add meta data\");\r\n \r\n if(isset($request[\"status\"]))\r\n throw new Exception(\"sorry you are not allowed to update the status\");\r\n \r\n //check if he was the one who created the form and if the status is 2->reverted\r\n $counter = Authentication::$db->countRecords(\"sync\", \"_form_id = :formid and _user_id = :userid and status in (2)\",\r\n array(\r\n \":formid\" => $request[\"form_id\"],\r\n \":userid\" => $user->id\r\n )\r\n );\r\n \r\n if($counter!=1){\r\n throw new Exception(\"Sorry you cannot update this form untill the supervisor checks it.\");\r\n }\r\n }\r\n }\r\n \r\n return true;\r\n }", "public function validateUser(){\n\t\t$user = $this->auth->user();\n\t\tif(!$user) {\n\t\t\t$responseArray = [\n\t\t\t\t'message' => 'Not authorized. Please login again',\n\t\t\t\t'status' => false\n\t\t\t];\n\n\t\t\treturn response()->json($responseArray)->setStatusCode(403);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$responseArray = [\n\t\t\t'message' => 'User is authorized',\n\t\t\t'status' => true\n\t\t\t];\n\n\t\t\treturn response()->json($responseArray)->setStatusCode(200);\n\t\t}\n\t}", "public function validAuthenticationResponse($request, $result)\n {\n if (is_bool($result)) {\n return json_encode($result);\n }\n\n $channelName = $request->channel_name;\n\n return json_encode([\n 'channel_data' => [\n 'user_id' => $this->retrieveUser($request, $channelName)->getAuthIdentifier(),\n 'user_info' => $result,\n ]\n ]);\n }", "public static function validateUserInfo($userInfo)\n {\n $regex = '/^(?:[' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . ':]+|%[A-Fa-f0-9]{2})*$/';\n return (bool) preg_match($regex, $userInfo);\n }", "public function validateToken()\n {\n $user = auth()->user();\n $token = $user->token();\n $profileIds = [];\n $userProfiles = UserProfile::where(['user_id' => $user->id])->get(['profile_id']);\n\n foreach ($userProfiles as $profile) {\n $profileIds[] = $profile->profile_id;\n }\n\n return response()->json([\n 'message' => 'Usuário autenticado com sucesso!',\n 'data' => [\n 'token' => [\n 'profile_id' => $token->profile_id,\n 'expires_at' => Carbon::parse(\n $token->expires_at\n )->toDateTimeString()\n ],\n 'user' => User::find($user->id, ['login', 'name', 'email', 'last_access', 'created_at']),\n 'profiles' => Profile::whereIN('id', $profileIds)->get(['id', 'noun', 'description'])\n ]\n ]);\n }", "private function isValidProfileInformation($user_fulldata,$application){\n $validation_array = $this->getValidationArray($application);\n\n $user_reg_validation = $validation_array['users_reg'];\n $guardian_validation = $validation_array['guardian'];\n $qualifications_validation = $validation_array['qualifications'];\n $qualification_error_msg = $validation_array['qualifications']['DEGREE_ID_MSG'];\n $or_qualifications_validation = $validation_array['or_qualifications']['OR_DEGREE_ID'];\n $or_qualification_error_msg = $validation_array['or_qualifications']['OR_DEGREE_ID_MSG'];\n\n $users_reg = $user_fulldata['users_reg'];\n $guardian = $user_fulldata['guardian'];\n $qualifications = $user_fulldata['qualifications'];\n\n\n\n if($users_reg['IS_CNIC_PASS']=='P'){\n $user_reg_validation = array_merge($user_reg_validation,$validation_array['PASSPORT']);\n }else{\n $user_reg_validation = array_merge($user_reg_validation,$validation_array['CNIC']);\n }\n\n $error = \"\";\n foreach($user_reg_validation as $column=>$value){\n\n\n if(preg_match(\"/\".$value['regex'].\"/\", $users_reg[$column])){\n\n }else{\n $error.=\"<div class='text-danger'>{$value['error_msg']}</div>\";\n\n }\n }\n\n foreach($guardian_validation as $column=>$value){\n\n\n if(preg_match(\"/\".$value['regex'].\"/\", $guardian[$column])){\n\n }else{\n $error.=\"<div class='text-danger'>{$value['error_msg']}</div>\";\n }\n }\n \n foreach($qualifications as $qual){\n\n foreach($qualifications_validation['DEGREE_ID'] as $k=>$val){\n if($qual['DEGREE_ID']==$val){\n unset($qualifications_validation['DEGREE_ID'][$k]);\n unset($qualification_error_msg[$k]);\n\n break;\n }\n }\n }\n foreach ($qualification_error_msg as $error_msg){\n $error.=\"<div class='text-danger'>{$error_msg}</div>\";\n }\n\n\n if(is_array($or_qualifications_validation)){\n $bool = true;\n foreach($qualifications as $qual){\n\n foreach($or_qualifications_validation as $val){\n if($qual['DEGREE_ID']==$val){\n $bool = false;\n break;\n }\n }\n }\n\n if($bool){\n $error.=\"<div class='text-danger'>{$or_qualification_error_msg}</div>\";\n }\n\n }\n return $error;\n //prePrint($qualification_error_msg);\n\n }", "public function verifyEmailAddressByUserId($request)\n {\n return $this->start()->uri(\"/api/user/verify-email\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "protected function verify_token($request)\n {\n $header = $request->getHeaders();\n $token = $header['Authorization'][0];\n try{\n $current_user = $this->getDecodeJwt($token, getenv(\"APP_KEY\"));\n return (array)$current_user->data;\n }\n catch (\\Exception $e){\n return false;\n \n }\n }", "function checkIncompleteInfoById($userid)\r\n\t{\r\n\t\t$userid = funcs::check_input($userid);\r\n\r\n\t\t$sql = \"SELECT country, state, city, waitver_mobileno, mobileno FROM \".TABLE_MEMBER.\" WHERE id = '\".$userid.\"'\";\r\n\t\t$row = DBconnect::assoc_query_1D($sql);\r\n\r\n\t\tif($row['country'] == '0' && $row['state'] == '0' && $row['city'] == '0')\r\n\t\t{\r\n\t\t\treturn 2; //go to register step2\r\n\t\t}\r\n\t\telse if(!(isset($row['mobileno'])) || $row['mobileno'] == \"\")\r\n\t\t{\r\n\t\t\treturn 3; //go to mobile verify\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn 1; //complete info, users can access to the link which allow their permission\r\n\t\t}\r\n\t}", "public function verify_userinfo()\n\t{\n\t\t//load the user model\n\t\t$this->load->model('user');\n\t\t//call login function of user model\n\t\tif ($this->user->login())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse return false;\n\t}", "public function check($information) {\n $user = Users::findFirstByEmail($information['email']);\n if ($user == false) {\n //$this->registerUserThrottling(0);\n throw new PhalconException('Wrong email/password combination');\n }\n\n // Check the password\n if (!$this->security->checkHash($information['password'], $user->password)) {\n //$this->registerUserThrottling($user->id);\n throw new PhalconException('Wrong email/password combination');\n }\n\n // Check if the user was flagged\n //$this->checkUserFlags($user);\n\n // Register the successful login\n //$this->saveSuccessLogin($user);\n\n // Check if the remember me was selected\n /*if (isset($information['remember'])) {\n $this->createRememberEnvironment($user);\n }*/\n\n $this->session->set('auth-identity', [\n 'id' => $user->id,\n 'name' => $user->name,\n 'permission' => $user->permission\n ]);\n }", "protected function _infoComplete($user_info, $pwdOptional = false)\n\t{\n\t\t/**\n \t * Ensure we have all the required fields...\n \t */\n \t$noerror = true;\n \t$noerror &= array_key_exists('firstname',$user_info);\n \t$noerror &= array_key_exists('lastname',$user_info);\n \t$noerror &= array_key_exists('gender',$user_info);\n \t$noerror &= array_key_exists('email',$user_info);\n// \t$noerror &= array_key_exists('mobile',$user_info); /* Optional */\n \t$noerror &= array_key_exists('day',$user_info);\n \t$noerror &= array_key_exists('month',$user_info);\n \t$noerror &= array_key_exists('year',$user_info);\n \t$noerror &= array_key_exists('address1',$user_info);\n// \t$noerror &= array_key_exists('address2',$user_info); /* Optional */\n \t$noerror &= array_key_exists('town',$user_info);\n// \t$noerror &= array_key_exists('zip',$user_info); \t /* Optional */\n\t\tif (!$pwdOptional)\n \t\t$noerror &= array_key_exists('password',$user_info);\n \t$noerror &= array_key_exists('state',$user_info);\n \t$noerror &= array_key_exists('country',$user_info);\n \t\n \treturn $noerror;\t\n\t}", "protected function userDetailsValidator($request) {\n \treturn Validator::make($request,[\n 'company_id' => 'required',\n 'department_id' => 'required',\n 'group_id' => 'required',\n 'role_id' => 'required'\n ]);\n \t}", "public function validateAccessToken()\n {\n try {\n \n // Try to get token from header\n $token = $this->getBearerToken();\n //echo(\"TOKEN: \" .$token.\"\\n\"); //debug\n $payload = JWT::decode($token, API_ACCESS_TOKEN_KEY, [''.API_ALGORITHM.'']);\n \n //moved SQL connection from __construct(). At least do not make so many connections to database. \n try {\n $db = new Database();\n $this->database = $db->connect();\n $sql = $this->database->prepare(\"SELECT Id, Disabled FROM users WHERE Id = :id\");\n $sql->bindParam(\":id\", $payload->userId);\n $sql->execute();\n $user = $sql->fetch(PDO::FETCH_ASSOC);\n } catch (Exception $e) {\n $this->throwException(DATABASE_ERROR, \"Database select error.\");\n }\n if (!is_array($user)) {\n $this->response(INVALID_USER_PASS, \"This user is not found in our database\");\n }\n \n if ($user['Disabled'] == 1 ) {\n $this->response(USER_IS_DISABLED, \"This user is disabled.\");\n }\n \n // if validated correctly lets set \n \n $this->user->setUserId($payload->userId);\n //$this->userId = $payload->userId;\n \n } catch (Exception $e) {\n //close db connection\n //$this->database->disconnect();\n $this->throwException(ACCESS_TOKEN_ERROR, \"AccessToken: \".$e->getMessage());\n }\n //close db connection\n //$this->database->disconnect();\n \n }", "protected function validateDetails($request) \n {\n return $this->validate($request, [\n 'client_first_name' => 'required|alpha|max:256',\n 'client_last_name' => 'required|alpha|max:256',\n 'client_phone' => 'required|regex:/^([0-9\\s\\-\\+\\(\\)]*)$/|min:10',\n 'client_email' => 'required|email',\n ]);\n }", "private static function validate_sale_info($payment_info) {\n\n return Validation::factory($payment_info)\n ->rule('card_number', 'not_empty')\n ->rule('expirationMonth', 'not_empty')\n ->rule('expirationYear', 'not_empty')\n ->rule('cvv', 'not_empty')\n ->rule('currency', 'not_empty')\n ->rule('firstName', 'not_empty');\n }", "public function verify(UserInterface $signator, Request $request) {\n if(!$this->isValidTimestamp($request->headers->getDate(\"date\"))) {\n return false;\n }\n\n $parts = array();\n if(preg_match(self::$authRegex,$this->getAuthorizationHeader($request),$parts)) {\n $requestUser = $parts[1];\n $requestSignature = $parts[2];\n \n if($requestUser == $signator->getUsername()) {\n $calculatedSignature = $this->makeSignature($signator,$request);\n\n if($calculatedSignature == $requestSignature) {\n return true;\n }\n }\n }\n\n return false;\n }", "protected function validateUserEmail($userInfo) {\n $config = \\Drupal::service('config.factory')->get('auth0.settings');\n $requires_email = $config->get('auth0_requires_verified_email');\n\n if ($requires_email) {\n if (!isset($userInfo['email']) || empty($userInfo['email'])) {\n throw new EmailNotSetException();\n }\n if (!$userInfo['email_verified']) {\n throw new EmailNotVerifiedException();\n }\n }\n }", "private function validateObservation() {\n\n $response = new ApiResponse();\n\n if (!\\Request::has('device_uuid')) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'device_uuid_null',\n 'description' => 'The device uuid should not be null'];\n }\n else{\n $device = Device::where('device_uuid', \\Request::get('device_uuid'))->first();\n\n if($device==null){\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'device_not_found',\n 'description' => 'The device could not be found'];\n }\n }\n\n if (!\\Request::has('mission_id')) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'mission_id_null',\n 'description' => 'The mission id should not be null'];\n } else {\n //check that the mission_id exists\n $this->mission = Mission::with('type')->find(\\Request::get('mission_id'));\n\n if ($this->mission == null) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'mission_id_not_found',\n 'description' => 'The requested mission could not be found'];\n }\n }\n\n if (\\Request::has('observation_date')) {\n if (!$this->validateDate(\\Request::get('observation_date'))) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'wrong_date_format',\n 'description' => 'The date should be in the following format: Y-m-d hh:mm:ss'];\n }\n }\n\n if (\\Request::has('latitude') && !is_numeric(\\Request::get('latitude')) || \\Request::has('longitude') && !is_numeric(\\Request::get('longitude'))) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'coordinates_not_numeric',\n 'description' => 'The coordinates of the observation should be numeric'];\n }\n\n if (!\\Request::has('measurements')) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'measurements_null',\n 'description' => 'The measurements should not be null'];\n } else {\n foreach (\\Request::get('measurements') as $measurement) {\n\n if (!isset($measurement['latitude']) || $measurement['latitude'] == '' || !isset($measurement['longitude']) || $measurement['longitude'] == '') {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'coordinates_null',\n 'description' => 'The coordinates of the measurements should not be null'];\n } else if (!is_numeric($measurement['latitude']) || !is_numeric($measurement['longitude'])) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'coordinates_not_numeric',\n 'description' => 'The coordinates of the measurements should be numeric'];\n }\n }\n }\n\n return $response;\n }", "public function testGetInfoUser()\n {\n $id = 1;\n $this->json('GET', \"api/user/get-info/$id\", ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"data\" => [\n \"created_at\",\n \"email\",\n \"name\",\n \"id\",\n \"org_id\",\n \"updated_at\"\n ]\n ]);\n }", "public function hasValidClaims($token){\n \n $flatToken = explode('.',$token);\n $payload = $flatToken[1];\n $decodedPayload = base64_decode($payload);\n\n $claimsArray = $this->filterClaimsFromDecoded($decodedPayload);\n // dd($claimsArray);\n\n //validate claims\n foreach ($claimsArray as $key => $value) {\n $claimClassFromObj = $this->defaultClaims[$key];\n $claimClass = (new $claimClassFromObj($value));\n if(method_exists($claimClass,'validatePayload')){\n $claimClass->validatePayload();\n }\n }\n return true;\n\n }", "public function verifyUserRegistration($request)\n {\n return $this->startAnonymous()->uri(\"/api/user/verify-registration\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "function authUsers($userType, Request $request, Response $response) {\n $authHeader = $request->getHeader('Authorization');\n list($jwt) = sscanf($authHeader[0], 'Bearer %s');\n if ($jwt) {\n try {\n $data = getTokenData($request);\n if (in_array($data[Constants::USERS_FLD_USER_TYPE], $userType)) {\n return true;\n } else {\n return false;\n }\n } catch (Exception $e) {\n return false;\n }\n } else {\n return false;\n }\n return false;\n}", "public function testIdentifyUserWithBearerTokenTypeSetsUserIdForValidHeader()\n {\n $request = new Request($this->config, ['HTTPS' => 'on']);\n $mockOauth = $this->getMockBuilder(OAuthModel::class)->disableOriginalConstructor()->getMock();\n $mockOauth->expects($this->once())\n ->method('verifyAccessToken')\n ->with('authPart')\n ->willReturn('TheUserId');\n\n $request->setOauthModel($mockOauth);\n\n $request->identifyUser('Bearer authPart');\n\n $this->assertEquals('TheUserId', $request->user_id);\n $this->assertEquals('TheUserId', $request->getUserId());\n }", "public function getCallerInfo(Request $request) {\n $params = $request->all();\n //validate incoming user input request\n $validator = Validator::make($request->all(), RequestRules::getRule('CALLER_INFO'));\n\n if($validator->fails()) {\n return $this->validationError($validator->getMessageBag()->all(), HttpStatusCodes::UNPROCESSABLE_ENTITY);\n }\n\n $userDetails = User::where('phonenumber', $params['client_phonenumber'])->first(); // Check if Client Exists\n $isvalid_clientId_role_doctor = User::where('client_id', $params['doctor_id'])->where('role','doctor')->first(); // Validate doctor's id\n $has_Subscription = Subscription::where('phonenumber', $params['client_phonenumber'])->first();\n\n if($userDetails){\n if($isvalid_clientId_role_doctor){\n $subData = $this->helper->getUserSubscriptionDataViaMobile($params['client_phonenumber']);\n try{\n $userData = $userDetails->toArray();\n $userDataContent = $this->jsonToArray($userData['content']);\n // dd($userDataContent);\n $caseQuery = new ClientCases();\n $caseData = $caseQuery->getUserCasesByPhonenumber($userData['phonenumber']);\n if(isset($userDataContent[\"calls\"])){\n $calls = (int) $userDataContent[\"calls\"];\n if($calls > 0 and !$caseData){\n\n $subscriptionData = $has_Subscription->toArray();\n $subscriptionDataContent = $this->jsonToArray($subscriptionData['content']);\n \n // Create Case\n $caseparam = $params; // copy request data\n $caseparam['case_id'] = $this->generateDefaultStaticPassword(5);\n $caseparam['client_name'] = $userDataContent['firstname']. \" \". $userDataContent['lastname'];\n $caseparam['avatar'] = $userDataContent['avatar'];\n $caseparam['client_id'] = $userData['client_id'];\n $caseparam['client_email'] = $userDataContent['email'];\n $caseparam['client_phonenumber'] = $userDataContent['phonenumber'];\n $caseparam['client_package'] = $userDataContent['package'];\n $caseparam['case_status'] = \"open\";\n $caseparam['sub_status'] = $userDataContent['status'];\n \n $caseQuery = new ClientCases();\n $caseDetails = $caseQuery->addCase($caseparam);\n\n if($caseDetails){\n $data = $caseparam;\n $msg = \"Data Retrieval Successful\";\n return $this->jsonoutput($msg, $data, HttpStatusCodes::OK);\n } else {\n return $this->error('Case not created. Call cannot proceed. Please Terminate.', HttpStatusCodes::UNAUTHORIZED);\n }\n \n } elseif($calls == 0 and $caseData){\n $caseDetails = $this->arraylize($caseData);\n if($caseDetails){\n $caseDetails['avatar'] = $userDataContent['avatar'];\n $data = $caseDetails;\n $msg = \"Data Retrieval Successful\";\n return $this->jsonoutput($msg, $data, HttpStatusCodes::OK);\n } else {\n return $this->error('Could not retrieve user details', HttpStatusCodes::BAD_REQUEST);\n }\n\n } elseif($calls > 0 and $caseData){\n $caseDetails = $this->arraylize($caseData);\n if($caseDetails){\n $caseDetails['avatar'] = $userDataContent['avatar'];\n $data = $caseDetails;\n $msg = \"Data Retrieval Successful\";\n return $this->jsonoutput($msg, $data, HttpStatusCodes::OK);\n } else {\n return $this->error('Could not retrieve user details', HttpStatusCodes::BAD_REQUEST);\n }\n\n } else {\n return $this->error('Client Subscription In-active. Please Terminate Call.', HttpStatusCodes::UNPROCESSABLE_ENTITY);\n }\n } else {\n return $this->error('This client is new and has not subscribed. Please Terminate Call.', HttpStatusCodes::FORBIDDEN);\n }\n \n } catch(\\Exception $e) {\n //something went wrong\n return $this->exceptionError($e->getMessage(), HttpStatusCodes::BAD_REQUEST);\n \n }\n } else {\n return $this->error('Doctor Credential Invalid!', HttpStatusCodes::BAD_REQUEST);\n }\n \n } else {\n return $this->error('Caller is not a 2MA Client!', HttpStatusCodes::NOT_FOUND);\n }\n }", "public function get($info)\n {\n if (is_integer($info)) {\n \n } elseif (is_string($info)) {\n \n } else {\n throw new Exception\\IdentityException(sprintf(\n 'A string-based username or an integer-based user ID is valid'\n ));\n }\n }", "public function verify($user_id, Request $request)\n {\n $user = User::findOrFail($user_id);\n\n if(! $request->hasValidSignature() || $user->hasVerifiedEmail() ){\n return response()->json(['Unauthorization Action'], 401);\n }\n\n $user->markEmailAsVerified();\n\n event(new Verified($user));\n\n return response()->json(['success'],200);\n }", "private function verify_request()\n {\n try{\n $headers = $this->input->request_headers();\n $token = $headers['X-API-KEY'];\n if(!$token) {\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n return;\n }\n\n $data = AUTHORIZATION::validateToken($token);\n if($data === false){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized accesss'];\n $this->response($res, $status);\n exit();\n }else{\n return $data;\n }\n\n }catch(Exception $e){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n }\n }", "private function verify_request()\n {\n try{\n $headers = $this->input->request_headers();\n $token = $headers['X-API-KEY'];\n if(!$token) {\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n return;\n }\n\n $data = AUTHORIZATION::validateToken($token);\n if($data === false){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized accesss'];\n $this->response($res, $status);\n exit();\n }else{\n return $data;\n }\n\n }catch(Exception $e){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n }\n }", "function oid_check_teams($response)\n{\n $requiredTeam = common_config('openid', 'required_team');\n if ($requiredTeam) {\n $team_resp = new Auth_OpenID_TeamsResponse($response);\n if ($team_resp) {\n $teams = $team_resp->getTeams();\n } else {\n $teams = array();\n }\n\n $match = in_array($requiredTeam, $teams);\n $is = $match ? 'is' : 'is not';\n common_log(LOG_DEBUG, \"Remote user $is in required team $requiredTeam: [\" . implode(', ', $teams) . \"]\");\n\n return $match;\n }\n\n return true;\n}", "protected function validateTokenClaims(string $clientId): void\n {\n // 1. The Issuer Identifier for the OpenID Provider (which is typically obtained during Discovery)\n // MUST exactly match the value of the iss (issuer) Claim.\n if (empty($this->payload['iss']) || $this->issuer !== $this->payload['iss']) {\n throw new OidcInvalidTokenException('Missing or non-matching token issuer value');\n }\n\n // 2. The Client MUST validate that the aud (audience) Claim contains its client_id value registered\n // at the Issuer identified by the iss (issuer) Claim as an audience. The ID Token MUST be rejected\n // if the ID Token does not list the Client as a valid audience, or if it contains additional\n // audiences not trusted by the Client.\n if (empty($this->payload['aud'])) {\n throw new OidcInvalidTokenException('Missing token audience value');\n }\n\n $aud = is_string($this->payload['aud']) ? [$this->payload['aud']] : $this->payload['aud'];\n if (count($aud) !== 1) {\n throw new OidcInvalidTokenException('Token audience value has ' . count($aud) . ' values, Expected 1');\n }\n\n if ($aud[0] !== $clientId) {\n throw new OidcInvalidTokenException('Token audience value did not match the expected client_id');\n }\n\n // 3. If the ID Token contains multiple audiences, the Client SHOULD verify that an azp Claim is present.\n // NOTE: Addressed by enforcing a count of 1 above.\n\n // 4. If an azp (authorized party) Claim is present, the Client SHOULD verify that its client_id\n // is the Claim Value.\n if (isset($this->payload['azp']) && $this->payload['azp'] !== $clientId) {\n throw new OidcInvalidTokenException('Token authorized party exists but does not match the expected client_id');\n }\n\n // 5. The current time MUST be before the time represented by the exp Claim\n // (possibly allowing for some small leeway to account for clock skew).\n if (empty($this->payload['exp'])) {\n throw new OidcInvalidTokenException('Missing token expiration time value');\n }\n\n $skewSeconds = 120;\n $now = time();\n if ($now >= (intval($this->payload['exp']) + $skewSeconds)) {\n throw new OidcInvalidTokenException('Token has expired');\n }\n\n // 6. The iat Claim can be used to reject tokens that were issued too far away from the current time,\n // limiting the amount of time that nonces need to be stored to prevent attacks.\n // The acceptable range is Client specific.\n if (empty($this->payload['iat'])) {\n throw new OidcInvalidTokenException('Missing token issued at time value');\n }\n\n $dayAgo = time() - 86400;\n $iat = intval($this->payload['iat']);\n if ($iat > ($now + $skewSeconds) || $iat < $dayAgo) {\n throw new OidcInvalidTokenException('Token issue at time is not recent or is invalid');\n }\n\n // 7. If the acr Claim was requested, the Client SHOULD check that the asserted Claim Value is appropriate.\n // The meaning and processing of acr Claim Values is out of scope for this document.\n // NOTE: Not used for our case here. acr is not requested.\n\n // 8. When a max_age request is made, the Client SHOULD check the auth_time Claim value and request\n // re-authentication if it determines too much time has elapsed since the last End-User authentication.\n // NOTE: Not used for our case here. A max_age request is not made.\n\n // Custom: Ensure the \"sub\" (Subject) Claim exists and has a value.\n if (empty($this->payload['sub'])) {\n throw new OidcInvalidTokenException('Missing token subject value');\n }\n }", "public function testValidationErrorIsReturnedIfInvalidDataIsPassedToEnabled2FA()\n {\n /** @var \\Pterodactyl\\Models\\User $user */\n $user = User::factory()->create(['use_totp' => false]);\n\n $response = $this->actingAs($user)->postJson('/api/client/account/two-factor', [\n 'code' => '',\n ]);\n\n $response->assertStatus(Response::HTTP_UNPROCESSABLE_ENTITY);\n $response->assertJsonPath('errors.0.code', 'ValidationException');\n $response->assertJsonPath('errors.0.meta.rule', 'required');\n }", "public function verifyRequest()\n {\n }", "public function validateInfo($info, $action = '', $resourceId = '')\n {\n $rules = [\n 'name' => 'required',\n ];\n\n $validator = Validator::make($info, $rules);\n\n return $validator;\n }", "private function verifySession($user_id)\n {\n $user = User::where([\n ['id', '=', $user_id]\n ])->get();\n\n if (count($user) == 0) {\n return ['bool' => false, 'msj' => 'Usuario no encontrado. revisa el id o token de usuario'];\n } else {\n\n $user = $user[0];\n $lifetime = config(\"session.lifetime\");\n $last_activity = new DateTime($user->last_activity);\n $current_datetime = new DateTime(date(\"Y-m-d H:i:s\"));\n $diff = $last_activity->diff($current_datetime);\n\n $bool = true;\n $msj = '';\n\n if ($diff->i > $lifetime) {\n $user->api_token = null;\n $oauth_access_tokens = DB::table('oauth_access_tokens')->select('id')->where('user_id', '=', $user->id)->get();\n\n foreach ($oauth_access_tokens as $oauth_access_token) {\n DB::table('oauth_refresh_tokens')->where('access_token_id', '=', $oauth_access_token->id)->delete();\n DB::table('oauth_access_tokens')->where('id', '=', $oauth_access_token->id)->delete();\n }\n\n $bool = false;\n $msj = 'Limite de tiempo excedido';\n } else {\n $user->last_activity = date(\"Y-m-d H:i:s\");\n }\n\n $user->save();\n return ['bool' => $bool, 'msj' => $msj];\n }\n }", "public function verify(VerifyTwoFactorTokenRequest $request, User $user)\n {\n if (! Authy::tokenIsValid($user, $request->token)) {\n return $this->setStatusCode(422)\n ->respondWithError(\"Invalid 2FA token.\");\n }\n\n $user->setTwoFactorAuthProviderOptions(array_merge(\n $user->getTwoFactorAuthProviderOptions(),\n ['enabled' => true]\n ));\n\n $user->save();\n\n event(new TwoFactorEnabledByAdmin($user));\n\n return $this->respondWithItem($user, new UserTransformer);\n }", "private function validate () {\n $payload = $this->payload;\n // Unset fields that don't match the spec\n foreach (array_keys($payload) as $field) {\n if (!in_array($field, $this->fields)) {\n unset($payload[$field]);\n }\n }\n\n // If the user is signing up manually (I.e. not via a social network), then\n // we also need a password\n if ($this->method === 'manual' && empty($payload['password'])) {\n return false;\n }\n\n $this->payload = $payload;\n return true;\n }", "public function setClaimInfo($claimInfo)\n {\n $this->claimInfo = $claimInfo;\n return $this;\n }", "public function hasValidResponse(RequestEntity $request);", "public function handleVerifyIdentityCard($userId, $type)\n {\n switch ($type) {\n case StatusConstant::IDENTITY_ACCEPT_STATUS:\n $user = $this->userRepo->find($userId);\n if ($user->input_refferal_code) {\n $userRefferal = $this->userRepo->findWhere(['referral_code' => $user->input_refferal_code])->first();\n if ($userRefferal) {\n $this->handleBonusReferral($userId, StatusConstant::BONUS_TYPE_INPUT_REFFERAL, $userRefferal->id);\n $this->handleBonusReferral($userRefferal->id, StatusConstant::BONUS_TYPE_REFFERAL, $userId);\n }\n }\n $this->userRepo->updateIdentityStatus($userId, StatusConstant::IDENTITY_ACCEPT_STATUS);\n $this->noticesService->noticeVerifyIdentityCard(StatusConstant::IDENTITY_ACCEPT_STATUS, $userId);\n break;\n case StatusConstant::IDENTITY_REJECT_STATUS:\n $this->IDRepo->removeIdentityCard($userId);\n $this->userRepo->updateIdentityStatus($userId, StatusConstant::IDENTITY_REJECT_STATUS);\n $this->noticesService->noticeVerifyIdentityCard(StatusConstant::IDENTITY_REJECT_STATUS, $userId);\n break;\n default:\n break;\n }\n }", "public function me(Request $request)\n {\n return $this->validResponse($request->user());\n }", "public function identityInfoSubmitted(Request $request)\n {\n return response()->json(['found' => boolval(\\App\\UserIdentityVerificationDetails::where('user_id', Auth::user()->id)->count())]);\n }", "function validateUser(Userinfo $userinfo)\n\t{\n\t\t$username = $this->filterUsername($userinfo->username);\n\t\tif ($username !== $userinfo->username) {\n\t\t\tthrow new RuntimeException('Username Has Invalid Character: ' . $userinfo->username . ' vs ' . $username);\n\t\t}\n\t\treturn true;\n\t}", "function processopenidresponse() {\n\t\t$consumer = new Auth_OpenID_Consumer(new OpenIDStorage(), new SessionWrapper());\n\n\t\t$trust_root = Director::absoluteBaseURL();\n\t\t$return_to_url = $trust_root . $this->Link('ProcessOpenIDResponse');\n\n\t\t// Complete the authentication process using the server's response.\n\t\t$response = $consumer->complete($return_to_url);\n\n\t\tif($response->status == Auth_OpenID_SUCCESS) {\n\t\t\tSession::clear(\"FormInfo.Form_RegistrationWithOpenIDForm.data\");\n\t\t\t$openid = $response->identity_url;\n\n\t\t\tif($response->endpoint->canonicalID) {\n\t\t\t\t$openid = $response->endpoint->canonicalID;\n\t\t\t}\n\n\t\t\t$sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($response);\n\t\t\t$sreg = $sreg_resp->contents();\n\n\t\t\t// Convert the simple registration data to the needed format\n\t\t\t// try to split fullname to get firstname and surname\n\t\t\t$data = array('IdentityURL' => $openid);\n\t\t\tif(isset($sreg['nickname']))\n\t\t\t\t$data['Nickname'] = $sreg['nickname'];\n\t\t\tif(isset($sreg['fullname'])) {\n\t\t\t\t$fullname = explode(' ', $sreg['fullname'], 2);\n\t\t\t\tif(count($fullname) == 2) {\n\t\t\t\t\t$data['FirstName'] = $fullname[0];\n\t\t\t\t\t$data['Surname'] = $fullname[1];\n\t\t\t\t} else {\n\t\t\t\t\t$data['Surname'] = $fullname[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($sreg['country']))\n\t\t\t\t$data['Country'] = $sreg['country'];\n\t\t\tif(isset($sreg['email']))\n\t\t\t\t$data['Email'] = $sreg['email'];\n\n\t\t\tSession::set(\"FormInfo.Form_RegistrationForm.data\", $data);\n\t\t\treturn $this->redirect($this->Link('register'));\n\t\t}\n\n\n\t\t// The server returned an error message, handle it!\n\t\tif($response->status == Auth_OpenID_CANCEL) {\n\t\t\t$error_message = _t('ForumMemberProfile.CANCELLEDVERIFICATION','The verification was cancelled. Please try again.');\n\t\t} else if($response->status == Auth_OpenID_FAILURE) {\n\t\t\t$error_message = _t('ForumMemberProfile.AUTHENTICATIONFAILED','The OpenID/i-name authentication failed.');\n\t\t} else {\n\t\t\t$error_message = _t('ForumMemberProfile.UNEXPECTEDERROR','An unexpected error occured. Please try again or register without OpenID');\n\t\t}\n\n\t\t$this->RegistrationWithOpenIDForm()->addErrorMessage(\"Blurb\",\n\t\t\t$error_message, 'bad');\n\n\t\treturn $this->redirect($this->Link('registerwithopenid'));\n\t}", "private function validateTokens()\n {\n $whoami = $this->getJson('/ping/whoami');\n if (isset($whoami['authenticated']) && $whoami['authenticated'])\n {\n syslog(LOG_DEBUG, \"Monzo: Token is still valid\");\n return true;\n }\n else\n {\n return false;\n }\n }", "protected function _validateResult($result)\n {\n \n if (false == $result) {\n $this->_authenticateResultInfo['code'] = Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND;\n $this->_authenticateResultInfo['messages'][] = 'A record with the supplied identity could not be found.';\n } elseif(is_array($result)) {\n $this->_body = $result;\n if(isset($result['error'])){\n $this->_authenticateResultInfo['code'] = Zend_Auth_Result::FAILURE;\n $this->_authenticateResultInfo['messages'][] = $result['hrInfo'];\n }\n elseif(isset($result['teacher'])){\n if(isset($result['teacher']['blocked']) && $result['teacher']['blocked'] == true){\n $this->_authenticateResultInfo['code'] = Zend_Auth_Result::FAILURE;\n $this->_authenticateResultInfo['messages'][] = 'Blocked reason: ' . $result['teacher']['blockedReason'];\n }\n else{\n $this->_authenticateResultInfo['code'] = Zend_Auth_Result::SUCCESS;\n $this->_authenticateResultInfo['identity'] = $this->_identity;\n $this->_authenticateResultInfo['messages'][] = 'Authentication successful.'; \n }\n \n }\n \t\n } else {\n \t$this->_authenticateResultInfo['code'] = Zend_Auth_Result::FAILURE_UNCATEGORIZED;\n }\n\n return $this->_authenticateCreateAuthResult();\n }", "public function isAuthorized( $request_vars ){\n // auth token\n \n $isAuthorized = false;\n\n $userInfo = $this->fbAuth->setAccessToken( $request_vars->getParam( 'accessToken' ) );\n\n// print_r( $userInfo );\n \n $this->userId = $userInfo['id'];\n\n if( is_array( $userInfo ) ) \n $isAuthorized = true;\n else\n echo 'not autorized';\n\n return $isAuthorized;\n }", "public static function is_verified($user, $site) \n\t{\n if (USER_VERIFY_ID == 'enabled') \n\t\t{\n\t\t\t//they've not submited a file and we've not verified\n if ($user->user_detailverified == 'unverified' && $user->user_detailssubmitted == 'notsubmitted') \n\t\t\t{\n require Config::get('PATH_VIEWS') . 'views/user/verify.php';\n require Config::get('PATH_VIEWS') . 'views/_templates/footer.php';\n exit();\n \n\t\t\t////they've submited their ID but we've not verified yet\n\t\t\t}else if ($user->user_detailssubmitted == 'submited' && $user->detailverified == 'unverified') \n\t\t\t{\n\t\t\t\t//leave them a message\n\t\t\t\texit('<div class=\"col-md-6 col-xs-offset-3\"><div class=\"alert alert-success\"><strong>'. Filtration\\Core\\System::translate(\"Details Submitted!\").'\n\t\t\t\t\t</strong>'. Filtration\\Core\\System::translate(\"Please wait for our team to verify your details\").'</div></div>');\n }\n }\n }", "public function check(){\n\n \tif($this->input->method()!=\"get\"){\n \t\t$this->output->set_status_header(405);\n \t\treturn false;\n \t}\n\t\t$JWTtoken = str_replace(\"Bearer \",\"\",$this->input->get_request_header('Authorization'));\n\t\t$decodedToken = \"\";\n\t\tif($JWTtoken == \"\" || $JWTtoken == null){\n\t\t\techo json_encode([\"error\"=>\"User authentication is required\"]);\n \t\t$this->output->set_status_header(401);\n \t\treturn false;\n\t\t}\n\t\t//$decodedToken = $this->jwtload->decode(\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.W3siZmlyc3RfbmFtZSI6ImFkbWluIiwibGFzdF9uYW1lIjoiZS1jb25zdWx0YSIsImVtYWlsIjoic2VydmVyQGUtY29uc3VsdGEuY29tIiwidXNlcm5hbWUiOiJlQWRtaW4iLCJpYXQiOiIxNTg3MTY2NDg4IiwiZXhwIjoiMTU4ODAzMDQ4OCJ9XQ.60U4_3ukAnwXqp517b0xRJXWIM1tT_00CCZWwjGa_2U\",$this->key,array('HS256'));\n\t\ttry{\n\t\t\t$decodedToken = $this->jwtload->decode($JWTtoken,$this->key,array('HS256'));\n\t\t}\n\t\tcatch(Exception $e){\n\t\t\t$decodedToken = false;\n\t\t\techo json_encode([\"error\"=>\"Invalid Token\"]);\n\t\t\t$this->output->set_status_header(401);\n\t\t\treturn $decodedToken;\n\t\t}\n\n\t\tif(!(time() > $decodedToken[0]->iat && time() < $decodedToken[0]->exp)){\n\t\t\techo json_encode([\"error\"=>\"User authentication is required\"]);\n \t\t$this->output->set_status_header(401);\n \t\treturn false;\n\t\t}\n\n\t\t//var_dump($decodedToken);\n\t\t//echo time();\n\n\t\t$userInfo = (object) [\n\t\t\t\"first_name\"=>$decodedToken[0]->first_name,\n\t\t\t\"last_name\"\t=>$decodedToken[0]->last_name,\n\t\t\t\"email\"\t\t=>$decodedToken[0]->email,\n\t\t\t\"username\"\t=>$decodedToken[0]->username\n\t\t];\n\t\techo json_encode([\"user\"=>$userInfo]);\n\t\treturn true;\n\t}", "function handle_claim() {\n $file = $_FILES[\"claim\"];\n\n if (!check_upload(&$file)) {\n header(\"HTTP/1.1 400 Bad Request\");\n echo \"Uploaded file missing or of wrong type!\\n\";\n return false;\n }\n\n if (($err = verify_signature(&$file)) !== \"OK\") {\n header(\"HTTP/1.1 400 Bad Request\");\n echo \"The claim's signature is invalid!\\n$err\\n\";\n return false;\n }\n\n extract_claim($file);\n return true;\n}", "public function getUserValidationAction()\n {\n $email = $this->params()->fromQuery('email','');\n $featureName = $this->params()->fromQuery('featureName','');\n $res = $this->entityManager->getRepository(Usersso::class)->isUserAllowed($email ,$featureName );\n if($res[0]['canAccess']>0)\n {\n $this->httpStatusCode = 200; \n\n }else{\n $this->httpStatusCode = 403;\n }\n $this->apiResponse['canAccess'] = $res[0]['canAccess'];\n return $this->createResponse();\n \n }", "public function validateSpeakerInfo()\n {\n $speakerInfo = filter_var(\n $this->_sanitized_data['speaker_info'],\n FILTER_SANITIZE_STRING\n );\n $validation_response = true;\n $speakerInfo = strip_tags($speakerInfo);\n $speakerInfo = $this->_purifier->purify($speakerInfo);\n\n if (empty($speakerInfo)) {\n $this->_addErrorMessage(\"You submitted speaker info but it was empty after sanitizing\");\n $validation_response = false;\n }\n\n return $validation_response;\n }", "public function validate($identityInformation, Constraint $constraint)\n {\n $expiredDate = $identityInformation->getIssueDate()->addYear($constraint->getExpirePeriod()->getExpirePeriod());\n \n // checks if expired date greater or equals to verification request date\n // all documents expire 5 years after issue\n if (!$expiredDate->greaterThanOrEqualTo($identityInformation->getRequestDate())) {\n $this->context->buildViolation($constraint->message)\n ->addViolation();\n }\n }", "public function validate($param, $isUser = false){\n\t\t$this->param = $param;\n\t\t\n\t\t$authorization_temp = null;\n\t\t// HTTP_DEVICETOKEN\n\t\t$device_token = $this->param->getServer('HTTP_DEVICETOKEN');\n\t\tif($device_token != 'no-device'){\n\t\t\t$device_token = $this->param->getServer('HTTP_DEVICEID') . '---' . $device_token;\n\t\t}\n\n\t\tif($device_token === '---'){\n\t\t\t$device_token = $this->param->getParam('Devicetoken');\n\t\t\tif($device_token != 'no-device'){\n\t\t\t\t$device_token = $this->param->getParam('Deviceid') . '---' . $device_token;\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t\twe use session on web app, token is not needed here\n\t\t\twe only use token for unsecure request\n\t\t\t$check = null; null = mobile , 1 = WEB \n\n\t\t\tif(!$this->param->getServer('HTTP_DEVICETOKEN')){\n\t\t\t\t$check = 1;\n\t\t\t}\n\t\t*/\n\t\t$result = [\n\t\t\t'error' => 1,\n\t\t\t'message' => $this->_lang->getLang('api_invalid_devicetoken'),\n\t\t\t'payload' => null,\n\t\t];\n\t\t\n\t\t$token = $this->getBearer();\n\n\t\tif(is_array($token) && count($token) == 3){\n\t\t\t$this->setSecret($this->siteConfig->getData('site_api_secret'));\n\t\t\t$fullToken = implode('.', $token);\n\n\t\t\t\n\t\t\t$payload = $this->validateToken($fullToken, $device_token/*, $check*/);\n\t\n\t\t\t$payload['devicetoken'] = $device_token;\n\t\t\tif($payload['error'] == 0){\n\t\t\t\tif($isUser){\n\t\t\t\t\tif(!isset($payload['payload']['jti'])) {\n\t\t\t\t\t\t$payload['error'] = 1;\n\t\t\t\t\t\t$payload['message'] = $this->_lang->getLang('login_no');\n\t\t\t\t\t\t$payload['payload'] = null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/*$user = $this->_userEntity->getByColumn(['id', $payload['jti']], 1);\n\t\t\t\t\t\tif(!$user){\n\t\t\t\t\t\t\t$payload['mesage'] = $this->_lang->getLang('loginaccount_not_found_no');\n\t\t\t\t\t\t\t$payload['payload'] = null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$payload['mesage'] = $this->_lang->getLang('success');\n\t\t\t\t\t\t\t$payload['user'] = $user;\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$result = $payload;\n\t\t}\n\n\t\treturn $result;\n\t}", "public function validateForm($data) {\n\t\tif(!is_array($data['value'])) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tforeach($data['value'] as $uID) {\n\t\t\t\t$user = User::getByUserID($data['value']);\n\t\t\t\tif(!$user->isRegistered()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn parent::validateForm($data);\n\t\t}\n\t}", "private function userinfo($access_token){\n //CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(), just entered');\n $userinfo = $this->serverGet($this->strategy['base_url'] . 'me', array('access_token' => $access_token), null, $headers); // 'me' from flask; google uses this naming convention, as do others.\n if (!empty($userinfo)){\n return $this->recursiveGetObjectVars(json_decode($userinfo));\n }\n else{\n $error = array(\n 'code' => 'userinfo_error',\n 'message' => 'Failed when attempting to query for user information',\n 'raw' => array(\n 'response' => $userinfo,\n 'headers' => $headers\n )\n );\n\n $this->errorCallback($error);\n }\n //CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(), done');\n }", "public function testItDoesntReturnAnInvalidUser()\n { \n $this->actingAs($this->user)\n ->getJson(\"api/v1/users/0\")\n ->assertStatus(422);\n }", "public function __invoke(Request $request, RequestHandler $handler): Response\r\n {\r\n \r\n $arrDatos = $request->getParsedBody();\r\n \r\n \r\n $user = new User();\r\n $user->email = $arrDatos['email']??\"0\";\r\n $user->tipo_id = $arrDatos['tipo']??\"0\";\r\n $user->clave = $arrDatos['clave']??\"0\";\r\n $user->nombre = $arrDatos['nombre']??\"0\";\r\n $user->legajo = $arrDatos['legajo']??\"0\";\r\n\r\n \r\n if ($user->email != \"0\" && $user->tipo_id != \"0\" && $user->clave != \"0\" && $user->nombre != \"0\" && $user->legajo) {\r\n \r\n if(Funciones::datosEspecificos3(strtolower($user->tipo_id),\"1\",\"2\",\"3\"))\r\n { \r\n if($user->legajo >999 && $user->legajo<2001)\r\n {\r\n $objeto = User::where('email',$arrDatos['email'])->get();\r\n $leg = User::where('legajo',$arrDatos['legajo'])->get();\r\n if($objeto == \"[]\")\r\n { \r\n if($leg == \"[]\")\r\n {\r\n $user->clave = password_hash($arrDatos['clave'],PASSWORD_DEFAULT);\r\n $request = $request->withAttribute(\"user\",$user);\r\n $resp = new Response();\r\n $response = $handler->handle($request);\r\n $existingContent = (string) $response->getBody();\r\n $resp->getBody()->write($existingContent);\r\n return $resp;\r\n \r\n }\r\n else\r\n {\r\n $resp = new Response();\r\n $resp->getBody()->write(json_encode(array(\"Error\" => \"Legajo Existente\")));\r\n return $resp;\r\n }\r\n\r\n }\r\n else\r\n {\r\n $resp = new Response();\r\n $resp->getBody()->write(json_encode(array(\"Error\" => \"Email Existente\")));\r\n \r\n return $resp;\r\n }\r\n }\r\n else\r\n { \r\n $resp = new Response();\r\n \r\n $resp->getBody()->write(json_encode(array(\"Error\" => \"Se puede ingresar un legajo entre 1000 y 2000\")));\r\n\r\n return $resp;\r\n }\r\n\r\n }\r\n else\r\n {\r\n $resp = new Response();\r\n $resp->getBody()->write(json_encode(array(\"Error\" => \"Solo es valido el tipo 1, 2 o 3\")));\r\n return $resp;\r\n }\r\n } else {\r\n $resp = new Response();\r\n $resp->getBody()->write(json_encode(array(\"Error\" => \"Datos insuficientes\")));\r\n return $resp;\r\n }\r\n \r\n \r\n }", "public function testIdentifyUserWithOauthTokenTypeSetsUserIdForValidHeader()\n {\n $request = new Request($this->config, ['HTTPS' => 'on']);\n $mockOauth = $this->getMockBuilder(OAuthModel::class)->disableOriginalConstructor()->getMock();\n $mockOauth->expects($this->once())\n ->method('verifyAccessToken')\n ->with('authPart')\n ->willReturn('TheUserId');\n\n $request->setOauthModel($mockOauth);\n\n $request->identifyUser('oauth authPart');\n\n $this->assertEquals('TheUserId', $request->user_id);\n $this->assertEquals('TheUserId', $request->getUserId());\n }", "protected function verify_token()\n {\n // lookup API Key record by value from HTTP header\n if (isset($this->rest->key) && is_null($this->rest->key)) {\n $key = $this->input->get_request_header(config_item('rest_key_name'));\n if (is_null($key)) {\n $key = $this->input->get_post('Token');\n }\n if (is_null($key)) {\n return;\n }\n $this->mApiKey = $this->api_keys->get_by(config_item('rest_key_column'), $key);\n if (!is_null($this->mApiKey)) {\n $this->rest->key = $this->mApiKey->{config_item('rest_key_column')};\n\n isset($this->mApiKey->user_id) && $this->rest->user_id = $this->mApiKey->user_id;\n isset($this->mApiKey->level) && $this->rest->level = $this->mApiKey->level;\n isset($this->mApiKey->ignore_limits) && $this->rest->ignore_limits = $this->mApiKey->ignore_limits;\n\n $this->_apiuser = $this->mApiKey;\n }\n\n } else {\n $this->mApiKey = $this->_apiuser;\n }\n\n if (!empty($this->mApiKey)) {\n $this->mUser = $this->users->get_by('username', $this->mApiKey->user_id);\n // only when the API Key represents a user\n if (!empty($this->mUser)) {\n $this->mUserRoles = $this->i2_auth->get_user_roles($this->mUser->id);\n// $this->mUserTenant = $this->users->get_user_tenant($this->mUser->id);\n $this->mUserTenant = $this->i2_auth->get_user_tenant($this->mUser->id);\n $this->tenant_table_prefix = $this->mUserTenant->tenant_name;\n $this->set_t_prefix();\n $this->mUserMainRole = $this->mUserRoles[0]->name;\n } else {\n // anonymous access via API Key\n $this->mUserMainRole = 'anonymous';\n }\n }\n }", "function validateUser($currentUser, $currentUserType){\n return $currentUserType==\"applicant\";\n }", "public function testUserInfo($userId)\n {\n $kraken = new Kraken(self::$tokenProvider);\n $userInfo = $kraken->users->info($userId);\n \n $this->assertInstanceOf(stdClass::class, $userInfo);\n $this->assertEquals(ACCESS_CHANNEL, $userInfo->name);\n\n // Check user info structure.\n foreach (self::USER_INFO_OBJ_ATTRIBUTES as $attr) {\n $this->assertObjectHasAttribute($attr, $userInfo);\n }\n\n // Test fetching the user by its username (and the cache by the way, since it should be in it after all tests)\n $newUserInfo = $kraken->users->info($userInfo->name);\n $this->assertEquals($userInfo, $newUserInfo);\n\n // Tests fetching an unknown user (thus failing the cache)\n $nonExistentUser = $kraken->users->info(\"NonExistentUser\". uniqid());\n $this->assertFalse($nonExistentUser);\n\n // Then drop the cache and test again a valid user to force an empty cache\n $kraken->users->emptyIdCache();\n \n // Assert the cache has been emptied\n $reflectionClass = new ReflectionClass(Users::class);\n $staticProperties = $reflectionClass->getStaticProperties();\n $userIdCache = $staticProperties['userIdCache'];\n $this->assertArrayNotHasKey($userInfo->name, $userIdCache);\n\n $nonCachedUserInfo = $kraken->users->info($userInfo->name);\n $this->assertEquals($userInfo, $nonCachedUserInfo);\n }", "function verifyAuth()\n\t{\n\t\tsanitizeRequest($_POST);\n\t\tsanitizeRequest($_GET);\n\t\t\n\t\t$currentUser = UserService::getInstance()->getCurrentUser();\n\t\tif (!$currentUser || !$currentUser->getSessionId()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t$payload = JWT::decode($currentUser->getSessionId(), SERVER_KEY, array('HS256'));\n\t\t\t$sessionId = UserService::getInstance()->getSessionId($currentUser->getId());\n\t\t\tif ($sessionId === $currentUser->getSessionId() &&\n\t\t\t\t\t$currentUser->getId() === $payload->id &&\n\t\t\t\t\t$currentUser->getEmail() === $payload->email) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\tif ($currentUser->isRemember() && $e->getMessage() === 'Expired token') {\n\t\t\t\t$currentUser->extendSession();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "private function checkUserAuthenticated () {\n if (empty($this->userIdentifier)) {\n #yes 403 - 401 is not appropriate for X509 authentication\n $this->exceptionWithResponseCode(403,\n \"You need to be authenticated to access this resource. \" .\n \"Please provide a valid IGTF X509 Certificate\"\n );\n }\n }", "public function validate(&$user)\n\t\t{\n\n\t\t\tif ( $user->get_detail ( clientes_todos ) == 1 )\n\t\t\t\treturn true;\n\n\t\t\treturn $user->get_detail(salesrep_id) == $this->get_detail(salesrep_id);\n\t\t}", "public function validateWithTokenId($data)\n {\n $validator = Validator::make($data, [\n 'datetime' => 'required|numeric',\n 'referenceId' => 'required|string',\n 'installments' => 'required|integer',\n 'amountE2' => 'required|integer',\n 'tokenId' => 'required|string',\n 'cardholderName' => 'nullable|string',\n 'cardExpirationDateYymm' => 'nullable|string|max:4',\n 'cvv' => 'nullable|numeric',\n 'autoCapture' => 'required|bool',\n\n 'purchaseInfo' => 'nullable|array',\n 'purchaseInfo.billTo' => 'nullable|array',\n 'purchaseInfo.billTo.address1' => 'nullable|string',\n 'purchaseInfo.billTo.address2' => 'nullable|string',\n 'purchaseInfo.billTo.administrativeArea' => 'nullable|string|max:2',\n 'purchaseInfo.billTo.countryCode' => 'nullable|string|max:2',\n 'purchaseInfo.billTo.city' => 'nullable|string',\n 'purchaseInfo.billTo.firstName' => 'nullable|string',\n 'purchaseInfo.billTo.lastName' => 'nullable|string',\n 'purchaseInfo.billTo.phoneNumber' => 'nullable|numeric',\n 'purchaseInfo.billTo.postalCode' => 'nullable|numeric',\n\n 'purchaseInfo.shippingTo' => 'nullable|array',\n 'purchaseInfo.shippingTo.address1' => 'nullable|string',\n 'purchaseInfo.shippingTo.address2' => 'nullable|string',\n 'purchaseInfo.shippingTo.administrativeArea' => 'nullable|string|max:2',\n 'purchaseInfo.shippingTo.countryCode' => 'nullable|string|max:2',\n 'purchaseInfo.shippingTo.city' => 'nullable|string',\n 'purchaseInfo.shippingTo.firstName' => 'nullable|string',\n 'purchaseInfo.shippingTo.lastName' => 'nullable|string',\n 'purchaseInfo.shippingTo.phoneNumber' => 'nullable|numeric',\n 'purchaseInfo.shippingTo.postalCode' => 'nullable|numeric',\n\n 'purchaseInfo.email' => 'nullable|email',\n 'purchaseInfo.ipAddress' => 'nullable|string',\n 'purchaseInfo.fingerprintSessionId' => 'nullable|string',\n 'purchaseInfo.personalIdentification' => 'nullable|numeric',\n\n ]);\n\n if ($validator->fails()) {\n throw new \\Exception($validator->errors()->first());\n }\n }", "public static function hasValidToken() {\n $requestHeaders = Rock::getHeaders();\n\n if (array_key_exists(Config::get('JWT_HEADER'), $requestHeaders) === true) {\n try {\n $decoded = (array)Firebase\\JWT\\JWT::decode($requestHeaders[Config::get('JWT_HEADER')], Config::get('JWT_KEY'), [Config::get('JWT_ALGORITHM')]);\n } catch (Exception $e) {\n return false;\n }\n\n $depth = 1;\n $result = Moedoo::select('user', [Config::get('TABLES')['user']['pk'] => $decoded['id']], null, $depth);\n $included = Moedoo::included(true);\n\n if (count($result) === 1) {\n $user = $result[0];\n $userGroup = $included['user_group'][$user['user_group']];\n\n if ($user['user_status'] === false) {\n //-> user suspended\n return false;\n } elseif (is_null($user['user_group']) === true) {\n //-> user doesn't belong to a user-group\n return false;\n } elseif ($userGroup['user_group_status'] === false) {\n //-> user-group has been suspended\n return false;\n }\n\n return $user;\n }\n\n return false;\n }\n\n return false;\n }", "public function authorize()\n {\n $auth_user = User::find(ApiHelper::getAuthenticatedUser()->id);\n $user_id = $this->route('user_id');\n if($user_id == $auth_user->id || ApiHelper::isPatient($user_id)){\n\n // ugly code; since iOs sends back <null> instead of null -> need to filter out these fields\n $fields = array('firstName', 'lastName', 'phone', 'gender', 'dateOfBirth', 'email');\n foreach ($fields as $f) {\n if($f == '<null>'\n )\n {\n echo $this->$f;\n $this->$f == null;\n }\n }\n return true;\n }\n return false;\n }", "function validateAuthorization($userId, $auth) {\n $jwt = \"\";\n\n if (substr($auth, 0, 6) == \"Bearer\") {\n $jwt = substr($auth, 7, strlen($auth));\n } else {\n return false;\n }\n \n $query = \"select content, expire_date from tokens where user_id = $userId ;\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n \n if ($r->num_rows == 0)\n return false;\n $response = $r->fetch_assoc();\n\n if ($this->isKeyExpired($response, $userId)) \n return false;\n\n $jwt = $response['content'];\n return $auth == $jwt;\n }", "private function validateAccessToken() {\n $this->userID = $this->facebook->getUser();\n }", "public function verified(Request $request)\n {\n if ($request->has('app_id') && $request->has('request_id') && $request->has('email') && $request->has('sign')) {\n if ($request->input('app_id') == 'oqEUfB6GyLysD9rK') {\n $sign = md5('app_id=oqEUfB6GyLysD9rK&request_id='.$request->input('request_id').'&email='.$request->input('email').'&app_secret=NCKhqJYmfYpCnVMTsPmU5dT2');\n if ($request->input('sign') == $sign) {\n $sign = md5('app_id=oqEUfB6GyLysD9rK&request_id='.$request->input('request_id').'&email='.$request->input('email').'&app_secret=UZSt7NsR7DqMhcjP3YuYnmJW');\n return response()->json(['code'=>200, 'result'=>false, 'sign'=>$sign]);\n } else {\n return response()->json(['code'=>403, 'message'=>'Access Denied: invalid sign.']);\n }\n } else {\n return response()->json(['code'=>403, 'message'=>'Access Denied: invalid app_id.']);\n }\n } else {\n return response()->json(['code'=>400, 'message'=>'Bad Request: missing parameter.']);\n }\n }", "public function checkIn(Request $request)\n {\n $response;\n $checkUser = new ValidUser($request);\n if ($checkUser != ErrorCode::$OK){\n $response = new MyResponse(ErrorCode::$INVALID_TOKEN, ErrorDesc::$INVALID_TOKEN, \"-\");\n return $response->get();\n }\n else {\n $absent_header = Absent::where('id','=',$request['absent_header'])\n ->first();\n $work_time = WorkTime::where('id','=',$absent_header['work_time'])\n ->first();\n $absent_time = Carbon::createFromFormat('Y-m-d H:i:s', \n $absent_header['work_date']\n .' '.$work_time['work_start']\n ,'Asia/Jakarta'); \n $lateTime = $absent_time->addMinutes($work_time['max_late']);\n \n $checkin = Carbon::now('Asia/Jakarta');\n $diff = $lateTime->diffInMinutes($checkin,false);\n\n $absent = new AbsentDetail();\n if ($diff > 0){\n $absent['status'] = 6;\n }\n else {\n $absent['status'] = 1;\n }\n $absent['employee'] = $request['employee_id'];\n $absent['check_in'] = $checkin;\n $absent['note'] = $request['note'];\n $absent['absent_header']= $absent_header['id'];\n $response = new MyResponse(ErrorCode::$OK, ErrorDesc::$OK, $absent);\n try {\n $absent->save();\n } catch(\\Illuminate\\Database\\QueryException $e){\n $errorCode = $e->errorInfo[1];\n if($errorCode == ErrorCode::$DUPLICATE_ENTRY){\n $response = new MyResponse(ErrorCode::$DUPLICATE_ENTRY, ErrorDesc::$DUPLICATE_ENTRY, \"Anda sudah melakukan absensi\");\n }\n }\n \n return $response->get();\n }\n // return $response->get();\n }", "public function completeWebAuthnAssertion($request)\n {\n return $this->startAnonymous()->uri(\"/api/webauthn/assert\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function verify(VerificationRequest $request)\n {\n $user = $this->verificationService->verify($request->all());\n\n if(isset($user['error']) && $user['error'] == 'invalid_user_token' ){\n $message = $this->getMessages->getMessage(\n null, \n $options = [\n 'error' => ['TokenNotFound']\n ],\n ['message_and_embed' => true]\n );\n return $this->response->json(['meta' => $message], 422);\n }\n \n $token = $user->createToken('userToken')->accessToken;\n\n $message = $this->getMessages->getMessage(\n $user, \n $options = [\n 'success' => ['UserMailAuthSuccess']\n ],\n ['message_and_embed' => true]\n );\n\n return (new UserResource($user))->additional([\n 'meta' => [\n 'success' => $message['success'],\n 'token' => $token\n ]\n ]);\n }", "public function validateClientToken($param){\n\t\t$this->param = $param;\n\n\t\t$token = $this->getBearer();\n\n\t\t$result = [\n\t\t\t'error' => 1,\n\t\t\t'message' => '',\n\t\t\t'payload' => null\n\t\t];\n\t\t$method = $this->param->getServer('REQUEST_METHOD');\n\t\tif($method === 'OPTIONS' || $method === 'PUT'){\n\t\t\tdie;\n\t\t}\n\n\t\tif($token && is_array($token)){\n\t\t\tlist($header, $payload, $signature) = $token;\n\t\t\t$dataEncoded = $header . '.' . $payload;\n\n\t\t\t$rawSignature = hash_hmac(\"sha256\", utf8_encode($dataEncoded), utf8_encode($this->siteConfig->getData('site_api_key')));\n\n\t\t\t$isValid = hash_equals($rawSignature, $signature);\n\n\t\t\tif($isValid){\n\t\t\t\t$payloadDecode = json_decode(base64_decode($payload), true);\n\t\t\t\tif(isset($payloadDecode['tzoffset']) && isset($payloadDecode['tzname'])){\n\t\t\t\t\t$tzoffset = $payloadDecode['tzoffset'];\n\t\t\t\t\t$tzname = $payloadDecode['tzname'];\n\n\t\t\t\t\t$tz = $this->validateTimeZone($tzoffset, $tzname);\n\n\t\t\t\t\tif($tz){\n\t\t\t\t\t\tdate_default_timezone_set($tz);\n\n\t\t\t\t\t\t$now = time();\n\t\t\t\t\t\t$tokenTime = strtotime($payloadDecode['iat']);\n\t\t\t\t\t\t$max_valid_time = $this->siteConfig->getData('site_api_token_max_time', 60*3);\n\n\t\t\t\t\t\t$gap = $now - $tokenTime;\n\n\t\t\t\t\t\t$expEnabled = (int)$this->siteConfig->getData('site_api_exp_enabled', 0);\n\n\t\t\t\t\t\t$result['error'] = 0;\n\t\t\t\t\t\t$result['message'] = $this->_lang->getLang('success');\n\t\t\t\t\t\t$result['payload'] = $payloadDecode;\n\n\t\t\t\t\t\tif($expEnabled == 1){\n\t\t\t\t\t\t\tif($gap > $max_valid_time){\n\t\t\t\t\t\t\t\t$result['error'] = 1;\n\t\t\t\t\t\t\t\t$result['message'] = $this->_lang->getLang('api_expired_token');\n\t\t\t\t\t\t\t\t$result['payload'] = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $result;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$result['message'] = $this->_lang->getLang('invalid_request');\n\t\t}\n\t}", "public function test_logged_in_user_show_info()\n {\n $user=User::factory()->create();\n //behavior as this created user\n $response=$this->actingAs($user)->get(route('auth.user'));\n\n $response->assertStatus(Response::HTTP_OK);\n }", "public function testCheckValidUser()\n {\n $body = file_get_contents(__DIR__ . '/TestXMLData/find_user_data.xml');\n\n $mock = new MockHandler([\n new Response(200, [], $body)\n ]);\n $handler = HandlerStack::create($mock);\n $client = new Client(['handler' => $handler]);\n\n try {\n $response = $client->request('/');\n } catch (GuzzleException $e) {\n echo Psr7\\str($e->getRequest());\n if ($e->hasResponse()) {\n echo Psr7\\str($e->getResponse());\n }\n }\n\n $given = $this->userdata->isValidUser($response);\n $expected = true;\n\n $this->assertEquals($expected, $given);\n }", "public function authenticatedUser()\n {\n try {\n if (!$user = JWTAuth::parseToken()->authenticate()) {\n return response()->json(['user_not_found'], 404);\n }\n } catch (TokenExpiredException $e) {\n return response()->json(['token_expired'], $e->getStatusCode());\n } catch (TokenInvalidException $e) {\n return response()->json(['token_invalid'], $e->getStatusCode());\n } catch (JWTException $e) {\n return response()->json(['token_absent'], $e->getStatusCode());\n }\n // the token is valid and we have found the user via the sub claim\n return response()->json(compact('user'));\n }", "function verify_appota_user($appota_access_token, $appota_userid, $appota_username) {\n $url = sprintf('https://api.appota.com/game/get_user_info?access_token=%s', $appota_access_token);\n $result = call_curl_get($url, null);\n return ($result[\"error_code\"] == 0 and $result[\"data\"][\"username\"] == $appota_username and $result[\"data\"][\"user_id\"]);\n}", "public function validateRegistration($app, $data) {\n $userByUsername = $app->dataAccessService->getUserByName($data->username);\n $userByEmail = $app->dataAccessService->getUserByEmail($data->email);\n $byEmailUsername = strtolower($userByEmail[\"user_name\"]);\n $byUsernameUsername = strtolower($userByUsername[\"user_name\"]);\n $reqUsername = strtolower($data->username);\n\n $reqEmail = strtolower($data->email);\n $byEmailEmail = strtolower($userByEmail[\"user_email\"]);\n $byUsernameEmail = strtolower($userByUsername[\"user_email\"]);\n\n if ($reqUsername !== $byEmailUsername) {\n // requested username is different from the username retrieved by looking up by requested email\n if (empty($byEmailUsername)) {\n // no username was retrieved by requested email\n if ($reqEmail !== $byUsernameEmail) {\n // no user found by this email using the same username\n if ($reqUsername !== $byUsernameUsername) {\n // no user found by this username either\n // username not taken, email not taken\n // create user\n $response = array(\"success\" => true, \"data\" => \"Thank you for registering.\");\n } else {\n // username in use by another email address\n $response = array(\"success\" => false, \"data\" => \"Username is already in use by another account.\");\n }\n } else {\n // requested email is in use by a differently named account\n $response = array(\"success\" => false, \"data\" => \"Email is already in use by another account.\");\n }\n } else {\n // requested username is different from the username retrieved by looking up by requested email\n // an username was found that was using the requested email\n $response = array(\"success\" => false, \"data\" => \"Email is already in use by another account.\");\n }\n } else {\n // requested username is the same as the one found for requested email address\n if($userByEmail[\"user_role_id\"] !== 6) {\n // not unregistered\n $response = array(\"success\" => false, \"data\" => \"Username taken by a registered user.\");\n } else {\n // unregistered\n $response = array(\"success\" => true, \"data\" => \"An account has been created for your username.\");\n }\n }\n\n return $response;\n }", "public function matchOTP(Request $request){\n\n /** validation */\n $validator = Validator::make($request->all(), [\n 'otp' => 'required',\n 'user_id' => 'required'\n ],[]);\n\n if ($validator->fails()) {\n $response = ['status'=>'false','message'=>'Validation errors','errors'=>$validator->errors()];\n return response()->json($response);\n }\n\n $user = User::where('id',$request['user_id'])->first();\n \n if(!empty($user)){\n\n if($user->otp == $request['otp']){\n\n\n $user->otp = NULL;\n $user->is_email_verified = '1';\n $user->save();\n\n $response = ['status'=>'true','message'=>'Your account verified successfully'];\n return response()->json($response);\n\n }else{\n $response = ['status'=>'false','message'=>'User not identified'];\n return response()->json($response);\n }\n\n }else{\n $response = ['status'=>'false','message'=>'User not identified'];\n return response()->json($response);\n }\n\n }", "public function verify_user_data()\n {\n\n if(isset($_SESSION['id']) AND $_SESSION['id'] == $_GET['id'])\n {\n\n $this->user_data_check = true;\n\n }else{\n\n $this->user_data_check = false;\n\n }\n\n return $this->user_data_check;\n\n }", "public function updateUserinfo()\n\t{\n\t\t$user_array = Session::all();\n\n \t$userID = Session::get('id');\n\t\t$data = $this->request->all();\n\t\t$data['user'] = Auth::user();\n\t\t\t$rules = array(\n \t\t'full_name' => 'required',\n\t\t\t\t'zip_code' => 'required',\n\t\t\t\t'aniversary_date' => 'required',\n\t\t\t\t'phone_number' => 'required',\n\t\t\t\t'dob' => 'required',\n\t\t\t\t'gender' => 'required',\n\t\t\t\t'location_id' => 'required'\t\t\t\t\n\t\t\t);\n\n\t\t\t$message = array(\n\t\t\t\t'required' => 'The :attribute is required', \n\t\t\t);\n\n\t\t\t$validation = Validator::make($data, $rules, $message);\n\n\t\t\tif($validation->fails())\n\t\t\t{\n\t\t\t\treturn Redirect::to('/users/updateinfo')->withErrors($validation);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n \t$arrResponse=Profile::updateProfileWeb($data, $userID);\n \treturn Redirect::to('/users/myaccount')\n\t\t ->with('flash_notice', '');\n\t\t }\n\t}", "public function setOnCheckCookieRequest()\n {\n $origin = $this->getOrigin();\n if ($this->originIsValid($origin)) {\n header('Access-Control-Allow-Origin: ' . $this->request->server->get('HTTP_ORIGIN'));\n header('Access-Control-Allow-Credentials: true');\n header('Content-Type: application/json');\n if($user = $this->getUserFromCookie()) {\n $token = (new JWT($this->getDomain()))->generate(array('uid' => $user['id']));\n echo '{\"status\":\"ok\",\"' . \\ModuleSSO::TOKEN_KEY . '\":\"' . $token . '\",\"email\":\"' . $user['email'] . '\"}';\n } else {\n JsonResponse::create(array(\"status\" => \"fail\", \"code\" => \"bad_cookie\"))->send();\n }\n } else {\n //probably won't reach this because of Same origin policy\n JsonResponse::create(array(\"status\" => \"fail\", \"code\" => \"http_origin_not_set\"))->send();\n }\n }", "public function user_is_allowed()\n {\n //check if the record exist\n if (! $this->record) {\n $this->build_error('These record does not exist or it may not belong to you',404);\n }\n\n //check if the user is the owner of the entry\n if(!isOwner($this->record)) {\n $this->build_error('you are not the owner of this task');\n }\n\n //check if the incomming entries type is Array\n if (!is_array($this->request->entries)) {\n $this->build_error('Please the entries must be an Array');\n }\n }", "private function checkValidUser() {\n return;\n if(!($this->getData('key') == $this->sessionId && isset($_SESSION['user']) && isset($_SESSION['valid']) && $_SESSION['valid'] === true)) {\n $this->output = array(\n 'success' => false,\n 'key' => 'kMIvl'\n );\n\n // Terminate the call now, user isn't allowed to perform this action\n $this->renderOutput(true);\n }\n }", "function validateData($data) {\n $data = json_decode($data);\n $typesArr = [1, 2];\n\n if (!in_array((int)$data->type, $typesArr)) {\n return false;\n } else {\n $data->type = (int)$data->type;\n }\n\n if (empty($data->feedback)) {\n return false;\n }\n\n if ($data->type == 2 && !filter_var($data->url, FILTER_VALIDATE_URL)) {\n return false;\n }\n\n if (empty($data->name)) {\n $data->name = \"anonymous\";\n }\n\n if (empty($data->email)) {\n $data->email = \"anonymous\";\n }\n\n return $data;\n }", "public function processVerificationDetails()\n {\n // success needs to be on the landing pages so the login button is right on top\n $SubmittedFormName = 'VerificationDetailsForm';\n $returnToRoute = array\n (\n 'name' => FALSE,\n 'data' => FALSE,\n );\n $VerificationDetailsFormMessages = array();\n\n if(Request::isMethod('post'))\n {\n if($this->isFormClean($SubmittedFormName, Input::all()))\n {\n // Validate vcode\n $verifiedMemberIDArray = $this->verifyEmailByLinkAndGetMemberIDArray(Input::get('vcode'), 'VerificationDetailsForm');\n\n if (!isset($verifiedMemberIDArray['errorNbr']) && !isset($verifiedMemberIDArray['errorMsg']))\n {\n if (isset($verifiedMemberIDArray) && is_array($verifiedMemberIDArray))\n {\n // Validate Form\n $formFields = array\n (\n 'first_name' => Input::get('first_name'),\n 'last_name' => Input::get('last_name'),\n 'gender' => Input::get('gender'),\n 'member_type' => Input::get('member_type'),\n 'zipcode' => Input::get('zipcode'),\n );\n $formRules = array\n (\n 'first_name' => array\n (\n 'required',\n 'alpha',\n 'between:2,60',\n ),\n 'last_name' => array\n (\n 'required',\n 'alpha',\n 'between:2,60',\n ),\n 'gender' => array\n (\n 'required',\n 'numeric',\n 'digits:1',\n 'min:1',\n 'max:2',\n ),\n 'member_type' => array\n (\n 'required',\n 'numeric',\n 'digits:1',\n 'min:1',\n 'max:3',\n ),\n 'zipcode' => array\n (\n 'required',\n 'numeric',\n 'digits:5',\n #'exists:freelife_utils.location_data,postal_code',\n ),\n );\n $formMessages = array\n (\n 'first_name.required' => \"Please, enter your first name.\",\n 'first_name.alpha' => \"Please, use only the alphabet for your first name.\",\n 'first_name.between' => \"Please, re-check the length of your first name.\",\n\n 'last_name.required' => \"Please, enter your last name.\",\n 'last_name.alpha' => \"Please, use only the alphabet for your last name.\",\n 'last_name.between' => \"Please, re-check the length of your last name.\",\n\n 'gender.required' => \"Please, select your gender.\",\n 'gender.numeric' => \"Please, choose a gender.\",\n 'gender.digits' => \"Please, choose a gender.\",\n 'gender.min' => \"Please, choose a gender.\",\n 'gender.max' => \"Please, choose a gender.\",\n\n 'member_type.required' => \"Please, select your Membership Type.\",\n 'member_type.numeric' => \"Please, choose a Membership Type.\",\n 'member_type.digits' => \"Please, choose a Membership Type.\",\n 'member_type.min' => \"Please, choose a Membership Type.\",\n 'member_type.max' => \"Please, choose a Membership Type.\",\n\n 'zipcode.required' => \"Please, enter your zipcode.\",\n 'zipcode.numeric' => \"Please, use only numbers for your zipcode.\",\n 'zipcode.digits' => \"Please, enter a zipcode.\",\n );\n\n $validator = Validator::make($formFields, $formRules, $formMessages);\n\n if ($validator->passes())\n {\n $memberDetailsExist = $this->doEmployeeDetailsExist($verifiedMemberIDArray['memberID']);\n\n // Add Member Details\n $detailsFillableArray = array\n (\n 'member_id' => $verifiedMemberIDArray['memberID'],\n 'first_name' => $formFields['first_name'],\n 'last_name' => $formFields['last_name'],\n 'gender' => $formFields['gender'],\n 'zipcode' => $formFields['zipcode'],\n 'personal_summary' => '',\n 'profile_pic_url' => '',\n 'personal_website_url' => '',\n 'linkedin_url' => '',\n 'google_plus_url' => '',\n 'twitter_url' => '',\n 'facebook_url' => '',\n );\n if($memberDetailsExist)\n {\n $this->updateEmployeeDetails($verifiedMemberIDArray['memberID'], $detailsFillableArray);\n }\n else\n {\n $this->addEmployeeDetails($verifiedMemberIDArray['memberID'], $detailsFillableArray);\n }\n\n // Update Member Object with Member Type\n $memberFillableArray = array\n (\n 'member_type' => $this->getMemberTypeFromFromValue(strtolower($formFields['member_type'])),\n );\n $this->updateMember($verifiedMemberIDArray['memberID'], $memberFillableArray);\n $this->addEmployeeStatus('VerifiedStartupDetails', $verifiedMemberIDArray['memberID']);\n $this->addEmployeeStatus('ValidMember', $verifiedMemberIDArray['memberID']);\n $this->addEmployeeSiteStatus('Member startup details complete.', $verifiedMemberIDArray['memberID']);\n\n // Successful Verification Notification Email\n $this->sendEmail\n (\n 'genericProfileInformationChange',\n array\n (\n 'first_name' => $formFields['first_name'],\n 'last_name' => $formFields['last_name'],\n ),\n array\n (\n 'fromTag' => 'General',\n 'sendToEmail' => $verifiedMemberIDArray['email'],\n 'sendToName' => $formFields['first_name'] . ' ' . $formFields['last_name'],\n 'subject' => 'Profile Change Notification',\n 'ccArray' => FALSE,\n 'attachArray' => FALSE,\n )\n );\n\n\n $this->registerAccessAttempt($this->getSiteUser()->getID(), $SubmittedFormName, 1);\n $viewData = array\n (\n 'firstName' => $formFields['first_name'],\n 'emailAddress' => $verifiedMemberIDArray['email'],\n );\n\n return $this->makeResponseView('application/auth/verification-details-success', $viewData);\n }\n else\n {\n $this->registerAccessAttempt($this->getSiteUser()->getID(), $SubmittedFormName, 0);\n $VerificationDetailsFormErrors = $validator->messages()->toArray();\n $VerificationDetailsFormMessages = array();\n foreach($VerificationDetailsFormErrors as $errors)\n {\n $VerificationDetailsFormMessages[] = $errors[0];\n }\n\n Log::info(\"VerificationDetails form values did not pass.\");\n }\n }\n else\n {\n $this->registerAccessAttempt($this->getSiteUser()->getID(), $SubmittedFormName, 0);\n Log::info(\"Error #3 - returned value from verifiedMemberIDArray is not an array.\");\n $returnToRoute = array\n (\n 'name' => 'custom-error',\n 'data' => array('errorNumber' => 3),\n );\n }\n }\n else\n {\n $this->registerAccessAttempt($this->getSiteUser()->getID(), $SubmittedFormName, 0);\n Log::info(\"Error #\" . $verifiedMemberIDArray['errorNbr'] . \" - \" . $verifiedMemberIDArray['errorMsg'] . \".\");\n $returnToRoute = array\n (\n 'name' => 'custom-error',\n 'data' => array('errorNumber' => $verifiedMemberIDArray['errorNbr']),\n );\n }\n }\n else\n {\n $this->registerAccessAttempt($this->getSiteUser()->getID(), $SubmittedFormName, 0);\n $this->addAdminAlert();\n Log::warning($SubmittedFormName . \" has invalid dummy variables passed.\");\n $returnToRoute = array\n (\n 'name' => 'custom-error',\n 'data' => array('errorNumber' => 23),\n );\n }\n }\n else\n {\n $this->registerAccessAttempt($this->getSiteUser()->getID(), $SubmittedFormName, 0);\n Log::warning($SubmittedFormName . \" is not being correctly posted to.\");\n $returnToRoute = array\n (\n 'name' => 'custom-error',\n 'data' => array('errorNumber' => 23),\n );\n }\n\n if(FALSE != $returnToRoute['name'])\n {\n return Redirect::route($returnToRoute['name'],$returnToRoute['data']);\n }\n else\n {\n $viewData = array\n (\n 'vcode' => Input::get('vcode'),\n 'firstName' => Input::get('first_name'),\n 'lastName' => Input::get('last_name'),\n 'gender' => Input::get('gender') ?: 0,\n 'memberType' => Input::get('member_type') ?: 0,\n 'zipCode' => Input::get('zipcode'),\n 'VerificationDetailsFormMessages' => $VerificationDetailsFormMessages,\n );\n return $this->makeResponseView('application/auth/verified_email_success', $viewData);\n }\n }", "public function awaitingValidated(ValidationUserInterface $user): bool;", "public function login(Request $request)\n {\n\n //this to check this value is email or username\n $value = $request->identfy;\n $field = filter_var($value, FILTER_VALIDATE_EMAIL) ? 'email' : 'username';\n request()->merge([$field => $value]);\n\n if ($field == 'username') {\n $vldate = Validator::make($request->all(), [\n 'username' => ['required', 'exists:users,username'],\n \"password\" => ['required']\n ]);\n } else {\n $vldate = Validator::make($request->all(), [\n 'email' => ['required', 'exists:users,email'],\n \"password\" => ['required']\n ]);\n } //end of if\n if ($vldate->fails()) {\n return response()->json([\n 'token' => null,\n 'data' => null,\n 'state' => '404',\n 'err' => $vldate->errors()->first()\n ]);\n } //end of if\n\n\n if ($field == 'username') {\n $token = Auth::guard('api')->attempt( ['username' => $request->username, 'password' => $request->password]);\n } else {\n $token=Auth::guard('api')->attempt(['email' => $request->email, 'password' => $request->password]);\n }\n\n\n\n if($token){\n return response()->json([\n 'token' => $token,\n 'data' => Auth::guard('api')->user(),\n 'state' => '200',\n 'err' => null\n ]);\n }else{\n return response()->json([\n 'token' => null,\n 'data' => null,\n 'state' => '404',\n 'err' => 'something is worng'\n ]);\n }\n\n }", "public function testWithInvalidToken()\n {\n Configure::write('debug', false);\n $request = new ServerRequest();\n\n $request = $request->withEnv('HTTP_AUTHORIZATION', 'Bearer this.is.invalid');\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n }", "public function check()\n {\n // Use dummy user for auth while in debug mode, make sure to disable this in production\n if (env('APP_DEBUG') && env('USE_DEMO_USER')) {\n $this->setUser(new FirebaseUser('Test User', 'ABZ-TU', '[email protected]', ''));\n return true;\n }\n $publicKeyURL = 'https://www.googleapis.com/robot/v1/metadata/x509/[email protected]';\n $kids = json_decode(file_get_contents($publicKeyURL), true);\n\n $parser = new AuthHeaders();\n $token = $parser->parse($this->request);\n if ($token) {\n try {\n $decoded = JWT::decode($token, $kids, array('RS256'));\n\n if ($decoded->iss !== config('firebase.iss')) {\n throw new \\Exception;\n }\n $name = property_exists($decoded, 'name') ? $decoded->name : '';\n $email = property_exists($decoded, 'email') ? $decoded->email : '';\n $image = property_exists($decoded, 'picture') ? $decoded->picture : '';\n\n // fetch user associated with given firebase user in our database,\n // check if the user is blocked or not, if blocked return 417 error code\n $profile = UserProfile::where('user_id', $decoded->user_id)->first();\n if ($profile && $profile->is_blocked) {\n // handle blocked user, this exception will be catched by HttpException below\n abort(417);\n }\n\n $firebaseUser = new FirebaseUser($name, $decoded->user_id, $email, $image);\n $this->setUser($firebaseUser);\n return true;\n } catch (HttpException $ex) {\n // handle blocked user\n abort(417);\n } catch (\\Exception $ex) {\n throw new BadRequestHttpException('token_invalid');\n }\n }\n throw new BadRequestHttpException('token_not_provided');\n }" ]
[ "0.61199075", "0.53209674", "0.5161927", "0.513904", "0.50741595", "0.49586102", "0.49447203", "0.49420717", "0.49323457", "0.4922052", "0.49094534", "0.4908126", "0.48788986", "0.48533937", "0.48219582", "0.48139027", "0.481387", "0.48041713", "0.47919026", "0.47835636", "0.47609735", "0.47609037", "0.47512677", "0.4750467", "0.47327065", "0.47242156", "0.4721892", "0.47213992", "0.47207743", "0.47193515", "0.47177103", "0.46855003", "0.46610582", "0.46360078", "0.4632173", "0.4629202", "0.4629202", "0.4623673", "0.4622551", "0.46194226", "0.46148732", "0.45908064", "0.45775232", "0.45723185", "0.4569686", "0.45640525", "0.45610598", "0.455904", "0.4547153", "0.45461246", "0.45454893", "0.45438913", "0.45376363", "0.4527833", "0.4519893", "0.4519224", "0.45173007", "0.4512873", "0.45083892", "0.45027843", "0.45022884", "0.4501571", "0.45004636", "0.44988397", "0.44964877", "0.4489918", "0.44870108", "0.44828627", "0.44827563", "0.4481758", "0.44768494", "0.4470241", "0.44694188", "0.44693777", "0.44673508", "0.44662517", "0.44631362", "0.44554254", "0.44541746", "0.44487807", "0.4438387", "0.4438225", "0.44332173", "0.4430315", "0.44233772", "0.44210273", "0.44206348", "0.44158316", "0.44015568", "0.44004592", "0.43998322", "0.4396998", "0.43965426", "0.4394947", "0.4393988", "0.43938547", "0.43903998", "0.4379474", "0.4368835", "0.43671292" ]
0.69121504
0
Validates that the requested essential claims are in the response, taking conditionals and special cases into account
private function validateMatchingResponseForToken(array $request, array $response, array $rules) { $logicEvaluator = new LogicEvaluator($rules, $response); foreach ($request as $claimName => $valueInRequest) { if (!$this->isVerificationClaim($claimName)) { continue; } $enabled = $this->getBoolValue($valueInRequest, 'conditional', true, $logicEvaluator); // If value=false is given, we accept both true and false. // It would make no sense to ask for stricly unverified e-mail or phone-number. // $essential is not considered for verification claims $mustBeVerified = $this->getBoolValue($valueInRequest, 'value', false, $logicEvaluator); $valueInResponse = $this->getClaimValue($response, $claimName); $baseClaimName = substr($claimName, 0, strlen($claimName) - strlen('_verified')); $baseClaimValueInRequest = isset($request[$baseClaimName]) ? $request[$baseClaimName] : []; $isBaseClaimEnabled = $this->getBoolValue($baseClaimValueInRequest, 'conditional', true, $logicEvaluator); $baseClaimValueInResponse = $this->getClaimValue($response, $baseClaimName); $isBaseClaimSet = !is_null($baseClaimValueInResponse); $isBaseClaimEssential = $this->getBoolValue($baseClaimValueInRequest, 'essential', false, $logicEvaluator); if (!$isBaseClaimEnabled && $isBaseClaimSet) { throw new ValidationException("Verifiable claim $baseClaimName disabled by conditional, but set."); } if ($isBaseClaimEssential && !$isBaseClaimSet) { throw new ValidationException("Verifiable claim $baseClaimName essential, but missing."); } if ($enabled && $isBaseClaimEnabled && $isBaseClaimSet) { if (!is_bool($valueInResponse)) { throw new ValidationException("Verification claim $claimName missing or has an invalid type."); } if ($mustBeVerified && $valueInResponse !== true) { throw new ValidationException("Verification claim $claimName not true."); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handle_claim() {\n $file = $_FILES[\"claim\"];\n\n if (!check_upload(&$file)) {\n header(\"HTTP/1.1 400 Bad Request\");\n echo \"Uploaded file missing or of wrong type!\\n\";\n return false;\n }\n\n if (($err = verify_signature(&$file)) !== \"OK\") {\n header(\"HTTP/1.1 400 Bad Request\");\n echo \"The claim's signature is invalid!\\n$err\\n\";\n return false;\n }\n\n extract_claim($file);\n return true;\n}", "private function verify_request()\n{\n $headers = $this->input->request_headers();\n // Extract the token\n $token = $headers['Authorization'];\n // Use try-catch\n // JWT library throws exception if the token is not valid\n try {\n // Validate the token\n // Successfull validation will return the decoded user data else returns false\n $data = AUTHORIZATION::validateToken($token);\n if ($data === false) {\n $status = parent::HTTP_UNAUTHORIZED;\n $response = ['status' => $status, 'msg' => 'Unauthorized Access!'];\n $this->response($response, $status);\n exit();\n } else {\n return $data;\n }\n } catch (Exception $e) {\n // Token is invalid\n // Send the unathorized access message\n $status = parent::HTTP_UNAUTHORIZED;\n $response = ['status' => $status, 'msg' => 'Unauthorized Access! '];\n $this->response($response, $status);\n }\n}", "public function hasValidClaims($token){\n \n $flatToken = explode('.',$token);\n $payload = $flatToken[1];\n $decodedPayload = base64_decode($payload);\n\n $claimsArray = $this->filterClaimsFromDecoded($decodedPayload);\n // dd($claimsArray);\n\n //validate claims\n foreach ($claimsArray as $key => $value) {\n $claimClassFromObj = $this->defaultClaims[$key];\n $claimClass = (new $claimClassFromObj($value));\n if(method_exists($claimClass,'validatePayload')){\n $claimClass->validatePayload();\n }\n }\n return true;\n\n }", "function GetTokenValidateRequest($Payloads) {\n\n if(!$Payloads ['Email'] || !$Payloads ['Password'] ) {\n Return \"False\" ;\n }\n return \"True\";\n\n}", "private function validateObservation() {\n\n $response = new ApiResponse();\n\n if (!\\Request::has('device_uuid')) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'device_uuid_null',\n 'description' => 'The device uuid should not be null'];\n }\n else{\n $device = Device::where('device_uuid', \\Request::get('device_uuid'))->first();\n\n if($device==null){\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'device_not_found',\n 'description' => 'The device could not be found'];\n }\n }\n\n if (!\\Request::has('mission_id')) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'mission_id_null',\n 'description' => 'The mission id should not be null'];\n } else {\n //check that the mission_id exists\n $this->mission = Mission::with('type')->find(\\Request::get('mission_id'));\n\n if ($this->mission == null) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'mission_id_not_found',\n 'description' => 'The requested mission could not be found'];\n }\n }\n\n if (\\Request::has('observation_date')) {\n if (!$this->validateDate(\\Request::get('observation_date'))) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'wrong_date_format',\n 'description' => 'The date should be in the following format: Y-m-d hh:mm:ss'];\n }\n }\n\n if (\\Request::has('latitude') && !is_numeric(\\Request::get('latitude')) || \\Request::has('longitude') && !is_numeric(\\Request::get('longitude'))) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'coordinates_not_numeric',\n 'description' => 'The coordinates of the observation should be numeric'];\n }\n\n if (!\\Request::has('measurements')) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'measurements_null',\n 'description' => 'The measurements should not be null'];\n } else {\n foreach (\\Request::get('measurements') as $measurement) {\n\n if (!isset($measurement['latitude']) || $measurement['latitude'] == '' || !isset($measurement['longitude']) || $measurement['longitude'] == '') {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'coordinates_null',\n 'description' => 'The coordinates of the measurements should not be null'];\n } else if (!is_numeric($measurement['latitude']) || !is_numeric($measurement['longitude'])) {\n $response->status = 'error';\n $response->message = [\n 'id' => '',\n 'code' => 'coordinates_not_numeric',\n 'description' => 'The coordinates of the measurements should be numeric'];\n }\n }\n }\n\n return $response;\n }", "private function verify_request()\n {\n try{\n $headers = $this->input->request_headers();\n $token = $headers['X-API-KEY'];\n if(!$token) {\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n return;\n }\n\n $data = AUTHORIZATION::validateToken($token);\n if($data === false){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized accesss'];\n $this->response($res, $status);\n exit();\n }else{\n return $data;\n }\n\n }catch(Exception $e){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n }\n }", "private function verify_request()\n {\n try{\n $headers = $this->input->request_headers();\n $token = $headers['X-API-KEY'];\n if(!$token) {\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n return;\n }\n\n $data = AUTHORIZATION::validateToken($token);\n if($data === false){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized accesss'];\n $this->response($res, $status);\n exit();\n }else{\n return $data;\n }\n\n }catch(Exception $e){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n }\n }", "public function validate($request, $requestId, $offerId) {\n $doctrine = $this->getDoctrine();\n $sessionId = $request->headers->get('X-SESSION-ID');\n $sessionRepo = $doctrine->getRepository('MegasoftEntangleBundle:Session');\n $session = $sessionRepo->findOneBy(array('sessionId' => $sessionId));\n $requestRepo = $doctrine->getRepository('MegasoftEntangleBundle:Request');\n $claimerRequest = $requestRepo->findOneBy(array('id' => $requestId));\n if ($sessionId == null) {\n return new Response('No such session1', 400);\n }\n if ($session == null) {\n return new Response('No such session2', 400);\n }\n if ($session->getExpired()) {\n return new Response('No such session3', 400);\n }\n if ($requestId == null || $offerId == null) {\n return new Response('No such request or offer', 400);\n }\n $userId = $session->getUserId();\n if ($userId == null) {\n return new Response('No such claimer', 400);\n }\n if ($claimerRequest == null) {\n return new Response('No such request', 400);\n }\n $offerRepo = $doctrine->getRepository('MegasoftEntangleBundle:Offer');\n $offer = $offerRepo->findOneBy(array('requestId' => $requestId, 'deleted' => false, 'status' => 2));\n if ($offer == null) {\n return new Response('No such offer', 400);\n }\n if (!($offer->getUserId() == $userId || $claimerRequest->getUserId() == $userId)) {\n return new Response('Not authorized to claim', 400);\n }\n $tangleId = $claimerRequest->getTangleId();\n $tangleRepo = $doctrine->getRepository('MegasoftEntangleBundle:Tangle');\n $tangle = $tangleRepo->findOneBy(array('id' => $tangleId, 'deleted' => false));\n if ($tangleId == null || $tangle == null) {\n return new Response('No such tangle', 400);\n }\n return null;\n }", "public function verifyRequest()\n {\n }", "public function validateMatchingResponse(array $requestedClaims, array $userinfo)\n {\n $rules = [];\n if (isset($requestedClaims['rules'])) {\n if (!is_array($requestedClaims['rules'])) {\n throw new ValidationException(\"Rules must be array (logic expression).\");\n }\n\n $rules =& $requestedClaims['rules'];\n }\n if (isset($requestedClaims['userinfo']) && !is_object($requestedClaims['userinfo'])) {\n $this->validateMatchingResponseForToken(\n $requestedClaims['userinfo'],\n $userinfo,\n $rules\n );\n }\n }", "public function get_claims(Request $request)\n{\n\n if (!Auth::guard('merchant')->check()) {\n return response([\"status\" => \"fail\", \"message\" => \"Permission Denied. Please log out and login again\"]);\n }\n\n if (auth()->user()->merchant_flagged) {\n $request->user()->token()->revoke();\n return response([\"status\" => \"fail\", \"message\" => \"Account access restricted\"]);\n }\n\n $where_array = array(\n ['merchant_id', '=', auth()->user()->merchant_id],\n ['paid_status', '=', 0],\n ); \n\n $unpaid_redemptions = DB::table('claims')\n ->selectRaw('count(*)')\n ->where($where_array)\n ->get();\n\n $unpaid_redemptions = (array) $unpaid_redemptions[0];\n $unpaid_redemptions = (array) $unpaid_redemptions[\"count(*)\"];\n\n\n $where_array = array(\n ['merchant_id', '=', auth()->user()->merchant_id],\n ); \n\n $claims = DB::table('claims')\n ->select('claims.*')\n ->where($where_array)\n ->get();\n\n\n for ($i=0; $i < count($claims); $i++) { \n\n if($claims[$i]->merchant_id > 0 && $claims[$i]->merchant_id != null){\n $this_merchant = DB::table('merchants')\n ->where(\"merchant_id\", \"=\", $claims[$i]->merchant_id)\n ->get();\n \n if(isset($this_merchant[0])){\n $claims[$i]->merchant_fullname = $this_merchant[0]->merchant_name;\n $claims[$i]->merchant_phone_number = $this_merchant[0]->merchant_phone_number;\n } else {\n $claims[$i]->merchant_fullname = \"[NA]\";\n $claims[$i]->merchant_phone_number = \"[NA]\";\n }\n } else {\n $claims[$i]->merchant_fullname = \"[NA]\";\n $claims[$i]->merchant_phone_number = \"[NA]\";\n }\n\n if($claims[$i]->payer_admin_id > 0 && $claims[$i]->payer_admin_id != null){\n $this_admin = DB::table('administrators')\n ->where(\"admin_id\", \"=\", $claims[$i]->payer_admin_id)\n ->get();\n \n if(isset($this_admin[0])){\n $claims[$i]->admin_fullname = $this_admin[0]->admin_firstname . \" \" . $this_admin[0]->admin_surname;\n } else {\n $claims[$i]->admin_fullname = \"[NA]\";\n }\n } else {\n $claims[$i]->admin_fullname = \"[NA]\";\n }\n }\n\n return response([\n \"status\" => \"success\", \n \"message\" => \"Operation successful\", \n \"unpaid\" => $unpaid_redemptions[0], \n \"merchant_balance\" => auth()->user()->merchant_balance, \n \"claims\" => $claims\n ]);\n }", "public function hasValidResponse(RequestEntity $request);", "function verifyRequest($req){\n\n}", "function check_esewa_response() {\n\n\t\t\t@ob_clean();\n\n\t\t\tif ( ! empty( $_REQUEST ) && $this->check_esewa_response_is_valid() ) {\n\n\t\t\t\tdo_action( 'valid-esewa-standard-response' );\n\n\t\t\t} else {\n\n\t\t\t\twp_die( 'eSewa Response Validation Failure' );\n\n\t\t\t}\n\n\t\t}", "private function requestIsValid() : bool\n {\n $queryParams = $this->request->getQueryParams();\n\n return array_has($queryParams,self::OPENID_ASSOC_HANDLE)\n && array_has($queryParams,self::OPENID_SIGNED)\n && array_has($queryParams,self::OPENID_SIG);\n }", "function attributes2claims($attributes)\n{\n $email = NULL;\n if (isset($attributes['mail']))\n $email = $attributes['mail'][0];\n else if (isset($attributes['email']))\n $email = $attributes['email'][0];\n else\n $email = NULL;\n\n $claims = array();\n $claims['subject_id'] = (isset($attributes['subject-id'])? $attributes['subject-id'][0] : null);\n $claims['name'] = (isset($attributes['cn']) ? $attributes['cn'][0] : null);\n $claims['family_name'] = (isset($attributes['sn']) ? $attributes['sn'][0] : null);\n $claims['given_name'] = (isset($attributes['givenName']) ? $attributes['givenName'][0] : null);\n $claims['middle_name'] = (isset($attributes['middleName']) ? $attributes['middleName'][0] : null);\n $claims['nickname'] = (isset($attributes['nickname']) ? $attributes['nickname'][0] : null);\n $claims['preferred_username'] = (isset($attributes['displayName']) ? $attributes['displayName'][0] : null);\n $claims['profile'] = (isset($attributes['profile']) ? $attributes['profile'][0] : null);\n $claims['picture'] = (isset($attributes['picture']) ? $attributes['picture'][0] : null);\n $claims['website'] = (isset($attributes['website']) ? $attributes['website'][0] : null);\n $claims['gender'] = (isset($attributes['gender']) ? $attributes['gender'][0] : null);\n $claims['age'] = (isset($attributes['age']) ? $attributes['age'][0] : null);\n $claims['birthdate'] = (isset($attributes['birthdate']) ? $attributes['birthdate'][0] : null);\n $claims['zoneinfo'] = (isset($attributes['zoneinfo']) ? $attributes['zoneinfo'][0] : null);\n $claims['locale'] = (isset($attributes['locale']) ? $attributes['locale'][0] : null);\n $claims['updated_at'] = (isset($attributes['updatedAt']) ? $attributes['updatedAt'][0] : null);\n $claims['email'] = $email;\n $claims['email_verified'] = (isset($attributes['emailVerified']) ? $attributes['emailVerified'][0] : null);\n $claims['affiliation'] = (isset($attributes['affiliation']) ? $attributes['affiliation'][0] : null);\n $claims['profession'] = (isset($attributes['profession']) ? $attributes['profession'][0] : null);\n $claims['idp_country'] = (isset($attributes['c']) ? $attributes['c'][0] : null);\n $claims['idp_country'] = (isset($attributes['idpCountry']) ? $attributes['idpCountry'][0] : null);\n $claims['idp_name'] = (isset($attributes['schacHomeOrganization']) ? $attributes['schacHomeOrganization'][0] : null);\n $claims['idp_name'] = (isset($attributes['idpName']) ? $attributes['idpName'][0] : null);\n $claims['idp_origin'] = (isset($attributes['businessCategory']) ? $attributes['businessCategory'][0] : null);\n $claims['idp_origin'] = (isset($attributes['idpOrigin']) ? $attributes['idpOrigin'][0] : null);\n $claims['home_town'] = (isset($attributes['homeTown']) ? $attributes['homeTown'][0] : null);\n\n return $claims;\n}", "public function getUserValidationAction()\n {\n $email = $this->params()->fromQuery('email','');\n $featureName = $this->params()->fromQuery('featureName','');\n $res = $this->entityManager->getRepository(Usersso::class)->isUserAllowed($email ,$featureName );\n if($res[0]['canAccess']>0)\n {\n $this->httpStatusCode = 200; \n\n }else{\n $this->httpStatusCode = 403;\n }\n $this->apiResponse['canAccess'] = $res[0]['canAccess'];\n return $this->createResponse();\n \n }", "private function verify_request($data_active)\r\n\t\t{\r\n\t\t\t$headers = $this->input->request_headers();\r\n\r\n\t\t\t// Extract the token\r\n\t\t\t$token = $headers['Authorization'];\r\n\r\n\t\t\t// Use try-catch\r\n\t\t\t// JWT library throws exception if the token is not valid\r\n\t\t\ttry {\r\n\t\t\t\t// Validate the token\r\n\t\t\t\t// Successfull validation will return the decoded user data else returns false\r\n $data = AUTHORIZATION::validateToken(str_replace(\"Bearer \",\"\",$token));\r\n\t\t\t\tif ($data === false) {\r\n\t\t\t\t\t$status = parent::HTTP_UNAUTHORIZED;\r\n\t\t\t\t\t$response = ['status' => $status, 'msg' => 'Unauthorized Access!'];\r\n\t\t\t\t\t$this->response($response, $status);\r\n\r\n\t\t\t\t\texit();\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn $data_active;\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception $e) {\r\n\t\t\t\t// Token is invalid\r\n\t\t\t\t// Send the unathorized access message\r\n\t\t\t\t$status = parent::HTTP_UNAUTHORIZED;\r\n\t\t\t\t$response = ['status' => $status, 'msg' => 'Unauthorized Access! '];\r\n\t\t\t\t$this->response($response, $status);\r\n\t\t\t}\r\n }", "protected function validateRequest() {\n \t \t\n $request = new Oauth_Model_Request($this->getRequest());\n\n if (!$this->_request_validator->isValid($request)) {\n $response = Array();\n\n $messages = $this->_request_validator->getMessages();\n $last_msg = explode(\":\", array_pop($messages));\n $response['error'] = $last_msg[0];\n $response['error_description'] = isset($last_msg[1]) ? $last_msg[1] : \"\";\n\n $this->getResponse()->setHttpResponseCode(401);\n $this->getResponse()->setBody(json_encode($response));\n $this->getResponse()->setHeader('Content-Type', 'application/json;charset=UTF-8');\n\n return FALSE;\n }\n\n return TRUE;\n }", "abstract public function is_authorized_response($response);", "public function validateRequest();", "function simpleid_check_authentication($request) {\n global $version;\n \n log_info('OpenID direct verification: ' . log_array($request));\n \n $is_valid = simpleid_verify_signatures($request);\n\n if ($is_valid) {\n $response = array('is_valid' => 'true');\n } else {\n $response = array('is_valid' => 'false');\n }\n \n // RP wants to check whether a handle is invalid\n if (isset($request['openid.invalidate_handle'])) {\n $invalid_assoc = cache_get('association', $request['openid.invalidate_handle']);\n \n if (!$invalid_assoc || ($invalid_assoc['created'] + SIMPLEID_ASSOC_EXPIRES_IN < time())) {\n // Yes, it's invalid\n $response['invalidate_handle'] = $request['openid.invalidate_handle'];\n }\n }\n\n log_info('OpenID direct verification response: ' . log_array($response));\n \n openid_direct_response(openid_direct_message($response, $version));\n}", "function verifyTokenValidity($authToken) { \n try {\n $decoded = JWT::decode($authToken, secretKey, array('HS256'));\n if(count($decoded) > 0){\n return TRUE;\n }\n \n } catch (Exception $ex) { \n $jsonData = new stdClass();\n //$message = 'Caught exception: '.$ex->getMessage();\n $message = currentUTCTime.','.nextOneHourTime;\n $bool = 0;\n $status = 401;\n //$code = REST_Controller::HTTP_OK;\n $setParams = [\n 'success' => $bool,\n 'status' => $status,\n 'message' => $message,\n 'result' => $jsonData\n ];\n // echo json_encode($setParams);die;\n return json_encode($setParams); \n exit();\n }\n}", "private function validate_input()\n \t{\n \t\t$this->errors_found = FALSE;\t\t\t\t\n\n\t\t// validate the get request\n\t\t//is their an IVR code?\n\t\tif(! isset($_GET['ivrcode'])){\n\t\t\t$this->response['status'] = 'Error';\n\t\t\t$this->response['message'][] = 'Missing ivrcode';\n\t\t\t$this->errors_found = TRUE;\n\t\t}elseif(! is_numeric($_GET['ivrcode'])){\n\t\t\t$this->response['status'] = 'Error';\n\t\t\t$this->response['message'][] = 'Invalid value for ivrcode - should be numeric';\n\t\t\t$this->errors_found = TRUE;\n\t\t}else{\n\t\t\t$this->form_answers['ivrcode'] = $_GET['ivrcode'];\n\t\t}\n\n\t\t//is there a phone number\n\t\tif(! isset($_GET['phonenumber'])){\n\t\t\t$this->response['status'] = 'Error';\n\t\t\t$this->response['message'][] = 'Missing phonenumber';\n\t\t\t$this->errors_found = TRUE;\n\t\t}elseif(! is_numeric($_GET['phonenumber'])){\n\t\t\t$this->response['status'] = 'Error';\n\t\t\t$this->response['message'][] = 'Invalid value for phonenumber - should be numeric';\n\t\t\t$this->errors_found = TRUE;\n\t\t}else{\n\t\t\t$this->form_answers['phonenumber'] = $_GET['phonenumber'];\n\t\t}\n\t\t\n\t\t//is there a well working?\n\t\tif(!isset($_GET['wellwork'])){\n\t\t\t$this->response['status'] = 'Error';\n\t\t\t$this->response['message'][] = 'Missing wellwork';\n\t\t\t$this->errors_found = TRUE;\n\t\t}else\n\t\t{\n\t\t\t$_GET['wellwork'] = strtolower($_GET['wellwork']);\n\t\t\t\n\t\t\tif($_GET['wellwork'] != 'yes' && $_GET['wellwork'] != 'no')\n\t\t\t{\n\t\t\t\t$this->response['status'] = 'Error';\n\t\t\t\t$this->response['message'][] = 'Invalid value for wellwork - should be Yes or No';\n\t\t\t\t$this->errors_found = TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->form_answers['wellwork'] = $_GET['wellwork'];\n\t\t\t}\n\t\t}\n\t\t\n\n\t\t//is there a does the mechanic know?\n\t\tif(isset($_GET['mechanicknow']))\n\t\t{\n\t\t\t$_GET['mechanicknow'] = strtolower($_GET['mechanicknow']);\n\t\t\tif($_GET['mechanicknow'] != 'yes' && $_GET['mechanicknow'] != 'no'){\n\t\t\t\t$this->response['status'] = 'Error';\n\t\t\t\t$this->response['message'][] = 'Invalid value for mechanicknow - should be Yes or No';\n\t\t\t\t$this->errors_found = TRUE;\n\t\t\t}else{\n\t\t\t\t$this->form_answers['mechanicknow'] = $_GET['mechanicknow'];\n\t\t\t}\n\t\t}\n\n\t\t\t\n\t\t//is there a can the mechanic fix\n\t\tif(isset($_GET['mechanicfix']))\n\t\t{\n\t\t\t$_GET['mechanicfix'] = strtolower($_GET['mechanicfix']);\n\t\t\tif($_GET['mechanicfix'] != 'yes' && $_GET['mechanicfix'] != 'no'){\n\t\t\t\t$this->response['status'] = 'Error';\n\t\t\t\t$this->response['message'][] = 'Invalid value for mechanicfix - should be Yes or No';\n\t\t\t\t$this->errors_found = TRUE;\n\t\t\t}else{\n\t\t\t\t$this->form_answers['mechanicfix'] = $_GET['mechanicfix'];\n\t\t\t}\n\t\t}\n\t\t//is there a file name\n\t\tif(isset($_GET['filename'])){\n\t\t\t$get = new Validation($_GET);\n\t\t\t$get->add_rules('filename','standard_text');\n\t\t\tif(! $get->validate()){\n\t\t\t\t$this->response['status'] = 'Error';\n\t\t\t\t$this->response['message'][] = 'Invalid value for filename - should be standard text';\n\t\t\t\t$this->errors_found = TRUE;\n\t\t\t}else{\n\t\t\t\t$this->form_answers['filename'] = $_GET['filename'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//is there a response format \n\t\tif(isset($_GET['resp'])){\n\t\t\tif($_GET['resp'] != 'json' && $_GET['resp'] != 'xml'){\n\t\t\t\t$this->response['status'] = 'Error';\n\t\t\t\t$this->response['message'][] = 'Invalid value for resp - should be json or xml';\n\t\t\t\t$this->errors_found = TRUE;\n\t\t\t}else{\n\t\t\t\t$this->resp = $_GET['resp'];\n\t\t\t}\n\t\t}else{\n\t\t\t$this->resp = 'json';\n\t\t}\n\n\t\t//if there are errors, let them know.\n\t\tif($this->errors_found){\n\t\t\t$this->send_response($this->response, $this->resp);\n\t\t\treturn;\n\t\t}\t\t\n \t}", "private function validate () {\n $payload = $this->payload;\n // Unset fields that don't match the spec\n foreach (array_keys($payload) as $field) {\n if (!in_array($field, $this->fields)) {\n unset($payload[$field]);\n }\n }\n\n // If the user is signing up manually (I.e. not via a social network), then\n // we also need a password\n if ($this->method === 'manual' && empty($payload['password'])) {\n return false;\n }\n\n $this->payload = $payload;\n return true;\n }", "abstract public function verifyRequest(): void;", "abstract public function verifyRequest(): void;", "public function filterClaimsFromDecoded($payload){\n $dc_pl = json_decode($payload,TRUE);\n $res = array();\n\n foreach ($dc_pl as $key => $val ) {\n if(array_key_exists($key,$this->defaultClaims)){\n $res[$key] = $val; \n }\n }\n \n return $res;\n\n }", "protected function validateTokenClaims(string $clientId): void\n {\n // 1. The Issuer Identifier for the OpenID Provider (which is typically obtained during Discovery)\n // MUST exactly match the value of the iss (issuer) Claim.\n if (empty($this->payload['iss']) || $this->issuer !== $this->payload['iss']) {\n throw new OidcInvalidTokenException('Missing or non-matching token issuer value');\n }\n\n // 2. The Client MUST validate that the aud (audience) Claim contains its client_id value registered\n // at the Issuer identified by the iss (issuer) Claim as an audience. The ID Token MUST be rejected\n // if the ID Token does not list the Client as a valid audience, or if it contains additional\n // audiences not trusted by the Client.\n if (empty($this->payload['aud'])) {\n throw new OidcInvalidTokenException('Missing token audience value');\n }\n\n $aud = is_string($this->payload['aud']) ? [$this->payload['aud']] : $this->payload['aud'];\n if (count($aud) !== 1) {\n throw new OidcInvalidTokenException('Token audience value has ' . count($aud) . ' values, Expected 1');\n }\n\n if ($aud[0] !== $clientId) {\n throw new OidcInvalidTokenException('Token audience value did not match the expected client_id');\n }\n\n // 3. If the ID Token contains multiple audiences, the Client SHOULD verify that an azp Claim is present.\n // NOTE: Addressed by enforcing a count of 1 above.\n\n // 4. If an azp (authorized party) Claim is present, the Client SHOULD verify that its client_id\n // is the Claim Value.\n if (isset($this->payload['azp']) && $this->payload['azp'] !== $clientId) {\n throw new OidcInvalidTokenException('Token authorized party exists but does not match the expected client_id');\n }\n\n // 5. The current time MUST be before the time represented by the exp Claim\n // (possibly allowing for some small leeway to account for clock skew).\n if (empty($this->payload['exp'])) {\n throw new OidcInvalidTokenException('Missing token expiration time value');\n }\n\n $skewSeconds = 120;\n $now = time();\n if ($now >= (intval($this->payload['exp']) + $skewSeconds)) {\n throw new OidcInvalidTokenException('Token has expired');\n }\n\n // 6. The iat Claim can be used to reject tokens that were issued too far away from the current time,\n // limiting the amount of time that nonces need to be stored to prevent attacks.\n // The acceptable range is Client specific.\n if (empty($this->payload['iat'])) {\n throw new OidcInvalidTokenException('Missing token issued at time value');\n }\n\n $dayAgo = time() - 86400;\n $iat = intval($this->payload['iat']);\n if ($iat > ($now + $skewSeconds) || $iat < $dayAgo) {\n throw new OidcInvalidTokenException('Token issue at time is not recent or is invalid');\n }\n\n // 7. If the acr Claim was requested, the Client SHOULD check that the asserted Claim Value is appropriate.\n // The meaning and processing of acr Claim Values is out of scope for this document.\n // NOTE: Not used for our case here. acr is not requested.\n\n // 8. When a max_age request is made, the Client SHOULD check the auth_time Claim value and request\n // re-authentication if it determines too much time has elapsed since the last End-User authentication.\n // NOTE: Not used for our case here. A max_age request is not made.\n\n // Custom: Ensure the \"sub\" (Subject) Claim exists and has a value.\n if (empty($this->payload['sub'])) {\n throw new OidcInvalidTokenException('Missing token subject value');\n }\n }", "public function validateResponseProvider() {\n $defaults = [\n 'route_name' => 'jsonapi.node--article.individual',\n 'resource_type' => new ResourceType('node', 'article', NULL),\n ];\n\n $test_data = [\n // Test validation success.\n [\n 'json' => <<<'EOD'\n{\n \"data\": {\n \"type\": \"node--article\",\n \"id\": \"4f342419-e668-4b76-9f87-7ce20c436169\",\n \"attributes\": {\n \"nid\": \"1\",\n \"uuid\": \"4f342419-e668-4b76-9f87-7ce20c436169\"\n }\n }\n}\nEOD\n ,\n 'expected' => TRUE,\n 'description' => 'Response validation flagged a valid response.',\n ],\n // Test validation failure: no \"type\" in \"data\".\n [\n 'json' => <<<'EOD'\n{\n \"data\": {\n \"id\": \"4f342419-e668-4b76-9f87-7ce20c436169\",\n \"attributes\": {\n \"nid\": \"1\",\n \"uuid\": \"4f342419-e668-4b76-9f87-7ce20c436169\"\n }\n }\n}\nEOD\n ,\n 'expected' => FALSE,\n 'description' => 'Response validation failed to flag an invalid response.',\n ],\n // Test validation failure: \"errors\" at the root level.\n [\n 'json' => <<<'EOD'\n{\n \"data\": {\n \"type\": \"node--article\",\n \"id\": \"4f342419-e668-4b76-9f87-7ce20c436169\",\n \"attributes\": {\n \"nid\": \"1\",\n \"uuid\": \"4f342419-e668-4b76-9f87-7ce20c436169\"\n }\n },\n \"errors\": [{}]\n}\nEOD\n ,\n 'expected' => FALSE,\n 'description' => 'Response validation failed to flag an invalid response.',\n ],\n // Test validation of an empty response passes.\n [\n 'json' => NULL,\n 'expected' => TRUE,\n 'description' => 'Response validation flagged a valid empty response.',\n ],\n // Test validation fails on empty object.\n [\n 'json' => '{}',\n 'expected' => FALSE,\n 'description' => 'Response validation flags empty array as invalid.',\n ],\n ];\n\n $test_cases = array_map(function ($input) use ($defaults) {\n [$json, $expected, $description, $route_name, $resource_type] = array_values($input + $defaults);\n return [\n $this->createRequest($route_name, $resource_type),\n $this->createResponse($json),\n $expected,\n $description,\n ];\n }, $test_data);\n\n return $test_cases;\n }", "private function verify_parameters(){\n if( empty( $_GET['email'] ) || empty( $_GET['pms_key'] ) || empty( $_GET['subscription_id'] ) )\n return false;\n\n return true;\n }", "function checkTreatment($checkMe){\n\tif($checkMe==\"\"||$checkMe==\"Pills\"|| $checkMe==\"None\" || $checkMe == \"More than one insulin shot\" || $checkMe==\"One Insulin shot\" || $checkMe==\"Insulin pump\" || $checkMe==\"Other injections\"){\n\n\t\t// one of the acceptable reponses was found, return true\n\t\treturn true;\n\t}else{\n\t\t//no acceptable response\n\t\treturn false;\n\n\t}\n}", "public function isValidRequest() {\n }", "function verifyAssertion(&$attributeVerifier,$response)\n {\n $ax_resp=Auth_OpenID_AX_FetchResponse::fromSuccessResponse($response);\n if($ax_resp instanceof Auth_OpenID_AX_FetchResponse){\n $ax_args=$ax_resp->getExtensionArgs();\n if($ax_args) {\n $value=base64_decode($ax_args['value.ext1.1']);\n if($attributeVerifier->verify($value)){\n return base64_decode($ax_args['value.ext0.1']);\n } else {\n return null;\n }\n } else {\n return null;\n }\n } else {\n return null;\n }\n }", "function verify_token () {\n $request = new Request();\n\n // Retrieve the user's JWT\n $jwt = get_token();\n\n if ($jwt) {\n try {\n /*\n * decode the jwt using the key from config\n */\n $config = Factory::fromFile('config/config.php', true);\n $secretKey = base64_decode($config->get('jwt')->get('key'));\n $token = JWT::decode($jwt, $secretKey, [$config->get('jwt')->get('algorithm')]);\n\n return $token;\n\n } catch (Exception $e) {\n /*\n * the token was not able to be decoded.\n * this is likely because the signature was not able to be verified (tampered token)\n */\n return new Response(array(\n 'body' => 'Invalid JWT token',\n 'header' => 401\n ));\n }\n } else {\n /*\n * No token was able to be extracted from the authorization header\n */\n return new Response(array(\n 'body' => 'JWT missing within authorisation header',\n 'header' => 400\n ));\n }\n\n // if ($request->isGet()) {\n // $authHeader = $request->getHeader('authorization');\n //\n // /*\n // * Look for the 'authorization' header\n // */\n // if ($authHeader) {\n // /*\n // * Extract the jwt from the Bearer\n // */\n // list($jwt) = sscanf( $authHeader->toString(), 'Authorization: Bearer %s');\n //\n // if ($jwt) {\n // try {\n // $config = Factory::fromFile('config/config.php', true);\n //\n // /*\n // * decode the jwt using the key from config\n // */\n // $secretKey = base64_decode($config->get('jwt')->get('key'));\n //\n // $token = JWT::decode($jwt, $secretKey, [$config->get('jwt')->get('algorithm')]);\n //\n // $asset = base64_encode(file_get_contents('http://lorempixel.com/200/300/cats/'));\n //\n // /**\n // * Valid request\n // */\n // return json_encode(array(\n // 'status' => true,\n // 'jwt' => token($token->data->userId, $token->data->userName)\n // ));\n //\n // } catch (Exception $e) {\n // /*\n // * the token was not able to be decoded.\n // * this is likely because the signature was not able to be verified (tampered token)\n // */\n // return array(\n // 'status' => false,\n // 'error' => 'HTTP/1.0 401 Unauthorized'\n // );\n // }\n // } else {\n // /*\n // * No token was able to be extracted from the authorization header\n // */\n // return array(\n // 'status' => false,\n // 'error' => 'HTTP/1.0 400 Bad Request'\n // );\n // }\n // } else {\n // /*\n // * The request lacks the authorization token\n // */\n // return array(\n // 'status' => false,\n // 'error' => 'HTTP/1.0 400 Bad Request'\n // );\n // }\n // } else {\n // return array(\n // 'status' => false,\n // 'error' => 'HTTP/1.0 405 Method Not Allowed'\n // );\n // }\n}", "public function validUserResponse ($userResponse);", "private function validateRequest()\n {\n $ret_api_secret = null;\n\n if (!isset($_POST['invoiceId'])) {\n dump($_POST['invoiceId']);\n return false;\n }\n\n if (isset($_POST['apiSecret'])) {\n $ret_api_secret = $_POST['apiSecret'];\n } else {\n return false;\n }\n\n if ($this->api_secret != $ret_api_secret) {\n return false;\n }\n\n if (isset($_SERVER['HTTP_REFERER'])) {\n $urlParts = parse_url($_SERVER['HTTP_REFERER']);\n $ip = gethostbyname($urlParts['host']);\n\n if ($this->pursar_ip != $ip) {\n return false;\n }\n }\n\n return true;\n }", "protected function validateRequest()\n {\n $validators = [\n 'hasClientId' => null,\n 'knownClientId' => null,\n 'timestamp' => 'signed',\n 'hasSignature' => 'signed',\n 'notExpiredTimestamp' => 'signed',\n 'signature' => 'signed',\n ];\n\n foreach ($validators as $validator => $condition) {\n // First make sure the conditions are fulfilled for the validator\n if ($condition) {\n $method = camel_case('validCondition_'.$condition);\n\n if (! $this->{$method}()) {\n continue;\n }\n }\n\n $method = camel_case('valid_'.$validator);\n $this->{$method}();\n }\n }", "private function verifyResponse()\n {\n $errorMessages = [];\n \n if (!isset($this->endpoint)) {\n $errorMessages[] = \"$endpoint must be set.\";\n }\n \n if (!isset($this->statusCode)) {\n $errorMessages[] = \"$statusCode must be set.\";\n }\n \n if (!is_array($this->data)) {\n $errorMessages[] = \"$data must be formatted as an array.\";\n }\n \n if (!is_array($this->errors)) {\n $errorMessages[] = \"$errors must be formatted as an array.\";\n }\n\n if (!empty($errorMessages)) {\n return $errorMessages;\n }\n \n return true;\n }", "abstract protected function checkExistingResponse();", "function check_esewa_response_is_valid() {\n\t\t\tglobal $woocommerce;\n\n\t\t\tif ( 'yes' === $this->debug ) {\n\t\t\t\t$this->log->add( 'esewa', 'Checking eSewa response is valid...' );\n\t\t\t}\n\n\t\t\tif ( 'yes' === $this->testmode ) {\n\t\t\t\t$esewa_adr = $this->testurl_verification;\n\t\t\t} else {\n\t\t\t\t$esewa_adr = $this->liveurl_verification;\n\t\t\t}\n\n\t\t\t$_REQUEST = stripslashes_deep( $_REQUEST );\n\n\t\t\t$params = array(\n 'amt' => $_REQUEST['amt'],\n 'pid' => $_REQUEST['oid'],\n 'rid' => $_REQUEST['refId'],\n 'scd' => $this -> merchant,\n\t\t\t);\n\n\t\t\tif ( 'yes' === $this->debug ) {\n\t\t\t\t$this->log->add( 'esewa', 'Request Parameters: ' . print_r( $params, true ) );\n\t\t\t}\n\n\t\t\t$received_values = $params;\n\n\t\t\t$eparams = array(\n 'body' => $received_values,\n 'sslverify' => false,\n 'timeout' => 60,\n 'httpversion' => '1.1',\n 'user-agent' => 'WooCommerce/' . $woocommerce->version,\n\t\t\t);\n\t\t\t$response = wp_remote_post( $esewa_adr, $eparams );\n\n\t\t\tif ( 'yes' === $this->debug ) {\n\t\t\t\t$this->log->add( 'esewa', 'eSewa Response: ' . print_r( $response, true ) );\n\t\t\t}\n\n\t\t\t// check to see if the request was valid.\n\t\t\tif ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {\n\t\t\t\tif ( 'yes' === $this->debug ) {\n\t\t\t\t\t$this->log->add( 'esewa', 'Received valid response from eSewa' );\n\t\t\t\t}\n\n\t\t\t\t// Check response code.\n\t\t\t\t$body = wp_remote_retrieve_body( $response );\n\t\t\t\t$esewa_response_code = trim( strip_tags( $body ) );\n\t\t\t\tif ( ! empty( $esewa_response_code ) ) {\n\t\t\t\t\t$esewa_response_code = strtolower( $esewa_response_code );\n\t\t\t\t}\n\t\t\t\tif ( 'success' === $esewa_response_code ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t} // End if.\n\n\t\t\tif ( 'yes' === $this->debug ) {\n\t\t\t\t$this->log->add( 'esewa', 'Received invalid response from eSewa' );\n\t\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\t\t$this->log->add( 'esewa', 'Error response: ' . $response->get_error_message() );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\n\t\t}", "public function checkEducationTitle(Request $request){\n\n $education_title = $request->input('title');\n //convert the education title into the slug\n\n $education_slug = str_slug($education_title);\n\n $education_details = Education::where('slug',$education_slug)\n ->where(function($query) use($request){\n if($request->has('id') && !empty($request->get('id'))){\n $query->whereNotIn('id',[$request->input('id')]);\n }\n })\n ->first();\n\n $isAvailable = true;\n if($education_details){\n //the education title found return true \n\n $isAvailable = false;\n }else{\n //the education title not found return false\n }\n\n\n //return response\n return response()->json(array('valid'=> $isAvailable));\n }", "protected function verifyHeaders()\r\n\t{\r\n\t\tif(!array_key_exists(SONIC_HEADER__TARGET_API, $this->headers))\r\n\t\t\tthrow new MalformedResponseHeaderException(\"Malformed response: Header \" . SONIC_HEADER__TARGET_API . \" missing\");\r\n\t\telse if(!array_key_exists(SONIC_HEADER__DATE, $this->headers))\r\n\t\t\tthrow new MalformedResponseHeaderException(\"Malformed response: Header \" . SONIC_HEADER__DATE . \" missing\");\r\n\t\telse if(!array_key_exists(SONIC_HEADER__SIGNATURE, $this->headers))\r\n\t\t\tthrow new MalformedResponseHeaderException(\"Malformed response: Header \" . SONIC_HEADER__SIGNATURE . \" missing\");\r\n\t\telse if(!array_key_exists(SONIC_HEADER__RANDOM, $this->headers))\r\n\t\t\tthrow new MalformedResponseHeaderException(\"Malformed response: Header \" . SONIC_HEADER__RANDOM . \" missing\");\r\n\t\telse if(!array_key_exists(SONIC_HEADER__SOURCE_GID, $this->headers))\r\n\t\t\tthrow new MalformedResponseHeaderException(\"Malformed response: Header \" . SONIC_HEADER__SOURCE_GID . \" missing\");\r\n\t\telse if(!array_key_exists(SONIC_HEADER__PLATFORM_GID, $this->headers))\r\n\t\t\tthrow new MalformedRequestHeaderException(\"Malformed response: Header \" . SONIC_HEADER__PLATFORM_GID . \" missing\");\r\n\t\telse return true;\r\n\t}", "public function getIsRequestToCorrectCvvOrAvsError();", "protected function validateRequest() {\n $request = new Oauth_Model_Request($this->getRequest());\n\n if (!$this->_request_validator->isValid($request)) {\n $response = Array();\n\n $messages = $this->_request_validator->getMessages();\n $last_msg = explode(\":\", array_pop($messages));\n $response['error'] = $last_msg[0];\n $response['error_description'] = isset($last_msg[1]) ? $last_msg[1] : \"\";\n\n $this->getResponse()->setHttpResponseCode(401);\n $this->getResponse()->setBody(json_encode($response));\n $this->getResponse()->setHeader('Content-Type', 'application/json;charset=UTF-8');\n\n return FALSE;\n }\n\n return TRUE;\n }", "function cp_CheckResponse($response)\n{\n $requiredParameters = array(\n 'merchantAccount',\n 'orderReference',\n 'amount',\n 'currency',\n 'merchantSignature',\n 'transactionStatus',\n 'type'\n );\n\n $result = true;\n if (empty($response)) {\n return false;\n }\n\n foreach ($requiredParameters as $param) {\n if (!isset($response[$param]) || empty($response[$param])) {\n $result = false;\n break;\n }\n }\n\n return $result;\n}", "function test_treatments_unauthorized_true()\n {\n $this->seed();\n\n $response = $this->json('GET', '/api/treatments/1');\n $response->assertUnauthorized();\n }", "public function verifyRequest(): void\n {\n $this->verifySignature();\n\n if (!$this->request->hasParameters(['entry.0.messaging.0.sender.id', 'entry.0.messaging.0.message'])) {\n throw new InvalidRequest('Invalid payload');\n }\n }", "public function check(){\n\n \tif($this->input->method()!=\"get\"){\n \t\t$this->output->set_status_header(405);\n \t\treturn false;\n \t}\n\t\t$JWTtoken = str_replace(\"Bearer \",\"\",$this->input->get_request_header('Authorization'));\n\t\t$decodedToken = \"\";\n\t\tif($JWTtoken == \"\" || $JWTtoken == null){\n\t\t\techo json_encode([\"error\"=>\"User authentication is required\"]);\n \t\t$this->output->set_status_header(401);\n \t\treturn false;\n\t\t}\n\t\t//$decodedToken = $this->jwtload->decode(\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.W3siZmlyc3RfbmFtZSI6ImFkbWluIiwibGFzdF9uYW1lIjoiZS1jb25zdWx0YSIsImVtYWlsIjoic2VydmVyQGUtY29uc3VsdGEuY29tIiwidXNlcm5hbWUiOiJlQWRtaW4iLCJpYXQiOiIxNTg3MTY2NDg4IiwiZXhwIjoiMTU4ODAzMDQ4OCJ9XQ.60U4_3ukAnwXqp517b0xRJXWIM1tT_00CCZWwjGa_2U\",$this->key,array('HS256'));\n\t\ttry{\n\t\t\t$decodedToken = $this->jwtload->decode($JWTtoken,$this->key,array('HS256'));\n\t\t}\n\t\tcatch(Exception $e){\n\t\t\t$decodedToken = false;\n\t\t\techo json_encode([\"error\"=>\"Invalid Token\"]);\n\t\t\t$this->output->set_status_header(401);\n\t\t\treturn $decodedToken;\n\t\t}\n\n\t\tif(!(time() > $decodedToken[0]->iat && time() < $decodedToken[0]->exp)){\n\t\t\techo json_encode([\"error\"=>\"User authentication is required\"]);\n \t\t$this->output->set_status_header(401);\n \t\treturn false;\n\t\t}\n\n\t\t//var_dump($decodedToken);\n\t\t//echo time();\n\n\t\t$userInfo = (object) [\n\t\t\t\"first_name\"=>$decodedToken[0]->first_name,\n\t\t\t\"last_name\"\t=>$decodedToken[0]->last_name,\n\t\t\t\"email\"\t\t=>$decodedToken[0]->email,\n\t\t\t\"username\"\t=>$decodedToken[0]->username\n\t\t];\n\t\techo json_encode([\"user\"=>$userInfo]);\n\t\treturn true;\n\t}", "function do_introspection($token, $scopes, $subject)\r\n{\r\n // Call Authlete's /auth/introspection API.\r\n $response = call_introspection_api($token, $scopes, $subject);\r\n\r\n // The content of the response to the client.\r\n $content = $response['responseContent'];\r\n\r\n // \"action\" denotes the next action.\r\n switch ($response['action'])\r\n {\r\n case 'INTERNAL_SERVER_ERROR':\r\n // 500 Internal Server Error\r\n // The API request from this implementation was wrong\r\n // or an error occurred in Authlete.\r\n (new WebResponse(500))->wwwAuthenticate($content)->finish();\r\n return null; // Not reach here.\r\n\r\n case 'BAD_REQUEST':\r\n // 400 Bad Request\r\n // The request from the client application does not\r\n // contain an access token.\r\n (new WebResponse(400))->wwwAuthenticate($content)->finish();\r\n return null; // Not reach here.\r\n\r\n case 'UNAUTHORIZED':\r\n // 401 Unauthorized\r\n // The presented access token does not exist or has expired.\r\n (new WebResponse(401))->wwwAuthenticate($content)->finish();\r\n return null; // Not reach here.\r\n\r\n case 'FORBIDDEN':\r\n // 403 Forbidden\r\n // The access token does not cover the required scopes\r\n // or the subject associated with the access token is\r\n // different.\r\n (new WebResponse(403))->wwwAuthenticate($content)->finish();\r\n return null; // Not reach here.\r\n\r\n case 'OK':\r\n // The access token is valid (= exists and has not expired).\r\n return $response;\r\n\r\n default:\r\n // This never happens.\r\n (new WebResponse(500, \"Unknown action\"))->plain()->finish();\r\n return null; // Not reach here.\r\n }\r\n}", "protected function validate() {\n\t\t// This loop has to be removed for 1.1\n\t\tforeach ($this->data as $k => $v) {\n\t\t\tif ($k == '__SESS_ID') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$sep = strpos('/', $k) !== false ? '/' : '-';\n\t\t\tbreak;\n\t\t}\n\n\t\t$validities = array();\n\n\t\t$hasError = ake(self::RESPONSE_ERROR, $this->responses);\n\n\t\tif (empty($this->data)) {\n\t\t\treturn $hasError;\n\t\t}\n\n\t\t$sep = null;\n\n\n\t\t// DEPRECATED, to be removed for 1.1\n\t\tforeach ($this->data as $k => $v) {\n\t\t\tif ($k == '__SESS_ID') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (is_null($sep)) {\n\t\t\t\t$sep = strpos($k, '/') !== false ? '/' : '-';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// DEPRECATED, to be removed for 1.1\n\t\tif ($sep == '/') {\n\t\t\tforeach ($this->data as $k => $v) {\n\t\t\t\tif ($k == '__SESS_ID') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$id = explode($sep, $k);\n\n\t\t\t\tif (count($id) > 3) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tforeach ($this->structure[$this->table] as &$field) {\n\t\t\t\t\tif (is_array($field) && array_key_exists('name', $field) && $field['name'] == $id[2]) {\n\t\t\t\t\t\tif (array_key_exists('validation', $field)) {\n\t\t\t\t\t\t\t$r = '/' . $field['validation']['rule'] . '/';\n\n\t\t\t\t\t\t\tif (!preg_match($r, $v)) {\n\t\t\t\t\t\t\t\t$hasError = true;\n\t\t\t\t\t\t\t\t$this->addResponse($field['validation']['message'], self::RESPONSE_ERROR);\n\t\t\t\t\t\t\t\t$validities[$field['name']] = false;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$validities[$field['name']] = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->toSave[$id[2]] = $v;\n\t\t\t}\n\n\t\t\t$this->view->set('validities', $validities);\n\n\t\t\treturn $hasError == false;\n\t\t\t// NEW WAY TO VALIDATE\n\t\t}\n\n\n\t\t// Here is final line code to keep for 1.1\n\n\t\t$dbs = array();\n\n\t\t// We order POST data by db/table to call the right model for each data\n\t\tforeach ($this->data as $k => $v) {\n\t\t\t// Find something less ugly\n\t\t\t$c = count(explode('-', $k)) - 1;\n\n\t\t\t// DB nor table given, we apply implicit db and table of this controller\n\t\t\tif ($c == 0) {\n\t\t\t\t$db = $this->_implicit;\n\n\t\t\t\tif (!is_null($this->model)) {\n\t\t\t\t\tthrow new ErrorException('POST field ' . $k . ' has not been associated to a table.');\n\t\t\t\t}\n\n\t\t\t\t$table = $this->model->getTable();\n\n\t\t\t\t$field = $k;\n\t\t\t\t// Only table and field are given, we apply implicit db of this controller\n\t\t\t} else if ($c == 1) {\n\t\t\t\t$db = $this->_implicit;\n\t\t\t\tlist ( $table, $field ) = explode('-', $k);\n\t\t\t} else {\n\t\t\t\tlist ( $db, $table, $field ) = explode('-', $k);\n\t\t\t}\n\n\n\t\t\t// Now we add field in all fields to be validated\n\t\t\t$db = camelize($db, '_');\n\n\t\t\tif (!ake($db, $dbs)) {\n\t\t\t\t$dbs[$db] = array();\n\t\t\t}\n\n\t\t\t$model = camelize($table, '_');\n\n\t\t\tif (!ake($model, $dbs[$db])) {\n\t\t\t\t$dbs[$db][$model] = array();\n\t\t\t}\n\n\t\t\t$dbs[$db][$model][$field] = $v;\n\t\t}\n\n\t\t$result = array();\n\n\t\t// And we call each model to validate data\n\t\tforeach ($dbs as $db => $models) {\n\t\t\tforeach ($models as $model => $fields) {\n\t\t\t\t$result = $this->$db->$model->validate($fields, $result);\n\t\t\t}\n\t\t}\n\n\t\t// [DEPRECATED] >>\n\t\t$this->toSave = $result['data'];\n\t\t// << [DEPRECATED]\n\t\t// We send result messages to view\n\t\tforeach ($result['messages'] as $msg) {\n\t\t\t$this->addResponse($msg, self::RESPONSE_ERROR);\n\t\t}\n\n\t\t$this->view->set('validities', $result['validities']);\n\n\t\treturn empty($result['messages']);\n\t}", "function verifyRequiredParams($required_fields, Request $request) {\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n parse_str(request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n $response = array();\n $response[\"error\"] = $error;\n if ($error) {\n // Required field(s) are missing or empty\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is/are missing or empty';\n }\n return $response;\n}", "private function validateRequest()\n {\n //verify there is a valid access token and it matches our config. Bail if not present\n $incoming_access_token = $this->request->token();\n if ($incoming_access_token !== $this->config->access_token && ! empty($this->config->access_token)) {\n $msg = 'Access denied due to invalid token.';\n syslog(LOG_DEBUG, $msg);\n header('HTTP/1.1 403 Access Denied.');\n exit();\n }\n\n //verify we have a valid request\n if (! $this->request->isValid()) {\n $msg = 'Invalid package received.';\n syslog(LOG_DEBUG, $msg);\n header('HTTP/1.1 400 Bad Request');\n exit($msg);\n }\n }", "function determineEligibility() {\n if (isset($_REQUEST['eligible_submitted'])) {\n /* eligible if:\n * a woman\n * aged 16-50\n * has ticked one of the 'partner' checkboxes\n */\n $eligibility = false;\n if(isset($_REQUEST['female']) and isset($_REQUEST['age'])) {\n\tif ($_REQUEST['female'] == \"yes\" and $_REQUEST['age'] == \"yes\") {\n\n\t foreach ($_REQUEST as $req=>$value) {\n\t if(strpos( $req , 'partner_' ) !== false) {\n\t $eligibility = true;\n\t }\n\t }\n\t $this->eligible = $eligibility;\n\t $_SESSION[\"eligible\"] = $this->eligible;\n\t}\n }\n if ($this->eligible === true) {\n\t/* eligible go to plain language statement */\n\t$_REQUEST['mode'] = \"introduction\";\n\treturn $this->showIntro();\n }\n else {\n\t/* otherwise, thanks for coming */\n\treturn $this->showIneligible();\n }\n }\n $output = $this->outputBoilerplate('eligibility.html');\n return $output;\n }", "public function validate_payload() {\n if (isset($this->initial_data[\"interface\"])) {\n $this->initial_data[\"interface\"] = APITools\\get_pfsense_if_id($this->initial_data[\"interface\"]);\n # Check that interface exists\n if (is_string($this->initial_data[\"interface\"])) {\n $if_conf = $this->config[\"interfaces\"][$this->initial_data[\"interface\"]];\n # Check that interface hosts a static network with multiple addresses\n if (isset($if_conf[\"enable\"]) and is_ipaddrv4($if_conf[\"ipaddr\"]) and $if_conf[\"subnet\"] <= 31) {\n\n } else {\n $this->errors[] = APIResponse\\get(2019);\n }\n } else {\n $this->errors[] = APIResponse\\get(2018);\n }\n } else {\n $this->errors[] = APIResponse\\get(2017);\n }\n\n # Check for our required 'id' payload value\n if (isset($this->initial_data[\"id\"])) {\n # Ensure this ID exists\n $dhcp_maps = $this->config[\"dhcpd\"][$this->initial_data[\"interface\"]][\"staticmap\"];\n if (array_key_exists($this->initial_data[\"id\"], $dhcp_maps)) {\n $this->id = $this->initial_data[\"id\"];\n } else {\n $this->errors[] = APIResponse\\get(2045);\n }\n } else {\n $this->errors[] = APIResponse\\get(2044);\n }\n }", "function verifyRequiredParams($required_fields) {\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = \\Slim\\Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n \n if ($error) {\n // Required field(s) are missing or empty\n // echo error json and stop the app\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n\n\n $response[\"status\"] = \"I\";\n $response[\"description\"] = 'Campo(s) Requerido(s) ' . substr($error_fields, 0, -2) . '';\n $response[\"idTransaction\"] = time();\n $response[\"parameters\"] = [];\n $response[\"timeRequest\"] = date(\"Y-m-d H:i:s\");\n\n echoResponse(400, $response);\n \n $app->stop();\n }\n}", "function validate_jwt($iap_jwt, $expected_audience)\n{\n $token = (new Parser())->parse((string) $iap_jwt); // Parses from a string\n $algorithm = $token->getHeader('alg');\n assert($algorithm =='ES256');\n $kid = $token->getHeader('kid');\n $client = new Client(['base_uri' => 'https://www.gstatic.com/']);\n $response = $client->request('GET', 'iap/verify/public_key');\n $body_content = json_decode((string) $response->getBody());\n $public_key = $body_content->$kid;\n\n // Validate token by checking issuer and audience fields. The JWT library automatically checks the time constraints.\n $data = new ValidationData();\n $data->setIssuer('https://cloud.google.com/iap');\n $data->setAudience($expected_audience);\n assert($token->validate($data));\n\n // Verify the signature using the JWT library.\n $signer = new Sha256();\n assert($token->verify($signer, $public_key));\n\n // Return the user identity (subject and user email) if JWT verification is successful.\n return array('sub' => $token->getClaim('sub'), 'email' => $token->getClaim('email'));\n}", "public function validateToken() \n {\n return API::response()->array(['status' => 'success'])->statusCode(200);\n }", "public function bmo_validate_request(){\n\t\t $this->is_google = $this->is_request_google();\n\t\t if( ! $this->is_google ) return; // Move along if this isn't even a google request\n\n\t\t //If this is a google request, validate the $_GET[ 'code' ] param\n\t\t $this->valid = $this->google_client->validate_code( $_GET[ 'code' ] );\n\n\t\t //Let's strip the $_GET[ 'code' ] param so nothing else can use it\n\t\t $strip = $this->strip_code_param();\n\n\t\t //Get the Google User\n\t\t $this->google_user = $this->google_client->get_google_user();\n\n\t\t //Check if the Google User Email is allowed agains our list of Approved Domains\n\t\t $approved = $this->approve_google_user();\n\n\t\t return;\n\t}", "protected function Validate() : Bool\n {\n $params = [];\n\n foreach ($this->verifyWhitelist as $k => $v) {\n if( isset($_GET[$v]) ){\n $params[$k] = $_GET[$v];\n }\n }\n\n $params[\"openid.mode\"] = \"check_authentication\"; \n \n if ( !isset($params[\"openid.return_to\"]) || $params[\"openid.return_to\"] != $this->redirectParams[\"openid.return_to\"] ){\n return false;\n } \n\n $client = $this->Client();\n\n $response = $client->request(\"POST\", $this->urlAuthorize, [ \n \"form_params\" => $params, \n \"headers\" => [ \"Accept\" => \"application/json\" ] \n ]);\n\n $response = (string) $response->getBody(); \n\n if( strpos($response, \"is_valid:true\") === false ){\n return false;\n } \n\n return true;\n }", "function validateInterkassaResp($post_in)\n{\n\t$key_to_sort = $post_in;\n\t$ik_co_id = $key_to_sort['ik_co_id'];\n\t$ik_sign = $key_to_sort['ik_sign'];\n\t$ik_am = $key_to_sort['ik_am'];\n\t$ik_inv_st = $key_to_sort['ik_inv_st'];\n\n\t// Forming a digital signature\n\tunset($key_to_sort['ik_sign']);\n\tksort($key_to_sort, SORT_STRING);\n\n\t// Add to the array \"secret key\"\n\tarray_push($key_to_sort, 'XRZxzNbDsQYzsWm2');\n\n\t// Concatenate values ​​by a \":\"\n\t$signString = implode(':', $key_to_sort);\n\n\t// Take the MD5 hash in binary form by\n\t$sign = base64_encode(md5($signString, true));\n\n\t// Validate kassa results\n\tif(\n\t\t$ik_co_id == '5370b755bf4efccb31ad6f90' AND \n\t\t$ik_inv_st == 'success' AND \n\t\t$ik_sign == $sign\n\t)\n\t{\n\t\treturn $ik_am;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "public function check()\n\t{\n\n\t\t$errors = [];\n\n\t\tif ($this->actor && !$this->isAllowed($this->action, 'authorized')) {\n\n\t\t\thttp_response_code(400);\n\n\t\t\t$errors[] = 'This action for authorized users is not found';\n\n\t\t} elseif (!$this->actor && !$this->isAllowed($this->action, 'unauthorized')) {\n\n\t\t\thttp_response_code(401);\n\n\t\t\t$errors[] = 'Unauthorized error';\n\n\t\t}\n\n\t\treturn $errors;\n\n\t}", "public function postPatientReleaseForm(PatientReleaseForm $request){\r\n \r\n if($request->form_type == 'consent'){\r\n /* $validator = Validator::make($request->all(),[\r\n 'consent_form_signature_setup' => 'required', \r\n 'acknowledge_receive_services' => 'required|in:1',\r\n 'acknowledge_emergency_medical_services' => 'required|in:1',\r\n 'acknowledge_release_medical_records' => 'required|in:1',\r\n 'acknowledge_release_vehicle' => 'required|in:1',\r\n 'acknowledge_patient_bill_of_rights' => 'required|in:1',\r\n 'acknowledge_signature' => 'required|in:1',\r\n 'consent_form_documents_located_at_with' => 'required',\r\n 'consent_form_living_will_executed' => 'required',\r\n 'consent_form_dpoa_executed' => 'required',\r\n 'consent_form_signature_date' => 'required',\r\n 'consent_form_patient_initials' => 'required|max:10',\r\n 'patient_id' => 'required',\r\n 'consent_form_living_will_executed' => 'required',\r\n 'consent_form_dpoa_name' => 'required|max:50|regex:/^[\\pL\\s]+$/u',\r\n 'consent_form_dpoa_phone_number' => 'required|phone',\r\n ]);*/\r\n $form_type = 0;\r\n }\r\n else if($request->form_type == 'hippa' ){\r\n /* $validator = Validator::make($request->all(),[\r\n 'hippa_form_signature_setup' => 'required', \r\n 'acknowledge_authorize_person' => 'required|in:1',\r\n 'acknowledge_description_of_info' => 'required|in:1',\r\n 'acknowledge_purpose_to_use' => 'required|in:1',\r\n 'acknowledge_validity_of_form' => 'required|in:1',\r\n 'acknowledge_signature' => 'required|in:1',\r\n 'patient_id' => 'required'\r\n ]);*/\r\n $form_type = 1;\r\n }\r\n else{\r\n abort(404);\r\n }\r\n \r\n\r\n /*if($validator->fails()){\r\n return response()->json(['errors'=>$validator->errors()],422);\r\n }*/\r\n $message='';\r\n if($form_type == 1){\r\n $message='Hippa form'; \r\n }\r\n if($form_type == 0){\r\n \r\n $message='Consent form'; \r\n }\r\n $save_signature = $this->patient->savePatientReleaseForm($request,$form_type);\r\n if($save_signature){\r\n $request->session()->flash('message.level','success');\r\n $request->session()->flash('message.content',''. $message.trans('message.sign_successfully'));\r\n return response()->json(['message' => trans('message.consent_form_save')], 200); \r\n }\r\n else{\r\n $request->session()->flash('message.level','danger');\r\n $request->session()->flash('message.content',trans('message.some_error'). $message.'.');\r\n return response()->json(['message' => trans('message.error_consent_form_save')], 500);\r\n } \r\n \r\n }", "public function isValidResponse(){\n\t\treturn $this->isLoaded(); \n\t}", "function httpResponseValidatation($HttpType, $requestValue) {\n // Connect to DB\n $dataBase = connect_to_db();\n if (!$dataBase) {\n exit(\"Database error!\");\n }\n $returnValid = true;\n // var_dump(\"VERIFY USER\");\n $keys = array_keys($requestValue);\n if ($HttpType == \"POST\") {\n // username is a required field, and must be uneque\n if (validateUnequeIndividualFromTable(\"post\", $dataBase, $requestValue[\"post_id\"], \"id\")) {\n $returnValid = false;\n send404(\"Invlaid post given\", array(\"Message\" => \" Post \" . $requestValue[\"post_id\"] . \" id does not exist\"));\n }\n }\n else if ($HttpType == \"GET\" || $HttpType == \"PUT\" || $HttpType == \"DELETE\") {\n if (array_key_exists(\"post_id\", $requestValue)) {\n if (validateUnequeIndividualFromTable(\"blog_comment\", $dataBase, $requestValue[\"post_id\"], \"post_id\")) {\n $returnValid = false;\n send404(\"Invlaid ID given\", array(\"Message\" =>\"Post \". $requestValue[\"post_id\"] . \" does not match\"));\n }\n }\n }\n return $returnValid;\n}", "public function handle($request, Closure $next){\n\t\t\n\t\tLog::info(\"Api Input Validate\");\n\t\t\n\t\t//If we are retrieving a record, there is no need to do anything here.\n\t\tif (strpos($request->path(), 'retrieve') !== false) {\n \t\treturn $next($request);\n\t\t}\n\n //Do not validate api requests from Neeyamo\n /*\n\t\tif (strpos($request->path(), \"ney\") !== false) {\n return $next($request);\n\t\t}\n\t\t * \n\t\t */\n\t\t\n\t\t//$message = [];\n\n if($request[\"check_type\"] == \"tri-eye\"){\n \t$request[\"check_types\"] = [1];\n }else if($request[\"check_type\"] == \"single-eye\"){\n \t$request[\"check_types\"] = [2];\n }else if($request[\"check_type\"] == \"state\"){\n\t\t\t$request[\"check_types\"] = [3];\n\t\t}else if($request[\"check_type\"] == \"county\"){\n\t\t\t$request[\"check_types\"] = [4];\n\t\t}else if($request[\"check_type\"] == \"federal_national\"){\n\t\t\t$request[\"check_types\"] = [5];\n\t\t}else if($request[\"check_type\"] == \"federal_state\"){\n\t\t\t$request[\"check_types\"] = [6];\n\t\t}else if($request[\"check_type\"] == \"district\"){\n\t\t\t$request[\"check_types\"] = [7];\n\t\t}else if($request[\"check_type\"] == \"employment\"){\n\t\t\t$request[\"check_types\"] = [8];\n\t\t}else if($request[\"check_type\"] == \"education\"){\n\t\t\t$request[\"check_types\"] = [9];\n\t\t}else if($request[\"check_type\"] == \"mvr\"){\n\t\t\t$request[\"check_types\"] = [10];\n\t\t}else if($request[\"check_type\"] == \"federal-district-tri-eye\"){\n\t\t\t$request[\"check_types\"] = [7];\n\t\t\t$request[\"federal_district_tri_eye_district_ids\"] = [json_decode($request[\"federal_district_tri_eye_district_ids\"])];\n\t\t}else if($request[\"check_type\"] == \"home_auto\"){\n\t\t\t$request[\"check_types\"] = [11,13]; //infutor MaxID\n\t\t}else if($request[\"check_type\"] == \"personal\"){\n\t\t\t$request[\"check_types\"] = [12]; //usinfo\n\t\t}else if( $request[\"check_type\"] == \"cssi_data\" ){\n\t\t\t$request[\"check_types\"] = [11,12,13];\n\t\t}else if( $request[\"check_type\"] == \"cssi_auto\" ){\n\t\t\t$request[\"check_types\"] = [11,13]; //infutor auto\n\t\t}else if( $request[\"check_type\"] == \"cssi_vehicle\" ){\n\t\t\t$request[\"check_types\"] = [13]; //infutor auto\n\t\t}else if($request[\"check_type\"] == \"cssi_mvr\"){\n\t\t\t$request[\"check_types\"] = [14];\n\t\t}else{\n\t\t\treturn response()->json(\"Invalid check type\", 400);\n\t\t}\n\t\t\n\t\t/*\n\t\tif(count($message)){\n\t\t\treturn response()->json($message, 400);\n\t\t}\n\t\t * \n\t\t */\n\n\t\treturn $next($request);\n\t\t\n\t}", "function verifyRequiredParams($required_fields) {\n\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = \\Slim\\Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n // Required field(s) are missing or empty\n // echo error json and stop the app\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n $response[\"status\"] = \"failed\";\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n $response[\"errorcode\"]=5;\n echoRespnse(400, $response);\n $app->stop();\n }\n\n}", "function verifyRequiredParams($required_fields)\n{\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = \\Slim\\Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n // Required field(s) are missing or empty\n // echo error json and stop the app\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n\n $response[\"status\"] = \"I\";\n $response[\"description\"] = 'Campo(s) Requerido(s) ' . substr($error_fields, 0, -2) . '';\n $response[\"idTransaction\"] = time();\n $response[\"parameters\"] = [];\n $response[\"timeRequest\"] = date(\"Y-m-d H:i:s\");\n\n echoResponse(400, $response);\n\n $app->stop();\n }\n}", "public function getHasPossibleClaimCircumstances()\n {\n return $this->hasPossibleClaimCircumstances;\n }", "public function completeWebAuthnAssertion($request)\n {\n return $this->startAnonymous()->uri(\"/api/webauthn/assert\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function validateIssuedBy($value) {\n // its ok to return true\n if ( !in_array($this->data['WarehouseOrder']['status'],['isporucen','spreman']) ) {\n if ( empty($value['issued_by']) ) {\n return true;\n }\n }\n\n // not the value must not be empty\n if ( empty($value['issued_by']) ) {\n return false;\n }\n\n return true;\n }", "public function _check_request_info() {\n\t\t$msg = '';\n\t\tif ($this->generate_invoice_request) {\n\t\t\tif (($this->generate_request_amount < 1) || ($this->generate_request_amount > 100)) {\n\t\t\t\t$msg .= \"Invoice request amount must be between 1 and 100.<br />\";\n\t\t\t}\n\t\t\tif (!$this->generate_request_recipients) {\n\t\t\t\t$msg .= \"You must select a user as a recipient for the invoice request.<br />\";\n\t\t\t}\n\t\t}\n\t\treturn $msg;\n\t}", "function verifyRequiredParams($required_fields) \n\t{\n\t\t$error = false;\n\t\t$error_fields = \"\";\n\t\t$request_params = array();\n\t\t$request_params = $_REQUEST;\n\t\t\n\t\t// Handling PUT request params\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'PUT') \n\t\t{\n\t\t\t$app = \\Slim\\Slim::getInstance();\n\t\t\tparse_str($app->request()->getBody(), $request_params);\n\t\t}\n\t\t\n\t\tforeach ($required_fields as $field) \n\t\t{\n\t\t\tif (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) \n\t\t\t{\n\t\t\t\t$error = true;\n\t\t\t\t$error_fields .= $field . ', ';\n\t\t\t}\n\t\t\n\t\t}\n\n\t\tif ($error) \n\t\t{\n\t\t\t\n\t\t\t// Required field(s) are missing or empty\n\t\t\t// echo error json and stop the app\n\t\t\t$response = array();\n\t\t\t$app = \\Slim\\Slim::getInstance();\n\t\t\t$response[\"error\"] = true;\n\t\t\t$response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n\t\t\techoRespnse(400, $response);\n\t\t\t$app->stop();\n\t\t}\n }", "public function verifyRequest()\n\t{\n\t\t$this->verifyApplicationId();\n\t\t$this->verifyTimestamp();\n\t\t$this->verifySignatureCertificateUrl($this->getSignatureCertificateUrl());\n\n\t\t$certificate = $this->persistence->getCertificateForKey($this->certificate_url);\n\n\t\tif (! $certificate) {\n\t\t\t$certificate = new Certificate($this->certificate_url);\n\t\t}\n\n\t\t$this->verifyCertificate($certificate);\n\t}", "public function use_for_claims() {\n\t\treturn $this->get_product_meta( 'use_for_claims' ) === 'yes';\n\t}", "public function verified(Request $request)\n {\n if ($request->has('app_id') && $request->has('request_id') && $request->has('email') && $request->has('sign')) {\n if ($request->input('app_id') == 'oqEUfB6GyLysD9rK') {\n $sign = md5('app_id=oqEUfB6GyLysD9rK&request_id='.$request->input('request_id').'&email='.$request->input('email').'&app_secret=NCKhqJYmfYpCnVMTsPmU5dT2');\n if ($request->input('sign') == $sign) {\n $sign = md5('app_id=oqEUfB6GyLysD9rK&request_id='.$request->input('request_id').'&email='.$request->input('email').'&app_secret=UZSt7NsR7DqMhcjP3YuYnmJW');\n return response()->json(['code'=>200, 'result'=>false, 'sign'=>$sign]);\n } else {\n return response()->json(['code'=>403, 'message'=>'Access Denied: invalid sign.']);\n }\n } else {\n return response()->json(['code'=>403, 'message'=>'Access Denied: invalid app_id.']);\n }\n } else {\n return response()->json(['code'=>400, 'message'=>'Bad Request: missing parameter.']);\n }\n }", "public function validateReuest()\r\n {\r\n //echo $_SERVER['CONTENT_TYPE']; exit;\r\n\r\n if($_SERVER['CONTENT_TYPE'] !== 'application/json')\r\n {\r\n $this->throwError(REQUEST_CONTENTTYPE_NOT_VALID, 'Request Content-Type is not Valid');\r\n }\r\n\r\n // decode it into array format.\r\n $data = json_decode($this->request, true);\r\n // to check the data in array.\r\n //print_r($data);\r\n\r\n\r\n // check if api name is reuired or not\r\n if(!isset($data['name']) || $data['name'] == \"\")\r\n {\r\n $this->throwError(API_NAME_REQUIRED, \"API Name is Required.\");\r\n }\r\n $this->serviceName = $data['name'];\r\n\r\n\r\n // check if parameters name is reuired or not\r\n if(!is_array($data['param']))\r\n {\r\n $this->throwError(API_PARAM_REQUIRED, \"API PARAM is Required.\");\r\n }\r\n $this->param = $data['param'];\r\n }", "function verifyRequiredParams($required_fields) {\r\n\t\t\t$error = false;\r\n\t\t\t$error_fields = \"\";\r\n\t\t\t$request_params = array();\r\n\t\t\t$request_params = $_REQUEST;\r\n\t\t\t// Handling PUT request params\r\n\t\t\tif ($_SERVER['REQUEST_METHOD'] == 'PUT') {\r\n\t\t\t\t$app = \\Slim\\Slim::getInstance();\r\n\t\t\t\tparse_str($app->request()->getBody(), $request_params);\r\n\t\t\t}\r\n\t\t\tforeach ($required_fields as $field) {\r\n\t\t\t\tif (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\r\n\t\t\t\t\t$error = true;\r\n\t\t\t\t\t$error_fields .= $field . ', ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t \r\n\t\tif ($error) {\r\n\t\t\t// Required field(s) are missing or empty\r\n\t\t\t// echo error json and stop the app\r\n\t\t\t$response = array();\r\n\t\t\t$app = \\Slim\\Slim::getInstance();\r\n\t\t\t$response[\"error\"] = true;\r\n\t\t\t$response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\r\n\t\t\techoRespnse(400, $response);\r\n\t\t\t$app->stop();\r\n\t\t}\r\n\t}", "public function provideTestValidateResponse()\n {\n return array(\n // all pass\n array(true, true, true, true, null),\n // no success but acceptable, no AVS or CVV failures\n array(false, true, true, true, null),\n // AVS failure\n array(false, false, false, true, 'Radial_CreditCard_Exception'),\n // CVV failure\n array(false, false, true, false, 'Radial_CreditCard_Exception'),\n // no success, no failures but still unacceptable\n array(false, false, true, true, 'Radial_CreditCard_Exception'),\n );\n }", "public static function hasCkeck(String $token, $validate = true )\n {\n try {\n $credentials = JWT::decode($token, env('JWT_SECRET'), ['HS256']);\n $timeNext = $credentials->timeNext;\n // Check if it is jwt from normal events\n if ($validate) {\n $user = \\App\\Models\\Subscription::findByUserIdAndServiceIdAndServiceOfferKeyAndSubscriptionId((array)$credentials);\n if (!$user) {\n throw new \\Exception(ResponseCode::UNAUTHORIZED_MESSAGE, ResponseCode::NO_CONTENT);\n } else {\n return ['user' => $user, 'timeNext' => $timeNext];\n }\n } else{\n // Only jwt custom\n return ['data' => $credentials, 'timeNext' => $timeNext];\n }\n } catch (ExpiredException $e) {\n return ['error' => ResponseCode::UNAUTHORIZED_MESSAGE, 'code' => ResponseCode::EXIST];\n } catch (\\Exception $e) {\n return ['error' => ResponseCode::PRECONDITION_FAILED_MESSAGE, 'code' => ResponseCode::ERROR_EXCEPTION];\n } catch (UnexpectedValueException $e) {\n \\Log::info(__METHOD__, ['jwt' => $token, 'execption' => $e->getMessage()]);\n return ['error' => ResponseCode::PRECONDITION_FAILED_MESSAGE, 'code' => ResponseCode::NO_CONTENT];\n } catch (SignatureInvalidException $e) {\n \\Log::info(__METHOD__, ['jwt' => $token, 'execption' => $e->getMessage()]);\n return ['error' => ResponseCode::PRECONDITION_FAILED_MESSAGE, 'code' => ResponseCode::NO_CONTENT];\n } catch (BeforeValidException $e) {\n \\Log::info(__METHOD__, ['jwt' => $token, 'execption' => $e->getMessage()]);\n return ['error' => ResponseCode::PRECONDITION_FAILED_MESSAGE, 'code' => ResponseCode::NO_CONTENT];\n } catch (InvalidArgumentException $e) {\n \\Log::info(__METHOD__, ['jwt' => $token, 'execption' => $e->getMessage()]);\n return ['error' => ResponseCode::PRECONDITION_FAILED_MESSAGE, 'code' => ResponseCode::NO_CONTENT];\n } catch (DomainException $e) {\n \\Log::info(__METHOD__, ['jwt' => $token, 'execption' => $e->getMessage()]);\n return ['error' => ResponseCode::PRECONDITION_FAILED_MESSAGE, 'code' => ResponseCode::NO_CONTENT];\n } catch (RequestException $e) {\n \\Log::info(__METHOD__, ['jwt' => $token, 'execption' => $e->getMessage()]);\n return ['error' => ResponseCode::PRECONDITION_FAILED_MESSAGE, 'code' => ResponseCode::NO_CONTENT];\n }\n }", "function validateRequest($request) {\n $rules = \n [\n 'name' => 'required',\n 'address' => 'required',\n 'phone' => 'required|numeric',\n 'profession' => 'required|in:engineering,maths,physics'\n ]; \n // if validation fails, it will produce an error response }\n $this->validate($request, $rules);\n }", "public function checkIn(Request $request)\n {\n $response;\n $checkUser = new ValidUser($request);\n if ($checkUser != ErrorCode::$OK){\n $response = new MyResponse(ErrorCode::$INVALID_TOKEN, ErrorDesc::$INVALID_TOKEN, \"-\");\n return $response->get();\n }\n else {\n $absent_header = Absent::where('id','=',$request['absent_header'])\n ->first();\n $work_time = WorkTime::where('id','=',$absent_header['work_time'])\n ->first();\n $absent_time = Carbon::createFromFormat('Y-m-d H:i:s', \n $absent_header['work_date']\n .' '.$work_time['work_start']\n ,'Asia/Jakarta'); \n $lateTime = $absent_time->addMinutes($work_time['max_late']);\n \n $checkin = Carbon::now('Asia/Jakarta');\n $diff = $lateTime->diffInMinutes($checkin,false);\n\n $absent = new AbsentDetail();\n if ($diff > 0){\n $absent['status'] = 6;\n }\n else {\n $absent['status'] = 1;\n }\n $absent['employee'] = $request['employee_id'];\n $absent['check_in'] = $checkin;\n $absent['note'] = $request['note'];\n $absent['absent_header']= $absent_header['id'];\n $response = new MyResponse(ErrorCode::$OK, ErrorDesc::$OK, $absent);\n try {\n $absent->save();\n } catch(\\Illuminate\\Database\\QueryException $e){\n $errorCode = $e->errorInfo[1];\n if($errorCode == ErrorCode::$DUPLICATE_ENTRY){\n $response = new MyResponse(ErrorCode::$DUPLICATE_ENTRY, ErrorDesc::$DUPLICATE_ENTRY, \"Anda sudah melakukan absensi\");\n }\n }\n \n return $response->get();\n }\n // return $response->get();\n }", "function verifyRequiredParams($required_fields) {\r\n $error = false;\r\n $error_fields = \"\";\r\n $request_params = array();\r\n $request_params = $_REQUEST;\r\n // Handling PUT request params\r\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\r\n $app = \\Slim\\Slim::getInstance();\r\n parse_str($app->request()->getBody(), $request_params);\r\n }\r\n foreach ($required_fields as $field) {\r\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\r\n $error = true;\r\n $error_fields .= $field . ', ';\r\n }\r\n }\r\n\r\n if ($error) {\r\n // Required field(s) are missing or empty\r\n // echo error json and stop the app\r\n $response = array();\r\n $app = \\Slim\\Slim::getInstance();\r\n $response[\"error\"] = true;\r\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\r\n echoRespnse(400, $response);\r\n $app->stop();\r\n }\r\n}", "function verifyRequiredParams($required_fields)\n {\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n // Required field(s) are missing or empty\n // echo error json and stop the app\n $response = array();\n $app = Slim::getInstance();\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n $this->echoResponse(400, $response);\n $app->stop();\n }\n }", "function verifyRequiredParams($required_fields) {\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = \\Slim\\Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n // Required field(s) are missing or empty\n // echo error json and stop the app\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n echoResponse(400, $response);\n $app->stop();\n }\n}", "public function validateClientToken($param){\n\t\t$this->param = $param;\n\n\t\t$token = $this->getBearer();\n\n\t\t$result = [\n\t\t\t'error' => 1,\n\t\t\t'message' => '',\n\t\t\t'payload' => null\n\t\t];\n\t\t$method = $this->param->getServer('REQUEST_METHOD');\n\t\tif($method === 'OPTIONS' || $method === 'PUT'){\n\t\t\tdie;\n\t\t}\n\n\t\tif($token && is_array($token)){\n\t\t\tlist($header, $payload, $signature) = $token;\n\t\t\t$dataEncoded = $header . '.' . $payload;\n\n\t\t\t$rawSignature = hash_hmac(\"sha256\", utf8_encode($dataEncoded), utf8_encode($this->siteConfig->getData('site_api_key')));\n\n\t\t\t$isValid = hash_equals($rawSignature, $signature);\n\n\t\t\tif($isValid){\n\t\t\t\t$payloadDecode = json_decode(base64_decode($payload), true);\n\t\t\t\tif(isset($payloadDecode['tzoffset']) && isset($payloadDecode['tzname'])){\n\t\t\t\t\t$tzoffset = $payloadDecode['tzoffset'];\n\t\t\t\t\t$tzname = $payloadDecode['tzname'];\n\n\t\t\t\t\t$tz = $this->validateTimeZone($tzoffset, $tzname);\n\n\t\t\t\t\tif($tz){\n\t\t\t\t\t\tdate_default_timezone_set($tz);\n\n\t\t\t\t\t\t$now = time();\n\t\t\t\t\t\t$tokenTime = strtotime($payloadDecode['iat']);\n\t\t\t\t\t\t$max_valid_time = $this->siteConfig->getData('site_api_token_max_time', 60*3);\n\n\t\t\t\t\t\t$gap = $now - $tokenTime;\n\n\t\t\t\t\t\t$expEnabled = (int)$this->siteConfig->getData('site_api_exp_enabled', 0);\n\n\t\t\t\t\t\t$result['error'] = 0;\n\t\t\t\t\t\t$result['message'] = $this->_lang->getLang('success');\n\t\t\t\t\t\t$result['payload'] = $payloadDecode;\n\n\t\t\t\t\t\tif($expEnabled == 1){\n\t\t\t\t\t\t\tif($gap > $max_valid_time){\n\t\t\t\t\t\t\t\t$result['error'] = 1;\n\t\t\t\t\t\t\t\t$result['message'] = $this->_lang->getLang('api_expired_token');\n\t\t\t\t\t\t\t\t$result['payload'] = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $result;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$result['message'] = $this->_lang->getLang('invalid_request');\n\t\t}\n\t}", "function verifyRequiredParams($required_fields) {\n $error = false;\n $error_fields = \"\";\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = \\Slim\\Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n // Required field(s) are missing or empty\n // echo error json and stop the app\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n echoResponse(400, $response);\n $app->stop();\n }\n}", "public function isValid()\n {\n return !empty($this->_data[OAuth::PARAM_TOKEN])\n && !empty($this->_data[OAuth::PARAM_VERIFIER]);\n }", "public static function validate()\n {\n $request = Request::getInstance();\n $csrf = Session::get('csrf');\n\n if(!$csrf) self::rejectRequest();\n\n $isValid = hash_equals($request->csrf, $csrf);\n\n self::generateToken();\n\n if(!$isValid) {\n\n self::rejectRequest();\n\n }\n }", "public static function hasValidToken() {\n $requestHeaders = Rock::getHeaders();\n\n if (array_key_exists(Config::get('JWT_HEADER'), $requestHeaders) === true) {\n try {\n $decoded = (array)Firebase\\JWT\\JWT::decode($requestHeaders[Config::get('JWT_HEADER')], Config::get('JWT_KEY'), [Config::get('JWT_ALGORITHM')]);\n } catch (Exception $e) {\n return false;\n }\n\n $depth = 1;\n $result = Moedoo::select('user', [Config::get('TABLES')['user']['pk'] => $decoded['id']], null, $depth);\n $included = Moedoo::included(true);\n\n if (count($result) === 1) {\n $user = $result[0];\n $userGroup = $included['user_group'][$user['user_group']];\n\n if ($user['user_status'] === false) {\n //-> user suspended\n return false;\n } elseif (is_null($user['user_group']) === true) {\n //-> user doesn't belong to a user-group\n return false;\n } elseif ($userGroup['user_group_status'] === false) {\n //-> user-group has been suspended\n return false;\n }\n\n return $user;\n }\n\n return false;\n }\n\n return false;\n }", "function verifyRequiredParams($required_fields) {\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n// Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = \\Slim\\Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n// Required field(s) are missing or empty\n// echo error json and stop the app\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n $response[\"code\"] = 10;\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n echoRespnse(400, $response);\n $app->stop();\n }\n}", "protected function validateRequest()\n {\n if ( ! isset($_POST['purchase_code']) || ! is_string($_POST['purchase_code'])) {\n wp_send_json(array(\n 'type' => 'error',\n 'message' => __('Bad request', 'quform')\n ));\n }\n\n if ($_POST['purchase_code'] === '') {\n wp_send_json(array(\n 'type' => 'error',\n 'message' => __('Please enter a license key', 'quform')\n ));\n }\n\n if ( ! current_user_can('quform_settings')) {\n wp_send_json(array(\n 'type' => 'error',\n 'message' => __('Insufficient permissions', 'quform')\n ));\n }\n\n if ( ! check_ajax_referer('quform_verify_purchase_code', false, false)) {\n wp_send_json(array(\n 'type' => 'error',\n 'message' => __('Nonce check failed', 'quform')\n ));\n }\n }", "public function getInitClaims(){\n\n return $this->payload;\n \n }", "public function valid()\n {\n\n if ($this->container['correlation_id'] === null) {\n return false;\n }\n if ($this->container['provider_id'] === null) {\n return false;\n }\n if ($this->container['response_code'] === null) {\n return false;\n }\n if ($this->container['response_detail'] === null) {\n return false;\n }\n return true;\n }", "function verifyRequiredParams($required_fields) {\r\n $error = false;\r\n $error_fields = \"\";\r\n $request_params = array();\r\n $request_params = $_REQUEST;\r\n // handling PUT request params\r\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\r\n $app = \\Slim\\Slim::getInstance();\r\n parse_str($app->request()->getBody(), $request_params);\r\n }\r\n foreach ($required_fields as $field) {\r\n if (!isset($request_params[$field]) || !is_array($request_params)) {\r\n $error = true;\r\n $error_fields .= $field . ', ';\r\n }\r\n }\r\n if ($error) {\r\n // required fields are missing or empty\r\n // echo error json and stop the app\r\n $response = array();\r\n $app = \\Slim\\Slim::getInstance();\r\n $response['error'] = true;\r\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\r\n echoResponse(400, $response);\r\n $app->stop();\r\n }\r\n}", "public function testIsValid()\n {\n $isValid = JWT::getInstance()->isValidToken('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRfaWQiOiJyYWlsc19sZWdhY3kifQ.Dciipit-lh9N5FuPLNviTU-4Q5PUIdweJOCmPg7ucN4');\n $this->assertTrue($isValid);\n }", "public function authorize()\n\t{\n\t\t$expenses = $this->input('expense_ids');\n\t\tif($expenses != null && count($expenses) > 0) {\n\t\t\t$reportId = Expense::find($expenses[0])->report_id;\n\t\t\t$report = ExpenseReport::find($reportId);\n\t\t\tif($report->status) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function verifyRequiredParams($required_fields)\n{\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = \\Slim\\Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n // Required field(s) are missing or empty\n // echo error json and stop the app\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n echoRespnse(400, $response);\n $app->stop();\n }\n}", "function verifyRequiredParams($required_fields) {\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = \\Slim\\Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n // Required field(s) are missing or empty\n // echo error json and stop the app\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n echoRespnse(400, $response);\n $app->stop();\n }\n}", "function verifyRequiredParams($required_fields) {\n $error = false;\n $error_fields = \"\";\n $request_params = array();\n $request_params = $_REQUEST;\n // Handling PUT request params\n if ($_SERVER['REQUEST_METHOD'] == 'PUT') {\n $app = \\Slim\\Slim::getInstance();\n parse_str($app->request()->getBody(), $request_params);\n }\n foreach ($required_fields as $field) {\n if (!isset($request_params[$field]) || strlen(trim($request_params[$field])) <= 0) {\n $error = true;\n $error_fields .= $field . ', ';\n }\n }\n\n if ($error) {\n // Required field(s) are missing or empty\n // echo error json and stop the app\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n $response[\"error\"] = true;\n $response[\"message\"] = 'Required field(s) ' . substr($error_fields, 0, -2) . ' is missing or empty';\n echoRespnse(400, $response);\n $app->stop();\n }\n}" ]
[ "0.5917254", "0.58860385", "0.5828724", "0.5704555", "0.5642776", "0.55364764", "0.55364764", "0.55023044", "0.5487876", "0.5476067", "0.5457175", "0.54370266", "0.54347104", "0.53679836", "0.5352606", "0.53438467", "0.5340123", "0.53141844", "0.5310807", "0.53002864", "0.52892077", "0.5288528", "0.5274322", "0.52688193", "0.5247333", "0.5200387", "0.5200387", "0.5195857", "0.51934713", "0.5184753", "0.5170214", "0.5146606", "0.51453227", "0.5134671", "0.5132221", "0.51286054", "0.51148903", "0.5109142", "0.51081675", "0.50880605", "0.50865555", "0.5086006", "0.5075426", "0.5070969", "0.50672555", "0.5065918", "0.50543886", "0.5049567", "0.5043848", "0.503421", "0.5033733", "0.5021052", "0.50146466", "0.5009552", "0.50053376", "0.4985408", "0.4981809", "0.49815136", "0.49779207", "0.49754393", "0.49737495", "0.49701044", "0.4958385", "0.49479187", "0.49358225", "0.49138206", "0.49135628", "0.49112868", "0.4909853", "0.4908859", "0.49077603", "0.4900188", "0.48999053", "0.48934448", "0.4887864", "0.48878154", "0.48852456", "0.48790678", "0.48789218", "0.48764735", "0.4875381", "0.48702613", "0.48680073", "0.4867949", "0.48590338", "0.48575866", "0.48568502", "0.48494416", "0.48493588", "0.484685", "0.48453885", "0.4844318", "0.48409307", "0.4840098", "0.48362648", "0.48353323", "0.48283535", "0.4826031", "0.48238915", "0.48238915" ]
0.58951604
1
Get bool value from request
private function getBoolValue($valueInRequest, $attribute, $defaultValue, LogicEvaluator $logicEvaluator) { if (is_array($valueInRequest) && isset($valueInRequest[$attribute])) { $value = $logicEvaluator->evaluate($valueInRequest[$attribute]); if (!is_bool($value)) { throw new ValidationException($attribute . ' can not be evaluated to bool.'); } return $value; } return $defaultValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBool(): bool;", "public function bool()\n {\n return filter_var($this->value, FILTER_VALIDATE_BOOLEAN);\n }", "public function getBoolField()\n {\n $value = $this->get(self::BOOL_FIELD);\n return $value === null ? (boolean)$value : $value;\n }", "public function boolValue()\n {\n return $this->value;\n }", "function post_bool($boolean_name) {\n\t$boolean = $_POST[$boolean_name];\n\tif ($boolean == \"true\")\n\t\treturn true;\n\n\treturn false;\n}", "public function value(): bool\n {\n if (($val = $this->raw()) === null) {\n return false;\n }\n\n return (new Boolean)->decode($val);\n }", "public function getBool(): ?BoolQuery;", "public function isGet(): bool {}", "public function get() {\n\t\treturn (bool) $this->user_options->get( static::OPTION );\n\t}", "public function getIsRequired(): bool;", "function rest_is_boolean($maybe_bool)\n {\n }", "public static function getIsRequired()\n {\n return (bool) self::get('is_required', false);\n }", "public function example_function() {\n\t\tif ( ! check_ajax_referer( 'my_nonce' ) ) {\n\t\t\twp_die(); // Die because nonce verification has failed.\n\t\t}\n\n\t\t$some_boolean_variable = filter_input( INPUT_GET, 'some_boolean_variable', FILTER_VALIDATE_BOOLEAN );\n\t\tif ( $some_boolean_variable ) {\n\t\t\twp_send_json_success( 'Some boolean variable value is set and has value of 1, true, on or yes' );\n\t\t}\n\t\twp_send_json_error( 'No variable set.' );\n\t}", "public function getBoolean($key)\n {\n \n if (!isset($this->data[$key])) {\n return false;\n }\n \n if (is_bool($this->data[$key])) {\n return $this->data[$key];\n }\n\n if (('f' !== $this->data[$key] && 'FALSE' !== $this->data[$key] && '0' != $this->data[$key]))\n return true;\n else\n return false;\n\n }", "public function getIsTest()\n {\n $value = $this->get(self::ISTEST);\n return $value === null ? (boolean)$value : $value;\n }", "public function hasBoolValue(){\n return $this->_has(3);\n }", "public function isTrue()\n {\n \n return !!$this->value;\n \n }", "public function parseRequest(): bool;", "public function isPost(): bool {}", "public function getRequired(): bool;", "private function validateBoolean($name)\n {\n return $this->entity->$name;\n }", "public function getIsGetRequest()\n\t{\n\t\treturn ($this->getRequestType() == 'GET');\n\t}", "function sa_getFlag($flag){\n return (isset($_REQUEST[$flag]) and $_REQUEST[$flag]==1) ? true : false;\n}", "public function hasRequest(): bool;", "public function hasRequest(): bool;", "public function hasBoolValue(){\n return $this->_has(4);\n }", "public function getBool($prop) {\n\n\t\t\t// Get property\n\t\t\t$val = $this->get($prop);\n\n\t\t\t// String/numeric bool?\n\t\t\tif ($val === 'false') { \n\t\t\t\t$val = false; \n\t\t\t} elseif ($val === 'true') {\n\t\t\t\t$val = true;\n\t\t\t} elseif ($val === 1 || $val === '1') {\n\t\t\t\t$val = true;\n\t\t\t} elseif ($val === 0 || $val === '0') {\n\t\t\t\t$val = false;\n\t\t\t}\n\n\n\n\n\t\t\t// Boolean?\n\t\t\tif (is_bool($val)) {\n\t\t\t\treturn $val;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t}", "public function getBool(string $field_name, string $true_value)\n {\n return $this->field_bool(INPUT_GET, $field_name, $true_value);\n }", "public static function boolean()\n {\n return self::builtinType('bool');\n }", "function rest_sanitize_boolean($value)\n {\n }", "public function getBooleanFormatForQueryString(): string\n {\n return $this->booleanFormatForQueryString;\n }", "public function toBoolean()\n {\n $key = $this->toLowerCase()->str;\n $map = array(\n 'true' => true,\n '1' => true,\n 'on' => true,\n 'yes' => true,\n 'false' => false,\n '0' => false,\n 'off' => false,\n 'no' => false,\n );\n\n if (array_key_exists($key, $map)) {\n return $map[$key];\n } elseif (is_numeric($this->str)) {\n return ((int) $this->str > 0);\n } else {\n return (bool) $this->regexReplace('[[:space:]]', '')->str;\n }\n }", "public function toBool() : bool\n {\n return boolval($this->value);\n }", "public function is_valid(){\n return $this->is_valid;\n }", "public function wt_parse_bool_field($value) {\n if ('0' === $value) {\n return false;\n }\n\n if ('1' === $value) {\n return true;\n }\n\n // Don't return explicit true or false for empty fields or values like 'notify'.\n return wc_clean($value);\n }", "function readBoolean();", "function read_boolean(&$payload) {\n return (bool) read_byte($payload);\n}", "public static function boolean() {}", "public function getIsAccepted(): bool;", "public function getPBool()\n {\n return isset($this->p_bool) ? $this->p_bool : false;\n }", "public function getBoolean( Inx_Api_Recipient_Attribute $oAttribute );", "function getBooleanQuery(){\n return $this->_query;\n }", "public function getSubmittedValue() {\n return isset($_REQUEST[$this->name]) ? $_REQUEST[$this->name] : FALSE;\n }", "function toBoolean(){\n\t\tif(in_array($this->lower(),array('','false','off','no','n','f'))){\n\t\t\treturn false;\n\t\t}\n\t\treturn (bool)$this->toString();\n\t}", "public static function boolean()\n {\n return Type::boolean();\n }", "public function isBoolean();", "public function isRequest(): bool {\n return $this->options['request'] ?? false;\n }", "function wp_validate_boolean($value)\n {\n }", "private static function getBool($param)\n {\n if ('true' == $param) {\n return true;\n }\n\n if ('false' == $param) {\n return false;\n }\n\n return (bool) $param;\n }", "function boolval($val){\n return $val === 'true' ? true : false;\n}", "function to_boolean($val);", "public function postBool(string $field_name, string $true_value)\n {\n return $this->field_bool(INPUT_POST, $field_name, $true_value);\n }", "public function isSet() : bool;", "function getResp() {\n $resp = $_GET[\"resp\"];\n\n if ($resp != 'on') {\n $resp = 'off';\n }\n return $resp;\n}", "public function isBoolean(): bool\n {\n return $this->boolean;\n }", "function serendipity_ini_bool($var) {\n return ($var === 'on' || $var == '1');\n}", "public function toBoolean(): bool\n {\n return $this->boolean;\n }", "public function test(Request $request) {\n\n return response()->json(['floaing' => 1.25]);\n return [filter_var('true', FILTER_VALIDATE_BOOLEAN)];\n }", "function ini_get_bool($ini_get_arg) {\n\t$temp = ini_get($ini_get_arg);\n\n\tif ($temp == '1' or strtolower($temp) == 'on') {\n\t\treturn true;\n\t}\n\treturn false;\n}", "public static function getBoolean(string $key): bool {\n\t\t$v = self::$sessionInstance->get ( $key, false );\n\t\treturn UString::isBooleanTrue ( $v );\n\t}", "function o_castBool($value) {\n\t\t\treturn Obj::singleton()->castBool($value);\n\t\t}", "public static function getBool($param)\n {\n $value = filter_var(self::get($param), FILTER_VALIDATE_BOOLEAN);\n\n return $value;\n }", "public function isGet(): bool \r\n {\r\n return $this -> method() === 'GET' ? true : false;\r\n }", "protected function get_type() {\n\t\treturn 'boolean';\n\t}", "protected function get_type() {\n\t\treturn 'boolean';\n\t}", "public function isSubmited(): bool\n {\n return (bool) $this->values();\n }", "public static function GetBool($key)\n {\n return (bool)self::Get($key);\n }", "public function isGet();", "function getBoolean($key, $defvalue = '') {\n\t\treturn strcasecmp('true', $this->get($key, $defvalue).'') === 0;\n\t}", "static function toBoolean($data)\r\n {\r\n if(!is_string($data))\r\n return (bool) $data;\r\n switch(strtolower($data)) {\r\n case '1':\r\n case 'TRUE':\r\n case 'on':\r\n case 'yes':\r\n case 'y':\r\n return TRUE;\r\n default:\r\n return FALSE;\r\n }\r\n }", "private function bool($value)\n\t{\n\t\t// We do *not* follow the string 0 php casting rule.\n\t\t// {if field} should be true if the user entered\n\t\t// something. Doesn't matter what it is.\n\t\tif ($value === '0')\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn (bool) $value;\n\t}", "function erp_validate_boolean( $value ) {\n return filter_var( $value, FILTER_VALIDATE_BOOLEAN );\n}", "static public function GetGETSaveInSent() {\n if (isset(self::$saveInSent))\n return self::$saveInSent;\n else\n return true;\n }", "public function castToBool($value);", "public function isRequired() {\n return $this->is_required;\n }", "function boolval($var) {\r\n if (is_bool($var)) { return $var; }\r\n switch ($var) {\r\n case 'true': return true;\r\n case 'false': return false;\r\n default: throw new InvalidArgumentException('Cannot parse value '.$var);\r\n }\r\n}", "public function isTrue();", "public function IsOk(){\n\t\treturn $this->_isok;\n\t}", "public function toBool(): bool\n\t{\n\t\treturn false;\n\t}", "function getIsOn(){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('SELECT isOn FROM bot_on_off LIMIT 1');\n\t\t$statement->execute();\n\t\treturn $statement->fetch()['isOn'] == true;\n\t}", "protected function getBooleanValue($path)\n {\n $normalizedPath = strtolower($path);\n\n if (in_array($normalizedPath, ['true', 'on', 'yes'])) {\n return true;\n }\n\n if (in_array($normalizedPath, ['false', 'off', 'no'])) {\n return false;\n }\n\n return null;\n }", "function bool($val,$str=false){\n if(is_string($val)) {\n $val=strtolower($val);\n $val=$val && $val!=\"false\" && $val !=\"no\" && $val !=\"n\" && $val !=\"f\" && $val !=\"off\";\n }else $val=(bool)$val;\n return $str?($val?\"true\":\"false\"):$val;\n}", "public function getBoolean($i);", "function boolval( $val ) {\r\n\t\treturn (bool) $val;\r\n\t}", "public function IsRequired()\n {\n return $this->IsRequired;\n }", "public function isRequest();", "private function fetchDataFromRequest()\n {\n $this->data = (object)$_REQUEST;\n if ($this->getParameter('apicheck',self::REGEX_INTEGER)) {\n $this->apiCheck = true;\n }\n\n return true;\n }", "abstract public function getIsOk(): bool;", "function pdo_bool($value) {\n\tif (is_bool($value)) {\n\t\t$value = (int)$value;\n\t}\n\treturn $value;\n}", "function isTrue($value) {\r\n\treturn is_bool($value) ? $value : (bool)preg_match('/^(1|y|yes|true|on)$/i',(string)$value);\r\n}", "private function checkrequest()\n {\n // This method checks if there is user input, and returns the request_method if evaluated to be true\n if ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n $this->request = \"post\";\n return true;\n } elseif ($_SERVER['REQUEST_METHOD'] == \"GET\") {\n $this->request = \"get\";\n return true;\n } else {\n $this->request = false;\n }\n }", "public function set($value)\n\t{\n\t\treturn filter_var($value, FILTER_VALIDATE_BOOLEAN);\n\t}", "public function set($value)\n\t{\n\t\treturn filter_var($value, FILTER_VALIDATE_BOOLEAN);\n\t}", "public static function bool($input = \"\"):bool {\n\n # check if email\n\t\treturn filter_var($input, FILTER_VALIDATE_BOOL) ? true : false;\n\n }", "public function isValid()\n {\n return $this->data['is_valid'];\n }", "public function isPost(): bool \r\n {\r\n return $this -> method() === 'POST' ? true : false;\r\n }", "public function getIsUserAttribute()\n {\n return $this->attributes['user_type'] == '3';\n }", "function format_bool(mixed $input): string\n{\n return $input ? 'true' : 'false';\n}", "function o_isBool($value) {\n\t\t\treturn Obj::singleton()->isBool($value);\n\t\t}", "public function getBooleanString($tf);", "public static function isGet() {\n\n if (empty(self::$_requestType))\n self::_initRequestType();\n\n return (self::$_requestType == 'GET');\n }" ]
[ "0.71778405", "0.701831", "0.7005731", "0.6821132", "0.6760427", "0.66830415", "0.6601742", "0.65724325", "0.651404", "0.65119064", "0.64777994", "0.6395705", "0.63876724", "0.63818914", "0.6362779", "0.634482", "0.63352656", "0.6324884", "0.6323044", "0.631167", "0.6303824", "0.6299966", "0.6282061", "0.6264881", "0.6264881", "0.6263005", "0.6249038", "0.62484026", "0.6236573", "0.623385", "0.62272185", "0.6224431", "0.6224054", "0.62183475", "0.6218027", "0.62111026", "0.620225", "0.6197621", "0.61974585", "0.6188173", "0.6173509", "0.61695135", "0.61527526", "0.61397684", "0.6125546", "0.6124817", "0.61184937", "0.6118332", "0.610719", "0.6105239", "0.60969657", "0.60899675", "0.607078", "0.60675216", "0.60625106", "0.6057944", "0.605541", "0.60503244", "0.60283595", "0.60176635", "0.6015982", "0.6014297", "0.60115874", "0.6001319", "0.6001319", "0.59961206", "0.598478", "0.5978287", "0.596263", "0.5949223", "0.5937096", "0.5934627", "0.593167", "0.5899153", "0.5882206", "0.5875023", "0.5873735", "0.5864575", "0.58598906", "0.58594537", "0.585136", "0.58499354", "0.5846889", "0.584389", "0.58372414", "0.58335215", "0.5830199", "0.58264285", "0.58170176", "0.5815724", "0.58107847", "0.58079994", "0.58079994", "0.5799855", "0.5799086", "0.579781", "0.57919234", "0.57899445", "0.57809633", "0.5777095", "0.5776574" ]
0.0
-1
Does the string end with the given ending?
private function endsWith($string, $ending) { $length = strlen($ending); if ($length == 0) { return true; } return (substr($string, -$length) === $ending); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ends_with($string,...$end)\n{\n if(!$string)\n return false;\n foreach( $end as $e )\n if( substr($string,strlen($string)-strlen($e)) == $e )\n return true;\n return false;\n}", "function check_str_end(string $string, string $end, int $len, $endLength): bool\n{\n return substr($string, $len - $endLength, $endLength) == $end;\n}", "function str_endsWith (string $str, string $needle): bool {\n\t$strLen = strlen($str);\n\t$needleLen = strlen($needle);\n\treturn (substr($str, $strLen - $needleLen, $needleLen) === $needle);\n}", "function string_ends_with( $haystack, $needle ) {\n\t\treturn substr($haystack, -strlen($needle))===$needle;\n\t}", "function ends_with($haystack, $needle)\n{\n\treturn substr($haystack, -strlen($needle))===$needle;\n}", "function str_endswith($string, $test) {\n $strlen = strlen($string);\n $testlen = strlen($test);\n if ($testlen > $strlen) {\n return false;\n }\n return substr_compare($string, $test, $strlen - $testlen, $testlen) === 0;\n }", "public function isLastPartOfStringReturnsFalseForNotMatchingFirstPartDataProvider() {}", "function ends_with($haystack, $needle) {\r\n $length = strlen($needle);\r\n $start = $length *-1; //negative\r\n return (substr($haystack, $start, $length) === $needle);\r\n}", "public function isLastPartOfStringReturnsTrueForMatchingFirstPartDataProvider() {}", "function ends_with($haystack, $needle) {\n\treturn $needle === substr($haystack, -strlen($needle));\n}", "public static function endsWith($string, $end)\n {\n // Needle cannot be found if needle is longer than haystack.\n if (($offset = strlen($string) - strlen($end)) >= 0) {\n return strpos($string, $end, $offset) === $offset;\n }\n\n return false;\n }", "public static function endsWith($str, $suffix) {\n\t\treturn substr($str, strlen($str) - strlen($suffix)) === $suffix;\n\t}", "function strEndsWith($haystack,$needle){\n\n if(strlen($haystack)<=strlen($needle)){\n return false;\n }\n $pos=stripos($haystack,$needle,0-strlen($needle));\n\n if($pos==(strlen($haystack)-strlen($needle))){\n return true;\n }\n return false;\n}", "function ends_iwith($string,...$end)\n{\n if(!$string)\n return false;\n $string = strtolower($string);\n foreach( $end as $e )\n if( substr($string,strlen($string)-strlen($e)) == strtolower($e) )\n return true;\n return false;\n}", "public function endsWithReturnsFalseForNotMatchingLastPartDataProvider() {}", "public function endsWith($suffix) {\n $other = new Str($suffix, $this->charset);\n\n return mb_strrpos($this->rawString, $suffix, 0, $this->charset) === ($this->length() - $other->length());\n }", "function endsBy(string $haystack, string $needle) : bool\n{\n $length = strlen($needle);\n\n return $length === 0 ||\n (substr($haystack, -$length) === $needle);\n}", "public function endsWithReturnsTrueForMatchingLastPartDataProvider() {}", "function endsWith($haystack, $needle) {\n return $needle === \"\" || strpos($haystack, $needle, strlen($haystack) - strlen($needle)) !== FALSE;\n}", "public function testTrueEndsWith()\n {\n $this->assertTrue(Str::endsWith('foo', 'o'));\n }", "public static function endsWith($haystack, $needle) {\n return (strrpos($haystack, $needle) == (strlen($haystack) - strlen(\n $needle\n )));\n }", "function endsWith($haystack, $needle) {\n\treturn $needle === \"\" || strpos($haystack, $needle, strlen($haystack) - strlen($needle)) !== FALSE;\n}", "function endsWith($haystack, $needle)\n{\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n}", "function endsWith($haystack, $needle)\n{\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n}", "function endsWith($needle, $haystack)\n{\n $needle = strrev($needle);\n $haystack = strrev($haystack);\n return (strpos($haystack, $needle) === 0);\n}", "public static function stringEndsWith($string, $suffix)\n {\n $str_len = strlen($string);\n $suffix_len = strlen($suffix);\n if ($suffix_len > $str_len) return false;\n return substr_compare($string, $suffix, $str_len - $suffix_len, $suffix_len) === 0;\n }", "public function testFalseEndsWith()\n {\n $this->assertFalse(Str::endsWith('foo', 'y'));\n }", "function endsWith($haystack, $needle) {\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n}", "function endsWith($haystack, $needle) {\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n}", "function endsWith($haystack, $needle) {\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n}", "function endsWith($haystack, $needle){\n $length = strlen($needle);\n return $length === 0 ||\n (substr($haystack, -$length) === $needle);\n }", "function endsWith($haystack, $needle) {\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false);\n}", "function endsWith($haystack, $needle) {\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false);\n}", "function endsWith($haystack, $needle) {\r\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false);\r\n}", "function endsWith($haystack, $needle) {\n\t\t$pos = strlen($haystack) - strlen($needle);\n\t\treturn (strpos($haystack, $needle) === $pos);\n\t}", "function endsWith($haystack, $needle) {\n if(!empty($haystack)) {\n return $needle === \"\" || strpos($haystack, $needle, strlen($haystack) - strlen($needle)) !== FALSE;\n }\n}", "function endsWith($haystack, $needle) {\n if(!empty($haystack)) {\n return $needle === \"\" || strpos($haystack, $needle, strlen($haystack) - strlen($needle)) !== FALSE;\n }\n}", "private function strEndsWith($string, $niddle)\n {\n return mb_substr($string, mb_strlen($string) - mb_strlen($niddle), mb_strlen($niddle)) == $niddle;\n }", "function endWith($haystack, $needle) { \n\n\t\t $length = strlen($needle); \n\t\t if($length == 0)\n\t\t { \n\t\t\t return true; \n\t\t } \n\t\t return (substr($haystack, -$length) === $needle);\n\t }", "function endsWith($haystack, $needle) {\r\n\t\treturn $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\r\n\t}", "public static function ends_with( $needle, $haystack ) {\n\t\treturn '' === $needle || substr( $haystack, -strlen( $needle ) ) === (string) $needle;\n\t}", "public static function ends_with( $haystack, $needle ) {\n\t\treturn $needle === substr( $haystack, -strlen( $needle ) );\n\t}", "function endsWith($haystack, $needle) {\n\t\t\t$needle_length = strlen($needle);\n\t\t\t$offset = strlen($haystack) - $needle_length;\n\t\t\t$length = $needle_length;\n\t\t\treturn @substr_compare($haystack, $needle, $offset, $length) === 0;\n\t\t}", "function endsWith($haystack, $needle)\r\n {\r\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\r\n }", "public static function endsWith(string $string, string $suffix, &$nonSuffix = null) : bool\n {\n $suffixLength = strlen($suffix);\n\n if ($suffixLength === 0) {\n $nonSuffix = $string;\n return true;\n }\n\n if (empty($string)) {\n $nonSuffix = '';\n return false;\n }\n\n if (substr_compare($string, $suffix, -$suffixLength, $suffixLength) !== 0) {\n $nonSuffix = $string;\n return false;\n }\n\n $nonSuffix = substr($string, 0, -$suffixLength);\n return true;\n }", "function endsWith($haystack, $needle) {\n\t\treturn $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false);\n\t}", "function endsWith($haystack, $needle) {\n // search forward starting from end minus needle length characters\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false);\n }", "public static function endsWith($str,$test) {\r\n if (! (substr( $str, -strlen( $test ) ) == $test) ) {\r\n return false;\r\n }\r\n return substr($str, 0, strlen($str) - strlen($test));\r\n }", "public function endsWithIgnoreCase($suffix) {\n $other = new Str($suffix, $this->charset);\n\n return mb_strripos($this->rawString, $suffix, 0, $this->charset) === ($this->length() - $other->length());\n }", "function endsWith($haystack, $needle) {\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false);\n }", "static function endsWith($haystack, $needle)\n {\n // search forward starting from end minus needle length characters\n return $needle === \"\" ||\n (($temp = strlen($haystack) - strlen($needle)) >= 0 &&\n strpos($haystack, $needle, $temp) !== false);\n }", "public function endsWith(string $string, string $ends_with = ''): bool\n {\n\n $length = strlen($ends_with);\n\n return $length === 0 || (substr($string, -$length) === $ends_with);\n\n }", "public static function endsWith(String $haystack, String $needle): bool {\n\t\t$length = strlen($needle);\n\t\tif ($length == 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn (substr($haystack, -$length) === $needle);\n\t}", "function ends_with($haystack, $needles)\n {\n foreach ((array)$needles as $needle) {\n if (substr($haystack, -strlen($needle)) === (string)$needle) {\n return true;\n }\n }\n return false;\n }", "function endsWith($haystack, $needle) {\n\t\t$length = strlen($needle);\n\t\tif ($length == 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn (substr($haystack, -$length) == $needle);\n\t}", "public static function endsWith($haystack, $needle)\n {\n return '' === $needle || strrpos($haystack, $needle) === strlen($haystack) - strlen($needle);\n }", "private function endWith($haystack, $needle): bool\n {\n return substr_compare($haystack, $needle, -strlen($needle)) === 0;\n }", "static function endsWith(string $s, string|array $suffixes): bool {\n foreach ((array) $suffixes as $needle) {\n if (mb_substr($s, -mb_strlen((string) $needle)) === (string) $needle) {\n return true;\n }\n }\n\n return false;\n }", "public static function endsWith(string $haystack, string $needle): bool \n {\n return substr_compare($haystack, $needle, -strlen($needle)) === 0;\n }", "public static function endsWith($input, $suffix)\n {\n self::initialize();\n\n return strlen($suffix) === 0 || substr($input, -strlen($suffix)) === $suffix;\n }", "function endsWith($str1,$str2){\n \tif(mb_substr($str1, -mb_strlen($str2)) == $str2){\n \t\treturn mb_substr($str1, 0, mb_strlen($str1)- mb_strlen($str2));\n \t} else {\n \t\treturn -1;\n \t}\n\t}", "public static function endsWith(string $value, $end, bool $ignoreCase = false): bool\n {\n if ($ignoreCase) {\n $value = mb_strtolower($value);\n }\n $end = is_array($end) ? $end : [$end];\n foreach ($end as $val) {\n if ($ignoreCase) {\n $val = mb_strtolower($val);\n }\n if (mb_substr($value, -mb_strlen($val)) == $val) {\n return true;\n }\n }\n return false;\n }", "public static function str_ends_with( $haystack, $needle ) {\n\n\t\tif ( '' === $needle ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( self::multibyte_loaded() ) {\n\n\t\t\treturn mb_substr( $haystack, -mb_strlen( $needle, self::MB_ENCODING ), null, self::MB_ENCODING ) === $needle;\n\n\t\t} else {\n\n\t\t\t$haystack = self::str_to_ascii( $haystack );\n\t\t\t$needle = self::str_to_ascii( $needle );\n\n\t\t\treturn substr( $haystack, -strlen( $needle ) ) === $needle;\n\t\t}\n\t}", "public function endsWith(self $path): bool {\n $thisStr = $this.'';\n $pathStr = $path.'';\n\n return $path->length() === 0\n || $this->length() === 0\n || strpos($thisStr, $pathStr) === strlen($thisStr) - strlen($pathStr);\n }", "public static function ends_with($haystack, $needle)\n {\n $length = strlen($needle);\n if ($length == 0)\n {\n return true;\n }\n\n return (substr($haystack, -$length) === $needle);\n }", "function str_ends_with($needle, $haystack)\n {\n return str::endsWith($needle, $haystack);\n }", "public function endsWith($needle) {\n\t\treturn ($needle === '') || (substr((string)$this, -strlen($needle)) === $needle);\n\t}", "protected function ends()\n {\n static $re_all = '/^[\\h\\v]*$/';\n static $re_nnl = '/^[\\h]*$/';\n \n if ($this->data === null)\n return true;\n \n // if $tnl (track new lines) is true: use \\h, else: use \\h\\v\n return preg_match($this->tnl ? $re_nnl : $re_all, $this->data);\n }", "public static function endsWith($haystack, $needle)\n {\n return strrpos($haystack, $needle) == strlen($haystack) - strlen($needle);\n }", "public static function endsWith($haystack, $needle) {\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n }", "public function endsWith($haystack, $needle)\n {\n return $needle === '' || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false);\n }", "public static function endsWith(string $haystack, string $needle): bool\n {\n return stristr($haystack, $needle) !== false && substr($haystack, (strlen($needle) * -1)) === $needle;\n }", "public static function endsWith(string $haystack, string $needle): bool\n\t{\n\t\t$isEight = \\version_compare(PHP_VERSION, '8.0.0') >= 0;\n\t\t$length = strlen($needle);\n\n\t\tif ($isEight)\n\t\t{\n\t\t\treturn \\str_ends_with($haystack, $needle);\n\t\t}\n\n\t\treturn !$length ? true : substr($haystack, -$length) === $needle;\n\t}", "public static function endsWith(string $haystack, string $needle): bool\n {\n return $needle === '' || substr($haystack, -strlen($needle)) === $needle;\n }", "public static function endsWith($string, $search)\n {\n if ($search == '') {\n // all strings end in nothing!\n return true;\n }\n\n $len = strlen($search);\n $test = substr($string, -1 * $len);\n\n if ($test === $search) {\n return true;\n } else {\n return false;\n }\n }", "public static function endsWith($haystack, $needle)\n {\n return $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n }", "public static function endsWith($str, $substr)\n {\n return substr($str, -strlen($substr)) == $substr;\n }", "protected static function endsWith($haystack, $needle) {\n\t\t// search forward starting from end minus needle length characters\n\t\treturn $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n\t}", "protected static function endsWith($haystack, $needle) {\n\t\t// search forward starting from end minus needle length characters\n\t\treturn $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);\n\t}", "public function endsWith( $haystack, $needle ) {\n\t\treturn $needle == substr( $haystack, strlen( $haystack ) - strlen( $needle ) );\n\t}", "private function endsWith($haystack, $needle) {\r\n\t\t\treturn $needle === \"\" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false);\r\n\t\t}", "public function endsWith($string, $substring) {\n if (empty($string) || empty($substring) || strlen($substring) > strlen($string)) return false;\n\n return strpos($string, $substring) !== false && strpos($string, $substring) == strlen($string) - strlen($substring);\n }", "public static function endsWith($haystack, $needle)\r\n {\r\n Preconditions::checkIsString($haystack);\r\n Preconditions::checkIsString($needle);\r\n if ($needle == '') return true;\r\n\r\n $needle_length = strlen($needle);\r\n if ($needle_length > strlen($haystack)) {\r\n return false;\r\n }\r\n return substr_compare($haystack, $needle, -$needle_length, $needle_length) === 0;\r\n }", "static function stringEndsWith($suffix)\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::stringEndsWith', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public static function endsWith($value, $suffix)\n {\n return ($suffix == substr($value, -strlen($suffix))) ? true : false;\n }", "function endsWith($haystack, $needle) // Colorize: green\n { // Colorize: green\n $length = strlen($needle); // Colorize: green\n // Colorize: green\n if ($length == 0) // Colorize: green\n { // Colorize: green\n return true; // Colorize: green\n } // Colorize: green\n // Colorize: green\n return substr($haystack, -$length) === $needle; // Colorize: green\n }", "function str_iends_with($needle, $haystack)\n {\n return str::endsWithIgnoreCase($needle, $haystack);\n }", "public static function stringEndsWith($haystack, $needles)\n {\n foreach ((array)$needles as $needle) {\n if ((string)$needle === mb_substr($haystack, -self::stringLength($needle))) {\n return true;\n }\n }\n return false;\n }", "abstract protected function isEndToken(string $token) : bool;", "function ends_with($haystack, $needles)\n {\n return Str::endsWith($haystack, $needles);\n }", "public static function endsWith(string $subject, string $value): bool\n\t{\n\t\tif (function_exists(\"str_ends_with\")) {\n\t\t\treturn str_ends_with($subject, $value);\n\t\t}\n\t\treturn $value === \"\" || (($temp = mb_strlen($subject) - mb_strlen($value)) >= 0 && strpos($subject, $value, $temp) !== false);\n\t}", "public function endsWith($element) {\n return $this->is(new NotPossible('ends with anything'));\n }", "public function endsWith($haystack, $needle)\n {\n return $needle === '' || substr($haystack, -strlen($needle)) === $needle;\n }", "static function assertStringEndsWith($suffix, $string, $message = '')\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::assertStringEndsWith', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function endsWith ($haystack, $needle)\n {\n $length = strlen($needle);\n if ($length === 0) {\n return true;\n }\n return (substr($haystack, -$length) === $needle);\n }", "public static function endsWith($str, $needle, $caseInvariant = true)\n {\n $match = substr($str, strlen($str) - strlen($needle));\n return self::strContains($match, $needle, $caseInvariant);\n }", "public static function endsWith($haystack, $needle) {\n $length = strlen($needle);\n if ($length == 0) {\n return true;\n }\n\n return substr($haystack, -$length) === $needle;\n }", "public static function endsWith($haystack, $needle)\n {\n $length = strlen($needle);\n if (!$length) {\n return true;\n }\n return substr($haystack, -$length) === $needle;\n }", "public static function endsWith($needle, $haystack)\n {\n return substr($haystack, -strlen($needle)) == $needle;\n }", "function _EndsWithNewLine($data=null) \r\n{ \r\n$data = strval($data); //** ensure that data is a string. \r\nif(strlen($data) == 0) //** no date given to test. \r\nreturn false; //** does not end with newline. \r\n\r\n//** get the position of the last newline character. If the value returned \r\n//** is not numeric it is a boolean, indicating no match. Considered to end \r\n//** with newline if it ends with either a '\\n' or '\\r' character. \r\n\r\n$creturnpos = strrpos($data, \"\\r\"); //** position of '\\n'. \r\n$newlinepos = strrpos($data, \"\\n\"); //** position of '\\r'. \r\n\r\nreturn (is_int($newlinepos) || is_int($creturnpos)); \r\n}" ]
[ "0.8075019", "0.79937583", "0.783031", "0.77522296", "0.77446014", "0.77412206", "0.7707136", "0.7633017", "0.7626689", "0.7624749", "0.7588783", "0.7531934", "0.7489809", "0.74896574", "0.74605316", "0.73864275", "0.7373679", "0.73714787", "0.7369942", "0.7367351", "0.72840846", "0.72799677", "0.72737026", "0.72737026", "0.72719485", "0.7268855", "0.724449", "0.72260475", "0.72260475", "0.72260475", "0.7203312", "0.7199944", "0.7199944", "0.719764", "0.71334165", "0.71199155", "0.71199155", "0.7105969", "0.70626915", "0.70563114", "0.70517445", "0.70352125", "0.7029684", "0.70108426", "0.7005628", "0.7000007", "0.69943726", "0.6989642", "0.69879115", "0.6954042", "0.69359195", "0.6934935", "0.69246763", "0.68951195", "0.68869954", "0.6874723", "0.68497974", "0.6842458", "0.68177116", "0.6799974", "0.67895937", "0.67828256", "0.6760085", "0.6754936", "0.67479193", "0.6727702", "0.67145824", "0.6704597", "0.6702408", "0.6698471", "0.66974896", "0.6695967", "0.6693134", "0.66903645", "0.668584", "0.6679217", "0.6670775", "0.66551065", "0.66551065", "0.665067", "0.663527", "0.6633986", "0.6632345", "0.65943813", "0.65509766", "0.65497565", "0.6528385", "0.65178406", "0.65070933", "0.64897144", "0.648424", "0.6471996", "0.6468485", "0.6449642", "0.6403463", "0.6403208", "0.63942754", "0.63924265", "0.63844585", "0.6346071" ]
0.8063734
1
Returns whether a configuration object exists.
public function exists($name);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasConfig();", "public function hasConfig() {\n\t\treturn (bool)@file_exists($this->fullModulePath.'/config.ini');\n\t}", "public function has_config() {\n return true;\n }", "public function has_config() {\n return true;\n }", "public function has_configuration()\n {\n return true;\n }", "public function has_configuration()\n {\n return true;\n }", "public function exists($key)\r\n {\r\n return isset($this->config[$key]);\r\n }", "public function has_config() {\n return false;\n }", "public function has_config() {\n return false;\n }", "public function hasConfig() {\n return $this->hasConfig;\n }", "function has_configuration() {\n\t\treturn true;\n\t}", "public function checkIfEssentialConfigurationExists() {}", "function has_config() {\n return true;\n }", "public function exists($name)\n {\n return array_key_exists($name, $this->config);\n }", "public static function has($key)\n {\n if (isset(static::$cache[$key])) return true;\n\n $config = DBConfig::where('_key', '=', $key)->first();\n\n if (is_null($config)) return false;\n else return true;\n }", "public static function has($name)\n {\n return array_key_exists($name, self::$config);\n }", "public function exists(): bool {\n return property_exists($this, 'exists') && $this->exists;\n }", "public function has($key)\n {\n return array_key_exists($key, $this->config);\n }", "public function has($key)\n {\n return array_key_exists($key, $this->config);\n }", "public function has($key)\n {\n if(array_key_exists($key,$this->config_arr))\n return true;\n else\n return false;\n }", "public function hasConfig(string $key): bool;", "public function exists()\n {\n return true;\n }", "public function exists() {\n\t\ttry {\n\t\t\t$this->load();\n\t\t\treturn true;\n\t\t} catch ( \\Exception $e ) {\n\t\t\treturn false;\n\t\t}\n\t}", "public function hasConfig($key);", "protected function exists($name) {\n return $this->configuration->exists($name);\n }", "public function exists()\n\t{\n\t\t// If we don't have a configuration file for the repository it doesn't exist.\n\t\treturn file_exists($this->_root . '/.git/config');\n\t}", "function exists() {\n\t\tif ($this->exists) return true;\n\t\treturn false;\n\t}", "public function isExists()\n\t{\n\t\treturn $this->storage->isExists() && $this->dictionary->isExists();\n\t}", "public static function config_file_exists() {\n // Allow for late static binding by using static.\n $configfilepath = static::get_config_file_path();\n\n // Invalidate opcode php cache, so we get correct status of file.\n core_component::invalidate_opcode_php_cache($configfilepath);\n return file_exists($configfilepath);\n }", "public static function has($key)\n {\n return isset(self::$config[$key]);\n }", "public function exists($key) {\n\t\treturn array_key_exists($key, $this -> settings);\n\t}", "public function has($configProperty) {\n\t\treturn isset($this->{$configProperty}) && $this->{$configProperty} !== null;\n\t}", "final public function hasConfig($key = null)\n {\n $config = $this->getConfig();\n\n if (is_null($key)) {\n return !empty($config);\n } else {\n return array_key_exists($key, $config);\n }\n }", "public function has ( $name ) {\n\t\treturn isset($this->config['name']);\n\t}", "public function exists()\n {\n return false;\n }", "public function exists(): bool;", "public function exists(): bool;", "public function exists(): bool;", "public function exists()\n\t{\n\t\treturn $this->get('fullPath') && file_exists($this->get('fullPath'));\n\t}", "public function hasConfig($key)\n {\n if ( null === $key ) {\n return false;\n }\n\n $this->validateConfigKey($key);\n $configurator = $this->getConfigurator();\n\n return isset($configurator[$key]);\n }", "public function configFileExists() {\n $_fileName = \\Config::get('fontello::config.file');\n $_folderName = \\Config::get('fontello::config.folder');\n if (\\File::exists($_folderName . $_fileName)) {\n $this->_configFile = $_folderName . $_fileName;\n return true;\n }\n return false;\n }", "public function isConfigured(): bool\n {\n foreach ($this->dbal->getDatabases() as $db) {\n if (!$db->hasTable($this->config->getTable())) {\n return false;\n }\n }\n\n return true;\n }", "public function exists()\n\t\t{\n\t\t\t$path = $this->get_path();\n\n\t\t\treturn $path && file_exists($path);\n\t\t}", "public function offsetExists($offset)\n {\n return $this->configuration_object->has($offset);\n }", "public function has($key){\n return (array_key_exists($key,$this->settings));\n }", "public function hasConfig($key) {\n return $this->getConfigAugment()->has($key);\n }", "public function hasConfigLoader(): bool;", "public function exists() {}", "function has_altis_config() : bool {\n\tif ( ! function_exists( 'Altis\\\\get_config' ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! isset( Altis\\get_config()['hm-juicer'] ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "public function exists() {\n\t\treturn $this->_exists;\n\t}", "public function exists();", "public function exists();", "public function exists();", "public function has($configKey, $key);", "public function has(string $name):bool\n {\n /**\n * @var ConfigModel $model\n */\n\n $found = $this->cache->has($name);\n\n if (!$found) {\n $model = $this->loadOne($name);\n\n $found = false !== $model;\n if ($found) {\n $this->cache->set($name, $model);\n }\n }\n\n return $found;\n }", "public function exists(){\n\n\t\treturn (!empty($this->_data)) ? true : false;\n\n\t}", "public function isExists(){\n\t\treturn file_exists($this->getFullName());\n\t}", "public function exist()\n {\n return $this->_info && app()->getModule($this->_info['name']) ? TRUE : FALSE;\n }", "public function plugin_is_configured() {\n\t\treturn isset( $this->settings->client_id, $this->settings->base_uri ) && $this->settings->client_id && $this->settings->base_uri;\n\t}", "public static function isConfigured()\n {\n return !(bool) (empty(self::applicationId()) || empty(self::apiKey()));\n }", "public function exists(): bool\n {\n if ($this->shouldEmulateExecution()) {\n return false;\n }\n\n return $this->one() !== null;\n }", "public function exists()\n {\n return ($this->id) ? true : false;\n }", "public function hasConfig($package);", "protected function hasConfig(): bool\n {\n if (file_exists($this->laravel->basePath('.php_cs'))) {\n return true;\n }\n\n return file_exists($this->laravel->basePath('.php_cs.dist'));\n }", "function exists()\n {\n return false;\n }", "public function exists()\n {\n return $this->exists;\n }", "function exists() {\n \n return !empty($this->cache);\n \n }", "public function exists()\n {\n return file_exists($this->path);\n }", "public function Exists();", "public function settingExists($key) {\n return isset($this->options[$key]);\n }", "public function has(string $name): bool\n {\n try {\n $result = $this->configCommand($name);\n } catch (RuntimeException $exception) {\n return false;\n }\n\n return $result->isSuccessful();\n }", "public function exists() : bool\n\t{\n\t\treturn (file_exists($this->path));\n\t}", "public function exists()\n {\n }", "public function exists()\n {\n }", "public function exists($attribute){\n $name = $attribute;\n if ($attribute instanceof ConfigurationAttribute){\n $name = $attribute->getName();\n }\n\n return $this->getAttribute($name) != null;\n }", "public function exists()\r\n {\r\n }", "public function has($name)\n {\n return $this->setting->has($name);\n }", "public function exists() {\n\t\treturn !is_null($this->id);\n\t}", "public function exists()\n {\n return file_exists($this->getPath());\n }", "public function exists() {\n\n return file_exists($this->path);\n }", "private function _configurationExists($input) {\n\t\t$check = $this->db->queryFetchSingle(\"SELECT * FROM \"._WE_CREDITSYS_.\" WHERE config_id = ?\", array($input));\n\t\tif($check) return true;\n\t\treturn false;\n\t}", "public function exist($key) {\n return isset($this->objects[$key]);\n }", "public function offsetExists($offset) {\n\t\treturn array_key_exists($offset, $this->config);\n\t}", "public function exists(string $object) : bool\n {\n return !empty($this->registry) && isset($this->registry[$object]);\n }", "public function exists($key)\n\t{\n\t\treturn isset($this->_object[$key]);\n\t}", "public function exists() {\n\t\t$exists = (bool)$this->conf['GROUPS'];\n\n\t\treturn $exists;\n\t}", "public function hasConfigValue(string $name): bool\n {\n return isset($this->config[$name]);\n }", "public function isExist() {\n\t\tif (!empty($this->enCryptKey) && !empty($this->deCryptKey) && !empty($this->certKey)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private function _loadConfig() {\n\t\t$this->_config = $this->_call('configuration', '');\n\n\t\treturn ! empty($this->_config);\n\t}", "public function hasConfig($package)\n {\n if (!$this->_config)\n $this->_config = $this->app->config->getConfig(\n 'assets', false, true\n );\n return isset($this->_config[$package]);\n }", "protected function isConfigured()\n {\n $skip = Tools::getValue('skip');\n if ($skip) {\n Configuration::updateValue('DF_ENABLE_HASH', 0);\n Configuration::updateValue('DF_ENABLED_V9', true);\n }\n $sql = 'SELECT id_configuration FROM ' . _DB_PREFIX_ . 'configuration WHERE name = \\'DF_ENABLE_HASH\\'';\n\n return Db::getInstance()->getValue($sql);\n }", "public function templateExists(): bool\n {\n return isset($this->templatePath);\n }", "public function exists() {\n return $this->shareData !== false;\n }", "public function exists(){\n\t\treturn ($this->count() > 0);\n\t}", "public function exists()\n {\n return ($this->conversation !== null);\n }", "public function testConfigExists() {\n if (isset($this->app->config) && sizeof($this->app->config) > 0) {\n $this->pass(\"The configuration file has been loaded.\");\n }\n else {\n $this->fail(\"The configuration file was not loaded or is empty.\");\n }\n }", "public function exists()\n {\n return $this->count() > 0;\n }", "public function exists()\n {\n return !empty($this->data);\n }", "private function get_is_configured(): bool\n\t{\n\t\treturn $this->status >= self::STATUS_CONFIGURED;\n\t}", "public function configFileExists(string $fileName): bool;", "public function exists(): bool\n {\n return file_exists($this->path);\n }" ]
[ "0.77736974", "0.773603", "0.756169", "0.756169", "0.73932964", "0.73932964", "0.73191", "0.7289112", "0.7289112", "0.72641015", "0.7234415", "0.7200637", "0.71567684", "0.7116742", "0.71004933", "0.70732397", "0.705539", "0.70530415", "0.70530415", "0.7039961", "0.7038368", "0.7025615", "0.7024177", "0.7021139", "0.69975406", "0.69829", "0.69766426", "0.69539297", "0.69371164", "0.68906295", "0.6876565", "0.68178964", "0.68114513", "0.6790037", "0.67733276", "0.6723501", "0.6723501", "0.6723501", "0.6722772", "0.6720466", "0.6716958", "0.6710177", "0.6695731", "0.6671383", "0.6648654", "0.66238177", "0.6617912", "0.6617838", "0.6580133", "0.6573667", "0.656183", "0.656183", "0.656183", "0.65596354", "0.6526145", "0.65232927", "0.65040916", "0.6497147", "0.6490567", "0.6489083", "0.64643985", "0.6447848", "0.644033", "0.64360243", "0.6432434", "0.6425371", "0.6403346", "0.6402896", "0.63958937", "0.6392706", "0.6388099", "0.6386731", "0.6381207", "0.6380133", "0.6368491", "0.6365762", "0.635651", "0.6355184", "0.63492537", "0.6347539", "0.6346559", "0.6342721", "0.634264", "0.63265955", "0.63252985", "0.63189596", "0.6315834", "0.6307242", "0.63045645", "0.63021344", "0.63016033", "0.6300188", "0.6294831", "0.62885374", "0.62722814", "0.62674046", "0.6265397", "0.62616366", "0.6254699", "0.6245793", "0.62420195" ]
0.0
-1
Reads configuration data from the storage.
public function read($name);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function readConfigurationValues();", "public static function read()\n {\n return self::$config;\n }", "public function readConfig() {\n if ( file_exists( $this->path . '/config/config.php' ) ) {\n require_once $this->path . '/config/config.php';\n }\n }", "public function load()\n\t{\n\t\tif (file_exists(self::$configPath))\n\t\t{\n\t\t\t$this->config = json_decode(file_get_contents(self::$configPath), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->config = array();\n\t\t}\n\t}", "public static function load()\n {\n $entries = Configuration::get();\n \n foreach ($entries as $entry) {\n self::$config[$entry->id] = unserialize($entry->value);\n }\n }", "function read()\n\t{\n\t\t$content = $this->storage->read();\n\t\t$data = array();\n\t\tforeach($content['data'] as $key=>$value) {\n\t\t\t$storage = new \\Zentric\\Storage(array(\n\t\t\t\t'key' => $key\n\t\t\t\t, 'folder' => STORAGE\n\t\t\t\t, 'driver' => 'Array'\t\t\t\n\t\t\t));\t\t\t\n\t\t\t$data[] = $storage->read();\t\t\t \n\t\t}\n\t\treturn $data;\n\t}", "private static function getConfig() {\n\n\t\t$pathRoot = $_SERVER['DOCUMENT_ROOT'].substr($_SERVER['PHP_SELF'],0, strpos($_SERVER['PHP_SELF'],\"/\",1)).\"/config/\";\n\n\t\t$jsonConfig = file_get_contents($pathRoot.'config.json');\n\t\tself::$arrayConfig = json_decode($jsonConfig);\n\t}", "private static function readConfig()\n {\n $handler = self::getHandler();\n if (null == $handler->arrConfigGlobal && null == $handler->arrConfigLocal && null == $handler->arrConfigSecure) {\n include dirname(__FILE__) . '/../../config/default.php';\n\n $handler->arrConfigLocal = $APPCONFIG;\n\n $db = Base_Database::getConnection();\n try {\n // This is just for things like API keys, password salts etc.\n // If we have, at a later point, a function to export the database\n // en masse, then we can encrypt all the output from the secureconfig\n // table. It shouldn't overide the global or local config settings\n $sql = \"SELECT * FROM secureconfig\";\n $query = $db->prepare($sql);\n $query->execute();\n $handler->arrConfigSecure = $query->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP);\n\n // This is just the regular global configuration settings.\n $sql = \"SELECT * FROM config\";\n $query = $db->prepare($sql);\n $query->execute();\n $handler->arrConfigGlobal = $query->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP);\n foreach ($handler->arrConfigGlobal as $key => $value) {\n $handler->arrConfig[$key] = array('isLocal' => false, 'isOverriden' => false, 'value' => $value[0]);\n }\n \n // This is the configuration settings local to this individual machine.\n foreach ($handler->arrConfigLocal as $key => $value) {\n if (isset($handler->arrConfig[$key])) {\n $handler->arrConfig[$key] = array('isLocal' => true, 'isOverriden' => true, 'value' => $value);\n } else {\n $handler->arrConfig[$key] = array('isLocal' => true, 'isOverriden' => false, 'value' => $value);\n }\n }\n } catch(Exception $e) {\n error_log($e);\n die();\n }\n }\n }", "public function load(): ConfigStoreInterface;", "public function loadConfig() {\n return (object)$this->config;\n }", "public function readConfigFile(): void\n {\n $configPath = __DIR__ . '/../../.config';\n if (!file_exists($configPath)) {\n echo \"Could not find .config\\n\";\n die;\n }\n $lines = preg_split('/[\\r\\n]+/', file_get_contents($configPath));\n foreach ($lines as $line) {\n if (empty($line)) {\n continue;\n }\n if (substr($line, 0, 1) == '#') {\n continue;\n }\n $kv = preg_split(\"/=/\", $line);\n $key = $kv[0];\n $value = $kv[1];\n $this->data[$key] = $value;\n }\n }", "private function readConfig(){\n\n\t\t$this->_ini_array = parse_ini_file(CONFIG.'system.ini');\n\n\t\t$this->_host =\t$this->_ini_array['db_host'];\n\t\t$this->_username = $this->_ini_array['db_username'];\n\t\t$this->_password = $this->_ini_array['db_password'];\n\t\t$this->_database = $this->_ini_array['db_database'];\n\t\n\t\t$this->_log_enabled=$this->_ini_array['log_enabled'];\n\t\t$this->_log_level=$this->_ini_array['log_level'];\n\t\t$this->_log_file_path=$this->_ini_array['log_path'];\n\t\n\n\t\t$this->_lang_default=$this->_ini_array['lang_default'];\n\n\t}", "function getConfigProperties() {\n\tglobal $ethereum_reader_Config;\n\t\n\tif (isset($ethereum_reader_Config))\n\t\treturn $ethereum_reader_Config;\n\t\n\t// initialization of array\n\t$ethereum_reader_Config = array();\n\t\n\t$jsonfile = dirname(__FILE__).'/../settings/config.json';\n\t\n\tif (!file_exists($jsonfile)) {\n\t\treturn $ethereum_reader_Config;\n\t\t\n\t}\n\t\t\t\n\t// read jsonfile\n\t$jsonstring = file_get_contents($jsonfile);\n\n\t$ethereum_reader_Config = json_decode($jsonstring, true);\n\n\treturn $ethereum_reader_Config ;\n}", "protected function getFromStorage()\n {\n try {\n if ($data = $this->parseJson(file_get_contents($this->getStoragePath()))) {\n return $data;\n }\n } catch (ErrorException $e) {\n // File does not exist or could not be opened.\n }\n\n // Fall back to the list provided by the package.\n return $this->parseJson(file_get_contents(__DIR__.'/../domains.json'));\n }", "public static function getConfig() {\n\t\tif (self::$temp_config !== null) {\n\t\t\treturn self::$temp_config;\n\t\t}\n\n\t\t$config_file = self::getConfigFile();\n\t\treturn (!file_exists($config_file)) ? array() : json_decode(file_get_contents($config_file), true);\n\t}", "public function readConfigAction()\n {\n $this->getResponse()->setBody(self::getHelper()->readconfig());\n\n }", "public function read(){\n\t\n\t\tif (!$this->cfg_loaded){\n\t\t\t$this->load();\n\t\t}\n\t\t\n\t\tif ($this->cfg_loaded){\n\t\t\t\n\t\t\t$this->getLogger()->debug(\"Starting reading XML configuration\");\n\t\t\t$config = $this->cfg->getElementsByTagName(\"configuration\");\n\t\t\t\t\n\t\t\tif ($config->length == 1){\n\t\t\t\n\t\t\t\t// first read debug configuration\n\t\t\t\t$this->cfg_debug->read_debug($config->item(0)->getElementsByTagName(\"debug\")->item(0));\n\t\t\t\t\n\t\t\t\t// $this->read_sensors($config->item(0));\n\t\t\t\t$this->cfg_sensors->read_sensors($config->item(0));\n\t\t\t\t\n\t\t\t\t$this->cfg_actions->read_actions($config->item(0)->getElementsByTagName(\"actions\")->item(0));\n\t\t\t\t$this->cfg_gpio->read_gpios($config->item(0)->getElementsByTagName(\"gpios\")->item(0));\n\t\t\t\t$this->cfg_stats->read_stats($config->item(0)->getElementsByTagName(\"statistics\")->item(0));\n\t\t\t\t\n\t\t\t\t$this->cfg_modes->read_modes($config->item(0)->getElementsByTagName(\"modes\")->item(0));\n\t\t\t\t$this->cfg_progs->read_programs($config->item(0)->getElementsByTagName(\"programs\")->item(0));\n\t\t\t} else {\n\t\t\t\t$this->getLogger()->error(\"section <configuration> not found. Can't read configuration.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "function load_config() {\n\t\t$conf_file = @file_get_contents( LDAP_LOGIN_PATH.'data.dat' );\n\t\tif ($conf_file!==false)\n\t\t{\n\t\t\t$this->config = unserialize($conf_file);\n\t\t}\n\t}", "private function read_config() {\n\t\t$sections = parse_ini_file($this->config['conf'], true);\n\t\tforeach ($sections as $sectionk => $sectionv) {\n\t\t\tforeach ($sectionv as $key => $var)\n\t\t\t\t$this->config[$sectionk . '.' . $key] = $var;\n\t\t}\n\t}", "static function loadConfig() {\n\t\t$config = self::file($_SERVER[\"DOCUMENT_ROOT\"] . \"/../config.json\");\n\t\tif (!is_null($config))\n\t\t\tself::$config = json_decode($config);\n\t}", "public function refreshConfig()\n {\n $this->_data = $this->_reader->read();\n $this->merge($this->_dbReader->get());\n }", "abstract protected function loadConfig();", "public static function readAll()\n {\n $settingsObj = self::getInstance();\n if (isset($settingsObj->data)) {\n return $settingsObj->data;\n }\n return false;\n }", "function loadConfig(){\n $file = file_get_contents($this->config_dir, FILE_USE_INCLUDE_PATH);\n $urls = json_decode($file,TRUE);\n //not the best way but error handling\n if ($file == NULL || $urls == NUll ){\n print(\"Error reading the config file or it it is empty\");\n }\n else{\n $this->config_data = $urls;\n\n }\n }", "private function loadConfig() {\n if (file_exists($this->_data['cache_config_file'])) {\n $data = unserialize(file_get_contents($this->_data['cache_config_file']));\n \n self::$_configInstance = (object)$data; //instance of stdClass with all the properties public\n //$this->_data = (array)$data; \n return true;\n } \n return false;\n }", "public function readConfig() {\n \t// Read the current configuration file\n \t$this->setConfig(parse_ini_file($this->getConfigFile(), true));\n \t// Return instance \n \treturn $this;\n }", "protected function loadConfig() {\n $json = new JSON();\n $viewConfig = $json->readFile(__SITE_PATH . \"\\\\config\\\\view.json\");\n $this->meta_info = $viewConfig['meta'];\n $this->js_files = $viewConfig['javascript'];\n $this->css_files = $viewConfig['css'];\n }", "public function getConfig() {\n if ($this->config) {\n return $this->config;\n }\n \n $this->config = $this->parse($this->configFile);\n return $this->config;\n }", "public function loadConfig()\n {\n $this->setGlobalStoreOfShopNumber($this->getShopNumber());\n $this->loadArray($this->toArray());\n $this->setExportTmpAndLogSettings();\n }", "private function read(): array|false {\n $security = \"<?php header(\\\"Status: 403\\\"); exit(\\\"Access denied.\\\"); ?>\\n\";\n $contents = @file_get_contents(INCLUDES_DIR.DIR.\"config.json.php\");\n\n if ($contents === false)\n return false;\n\n $json = json_get(str_replace($security, \"\", $contents), true);\n\n if (!is_array($json))\n return false;\n\n return $this->data = $json;\n }", "public static function load()\n {\n $configFile = self::getConfigFilePath();\n\n if (!is_file($configFile)) {\n self::save([]);\n }\n\n $config = require($configFile);\n\n if (!is_array($config))\n return array();\n\n return $config;\n }", "public static function getConfigData()\n\t\t{\n\t\t\t$sConfigFile = self::getConfigFile();\n\n\t\t\t// Detect DB settings via configuration file\n\t\t\tif(is_file($sConfigFile))\n\t\t\t{\n\t\t\t\treturn file_get_contents($sConfigFile);\n\t\t\t}\n\n\t\t\treturn '';\n\t\t}", "public function load()\n {\n $ini = APP_DIR.'config/'.ENVIRONMENT.'.ini';\n\n if(!file_exists($ini))\n Clockwork::throwError('Could not load config ('.$ini.')');\n\n $this->data = parse_ini_file($ini, true);\n \n $this->setValues();\n }", "function get_config() {\n //$memcached = new \\Memcached();\n //$memcached->addServer(MEMCACHED_HOST, MEMCACHED_PORT);\n \n if (false) {//$memcached->get('lc_config') && MEMCACHED_ENABLED) {\n //return $memcached->get('lc_config');\n }\n else { \n // Load our master config\n $master_config = parse_ini_file(LC_HOME . LC_MASTER_CONFIG, True);\n \n // Let's get the local config based on the resource type (an action parameter)\n if (!empty($this->http_request->action_params['resource_type'])){\n $resource_type = $this->http_request->action_params['resource_type'];\n if (!empty($resource_type) && !in_array($resource_type, array_keys($master_config['resource_types']))) {\n throw new \\Exception('Incorrect resource type specified' .\n ' --> ' . $resource_type . ' <-- See ' .\n $master_config['doc']['lc_doc_loc'] . ' for documention on resource types.');\n }\n }\n \n $resource_config = parse_ini_file(LC_HOME . $master_config['resource_types'][$resource_type]);\n\n // Since we turn all sections in our master config into arrays (this \n // way we can validate keys easily), we need to flatten it back down\n $flattened_master_config = array();\n foreach ($master_config as $top_level_element) {\n foreach ($top_level_element as $key => $value) {\n $flattened_master_config[$key] = $value;\n }\n }\n\n $merged = array_merge($flattened_master_config, $resource_config);\n //$memcached->set('lc_config', $merged);\n return $merged;\n }\n }", "protected function read() {\n\t\t$fileContent = trim(file_get_contents($this->filepath));\n\t\t$pattern = '/\\$([^=]+)=([^;]+);/';\n\t\t$matches = null;\n\t\t$matchesFound = preg_match_all($pattern, $fileContent, $matches);\n\t\t$configContents = array();\n\t\tif ($matchesFound) {\n\t\t\t$configContents = $matches[0];\n\t\t}\n\t\t$this->rows = array();\n\t\tforeach ($configContents as $configLine) {\n\t\t\t$this->rows[] = new ConfigFileRow($configLine, $this);\n\t\t}\n\t\t$this->rowIndex = -1;\n\t\tunset($fileContent);\n\t}", "protected function getConfig() {\n\t\t\t$handle = fopen($this->configFile, 'r');\n\t\t\t$contents = fread($handle, filesize($this->configFile));\n\t\t\tfclose($handle);\n\n\t\t\t$this->config = json_decode($contents);\n\n\t\t\tforeach ($this->configMap as $key => $value) {\n\t\t\t\tif ($handle && !array_key_exists($key, $this->config)) {\n\t\t\t\t\tthrow new Exception('Missing key: ' . $key);\n\t\t\t\t}\n\n\t\t\t\tif (empty($this->config->{$key})) {\n\t\t\t\t\t/*\n\t\t\t\t\t\tIf the config isn't found we'll check if an environment\n\t\t\t\t\t\tvariable exists, this is largely Heroku specific, and offers\n\t\t\t\t\t\tus a nice way to avoid deploying any config.\n\n\t\t\t\t\t\tIf time were no issue this handling would be more loosely\n\t\t\t\t\t\tcoupled to this class.\n\t\t\t\t\t*/\n\t\t\t\t\t$env_value = getenv($value['env']);\n\n\t\t\t\t\tif (empty($env_value)) {\n\t\t\t\t\t\tthrow new Exception('Missing value: ' . $key);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->{$value['prop']} = !empty($env_value) ? $env_value : $this->config->{$key};\n\t\t\t}\n\n\t\t\treturn $this;\n\t\t}", "function getConfigObj(){\n $fh = fopen($GLOBALS['configFileName'],'r')\n\t\t\tor die(\"Unable to open file!\");\n\n $configJson = fread($fh, filesize($GLOBALS['configFileName']));\n fclose($fh);\n // print($configJson);\n // $configObj = json_decode($configJson);\n // var_dump($configObj); //->{'devices'}[0]->{'name'};\n return json_decode($configJson);\n }", "public function read() : void\n {\n $ilDB = $this->db;\n\n $query = \"SELECT * FROM crn_sts_mtr_settings\";\n $result = $ilDB->query($query);\n\n while ($row = $ilDB->fetchAssoc($result)) {\n $this->setting[$row[\"keyword\"]] = $row[\"value\"];\n }\n }", "public function getConfigData() {\n\t\treturn array(\n\t\t\t'storageType' => StorageFactory::TYPE_DUMMY,\n\t\t\t'debuggerDisabled' => $this->debuggerDisabled,\n\t\t);\n\t}", "private static function loadConfigurationFile()\n {\n if(self::$ConfigurationData == null)\n {\n $file_contents = file_get_contents(CONFIGURATION_FILE);\n $json_data = json_decode($file_contents, true);\n\n if(empty($json_data))\n {\n throw new Exception(\"Invalid JSON data in the configuration file\");\n }\n\n self::$ConfigurationData = $json_data;\n }\n }", "protected function loadFormData()\n {\n // Check the session for previously entered form data.\n $app = JFactory::getApplication();\n $data = $app->getUserState('com_jtransport.config.data', array());\n\n if (empty($data))\n {\n $data = $this->getItem();\n }\n\n return $data;\n }", "private function LoadConfigFile(){\n $a = file_get_contents($this->RootDIR . 'config/main.json');\n $this->Config = json_decode($a, true);\n }", "protected function _get_config()\n {\n $config = Spyc::YAMLLoad(\"config.yaml\");\n return $config;\n }", "public function loadConfig($data);", "function getConfigContents() {\n\t\treturn $this->configContents;\n\t}", "public function readAndCache() {\n\n $config = $this->read(false);\n $tempPath = App::tempPath();\n \\jFile::createDir($tempPath, $config->chmodDir);\n $filename = $tempPath.str_replace('/', '~', $this->configFileName);\n\n if (BYTECODE_CACHE_EXISTS) {\n $filename .= '.conf.php';\n if ($f = @fopen($filename, 'wb')) {\n fwrite($f, '<?php $config = '.var_export(get_object_vars($config),true).\";\\n?>\");\n fclose($f);\n chmod($filename, $config->chmodFile);\n }\n else {\n throw new Exception('Error while writing configuration cache file -- '.$filename);\n }\n }\n else {\n IniFileMgr::write(get_object_vars($config), $filename.'.resultini.php', \";<?php die('');?>\\n\", $config->chmodFile);\n }\n return $config;\n }", "private function readLogConfig(){\n\n\t\t$_config = ConfigUtil::getInstance();\n\n\t\t$this->_log_enabled = $_config->isLogEnabled();\n\t\t$this->_log_level = $_config->getLogLevel();\n\t\t$this->_log_file_path = $_config->getLogFilePath();\n\t\n\t}", "private function readAppData()\n {\n $fileName = \"{$this->storeDirectory}/appData.json\";\n if (file_exists($fileName)) {\n $data = json_decode(file_get_contents($fileName), true);\n if (isset($data['default-counter'])) {\n $this->defaultCounter = $data['default-counter'];\n }\n }\n }", "function Event_Config_Read()\n {\n if (empty($this->Event_Config))\n {\n $this->Event_Config=$this->ReadPHPArray($this->Event_Config_File());\n $groups=$this->Dir_Files($this->Event_Config_Path.\"/Config\",'\\.php$');\n $this->Event_Config_Group=$this->Event_Config[ \"Config_Group_Default\" ];\n \n }\n }", "protected function getConfig($path = '') {\n if ($path == '') {\n $path = getenv('HOME') . '/.podcastr.json';\n }\n\n if ($this->output->isVerbose()) {\n $this->output->writeln(\"<comment> - Loading config from ~/.podcastr.json</comment>\");\n }\n $config = file_get_contents($path);\n $config = json_decode($config, TRUE);\n if (is_null($config)) {\n $this->output->writeln(\"<error>Config is invalid JSON or cannot be read.</error>\");\n exit(1);\n }\n\n return $config;\n }", "public function loadConfig()\n {\n return parse_ini_file(\n DIR_ROOT . '/config.ini', False\n );\n }", "public function getDataConfig()\n {\n return $this->dataConfig;\n }", "public function readCache()\n {\n return $this->readFile()->unpackData();\n }", "public function load_config() {\n if (!isset($this->config)) {\n $name = $this->get_name();\n $this->config = get_config(\"local_$name\");\n }\n }", "private function loadConfigRepository(): void\n {\n // Check Config\n if (\\count($this->configs) > 0) {\n return;\n }\n\n // Load Cache|Repository\n $store = $this->configRepo->findAll();\n foreach ($store as $config) {\n if (count($config->getValue()) === 1) {\n $val = $config->getValue()[0];\n\n if ('true' === $val) {\n $val = true;\n } elseif ('false' === $val) {\n $val = false;\n }\n } else {\n $val = $config->getValue();\n }\n\n $this->configs[$config->getName()] = $val;\n }\n }", "function loadFromDatabase(){\n global $DB;\n $resource = $DB->config->get();\n $list = array();\n while($row = $DB->fetchAssoc($resource))\n {\n if(!isset($this->sections[$row['section']])) $this->sections[$row['section']] = new ConfigSection($row['section']);\n $this->sections[$row['section']]->registerFromDatabase($row);\n }\n }", "function cacheConfig() {\n\t\tif(!isset($this->_options['configCachePath'])) {\n\t\t\tthrow new PPI_Exception('Missing path to the config cache path');\n\t\t}\n\n\t\t$path = sprintf('%s%s.%s.cache',\n\t\t\t$this->_options['configCachePath'],\n\t\t\t$this->_options['configFile'],\n\t\t\t$this->_options['configBlock']);\n\n\t\tif(file_exists($path)) {\n\t\t\treturn unserialize(file_get_contents($path));\n\t\t}\n\t\t$config = $this->parseConfig();\n\t\tfile_put_contents($path, serialize($config));\n\t\treturn $config;\n\t}", "public static function read( $key ) {\r\n\t\t\t// split keys\r\n\t\t\t$keys = self::explode( $key );\r\n\t\t\t// read value\r\n\t\t\t$data = self::$data;\r\n\r\n\t\t\tforeach ( $keys as $part ) {\r\n\t\t\t\tif ( isset( $data[ $part ] ) ) {\r\n\t\t\t\t\t$data = $data[ $part ];\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tthrow new ConfigureException( $key );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $data;\r\n\t\t}", "public function getData()\n\t{\n\t\t$data = '';\n\t\tif($this->beforeRead())\n\t\t{\n\t\t\t$filename = $this->getStorageFile();\n\t\t\t\n\t\t\tif($this->enablePersistentData===true and isset(self::$persistentData[$filename]))\n\t\t\t{\n\t\t\t\treturn self::$persistentData[$filename];\n\t\t\t}\t\t\n\t\t\t\n\t\t\tif(!file_exists($filename) or filesize($filename)===0)\n\t\t\t{\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($filename,'rb');\n\t\t\tself::$persistentData[$filename] = $data = fread($fp,filesize($filename));\n\t\t\tfclose($fp);\n\t\t\t$this->afterRead();\n\t\t}\n\t\treturn $data;\n\t}", "public function read()\n {\n }", "protected function _getConfig($path)\n {\n return $this->scopeConfig->getValue($path, ScopeInterface::SCOPE_STORE);\n }", "public function testReadConfigurationFileOrArray()\n {\n\t $method = $this->setAccessibleMethod('readConfig');\n\n\t $this->assertEquals([], $method->invoke($this->dbConfiguration->newInstanceWithoutConstructor(), __DIR__.'/dummy/configuration.php'));\n\n\t $this->assertEquals([], $method->invoke($this->dbConfiguration->newInstanceWithoutConstructor(), []));\n }", "public function read() {\r\n }", "protected function loadConfig() : \\codename\\core\\config {\r\n return new \\codename\\core\\config\\json('config/model/' . $this->schema . '_' . $this->table . '.json', true, true);\r\n }", "public function ovpnCurrentConfig()\n {\n $readArr = unserialize(file_get_contents(\"./vpn/ovpn.array.config\"));\n return $readArr;\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 }", "private function _readFile()\n {\n $content = file_get_contents($this->file);\n $this->config = json_decode(utf8_encode($content), true);\n\n if ($this->config == null && json_last_error() != JSON_ERROR_NONE)\n {\n throw new \\LogicException(sprintf(\"Failed to parse config file '%s'. Error: '%s'\", basename($this->file) , json_last_error_msg()));\n }\n }", "public function load()\n {\n $settings = array(\n 'similarityMeasure',\n 'xFactor',\n 'alpha'\n );\n \n $result = $this->db->select($settings)\n ->from('Configuration')\n ->get()->row_array();\n \n return $result;\n }", "public function read()\n\t{\n\t\treturn file_get_contents($this->getPath());\n\t}", "private function loadConfig(){\n $DB = DB::pass();\n $conf = $DB->loadConfig();\n if ( count($conf) > 0 ){\n foreach($conf as $c){\n $this->config->set($c['cluster'] . \".\" . $c['name'],$c['value']);\n }\n } else {\n throw new SystemException(\"No database configuration\");\n }\n }", "private static function loadAppConfig() {\n\t\t\t$appConfJson = file_get_contents(JIAOYU_PROJECT_HOME.\"/app/conf/config.json\");\n\t\t\ttry {\n\t\t\t\t$appConf = JsonUtils::decode($appConfJson);\n\t\t\t} catch (JsonException $e) {\n\t\t\t\tthrow new ConfigurationException(\"Error initializing app config: \".$e->getMessage());\n\t\t\t}\n\n\t\t\t// OK - now we can load up the config array from the file\n\t\t\tforeach ($appConf as $configKey => $configValue) {\n\t\t\t\tself::$config[$configKey] = $configValue;\n\t\t\t}\n\t\t}", "public function readBoardConfig() {\n $file = __DIR__.\"/datas/board.json\";\n $configData = is_file($file) ? file_get_contents($file) : FALSE;\n if ($configData !== FALSE) {\n $config = json_decode($configData, TRUE);\n } else {\n $config = array(\"title\" => \"\", \"layout\" => array());\n }\n return $config;\n }", "function get_config_data()\n{\n global $dbh;\n $config = null;\n\n $result = $dbh->query(\"SELECT * FROM configuration\");\n if ($result)\n $config = $result->fetch(PDO::FETCH_OBJ);\n\n return $config;\n}", "public function getData()\n {\n if ($this->configIsValid('common')) {\n return $this->Config['common']; \n }\n }", "public function get()\r\n {\r\n $this->ensureLoaded();\r\n return $this->config;\r\n }", "function getConfiguration(): Configuration\n {\n $configFileContent = file_get_contents($this->configurationFilePath);\n try {\n $this->configuration = $this->serializer->deserialize($configFileContent, Configuration::class, $this->configurationFileFormat);\n } catch (\\RuntimeException|\\Exception $e) {\n throw new ConfigurationFileDeserializationException($this->configurationFileFormat . ' is unsupported', 0, $e);\n }\n return $this->configuration;\n }", "public function read(): mixed\n {\n return json_decode(file_get_contents($this->path), true, 512, JSON_THROW_ON_ERROR);\n }", "function getConfig()\n {\n return $this->_api->doRequest(\"GET\", \"{$this->getBaseApiPath()}/config\");\n }", "protected function getConfigFromFile()\n {\n if (isset($this->config)) {\n return $this->config;\n }\n\n $className = get_class($this);\n $configPath = realpath(dirname(File::fromClass($className)));\n\n if (File::exists($configFile = $configPath.'/extension.json')) {\n $config = json_decode(File::get($configFile), true) ?? [];\n }\n elseif (File::exists($configFile = $configPath.'/composer.json')) {\n $config = ComposerManager::instance()->getConfig($configPath);\n }\n else {\n throw new SystemException(\"The configuration file for extension <b>{$className}</b> does not exist. \".\n 'Create the file or override extensionMeta() method in the extension class.');\n }\n\n foreach (['code', 'name', 'description', 'author', 'icon'] as $item) {\n if (!array_key_exists($item, $config)) {\n throw new SystemException(sprintf(\n Lang::get('system::lang.missing.config_key'),\n $item, File::localToPublic($configFile)\n ));\n }\n }\n\n return $this->config = $config;\n }", "public function getConfig()\r\n {\r\n return $this->_file;\r\n }", "public function getConfig()\n {\n return $this->_getConfigFile();\n }", "private function load()\n {\n if (!file_exists($this->file)) {\n throw new Exception('config file not found');\n }\n // read contents of wordpress config\n // we can not require the configuration because it requires a shit load of other files\n $this->config = file_get_contents($this->file);\n }", "function retrieveSettings()\n\t\t{\t\n\t\t\t$this->settings = array();\n\t\t\t// first retrieve the \"external\" settings\n\t\t\t$this->retrieveExternalSettings();\n\t\t\t// read the settings property\n\t\t\t$stream = mapi_openpropertytostream($this->store, PR_EC_WEBACCESS_SETTINGS);\n\t\t\tif ($stream == false) {\n\t\t\t\treturn ;\n\t\t\t}\n\n\t\t\t$stat = mapi_stream_stat($stream);\n\t\t\tmapi_stream_seek($stream, 0, STREAM_SEEK_SET);\n\t\t\t$settings_string = '';\n\t\t\tfor($i=0;$i<$stat['cb'];$i+=1024){\n\t\t\t\t$settings_string .= mapi_stream_read($stream, 1024);\n\t\t\t}\n\t\t\t\n\t\t\t// suppress php notice in case unserializing fails\n\t\t\t$settings = @unserialize($settings_string);\n\n\t\t\tif (!$settings){ // backwards compatible with old saving method using XML\n\t\t\t\t$xml = new XMLParser();\n\t\t\t\t$settings = $xml->getData($settings_string);\n\t\t\t}\n\n\t\t\tif (is_array($settings) && isset($settings['settings']) && is_array($settings['settings'])){\n\t\t\t\t$this->settings = array_merge_recursive_overwrite($settings['settings'],$this->settings);\n\t\t\t}\n\t\t}", "private function loadConfiguration()\n {\n /** @var ConfigurationManager $configurationManager */\n $configurationManager = ConfigurationManager::getInstance();\n $this->configuration = $configurationManager->getMainConfiguration();\n }", "public function getConfiguration()\n {\n $configuration = parent::getConfiguration();\n $configuration['debug'] = isset($configuration['debug']) ? $configuration['debug'] : false;\n $configuration['fileUri'] = $this->container->getParameter(\"mapbender.uploads_dir\") . \"/data-store\";\n\n if (isset($configuration[\"schemes\"]) && is_array($configuration[\"schemes\"])) {\n foreach ($configuration[\"schemes\"] as $key => &$scheme) {\n if (is_string($scheme['dataStore'])) {\n $storeId = $scheme['dataStore'];\n $dataStore = $this->container->getParameter('dataStores');\n $scheme['dataStore'] = $dataStore[ $storeId ];\n $scheme['dataStore'][\"id\"] = $storeId;\n //$dataStore = new DataStore($this->container, $configuration['source']);\n }\n if (isset($scheme['formItems'])) {\n $scheme['formItems'] = $this->prepareItems($scheme['formItems']);\n }\n }\n }\n return $configuration;\n }", "function get_settings_config_data() {\n $config = $this->config;//get instance config\n\n //if config doesn't exist - create it\n if (!isset($config)) {\n $config = new stdClass();\n }\n\n //if data doesn't exist = make it an empty array\n if (!isset($config->data))\n $config->data = array();\n\n //return config\n return $config;\n }", "public static function getConfig() {\n return parse_ini_file(__DIR__ . '/config.ini');\n }", "private function load_options()\n\t\t{\n\t\t\t$options = NULL;\n\n\t\t\t// load from persistent store\n\t\t\tif ( NULL !== $this->option_name ) {\n\t\t\t\t// reading from database\n\t\t\t\t$options = get_option( $this->option_name, $this->defaults );\n\t\t\t} else if ( NULL !== $this->filename ) {\n\t\t\t\t// reading from filesystem\n\t\t\t\tif ( file_exists( $this->filename ) ) {\n\t\t\t\t\t$data = file_get_contents( $this->filename );\n\t\t\t\t\t$options = json_decode( $data, TRUE );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// TODO: add capability to store in DS specific table\n\n\t\t\t// this ensures we have *something*, even if it's an empty array\n\t\t\tif ( NULL === $options )\n\t\t\t\t$options = $this->defaults;\n\n\t\t\t$this->_options = array_merge( $this->defaults, $options );\n\t\t}", "public function parseConfig()\n {\n $fileContents = file_get_contents($this->filename);\n if (!$fileContents) {\n $this->error = 'Failed to read file contents';\n\n return false;\n }\n\n $config = json_decode($fileContents, true);\n if (json_last_error()) {\n $this->error = json_last_error_msg();\n\n return false;\n }\n\n $this->config = new Data(array_replace_recursive($config, $this->overrides));\n\n return true;\n }", "public function getConfig() {}", "public function getData()\n {\n \treturn file_get_contents($this->config['location']);\n }", "protected function _load_config()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n $config_file = new Configuration_File(self::FILE_CONFIG);\n $rawdata = $config_file->load();\n } catch (File_Not_Found_Exception $e) {\n // Not fatal, set defaults below\n } catch (Engine_Exception $e) {\n throw new Engine_Exception($e->get_message(), CLEAROS_WARNING);\n }\n\n if (isset($rawdata['allow_shell']) && preg_match(\"/(true|1)/i\", $rawdata['allow_shell']))\n $this->config['allow_shell'] = TRUE;\n else\n $this->config['allow_shell'] = FALSE;\n\n if (isset($rawdata['theme_mode']) && !empty($rawdata['theme_mode']))\n $this->config['theme_mode'] = $rawdata['theme_mode'];\n else\n $this->config['theme_mode'] = 'normal';\n\n if (isset($rawdata['theme']) && !empty($rawdata['theme']))\n $this->config['theme'] = $rawdata['theme'];\n else\n $this->config['theme'] = 'default';\n\n $this->is_loaded = TRUE;\n }", "abstract protected function getConfig();", "public function list() {\n $this->store->listConfig();\n }", "public static function read_config()\n\t{\n\t\t$config = realpath(dirname(__FILE__) . '/../../config_local.php');\n\t\t$hosted_config = Utils::get_hosted_path() . '/config_local.php';\n\n\t\tif (is_readable($config)) \n\t\t{\n\t\t\trequire($config);\n\t\t\t$is_hosted = FALSE;\n\t\t\t\n\t\t// maybe we are hosted\n\t\t} elseif (file_exists($hosted_config) )\n\t\t{\n\t\t\trequire($hosted_config);\n\t\t\trequire_once(Utils::get_hosted_path() . '/htdocs/system/system.php');\n\t\t\t$is_hosted = TRUE;\n\n\t\t// lets try the normal config location\n\t\t} elseif (is_readable('config.php')) \n\t\t{\n\t\t\trequire('config.php');\n\t\t\t$is_hosted = FALSE;\n\n\t\t// redirect\n\t\t} else \n\t\t{\n\t\t\theader('Location: install/index.php');\n\t\t\t$is_hosted = FALSE;\n\t\t}\n\n\t\tdefine('IS_HOSTED', $is_hosted);\n\t}", "public function fetchSettings()\n {\n return $this->store->fetch();\n }", "public function getConfig()\n {\n return $this->get('config');\n }", "public function getConfig()\n { // Try the template specific path first\n $fname = APPLICATION_PATH.$this->_paths['pkg_template'].'/config.json';\n if( file_exists($fname) ) {\n return json_decode(file_get_contents($fname));\n }\n // Next try the domain common path\n $fname = APPLICATION_PATH.$this->_paths['pkg_common'].'/config.json';\n if( file_exists($fname) ) {\n return json_decode(file_get_contents($fname));\n }\n // Finally, try the app common path\n $fname = APPLICATION_PATH.$this->_paths['app_common'].'/config.json';\n if( file_exists($fname) ) {\n return json_decode(file_get_contents($fname));\n }\n // If none of these files were found, return false to indicate failure\n if( !$this->_config) throw new CException('Configuration not found');\n }", "abstract public function getConfig();", "public function load()\n\t{\n\t\tif(($cache=$this->getApplication()->getCache())!==null && ($value=$cache->get(self::CACHE_NAME))!==false)\n\t\t\treturn unserialize($value);\n\t\telse\n\t\t{\n\t\t\tif(($content=@file_get_contents($this->getStateFilePath()))!==false)\n\t\t\t\treturn unserialize($content);\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t}", "public function read() {\n\t\t\n\t}" ]
[ "0.7271961", "0.7196819", "0.69144773", "0.66008073", "0.6591329", "0.64689195", "0.64281684", "0.6357724", "0.6345261", "0.6282819", "0.6261112", "0.6255022", "0.6245914", "0.62448245", "0.6234477", "0.6231036", "0.61999047", "0.6196159", "0.6181799", "0.61234885", "0.6083085", "0.6064951", "0.5989212", "0.5971826", "0.59695697", "0.59626913", "0.594184", "0.5933033", "0.5919514", "0.59088314", "0.58756334", "0.58666295", "0.5860639", "0.58470285", "0.58429515", "0.5838561", "0.58196974", "0.58048403", "0.5804756", "0.5799983", "0.5786298", "0.57759726", "0.5774157", "0.5770311", "0.57702476", "0.57563657", "0.5755138", "0.57550484", "0.5750602", "0.5744895", "0.57426476", "0.5717515", "0.57056564", "0.5704118", "0.5681407", "0.5661804", "0.5655427", "0.56536275", "0.56468976", "0.5646383", "0.5645343", "0.564445", "0.5636161", "0.56231433", "0.5613805", "0.55886054", "0.5580765", "0.55765504", "0.5567613", "0.5562627", "0.55613947", "0.555511", "0.55546594", "0.55452335", "0.55357826", "0.55324554", "0.5530522", "0.55297273", "0.552805", "0.55262285", "0.5525705", "0.5522443", "0.5521078", "0.55205613", "0.55194336", "0.55156356", "0.5515195", "0.5506938", "0.5493126", "0.54865795", "0.5483024", "0.5481583", "0.54803586", "0.54786414", "0.5475248", "0.5464403", "0.5458629", "0.5449529", "0.54468745", "0.5445647", "0.54392856" ]
0.0
-1
Reads configuration data from the storage.
public function readMultiple(array $names);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function readConfigurationValues();", "public static function read()\n {\n return self::$config;\n }", "public function readConfig() {\n if ( file_exists( $this->path . '/config/config.php' ) ) {\n require_once $this->path . '/config/config.php';\n }\n }", "public function load()\n\t{\n\t\tif (file_exists(self::$configPath))\n\t\t{\n\t\t\t$this->config = json_decode(file_get_contents(self::$configPath), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->config = array();\n\t\t}\n\t}", "public static function load()\n {\n $entries = Configuration::get();\n \n foreach ($entries as $entry) {\n self::$config[$entry->id] = unserialize($entry->value);\n }\n }", "function read()\n\t{\n\t\t$content = $this->storage->read();\n\t\t$data = array();\n\t\tforeach($content['data'] as $key=>$value) {\n\t\t\t$storage = new \\Zentric\\Storage(array(\n\t\t\t\t'key' => $key\n\t\t\t\t, 'folder' => STORAGE\n\t\t\t\t, 'driver' => 'Array'\t\t\t\n\t\t\t));\t\t\t\n\t\t\t$data[] = $storage->read();\t\t\t \n\t\t}\n\t\treturn $data;\n\t}", "private static function getConfig() {\n\n\t\t$pathRoot = $_SERVER['DOCUMENT_ROOT'].substr($_SERVER['PHP_SELF'],0, strpos($_SERVER['PHP_SELF'],\"/\",1)).\"/config/\";\n\n\t\t$jsonConfig = file_get_contents($pathRoot.'config.json');\n\t\tself::$arrayConfig = json_decode($jsonConfig);\n\t}", "private static function readConfig()\n {\n $handler = self::getHandler();\n if (null == $handler->arrConfigGlobal && null == $handler->arrConfigLocal && null == $handler->arrConfigSecure) {\n include dirname(__FILE__) . '/../../config/default.php';\n\n $handler->arrConfigLocal = $APPCONFIG;\n\n $db = Base_Database::getConnection();\n try {\n // This is just for things like API keys, password salts etc.\n // If we have, at a later point, a function to export the database\n // en masse, then we can encrypt all the output from the secureconfig\n // table. It shouldn't overide the global or local config settings\n $sql = \"SELECT * FROM secureconfig\";\n $query = $db->prepare($sql);\n $query->execute();\n $handler->arrConfigSecure = $query->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP);\n\n // This is just the regular global configuration settings.\n $sql = \"SELECT * FROM config\";\n $query = $db->prepare($sql);\n $query->execute();\n $handler->arrConfigGlobal = $query->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP);\n foreach ($handler->arrConfigGlobal as $key => $value) {\n $handler->arrConfig[$key] = array('isLocal' => false, 'isOverriden' => false, 'value' => $value[0]);\n }\n \n // This is the configuration settings local to this individual machine.\n foreach ($handler->arrConfigLocal as $key => $value) {\n if (isset($handler->arrConfig[$key])) {\n $handler->arrConfig[$key] = array('isLocal' => true, 'isOverriden' => true, 'value' => $value);\n } else {\n $handler->arrConfig[$key] = array('isLocal' => true, 'isOverriden' => false, 'value' => $value);\n }\n }\n } catch(Exception $e) {\n error_log($e);\n die();\n }\n }\n }", "public function load(): ConfigStoreInterface;", "public function loadConfig() {\n return (object)$this->config;\n }", "public function readConfigFile(): void\n {\n $configPath = __DIR__ . '/../../.config';\n if (!file_exists($configPath)) {\n echo \"Could not find .config\\n\";\n die;\n }\n $lines = preg_split('/[\\r\\n]+/', file_get_contents($configPath));\n foreach ($lines as $line) {\n if (empty($line)) {\n continue;\n }\n if (substr($line, 0, 1) == '#') {\n continue;\n }\n $kv = preg_split(\"/=/\", $line);\n $key = $kv[0];\n $value = $kv[1];\n $this->data[$key] = $value;\n }\n }", "private function readConfig(){\n\n\t\t$this->_ini_array = parse_ini_file(CONFIG.'system.ini');\n\n\t\t$this->_host =\t$this->_ini_array['db_host'];\n\t\t$this->_username = $this->_ini_array['db_username'];\n\t\t$this->_password = $this->_ini_array['db_password'];\n\t\t$this->_database = $this->_ini_array['db_database'];\n\t\n\t\t$this->_log_enabled=$this->_ini_array['log_enabled'];\n\t\t$this->_log_level=$this->_ini_array['log_level'];\n\t\t$this->_log_file_path=$this->_ini_array['log_path'];\n\t\n\n\t\t$this->_lang_default=$this->_ini_array['lang_default'];\n\n\t}", "function getConfigProperties() {\n\tglobal $ethereum_reader_Config;\n\t\n\tif (isset($ethereum_reader_Config))\n\t\treturn $ethereum_reader_Config;\n\t\n\t// initialization of array\n\t$ethereum_reader_Config = array();\n\t\n\t$jsonfile = dirname(__FILE__).'/../settings/config.json';\n\t\n\tif (!file_exists($jsonfile)) {\n\t\treturn $ethereum_reader_Config;\n\t\t\n\t}\n\t\t\t\n\t// read jsonfile\n\t$jsonstring = file_get_contents($jsonfile);\n\n\t$ethereum_reader_Config = json_decode($jsonstring, true);\n\n\treturn $ethereum_reader_Config ;\n}", "protected function getFromStorage()\n {\n try {\n if ($data = $this->parseJson(file_get_contents($this->getStoragePath()))) {\n return $data;\n }\n } catch (ErrorException $e) {\n // File does not exist or could not be opened.\n }\n\n // Fall back to the list provided by the package.\n return $this->parseJson(file_get_contents(__DIR__.'/../domains.json'));\n }", "public static function getConfig() {\n\t\tif (self::$temp_config !== null) {\n\t\t\treturn self::$temp_config;\n\t\t}\n\n\t\t$config_file = self::getConfigFile();\n\t\treturn (!file_exists($config_file)) ? array() : json_decode(file_get_contents($config_file), true);\n\t}", "public function readConfigAction()\n {\n $this->getResponse()->setBody(self::getHelper()->readconfig());\n\n }", "public function read(){\n\t\n\t\tif (!$this->cfg_loaded){\n\t\t\t$this->load();\n\t\t}\n\t\t\n\t\tif ($this->cfg_loaded){\n\t\t\t\n\t\t\t$this->getLogger()->debug(\"Starting reading XML configuration\");\n\t\t\t$config = $this->cfg->getElementsByTagName(\"configuration\");\n\t\t\t\t\n\t\t\tif ($config->length == 1){\n\t\t\t\n\t\t\t\t// first read debug configuration\n\t\t\t\t$this->cfg_debug->read_debug($config->item(0)->getElementsByTagName(\"debug\")->item(0));\n\t\t\t\t\n\t\t\t\t// $this->read_sensors($config->item(0));\n\t\t\t\t$this->cfg_sensors->read_sensors($config->item(0));\n\t\t\t\t\n\t\t\t\t$this->cfg_actions->read_actions($config->item(0)->getElementsByTagName(\"actions\")->item(0));\n\t\t\t\t$this->cfg_gpio->read_gpios($config->item(0)->getElementsByTagName(\"gpios\")->item(0));\n\t\t\t\t$this->cfg_stats->read_stats($config->item(0)->getElementsByTagName(\"statistics\")->item(0));\n\t\t\t\t\n\t\t\t\t$this->cfg_modes->read_modes($config->item(0)->getElementsByTagName(\"modes\")->item(0));\n\t\t\t\t$this->cfg_progs->read_programs($config->item(0)->getElementsByTagName(\"programs\")->item(0));\n\t\t\t} else {\n\t\t\t\t$this->getLogger()->error(\"section <configuration> not found. Can't read configuration.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "function load_config() {\n\t\t$conf_file = @file_get_contents( LDAP_LOGIN_PATH.'data.dat' );\n\t\tif ($conf_file!==false)\n\t\t{\n\t\t\t$this->config = unserialize($conf_file);\n\t\t}\n\t}", "private function read_config() {\n\t\t$sections = parse_ini_file($this->config['conf'], true);\n\t\tforeach ($sections as $sectionk => $sectionv) {\n\t\t\tforeach ($sectionv as $key => $var)\n\t\t\t\t$this->config[$sectionk . '.' . $key] = $var;\n\t\t}\n\t}", "static function loadConfig() {\n\t\t$config = self::file($_SERVER[\"DOCUMENT_ROOT\"] . \"/../config.json\");\n\t\tif (!is_null($config))\n\t\t\tself::$config = json_decode($config);\n\t}", "public function refreshConfig()\n {\n $this->_data = $this->_reader->read();\n $this->merge($this->_dbReader->get());\n }", "abstract protected function loadConfig();", "public static function readAll()\n {\n $settingsObj = self::getInstance();\n if (isset($settingsObj->data)) {\n return $settingsObj->data;\n }\n return false;\n }", "function loadConfig(){\n $file = file_get_contents($this->config_dir, FILE_USE_INCLUDE_PATH);\n $urls = json_decode($file,TRUE);\n //not the best way but error handling\n if ($file == NULL || $urls == NUll ){\n print(\"Error reading the config file or it it is empty\");\n }\n else{\n $this->config_data = $urls;\n\n }\n }", "private function loadConfig() {\n if (file_exists($this->_data['cache_config_file'])) {\n $data = unserialize(file_get_contents($this->_data['cache_config_file']));\n \n self::$_configInstance = (object)$data; //instance of stdClass with all the properties public\n //$this->_data = (array)$data; \n return true;\n } \n return false;\n }", "public function readConfig() {\n \t// Read the current configuration file\n \t$this->setConfig(parse_ini_file($this->getConfigFile(), true));\n \t// Return instance \n \treturn $this;\n }", "protected function loadConfig() {\n $json = new JSON();\n $viewConfig = $json->readFile(__SITE_PATH . \"\\\\config\\\\view.json\");\n $this->meta_info = $viewConfig['meta'];\n $this->js_files = $viewConfig['javascript'];\n $this->css_files = $viewConfig['css'];\n }", "public function getConfig() {\n if ($this->config) {\n return $this->config;\n }\n \n $this->config = $this->parse($this->configFile);\n return $this->config;\n }", "public function loadConfig()\n {\n $this->setGlobalStoreOfShopNumber($this->getShopNumber());\n $this->loadArray($this->toArray());\n $this->setExportTmpAndLogSettings();\n }", "private function read(): array|false {\n $security = \"<?php header(\\\"Status: 403\\\"); exit(\\\"Access denied.\\\"); ?>\\n\";\n $contents = @file_get_contents(INCLUDES_DIR.DIR.\"config.json.php\");\n\n if ($contents === false)\n return false;\n\n $json = json_get(str_replace($security, \"\", $contents), true);\n\n if (!is_array($json))\n return false;\n\n return $this->data = $json;\n }", "public static function load()\n {\n $configFile = self::getConfigFilePath();\n\n if (!is_file($configFile)) {\n self::save([]);\n }\n\n $config = require($configFile);\n\n if (!is_array($config))\n return array();\n\n return $config;\n }", "public static function getConfigData()\n\t\t{\n\t\t\t$sConfigFile = self::getConfigFile();\n\n\t\t\t// Detect DB settings via configuration file\n\t\t\tif(is_file($sConfigFile))\n\t\t\t{\n\t\t\t\treturn file_get_contents($sConfigFile);\n\t\t\t}\n\n\t\t\treturn '';\n\t\t}", "public function load()\n {\n $ini = APP_DIR.'config/'.ENVIRONMENT.'.ini';\n\n if(!file_exists($ini))\n Clockwork::throwError('Could not load config ('.$ini.')');\n\n $this->data = parse_ini_file($ini, true);\n \n $this->setValues();\n }", "function get_config() {\n //$memcached = new \\Memcached();\n //$memcached->addServer(MEMCACHED_HOST, MEMCACHED_PORT);\n \n if (false) {//$memcached->get('lc_config') && MEMCACHED_ENABLED) {\n //return $memcached->get('lc_config');\n }\n else { \n // Load our master config\n $master_config = parse_ini_file(LC_HOME . LC_MASTER_CONFIG, True);\n \n // Let's get the local config based on the resource type (an action parameter)\n if (!empty($this->http_request->action_params['resource_type'])){\n $resource_type = $this->http_request->action_params['resource_type'];\n if (!empty($resource_type) && !in_array($resource_type, array_keys($master_config['resource_types']))) {\n throw new \\Exception('Incorrect resource type specified' .\n ' --> ' . $resource_type . ' <-- See ' .\n $master_config['doc']['lc_doc_loc'] . ' for documention on resource types.');\n }\n }\n \n $resource_config = parse_ini_file(LC_HOME . $master_config['resource_types'][$resource_type]);\n\n // Since we turn all sections in our master config into arrays (this \n // way we can validate keys easily), we need to flatten it back down\n $flattened_master_config = array();\n foreach ($master_config as $top_level_element) {\n foreach ($top_level_element as $key => $value) {\n $flattened_master_config[$key] = $value;\n }\n }\n\n $merged = array_merge($flattened_master_config, $resource_config);\n //$memcached->set('lc_config', $merged);\n return $merged;\n }\n }", "protected function read() {\n\t\t$fileContent = trim(file_get_contents($this->filepath));\n\t\t$pattern = '/\\$([^=]+)=([^;]+);/';\n\t\t$matches = null;\n\t\t$matchesFound = preg_match_all($pattern, $fileContent, $matches);\n\t\t$configContents = array();\n\t\tif ($matchesFound) {\n\t\t\t$configContents = $matches[0];\n\t\t}\n\t\t$this->rows = array();\n\t\tforeach ($configContents as $configLine) {\n\t\t\t$this->rows[] = new ConfigFileRow($configLine, $this);\n\t\t}\n\t\t$this->rowIndex = -1;\n\t\tunset($fileContent);\n\t}", "protected function getConfig() {\n\t\t\t$handle = fopen($this->configFile, 'r');\n\t\t\t$contents = fread($handle, filesize($this->configFile));\n\t\t\tfclose($handle);\n\n\t\t\t$this->config = json_decode($contents);\n\n\t\t\tforeach ($this->configMap as $key => $value) {\n\t\t\t\tif ($handle && !array_key_exists($key, $this->config)) {\n\t\t\t\t\tthrow new Exception('Missing key: ' . $key);\n\t\t\t\t}\n\n\t\t\t\tif (empty($this->config->{$key})) {\n\t\t\t\t\t/*\n\t\t\t\t\t\tIf the config isn't found we'll check if an environment\n\t\t\t\t\t\tvariable exists, this is largely Heroku specific, and offers\n\t\t\t\t\t\tus a nice way to avoid deploying any config.\n\n\t\t\t\t\t\tIf time were no issue this handling would be more loosely\n\t\t\t\t\t\tcoupled to this class.\n\t\t\t\t\t*/\n\t\t\t\t\t$env_value = getenv($value['env']);\n\n\t\t\t\t\tif (empty($env_value)) {\n\t\t\t\t\t\tthrow new Exception('Missing value: ' . $key);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->{$value['prop']} = !empty($env_value) ? $env_value : $this->config->{$key};\n\t\t\t}\n\n\t\t\treturn $this;\n\t\t}", "function getConfigObj(){\n $fh = fopen($GLOBALS['configFileName'],'r')\n\t\t\tor die(\"Unable to open file!\");\n\n $configJson = fread($fh, filesize($GLOBALS['configFileName']));\n fclose($fh);\n // print($configJson);\n // $configObj = json_decode($configJson);\n // var_dump($configObj); //->{'devices'}[0]->{'name'};\n return json_decode($configJson);\n }", "public function getConfigData() {\n\t\treturn array(\n\t\t\t'storageType' => StorageFactory::TYPE_DUMMY,\n\t\t\t'debuggerDisabled' => $this->debuggerDisabled,\n\t\t);\n\t}", "public function read() : void\n {\n $ilDB = $this->db;\n\n $query = \"SELECT * FROM crn_sts_mtr_settings\";\n $result = $ilDB->query($query);\n\n while ($row = $ilDB->fetchAssoc($result)) {\n $this->setting[$row[\"keyword\"]] = $row[\"value\"];\n }\n }", "private static function loadConfigurationFile()\n {\n if(self::$ConfigurationData == null)\n {\n $file_contents = file_get_contents(CONFIGURATION_FILE);\n $json_data = json_decode($file_contents, true);\n\n if(empty($json_data))\n {\n throw new Exception(\"Invalid JSON data in the configuration file\");\n }\n\n self::$ConfigurationData = $json_data;\n }\n }", "protected function loadFormData()\n {\n // Check the session for previously entered form data.\n $app = JFactory::getApplication();\n $data = $app->getUserState('com_jtransport.config.data', array());\n\n if (empty($data))\n {\n $data = $this->getItem();\n }\n\n return $data;\n }", "private function LoadConfigFile(){\n $a = file_get_contents($this->RootDIR . 'config/main.json');\n $this->Config = json_decode($a, true);\n }", "protected function _get_config()\n {\n $config = Spyc::YAMLLoad(\"config.yaml\");\n return $config;\n }", "public function loadConfig($data);", "function getConfigContents() {\n\t\treturn $this->configContents;\n\t}", "private function readLogConfig(){\n\n\t\t$_config = ConfigUtil::getInstance();\n\n\t\t$this->_log_enabled = $_config->isLogEnabled();\n\t\t$this->_log_level = $_config->getLogLevel();\n\t\t$this->_log_file_path = $_config->getLogFilePath();\n\t\n\t}", "public function readAndCache() {\n\n $config = $this->read(false);\n $tempPath = App::tempPath();\n \\jFile::createDir($tempPath, $config->chmodDir);\n $filename = $tempPath.str_replace('/', '~', $this->configFileName);\n\n if (BYTECODE_CACHE_EXISTS) {\n $filename .= '.conf.php';\n if ($f = @fopen($filename, 'wb')) {\n fwrite($f, '<?php $config = '.var_export(get_object_vars($config),true).\";\\n?>\");\n fclose($f);\n chmod($filename, $config->chmodFile);\n }\n else {\n throw new Exception('Error while writing configuration cache file -- '.$filename);\n }\n }\n else {\n IniFileMgr::write(get_object_vars($config), $filename.'.resultini.php', \";<?php die('');?>\\n\", $config->chmodFile);\n }\n return $config;\n }", "private function readAppData()\n {\n $fileName = \"{$this->storeDirectory}/appData.json\";\n if (file_exists($fileName)) {\n $data = json_decode(file_get_contents($fileName), true);\n if (isset($data['default-counter'])) {\n $this->defaultCounter = $data['default-counter'];\n }\n }\n }", "function Event_Config_Read()\n {\n if (empty($this->Event_Config))\n {\n $this->Event_Config=$this->ReadPHPArray($this->Event_Config_File());\n $groups=$this->Dir_Files($this->Event_Config_Path.\"/Config\",'\\.php$');\n $this->Event_Config_Group=$this->Event_Config[ \"Config_Group_Default\" ];\n \n }\n }", "protected function getConfig($path = '') {\n if ($path == '') {\n $path = getenv('HOME') . '/.podcastr.json';\n }\n\n if ($this->output->isVerbose()) {\n $this->output->writeln(\"<comment> - Loading config from ~/.podcastr.json</comment>\");\n }\n $config = file_get_contents($path);\n $config = json_decode($config, TRUE);\n if (is_null($config)) {\n $this->output->writeln(\"<error>Config is invalid JSON or cannot be read.</error>\");\n exit(1);\n }\n\n return $config;\n }", "public function loadConfig()\n {\n return parse_ini_file(\n DIR_ROOT . '/config.ini', False\n );\n }", "public function getDataConfig()\n {\n return $this->dataConfig;\n }", "public function load_config() {\n if (!isset($this->config)) {\n $name = $this->get_name();\n $this->config = get_config(\"local_$name\");\n }\n }", "public function readCache()\n {\n return $this->readFile()->unpackData();\n }", "private function loadConfigRepository(): void\n {\n // Check Config\n if (\\count($this->configs) > 0) {\n return;\n }\n\n // Load Cache|Repository\n $store = $this->configRepo->findAll();\n foreach ($store as $config) {\n if (count($config->getValue()) === 1) {\n $val = $config->getValue()[0];\n\n if ('true' === $val) {\n $val = true;\n } elseif ('false' === $val) {\n $val = false;\n }\n } else {\n $val = $config->getValue();\n }\n\n $this->configs[$config->getName()] = $val;\n }\n }", "function loadFromDatabase(){\n global $DB;\n $resource = $DB->config->get();\n $list = array();\n while($row = $DB->fetchAssoc($resource))\n {\n if(!isset($this->sections[$row['section']])) $this->sections[$row['section']] = new ConfigSection($row['section']);\n $this->sections[$row['section']]->registerFromDatabase($row);\n }\n }", "function cacheConfig() {\n\t\tif(!isset($this->_options['configCachePath'])) {\n\t\t\tthrow new PPI_Exception('Missing path to the config cache path');\n\t\t}\n\n\t\t$path = sprintf('%s%s.%s.cache',\n\t\t\t$this->_options['configCachePath'],\n\t\t\t$this->_options['configFile'],\n\t\t\t$this->_options['configBlock']);\n\n\t\tif(file_exists($path)) {\n\t\t\treturn unserialize(file_get_contents($path));\n\t\t}\n\t\t$config = $this->parseConfig();\n\t\tfile_put_contents($path, serialize($config));\n\t\treturn $config;\n\t}", "public static function read( $key ) {\r\n\t\t\t// split keys\r\n\t\t\t$keys = self::explode( $key );\r\n\t\t\t// read value\r\n\t\t\t$data = self::$data;\r\n\r\n\t\t\tforeach ( $keys as $part ) {\r\n\t\t\t\tif ( isset( $data[ $part ] ) ) {\r\n\t\t\t\t\t$data = $data[ $part ];\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tthrow new ConfigureException( $key );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $data;\r\n\t\t}", "protected function _getConfig($path)\n {\n return $this->scopeConfig->getValue($path, ScopeInterface::SCOPE_STORE);\n }", "public function read()\n {\n }", "public function getData()\n\t{\n\t\t$data = '';\n\t\tif($this->beforeRead())\n\t\t{\n\t\t\t$filename = $this->getStorageFile();\n\t\t\t\n\t\t\tif($this->enablePersistentData===true and isset(self::$persistentData[$filename]))\n\t\t\t{\n\t\t\t\treturn self::$persistentData[$filename];\n\t\t\t}\t\t\n\t\t\t\n\t\t\tif(!file_exists($filename) or filesize($filename)===0)\n\t\t\t{\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($filename,'rb');\n\t\t\tself::$persistentData[$filename] = $data = fread($fp,filesize($filename));\n\t\t\tfclose($fp);\n\t\t\t$this->afterRead();\n\t\t}\n\t\treturn $data;\n\t}", "public function testReadConfigurationFileOrArray()\n {\n\t $method = $this->setAccessibleMethod('readConfig');\n\n\t $this->assertEquals([], $method->invoke($this->dbConfiguration->newInstanceWithoutConstructor(), __DIR__.'/dummy/configuration.php'));\n\n\t $this->assertEquals([], $method->invoke($this->dbConfiguration->newInstanceWithoutConstructor(), []));\n }", "public function read() {\r\n }", "protected function loadConfig() : \\codename\\core\\config {\r\n return new \\codename\\core\\config\\json('config/model/' . $this->schema . '_' . $this->table . '.json', true, true);\r\n }", "public function ovpnCurrentConfig()\n {\n $readArr = unserialize(file_get_contents(\"./vpn/ovpn.array.config\"));\n return $readArr;\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 }", "private function _readFile()\n {\n $content = file_get_contents($this->file);\n $this->config = json_decode(utf8_encode($content), true);\n\n if ($this->config == null && json_last_error() != JSON_ERROR_NONE)\n {\n throw new \\LogicException(sprintf(\"Failed to parse config file '%s'. Error: '%s'\", basename($this->file) , json_last_error_msg()));\n }\n }", "public function load()\n {\n $settings = array(\n 'similarityMeasure',\n 'xFactor',\n 'alpha'\n );\n \n $result = $this->db->select($settings)\n ->from('Configuration')\n ->get()->row_array();\n \n return $result;\n }", "public function read()\n\t{\n\t\treturn file_get_contents($this->getPath());\n\t}", "private function loadConfig(){\n $DB = DB::pass();\n $conf = $DB->loadConfig();\n if ( count($conf) > 0 ){\n foreach($conf as $c){\n $this->config->set($c['cluster'] . \".\" . $c['name'],$c['value']);\n }\n } else {\n throw new SystemException(\"No database configuration\");\n }\n }", "private static function loadAppConfig() {\n\t\t\t$appConfJson = file_get_contents(JIAOYU_PROJECT_HOME.\"/app/conf/config.json\");\n\t\t\ttry {\n\t\t\t\t$appConf = JsonUtils::decode($appConfJson);\n\t\t\t} catch (JsonException $e) {\n\t\t\t\tthrow new ConfigurationException(\"Error initializing app config: \".$e->getMessage());\n\t\t\t}\n\n\t\t\t// OK - now we can load up the config array from the file\n\t\t\tforeach ($appConf as $configKey => $configValue) {\n\t\t\t\tself::$config[$configKey] = $configValue;\n\t\t\t}\n\t\t}", "function get_config_data()\n{\n global $dbh;\n $config = null;\n\n $result = $dbh->query(\"SELECT * FROM configuration\");\n if ($result)\n $config = $result->fetch(PDO::FETCH_OBJ);\n\n return $config;\n}", "public function readBoardConfig() {\n $file = __DIR__.\"/datas/board.json\";\n $configData = is_file($file) ? file_get_contents($file) : FALSE;\n if ($configData !== FALSE) {\n $config = json_decode($configData, TRUE);\n } else {\n $config = array(\"title\" => \"\", \"layout\" => array());\n }\n return $config;\n }", "public function getData()\n {\n if ($this->configIsValid('common')) {\n return $this->Config['common']; \n }\n }", "public function get()\r\n {\r\n $this->ensureLoaded();\r\n return $this->config;\r\n }", "function getConfiguration(): Configuration\n {\n $configFileContent = file_get_contents($this->configurationFilePath);\n try {\n $this->configuration = $this->serializer->deserialize($configFileContent, Configuration::class, $this->configurationFileFormat);\n } catch (\\RuntimeException|\\Exception $e) {\n throw new ConfigurationFileDeserializationException($this->configurationFileFormat . ' is unsupported', 0, $e);\n }\n return $this->configuration;\n }", "function getConfig()\n {\n return $this->_api->doRequest(\"GET\", \"{$this->getBaseApiPath()}/config\");\n }", "protected function getConfigFromFile()\n {\n if (isset($this->config)) {\n return $this->config;\n }\n\n $className = get_class($this);\n $configPath = realpath(dirname(File::fromClass($className)));\n\n if (File::exists($configFile = $configPath.'/extension.json')) {\n $config = json_decode(File::get($configFile), true) ?? [];\n }\n elseif (File::exists($configFile = $configPath.'/composer.json')) {\n $config = ComposerManager::instance()->getConfig($configPath);\n }\n else {\n throw new SystemException(\"The configuration file for extension <b>{$className}</b> does not exist. \".\n 'Create the file or override extensionMeta() method in the extension class.');\n }\n\n foreach (['code', 'name', 'description', 'author', 'icon'] as $item) {\n if (!array_key_exists($item, $config)) {\n throw new SystemException(sprintf(\n Lang::get('system::lang.missing.config_key'),\n $item, File::localToPublic($configFile)\n ));\n }\n }\n\n return $this->config = $config;\n }", "public function read(): mixed\n {\n return json_decode(file_get_contents($this->path), true, 512, JSON_THROW_ON_ERROR);\n }", "public function getConfig()\r\n {\r\n return $this->_file;\r\n }", "public function getConfig()\n {\n return $this->_getConfigFile();\n }", "private function load()\n {\n if (!file_exists($this->file)) {\n throw new Exception('config file not found');\n }\n // read contents of wordpress config\n // we can not require the configuration because it requires a shit load of other files\n $this->config = file_get_contents($this->file);\n }", "public function getConfiguration()\n {\n $configuration = parent::getConfiguration();\n $configuration['debug'] = isset($configuration['debug']) ? $configuration['debug'] : false;\n $configuration['fileUri'] = $this->container->getParameter(\"mapbender.uploads_dir\") . \"/data-store\";\n\n if (isset($configuration[\"schemes\"]) && is_array($configuration[\"schemes\"])) {\n foreach ($configuration[\"schemes\"] as $key => &$scheme) {\n if (is_string($scheme['dataStore'])) {\n $storeId = $scheme['dataStore'];\n $dataStore = $this->container->getParameter('dataStores');\n $scheme['dataStore'] = $dataStore[ $storeId ];\n $scheme['dataStore'][\"id\"] = $storeId;\n //$dataStore = new DataStore($this->container, $configuration['source']);\n }\n if (isset($scheme['formItems'])) {\n $scheme['formItems'] = $this->prepareItems($scheme['formItems']);\n }\n }\n }\n return $configuration;\n }", "private function loadConfiguration()\n {\n /** @var ConfigurationManager $configurationManager */\n $configurationManager = ConfigurationManager::getInstance();\n $this->configuration = $configurationManager->getMainConfiguration();\n }", "function retrieveSettings()\n\t\t{\t\n\t\t\t$this->settings = array();\n\t\t\t// first retrieve the \"external\" settings\n\t\t\t$this->retrieveExternalSettings();\n\t\t\t// read the settings property\n\t\t\t$stream = mapi_openpropertytostream($this->store, PR_EC_WEBACCESS_SETTINGS);\n\t\t\tif ($stream == false) {\n\t\t\t\treturn ;\n\t\t\t}\n\n\t\t\t$stat = mapi_stream_stat($stream);\n\t\t\tmapi_stream_seek($stream, 0, STREAM_SEEK_SET);\n\t\t\t$settings_string = '';\n\t\t\tfor($i=0;$i<$stat['cb'];$i+=1024){\n\t\t\t\t$settings_string .= mapi_stream_read($stream, 1024);\n\t\t\t}\n\t\t\t\n\t\t\t// suppress php notice in case unserializing fails\n\t\t\t$settings = @unserialize($settings_string);\n\n\t\t\tif (!$settings){ // backwards compatible with old saving method using XML\n\t\t\t\t$xml = new XMLParser();\n\t\t\t\t$settings = $xml->getData($settings_string);\n\t\t\t}\n\n\t\t\tif (is_array($settings) && isset($settings['settings']) && is_array($settings['settings'])){\n\t\t\t\t$this->settings = array_merge_recursive_overwrite($settings['settings'],$this->settings);\n\t\t\t}\n\t\t}", "function get_settings_config_data() {\n $config = $this->config;//get instance config\n\n //if config doesn't exist - create it\n if (!isset($config)) {\n $config = new stdClass();\n }\n\n //if data doesn't exist = make it an empty array\n if (!isset($config->data))\n $config->data = array();\n\n //return config\n return $config;\n }", "public static function getConfig() {\n return parse_ini_file(__DIR__ . '/config.ini');\n }", "private function load_options()\n\t\t{\n\t\t\t$options = NULL;\n\n\t\t\t// load from persistent store\n\t\t\tif ( NULL !== $this->option_name ) {\n\t\t\t\t// reading from database\n\t\t\t\t$options = get_option( $this->option_name, $this->defaults );\n\t\t\t} else if ( NULL !== $this->filename ) {\n\t\t\t\t// reading from filesystem\n\t\t\t\tif ( file_exists( $this->filename ) ) {\n\t\t\t\t\t$data = file_get_contents( $this->filename );\n\t\t\t\t\t$options = json_decode( $data, TRUE );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// TODO: add capability to store in DS specific table\n\n\t\t\t// this ensures we have *something*, even if it's an empty array\n\t\t\tif ( NULL === $options )\n\t\t\t\t$options = $this->defaults;\n\n\t\t\t$this->_options = array_merge( $this->defaults, $options );\n\t\t}", "public function parseConfig()\n {\n $fileContents = file_get_contents($this->filename);\n if (!$fileContents) {\n $this->error = 'Failed to read file contents';\n\n return false;\n }\n\n $config = json_decode($fileContents, true);\n if (json_last_error()) {\n $this->error = json_last_error_msg();\n\n return false;\n }\n\n $this->config = new Data(array_replace_recursive($config, $this->overrides));\n\n return true;\n }", "public function getConfig() {}", "public function getData()\n {\n \treturn file_get_contents($this->config['location']);\n }", "abstract protected function getConfig();", "protected function _load_config()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n $config_file = new Configuration_File(self::FILE_CONFIG);\n $rawdata = $config_file->load();\n } catch (File_Not_Found_Exception $e) {\n // Not fatal, set defaults below\n } catch (Engine_Exception $e) {\n throw new Engine_Exception($e->get_message(), CLEAROS_WARNING);\n }\n\n if (isset($rawdata['allow_shell']) && preg_match(\"/(true|1)/i\", $rawdata['allow_shell']))\n $this->config['allow_shell'] = TRUE;\n else\n $this->config['allow_shell'] = FALSE;\n\n if (isset($rawdata['theme_mode']) && !empty($rawdata['theme_mode']))\n $this->config['theme_mode'] = $rawdata['theme_mode'];\n else\n $this->config['theme_mode'] = 'normal';\n\n if (isset($rawdata['theme']) && !empty($rawdata['theme']))\n $this->config['theme'] = $rawdata['theme'];\n else\n $this->config['theme'] = 'default';\n\n $this->is_loaded = TRUE;\n }", "public function list() {\n $this->store->listConfig();\n }", "public static function read_config()\n\t{\n\t\t$config = realpath(dirname(__FILE__) . '/../../config_local.php');\n\t\t$hosted_config = Utils::get_hosted_path() . '/config_local.php';\n\n\t\tif (is_readable($config)) \n\t\t{\n\t\t\trequire($config);\n\t\t\t$is_hosted = FALSE;\n\t\t\t\n\t\t// maybe we are hosted\n\t\t} elseif (file_exists($hosted_config) )\n\t\t{\n\t\t\trequire($hosted_config);\n\t\t\trequire_once(Utils::get_hosted_path() . '/htdocs/system/system.php');\n\t\t\t$is_hosted = TRUE;\n\n\t\t// lets try the normal config location\n\t\t} elseif (is_readable('config.php')) \n\t\t{\n\t\t\trequire('config.php');\n\t\t\t$is_hosted = FALSE;\n\n\t\t// redirect\n\t\t} else \n\t\t{\n\t\t\theader('Location: install/index.php');\n\t\t\t$is_hosted = FALSE;\n\t\t}\n\n\t\tdefine('IS_HOSTED', $is_hosted);\n\t}", "public function fetchSettings()\n {\n return $this->store->fetch();\n }", "public function getConfig()\n {\n return $this->get('config');\n }", "public function getConfig()\n { // Try the template specific path first\n $fname = APPLICATION_PATH.$this->_paths['pkg_template'].'/config.json';\n if( file_exists($fname) ) {\n return json_decode(file_get_contents($fname));\n }\n // Next try the domain common path\n $fname = APPLICATION_PATH.$this->_paths['pkg_common'].'/config.json';\n if( file_exists($fname) ) {\n return json_decode(file_get_contents($fname));\n }\n // Finally, try the app common path\n $fname = APPLICATION_PATH.$this->_paths['app_common'].'/config.json';\n if( file_exists($fname) ) {\n return json_decode(file_get_contents($fname));\n }\n // If none of these files were found, return false to indicate failure\n if( !$this->_config) throw new CException('Configuration not found');\n }", "abstract public function getConfig();", "public function load()\n\t{\n\t\tif(($cache=$this->getApplication()->getCache())!==null && ($value=$cache->get(self::CACHE_NAME))!==false)\n\t\t\treturn unserialize($value);\n\t\telse\n\t\t{\n\t\t\tif(($content=@file_get_contents($this->getStateFilePath()))!==false)\n\t\t\t\treturn unserialize($content);\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t}", "public function getConfig()\n {\n return $this->config;\n }" ]
[ "0.727389", "0.7198893", "0.69167006", "0.66020435", "0.6593285", "0.6467077", "0.6431306", "0.63610655", "0.63451916", "0.6284712", "0.6263903", "0.6257862", "0.6247373", "0.6243261", "0.62375486", "0.6233703", "0.620125", "0.6197925", "0.6185712", "0.61250764", "0.6084894", "0.6067665", "0.5990448", "0.59740317", "0.5971013", "0.59648126", "0.5943464", "0.59362304", "0.5922253", "0.5910132", "0.5877505", "0.5869383", "0.5862552", "0.5851334", "0.58444756", "0.5841683", "0.58208805", "0.5807435", "0.58069247", "0.58007854", "0.5788037", "0.5778348", "0.5776902", "0.57729805", "0.5772974", "0.5757435", "0.5756478", "0.575568", "0.5752753", "0.5746469", "0.574493", "0.5721273", "0.57067436", "0.5704478", "0.56824553", "0.5664222", "0.5656878", "0.5655343", "0.56464463", "0.5646383", "0.5645634", "0.5644679", "0.5635983", "0.5626235", "0.5615463", "0.55912775", "0.558269", "0.5578206", "0.5566417", "0.55647105", "0.5563927", "0.55573386", "0.5556793", "0.5548629", "0.5539166", "0.5533168", "0.5532853", "0.5529451", "0.55293155", "0.5529278", "0.55288863", "0.55231756", "0.55228305", "0.5521893", "0.5521391", "0.55185646", "0.55177504", "0.55096704", "0.5495133", "0.54900444", "0.548414", "0.54840785", "0.54835767", "0.5479321", "0.5477862", "0.54650474", "0.54618573", "0.5452082", "0.5450477", "0.54443216", "0.54405594" ]
0.0
-1
Writes configuration data to the storage.
public function write($name, array $data);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save()\n\t{\n\t\t$json = json_encode($this->config, JSON_PRETTY_PRINT);\n\n\t\tif (!$h = fopen(self::$configPath, 'w'))\n\t\t{\n\t\t\tdie('Could not open file ' . self::$configPath);\n\t\t}\n\n\t\tif (!fwrite($h, $json))\n\t\t{\n\t\t\tdie('Could not write file ' . self::$configPath);\n\t\t}\n\n\t\tfclose($h);\n\t}", "public function save()\n {\n $config_content = file_get_contents($this->config_path);\n\n foreach ($this->fields as $configuration => $value) {\n $config_content = str_replace(str_replace('\\\\', '\\\\\\\\', $value['default']), str_replace('\\\\', '\\\\\\\\', $this->configurations[$configuration]), $config_content);\n config([$value['config'] => str_replace('\\\\', '\\\\\\\\', $this->configurations[$configuration])]); //Reset the config value\n }\n\n file_put_contents($this->config_path, $config_content);\n }", "public function writeConfig() {\n $mergedTemplate = $this->mergeTemplate();\n file_put_contents(\"{$this->settings['paths']['hostConfigDir']}/{$this->params['name']}.cfg\", $mergedTemplate);\n file_put_contents(\"{$this->settings['paths']['hostTrackDir']}/{$this->params['type']}.inf\", \"{$this->params['name']}:{$this->params['instanceId']}\" . PHP_EOL, FILE_APPEND);\n $this->logChange();\n }", "function write() {\n\t\t$this->readychk();\n\t\tif (!is_dir($this->dir_path)) { mkdir($this->dir_path); }\n\t\tif (!is_dir($this->asset_path)) { mkdir($this->asset_path); }\n\n\t\t$cstr = json_encode($this->export(TRUE, TRUE));\n\t\tif (\n\t\t\t$cstr === FALSE &&\n\t\t\tjson_last_error() !== JSON_ERROR_NONE\n\t\t) { throw new IntException(\"Slide config encoding failed.\"); }\n\t\tfile_lock_and_put($this->conf_path, $cstr);\n\t}", "private function saveConfig() {\n \tself::$_configInstance = (object)$this->_data; \n file_put_contents($this->_data['cache_config_file'],serialize(self::$_configInstance)); \n }", "public function Save()\n {\n $content = \"\";\n foreach ($this->vars as $key => $elem) {\n $content .= \"[\".$key.\"]\\n\";\n foreach ($elem as $key2 => $elem2) {\n $content .= $key2.\" = \\\"\".$elem2.\"\\\"\\n\";\n }\n $content .= \"\\n\";\n }\n if (!$handle = @fopen($this->fileName, 'w')) {\n error_log(\"Config::Save() - Could not open file('\".$this->fileName.\"') for writing, error.\");\n }\n if (!fwrite($handle, $content)) {\n error_log(\"Config::Save() - Could not write to open file('\" . $this->fileName .\"'), error.\");\n }\n fclose($handle);\n }", "protected function write()\n {\n $this->writeString($this->database);\n $this->writeString($this->type);\n $this->writeString($this->storage);\n }", "public function save()\n\t{\n\t\tif($this->beforeSave())\n\t\t{\n\t\t\t$dest = $this->getStorageFile();\n\t\t\t\n\t\t\tif(file_exists($dest) and is_writable($dest)===false)\n\t\t\t{\n\t\t\t\t@chmod($dest,0777);\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($dest,$this->mode);\n\t\t\tfwrite($fp,$this->data);\n\t\t\tfclose($fp);\n\t\t\t$this->afterSave();\n\t\t}\n\t}", "private function writeConfigFile()\n {\n if (!$this->configFile) {\n $confDir = $this->scratchSpace . DIRECTORY_SEPARATOR . 'config';\n mkdir($confDir);\n $this->configFile = $confDir . DIRECTORY_SEPARATOR . 'config.yml';\n }\n file_put_contents($this->configFile, $this->configYaml);\n $this->container->setParameter('config.filename', $this->configFile);\n }", "public function saveSettings()\n {\n $this->store->save($this->data);\n }", "public function save()\n\t{\n\t\t$h = fopen(WEBDEV_CONFIG_FILE, 'w');\n\t\tfwrite($h, \"<?php\\n return \" .var_export($this->config->all(), true) .';');\n\t\tfclose($h);\n\t}", "protected function write()\n {\n if (!is_dir($this->path)) {\n mkdir($this->path);\n }\n\n file_put_contents($this->file, json_encode([\n 'network' => $this->network,\n 'epoch' => static::$epoch,\n 'iteration' => static::$iteration,\n 'a' => $this->a,\n 'e' => $this->e\n ]));\n }", "private function writeAppData()\n {\n $fileName = \"{$this->storeDirectory}/appData.json\";\n $data = json_encode([\n 'default-counter' => $this->defaultCounter,\n ]);\n file_put_contents($fileName, $data, JSON_PRETTY_PRINT);\n }", "public function writeAndPush()\n {\n $this->gitConfig();\n $this->writeFullConfFile();\n $this->writeUsers();\n if($this->commitConfig()) $this->pushConfig();\n }", "public function canWriteConfiguration() {}", "public function write() {\n\t\t$database = Registry::get(\"database\");\n\t\t$v = \"value='\" . $this -> value . \"'\";\n\t\t$statement = Registry::get(\"database\") -> query(\"UPDATE server.configs SET \" . $v . \" WHERE key_='\" . $this -> key . \"'\");\n\t}", "private static function writeConfig($config)\n {\n self::init();\n\n return file_put_contents(self::$configFile, json_encode((object) $config, JSON_PRETTY_PRINT));\n }", "public function saveConfig($data, $values);", "abstract protected function saveConfiguration($name, $value);", "public function save()\n\t{\n\t\t$this->componentConfig->save();\n\t}", "public function store()\n {\n $classes = [];\n\n foreach ($this->classes as $class) {\n $classes[] = $class['input_file'];\n }\n\n $json_classes = json_encode($classes);\n\n $this->filesystem->put(config('larinterface.cache_directory') . '/larinterface.json', $json_classes);\n }", "public function write(array $options, ConfigInterface $config);", "public function saveSettings()\n {\n if (empty($this->settings)) {\n $this->loadSettings();\n }\n \n $this->saveJSON($this->settings);\n }", "function configWriter($configs){\n\t\t\t\tglobal $scope_id;\n\t\t\t\t$appearanceSwitch = new Mage_Core_Model_Config();\n\t\t\t\tforeach($configs as $section => $value){\n\t\t\t\t\tif($scope_id){\n\t\t\t\t\t\t$appearanceSwitch->saveConfig($section, $value, 'stores', $scope_id);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$appearanceSwitch->saveConfig($section, $value, 'default', 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "private function save() {\n global $config;\n\n //Save Config\n file_put_contents($config[\"usersFile\"],json_encode($this->users,JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT));\n }", "public function ovpnWriteConfig($path)\n {\n //unset($path);\n $myfile = fopen($path, \"w\") or die(\"Unable to open file!\");\n fclose($myfile);\n $myfile = fopen($path, \"a\") or die(\"Unable to open file!\");\n foreach ($this as $key=>$value) {\n if ($key == \"keys\") {\n $key = \"key\";\n }\n if ($key == \"maxclients\") {\n $key = \"max-clients\";\n }\n if ($value == \"\" or $value === null) {\n continue;\n }\n if (strpos($key, '_') !== false) {\n $key = str_replace(\"_\", \"-\", $key);\n }\n if ($key == \"compression\" or $key == \"srvConfigPath\") {\n continue;\n }\n if ($key == \"client-to-client\") {\n fwrite($myfile, \"$value\\n\");\n continue;\n }\n if ($key == \"push-routes\" or $key == \"push-dns\") {\n $quo = '\"';\n $key = \"push\";\n $value = \"$quo$value$quo\\n\";\n }\n if ($key == \"push-gateway\") {\n fwrite($myfile, \"push $quo$value$quo\\n\");\n continue;\n }\n fwrite($myfile, \"$key $value\\n\");\n }\n fclose($myfile);\n //Done setting config, lets save the new object of items in a file for later processing\n $myfile = fopen(\"./vpn/urgent.conf\", \"w\") or die(\"Unable to open file!\");\n fwrite($myfile, serialize($this));\n fclose($myfile);\n }", "public function writeConfig(string $filename, $data, array $parent = array())\n\t{\n\t\t$out = $this->writeConfigRec((array)$data);\n\t\t\n\t\tif (substr($filename, 0, 1 ) != \"/\")\n\t\t\t$filename = BP.'/app/config/'.$filename;\n\t\t\n\t\tfile_put_contents($filename, trim($out));\n\t}", "public function writeConfig($config) {\n if(!is_array($config)) {\n trigger_error(\"writeConfig must be called with an array\");\n return FALSE;\n }\n \n if(!$this->_connected) {\n trigger_error(\"Can't write config when not connected\");\n return FALSE;\n }\n \n $toWrite = \"; Config written at \" . date('m-d-Y h:i:s') . \"\\n\";\n $toWrite .= \"; PDU writer version \" . VERSION . \"\\n\";\n $toWrite .= \"; 2011 Kevin O'Connor - [email protected]\\n\";\n \n foreach($config as $directive => $values) {\n $toWrite .= '[' . $directive . \"]\\n\";\n \n foreach($values as $configName => $configValue) {\n $toWrite .= $configName . \"=\" . $configValue . \"\\n\";\n }\n }\n \n if(!file_put_contents('configs/' . $this->_ip . '.ini_updated', $toWrite)) {\n trigger_error(\"Couldn't write temporary config\");\n return FALSE;\n }\n \n if(!ftp_put($this->_ftpConnection, 'config.ini', 'configs/' . $this->_ip . '.ini_updated', FTP_ASCII)) {\n trigger_error(\"Couldn't ftp_put\");\n return FALSE;\n }\n\t\n\tunlink('configs/' . $this->_ip . '.ini_updated');\n\tunlink('configs/' . $this->_ip . '.ini');\n \n return TRUE;\n }", "public function store()\n {\n $this->storeKeys();\n }", "public function save()\n\t\t{\n#DS_Database_Archive::_log(__METHOD__.'()');\n\t\t\tif ( $this->_dirty ) {\n#DS_Database_Archive::_log(__METHOD__.'() data is dirty');\n\t\t\t\tif ( NULL !== $this->option_name ) {\n\t\t\t\t\tset_option( $this->option_name, $this->_options );\n\t\t\t\t} else if ( NULL !== $this->filename ) {\n\t\t\t\t\t// save to filesystem\n#DS_Database_Archive::_log(__METHOD__.'() saving to file ' . $this->filename);\n\t\t\t\t\t$output = json_encode( $this->_options, JSON_PRETTY_PRINT );\n#DS_Database_Archive::_log(__METHOD__.'() contents: ' . $output);\n\t\t\t\t\tfile_put_contents( $this->filename, $output );\n\t\t\t\t}\n\t\t\t\t$this->_dirty = FALSE;\n\t\t\t}\n\t\t}", "public function saveSettings()\n {\n return $this->config->saveFile();\n }", "public function saveConfigOptions() {}", "public function storeBackupConfig($filepath, array $data);", "function write_config($data) {\n\n\t\t// Config path\n\t\t$template_path \t= 'config-sample.php';\n\t\t$output_path \t= 'config.php';\n\n\t\t// Open the file\n\t\t$database_file = file_get_contents($template_path);\n\n\t\t$new = str_replace(\"%DB_HOST%\",$data['db_host'],$database_file);\n\t\t$new = str_replace(\"%DB_USERNAME%\",$data['db_username'],$new);\n\t\t$new = str_replace(\"%DB_PASSWORD%\",$data['db_password'],$new);\n\t\t$new = str_replace(\"%DB_NAME%\",$data['db_name'],$new);\n\t\t$new = str_replace(\"%SITE_URL%\",$data['site_url'],$new);\n\n\t\t// Write the new database.php file\n\t\t$handle = fopen($output_path,'w+');\n\n\t\t// Chmod the file, in case the user forgot\n\t\t@chmod($output_path,0777);\n\n\t\t// Verify file permissions\n\t\tif(is_writable($output_path)) {\n\n\t\t\t// Write the file\n\t\t\tif(fwrite($handle,$new)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function config_save() {\n }", "public function store() {\n $logData = \"=========================================\\n\";\n $logData .= \"Date Time: \".$this->record_date.\"\\n\";\n $logData .= $this->title.\" (\".$this->type.\") \\n\";\n if(!empty($this->data)) {\n $logData .= var_export($this->data, true).\"\\n\";\n }\n \n file_put_contents($this->file, $logData, FILE_APPEND);\n \n }", "private function writeConfig(string $key, array $config)\n {\n $this->initialize();\n $configuration = sprintf('<?php return %s;', var_export($config, true));\n file_put_contents(\n $this->directoryList->getPath(DirectoryList::GENERATED_METADATA) . '/' . $key . '.php',\n $configuration\n );\n }", "protected function _save()\n\t{\n\t\t$_file = $this->_storagePath . DIRECTORY_SEPARATOR . $this->_fileName;\n\n\t\t$_data = json_encode( $this->contents() );\n\n\t\tif ( $this->_compressStore )\n\t\t{\n\t\t\t$_data = Utility\\Storage::freeze( $this->contents() );\n\t\t}\n\n\t\tif ( false === file_put_contents( $_file, $_data ) )\n\t\t{\n\t\t\tUtility\\Log::error( 'Unable to store Oasys data in \"' . $_file . '\". System error.' );\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "protected function writeMetadata() {\n $_SESSION[self::METADATA_KEY] = $this->metadata;\n }", "public function writeAll()\n {\n foreach( $this->values as $name => $value ){\n $this->_write( s($name), s($value) );\n }\n }", "public function write_db_config() {\r\n $template = file_get_contents(MODULES . 'install/assets/config/database.php');\r\n\r\n $replace = array(\r\n '__HOSTNAME__' => $this->hostname,\r\n '__USERNAME__' => $this->username,\r\n '__PASSWORD__' => $this->password,\r\n '__DATABASE__' => $this->database,\r\n '__PORT__' => $this->port,\r\n '__DRIVER__' => $this->driver,\r\n '__PREFIX__' => $this->prefix,\r\n );\r\n\r\n $template = str_replace(array_keys($replace), $replace, $template);\r\n\r\n $handle = @fopen(APPPATH . 'config/database.php', 'w+');\r\n\r\n if ($handle !== FALSE) {\r\n $response = @fwrite($handle, $template);\r\n fclose($handle);\r\n\r\n if ($response) {\r\n return TRUE;\r\n }\r\n }\r\n\r\n throw new Exception('Failed to write to ' . APPPATH . 'config/database.php');\r\n }", "protected function saveJSON(&$data)\n {\n $this->validateParameters();\n \n $json = array_to_json($data);\n \n if (!empty($this->save_encrypted)) {\n $json = aes_256_encrypt($json, $this->salt_key);\n }\n \n if (file_put_contents($this->save_path, $json) === false) {\n throw new \\Exception(sprintf(\"The config file '%s' cannot be written!\", $this->save_path));\n }\n \n if ($this->use_apcu) {\n apcu_delete(\"config_settings\");\n }\n }", "protected function store()\n\t{\n\t\t// rebuild the keys table\n\t\t$this->reindex();\n\n\t\t//throw new Exception(\"Not yet implemented!\");\n\t\t\t\t//---------------------\n\n $domDoc = new DOMDocument;\n $rootElt = $domDoc->createElement('items');\n $rootNode = $domDoc->appendChild($rootElt);\n\n foreach($this->_data AS $row) {\n $rowElement = $domDoc->createElement('item');\n\n foreach($row AS $key => $value) {\n\n $element = $domDoc->createElement($key);\n $element->appendChild($domDoc->createTextNode($value));\n\n $rowElement->appendChild($element);\n }\n $rootNode->appendChild($rowElement);\n\n }\n\n $data = $domDoc->saveXML();\n\n //var_dump($data);\n\n file_put_contents($this->_origin, $data);\n\n\t\t// --------------------\n\t}", "function config_save($cfg) {\n\t\t$h = fopen(CONFIG_PATH,\"w+\");\n\t\tforeach ($cfg as $cam) {\n\t\t\t$cam_info = $cam[\"name\"].\" : \".$cam[\"hw\"].\"\\t\".$cam[\"width\"].\"x\".$cam[\"height\"].\"\\n\";\n\t\t\tfwrite($h, $cam_info);\n\t\t\tforeach ($cam[\"gates\"] as $gate) {\n\t\t\t\t$gate_info = \"\\t\".$gate[\"name\"].\"\\t(\".$gate[\"x1\"].\",\".$gate[\"y1\"].\")\\t(\".$gate[\"x2\"].\",\".$gate[\"y2\"].\")\\n\";\n\t\t\t\tfwrite($h, $gate_info);\n\t\t\t}\n\t\t}\n\t\tfclose($h);\n\t}", "protected function writeConfiguration(array $data): bool\n {\n $projectRoot = PxApp::projectRootPath();\n $configFilename = PxApp::CONFIG_FILENAME;\n\n $configuration = PxApp::getConfiguration()\n ->getContext(ConfigOverlay::DEFAULT_CONTEXT)\n ->combine($data)\n ->export();\n\n $results = $this->taskWriteToFile(\"{$projectRoot}/{$configFilename}.yml\")\n ->text(Yaml::dump($configuration, 10, 4))\n ->run();\n\n return $results->wasSuccessful();\n }", "public function write($data);", "public function write($data);", "public function write($data);", "public function write($data);", "public static function write($name, $value)\n {\n $settingsObj = self::getInstance();\n $settingsObj->data = ArrayUtils::setValue($settingsObj->data, $name, $value);\n }", "private function flush(): void {\n file_put_contents(APP_ROOT . '/public/config/lang/dictionary.json',\n json_encode([\\Config::Dictionary => $this->dictionary]));\n }", "public function saveCache()\n {\n if($this->isCacheExists()){\n if($this->isUpdateRequired()){\n $this->updateCache();\n }\n } else {\n $this->packData()->writeFile();\n }\n }", "protected function saveConfig() {\n return $this->updateConfigValues(array(\n 'PAYNETEASY_END_POINT',\n 'PAYNETEASY_LOGIN',\n 'PAYNETEASY_SIGNING_KEY',\n 'PAYNETEASY_SANDBOX_GATEWAY',\n 'PAYNETEASY_PRODUCTION_GATEWAY',\n 'PAYNETEASY_GATEWAY_MODE'\n ));\n }", "protected function writeConfig(array $nonDefaultValues)\n {\n $configValues = self::$configValues;\n foreach ($nonDefaultValues as $name => $value) {\n $configValues[$name] = $value;\n }\n file_put_contents(self::$configFile, json_encode($configValues));\n }", "public function write(array $values)\n {\n foreach($values as $key => $value) {\n $this->set($key, $value);\n list($filename, $item) = $this->parseKey($key);\n $config[$filename][$item] = $value;\n }\n\n foreach($config as $filename => $items) {\n $path = config_path($filename . '.php');\n if (!is_writeable($path)) throw new \\Exception('Configuration file ' . $filename . '.php is not writeable.');\n if (!$this->rewrite->toFile($path, $items)) throw new \\Exception('Unable to update configuration file ' . $filename . '.php');\n }\n }", "public static function save()\n\t{\n\t\tConfigManager::save('discord', self::load(), 'config');\n\t}", "private function putConfig(): void\n {\n /** @var array<string, array<string, string>> $alertOutputsFromConfig */\n $alertOutputsFromConfig = config('alert.output', []);\n\n foreach ($alertOutputsFromConfig as $plugin => $map) {\n if ($this->desiredOutput !== null && $this->desiredOutput != $plugin) {\n $this->session->remove(\"alert.$plugin\");\n continue;\n }\n\n $output = [];\n foreach ($map as $from => $to) {\n $output[$from] = $this->fields[$to] ?? '';\n }\n\n $this->session->put(\"alert.$plugin\", json_encode($output));\n }\n }", "public function save()\n {\n $this->readCache();\n\n file_put_contents($this->filePath, json_encode($this->cacheContents));\n }", "public function saveSettingAction(){\n $configKey = array('api_key', 'api_secret','include_folders','resize_auto',\n 'resize_image','min_size','max_size','compression_type_pdf','compression_type_png','compression_type_jpg','compression_type_gif', 'saving_auto', 'compress_auto', 'cron_periodicity', 'reindex_init');\n $coreConfig = Mage::getConfig();\n $post = $this->getRequest()->getPost();\n foreach ($configKey as $key) { \n if (isset($post[$key])) { \n $coreConfig->saveConfig(\"mageio_\".$key, Mage::helper('core')->escapeHtml($post[$key]))->cleanCache();\n }\n }\n\t\t$installed_time = Mage::getStoreConfig('mageio_installed_time');\n if(empty($installed_time)) {\n $installed_time = time();\n $coreConfig = Mage::getConfig();\n $coreConfig->saveConfig('mageio_installed_time', Mage::helper('core')->escapeHtml($installed_time))->cleanCache();\n }\n\t\t//Remove error message if set\n\t\t$coreConfig->saveConfig(\"mageio_errormessage\", Mage::helper('core')->escapeHtml(null))->cleanCache();\n\t\t\n\t\t$this->_redirect('imagerecycle/index/index');\n\t}", "public function dumpConfig()\n {\n $file = $this->buildDir . DIRECTORY_SEPARATOR . 'settings.json';\n $config = json_encode(get_object_vars($this), JSON_PRETTY_PRINT);\n\n $this->logger->info('Dumping test config {config} to {file}', ['file' => $file, 'config' => $config]);\n file_put_contents($file, $config);\n }", "public function save()\n\t{\n\t\tFile::disk()->put($this->configPath, YAML::dump($this->configData));\n\n\t\tArtisan::call(sprintf('favicon:generate --site=%s', $this->handle));\n\t}", "public function write();", "public function write();", "function _write_config_file($values){\n $db_server = $values['db_server'] ?: \"\";\n $db_name = $values['db_name'] ?: \"\";\n $db_user = $values['db_user'] ?: \"\";\n $db_password = $values['db_password'] ?: \"\";\n $mynautique_enabled = (isset($values['mynautique_enabled']) && $values['mynautique_enabled'] == TRUE) ? \"TRUE\" : \"FALSE\";\n $mynautique_user = isset($values['mynautique_user']) && $mynautique_enabled == \"TRUE\" ? $values['mynautique_user'] : \"\";\n $mynautique_password = isset($values['mynautique_password']) && $mynautique_enabled == \"TRUE\" ? $values['mynautique_password'] : \"\";\n\n // write configuration file (only after schema is applied)// build the configuration for the configuration file\n $config_string = '<?php'.\"\\n\";\n $config_string .= '// Database Configuration'.\"\\n\";\n $config_string .= '//==================================================='.\"\\n\";\n $config_string .= '// database server'.\"\\n\";\n $config_string .= '$config[\\'db_server\\'] = \"'. $db_server .'\";'.\"\\n\";\n $config_string .= '// database'.\"\\n\";\n $config_string .= '$config[\\'db_name\\'] = \"'. $db_name .'\";'.\"\\n\";\n $config_string .= '// database user'.\"\\n\";\n $config_string .= '$config[\\'db_user\\'] = \"'. $db_user .'\";'.\"\\n\";\n $config_string .= '// database user password'.\"\\n\";\n $config_string .= '$config[\\'db_password\\'] = \"'. $db_password .'\";'.\"\\n\";\n $config_string .= \"\\n\";\n\n if ( isset($values['mynautique_enabled'])) {\n $config_string .= '// MyNautique Configuration'.\"\\n\";\n $config_string .= '//==================================================='.\"\\n\";\n $config_string .= '// myNautique enabled'.\"\\n\";\n $config_string .= '$config[\\'mynautique_enabled\\'] = '.$mynautique_enabled .';'.\"\\n\";\n $config_string .= '// myNautique user'.\"\\n\";\n $config_string .= '$config[\\'mynautique_user\\'] = \"'. $mynautique_user .'\";'.\"\\n\";\n $config_string .= '// myNautique password'.\"\\n\";\n $config_string .= '$config[\\'mynautique_password\\'] = \"'. $mynautique_password .'\";'.\"\\n\";\n }\n\n $config_string .= '?>'.\"\\n\";\n\n $bytes_written = file_put_contents (\"../config/config.php\", $config_string);\n\n if($bytes_written == FALSE) {\n return $bytes_written;\n }\n return TRUE;\n }", "protected function saveConfiguration($name, $value)\n {\n // TODO: Implement saveConfiguration() method.\n }", "public function write ($contents)\n {\n if (is_array($contents) && count($contents) > 0) {\n Zend_Json::$useBuiltinEncoderDecoder = true;\n $data_storage['session_id'] = $this->_session_id;\n $data_storage['user_ip'] = $this->_user_ip;\n $data_storage['time'] = time();\n $data_storage['data'] = Zend_Json::encode($contents);\n if (isset($contents['username'])) {\n $data_storage['username'] = $contents['username'];\n }\n if (isset($contents['id'])) {\n $data_storage['user_id'] = $contents['id'];\n }\n if (isset($contents['is_admin'])) {\n $data_storage['is_admin'] = $contents['is_admin'];\n }\n if (isset($contents['client_id'])) {\n $data_storage['client_id'] = $contents['client_id'];\n }\n if (isset($contents['guest'])) {\n $data_storage['guest'] = $contents['guest'];\n }\n $this->_storage->setOptions($data_storage);\n if (isset($data_storage['user_id']) && isset($data_storage['username']) && $data_storage['user_id'] > 0) {\n $this->_storage->save();\n }\n }\n }", "public function flush()\n {\n self::$configs = [];\n }", "public function _write($data)\n {\n }", "public function store($contents)\n {\n file_put_contents(self::$dataFolder . '/' . time() . '.data', serialize($contents));\n }", "private function saveData() {\n // Create a new object with relevant information\n $data = new stdClass();\n $data->accessToken = $this->accessToken;\n $data->expirationDate = $this->expirationDate;\n $data->refreshToken = $this->refreshToken;\n\n // And save it to disk (will automatically create the file for us)\n file_put_contents(DATA_FILE, json_encode($data));\n }", "abstract public function write($data);", "function write_config()\n\t{\n\t\t$charmap \t= $this->paths['tempdir'].'/'.$this->paths['config'];\n\t\t$handle \t= @fopen( $charmap, 'w' );\n\t\t\n\t if ($handle)\n\t {\n\t fwrite( $handle, '<?php $chars = array();');\n\t \n\t foreach($this->svg_config[$this->font_name] as $unicode)\n\t {\n\t \tif(!empty($unicode))\n\t \t{\n\t \t\t$delimiter = \"'\";\n\t \t\tif(strpos($unicode, \"'\") !== false) $delimiter = '\"';\n\t \t\tfwrite( $handle, \"\\r\\n\".'$chars[\\''.$this->font_name.'\\']['.$delimiter.$unicode.$delimiter.'] = '.$delimiter.$unicode.$delimiter.';' );\n\t \t}\n\t } \t \n\t \n\t fclose( $handle );\n\t }\n\t else\n\t {\n\t \t$this->delete_folder($this->paths['tempdir']);\n\t\t\texit('Was not able to write a config file');\n\t }\n\t\t\n\t\t\n\t}", "public function save()\n {\n\n // Create config folder if it does not exist.\n $fs = new Filesystem();\n $dumper = new Dumper();\n\n if (!$fs->exists(getenv('HOME').'/.talos')) {\n try {\n $fs->mkdir(getenv('HOME').'/.talos/apps');\n } catch (IOExceptionInterface $e) {\n return false;\n }\n }\n\n try {\n $fs->dumpFile(getenv('HOME').'/.talos/talos.yml', $dumper->dump($this->config, 10));\n\n return true;\n } catch (IOExceptionInterface $e) {\n return false;\n }\n }", "public function exportConfiguration() {}", "public function write(string $path, $contents, string $visibility = null)\n {\n if ($visibility === null) {\n if (!isset($this->config['visibility'])) {\n throw new StorageConfigException('Missing storage \"visibility\" config.');\n }\n\n $visibility = $this->config['visibility'];\n }\n\n $this->config = ['visibility' => $visibility];\n\n if (gettype($contents) == 'string') {\n $this->adapter->write($path, $contents, $this->config);\n } else if (gettype($contents) == 'resource') {\n $this->adapter->writeStream($path, $contents, $this->config);\n }\n }", "public function store()\n {\n // Get the json data from the electric imp\n $jsonbody = file_get_contents('php://input');\n\n // Decode the json so we can see if the device id is ours\n $json = json_decode($jsonbody, false);\n\n if ($json[0]['device'] != SensorController::DEVICE_ID)\n return;\n\n $this->sensorModel->saveData($jsonbody);\n }", "public function write($data) {\n\t}", "public function save() {\n $configdata = $this->get('configdata');\n if (!array_key_exists('defaultvalue_editor', $configdata)) {\n $this->field->save();\n return;\n }\n\n if (!$this->get('id')) {\n $this->field->save();\n }\n\n // Store files.\n $textoptions = $this->value_editor_options();\n $tempvalue = (object) ['defaultvalue_editor' => $configdata['defaultvalue_editor']];\n $tempvalue = file_postupdate_standard_editor($tempvalue, 'defaultvalue', $textoptions, $textoptions['context'],\n 'customfield_textarea', 'defaultvalue', $this->get('id'));\n\n $configdata['defaultvalue'] = $tempvalue->defaultvalue;\n $configdata['defaultvalueformat'] = $tempvalue->defaultvalueformat;\n unset($configdata['defaultvalue_editor']);\n $this->field->set('configdata', json_encode($configdata));\n $this->field->save();\n }", "public function save()\n\t{\n\t\t// -> means the file was never loaded because no setting was changed\n\t\t// -> means no need to save\n\t\tif ($this->settings === null) return;\n\t\t\n\t\t$yaml = Spyc::YAMLDump($this->settings);\n\t}", "public function store(Requests\\StoreConfigRequest $request)\n {\n $this->config->create(\n $request->only('pageTitle', 'footerContent', 'address', 'phone', 'fax', 'email', 'map')\n );\n\n return redirect(route('backend.config.index'))->with('status', 'Config has been created.');\n }", "public function saveConfig() {\r\n\t$configObj = new \\config(PROFILE_PATH . '/' . $this->name . '/config.php', TRUE);\r\n\t$config = array();\r\n\tinclude($this->name . '/config.php');\r\n\t$config = array_intersect_key(\\app::$config, $config);\r\n\treturn $configObj->saveConfig($config);\r\n }", "protected function _write() {}", "protected function setConfigValue($data){\t\n\t\tMage::getModel('core/config_data')->load($data['path'],'path')->setData($data)->save();\n\t}", "public function save()\n {\n if ( !$this->unsaved ) {\n // either nothing has been changed, or data has not been loaded, so\n // do nothing by returning early\n return;\n }\n\n $this->write();\n $this->unsaved = false;\n }", "public function save($name) \n {\n // Lowercase the $name\n $name = strtolower($name);\n \n // Check to see if we need to put this in an array\n $ckey = $this->files[$name]['config_key'];\n if($ckey != FALSE)\n {\n $Old_Data = $this->data[$name];\n $this->data[$name] = array(\"$ckey\" => $this->data[$name]);\n }\n\n // Create our new file content\n $cfg = \"<?php\\n\";\n\n // Loop through each var and write it\n foreach( $this->data[$name] as $key => $val )\n {\n switch( gettype($val) )\n {\n case \"boolean\":\n $val = ($val == true) ? 'true' : 'false';\n // donot break\n case \"integer\":\n case \"double\":\n case \"float\":\n $cfg .= \"\\$$key = \" . $val . \";\\n\";\n break;\n case \"array\":\n $val = var_export($val, TRUE);\n $cfg .= \"\\$$key = \" . $val . \";\\n\";\n break;\n case \"NULL\":\n $cfg .= \"\\$$key = null;\\n\";\n break;\n case \"string\":\n $cfg .= (is_numeric($val)) ? \"\\$$key = \" . $val . \";\\n\" : \"\\$$key = '\" . addslashes( $val ) . \"';\\n\";\n break;\n default: break;\n }\n }\n\n // Close the php tag\n $cfg .= \"?>\";\n \n // Add the back to non array if we did put it in one\n if($ckey != FALSE)\n {\n $this->data[$name] = $Old_Data;\n }\n \n // Copy the current config file for backup, \n // and write the new config values to the new config\n copy($this->files[$name]['file_path'], $this->files[$name]['file_path'].'.bak');\n if(file_put_contents( $this->files[$name]['file_path'], $cfg )) \n {\n return TRUE;\n } \n else \n {\n return FALSE;\n }\n }", "function saveConfig(Config_Lite $inConfig) {\r\n\t\ttry {\r\n $inConfig->save();\r\n\t\t} catch (Config_Lite_Exception $e) {\r\n\t\t\techo \"\\n\" . 'Exception Message: ' . $e->getMessage();\r\n\t\t\twrite_log('Error saving configuration.','ERROR');\r\n\t\t}\r\n\t\t$configFile = dirname(__FILE__) . '/config.ini.php';\r\n\t\t$cache_new = \"'; <?php die('Access denied'); ?>\"; // Adds this to the top of the config so that PHP kills the execution if someone tries to request the config-file remotely.\r\n\t\t$cache_new .= file_get_contents($configFile);\r\n\t\tfile_put_contents($configFile,$cache_new);\r\n\t\t\r\n\t}", "public function save($values)\n {\n $values = json_encode($values);\n Storage::put($this->storename, $values);\n }", "function saveSettings()\n\t\t{\n\t\t\t$this->Init();\n\n\t\t\t$this->saveExternalSettings();\n\t\t\t\n\t\t\t$settings = serialize(array(\"settings\"=>$this->settings));\n\t\n\t\n\t\t\t$stream = mapi_openpropertytostream($this->store, PR_EC_WEBACCESS_SETTINGS, MAPI_CREATE | MAPI_MODIFY);\n\t\t\tmapi_stream_setsize($stream, strlen($settings));\n\t\t\tmapi_stream_seek($stream, 0, STREAM_SEEK_SET);\n\t\t\tmapi_stream_write($stream, $settings);\n\t\t\tmapi_stream_commit($stream);\n\t\n\t\t\tmapi_savechanges($this->store);\n\t\n\t\t\t// reload settings from store...\n\t\t\t$this->retrieveSettings();\n\t\t}", "public function store($value) {\r\n $h = null;\r\n if (isset($this->handle)) {\r\n $h = $this->handle;\r\n }\r\n else {\r\n $h = $this->_open();\r\n flock($h, LOCK_EX); // exclusive lock for writing\r\n }\r\n if ($this->option_create) { // mode == 'a+'\r\n ftruncate($h,0);\r\n }\r\n $result = fwrite($h, $value);\r\n if (is_null($this->handle)) {\r\n flock($h, LOCK_UN);\r\n fclose($h);\r\n }\r\n }", "public function sync()\n {\n $result = '';\n foreach ($this->hosts() as $host) {\n $result .= $host;\n $result .= \"\\n\";\n }\n file_put_contents($this->configFilePath(), $result);\n }", "private function storeSchedule()\n\t{\n\t\tfile_put_contents('schedule.json', json_encode(self::$schedule));\n\n\t\t// Sleeping 1/10s to avoid race conditions and reloading the file\n\t\tusleep(100000);\n\t\tself::loadSchedule();\n\t}", "function write_array( &$array2store ){\n die('decided to go anohter route - not done');\n // add the settings back at the bottom of the file\n reset($array2store);\n foreach( $array2store as $key => $val ){\n for( $x = 0 ; $x < count($values) ; ++$x ){ //yes count in a loop - only doing it since this is a single user script -- ohh yeah, sue me!\n exec(\"echo '\".$config_value.'['.$x.\"]=\\\"\".$values[$x].\"\\\"' >> '$this->_settings_file'\");\n ++$upcnt;\n }\n }\n\n }", "public function store() {\n\t\t//\n\t}", "public function store() {\n\t\t//\n\t}", "public function store() {\n\t\t//\n\t}", "protected function publishConfig()\n {\n $this->publishes([\n $this->basePath('config/flare/config.php') => config_path('flare/config.php'),\n ]);\n }", "function wroteConfig() {\n\t\treturn $this->wroteConfig;\n\t}", "public function save()\n {\n $data = $this->read_file();\n\n if (( ! $data))\n {\n $data = array();\n }\n\n $data[$this->id] = array(\n 'id' => $this->id,\n 'email' => $this->email,\n 'firstname' => $this->firstname,\n 'lastname' => $this->lastname,\n 'password' => $this->password,\n 'token' => $this->token,\n 'logins' => $this->logins,\n );\n\n $this->write_file($data);\n }", "public function writeFullConfFile()\n {\n return $this->writeFile(\n $this->getGitLocalRepositoryPath() . DIRECTORY_SEPARATOR .\n self::GITOLITE_CONF_DIR . self::GITOLITE_CONF_FILE,\n $this->renderFullConfFile()\n );\n }", "private static function save() {\n\t\tif(self::$data===null) throw new Excepton('Save before load!');\n\t\t$fp=fopen(self::$datafile,'w');\n\t\tif(!$fp) throw new Exception('Could not write data file!');\n\t\tforeach (self::$data as $item) {\n\t\t\tfwrite($fp,$item); // we use the __toString() here\n\t\t}\n\t\tfclose($fp);\n\t}", "private function write_config_data()\n\t{\n\t\t$captcha_url = '{base_url}images/captchas/';\n\n\t\tforeach (array('avatar_path', 'photo_path', 'signature_img_path', 'pm_path', 'captcha_path', 'theme_folder_path') as $path)\n\t\t{\n\t\t\t$prefix = ($path != 'theme_folder_path') ? $this->root_theme_path : '';\n\t\t\t$this->userdata[$path] = rtrim(realpath($prefix.$this->userdata[$path]), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;\n\t\t\t$this->userdata[$path] = str_replace($this->base_path, '{base_path}', $this->userdata[$path]);\n\t\t}\n\n\t\t$config = array(\n\t\t\t'db_port' => $this->userdata['db_port'],\n\t\t\t'db_hostname' => $this->userdata['db_hostname'],\n\t\t\t'db_username' => $this->userdata['db_username'],\n\t\t\t'db_password' => $this->userdata['db_password'],\n\t\t\t'db_database' => $this->userdata['db_name'],\n\t\t\t'db_dbprefix' => $this->getDbPrefix(),\n\t\t\t'db_char_set' => $this->userdata['db_char_set'],\n\t\t\t'db_collat' => $this->userdata['db_collat'],\n\t\t\t'app_version' => $this->userdata['app_version'],\n\t\t\t'debug' => '1',\n\t\t\t'site_index' => $this->userdata['site_index'],\n\t\t\t'site_label' => $this->userdata['site_label'],\n\t\t\t'base_path' => $this->base_path,\n\t\t\t'base_url' => $this->userdata['site_url'],\n\t\t\t'cp_url' => str_replace($this->userdata['site_url'], '{base_url}', $this->userdata['cp_url']),\n\t\t\t'site_url' => '{base_url}',\n\t\t\t'theme_folder_url' => '{base_url}themes/',\n\t\t\t'webmaster_email' => $this->userdata['email_address'],\n\t\t\t'webmaster_name' => '',\n\t\t\t'channel_nomenclature' => 'channel',\n\t\t\t'max_caches' => '150',\n\t\t\t'cache_driver' => 'file',\n\t\t\t'captcha_url' => $captcha_url,\n\t\t\t'captcha_path' => $this->userdata['captcha_path'],\n\t\t\t'captcha_font' => 'y',\n\t\t\t'captcha_rand' => 'y',\n\t\t\t'captcha_require_members' => 'n',\n\t\t\t'require_captcha' => 'n',\n\t\t\t'enable_sql_caching' => 'n',\n\t\t\t'force_query_string' => 'n',\n\t\t\t'show_profiler' => 'n',\n\t\t\t'include_seconds' => 'n',\n\t\t\t'cookie_domain' => '',\n\t\t\t'cookie_path' => '/',\n\t\t\t'cookie_prefix' => '',\n\t\t\t'website_session_type' => 'c',\n\t\t\t'cp_session_type' => 'c',\n\t\t\t'cookie_httponly' => 'y',\n\t\t\t'allow_username_change' => 'y',\n\t\t\t'allow_multi_logins' => 'y',\n\t\t\t'password_lockout' => 'y',\n\t\t\t'password_lockout_interval' => '1',\n\t\t\t'require_ip_for_login' => 'y',\n\t\t\t'require_ip_for_posting' => 'y',\n\t\t\t'require_secure_passwords' => 'n',\n\t\t\t'allow_dictionary_pw' => 'y',\n\t\t\t'name_of_dictionary_file' => '',\n\t\t\t'xss_clean_uploads' => 'y',\n\t\t\t'redirect_method' => $this->userdata['redirect_method'],\n\t\t\t'deft_lang' => $this->userdata['deft_lang'],\n\t\t\t'xml_lang' => 'en',\n\t\t\t'send_headers' => 'y',\n\t\t\t'gzip_output' => 'n',\n\t\t\t'is_system_on' => 'y',\n\t\t\t'allow_extensions' => 'y',\n\t\t\t'date_format' => '%n/%j/%Y',\n\t\t\t'time_format' => '12',\n\t\t\t'include_seconds' => 'n',\n\t\t\t'server_offset' => '',\n\t\t\t'default_site_timezone' => date_default_timezone_get(),\n\t\t\t'mail_protocol' => 'mail',\n\t\t\t'email_newline' => '\\n', // single-quoted for portability\n\t\t\t'smtp_server' => '',\n\t\t\t'smtp_username' => '',\n\t\t\t'smtp_password' => '',\n\t\t\t'email_smtp_crypto' => 'ssl',\n\t\t\t'email_debug' => 'n',\n\t\t\t'email_charset' => 'utf-8',\n\t\t\t'email_batchmode' => 'n',\n\t\t\t'email_batch_size' => '',\n\t\t\t'mail_format' => 'plain',\n\t\t\t'word_wrap' => 'y',\n\t\t\t'email_console_timelock' => '5',\n\t\t\t'log_email_console_msgs' => 'y',\n\t\t\t'log_search_terms' => 'y',\n\t\t\t'un_min_len' => '4',\n\t\t\t'pw_min_len' => '5',\n\t\t\t'allow_member_registration' => 'n',\n\t\t\t'allow_member_localization' => 'y',\n\t\t\t'req_mbr_activation' => 'email',\n\t\t\t'new_member_notification' => 'n',\n\t\t\t'mbr_notification_emails' => '',\n\t\t\t'require_terms_of_service' => 'y',\n\t\t\t'default_member_group' => '5',\n\t\t\t'profile_trigger' => 'member',\n\t\t\t'member_theme' => 'default',\n\t\t\t'enable_avatars' => 'y',\n\t\t\t'allow_avatar_uploads' => 'n',\n\t\t\t'avatar_url' => '{base_url}'.$this->userdata['avatar_url'],\n\t\t\t'avatar_path' => $this->userdata['avatar_path'],\n\t\t\t'avatar_max_width' => '100',\n\t\t\t'avatar_max_height' => '100',\n\t\t\t'avatar_max_kb' => '50',\n\t\t\t'enable_photos' => 'n',\n\t\t\t'photo_url' => '{base_url}'.$this->userdata['photo_url'],\n\t\t\t'photo_path' => $this->userdata['photo_path'],\n\t\t\t'photo_max_width' => '100',\n\t\t\t'photo_max_height' => '100',\n\t\t\t'photo_max_kb' => '50',\n\t\t\t'allow_signatures' => 'y',\n\t\t\t'sig_maxlength' => '500',\n\t\t\t'sig_allow_img_hotlink' => 'n',\n\t\t\t'sig_allow_img_upload' => 'n',\n\t\t\t'sig_img_url' => '{base_url}'.$this->userdata['signature_img_url'],\n\t\t\t'sig_img_path' => $this->userdata['signature_img_path'],\n\t\t\t'sig_img_max_width' => '480',\n\t\t\t'sig_img_max_height' => '80',\n\t\t\t'sig_img_max_kb' => '30',\n\t\t\t'prv_msg_enabled' => 'y',\n\t\t\t'prv_msg_allow_attachments' => 'y',\n\t\t\t'prv_msg_upload_path' => $this->userdata['pm_path'],\n\t\t\t'prv_msg_max_attachments' => '3',\n\t\t\t'prv_msg_attach_maxsize' => '250',\n\t\t\t'prv_msg_attach_total' => '100',\n\t\t\t'prv_msg_html_format' => 'safe',\n\t\t\t'prv_msg_auto_links' => 'y',\n\t\t\t'prv_msg_max_chars' => '6000',\n\t\t\t'enable_template_routes' => 'y',\n\t\t\t'strict_urls' => 'y',\n\t\t\t'site_404' => '',\n\t\t\t'save_tmpl_revisions' => 'n',\n\t\t\t'max_tmpl_revisions' => '5',\n\t\t\t'save_tmpl_files' => 'y',\n\t\t\t'deny_duplicate_data' => 'y',\n\t\t\t'redirect_submitted_links' => 'n',\n\t\t\t'enable_censoring' => 'n',\n\t\t\t'censored_words' => '',\n\t\t\t'censor_replacement' => '',\n\t\t\t'banned_ips' => '',\n\t\t\t'banned_emails' => '',\n\t\t\t'banned_usernames' => '',\n\t\t\t'banned_screen_names' => '',\n\t\t\t'ban_action' => 'restrict',\n\t\t\t'ban_message' => 'This site is currently unavailable',\n\t\t\t'ban_destination' => 'http://www.yahoo.com/',\n\t\t\t'enable_emoticons' => 'y',\n\t\t\t'emoticon_url' => '{base_url}'.'images/smileys/',\n\t\t\t'recount_batch_total' => '1000',\n\t\t\t'image_resize_protocol' => 'gd2',\n\t\t\t'image_library_path' => '',\n\t\t\t'thumbnail_prefix' => 'thumb',\n\t\t\t'word_separator' => 'dash',\n\t\t\t'use_category_name' => 'n',\n\t\t\t'reserved_category_word' => 'category',\n\t\t\t'auto_convert_high_ascii' => 'n',\n\t\t\t'new_posts_clear_caches' => 'y',\n\t\t\t'auto_assign_cat_parents' => 'y',\n\t\t\t'new_version_check' => 'y',\n\t\t\t'enable_throttling' => 'n',\n\t\t\t'banish_masked_ips' => 'y',\n\t\t\t'max_page_loads' => '10',\n\t\t\t'time_interval' => '8',\n\t\t\t'lockout_time' => '30',\n\t\t\t'banishment_type' => 'message',\n\t\t\t'banishment_url' => '',\n\t\t\t'banishment_message' => 'You have exceeded the allowed page load frequency.',\n\t\t\t'enable_search_log' => 'y',\n\t\t\t'max_logged_searches' => '500',\n\t\t\t'memberlist_order_by' => \"member_id\",\n\t\t\t'memberlist_sort_order' => \"desc\",\n\t\t\t'memberlist_row_limit' => \"20\",\n\t\t\t'is_site_on' => 'y',\n\t\t\t'theme_folder_path' => $this->userdata['theme_folder_path'],\n\t\t);\n\n\t\t// Default Administration Prefs\n\t\t$admin_default = array(\n\t\t\t'site_index',\n\t\t\t'base_url',\n\t\t\t'base_path',\n\t\t\t'cp_url',\n\t\t\t'site_url',\n\t\t\t'theme_folder_url',\n\t\t\t'webmaster_email',\n\t\t\t'webmaster_name',\n\t\t\t'channel_nomenclature',\n\t\t\t'max_caches',\n\t\t\t'captcha_url',\n\t\t\t'captcha_path',\n\t\t\t'captcha_font',\n\t\t\t'captcha_rand',\n\t\t\t'captcha_require_members',\n\t\t\t'require_captcha',\n\t\t\t'enable_sql_caching',\n\t\t\t'force_query_string',\n\t\t\t'show_profiler',\n\t\t\t'include_seconds',\n\t\t\t'cookie_domain',\n\t\t\t'cookie_path',\n\t\t\t'website_session_type',\n\t\t\t'cp_session_type',\n\t\t\t'allow_username_change',\n\t\t\t'allow_multi_logins',\n\t\t\t'password_lockout',\n\t\t\t'password_lockout_interval',\n\t\t\t'require_ip_for_login',\n\t\t\t'require_ip_for_posting',\n\t\t\t'require_secure_passwords',\n\t\t\t'allow_dictionary_pw',\n\t\t\t'name_of_dictionary_file',\n\t\t\t'xss_clean_uploads',\n\t\t\t'redirect_method',\n\t\t\t'deft_lang',\n\t\t\t'xml_lang',\n\t\t\t'send_headers',\n\t\t\t'gzip_output',\n\t\t\t'date_format',\n\t\t\t'time_format',\n\t\t\t'include_seconds',\n\t\t\t'server_offset',\n\t\t\t'default_site_timezone',\n\t\t\t'mail_protocol',\n\t\t\t'email_newline',\n\t\t\t'smtp_server',\n\t\t\t'smtp_username',\n\t\t\t'smtp_password',\n\t\t\t'email_smtp_crypto',\n\t\t\t'email_debug',\n\t\t\t'email_charset',\n\t\t\t'email_batchmode',\n\t\t\t'email_batch_size',\n\t\t\t'mail_format',\n\t\t\t'word_wrap',\n\t\t\t'email_console_timelock',\n\t\t\t'log_email_console_msgs',\n\t\t\t'log_search_terms',\n\t\t\t'deny_duplicate_data',\n\t\t\t'redirect_submitted_links',\n\t\t\t'enable_censoring',\n\t\t\t'censored_words',\n\t\t\t'censor_replacement',\n\t\t\t'banned_ips',\n\t\t\t'banned_emails',\n\t\t\t'banned_usernames',\n\t\t\t'banned_screen_names',\n\t\t\t'ban_action',\n\t\t\t'ban_message',\n\t\t\t'ban_destination',\n\t\t\t'enable_emoticons',\n\t\t\t'emoticon_url',\n\t\t\t'recount_batch_total',\n\t\t\t'new_version_check',\n\t\t\t'enable_throttling',\n\t\t\t'banish_masked_ips',\n\t\t\t'max_page_loads',\n\t\t\t'time_interval',\n\t\t\t'lockout_time',\n\t\t\t'banishment_type',\n\t\t\t'banishment_url',\n\t\t\t'banishment_message',\n\t\t\t'enable_search_log',\n\t\t\t'max_logged_searches',\n\t\t\t'theme_folder_path',\n\t\t\t'is_site_on'\n\t\t);\n\n\t\t$site_prefs = array();\n\n\t\tforeach($admin_default as $value)\n\t\t{\n\t\t\t$site_prefs[$value] = $config[$value];\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_system_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Default Members Prefs\n\t\t$member_default = array(\n\t\t\t'un_min_len',\n\t\t\t'pw_min_len',\n\t\t\t'allow_member_registration',\n\t\t\t'allow_member_localization',\n\t\t\t'req_mbr_activation',\n\t\t\t'new_member_notification',\n\t\t\t'mbr_notification_emails',\n\t\t\t'require_terms_of_service',\n\t\t\t'default_member_group',\n\t\t\t'profile_trigger',\n\t\t\t'member_theme',\n\t\t\t'enable_avatars',\n\t\t\t'allow_avatar_uploads',\n\t\t\t'avatar_url',\n\t\t\t'avatar_path',\n\t\t\t'avatar_max_width',\n\t\t\t'avatar_max_height',\n\t\t\t'avatar_max_kb',\n\t\t\t'enable_photos',\n\t\t\t'photo_url',\n\t\t\t'photo_path',\n\t\t\t'photo_max_width',\n\t\t\t'photo_max_height',\n\t\t\t'photo_max_kb',\n\t\t\t'allow_signatures',\n\t\t\t'sig_maxlength',\n\t\t\t'sig_allow_img_hotlink',\n\t\t\t'sig_allow_img_upload',\n\t\t\t'sig_img_url',\n\t\t\t'sig_img_path',\n\t\t\t'sig_img_max_width',\n\t\t\t'sig_img_max_height',\n\t\t\t'sig_img_max_kb',\n\t\t\t'prv_msg_enabled',\n\t\t\t'prv_msg_allow_attachments',\n\t\t\t'prv_msg_upload_path',\n\t\t\t'prv_msg_max_attachments',\n\t\t\t'prv_msg_attach_maxsize',\n\t\t\t'prv_msg_attach_total',\n\t\t\t'prv_msg_html_format',\n\t\t\t'prv_msg_auto_links',\n\t\t\t'prv_msg_max_chars',\n\t\t\t'memberlist_order_by',\n\t\t\t'memberlist_sort_order',\n\t\t\t'memberlist_row_limit'\n\t\t);\n\n\t\t$site_prefs = array();\n\n\t\tforeach($member_default as $value)\n\t\t{\n\t\t\t$site_prefs[$value] = $config[$value];\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_member_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Default Templates Prefs\n\t\t$template_default = array(\n\t\t\t'enable_template_routes',\n\t\t\t'strict_urls',\n\t\t\t'site_404',\n\t\t\t'save_tmpl_revisions',\n\t\t\t'max_tmpl_revisions',\n\t\t);\n\t\t$site_prefs = array();\n\n\t\tforeach($template_default as $value)\n\t\t{\n\t\t\t$site_prefs[$value] = $config[$value];\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_template_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Default Channels Prefs\n\t\t$channel_default = array(\n\t\t\t'image_resize_protocol',\n\t\t\t'image_library_path',\n\t\t\t'thumbnail_prefix',\n\t\t\t'word_separator',\n\t\t\t'use_category_name',\n\t\t\t'reserved_category_word',\n\t\t\t'auto_convert_high_ascii',\n\t\t\t'new_posts_clear_caches',\n\t\t\t'auto_assign_cat_parents',\n\t\t\t'enable_comments',\n\t\t\t'comment_word_censoring',\n\t\t\t'comment_moderation_override',\n\t\t\t'comment_edit_time_limit'\n\t\t);\n\n\t\t$site_prefs = array();\n\n\t\tforeach($channel_default as $value)\n\t\t{\n\t\t\tif (isset($config[$value]))\n\t\t\t{\n\t\t\t\t$site_prefs[$value] = $config[$value];\n\t\t\t}\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_channel_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Remove Site Prefs from Config\n\t\tforeach(array_merge($admin_default, $member_default, $template_default, $channel_default) as $value)\n\t\t{\n\t\t\tunset($config[$value]);\n\t\t}\n\n\t\t// Write the config file data\n\t\t$this->write_config_from_template($config);\n\n\t\treturn TRUE;\n\t}" ]
[ "0.7184266", "0.6727013", "0.66693735", "0.6667976", "0.64904344", "0.64337415", "0.63909715", "0.6359819", "0.6337933", "0.63310003", "0.63266534", "0.6322355", "0.6249194", "0.6135065", "0.61201805", "0.61148655", "0.6074609", "0.6011083", "0.5992508", "0.5975874", "0.59173256", "0.58988357", "0.5881742", "0.58776253", "0.5827507", "0.5802806", "0.57545227", "0.57465243", "0.5732514", "0.572991", "0.5706781", "0.566989", "0.56640226", "0.5653249", "0.5646505", "0.5634051", "0.5603685", "0.55589056", "0.5552009", "0.55348957", "0.5532035", "0.54939467", "0.54932857", "0.54914784", "0.54894316", "0.5454356", "0.5454356", "0.5454356", "0.5454356", "0.5447314", "0.54359627", "0.54305565", "0.54302484", "0.54251385", "0.5404917", "0.5398289", "0.5390922", "0.53835934", "0.5383289", "0.53753436", "0.53568846", "0.53492296", "0.53492296", "0.5345192", "0.53437936", "0.53429484", "0.5342743", "0.53329176", "0.5332706", "0.5331709", "0.5323127", "0.53129995", "0.530007", "0.52878976", "0.52808744", "0.5279821", "0.52763695", "0.5270901", "0.526635", "0.5246515", "0.5246485", "0.5239732", "0.52320415", "0.5227911", "0.52222365", "0.5218472", "0.52102274", "0.51917726", "0.5191702", "0.51794195", "0.5168916", "0.51630175", "0.5143938", "0.5143938", "0.5143938", "0.5143796", "0.5142807", "0.5138306", "0.5135738", "0.513108", "0.51294214" ]
0.0
-1
Deletes a configuration object from the storage.
public function delete($name);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteSettings()\n {\n $master = new DynaGridStore([\n 'id' => $this->dynaGridId,\n 'category' => DynaGridStore::STORE_GRID,\n 'storage' => $this->storage,\n 'userSpecific' => $this->userSpecific\n ]);\n $config = $this->storage == DynaGrid::TYPE_DB ? null : $master->fetch();\n $master->deleteConfig($this->category, $config);\n $this->store->delete();\n }", "protected function deleteConfiguration(){\n Configuration::deleteByName($this->name.'_settings');\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "abstract protected function deleteConfiguration($name);", "public function destroy(Config $config)\n {\n $config->delete();\n\n return redirect()->route('config.index')\n ->with('success','config deleted successfully');\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function remove() {\n $f = new File(self::CONFIG_FILE_PATH);\n $f->remove();\n }", "public function delete(): void\n {\n unlink($this->path);\n }", "public function delete() {\n\t\t$this->getConnection()->delete( $this );\n\t\t$this->clear();\n\t}", "public function deleteConfig() {\n\t\tif(!$this->_configId) throw new Exception(lang('error_126'));\n\t\tif(!$this->db->query(\"DELETE FROM \"._WE_CREDITSYS_.\" WHERE config_id = ?\", array($this->_configId))) {\n\t\t\tthrow new Exception(lang('error_142'));\n\t\t}\n\t}", "public function delete(ConfigItem $configItem)\n {\n $this->deleteMultiple([$configItem]);\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 final function delete() {\n }", "public function deleteConfiguration($identifier)\n {\n $this->getTable()->where('identifier', $identifier)->delete();\n }", "public function delete()\n {\n $this->repository->delete($this->id);\n }", "public function destroy(Configuration $configuration)\n {\n $this->authorize('delete', $configuration);\n $configuration->delete();\n }", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function instance_deleted() {\n $this->purge_all_definitions();\n @rmdir($this->filestorepath);\n }", "public function delete()\n\t{\n\t\t$this->hard_delete();\n\t}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function destroy($id)\n\t{\n\t\t$configuration = Configuration::findOrFail($id);\n\t\t$configuration->delete();\n\t\tsession()->flash('success_message', 'Configuration deleted successfully.');\n\t\treturn redirect()->action('UserController@show', ['user_id' => $configuration->user->id]);\n\t}", "public function destroy($id)\n {\n $post = $this->config->findOrFail($id);\n\n $post->delete();\n\n return redirect(route('backend.config.index'))->with('status', 'Config has been deleted.');\n }", "public function delete() {\n $this->logger->debug(\"Deleting session\");\n $this->repository->removeByKey($this->getKeys());\n self::$instance = null;\n }", "public function delete() {\r\n\t\t$this->getMapper()->delete($this);\r\n\t}", "private function deleteConfigurationEntry($id)\n\t{\n\t\treturn $this->engine->delete([\n\t\t\t'index' => $this->configurationIndexName,\n\t\t\t'type' => static::TYPE_CONFIGURATION,\n\t\t\t'id' => $id\n\t\t]);\n\t}", "public function destroy(Config $config)\n {\n $config->delete();\n \n return response()->json('La configuración se eliminó exitosamente');\n }", "public function delete() {\n\t\t$this->deleted = true;\n\t}", "public static function delete(string $key, string $config = 'default'): bool\n {\n return static::pool($config)->delete($key);\n }", "public function deleteObject($path)\n\t{\n\t\t// Re-authenticate if necessary\n\t\t$token = $this->getToken();\n\n\t\t// Get the URL to list containers\n\t\t$url = $this->getStorageEndpoint();\n\t\t$url = rtrim($url, '\\\\/');\n\t\t$path = ltrim($path, '\\\\/');\n\t\t$url .= '/' . $path;\n\n\t\t// Get the request object\n\t\t$request = new Request('DELETE', $url);\n\t\t$request->setHeader('X-Auth-Token', $token);\n\n\t\t$request->getResponse();\n\t}", "public static function del(string $id): void\n\t{\n\t\t\\unset(static::$config[$id]);\n\t}", "public function delete_config($data)\n {\n\n $this->db->where('id', $data);\n $this->db->delete('configuration');\n return true;\n }", "public function delete(): void\n {\n $this->instances->demo()->runHook($this->root(), 'delete:before', $this);\n\n Dir::remove($this->root());\n $this->instances->delete($this->id);\n\n $this->instances->demo()->runHook($this->root(), 'delete:after', $this);\n }", "public function destroy($id)\n {\n Config::destroy($id);\n return redirect('configs')->with('success', 'Config Deleted Successfully');\n }", "public function deleteValue($key) {\n\t\t$this->config->deleteKey($key);\n\t}", "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 {\n if (!$this->id) {\n throw new \\RuntimeException('You cannot delete a device without id');\n }\n\n\t\tPersistentSession::getInstance()->delete($this);\n }", "public function delete($key)\n {\n $data = new Data(self::$configs);\n\n $data->remove($key);\n self::$configs = $data->export();\n }", "public function clearConfig()\n {\n $this->_xcoobee->getStore()->clearStore();\n }", "public function delete()\n {\n $this->execute(\n $this->syntax->deleteSyntax(get_object_vars($this))\n );\n }", "public function destroy($id_configuracion)\n {\n configuraciones::destroy($id_configuracion);\n\n Session::flash('message','Configuracion eliminada correctamente');\n return Redirect::to('/configuracion');\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function deleteConfig($key) {\n\t $config = Mage::getConfig();\n\t $config->deleteConfig($key);\n\t}", "public function postDeleteKeyValueKeyConfig(Object_KeyValue_KeyConfig $config)\n {\n\n }", "public function destroy($configration_id)\n {\n $configration= configration::find($configration_id);\n\n\n $configration->delete();\n return redirect('/admin/configrations/index')->with('completed','configration deleted successfully');\n }", "public function delete($object)\n {\n $this->setObjectState($object, self::OBJ_REMOVED);\n }", "public function destroy($id)\n {\n return $this->configurationRepository->skipPresenter(true)->find($id)->delete();\n }", "public function remove(JobConfigurationInterface $configuration, $save = false);", "function remove() {\n global $db;\n $db->Execute(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_key in ('\" . implode(\"', '\", $this->keys()) . \"')\");\n }", "public function destroy($id)\n {\n return $this->horarioconfig->destroy($id); \n }", "public function delete($id){\n\t\t$sql = 'DELETE FROM contentstore_videouploadconfig WHERE id = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function delete()\n {\n return delete_option($this->hash);\n }", "function remove() {\r\n global $db;\r\n $db->Execute(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_key in ('\" . implode(\"', '\", $this->keys()) . \"')\");\r\n }", "public function deleted(Storage $storage)\n {\n //\n }", "public function delete()\n {\n delete_option($this->optionName);\n }", "public function delete()\n {\n // TODO: Implement delete() method.\n }", "public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }", "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 delete()\n {\n self::deleteById( $this->db, $this->id, $this->prefix );\n\n if( $this->inTransaction )\n {\n //$this->db->commit();\n $this->inTransaction = false;\n }\n }", "public function delete()\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 forceDelete();", "public static function delete($name)\n {\n unset(self::$settings[$name]);\n\n DB::table('settings')->where('name', $name)->delete();\n }", "public function delete( $args, $assoc_args ) {\n\n\t\tlist( $alias ) = $args;\n\n\t\t$config = ( ! empty( $assoc_args['config'] ) ? $assoc_args['config'] : '' );\n\n\t\tlist( $config_path, $aliases ) = $this->get_aliases_data( $config, $alias );\n\n\t\t$this->validate_config_file( $config_path );\n\n\t\tif ( empty( $aliases[ $alias ] ) ) {\n\t\t\tWP_CLI::error( \"No alias found with key '{$alias}'.\" );\n\t\t}\n\n\t\tunset( $aliases[ $alias ] );\n\t\t$this->process_aliases( $aliases, $alias, $config_path, 'Deleted' );\n\n\t}", "public function delete(GC_Model_Arquivo $object)\n\t{\n \t$this->getDbTable()->delete(array('id = ?' => $object->id));\n\t}", "public function delete (ValueObjectAbstract $valueObject);", "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 }", "public function destroy($id)\n {\n \t$ok=DB::table('config')->where('id',$id)->get()->toArray()[0]->status;\n\t\tif(!$ok){\n\t $res=DB::table('config')->delete($id);\n\t\t\tif($res){\n\t\t\t\treturn 1;\n\t\t\t}else{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}", "public abstract function delete();", "function delete_configuracion($id)\n {\n return $this->db->delete('configuracion',array('id'=>$id));\n }", "public function deleteDatabaseStructure( );", "public function delete() {\n if(!isset($this->id)) {\n $error = 'We need an id to delete an object with this method, if you don\\'t have any, use the static remove instead';\n $line = \"delete(\".$propname.\") => \" . $error;\n $this->writeErrorLog($line);\n throw new \\Exception($error);\n } else {\n foreach ($this->fillable as $key => $value) {\n $data[$key] = $this->$key;\n }\n $qb = $this::remove();\n $qb->where(['id' => $this->id])->make();\n return true;\n }\n }", "private function deleteSettings()\n\t{\n\t}", "public function delete()\n {\n Db::getInstance()->delete($this->getTableName(), ['id' => $this->getId()]);\n }", "protected function deleteStore() {\n $keys = ['entity_type', 'entity_id', 'export_type'];\n foreach ($keys as $key) {\n $this->store->delete($key);\n }\n }", "function deleteConf($id, $file=CONFERENCES){\n\t$confs = getJSON($file);\n\t$index = searchIndex($confs, $id);\n\tarray_splice($confs, $index, 1);\n\t\n\texport($confs, $file);\n}", "public function destroy($id)\n {\n //Valida se usuário possui permissão para acessar esta opção\n if(App\\Models\\User::getPermission('configs_remove',Auth::user()->user_type_code)){\n \n $config = $this->configRepository->findWithoutFail($id);\n\n if (empty($config)) {\n Flash::error(Lang::get('validation.not_found'));\n\n return redirect(route('configs.index'));\n }\n\n $this->configRepository->delete($id);\n\n //Grava log\n $descricao = 'Excluiu Config ID: '.$id;\n $log = App\\Models\\Log::wlog('configs_remove', $descricao);\n\n\n Flash::success(Lang::get('validation.delete_success'));\n return array(0,Lang::get('validation.delete_success'));\n\n }else{\n //Sem permissão\n Flash::error(Lang::get('validation.permission'));\n return array(1,Lang::get('validation.permission'));\n } \n }", "public function destroy($id)\n {\n //\n $re = Config::where('conf_id',$id)->delete();\n if($re){\n // $this->putFile();\n $data = [\n 'status'=>0,\n 'msg'=>'删除成功',\n ];\n }else{\n $data = [\n 'status'=>1,\n 'msg'=>'删除失败',\n ];\n }\n return $data;\n }", "public function deleted ( ScoreboardTeamConfig $config )\n {\n Cache::tags( [ 'Scoreboard', $config->event_instance->name ] )->flush();\n }", "public function destroy($id)\n\t{\n\t\t//\n\t\tif(!$this->permit->crud_configs_delete)\n return redirect('accessDenied');\n\t\tCepConfigs::where('conf_id',$id)->delete();\n\t\treturn redirect('configs');\n\t}", "public function forceDeleted(Storage $storage)\n {\n //\n }", "public function postDeleteKeyValueGroupConfig(Object_KeyValue_GroupConfig $config)\n {\n\n }", "public function delete(array $deleteKeys, Database_Config $databaseConfig = NULL);", "function remove() \r\n {\r\n $tbl = new Payment_Config;\r\n $tbl->delete('where `module_key`=?', array($this->module_key()));\r\n }", "public function delete() {\n\n\t\tif (is_multisite()) {\n\t\t\tdelete_site_option('wpo_cache_config');\n\t\t} else {\n\t\t\tdelete_option('wpo_cache_config');\n\t\t}\n\t\t\n\t\tif (!WPO_Page_Cache::delete(WPO_CACHE_CONFIG_DIR)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}" ]
[ "0.69860554", "0.6941031", "0.64523286", "0.63506347", "0.6270832", "0.6249473", "0.6176333", "0.6141203", "0.6109421", "0.6091004", "0.6072525", "0.606543", "0.6054349", "0.6054349", "0.6054349", "0.6054349", "0.6054349", "0.6054349", "0.6054349", "0.6054349", "0.6054349", "0.6054349", "0.6054349", "0.6054349", "0.6054349", "0.6054349", "0.6054349", "0.6043334", "0.6024914", "0.60043323", "0.5991693", "0.59912366", "0.5962021", "0.592538", "0.5922016", "0.5921775", "0.5921775", "0.59188414", "0.5913468", "0.5902128", "0.589551", "0.5889543", "0.58842325", "0.5874087", "0.5832478", "0.58282906", "0.58048856", "0.5804271", "0.5800618", "0.5785357", "0.5765321", "0.5752136", "0.5746274", "0.57388455", "0.5731404", "0.5730153", "0.5699861", "0.5691798", "0.5670506", "0.56695026", "0.5667358", "0.5660949", "0.5648417", "0.5648257", "0.5629807", "0.5627981", "0.5626004", "0.56211686", "0.56199825", "0.5617001", "0.5613302", "0.56003433", "0.5596935", "0.55910194", "0.55890954", "0.5586856", "0.5586772", "0.5563289", "0.5561539", "0.55550003", "0.55539453", "0.5540571", "0.5527131", "0.5512713", "0.550509", "0.55044913", "0.54985726", "0.5490073", "0.5485217", "0.54748505", "0.5461247", "0.5461006", "0.54595846", "0.54564345", "0.54448605", "0.5434559", "0.5433944", "0.5429393", "0.54273504", "0.5426615", "0.5425792" ]
0.0
-1
Renames a configuration object in the storage.
public function rename($name, $new_name);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rename(Storable $storable, string $newName): void;", "function rename($old_name,$name){\r\n $file = lako_ljson::make_ljson_file($old_name);\r\n $file = $this->loader->locate($file);\r\n $definition = lako::get('ljson')->require_file($file);\r\n $location = dirname($file);\r\n //edit definition\r\n $definition['table'] = $definition['name'] = $name;\r\n lako::get('ljson')->save($location.\"/{$name}\",$definition);\r\n @unlink($file);\r\n }", "public function rename($newname);", "public function rename($path, $newpath)\n {\n }", "public function rename($source, $destination);", "function setName( $newName )\r\n\t{\r\n\t\t$basePath = dirname( $this->path );\r\n\t\tif(rename( $this->path, $basePath.'/'.$newName ))\r\n\t\t{\r\n\t\t\t$this->path = $basePath.'/'.$newName;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ttrigger_error(\"Não foi possível renomear a pasta \" . $this->path);\r\n\t\t}\r\n\t}", "public function renameIfExists($setting = true) {\n\t\t$this->rename_if_exists = $setting;\n\t}", "public function rename($source, $target)\n {\n \n }", "public function changeCfg($name, $value)\n {\n return $this->storage->changeCfg($name, $value);\n }", "abstract protected function deleteConfiguration($name);", "public function testRenameTo()\n {\n /*\n * remove all tables\n */\n $tables = $this->fixture->getDBObject()->fetchList('SHOW TABLES');\n foreach($tables as $table) {\n $this->fixture->getDBObject()->simpleQuery('DROP TABLE '. $table['Tables_in_'.$this->fixture->a['db_name']]);\n }\n\n /*\n * create fresh store and check tables\n */\n $this->fixture->setup();\n\n $tables = $this->fixture->getDBObject()->fetchList('SHOW TABLES');\n foreach($tables as $table) {\n $this->assertTrue(\n false !== strpos($table['Tables_in_'.$this->fixture->a['db_name']], $this->dbConfig['db_table_prefix'].'_')\n );\n }\n\n /*\n * rename store\n */\n $prefix = 'new_store';\n $this->fixture->renameTo($prefix);\n\n /*\n * check for new prefixes\n */\n $tables = $this->fixture->getDBObject()->fetchList('SHOW TABLES');\n foreach($tables as $table) {\n $this->assertTrue(\n false !== strpos($table['Tables_in_'.$this->fixture->a['db_name']], $prefix)\n );\n }\n }", "public function renameModule($name, $newName);", "public function rename($name){\n\t\t$oldPath = $this->path;\n\t\t$path_array = explode(self::DS, $oldPath);\n\t\tarray_pop($path_array);\n\t\t$_newPath = implode(self::DS, $path_array);\n\t\t$newPath = $_newPath . self::DS . $name;\n\t\t$this->path = $newPath;\n\t\trename($oldPath, $newPath);\n\t}", "abstract protected function saveConfiguration($name, $value);", "public function rename($new_name) {\n\t\t$new_path = $this->getParentDirectory()->getPath().DIRECTORY_SEPARATOR.$new_name;\n\t\tif (!rename($this->getPath(), $new_path)) throw new \\Exception(\"Couldn't rename the file $this to $new_path\");\n\t\t$this->path = $new_path;\n\t}", "public function rename($entity, $name)\n\t{\n\t\t$entity->name = $name;\n\t\t$entity->save();\n\n return $entity;\n\t}", "public function setName($newName){\n\t}", "public function setNameAfterUploaded($name) {\n $this->_newName = $name;\n }", "public function replace(array $config) : ConfigInterface;", "public function rename_file( string $old_name, string $new_name ): void {\n\t\t$blob_client = $this->get_blob_client();\n\t\t$container_name = $this->get_container_name();\n\n\t\t$blob_client->copyBlob( $container_name, $new_name, $container_name, $old_name );\n\t\t$blob_client->deleteBlob( $container_name, $old_name );\n\t}", "public function rename()\n\t{\n\t\t$newValue = $this->name;\n\t\t$previousValue = $this->getPreviousValue('name');\n\t\t$fieldName = $this->fieldModel->getName();\n\n\t\t$dbCommand = \\App\\Db::getInstance()->createCommand();\n\t\t$dataReader = (new \\App\\Db\\Query())->select(['tablename', 'columnname', 'fieldid', 'tabid'])\n\t\t\t->from('vtiger_field')\n\t\t\t->where(['fieldname' => $fieldName, 'uitype' => [15, 16, 33]])\n\t\t\t->createCommand()->query();\n\t\twhile ($row = $dataReader->read()) {\n\t\t\t$tableName = $row['tablename'];\n\t\t\t$columnName = $row['columnname'];\n\t\t\t$dbCommand->update($tableName, [$columnName => $newValue], [$columnName => $previousValue])\n\t\t\t\t->execute();\n\t\t\t$dbCommand->update('vtiger_field', ['defaultvalue' => $newValue], ['defaultvalue' => $previousValue, 'fieldid' => $row['fieldid']])\n\t\t\t\t->execute();\n\t\t\t$moduleName = \\App\\Module::getModuleName($row['tabid']);\n\n\t\t\t\\App\\Fields\\Picklist::clearCache($fieldName, $moduleName);\n\t\t\t$eventHandler = new \\App\\EventHandler();\n\t\t\t$eventHandler->setParams([\n\t\t\t\t'fieldname' => $fieldName,\n\t\t\t\t'oldvalue' => $previousValue,\n\t\t\t\t'newvalue' => $newValue,\n\t\t\t\t'module' => $moduleName,\n\t\t\t\t'id' => $this->getId(),\n\t\t\t]);\n\t\t\t$eventHandler->trigger('PicklistAfterRename');\n\t\t}\n\t\t\\App\\Fields\\Picklist::clearCache($fieldName, $this->fieldModel->getModuleName());\n\t}", "public function change($name)\n {\n return $this->destroy()->setName($name)->save();\n }", "public function setName($newName) {\n $this->name = $newName;\n }", "public static function rename ($path, $newPath) {\n\t\t\\rename($path, $newPath);\n\t}", "public function handleRename(PersistEvent $event)\n {\n $document = $event->getDocument();\n $defaultLocale = $this->registry->getDefaultLocale();\n\n if (!$event->getOption('auto_name')\n || !$document instanceof AutoNameBehavior\n || $defaultLocale !== $event->getLocale()\n || !$event->hasNode()\n || $event->getNode()->isNew()\n ) {\n return;\n }\n\n $node = $event->getNode();\n $name = $this->getName($document, $event->getParentNode(), $node);\n\n if ($name === $node->getName()) {\n return;\n }\n\n $this->rename($event->getNode(), $name);\n }", "public function rename(string $from, string $to): Promise;", "function rename($old_handle, $new_handle)\n\t{\n\t\tglobal $phpbb_root_path;\n\n\t\t$old_handle = $this->root_path . str_replace($phpbb_root_path, '', $old_handle);\n\n\t\treturn $this->_rename($old_handle, $new_handle);\n\t}", "public function setName(?string $value): void {\n $this->getBackingStore()->set('name', $value);\n }", "public function setName(?string $value): void {\n $this->getBackingStore()->set('name', $value);\n }", "public function setName(?string $value): void {\n $this->getBackingStore()->set('name', $value);\n }", "public function setName(?string $value): void {\n $this->getBackingStore()->set('name', $value);\n }", "public function setName(?string $value): void {\n $this->getBackingStore()->set('name', $value);\n }", "public function setName(?string $value): void {\n $this->getBackingStore()->set('name', $value);\n }", "public function setName(?string $value): void {\n $this->getBackingStore()->set('name', $value);\n }", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName(string $name);", "public function setName(string $name);", "public function setName($name) {}", "public function setName($name) {}", "public function rename($name)\r\n {\r\n $from = $this->getPath();\r\n $to = B::rename($this->getPath(), $name);\r\n\r\n $this->getDatabase()->rename($from, $to);\r\n $this->path = $to;\r\n $this->refresh();\r\n\r\n return $this;\r\n }", "public function renameOnDFS( $oldPath, $newPath )\n {\n $this->accumulatorStart();\n\n $oldPath = $this->makeDFSPath( $oldPath );\n $newPath = $this->makeDFSPath( $newPath );\n\n if(strpos($oldPath,'/storage/') !== FALSE )\n {\n try\n {\n $result = $this->s3->getObject(array('Bucket' => $this->bucket,\n 'Key' => $oldPath));\n $contents=(string) $result['Body'];\n \n $this->s3->putObject(array('Bucket' => $this->bucket,\n 'Key' => $newPath,\n 'Body' => $contents,\n 'ACL' => 'public-read'));\n \n $this->s3->deleteObject(array('Bucket' => $this->bucket,\n 'Key' => $oldPath ));\n $ret = true;\n }catch(S3Exception $e){\n $ret =false;\n }\n }\n else\n {\n $item_old = $this->pool->getItem($oldPath);\n $item_new = $this->pool->getItem($newPath);\n \n $item_new->lock();\n $item_new->set($item_old->get($oldPath));\n $item_old->clear();\n\n $ret = eZFile::rename( $oldPath, $newPath, true );\n\n if ( $ret )\n eZClusterFileHandler::cleanupEmptyDirectories( $oldPath );\n }\n \n $this->accumulatorStop();\n\n return $ret;\n }", "public function rename($newTableName)\r\n {\r\n\r\n }", "public function setName($newName)\n {\n $this->name = $newName;\n }", "public function setName($newName)\n {\n $this->name = $newName;\n }", "public function rename($id, $name)\n {\n return false;\n }", "private function rename(NodeInterface $node, $name)\n {\n $names = (array) $node->getParent()->getNodeNames();\n $pos = array_search($node->getName(), $names);\n $next = isset($names[$pos + 1]) ? $names[$pos + 1] : null;\n\n $node->rename($name);\n\n if ($next) {\n $node->getParent()->orderBefore($name, $next);\n }\n }", "public function rename($old, $new)\n {\n Horde_Kolab_Storage_Exception_Pear::catchError(\n $this->getBackend()->renameMailbox(\n $this->encodePath($old),\n $this->encodePath($new)\n )\n );\n }", "protected function saveConfiguration($name, $value)\n {\n // TODO: Implement saveConfiguration() method.\n }", "public function rename($file, $new_file);", "function rename_project( $user, $project, $new_name )\n {\n //Unimplemented\n }", "public static function rename($from, $to)\n {\n $object = get_class(self::$driver);\n\n return $object::rename($from, $to);\n }", "public function setName($name)\n {\n $this->file['name'] = (string) $name;\n }", "public function newName($newName)\n {\n $this->newName = $newName;\n }", "public function SetName ($name);", "private function rmvFile($config, $name)\n\t{\n\t\t$success = unlink($config[\"app\"][\"datadir\"].$name);\n\t\treturn $success;\n\t}", "public function setName($name) {\n\t}", "public function rename( $new_name, $id ) {\r\r\n global $wpdb;\r\r\n\r\r\n $this->refresh = true;\r\r\n\r\r\n return $wpdb->query(\r\r\n $wpdb->prepare(\"UPDATE \" . wd_asp()->db->table('main') . \" SET name = '%s' WHERE id = %d\", $new_name, $id)\r\r\n );\r\r\n }", "protected function renameDeck()\n {\n $request = $this->request();\n $player = $this->getCurrentPlayer();\n $dbEntityDeck = $this->dbEntity()->deck();\n\n $this->result()->setCurrent('Decks');\n\n $this->assertParamsNonEmpty(['current_deck']);\n $deckId = $request['current_deck'];\n\n $deck = $this->dbEntity()->deck()->getDeckAsserted($deckId);\n\n // validate deck ownership\n if ($deck->getUsername() != $player->getUsername()) {\n throw new Exception('Can only manipulate own deck', Exception::WARNING);\n }\n\n $this->result()->setCurrent('Decks_edit');\n\n $this->assertParamsExist(['new_deck_name']);\n $newName = $request['new_deck_name'];\n\n // validate new deck name\n if (trim($newName) == '') {\n throw new Exception('Cannot change deck name, invalid input', Exception::WARNING);\n }\n\n // list player's deck\n $result = $dbEntityDeck->listDecks($player->getUsername());\n if ($result->isError()) {\n throw new Exception('Failed to list decks');\n }\n $list = $result->data();\n\n // extract deck names\n $deckNames = array();\n foreach ($list as $deckData) {\n // omit current deck\n if ($deck->getDeckId() != $deckData['deck_id']) {\n $deckNames[] = $deckData['deck_name'];\n }\n }\n\n // check if the new deck name isn't already used\n $pos = array_search($newName, $deckNames);\n if ($pos !== false) {\n throw new Exception('Cannot change deck name, it is already used by another deck', Exception::WARNING);\n }\n\n // update deck name\n $deck\n ->setDeckName($newName)\n ->setModifiedAt(Date::timeToStr());\n if (!$deck->save()) {\n throw new Exception('Failed to rename deck');\n }\n\n $this->result()->setInfo('Deck saved');\n }", "public function edit ( $name, $value ) {\n\t\tif( !$this->has ( $name ) ) {\n\t\t\tthrow new \\InvalidArgumentException(sprintf('The name \"%s\" does not exist and can not be edited.', $name));\n\t\t}\n\t\t$this->config[$name] = $value;\n\t}", "public function rename(string $from, string $to)\n {\n $this->build(tap($this->createBlueprint($from), function (Blueprint $blueprint) use ($to) {\n $blueprint->rename($to);\n }));\n }", "public function rename_db($oldname, $newname) {\n return UPS_SUCCESS;\n }", "public function rename($to) {\n\t\tthrow new \\InvalidArgumentException;\n\t\treturn $this;\n\t}", "public function save()\n {\n $config_content = file_get_contents($this->config_path);\n\n foreach ($this->fields as $configuration => $value) {\n $config_content = str_replace(str_replace('\\\\', '\\\\\\\\', $value['default']), str_replace('\\\\', '\\\\\\\\', $this->configurations[$configuration]), $config_content);\n config([$value['config'] => str_replace('\\\\', '\\\\\\\\', $this->configurations[$configuration])]); //Reset the config value\n }\n\n file_put_contents($this->config_path, $config_content);\n }", "public function covers_rename(): void\n {\n $response = $this->check_request('Rename cover');\n if (!$response) {\n $original = input_request('original');\n $newname = input_request('newname');\n if (file_exists(folder_covers() . $newname)) {\n $response = $this->get_response(true,\n 'Cannot rename, file exists');\n $this->log_error(\"Cover rename $original -> $newname EXISTS\");\n } else {\n $result = rename(folder_covers() . $original,\n folder_covers() . $newname);\n if ($result) {\n $response = $this->get_response(false, 'Cover renamed');\n $this->log_info(\"Cover rename $original -> $newname\");\n } else {\n $response = $this->get_response(true, 'Rename failed');\n $this->log_error(\n \"Cover rename $original -> $newname FAILED\");\n }\n }\n }\n exit(json_encode($response));\n }", "public static function rename(&$object, $key, $new_key) {\n\t\t\t$qarray = \\uri\\generate::query_array($object);\n\t\t\tif (isset($qarray[$key])) {\n\t\t\t\t$qarray[$new_key] = $qarray[$key];\n\t\t\t\tunset($qarray[$key]);\n\t\t\t\t\\uri\\actions::modify($object, 'replace', 'QUERY', self::build_query($qarray));\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\treturn FALSE;\n\t\t}", "public function setNameAttribute($name)\n {\n $this->attributes['name'] = $name;\n $this->path = $this->baseDir() . $name;\n $this->thumbnail_path = $this->baseDir() . 'tn-' . $name;\n }" ]
[ "0.6215419", "0.57994515", "0.57121986", "0.5274167", "0.5262123", "0.5251104", "0.5124061", "0.5096711", "0.5076634", "0.50512975", "0.5035078", "0.50222725", "0.50198144", "0.5019733", "0.49869028", "0.49865326", "0.495102", "0.49427477", "0.49329376", "0.49276316", "0.48919496", "0.48383668", "0.4833749", "0.4820449", "0.48184097", "0.4814822", "0.48046172", "0.4803591", "0.4803591", "0.4803591", "0.4803591", "0.4803591", "0.4803591", "0.4803591", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.4802011", "0.47999546", "0.47999546", "0.47748992", "0.47748992", "0.4774706", "0.4773755", "0.47615817", "0.47469378", "0.47469378", "0.47456875", "0.4744456", "0.47249323", "0.47221053", "0.4717555", "0.47161168", "0.47087643", "0.46915764", "0.46754086", "0.4667776", "0.46653464", "0.46588546", "0.4641343", "0.4619264", "0.46123952", "0.46107623", "0.46072957", "0.46015307", "0.45995793", "0.4598679", "0.45958215", "0.4580112" ]
0.5440077
3
Encodes configuration data into the storagespecific format.
public function encode($data);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save()\n\t{\n\t\t$json = json_encode($this->config, JSON_PRETTY_PRINT);\n\n\t\tif (!$h = fopen(self::$configPath, 'w'))\n\t\t{\n\t\t\tdie('Could not open file ' . self::$configPath);\n\t\t}\n\n\t\tif (!fwrite($h, $json))\n\t\t{\n\t\t\tdie('Could not write file ' . self::$configPath);\n\t\t}\n\n\t\tfclose($h);\n\t}", "public function save()\n {\n $config_content = file_get_contents($this->config_path);\n\n foreach ($this->fields as $configuration => $value) {\n $config_content = str_replace(str_replace('\\\\', '\\\\\\\\', $value['default']), str_replace('\\\\', '\\\\\\\\', $this->configurations[$configuration]), $config_content);\n config([$value['config'] => str_replace('\\\\', '\\\\\\\\', $this->configurations[$configuration])]); //Reset the config value\n }\n\n file_put_contents($this->config_path, $config_content);\n }", "function write_configuration(&$d) {\n\t\t$my_config_array = array(\n\t\t\t\"AP_UNIQUE_ID\" => htmlentities($d['AP_UNIQUE_ID'], ENT_QUOTES, 'UTF-8'),\n\t\t\t\"AP_SIGN_KEY\" => htmlentities($d['AP_SIGN_KEY'], ENT_QUOTES, 'UTF-8'),\n\t\t\t\"AP_FRAME_URL\" => htmlentities($d['AP_FRAME_URL'], ENT_QUOTES, 'UTF-8'),\n\t\t\t\"AP_PAYMENT_SRC\" => htmlentities($d['AP_PAYMENT_SRC'], ENT_QUOTES, 'UTF-8'),\n\t\t\t\"AP_PAYER_CALLBACK_URL\" => htmlentities($d['AP_PAYER_CALLBACK_URL'], ENT_QUOTES, 'UTF-8'),\n\t\t\t\"AP_PAYMENT_CALLBACK_URL\" => htmlentities($d['AP_PAYMENT_CALLBACK_URL'], ENT_QUOTES, 'UTF-8'),\n\t\t\t\"AP_ALLOWED_IP\" => htmlentities($d['AP_ALLOWED_IP'], ENT_QUOTES, 'UTF-8'),\n\t\t\t\"AP_CSS_FILE\" => htmlentities($d['AP_CSS_FILE'], ENT_QUOTES, 'UTF-8'),\n\t\t\t\"AP_FRAME_MODE\" => htmlentities($d['AP_FRAME_MODE'], ENT_QUOTES, 'UTF-8'),\n\t\t\t\"AP_FRAME_PARAMS\" => addslashes($d['AP_FRAME_PARAMS'])\n\t\t);\n\n\t\tif (isset($my_config_array['AP_FRAME_PARAMS'])) {\n\t\t\t$frame_params = $my_config_array['AP_FRAME_PARAMS'];\n\t\t \t$pattern = '/[\\s]+/';\n\t\t \t$iframe_attributes = preg_split($pattern, trim($frame_params));\n\t\t \tforeach ($iframe_attributes as $pair) {\n\t\t \t\t$attribute = explode(\"=\", $pair);\n\t\t \t\t$available_attributes = array(\"width\", \"height\", \"scrolling\", \n\t\t\t \t\"frameborder\", \"allign\", \"marginheight\", \"marginwidth\");\n\t\t\t\tif (!in_array(trim($attribute[0]), $available_attributes)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\n\t\t$config = \"<?php\\n\";\n\t\t$config .= \"if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); \\n\\n\";\n\t\tforeach( $my_config_array as $key => $value ) {\n\t\t\t$config .= \"define ('$key', '$value');\\n\";\n\t\t}\n\n\t\t$config .= \"?>\";\n\n\t\tif ($fp = fopen(CLASSPATH .\"payment/\".__CLASS__.\".cfg.php\", \"w\")) {\n\t\t\tfputs($fp, $config, strlen($config));\n\t\t\tfclose ($fp);\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getConfigData() {\n\t\treturn array(\n\t\t\t'storageType' => StorageFactory::TYPE_DUMMY,\n\t\t\t'debuggerDisabled' => $this->debuggerDisabled,\n\t\t);\n\t}", "function instance_config_save($data, $nolongerused = false) {\n\n //If the is_form_submission or config_is_form_submission property is set in the object,\n //then this is a valid form submission that will be saved to the config\n if (isset($data->is_form_submission) || isset($data->config_is_form_submission)) {\n \n //process form data submission into a data string\n $data_string = dd_content_process_settings_form($data);\n\n $config_data = new stdClass();//create a config object\n $config_data->data = $data_string;//set the data to be our processed string\n \n //add any non-submission fields back into config based on existing config\n //ex: orientation\n dd_content_add_non_standard_form_data($this, $config_data);\n parent::instance_config_save($config_data);\n } else {//In the case its not set, then we are updating the configuration\n //in specialization its unserialized - needs to be re-serialized before savint\n $data->data = dd_content_serialize($data->data);\n parent::instance_config_save($data);\n }\n }", "abstract protected function saveConfiguration($name, $value);", "private function saveConfig() {\n \tself::$_configInstance = (object)$this->_data; \n file_put_contents($this->_data['cache_config_file'],serialize(self::$_configInstance)); \n }", "public function saveConfigOptions() {}", "public function save()\n\t{\n\t\t$h = fopen(WEBDEV_CONFIG_FILE, 'w');\n\t\tfwrite($h, \"<?php\\n return \" .var_export($this->config->all(), true) .';');\n\t\tfclose($h);\n\t}", "public function config_save() {\n }", "protected function declareConfig(){\n\n $output = '';\n \n foreach( $this->getConfig() as $key => $value ){\n \n $output .= $key . '=' . json_encode( $value ) . ';';\n \n }\n \n return $output;\n\n }", "protected function write()\n {\n $this->writeString($this->database);\n $this->writeString($this->type);\n $this->writeString($this->storage);\n }", "function configWriter($configs){\n\t\t\t\tglobal $scope_id;\n\t\t\t\t$appearanceSwitch = new Mage_Core_Model_Config();\n\t\t\t\tforeach($configs as $section => $value){\n\t\t\t\t\tif($scope_id){\n\t\t\t\t\t\t$appearanceSwitch->saveConfig($section, $value, 'stores', $scope_id);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$appearanceSwitch->saveConfig($section, $value, 'default', 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function saveConfiguration() {\n//\t\t$field_value = DevblocksPlatform::importGPC($_POST['field_value']);\n//\t\t$this->params['field_name'] = $field_value;\n\t}", "protected function setConfigValue($data){\t\n\t\tMage::getModel('core/config_data')->load($data['path'],'path')->setData($data)->save();\n\t}", "public function saveConfig($data, $values);", "public function storeConfigData(){\n $data = array();\n $data['bg'] = $this->_scopeConfig->getValue('webkul/webkul_verticalslider/wk_verticalslider_bg', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $data['noitems'] = $this->_scopeConfig->getValue('webkul/webkul_verticalslider/wk_verticalslider_category', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $data['animate'] = $this->_scopeConfig->getValue('webkul/webkul_verticalslider/wk_verticalslider_animation_time', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $data['width'] = $this->_scopeConfig->getValue('webkul/webkul_verticalslider/wk_verticalslider_width', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $data['height'] = $this->_scopeConfig->getValue('webkul/webkul_verticalslider/wk_verticalslider_height', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n return $data;\n }", "public function getConfiguration()\n {\n $configuration = parent::getConfiguration();\n $configuration['debug'] = isset($configuration['debug']) ? $configuration['debug'] : false;\n $configuration['fileUri'] = $this->container->getParameter(\"mapbender.uploads_dir\") . \"/data-store\";\n\n if (isset($configuration[\"schemes\"]) && is_array($configuration[\"schemes\"])) {\n foreach ($configuration[\"schemes\"] as $key => &$scheme) {\n if (is_string($scheme['dataStore'])) {\n $storeId = $scheme['dataStore'];\n $dataStore = $this->container->getParameter('dataStores');\n $scheme['dataStore'] = $dataStore[ $storeId ];\n $scheme['dataStore'][\"id\"] = $storeId;\n //$dataStore = new DataStore($this->container, $configuration['source']);\n }\n if (isset($scheme['formItems'])) {\n $scheme['formItems'] = $this->prepareItems($scheme['formItems']);\n }\n }\n }\n return $configuration;\n }", "public function Save()\n {\n $content = \"\";\n foreach ($this->vars as $key => $elem) {\n $content .= \"[\".$key.\"]\\n\";\n foreach ($elem as $key2 => $elem2) {\n $content .= $key2.\" = \\\"\".$elem2.\"\\\"\\n\";\n }\n $content .= \"\\n\";\n }\n if (!$handle = @fopen($this->fileName, 'w')) {\n error_log(\"Config::Save() - Could not open file('\".$this->fileName.\"') for writing, error.\");\n }\n if (!fwrite($handle, $content)) {\n error_log(\"Config::Save() - Could not write to open file('\" . $this->fileName .\"'), error.\");\n }\n fclose($handle);\n }", "abstract public function convert_to_storage();", "public function dump(ConfigState $state): void\n {\n $state->useNamespace('typo.extBase.element', function () use ($state) {\n $state->setAsJson('args', $this->registrationArgs);\n $state->set('configureArgs', $this->configureArgs);\n $state->setAsJson('iconArgs', array_filter($this->iconArgs));\n $state->setAsJson('dataHooks', $this->dataHooks);\n $state->setAsJson('backendPreviewHooks', $this->backendPreviewHooks);\n $state->setAsJson('flexForms', array_filter($this->flexFormArgs));\n $state->setAsJson('variants', $this->variantMap);\n });\n \n if (! empty($this->backendPreviewRenderers['preview'])) {\n $state->mergeIntoArray('t3ba.backendPreview.previewRenderers', $this->backendPreviewRenderers['preview']);\n }\n if (! empty($this->additionalPreviewDescriptions)) {\n $state->mergeIntoArray('t3ba.backendPreview.descriptions', $this->additionalPreviewDescriptions);\n }\n if (! empty($this->backendPreviewRenderers['listLabel'])) {\n $state->mergeIntoArray('t3ba.backendPreview.listLabelRenderers', $this->backendPreviewRenderers['listLabel']);\n }\n \n }", "final protected function makeStorable()\n\t{\n\t\tassert( 'is_array( $this->usable )' );\n\n\t\tif ( data::autoType( config::get( 'session.encrypt', false ), 'boolean' ) )\n\t\t\t$this->storable = crypt::create()->encrypt( serialize( $this->usable ) );\n\t\telse\n\t\t\t$this->storable = serialize( $this->usable );\n\t}", "public function storeBackupConfig($filepath, array $data);", "public function save()\n\t\t{\n#DS_Database_Archive::_log(__METHOD__.'()');\n\t\t\tif ( $this->_dirty ) {\n#DS_Database_Archive::_log(__METHOD__.'() data is dirty');\n\t\t\t\tif ( NULL !== $this->option_name ) {\n\t\t\t\t\tset_option( $this->option_name, $this->_options );\n\t\t\t\t} else if ( NULL !== $this->filename ) {\n\t\t\t\t\t// save to filesystem\n#DS_Database_Archive::_log(__METHOD__.'() saving to file ' . $this->filename);\n\t\t\t\t\t$output = json_encode( $this->_options, JSON_PRETTY_PRINT );\n#DS_Database_Archive::_log(__METHOD__.'() contents: ' . $output);\n\t\t\t\t\tfile_put_contents( $this->filename, $output );\n\t\t\t\t}\n\t\t\t\t$this->_dirty = FALSE;\n\t\t\t}\n\t\t}", "function instance_config_save($data, $nolongerused = false) {\n global $DB;\n\n $config = clone($data);\n parent::instance_config_save($config, $nolongerused);\n }", "public function store()\n {\n $classes = [];\n\n foreach ($this->classes as $class) {\n $classes[] = $class['input_file'];\n }\n\n $json_classes = json_encode($classes);\n\n $this->filesystem->put(config('larinterface.cache_directory') . '/larinterface.json', $json_classes);\n }", "protected function saveConfig() {\n return $this->updateConfigValues(array(\n 'PAYNETEASY_END_POINT',\n 'PAYNETEASY_LOGIN',\n 'PAYNETEASY_SIGNING_KEY',\n 'PAYNETEASY_SANDBOX_GATEWAY',\n 'PAYNETEASY_PRODUCTION_GATEWAY',\n 'PAYNETEASY_GATEWAY_MODE'\n ));\n }", "function write() {\n\t\t$this->readychk();\n\t\tif (!is_dir($this->dir_path)) { mkdir($this->dir_path); }\n\t\tif (!is_dir($this->asset_path)) { mkdir($this->asset_path); }\n\n\t\t$cstr = json_encode($this->export(TRUE, TRUE));\n\t\tif (\n\t\t\t$cstr === FALSE &&\n\t\t\tjson_last_error() !== JSON_ERROR_NONE\n\t\t) { throw new IntException(\"Slide config encoding failed.\"); }\n\t\tfile_lock_and_put($this->conf_path, $cstr);\n\t}", "public function save() {\n $configdata = $this->get('configdata');\n if (!array_key_exists('defaultvalue_editor', $configdata)) {\n $this->field->save();\n return;\n }\n\n if (!$this->get('id')) {\n $this->field->save();\n }\n\n // Store files.\n $textoptions = $this->value_editor_options();\n $tempvalue = (object) ['defaultvalue_editor' => $configdata['defaultvalue_editor']];\n $tempvalue = file_postupdate_standard_editor($tempvalue, 'defaultvalue', $textoptions, $textoptions['context'],\n 'customfield_textarea', 'defaultvalue', $this->get('id'));\n\n $configdata['defaultvalue'] = $tempvalue->defaultvalue;\n $configdata['defaultvalueformat'] = $tempvalue->defaultvalueformat;\n unset($configdata['defaultvalue_editor']);\n $this->field->set('configdata', json_encode($configdata));\n $this->field->save();\n }", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "public function prepareConfigSchema()\n {\n // Store Chapters\n $fromchapter = ['labels' => [],'id' => []];\n foreach ($this->container->db->getFormats() as $f) {\n array_push($fromchapter['labels'], $f->getName());\n array_push($fromchapter['id'], $f->getId());\n }\n\n // Store Issues\n $fromissue = ['labels' => [],'id' => []];\n foreach ($this->container->db->getIssues() as $i) {\n array_push($fromissue['labels'], $i->getName());\n array_push($fromissue['id'], $i->getId());\n }\n\n // Store Books\n $frombook = ['labels' => [],'id' => []];\n foreach ($this->container->db->getBooks() as $b) {\n array_push($frombook['labels'], $b->getName());\n array_push($frombook['id'], $b->getId());\n }\n\n // Store Templates\n $fromtemplate = ['labels' => [],'id' => []];\n foreach ($this->container->db->getTemplatenames() as $t) {\n array_push($fromtemplate['labels'], $t->getName());\n array_push($fromtemplate['id'], $t->getId());\n }\n\n // Store Templates\n $fromfield = ['labels' => [],'id' => []];\n foreach ($this->container->db->getTemplatefields() as $t) {\n array_push($fromfield['labels'], $t->getFieldname());\n array_push($fromfield['id'], $t->getId());\n }\n\n // Store Historytypes\n\n foreach (['books', 'issues', 'chapters', 'cloud', 'other', 'self', 'contributional', 'structural', 'fixed'] as $_ht) {\n $historytypes['id'][] = $_ht;\n $historytypes['labels'][] = $this->container->translations['field_historytype_'.$_ht];\n }\n\n // Todo\n $thisfields = [\n 'labels' => ['fielda', 'fieldb','fieldc'],\n 'id' => [1,2,3]\n ];\n\n $lengthinfluence = [\n 'title' => $this->container->translations['field_config'.'lengthinfluence'],\n 'options' => [\n 'collapsed' => true\n ],\n 'type' => 'array',\n 'propertyOrder' => 100,\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => $this->container->translations['field_config'.'lengthinfluence'.'row'],\n 'headerTemplate' => '{{ self.fieldname }}',\n 'properties' => [\n 'factor' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'lengthinfluence'.'factor'],\n ],\n 'fieldname' => [\n 'type' => 'string',\n 'uniqueItems' => true,\n 'enum' => [],//$fromfield['id'],\n 'options' => [\n 'enum_titles' => $fromfield['labels'],\n 'title' => [],//$this->container->translations['field_config'.'lengthinfluence'.'labels'],\n ]\n ]\n ]\n ]\n ];\n\n $schema = [\n 'title' => 'Field Configuration',\n 'type' => 'object',\n 'properties' => [\n 'imagesize' => [\n 'title' => $this->container->translations['field_config'.'imagesize'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => $this->container->translations['field_config'.'imagesize'.'row'],\n 'properties' => [\n 'width' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'imagesize'.'width'],\n ],\n 'height' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'imagesize'.'height'],\n ]\n ]\n ]\n ],\n 'caption_variants' => [\n 'title' => $this->container->translations['field_config'.'imagecaptions'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 11,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'imagecaption'],\n ]\n ],\n 'history' => [\n 'title' => $this->container->translations['field_config'.'history'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'fullhistory' => [\n 'title' => $this->container->translations['field_config'.'fullhistory'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox',\n 'watch' => [\n 'hist' => 'history'\n ],\n 'hidden' => '!history'\n ],\n 'growing' => [\n 'title' => $this->container->translations['field_config'.'growing'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'maxlines' => [\n 'title' => $this->container->translations['field_config'.'maxlines'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'textlength' => [\n 'title' => $this->container->translations['field_config'.'textlength'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'lengthinfluence' => $lengthinfluence,\n 'rtfeditor' => [\n 'title' => $this->container->translations['field_config'.'rtfeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'markdowneditor' => [\n 'title' => $this->container->translations['field_config'.'markdowneditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'codeeditor' => [\n 'title' => $this->container->translations['field_config'.'codeeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'editorcolumns' => [\n 'title' => $this->container->translations['field_config'.'editorcolumns'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => 'Line',\n 'properties' => [\n \"lines\" => [\n 'type' => 'integer',\n 'title' => $this->container->translations['field_config'.'editorcolumns'.'lines'],\n ],\n \"label\" => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'editorcolumns'.'label'],\n ]\n ]\n ]\n ],\n 'arrayeditor' => [\n 'title' => $this->container->translations['field_config'.'arrayeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'columns' => [\n 'title' => $this->container->translations['field_config'.'columns'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'colnames' => [\n 'title' => $this->container->translations['field_config'.'colnames'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'format' => 'text',\n 'title' => $this->container->translations['field_config'.'colnames'.'labels'],\n ]\n ],\n 'latitude' => [\n 'title' => $this->container->translations['field_config'.'latitude'],\n 'type' => 'number',\n 'propertyOrder' => 0\n ],\n 'longitude' => [\n 'title' => $this->container->translations['field_config'.'longitude'],\n 'type' => 'number',\n 'propertyOrder' => 0\n ],\n 'dateformat' => [\n 'title' => $this->container->translations['field_config'.'dateformat'],\n 'type' => 'string',\n 'propertyOrder' => 2,\n 'uniqueItems' => true,\n 'enum' => [\n 'd/m/Y H:i:s', 'd/m/Y H:i', 'd/m/Y', 'm/Y', 'Y'\n ],\n 'options' => [\n 'enum_titles' => [\n 'dd/mm/yyyy hh:mm:ss', 'dd/mm/yyyy hh:mm', 'dd/mm/yyyy', 'mm/yyyy', 'yyyy'\n ]\n ]\n ],\n 'integer' => [\n 'title' => $this->container->translations['field_config'.'integer'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'resolve_foreign' => [\n 'title' => $this->container->translations['field_config'.'resolve_foreign'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'multiple' => [\n 'title' => $this->container->translations['field_config'.'multiple'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n //cloud\n 'threeDee' => [\n 'title' => $this->container->translations['field_config'.'threeDee'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'history_command' => [\n 'title' => $this->container->translations['field_config'.'history_command'],\n 'format' => 'select',\n 'propertyOrder' => -1,\n 'uniqueItems' => true,\n 'type' => 'string',\n 'enum' => $historytypes['id'],\n 'options' => [\n 'enum_titles' => $historytypes['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //legends\n 'legends' => [\n 'options' => [\n 'grid_columns' => 12,\n ],\n 'title' => $this->container->translations['field_config'.'legends'],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string'\n ]\n ],\n //fixed\n 'fixedvalues' => [\n 'options' => [\n 'grid_columns' => 12,\n ],\n 'title' => $this->container->translations['field_config'.'fixedvalues'],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'fixedvalues'.'row'],\n ]\n ],\n //issues, cloud, self, contributional\n 'restrict_to_open' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_open'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n // not implemented so far\n 'restrict_to_book' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_book'],\n 'type' => 'boolean',\n 'propertyOrder' => 2,\n 'format' => 'checkbox'\n ],\n //issues, chapters\n 'frombook' => [\n 'title' => $this->container->translations['field_config'.'frombook'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 1,\n 'uniqueItems' => true,\n 'enum' => $frombook['id'],\n 'options' => [\n 'enum_titles' => $frombook['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //cloud, other, self, contributional\n 'restrict_to_issue' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_issue'],\n 'type' => 'boolean',\n 'propertyOrder' => 4,\n 'format' => 'checkbox'\n ],\n //cloud, other, self, contributional\n 'fromissue' => [\n 'title' => $this->container->translations['field_config'.'fromissue'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 3,\n 'uniqueItems' => true,\n 'enum' => $fromissue['id'],\n 'options' => [\n 'enum_titles' => $fromissue['labels'],\n 'grid_columns' => 12,\n ]\n ],\n\n //contributional,\n 'restrict_to_chapter' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_chapter'],\n 'type' => 'boolean',\n 'propertyOrder' => 6,\n 'format' => 'checkbox'\n ],\n //contributional\n 'fromchapter' => [\n 'title' => $this->container->translations['field_config'.'fromchapter'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 5,\n 'uniqueItems' => true,\n 'enum' => $fromchapter['id'],\n 'options' => [\n 'enum_titles' => $fromchapter['labels'],\n 'grid_columns' => 12,\n ]\n ],\n // not implemented so far\n 'restrict_to_template' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_template'],\n 'type' => 'boolean',\n 'propertyOrder' => 9,\n 'format' => 'checkbox'\n ],\n //contributional, structural\n 'fromtemplate' => [\n 'title' => $this->container->translations['field_config'.'fromtemplate'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 8,\n 'uniqueItems' => true,\n 'enum' => $fromtemplate['id'],\n 'options' => [\n 'enum_titles' => $fromtemplate['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //cloud, other\n 'fromfield' => [\n 'title' => $this->container->translations['field_config'.'fromfield'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 10,\n 'uniqueItems' => true,\n 'enum' => $fromfield['id'],\n 'options' => [\n 'enum_titles' => $fromfield['labels'],\n 'grid_columns' => 12,\n ]\n ],\n ],\n ];\n return json_encode($schema);\n }", "abstract public function encode();", "public function exportConfiguration() {}", "function instance_config_save($data, $nolongerused = false) {\n global $COURSE;\n\n $config = clone($data);\n $fileoptions = array('subdirs'=>false,\n 'maxfiles'=>1,\n 'maxbytes'=>$COURSE->maxbytes,\n 'accepted_types'=>'web_image',\n 'return_types'=>FILE_INTERNAL);\n file_save_draft_area_files($config->imagespot, $this->context->id, 'block_informationspot', 'image', 0, $fileoptions);\n\n parent::instance_config_save($config, $nolongerused);\n }", "public function toString()\n {\n return json_encode($this->config);\n }", "public function encode($data, $format, array $context = [])\n {\n $context = $this->resolveContext($context);\n\n if ($this->isYamlOldStyleInterface()) {\n $encodedData = Yaml::dump(\n $data,\n $context[ self::OPTION_INLINE ],\n $context[ self::OPTION_INDENT ],\n $context[ self::OPTION_EXCEPTION_ON_INVALID_TYPE ],\n $context[ self::OPTION_OBJECT ]\n );\n\n } else {\n $options = $this->contextToOptions($context);\n\n $encodedData = Yaml::dump(\n $data,\n $context[ self::OPTION_INLINE ],\n $context[ self::OPTION_INDENT ],\n $options\n );\n }\n\n return $encodedData;\n }", "public function writeConfig(string $filename, $data, array $parent = array())\n\t{\n\t\t$out = $this->writeConfigRec((array)$data);\n\t\t\n\t\tif (substr($filename, 0, 1 ) != \"/\")\n\t\t\t$filename = BP.'/app/config/'.$filename;\n\t\t\n\t\tfile_put_contents($filename, trim($out));\n\t}", "private function saveType()\n\t{\n\t\t// Build config file\n\t\t$config = \"<?php \\n\\n\";\n\t\t$config.= \"// This config file is auto generated on boot.\\n\\n\";\n\t\t$config.= 'define(\"INSTANCE_TYPE\", \"'.$this->instanceType.'\");'.\"\\n\";\n\t\t$config.= 'define(\"INSTANCE_NAME\", \"'.$this->instanceName.'\");'.\"\\n\";\n\t\t$config.= 'define(\"BRANCH\", \"'.$this->branch.'\");'.\"\\n\";\n\n\t\t// If bootstrapping the development server\n\t\tif($this->instanceDev)\n\t\t{\n\t\t\t$config.= 'define(\"DEV\", TRUE);'.\"\\n\";\n\t\t}\t\n\n\t\t// Write config file to config folder\n\t\tfile_put_contents(\"config/instance.config.php\", $config);\n\t}", "protected function setStorage($data)\n {\n Session::register(__NAMESPACE__, serialize($data));\n }", "public function getConfig(): string\n {\n $checkoutConfig = $this->compositeConfigProvider->getConfig();\n $storeCode = $checkoutConfig['storeCode'];\n $checkoutConfig['payment']['restUrlPrefix'] = \"/rest/$storeCode/V1/\";\n\n $transport = new \\Magento\\Framework\\DataObject([\n 'checkoutConfig' => $checkoutConfig,\n 'output' => [\n 'storeCode' => $storeCode,\n 'payment' => $checkoutConfig['payment'],\n 'language' => $this->localeResolver->getLocale(),\n 'currency' => $this->currencyProvider->getConfig(),\n 'defaultCountryId' => $checkoutConfig['defaultCountryId'],\n ]\n ]);\n\n $this->eventManager->dispatch('hyva_react_checkout_config', ['transport' => $transport]);\n\n return $this->serializer->serialize($transport->getData('output'));\n }", "function configure($key, $value, $type='system', $unique_slug='unknow', $storage_type='database') { // 配置\n\tswitch ( $storage_type ) {\n\t\tcase 'database':\n\t\t\tif ( is_null($key) ) {\n\t\t\t\treturn Config::where([\n\t\t\t\t\t'type' => $type,\n\t\t\t\t\t'unique_slug' => $unique_slug,\n\t\t\t\t])->pluck('value', 'key');\n\t\t\t} else if ( is_null($value) ) {\n\t\t\t\treturn Config::where([\n\t\t\t\t\t'type' => $type,\n\t\t\t\t\t'unique_slug' => $unique_slug,\n\t\t\t\t\t'key' => $key,\n\t\t\t\t])->value('value');\n\t\t\t} else {\n\t\t\t\t$data = Config::where([\n\t\t\t\t\t'type' => $type,\n\t\t\t\t\t'unique_slug' => $unique_slug,\n\t\t\t\t\t'key' => $key,\n\t\t\t\t])->first();\n\n\t\t\t\tif ( $data ) {\n\t\t\t\t\treturn Config::where([\n\t\t\t\t\t\t'type' => $type,\n\t\t\t\t\t\t'unique_slug' => $unique_slug,\n\t\t\t\t\t\t'key' => $key,\n\t\t\t\t\t])->update(['value' => $value]);\n\t\t\t\t} else {\n\t\t\t\t\treturn Config::create([\n\t\t\t\t\t\t'type' => $type,\n\t\t\t\t\t\t'unique_slug' => $unique_slug,\n\t\t\t\t\t\t'key' => $key,\n\t\t\t\t\t\t'value' => $value,\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\tcase 'redis':\n\t\tbreak;\n\t\tcase 'mongodb':\n\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new Exception(\"Error Config Type: \" . $storage_type, 1);\n\t\tbreak;\n\t}\n}", "protected function saveJSON(&$data)\n {\n $this->validateParameters();\n \n $json = array_to_json($data);\n \n if (!empty($this->save_encrypted)) {\n $json = aes_256_encrypt($json, $this->salt_key);\n }\n \n if (file_put_contents($this->save_path, $json) === false) {\n throw new \\Exception(sprintf(\"The config file '%s' cannot be written!\", $this->save_path));\n }\n \n if ($this->use_apcu) {\n apcu_delete(\"config_settings\");\n }\n }", "function save_hcid($hci_config,$save_file='')\n{\n global $base_plugin;\n \n if ($save_file=='')\n {\n $save_file=$base_plugin.'data/hcid.conf';\n }\n $fp=fopen($save_file,'w');\n fwrite($fp,\"options {\\n\");\n if($hci_config['autoinit'] == 'on')\n {\n fwrite($fp,\"\\tautoinit yes;\\n\");\n }\n if(!empty($hci_config['security']))\n {\n fwrite($fp,\"\\tsecurity \".$hci_config['security'].\";\\n\");\n }\n if(!empty($hci_config['pairing']))\n {\n fwrite($fp,\"\\tpairing \".$hci_config['pairing'].\";\\n\");\n }\n if(!empty($hci_config['passkey']))\n {\n fwrite($fp,\"\\tpasskey \".$hci_config['passkey'].\";\\n\");\n }\n fwrite($fp,\"}\\n\");\n fwrite($fp,\"device {\\n\");\n if(!empty($hci_config['name']))\n {\n fwrite($fp,\"\\tname \".$hci_config['name'].\";\\n\");\n }\n\n fwrite($fp,\"\\tclass 0x000100;\\n\");\n \n if($hci_config['iscan'] == 'on')\n {\n fwrite($fp,\"\\tiscan enable;\\n\");\n }\n if($hci_config['pscan'] == 'on')\n {\n fwrite($fp,\"\\tpscan enable;\\n\");\n }\n\n if(!empty($hci_config['lm']))\n {\n fwrite($fp,\"\\tlm \".$hci_config['lm'].\";\\n\");\n }\n\n $lp='';\n\n if($hci_config['rswitch'] == 'on')\n {\n $lp.='rswitch';\n }\n if($hci_config['hold'] == 'on')\n {\n if ($lp!='')\n {\n $lp.=',hold';\n }\n else\n {\n $lp.='hold';\n }\n\n }\n if($hci_config['sniff'] == 'on')\n {\n if ($lp!='')\n {\n $lp.=',sniff';\n }\n else\n {\n $lp.='sniff';\n }\n }\n if($hci_config['park'] == 'on')\n {\n if ($lp!='')\n {\n $lp.=',park';\n }\n else\n {\n $lp.='park';\n }\n }\n if ($lp=='')\n {\n $lp='none';\n }\n fwrite($fp,\"\\tlp \".$lp.\";\\n\");\n fwrite($fp,\"}\\n\");\n fclose($fp);\n}", "public function saveSettings()\n {\n $this->store->save($this->data);\n }", "function saveConfiguration() {\r\n foreach($_POST as $configuration_key=>$configuration_value){\r\n\t\t\t\tif(stripos($configuration_key, \"haendlerbund\")!==false) {\r\n\t\t\t\t\t$sql = xtc_db_query(\"SELECT * FROM configuration WHERE configuration_key='\".$configuration_key.\"' LIMIT 1\");\r\n\t\t\t\t\tif(xtc_db_num_rows($sql)) {\r\n\t\t\t\t\t\txtc_db_query(\"UPDATE configuration SET configuration_value='\".$configuration_value.\"' WHERE configuration_key='\".$configuration_key.\"' LIMIT 1\");\r\n\t\t\t\t\t}\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t}", "public function getConfigurationExample() {\n\t\treturn '\nstorage = tce\nstorage {\n\tdontUpdateFields = password\n\tdontUsePidForKeyField = 0\n\t\n\t# only update existing records but dont create new ones\n\t# dontAllowInserts = 1\n\t\n\t# needed for ordering records in TYPO3\n\t// moveAfterField = myFunnyFieldWithUIDofpreviousRecord\n\t\n\t# if set to 1, deleted records will be reactivated when they get imported again\n\treactivateDeletedRecords = 0\n}';\n\t}", "public function __prepare()\n {\n $config = $this->objectManager->get(\\Magento\\Mtf\\Config\\DataInterface::class);\n // Prepare config data\n $configData['dbHost'] = $config->get('install/0/host/0');\n $configData['dbUser'] = $config->get('install/0/user/0');\n $configData['dbPassword'] = $config->get('install/0/password/0');\n $configData['dbName'] = $config->get('install/0/dbName/0');\n $configData['baseUrl'] = $config->get('install/0/baseUrl/0');\n $configData['admin'] = $config->get('install/0/backendName/0');\n\n return ['configData' => $configData];\n }", "private function putConfig(): void\n {\n /** @var array<string, array<string, string>> $alertOutputsFromConfig */\n $alertOutputsFromConfig = config('alert.output', []);\n\n foreach ($alertOutputsFromConfig as $plugin => $map) {\n if ($this->desiredOutput !== null && $this->desiredOutput != $plugin) {\n $this->session->remove(\"alert.$plugin\");\n continue;\n }\n\n $output = [];\n foreach ($map as $from => $to) {\n $output[$from] = $this->fields[$to] ?? '';\n }\n\n $this->session->put(\"alert.$plugin\", json_encode($output));\n }\n }", "public function serialize()\n {\n $data = parent::serialize();\n $crypt = $this->getCrypt();\n $data = $crypt->encrypt($data);\n $data = base64_encode($data);\n return ($data);\n }", "public function dump($config): string;", "public function writeConfig() {\n $mergedTemplate = $this->mergeTemplate();\n file_put_contents(\"{$this->settings['paths']['hostConfigDir']}/{$this->params['name']}.cfg\", $mergedTemplate);\n file_put_contents(\"{$this->settings['paths']['hostTrackDir']}/{$this->params['type']}.inf\", \"{$this->params['name']}:{$this->params['instanceId']}\" . PHP_EOL, FILE_APPEND);\n $this->logChange();\n }", "public function setConfigData($data): void\n {\n foreach ($data as $key => $value) {\n if (DB::table('core_config')->where('code', '=', $key)->exists()) {\n DB::table('core_config')\n ->where('code', '=', $key)\n ->update(['value' => $value]);\n } else {\n DB::table('core_config')->insert([\n 'code' => $key,\n 'value' => $value,\n 'channel_code' => null,\n 'locale_code' => null,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }\n }\n }", "function save_config($data)\n\t{\n\t\t$sql = \"UPDATE config SET value = CASE \";\n\n\t\tforeach ($data as $key => $value) {\n\t\t\t$this->config->set($key, $value);\n\t\t\t$keys[] = \"'$key'\";\n\t\t\t$sql .= \"WHEN param = '$key' THEN '$value' \";\n\t\t}\n\n\t\t$keys = implode(',', $keys);\n\t\t$sql .= \"END WHERE param IN ($keys)\";\n\n\t\ttry {\n\t\t\t$this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n\t\t\t$dbdata = $this->conn->prepare($sql);\n\t\t\t$dbdata->execute();\n\t\t} catch (PDOException $err) {\n\t\t\t//print_r('Error: ' . $err . '');\n\t\t\techo 'error';\n\t\t\tdie();\n\t\t}\n\t}", "public function store(Request $request)\n {\n if($request->get('is_active') == true){\n $this->deactivateAll();\n }\n\n $config = new LiteBriteConfig;\n $config->rows = $request->get('rows');\n $config->columns = $request->get('columns');\n $config->dimmer_levels = $request->get('dimmer_levels');\n $config->name = $request->get('config_name');\n $config->bulb_type = $request->get('bulb_type');\n $config->is_active = $request->get('is_active');\n $config->save();\n \n return response()->json($config);\n }", "private function toContainer(): void\n {\n $configFiles = [\n 'config' => $this->configManager->getFilePath(),\n 'router' => $this->router->getFilePath(),\n ];\n $this->container::add('configFiles', $configFiles);\n $this->container::add('config', $this->configData);\n $this->container::add('defaultLang', $this->defaultLang);\n $this->container::add('request', $this->request);\n }", "public function write() {\n\t\t$database = Registry::get(\"database\");\n\t\t$v = \"value='\" . $this -> value . \"'\";\n\t\t$statement = Registry::get(\"database\") -> query(\"UPDATE server.configs SET \" . $v . \" WHERE key_='\" . $this -> key . \"'\");\n\t}", "function workbench_post_set_config($name, $data) {\n $data = serialize($data);\n\n db_merge('workbench_post')\n ->key(array('data_name' => $name))\n ->fields(array(\n 'data' => $data,\n ))\n ->execute();\n}", "private function saveConfig(){\r\n\t\t//\t\tCheck form input\r\n\t\tif($_POST['interfaces_wan_type'] != 'dhcp' && $_POST['interfaces_wan_type'] != 'static'){\r\n\t\t\tErrorHandler::addError('formerror','interfaces_wan_type');\r\n\t\t}\r\n\t\tif(!empty($_POST['interfaces_wan_mac']) && !Functions::isMacAddress($_POST['interfaces_wan_mac'])){\r\n\t\t\tErrorHandler::addError('formerror','interfaces_wan_mac');\r\n\t\t}\r\n\t\tif(!empty($_POST['interfaces_wan_mtu']) && !is_numeric($_POST['interfaces_wan_mtu'])){\r\n\t\t\tErrorHandler::addError('formerror','interfaces_wan_mtu');\r\n\t\t}\r\n\t\tif($_POST['interfaces_wan_type'] == 'static' && !Functions::is_ipAddr($_POST['interfaces_wan_static_ipaddr'])){\r\n\t\t\tErrorHandler::addError('formerror','interfaces_wan_static_ipaddr');\r\n\t\t}\r\n\t\tif($_POST['interfaces_wan_type'] == 'static' && !Functions::is_ipAddr($_POST['interfaces_wan_static_gateway'])){\r\n\t\t\tErrorHandler::addError('formerror','interfaces_wan_static_gateway');\r\n\t\t}\r\n\t\tif($_POST['interfaces_wan_type'] == 'dhcp' && !Functions::is_hostname($_POST['interfaces_wan_dhcp_hostname'])){\r\n\t\t\tErrorHandler::addError('formerror','interfaces_wan_dhcp_hostname');\r\n\t\t}\r\n\t\tif($_POST['interfaces_wan_type'] == 'static' && !Functions::is_ipAddr($_POST['interfaces_wan_static_subnetmask'])){\r\n\t\t\tErrorHandler::addError('formerror','interfaces_wan_static_subnetmask');\r\n\t\t}\r\n\t\t\r\n\t\t//\tPropagate exit on errors\r\n\t\tif(ErrorHandler::errorCount() > 0){\r\n\t\t\tthrow new Exception('There is invalid form input');\r\n\t\t}\r\n\t\t\r\n\t\t//\tSave actual configuration\r\n\t\tif(!empty($_POST['interfaces_wan_mac'])){\r\n\t\t\t$this->data->mac = $_POST['interfaces_wan_mac'];\r\n\t\t}\r\n\t\tif(!empty($_POST['interfaces_wan_mtu'])){\r\n\t\t\t$this->data->mtu = $_POST['interfaces_wan_mtu'];\r\n\t\t}\r\n\t\t\r\n\t\tif($_POST['interfaces_wan_type'] == 'dhcp'){\r\n\t\t\t$this->data->ipaddr = 'dhcp';\r\n\t\t\t$this->data->dhcphostname = $_POST['interfaces_wan_dhcp_hostname'];\r\n\t\t}\r\n\t\telseif($_POST['interfaces_wan_type'] == 'static'){\r\n\t\t\t$this->data->ipaddr = $_POST['interfaces_wan_static_ipaddr'];\r\n\t\t\t$this->data->gateway = $_POST['interfaces_wan_static_gateway'];\r\n\t\t\t$this->data->subnet = $_POST['interfaces_wan_static_subnetmask'];\r\n\t\t}\r\n\t\techo '<reply action=\"ok\">';\r\n\t\techo $this->data->asXML();\r\n\t\techo '</reply>';\r\n\t\t$this->config->saveConfig();\r\n\t}", "public function getForStorage()\n {\n $data = [];\n\n foreach ($this->config->getFields() as $key => $params) {\n\n // skip field if flag is set\n if (!empty($params['skip'])) {\n continue;\n }\n\n if($params['type'] == 'slug')\n {\n $data[$key . '_slug'] = str_slug($this->getStringData($key));\n }\n\n // set field to null, if not in POSTed data array (checkboxes)\n $this->nullIfOmitted($key, $this->data);\n\n // get data as string by flattening arrays\n $data[$key] = $this->getStringData($key);\n }\n\n return $data;\n }", "private function _saveSec() {\r\n\r\n // get current configuration object\r\n $sefConfig = & Sh404sefFactory::getConfig();\r\n\r\n //set skip and nocache arrays, unless POST is empty, meaning this is first attempt to save config\r\n if (!empty($_POST)) {\r\n $sefConfig->shSecOnlyNumVars = array();\r\n $sefConfig->shSecAlphaNumVars = array();\r\n $sefConfig->shSecNoProtocolVars = array();\r\n $sefConfig->ipWhiteList = array();\r\n $sefConfig->ipBlackList = array();\r\n $sefConfig->uAgentWhiteList = array();\r\n $sefConfig->uAgentBlackList = array();\r\n }\r\n\r\n }", "protected function _save()\n\t{\n\t\t$_file = $this->_storagePath . DIRECTORY_SEPARATOR . $this->_fileName;\n\n\t\t$_data = json_encode( $this->contents() );\n\n\t\tif ( $this->_compressStore )\n\t\t{\n\t\t\t$_data = Utility\\Storage::freeze( $this->contents() );\n\t\t}\n\n\t\tif ( false === file_put_contents( $_file, $_data ) )\n\t\t{\n\t\t\tUtility\\Log::error( 'Unable to store Oasys data in \"' . $_file . '\". System error.' );\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function encode($key, $data);", "function config_save($data) {\n $module = 'project/lpr';\n\n foreach ($data as $name => $value) {\n set_config($name, $value, $module);\n }\n\n return true;\n }", "public function encode()\n {\n }", "private static function writeConfig($config)\n {\n self::init();\n\n return file_put_contents(self::$configFile, json_encode((object) $config, JSON_PRETTY_PRINT));\n }", "public function getConfigToString() {\n return serialize($this->_options);\n }", "public function serialize(SerializationWriter $writer): void {\n parent::serialize($writer);\n $writer->writeStringValue('displayName', $this->getDisplayName());\n $writer->writeEnumValue('platformType', $this->getPlatformType());\n $writer->writeIntegerValue('settingCount', $this->getSettingCount());\n $writer->writeCollectionOfObjectValues('settingStates', $this->getSettingStates());\n $writer->writeEnumValue('state', $this->getState());\n $writer->writeStringValue('userId', $this->getUserId());\n $writer->writeStringValue('userPrincipalName', $this->getUserPrincipalName());\n $writer->writeIntegerValue('version', $this->getVersion());\n }", "public function set_config_settings()\r\n\t{\t\r\n\t\t// Check the config table exists in the config file and is enabled.\r\n\t\tif ($this->get_enabled_status('config'))\r\n\t\t{\r\n\t\t\tif ($config_data = $this->get_database_config_data())\r\n\t\t\t{\r\n\t\t\t\t// Loop through all the returned defaults and convert the database column names to cart session names.\r\n\t\t\t\tforeach($this->flexi->cart_database['configuration']['columns'] as $column_name => $column_alias)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (isset($config_data[$column_alias]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$config_data[$column_name] = $config_data[$column_alias];\r\n\t\t\t\t\t\tunset($config_data[$column_alias]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Config file hard-coded settings.\r\n\t\t$config_defaults = $this->flexi->cart_defaults['configuration'];\r\n\r\n\t\t// Loop through the config hard-coded default settings and apply them to any config settings without a value from the database lookup.\r\n\t\tforeach($config_defaults as $setting_name => $setting_value)\r\n\t\t{\r\n\t\t\tif (! isset($config_data[$setting_name]))\r\n\t\t\t{\r\n\t\t\t\t$config_data[$setting_name] = $config_defaults[$setting_name];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Group non boolean config value types together.\r\n\t\t$non_boolean_columns = array('order_number_prefix', 'order_number_suffix', 'weight_type', 'minimum_order', 'reward_point_multiplier', 'reward_voucher_multiplier', \r\n\t\t\t'reward_point_to_voucher_ratio', 'reward_point_days_pending', 'reward_point_days_valid', 'reward_voucher_days_valid', 'quantity_decimals', 'weight_decimals');\r\n\t\t\r\n\t\t// Ensure the data is stored in the correct format type.\r\n\t\tforeach($config_data as $column => $value)\r\n\t\t{\r\n\t\t\t// Ensure non boolean values are stored as their entered value.\r\n\t\t\tif (in_array($column, $non_boolean_columns))\r\n\t\t\t{\r\n\t\t\t\t$config_data[$column] = (string)$config_data[$column];\r\n\t\t\t}\r\n\t\t\t// All others are saved as boolean.\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$config_data[$column] = (bool)$config_data[$column];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Set configuration data to cart session settings.\r\n\t\t$this->flexi->cart_contents['settings']['configuration'] = $config_data;\r\n\r\n\t\t// Set an empty cart id and order number placeholder.\r\n\t\t$this->flexi->cart_contents['settings']['configuration']['cart_data_id'] = FALSE;\r\n\t\t$this->flexi->cart_contents['settings']['configuration']['order_number'] = FALSE;\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}", "protected function setUpConfigurationData() {}", "public function put($configKey, $key, $data);", "abstract public function encode($data);", "public function store(Request $request, Configuration $config)\n {\n $switch = (bool) $request->input('switch');\n $apply_amount = (int) $request->input('apply_amount');\n $onlookers_amount = (int) $request->input('onlookers_amount');\n $anonymity_rule = (string) $request->input('anonymity_rule');\n\n $config->set([\n 'question.app.switch' => $switch,\n 'question.apply_amount' => $apply_amount,\n 'question.onlookers_amount' => $onlookers_amount,\n 'question.anonymity_rule' => $anonymity_rule,\n ]);\n\n return response()->json(['message' => '设置成功'], 201);\n }", "public function serialize()\n {\n $data = array();\n\n $skip = array(\n 'connection',\n 'platform',\n 'driver'\n );\n\n foreach ($this as $key => $value) {\n if (in_array($key, $skip)) {\n continue;\n }\n $data[$key] = $value;\n }\n\n return serialize($data);\n }", "function store_data($data, $data_name)\n{\n /* @todo store the PUA data in its own table */\n update_option($data_name, serialize($data));\n}", "public function saveSettingAction(){\n $configKey = array('api_key', 'api_secret','include_folders','resize_auto',\n 'resize_image','min_size','max_size','compression_type_pdf','compression_type_png','compression_type_jpg','compression_type_gif', 'saving_auto', 'compress_auto', 'cron_periodicity', 'reindex_init');\n $coreConfig = Mage::getConfig();\n $post = $this->getRequest()->getPost();\n foreach ($configKey as $key) { \n if (isset($post[$key])) { \n $coreConfig->saveConfig(\"mageio_\".$key, Mage::helper('core')->escapeHtml($post[$key]))->cleanCache();\n }\n }\n\t\t$installed_time = Mage::getStoreConfig('mageio_installed_time');\n if(empty($installed_time)) {\n $installed_time = time();\n $coreConfig = Mage::getConfig();\n $coreConfig->saveConfig('mageio_installed_time', Mage::helper('core')->escapeHtml($installed_time))->cleanCache();\n }\n\t\t//Remove error message if set\n\t\t$coreConfig->saveConfig(\"mageio_errormessage\", Mage::helper('core')->escapeHtml(null))->cleanCache();\n\t\t\n\t\t$this->_redirect('imagerecycle/index/index');\n\t}", "abstract protected function serializeData();", "private function save_configuration_bundle() {\n\t\t$this->configuration_bundle = array();\n\t\t// Some items must always be saved + restored; others only on a migration\n\t\t// Remember, if modifying this, that a restoration can include restoring a destroyed site from a backup onto a fresh WP install on the same URL. So, it is not necessarily desirable to retain the current settings and drop the ones in the backup.\n\t\t$keys_to_save = array('updraft_remotesites', 'updraft_migrator_localkeys', 'updraft_central_localkeys', 'updraft_restore_in_progress');\n\n\t\tif ($this->old_siteurl != $this->our_siteurl || (defined('UPDRAFTPLUS_RESTORE_ALL_SETTINGS') && UPDRAFTPLUS_RESTORE_ALL_SETTINGS)) {\n\t\t\tglobal $updraftplus;\n\t\t\t$keys_to_save = array_merge($keys_to_save, $updraftplus->get_settings_keys());\n\t\t\t$keys_to_save[] = 'updraft_backup_history';\n\t\t}\n\n\t\tforeach ($keys_to_save as $key) {\n\t\t\t$this->configuration_bundle[$key] = UpdraftPlus_Options::get_updraft_option($key);\n\t\t}\n\t}", "public function save_settings($data) {\n\n\t\treturn array(\n\t\t\t'config_settings' => $this->EE->input->post('config_settings'),\n\t\t\t'eeck_image_upload' => $this->EE->input->post('eeck_image_upload'),\n\t\t\t'eeck_file_upload' => $this->EE->input->post('eeck_file_upload'),\n\t\t\t'eeck_flash_upload' => $this->EE->input->post('eeck_flash_upload'),\n\t\t\t'field_fmt' => 'none',\n\t\t\t'field_show_fmt' => 'n'\n\t\t\t\t);\n\t}", "abstract function encode($data);", "public function store(Request $request)\n {\n // Validate the request\n $data = $request->validate([\n 'software_id' => 'required|exists:softwares,id',\n 'name' => 'required|string|max:191',\n 'content' => 'required',\n 'filename' => 'required|string|max:191',\n 'path' => 'required|string|max:191'\n\n ]);\n\n // Store the the newly created configuration\n $configuration = Configuration::create([\n 'user_id' => Auth::guard('api')->id(),\n 'software_id' => $data['software_id'],\n 'name' => $data['name'],\n 'content' => $data['content'],\n 'filename' => $data['filename'],\n 'path' => $data['path']\n ]);\n\n // Load the configuration's details\n $configuration->load('software:id,name,vendor,vendor_url');\n\n // Return the details of the configuration with a 201 status code\n return response()->json([\n 'data' => $configuration\n ], 201);\n }", "function write_config()\n\t{\n\t\t$charmap \t= $this->paths['tempdir'].'/'.$this->paths['config'];\n\t\t$handle \t= @fopen( $charmap, 'w' );\n\t\t\n\t if ($handle)\n\t {\n\t fwrite( $handle, '<?php $chars = array();');\n\t \n\t foreach($this->svg_config[$this->font_name] as $unicode)\n\t {\n\t \tif(!empty($unicode))\n\t \t{\n\t \t\t$delimiter = \"'\";\n\t \t\tif(strpos($unicode, \"'\") !== false) $delimiter = '\"';\n\t \t\tfwrite( $handle, \"\\r\\n\".'$chars[\\''.$this->font_name.'\\']['.$delimiter.$unicode.$delimiter.'] = '.$delimiter.$unicode.$delimiter.';' );\n\t \t}\n\t } \t \n\t \n\t fclose( $handle );\n\t }\n\t else\n\t {\n\t \t$this->delete_folder($this->paths['tempdir']);\n\t\t\texit('Was not able to write a config file');\n\t }\n\t\t\n\t\t\n\t}", "public function addStorage($config = array()) {\n\t\t//add storage for after processing\n\t\t$this->storages[] = $config;\n\t}", "function emb_save_options() {\n\t}", "public function setStorageData(string $storage_path): Uploadable;", "public function encode($format);", "function enc($data)\n {\n return base64_encode($data);\n }", "private function saveConfig(){\n\t\tif(!isset($_POST['services_ipsec_settings_enabled'])){\n\t\t\t$this->data['enable'] = 'false';\n\t\t}\n\t\telseif($_POST['services_ipsec_settings_enabled'] == 'true'){\n\t\t\t$this->data['enable'] = 'true';\n\t\t}\n\t\t\n\t\t$this->config->saveConfig();\n\t\t$this->returnConfig();\n\t}", "public function save()\n\t{\n\t\tif($this->beforeSave())\n\t\t{\n\t\t\t$dest = $this->getStorageFile();\n\t\t\t\n\t\t\tif(file_exists($dest) and is_writable($dest)===false)\n\t\t\t{\n\t\t\t\t@chmod($dest,0777);\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($dest,$this->mode);\n\t\t\tfwrite($fp,$this->data);\n\t\t\tfclose($fp);\n\t\t\t$this->afterSave();\n\t\t}\n\t}", "protected function defaultRawConfiguration()\n {\n return [\n 'negotiation' => [\n 'enabled' => false,\n ],\n 'serializer' => [\n 'enabled' => true\n ],\n 'normalizer' => [\n 'enabled' => false\n ],\n 'validator' => [\n 'enabled' => false\n ],\n 'types' =>\n [\n [\n 'name' => 'json',\n 'values'=> [\n 'application/json','text/json'\n ],\n 'restrict' => null\n ],\n [\n 'name' => 'xml',\n 'values' => [\n 'application/xml','text/xml'\n ],\n 'restrict' => null\n ]\n ],\n 'headers' =>\n [\n 'content_type' => 'content-type',\n 'accept_type' => 'accept'\n ]\n ];\n }", "function saveConfig(Config_Lite $inConfig) {\r\n\t\ttry {\r\n $inConfig->save();\r\n\t\t} catch (Config_Lite_Exception $e) {\r\n\t\t\techo \"\\n\" . 'Exception Message: ' . $e->getMessage();\r\n\t\t\twrite_log('Error saving configuration.','ERROR');\r\n\t\t}\r\n\t\t$configFile = dirname(__FILE__) . '/config.ini.php';\r\n\t\t$cache_new = \"'; <?php die('Access denied'); ?>\"; // Adds this to the top of the config so that PHP kills the execution if someone tries to request the config-file remotely.\r\n\t\t$cache_new .= file_get_contents($configFile);\r\n\t\tfile_put_contents($configFile,$cache_new);\r\n\t\t\r\n\t}", "public function encode($data) {\n return serialize($data);\n }", "function serendipity_updateConfiguration() {\n global $serendipity, $umask;\n\n // Save all basic config variables to the database\n $config = serendipity_parseTemplate(S9Y_CONFIG_TEMPLATE);\n\n if (isset($_POST['sqlitedbName']) && !empty($_POST['sqlitedbName'])) {\n $_POST['dbName'] = $_POST['sqlitedbName'];\n }\n\n // Password can be hidden in re-configuring, but we need to store old password\n if (empty($_POST['dbPass']) && !empty($serendipity['dbPass'])) {\n $_POST['dbPass'] = $serendipity['dbPass'];\n }\n\n foreach($config as $category) {\n foreach ( $category['items'] as $item ) {\n\n /* Don't save trash */\n if ( !serendipity_checkConfigItemFlags($item, 'configuration') ) {\n continue;\n }\n\n if (!isset($item['userlevel'])) {\n $item['userlevel'] = USERLEVEL_ADMIN;\n }\n\n // Check permission set. Changes to blogConfiguration or siteConfiguration items\n // always required authorid = 0, so that it be not specific to a userlogin\n if ( ($serendipity['serendipityUserlevel'] ?? 0) >= $item['userlevel'] || IS_installed === false ) {\n $authorid = 0;\n } elseif ($item['permission'] == 'blogConfiguration' && serendipity_checkPermission('blogConfiguration')) {\n $authorid = 0;\n } elseif ($item['permission'] == 'siteConfiguration' && serendipity_checkPermission('siteConfiguration')) {\n $authorid = 0;\n } else {\n $authorid = $serendipity['authorid'];\n }\n\n if (is_array($_POST[$item['var']])) {\n // Arrays not allowed. Use first index value.\n $_POST[$item['var']] = array_key_first($_POST[$item['var']]);\n\n // If it still is an array, munge it all together.\n if (is_array($_POST[$item['var']])) {\n $_POST[$item['var']] = @implode(',', $_POST[$item['var']]);\n }\n }\n\n serendipity_set_config_var($item['var'], $_POST[$item['var']], $authorid);\n }\n }\n\n if (IS_installed === false || serendipity_checkPermission('siteConfiguration')) {\n return serendipity_updateLocalConfig($_POST['dbName'],\n $_POST['dbPrefix'],\n $_POST['dbHost'],\n $_POST['dbUser'],\n $_POST['dbPass'],\n $_POST['dbType'],\n $_POST['dbPersistent']);\n } else {\n return true;\n }\n}", "function saveConfig($data) {\n\t$isValid = false;\n\tif(strip_tags($data) == $data) {\n\t\t$isValid = true;\n\t}\n\n\tif ($isValid) {\n\t\treturn file_put_contents(\"config.yml\", stripslashes($data));\n\t}\n\t{\n\t\treturn false;\n\t}\n}", "public function localConfig();" ]
[ "0.5545379", "0.5489159", "0.54490453", "0.54300356", "0.5394215", "0.5389233", "0.53847975", "0.53560495", "0.526964", "0.5225407", "0.5206583", "0.51743037", "0.5161273", "0.5157175", "0.5132337", "0.50227976", "0.5020768", "0.5009272", "0.5006084", "0.49858108", "0.49787983", "0.49654242", "0.49603006", "0.49602598", "0.49544677", "0.4947444", "0.4939542", "0.49385443", "0.4936093", "0.4934481", "0.4934405", "0.4934405", "0.4934405", "0.4934405", "0.49303904", "0.49214494", "0.49206474", "0.48928294", "0.488925", "0.48884237", "0.48822358", "0.4876191", "0.48728517", "0.48637566", "0.48590633", "0.48586488", "0.48526135", "0.48359808", "0.48317668", "0.482904", "0.4815533", "0.4805078", "0.47986934", "0.47894743", "0.47872448", "0.47865003", "0.47818935", "0.47754514", "0.47699934", "0.47699815", "0.4757687", "0.47546935", "0.47466335", "0.47390065", "0.47386798", "0.47343844", "0.47316745", "0.47221515", "0.4719379", "0.4691897", "0.46904084", "0.46886262", "0.46837616", "0.46797535", "0.46786278", "0.4667765", "0.4665898", "0.46635446", "0.46624404", "0.4659701", "0.46524182", "0.46515787", "0.46471295", "0.46444044", "0.46419907", "0.46410954", "0.46408036", "0.46382627", "0.46374202", "0.46359727", "0.4621626", "0.46213228", "0.46203166", "0.4612318", "0.46120477", "0.46060318", "0.46016666", "0.45987198" ]
0.47212213
70
Decodes configuration data from the storagespecific format.
public function decode($raw);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function readConfigurationValues();", "public function decode ()\n {\n $magicBytes = $this->nextBytes(4);\n if (Utils::byteArray2String($magicBytes) === \"meta\") {\n $this->version = hexdec(Utils::bytesToHex($this->nextBytes(1)));\n if (!empty($this->metadataVersion[$this->version])) {\n $metadata[\"metadata\"] = $this->process($this->metadataVersion[$this->version]);\n $metadata[\"magicNumber\"] = $this->process(\"u32\", new ScaleBytes($magicBytes));\n $metadata[\"metadata_version\"] = $this->version;\n return $metadata;\n } else {\n throw new InvalidArgumentException(sprintf('only support metadata v12,v13,14'));\n }\n } else {\n throw new InvalidArgumentException(sprintf('decode runtime metadata fail'));\n }\n }", "public function getConfigData() {\n\t\treturn array(\n\t\t\t'storageType' => StorageFactory::TYPE_DUMMY,\n\t\t\t'debuggerDisabled' => $this->debuggerDisabled,\n\t\t);\n\t}", "abstract public function convert_to_storage();", "abstract public function convert_from_storage($source);", "public function getForStorage()\n {\n $data = [];\n\n foreach ($this->config->getFields() as $key => $params) {\n\n // skip field if flag is set\n if (!empty($params['skip'])) {\n continue;\n }\n\n if($params['type'] == 'slug')\n {\n $data[$key . '_slug'] = str_slug($this->getStringData($key));\n }\n\n // set field to null, if not in POSTed data array (checkboxes)\n $this->nullIfOmitted($key, $this->data);\n\n // get data as string by flattening arrays\n $data[$key] = $this->getStringData($key);\n }\n\n return $data;\n }", "public function decode($config, $array = false)\n {\n return json_decode($config, $array);\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"WafConfig\",$param) and $param[\"WafConfig\"] !== null) {\n $this->WafConfig = new WafConfig();\n $this->WafConfig->deserialize($param[\"WafConfig\"]);\n }\n\n if (array_key_exists(\"RateLimitConfig\",$param) and $param[\"RateLimitConfig\"] !== null) {\n $this->RateLimitConfig = new RateLimitConfig();\n $this->RateLimitConfig->deserialize($param[\"RateLimitConfig\"]);\n }\n\n if (array_key_exists(\"AclConfig\",$param) and $param[\"AclConfig\"] !== null) {\n $this->AclConfig = new AclConfig();\n $this->AclConfig->deserialize($param[\"AclConfig\"]);\n }\n\n if (array_key_exists(\"BotConfig\",$param) and $param[\"BotConfig\"] !== null) {\n $this->BotConfig = new BotConfig();\n $this->BotConfig->deserialize($param[\"BotConfig\"]);\n }\n\n if (array_key_exists(\"SwitchConfig\",$param) and $param[\"SwitchConfig\"] !== null) {\n $this->SwitchConfig = new SwitchConfig();\n $this->SwitchConfig->deserialize($param[\"SwitchConfig\"]);\n }\n\n if (array_key_exists(\"IpTableConfig\",$param) and $param[\"IpTableConfig\"] !== null) {\n $this->IpTableConfig = new IpTableConfig();\n $this->IpTableConfig->deserialize($param[\"IpTableConfig\"]);\n }\n\n if (array_key_exists(\"ExceptConfig\",$param) and $param[\"ExceptConfig\"] !== null) {\n $this->ExceptConfig = new ExceptConfig();\n $this->ExceptConfig->deserialize($param[\"ExceptConfig\"]);\n }\n\n if (array_key_exists(\"DropPageConfig\",$param) and $param[\"DropPageConfig\"] !== null) {\n $this->DropPageConfig = new DropPageConfig();\n $this->DropPageConfig->deserialize($param[\"DropPageConfig\"]);\n }\n\n if (array_key_exists(\"TemplateConfig\",$param) and $param[\"TemplateConfig\"] !== null) {\n $this->TemplateConfig = new TemplateConfig();\n $this->TemplateConfig->deserialize($param[\"TemplateConfig\"]);\n }\n\n if (array_key_exists(\"SlowPostConfig\",$param) and $param[\"SlowPostConfig\"] !== null) {\n $this->SlowPostConfig = new SlowPostConfig();\n $this->SlowPostConfig->deserialize($param[\"SlowPostConfig\"]);\n }\n }", "public static function jsonDecode($json)\n {\n $config = static::jsonToArray($json);\n if (array_key_exists(ConfigTypeA::JSON_ASHOST, $config)\n || array_key_exists(ConfigTypeA::JSON_SYSNR, $config)\n || array_key_exists(ConfigTypeA::JSON_GWHOST, $config)\n || array_key_exists(ConfigTypeA::JSON_GWSERV, $config)\n ) {\n return new ConfigTypeA($config);\n }\n if (array_key_exists(ConfigTypeB::JSON_MSHOST, $config)\n || array_key_exists(ConfigTypeB::JSON_R3NAME, $config)\n || array_key_exists(ConfigTypeB::JSON_GROUP, $config)\n ) {\n return new ConfigTypeB($config);\n }\n throw new InvalidArgumentException(\n 'Cannot automatically determine the configuration type from the'\n . ' given configuration keys!'\n );\n }", "public function decode($data) {}", "public function decode($data) {}", "public function decode($data) {}", "public function decode($data) {}", "public function decode($data) {}", "public static function parseSettings()\n\t{\n\t\t$settings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['sd_googlemaps']);\n\n\t\tif (!is_array($settings)) {\n\t\t\t$settings = [];\n\t\t}\n\t\treturn $settings;\n\t}", "protected function getFromStorage()\n {\n try {\n if ($data = $this->parseJson(file_get_contents($this->getStoragePath()))) {\n return $data;\n }\n } catch (ErrorException $e) {\n // File does not exist or could not be opened.\n }\n\n // Fall back to the list provided by the package.\n return $this->parseJson(file_get_contents(__DIR__.'/../domains.json'));\n }", "abstract public function decode($data);", "private function load_options()\n\t\t{\n\t\t\t$options = NULL;\n\n\t\t\t// load from persistent store\n\t\t\tif ( NULL !== $this->option_name ) {\n\t\t\t\t// reading from database\n\t\t\t\t$options = get_option( $this->option_name, $this->defaults );\n\t\t\t} else if ( NULL !== $this->filename ) {\n\t\t\t\t// reading from filesystem\n\t\t\t\tif ( file_exists( $this->filename ) ) {\n\t\t\t\t\t$data = file_get_contents( $this->filename );\n\t\t\t\t\t$options = json_decode( $data, TRUE );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// TODO: add capability to store in DS specific table\n\n\t\t\t// this ensures we have *something*, even if it's an empty array\n\t\t\tif ( NULL === $options )\n\t\t\t\t$options = $this->defaults;\n\n\t\t\t$this->_options = array_merge( $this->defaults, $options );\n\t\t}", "public function deserialize($data);", "public function parseConfig()\n {\n $fileContents = file_get_contents($this->filename);\n if (!$fileContents) {\n $this->error = 'Failed to read file contents';\n\n return false;\n }\n\n $config = json_decode($fileContents, true);\n if (json_last_error()) {\n $this->error = json_last_error_msg();\n\n return false;\n }\n\n $this->config = new Data(array_replace_recursive($config, $this->overrides));\n\n return true;\n }", "public function decode ($raw);", "public static function provideJsonDecodeConfigTypeB()\n {\n return [\n [[ConfigTypeB::JSON_MSHOST => '4htV2O3BMH'], '{\"'.ConfigTypeB::JSON_MSHOST.'\":\"4htV2O3BMH\"}'],\n [[ConfigTypeB::JSON_R3NAME => 'XmJsmqU3ua'], '{\"'.ConfigTypeB::JSON_R3NAME.'\":\"XmJsmqU3ua\"}'],\n [[ConfigTypeB::JSON_GROUP => 'Tczw3KTagh'], '{\"'.ConfigTypeB::JSON_GROUP.'\":\"Tczw3KTagh\"}']\n ];\n }", "private function unpackData()\n {\n return json_decode($this->packedData, true);\n }", "public function decode($data);", "function formatToArray($content, $extension, $customDecoder)\n{\n if ($customDecoder != null) {\n return $customDecoder($content);\n } else {\n $decoders = getDecoders();\n\n if (key_exists($extension, $decoders)) {\n return $decoders[$extension]($content);\n } else {\n echo \"unacceptable input file format: $extension\";\n return false;\n }\n }\n\n /*\n switch ($extension) {\n case 'json':\n return json\\decode($content);\n break;\n case 'yml':\n return yml\\decode($content);\n break;\n default:\n echo \"unacceptable input file format: $extension\";\n return false;\n break;\n }\n */\n}", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"LocalDiskType\",$param) and $param[\"LocalDiskType\"] !== null) {\n $this->LocalDiskType = $param[\"LocalDiskType\"];\n }\n\n if (array_key_exists(\"LocalDiskSize\",$param) and $param[\"LocalDiskSize\"] !== null) {\n $this->LocalDiskSize = $param[\"LocalDiskSize\"];\n }\n\n if (array_key_exists(\"LocalDiskCount\",$param) and $param[\"LocalDiskCount\"] !== null) {\n $this->LocalDiskCount = $param[\"LocalDiskCount\"];\n }\n }", "public function loadConfig($data);", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"Spec\",$param) and $param[\"Spec\"] !== null) {\n $this->Spec = $param[\"Spec\"];\n }\n\n if (array_key_exists(\"SpecName\",$param) and $param[\"SpecName\"] !== null) {\n $this->SpecName = $param[\"SpecName\"];\n }\n\n if (array_key_exists(\"StorageType\",$param) and $param[\"StorageType\"] !== null) {\n $this->StorageType = $param[\"StorageType\"];\n }\n\n if (array_key_exists(\"DiskType\",$param) and $param[\"DiskType\"] !== null) {\n $this->DiskType = $param[\"DiskType\"];\n }\n\n if (array_key_exists(\"RootSize\",$param) and $param[\"RootSize\"] !== null) {\n $this->RootSize = $param[\"RootSize\"];\n }\n\n if (array_key_exists(\"MemSize\",$param) and $param[\"MemSize\"] !== null) {\n $this->MemSize = $param[\"MemSize\"];\n }\n\n if (array_key_exists(\"Cpu\",$param) and $param[\"Cpu\"] !== null) {\n $this->Cpu = $param[\"Cpu\"];\n }\n\n if (array_key_exists(\"DiskSize\",$param) and $param[\"DiskSize\"] !== null) {\n $this->DiskSize = $param[\"DiskSize\"];\n }\n\n if (array_key_exists(\"InstanceType\",$param) and $param[\"InstanceType\"] !== null) {\n $this->InstanceType = $param[\"InstanceType\"];\n }\n }", "function parseConfig() {\n\n\t\t// Make sure our config file exists\n\t\tif(!file_exists(CONFIGPATH . $this->_options['configFile'])) {\n\t\t\tdie('Unable to find <b>'. CONFIGPATH . $this->_options['configFile'] .'</b> file, please check your application configuration');\n\t\t}\n\n\t\t// Switch the file extension\n\t\tswitch(PPI_Helper::getFileExtension($this->_options['configFile'])) {\n\t\t\tcase 'ini':\n\t\t\t\treturn new PPI_Config_Ini(parse_ini_file(CONFIGPATH . $this->_options['configFile'], true, INI_SCANNER_RAW), $this->_options['configBlock']);\n\n\t\t\tcase 'xml':\n\t\t\t\tdie('Trying to load a xml config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t\tcase 'php':\n\t\t\t\tdie('Trying to load a php config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t}\n\t}", "private function parseConfig(){\n\t\t\treturn parse_ini_file(BASE_PATH . 'config' . DIRECTORY_SEPARATOR . 'config.ini');\n\t\t}", "public function getConfiguration()\n {\n $configuration = parent::getConfiguration();\n $configuration['debug'] = isset($configuration['debug']) ? $configuration['debug'] : false;\n $configuration['fileUri'] = $this->container->getParameter(\"mapbender.uploads_dir\") . \"/data-store\";\n\n if (isset($configuration[\"schemes\"]) && is_array($configuration[\"schemes\"])) {\n foreach ($configuration[\"schemes\"] as $key => &$scheme) {\n if (is_string($scheme['dataStore'])) {\n $storeId = $scheme['dataStore'];\n $dataStore = $this->container->getParameter('dataStores');\n $scheme['dataStore'] = $dataStore[ $storeId ];\n $scheme['dataStore'][\"id\"] = $storeId;\n //$dataStore = new DataStore($this->container, $configuration['source']);\n }\n if (isset($scheme['formItems'])) {\n $scheme['formItems'] = $this->prepareItems($scheme['formItems']);\n }\n }\n }\n return $configuration;\n }", "abstract protected function loadConfig();", "public static function provideJsonDecodeConfigTypeA()\n {\n return [\n [[ConfigTypeA::JSON_ASHOST => 'ItulITyML1'], '{\"'.ConfigTypeA::JSON_ASHOST.'\":\"ItulITyML1\"}'],\n [[ConfigTypeA::JSON_SYSNR => '5345'], '{\"'.ConfigTypeA::JSON_SYSNR.'\":\"5345\"}'],\n [[ConfigTypeA::JSON_GWHOST => '6sqPJLVVgS'], '{\"'.ConfigTypeA::JSON_GWHOST.'\":\"6sqPJLVVgS\"}'],\n [[ConfigTypeA::JSON_GWSERV => 'pzkPI1ZV7f'], '{\"'.ConfigTypeA::JSON_GWSERV.'\":\"pzkPI1ZV7f\"}']\n ];\n }", "public function decodeValue($value)\n {\n if ($value !== false) {\n if ($this->format == self::JSON) {\n $value = json_decode($value, true);\n } else if ($this->format == self::PHP) {\n $value = unserialize($value);\n }\n }\n\n return $value;\n }", "function phunpack($format, $data){\n\t$tmp = unpack($format,$data);\n\t$result=array();\n foreach ($tmp as $key => $val) {\n \tif(substr($key,0,4)!='skip')$result[$key] = $val;\n }\n return $result;\n}", "function load_config() {\n\t\t$conf_file = @file_get_contents( LDAP_LOGIN_PATH.'data.dat' );\n\t\tif ($conf_file!==false)\n\t\t{\n\t\t\t$this->config = unserialize($conf_file);\n\t\t}\n\t}", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"Records\",$param) and $param[\"Records\"] !== null) {\n $this->Records = [];\n foreach ($param[\"Records\"] as $key => $value){\n $obj = new ConfigData();\n $obj->deserialize($value);\n array_push($this->Records, $obj);\n }\n }\n\n if (array_key_exists(\"ContinueToken\",$param) and $param[\"ContinueToken\"] !== null) {\n $this->ContinueToken = $param[\"ContinueToken\"];\n }\n\n if (array_key_exists(\"RemainingCount\",$param) and $param[\"RemainingCount\"] !== null) {\n $this->RemainingCount = $param[\"RemainingCount\"];\n }\n }", "public static function load()\n {\n $entries = Configuration::get();\n \n foreach ($entries as $entry) {\n self::$config[$entry->id] = unserialize($entry->value);\n }\n }", "public function prepareConfigSchema()\n {\n // Store Chapters\n $fromchapter = ['labels' => [],'id' => []];\n foreach ($this->container->db->getFormats() as $f) {\n array_push($fromchapter['labels'], $f->getName());\n array_push($fromchapter['id'], $f->getId());\n }\n\n // Store Issues\n $fromissue = ['labels' => [],'id' => []];\n foreach ($this->container->db->getIssues() as $i) {\n array_push($fromissue['labels'], $i->getName());\n array_push($fromissue['id'], $i->getId());\n }\n\n // Store Books\n $frombook = ['labels' => [],'id' => []];\n foreach ($this->container->db->getBooks() as $b) {\n array_push($frombook['labels'], $b->getName());\n array_push($frombook['id'], $b->getId());\n }\n\n // Store Templates\n $fromtemplate = ['labels' => [],'id' => []];\n foreach ($this->container->db->getTemplatenames() as $t) {\n array_push($fromtemplate['labels'], $t->getName());\n array_push($fromtemplate['id'], $t->getId());\n }\n\n // Store Templates\n $fromfield = ['labels' => [],'id' => []];\n foreach ($this->container->db->getTemplatefields() as $t) {\n array_push($fromfield['labels'], $t->getFieldname());\n array_push($fromfield['id'], $t->getId());\n }\n\n // Store Historytypes\n\n foreach (['books', 'issues', 'chapters', 'cloud', 'other', 'self', 'contributional', 'structural', 'fixed'] as $_ht) {\n $historytypes['id'][] = $_ht;\n $historytypes['labels'][] = $this->container->translations['field_historytype_'.$_ht];\n }\n\n // Todo\n $thisfields = [\n 'labels' => ['fielda', 'fieldb','fieldc'],\n 'id' => [1,2,3]\n ];\n\n $lengthinfluence = [\n 'title' => $this->container->translations['field_config'.'lengthinfluence'],\n 'options' => [\n 'collapsed' => true\n ],\n 'type' => 'array',\n 'propertyOrder' => 100,\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => $this->container->translations['field_config'.'lengthinfluence'.'row'],\n 'headerTemplate' => '{{ self.fieldname }}',\n 'properties' => [\n 'factor' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'lengthinfluence'.'factor'],\n ],\n 'fieldname' => [\n 'type' => 'string',\n 'uniqueItems' => true,\n 'enum' => [],//$fromfield['id'],\n 'options' => [\n 'enum_titles' => $fromfield['labels'],\n 'title' => [],//$this->container->translations['field_config'.'lengthinfluence'.'labels'],\n ]\n ]\n ]\n ]\n ];\n\n $schema = [\n 'title' => 'Field Configuration',\n 'type' => 'object',\n 'properties' => [\n 'imagesize' => [\n 'title' => $this->container->translations['field_config'.'imagesize'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => $this->container->translations['field_config'.'imagesize'.'row'],\n 'properties' => [\n 'width' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'imagesize'.'width'],\n ],\n 'height' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'imagesize'.'height'],\n ]\n ]\n ]\n ],\n 'caption_variants' => [\n 'title' => $this->container->translations['field_config'.'imagecaptions'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 11,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'imagecaption'],\n ]\n ],\n 'history' => [\n 'title' => $this->container->translations['field_config'.'history'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'fullhistory' => [\n 'title' => $this->container->translations['field_config'.'fullhistory'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox',\n 'watch' => [\n 'hist' => 'history'\n ],\n 'hidden' => '!history'\n ],\n 'growing' => [\n 'title' => $this->container->translations['field_config'.'growing'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'maxlines' => [\n 'title' => $this->container->translations['field_config'.'maxlines'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'textlength' => [\n 'title' => $this->container->translations['field_config'.'textlength'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'lengthinfluence' => $lengthinfluence,\n 'rtfeditor' => [\n 'title' => $this->container->translations['field_config'.'rtfeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'markdowneditor' => [\n 'title' => $this->container->translations['field_config'.'markdowneditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'codeeditor' => [\n 'title' => $this->container->translations['field_config'.'codeeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'editorcolumns' => [\n 'title' => $this->container->translations['field_config'.'editorcolumns'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => 'Line',\n 'properties' => [\n \"lines\" => [\n 'type' => 'integer',\n 'title' => $this->container->translations['field_config'.'editorcolumns'.'lines'],\n ],\n \"label\" => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'editorcolumns'.'label'],\n ]\n ]\n ]\n ],\n 'arrayeditor' => [\n 'title' => $this->container->translations['field_config'.'arrayeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'columns' => [\n 'title' => $this->container->translations['field_config'.'columns'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'colnames' => [\n 'title' => $this->container->translations['field_config'.'colnames'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'format' => 'text',\n 'title' => $this->container->translations['field_config'.'colnames'.'labels'],\n ]\n ],\n 'latitude' => [\n 'title' => $this->container->translations['field_config'.'latitude'],\n 'type' => 'number',\n 'propertyOrder' => 0\n ],\n 'longitude' => [\n 'title' => $this->container->translations['field_config'.'longitude'],\n 'type' => 'number',\n 'propertyOrder' => 0\n ],\n 'dateformat' => [\n 'title' => $this->container->translations['field_config'.'dateformat'],\n 'type' => 'string',\n 'propertyOrder' => 2,\n 'uniqueItems' => true,\n 'enum' => [\n 'd/m/Y H:i:s', 'd/m/Y H:i', 'd/m/Y', 'm/Y', 'Y'\n ],\n 'options' => [\n 'enum_titles' => [\n 'dd/mm/yyyy hh:mm:ss', 'dd/mm/yyyy hh:mm', 'dd/mm/yyyy', 'mm/yyyy', 'yyyy'\n ]\n ]\n ],\n 'integer' => [\n 'title' => $this->container->translations['field_config'.'integer'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'resolve_foreign' => [\n 'title' => $this->container->translations['field_config'.'resolve_foreign'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'multiple' => [\n 'title' => $this->container->translations['field_config'.'multiple'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n //cloud\n 'threeDee' => [\n 'title' => $this->container->translations['field_config'.'threeDee'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'history_command' => [\n 'title' => $this->container->translations['field_config'.'history_command'],\n 'format' => 'select',\n 'propertyOrder' => -1,\n 'uniqueItems' => true,\n 'type' => 'string',\n 'enum' => $historytypes['id'],\n 'options' => [\n 'enum_titles' => $historytypes['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //legends\n 'legends' => [\n 'options' => [\n 'grid_columns' => 12,\n ],\n 'title' => $this->container->translations['field_config'.'legends'],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string'\n ]\n ],\n //fixed\n 'fixedvalues' => [\n 'options' => [\n 'grid_columns' => 12,\n ],\n 'title' => $this->container->translations['field_config'.'fixedvalues'],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'fixedvalues'.'row'],\n ]\n ],\n //issues, cloud, self, contributional\n 'restrict_to_open' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_open'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n // not implemented so far\n 'restrict_to_book' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_book'],\n 'type' => 'boolean',\n 'propertyOrder' => 2,\n 'format' => 'checkbox'\n ],\n //issues, chapters\n 'frombook' => [\n 'title' => $this->container->translations['field_config'.'frombook'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 1,\n 'uniqueItems' => true,\n 'enum' => $frombook['id'],\n 'options' => [\n 'enum_titles' => $frombook['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //cloud, other, self, contributional\n 'restrict_to_issue' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_issue'],\n 'type' => 'boolean',\n 'propertyOrder' => 4,\n 'format' => 'checkbox'\n ],\n //cloud, other, self, contributional\n 'fromissue' => [\n 'title' => $this->container->translations['field_config'.'fromissue'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 3,\n 'uniqueItems' => true,\n 'enum' => $fromissue['id'],\n 'options' => [\n 'enum_titles' => $fromissue['labels'],\n 'grid_columns' => 12,\n ]\n ],\n\n //contributional,\n 'restrict_to_chapter' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_chapter'],\n 'type' => 'boolean',\n 'propertyOrder' => 6,\n 'format' => 'checkbox'\n ],\n //contributional\n 'fromchapter' => [\n 'title' => $this->container->translations['field_config'.'fromchapter'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 5,\n 'uniqueItems' => true,\n 'enum' => $fromchapter['id'],\n 'options' => [\n 'enum_titles' => $fromchapter['labels'],\n 'grid_columns' => 12,\n ]\n ],\n // not implemented so far\n 'restrict_to_template' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_template'],\n 'type' => 'boolean',\n 'propertyOrder' => 9,\n 'format' => 'checkbox'\n ],\n //contributional, structural\n 'fromtemplate' => [\n 'title' => $this->container->translations['field_config'.'fromtemplate'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 8,\n 'uniqueItems' => true,\n 'enum' => $fromtemplate['id'],\n 'options' => [\n 'enum_titles' => $fromtemplate['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //cloud, other\n 'fromfield' => [\n 'title' => $this->container->translations['field_config'.'fromfield'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 10,\n 'uniqueItems' => true,\n 'enum' => $fromfield['id'],\n 'options' => [\n 'enum_titles' => $fromfield['labels'],\n 'grid_columns' => 12,\n ]\n ],\n ],\n ];\n return json_encode($schema);\n }", "protected function get_decoded_data() {\n return json_decode($this->get_data());\n }", "public function load()\n\t{\n\t\tif (file_exists(self::$configPath))\n\t\t{\n\t\t\t$this->config = json_decode(file_get_contents(self::$configPath), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->config = array();\n\t\t}\n\t}", "private static function getConfig() {\n\n\t\t$pathRoot = $_SERVER['DOCUMENT_ROOT'].substr($_SERVER['PHP_SELF'],0, strpos($_SERVER['PHP_SELF'],\"/\",1)).\"/config/\";\n\n\t\t$jsonConfig = file_get_contents($pathRoot.'config.json');\n\t\tself::$arrayConfig = json_decode($jsonConfig);\n\t}", "public function unserialize($data) {}", "function getConfigObj(){\n $fh = fopen($GLOBALS['configFileName'],'r')\n\t\t\tor die(\"Unable to open file!\");\n\n $configJson = fread($fh, filesize($GLOBALS['configFileName']));\n fclose($fh);\n // print($configJson);\n // $configObj = json_decode($configJson);\n // var_dump($configObj); //->{'devices'}[0]->{'name'};\n return json_decode($configJson);\n }", "public function parse2array() {\n\t\t/**\n\t\t * Thanks to Vladimir Struchkov <great_boba yahoo com> for providing the\n\t\t * code to extract base64 encoded values\n\t\t */\n\n\t\t$arr1 = explode( \"\\n\", str_replace( \"\\r\", '', $this->rawdata ) );\n\t\t$i = $j = 0;\n\t\t$arr2 = array();\n\n\t\t/* First pass, rawdata is splitted into raw blocks */\n\t\tforeach ( $arr1 as $v ) {\n\t\t\tif ( trim( $v ) == '' ) {\n\t\t\t\t++ $i;\n\t\t\t\t$j = 0;\n\t\t\t} else {\n\t\t\t\t$arr2[ $i ][ $j ++ ] = $v;\n\t\t\t}\n\t\t}\n\n\t\t/* Second pass, raw blocks are updated with their name/value pairs */\n\t\tforeach ( $arr2 as $k1 => $v1 ) {\n\t\t\t$i = 0;\n\t\t\t$decode = false;\n\t\t\tforeach ( $v1 as $v2 ) {\n\t\t\t\tif ( ereg( '::', $v2 ) ) { // base64 encoded, chunk start\n\t\t\t\t\t$decode = true;\n\t\t\t\t\t$arr = explode( ':', str_replace( '::', ':', $v2 ) );\n\t\t\t\t\t$i = $arr[0];\n\t\t\t\t\t$this->entries[ $k1 ][ $i ] = base64_decode( $arr[1] );\n\t\t\t\t} elseif ( ereg( ':', $v2 ) ) {\n\t\t\t\t\t$decode = false;\n\t\t\t\t\t$arr = explode( ':', $v2 );\n\t\t\t\t\t$count = count( $arr );\n\t\t\t\t\tif ( $count != 2 ) {\n\t\t\t\t\t\tfor ( $i = $count - 1; $i > 1; -- $i ) {\n\t\t\t\t\t\t\t$arr[ $i - 1 ] .= ':' . $arr[ $i ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$i = $arr[0];\n\t\t\t\t\t$this->entries[ $k1 ][ $i ] = $arr[1];\n\t\t\t\t} else {\n\t\t\t\t\tif ( $decode ) { // base64 encoded, next chunk\n\t\t\t\t\t\t$this->entries[ $k1 ][ $i ] .= base64_decode( $v2 );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->entries[ $k1 ][ $i ] = $v2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function getConfiguration(): Configuration\n {\n $configFileContent = file_get_contents($this->configurationFilePath);\n try {\n $this->configuration = $this->serializer->deserialize($configFileContent, Configuration::class, $this->configurationFileFormat);\n } catch (\\RuntimeException|\\Exception $e) {\n throw new ConfigurationFileDeserializationException($this->configurationFileFormat . ' is unsupported', 0, $e);\n }\n return $this->configuration;\n }", "public function decode($rawContent);", "function deserialise(string $data): void;", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"InstanceId\",$param) and $param[\"InstanceId\"] !== null) {\n $this->InstanceId = $param[\"InstanceId\"];\n }\n\n if (array_key_exists(\"DiskSize\",$param) and $param[\"DiskSize\"] !== null) {\n $this->DiskSize = $param[\"DiskSize\"];\n }\n\n if (array_key_exists(\"BandWidth\",$param) and $param[\"BandWidth\"] !== null) {\n $this->BandWidth = $param[\"BandWidth\"];\n }\n\n if (array_key_exists(\"Partition\",$param) and $param[\"Partition\"] !== null) {\n $this->Partition = $param[\"Partition\"];\n }\n }", "abstract public function decode(array $options = array());", "public function deserialize($data)\n {\n }", "static public function util_array_from_storage( $blog_id, $preview ) {\n\t\t$content = self::load_content( $blog_id, $preview );\n\t\t$config = @json_decode( $content, true );\n\n\t\tif ( is_array( $config ) )\n\t\t\treturn $config;\n\n\t\treturn null;\n\t}", "public function getDecoder($format);", "private function validateConfig($config)\n {\n if (!is_array($config)) {\n throw new \\InvalidArgumentException(Constants::BAD_CONFIG_FORMAT_MESSAGE);\n }\n if (!array_key_exists('file_path', $config) && !array_key_exists('json_data', $config)) {\n throw new \\InvalidArgumentException('Config should either contain a `file_path` or `json_data`');\n }\n if (array_key_exists('file_path', $config)) {\n if (!file_exists($config['file_path'])) {\n throw new FileNotFound($config['file_path']);\n }\n $stores_data = file_get_contents($config['file_path']);\n }\n if (array_key_exists('json_data', $config)) {\n $stores_data = $config['json_data'];\n }\n\n $stores = json_decode(\n $stores_data,\n true\n );\n if (!$stores) {\n throw new \\InvalidArgumentException(Constants::INVALID_JSON_DATA_MESSAGE);\n }\n $this->stores = $stores;\n }", "public function parse()\n {\n $this->data = parse_ini_file($this->fileName);\n }", "public function deserialize($data, $type, $format, array $context = array())\n {\n return unserialize(base64_decode($data));\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"Zone\",$param) and $param[\"Zone\"] !== null) {\n $this->Zone = $param[\"Zone\"];\n }\n\n if (array_key_exists(\"SpecCode\",$param) and $param[\"SpecCode\"] !== null) {\n $this->SpecCode = $param[\"SpecCode\"];\n }\n\n if (array_key_exists(\"Storage\",$param) and $param[\"Storage\"] !== null) {\n $this->Storage = $param[\"Storage\"];\n }\n\n if (array_key_exists(\"InstanceCount\",$param) and $param[\"InstanceCount\"] !== null) {\n $this->InstanceCount = $param[\"InstanceCount\"];\n }\n\n if (array_key_exists(\"Period\",$param) and $param[\"Period\"] !== null) {\n $this->Period = $param[\"Period\"];\n }\n\n if (array_key_exists(\"Pid\",$param) and $param[\"Pid\"] !== null) {\n $this->Pid = $param[\"Pid\"];\n }\n\n if (array_key_exists(\"InstanceChargeType\",$param) and $param[\"InstanceChargeType\"] !== null) {\n $this->InstanceChargeType = $param[\"InstanceChargeType\"];\n }\n\n if (array_key_exists(\"InstanceType\",$param) and $param[\"InstanceType\"] !== null) {\n $this->InstanceType = $param[\"InstanceType\"];\n }\n\n if (array_key_exists(\"DBEngine\",$param) and $param[\"DBEngine\"] !== null) {\n $this->DBEngine = $param[\"DBEngine\"];\n }\n }", "function config_load() {\n\t\t$config_camera = '/^\\s*([^:]+)\\s*:\\s*([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})\\s+(\\d+)\\s*x\\s*(\\d+)\\s*$/iu';\n\t\t$config_gate = '/^\\s*(.+)\\s*\\((\\d+)\\s*,\\s*(\\d+)\\)\\s*\\((\\d+),(\\d+)\\)\\s*$/u';\n\n\t\t$data = file(CONFIG_PATH);\n\t\tif ($data === NULL) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$config = array();\n\n\t\t$status = 0;\n\t\tfor ($n=0; $n<sizeof($data); $n++) {\n\t\t\t$str = $data[$n];\n\t\t\n\t\t\tif (preg_match($config_camera, $str, $matches)) {\n\t\t\t\t$name = trim($matches[1]);\n\t\t\t\t$hw_id = $matches[2].$matches[3].$matches[4].$matches[5].$matches[6].$matches[7];\n\t\t\t\t$width = $matches[8];\n\t\t\t\t$height= $matches[9];\n\n\t\t\t\t$gates = array();\n\t\t\t\tarray_push($config, \n\t\t\t\t\t\t array(\"hw\" => $hw_id, \n\t\t\t\t\t\t \"name\" => $name, \n\t\t\t\t\t\t\t\t \"gates\" => &$gates,\n\t\t\t\t\t\t\t\t \"width\" => $width,\n\t\t\t\t\t\t\t\t \"height\"=> $height));\n\t\t\t\t$status = 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($status == 1 && preg_match($config_gate, $str, $matches)) {\n\t\t\t\tarray_push($gates, array(\"name\"=>trim($matches[1]),\n\t\t\t\t\t\t\t\t\t\t \"x1\" =>$matches[2],\n\t\t\t\t\t\t\t\t\t\t \"y1\" =>$matches[3],\n\t\t\t\t\t\t\t\t\t\t \"x2\" =>$matches[4],\n\t\t\t\t\t\t\t\t\t\t \"y2\" =>$matches[5]));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn $config;\n\t}", "private function parse($config) {\n\t\t$this->domain = $this->getDomainFromConfig($config);\n\n\t\t$this->configurations = $this->getSettingsFromConfig($config);\n\n\t\t$this->declarations = $this->getDeclarationsFromConfig($config);\n\t}", "protected function dbDecode($value)\n {\n $decodedValue = base64_decode($value);\n if (false === $decodedValue) {\n throw new Exception\\StorageException('Error decoding value');\n }\n \n return $decodedValue;\n }", "protected function loadConfig() : \\codename\\core\\config {\r\n return new \\codename\\core\\config\\json('config/model/' . $this->schema . '_' . $this->table . '.json', true, true);\r\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"ClusterId\",$param) and $param[\"ClusterId\"] !== null) {\n $this->ClusterId = $param[\"ClusterId\"];\n }\n\n if (array_key_exists(\"ClusterName\",$param) and $param[\"ClusterName\"] !== null) {\n $this->ClusterName = $param[\"ClusterName\"];\n }\n\n if (array_key_exists(\"Region\",$param) and $param[\"Region\"] !== null) {\n $this->Region = $param[\"Region\"];\n }\n\n if (array_key_exists(\"Zone\",$param) and $param[\"Zone\"] !== null) {\n $this->Zone = $param[\"Zone\"];\n }\n\n if (array_key_exists(\"PhysicalZone\",$param) and $param[\"PhysicalZone\"] !== null) {\n $this->PhysicalZone = $param[\"PhysicalZone\"];\n }\n\n if (array_key_exists(\"Status\",$param) and $param[\"Status\"] !== null) {\n $this->Status = $param[\"Status\"];\n }\n\n if (array_key_exists(\"StatusDesc\",$param) and $param[\"StatusDesc\"] !== null) {\n $this->StatusDesc = $param[\"StatusDesc\"];\n }\n\n if (array_key_exists(\"ServerlessStatus\",$param) and $param[\"ServerlessStatus\"] !== null) {\n $this->ServerlessStatus = $param[\"ServerlessStatus\"];\n }\n\n if (array_key_exists(\"StorageId\",$param) and $param[\"StorageId\"] !== null) {\n $this->StorageId = $param[\"StorageId\"];\n }\n\n if (array_key_exists(\"Storage\",$param) and $param[\"Storage\"] !== null) {\n $this->Storage = $param[\"Storage\"];\n }\n\n if (array_key_exists(\"MaxStorageSize\",$param) and $param[\"MaxStorageSize\"] !== null) {\n $this->MaxStorageSize = $param[\"MaxStorageSize\"];\n }\n\n if (array_key_exists(\"MinStorageSize\",$param) and $param[\"MinStorageSize\"] !== null) {\n $this->MinStorageSize = $param[\"MinStorageSize\"];\n }\n\n if (array_key_exists(\"StoragePayMode\",$param) and $param[\"StoragePayMode\"] !== null) {\n $this->StoragePayMode = $param[\"StoragePayMode\"];\n }\n\n if (array_key_exists(\"VpcName\",$param) and $param[\"VpcName\"] !== null) {\n $this->VpcName = $param[\"VpcName\"];\n }\n\n if (array_key_exists(\"VpcId\",$param) and $param[\"VpcId\"] !== null) {\n $this->VpcId = $param[\"VpcId\"];\n }\n\n if (array_key_exists(\"SubnetName\",$param) and $param[\"SubnetName\"] !== null) {\n $this->SubnetName = $param[\"SubnetName\"];\n }\n\n if (array_key_exists(\"SubnetId\",$param) and $param[\"SubnetId\"] !== null) {\n $this->SubnetId = $param[\"SubnetId\"];\n }\n\n if (array_key_exists(\"Charset\",$param) and $param[\"Charset\"] !== null) {\n $this->Charset = $param[\"Charset\"];\n }\n\n if (array_key_exists(\"CreateTime\",$param) and $param[\"CreateTime\"] !== null) {\n $this->CreateTime = $param[\"CreateTime\"];\n }\n\n if (array_key_exists(\"DbType\",$param) and $param[\"DbType\"] !== null) {\n $this->DbType = $param[\"DbType\"];\n }\n\n if (array_key_exists(\"DbMode\",$param) and $param[\"DbMode\"] !== null) {\n $this->DbMode = $param[\"DbMode\"];\n }\n\n if (array_key_exists(\"DbVersion\",$param) and $param[\"DbVersion\"] !== null) {\n $this->DbVersion = $param[\"DbVersion\"];\n }\n\n if (array_key_exists(\"StorageLimit\",$param) and $param[\"StorageLimit\"] !== null) {\n $this->StorageLimit = $param[\"StorageLimit\"];\n }\n\n if (array_key_exists(\"UsedStorage\",$param) and $param[\"UsedStorage\"] !== null) {\n $this->UsedStorage = $param[\"UsedStorage\"];\n }\n\n if (array_key_exists(\"Vip\",$param) and $param[\"Vip\"] !== null) {\n $this->Vip = $param[\"Vip\"];\n }\n\n if (array_key_exists(\"Vport\",$param) and $param[\"Vport\"] !== null) {\n $this->Vport = $param[\"Vport\"];\n }\n\n if (array_key_exists(\"RoAddr\",$param) and $param[\"RoAddr\"] !== null) {\n $this->RoAddr = [];\n foreach ($param[\"RoAddr\"] as $key => $value){\n $obj = new Addr();\n $obj->deserialize($value);\n array_push($this->RoAddr, $obj);\n }\n }\n\n if (array_key_exists(\"Ability\",$param) and $param[\"Ability\"] !== null) {\n $this->Ability = new Ability();\n $this->Ability->deserialize($param[\"Ability\"]);\n }\n\n if (array_key_exists(\"CynosVersion\",$param) and $param[\"CynosVersion\"] !== null) {\n $this->CynosVersion = $param[\"CynosVersion\"];\n }\n\n if (array_key_exists(\"BusinessType\",$param) and $param[\"BusinessType\"] !== null) {\n $this->BusinessType = $param[\"BusinessType\"];\n }\n\n if (array_key_exists(\"HasSlaveZone\",$param) and $param[\"HasSlaveZone\"] !== null) {\n $this->HasSlaveZone = $param[\"HasSlaveZone\"];\n }\n\n if (array_key_exists(\"IsFreeze\",$param) and $param[\"IsFreeze\"] !== null) {\n $this->IsFreeze = $param[\"IsFreeze\"];\n }\n\n if (array_key_exists(\"Tasks\",$param) and $param[\"Tasks\"] !== null) {\n $this->Tasks = [];\n foreach ($param[\"Tasks\"] as $key => $value){\n $obj = new ObjectTask();\n $obj->deserialize($value);\n array_push($this->Tasks, $obj);\n }\n }\n\n if (array_key_exists(\"MasterZone\",$param) and $param[\"MasterZone\"] !== null) {\n $this->MasterZone = $param[\"MasterZone\"];\n }\n\n if (array_key_exists(\"SlaveZones\",$param) and $param[\"SlaveZones\"] !== null) {\n $this->SlaveZones = $param[\"SlaveZones\"];\n }\n\n if (array_key_exists(\"InstanceSet\",$param) and $param[\"InstanceSet\"] !== null) {\n $this->InstanceSet = [];\n foreach ($param[\"InstanceSet\"] as $key => $value){\n $obj = new ClusterInstanceDetail();\n $obj->deserialize($value);\n array_push($this->InstanceSet, $obj);\n }\n }\n\n if (array_key_exists(\"PayMode\",$param) and $param[\"PayMode\"] !== null) {\n $this->PayMode = $param[\"PayMode\"];\n }\n\n if (array_key_exists(\"PeriodEndTime\",$param) and $param[\"PeriodEndTime\"] !== null) {\n $this->PeriodEndTime = $param[\"PeriodEndTime\"];\n }\n\n if (array_key_exists(\"ProjectID\",$param) and $param[\"ProjectID\"] !== null) {\n $this->ProjectID = $param[\"ProjectID\"];\n }\n\n if (array_key_exists(\"ResourceTags\",$param) and $param[\"ResourceTags\"] !== null) {\n $this->ResourceTags = [];\n foreach ($param[\"ResourceTags\"] as $key => $value){\n $obj = new Tag();\n $obj->deserialize($value);\n array_push($this->ResourceTags, $obj);\n }\n }\n\n if (array_key_exists(\"ProxyStatus\",$param) and $param[\"ProxyStatus\"] !== null) {\n $this->ProxyStatus = $param[\"ProxyStatus\"];\n }\n\n if (array_key_exists(\"LogBin\",$param) and $param[\"LogBin\"] !== null) {\n $this->LogBin = $param[\"LogBin\"];\n }\n\n if (array_key_exists(\"IsSkipTrade\",$param) and $param[\"IsSkipTrade\"] !== null) {\n $this->IsSkipTrade = $param[\"IsSkipTrade\"];\n }\n\n if (array_key_exists(\"PitrType\",$param) and $param[\"PitrType\"] !== null) {\n $this->PitrType = $param[\"PitrType\"];\n }\n\n if (array_key_exists(\"IsOpenPasswordComplexity\",$param) and $param[\"IsOpenPasswordComplexity\"] !== null) {\n $this->IsOpenPasswordComplexity = $param[\"IsOpenPasswordComplexity\"];\n }\n\n if (array_key_exists(\"NetworkStatus\",$param) and $param[\"NetworkStatus\"] !== null) {\n $this->NetworkStatus = $param[\"NetworkStatus\"];\n }\n\n if (array_key_exists(\"ResourcePackages\",$param) and $param[\"ResourcePackages\"] !== null) {\n $this->ResourcePackages = [];\n foreach ($param[\"ResourcePackages\"] as $key => $value){\n $obj = new ResourcePackage();\n $obj->deserialize($value);\n array_push($this->ResourcePackages, $obj);\n }\n }\n\n if (array_key_exists(\"RenewFlag\",$param) and $param[\"RenewFlag\"] !== null) {\n $this->RenewFlag = $param[\"RenewFlag\"];\n }\n }", "public function decode() \n\t{\n\t\treturn json_decode(file_get_contents(self::BOOKCASE), true, self::DEPTH, JSON_BIGINT_AS_STRING);\n\t}", "private static function readConfig()\n {\n $handler = self::getHandler();\n if (null == $handler->arrConfigGlobal && null == $handler->arrConfigLocal && null == $handler->arrConfigSecure) {\n include dirname(__FILE__) . '/../../config/default.php';\n\n $handler->arrConfigLocal = $APPCONFIG;\n\n $db = Base_Database::getConnection();\n try {\n // This is just for things like API keys, password salts etc.\n // If we have, at a later point, a function to export the database\n // en masse, then we can encrypt all the output from the secureconfig\n // table. It shouldn't overide the global or local config settings\n $sql = \"SELECT * FROM secureconfig\";\n $query = $db->prepare($sql);\n $query->execute();\n $handler->arrConfigSecure = $query->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP);\n\n // This is just the regular global configuration settings.\n $sql = \"SELECT * FROM config\";\n $query = $db->prepare($sql);\n $query->execute();\n $handler->arrConfigGlobal = $query->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP);\n foreach ($handler->arrConfigGlobal as $key => $value) {\n $handler->arrConfig[$key] = array('isLocal' => false, 'isOverriden' => false, 'value' => $value[0]);\n }\n \n // This is the configuration settings local to this individual machine.\n foreach ($handler->arrConfigLocal as $key => $value) {\n if (isset($handler->arrConfig[$key])) {\n $handler->arrConfig[$key] = array('isLocal' => true, 'isOverriden' => true, 'value' => $value);\n } else {\n $handler->arrConfig[$key] = array('isLocal' => true, 'isOverriden' => false, 'value' => $value);\n }\n }\n } catch(Exception $e) {\n error_log($e);\n die();\n }\n }\n }", "public function load(): ConfigStoreInterface;", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"Codec\",$param) and $param[\"Codec\"] !== null) {\n $this->Codec = $param[\"Codec\"];\n }\n\n if (array_key_exists(\"Fps\",$param) and $param[\"Fps\"] !== null) {\n $this->Fps = $param[\"Fps\"];\n }\n\n if (array_key_exists(\"Bitrate\",$param) and $param[\"Bitrate\"] !== null) {\n $this->Bitrate = $param[\"Bitrate\"];\n }\n\n if (array_key_exists(\"ResolutionAdaptive\",$param) and $param[\"ResolutionAdaptive\"] !== null) {\n $this->ResolutionAdaptive = $param[\"ResolutionAdaptive\"];\n }\n\n if (array_key_exists(\"Width\",$param) and $param[\"Width\"] !== null) {\n $this->Width = $param[\"Width\"];\n }\n\n if (array_key_exists(\"Height\",$param) and $param[\"Height\"] !== null) {\n $this->Height = $param[\"Height\"];\n }\n\n if (array_key_exists(\"FillType\",$param) and $param[\"FillType\"] !== null) {\n $this->FillType = $param[\"FillType\"];\n }\n\n if (array_key_exists(\"Vcrf\",$param) and $param[\"Vcrf\"] !== null) {\n $this->Vcrf = $param[\"Vcrf\"];\n }\n\n if (array_key_exists(\"Gop\",$param) and $param[\"Gop\"] !== null) {\n $this->Gop = $param[\"Gop\"];\n }\n\n if (array_key_exists(\"PreserveHDRSwitch\",$param) and $param[\"PreserveHDRSwitch\"] !== null) {\n $this->PreserveHDRSwitch = $param[\"PreserveHDRSwitch\"];\n }\n\n if (array_key_exists(\"CodecTag\",$param) and $param[\"CodecTag\"] !== null) {\n $this->CodecTag = $param[\"CodecTag\"];\n }\n }", "protected function prepareConfig(array &$config) {\n $type = $config['type'];\n // Check if we're dealing with a preconfigured field.\n if (strpos($type, 'field_ui:') !== FALSE) {\n // @see \\Drupal\\field_ui\\Form\\FieldStorageAddForm::submitForm\n list(, $type, $option_key) = explode(':', $type, 3);\n $config['type'] = $type;\n\n $field_type_class = $this->fieldTypePluginManager->getDefinition($type)['class'];\n $field_options = $field_type_class::getPreconfiguredOptions()[$option_key];\n\n // Merge in preconfigured field storage options.\n if (isset($field_options['field_storage_config'])) {\n foreach (['settings'] as $key) {\n if (isset($field_options['field_storage_config'][$key]) && empty($config[$key])) {\n $config[$key] = $field_options['field_storage_config'][$key];\n }\n }\n }\n }\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"Format\",$param) and $param[\"Format\"] !== null) {\n $this->Format = $param[\"Format\"];\n }\n\n if (array_key_exists(\"Csv\",$param) and $param[\"Csv\"] !== null) {\n $this->Csv = new CsvInfo();\n $this->Csv->deserialize($param[\"Csv\"]);\n }\n\n if (array_key_exists(\"Json\",$param) and $param[\"Json\"] !== null) {\n $this->Json = new JsonInfo();\n $this->Json->deserialize($param[\"Json\"]);\n }\n\n if (array_key_exists(\"Parquet\",$param) and $param[\"Parquet\"] !== null) {\n $this->Parquet = new ParquetInfo();\n $this->Parquet->deserialize($param[\"Parquet\"]);\n }\n }", "function __construct() {\n if (!file_exists($this->configuration_file_path)) {\n \n die(\"FATAL: Missing \" . $this->configuration_file_path . `pwd` );\n \n }\n \n $raw_contents = file_get_contents($this->configuration_file_path);\n\n\n //parse json object\n try {\n\n $this->Config = json_decode( $raw_contents );\n\n } catch (Exception $e) {\n\n die(\"FATAL: Bad configuration file? \");\n\n }\n \n\n }", "public function getFieldStorageDefinitions();", "public function decode($in) {}", "public function loadConfig() {\n return (object)$this->config;\n }", "public function decode(mixed $value): mixed {\n if (is_array($value)) {\n return $this->decodeArray($value);\n }\n $original_value = $value;\n $decoder = $this->config['decoder']['message'];\n\n if ($value !== null) {\n if ($decoder === 'utf-8') {\n $decoded_values = $this->mime_header_decode($value);\n $tempValue = \"\";\n foreach ($decoded_values as $decoded_value) {\n $tempValue .= $this->convertEncoding($decoded_value->text, $decoded_value->charset);\n }\n if ($tempValue) {\n $value = $tempValue;\n } else if (extension_loaded('imap')) {\n $value = \\imap_utf8($value);\n }else if (function_exists('iconv_mime_decode')){\n $value = iconv_mime_decode($value, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, \"UTF-8\");\n }else{\n $value = mb_decode_mimeheader($value);\n }\n }elseif ($decoder === 'iconv') {\n $value = iconv_mime_decode($value, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, \"UTF-8\");\n }else if ($this->is_uft8($value)) {\n $value = mb_decode_mimeheader($value);\n }\n\n if ($this->notDecoded($original_value, $value)) {\n $value = $this->convertEncoding($original_value, $this->getEncoding($original_value));\n }\n }\n\n return $value;\n }", "function _ra_decode ($value)\n {\n //_ra_decode supports decoding entire Arrays\n\n if (is_array($value)) {\n $temp_array = array();\n foreach ($value as $key => $val) {\n if ($this->sess_encryption) {\n $temp_array[$key] = $this->_ra_decode($val);\n } else {\n $temp_array[$key] = $val;\n }\n }\n return $temp_array;\n }\n if ($this->sess_encryption && is_string($value)) {\n $value = $this->CI->encrypt->decode($value);\n return $value;\n }\n return $value;\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"Definition\",$param) and $param[\"Definition\"] !== null) {\n $this->Definition = $param[\"Definition\"];\n }\n\n if (array_key_exists(\"Name\",$param) and $param[\"Name\"] !== null) {\n $this->Name = $param[\"Name\"];\n }\n\n if (array_key_exists(\"Comment\",$param) and $param[\"Comment\"] !== null) {\n $this->Comment = $param[\"Comment\"];\n }\n\n if (array_key_exists(\"PornConfigure\",$param) and $param[\"PornConfigure\"] !== null) {\n $this->PornConfigure = new PornConfigureInfo();\n $this->PornConfigure->deserialize($param[\"PornConfigure\"]);\n }\n\n if (array_key_exists(\"TerrorismConfigure\",$param) and $param[\"TerrorismConfigure\"] !== null) {\n $this->TerrorismConfigure = new TerrorismConfigureInfo();\n $this->TerrorismConfigure->deserialize($param[\"TerrorismConfigure\"]);\n }\n\n if (array_key_exists(\"PoliticalConfigure\",$param) and $param[\"PoliticalConfigure\"] !== null) {\n $this->PoliticalConfigure = new PoliticalConfigureInfo();\n $this->PoliticalConfigure->deserialize($param[\"PoliticalConfigure\"]);\n }\n\n if (array_key_exists(\"ProhibitedConfigure\",$param) and $param[\"ProhibitedConfigure\"] !== null) {\n $this->ProhibitedConfigure = new ProhibitedConfigureInfo();\n $this->ProhibitedConfigure->deserialize($param[\"ProhibitedConfigure\"]);\n }\n\n if (array_key_exists(\"UserDefineConfigure\",$param) and $param[\"UserDefineConfigure\"] !== null) {\n $this->UserDefineConfigure = new UserDefineConfigureInfo();\n $this->UserDefineConfigure->deserialize($param[\"UserDefineConfigure\"]);\n }\n\n if (array_key_exists(\"ReviewWallSwitch\",$param) and $param[\"ReviewWallSwitch\"] !== null) {\n $this->ReviewWallSwitch = $param[\"ReviewWallSwitch\"];\n }\n\n if (array_key_exists(\"ScreenshotInterval\",$param) and $param[\"ScreenshotInterval\"] !== null) {\n $this->ScreenshotInterval = $param[\"ScreenshotInterval\"];\n }\n\n if (array_key_exists(\"CreateTime\",$param) and $param[\"CreateTime\"] !== null) {\n $this->CreateTime = $param[\"CreateTime\"];\n }\n\n if (array_key_exists(\"UpdateTime\",$param) and $param[\"UpdateTime\"] !== null) {\n $this->UpdateTime = $param[\"UpdateTime\"];\n }\n }", "protected function defaultRawConfiguration()\n {\n return [\n 'negotiation' => [\n 'enabled' => false,\n ],\n 'serializer' => [\n 'enabled' => true\n ],\n 'normalizer' => [\n 'enabled' => false\n ],\n 'validator' => [\n 'enabled' => false\n ],\n 'types' =>\n [\n [\n 'name' => 'json',\n 'values'=> [\n 'application/json','text/json'\n ],\n 'restrict' => null\n ],\n [\n 'name' => 'xml',\n 'values' => [\n 'application/xml','text/xml'\n ],\n 'restrict' => null\n ]\n ],\n 'headers' =>\n [\n 'content_type' => 'content-type',\n 'accept_type' => 'accept'\n ]\n ];\n }", "protected function loadJSON(&$data)\n {\n if ($this->use_apcu && apcu_exists(\"config_settings\")) {\n $data = apcu_fetch(\"config_settings\");\n if (!empty($data)) {\n return;\n }\n }\n \n $this->validateParameters();\n \n if (!file_exists($this->save_path) && empty($this->config_file_must_exist)) {\n return;\n }\n \n if (!file_exists($this->save_path) || !is_readable($this->save_path)) {\n throw new \\Exception(sprintf(\"The config file '%s' cannot be read!\", $this->save_path));\n }\n \n $json = file_get_contents($this->save_path);\n if ($json === false) {\n throw new \\Exception(sprintf(\"The config file '%s' cannot be read!\", $this->save_path));\n }\n \n if (!empty($this->save_encrypted)) {\n $json = aes_256_decrypt($json, $this->salt_key);\n }\n \n try {\n json_to_array($json, $data);\n } catch (\\Throwable $ex) {\n throw new \\Exception(\"JSON parse error: \" . $ex->getMessage());\n }\n \n if ($this->use_apcu) {\n apcu_store(\"config_settings\", $data);\n }\n }", "protected function decodeData($value) {\n\t\treturn wireDecodeJSON($value);\n\t}", "static function loadConfig() {\n\t\t$config = self::file($_SERVER[\"DOCUMENT_ROOT\"] . \"/../config.json\");\n\t\tif (!is_null($config))\n\t\t\tself::$config = json_decode($config);\n\t}", "abstract public function unserialize($serialized);", "public function deserialize($stream) {\n throw new FormatUnsupported('Cannot deserialize '.($this->mime ? 'from '.$this->mime : 'without mime type'));\n }", "public function getSupportedInputStorageFormats()\n {\n return $this->supported_input_storage_formats;\n }", "public function unpack($raw);", "public function readBoardConfig() {\n $file = __DIR__.\"/datas/board.json\";\n $configData = is_file($file) ? file_get_contents($file) : FALSE;\n if ($configData !== FALSE) {\n $config = json_decode($configData, TRUE);\n } else {\n $config = array(\"title\" => \"\", \"layout\" => array());\n }\n return $config;\n }", "private function readConfig(){\n\n\t\t$this->_ini_array = parse_ini_file(CONFIG.'system.ini');\n\n\t\t$this->_host =\t$this->_ini_array['db_host'];\n\t\t$this->_username = $this->_ini_array['db_username'];\n\t\t$this->_password = $this->_ini_array['db_password'];\n\t\t$this->_database = $this->_ini_array['db_database'];\n\t\n\t\t$this->_log_enabled=$this->_ini_array['log_enabled'];\n\t\t$this->_log_level=$this->_ini_array['log_level'];\n\t\t$this->_log_file_path=$this->_ini_array['log_path'];\n\t\n\n\t\t$this->_lang_default=$this->_ini_array['lang_default'];\n\n\t}", "public function load($config): object\n {\n if (is_string($config)) {\n $oldConfig = $config;\n $extension = pathinfo($config, PATHINFO_EXTENSION);\n\n $this->checkOptionsExtension($extension);\n\n $config = [\n \"adapter\" => $extension,\n \"filePath\" => $oldConfig,\n ];\n }\n\n if (is_object($config) && $config instanceof Config) {\n $config = $config->toArray();\n }\n\n $this\n ->checkOptionsIsArray($config)\n ->checkOptionsFilePath($config)\n ->checkOptionsAdapter($config)\n ;\n\n $adapter = strtolower($config[\"adapter\"]);\n $first = $config[\"filePath\"];\n\n if (!strpos($first, \".\")) {\n $first = $first . \".\" . lcfirst($adapter);\n }\n\n $second = $this->checkSecond($config, $adapter);\n\n return $this->newInstance($adapter, $first, $second);\n }", "public function toArray(){\n\t\treturn parse_ini_file($this->path, true);\n\t}", "public function getParsed($identifier)\n {\n $conf = $this->getConfigurationByIdentifier($identifier);\n if (!$conf)\n return null;\n\n $cf = array();\n\n $expl = explode(\"\\n\", $conf->configuration);\n foreach ($expl as $a)\n {\n $pos = strpos($a, '=');\n if ($pos <= 0)\n return array();\n\n $key = substr($a, 0, $pos);\n $val = substr($a, $pos+1);\n\n $cf[$key] = $val;\n }\n\n return $cf;\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"SourceRegistryId\",$param) and $param[\"SourceRegistryId\"] !== null) {\n $this->SourceRegistryId = $param[\"SourceRegistryId\"];\n }\n\n if (array_key_exists(\"DestinationRegistryId\",$param) and $param[\"DestinationRegistryId\"] !== null) {\n $this->DestinationRegistryId = $param[\"DestinationRegistryId\"];\n }\n\n if (array_key_exists(\"Rule\",$param) and $param[\"Rule\"] !== null) {\n $this->Rule = new ReplicationRule();\n $this->Rule->deserialize($param[\"Rule\"]);\n }\n\n if (array_key_exists(\"Description\",$param) and $param[\"Description\"] !== null) {\n $this->Description = $param[\"Description\"];\n }\n\n if (array_key_exists(\"DestinationRegionId\",$param) and $param[\"DestinationRegionId\"] !== null) {\n $this->DestinationRegionId = $param[\"DestinationRegionId\"];\n }\n\n if (array_key_exists(\"PeerReplicationOption\",$param) and $param[\"PeerReplicationOption\"] !== null) {\n $this->PeerReplicationOption = new PeerReplicationOption();\n $this->PeerReplicationOption->deserialize($param[\"PeerReplicationOption\"]);\n }\n }", "public static function getConfig() {\n\t\tif (self::$temp_config !== null) {\n\t\t\treturn self::$temp_config;\n\t\t}\n\n\t\t$config_file = self::getConfigFile();\n\t\treturn (!file_exists($config_file)) ? array() : json_decode(file_get_contents($config_file), true);\n\t}", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"InstanceIds\",$param) and $param[\"InstanceIds\"] !== null) {\n $this->InstanceIds = $param[\"InstanceIds\"];\n }\n\n if (array_key_exists(\"IsolateDataDisk\",$param) and $param[\"IsolateDataDisk\"] !== null) {\n $this->IsolateDataDisk = $param[\"IsolateDataDisk\"];\n }\n }", "abstract protected function loadDiscoveryFromStorage(EditableDiscovery $discovery, array $initializers = array());", "private function LoadConfigFile(){\n $a = file_get_contents($this->RootDIR . 'config/main.json');\n $this->Config = json_decode($a, true);\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"CryptoType\",$param) and $param[\"CryptoType\"] !== null) {\n $this->CryptoType = $param[\"CryptoType\"];\n }\n\n if (array_key_exists(\"CryptoContent\",$param) and $param[\"CryptoContent\"] !== null) {\n $this->CryptoContent = $param[\"CryptoContent\"];\n }\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"ProductId\",$param) and $param[\"ProductId\"] !== null) {\n $this->ProductId = $param[\"ProductId\"];\n }\n\n if (array_key_exists(\"Software\",$param) and $param[\"Software\"] !== null) {\n $this->Software = $param[\"Software\"];\n }\n\n if (array_key_exists(\"SupportHA\",$param) and $param[\"SupportHA\"] !== null) {\n $this->SupportHA = $param[\"SupportHA\"];\n }\n\n if (array_key_exists(\"InstanceName\",$param) and $param[\"InstanceName\"] !== null) {\n $this->InstanceName = $param[\"InstanceName\"];\n }\n\n if (array_key_exists(\"PayMode\",$param) and $param[\"PayMode\"] !== null) {\n $this->PayMode = $param[\"PayMode\"];\n }\n\n if (array_key_exists(\"TimeSpan\",$param) and $param[\"TimeSpan\"] !== null) {\n $this->TimeSpan = $param[\"TimeSpan\"];\n }\n\n if (array_key_exists(\"TimeUnit\",$param) and $param[\"TimeUnit\"] !== null) {\n $this->TimeUnit = $param[\"TimeUnit\"];\n }\n\n if (array_key_exists(\"LoginSettings\",$param) and $param[\"LoginSettings\"] !== null) {\n $this->LoginSettings = new LoginSettings();\n $this->LoginSettings->deserialize($param[\"LoginSettings\"]);\n }\n\n if (array_key_exists(\"VPCSettings\",$param) and $param[\"VPCSettings\"] !== null) {\n $this->VPCSettings = new VPCSettings();\n $this->VPCSettings->deserialize($param[\"VPCSettings\"]);\n }\n\n if (array_key_exists(\"ResourceSpec\",$param) and $param[\"ResourceSpec\"] !== null) {\n $this->ResourceSpec = new NewResourceSpec();\n $this->ResourceSpec->deserialize($param[\"ResourceSpec\"]);\n }\n\n if (array_key_exists(\"COSSettings\",$param) and $param[\"COSSettings\"] !== null) {\n $this->COSSettings = new COSSettings();\n $this->COSSettings->deserialize($param[\"COSSettings\"]);\n }\n\n if (array_key_exists(\"Placement\",$param) and $param[\"Placement\"] !== null) {\n $this->Placement = new Placement();\n $this->Placement->deserialize($param[\"Placement\"]);\n }\n\n if (array_key_exists(\"SgId\",$param) and $param[\"SgId\"] !== null) {\n $this->SgId = $param[\"SgId\"];\n }\n\n if (array_key_exists(\"PreExecutedFileSettings\",$param) and $param[\"PreExecutedFileSettings\"] !== null) {\n $this->PreExecutedFileSettings = [];\n foreach ($param[\"PreExecutedFileSettings\"] as $key => $value){\n $obj = new PreExecuteFileSettings();\n $obj->deserialize($value);\n array_push($this->PreExecutedFileSettings, $obj);\n }\n }\n\n if (array_key_exists(\"AutoRenew\",$param) and $param[\"AutoRenew\"] !== null) {\n $this->AutoRenew = $param[\"AutoRenew\"];\n }\n\n if (array_key_exists(\"ClientToken\",$param) and $param[\"ClientToken\"] !== null) {\n $this->ClientToken = $param[\"ClientToken\"];\n }\n\n if (array_key_exists(\"NeedMasterWan\",$param) and $param[\"NeedMasterWan\"] !== null) {\n $this->NeedMasterWan = $param[\"NeedMasterWan\"];\n }\n\n if (array_key_exists(\"RemoteLoginAtCreate\",$param) and $param[\"RemoteLoginAtCreate\"] !== null) {\n $this->RemoteLoginAtCreate = $param[\"RemoteLoginAtCreate\"];\n }\n\n if (array_key_exists(\"CheckSecurity\",$param) and $param[\"CheckSecurity\"] !== null) {\n $this->CheckSecurity = $param[\"CheckSecurity\"];\n }\n\n if (array_key_exists(\"ExtendFsField\",$param) and $param[\"ExtendFsField\"] !== null) {\n $this->ExtendFsField = $param[\"ExtendFsField\"];\n }\n\n if (array_key_exists(\"Tags\",$param) and $param[\"Tags\"] !== null) {\n $this->Tags = [];\n foreach ($param[\"Tags\"] as $key => $value){\n $obj = new Tag();\n $obj->deserialize($value);\n array_push($this->Tags, $obj);\n }\n }\n\n if (array_key_exists(\"DisasterRecoverGroupIds\",$param) and $param[\"DisasterRecoverGroupIds\"] !== null) {\n $this->DisasterRecoverGroupIds = $param[\"DisasterRecoverGroupIds\"];\n }\n\n if (array_key_exists(\"CbsEncrypt\",$param) and $param[\"CbsEncrypt\"] !== null) {\n $this->CbsEncrypt = $param[\"CbsEncrypt\"];\n }\n\n if (array_key_exists(\"MetaType\",$param) and $param[\"MetaType\"] !== null) {\n $this->MetaType = $param[\"MetaType\"];\n }\n\n if (array_key_exists(\"UnifyMetaInstanceId\",$param) and $param[\"UnifyMetaInstanceId\"] !== null) {\n $this->UnifyMetaInstanceId = $param[\"UnifyMetaInstanceId\"];\n }\n\n if (array_key_exists(\"MetaDBInfo\",$param) and $param[\"MetaDBInfo\"] !== null) {\n $this->MetaDBInfo = new CustomMetaInfo();\n $this->MetaDBInfo->deserialize($param[\"MetaDBInfo\"]);\n }\n\n if (array_key_exists(\"ApplicationRole\",$param) and $param[\"ApplicationRole\"] !== null) {\n $this->ApplicationRole = $param[\"ApplicationRole\"];\n }\n\n if (array_key_exists(\"SceneName\",$param) and $param[\"SceneName\"] !== null) {\n $this->SceneName = $param[\"SceneName\"];\n }\n\n if (array_key_exists(\"ExternalService\",$param) and $param[\"ExternalService\"] !== null) {\n $this->ExternalService = [];\n foreach ($param[\"ExternalService\"] as $key => $value){\n $obj = new ExternalService();\n $obj->deserialize($value);\n array_push($this->ExternalService, $obj);\n }\n }\n\n if (array_key_exists(\"VersionID\",$param) and $param[\"VersionID\"] !== null) {\n $this->VersionID = $param[\"VersionID\"];\n }\n\n if (array_key_exists(\"MultiZone\",$param) and $param[\"MultiZone\"] !== null) {\n $this->MultiZone = $param[\"MultiZone\"];\n }\n\n if (array_key_exists(\"MultiZoneSettings\",$param) and $param[\"MultiZoneSettings\"] !== null) {\n $this->MultiZoneSettings = [];\n foreach ($param[\"MultiZoneSettings\"] as $key => $value){\n $obj = new MultiZoneSetting();\n $obj->deserialize($value);\n array_push($this->MultiZoneSettings, $obj);\n }\n }\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"Name\",$param) and $param[\"Name\"] !== null) {\n $this->Name = $param[\"Name\"];\n }\n\n if (array_key_exists(\"Size\",$param) and $param[\"Size\"] !== null) {\n $this->Size = $param[\"Size\"];\n }\n\n if (array_key_exists(\"Date\",$param) and $param[\"Date\"] !== null) {\n $this->Date = $param[\"Date\"];\n }\n\n if (array_key_exists(\"IntranetUrl\",$param) and $param[\"IntranetUrl\"] !== null) {\n $this->IntranetUrl = $param[\"IntranetUrl\"];\n }\n\n if (array_key_exists(\"InternetUrl\",$param) and $param[\"InternetUrl\"] !== null) {\n $this->InternetUrl = $param[\"InternetUrl\"];\n }\n\n if (array_key_exists(\"Type\",$param) and $param[\"Type\"] !== null) {\n $this->Type = $param[\"Type\"];\n }\n\n if (array_key_exists(\"BinlogStartTime\",$param) and $param[\"BinlogStartTime\"] !== null) {\n $this->BinlogStartTime = $param[\"BinlogStartTime\"];\n }\n\n if (array_key_exists(\"BinlogFinishTime\",$param) and $param[\"BinlogFinishTime\"] !== null) {\n $this->BinlogFinishTime = $param[\"BinlogFinishTime\"];\n }\n\n if (array_key_exists(\"Region\",$param) and $param[\"Region\"] !== null) {\n $this->Region = $param[\"Region\"];\n }\n\n if (array_key_exists(\"Status\",$param) and $param[\"Status\"] !== null) {\n $this->Status = $param[\"Status\"];\n }\n\n if (array_key_exists(\"RemoteInfo\",$param) and $param[\"RemoteInfo\"] !== null) {\n $this->RemoteInfo = [];\n foreach ($param[\"RemoteInfo\"] as $key => $value){\n $obj = new RemoteBackupInfo();\n $obj->deserialize($value);\n array_push($this->RemoteInfo, $obj);\n }\n }\n\n if (array_key_exists(\"CosStorageType\",$param) and $param[\"CosStorageType\"] !== null) {\n $this->CosStorageType = $param[\"CosStorageType\"];\n }\n\n if (array_key_exists(\"InstanceId\",$param) and $param[\"InstanceId\"] !== null) {\n $this->InstanceId = $param[\"InstanceId\"];\n }\n }", "public static function decodeFromFile($path);", "private static function loadConfigurationFile()\n {\n if(self::$ConfigurationData == null)\n {\n $file_contents = file_get_contents(CONFIGURATION_FILE);\n $json_data = json_decode($file_contents, true);\n\n if(empty($json_data))\n {\n throw new Exception(\"Invalid JSON data in the configuration file\");\n }\n\n self::$ConfigurationData = $json_data;\n }\n }", "private function loadDataTypes() {\n if(count($this->dbConfigs) > 0){\n switch ($this->dbConfigs[\"driver\"]) {\n case \"mysql\":\n $this->arrDataTypes = array('char', 'varchar', 'tinytext', 'text', 'mediumtext', 'longtext', 'tinyblob', 'mediumblob',\n 'blob', 'longblob', 'enum', 'set', 'date', 'datetime', 'time', 'year');\n break;\n\n case \"mssql\":\n $this->arrDataTypes = array('smalldatetime', 'datetime', 'char', 'varchar', 'text', 'nchar', 'nvarchar', 'ntext', 'binary', 'varbinary');\n break;\n\n case \"sqlsrv\":\n $this->arrDataTypes = array('smalldatetime', 'datetime', 'char', 'varchar', 'text', 'nchar', 'nvarchar', 'ntext', 'binary', 'varbinary','date');\n break;\n }\n }\n }", "function decode($data) {\n // TODO: parse extension (prioritary before xformat parameter)\n $format = $this->params['xformat'];\n $format_method = \"decode_{$format}\";\n if (!method_exists($this, $format_method)) throw new xException(\"REST format input not allowed: {$format}\", 501);\n // TODO: Recodes input stream if necessary\n $input = $this->$format_method($data);\n return $input;\n }" ]
[ "0.54687566", "0.5364445", "0.5310812", "0.5306034", "0.52516633", "0.5135629", "0.5131478", "0.5128883", "0.5100327", "0.50932646", "0.50932646", "0.50932646", "0.50932646", "0.50932646", "0.5073528", "0.50682443", "0.4981014", "0.49719518", "0.4952335", "0.4934609", "0.49328873", "0.4903733", "0.48913524", "0.48870754", "0.48819226", "0.48685598", "0.484818", "0.48379877", "0.48374966", "0.48273703", "0.4824113", "0.48218477", "0.48198393", "0.48068756", "0.48028272", "0.47777474", "0.47766286", "0.4771705", "0.47678944", "0.47515157", "0.4744314", "0.4739475", "0.47391", "0.47348857", "0.47251266", "0.4723107", "0.47230655", "0.46971253", "0.4684301", "0.46812803", "0.46624514", "0.4660976", "0.46519297", "0.464694", "0.46255845", "0.462094", "0.4611578", "0.4606973", "0.45761573", "0.45692584", "0.45645", "0.4545265", "0.4543115", "0.453723", "0.45270452", "0.45265558", "0.45265052", "0.45255405", "0.4525381", "0.45158648", "0.4509912", "0.4507391", "0.4479625", "0.44793236", "0.44715062", "0.44707823", "0.44670844", "0.44563112", "0.44561046", "0.44505143", "0.44458655", "0.44451767", "0.4439555", "0.44343013", "0.44333622", "0.44170558", "0.4416253", "0.44143382", "0.44141316", "0.44118518", "0.44080555", "0.44056338", "0.44026646", "0.43992522", "0.4392199", "0.43912303", "0.4387906", "0.43876538", "0.43874505", "0.43829727" ]
0.49886647
16
Gets configuration object names starting with a given prefix. Given the following configuration objects: node.type.article node.type.page Passing the prefix 'node.type.' will return an array containing the above names.
public function listAll($prefix = '');
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPrefixes();", "public static function keys($prefix)\n {\n return parent::keys($prefix);\n }", "public function getPrefix();", "public function getPrefix();", "function getPrefixes();", "function getPrefixes() {\n return array(\"from\" => \"froms\", \"subject\" => \"subjects\", \"text\" => \"texts\");\n}", "public function getWildcardPrefixes() {}", "public function getPrefix() {}", "public function getByPathPrefix($pathPrefix);", "public function find_by_prefix($prefix) {\n $this->ensure_path_exists();\n $prefix = preg_replace('#(\\*|\\?|\\[)#', '[$1]', $prefix);\n $files = glob($this->glob_keys_pattern($prefix), GLOB_MARK | GLOB_NOSORT);\n $return = array();\n if ($files === false) {\n return $return;\n }\n foreach ($files as $file) {\n // Trim off \".cache\" from the end.\n $return[] = substr(basename($file), 0, -6);\n }\n return $return;\n }", "protected function getAll($prefix = '') {\n return $this->getIterator('/^' . preg_quote($this->getApcuKey($prefix), '/') . '/');\n }", "public function Get_All_Prefix()\n {\n $this->DB->Change_DB($this->PERSON_DB);\n $sql = \"SELECT `code`,`name` FROM `prefix` ORDER BY `name_full`\";\n $result = $this->DB->Query($sql);\n $this->DB->Change_DB($this->DEFAULT_DB);\n if($result)\n {\n $prefix = array();\n for($i=0;$i<count($result);$i++)\n {\n $temp['id'] = $result[$i]['code'];\n $temp['prefix'] = $result[$i]['name'];\n array_push($prefix,$temp);\n }\n return $prefix;\n }\n else\n {\n return false;\n }\n\n }", "protected function getPrefix(array $config)\n {\n return $config['prefix'] ?? $this->container['config']['cache.prefix'];\n }", "function getHostConfiguration(EntityInterface $entity, $prefix = 'field_ran_') {\n // field collection's fields.\n $field_collection = $entity->getFields()['field_ran_host_configuration']->getIterator()[0];\n $fields = $field_collection->getFieldCollectionItem()->getFields();\n $vars = array();\n $len = strlen($prefix);\n foreach ($fields as $name => $field) {\n if (substr($name, 0, $len) == $prefix) {\n $vars[substr($name, $len)] = array();\n foreach ($field->getIterator() as $object) {\n $vars[substr($name, $len)][] = $object->getString();\n }\n $vars[substr($name, $len)] = array_filter($vars[substr($name, $len)]);\n }\n }\n return $vars;\n }", "public function getKeys(string $prefix = \"\"): array\n {\n $files = [];\n $directory = $this->getDir();\n\n if (!file_exists($directory)) {\n return [];\n }\n\n $iterator = $this->getIterator($directory);\n\n foreach ($iterator as $file) {\n if ($file->isFile()) {\n $files[] = $this->prefix . $file->getFilename();\n }\n }\n\n return $this->getFilteredKeys($files, $prefix);\n }", "function get_attribute_names_with_prefix($prefix)\n {\n }", "public function getKeys(string $prefix = ''): array\n {\n return $this->getFilteredKeys(\n $this->getAdapter()->keys('*'),\n $prefix\n );\n }", "private function addPrefixProperties($props, $prefix) {\n\t\t$conProps = array();\n\t\tforeach ($props as $k => $v) {\n\t\t\t$conProps[$prefix . ucfirst($k)] = $v;\n\t\t}\n\t\treturn $conProps;\n\t}", "public function suggestProperty($prefix = null){\n $error = [\n \"status\" => \"error\",\n \"message\" => \"invalid query\",\n \"details\" => \"prefix\"\n ];\n $result = [];\n\n if (!isset($prefix))\n return $error;\n\n $result[\"result\"] = $this->mapper->filterPropertiesPrefix($this->input[\"prefix\"]);\n return $result;\n }", "public function prefixKey($prefix);", "public function getElementPrefix();", "public function providerPrefixRoundTrip() {\n return [\n [\n ['' => 'test_'],\n 'test_',\n ],\n [\n [\n 'fooTable' => 'foo_',\n 'barTable' => 'bar_',\n ],\n [\n 'fooTable' => 'foo_',\n 'barTable' => 'bar_',\n ],\n ],\n ];\n }", "Public Function getPrefix() { Return $this->prefix; }", "public function filterPrefix($prefix)\n {\n $names = [];\n\n foreach ($this->getMethods() as $method) {\n if ($method->isPublic() && substr_count($method->getName(), $prefix, null, strlen($prefix))) {\n $names[] = $method->getName();\n }\n }\n\n return $names;\n }", "public function getPrefix()\n\t{\n\t\t\n\t\t$parsed = $this->getAsArray();\n\t\t\n\t\tif( ! empty($parsed) )\n\t\t{\n\t\t\tif( in_array($parsed[0], (array)$this->prefixes) )\n\t\t\t{\n\t\t\t\treturn $parsed[0];\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function getConsts($prefix)\n {\n if (isset(self::$consts[$prefix])) {\n return self::$consts[$prefix];\n }\n\n // 1. Get all class constants\n $class = new \\ReflectionClass($this);\n $consts = $class->getConstants();\n\n // 2. Use exiting constant configs\n $property = lcfirst(str_replace('_', '', ucwords($prefix, '_'))) . 'Names';\n if (isset($this->{$property})) {\n $names = $this->{$property};\n } else {\n $names = [];\n }\n\n // 3. Generate id and name\n $prefix .= '_';\n $data = [];\n $length = strlen($prefix);\n foreach ($consts as $name => $id) {\n if (0 !== stripos($name, $prefix)) {\n continue;\n }\n if (in_array($name, $this->constExcludes, true)) {\n continue;\n }\n $data[$id]['id'] = $id;\n $data[$id]['key'] = strtolower(strtr(substr($name, $length), ['_' => '-']));\n if (isset($names[$id])) {\n $data[$id]['name'] = $names[$id];\n }\n }\n\n self::$consts[$prefix] = $data;\n\n return $data;\n }", "public function getPrefix(): string\n {\n }", "public function getPrefixes()\n\t{\n\t\treturn $this->prefixDirs;\n\t}", "public function getPrefixes()\n\t{\n\t\treturn $this->prefixes;\n\t}", "private static function retrieveSettings($prefix)\n {\n if (!isset(static::$settings[$prefix])) {\n static::$settings[$prefix] = static::getDefaultSettings();\n $prefixLength = strlen($prefix);\n\n foreach ($_SERVER as $key => $value) {\n if (strpos($key, $prefix) === 0) {\n static::$settings[$prefix][strtolower(substr($key, $prefixLength))] = $value;\n }\n }\n\n if (static::$settings[$prefix] === static::getDefaultSettings()) {\n static::$settings[$prefix] = array();\n }\n }\n\n return static::$settings[$prefix];\n }", "private function getPrefix(Config $config)\n {\n $parts = explode(':', $config->name);\n\n if (1 === count($parts)) {\n return;\n }\n\n if ($config->parent && 2 === count($parts)) {\n array_shift($parts);\n return implode('/', $parts);\n }\n\n if (!$config->parent) {\n return implode(':', $parts);\n }\n }", "public function getSourcePrefixes();", "public function getAvailablePrefixes();", "public function getPrefix()\n {\n return $this->__get(self::FIELD_PREFIX);\n }", "function get_prefix($course)\n{\n return $course->prefix;\n}", "abstract public function getPrefix(): string;", "public function queryKeys($prefix = null)\n\t{\n\t\treturn [];\n\t}", "public function getNamespacePrefix($index);", "public function GetPrefix() {\n\n return $this->\n config['prefix'];\n }", "protected function get_constants($object, $prefix)\n {\n $returned_constants = array();\n \n $reflection_class = new \\ReflectionClass($object);\n $constants = $reflection_class->getConstants();\n \n foreach ($constants as $constant_name => $constant_value)\n {\n if (strpos($constant_name, $prefix) === 0)\n {\n $returned_constants[$constant_name] = $constant_value;\n }\n }\n \n return $returned_constants;\n }", "protected function getFieldNamePrefix() {}", "protected function getFieldNamePrefix() {}", "public function getPrefix()\n {\n $connector_parameters = $this->getConnectorParameters();\n \n foreach( $connector_parameters as $param )\n {\n if( $param->getName() == self::PREFIX )\n {\n return $param->getValue();\n }\n }\n }", "private function generateTemplatePaths($data, $prefix = []): array\n {\n\n $keyStrings = [];\n\n foreach ($data as $key => $value) {\n $currentPrefix = $prefix;\n\n if (false === is_array($value)) {\n $currentPrefix[] = $value;\n $keyStrings[] = $currentPrefix;\n continue;\n }\n\n $currentPrefix[] = $key;\n $subKeyStrings = $this->generateTemplatePaths($value, $currentPrefix);\n $keyStrings = array_merge($keyStrings, $subKeyStrings);\n }\n\n return $keyStrings;\n }", "public function getPropertyNames();", "public function getFacebookConfigurationPrefix(array $config, ContainerBuilder $container);", "public function getCustomerPrefix();", "abstract function getPluginSettingsPrefix();", "public static function getClassConstants($class, $prefix = '')\n {\n if (is_object($class)) {\n $class = get_class($class);\n } else if (!class_exists($class)) {\n \\Tk\\Log::warning('Class Not Found: ' . $class);\n return array();\n }\n $retList = array();\n try {\n $oReflect = new \\ReflectionClass($class);\n $constList = $oReflect->getConstants();\n if (!$prefix) {\n return $constList;\n }\n foreach ($constList as $k => $v) {\n if (substr($k, 0, strlen($prefix)) == $prefix) {\n $retList[$k] = $v;\n }\n }\n } catch (\\ReflectionException $e) {\n \\Tk\\Log::warning($e->__toString());\n }\n return $retList;\n }", "public function getPrefix()\n {\n // TODO: Implement getPrefix() method.\n }", "public function getPrefix()\n {\n return $this->prefix;\n }", "public function getPrefix()\n {\n return $this->prefix;\n }", "public function getPrefix()\n {\n return $this->prefix;\n }", "public function getPrefix()\n {\n return $this->prefix;\n }", "public function getPrefix()\n {\n return $this->prefix;\n }", "public function getPrefix()\n {\n return $this->prefix;\n }", "public function getPrefix()\n {\n return $this->prefix;\n }", "public function getPrefix()\n {\n return $this->prefix;\n }", "private function getPrefix(Config $config)\n {\n $parts = explode(':', $config->getPrefix());\n array_shift($parts);\n\n return strtolower(str_replace(array('/', '\\\\'), '_', implode('_', $parts)));\n }", "public function setPrefix($prefix);", "public function getPrefix(): string\n {\n return $this->prefix;\n }", "function rest_get_url_prefix()\n {\n }", "public function setPrefix( $prefix );", "public function getPrefix()\n\t{\n\t\treturn $this->prefix;\n\t}", "public function getPrefix()\n\t{\n\t\treturn $this->prefix;\n\t}", "public function getPrefix()\n\t{\n\t\treturn $this->prefix;\n\t}", "public function getPrefix()\n\t{\n\t\treturn $this->prefix;\n\t}", "public function getPrefix()\n {\n return $this->prefix ?? '';\n }", "public static function getSettings($prefix)\n {\n return static::retrieveSettings($prefix);\n }", "public function getPrefix()\n {\n return $this->_prefix;\n }", "private function Prefix($type=NULL) {\n\t\tif (!isset($type)) {\n\t\t\t$parts = preg_split('/\\\\\\/', get_class($this));\n\t\t\t$type = $parts[count($parts)-1];\n\t\t}\n\t\tswitch($type) {\n\t\tcase 'Account':\n\t\t\treturn self::ACCOUNT_META_PREFIX;\n\t\tcase 'CDNContainer':\n\t\t return self::CDNCONTAINER_META_PREFIX;\n\t\tcase 'Container':\n\t\t\treturn self::CONTAINER_META_PREFIX;\n\t\tcase 'DataObject':\n\t\t\treturn self::OBJECT_META_PREFIX;\n\t\tdefault:\n\t\t\tthrow new MetadataPrefixError(sprintf(\n\t\t\t\t_('Unrecognized metadata type [%s]'), $type));\n\t\t}\n\t}", "public function preparePrefixes()\n {\n $this->prefixes['route'] = explode('/', config('app-generator.prefixes.route', ''));\n $this->prefixes['path'] = explode('/', config('app-generator.prefixes.path', ''));\n\n if ($prefix = $this->getOption('prefix')) {\n $multiplePrefixes = explode(',', $prefix);\n\n $this->prefixes['route'] = array_merge($this->prefixes['route'], $multiplePrefixes);\n $this->prefixes['path'] = array_merge($this->prefixes['path'], $multiplePrefixes);\n }\n\n $this->prefixes['route'] = array_filter($this->prefixes['route']);\n $this->prefixes['path'] = array_filter($this->prefixes['path']);\n\n $routePrefix = '';\n foreach ($this->prefixes['route'] as $singlePrefix) {\n $routePrefix .= Str::camel($singlePrefix) . '.';\n }\n $this->prefixes['route'] = !empty($routePrefix) ? substr($routePrefix, 0, -1) : $routePrefix;\n\n $namespacePrefix = $pathPrefix = '';\n foreach ($this->prefixes['path'] as $singlePrefix) {\n $namespacePrefix .= Str::title($singlePrefix) . '\\\\';\n $pathPrefix .= Str::title($singlePrefix) . '/';\n }\n\n $this->prefixes['namespace'] = !empty($namespacePrefix) ? substr($namespacePrefix, 0, -1) : $namespacePrefix;\n $this->prefixes['path'] = !empty($pathPrefix) ? substr($pathPrefix, 0, -1) : $pathPrefix;\n }", "public function getCacheByPrefix($prefix)\n {\n //Define output\n $outputs = [];\n $keys = $this->cache->queryKeys($prefix);\n foreach ($keys as $key) {\n $outputs[$key] = $this->getCache($key);\n }\n return $outputs;\n }", "public function startsWith($prefix);", "function acf_add_array_key_prefix($array, $prefix)\n{\n}", "public function getPrefix() {\n return $this->_prefix;\n }", "function startsWith($prefix) {\n $node = $this->find($prefix);\n return $node != null; // 前缀存在即可\n }", "public function getPrefixTitle ();", "public function testPrefixedExtraction()\n {\n $queryData = ['prefix_a' => 1, 'b' => 2];\n $requestData = ['a' => 2, 'prefix_b' => 4, 'c' => 8];\n $contentData = ['b' => 3, 'prefix_c' => 6, 'prefix_d' => 9];\n $request = $this->createRequest($queryData, $requestData, $contentData);\n\n $this->assertEquals(\n ['a' => 1, 'b' => 4, 'c' => 6, 'd' => 9],\n $this->extractParameters($request, 'prefix_')\n );\n }", "function prefix($n = null) {\n\tglobal $ns;\n\tif (is_null($n))\n\t\t$n = array_keys($ns);\n\tif (!is_array($n))\n\t\t$n = array($n);\n\t$ret = \"\";\n\tforeach ($n as $s)\n\t\t$ret .= \"PREFIX $s: <\" . $ns[$s] . \">\\n\";\n\treturn $ret;\n}", "public function getPrefix(): string\n {\n return (string) $this->prefix;\n }", "protected function getPrefix()\n {\n $prefix = '';\n return $prefix;\n }", "public static function getTemplateGroup($strPrefix)\n {\n $arrTemplates = array();\n\n // Get the default templates\n foreach (\\TemplateLoader::getPrefixedFiles($strPrefix) as $strTemplate)\n {\n $arrTemplates[$strTemplate][] = 'root';\n }\n\n $arrCustomized = glob(TL_ROOT . '/templates/' . $strPrefix . '*');\n\n // Add the customized templates\n if (is_array($arrCustomized))\n {\n foreach ($arrCustomized as $strFile)\n {\n $strTemplate = basename($strFile, strrchr($strFile, '.'));\n $arrTemplates[$strTemplate][] = $GLOBALS['TL_LANG']['MSC']['global'];\n }\n }\n\n // Show the template sources (see #6875)\n foreach ($arrTemplates as $k=>$v)\n {\n $arrTemplates[$k] = $k;\n }\n\n // Sort the template names\n ksort($arrTemplates);\n\n return $arrTemplates;\n }", "public function getDestinationPrefixes();", "protected function getPrefix(): string\n\t{\n\t\treturn $this->arParams['PREFIX'] !== '' ? $this->arParams['PREFIX'] : $this->getDefaultPrefix();\n\t}", "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 static function prefixKeys(array $array, $prefix)\n {\n return array_combine(array_map(function ($key) use ($prefix) {\n return $prefix . $key;\n }, array_keys($array)), array_values($array));\n }", "public function metaKeys($prefixed = true) {\n $keys = array_keys((array)$this->meta());\n if (!$prefixed) {\n $prefix = static::meta_prefix();\n array_walk($keys, function (&$value) use ($prefix) {\n $value = substr($value, strlen($prefix));\n });\n }\n\n return $keys;\n }", "public function getPrefix($store = null) {\n\t\tif ($store) {\n\t\t\t$data = $store->getConfig(Self::CONF_PREFIX);\n\t\t} else {\n\t\t\t$data = $this->_scopeConfig->getValue(Self::CONF_PREFIX, ScopeInterface::SCOPE_STORE);\n\t\t}\n\t\treturn $data;\n\t}", "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 }", "function array_prefix_keys(string $prefix, array $array): array\n{\n if (is_numeric_array($array)) {\n return $array;\n }\n\n $result = [];\n foreach ($array as $key => $value) {\n $result[$prefix . $key] = $value;\n }\n return $result;\n}", "protected function getTablePrefixes(): array\n {\n if (null === $this->genTablePrefixes) {\n $container = $this->getContextVar(\"container\");\n $createFile = $this->getContextVar(\"createFile\");\n $this->genTablePrefixes = DeveloperWizardGenericHelper::getTablePrefixes($createFile, $container);\n if (count($this->genTablePrefixes) < 1) {\n $createFile = $this->getContextVar(\"createFile\");\n $this->error(\"No table prefix found in the create file: $createFile.\");\n }\n }\n return $this->genTablePrefixes;\n }", "function acf_remove_array_key_prefix($array, $prefix)\n{\n}", "public function getPrefix() {\n return $this->_prefix;\n }", "function startsWith($prefix)\n {\n $node = $this;\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 }", "static function addPrefixKeys($arr_inputs, $prefix = 'openid.')\n\t{\n\t\t$arr_outputs = array();\n\t\tforeach ($arr_inputs as $k => $v) {\n\t\t\t$arr_outputs[$prefix . $k] = $v;\n\t\t}\n\t\treturn $arr_outputs;\n\t}", "public function getPrefix(): string\n {\n return config('linky.db.prefix');\n }", "public function getPrefix() {\n return $this->sPrefix;\n }", "public function names() {\n $maps = $this->classRegistry->getClassMapping();\n \n $result = [];\n foreach($maps as $map) {\n $key = str_replace('\\\\','__',$map->getCurrentName());\n $result[$key] = $map->getCurrentName();\n }\n \n return $result;\n }", "private function getFilterMethods($prefix)\n {\n $listMethods = get_class_methods($this);\n $return = [];\n $strlenPrefix = strlen($prefix);\n foreach ($listMethods as $method) {\n if (substr($method, 0, $strlenPrefix) === $prefix) {\n $return[substr($method, $strlenPrefix)] =\n strtolower(substr($method, $strlenPrefix, 1)) . substr($method, ($strlenPrefix + 1));\n }\n }\n return $return;\n }" ]
[ "0.64692664", "0.64085", "0.62802047", "0.62802047", "0.62677175", "0.6219111", "0.6173023", "0.61568785", "0.6031773", "0.60099745", "0.59278196", "0.58854645", "0.58851355", "0.58645904", "0.5817596", "0.58150494", "0.579695", "0.57931185", "0.575712", "0.57380956", "0.5726995", "0.5722384", "0.57220644", "0.57074916", "0.57012826", "0.5682099", "0.5678974", "0.56209135", "0.56198186", "0.5602385", "0.558434", "0.55840874", "0.55672383", "0.5552474", "0.5550085", "0.55410796", "0.5530565", "0.5529907", "0.5507265", "0.54845977", "0.5471065", "0.5471065", "0.5463817", "0.54588383", "0.5449935", "0.54481256", "0.5427414", "0.5423111", "0.5396459", "0.53626585", "0.53614575", "0.53614575", "0.53614575", "0.53614575", "0.53614575", "0.53614575", "0.53614575", "0.53614575", "0.5359963", "0.5350459", "0.5344215", "0.5340098", "0.5307583", "0.52954376", "0.52954376", "0.52954376", "0.52954376", "0.528378", "0.527777", "0.52706563", "0.52683085", "0.5264437", "0.52643985", "0.5242942", "0.52419686", "0.5229881", "0.52237064", "0.52226645", "0.52167934", "0.5211733", "0.51962936", "0.5193323", "0.51904404", "0.5188381", "0.51848394", "0.51709396", "0.51564455", "0.51562315", "0.51381445", "0.51323307", "0.5131201", "0.51295567", "0.5117449", "0.5114069", "0.5107234", "0.5101061", "0.5098007", "0.50855666", "0.5074498", "0.5069608" ]
0.6012731
9
Deletes configuration objects whose names start with a given prefix. Given the following configuration object names: node.type.article node.type.page Passing the prefix 'node.type.' will delete the above configuration objects.
public function deleteAll($prefix = '');
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function delete($prefix)\n {\n if (!is_string($prefix) or $prefix === null or $prefix === '') {\n throw new \\InvalidArgumentException(\n \"\\$prefix should be a string and cannot be null or empty\"\n );\n }\n\n $prefix = strtolower($prefix);\n self::namespaces(); // make sure, that self::$namespaces is initialized\n if (isset(self::$namespaces[$prefix])) {\n unset(self::$namespaces[$prefix]);\n }\n }", "public function flushPrefix($prefix)\n\t{\n\t\t$prefix = $this->id_prefix . $prefix;\n\t\t$prefix_like = \"$prefix%\";\n\n\t\ttry {\n\t\t\t$this->db->fetchAll(\"\n\t\t\t\tDELETE FROM cache\n\t\t\t\tWHERE id LIKE ?\n\t\t\t\", array($prefix_like));\n\t\t} catch (\\Exception $e) {\n\t\t\tif (!$this->silence_exceptions) {\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t}\n\n\t\tforeach (array_keys($this->loaded) as $key) {\n\t\t\tif (strpos($key, $prefix) === 0) {\n\t\t\t\tunset($this->loaded[$key]);\n\t\t\t}\n\t\t}\n\t}", "public static function deletePrefix($prefix)\n {\n return self::pipeline(function ($pipe) use ($prefix) {\n $keys = self::keys($prefix);\n foreach ($keys as $key) {\n $pipe->del($key);\n }\n });\n }", "public static function delete_by_prefix( $prefix = '' ) {\n\t\tif ( empty( $prefix ) ) {\n\t\t\treturn;\n\t\t}\n\t\t$base = static::get_upload_base();\n\n\t\tif ( is_dir( $base ) ) {\n\t\t\t$files = preg_grep( '~^' . $prefix . '.*\\.pdf$~', scandir( $base ) );\n\t\t\tforeach ( $files as $file_name ) {\n\t\t\t\tif ( file_exists( $base . $file_name ) ) {\n\t\t\t\t\t@unlink( $base . $file_name );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function clearByPrefix(string $prefix): bool;", "function acf_remove_array_key_prefix($array, $prefix)\n{\n}", "public function removeTablePrefixes($prefix)\n {\n $connection = $this->entityManager->getConnection();\n $schemaManager = $connection->getSchemaManager();\n $schema = $schemaManager->createSchema();\n // remove table prefixes\n foreach ($this->importTables as $value) {\n if (!$schema->hasTable($prefix . $value)) {\n continue;\n }\n\n $sql = 'RENAME TABLE ' . $prefix . $value . ' TO ' . $value;\n $stmt = $connection->prepare($sql);\n\n try {\n $stmt->execute();\n } catch (\\Exception $e) {\n $this->addFlash('error', $e->getMessage() . $this->__f('There was a problem recognizing the existing Dizkus tables. Please confirm that your prefix match the actual Dizkus tables in the database. (Current prefix loaded as `%s`)', ['%s' => $prefix]));\n\n return false;\n }\n }\n }", "public function deleteCacheByPrefix($prefix)\n {\n $keys = $this->cache->queryKeys($prefix);\n foreach ($keys as $key) {\n $this->deleteCache($key);\n }\n return true;\n }", "public function delete(string $prefix, string $key): void;", "public function clearParams($prefix = '') {\n if (!empty($prefix)) {\n $fields = $this->_rediska->getHashFields($prefix);\n foreach ($fields As $field){\n $this->_rediska->deleteFromHash($prefix, $field);\n }\n return true;\n } else {\n return false;\n }\n }", "public function clearByPrefixes(array $prefixes): bool;", "public function setPrefix($prefix);", "public function clear($cachePrefix)\n {\n foreach ($this->filesystem->keys() as $key) {\n if (false !== strpos($key, DIRECTORY_SEPARATOR)) {\n $this->filesystem->delete($key);\n }\n }\n foreach ($this->filesystem->keys() as $key) {\n $this->filesystem->delete($key);\n }\n }", "public function setPrefix( $prefix );", "public function prefixKey($prefix);", "public function removePrefixFromPath()\n {\n $this->fileStructure->path = $this->getPathWithoutPrefix( $this->fileStructure->path, $this->prefix );\n $this->prefix = \"\";\n }", "abstract protected function deleteConfiguration($name);", "static function detachPrefixKeys($arr_inputs, $prefix = 'openid.')\n\t{\n\t\t$arr_outputs = array();\n\t\t$len = strlen($prefix);\n\t\tforeach ($arr_inputs as $k => $v) {\n\t\t\t$key = ($prefix === substr($k, 0, $len)) ? substr($k, $len) : $k;\n\t\t\t$arr_outputs[$key] = $v;\n\t\t}\n\t\treturn $arr_outputs;\n\t}", "function removeAllByPrefix ($s)\r\n\t{ \r\n if (!($rHandler = opendir($this->sPath))) \r\n return false;\r\n\r\n $l = strlen($s);\r\n while (($sFile = readdir($rHandler)) !== false)\r\n if (0 == strncmp($sFile, $s, $l))\r\n @unlink ($this->sPath . $sFile);\r\n \r\n closedir($rHandler);\r\n\r\n return true;\r\n }", "function cleanPrefixes($array){\n return array_merge($array, Configure::read('appli.CleanPrefixes'));\n }", "public function removeOption($name, $prefix = '')\n\t{\n\t\tif (array_key_exists($prefix . $name, $this->_options)) {\n\t\t\tunset($this->_options[$prefix . $name]);\n\t\t}\n\t}", "public function cleanupUploadDirs($lifetime, $uploadPrefix)\n {\n $uploadDirs = glob(ABSPATH . $uploadPrefix . '*');\n $toDelete = array_filter($uploadDirs, function($dir) {\n return filemtime($dir) < time() - $lifetime * 60 ? true : false;\n });\n\n foreach ($toDelete as $dir) {\n $files = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($dir . '/', \\RecursiveDirectoryIterator::SKIP_DOTS), \\RecursiveIteratorIterator::CHILD_FIRST);\n \n foreach ($files as $file)\n $file->isDir() === true ? rmdir($file->getRealPath()) : unlink($file->getRealPath());\n\n rmdir($dir);\n }\n }", "public function prune()\n {\n $list = $this->metadata->getAllMetadata();\n\n $pruneMappings = $this->client->indices()->getMapping();\n\n # Remove configured mappings from prune list\n foreach ($list as $metadata) {\n $index = $metadata->getIndex();\n $type = $metadata->getType();\n\n unset($pruneMappings[$index]['mappings'][$type]);\n }\n\n # Delete mappings that are not in the configuration\n foreach ($pruneMappings as $index => $indexMapping) {\n foreach ($indexMapping['mappings'] as $type => $typeMapping) {\n try {\n $params = [\n 'index' => $index,\n 'type' => $type\n ];\n\n $response = $this->client->indices()->deleteMapping($params);\n } catch (Exception $exception) {\n $response = [\n 'ok' => false,\n 'error' => $exception->getMessage()\n ];\n } finally {\n $metadata = new MetadataOptions;\n $metadata->setIndex($index);\n $metadata->setType($type);\n\n $this->getEventManager()\n ->trigger('prune', $this, compact('response', 'metadata'));\n }\n }\n }\n }", "function cfg_del(...$args)\n{\n\tglobal $CONFIG;\n\tswitch( count($args) )\n\t{\n\t\tcase 1: unset($CONFIG[$args[0]]); break;\n\t\tcase 2: unset($CONFIG[$args[0]][$args[1]]); break;\n\t\tcase 3: unset($CONFIG[$args[0]][$args[1]][$args[2]]); break;\n\t\tcase 4: unset($CONFIG[$args[0]][$args[1]][$args[2]][$args[3]]); break;\n\t\tcase 5: unset($CONFIG[$args[0]][$args[1]][$args[2]][$args[3]][$args[4]]); break;\n\t\tcase 6: unset($CONFIG[$args[0]][$args[1]][$args[2]][$args[3]][$args[4]][$args[5]]); break;\n\t\tdefault: WdfException::Raise(\"Illegal argument count: \".count($args));\n\t}\n}", "public function preparePrefixes()\n {\n $this->prefixes['route'] = explode('/', config('app-generator.prefixes.route', ''));\n $this->prefixes['path'] = explode('/', config('app-generator.prefixes.path', ''));\n\n if ($prefix = $this->getOption('prefix')) {\n $multiplePrefixes = explode(',', $prefix);\n\n $this->prefixes['route'] = array_merge($this->prefixes['route'], $multiplePrefixes);\n $this->prefixes['path'] = array_merge($this->prefixes['path'], $multiplePrefixes);\n }\n\n $this->prefixes['route'] = array_filter($this->prefixes['route']);\n $this->prefixes['path'] = array_filter($this->prefixes['path']);\n\n $routePrefix = '';\n foreach ($this->prefixes['route'] as $singlePrefix) {\n $routePrefix .= Str::camel($singlePrefix) . '.';\n }\n $this->prefixes['route'] = !empty($routePrefix) ? substr($routePrefix, 0, -1) : $routePrefix;\n\n $namespacePrefix = $pathPrefix = '';\n foreach ($this->prefixes['path'] as $singlePrefix) {\n $namespacePrefix .= Str::title($singlePrefix) . '\\\\';\n $pathPrefix .= Str::title($singlePrefix) . '/';\n }\n\n $this->prefixes['namespace'] = !empty($namespacePrefix) ? substr($namespacePrefix, 0, -1) : $namespacePrefix;\n $this->prefixes['path'] = !empty($pathPrefix) ? substr($pathPrefix, 0, -1) : $pathPrefix;\n }", "public function deleteObsoleteConfigs();", "public function delete( $args, $assoc_args ) {\n\n\t\tlist( $alias ) = $args;\n\n\t\t$config = ( ! empty( $assoc_args['config'] ) ? $assoc_args['config'] : '' );\n\n\t\tlist( $config_path, $aliases ) = $this->get_aliases_data( $config, $alias );\n\n\t\t$this->validate_config_file( $config_path );\n\n\t\tif ( empty( $aliases[ $alias ] ) ) {\n\t\t\tWP_CLI::error( \"No alias found with key '{$alias}'.\" );\n\t\t}\n\n\t\tunset( $aliases[ $alias ] );\n\t\t$this->process_aliases( $aliases, $alias, $config_path, 'Deleted' );\n\n\t}", "public function setPrefix($prefix = \"\") {\n $this->_prefix = !empty($prefix) ? $prefix : '';\n }", "function removeAllByPrefix ($s)\r\n\t{\r\n // not implemented for current cache\r\n return false;\r\n }", "public function setPrefix($prefix) {\n $this->prefix = $prefix;\n }", "public function setPrefix($prefix) {\n $this->prefix = $prefix;\n }", "public function setPrefix($prefix)\n {\n $this->prefix = $prefix;\n }", "public function setPrefix($prefix)\n {\n $this->prefix = $prefix;\n }", "function clear($cachePrefix);", "public function setPrefix($prefix){\n\t\t$this->prefix = $prefix;\n\t}", "public static function keys($prefix)\n {\n return parent::keys($prefix);\n }", "function remove_from_parent()\n {\n foreach ($this->plugins as $name => $obj) {\n $this->updateServicesVars($name);\n if ($this->plugins[$name]->initially_was_account) {\n if (isset($this->plugins[$name]->krb_host_key) && $this->plugins[$name]->krb_host_key instanceof krbHostKeys) {\n $this->plugins[$name]->krb_host_key->remove_from_parent_by_prefix($this->plugins[$name]->krb_service_prefix);\n }\n $this->plugins[$name]->remove_from_parent();\n }\n }\n }", "protected function glob_keys_pattern($prefix = '') {\n if ($this->singledirectory) {\n return $this->path . '/'.$prefix.'*.cache';\n } else {\n return $this->path . '/*/'.$prefix.'*.cache';\n }\n }", "public function setPrefix($prefix)\n\t{\n\t\t$this->prefix = $prefix;\n\t}", "public function setPrefix(string $prefix): void\n {\n $this->prefix = $prefix;\n }", "public function setPrefix(string $prefix): void\n {\n $this->prefix = $prefix;\n }", "function strip_prefix(string $string, string $prefix, Encoding $encoding = Encoding::UTF_8): string\n{\n if ($prefix === $string) {\n return '';\n }\n\n if ('' === $prefix || '' === $string || !starts_with($string, $prefix, $encoding)) {\n return $string;\n }\n\n return slice($string, length($prefix, $encoding), null, $encoding);\n}", "function strip_prefix(string $string, string $prefix): string\n{\n if ('' === $prefix || !starts_with($string, $prefix)) {\n return $string;\n }\n\n /** @psalm-suppress MissingThrowsDocblock - $offset is within-bounds. */\n return slice($string, length($prefix));\n}", "public function listAll($prefix = '');", "private function removeOldConfigurationKeys()\n {\n foreach ($this->oldConfigurationKeys as $configuration) {\n Configuration::deleteByName($configuration);\n }\n }", "private function _stripOutTestRoutes(&$config)\n {\n\t\t// [taz] Pull any routes with names starting with \"test\" out.\n \n $routes = $config->routes->toArray();\n \n foreach ($routes as $routeName => $routeSpec) {\n\n \tif ('test' == substr($routeName, 0, 4)) {\n \tunset($config->routes->$routeName);\n }\n \t\n }\t \t\n }", "function cleanUpUnusedImageFiles($dir, $prefix)\r\n {\r\n // iterate through files in the directory\r\n if(is_dir($dir))\r\n {\r\n if($dh = opendir($dir))\r\n {\r\n while(($file = readdir($dh)) !== false)\r\n {\r\n // find gif files\r\n if(preg_match(\"/.gif/\", $file))\r\n {\r\n // find files that start with the given prefix\r\n if(preg_match(\"/^$prefix/\", $file))\r\n {\r\n // delete file\r\n unlink($dir.\"/\".$file);\r\n }\r\n }\r\n }\r\n closedir($dh);\r\n }\r\n }\r\n }", "public function setPrefix($prefix)\n {\n $this->prefix = !empty($prefix) ? $prefix . ':' : '';\n }", "public function preDeleteKeyValueGroupConfig(Object_KeyValue_GroupConfig $config)\n {\n\n }", "public function setPrefix($address_prefix)\n\t{\n\t\t$this->address_prefix = trim($address_prefix);\n\t}", "public function deleteConfigs()\n {\n foreach ($this->fields_form as $k => $f) {\n foreach ($f['form']['input'] as $i => $input) {\n if (isset($input['ignore']) && $input['ignore'] == true) {\n continue;\n }\n Configuration::deleteByName($input['name']);\n }\n }\n\n $this->deleteCustomConfigs();\n\n return true;\n }", "public static function removePrefix(string $str, string $prefix): string\n {\n $length = strlen($prefix);\n if (substr($str, 0, $length) === $prefix) { // if start from prefix\n return substr($str, $length);\n } else {\n return $str;\n }\n }", "function mongo_node_mass_delete($entity_type, $entities) {\n entity_delete_multiple($entity_type, $entities);\n}", "public function testPrefix(): void\n {\n $routes = Router::createRouteBuilder('/');\n\n $routes->prefix('admin', function (RouteBuilder $routes): void {\n $this->assertSame('/admin', $routes->path());\n $this->assertEquals(['prefix' => 'Admin'], $routes->params());\n });\n\n $routes->prefix('admin', ['_namePrefix' => 'admin:'], function (RouteBuilder $routes): void {\n $this->assertSame('admin:', $routes->namePrefix());\n $this->assertEquals(['prefix' => 'Admin'], $routes->params());\n });\n }", "public function find_by_prefix($prefix) {\n $this->ensure_path_exists();\n $prefix = preg_replace('#(\\*|\\?|\\[)#', '[$1]', $prefix);\n $files = glob($this->glob_keys_pattern($prefix), GLOB_MARK | GLOB_NOSORT);\n $return = array();\n if ($files === false) {\n return $return;\n }\n foreach ($files as $file) {\n // Trim off \".cache\" from the end.\n $return[] = substr(basename($file), 0, -6);\n }\n return $return;\n }", "public function clear () {\n //$prefix = $this->redis->getOptions()->__get('prefix')->getPrefix();\n foreach($this->redis->keys(\"*\") as $key) {\n $this->redis->del($key);\n }\n }", "public function testPrefixOptions(): void\n {\n $routes = Router::createRouteBuilder('/');\n\n $routes->prefix('admin', ['param' => 'value'], function (RouteBuilder $routes): void {\n $this->assertSame('/admin', $routes->path());\n $this->assertEquals(['prefix' => 'Admin', 'param' => 'value'], $routes->params());\n });\n\n $routes->prefix('CustomPath', ['path' => '/custom-path'], function (RouteBuilder $routes): void {\n $this->assertSame('/custom-path', $routes->path());\n $this->assertEquals(['prefix' => 'CustomPath'], $routes->params());\n });\n }", "public function setPrefix($prefix)\n {\n $this->idPrefix = $prefix;\n }", "public function clearParam($param, $prefix = \"\") {\n if (!empty($prefix)) {\n // need check ?\n if ($this->_rediska->existsInHash($prefix, $param)) {\n $this->_rediska->deleteFromHash($prefix, $param);\n }\n } else {\n $this->_rediska->delete($param);\n }\n return true;\n }", "public function deleteByPrimaryKeys(stubObject $entity);", "public function cleanup() : ConfigCreator {\n try {\n foreach ($this->entityTypeManager->getStorage('search_api_index')->loadMultiple() as $index) {\n $index->delete();\n }\n }\n catch (\\Exception $e) {\n // Search API is not installed.\n }\n\n foreach ($this->getEntityTypes() as $entity_type) {\n $definition = $this->entityTypeManager->getDefinition($entity_type);\n $bundleEntityType = $definition->getBundleEntityType();\n if ($bundleEntityType) {\n // Delete all entities.\n $field_definitions = $this->entityFieldManager->getFieldStorageDefinitions($entity_type);\n $storage = $this->entityTypeManager->getStorage($entity_type);\n foreach ($storage->getTableMapping($field_definitions)->getTableNames() as $table) {\n $this->database->truncate($table)->execute();\n }\n\n // Delete fields.\n $entities = $this->entityTypeManager->getStorage('field_config')->loadByProperties(['entity_type' => $entity_type]);\n $this->entityTypeManager->getStorage('field_config')->delete($entities);\n\n $entities = $this->entityTypeManager->getStorage('field_storage_config')->loadByProperties(['entity_type' => $entity_type]);\n $this->entityTypeManager->getStorage('field_storage_config')->delete($entities);\n }\n }\n\n foreach ($this->getEntityTypes() as $entity_type) {\n $definition = $this->entityTypeManager->getDefinition($entity_type);\n $bundleEntityType = $definition->getBundleEntityType();\n if ($bundleEntityType) {\n // Delete all bundles.\n $bundles = $this->entityTypeManager->getStorage($bundleEntityType)->loadMultiple();\n $this->entityTypeManager->getStorage($bundleEntityType)->delete($bundles);\n }\n }\n\n return $this;\n }", "public function deleteKeyPatterns($keyPatterns);", "function remove(){\n tep_db_query(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_key in ('\" . implode(\"', '\", $this->keys()) . \"')\");\n }", "public static function removePrefix($string, $prefix = null)\n {\n if (empty($prefix)) {\n $prefix = Yii::$app->controller->db->tablePrefix ?: null;\n }\n\n if (strpos($string, $prefix) === false) {\n return $string;\n }\n\n $position = strpos($string, $prefix) + strlen($prefix);\n\n return substr($string, $position);\n }", "public function setPrefix($prefix) {\n\t\tif ($prefix == $this->prefix) return;\n\t\t\n\t\t$this->prefix = $prefix;\n\t\t$sql = \"UPDATE \twbb\".WBB_N.\"_thread\n\t\t\tSET\tprefix = '\".escapeString($prefix).\"'\n\t\t\tWHERE \tthreadID = \".$this->threadID;\n\t\tWCF::getDB()->registerShutdownUpdate($sql);\n\t}", "public function clearCacheDataWithPrefix($dataCacheKeyPrefix = ''){\n $cacheKey = $this->getCacheKey($dataCacheKeyPrefix);\n $this->clearCache($cacheKey);\n }", "public function getDeletedPrefixKey() {}", "public function clear_titles_layouts(string $area)\n{\n\n // Delete existing\n db::query(\"DELETE FROM cms_layouts WHERE area = %s\", $area);\n\n // Delete from redis cms:titles\n$keys = redis::hkeys('cms:titles');\n foreach ($keys as $key) { \n if (!preg_match(\"/^$area\\//\", $key)) { continue; }\n redis::hdel('cms:titles', $key);\n }\n\n // Delete from redis cms:layouts\n $keys = redis::hkeys('cms:layouts');\n foreach ($keys as $key) { \n if (!preg_match(\"/^$area\\//\", $key)) { continue; }\n redis::hdel('cms:layouts', $key);\n }\n\n // Debug\n debug::add(2, tr(\"Cleared all page titles / layouts from area {1}\", $area));\n\n}", "public static function stripStart($str, $prefix) {\n\t\t$prefixLen = strlen($prefix);\n\t\tif (substr($str, 0, $prefixLen) === $prefix) {\n\t\t\treturn substr($str, $prefixLen);\n\t\t}\n\t\treturn $str;\n\t}", "public function prefixClassName($prefix) {\n\t\t$this->processedClassCode = preg_replace_callback(self::PATTERN_CLASS_SIGNATURE, function($matches) use ($prefix) {\n\t\t\treturn $matches['modifiers'] . $prefix . $matches['className'] . $matches['parents'];\n\t\t}, $this->processedClassCode);\n\t}", "public static function remove(string ...$names)\n {\n foreach ($names as $name) {\n $type = pathinfo($name, PATHINFO_EXTENSION);\n if (array_key_exists($type, self::$toLoad) && array_key_exists($name, self::$toLoad[$type]))\n unset(self::$toLoad[$type][$name]);\n }\n }", "public function setCustomerPrefix($customerPrefix);", "public function setPrefix($prefix)\n\t{\n\t\tif (func_num_args() == 1) {\n\t\t\t$this->id_prefix = $prefix;\n\t\t} else {\n\t\t\t$args = func_get_args();\n\t\t\t$args = Arrays::castToType($args, 'string');\n\t\t\t$this->id_prefix = implode('.', $args);\n\t\t}\n\n\t\tif (substr($this->id_prefix, -1, 1) != '.') {\n\t\t\t$this->id_prefix .= '.';\n\t\t}\n\t}", "public function suggestProperty($prefix = null){\n $error = [\n \"status\" => \"error\",\n \"message\" => \"invalid query\",\n \"details\" => \"prefix\"\n ];\n $result = [];\n\n if (!isset($prefix))\n return $error;\n\n $result[\"result\"] = $this->mapper->filterPropertiesPrefix($this->input[\"prefix\"]);\n return $result;\n }", "protected function deleteConfiguration(){\n Configuration::deleteByName($this->name.'_settings');\n }", "public function setXpathPrefix($prefix)\n {\n $this->xpathPrefix = $prefix;\n }", "public function clear(): bool\n {\n $result = [];\n $files = array_diff(scandir($this->config['path']), ['..', '.']);\n $prefixLength = strlen($this->config['prefix']);\n foreach ($files as $file) {\n if (substr($file, 0, $prefixLength) === $this->config['prefix']) {\n $result[] = unlink($this->config['path'] . '/' . $file) === true;\n }\n }\n\n return ! in_array(false, $result);\n }", "function _prefix($prefix = 'admin') {\n\t\tif (isset($this->params['prefix']) && $this->params['prefix'] == $prefix) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function prependRouteControllersWithPrefix($prefix)\n {\n foreach (parent::all() as $route) {\n $route->setDefault('_controller', $prefix.$route->getDefault('_controller'));\n }\n }", "public function test_updatePrefix()\n\t{\n\t}", "public function deleteNamespace($request)\n {\n $runtime = new RuntimeOptions([]);\n\n return $this->deleteNamespaceWithOptions($request, $runtime);\n }", "protected function setPrefix()\n {\n if (array_key_exists('prefix', $this->config)) {\n $this->prefix = $this->config['prefix'];\n }\n }", "function remove() {\n global $db;\n $db->Execute(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_key in ('\" . implode(\"', '\", $this->keys()) . \"')\");\n }", "public function setPathPrefix($prefix)\n {\n $prefix = ltrim($prefix, '/');\n\n return parent::setPathPrefix($prefix);\n }", "public static function delete(string ...$keys)\n {\n static::getInstance()->delete(...$keys);\n }", "protected function remove_prefix( $text, $prefix ) {\n\t\tif ( 0 === strpos( $text, $prefix ) ) {\n\t\t\t$text = substr( $text, strlen( $prefix ) );\n\t\t}\n\t\treturn $text;\n\t}", "public function testNoNameDelete()\n\t{\n\t\t$this->setExpectedException( 'CCException' );\n\t\t\n\t\t$config = CCConfig::create();\n\t\t$config->_delete();\n\t}", "function remove() {\r\n global $db;\r\n $db->Execute(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_key in ('\" . implode(\"', '\", $this->keys()) . \"')\");\r\n }", "public function purgeObjects(array $ids);", "public function deleteConfiguration($identifier)\n {\n $this->getTable()->where('identifier', $identifier)->delete();\n }", "public static function removeAllConfig()\n {\n foreach (self::CONFIG as $configKey) {\n Configuration::deleteByName($configKey);\n }\n }", "public function setPrefix() {\n\t}", "public function registerPrefix($prefix, $paths)\n\t{\n\t\t$this->prefixes[$prefix] = (array) $paths;\n\t}", "function unregister($things) {\n $things = explode(\",\", $things);\n reset($things);\n while (list(,$thing) = each($things)) {\n $thing = trim($thing);\n if ($thing) {\n unset($this->registered_objects[$thing]);\n }\n }\n }", "public function getByPathPrefix($pathPrefix);", "public function markTablesForImport($prefix)\n {\n $connection = $this->entityManager->getConnection();\n // remove table prefixes\n foreach ($this->importTables as $value) {\n $sql = 'RENAME TABLE ' . $value . ' TO ' . $prefix . $value;\n $stmt = $connection->prepare($sql);\n\n try {\n $stmt->execute();\n } catch (\\Exception $e) {\n $this->addFlash('error', $e->getMessage() . $this->__f('There was a problem recognizing the existing Dizkus tables. Please confirm that your prefix match the actual Dizkus tables in the database. (Current prefix loaded as `%s`)', ['%s' => $prefix]));\n\n return false;\n }\n }\n }", "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 static function purge_cloudflare_cache( $prefixes = array() ) {\n\t\tif ( ! self::$custom_hostname ) {\n\t\t\treturn 'error';\n\t\t}\n\n\t\tif ( ! NerdPress_Helpers::is_production( home_url( '/' ) ) ) {\n\t\t\t\treturn 'skip_cache_clearing';\n\t\t}\n\n\t\tif ( empty( $prefixes ) ) {\n\t\t\tself::$cache_clear_type = 'full';\n\t\t\t$body = '{ \"hosts\": [\"' . self::$custom_hostname . '\"] }';\n\t\t\t$time = time();\n\n\t\t\tif ( get_option( 'nerdpress_full_cache_clear_time' ) === false ) {\n\t\t\t\tadd_option( 'nerdpress_full_cache_clear_time', $time, '', false );\n\t\t\t}\n\n\t\t\t$last_cloudflare_cache_clear_time = get_option( 'nerdpress_full_cache_clear_time' );\n\t\t\t$time_since_cache_clearing = $time - $last_cloudflare_cache_clear_time;\n\n\t\t\tif ( $time_since_cache_clearing < 10 ) {\n\t\t\t\treturn 'cache_clear_rate_limited';\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tforeach ($prefixes as $prefix) {\n\t\t\t// Removing all query strings if lang= exist.\n\t\t\t\tif ( strpos( $prefix, 'lang=' ) !== false ) {\n\t\t\t\t\t$prefix = preg_replace( '#\\?.*$#', '', $prefix );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Bypassing cache clearing if another query string exists.\n\t\t\tif ( NerdPress_Helpers::cache_clear_bypass_on_string( $prefixes ) ) {\n\t\t\t\treturn 'skip_cache_clearing';\n\t\t\t}\n\n\t\t\t// Removing http(s):// because Cloudflare API \"prefixes\" cache clear requires it\n\t\t\t$prefixes_no_protocol = preg_replace( '#https?://#', '', $prefixes );\n\n\t\t\tself::$cache_clear_type = implode( ',', $prefixes_no_protocol );\n\t\t\t$body = '{ \"prefixes\": [\"' . implode( ',', $prefixes_no_protocol ) . '\"] }';\n\t\t}\n\n\t\t$url = self::assemble_url() . 'purge_cache';\n\t\t$opts = array(\n\t\t\t'headers' => array_merge(\n\t\t\t\tself::$header_content_type,\n\t\t\t\tself::$header_cloudflare\n\t\t\t),\n\t\t\t'body' => $body,\n\t\t);\n\n\t\t$result = self::post( $url, $opts );\n\n\t\tif (\n\t\t\tself::$cache_clear_type === 'full'\n\t\t\t&& ! is_wp_error( $result )\n\t\t) {\n\t\t\t$api_call_status = json_decode( $result['body'] );\n\t\t\tif ( $api_call_status->success ) {\n\t\t\t\tupdate_option( 'nerdpress_full_cache_clear_time', $time, false );\n\t\t\t}\n\t\t}\n\n\t\treturn self::process_response( $result );\n\t}", "public function setRoutePrefix($prefix)\n {\n if (Str::startsWith($prefix, Lit::url(''))) {\n $prefix = Str::replaceFirst(Lit::url(''), '', $prefix);\n }\n\n $this->routePrefix = $prefix;\n }", "public function unprefix($value);" ]
[ "0.59229916", "0.5854187", "0.58503544", "0.5822707", "0.57871926", "0.552195", "0.5466166", "0.5421459", "0.534045", "0.53156245", "0.5227362", "0.51237273", "0.5120324", "0.49455112", "0.49274817", "0.48961696", "0.48476747", "0.48331958", "0.4800423", "0.4796945", "0.47775134", "0.47315446", "0.47311884", "0.4727132", "0.47259298", "0.47240108", "0.47094852", "0.47050175", "0.46789566", "0.46764022", "0.46764022", "0.46742153", "0.46742153", "0.46709692", "0.46525028", "0.46480587", "0.46286508", "0.46010563", "0.45877695", "0.4587628", "0.4587628", "0.45813358", "0.45560932", "0.45460787", "0.4535347", "0.45346758", "0.45240498", "0.4523617", "0.4518397", "0.45176587", "0.4508613", "0.4501593", "0.44959006", "0.44888878", "0.44868016", "0.44850916", "0.4484268", "0.4472913", "0.44661063", "0.4458423", "0.4448507", "0.44365", "0.44288212", "0.44222894", "0.4415226", "0.43969002", "0.43815544", "0.4381229", "0.43782347", "0.43708143", "0.4370182", "0.4369912", "0.43633544", "0.4362407", "0.4343093", "0.43416142", "0.43330318", "0.43309033", "0.43308493", "0.43268228", "0.4313018", "0.43119636", "0.43081647", "0.43067244", "0.43048567", "0.43022272", "0.43004522", "0.43002513", "0.42996362", "0.42954335", "0.42903572", "0.42885384", "0.42846024", "0.4275159", "0.42703345", "0.42681062", "0.42645496", "0.42629907", "0.42622742", "0.42618135" ]
0.6815704
0
We'll use a constructor, as you can't directly call a function from a property definition.
public function __construct() { // Assign the CodeIgniter super-object $this->CI =& get_instance(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct($val)\n {\n $this->property = $val;\n }", "function createProperty();", "public function __construct($createProperty, $property)\n {\n $this->property = $property;\n\n $this->createProperty = $createProperty;\n }", "public function __construct(Property $property)\n {\n $this->property = $property;\n }", "function NewFuncProp($aClassName,$aName,$aLineNbr,$aArgs,$aArgsVal,$aShortComment) {\r\n\treturn new DocFuncProp($aClassName,$aName,$aLineNbr,$aArgs,$aArgsVal,$aShortComment);\r\n }", "public function __construct($fun) {\n $this->f = $fun;\n }", "function __constructor(){}", "private final function __construct() {}", "public function __construct()\n {\n foreach (GeneralUtility::makeInstance(\\ReflectionClass::class, static::class)->getProperties() ?? [] as $reflection) {\n if (!$reflection->isProtected()) {\n $name = $reflection->getName();\n $value = $this->{$name};\n\n // Define parameter name of property\n $this->parameterMapping[$name] = GeneralUtility::camelCaseToLowerCaseUnderscored($name);\n\n // Map the type of properties\n $this->typeMapping[$name] = is_int($value) ? 'int' : (is_array($value) ? 'array' : (is_bool($value) ? 'bool' : (is_string($value) ? 'string' : null)));\n }\n }\n }", "public function __construct ($value) {}", "public function __construct ($value) {}", "public function __construct ($value) {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "public function getCustomConstructor(): callable;", "public function __construct($fun=null) {\n $this->f = $fun;\n }", "public function __construct()\n {\n $accessorBuilder = PropertyAccess::createPropertyAccessorBuilder();\n $accessorBuilder->enableExceptionOnInvalidIndex();\n\n $this->pa = $accessorBuilder->getPropertyAccessor();\n }", "function __construct() {\n //added for code coverage.\n //$this->testValue = $testValue;\n }", "public function __construct(callable $value);", "public function __construct(Property $property, $company)\n {\n // dd($property);\n $this->_company = $company;\n $this->_property = $property;\n }", "final private function __construct() {}", "final private function __construct() {}", "public function __construct($value, Reflection_Property $property)\n\t{\n\t\tparent::__construct($value, $property->getType()->asReflectionClass());\n\t\t$this->properties = Replaces_Annotations::replaceProperties($this->getProperties());\n\t\t$this->value = array_keys($this->properties);\n\t}", "#[Pure]\n public function __construct() {}", "#[Pure]\n public function __construct() {}", "public function __construct($_clazz, $_property) {\n parent::__construct('numeric property name is not allowed in ' . $_clazz . '::' . $_property);\n }", "function _construct(){ }", "protected final function __construct() {}", "function __construct( $props = [] ) {\n $this->studiesToRamRatio = 1000;\n $this->ramToStudiesRatioMB = 500;\n $this->ram1GbPerHourCost = 0.00553;\n $this->storageUsePerStudyInMb = 10;\n $this->storage1GbPerMonthCost = 0.10;\n\n // Set property value if given\n foreach( $props as $name => $value ) :\n if( property_exists ( $this, $name) ) :\n $this->$name = $value;\n endif;\n endforeach;\n\n $this->ramPerStudyCostIn1Day = $this->computeRamPerStudyCostIn1Day();\n \n }", "function __construct(string $str_func)\n {\n //--- (YPower constructor)\n parent::__construct($str_func);\n $this->_className = 'Power';\n\n //--- (end of YPower constructor)\n }", "function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct () {}", "public function __construct($value)\n {\n }", "public function __construct()\n {\n # no args = no further setup\n if (func_num_args() == 0) return;\n\n # use this to work out whether an arg refers to an Orm name\n $name_specified = 0;\n\n if (is_array($input = func_get_arg(0))) { # array = new object with initial values\n if (func_num_args() == 2)\n $name_specified = 1;\n\n foreach($input as $key => $val)\n $this->$key = $val;\n\n }\n\n if ($name_specified > 0) {\n $this->setup_name = func_get_arg($name_specified);\n }\n }", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}" ]
[ "0.67959", "0.676635", "0.64151615", "0.62790227", "0.62709343", "0.62288797", "0.615108", "0.61469036", "0.6104368", "0.6057775", "0.6057775", "0.6057775", "0.6045571", "0.6045571", "0.6045571", "0.6045571", "0.6045571", "0.6045571", "0.6040542", "0.5979003", "0.59707034", "0.59421366", "0.59369576", "0.5890453", "0.58508277", "0.58508277", "0.58236784", "0.5823379", "0.5823379", "0.5817569", "0.5812367", "0.58066636", "0.57974696", "0.57715493", "0.5770028", "0.57698274", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57693523", "0.57691556", "0.57691556", "0.57636976", "0.5760758", "0.5744549", "0.5726325", "0.5726325", "0.5726325", "0.5726325" ]
0.0
-1
this three functions look for id,amount,account_type from array accounts
function emetteur_account_id() { global $account_type; foreach ($account_type as $key => $accounts) { foreach ($accounts as $key => $account) { if ($account == test_input($_POST["compte_emetteur"])) { return $accounts["id"]; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function beneficiaire_account_id() {\n global $account_type;\n foreach ($account_type as $key => $accounts) {\n foreach ($accounts as $key => $account) {\n if ($account == test_input($_POST[\"compte_beneficiaire\"])) {\n return $accounts[\"id\"];\n }\n }\n }\n }", "public function getAccounts(){\n $accounts = [];\n foreach ($this->data['Items'] as $account) {\n $newAccount = [];\n $newAccount['accounting_id'] = IndexSanityCheckHelper::indexSanityCheck('UID', $account);\n $newAccount['code'] = IndexSanityCheckHelper::indexSanityCheck('DisplayID', $account);\n $newAccount['name'] = IndexSanityCheckHelper::indexSanityCheck('Name', $account);\n $newAccount['description'] = IndexSanityCheckHelper::indexSanityCheck('Description', $account);\n $newAccount['type'] = IndexSanityCheckHelper::indexSanityCheck('Type', $account);\n\n if (array_key_exists('Type', $account)) {\n if ($account['Type']) {\n $newAccount['is_bank_account'] = ($account['Type'] === 'Bank');\n }\n }\n\n if (array_key_exists('BankingDetails', $account)) {\n if ($account['BankingDetails']) {\n $newAccount['bank_account_number'] = IndexSanityCheckHelper::indexSanityCheck('BankAccountNumber', $account['BankingDetails']);\n }\n }\n\n if (array_key_exists('TaxCode', $account)) {\n if ($account['TaxCode']) {\n $newAccount['tax_type'] = IndexSanityCheckHelper::indexSanityCheck('Code', $account['TaxCode']);\n }\n }\n array_push($accounts, $newAccount);\n }\n\n return $accounts;\n }", "private static function parseAccounts($arr)\n\t{\n\t\t$results = array();\n\t\tif (count($arr) > 0) {\n\t\t\tif (array_key_exists('account', $arr)) {\n\t\t\t\t$accounts = $arr['account'];\n\t\t\t\tforeach ($accounts as $account) {\n\t\t\t\t\t$attr = $account->attributes();\n\t\t\t\t\tif (array_key_exists('account', $account)) {\n\t\t\t\t\t\t$results = array_merge(\n\t\t\t\t\t\t\t$results, self::parseAccounts((array)$account)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$code = (string)$attr['code'];\n\t\t\t\t\t$name = (string)$attr['name'];\n//\t\t\t\t\tif ($code >= '4000') {\n\t\t\t\t\t\t$results[] = $code;\n//\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$results = array_unique($results);\n\t\t\t\tsort($results);\n\t\t\t}\n\t\t}\n\t\treturn $results;\n\t}", "function selectTransactionsByAccountId($id) {\n $connection = openDb();\n $id = (int) $id;\n\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM transaction_view WHERE SENDER_ACCOUNT = ? OR RECIPIENT_ACCOUNT = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"si\",$id,$id);\n\n return executeQueryPrepared($stmt, $connection);\n}", "public static function getAccountById($account_id){\n $stmt = Dbh::connect() ->PREPARE(\"SELECT * FROM accounts WHERE account_id=?\");\n $stmt->execute([$account_id]);\n $account = array();\n if($stmt->rowCount()){\n while ($row = $stmt->fetch()){\n $account = array(\"id\"=>$row['account_id'], \"email\"=>$row['email'], \"firstName\"=>$row['first_name'], \"lastName\"=>$row['last_name'],\n \"type\"=>$row['account_type'],\"password\"=>$row['password'],\"subscription\"=>$row['subscription']);\n }\n return $account;\n } else {\n\t\t\treturn false;\n\t\t}\n }", "public function CommissionFeeServiceAccordingVendor($type=\"STRIPE\",$account_status=0)\n{\n\t \n\t $orders = Auth::user()->ShopProductCartItemOfVendors;\n $arr =[];\n $account =[];\n\n\t foreach ($orders as $key => $value) {\n\n\t \n\t \t$amount = trim($value->getOrderOfSingleVendor->sum('total')); \n\n $account_id = $type == \"STRIPE\" ? $value->vendor->shop->stripe_account_id : $value->vendor->shop->paypal_email;\n $service_fee = $this->getServiceFee($amount);\n $commission_fee = $this->getCommissionFee($amount);\n\n\n $payable_amount = round($amount - ($service_fee + $commission_fee));\n\n $stripeAccountParams= (array)[\"amount\" => $payable_amount,\"stripe_account\" => $account_id];\n\n array_push($account, $stripeAccountParams);\n\n\t \t$arr[$value->vendor_id] = [\n 'vendor_id' => $value->vendor_id,\n 'total' => $this->getGrandTotal(),\n 'amount' => $amount,\n 'tax' => $this->getTax(),\n 'commission_fee' => $commission_fee,\n 'service_fee' => $service_fee,\n 'payable_amount' => $payable_amount,\n 'account_id' => $account_id,\n 'stripeAccountParams' => $stripeAccountParams\n\t \t];\n\n\n\t \t//array_push($arr[$value->vendor_id], $arr1);\n\t }\n\n\t return $account_status == 0 ? $arr : $account;\n \n}", "public function getAccounts();", "public function findAccounts() {\n\t\t\n\t}", "public function getAccountDetailsByaccountId($accountId)\n {\n $account = Account::where('id', $accountId)->first();\n if(!empty($account)) {\n return ([\n 'flag' => true,\n 'name' => $account->accountDetail->name,\n ]);\n } else {\n return ([\n 'flag' => false\n ]); \n }\n }", "function getAccounts() {\n $stmt = $this->pdo->query('SELECT * FROM get_accounts()');\n $accounts = [];\n while ($row = $stmt->fetch()) {\n $accounts[] = [\n 'id' => $row['id'],\n 'first_name' => $row['first_name'],\n 'last_name' => $row['last_name'],\n 'plan' => $row['plan'],\n 'effective_date' => $row['effective_date']\n ];\n }\n return $accounts;\n }", "public function getFinanceAccount($user_id = null,$payment_type = null)\n {\n $table = Engine_Api::_()->getDbtable('paymentAccounts', 'mp3music');\n $select = $table->select();\n \n if($user_id != null)\n {\n $select->where('user_id = ?',$user_id);\n }\n if($payment_type != null)\n {\n $select->where('payment_type = ?',$payment_type); \n }\n $accounts = $table->fetchAll($select)->toArray(); \n return @$accounts[0]; \n }", "function media_theplatform_mpx_get_accounts_select() {\n // Check for the signIn token.\n $mpx_token = media_theplatform_mpx_variable_get('token', NULL);\n if (!$mpx_token) {\n return t('There was an error with your request.');\n }\n // Get the list of accounts from thePlatform.\n $url = 'http://access.auth.theplatform.com/data/Account?schema=1.3.0&form=json&byDisabled=false&token=' . $mpx_token;\n $result = drupal_http_request($url);\n $result_data = drupal_json_decode($result->data);\n\n global $user;\n\n if (empty($result_data['entryCount']) || $result_data['entryCount'] == 0) {\n $log = array(\n 'uid' => $user->uid,\n 'type' => 'request',\n 'type_id' => NULL,\n 'action' => 'account',\n 'details' => '0 accounts returned.',\n );\n media_theplatform_mpx_insert_log($log);\n //return FALSE;\n drupal_set_message(t('The logged in user does not have the privilege to set the account.'), 'warning');\n return array();\n }\n $accounts = array();\n $accounts_data = array();\n\n foreach ($result_data['entries'] as $entry) {\n $title = $entry['title'];\n $key = rawurlencode($title);\n $accounts[$key] = $title;\n }\n $log = array(\n 'uid' => $user->uid,\n 'type' => 'request',\n 'type_id' => NULL,\n 'action' => 'account',\n 'details' => count($accounts) . ' accounts returned.',\n );\n media_theplatform_mpx_insert_log($log);\n // Sort accounts alphabetically.\n natcasesort($accounts);\n return $accounts;\n}", "protected function getAccountData()\n\t{\n\t\t$db = $this->getDatabase();\n\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select('*')\n\t\t\t\t->from('#__accountdata')\n\t\t\t\t->where('(w20_facebook <> \"\" OR w20_twitter <> \"\")')\n\t\t\t\t->where('typ = 0')\n\t\t\t\t// ->where('bid IN (2657)')\n\t\t\t\t->where('status = 0');\n\n\n\t\t$db->setQuery($query);\n\t\t$this->adata = $db->loadObjectList();\n\n\t\treturn $this->adata;\n\t}", "private function findAccountByOwner(string $type, int $id)\n {\n return Account::where([\n \"owner_id\" => $id,\n \"owner_type\" => $type\n ])->firstOrFail();\n }", "function getThirdPartyIDThirdPartyAccountAssignment($post_source_account,$status1,$DbConnection)\n {\n $third_party_account_id=array();\n $querydesaid=\"SELECT third_party_account_id from third_party_account_assignment WHERE admin_account_id='$post_source_account' and status='$status1'\";\n $resultdesaid=mysql_query($querydesaid,$DbConnection);\n while($row=mysql_fetch_object($resultdesaid))\n {\n $third_party_account_id[]=$row->third_party_account_id;\n }\n return $third_party_account_id; \n }", "public function get_account_data() {\n return array(\n 'accountId' => $this->accountId,\n 'email' => $this->email,\n 'firstName' => $this->firstName,\n 'lastName' => $this->lastName,\n 'type' => $this->type,\n 'subscription' => $this->subscription\n );\n }", "function transactions_by_type($type){\n\t\t$query = $this->db->query(\"SELECT * FROM transactions WHERE Trans = '$type';\");\n\t\treturn $query->result_array();\n\t}", "public function add_account($id,$balance){\n if(preg_match(\"/^[0-9]+$/\",$id) && preg_match(\"/^[-+]?[0-9]*\\.?[0-9]+$/\",$balance)){\n if(array_key_exists($id,$this->accounts)){\n return 4;\n }else{\n $account = new Account($id,$balance);\n $this->accounts[$account->id] = $account;\n return 0;\n }\n }else{\n return 3;\n }\n }", "function get_user_info($account_id)\n {\n // $query_avg_score=$this->db->query(\"SELECT AVG(score) AS score FROM xl_score WHERE target_id='{$account_id}'\");\n\n $query_avatar_url=$this->db->query(\"SELECT avatar_url AS avatar_url FROM xl_avatar WHERE account_id='{$account_id}'\");\n\n $query_account_info=$this->db->query(\"SELECT id,nickname,cellphone,sex,birthday,horoscope,status,register_user,type FROM xl_account WHERE id='{$account_id}'\");\n\n $arr = array();\n\n foreach($query_account_info->result_array() as $row)\n {\n array_push($arr,$row);\n }\n $user_info=array();\n\n if (count($arr)==0) \n {\n \n return $user_info;\n }\n\n $user_info=$arr[0];\n \n if ($query_avatar_url->num_rows()>0) \n {\n $arr_avatar = array();\n\n foreach($query_avatar_url->result_array() as $row)\n {\n array_push($arr_avatar,$row);\n }\n\n $user_avatar=$arr_avatar[0];\n\n }\n else\n {\n $user_avatar=array('avatar_url' => '', );\n\n }\n\n $user_info=array_merge($user_info, $user_avatar);\n // $user_info=array_merge($user_info,$user_score);\n\n return $user_info;\n \n\n }", "function getAccounts() {\n $stmt = $this->pdo->query('SELECT * FROM get_accounts()');\n $accounts = [];\n while ($row = $stmt->fetch()) {\n $accounts[] = [\n 'id' => $row['id'],\n 'first_name' => $row['first_name'],\n 'last_name' => $row['last_name'],\n 'plan' => $row['plan'],\n 'effective_date' => $row['effective_date']\n ];\n }\n return $accounts;\n }", "function get_pay_type_array() {\n $sql = \"SELECT id, name FROM \".TB_PREF.\"payroll_pay_type\";\n $result = db_query($sql, \"could not get pay rates\");\n $type_array = array();\n while($myrow = db_fetch($result)){\n\t$type_array[$myrow['id']] = $myrow['name'];\n }\n return $type_array;\n}", "public function getAccount();", "public function listAccountIds() //*\n\t{\n\t$this->errorLogging->logInfo(__CLASS__, __METHOD__, \"Called.\");\n\t\n\t$userGroup = $_SESSION[\"usergroup\"];\n\n\t$select_array = array(\n\t\"table\" => 'accounts', \n\t\"where\" => 'WHERE', \n\t\"columns\" => array(\n\t\"account_pk\",\n\t\"account_name\",),\n\t\"returns\" => array(\n\t\"accountPK\",\n\t\"accountName\"),\n\t\"conditions\" => array(\n\t\tarray(\n\t\t\"column\" => \"user_group\",\n\t\t\"operator\" => \"=\",\n\t\t\"value\" => \"$userGroup\",\n\t\t\"concat\" => \"\")\n\t),\n\t\"endingQuery\" => \"\"\n\t);\n\t\n\t$returnedArray = $this->dbConnection->ConstructSelect($select_array); //errors handled by dbase class\n\t$this->responseClass->apiResponse($returnedArray);\n\treturn true;\n\t}", "function get_account_type_by_date($group_id, $from_date, $to_date) {\n $CI = & get_instance();\n $CI->load->helper('traialbalance');\n $CI->load->model('account/report');\n $returnArr = get_opening_balance_cal_by_date($group_id, $from_date, $to_date);\n $opening_balance = 0;\n foreach ($returnArr as $row) {\n if ($row['account_type'] == 'Dr') {\n $opening_balance = $opening_balance + $row['opening_balance'];\n }\n if ($row['account_type'] == 'Cr') {\n $opening_balance = $opening_balance - str_replace('-', '', $row['opening_balance']);\n }\n }\n if ($opening_balance >= 0) {\n return 'Dr';\n }\n if ($opening_balance < 0) {\n return 'Cr';\n }\n}", "public static function getAllAccounts(){\n\t\t$stmt = Dbh::connect()->query(\"SELECT * FROM accounts\");\n\t\t$accounts = array();\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){\n $accounts[] = new Account($row['account_id'], $row['email'], $row['first_name'], $row['last_name'], $row['account_type'], $row['password']);\n }\n return $accounts;\n\t}", "private function managedAccountResponse($id)\n {\n return [\n 'id' => $id,\n 'currencies_supported' => [\n 'usd', 'aed', 'afn', '...',\n ],\n 'object' => 'account',\n 'business_name' => 'Stripe.com',\n 'bank_accounts' => [\n 'object' => 'list',\n 'total_count' => 0,\n 'has_more' => false,\n 'url' => '/v1/accounts/' . $id . '/bank_accounts',\n 'data' => [],\n ],\n 'verification' => [\n 'fields_needed' => [\n 'product_description',\n 'business_url',\n 'support_phone',\n 'bank_account',\n 'tos_acceptance.ip',\n 'tos_acceptance.date',\n ],\n 'due_by' => null,\n 'contacted' => false,\n ],\n 'tos_acceptance' => [\n 'ip' => null,\n 'date' => null,\n 'user_agent' => null,\n ],\n 'legal_entity' => [\n 'type' => null,\n 'business_name' => null,\n 'address' => [\n 'line1' => null,\n 'line2' => null,\n 'city' => null,\n 'state' => null,\n 'postal_code' => null,\n 'country' => 'US',\n ],\n 'first_name' => null,\n 'last_name' => null,\n 'additional_owners' => null,\n 'verification' => [\n 'status' => 'unverified',\n 'document' => null,\n 'details' => null,\n ],\n ],\n ];\n }", "function getDetailAllAcIDUIDNext($admin_id1,$DbConnection)\n{\n\t$query =\"SELECT account.account_id,account.user_id FROM account,account_detail USE INDEX(ad_acamdid) WHERE account.user_type='substation' AND account.status=1 and account.account_id=account_detail.account_id AND account_detail.account_admin_id='$admin_id1'\";\n\t$result = mysql_query($query,$DbConnection);\t\n\twhile($row = mysql_fetch_object($result))\n\t{\n\t\t/*$account_id_sub = $row->account_id;\n\t\t$user_id_sub = $row->user_id;*/\n\t\t\n\t\t$data[]=array('account_id_sub'=>$row->account_id,'user_id_sub'=>$row->user_id);\t\n\t}\n\treturn $data;\t\n}", "public function userAccountListJson2(){\n\t\t$user = loggedInUserData();\n\t\t$userID = $user['user_id'];\n\t\t\n\t\t$role \t= $user['role'];\n\n \n\t\t\n\t\t$limit = $this->input->get('length');\n\t\t$start = $this->input->get('start');\n\n\t\t$queryCount = $this->ledger_model->userAccountListCount2();\n\n\t\t$query = $this->ledger_model->userAccountList2($limit, $start);\n\t\t\n\t\t$draw = $this->input->get('draw');\n\n\t\t$data = [];\n\t\t$data['draw'] = $draw;\n\t\t$data['recordsTotal'] = $queryCount;\n\t\t$data['recordsFiltered'] = $queryCount;\n\t\tif($query -> num_rows() > 0) \n\t\t{\t\n\t\tforeach($query->result() as $r)\n\t\t{\n\t\t\t\n\t\t\tif ($r->tran_count != null)\n\t\t\t{\n\t\t\t\t$counts = $r->tran_count;\n\t\t\t}\n\n\t\t\t//Action Button\n\t\t\t$button = '';\n\t\t\t$button .= '<a class=\"btn btn-primary editBtn\" href=\"'.base_url('account/balancesheet_view/'. $r->id).'\" data-toggle=\"tooltip\" title=\"View\">\n\t\t\t\t\t\t<i class=\"fa fa-eye\"></i> </a>';\n\t\t\t//Get Decision who in online?\n if($user['role'] == 'admin')\n {\n\t\t//\t$button .= '<a class=\"btn btn-danger deleteBtn\" id=\"'.$r->id.'\" data-toggle=\"tooltip\" title=\"Delete\">\n\t\t//\t\t\t\t<i class=\"fa fa-trash\"></i> </a>';\n\t\t}\t\n\t\t\n\t\t\n\t\t\t\t$data['data'][] = array(\n\t\t\t\t$button,\n $counts,\n\t\t\t\tdate('d/m/Y h:i A', $r->created_at), //date format\n\t\t\t\tnumber_format($r->debit, 2),\t\n\t\t\t\tnumber_format($r->credit, 2),\t\n\t\t\t\tnumber_format($r->amount, 2),\t\t\n\t\t\t\t$r->points_mode,\t\t\t\t\t\n\t\t\t\t$r->tranx_id\n\t\t\t\t\n\t\t\t);\n\t\t\n\t\t}\n\t\t}\n\t\telse{\n\t\t\t$data['data'][] = array(\n\t\t\t\t'Offer Accounts are not yet updated' , '', '','', '','',''\n\t\t\t);\n\t\t\n\t\t}\n\t\techo json_encode($data);\t\t\n\n\t}", "public function getWhereAccounts($post_id) {\n $return = array();\n $get = array(\n //'limit' => 10,\n 'conditions' => array(array('post_id' => $post_id, 'scheduled' => 1)),\n //'fields' => array('', ''),\n //'order' => array('date'=>'desc')\n );\n //fb users\n $fbusers = $this->FcbUserPosts->find('all', $get);\n if (!empty($fbusers)) {\n foreach ($fbusers as $user) {\n $value = 'fcbuseredit-' . $user['FcbUserPosts']['fcb_uid'];\n array_push($return, $value);\n }\n }\n //fb pages\n $fbpages = $this->FcbPagePosts->find('all', $get);\n if (!empty($fbpages)) {\n foreach ($fbpages as $page) {\n $value = 'fcbpageedit-' . $page['FcbPagePosts']['fcb_uid'] . '-' . $page['FcbPagePosts']['fcb_page_id'];\n array_push($return, $value);\n }\n }\n //twitter\n $twitter = $this->TwUserPosts->find('all', $get);\n if (!empty($twitter)) {\n foreach ($twitter as $account) {\n $value = 'twuseredit-' . $account['TwUserPosts']['tw_uid'];\n array_push($return, $value);\n }\n }\n //return \n return $return;\n }", "function totalAmount_account() {\r\n global $date;\r\n $query = \"SELECT DISTINCT\r\n account AS Account,\r\n (\r\n (\r\n (\r\n SELECT IFNULL(SUM(amount), 0)\r\n FROM record\r\n WHERE acc = Account\r\n AND transaction_type = 'in'\r\n AND date BETWEEN\r\n (\r\n SELECT MIN(date)\r\n FROM record\r\n ) AND '{$date}'\r\n )\r\n +\r\n (\r\n SELECT IFNULL(SUM(amount), 0)\r\n FROM record\r\n WHERE to_acc = Account\r\n AND transaction_type = 'tr'\r\n AND date BETWEEN\r\n (\r\n SELECT MIN(date)\r\n FROM record\r\n ) AND '{$date}'\r\n )\r\n )\r\n -\r\n (\r\n (\r\n SELECT IFNULL(SUM(amount), 0)\r\n FROM record\r\n WHERE acc = Account\r\n AND transaction_type = 'ex'\r\n AND date BETWEEN\r\n (\r\n SELECT MIN(date)\r\n FROM record\r\n ) AND '{$date}'\r\n )\r\n +\r\n (\r\n SELECT IFNULL(SUM(amount), 0)\r\n FROM record\r\n WHERE from_acc = Account\r\n AND transaction_type = 'tr'\r\n AND date BETWEEN\r\n (\r\n SELECT MIN(date)\r\n FROM record\r\n ) AND '{$date}'\r\n )\r\n )\r\n ) AS Remain\r\n FROM account;\";\r\n return fetch($query);\r\n }", "public function getAmounts(): array{\r\n $amounts = array();\r\n $con = $this->db->getConnection();\r\n foreach(mysqli_query($con, 'SELECT * FROM amounts')as $key){ $amounts[$key['idamounts']] = $key['amount']; }\r\n return $amounts;\r\n $this->con->closeConnection();\r\n }", "public function UserCustomCaseAmount($account_id){\n $this->db->select('sum(reimburse_details.amount_total) as amount_total');\n $this->db->from('reimburse_details');\n $this->db->join('custom_case', 'custom_case.accountId=reimburse_details.ID_ACCOUNT AND custom_case.caseId=reimburse_details.case_id');\n $this->db->where('reimburse_details.ID_ACCOUNT', $account_id);\n $result = $this->db->get();\n return $result->result_array();\n }", "public function get_accounts(){\n $items = array();\n if( ! $this->is_connect() ){\n return array();\n }\n //$this->new_request( \"GET\", \"/accounts\" );//$this->is_connect() hace la petición de las cuentas\n $response = json_decode( $this->ironman->get_response_body(), true );\n $accounts = isset( $response['accounts'] ) ? $response['accounts'] : array();\n foreach( $accounts as $account ){\n $items[$account['id']] = $account['name'];\n }\n return $items;\n }", "private function accountType($accountPK) //*\n\t{\n\t$this->errorLogging->logInfo(__CLASS__, __METHOD__, \"Called.\");\n\t\t\n\t$select_array = array(\n\t\"table\" => 'accounts', \n\t\"where\" => 'WHERE', \n\t\"columns\" => array(\n\t\"account_type_pk\"),\n\t\"returns\" => array(\n\t\"accountTypePK\"),\n\t\"conditions\" => array(\n\t\tarray(\n\t\t\"column\" => \"account_pk\",\n\t\t\"operator\" => \"=\",\n\t\t\"value\" => \"$accountPK\",\n\t\t\"concat\" => \"\")\t\t\n\t),\n\t\"endingQuery\" => \"\"\n\t);\n\t\t\n\t$returnedArray = $this->dbConnection->ConstructSelect($select_array);\n\t\tif (is_array($returnedArray ))\n\t\t{\n\t\t$accountTypePK = $returnedArray[0][\"accountTypePK\"];\n\t\t}\n\t\telse\n\t\t{\n\t\t$accountTypePK = 5;\n\t\t}\n\treturn $accountTypePK;\n\t}", "public function getAccounts()\n {\n }", "function getAccounts($accounts){\n\t\techo '<div class = \"Accounts\">';\n\t\techo '<h2 class = \"Accounts\">Your Accounts:</h2>';\n\t\techo '<ul class = \"Accounts\">';\n\n\t\t//Echo out each account\n\t\tforeach ($accounts as $account) {\n\t\t\t//var_dump($account);\n\t\t\techo '<li><span class = \"Spacer\"><br /></span><span class = \"AccountName\">' . $account['name'] . ': </span><span class =\"AccountAmount\">$' . $account['amount'] . '</span></li>';\n\t\t\techo '<hr class =\"Accounts\">';\n\t\t}\n\n\t\techo '</ul><div class = \"largespacer\"></div>';\n\t\t$this->createAccountButton();\n\t\techo '</div>';\n\t\t//Returns true\n\t\treturn true;\n\t}", "public function UserInventoryCaseDetailAmount($account_id){\n $this->db->select('sum(reimburse_details.amount_total) as amount_total');\n $this->db->from('reimburse_details');\n $this->db->join('case_details_inventory', 'case_details_inventory.inventoryItemId=reimburse_details.order_id AND case_details_inventory.accountId=reimburse_details.ID_ACCOUNT AND case_details_inventory.caseId=reimburse_details.case_id');\n $this->db->where('reimburse_details.ID_ACCOUNT', $account_id);\n $result = $this->db->get();\n return $result->result_array();\n }", "protected function _loadAccountData() {\n\t\tif(check($this->_userid)) {\n\t\t\t$result = $this->db->queryFetchSingle(\"SELECT * FROM \"._TBL_MI_.\" WHERE \"._CLMN_MEMBID_.\" = ?\", array($this->_userid));\n\t\t\tif(!is_array($result)) return;\n\t\t\t$this->_accountData = $result;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(check($this->_username)) {\n\t\t\t$result = $this->db->queryFetchSingle(\"SELECT * FROM \"._TBL_MI_.\" WHERE \"._CLMN_USERNM_.\" = ?\", array($this->_username));\n\t\t\tif(!is_array($result)) return;\n\t\t\t$this->_accountData = $result;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(check($this->_email)) {\n\t\t\t$result = $this->db->queryFetchSingle(\"SELECT * FROM \"._TBL_MI_.\" WHERE \"._CLMN_EMAIL_.\" = ?\", array($this->_email));\n\t\t\tif(!is_array($result)) return;\n\t\t\t$this->_accountData = $result;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\treturn;\n\t}", "public function account_transaction($id) {\n $options = [\n 'projection' => [\n '_id' => 1,\n 'purchase_inv_id' => 1,\n 'subscription_cost' => 1,\n 'setup_cost' => 1,\n 'amount' => 1,\n 'package_type' => 1,\n 'payment_terms' => 1,\n 'createddate' => 1,\n 'expirydate' => 1,\n 'paid_status' => 1,\n 'txnID' => 1,\n 'ePGTxnID' => 1,\n 'currency' => 1,\n 'responsecode' => 1,\n 'response_msg' => 1,\n 'pay_mode' => 1,\n 'service_tax' => 1,\n 'service_tax_cost' => 1\n ]\n ];\n\n $query_result = $this->mongo_db->find(MDB_PACKAGE_INFO, ['_id' => (int) $id], $options);\n $result = (!empty($query_result) && isset($query_result[0])) ? $query_result[0] : array();\n return $result;\n }", "public function userAccountListJson(){\n\t\t$user = loggedInUserData();\n\t\t$userID = $user['user_id'];\n\t\t\n\t\t$role \t= $user['role'];\n\n \n\t\t\n\t\t$limit = $this->input->get('length');\n\t\t$start = $this->input->get('start');\n\n\t\t$queryCount = $this->ledger_model->userAccountListCount();\n\n\t\t$query = $this->ledger_model->userAccountList($limit, $start);\n\t\t\n\t\t$draw = $this->input->get('draw');\n\n\t\t$data = [];\n\t\t$data['draw'] = $draw;\n\t\t$data['recordsTotal'] = $queryCount;\n\t\t$data['recordsFiltered'] = $queryCount;\n\t\tif($query -> num_rows() > 0) \n\t\t{\t\n\t\tforeach($query->result() as $r)\n\t\t{\n\t\t\t//CPA Display\n\t\tif( $role != 'admin')\n\t\t{\tif ($r->points_mode == 'wallet')\n\t\t\t{\n\t\t\t\t$values = 'CPA';\n\t\t\t\n\t\t\tif ($r->tran_count != null)\n\t\t\t{\n\t\t\t\t$counts = $r->tran_count;\n\t\t\t}\n\n\t\t\t//Action Button\n\t\t\t$button = '';\n\t\t\t$button .= '<a class=\"btn btn-primary editBtn\" href=\"'.base_url('account/balancesheet_view/'. $r->id).'\" data-toggle=\"tooltip\" title=\"View\">\n\t\t\t\t\t\t<i class=\"fa fa-eye\"></i> </a>';\n\t\t\t//Get Decision who in online?\n if($user['role'] == 'admin')\n {\n\t\t//\t$button .= '<a class=\"btn btn-danger deleteBtn\" id=\"'.$r->id.'\" data-toggle=\"tooltip\" title=\"Delete\">\n\t\t//\t\t\t\t<i class=\"fa fa-trash\"></i> </a>';\n\t\t}\t\n\t\t\n\t\t\n\t\t\t\t$data['data'][] = array(\n\t\t\t\t$button,\n $counts,\n\t\t\t\tdate('d/m/Y h:i A', $r->created_at), //date format\n\t\t\t\tnumber_format($r->debit, 2),\t\n\t\t\t\tnumber_format($r->credit, 2),\t\n\t\t\t\tnumber_format($r->amount, 2),\t\t\n\t\t\t\t$values, //$r->points_mode,\t\t\t\t\t\n\t\t\t\t$r->tranx_id\n\t\t\t\t\n\t\t\t);\n\t\t}\n\t\t}else{\n\t\t\t\n\t\tif ($r->points_mode == 'wallet')\n\t\t\t{\n\t\t\t\t$values = 'CPA';\n\t\t\t}else{\n\t\t\t\t$values = $r->points_mode;\n\t\t\t}\n\t\t\tif ($r->tran_count != null)\n\t\t\t{\n\t\t\t\t$counts = $r->tran_count;\n\t\t\t}\n\n\t\t\t//Action Button\n\t\t\t$button = '';\n\t\t\t$button .= '<a class=\"btn btn-primary editBtn\" href=\"'.base_url('account/balancesheet_view/'. $r->id).'\" data-toggle=\"tooltip\" title=\"View\">\n\t\t\t\t\t\t<i class=\"fa fa-eye\"></i> </a>';\n\t\t\t//Get Decision who in online?\n if($user['role'] == 'admin')\n {\n\t\t//\t$button .= '<a class=\"btn btn-danger deleteBtn\" id=\"'.$r->id.'\" data-toggle=\"tooltip\" title=\"Delete\">\n\t\t//\t\t\t\t<i class=\"fa fa-trash\"></i> </a>';\n\t\t}\t\n\t\t\n\t\t\n\t\t\t\t$data['data'][] = array(\n\t\t\t\t$button,\n $counts,\n\t\t\t\tdate('d/m/Y h:i A', $r->created_at), //date format\n\t\t\t\tnumber_format($r->debit, 2),\t\n\t\t\t\tnumber_format($r->credit, 2),\t\n\t\t\t\tnumber_format($r->amount, 2),\t\t\n\t\t\t\t$values, //$r->points_mode,\t\t\t\t\t\n\t\t\t\t$r->tranx_id\n\t\t\t\t\n\t\t\t);\n\t\t}\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t}\n\t\telse{\n\t\t\t$data['data'][] = array(\n\t\t\t\t'CPA Accounts are not yet updated' , '', '','', '','',''\n\t\t\t);\n\t\t\n\t\t}\n\t\techo json_encode($data);\t\t\n\n\t}", "function mint_get_account($session, $token, $account_name) {\n // mint needs some info to log in\n $_post = array(\n \"input\" => '[' . json_encode(array(\n \"args\" => array(\n \"types\" => array(\"OTHER_PROPERTY\"),\n ),\n \"id\" => \"115485\",\n \"service\" => \"MintAccountService\",\n \"task\" => \"getAccountsSorted\", \n )) . ']',\n );\n $session->URLFetch(\"https://wwws.mint.com/bundledServiceController.xevent?token=\" . $token, $_post);\n $_obj = json_decode($session->response);\n \n // 115485 seems to be a magic/arbitrary number that mint labels the object in it's return json\n foreach ($_obj->response->{115485}->response as $account) {\n if ($account->name == $account_name) {\n return $account->accountId;\n }\n }\n Debug::trace('could not find an account named ' . $account_name . ' in your mint.com account');\n}", "function get_invested_accounts($tid)\n\t{\n\t return $this->db->select()\n\t\t ->from('pamm_accounts') \n\t\t ->where(\"login IN (select pamm_invested_accounts_login FROM pamm_invested_accounts WHERE pamm_invested_accounts_tid=$tid)\")\n\t\t ->where(\"pamm_accounts.active !='4'\")\t\n\t\t ->get()->result();\n\t}", "public function getAccountCode();", "public function getAccountCode();", "function getAccounts(){\n\t\t// Get staff members from urlms\n\t\t$accounts = $this->urlms->getLab_index(0)->getFundingAccounts();\n\t\t$count = 0;\n\t\t// for each account, display its name and its balance\n\t\tforeach ($accounts as $a){\n\t\t\techo $a->getType() . \" \" . number_format($a->getBalance(), 2, \".\" , \",\" ) . \"<br>\";\n\t\t\t$count ++;\n\t\t}?>\n\t\t<html>\n\t\t\t<div class=\"container\">\n\t\t\t\t<div class=\"row\">\n\t\t\t\t\t<div class=\"col-sm-2\">\n\t\t\t\t\t\t<a href=\"../view/FundingView.php\" style=\"color: white; text-decoration: none;\">\n\t\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-danger\" data-toggle=\"tooltip\"\n\t\t\t\t\t\t\tdata-placement=\"bottom\" title=\"Go back to homepage\">Back</button>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</html><?php \n\t\treturn $count;\n\t}", "function get_begin_saldo_account()\n {\n $this->db->select('accounts.id, accounts.currency, accounts.name, accounts.alias, accounts.code, accounts.classification_id');\n $this->db->from('accounts,classifications');\n $this->db->where('accounts.classification_id = classifications.id');\n \n $names = array('harta', 'modal', 'kewajiban');\n $this->db->where_in('classifications.type', $names);\n $this->db->where('accounts.deleted', NULL);\n \n $this->db->order_by('accounts.code','asc');\n return $this->db->get(); \n }", "function pagelines_account_array( ){\n\n\t$d = array(\n\t\n\t\t'Your_Account'\t\t=> array(\n\t\t\t'icon'\t\t\t=> PL_ADMIN_ICONS.'/rocket-fly.png',\n\t\t\t'credentials' \t=> array(\n\t\t\t\t'version'\t=> 'pro',\n\t\t\t\t'type'\t\t=> 'updates_setup',\n\t\t\t\t'title'\t\t=> __( 'Configure PageLines Account &amp; Auto Updates', 'pagelines' ),\n\t\t\t\t'shortexp'\t=> __( 'Get your latest updates automatically, direct from PageLines.', 'pagelines' ),\n\t\t\t\t'layout'\t=> 'full',\n\t\t\t)\n\t\t),\n\t\t'Import-Export'\t\t=> array(\n\t\t\t'icon'\t\t\t=> PL_ADMIN_ICONS.'/extend-inout.png',\n\t\t\t'import_set'\t=> array(\n\t\t\t\t'default'\t=> '',\n\t\t\t\t'type'\t\t=> 'import_export',\n\t\t\t\t'layout'\t=> 'full',\n\t\t\t\t'title'\t\t=> __( 'Import/Export PageLines Settings', 'pagelines' ),\t\t\t\t\t\t\n\t\t\t\t'shortexp'\t=> __( 'Use this form to upload PageLines settings from another install.', 'pagelines' ),\n\t\t\t)\n\t\t)\n\t);\n\n\treturn apply_filters( 'pagelines_account_array', $d ); \n}", "function obtain_accounts_to_correct()\n\t{\n\t return $this->db->select('pamm_accounts.login,pamm_tp.failed_divide,pamm_tp.id')\n\t\t ->from('pamm_accounts')\n\t\t ->join('pamm_tp', 'pamm_accounts.login=pamm_tp.number', 'left')\n\t\t ->where('pamm_tp.failed_divide','1') \n\t\t ->where(\"pamm_accounts.active IN ('1','3','5')\")\n\t\t ->order_by('pamm_tp.id','DESC')\n\t\t ->limit(1)\n\t\t ->get()->result();\n\t}", "public function getAccountID();", "function get_accounts($user_id) {\n\t if ($this->ensure_portal() != -1) {\n\t\t $this->login();\n\t\t\t$ger_params = array(\n\t\t\t 'session' => $this->session,\n\t\t\t 'module_name' => 'Contacts',\n\t\t\t 'module_id' => $user_id,\n\t\t\t 'link_field_name' => 'accounts',\n\t\t\t 'related_module_query' => '',\n\t\t\t 'related_fields' => array(\n\t\t\t 'id',\n\t\t\t 'name',\n\t\t\t ),\n\t\t\t 'related_module_link_name_to_fields_array' => array(\n\t\t\t ),\n\t\t\t 'deleted'=> '0',\n\t\t\t 'order_by' => '',\n\t\t\t 'offset' => 0,\n\t\t\t 'limit' => 5,\n\t\t );\n\n\t\t $ger_result = $this->call(\"get_relationships\", $ger_params);\n\t\t $accounts = [];\n\n\t\t foreach($ger_result->entry_list as $entry) {\n\t\t \t$id = $entry->name_value_list->id->value;\n\t \t\t$name = $entry->name_value_list->name->value;\n\t \t\t$accounts[]= array(\"id\" => $id, \"name\" => $name);\n\t \t}\n\t \treturn $accounts;\n\t } else {\n\t $this->kick();\n\t }\n\t}", "function cases_by_account($account_id) {\n\t $this->login();\n\t\tif ($this->ensure_portal() != -1) {\n\t\t\t$gel_parameters = array(\n\t\t\t\t\"session\" => $this->session,\n\t\t\t\t\"module_name\" => \"Cases\",\n\t\t\t\t\"query\" => \" cases.account_id = '\" . $account_id . \"' \",\n\t\t\t\t\"order_by\" => \" cases.case_number DESC \",\n\t\t\t\t\"offset\" => 0,\n\t\t\t\t\"select_fields\" => array(),\n\t\t\t\t\"link_name_to_fields_array\" => array(),\n\t\t\t\t\"max_results\" => 100,\n\t\t\t\t\"deleted\" => 0,\n\t\t\t\t\"favorites\" => false,\n\t\t );\n\n\t\t $gel_results = $this->call(\"get_entry_list\", $gel_parameters);\n\n\t\t $cases = [];\n\n\t\t foreach($gel_results->entry_list as $entry) {\n\t\t $id = $entry->name_value_list->id->value;\n\t\t $name = $entry->name_value_list->name->value;\n\t\t $number = $entry->name_value_list->case_number->value;\n\t\t $cases[]= array(\"id\" => $id, \"name\" => $name, \"number\" => $number);\n\t\t }\n\n usort($cases, \"sort_cases\");\n\n\t\t return $cases;\n\t\t} else {\n\t\t\t$this->kick();\t\n\t\t}\n\t}", "public function getAccount($account_id)\n\t{\n\t\t$arr = DB::select('SELECT * FROM accounts WHERE account_id = ?', [$account_id]); \n\n\t\tif ($arr[0]) {\n\t\t\treturn $arr[0];\n\t\t} else {\n\t\t\treturn ['status' => 'error', 'error' => 'Ups!!! No accounts.'];\n\t\t}\n\t}", "function importSpecific( $tmpTable, $record)\n\t{\n\t\t// if not record goes with current user\n\t\tif( strlen($record['user_id']) == 0 || $GLOBALS['appshore']->rbac->checkPermissionOnUser($this->appRole, $record['user_id']) == false )\n\t\t\t$record['user_id'] = $GLOBALS['appshore_data']['current_user']['user_id'];\n\n\t\t// check if main account exist\n\t\tif( $record['account_top_id'])\n\t\t{\t\t\t\n\t\t\t$account_top = getOneAssocArray( 'select account_id from accounts where account_id = \"'.$record['account_top_id'].'\" limit 1');\n\t\t\t\t\n\t\t\tif( !isset($account_top['account_id']) )\n\t\t\t\tunset($record['account_top_id']); // we do not set main account if it does not exist already\n\t\t}\t\t\n\t\t\n\t\t// if a main account name is defined but no main account id we check if we find a match else we ignore it\n\t\tif( $record['account_top_name'] && !isset($record['account_top_id']))\n\t\t{\t\t\t\n\t\t\t$account_top = getOneAssocArray( 'select account_id from accounts where account_name = \"'.$record['account_top_name'].'\" limit 1');\n\t\t\t\t\n\t\t\tif( isset($account_top['account_id']) )\n\t\t\t\t$record['account_top_id'] = $account_top['account_id'];\n\t\t}\n\t\t\t\t\t\t\n\t\t// check if account exist\n\t\tif ( $this->isUnique['account_name'] == 'Y' )\n\t\t{\n\t\t\t$account = getOneAssocArray( 'select * from accounts where lower(account_name) = \"'.strtolower($record['account_name']).'\" limit 1');\t\n\t\t\t\n\t\t\tif( isset($account['account_id']) )\n\t\t\t{\t\n\t\t\t\t$this->specific['Accounts']['rejected']++;\n\t\t\t\treturn ERROR_INSERT_DUPLICATED_VALUE;\n\t\t\t}\n\n\t\t\t$record['account_id'] = $account['account_id'];\n\t\t}\n\t\n\t\t// we create a new account\n\t\tif( ($account['account_id'] = insertRow( 'accounts', 'account_id', $record, true)) == NULL )\n\t\t{\n\t\t\t$this->specific['Accounts']['rejected']++;\n\t\t\treturn ERROR_INSERT;\n\t\t}\n\n\t\t$this->specific['Accounts']['created']++;\n\t\treturn true;\n\t}", "function createAccount($sfConn, $dataArray){\n\t\techo(\"<P> createAccount <P>\");\n $sObjects = array();\n foreach ($dataArray as $fieldset)\n {\n\t\techo(\"<P> Set records to Account <P>\");\n $sObject = new sObject();\n $sObject->type = 'Account'; \n $sObject->fields = $fieldset;\n array_push($sObjects, $sObject);\n\t\t\t\t\necho(\"<P> ACCOUNT DETAILS- type: \" . $sObject->type . \n\t\t\" Dealer: \" . $fieldset['Dealer_Number__c'] . \n\t\t\" Name: \" . $fieldset['Name'] . \n\t\t\t\t\t\t\t\" Owner ID: \" . $fieldset['OwnerId'] .\n\t\t\t\t\t\t\t\" Phone \" . $fieldset['Phone'] .\n\t\t\t\t\t\t\t\" Dealer Auction Access: \" . $fieldset['Dealer_Auction_Access_Number__c'] .\n\t\t\t\t\t\t\t\" Dealer_Status__c: \" . $fieldset['Dealer_Status__c'] .\n\t\t\t\t\t\t\t\" IAA_Territory__c: \" . $fieldset['IAA_Territory__c'] .\n\t\t\t\t\t\t\t\" ID: \" . $sObject->Id .\n\t\t\"\");\n\t\t\n }\n\t\techo(\"<P> Ready to roll <P>\");\n $success = create_multiple($sfConn, $sObjects);\n return $success; \n }", "function get_products_for_accounts($accounts)\n{\n module_load_include('module', 'ppt_ta_access', 'ppt_ta_access');\n // Looping over each account and load it.\n $products = [];\n if (empty($accounts)) {\n return $products;\n }\n foreach ($accounts as $account) {\n\n $account_wrapper = entity_metadata_wrapper('node', node_load($account));\n $account_products = $account_wrapper->field_products->value();\n\n // Loop over products, add the product if it isn't already in array.\n foreach ($account_products as $account_product) {\n if ($account_product) {\n if (!in_array($account_product->tid, $products) && ppt_ta_term_access($account_product)) {\n array_push($products, $account_product->tid);\n }\n }\n }\n }\n\n return $products;\n}", "function getUserAmountDetails($user_id)\n\t\t{\n\t\t\t//defining variable\n\t\t\t$total_earning = 0;\n\t\t\t$total_withdraw = 0;\n\t\t\t//getting values of user money\n\t\t\t$userMoney = $this->manageContent->getValueMultipleCondtn('user_money_info', '*', array('user_id'), array($user_id));\n\t\t\tif(!empty($userMoney[0]))\n\t\t\t{\n\t\t\t\tforeach($userMoney as $money)\n\t\t\t\t{\n\t\t\t\t\tif(!empty($money['credit_amount']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$total_earning = $total_earning + $money['credit_amount'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($money['debit_amount']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$total_withdraw = $total_withdraw + $money['debit_amount'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$net_amount = $total_earning - $total_withdraw;\n\t\t\t\n\t\t\treturn array($total_earning,$total_withdraw,$net_amount);\n\t\t}", "function get_wallet($id_trader) \n\t{\n\t\treturn $this->db->select('USD,EUR,GBP,JPY,CHF,TRY,RUR')\n\t\t->where('id',$id_trader)\n\t\t->get('investroom_personal_accounts')->row();\n\t}", "public function get_manage_pamm_accounts($id_trader)\n\t{\n\t return $this->db->select()\n\t\t->from('pamm_accounts')\n\t\t->where('tid', $id_trader)\t\n\t\t->where(\"active !='4'\")\t\n\t\t->get()->result();\n\t\t\n\t}", "public function getCorpoAdminAccountPaymentAllInfo($id, $accountId, $moduleId)\n {\n $dealInfo = $this->em->getRepository('CorporateBundle:CorpoAccountTransactions')->getAccountTransactionPaymentAllInfo($id, $accountId, $moduleId);\n return $dealInfo;\n }", "function get_franchise_account_stat_byid($fid)\r\n\t{\r\n\t\t$det = array();\r\n\t\t\r\n\t\t$ordered_tilldate = @$this->db->query(\"select round(sum((i_orgprice-(i_coup_discount+i_discount))*b.quantity),2) as amt \r\n\t\t\tfrom king_transactions a \r\n\t\t\tjoin king_orders b on a.transid = b.transid \r\n\t\t join pnh_m_franchise_info c on c.franchise_id = a.franchise_id \r\n\t\t\twhere a.franchise_id = ? \",$fid)->row()->amt;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t$not_shipped_amount = $this->db->query(\" select sum(t) as amt from (\r\n\t\t\t\t\t\t\t\t\t\t\tselect a.invoice_no,debit_amt as t \r\n\t\t\t\t\t\t\t\t\t\t\t\tfrom pnh_franchise_account_summary a \r\n\t\t\t\t\t\t\t\t\t\t\t\tjoin king_invoice c on c.invoice_no = a.invoice_no and invoice_status = 1 \r\n\t\t\t\t\t\t\t\t\t\t\t\twhere action_type = 1 \r\n\t\t\t\t\t\t\t\t\t\t\t\tand franchise_id = ? \r\n\t\t\t\t\t\t\t\t\t\t\tgroup by a.invoice_no ) as a \r\n\t\t\t\t\t\t\t\t\t\t\tjoin shipment_batch_process_invoice_link b on a.invoice_no = b.invoice_no and shipped = 0 \",$fid)->row()->amt;\r\n\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t$total_invoice_val = $this->db->query(\"select sum(debit_amt) as amt from pnh_franchise_account_summary where action_type = 1 and franchise_id = ? \",$fid)->row()->amt;\r\n\t\t$total_invoice_cancelled_val = $this->db->query(\"select sum(credit_amt) as amt from pnh_franchise_account_summary where action_type = 1 and franchise_id = ? \",$fid)->row()->amt;\r\n\t\t\t\r\n\t\t\t$sql = \"select sum(credit_amt) as amt \r\n\t\t\t\t\t\tfrom pnh_franchise_account_summary a\r\n\t\t\t\t\t\tjoin pnh_t_receipt_info b on a.receipt_id = b.receipt_id \r\n\t\t\t\t\t\twhere action_type = 3 and a.franchise_id = ? and a.receipt_type = 1 and a.status = 1 and b.status = 1 \r\n\t\t\t\t\t\";\r\n\t\t$total_active_receipts_val = $this->db->query($sql,array($fid))->row()->amt ;\r\n\t\t\t\r\n\t\t\t$sql = \"select sum(receipt_amount) as amt \r\n\t\t\t\t\t\t\tfrom pnh_t_receipt_info \r\n\t\t\t\t\t\t\twhere franchise_id = ? \r\n\t\t\t\t\t\t\tand status in (2,3) and is_active = 1 \r\n\t\t\t\t\t\";\r\n\t\t\t\t\t \r\n\t\t$total_cancelled_receipts_val = $this->db->query($sql,array($fid))->row()->amt;\r\n\t\t\t\r\n\t\t$sql = \"select sum(receipt_amount) as amt \r\n\t\t\t\t\t\t\tfrom pnh_t_receipt_info \r\n\t\t\t\t\t\t\twhere franchise_id = ? and status = 0 and receipt_type = 1 \r\n\t\t\t\t\t\";\r\n\t\t\t\t\t \r\n\t\t$total_pending_receipts_val = $this->db->query($sql,array($fid))->row()->amt;\r\n\t\t\t\r\n\t\t$sql = \"select sum(credit_amt-debit_amt) as amt \r\n\t\t\t\t\t\tfrom pnh_franchise_account_summary where action_type = 5 and franchise_id = ? \";\r\n\t\t$acc_adjustments_val = $this->db->query($sql,array($fid))->row()->amt;\r\n\t\t\r\n\t\t/*\r\n\t\t$sql = \"select sum(credit_amt-debit_amt) as amt \r\n\t\t\t\t\t\t\tfrom pnh_franchise_account_summary where action_type = 7 and franchise_id = ? \";\r\n\t\t$ttl_credit_note_val = $this->db->query($sql,array($fid))->row()->amt;\r\n\t\t */ \r\n\t\t\r\n\t\t$sql = \"select (sum(credit_amt)-sum(debit_amt)) as amt from ((\r\nselect statement_id,type,count(a.invoice_no) as invoice_no,sum(credit_amt) as credit_amt,sum(debit_amt) as debit_amt,date(a.created_on) as action_date,concat('Total ',count(a.invoice_no),' IMEI Activations') as remarks \r\n\t\tfrom pnh_franchise_account_summary a \r\n\t\tjoin t_invoice_credit_notes b on a.credit_note_id = b.id \r\n\t\twhere action_type = 7 and type = 2 \r\n\t\tand a.franchise_id = ? \r\n\t\t \r\n\tgroup by action_date \t\r\n)\r\nunion\r\n(\r\nselect statement_id,1 as type,(a.invoice_no) as invoice_no,sum(credit_amt) as credit_amt,sum(debit_amt) as debit_amt,date(a.created_on) as action_date,remarks\r\n\t\tfrom pnh_franchise_account_summary a \r\n\t\tjoin t_invoice_credit_notes b on a.invoice_no = b.invoice_no \r\n\t\twhere action_type = 7 and type = 1 \r\n\t\tand a.franchise_id = ? \r\n\t\t \r\n\t group by statement_id \r\n)\r\n) as g \r\norder by action_date\";\r\n\t\t$ttl_credit_note_val = $this->db->query($sql,array($fid,$fid))->row()->amt; \r\n\t\t\r\n\t\t$total_active_invoiced = ($total_invoice_val-$total_invoice_cancelled_val);\r\n\t\t\r\n\t\t$data['net_payable_amt'] = ($total_active_invoiced-($total_active_receipts_val+$acc_adjustments_val+$ttl_credit_note_val));\r\n\t\t\r\n\t\t$data['shipped_tilldate'] = $total_active_invoiced-$not_shipped_amount; \r\n\t\t$data['credit_note_amt'] = $ttl_credit_note_val;\r\n\t\t$data['paid_tilldate'] = $total_active_receipts_val;\r\n\t\t$data['uncleared_payment'] = $total_pending_receipts_val;\r\n\t\t$data['cancelled_tilldate'] = $total_cancelled_receipts_val;\r\n\t\t$data['ordered_tilldate'] = $ordered_tilldate;\r\n\t\t$data['not_shipped_amount'] = $not_shipped_amount;\r\n\t\t$data['acc_adjustments_val'] = $acc_adjustments_val;\r\n\t\t$data['current_balance'] = ($data['shipped_tilldate']-$data['paid_tilldate']+$data['acc_adjustments_val']-$data['credit_note_amt'])*-1;\r\n\t\t\r\n\t\t$payment_pen = ($data['shipped_tilldate']-$data['paid_tilldate']+$data['acc_adjustments_val']);\r\n\t\t$data['pending_payment'] = ($payment_pen<0)?0:$payment_pen;\r\n\t\t\t\r\n\t\treturn $data;\t\r\n\t}", "public function getAccountType()\n {\n return $this->account_type;\n }", "public function getAccountType()\n {\n return $this->account_type;\n }", "public function getAccountType()\n {\n return $this->account_type;\n }", "public function hasMultipleAccounts();", "public function index($type)\n {\n\n $organization_id = Session::get('organization_id'); \n\n if($type != 'vendor' && $type != 'customer' && $type != 'wms-customer') abort(403);\n\n if($type == 'wms-customer') $name = 'customer'; else $name = $type;\n\n $person_type_id = AccountPersonType::where('name', $name)->first()->id;\n\n $title = PeopleTitle::pluck('display_name','id');\n $title->prepend('Title','');\n\n $country = Country::where('name', 'India')->first();\n\n $state = State::where('country_id', $country->id)->pluck('name', 'id');\n $state->prepend('Select State', '');\n\n $payment = PaymentMethod::where('organization_id', Session::get('organization_id'))->pluck('display_name','id');\n $payment->prepend('Select Payment Method','');\n\n $terms = Term::select('id', 'display_name')->where('organization_id', Session::get('organization_id'))->pluck('display_name', 'id');\n $terms->prepend('Select Term','');\n\n if($name == 'vendor') {\n\n $purchases = AccountVoucher::where('name', 'purchases')->where('organization_id', $organization_id)->first()->id;\n\n $transaction_type = [$purchases];\n } \n else if($name == 'customer') \n { \n $sale = AccountVoucher::where('name', 'sales')->where('organization_id', $organization_id)->first()->id;\n\n $sale_cash = AccountVoucher::where('name', 'sales_cash')->where('organization_id', $organization_id)->first()->id;\n\n $transaction_type = [$sale, $sale_cash];\n }\n\n $sale = AccountVoucher::where('name', 'sales')->where('organization_id', $organization_id)->first()->id;\n\n $sale_cash = AccountVoucher::where('name', 'sales_cash')->where('organization_id', $organization_id)->first()->id;\n\n \n $peoples = People::select('people.id', 'people.person_id', 'people.first_name', 'people.display_name','people.mobile_no','people.status', 'people.email_address', 'persons.crm_code', 'businesses.bcrm_code', \n DB::raw('IF(SUM(transactions.total) IS NULL, SUM(business.total), SUM(transactions.total)) AS total'),\n DB::raw('IF(persons.crm_code IS NULL, businesses.bcrm_code, persons.crm_code) AS crm_id'),\n DB::raw('CONCAT(COALESCE(people.first_name, \"\"), \" \" ,COALESCE(people.last_name, \"\")) AS contact_person'), \n DB::raw('IF(account_ledger_credit_infos.max_credit_limit IS NULL, business_ledger_credit_infos.max_credit_limit, account_ledger_credit_infos.max_credit_limit) AS max_credit_limit'),\n 'people.group_id','customer_gropings.display_name as group_name'\n )\n ->leftJoin('people_person_types', 'people_person_types.people_id','=','people.id')\n ->leftJoin('persons', 'persons.id','=','people.person_id')\n ->leftJoin('businesses', 'businesses.id','=','people.business_id')\n\n ->leftJoin('transactions', function($query) use($transaction_type) {\n $query->on('transactions.people_id','=','people.person_id');\n $query->whereIn('transactions.transaction_type_id', $transaction_type);\n })\n ->leftJoin('transactions AS business', function($query) use($transaction_type){\n $query->on('business.people_id','=','people.business_id');\n $query->whereIn('transactions.transaction_type_id', $transaction_type);\n })\n\n ->leftJoin('account_ledgers', function($join) use($organization_id)\n {\n $join->on('people.person_id', '=', 'account_ledgers.person_id')\n ->where('account_ledgers.organization_id', $organization_id);\n })\n ->leftjoin('account_ledger_credit_infos','account_ledgers.id','=','account_ledger_credit_infos.id')\n\n ->leftJoin('account_ledgers AS business_ledgers', function($join) use($organization_id)\n {\n $join->on('people.business_id', '=', 'business_ledgers.business_id')\n ->where('business_ledgers.organization_id', $organization_id);\n })\n ->leftjoin('account_ledger_credit_infos AS business_ledger_credit_infos','business_ledgers.id','=','business_ledger_credit_infos.id')\n ->leftjoin('customer_gropings','customer_gropings.id','=','people.group_id')\n\n ->where('people.organization_id', $organization_id)\n ->where('people_person_types.person_type_id', $person_type_id)\n ->groupBy('people.id')\n ->orderBy('people.first_name')\n ->get();\n \n\n $group_name = CustomerGroping::where('organization_id', $organization_id)->pluck('name', 'id');\n $group_name->prepend('Select Group Name', '');\n\n return view('inventory.contact', compact('peoples','name', 'title', 'state', 'payment', 'terms', 'type','group_name'));\n }", "public function actionFind_extra_data() {\n $_loanItems = LoanItem::model()->findAll();\n foreach ($_loanItems as $_loanItem) {\n $_ids[] = $_loanItem->id;\n }\n $_model = new CashAccount();\n $criteria = new CDbCriteria();\n $criteria->condition = \"loan_payment_id IS NOT NULL\";\n $criteria->addNotInCondition(\"loan_payment_id\", $_ids);\n $_dataset = $_model->findAll($criteria);\n echo count($_dataset);\n AppHelper::pr($_dataset);\n exit;\n }", "public function getAccountTypes()\n {\n return AccountTypes::all();\n }", "public function masterSummary($account_id) {\n\n $this->db->where(array('account_id' => $account_id, 'account_type' => 1));\n $rs = $this->db->get('accounts')->result();\n $total = count($rs);\n\n $where = array('account_id' => $account_id, 'active' => 1, 'account_type' => 1);\n $this->db->where($where);\n $res = $this->db->get('accounts')->result();\n $enable = count($res);\n $disable = $total - $enable;\n\n $summary = array();\n $summary[] = array(\n 'live' => $enable,\n 'disable' => $disable\n );\n return $summary;\n }", "function getAccountId($account_name)\n\t{\n\t\t global $log;\n $log->info(\"in getAccountId \".$account_name);\n\t\tglobal $adb;\n\t\tif($account_name != '')\n\t\t{\n\t\t\t$sql = \"select accountid from ec_account where accountname='\".$account_name.\"'\";\n\t\t\t$result = $adb->query($sql);\n\t\t\t$accountid = $adb->query_result($result,0,\"accountid\");\n\t\t}\n\t\treturn $accountid;\n\t}", "public function getAccountDetails(): array\n {\n $response = $this->prepareHttpClient('/mailer/account-details')\n ->send();\n\n $xml = new SimpleXMLElement($this->parseResponse($response));\n return [\n 'id' => (string) $xml->attributes()->id,\n 'credit' => (float) $xml->credit,\n ];\n }", "function employeeAccountTypes(){\n return array(\n 'SKYPE',\n 'FACEBOOK',\n 'GMAIL',\n 'YAHOO',\n 'HOTMAIL',\n 'MICROSOFT',\n );\n}", "function updateAccount($sfConn, $dataArray){\n\t\techo(\"<P> updateAccount \");\n $sObjects = array();\n foreach ($dataArray as $fieldset)\n {\n\t\t\t\techo(\"<P> Set records to Account \");\n $sObject = new sObject();\n $sObject->type = 'Account'; \n $sObject->fields = $fieldset;\n array_push($sObjects, $sObject);\n }\n\t\techo(\"<P> Ready to roll \");\n $success = update_objects($sfConn, $sObjects);\n return $success; \n }", "function arr_one($account){\n\t\t$check_login = check_login($account);\n\t\t$arr = mysqli_fetch_assoc($check_login);\n\t\treturn $arr;\n\t}", "public function saveFinanceAccount($account)\n {\n if(isset($account['paymentaccount_id']) && $account['paymentaccount_id']>0)\n {\n //update info of this account\n $table = Engine_Api::_()->getDbtable('paymentAccounts', 'mp3music');\n $data = array(\n 'account_username' => $account['account_username']\n );\n $where = $table->getAdapter()->quoteInto('paymentaccount_id = ?', $account['paymentaccount_id']);\n $table->update($data, $where);\n }\n else\n {\n $acc = Engine_Api::_()->getDbtable('paymentAccounts', 'mp3music')->createRow(); \n $acc->account_username = $account['account_username'];\n $acc->payment_type = $account['payment_type'];\n $acc->total_amount = 0;\n $acc->account_status = 1;\n $acc->user_id = Engine_Api::_()->user()->getViewer()->getIdentity();\n $acc->save();\n\n }\n return $account;\n }", "public function get_all_balance($id)\n {\n if($id==0){\n $q=$this->db->where(['admin_id'=>1])->get('admin');\n $bal=$q->result_array()[0]['admin_chips'];\n }else if($id>999){\n $q=$this->db->where(['client_id'=>$id])->get('clients');\n $bal=$q->result_array()[0]['client_balance'];\n }else{\n $q=$this->db->where(['dist_id'=>$id])->get('distributor');\n $bal=$q->result_array()[0]['dist_balance'];\n }\n return $bal;\n }", "public function UserInventoryCaseDetail($account_id){\n $this->db->select('count(case_details_inventory.inventoryItemId) as inventoryItemId');\n $this->db->where('case_details_inventory.accountId ', $account_id);\n $this->db->where('case_details_inventory.status', '1');\n $result = $this->db->get('case_details_inventory');\n return $result->result_array();\n }", "public static function getAccount(string $type, int $id = 0) {\n $account = self::query($type, $id);\n if (!$account) {\n $account = self::createAccount($type, $id);\n }\n return $account;\n }", "function getTpaUidNameAr($account_id,$DbConnection)\n{\n\t$querydesaid=\"SELECT third_party_account_assignment.third_party_account_id,account.user_id,account_detail.name FROM third_party_account_assignment USE INDEX(tpaa_aaid_status),account,account_detail \n\tWHERE third_party_account_assignment.admin_account_id='$account_id' and third_party_account_assignment.status=1 \n\t AND account.account_id=third_party_account_assignment.third_party_account_id AND account_detail.account_id=account.account_id and account.status=1\";\n\t//echo\"query=\".$querydesaid.\"<br>\";\n\t$resultdesaid=mysql_query($querydesaid,$DbConnection);\n\t$numRows=mysql_num_rows($resultdesaid);\n\tif($numRows>0)\n\t{\n\t\twhile($row=mysql_fetch_object($resultdesaid))\n\t\t{\t\t\n\t\t\t//$tid=$row->third_party_account_id;\n\t\t\t//$tuser_id=$row->user_id;\n\t\t\t//$tname=$row->name;\n\t\t\t//$selectionbox.=\"<option value='$tid'>$tname($tuser_id)</option>\";\n\t\t\t//echo $tname.\"<br>\";\n\t\t\t$data[]=array('tid'=>$row->third_party_account_id,'tuser_id'=>$row->user_id,'tname'=>$row->name);\n\t\t\t\n\t\t}\n\t\treturn $data;\n\t}\n\telse\n\t{\n\t\t$data[]=array();\n\t\treturn $data;\n\t}\n}", "public function get_transaction_lists($user_id = '', $type = '', $fieldArr = array()) {\n if ($user_id != '' && $type != '') {\n $this->mongo_db->select($fieldArr);\n switch ($type) {\n case 'all':\n $where_clause = array(\"user_id\" => MongoID($user_id));\n break;\n case 'credit':\n $where_clause = array(\"transactions.$.type\" => 'CREDIT', \"user_id\" => MongoID($user_id));\n break;\n case 'debit':\n $where_clause = array(\"transactions.$.type\" => 'DEBIT', \"user_id\" => MongoID($user_id));\n break;\n default:\n $where_clause = array(\"user_id\" => MongoID($user_id));\n break;\n }\n $this->mongo_db->where($where_clause, TRUE);\n $res = $this->mongo_db->get(WALLET);\n return $res;\n }\n }", "public function find($bankAccountId): array\n {\n return Billingo::get(\"bank_accounts/{$bankAccountId}\");\n }", "function loopBills($dbc){\r\n $query = \"SELECT * FROM Bills\";\r\n if($result = $dbc->query($query)){\r\n while($row = $result->fetch_assoc()){\r\n $bill_id = $row['bill_id'];\r\n $amount = $row['amount'];\r\n $account1_id = $row['account1_id'];\r\n $account2_id = $row['account2_id'];\r\n $recurring = $row['recurring'];\r\n $bill = new Bill($bill_id, $amount,$account1_id, $account2_id, $recurring);\r\n if(isset($account1_id) && isset($account2_id) && isset($amount)){\r\n $status = singleBill($dbc, $bill);\r\n }\r\n }\r\n }\r\n}", "public function bankaccounts() {\n if ($this->input->get('view')) {\n $id = $this->myencrypt->decrypt_url($this->input->get('bankaccount_id'));\n $data['bankaccount'] = $this->account_model->getBankaccounts(array('mbankaccounts.mbankaccount_id' => $id));\n $data['balance'] = $this->account_model->getBankBalance(array('mbankaccount_id' => $id));\n $data['fixed_deposit'] = $this->account_model->getBankFixedDeposits(array('mbankaccount_id' => $id));\n $data['transactions'] = $this->account_model->getTransactions(false, array('ttransactions.mbankaccount_id' => $id, 'ttransactions.status' => 1));\n } else {\n $data['bankaccounts'] = $this->account_model->getBankaccounts();\n }\n $bank_data['name'] = \"accounts\";\n $data['bank_data'] = $bank_data;\n $this->view('bankaccounts', $data);\n }", "function updateAccounts($accountsArray) {\n\t\t$this->db->StartTrans();\n\t\t\n\t\tforeach ($accountsArray as $account) {\n\t\t\tif (!$this->isAccountValid($account))\n\t\t\t\t// This account cannot be added (probably because it does not have a unique prefix)\n\t\t\t\tthrow new Exception($this->copyOps->getCopyForId(\"prefixExistsError\", array(\"prefix\" => $account->prefix)));\n\n\t\t\t// First update the account root. This is failing because the account object has no loginOption.\n\t\t\t// getAccounts is sending back loginOption to DMS though. Seems we have to include it in the DetailsPane.\n\t\t\t//NetDebug::trace('AccountOps.updateAccounts loginOption='.$account->loginOption);\n\t\t\t$this->db->AutoExecute(\"T_AccountRoot\", $account->toAssocArray(), \"UPDATE\", \"F_RootID=\".$account->id);\n\t\t\t\n\t\t\t// Then update the titles within the account\n\t\t\t$this->updateAccountTitles($account);\n\t\t\t\n\t\t\t// Update the admin user object if it exists\n\t\t\tif ($account->adminUser) $this->manageableOps->updateUsers(array($account->adminUser), $account->id);\n\t\t\t\n\t\t\t// Finally delete the licence attributes\n\t\t\t$this->db->Execute(\"DELETE FROM T_LicenceAttributes WHERE F_RootID=?\", array($account->id));\n\t\t\t\n\t\t\tforeach ($account->licenceAttributes as $licenceAttribute) {\n\t\t\t\t$dbObj = array();\n\t\t\t\t$dbObj['F_RootID'] = $account->id;\n\t\t\t\t$dbObj['F_Key'] = $licenceAttribute['licenceKey'];\n\t\t\t\t$dbObj['F_Value'] = $licenceAttribute['licenceValue'];\n\t\t\t\tif ($licenceAttribute['productCode'] > 0) $dbObj['F_ProductCode'] = $licenceAttribute['productCode'];\n\t\t\t\t//NetDebug::trace('AccountOps.licenceAttribute insert '.$dbObj['F_Key'].'='.$dbObj['F_Value'].':'.$dbObj['F_ProductCode']);\n\t\t\t\t$this->db->AutoExecute(\"T_LicenceAttributes\", $dbObj, \"INSERT\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// make the root of the changed account explicit in the log\n\t\tAbstractService::$log->setRootID($account->id);\n\t\tAbstractService::$log->notice(\"Updated account name=\".$account->name.\", id=\".$account->id);\n\t\t\n\t\t$this->db->CompleteTrans();\n\t}", "function get_personas($accid)\r\n{\r\n\t$ret[] = array(-1,\"--account--\");\r\n\t$query = \"SELECT * from personas where '$accid'= accid \";\r\n\r\n\t$result = mysql_query ($query) or die(\"can not query table personas - \".mysql_error());\r\n\t$rowcount = mysql_num_rows($result);\r\n\t$odd = false; $first = true;\r\n\tif ($rowcount != 0) {\r\n\t\twhile (true) {\r\n\t\t\t$a = mysql_fetch_object($result);\r\n\t\t\tif ($a===false) break;\r\n\t\t\t$ret[] = array($a->persona,$a->persona);\r\n\t\t}\r\n\t}\r\n\treturn $ret;\r\n}", "public function get_all_partner($transaction_id,$type,&$data_arr,&$data_count){\n global $g_mc;\n /***\n sng:13/apr/2010\n This code is used in lots of places, so i cannot change c.* as well as company name\n */\n $q = \"select t.*,c.*,c.name as company_name from \".TP.\"transaction_partners as t left join \".TP.\"company as c on(t.partner_id=c.company_id) where t.transaction_id='\".$transaction_id.\"' AND t.partner_type='\".$type.\"' order by company_name\";\n if (isset($_REQUEST['debug']))\n echo $q . PHP_EOL;\n $res = mysql_query($q);\n if(!$res){\n return false;\n }\n ///////////////////////////\n $data_count = mysql_num_rows($res);\n if(0 == $data_count){\n //no data to return so\n return true;\n }\n /////////////////\n for($i=0;$i<$data_count;$i++){\n $data_arr[$i] = mysql_fetch_assoc($res);\n /***\n sng:13/apr/2010\n magic quoted company name\n **/\n $data_arr[$i]['company_name'] = $g_mc->db_to_view($data_arr[$i]['company_name']);\n $data_arr[$i]['name'] = $g_mc->db_to_view($data_arr[$i]['name']);\n }\n return true;\n }", "public function getAccountInformation()\n {\n $account = array(\n 'id' => $this->_account->getId(),\n 'nickname' => $this->_account->getNickname(),\n 'firstname' => $this->_account->getFirstname(),\n 'lastname' => $this->_account->getLastname(),\n 'created_at' => $this->_account->getCreated_at()\n ->format('d.m.Y H:M:s'),\n 'image' => $this->getProfileImage()\n );\n\n return $account;\n }", "function account($id)\r\n{\r\n mysql_selectdb(SQL_AUTH_DATABASE);\r\n $query = \"SELECT * FROM `account` WHERE `id` = $id\";\r\n $sql = mysql_query($query);\r\n return mysql_fetch_array($sql);\r\n \r\n}", "public function getAmountTransfers($id){\n\n $amountWallets = Wallets::select('amount')->where('id',$id)->get();\n\n return $amountWallets[0]->amount;\n \n }", "function addVoucher($dr_accounts, $cr_accounts, $auto_voucher,$details=false,$refAccount=null,$narration=null,$on_date=null){\n $drsum=0;\n $crsum=0;\n foreach($dr_accounts as $key=>$val){\n if($val['Amount']==\"\" or $val['Amount']== null or $val['Amount']==0) {\n unset($dr_accounts[$key]);\n continue;\n }\n $drsum += $val['Amount'];\n }\n \n foreach($cr_accounts as $key=>$val){\n if($val['Amount']==\"\" or $val['Amount']== null or $val['Amount']==0) {\n unset($cr_accounts[$key]);\n continue;\n }\n $crsum += $val['Amount'];\n }\n \n\n if($crsum != $drsum OR $crsum == 0) throw $this->exception (\"Debit Amount is not equal to Credit Amount or its Zero\");\n if(count($dr_accounts) > 1 AND count($cr_accounts) > 1) throw $this->exception(\"Many To Many voucher is not supported here, make two entries insted\");\n // throw $this->exception(\" $crsum :: $drsum \");\n\n if($auto_voucher === true){\n $cur_pos=$this->add('Model_Pos');\n $cur_pos->getCurrent();\n $auto_voucher = $cur_pos->getNextVoucherNumber($this->voucher_type);\n }\n \n if($narration===null) $narration = $this->default_narration;\n \n $details_fk=null;\n $has_details=(is_array($details)? true: false);\n \n $ve=$this->add('Model_VoucherEntry');\n \n // throw $this->exception(print_r($dr_accounts));\n\n foreach($dr_accounts as $key=>$val){\n if($val['Amount']==\"\" or $val['Amount']== null or $val['Amount']==0) continue;\n \n $ve['ledger_id']=$key;\n $ve['AmountDR']=$val['Amount'];\n $ve['VoucherNo']=$auto_voucher;\n $ve['Narration']=$narration;\n $ve['VoucherType']=$this->voucher_type;\n $ve['RefAccount']=(isset($val['RefAccount'])? $val['RefAccount']: $refAccount);\n // $ve['Rate']=(isset($val['Rate'])? $val['Rate']: \"\");\n // $ve['Qty']=(isset($val['Qty'])? $val['Qty']: \"\");\n $ve['has_details']=$has_details;\n $ve['entry_side']=\"DR\";\n $ve['entry_count_in_side'] = count($dr_accounts);\n if($on_date != null ) $ve['created_at']=$on_date;\n $ve->save();\n if($details_fk === null) $details_fk=$ve->id;\n $ve->unload();\n }\n foreach($cr_accounts as $key=>$val){\n if($val['Amount']==\"\" or $val['Amount']== null or $val['Amount']==0) continue;\n $ve['ledger_id']=$key;\n $ve['AmountCR']=$val['Amount'];\n $ve['VoucherNo']=$auto_voucher;\n $ve['Narration']=$narration;\n $ve['VoucherType']=$this->voucher_type;\n $ve['RefAccount']=(isset($val['RefAccount'])? $val['RefAccount']: $refAccount);\n // $ve['Rate']=(isset($val['Rate'])? $val['Rate']: \"\");\n // $ve['Qty']=(isset($val['Qty'])? $val['Qty']: \"\");\n $ve['has_details']=$has_details;\n $ve['entry_side']=\"CR\";\n $ve['entry_count_in_side'] = count($cr_accounts);\n if($on_date != null ) $ve['created_at']=$on_date;\n $ve->saveAndUnload();\n }\n if($has_details){\n $vd=$this->add('Model_VoucherDetails');\n foreach($details as $detail){\n $vd['voucher_id']=$details_fk;\n $vd['item_id']=$detail['item_id'];\n $vd['Rate']=$detail['Rate'];\n $vd['Qty']=$detail['Qty'];\n $vd['Amount']=$detail['Amount'];\n $vd->saveAndUnload();\n }\n }\n\n return $auto_voucher;\n \n }", "public function bankaccounttypeAction(){\r\n $this->_checkIfUserIsLoggedIn();\r\n $queryBuilder = $this->getEntityManager()->createQueryBuilder();\r\n $queryBuilder->add('select', 'bat.bactypeid,bat.bankacctype,bat.status')\r\n ->add('from', '\\Admin\\Entity\\BankAccountType bat')\r\n ->orderBy('bat.bactypeid', 'DESC');\r\n $data= $queryBuilder->getQuery()->getArrayResult(); \r\n $keys=array();\r\n foreach($data as $array){ \r\n foreach($array as $key=>$value){\r\n $key=str_replace(\"_\",\" \",$key);\r\n $keys[]=$key ; \r\n }\r\n break;\r\n}\r\n $fieldNames=$keys;\r\n $this->layout()->setVariable('fildnames', $fieldNames);\r\n return new ViewModel(array('fildnames'=>$fieldNames));\r\n }", "public function index()\n {\n \n $merchant = cseo_merchant::where('merchant_name', URL::to('/'))->first();\n\n $title = cseo_options_settings::SELECT('site_identity')->where('merchants_id', $merchant->id)->first();\n\n if ( count( $title ) > 0 ) {\n $site_identity = json_decode( $title->site_identity);\n }\n\n $query = [];\n\n $users = new cseo_account;\n\n $user_count = $users::Select(DB::raw('(Select count(*) from cseo_accounts where account_id != 1 ) countAll, (Select count(*) from cseo_accounts where account_id = 2) countAdmin, (Select count(*) from cseo_accounts where account_id = 3) countDev, (Select count(*) from cseo_accounts where account_id = 4) countSupport '))->first();\n\n \n if(request()->has('account_type')){\n $accounttype = request('account_type'); \n\n $user = $users::Select(DB::raw('cseo_accounts.id, cseo_accounts.first_name, cseo_accounts.last_name, cseo_accounts.position, cseo_accounts.email,cseo_accounts.remember_token,cseo_statuses.status_name, cseo_accounts.is_logged_in, cseo_accounts.created_at'))->join('cseo_statuses', 'cseo_statuses.id', 'cseo_accounts.account_id')->where('account_id',$accounttype)->latest();\n\n $query['account_type'] = $accounttype; \n \n }else{\n\n $user = $users::Select(DB::raw('cseo_accounts.id, cseo_accounts.first_name, cseo_accounts.last_name, cseo_accounts.position, cseo_accounts.email,cseo_accounts.remember_token,cseo_statuses.status_name, cseo_accounts.is_logged_in, cseo_accounts.created_at'))->join('cseo_statuses', 'cseo_statuses.id', 'cseo_accounts.account_id')->where('account_id','!=', '1')->latest();\n \n }\n\n $user = $user->paginate(10)->appends($query);\n\n $account_count = $user->count();\n\n return view('system.account.index', compact('site_identity','user_count', 'user','account_count')); \n\n }", "public static function account($accountId) {\n //Return the information for $accountId\n return self::get('accounts/' . $accountId);\n }", "public function myAccountAggregates($account_id)\n {\n // from los_orders\n // inner join los_users as u on u.id = los_orders.user_id\n // where los_orders.account_id = 4\n // group by user_id,first_name,last_name\n // order by first_name asc\n return $this->query()\n ->select(DB::raw('count(los_orders.id) as order_count'),\n DB::raw('coalesce(sum(total_price),0) as total_price'), 'first_name', 'last_name', 'user_id')\n ->join('los_users as u', 'u.id', '=', 'los_orders.user_id')\n ->where('los_orders.account_id', $account_id)\n ->orderBy('last_name')\n ->orderBy('first_name')\n ->groupBy('user_id')\n ->groupBy('first_name')\n ->groupBy('last_name')\n ->get();\n }", "function getBalancesForRestaurants($restaurants_ids_array) {\r\n $balances_for_restaurants = array();\r\n \r\n DB::useDB(B2B_B2C_COMMON);\r\n $balances = DB::query(\"SELECT id, balance from restaurant_balance WHERE id IN(\" . implode(\",\", $restaurants_ids_array) . \")\");\r\n// echo '<pre>'; var_dump($balances); echo '</pre>';\r\n \r\n foreach($restaurants_ids_array as $rest_id) {\r\n foreach($balances as $balance) {\r\n if($rest_id == $balance[\"id\"]) {\r\n $balances_for_restaurants[$balance[\"id\"]] = $balance[\"balance\"];\r\n }\r\n }\r\n }\r\n \r\n echo '<pre>'; var_dump($balances_for_restaurants); echo '</pre>';\r\n return $balances_for_restaurants;\r\n}", "public function dnbAccountsBAL($api,$args) {\n //invoke dnb api based on query type and query data\n $extDnbApi = $this->getEAPM();\n if (is_array($extDnbApi) && isset($extDnbApi['error'])) {\n throw new SugarApiExceptionRequestMethodFailure(null, array(), null, 424, $extDnbApi['error']);\n }\n $queryData = $args['qdata']; //data posted\n $result = $extDnbApi->dnbBALAccounts($queryData);\n if (is_array($result) && isset($result['error'])) {\n throw new SugarApiExceptionRequestMethodFailure(null, array(), null, 424, $result['error']);\n }\n return $result;\n }", "private function permutateAccount($account, $encrypted = FALSE)\n\t{\n\t\t$accounts = array();\n\n\t\tif ($encrypted)\n\t\t{\n\t\t\t$crypt_config = Crypt_Config::Get_Config(BFW_MODE);\n\t\t\t$crypt_object = Crypt_Singleton::Get_Instance($crypt_config['KEY'], $crypt_config['IV']);\n\t\t}\n\n\t\t// Setup an array of account numbers with prefixed 0's\n\t\t// Remove any leading 0's\n\t\t$account = ltrim($account, '0');\n\n\t\t// create all possible leading zero combinations for the bank account\n\t\t// only if the account number is not 17 digits\n\t\tfor ($i = strlen($account); $i <= 17; $i++)\n\t\t{\n\t\t\t$new = sprintf(\"%0{$i}d\", $account);\n\t\t\t$accounts[] = $encrypted\n\t\t\t\t? $crypt_object->encrypt($new)\n\t\t\t\t: $new;\n\t\t}\n\n\t\treturn $accounts;\n\t}", "public function get_transaction_data( $deal_id = \"\",$type=\"\")\n\t{\n\t\t$conditions = array(\"transaction.deal_id\" => $deal_id,\"type!=\" => 5);\n\t\tif($type){\n\t\t\t\t$conditions = array(\"transaction.deal_id\" => $deal_id,\"type\" => 5);\n\t\t}\n $result = $this->db->from(\"deals\")\n\t ->where($conditions)\n\t \t->join(\"transaction\",\"transaction.deal_id\",\"deals.deal_id\")\n\t \t->orderby(\"transaction.id\",\"DESC\")\n\t ->get();\n return $result;\n\t}", "private function getAccountType($idProfile)\r\n {\r\n $userTable = \"user\";\r\n $profileTable = \"profile\";\r\n \r\n // make query\r\n $query = \"SELECT u.account_type FROM \".$userTable.\" u JOIN \".$profileTable. \" p ON p.id_user = u.id_user WHERE p.id_profile = '$idProfile'\";\r\n $result = mysqli_query($this->db->getDb(), $query);\r\n $row = mysqli_fetch_assoc($result);\r\n \r\n // return account type\r\n return $row['account_type'];\r\n }", "public function getAccountType()\n {\n return $this->accountType;\n }", "function SearchAccountsByUserId($userId)\n{\n $GLOBALS['proxy'] = $GLOBALS['customerProxy']; \n \n // Specify the page index and number of customer results per page.\n\n $pageInfo = new Paging();\n $pageInfo->Index = 0; // The first page\n $pageInfo->Size = 100; // The first 100 accounts for this page of results\n\n $ordering = new OrderBy();\n $ordering->Field = OrderByField::Number;\n $ordering->Order = SortOrder::Ascending; \n\n $predicate = new Predicate();\n $predicate->Field = \"UserId\";\n $predicate->Operator = PredicateOperator::Equals;\n $predicate->Value = $userId; \n\n $request = new SearchAccountsRequest();\n $request->Ordering = $ordering;\n $request->PageInfo = $pageInfo;\n $request->Predicates = array($predicate);\n\n return $GLOBALS['proxy']->GetService()->SearchAccounts($request)->Accounts;\n}" ]
[ "0.6595377", "0.6134952", "0.60930204", "0.5779701", "0.57348096", "0.56539696", "0.56191105", "0.5611026", "0.5601746", "0.55570155", "0.5549037", "0.554459", "0.55139583", "0.54715633", "0.54419416", "0.543885", "0.5429928", "0.54044324", "0.5379817", "0.5375252", "0.5372752", "0.5355025", "0.5344065", "0.53327614", "0.53327435", "0.52871037", "0.5287103", "0.52797586", "0.52791685", "0.52755684", "0.5274584", "0.5266173", "0.52448803", "0.52356553", "0.52236134", "0.52171487", "0.5210364", "0.52030253", "0.518935", "0.51710004", "0.5168152", "0.5166839", "0.5156762", "0.5156762", "0.5154062", "0.5150186", "0.5130354", "0.5128513", "0.51221424", "0.5108578", "0.5106254", "0.5103874", "0.5089295", "0.5074913", "0.5070078", "0.50689745", "0.5059915", "0.5055116", "0.5054204", "0.50530505", "0.50512743", "0.50512743", "0.50512743", "0.50491726", "0.5040809", "0.5027207", "0.5025945", "0.50211954", "0.50135726", "0.50130844", "0.50094265", "0.50010407", "0.49922204", "0.49846292", "0.49820632", "0.49788782", "0.49666974", "0.4964197", "0.49565172", "0.49496484", "0.49478176", "0.4946517", "0.49461442", "0.49426946", "0.4934591", "0.4931197", "0.49258712", "0.49255893", "0.4921645", "0.49143916", "0.4910377", "0.4906139", "0.4906009", "0.49053416", "0.48968536", "0.48934656", "0.4890026", "0.4884838", "0.48779127", "0.4877897" ]
0.62901866
1
this three functions look for id,amount,account_type from array accounts
function beneficiaire_account_id() { global $account_type; foreach ($account_type as $key => $accounts) { foreach ($accounts as $key => $account) { if ($account == test_input($_POST["compte_beneficiaire"])) { return $accounts["id"]; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emetteur_account_id() {\n global $account_type;\n foreach ($account_type as $key => $accounts) {\n foreach ($accounts as $key => $account) {\n if ($account == test_input($_POST[\"compte_emetteur\"])) {\n return $accounts[\"id\"];\n }\n }\n }\n }", "public function getAccounts(){\n $accounts = [];\n foreach ($this->data['Items'] as $account) {\n $newAccount = [];\n $newAccount['accounting_id'] = IndexSanityCheckHelper::indexSanityCheck('UID', $account);\n $newAccount['code'] = IndexSanityCheckHelper::indexSanityCheck('DisplayID', $account);\n $newAccount['name'] = IndexSanityCheckHelper::indexSanityCheck('Name', $account);\n $newAccount['description'] = IndexSanityCheckHelper::indexSanityCheck('Description', $account);\n $newAccount['type'] = IndexSanityCheckHelper::indexSanityCheck('Type', $account);\n\n if (array_key_exists('Type', $account)) {\n if ($account['Type']) {\n $newAccount['is_bank_account'] = ($account['Type'] === 'Bank');\n }\n }\n\n if (array_key_exists('BankingDetails', $account)) {\n if ($account['BankingDetails']) {\n $newAccount['bank_account_number'] = IndexSanityCheckHelper::indexSanityCheck('BankAccountNumber', $account['BankingDetails']);\n }\n }\n\n if (array_key_exists('TaxCode', $account)) {\n if ($account['TaxCode']) {\n $newAccount['tax_type'] = IndexSanityCheckHelper::indexSanityCheck('Code', $account['TaxCode']);\n }\n }\n array_push($accounts, $newAccount);\n }\n\n return $accounts;\n }", "private static function parseAccounts($arr)\n\t{\n\t\t$results = array();\n\t\tif (count($arr) > 0) {\n\t\t\tif (array_key_exists('account', $arr)) {\n\t\t\t\t$accounts = $arr['account'];\n\t\t\t\tforeach ($accounts as $account) {\n\t\t\t\t\t$attr = $account->attributes();\n\t\t\t\t\tif (array_key_exists('account', $account)) {\n\t\t\t\t\t\t$results = array_merge(\n\t\t\t\t\t\t\t$results, self::parseAccounts((array)$account)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$code = (string)$attr['code'];\n\t\t\t\t\t$name = (string)$attr['name'];\n//\t\t\t\t\tif ($code >= '4000') {\n\t\t\t\t\t\t$results[] = $code;\n//\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$results = array_unique($results);\n\t\t\t\tsort($results);\n\t\t\t}\n\t\t}\n\t\treturn $results;\n\t}", "function selectTransactionsByAccountId($id) {\n $connection = openDb();\n $id = (int) $id;\n\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM transaction_view WHERE SENDER_ACCOUNT = ? OR RECIPIENT_ACCOUNT = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"si\",$id,$id);\n\n return executeQueryPrepared($stmt, $connection);\n}", "public static function getAccountById($account_id){\n $stmt = Dbh::connect() ->PREPARE(\"SELECT * FROM accounts WHERE account_id=?\");\n $stmt->execute([$account_id]);\n $account = array();\n if($stmt->rowCount()){\n while ($row = $stmt->fetch()){\n $account = array(\"id\"=>$row['account_id'], \"email\"=>$row['email'], \"firstName\"=>$row['first_name'], \"lastName\"=>$row['last_name'],\n \"type\"=>$row['account_type'],\"password\"=>$row['password'],\"subscription\"=>$row['subscription']);\n }\n return $account;\n } else {\n\t\t\treturn false;\n\t\t}\n }", "public function CommissionFeeServiceAccordingVendor($type=\"STRIPE\",$account_status=0)\n{\n\t \n\t $orders = Auth::user()->ShopProductCartItemOfVendors;\n $arr =[];\n $account =[];\n\n\t foreach ($orders as $key => $value) {\n\n\t \n\t \t$amount = trim($value->getOrderOfSingleVendor->sum('total')); \n\n $account_id = $type == \"STRIPE\" ? $value->vendor->shop->stripe_account_id : $value->vendor->shop->paypal_email;\n $service_fee = $this->getServiceFee($amount);\n $commission_fee = $this->getCommissionFee($amount);\n\n\n $payable_amount = round($amount - ($service_fee + $commission_fee));\n\n $stripeAccountParams= (array)[\"amount\" => $payable_amount,\"stripe_account\" => $account_id];\n\n array_push($account, $stripeAccountParams);\n\n\t \t$arr[$value->vendor_id] = [\n 'vendor_id' => $value->vendor_id,\n 'total' => $this->getGrandTotal(),\n 'amount' => $amount,\n 'tax' => $this->getTax(),\n 'commission_fee' => $commission_fee,\n 'service_fee' => $service_fee,\n 'payable_amount' => $payable_amount,\n 'account_id' => $account_id,\n 'stripeAccountParams' => $stripeAccountParams\n\t \t];\n\n\n\t \t//array_push($arr[$value->vendor_id], $arr1);\n\t }\n\n\t return $account_status == 0 ? $arr : $account;\n \n}", "public function getAccounts();", "public function findAccounts() {\n\t\t\n\t}", "public function getAccountDetailsByaccountId($accountId)\n {\n $account = Account::where('id', $accountId)->first();\n if(!empty($account)) {\n return ([\n 'flag' => true,\n 'name' => $account->accountDetail->name,\n ]);\n } else {\n return ([\n 'flag' => false\n ]); \n }\n }", "function getAccounts() {\n $stmt = $this->pdo->query('SELECT * FROM get_accounts()');\n $accounts = [];\n while ($row = $stmt->fetch()) {\n $accounts[] = [\n 'id' => $row['id'],\n 'first_name' => $row['first_name'],\n 'last_name' => $row['last_name'],\n 'plan' => $row['plan'],\n 'effective_date' => $row['effective_date']\n ];\n }\n return $accounts;\n }", "public function getFinanceAccount($user_id = null,$payment_type = null)\n {\n $table = Engine_Api::_()->getDbtable('paymentAccounts', 'mp3music');\n $select = $table->select();\n \n if($user_id != null)\n {\n $select->where('user_id = ?',$user_id);\n }\n if($payment_type != null)\n {\n $select->where('payment_type = ?',$payment_type); \n }\n $accounts = $table->fetchAll($select)->toArray(); \n return @$accounts[0]; \n }", "function media_theplatform_mpx_get_accounts_select() {\n // Check for the signIn token.\n $mpx_token = media_theplatform_mpx_variable_get('token', NULL);\n if (!$mpx_token) {\n return t('There was an error with your request.');\n }\n // Get the list of accounts from thePlatform.\n $url = 'http://access.auth.theplatform.com/data/Account?schema=1.3.0&form=json&byDisabled=false&token=' . $mpx_token;\n $result = drupal_http_request($url);\n $result_data = drupal_json_decode($result->data);\n\n global $user;\n\n if (empty($result_data['entryCount']) || $result_data['entryCount'] == 0) {\n $log = array(\n 'uid' => $user->uid,\n 'type' => 'request',\n 'type_id' => NULL,\n 'action' => 'account',\n 'details' => '0 accounts returned.',\n );\n media_theplatform_mpx_insert_log($log);\n //return FALSE;\n drupal_set_message(t('The logged in user does not have the privilege to set the account.'), 'warning');\n return array();\n }\n $accounts = array();\n $accounts_data = array();\n\n foreach ($result_data['entries'] as $entry) {\n $title = $entry['title'];\n $key = rawurlencode($title);\n $accounts[$key] = $title;\n }\n $log = array(\n 'uid' => $user->uid,\n 'type' => 'request',\n 'type_id' => NULL,\n 'action' => 'account',\n 'details' => count($accounts) . ' accounts returned.',\n );\n media_theplatform_mpx_insert_log($log);\n // Sort accounts alphabetically.\n natcasesort($accounts);\n return $accounts;\n}", "protected function getAccountData()\n\t{\n\t\t$db = $this->getDatabase();\n\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select('*')\n\t\t\t\t->from('#__accountdata')\n\t\t\t\t->where('(w20_facebook <> \"\" OR w20_twitter <> \"\")')\n\t\t\t\t->where('typ = 0')\n\t\t\t\t// ->where('bid IN (2657)')\n\t\t\t\t->where('status = 0');\n\n\n\t\t$db->setQuery($query);\n\t\t$this->adata = $db->loadObjectList();\n\n\t\treturn $this->adata;\n\t}", "private function findAccountByOwner(string $type, int $id)\n {\n return Account::where([\n \"owner_id\" => $id,\n \"owner_type\" => $type\n ])->firstOrFail();\n }", "function getThirdPartyIDThirdPartyAccountAssignment($post_source_account,$status1,$DbConnection)\n {\n $third_party_account_id=array();\n $querydesaid=\"SELECT third_party_account_id from third_party_account_assignment WHERE admin_account_id='$post_source_account' and status='$status1'\";\n $resultdesaid=mysql_query($querydesaid,$DbConnection);\n while($row=mysql_fetch_object($resultdesaid))\n {\n $third_party_account_id[]=$row->third_party_account_id;\n }\n return $third_party_account_id; \n }", "public function get_account_data() {\n return array(\n 'accountId' => $this->accountId,\n 'email' => $this->email,\n 'firstName' => $this->firstName,\n 'lastName' => $this->lastName,\n 'type' => $this->type,\n 'subscription' => $this->subscription\n );\n }", "function transactions_by_type($type){\n\t\t$query = $this->db->query(\"SELECT * FROM transactions WHERE Trans = '$type';\");\n\t\treturn $query->result_array();\n\t}", "public function add_account($id,$balance){\n if(preg_match(\"/^[0-9]+$/\",$id) && preg_match(\"/^[-+]?[0-9]*\\.?[0-9]+$/\",$balance)){\n if(array_key_exists($id,$this->accounts)){\n return 4;\n }else{\n $account = new Account($id,$balance);\n $this->accounts[$account->id] = $account;\n return 0;\n }\n }else{\n return 3;\n }\n }", "function get_user_info($account_id)\n {\n // $query_avg_score=$this->db->query(\"SELECT AVG(score) AS score FROM xl_score WHERE target_id='{$account_id}'\");\n\n $query_avatar_url=$this->db->query(\"SELECT avatar_url AS avatar_url FROM xl_avatar WHERE account_id='{$account_id}'\");\n\n $query_account_info=$this->db->query(\"SELECT id,nickname,cellphone,sex,birthday,horoscope,status,register_user,type FROM xl_account WHERE id='{$account_id}'\");\n\n $arr = array();\n\n foreach($query_account_info->result_array() as $row)\n {\n array_push($arr,$row);\n }\n $user_info=array();\n\n if (count($arr)==0) \n {\n \n return $user_info;\n }\n\n $user_info=$arr[0];\n \n if ($query_avatar_url->num_rows()>0) \n {\n $arr_avatar = array();\n\n foreach($query_avatar_url->result_array() as $row)\n {\n array_push($arr_avatar,$row);\n }\n\n $user_avatar=$arr_avatar[0];\n\n }\n else\n {\n $user_avatar=array('avatar_url' => '', );\n\n }\n\n $user_info=array_merge($user_info, $user_avatar);\n // $user_info=array_merge($user_info,$user_score);\n\n return $user_info;\n \n\n }", "function getAccounts() {\n $stmt = $this->pdo->query('SELECT * FROM get_accounts()');\n $accounts = [];\n while ($row = $stmt->fetch()) {\n $accounts[] = [\n 'id' => $row['id'],\n 'first_name' => $row['first_name'],\n 'last_name' => $row['last_name'],\n 'plan' => $row['plan'],\n 'effective_date' => $row['effective_date']\n ];\n }\n return $accounts;\n }", "function get_pay_type_array() {\n $sql = \"SELECT id, name FROM \".TB_PREF.\"payroll_pay_type\";\n $result = db_query($sql, \"could not get pay rates\");\n $type_array = array();\n while($myrow = db_fetch($result)){\n\t$type_array[$myrow['id']] = $myrow['name'];\n }\n return $type_array;\n}", "public function getAccount();", "public function listAccountIds() //*\n\t{\n\t$this->errorLogging->logInfo(__CLASS__, __METHOD__, \"Called.\");\n\t\n\t$userGroup = $_SESSION[\"usergroup\"];\n\n\t$select_array = array(\n\t\"table\" => 'accounts', \n\t\"where\" => 'WHERE', \n\t\"columns\" => array(\n\t\"account_pk\",\n\t\"account_name\",),\n\t\"returns\" => array(\n\t\"accountPK\",\n\t\"accountName\"),\n\t\"conditions\" => array(\n\t\tarray(\n\t\t\"column\" => \"user_group\",\n\t\t\"operator\" => \"=\",\n\t\t\"value\" => \"$userGroup\",\n\t\t\"concat\" => \"\")\n\t),\n\t\"endingQuery\" => \"\"\n\t);\n\t\n\t$returnedArray = $this->dbConnection->ConstructSelect($select_array); //errors handled by dbase class\n\t$this->responseClass->apiResponse($returnedArray);\n\treturn true;\n\t}", "function get_account_type_by_date($group_id, $from_date, $to_date) {\n $CI = & get_instance();\n $CI->load->helper('traialbalance');\n $CI->load->model('account/report');\n $returnArr = get_opening_balance_cal_by_date($group_id, $from_date, $to_date);\n $opening_balance = 0;\n foreach ($returnArr as $row) {\n if ($row['account_type'] == 'Dr') {\n $opening_balance = $opening_balance + $row['opening_balance'];\n }\n if ($row['account_type'] == 'Cr') {\n $opening_balance = $opening_balance - str_replace('-', '', $row['opening_balance']);\n }\n }\n if ($opening_balance >= 0) {\n return 'Dr';\n }\n if ($opening_balance < 0) {\n return 'Cr';\n }\n}", "public static function getAllAccounts(){\n\t\t$stmt = Dbh::connect()->query(\"SELECT * FROM accounts\");\n\t\t$accounts = array();\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){\n $accounts[] = new Account($row['account_id'], $row['email'], $row['first_name'], $row['last_name'], $row['account_type'], $row['password']);\n }\n return $accounts;\n\t}", "private function managedAccountResponse($id)\n {\n return [\n 'id' => $id,\n 'currencies_supported' => [\n 'usd', 'aed', 'afn', '...',\n ],\n 'object' => 'account',\n 'business_name' => 'Stripe.com',\n 'bank_accounts' => [\n 'object' => 'list',\n 'total_count' => 0,\n 'has_more' => false,\n 'url' => '/v1/accounts/' . $id . '/bank_accounts',\n 'data' => [],\n ],\n 'verification' => [\n 'fields_needed' => [\n 'product_description',\n 'business_url',\n 'support_phone',\n 'bank_account',\n 'tos_acceptance.ip',\n 'tos_acceptance.date',\n ],\n 'due_by' => null,\n 'contacted' => false,\n ],\n 'tos_acceptance' => [\n 'ip' => null,\n 'date' => null,\n 'user_agent' => null,\n ],\n 'legal_entity' => [\n 'type' => null,\n 'business_name' => null,\n 'address' => [\n 'line1' => null,\n 'line2' => null,\n 'city' => null,\n 'state' => null,\n 'postal_code' => null,\n 'country' => 'US',\n ],\n 'first_name' => null,\n 'last_name' => null,\n 'additional_owners' => null,\n 'verification' => [\n 'status' => 'unverified',\n 'document' => null,\n 'details' => null,\n ],\n ],\n ];\n }", "function getDetailAllAcIDUIDNext($admin_id1,$DbConnection)\n{\n\t$query =\"SELECT account.account_id,account.user_id FROM account,account_detail USE INDEX(ad_acamdid) WHERE account.user_type='substation' AND account.status=1 and account.account_id=account_detail.account_id AND account_detail.account_admin_id='$admin_id1'\";\n\t$result = mysql_query($query,$DbConnection);\t\n\twhile($row = mysql_fetch_object($result))\n\t{\n\t\t/*$account_id_sub = $row->account_id;\n\t\t$user_id_sub = $row->user_id;*/\n\t\t\n\t\t$data[]=array('account_id_sub'=>$row->account_id,'user_id_sub'=>$row->user_id);\t\n\t}\n\treturn $data;\t\n}", "public function userAccountListJson2(){\n\t\t$user = loggedInUserData();\n\t\t$userID = $user['user_id'];\n\t\t\n\t\t$role \t= $user['role'];\n\n \n\t\t\n\t\t$limit = $this->input->get('length');\n\t\t$start = $this->input->get('start');\n\n\t\t$queryCount = $this->ledger_model->userAccountListCount2();\n\n\t\t$query = $this->ledger_model->userAccountList2($limit, $start);\n\t\t\n\t\t$draw = $this->input->get('draw');\n\n\t\t$data = [];\n\t\t$data['draw'] = $draw;\n\t\t$data['recordsTotal'] = $queryCount;\n\t\t$data['recordsFiltered'] = $queryCount;\n\t\tif($query -> num_rows() > 0) \n\t\t{\t\n\t\tforeach($query->result() as $r)\n\t\t{\n\t\t\t\n\t\t\tif ($r->tran_count != null)\n\t\t\t{\n\t\t\t\t$counts = $r->tran_count;\n\t\t\t}\n\n\t\t\t//Action Button\n\t\t\t$button = '';\n\t\t\t$button .= '<a class=\"btn btn-primary editBtn\" href=\"'.base_url('account/balancesheet_view/'. $r->id).'\" data-toggle=\"tooltip\" title=\"View\">\n\t\t\t\t\t\t<i class=\"fa fa-eye\"></i> </a>';\n\t\t\t//Get Decision who in online?\n if($user['role'] == 'admin')\n {\n\t\t//\t$button .= '<a class=\"btn btn-danger deleteBtn\" id=\"'.$r->id.'\" data-toggle=\"tooltip\" title=\"Delete\">\n\t\t//\t\t\t\t<i class=\"fa fa-trash\"></i> </a>';\n\t\t}\t\n\t\t\n\t\t\n\t\t\t\t$data['data'][] = array(\n\t\t\t\t$button,\n $counts,\n\t\t\t\tdate('d/m/Y h:i A', $r->created_at), //date format\n\t\t\t\tnumber_format($r->debit, 2),\t\n\t\t\t\tnumber_format($r->credit, 2),\t\n\t\t\t\tnumber_format($r->amount, 2),\t\t\n\t\t\t\t$r->points_mode,\t\t\t\t\t\n\t\t\t\t$r->tranx_id\n\t\t\t\t\n\t\t\t);\n\t\t\n\t\t}\n\t\t}\n\t\telse{\n\t\t\t$data['data'][] = array(\n\t\t\t\t'Offer Accounts are not yet updated' , '', '','', '','',''\n\t\t\t);\n\t\t\n\t\t}\n\t\techo json_encode($data);\t\t\n\n\t}", "public function getWhereAccounts($post_id) {\n $return = array();\n $get = array(\n //'limit' => 10,\n 'conditions' => array(array('post_id' => $post_id, 'scheduled' => 1)),\n //'fields' => array('', ''),\n //'order' => array('date'=>'desc')\n );\n //fb users\n $fbusers = $this->FcbUserPosts->find('all', $get);\n if (!empty($fbusers)) {\n foreach ($fbusers as $user) {\n $value = 'fcbuseredit-' . $user['FcbUserPosts']['fcb_uid'];\n array_push($return, $value);\n }\n }\n //fb pages\n $fbpages = $this->FcbPagePosts->find('all', $get);\n if (!empty($fbpages)) {\n foreach ($fbpages as $page) {\n $value = 'fcbpageedit-' . $page['FcbPagePosts']['fcb_uid'] . '-' . $page['FcbPagePosts']['fcb_page_id'];\n array_push($return, $value);\n }\n }\n //twitter\n $twitter = $this->TwUserPosts->find('all', $get);\n if (!empty($twitter)) {\n foreach ($twitter as $account) {\n $value = 'twuseredit-' . $account['TwUserPosts']['tw_uid'];\n array_push($return, $value);\n }\n }\n //return \n return $return;\n }", "public function getAmounts(): array{\r\n $amounts = array();\r\n $con = $this->db->getConnection();\r\n foreach(mysqli_query($con, 'SELECT * FROM amounts')as $key){ $amounts[$key['idamounts']] = $key['amount']; }\r\n return $amounts;\r\n $this->con->closeConnection();\r\n }", "function totalAmount_account() {\r\n global $date;\r\n $query = \"SELECT DISTINCT\r\n account AS Account,\r\n (\r\n (\r\n (\r\n SELECT IFNULL(SUM(amount), 0)\r\n FROM record\r\n WHERE acc = Account\r\n AND transaction_type = 'in'\r\n AND date BETWEEN\r\n (\r\n SELECT MIN(date)\r\n FROM record\r\n ) AND '{$date}'\r\n )\r\n +\r\n (\r\n SELECT IFNULL(SUM(amount), 0)\r\n FROM record\r\n WHERE to_acc = Account\r\n AND transaction_type = 'tr'\r\n AND date BETWEEN\r\n (\r\n SELECT MIN(date)\r\n FROM record\r\n ) AND '{$date}'\r\n )\r\n )\r\n -\r\n (\r\n (\r\n SELECT IFNULL(SUM(amount), 0)\r\n FROM record\r\n WHERE acc = Account\r\n AND transaction_type = 'ex'\r\n AND date BETWEEN\r\n (\r\n SELECT MIN(date)\r\n FROM record\r\n ) AND '{$date}'\r\n )\r\n +\r\n (\r\n SELECT IFNULL(SUM(amount), 0)\r\n FROM record\r\n WHERE from_acc = Account\r\n AND transaction_type = 'tr'\r\n AND date BETWEEN\r\n (\r\n SELECT MIN(date)\r\n FROM record\r\n ) AND '{$date}'\r\n )\r\n )\r\n ) AS Remain\r\n FROM account;\";\r\n return fetch($query);\r\n }", "public function UserCustomCaseAmount($account_id){\n $this->db->select('sum(reimburse_details.amount_total) as amount_total');\n $this->db->from('reimburse_details');\n $this->db->join('custom_case', 'custom_case.accountId=reimburse_details.ID_ACCOUNT AND custom_case.caseId=reimburse_details.case_id');\n $this->db->where('reimburse_details.ID_ACCOUNT', $account_id);\n $result = $this->db->get();\n return $result->result_array();\n }", "public function get_accounts(){\n $items = array();\n if( ! $this->is_connect() ){\n return array();\n }\n //$this->new_request( \"GET\", \"/accounts\" );//$this->is_connect() hace la petición de las cuentas\n $response = json_decode( $this->ironman->get_response_body(), true );\n $accounts = isset( $response['accounts'] ) ? $response['accounts'] : array();\n foreach( $accounts as $account ){\n $items[$account['id']] = $account['name'];\n }\n return $items;\n }", "private function accountType($accountPK) //*\n\t{\n\t$this->errorLogging->logInfo(__CLASS__, __METHOD__, \"Called.\");\n\t\t\n\t$select_array = array(\n\t\"table\" => 'accounts', \n\t\"where\" => 'WHERE', \n\t\"columns\" => array(\n\t\"account_type_pk\"),\n\t\"returns\" => array(\n\t\"accountTypePK\"),\n\t\"conditions\" => array(\n\t\tarray(\n\t\t\"column\" => \"account_pk\",\n\t\t\"operator\" => \"=\",\n\t\t\"value\" => \"$accountPK\",\n\t\t\"concat\" => \"\")\t\t\n\t),\n\t\"endingQuery\" => \"\"\n\t);\n\t\t\n\t$returnedArray = $this->dbConnection->ConstructSelect($select_array);\n\t\tif (is_array($returnedArray ))\n\t\t{\n\t\t$accountTypePK = $returnedArray[0][\"accountTypePK\"];\n\t\t}\n\t\telse\n\t\t{\n\t\t$accountTypePK = 5;\n\t\t}\n\treturn $accountTypePK;\n\t}", "public function getAccounts()\n {\n }", "function getAccounts($accounts){\n\t\techo '<div class = \"Accounts\">';\n\t\techo '<h2 class = \"Accounts\">Your Accounts:</h2>';\n\t\techo '<ul class = \"Accounts\">';\n\n\t\t//Echo out each account\n\t\tforeach ($accounts as $account) {\n\t\t\t//var_dump($account);\n\t\t\techo '<li><span class = \"Spacer\"><br /></span><span class = \"AccountName\">' . $account['name'] . ': </span><span class =\"AccountAmount\">$' . $account['amount'] . '</span></li>';\n\t\t\techo '<hr class =\"Accounts\">';\n\t\t}\n\n\t\techo '</ul><div class = \"largespacer\"></div>';\n\t\t$this->createAccountButton();\n\t\techo '</div>';\n\t\t//Returns true\n\t\treturn true;\n\t}", "public function UserInventoryCaseDetailAmount($account_id){\n $this->db->select('sum(reimburse_details.amount_total) as amount_total');\n $this->db->from('reimburse_details');\n $this->db->join('case_details_inventory', 'case_details_inventory.inventoryItemId=reimburse_details.order_id AND case_details_inventory.accountId=reimburse_details.ID_ACCOUNT AND case_details_inventory.caseId=reimburse_details.case_id');\n $this->db->where('reimburse_details.ID_ACCOUNT', $account_id);\n $result = $this->db->get();\n return $result->result_array();\n }", "protected function _loadAccountData() {\n\t\tif(check($this->_userid)) {\n\t\t\t$result = $this->db->queryFetchSingle(\"SELECT * FROM \"._TBL_MI_.\" WHERE \"._CLMN_MEMBID_.\" = ?\", array($this->_userid));\n\t\t\tif(!is_array($result)) return;\n\t\t\t$this->_accountData = $result;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(check($this->_username)) {\n\t\t\t$result = $this->db->queryFetchSingle(\"SELECT * FROM \"._TBL_MI_.\" WHERE \"._CLMN_USERNM_.\" = ?\", array($this->_username));\n\t\t\tif(!is_array($result)) return;\n\t\t\t$this->_accountData = $result;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(check($this->_email)) {\n\t\t\t$result = $this->db->queryFetchSingle(\"SELECT * FROM \"._TBL_MI_.\" WHERE \"._CLMN_EMAIL_.\" = ?\", array($this->_email));\n\t\t\tif(!is_array($result)) return;\n\t\t\t$this->_accountData = $result;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\treturn;\n\t}", "public function account_transaction($id) {\n $options = [\n 'projection' => [\n '_id' => 1,\n 'purchase_inv_id' => 1,\n 'subscription_cost' => 1,\n 'setup_cost' => 1,\n 'amount' => 1,\n 'package_type' => 1,\n 'payment_terms' => 1,\n 'createddate' => 1,\n 'expirydate' => 1,\n 'paid_status' => 1,\n 'txnID' => 1,\n 'ePGTxnID' => 1,\n 'currency' => 1,\n 'responsecode' => 1,\n 'response_msg' => 1,\n 'pay_mode' => 1,\n 'service_tax' => 1,\n 'service_tax_cost' => 1\n ]\n ];\n\n $query_result = $this->mongo_db->find(MDB_PACKAGE_INFO, ['_id' => (int) $id], $options);\n $result = (!empty($query_result) && isset($query_result[0])) ? $query_result[0] : array();\n return $result;\n }", "public function userAccountListJson(){\n\t\t$user = loggedInUserData();\n\t\t$userID = $user['user_id'];\n\t\t\n\t\t$role \t= $user['role'];\n\n \n\t\t\n\t\t$limit = $this->input->get('length');\n\t\t$start = $this->input->get('start');\n\n\t\t$queryCount = $this->ledger_model->userAccountListCount();\n\n\t\t$query = $this->ledger_model->userAccountList($limit, $start);\n\t\t\n\t\t$draw = $this->input->get('draw');\n\n\t\t$data = [];\n\t\t$data['draw'] = $draw;\n\t\t$data['recordsTotal'] = $queryCount;\n\t\t$data['recordsFiltered'] = $queryCount;\n\t\tif($query -> num_rows() > 0) \n\t\t{\t\n\t\tforeach($query->result() as $r)\n\t\t{\n\t\t\t//CPA Display\n\t\tif( $role != 'admin')\n\t\t{\tif ($r->points_mode == 'wallet')\n\t\t\t{\n\t\t\t\t$values = 'CPA';\n\t\t\t\n\t\t\tif ($r->tran_count != null)\n\t\t\t{\n\t\t\t\t$counts = $r->tran_count;\n\t\t\t}\n\n\t\t\t//Action Button\n\t\t\t$button = '';\n\t\t\t$button .= '<a class=\"btn btn-primary editBtn\" href=\"'.base_url('account/balancesheet_view/'. $r->id).'\" data-toggle=\"tooltip\" title=\"View\">\n\t\t\t\t\t\t<i class=\"fa fa-eye\"></i> </a>';\n\t\t\t//Get Decision who in online?\n if($user['role'] == 'admin')\n {\n\t\t//\t$button .= '<a class=\"btn btn-danger deleteBtn\" id=\"'.$r->id.'\" data-toggle=\"tooltip\" title=\"Delete\">\n\t\t//\t\t\t\t<i class=\"fa fa-trash\"></i> </a>';\n\t\t}\t\n\t\t\n\t\t\n\t\t\t\t$data['data'][] = array(\n\t\t\t\t$button,\n $counts,\n\t\t\t\tdate('d/m/Y h:i A', $r->created_at), //date format\n\t\t\t\tnumber_format($r->debit, 2),\t\n\t\t\t\tnumber_format($r->credit, 2),\t\n\t\t\t\tnumber_format($r->amount, 2),\t\t\n\t\t\t\t$values, //$r->points_mode,\t\t\t\t\t\n\t\t\t\t$r->tranx_id\n\t\t\t\t\n\t\t\t);\n\t\t}\n\t\t}else{\n\t\t\t\n\t\tif ($r->points_mode == 'wallet')\n\t\t\t{\n\t\t\t\t$values = 'CPA';\n\t\t\t}else{\n\t\t\t\t$values = $r->points_mode;\n\t\t\t}\n\t\t\tif ($r->tran_count != null)\n\t\t\t{\n\t\t\t\t$counts = $r->tran_count;\n\t\t\t}\n\n\t\t\t//Action Button\n\t\t\t$button = '';\n\t\t\t$button .= '<a class=\"btn btn-primary editBtn\" href=\"'.base_url('account/balancesheet_view/'. $r->id).'\" data-toggle=\"tooltip\" title=\"View\">\n\t\t\t\t\t\t<i class=\"fa fa-eye\"></i> </a>';\n\t\t\t//Get Decision who in online?\n if($user['role'] == 'admin')\n {\n\t\t//\t$button .= '<a class=\"btn btn-danger deleteBtn\" id=\"'.$r->id.'\" data-toggle=\"tooltip\" title=\"Delete\">\n\t\t//\t\t\t\t<i class=\"fa fa-trash\"></i> </a>';\n\t\t}\t\n\t\t\n\t\t\n\t\t\t\t$data['data'][] = array(\n\t\t\t\t$button,\n $counts,\n\t\t\t\tdate('d/m/Y h:i A', $r->created_at), //date format\n\t\t\t\tnumber_format($r->debit, 2),\t\n\t\t\t\tnumber_format($r->credit, 2),\t\n\t\t\t\tnumber_format($r->amount, 2),\t\t\n\t\t\t\t$values, //$r->points_mode,\t\t\t\t\t\n\t\t\t\t$r->tranx_id\n\t\t\t\t\n\t\t\t);\n\t\t}\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t}\n\t\telse{\n\t\t\t$data['data'][] = array(\n\t\t\t\t'CPA Accounts are not yet updated' , '', '','', '','',''\n\t\t\t);\n\t\t\n\t\t}\n\t\techo json_encode($data);\t\t\n\n\t}", "function mint_get_account($session, $token, $account_name) {\n // mint needs some info to log in\n $_post = array(\n \"input\" => '[' . json_encode(array(\n \"args\" => array(\n \"types\" => array(\"OTHER_PROPERTY\"),\n ),\n \"id\" => \"115485\",\n \"service\" => \"MintAccountService\",\n \"task\" => \"getAccountsSorted\", \n )) . ']',\n );\n $session->URLFetch(\"https://wwws.mint.com/bundledServiceController.xevent?token=\" . $token, $_post);\n $_obj = json_decode($session->response);\n \n // 115485 seems to be a magic/arbitrary number that mint labels the object in it's return json\n foreach ($_obj->response->{115485}->response as $account) {\n if ($account->name == $account_name) {\n return $account->accountId;\n }\n }\n Debug::trace('could not find an account named ' . $account_name . ' in your mint.com account');\n}", "function get_invested_accounts($tid)\n\t{\n\t return $this->db->select()\n\t\t ->from('pamm_accounts') \n\t\t ->where(\"login IN (select pamm_invested_accounts_login FROM pamm_invested_accounts WHERE pamm_invested_accounts_tid=$tid)\")\n\t\t ->where(\"pamm_accounts.active !='4'\")\t\n\t\t ->get()->result();\n\t}", "public function getAccountCode();", "public function getAccountCode();", "function getAccounts(){\n\t\t// Get staff members from urlms\n\t\t$accounts = $this->urlms->getLab_index(0)->getFundingAccounts();\n\t\t$count = 0;\n\t\t// for each account, display its name and its balance\n\t\tforeach ($accounts as $a){\n\t\t\techo $a->getType() . \" \" . number_format($a->getBalance(), 2, \".\" , \",\" ) . \"<br>\";\n\t\t\t$count ++;\n\t\t}?>\n\t\t<html>\n\t\t\t<div class=\"container\">\n\t\t\t\t<div class=\"row\">\n\t\t\t\t\t<div class=\"col-sm-2\">\n\t\t\t\t\t\t<a href=\"../view/FundingView.php\" style=\"color: white; text-decoration: none;\">\n\t\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-danger\" data-toggle=\"tooltip\"\n\t\t\t\t\t\t\tdata-placement=\"bottom\" title=\"Go back to homepage\">Back</button>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</html><?php \n\t\treturn $count;\n\t}", "function get_begin_saldo_account()\n {\n $this->db->select('accounts.id, accounts.currency, accounts.name, accounts.alias, accounts.code, accounts.classification_id');\n $this->db->from('accounts,classifications');\n $this->db->where('accounts.classification_id = classifications.id');\n \n $names = array('harta', 'modal', 'kewajiban');\n $this->db->where_in('classifications.type', $names);\n $this->db->where('accounts.deleted', NULL);\n \n $this->db->order_by('accounts.code','asc');\n return $this->db->get(); \n }", "function pagelines_account_array( ){\n\n\t$d = array(\n\t\n\t\t'Your_Account'\t\t=> array(\n\t\t\t'icon'\t\t\t=> PL_ADMIN_ICONS.'/rocket-fly.png',\n\t\t\t'credentials' \t=> array(\n\t\t\t\t'version'\t=> 'pro',\n\t\t\t\t'type'\t\t=> 'updates_setup',\n\t\t\t\t'title'\t\t=> __( 'Configure PageLines Account &amp; Auto Updates', 'pagelines' ),\n\t\t\t\t'shortexp'\t=> __( 'Get your latest updates automatically, direct from PageLines.', 'pagelines' ),\n\t\t\t\t'layout'\t=> 'full',\n\t\t\t)\n\t\t),\n\t\t'Import-Export'\t\t=> array(\n\t\t\t'icon'\t\t\t=> PL_ADMIN_ICONS.'/extend-inout.png',\n\t\t\t'import_set'\t=> array(\n\t\t\t\t'default'\t=> '',\n\t\t\t\t'type'\t\t=> 'import_export',\n\t\t\t\t'layout'\t=> 'full',\n\t\t\t\t'title'\t\t=> __( 'Import/Export PageLines Settings', 'pagelines' ),\t\t\t\t\t\t\n\t\t\t\t'shortexp'\t=> __( 'Use this form to upload PageLines settings from another install.', 'pagelines' ),\n\t\t\t)\n\t\t)\n\t);\n\n\treturn apply_filters( 'pagelines_account_array', $d ); \n}", "function obtain_accounts_to_correct()\n\t{\n\t return $this->db->select('pamm_accounts.login,pamm_tp.failed_divide,pamm_tp.id')\n\t\t ->from('pamm_accounts')\n\t\t ->join('pamm_tp', 'pamm_accounts.login=pamm_tp.number', 'left')\n\t\t ->where('pamm_tp.failed_divide','1') \n\t\t ->where(\"pamm_accounts.active IN ('1','3','5')\")\n\t\t ->order_by('pamm_tp.id','DESC')\n\t\t ->limit(1)\n\t\t ->get()->result();\n\t}", "public function getAccountID();", "function get_accounts($user_id) {\n\t if ($this->ensure_portal() != -1) {\n\t\t $this->login();\n\t\t\t$ger_params = array(\n\t\t\t 'session' => $this->session,\n\t\t\t 'module_name' => 'Contacts',\n\t\t\t 'module_id' => $user_id,\n\t\t\t 'link_field_name' => 'accounts',\n\t\t\t 'related_module_query' => '',\n\t\t\t 'related_fields' => array(\n\t\t\t 'id',\n\t\t\t 'name',\n\t\t\t ),\n\t\t\t 'related_module_link_name_to_fields_array' => array(\n\t\t\t ),\n\t\t\t 'deleted'=> '0',\n\t\t\t 'order_by' => '',\n\t\t\t 'offset' => 0,\n\t\t\t 'limit' => 5,\n\t\t );\n\n\t\t $ger_result = $this->call(\"get_relationships\", $ger_params);\n\t\t $accounts = [];\n\n\t\t foreach($ger_result->entry_list as $entry) {\n\t\t \t$id = $entry->name_value_list->id->value;\n\t \t\t$name = $entry->name_value_list->name->value;\n\t \t\t$accounts[]= array(\"id\" => $id, \"name\" => $name);\n\t \t}\n\t \treturn $accounts;\n\t } else {\n\t $this->kick();\n\t }\n\t}", "function cases_by_account($account_id) {\n\t $this->login();\n\t\tif ($this->ensure_portal() != -1) {\n\t\t\t$gel_parameters = array(\n\t\t\t\t\"session\" => $this->session,\n\t\t\t\t\"module_name\" => \"Cases\",\n\t\t\t\t\"query\" => \" cases.account_id = '\" . $account_id . \"' \",\n\t\t\t\t\"order_by\" => \" cases.case_number DESC \",\n\t\t\t\t\"offset\" => 0,\n\t\t\t\t\"select_fields\" => array(),\n\t\t\t\t\"link_name_to_fields_array\" => array(),\n\t\t\t\t\"max_results\" => 100,\n\t\t\t\t\"deleted\" => 0,\n\t\t\t\t\"favorites\" => false,\n\t\t );\n\n\t\t $gel_results = $this->call(\"get_entry_list\", $gel_parameters);\n\n\t\t $cases = [];\n\n\t\t foreach($gel_results->entry_list as $entry) {\n\t\t $id = $entry->name_value_list->id->value;\n\t\t $name = $entry->name_value_list->name->value;\n\t\t $number = $entry->name_value_list->case_number->value;\n\t\t $cases[]= array(\"id\" => $id, \"name\" => $name, \"number\" => $number);\n\t\t }\n\n usort($cases, \"sort_cases\");\n\n\t\t return $cases;\n\t\t} else {\n\t\t\t$this->kick();\t\n\t\t}\n\t}", "public function getAccount($account_id)\n\t{\n\t\t$arr = DB::select('SELECT * FROM accounts WHERE account_id = ?', [$account_id]); \n\n\t\tif ($arr[0]) {\n\t\t\treturn $arr[0];\n\t\t} else {\n\t\t\treturn ['status' => 'error', 'error' => 'Ups!!! No accounts.'];\n\t\t}\n\t}", "function importSpecific( $tmpTable, $record)\n\t{\n\t\t// if not record goes with current user\n\t\tif( strlen($record['user_id']) == 0 || $GLOBALS['appshore']->rbac->checkPermissionOnUser($this->appRole, $record['user_id']) == false )\n\t\t\t$record['user_id'] = $GLOBALS['appshore_data']['current_user']['user_id'];\n\n\t\t// check if main account exist\n\t\tif( $record['account_top_id'])\n\t\t{\t\t\t\n\t\t\t$account_top = getOneAssocArray( 'select account_id from accounts where account_id = \"'.$record['account_top_id'].'\" limit 1');\n\t\t\t\t\n\t\t\tif( !isset($account_top['account_id']) )\n\t\t\t\tunset($record['account_top_id']); // we do not set main account if it does not exist already\n\t\t}\t\t\n\t\t\n\t\t// if a main account name is defined but no main account id we check if we find a match else we ignore it\n\t\tif( $record['account_top_name'] && !isset($record['account_top_id']))\n\t\t{\t\t\t\n\t\t\t$account_top = getOneAssocArray( 'select account_id from accounts where account_name = \"'.$record['account_top_name'].'\" limit 1');\n\t\t\t\t\n\t\t\tif( isset($account_top['account_id']) )\n\t\t\t\t$record['account_top_id'] = $account_top['account_id'];\n\t\t}\n\t\t\t\t\t\t\n\t\t// check if account exist\n\t\tif ( $this->isUnique['account_name'] == 'Y' )\n\t\t{\n\t\t\t$account = getOneAssocArray( 'select * from accounts where lower(account_name) = \"'.strtolower($record['account_name']).'\" limit 1');\t\n\t\t\t\n\t\t\tif( isset($account['account_id']) )\n\t\t\t{\t\n\t\t\t\t$this->specific['Accounts']['rejected']++;\n\t\t\t\treturn ERROR_INSERT_DUPLICATED_VALUE;\n\t\t\t}\n\n\t\t\t$record['account_id'] = $account['account_id'];\n\t\t}\n\t\n\t\t// we create a new account\n\t\tif( ($account['account_id'] = insertRow( 'accounts', 'account_id', $record, true)) == NULL )\n\t\t{\n\t\t\t$this->specific['Accounts']['rejected']++;\n\t\t\treturn ERROR_INSERT;\n\t\t}\n\n\t\t$this->specific['Accounts']['created']++;\n\t\treturn true;\n\t}", "function createAccount($sfConn, $dataArray){\n\t\techo(\"<P> createAccount <P>\");\n $sObjects = array();\n foreach ($dataArray as $fieldset)\n {\n\t\techo(\"<P> Set records to Account <P>\");\n $sObject = new sObject();\n $sObject->type = 'Account'; \n $sObject->fields = $fieldset;\n array_push($sObjects, $sObject);\n\t\t\t\t\necho(\"<P> ACCOUNT DETAILS- type: \" . $sObject->type . \n\t\t\" Dealer: \" . $fieldset['Dealer_Number__c'] . \n\t\t\" Name: \" . $fieldset['Name'] . \n\t\t\t\t\t\t\t\" Owner ID: \" . $fieldset['OwnerId'] .\n\t\t\t\t\t\t\t\" Phone \" . $fieldset['Phone'] .\n\t\t\t\t\t\t\t\" Dealer Auction Access: \" . $fieldset['Dealer_Auction_Access_Number__c'] .\n\t\t\t\t\t\t\t\" Dealer_Status__c: \" . $fieldset['Dealer_Status__c'] .\n\t\t\t\t\t\t\t\" IAA_Territory__c: \" . $fieldset['IAA_Territory__c'] .\n\t\t\t\t\t\t\t\" ID: \" . $sObject->Id .\n\t\t\"\");\n\t\t\n }\n\t\techo(\"<P> Ready to roll <P>\");\n $success = create_multiple($sfConn, $sObjects);\n return $success; \n }", "function get_products_for_accounts($accounts)\n{\n module_load_include('module', 'ppt_ta_access', 'ppt_ta_access');\n // Looping over each account and load it.\n $products = [];\n if (empty($accounts)) {\n return $products;\n }\n foreach ($accounts as $account) {\n\n $account_wrapper = entity_metadata_wrapper('node', node_load($account));\n $account_products = $account_wrapper->field_products->value();\n\n // Loop over products, add the product if it isn't already in array.\n foreach ($account_products as $account_product) {\n if ($account_product) {\n if (!in_array($account_product->tid, $products) && ppt_ta_term_access($account_product)) {\n array_push($products, $account_product->tid);\n }\n }\n }\n }\n\n return $products;\n}", "function getUserAmountDetails($user_id)\n\t\t{\n\t\t\t//defining variable\n\t\t\t$total_earning = 0;\n\t\t\t$total_withdraw = 0;\n\t\t\t//getting values of user money\n\t\t\t$userMoney = $this->manageContent->getValueMultipleCondtn('user_money_info', '*', array('user_id'), array($user_id));\n\t\t\tif(!empty($userMoney[0]))\n\t\t\t{\n\t\t\t\tforeach($userMoney as $money)\n\t\t\t\t{\n\t\t\t\t\tif(!empty($money['credit_amount']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$total_earning = $total_earning + $money['credit_amount'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($money['debit_amount']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$total_withdraw = $total_withdraw + $money['debit_amount'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$net_amount = $total_earning - $total_withdraw;\n\t\t\t\n\t\t\treturn array($total_earning,$total_withdraw,$net_amount);\n\t\t}", "function get_wallet($id_trader) \n\t{\n\t\treturn $this->db->select('USD,EUR,GBP,JPY,CHF,TRY,RUR')\n\t\t->where('id',$id_trader)\n\t\t->get('investroom_personal_accounts')->row();\n\t}", "public function getCorpoAdminAccountPaymentAllInfo($id, $accountId, $moduleId)\n {\n $dealInfo = $this->em->getRepository('CorporateBundle:CorpoAccountTransactions')->getAccountTransactionPaymentAllInfo($id, $accountId, $moduleId);\n return $dealInfo;\n }", "public function get_manage_pamm_accounts($id_trader)\n\t{\n\t return $this->db->select()\n\t\t->from('pamm_accounts')\n\t\t->where('tid', $id_trader)\t\n\t\t->where(\"active !='4'\")\t\n\t\t->get()->result();\n\t\t\n\t}", "function get_franchise_account_stat_byid($fid)\r\n\t{\r\n\t\t$det = array();\r\n\t\t\r\n\t\t$ordered_tilldate = @$this->db->query(\"select round(sum((i_orgprice-(i_coup_discount+i_discount))*b.quantity),2) as amt \r\n\t\t\tfrom king_transactions a \r\n\t\t\tjoin king_orders b on a.transid = b.transid \r\n\t\t join pnh_m_franchise_info c on c.franchise_id = a.franchise_id \r\n\t\t\twhere a.franchise_id = ? \",$fid)->row()->amt;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t$not_shipped_amount = $this->db->query(\" select sum(t) as amt from (\r\n\t\t\t\t\t\t\t\t\t\t\tselect a.invoice_no,debit_amt as t \r\n\t\t\t\t\t\t\t\t\t\t\t\tfrom pnh_franchise_account_summary a \r\n\t\t\t\t\t\t\t\t\t\t\t\tjoin king_invoice c on c.invoice_no = a.invoice_no and invoice_status = 1 \r\n\t\t\t\t\t\t\t\t\t\t\t\twhere action_type = 1 \r\n\t\t\t\t\t\t\t\t\t\t\t\tand franchise_id = ? \r\n\t\t\t\t\t\t\t\t\t\t\tgroup by a.invoice_no ) as a \r\n\t\t\t\t\t\t\t\t\t\t\tjoin shipment_batch_process_invoice_link b on a.invoice_no = b.invoice_no and shipped = 0 \",$fid)->row()->amt;\r\n\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t$total_invoice_val = $this->db->query(\"select sum(debit_amt) as amt from pnh_franchise_account_summary where action_type = 1 and franchise_id = ? \",$fid)->row()->amt;\r\n\t\t$total_invoice_cancelled_val = $this->db->query(\"select sum(credit_amt) as amt from pnh_franchise_account_summary where action_type = 1 and franchise_id = ? \",$fid)->row()->amt;\r\n\t\t\t\r\n\t\t\t$sql = \"select sum(credit_amt) as amt \r\n\t\t\t\t\t\tfrom pnh_franchise_account_summary a\r\n\t\t\t\t\t\tjoin pnh_t_receipt_info b on a.receipt_id = b.receipt_id \r\n\t\t\t\t\t\twhere action_type = 3 and a.franchise_id = ? and a.receipt_type = 1 and a.status = 1 and b.status = 1 \r\n\t\t\t\t\t\";\r\n\t\t$total_active_receipts_val = $this->db->query($sql,array($fid))->row()->amt ;\r\n\t\t\t\r\n\t\t\t$sql = \"select sum(receipt_amount) as amt \r\n\t\t\t\t\t\t\tfrom pnh_t_receipt_info \r\n\t\t\t\t\t\t\twhere franchise_id = ? \r\n\t\t\t\t\t\t\tand status in (2,3) and is_active = 1 \r\n\t\t\t\t\t\";\r\n\t\t\t\t\t \r\n\t\t$total_cancelled_receipts_val = $this->db->query($sql,array($fid))->row()->amt;\r\n\t\t\t\r\n\t\t$sql = \"select sum(receipt_amount) as amt \r\n\t\t\t\t\t\t\tfrom pnh_t_receipt_info \r\n\t\t\t\t\t\t\twhere franchise_id = ? and status = 0 and receipt_type = 1 \r\n\t\t\t\t\t\";\r\n\t\t\t\t\t \r\n\t\t$total_pending_receipts_val = $this->db->query($sql,array($fid))->row()->amt;\r\n\t\t\t\r\n\t\t$sql = \"select sum(credit_amt-debit_amt) as amt \r\n\t\t\t\t\t\tfrom pnh_franchise_account_summary where action_type = 5 and franchise_id = ? \";\r\n\t\t$acc_adjustments_val = $this->db->query($sql,array($fid))->row()->amt;\r\n\t\t\r\n\t\t/*\r\n\t\t$sql = \"select sum(credit_amt-debit_amt) as amt \r\n\t\t\t\t\t\t\tfrom pnh_franchise_account_summary where action_type = 7 and franchise_id = ? \";\r\n\t\t$ttl_credit_note_val = $this->db->query($sql,array($fid))->row()->amt;\r\n\t\t */ \r\n\t\t\r\n\t\t$sql = \"select (sum(credit_amt)-sum(debit_amt)) as amt from ((\r\nselect statement_id,type,count(a.invoice_no) as invoice_no,sum(credit_amt) as credit_amt,sum(debit_amt) as debit_amt,date(a.created_on) as action_date,concat('Total ',count(a.invoice_no),' IMEI Activations') as remarks \r\n\t\tfrom pnh_franchise_account_summary a \r\n\t\tjoin t_invoice_credit_notes b on a.credit_note_id = b.id \r\n\t\twhere action_type = 7 and type = 2 \r\n\t\tand a.franchise_id = ? \r\n\t\t \r\n\tgroup by action_date \t\r\n)\r\nunion\r\n(\r\nselect statement_id,1 as type,(a.invoice_no) as invoice_no,sum(credit_amt) as credit_amt,sum(debit_amt) as debit_amt,date(a.created_on) as action_date,remarks\r\n\t\tfrom pnh_franchise_account_summary a \r\n\t\tjoin t_invoice_credit_notes b on a.invoice_no = b.invoice_no \r\n\t\twhere action_type = 7 and type = 1 \r\n\t\tand a.franchise_id = ? \r\n\t\t \r\n\t group by statement_id \r\n)\r\n) as g \r\norder by action_date\";\r\n\t\t$ttl_credit_note_val = $this->db->query($sql,array($fid,$fid))->row()->amt; \r\n\t\t\r\n\t\t$total_active_invoiced = ($total_invoice_val-$total_invoice_cancelled_val);\r\n\t\t\r\n\t\t$data['net_payable_amt'] = ($total_active_invoiced-($total_active_receipts_val+$acc_adjustments_val+$ttl_credit_note_val));\r\n\t\t\r\n\t\t$data['shipped_tilldate'] = $total_active_invoiced-$not_shipped_amount; \r\n\t\t$data['credit_note_amt'] = $ttl_credit_note_val;\r\n\t\t$data['paid_tilldate'] = $total_active_receipts_val;\r\n\t\t$data['uncleared_payment'] = $total_pending_receipts_val;\r\n\t\t$data['cancelled_tilldate'] = $total_cancelled_receipts_val;\r\n\t\t$data['ordered_tilldate'] = $ordered_tilldate;\r\n\t\t$data['not_shipped_amount'] = $not_shipped_amount;\r\n\t\t$data['acc_adjustments_val'] = $acc_adjustments_val;\r\n\t\t$data['current_balance'] = ($data['shipped_tilldate']-$data['paid_tilldate']+$data['acc_adjustments_val']-$data['credit_note_amt'])*-1;\r\n\t\t\r\n\t\t$payment_pen = ($data['shipped_tilldate']-$data['paid_tilldate']+$data['acc_adjustments_val']);\r\n\t\t$data['pending_payment'] = ($payment_pen<0)?0:$payment_pen;\r\n\t\t\t\r\n\t\treturn $data;\t\r\n\t}", "public function getAccountType()\n {\n return $this->account_type;\n }", "public function getAccountType()\n {\n return $this->account_type;\n }", "public function getAccountType()\n {\n return $this->account_type;\n }", "public function hasMultipleAccounts();", "public function index($type)\n {\n\n $organization_id = Session::get('organization_id'); \n\n if($type != 'vendor' && $type != 'customer' && $type != 'wms-customer') abort(403);\n\n if($type == 'wms-customer') $name = 'customer'; else $name = $type;\n\n $person_type_id = AccountPersonType::where('name', $name)->first()->id;\n\n $title = PeopleTitle::pluck('display_name','id');\n $title->prepend('Title','');\n\n $country = Country::where('name', 'India')->first();\n\n $state = State::where('country_id', $country->id)->pluck('name', 'id');\n $state->prepend('Select State', '');\n\n $payment = PaymentMethod::where('organization_id', Session::get('organization_id'))->pluck('display_name','id');\n $payment->prepend('Select Payment Method','');\n\n $terms = Term::select('id', 'display_name')->where('organization_id', Session::get('organization_id'))->pluck('display_name', 'id');\n $terms->prepend('Select Term','');\n\n if($name == 'vendor') {\n\n $purchases = AccountVoucher::where('name', 'purchases')->where('organization_id', $organization_id)->first()->id;\n\n $transaction_type = [$purchases];\n } \n else if($name == 'customer') \n { \n $sale = AccountVoucher::where('name', 'sales')->where('organization_id', $organization_id)->first()->id;\n\n $sale_cash = AccountVoucher::where('name', 'sales_cash')->where('organization_id', $organization_id)->first()->id;\n\n $transaction_type = [$sale, $sale_cash];\n }\n\n $sale = AccountVoucher::where('name', 'sales')->where('organization_id', $organization_id)->first()->id;\n\n $sale_cash = AccountVoucher::where('name', 'sales_cash')->where('organization_id', $organization_id)->first()->id;\n\n \n $peoples = People::select('people.id', 'people.person_id', 'people.first_name', 'people.display_name','people.mobile_no','people.status', 'people.email_address', 'persons.crm_code', 'businesses.bcrm_code', \n DB::raw('IF(SUM(transactions.total) IS NULL, SUM(business.total), SUM(transactions.total)) AS total'),\n DB::raw('IF(persons.crm_code IS NULL, businesses.bcrm_code, persons.crm_code) AS crm_id'),\n DB::raw('CONCAT(COALESCE(people.first_name, \"\"), \" \" ,COALESCE(people.last_name, \"\")) AS contact_person'), \n DB::raw('IF(account_ledger_credit_infos.max_credit_limit IS NULL, business_ledger_credit_infos.max_credit_limit, account_ledger_credit_infos.max_credit_limit) AS max_credit_limit'),\n 'people.group_id','customer_gropings.display_name as group_name'\n )\n ->leftJoin('people_person_types', 'people_person_types.people_id','=','people.id')\n ->leftJoin('persons', 'persons.id','=','people.person_id')\n ->leftJoin('businesses', 'businesses.id','=','people.business_id')\n\n ->leftJoin('transactions', function($query) use($transaction_type) {\n $query->on('transactions.people_id','=','people.person_id');\n $query->whereIn('transactions.transaction_type_id', $transaction_type);\n })\n ->leftJoin('transactions AS business', function($query) use($transaction_type){\n $query->on('business.people_id','=','people.business_id');\n $query->whereIn('transactions.transaction_type_id', $transaction_type);\n })\n\n ->leftJoin('account_ledgers', function($join) use($organization_id)\n {\n $join->on('people.person_id', '=', 'account_ledgers.person_id')\n ->where('account_ledgers.organization_id', $organization_id);\n })\n ->leftjoin('account_ledger_credit_infos','account_ledgers.id','=','account_ledger_credit_infos.id')\n\n ->leftJoin('account_ledgers AS business_ledgers', function($join) use($organization_id)\n {\n $join->on('people.business_id', '=', 'business_ledgers.business_id')\n ->where('business_ledgers.organization_id', $organization_id);\n })\n ->leftjoin('account_ledger_credit_infos AS business_ledger_credit_infos','business_ledgers.id','=','business_ledger_credit_infos.id')\n ->leftjoin('customer_gropings','customer_gropings.id','=','people.group_id')\n\n ->where('people.organization_id', $organization_id)\n ->where('people_person_types.person_type_id', $person_type_id)\n ->groupBy('people.id')\n ->orderBy('people.first_name')\n ->get();\n \n\n $group_name = CustomerGroping::where('organization_id', $organization_id)->pluck('name', 'id');\n $group_name->prepend('Select Group Name', '');\n\n return view('inventory.contact', compact('peoples','name', 'title', 'state', 'payment', 'terms', 'type','group_name'));\n }", "public function actionFind_extra_data() {\n $_loanItems = LoanItem::model()->findAll();\n foreach ($_loanItems as $_loanItem) {\n $_ids[] = $_loanItem->id;\n }\n $_model = new CashAccount();\n $criteria = new CDbCriteria();\n $criteria->condition = \"loan_payment_id IS NOT NULL\";\n $criteria->addNotInCondition(\"loan_payment_id\", $_ids);\n $_dataset = $_model->findAll($criteria);\n echo count($_dataset);\n AppHelper::pr($_dataset);\n exit;\n }", "public function getAccountTypes()\n {\n return AccountTypes::all();\n }", "public function masterSummary($account_id) {\n\n $this->db->where(array('account_id' => $account_id, 'account_type' => 1));\n $rs = $this->db->get('accounts')->result();\n $total = count($rs);\n\n $where = array('account_id' => $account_id, 'active' => 1, 'account_type' => 1);\n $this->db->where($where);\n $res = $this->db->get('accounts')->result();\n $enable = count($res);\n $disable = $total - $enable;\n\n $summary = array();\n $summary[] = array(\n 'live' => $enable,\n 'disable' => $disable\n );\n return $summary;\n }", "public function getAccountDetails(): array\n {\n $response = $this->prepareHttpClient('/mailer/account-details')\n ->send();\n\n $xml = new SimpleXMLElement($this->parseResponse($response));\n return [\n 'id' => (string) $xml->attributes()->id,\n 'credit' => (float) $xml->credit,\n ];\n }", "function getAccountId($account_name)\n\t{\n\t\t global $log;\n $log->info(\"in getAccountId \".$account_name);\n\t\tglobal $adb;\n\t\tif($account_name != '')\n\t\t{\n\t\t\t$sql = \"select accountid from ec_account where accountname='\".$account_name.\"'\";\n\t\t\t$result = $adb->query($sql);\n\t\t\t$accountid = $adb->query_result($result,0,\"accountid\");\n\t\t}\n\t\treturn $accountid;\n\t}", "function employeeAccountTypes(){\n return array(\n 'SKYPE',\n 'FACEBOOK',\n 'GMAIL',\n 'YAHOO',\n 'HOTMAIL',\n 'MICROSOFT',\n );\n}", "function updateAccount($sfConn, $dataArray){\n\t\techo(\"<P> updateAccount \");\n $sObjects = array();\n foreach ($dataArray as $fieldset)\n {\n\t\t\t\techo(\"<P> Set records to Account \");\n $sObject = new sObject();\n $sObject->type = 'Account'; \n $sObject->fields = $fieldset;\n array_push($sObjects, $sObject);\n }\n\t\techo(\"<P> Ready to roll \");\n $success = update_objects($sfConn, $sObjects);\n return $success; \n }", "function arr_one($account){\n\t\t$check_login = check_login($account);\n\t\t$arr = mysqli_fetch_assoc($check_login);\n\t\treturn $arr;\n\t}", "public function saveFinanceAccount($account)\n {\n if(isset($account['paymentaccount_id']) && $account['paymentaccount_id']>0)\n {\n //update info of this account\n $table = Engine_Api::_()->getDbtable('paymentAccounts', 'mp3music');\n $data = array(\n 'account_username' => $account['account_username']\n );\n $where = $table->getAdapter()->quoteInto('paymentaccount_id = ?', $account['paymentaccount_id']);\n $table->update($data, $where);\n }\n else\n {\n $acc = Engine_Api::_()->getDbtable('paymentAccounts', 'mp3music')->createRow(); \n $acc->account_username = $account['account_username'];\n $acc->payment_type = $account['payment_type'];\n $acc->total_amount = 0;\n $acc->account_status = 1;\n $acc->user_id = Engine_Api::_()->user()->getViewer()->getIdentity();\n $acc->save();\n\n }\n return $account;\n }", "public function get_all_balance($id)\n {\n if($id==0){\n $q=$this->db->where(['admin_id'=>1])->get('admin');\n $bal=$q->result_array()[0]['admin_chips'];\n }else if($id>999){\n $q=$this->db->where(['client_id'=>$id])->get('clients');\n $bal=$q->result_array()[0]['client_balance'];\n }else{\n $q=$this->db->where(['dist_id'=>$id])->get('distributor');\n $bal=$q->result_array()[0]['dist_balance'];\n }\n return $bal;\n }", "public function UserInventoryCaseDetail($account_id){\n $this->db->select('count(case_details_inventory.inventoryItemId) as inventoryItemId');\n $this->db->where('case_details_inventory.accountId ', $account_id);\n $this->db->where('case_details_inventory.status', '1');\n $result = $this->db->get('case_details_inventory');\n return $result->result_array();\n }", "public static function getAccount(string $type, int $id = 0) {\n $account = self::query($type, $id);\n if (!$account) {\n $account = self::createAccount($type, $id);\n }\n return $account;\n }", "function getTpaUidNameAr($account_id,$DbConnection)\n{\n\t$querydesaid=\"SELECT third_party_account_assignment.third_party_account_id,account.user_id,account_detail.name FROM third_party_account_assignment USE INDEX(tpaa_aaid_status),account,account_detail \n\tWHERE third_party_account_assignment.admin_account_id='$account_id' and third_party_account_assignment.status=1 \n\t AND account.account_id=third_party_account_assignment.third_party_account_id AND account_detail.account_id=account.account_id and account.status=1\";\n\t//echo\"query=\".$querydesaid.\"<br>\";\n\t$resultdesaid=mysql_query($querydesaid,$DbConnection);\n\t$numRows=mysql_num_rows($resultdesaid);\n\tif($numRows>0)\n\t{\n\t\twhile($row=mysql_fetch_object($resultdesaid))\n\t\t{\t\t\n\t\t\t//$tid=$row->third_party_account_id;\n\t\t\t//$tuser_id=$row->user_id;\n\t\t\t//$tname=$row->name;\n\t\t\t//$selectionbox.=\"<option value='$tid'>$tname($tuser_id)</option>\";\n\t\t\t//echo $tname.\"<br>\";\n\t\t\t$data[]=array('tid'=>$row->third_party_account_id,'tuser_id'=>$row->user_id,'tname'=>$row->name);\n\t\t\t\n\t\t}\n\t\treturn $data;\n\t}\n\telse\n\t{\n\t\t$data[]=array();\n\t\treturn $data;\n\t}\n}", "public function get_transaction_lists($user_id = '', $type = '', $fieldArr = array()) {\n if ($user_id != '' && $type != '') {\n $this->mongo_db->select($fieldArr);\n switch ($type) {\n case 'all':\n $where_clause = array(\"user_id\" => MongoID($user_id));\n break;\n case 'credit':\n $where_clause = array(\"transactions.$.type\" => 'CREDIT', \"user_id\" => MongoID($user_id));\n break;\n case 'debit':\n $where_clause = array(\"transactions.$.type\" => 'DEBIT', \"user_id\" => MongoID($user_id));\n break;\n default:\n $where_clause = array(\"user_id\" => MongoID($user_id));\n break;\n }\n $this->mongo_db->where($where_clause, TRUE);\n $res = $this->mongo_db->get(WALLET);\n return $res;\n }\n }", "public function find($bankAccountId): array\n {\n return Billingo::get(\"bank_accounts/{$bankAccountId}\");\n }", "function loopBills($dbc){\r\n $query = \"SELECT * FROM Bills\";\r\n if($result = $dbc->query($query)){\r\n while($row = $result->fetch_assoc()){\r\n $bill_id = $row['bill_id'];\r\n $amount = $row['amount'];\r\n $account1_id = $row['account1_id'];\r\n $account2_id = $row['account2_id'];\r\n $recurring = $row['recurring'];\r\n $bill = new Bill($bill_id, $amount,$account1_id, $account2_id, $recurring);\r\n if(isset($account1_id) && isset($account2_id) && isset($amount)){\r\n $status = singleBill($dbc, $bill);\r\n }\r\n }\r\n }\r\n}", "function updateAccounts($accountsArray) {\n\t\t$this->db->StartTrans();\n\t\t\n\t\tforeach ($accountsArray as $account) {\n\t\t\tif (!$this->isAccountValid($account))\n\t\t\t\t// This account cannot be added (probably because it does not have a unique prefix)\n\t\t\t\tthrow new Exception($this->copyOps->getCopyForId(\"prefixExistsError\", array(\"prefix\" => $account->prefix)));\n\n\t\t\t// First update the account root. This is failing because the account object has no loginOption.\n\t\t\t// getAccounts is sending back loginOption to DMS though. Seems we have to include it in the DetailsPane.\n\t\t\t//NetDebug::trace('AccountOps.updateAccounts loginOption='.$account->loginOption);\n\t\t\t$this->db->AutoExecute(\"T_AccountRoot\", $account->toAssocArray(), \"UPDATE\", \"F_RootID=\".$account->id);\n\t\t\t\n\t\t\t// Then update the titles within the account\n\t\t\t$this->updateAccountTitles($account);\n\t\t\t\n\t\t\t// Update the admin user object if it exists\n\t\t\tif ($account->adminUser) $this->manageableOps->updateUsers(array($account->adminUser), $account->id);\n\t\t\t\n\t\t\t// Finally delete the licence attributes\n\t\t\t$this->db->Execute(\"DELETE FROM T_LicenceAttributes WHERE F_RootID=?\", array($account->id));\n\t\t\t\n\t\t\tforeach ($account->licenceAttributes as $licenceAttribute) {\n\t\t\t\t$dbObj = array();\n\t\t\t\t$dbObj['F_RootID'] = $account->id;\n\t\t\t\t$dbObj['F_Key'] = $licenceAttribute['licenceKey'];\n\t\t\t\t$dbObj['F_Value'] = $licenceAttribute['licenceValue'];\n\t\t\t\tif ($licenceAttribute['productCode'] > 0) $dbObj['F_ProductCode'] = $licenceAttribute['productCode'];\n\t\t\t\t//NetDebug::trace('AccountOps.licenceAttribute insert '.$dbObj['F_Key'].'='.$dbObj['F_Value'].':'.$dbObj['F_ProductCode']);\n\t\t\t\t$this->db->AutoExecute(\"T_LicenceAttributes\", $dbObj, \"INSERT\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// make the root of the changed account explicit in the log\n\t\tAbstractService::$log->setRootID($account->id);\n\t\tAbstractService::$log->notice(\"Updated account name=\".$account->name.\", id=\".$account->id);\n\t\t\n\t\t$this->db->CompleteTrans();\n\t}", "public function bankaccounts() {\n if ($this->input->get('view')) {\n $id = $this->myencrypt->decrypt_url($this->input->get('bankaccount_id'));\n $data['bankaccount'] = $this->account_model->getBankaccounts(array('mbankaccounts.mbankaccount_id' => $id));\n $data['balance'] = $this->account_model->getBankBalance(array('mbankaccount_id' => $id));\n $data['fixed_deposit'] = $this->account_model->getBankFixedDeposits(array('mbankaccount_id' => $id));\n $data['transactions'] = $this->account_model->getTransactions(false, array('ttransactions.mbankaccount_id' => $id, 'ttransactions.status' => 1));\n } else {\n $data['bankaccounts'] = $this->account_model->getBankaccounts();\n }\n $bank_data['name'] = \"accounts\";\n $data['bank_data'] = $bank_data;\n $this->view('bankaccounts', $data);\n }", "function get_personas($accid)\r\n{\r\n\t$ret[] = array(-1,\"--account--\");\r\n\t$query = \"SELECT * from personas where '$accid'= accid \";\r\n\r\n\t$result = mysql_query ($query) or die(\"can not query table personas - \".mysql_error());\r\n\t$rowcount = mysql_num_rows($result);\r\n\t$odd = false; $first = true;\r\n\tif ($rowcount != 0) {\r\n\t\twhile (true) {\r\n\t\t\t$a = mysql_fetch_object($result);\r\n\t\t\tif ($a===false) break;\r\n\t\t\t$ret[] = array($a->persona,$a->persona);\r\n\t\t}\r\n\t}\r\n\treturn $ret;\r\n}", "public function get_all_partner($transaction_id,$type,&$data_arr,&$data_count){\n global $g_mc;\n /***\n sng:13/apr/2010\n This code is used in lots of places, so i cannot change c.* as well as company name\n */\n $q = \"select t.*,c.*,c.name as company_name from \".TP.\"transaction_partners as t left join \".TP.\"company as c on(t.partner_id=c.company_id) where t.transaction_id='\".$transaction_id.\"' AND t.partner_type='\".$type.\"' order by company_name\";\n if (isset($_REQUEST['debug']))\n echo $q . PHP_EOL;\n $res = mysql_query($q);\n if(!$res){\n return false;\n }\n ///////////////////////////\n $data_count = mysql_num_rows($res);\n if(0 == $data_count){\n //no data to return so\n return true;\n }\n /////////////////\n for($i=0;$i<$data_count;$i++){\n $data_arr[$i] = mysql_fetch_assoc($res);\n /***\n sng:13/apr/2010\n magic quoted company name\n **/\n $data_arr[$i]['company_name'] = $g_mc->db_to_view($data_arr[$i]['company_name']);\n $data_arr[$i]['name'] = $g_mc->db_to_view($data_arr[$i]['name']);\n }\n return true;\n }", "public function getAccountInformation()\n {\n $account = array(\n 'id' => $this->_account->getId(),\n 'nickname' => $this->_account->getNickname(),\n 'firstname' => $this->_account->getFirstname(),\n 'lastname' => $this->_account->getLastname(),\n 'created_at' => $this->_account->getCreated_at()\n ->format('d.m.Y H:M:s'),\n 'image' => $this->getProfileImage()\n );\n\n return $account;\n }", "public function getAmountTransfers($id){\n\n $amountWallets = Wallets::select('amount')->where('id',$id)->get();\n\n return $amountWallets[0]->amount;\n \n }", "function account($id)\r\n{\r\n mysql_selectdb(SQL_AUTH_DATABASE);\r\n $query = \"SELECT * FROM `account` WHERE `id` = $id\";\r\n $sql = mysql_query($query);\r\n return mysql_fetch_array($sql);\r\n \r\n}", "function addVoucher($dr_accounts, $cr_accounts, $auto_voucher,$details=false,$refAccount=null,$narration=null,$on_date=null){\n $drsum=0;\n $crsum=0;\n foreach($dr_accounts as $key=>$val){\n if($val['Amount']==\"\" or $val['Amount']== null or $val['Amount']==0) {\n unset($dr_accounts[$key]);\n continue;\n }\n $drsum += $val['Amount'];\n }\n \n foreach($cr_accounts as $key=>$val){\n if($val['Amount']==\"\" or $val['Amount']== null or $val['Amount']==0) {\n unset($cr_accounts[$key]);\n continue;\n }\n $crsum += $val['Amount'];\n }\n \n\n if($crsum != $drsum OR $crsum == 0) throw $this->exception (\"Debit Amount is not equal to Credit Amount or its Zero\");\n if(count($dr_accounts) > 1 AND count($cr_accounts) > 1) throw $this->exception(\"Many To Many voucher is not supported here, make two entries insted\");\n // throw $this->exception(\" $crsum :: $drsum \");\n\n if($auto_voucher === true){\n $cur_pos=$this->add('Model_Pos');\n $cur_pos->getCurrent();\n $auto_voucher = $cur_pos->getNextVoucherNumber($this->voucher_type);\n }\n \n if($narration===null) $narration = $this->default_narration;\n \n $details_fk=null;\n $has_details=(is_array($details)? true: false);\n \n $ve=$this->add('Model_VoucherEntry');\n \n // throw $this->exception(print_r($dr_accounts));\n\n foreach($dr_accounts as $key=>$val){\n if($val['Amount']==\"\" or $val['Amount']== null or $val['Amount']==0) continue;\n \n $ve['ledger_id']=$key;\n $ve['AmountDR']=$val['Amount'];\n $ve['VoucherNo']=$auto_voucher;\n $ve['Narration']=$narration;\n $ve['VoucherType']=$this->voucher_type;\n $ve['RefAccount']=(isset($val['RefAccount'])? $val['RefAccount']: $refAccount);\n // $ve['Rate']=(isset($val['Rate'])? $val['Rate']: \"\");\n // $ve['Qty']=(isset($val['Qty'])? $val['Qty']: \"\");\n $ve['has_details']=$has_details;\n $ve['entry_side']=\"DR\";\n $ve['entry_count_in_side'] = count($dr_accounts);\n if($on_date != null ) $ve['created_at']=$on_date;\n $ve->save();\n if($details_fk === null) $details_fk=$ve->id;\n $ve->unload();\n }\n foreach($cr_accounts as $key=>$val){\n if($val['Amount']==\"\" or $val['Amount']== null or $val['Amount']==0) continue;\n $ve['ledger_id']=$key;\n $ve['AmountCR']=$val['Amount'];\n $ve['VoucherNo']=$auto_voucher;\n $ve['Narration']=$narration;\n $ve['VoucherType']=$this->voucher_type;\n $ve['RefAccount']=(isset($val['RefAccount'])? $val['RefAccount']: $refAccount);\n // $ve['Rate']=(isset($val['Rate'])? $val['Rate']: \"\");\n // $ve['Qty']=(isset($val['Qty'])? $val['Qty']: \"\");\n $ve['has_details']=$has_details;\n $ve['entry_side']=\"CR\";\n $ve['entry_count_in_side'] = count($cr_accounts);\n if($on_date != null ) $ve['created_at']=$on_date;\n $ve->saveAndUnload();\n }\n if($has_details){\n $vd=$this->add('Model_VoucherDetails');\n foreach($details as $detail){\n $vd['voucher_id']=$details_fk;\n $vd['item_id']=$detail['item_id'];\n $vd['Rate']=$detail['Rate'];\n $vd['Qty']=$detail['Qty'];\n $vd['Amount']=$detail['Amount'];\n $vd->saveAndUnload();\n }\n }\n\n return $auto_voucher;\n \n }", "public function bankaccounttypeAction(){\r\n $this->_checkIfUserIsLoggedIn();\r\n $queryBuilder = $this->getEntityManager()->createQueryBuilder();\r\n $queryBuilder->add('select', 'bat.bactypeid,bat.bankacctype,bat.status')\r\n ->add('from', '\\Admin\\Entity\\BankAccountType bat')\r\n ->orderBy('bat.bactypeid', 'DESC');\r\n $data= $queryBuilder->getQuery()->getArrayResult(); \r\n $keys=array();\r\n foreach($data as $array){ \r\n foreach($array as $key=>$value){\r\n $key=str_replace(\"_\",\" \",$key);\r\n $keys[]=$key ; \r\n }\r\n break;\r\n}\r\n $fieldNames=$keys;\r\n $this->layout()->setVariable('fildnames', $fieldNames);\r\n return new ViewModel(array('fildnames'=>$fieldNames));\r\n }", "public function index()\n {\n \n $merchant = cseo_merchant::where('merchant_name', URL::to('/'))->first();\n\n $title = cseo_options_settings::SELECT('site_identity')->where('merchants_id', $merchant->id)->first();\n\n if ( count( $title ) > 0 ) {\n $site_identity = json_decode( $title->site_identity);\n }\n\n $query = [];\n\n $users = new cseo_account;\n\n $user_count = $users::Select(DB::raw('(Select count(*) from cseo_accounts where account_id != 1 ) countAll, (Select count(*) from cseo_accounts where account_id = 2) countAdmin, (Select count(*) from cseo_accounts where account_id = 3) countDev, (Select count(*) from cseo_accounts where account_id = 4) countSupport '))->first();\n\n \n if(request()->has('account_type')){\n $accounttype = request('account_type'); \n\n $user = $users::Select(DB::raw('cseo_accounts.id, cseo_accounts.first_name, cseo_accounts.last_name, cseo_accounts.position, cseo_accounts.email,cseo_accounts.remember_token,cseo_statuses.status_name, cseo_accounts.is_logged_in, cseo_accounts.created_at'))->join('cseo_statuses', 'cseo_statuses.id', 'cseo_accounts.account_id')->where('account_id',$accounttype)->latest();\n\n $query['account_type'] = $accounttype; \n \n }else{\n\n $user = $users::Select(DB::raw('cseo_accounts.id, cseo_accounts.first_name, cseo_accounts.last_name, cseo_accounts.position, cseo_accounts.email,cseo_accounts.remember_token,cseo_statuses.status_name, cseo_accounts.is_logged_in, cseo_accounts.created_at'))->join('cseo_statuses', 'cseo_statuses.id', 'cseo_accounts.account_id')->where('account_id','!=', '1')->latest();\n \n }\n\n $user = $user->paginate(10)->appends($query);\n\n $account_count = $user->count();\n\n return view('system.account.index', compact('site_identity','user_count', 'user','account_count')); \n\n }", "function getBalancesForRestaurants($restaurants_ids_array) {\r\n $balances_for_restaurants = array();\r\n \r\n DB::useDB(B2B_B2C_COMMON);\r\n $balances = DB::query(\"SELECT id, balance from restaurant_balance WHERE id IN(\" . implode(\",\", $restaurants_ids_array) . \")\");\r\n// echo '<pre>'; var_dump($balances); echo '</pre>';\r\n \r\n foreach($restaurants_ids_array as $rest_id) {\r\n foreach($balances as $balance) {\r\n if($rest_id == $balance[\"id\"]) {\r\n $balances_for_restaurants[$balance[\"id\"]] = $balance[\"balance\"];\r\n }\r\n }\r\n }\r\n \r\n echo '<pre>'; var_dump($balances_for_restaurants); echo '</pre>';\r\n return $balances_for_restaurants;\r\n}", "public function myAccountAggregates($account_id)\n {\n // from los_orders\n // inner join los_users as u on u.id = los_orders.user_id\n // where los_orders.account_id = 4\n // group by user_id,first_name,last_name\n // order by first_name asc\n return $this->query()\n ->select(DB::raw('count(los_orders.id) as order_count'),\n DB::raw('coalesce(sum(total_price),0) as total_price'), 'first_name', 'last_name', 'user_id')\n ->join('los_users as u', 'u.id', '=', 'los_orders.user_id')\n ->where('los_orders.account_id', $account_id)\n ->orderBy('last_name')\n ->orderBy('first_name')\n ->groupBy('user_id')\n ->groupBy('first_name')\n ->groupBy('last_name')\n ->get();\n }", "public static function account($accountId) {\n //Return the information for $accountId\n return self::get('accounts/' . $accountId);\n }", "public function dnbAccountsBAL($api,$args) {\n //invoke dnb api based on query type and query data\n $extDnbApi = $this->getEAPM();\n if (is_array($extDnbApi) && isset($extDnbApi['error'])) {\n throw new SugarApiExceptionRequestMethodFailure(null, array(), null, 424, $extDnbApi['error']);\n }\n $queryData = $args['qdata']; //data posted\n $result = $extDnbApi->dnbBALAccounts($queryData);\n if (is_array($result) && isset($result['error'])) {\n throw new SugarApiExceptionRequestMethodFailure(null, array(), null, 424, $result['error']);\n }\n return $result;\n }", "private function permutateAccount($account, $encrypted = FALSE)\n\t{\n\t\t$accounts = array();\n\n\t\tif ($encrypted)\n\t\t{\n\t\t\t$crypt_config = Crypt_Config::Get_Config(BFW_MODE);\n\t\t\t$crypt_object = Crypt_Singleton::Get_Instance($crypt_config['KEY'], $crypt_config['IV']);\n\t\t}\n\n\t\t// Setup an array of account numbers with prefixed 0's\n\t\t// Remove any leading 0's\n\t\t$account = ltrim($account, '0');\n\n\t\t// create all possible leading zero combinations for the bank account\n\t\t// only if the account number is not 17 digits\n\t\tfor ($i = strlen($account); $i <= 17; $i++)\n\t\t{\n\t\t\t$new = sprintf(\"%0{$i}d\", $account);\n\t\t\t$accounts[] = $encrypted\n\t\t\t\t? $crypt_object->encrypt($new)\n\t\t\t\t: $new;\n\t\t}\n\n\t\treturn $accounts;\n\t}", "public function get_transaction_data( $deal_id = \"\",$type=\"\")\n\t{\n\t\t$conditions = array(\"transaction.deal_id\" => $deal_id,\"type!=\" => 5);\n\t\tif($type){\n\t\t\t\t$conditions = array(\"transaction.deal_id\" => $deal_id,\"type\" => 5);\n\t\t}\n $result = $this->db->from(\"deals\")\n\t ->where($conditions)\n\t \t->join(\"transaction\",\"transaction.deal_id\",\"deals.deal_id\")\n\t \t->orderby(\"transaction.id\",\"DESC\")\n\t ->get();\n return $result;\n\t}", "private function getAccountType($idProfile)\r\n {\r\n $userTable = \"user\";\r\n $profileTable = \"profile\";\r\n \r\n // make query\r\n $query = \"SELECT u.account_type FROM \".$userTable.\" u JOIN \".$profileTable. \" p ON p.id_user = u.id_user WHERE p.id_profile = '$idProfile'\";\r\n $result = mysqli_query($this->db->getDb(), $query);\r\n $row = mysqli_fetch_assoc($result);\r\n \r\n // return account type\r\n return $row['account_type'];\r\n }", "public function getAccountType()\n {\n return $this->accountType;\n }", "function SearchAccountsByUserId($userId)\n{\n $GLOBALS['proxy'] = $GLOBALS['customerProxy']; \n \n // Specify the page index and number of customer results per page.\n\n $pageInfo = new Paging();\n $pageInfo->Index = 0; // The first page\n $pageInfo->Size = 100; // The first 100 accounts for this page of results\n\n $ordering = new OrderBy();\n $ordering->Field = OrderByField::Number;\n $ordering->Order = SortOrder::Ascending; \n\n $predicate = new Predicate();\n $predicate->Field = \"UserId\";\n $predicate->Operator = PredicateOperator::Equals;\n $predicate->Value = $userId; \n\n $request = new SearchAccountsRequest();\n $request->Ordering = $ordering;\n $request->PageInfo = $pageInfo;\n $request->Predicates = array($predicate);\n\n return $GLOBALS['proxy']->GetService()->SearchAccounts($request)->Accounts;\n}" ]
[ "0.6289802", "0.6134071", "0.609225", "0.5778751", "0.57343304", "0.5654055", "0.561856", "0.5610239", "0.56008947", "0.55561996", "0.55483097", "0.55452555", "0.5513649", "0.54710156", "0.5441734", "0.5439063", "0.54292583", "0.5402549", "0.53785807", "0.53743976", "0.5373095", "0.53530794", "0.53450924", "0.53326464", "0.5331831", "0.5288897", "0.52869457", "0.5280374", "0.5278823", "0.5274113", "0.52738297", "0.52659625", "0.5245009", "0.52354974", "0.5223492", "0.52164924", "0.5210343", "0.52022517", "0.5189663", "0.5171277", "0.51676005", "0.5165377", "0.51570815", "0.51570815", "0.5152622", "0.51495004", "0.5130872", "0.5127411", "0.51209325", "0.510796", "0.51063704", "0.510273", "0.50879866", "0.50750846", "0.5070675", "0.5068004", "0.505847", "0.505426", "0.50535524", "0.5053057", "0.50514096", "0.50514096", "0.50514096", "0.50491476", "0.5041656", "0.5028512", "0.50267", "0.5021366", "0.5012799", "0.50121135", "0.5010866", "0.5001537", "0.499094", "0.49837038", "0.49815223", "0.49792317", "0.49660733", "0.49635643", "0.49570838", "0.49484587", "0.4946944", "0.4946593", "0.4946009", "0.49407923", "0.49347454", "0.49302346", "0.49260104", "0.49244854", "0.49215263", "0.49146864", "0.4911323", "0.4905287", "0.4905036", "0.49045303", "0.48965135", "0.48920655", "0.4890637", "0.4884688", "0.4878081", "0.48776644" ]
0.659521
0
/ the constructor loads the necessary core files and classes, and creates a router instance
public function __construct() { $this->loadCoreClasses(); $this->router = new Router(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $this->uri = Fly::app()->getUri();\n Fly::log('debug', \"Router Class Initialized\");\n $this->setRouting();\n }", "function __construct()\n {\n $routesPath = ROOT . '/core/config/routes.php';\n if (file_exists($routesPath)) {\n $this->routes = include_once($routesPath);\n } else {\n die('error');\n }\n }", "public function __construct()\n\t{\n\t\t$this->CI =& get_instance();\n\t\t$this->route_stack = array('', '', '', '');\n\t\tlog_message('debug', 'Router Class Initialized');\n\t}", "function __construct(){\r\n $parser = new Shumvc_RouteParser();\r\n $this->routes = $parser->getRoutes();\r\n }", "public function __construct()\r\n {\r\n $routesPath = ROOT . 'config/routes.php';\r\n $this->routes = include($routesPath);\r\n }", "function __construct() {\n global $urlpatterns,$errorhandler;\n //Initialize config object\n $this->config=new Config();\n //Get all URLs Routes\n $this->routes=$this->config->urlpatterns;\n //Get all ErrorHandler\n $this->error_routes=$this->config->errorhandler;\n //Check for server error\n $this->server_error();\n //Route URLs\n $this->router($this->config->request_path, $this->routes);\n }", "public function __construct()\r\n {\r\n Zend_Loader::registerAutoload();\r\n $this->_frontController = Zend_Controller_Front::getInstance();\r\n $this->_router = $this->_frontController->getRouter();\r\n }", "public function __construct()\n\t{\n\t\tself::$classRouter\t= RecursiveRouter::class;\n\t\tself::$configFile\t= \"config/config.ini\";\n\t\t$this->detectSelf( FALSE );\n\t\t$this->uri\t= getCwd().'/';\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// hack for console jobs\n\t\t$this->initClock();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup clock\n\t\t$this->initConfiguration();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup configuration\n\t\t$this->initModules();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup module support\n\t\t$this->initDatabase();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup database connection\n\t\t$this->initCache();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup cache support\n\t\t$this->initRequest();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup HTTP request handler\n\t\t$this->initResponse();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup HTTP response handler\n\t\t$this->initRouter();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// setup request router\n\t\t$this->initLanguage();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// [DO NOT] setup language support\n\t\t$this->initPage();\n\t\t$this->__onInit();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// call init event (implemented by extending classes)\n\t\tif( $this->getModules()->has( 'Resource_Database' ) )\n\t\t\t$this->dbc->query( 'SET NAMES \"utf8\"' );\t\t\t\t\t\t\t\t\t\t\t\t// ...\n\t}", "private function __construct() {\n\n /**\n * Throw an exception if we are trying to create\n * a second instance of the router class.\n */\n if (self::$instance != null) {\n throw new Exception('Cannot create multiple router instances.');\n }\n\n $this->registry = Registry::getInstance();\n\n request::parseRequest();\n $this->route = request::getRoute();\n\n }", "public function __construct()\n {\n $this->route = new \\Janrain\\Union\\Lib\\Route;\n }", "public function __construct() {\r\n $host = $_SERVER['HTTP_HOST'];\r\n $this->routes['default'] = \"http://$host/index.php\";\r\n $this->routes['login'] = \"http://$host/login.php\";\r\n }", "public function __construct() {\n // Initialisation du mappage du site\n if ($this->router === false) {\n $router = new Router();\n $router->map();\n $this->router = true;\n }\n // On récupère l'URL et on la traite\n $this->request = new Request();\n $this->request = new Router($this->request->url);\n $this->request = $this->request->request;\n // On appelle soit le controlleur soit une page d'erreur\n $controller = $this->loadController();\n $action = $this->request['action']; \n if (class_exists($controller) && in_array($action, get_class_methods($controller))) {\n call_user_func_array(array(new $controller, $action), $this->request['params']);\n } else {\n Router::error(); \n } \n }", "public function bootstrapRouter()\n {\n $this->router = new Router($this);\n }", "protected function initRouter()\n {\n $xml = new \\DOMDocument;\n $xml->load(ROOT_DIR . '/configs/routing.xml');\n\n $routes = $xml->getElementsByTagName('route');\n\n $routeList = new RouteList();\n\n /** @var $DOMRoute DOMElement */\n foreach ($routes as $DOMRoute) {\n $attrController = $DOMRoute->getAttribute('controller');\n list($controller, $action) = explode('::', $attrController);\n\n /** @var Route $route */\n $route =\n new Route(\n $DOMRoute->getAttribute('path'),\n $controller,\n $action\n );\n\n if ($DOMRoute->hasChildNodes()) {\n /** @var \\DOMElement $node */\n $requirements = [];\n foreach ($DOMRoute->childNodes as $node) {\n if ($node->nodeType === XML_ELEMENT_NODE && $node->nodeName === \"requirement\") {\n $requirements[$node->getAttribute('key')] = $node->nodeValue;\n }\n if ($node->nodeType === XML_ELEMENT_NODE && $node->nodeName === \"condition\") {\n $route->setCondition($node->nodeValue);\n }\n }\n $route->setRequirements($requirements);\n }\n\n $routeList->offsetSet(\n $DOMRoute->getAttribute('id'),\n $route\n );\n }\n\n $this->router = new Router($routeList);\n }", "protected function _initLoadRouter(){\r\n\t}", "function __construct()\n\t{\n\t\t$this->load = new Load();\n\t\t$this->model = new Model();\n\n\t\t$this->home();\n\t}", "protected static function createRouter() {\n\t\tstatic::$router = new Router();\n\t}", "private function initRouter()\n {\n $this->di->mapService('core.router', '\\Core\\Router\\Router');\n\n $this->router = $this->di->get('core.router');\n $this->router->setBaseUrl(BASEURL);\n $this->router->setParametersToTarget([\n 'app',\n 'controller',\n 'action'\n ]);\n $this->router->addMatchTypes([\n 'mvc' => '[A-Za-z0-9_]++'\n ]);\n\n // Generic routes\n $routes = [\n 'index' => [\n 'route' => '/[mvc:app]/[mvc:controller]',\n 'target' => [\n 'action' => 'index'\n ]\n ],\n 'action' => [\n 'route' => '/[mvc:app]/[mvc:controller]/[mvc:action]'\n ],\n 'id' => [\n 'route' => '/[mvc:app]/[mvc:controller]/[i:id]?/[mvc:action]'\n ],\n 'child' => [\n 'route' => '/[mvc:app]/[mvc:controller]/[i:id]?/[mvc:action]/of/[i:id_parent]'\n ]\n ];\n\n foreach ($routes as $name => $route) {\n $this->router->map($route['method'] ?? 'GET|POST', $route['route'], $route['target'] ?? [], 'generic.' . $name);\n }\n }", "private function __construct() {\n require_once CORE_LIBRARY . 'CoreAutoloader.php';\n\n // instantiate core-class objects\n $this->autoloader = new CoreAutoloader();\n $this->config = CoreConfig::instance();\n $this->uri = CoreUri::instance();\n $this->message = CoreMessage::instance();\n }", "public function __construct(Router $router)\n {\n //Set the variables\n $this->router = $router;\n }", "public function __construct () {\n $this->router = new \\Skeletal\\Router\\Router();\n $this->session = new Session();\n \n $this->onNotFound = function ( $svc, $req ) {\n return (new Response())->text( '404 - Not Found' )->code(404);\n };\n $this->onException = function ( $svc, $req, $ex ) {\n return (new Response())->serverError()->text( '500 - Server Error' );\n };\n }", "public function __construct() {\n\t\t$this->getRoutes = array();\n\t\t$this->postRoutes = array();\n\t}", "public function __construct()\n {\n $this->checkRequestType($_SERVER['REQUEST_METHOD']);\n\n $this->setRoute();\n\n $this->executeRoute();\n }", "function __construct($a)\n {\n $this->RootDIR = $a . '/';\n \n // Load the config file\n $this->LoadConfigFile();\n \n // Get the autoloaders working\n $this->SetUpAutoLoaders();\n \n // Load classes into this object\n $this->LoadClasses();\n \n // Setup Smarty\n $this->SmartySetup();\n \n // Route the traffic\n $this->Router->RouteTraffic();\n }", "protected function _createRouter(){\n\t\treturn new SimpleRouter();\n\t}", "public function router()\n {\n // Initializing variables\n LSReqenvironment::initialize();\n }", "public function __construct()\n {\n $this->routes = array();\n }", "public function __construct(){\n $this->findRoute();\n }", "protected function _initRouter()\n {\n $front = Zend_Controller_Front::getInstance();\n $router = $front->getRouter();\n \n // Add some routes\n $router->addRoute('routeId', new Zend_Controller_Router_Route('route/definition/:param'));\n //...\n \n // Returns the router resource to bootstrap resource registry\n return $router;\n }", "public function init()\n\t{\n\t\t$this->loader->init();\n\t\t$this->routing->init();\n\t}", "public function __construct() {\n\t$this->app_path = __DIR__;\n\n\t// import main config file\n\trequire_once($this->app_path.'/config.class.php');\n\t$this->config = new config(realpath($this->app_path.'/../config'));\n\t$this->config->add_config(/* The default config */);\n\n\t$this->register_subdomain();\n\t$this->config->set_namespace($this->subdomain);\n\n\t$this->register_paths();\n\n\t// manage include paths\n\t$ip = get_include_path();\n\t$this->ip = realpath($this->FSPATH.'/'.$this->config->paths->sub_folder.'/'.$this->config->paths->app_folder.'/framework').':'.realpath($this->FSPATH.'/'.$this->config->paths->sub_folder.'/'.$this->config->paths->app_folder.'/model').':'.realpath($this->FSPATH.'/'.$this->config->paths->sub_folder.'/'.$this->config->paths->app_folder.'/logic');\n\tset_include_path($ip.':'.$this->ip);\n\n\t// register the autoload function\n\tspl_autoload_register(array($this, 'load_resource'));\n\trequire_once($this->FSPATH.'/'.$this->config->paths->sub_folder.'/'.$this->config->paths->app_folder.'/vendor/autoload.php');\n\n\t$this->set_globals();\n}", "public function __construct(Router $router)\n {\n $this->router = $router;\n }", "public function __construct(Router $router)\n {\n $this->router = $router;\n }", "public function __construct(Router $router)\n {\n $this->router = $router;\n }", "public function __construct(Router $router)\n {\n $this->router = $router;\n }", "public function __construct(Router $router)\n {\n $this->router = $router;\n }", "public function __construct(Router $router)\n {\n $this->router = $router;\n }", "public function __construct(Router $router)\n {\n parent::__construct($router);\n }", "public function __construct()\n\t{\n\t\t$this['router'] = new Router;\n\n\t\t$this['request'] = Request::createFromGlobals();\n\n\t\t// The exception handler class takes care of determining which of the bound\n\t\t// exception handler Closures should be called for a given exception and\n\t\t// gets the response from them. We'll bind it here to allow overrides.\n\t\t$this->registerExceptionHandlers();\n\t}", "protected function _initRouter()\n\t{\n\t\t$cfgPath = $this->getOption('configPath');\n\t\t$config = new Zend_Config_Ini($cfgPath . 'routes.ini', 'production');\n\n\t\t$front = Zend_Controller_Front::getInstance();\n\t\t$router = $front->getRouter();\n\t\t$router->addConfig($config, 'routes');\n\t}", "public function __construct() {\n if(!file_exists(SYSPATH.\"load_class.php\")){\n\t\t\theader('HTTP/1.1 503 Service Unavailable.', TRUE, 503);\n\t\t\techo 'Your appication folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;\n\t\t\texit(3); // EXIT_CONFIG\n\t\t}\n\t\trequire_once(SYSPATH.\"load_class.php\");\n //Enable auto loading from the classes and libraries folders\n $classLoader = new ClassLoader(Array(APPPATH.'classes', APPPATH.'libraries'));\n $classLoader->register();\n $this->classLoader = $classLoader;\n }", "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 }", "public function __construct() {\n if (isset($_GET['rc'])) {\n $this->url = rtrim($_GET['rc'], '/'); // We don't want no empty arg\n $this->args = explode('/', $this->url);\n }\n \n // Load index controller by default, or first arg if specified\n $controller = ($this->url === null) ? 'null' : array_shift($this->args);\n $this->controllerName = ucfirst($controller);\n\n // Create controller and call method\n $this->route();\n // Make the controller display something\n $this->controllerClass->render();\n }", "protected function __construct(Router $router)\n {\n $this->_router = $router;\n }", "public function get_router();", "public function __construct() {\n $this->setRouteData();\n }", "public static function Main() {\n $routes = New Router();\n \n $routes->index();\n }", "function _initialize()\n {\n\n //initalize Loader\n $auto_load=array(\"io\",\"segment\",\"router\");\n \n foreach($auto_load as $library)\n {\n $this->$library=& load_class($library);\n }\n //load loader class\n $this->load =& load_class('Loader');\n \n //call auto load from config file\n $this->load->_auto_load();\n }", "public function __construct()\n {\n $this->ParseUrl();\n $this->Dispatch();\n }", "public function __construct(\\Symfony\\Component\\Routing\\Router $router) {\n //Set stuff\n $this->router = $router;\n\n //Init\n $routeParameters = array();\n }", "public function __construct()\n\n\t{\n $this->thisRoute = Route::current()->uri();\n\t}", "protected function _getRouter() {\n\t\treturn new Router;\n\t}", "public function __construct() {\n // Autoload Dependencies & Helpers\n spl_autoload_register([$this, 'loadBones']);\n // Load in Core Components\n foreach (glob(SKELETON_PATH . 'core/*.php') as $file) {\n list($filePath, $className) = [$file, 'Skeleton_' . basename($file, EXT)];\n if(file_exists($filePath)) {\n include $filePath;\n $this->{strtolower(basename($filePath, EXT))} = new $className($this);\n $this->coreComponents[] = strtolower(basename($filePath, EXT));\n }\n }\n // Core Components Loaded!\n foreach($this->coreComponents as $component) {\n if(method_exists($this->{$component}, '_onLoadFinish')) {\n $this->{$component}->_onLoadFinish();\n }\n }\n // Set environment\n $this->environment = ENVIRONMENT;\n if(!$this->environment) {\n exit(JSON::out('error', 'No environment set!'));\n }\n // Preload stuff is over\n $this->router->setPreloadFlag(false);\n // Run App\n try {\n $skeleton = $this;\n include $this->router->go();\n // the end\n die();\n } catch(NoRouteFoundException $e) {\n JSON::out(array(\n 'status' => 'error', \n 'message' => $e->getMessage()\n ));\n } catch(Exception $e) {\n JSON::out(array(\n 'status' => 'error', \n 'message' => $e->getMessage()\n ));\n }\n }", "public function __construct()\n {\n // Store the instance statically\n static::$instance = $this;\n\n // Load the app's config\n $this->loadConfig();\n\n // Register the error handler\n $this->registerErrorHandler();\n\n // Create our request and response objects\n $this->request = new Request;\n $this->response = new Response;\n\n // Bootstrap the database\n Database::bootstrap($this->config->db->toArray());\n\n // Convert relative store paths to absolute, and bootstrap the cache\n foreach ($this->config->cache as $instance => $config) {\n $cacheStorePath = $config->store_path;\n if ($cacheStorePath !== null) {\n if (!is_dir($cacheStorePath) && is_dir(APP_ROOT.$cacheStorePath)) {\n $this->config->cache->{$instance}->store_path = APP_ROOT.$cacheStorePath;\n }\n }\n }\n Cache::bootstrap($this->config->cache->toArray());\n\n // Convert relative store paths to absolute, and bootstrap the session\n $sessionStorePath = $this->config->session->store_path;\n if ($sessionStorePath !== null) {\n if (!is_dir($sessionStorePath) && is_dir(APP_ROOT.$sessionStorePath)) {\n $this->config->session->store_path = APP_ROOT.$sessionStorePath;\n }\n }\n Session::bootstrap($this->config->session);\n\n // Include the app routes\n require APP_ROOT.'routes.php';\n\n // Register global view variables\n View::addGlobal('appName', $this->config->app->name);\n View::addGlobal('app', $this);\n View::addGlobal('input', $this->request->input);\n\n $this->compileAssets();\n\n // Execute routes\n Router::execute();\n\n if (PHP_SAPI !== 'cli') {\n $this->checkRoute();\n }\n }", "protected function init() {\n\t\t$routes = $this->routePluginManager;\n\t\tforeach ( array (\n\t\t\t\t'hostname' => __NAMESPACE__ . '\\Hostname',\n\t\t\t\t'literal' => __NAMESPACE__ . '\\Literal',\n\t\t\t\t'part' => __NAMESPACE__ . '\\Part',\n\t\t\t\t'regex' => __NAMESPACE__ . '\\Regex',\n\t\t\t\t'scheme' => __NAMESPACE__ . '\\Scheme',\n\t\t\t\t'segment' => __NAMESPACE__ . '\\Segment',\n\t\t\t\t'wildcard' => __NAMESPACE__ . '\\Wildcard',\n\t\t\t\t'query' => __NAMESPACE__ . '\\Query',\n\t\t\t\t'method' => __NAMESPACE__ . '\\Method' \n\t\t) as $name => $class ) {\n\t\t\t$routes->setInvokableClass ( $name, $class );\n\t\t}\n\t\t;\n\t}", "public function __construct() {\n $this->api = \\Slim\\Slim::getInstance();\n\n $this->CSUser = CSUser::getInstance();\n $this->CSAuth = CSAuth::getInstance();\n\n //Login route\n\t\t$this->api->post('/login', array($this, 'login')); \n\n\t\t//Logout rout\n\t\t$this->api->delete('/login', array($this, 'logout'));\n }", "public function __construct(Router $router)\n {\n parent::__construct();\n\n $this->router = $router;\n }", "public function __construct() {\n\t\t\n\t\t// Load components required by this gateway\n\t\tLoader::loadComponents($this, array(\"Input\", \"Net\"));\n\t\t\n\t\t// Load the language required by this gateway\n\t\tLanguage::loadLang(\"alipay\", null, dirname(__FILE__) . DS . \"language\" . DS);\n\t}", "public function __construct()\n {\n // create array with URL parts in $url\n $this->splitUrl();\n // check for controller: no controller given ? then load start-page\n if ($this->url_controller) {\n $controller = ucfirst(strtolower($this->url_controller));\n $pathController = APP . \"controllers/{$controller}.controller.php\";\n if( file_exists($pathController) ) {\n // llamamos al archivo controlador\n require $pathController;\n $action = strtolower($this->url_action).'Action';\n\n if (!empty($this->url_params)) {\n $this->url_controller = new $controller($this->url_params);\n }else{\n $this->url_controller = new $controller();\n }\n // comprobamos si la accion existe\n if (method_exists($this->url_controller, $action)) {\n $this->url_controller->{$action}($this->url_params);\n } else {\n $params = array_merge(array($this->url_action), $this->url_params);\n $this->url_controller->index($params);\n }\n }else{\n header('location: ' . URL . 'error');\n }\n } elseif (!$this->url_controller) {\n require APP . 'controllers/Home.controller.php';\n $page = new Home();\n $page->index();\n }\n }", "function __construct( $file = null ) {\n\t\tparent::__construct( AE_APP . 'routes' ) ;\n\t}", "public function __construct()\n {\n $this->container = Initializer::get()->getContainer();\n\n $this->structure_view = $this->container\n ->get('minphp.mvc')['default_structure'];\n\n // Initialize the structure view\n $this->structure = $this->container->get('view');\n\n // Initialize the main view\n $this->view = $this->container->get('view');\n\n // Load any preset models\n $this->uses($this->uses);\n\n // Load any preset components\n $this->components($this->components);\n\n // Load any preset helpers\n $this->helpers($this->helpers);\n }", "public function __construct() \n {\n parent::__construct();\n $this->load->model(\n [\n 'Pages_model',\n 'Article_model'\n ]\n );\n $this->class_path_name = $this->router->fetch_class();\n }", "public function __construct() {\n\n\t\t$this->actions = [];\n\t\t$this->filters = [];\n\t\t\n\t\t# Components\n\t\t$this->nav = new Nav ();\n\t\t$this->api = new API ();\n\t\t$this->admin = new Admin ();\n\t\t\n\t\t# Define hooks\n\t\t$this->enqueue ();\n\t\t$this->admin_hooks ();\n\t\t$this->admin_ajax_routing ();\n\t\t$this->public_hooks ();\n\t}", "public function __construct(){\n\t\t$url = $this->processUrl();\n\n\t\t//this if statement unsets the defaultController so we can use the one that is being talked to.\n\t\tif(file_exists('../app/controllers/'.$url[0].'.php')){\n\t\t\t$this->defaultController = $url[0];\n\t\t\tunset($url[0]);\n\t\t}\n\n\t\trequire_once('../app/controllers/' .$this->defaultController.'.php');\n\n\t\t$this->defaultController = new $this->defaultController;//instantiate and make it an object\n\n\t\tif(isset($url[1])){\n\t\t\tif(method_exists($this->defaultController,$url[1])){\n\t\t\t$this->defaultMethod = $url[1];\n\t\t\tunset($url[1]);\n\t\t\t}\t\n\t\t}\n\n\t\t\n\t\t$this->parameters = $url ? array_values($url):[];\n\t\t// print_r($this->parameters);\n\n\t\tcall_user_func_array([$this->defaultController,$this->defaultMethod],$this->parameters);\n\t}", "public function __construct()\n\t{\n\t\t$this->system = new System;\n\n\t\t$config = $this->system->getFileContent( \"Config\\\\config.json\" );\n\t\t$config = json_decode( $config, True );\n\n\t\tforeach( $config as $key => $value ) {\n\t\t\t$this->$key = $value;\n\t\t}\n\n\t\tif( $_SERVER['SERVER_NAME'] == \"localhost\" ) {\n\t\t\t$server = \"http://\" . $_SERVER['SERVER_NAME'];\n\t\t} else {\n\t\t\t$server = $_SERVER['SERVER_NAME'];\n\t\t}\n\t\t$this->server = $server . \"/\" . $this->workspace;\n\t\t\n\t\t$this->address = $this->parseAddress( $_SERVER['REQUEST_URI'] );\n\t}", "public function __construct()\n {\n\t\t$this->CI =& get_instance();\n\t\t\n\t\t$this->CI->load->helper('url');\n\t\t$this->CI->load->model('M_root');\n }", "public function __construct() {\n\t\t$this->requester = new Gumroad_Requester();\n\t\t$this->sessions = new Gumroad_Sessions_Endpoint($this->requester);\n\t\t$this->products = new Gumroad_Products_Endpoint($this->requester);\n\t}", "function __construct(){\n spl_autoload_register(function ($className) {\n $ds = DIRECTORY_SEPARATOR;\n $dir = App::$param['path'];\n $className = strtr($className, '\\\\', $ds);\n $file = \"{$dir}{$className}.php\";\n if (is_readable($file)) {\n require_once $file;\n }\n });\n set_include_path(get_include_path() . PATH_SEPARATOR . App::$param['path'] . PATH_SEPARATOR . App::$param['path'] . \"app\" . PATH_SEPARATOR . App::$param['path'] . \"app/libs/PEAR/\");\n }", "public function __construct() {\n $this->loader();\n }", "protected function setUp() {\n $this->object = new MainSetupRouter;\n }", "public function __construct()\n {\n if (Registry::isKeySet('route')) {\n\n $this->route = Registry::get('route');\n\n }\n\n }", "public function __construct(AccessAwareRouterInterface $router) {\n $this->router = $router;\n }", "public function __construct()\n {\n // initialize the default configuration\n $this->initDefaultDirectories();\n $this->initDefaultLoggers();\n $this->initDefaultScanners();\n $this->initDefaultExtractors();\n $this->initDefaultProvisioners();\n $this->initDefaultInitialContext();\n }", "public function __construct() {\n\t\t$this->initFormat();\n\t\t$this->initSession();\n\t\t$this->initDatabase();\n\t\t$this->initProjectSpecific();\n\t\t$this->initController();\n\t\t$this->initDocument();\n\t\t$this->initOutput();\n\t}", "public function __construct(){\n\n\t\t//iniciando o array de rotas\n\t\t$this->initRotues();\n\n\t\t$this->run($this->getUrl());\n\n\t}", "public function initialize()\n {\n $configs = \\Phpfox::get('router.provider')->loadConfigs();\n\n $this->phrases = $configs['phrases'];\n\n foreach ($configs['chains'] as $v) {\n\n if (!isset($v['chain'])) {\n throw new InvalidArgumentException(var_export($v, 1));\n }\n $key = $v['chain'];\n unset($v['chain']);\n if (!isset($this->routes[$key])) {\n $this->routes[$key] = new Routing($key, null);\n }\n $this->routes[$key]->chain($this->build($v));\n }\n\n foreach ($configs['routes'] as $key => $v) {\n if (strpos($key, '.')) {\n list($group) = explode('.', $key, 2);\n $this->routes[$group]->add(new Routing($key, $this->build($v)));\n } else {\n $this->routes[$key] = new Routing($key, $this->build($v));\n }\n }\n }", "public function __construct(){\r\n $this->view = new Views(\"./app/view\");\r\n $this->site = new Site();\r\n $this->user = new User();\r\n }", "public function __construct() {\r\n\t\t\r\n\t\tSession::init();\n\t\tif (!Session::get('local'))\n\t\t\tSession::set('local', DEFAULT_LANGUAGE);\r\n\t\t\r\n\t\t$this->getUrl();\r\n\t\t\r\n\t\t//No controller is specified.\r\n\t\tif (empty($this->url[0])) {\r\n\t\t\t$this->loadDefaultController();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$this->loadCurrentController();\r\n\t\t$this->callControllerMethod();\r\n\r\n\t}", "public function __construct()\r\n {\r\n $this->includes();\r\n $this->setup();\r\n $this->hooks();\r\n }", "function __construct()\n {\n $this->childController = strtolower(get_called_class());\n $this->openDatabaseConnection();\n $this->loadModel();\n $this->loadView();\n }", "function __construct() {\n\t\tsession_start();\n\t\tparent::__construct($_GET);\n\t\t\n\t\t/**\n\t\t * CACHING WERKEN WE HIER NIET UIT : is een db lookup sneller dan een file_Exists?\n\t\t * lijk met wel interessant als de hele pagina wordt gecached.\n\t\t * \n\t\t * check controller in db\n\t\t * if controller not exists > check contoller in dir controller\n\t\t * if exists in dir controller add to cache_controllers\n\t\t * if not exists > 404\n\t\t */\n\t\t\n\t\tif(!$this->getRouter()){\n\t\t\t/**\n\t\t\t * this must be the homepage since there's no controller specified\n\t\t\t */\n\t\t\t\n\t\t\t\n\t\t\tif(file_exists('controller/HomeController.php')) {\n\t\t\t\t\n\t\t\t\t$t = new HomeController('Home');\n\t\t\t\t$t->getView();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tprint('FOAD');\n\t\t\t}\n\t\t\t\t \t\n\t\t}\n\t\telse\n\t\t{\n\n\n\t\t\tif(file_exists('controller/'.$this->getRouter().'Controller.php')) {\n\t\t\t\t\n\t\t\t\t//require_once 'controller/'.$this->getRouter().'.php';\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 * public pags\n\t\t\t\t */\n\t\t\t\t$class = __NAMESPACE__.'\\\\'.$this->getRouter().'Controller';\n\t\t\t\t$t = new $class($this->getRouter(),$this->getArgs());\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\tswitch ($this->getRouter()) {\n\t\t\t\t\tcase 'Login':\n\t\t\t\t\t\t$t = new Login_controller($this->getRouter());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Home':\n\t\t\t\t\t\t$t = new Home_controller($this->getRouter());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Overview':\n\t\t\t\t\t\t$t = new Overview_controller($this->getRouter());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Project':\n\t\t\t\t\t\t$t = new Project_controller($this->getRouter());\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$t->getView();\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//print('return 404 error page');\n\t\t\t\theader(\"Location: /page404\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\n\t\t\t \n\t\t\t\n\t\t}\t\n\t\t\n\t}", "function init(){\n\t\t//$uri = str_replace(BASE_URL,\"\",\"http://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);\n\t\t$uri = str_replace(BASE_URL,\"\",\"//\" . HOST . REQUEST);\n\t\t$this->route($uri);\n\t}", "public static function router() {\n\t\tif (!isset(self::$_router)) {\n\t\t\tself::$_router=new \\GO\\Base\\Router();\n\t\t}\n\t\treturn self::$_router;\n\t}", "public function __construct($config)\n {\n if (isset($_SERVER['PATH_INFO']))\n {\n $this->route_path = $this->pathSplit($_SERVER['PATH_INFO']);\n }\n $this->config = $config;\n $this->defineRoute();\n }", "public function __construct() {\n $this->setRoutes(array(\n 'user' => 'getAllUsers',\n 'user/:userId' => 'getCertainUser',\n 'fixName/:variableName' => 'anotherMethod'\n ));\n }", "private function __construct() {\n\t\t$this->initialise();\n\t}", "public static function load() {\n\t\t\trequire ROOT.'/vendor/autoload.php';\n\t\t\trequire ROOT.'/core/Autoloader.php';\n\t\t\tAutoloader::register();\n\n\t\t\t$router = new Router($_GET['url']);\n\n\t\t\t//FRONT\n\t\t\t//Home\n\t\t\t$router->get('/', 'Home#index');\n\t\t\t$router->get('/home', 'Home#index');\n\t\t\t//Blog\n\t\t\t$router->get('/blog', 'BlogPost#index');\n\t\t\t//Single blog post\n\t\t\t$router->get('/blog/post/:id', 'BlogPost#getSingle')->with('id', '[0-9]+');\n\t\t\t$router->post('/blog/post/:id', 'BlogPost#getSingle')->with('id', '[0-9]+');\n\t\t\t$router->get('/blog/post/like/:id', 'BlogPost#like')->with('id', '[0-9]+');\n\t\t\t//Tags\n\t\t\t$router->get('/blog/tags/:id', 'Tag#showBlogPostsList')->with('id', '[0-9]+');\n\t\t\t//Contact\n\t\t\t$router->get('/contact', 'Contact#index');\n\t\t\t$router->post('/contact/sendMail', 'Contact#sendMail');\n\n\t\t\t//ADMIN\n\t\t\t//Dashboard\n\t\t\t$router->get('/admin', 'Admin\\Admin#index');\n\t\t\t//Blog posts\n\t\t\t$router->get('/admin/posts', 'Admin\\BlogPost#index');\n\t\t\t$router->get('/admin/post/add', 'Admin\\BlogPost#add');\n\t\t\t$router->post('/admin/post/add', 'Admin\\BlogPost#add');\n\t\t\t$router->get('/admin/post/edit/:id', 'Admin\\BlogPost#edit')->with('id', '[0-9]+');\n\t\t\t$router->post('/admin/post/edit/:id', 'Admin\\BlogPost#edit')->with('id', '[0-9]+');\n\t\t\t$router->post('/admin/post/delete', 'Admin\\BlogPost#delete');\n\t\t\t//Comments\n\t\t\t$router->get('/admin/comments', 'Admin\\Comment#index');\n\t\t\t$router->post('/admin/comments/validate', 'Admin\\Comment#validate');\n\t\t\t$router->post('/admin/comments/delete', 'Admin\\Comment#delete');\n\t\t\t//Tags\n\t\t\t$router->get('/admin/tags', 'Admin\\Tag#index');\n\t\t\t$router->get('/admin/tags/add', 'Admin\\Tag#add');\n\t\t\t$router->post('/admin/tags/add', 'Admin\\Tag#add');\n\t\t\t$router->get('/admin/tags/edit/:id', 'Admin\\Tag#edit')->with('id', '[0-9]+');\n\t\t\t$router->post('/admin/tags/edit/:id', 'Admin\\Tag#edit')->with('id', '[0-9]+');\n\t\t\t$router->post('/admin/tags/delete', 'Admin\\Tag#delete');\n\n\t\t\t//ERROR\n\t\t\t$router->get('/error/404', 'Error\\Error#notFound');\n\t\t\t$router->get('/error/403', 'Error\\Error#forbidden');\n\n\t\t\t$router->run();\n\t\t}", "public function __construct()\n {\n // create array with URL parts in $url\n $this->splitUrl();\t\t\t\t\n\t\tif ($this->url_controller == '') {$this->url_controller='home';} /* set to default home */\t\t\n\t\t\n // check for controller: does such a controller exist ?\n if (file_exists('./apps/control/' . $this->url_controller . '.php') ) \n\t\t\t{\n\n\t\t\t\trequire './apps/control/' . $this->url_controller . '.php';\t\t\t\t\t\t \n\t\t\t\tif ($this->url_controller == 'report') \n\t\t\t\t{ \n\t\t\t\t\t$this->url_controller = new $this->url_controller(); \n\t\t\t\t\t$this->url_controller->index($this->url_action);\n\t\t\t\t}\n\t\t\t\tif ($this->url_controller == 'home') { \t\t\t\t\n\t\t\t\t\t$this->url_controller = new $this->url_controller(); \n\t\t\t\t\t$this->url_controller->index('home',$this->url_action);\n\t\t\t\t}\n\t\t\t}\n\n\n \n\t\telse\n\t\t{\n\t\t\t\n\t\t\t$this->url_controller = 'home';\n\t\t\t$this->url_action = '404';\t\t\t\n\t\t\trequire './apps/control/' . $this->url_controller . '.php';\t\t\t\t\t\t \n\t\t\t$this->url_controller = new $this->url_controller(); \n $this->url_controller->index('home',$this->url_action);\n\t\t}\n }", "public function __construct()\n {\n if ($module = Registry::get('request')->getModules()) {\n $path = Micro::getInstance()->config['AppDir'] . $module . '/' . ucfirst(basename($module)) . 'Module.php';\n\n if (file_exists($path)) {\n $path = substr(basename($path), 0, -4);\n self::$module = new $path();\n }\n }\n }", "function __construct()\n {\n $arr = $this->UrlProcess();\n\n //handling controller\n //check controller exists\n if(file_exists(\"./mvc/controllers/\".$arr[0].\".php\")){\n $this->controller = $arr[0];\n unset($arr[0]);\n }\n require_once \"./mvc/controllers/\". $this->controller.\".php\";\n $this->controller = new $this->controller;\n //handling acction\n //check if arr[1] exists\n if(isset($arr[1])){\n //method_exists(class, a method check)\n if( method_exists($this->controller, $arr[1])){\n $this->acction = $arr[1]; \n }\n unset($arr[1]);\n }\n //handding params\n $this->params = $arr?array_values($arr):[];\n\n call_user_func_array([$this->controller, $this->acction], $this->params);\n }", "function __construct(){\n\t\t// URL Rewriting\n\t\t$params = explode(\"/\",$_SERVER['REQUEST_URI']);\n\t\t$this->view = empty($params[1]) ? $this->view : $params[1];\n\t\t$this->list = empty($params[2]) ? $this->list :$params[2];\n\t\t$this->query = empty($_POST['query']) ? $this->query : $_POST['query'];\n\t\t// Live Debugging\n\t\tif (stristr($this->view,\"debug\")){\n\t\t\tinclude(DEBUG_DIR.\"/live_debug.php\");\n\t\t\treturn;\n\t\t}\n\t\t// Front End\n\t\t$this->setListings();\n\t\tif (is_file(ROOT_DIR.\"/view/\".$this->view.\".php\")){\n\t\t\tinclude(ROOT_DIR.\"/view/header.php\");\n\t\t\tif ($this->list == 'search'){\n\t\t\t\tinclude (ROOT_DIR.'/view/search.php');\n\t\t\t}\n\t\t\tinclude(ROOT_DIR.\"/view/\".$this->view.\".php\");\n\t\t\tinclude(ROOT_DIR.\"/view/footer.php\");\n\t\t} else {\n\t\t\tinclude(ROOT_DIR.\"/view/404.php\");\n\t\t}\n\t}", "function __construct()\n\t{\n\t\t// Check repo for any new revisions\n\t\t$this->updateApp();\t\t\n\n\t\t// Create a new amazon connection\t\t\n\t\t$this->amazon();\n\t\t\n\t\t// Configure this server\n\t\t$this->bootstrap();\t\t\n\t}", "public function __construct()\n {\n $this->_remove_magic_quotes();\n $this->_unregister_globals();\n\n $this->_params = Router::factory()->parse($this->get('url'));\n }", "public function __construct()\n\t{\n\t\tCowl::timer('cowl init');\n\t\t\n\t\t@session_start(); // I know that the @-notation is frowned upon, but adding it to session_start saves us unnecessary warnings\n\t\t\n\t\tCache::setDir(COWL_CACHE_DIR);\n\t\tCurrent::initialize(COWL_DIR);\n\n\t\tif ( COWL_CLI )\n\t\t\t$this->parseCLIPath();\n\t\telse\n\t\t\t$this->parseRequestPath();\n\t\t\n\t\tCowl::timer('cowl set defaults');\n\t\t\n\t\t// Get and set all directories for various things.\n\t\tlist(\n\t\t\t$commands_dir, $model_dir, $validators_dir,\n\t\t\t$library_dir, $view_dir, $helpers_dir,\n\t\t\t$helpers_app_dir, $drivers_dir, $app_dir,\n\t\t\t$view_layout_dir, $validator_error_messages, $lang)\n\t\t= \n\t\t\tCurrent::$config->gets('paths.commands', 'paths.model',\n\t\t\t\t'paths.validators', 'paths.library', 'paths.view',\n\t\t\t\t'paths.helpers', 'paths.helpers_app', 'paths.drivers', 'paths.app',\n\t\t\t\t'paths.layouts', 'paths.validator_messages', 'lang');\n\t\t\n\t\tController::setDir($commands_dir);\t\n\t\tDataMapper::setMappersDir($model_dir);\n\t\tDataMapper::setObjectsDir($model_dir);\n\t\tValidator::setPath($validators_dir);\n\t\tValidator::loadStrings($validator_error_messages, $lang);\n\t\tTemplater::setBaseDir($view_dir);\n\t\tTemplater::setLayoutDir($view_layout_dir);\n\t\tLibrary::setPath($library_dir);\t\n\t\tHelpers::setPath($helpers_dir);\n\t\tHelpers::setAppPath($helpers_app_dir);\n\t\tDatabase::setPath($drivers_dir);\n\t\tStaticServer::setDir($app_dir);\n\t\t\n\t\tCowl::timerEnd('cowl set defaults');\n\t\t\n\t\tCowl::timer('cowl plugins load');\n\t\tCurrent::$plugins = new Plugins();\n\t\tCowl::timerEnd('cowl plugins load');\n\t\t\n\t\t// Load default helper\n\t\tHelpers::load('standard', 'form');\n\t\t\n\t\tCowl::timerEnd('cowl init');\n\t}", "public function initialize() {\n $this->setPaths(\n [\n 'namespace' => 'ReIndex\\Controller',\n 'controller' => 'footer'\n ]);\n\n $this->setHostname(Di::getDefault()['config']['application']['domainName']);\n\n $this->addGet('/tour/', ['action' => 'tour']);\n $this->addGet('/help/', ['action' => 'help']);\n $this->addGet('/legal/', ['action' => 'legal']);\n $this->addGet('/privacy/', ['action' => 'privacy']);\n $this->addGet('/careers/', ['action' => 'career']);\n $this->addGet('/advertising/', ['action' => 'advertising']);\n $this->addGet('/contacts/', ['action' => 'contact']);\n $this->addGet('/info/', ['action' => 'info']);\n }", "public function __construct() {\n\n list($null,$controller, $action, $id) = explode(\"/\", $_SERVER['PATH_INFO']);\n \n $this->urlValues['base'] = \"http://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n $this->urlValues['controller'] = $controller ? $controller : \"home\";\n $this->urlValues['action'] = $action;\n $this->urlValues['id'] = $id;\n\n $this->controllerName = strtolower($this->urlValues['controller']);\n $this->controllerClass = ucfirst(strtolower($this->urlValues['controller'])) . \"Controller\";\n\n if ($this->urlValues['action'] == \"\") {\n $this->action = \"index\";\n } else {\n $this->action = $this->urlValues['action'];\n }\n }", "public static function Initialize()\n\t\t{\n\t\t\tself::SetIniDirectives();\n\t\t\tself::AddRoutes();\n\t\t}", "public function __construct()\n {\n parent::__construct();\n $this->app->loadClass('date');\n $this->loadModel('task');\n $this->loadModel('order', 'crm');\n $this->loadModel('customer');\n }", "public function __construct()\n {\n parent::__construct(); \n $this->_ROUTE = \"languages\";\n $this->_TABLE = \"atlantotec_languages\";\n $this->_URL = route($this->_ROUTE_FIX.\".\".$this->_ROUTE); \n $this->_DATA[\"_PAGETILE\"] = \"Languages\"; \n $this->_DATA[\"_ROUTE_ADD\"] = route($this->_ROUTE_FIX.\".\".$this->_ROUTE . \".create\"); \n }", "public static function router(){\n if(iRouter::callMade()) {\n viewManager::registerComponent(iRouter::$route);\n }\n }" ]
[ "0.8297344", "0.788802", "0.7747912", "0.7725001", "0.77034354", "0.77000535", "0.76570654", "0.76074505", "0.7605644", "0.7557966", "0.7504764", "0.74951476", "0.7449673", "0.74465173", "0.7301544", "0.7273089", "0.7268058", "0.7231878", "0.72175306", "0.72009236", "0.7188815", "0.7161417", "0.7128109", "0.70756924", "0.7052148", "0.70489895", "0.704416", "0.70025414", "0.698841", "0.69520164", "0.6951533", "0.69433564", "0.69433564", "0.69433564", "0.69433564", "0.69433564", "0.69433564", "0.6942028", "0.6914726", "0.6908925", "0.689569", "0.6871897", "0.6862946", "0.68608165", "0.68468297", "0.6836106", "0.68309855", "0.6824484", "0.6800312", "0.67830807", "0.67818844", "0.6758279", "0.6750636", "0.67460173", "0.67425823", "0.6712573", "0.6697216", "0.6694855", "0.6689547", "0.66895175", "0.668897", "0.66822654", "0.6674551", "0.6669249", "0.66586584", "0.66556656", "0.66546524", "0.6653194", "0.6623243", "0.66151476", "0.661149", "0.6611342", "0.66108876", "0.6604435", "0.6594038", "0.659336", "0.65906465", "0.65894735", "0.6588316", "0.65858674", "0.6580222", "0.65749884", "0.65669173", "0.6557625", "0.6555598", "0.65505284", "0.65415895", "0.6537224", "0.65368015", "0.65265185", "0.6525332", "0.6523639", "0.65178746", "0.6515723", "0.6515297", "0.6513053", "0.6512234", "0.65110433", "0.650653", "0.65026295" ]
0.88063747
0
/ this is the method that starts the application
public function run() { $this->routeRequest(new Request()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function start() {\n\t\t$this->invoke(\"start\");\n\t}", "public function startup();", "function start_application() {\n\t// The SAPI type is cgi-fcgi when accessed from the browser.\n\tif (PHP_SAPI === 'cgi-fcgi') {\n\t\t// Force secure site.\n\t\tif (FORCE_SECURE) {\n\t\t\tredirect_to_https();\n\t\t}\n\t}\n\n\trequire ABSPATH . 'vendor/autoload.php';\n\n\t// Make sure OpenOffice is running.\n\t// start_openoffice();\n\n\t// Include base classes.\n\tinclude_classes();\n\n\t// Include controllers.\n\tinclude_controllers();\n\n\t// Activate query string parameters.\n\tinclude_query_string();\n}", "function startApplication(){\n\n\t// name space all the stuff for the application\n\t$_SESSION[ SESSION_NAME_SPACE ] = array();\n\t$_SESSION[ SESSION_NAME_SPACE ][ 'systemPath' ] = getcwd();\n\t$_SESSION[ SESSION_NAME_SPACE ][ 'factory' ] = new Factory();\n\n\t// lets output a message that the application has been reloaded.\n\t$initViewState = getFactory()->getBean( 'ViewState' );\n\t$initViewState->setResponse('Application Started at: ' . date( 'l jS \\of F Y h:i:s A' ), 'warning');\n\tsetViewState( $initViewState );\n}", "public function start() {}", "public function start() {}", "public function start() {}", "public function start() {}", "public function start() {}", "public function start() {}", "public function start() {}", "public function start() {}", "public function start() {}", "public function start() {}", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start() {\n\n // TODO: Maybe sometimes\n\n }", "public function start()\n {\n }", "public function start()\n {\n }", "public function start()\n {\n }", "public static function run()\n {\n static::$app->run();\n }", "public function run()\n {\n $this->run_configuration();\n\n $this->request->plugins = $this->pluggins;\n\n $app = $this;\n\n $this->router->start($app);\n }", "public function start()\n {\n // TODO: Implement start() method.\n }", "public static function start(): void {\n }", "abstract public function start();", "abstract public function start();", "public function launchApp()\n {\n if ($this->findAppPort()) {\n return;\n }\n\n exec('open ' . self::APP_LAUNCH_URL);\n\n while (!$this->findAppPort()) {\n sleep(2);\n }\n }", "public function launch() {\n\t\t$controller = ucfirst($this->getController());\n\t\t$method = $this->getMethod();\n\t\t\n\t\tif (file_exists(APPPATH . 'modules/' . $controller . '.php') === FALSE)\n\t\t\tshowError($this->lang->line('syserr_notfound'), 404);\n\t\t\n\t\tinclude_once(APPPATH . 'modules/' . $controller . '.php');\n\t\t\n\t\tif (class_exists($controller) === FALSE)\n\t\t\tshowError($this->lang->line('syserr_notfound'), 404);\n\n\t\t$app = new $controller();\n\t\t\n\t\tif (method_exists($app, $method) === FALSE)\n\t\t\tshowError($this->lang->line('syserr_notfound'), 404);\n\t\t\n\t\t\n\t\t$app->$method();\n\t}", "public function start()\n {\n // For example you can check Auth\n }", "public function run(){\n $this->app->run();\n }", "public function start(): void {}", "public function start () {\n if (!$this->started) {\n $this->restart();\n }\n }", "abstract function start();", "private function start()\n {\n // CSRF Watchdog\n $this->csrfWatchdog();\n\n // Retrieve and other services\n $this->retriever->watchdog();\n\n // Router Templater Hybrid\n $this->renderer->route();\n }", "public function run()\n {\n $this->server->start();\n }", "public function start()\n {\n Session::start();\n\n Environment::start();\n \n Database::start($withDatabase = true);\n \n Router::start();\n }", "public function start(): void;", "private function startEngine(){\n $this->start();\n }", "private function launcher() {\n \n $controller = $this->controller;\n $task = $this->task;\n \n if (!isset($controller)) {\n $controller = 'IndexController';\n }\n else {\n $controller = ucfirst($controller).'Controller';\n }\n \n if (!isset($task)) {\n $task = 'index';\n }\n \n $c = new $controller();\n \n call_user_func(array($c, $task));\n \n Quantum\\Output::setMainView($this->controller, $task);\n \n\n }", "public function run()\n {\n $this->welcome();\n }", "public static function run(){\n //App_Registry::instance();\n //App_Registry::set('Controller_Abstract', new Controller_Abstract());\n\n\t\t//Load Front controller to match url\n\n //echo self::getConfig()->is_installed;\n\n if(self::getConfig()->is_installed == '0'){\n\n echo \" Running Setup \";\n new Setup();\n //echo self::getConfig()->is_installed;\n }\n\n $front = new Controller_Front();\n $frontArray = Controller_Front::match();\n }", "public function start()\n {\n die(\"Must override this function in a driver\");\n }", "public function start()\n\t{\n\t\t$this->define_home_dir_constant();\n\t\t$this->register_root_namespace();\n\t\tspl_autoload_register(array($this, 'autoload'));\n\t}", "public function start()\n {\n $whoops = new Run();\n $handler = new PrettyPageHandler();\n\n $handler->addResourcePath(__DIR__.'/Resources');\n $handler->setEditor('sublime');\n\n $whoops->pushHandler($handler);\n $whoops->register();\n\n $this->whoops = $whoops;\n }", "public function start()\n {\n // nop\n }", "private function run()\n {\n error_reporting(E_ALL|E_STRICT);\n $namespace = 'cli';\n if (defined('NAMESPACE')) {\n $namespace = constant('NAMESPACE');\n }\n elseif (isset($_SERVER, $_SERVER['SERVER_NAME'])) {\n $namespace = $_SERVER['SERVER_NAME'];\n }\n if (!defined('BOOTSTRAP_FILE')) {\n die('Please define BOOTSTRAP_FILE before calling Init::run()');\n }\n Zend_Registry::set('namespace', $namespace);\n try {\n $this->startTimer();\n $this->loadConfig(str_replace(array('.','-'), '_', $namespace));\n $this->setDebug();\n $this->initResources();\n $this->initTimezone();\n $this->initRequest(constant('BOOTSTRAP_FILE'), $namespace);\n $this->initLocale();\n $this->initTranslate();\n $this->initLogging($namespace);\n $this->parseRequest($namespace);\n } catch (WrappedException $we) {\n $this->spawnInitError($we);\n }\n }", "public function bootstrap();", "public function bootstrap();", "public function start()\n {\n $this->registerDefaultServices();\n\n $this->handle($this->request->createFromGlobals());\n }", "public function run(){\n $this->session->start();\n $this->request->prepareUrl();\n $this->file->require('App/index.php');\n list($controller,$method,$arguments) = $this->route->getProperRoute();\n }", "function start()\n {\n $this->startService();\n $this->startSession();\n }", "public static function launcher()\n {\n $displayerrors = get_plugin_setting('displayerrors', 'elgg_developer_tools');\n if ($displayerrors) ini_set('display_errors', 1);\n \n /** delete views if its requested **/\n $deleteviews = get_plugin_setting('deleteviews', 'elgg_developer_tools');\n if ($deleteviews) self::_deleteViews();\n \n /** include firePHP if need be **/\n $firephp = get_plugin_setting('enablefirephp', 'elgg_developer_tools');\n if ($firephp) {\n require_once dirname(__FILE__) . '/firephp/FirePHP.class.php';\n require_once dirname(__FILE__) . '/firephp/fb.php';\n }\n else {\n require_once dirname(__FILE__) . '/FirePHPDisabled.php';\n }\n }", "public static function start()\r\n {\r\n return self::_init();\r\n }", "protected function _before(){\n $this->startApplication();\n }", "static function start()\n {\n $controller_name = 'Main';\n $action_name = 'Index';\n\n $routes = explode('/', $_SERVER['REQUEST_URI']);\n\n // get the name of the controller\n if (!empty($routes[1])) {\n $controller_name = ucfirst($routes[1]);\n }\n\n // get the name of the action\n if (!empty($routes[2])) {\n $action_name = ucfirst($routes[2]);\n }\n\n // add prefixes\n $controller_name = 'Controller' . $controller_name;\n $action_name = 'action' . $action_name;\n\n // take file with controller class\n $controller_file = $controller_name . '.php';\n $controller_path = \"../app/controllers/\" . $controller_file;\n\n try {\n if (!file_exists($controller_path)) {\n throw new \\Exception('Could not find file');\n }\n include \"../app/controllers/\" . $controller_file;\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n // create a controller\n $controller_name = \"App\\\\Controllers\\\\\" . $controller_name;\n $controller = new $controller_name();\n $action = $action_name;\n\n try {\n if (!method_exists($controller, $action)) {\n throw new \\Exception('Could not find method');\n }\n // call the controller action\n $controller->$action();\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n }", "public function startApp($appname){\r\n if (!isset($this->apps[$appname])) throw new error(\"Application dosen't exists, cannot start\");\r\n $this->app = $this->apps[$appname];\r\n return $this->app->start();\r\n }", "public static function main()\n {\n self::initConfig(); \n \n /* Configuracion de manejo de error y Locale */\n self::initEnvironmet();\n \n /* Inicializa Layout */\n self::initLayout();\n \n /* Base de Datos*/\n self::initDataBase();\n \n /*Lenjuaje*/\n self::initLanguaje();\n \n /* Front Controller y Dispatch */\n /*Agregar cualquier otra función antes de esta*/\n self::initFrontController();\n \n \n }", "public function start()\n\t{\n\t\t// Get contoller and action names\n\t\t$this->getControllerName();\n\t\t$this->getActionName();\n\n\t\t// Set Names of executing class and action names\n\t\t$this->class_Name = ucfirst($this->controllerName);\n\t\t$this->action_Name = ucfirst($this->actionName);\n\n\t\t// Set globals variable\n\t\t$this->setGlobalsData();\n\n\t\t// Run action\n\t\t$this->getControllerAction();\n\t}", "public function user_can_start_application()\n\t {\n\t \t$response = $this->get('/');\n\t \t$response->assertSeeText('Service record request');\n\t \t$response->assertSeeText('Start now');\n\t }", "static function start() {\n self::instance()->klein->dispatch(self::instance()->request);\n exit;\n }", "function main() {\n\t\tif (!$this->_registerPid()) {\n\t\t\t$this->out('Unable to register Pid');\n\t\t\t$this->_stop();\n\t\t}\n\t\tif (file_exists($this->params['working'] . DS . '.autotest')) {\n\t\t\tinclude($this->params['working'] . DS . '.autotest');\n\t\t}\n\t\tif (!empty($this->params['notify'])) {\n\t\t\t$this->settings['notify'] = $this->params['notify'];\n\t\t}\n\t\tif (!empty($this->params['mode'])) {\n\t\t\t$this->settings['mode'] = $this->params['mode'];\n\t\t}\n\t\t$suffix = '';\n\t\tif (!empty($this->settings['mode'])) {\n\t\t\t$suffix = ' (' . $this->settings['mode'] . ' mode)';\n\t\t}\n\n\t\tNotify::$method = $this->settings['notify'];\n\t\t$this->addHooks();\n\t\tNotify::message('Autopilot Starting', 'in ' . APP_DIR . $suffix, 0, false);\n\t\t$this->buildPaths();\n\t\t$this->run();\n\t}", "public function launch()\r\n {\r\n // Extract data to be usable inside the view file\r\n extract($this->data);\r\n\r\n // Expected view file format is\r\n // viewfolder.viewfile\r\n $view_file = str_replace(\".\", \"/\", $this->view_file);\r\n\r\n // Require view\r\n require path('app').'/views/'.$view_file.'.php';\r\n }", "protected function main()\n /**/\n {\n parent::run();\n }", "public static function run() {\n if(self::$_init) {\n $route = static::requestRoute();\n if($route && $controller = static::createController($route['controller'])) {\n /** session started */\n App::sessionStart();\n /** running application */\n try {\n /* @var Controller $controller */\n $controller->run($route['action']);\n } catch (\\Exception $e) {\n static::error500('', \"Exception: [{$e->getMessage()}] in {$e->getFile()} at #{$e->getLine()}.\");\n }\n /** on success */\n static::end();\n } else {\n static::error404('Requested invalid resource.');\n }\n } else {\n static::error500('Application was not set up.');\n }\n }", "private function serveStart()\n {\n if (static::$run) {\n return;\n }\n\n static::$run = true;\n\n print \"Running dev/build...\\n\";\n @exec(\"framework/sake dev/build flush=1 > /dev/null 2> /dev/null\");\n\n print \"Finding open port...\\n\";\n\n while (!$this->addressAvailable($this->getHost(), $this->getPort())) {\n $this->setPort($this->getPort() + 1);\n }\n\n if (!$this->running) {\n $host = $this->getHost();\n $port = $this->getPort();\n\n $hash = spl_object_hash($this);\n\n print \"Starting development server...\\n\";\n $command = \"framework/sake dev/tasks/SilverStripe-Serve-Task hash={$hash} host={$host} port={$port} > /dev/null 2> /dev/null &\";\n\n exec($command, $output);\n\n $command = \"ps -o pid,command | grep {$hash}\";\n @exec($command, $output);\n\n if (count($output) > 0) {\n foreach ($output as $line) {\n $parts = explode(\" \", $line);\n $this->pid[] = $parts[0];\n }\n }\n\n sleep(1);\n }\n }", "protected function start()\n {\n $status = $this->autoTestController->start();\n\n PacklinkPrestaShopUtility::dieJson($status);\n }", "function startEngine() {\n }", "public function start()\n {\n $model = new NewModel();\n $listeNews = $model->getNews();\n\n $this->view->home($listeNews);\n }", "public function start()\n {\n // Este módulo requiere a un usuario logueado\n $this -> setRequireUser( true );\n }", "public function start()\n { \n $process = new Process(['/home/pio/PredictionIO-0.14.0/bin/pio-start-all']);\n\n // $process->setWorkingDirectory('/home/pio/PredictionIO-0.14.0/bin');\n\n $process->run();\n\n // Executes after the command finishes\n if (!$process->isSuccessful()) {\n \\Log::info(new ProcessFailedException($process));\n\n session()->flash('error', 'Failed' );\n\n return back()->with('status', 'Failed' );\n }\n \n \\Log::info($process->getOutput());\n\n session()->flash('success', 'Started');\n\n return back()->with('status', 'Started');\n }", "public function run() {\n $this->init();\n $this->welcome();\n $this->setMark();\n $this->startGame();\n }", "abstract public function createApplication();", "static function go()\n {\n chdir(dirname(__DIR__));\n\n // Setup autoloading\n require_once(__DIR__ . '/../init_autoloader.php');\n\n // Run application\n $config = require('config/application.config.php');\n Mvc\\Application::init($config);\n\n $serviceManager = new ServiceManager(new ServiceManagerConfig());\n $serviceManager->setService('ApplicationConfig', $config);\n $serviceManager->get('ModuleManager')->loadModules();\n\n self::$serviceManager = $serviceManager;\n }", "public function start(){\n\n $this->callView();\n\n }", "public function start()\n {\n if ($this->argument('blacklist')) {\n $this->error(\"The blacklist argument hasn't been implemented yet. The command will put logs in every controller.\");\n }\n\n if ($this->confirm('This command will CHANGE your controllers.'.\"\\n\".'Are you sure you want to continue? [y|N]')) {\n $filesArray = $this->dirToArray($this->controllerBaseUrl);\n $this->loopFiles($filesArray);\n $this->info('Wrote log-lines to '.$this->controllerCount.' controllers.');\n }\n }", "public function __construct() {\n $this->start();\n }", "public function createApplication()\n {\n }", "public function run()\n {\n $app = new \\App\\Application();\n $app->status = 'ellection';\n $app->save();\n }", "function startApp($classApplication) {\n new $classApplication();\n}", "static function start($app_directory = NULL, $arg = NULL) {\n \n matrix::get_status();\n avr::status();\n \n self::$script_command = $app_directory . '/third_party/kb/builds/rtl443/build/src/rtl_433 -a -D 2>&1';\n self::$process = proc_open(self::$script_command, self::$descriptorspec, self::$pipes);\n\n if (is_resource(self::$process)) {\n while (!self::$do_quit && !feof(self::$pipes[1])) {\n $in = fgets(self::$pipes[1]);\n $trimmed = trim($in);\n self::process_input($trimmed);\n }\n } else {\n itach::l('NOT RESOURCE....');\n }\n }", "public function start() {\n $this->setup();\n $this->fight();\n }", "public function run()\n {\n $routes = new Routes($this->router);\n $routes->start();\n $this->router->start();\n }", "public function __construct()\n {\n $this->start();\n }", "public function __construct()\n {\n $this->start();\n }", "public function run() {\n if ($this->_config->getConfigFolder() == NULL) {\n $this->setConfigFolder('../config');\n }\n\n $this->_frontController = \\GRG\\FrontController::getInsance();\n\n if ($this->router instanceof \\GRG\\Routers\\IRouter) {\n $this->_frontController->setRouter($this->router);\n }\n elseif ($this->router == 'SomeRouter') {\n // TODO: create router.\n// $this->_frontController->setRouter(new \\GRG\\Routers\\SomeRouter());\n }\n else {\n // If none specified, set default router.\n $this->_frontController->setRouter(new \\GRG\\Routers\\DefaultRouter());\n }\n\n $_sess = $this->_config->app['session'];\n if ($_sess['autostart']) {\n if ($_sess['type'] == 'native') {\n $_s = new \\GRG\\Sessions\\NativeSession(\n $_sess['name'],\n $_sess['lifetime'],\n $_sess['path'],\n $_sess['domain'],\n $_sess['secure']\n );\n }\n elseif ($_sess['type'] == 'database') {\n $_s = new \\GRG\\Sessions\\DBSession(\n $_sess['dbConnection'],\n $_sess['name'],\n $_sess['dbTable'],\n $_sess['lifetime'],\n $_sess['path'],\n $_sess['domain'],\n $_sess['secure']\n );\n }\n else {\n throw new \\Exception('No valid session.', 500);\n }\n\n $this->setSession($_s);\n }\n\n $this->_frontController->dispatch();\n }", "public static function start()\n {\n $controller_name = 'Login';\n $action_name = 'Index';\n\n $routes = explode('/', $_SERVER['REQUEST_URI']);\n \n //getting controller name from requested url\n if (!empty($routes[2]) && $routes[2] != 'index.php') {\n $controller_name = $routes[2];\n }\n \n //getting action name from requested url\n if (!empty($routes[3])) {\n $action_name = $routes[3];\n }\n\n //adding prefixes\n $model_name = 'BwtTest\\Models\\Model'.ucfirst($controller_name);\n $controller_name = 'BwtTest\\Controllers\\Controller'.ucfirst($controller_name);\n $action_name = 'action'.ucfirst($action_name);\n \n // creating model\n $model = null;\n if (class_exists($controller_name)) {\n $controller = new $controller_name($model);\n }\n if (method_exists($controller, $action_name)) {\n // вызываем действие контроллера\n $controller->$action_name();\n } else {\n // здесь также разумнее было бы кинуть исключение\n Route::errorPage404();\n }\n }", "public static function start()\n {\n self::registerDefault();\n\n $page = rex_request('page', 'string');\n $subpage = rex_request('subpage', 'string');\n $function = rex_request('function', 'string');\n\n if ($page === 'import_export' && $subpage === 'import' && $function === 'dbimport') {\n rex_register_extension('A1_AFTER_DB_IMPORT', function () {\n rex_developer_manager::synchronize(null, true);\n });\n } elseif ($page === 'developer' && $function === 'update') {\n rex_register_extension('OUTPUT_FILTER_CACHE', function () {\n rex_developer_manager::synchronize(null, true);\n });\n } else {\n self::synchronize(self::START_EARLY);\n rex_register_extension('OUTPUT_FILTER_CACHE', function () {\n rex_developer_manager::synchronize(rex_developer_manager::START_LATE);\n });\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 }", "public function start_app_backup() {\n \n // Backups the files to update and save update\n (new MidrubBaseAdminCollectionUpdateHelpers\\Apps)->start_backup();\n \n }", "public function index()\n {\n $this->main();\n }", "public function index()\n {\n $this->main();\n }" ]
[ "0.7491657", "0.7436318", "0.7361607", "0.73032093", "0.729617", "0.729617", "0.7295368", "0.72949576", "0.72946435", "0.72946435", "0.72946435", "0.72946435", "0.72946435", "0.72946435", "0.7276878", "0.7276878", "0.7276878", "0.7276878", "0.7276878", "0.7276878", "0.7276878", "0.7276878", "0.7276878", "0.7276878", "0.7276878", "0.7276878", "0.72354496", "0.72053415", "0.72053415", "0.72053415", "0.7188866", "0.7145923", "0.71049654", "0.70248157", "0.6968054", "0.6968054", "0.69595766", "0.694974", "0.6933833", "0.68928826", "0.6878883", "0.6838021", "0.6815522", "0.67952985", "0.6788388", "0.67860353", "0.67845935", "0.6752405", "0.6731714", "0.6715737", "0.66833234", "0.66657037", "0.66604215", "0.6650561", "0.6650461", "0.6642471", "0.66257083", "0.66257083", "0.66032857", "0.6566386", "0.6523381", "0.6523154", "0.6520407", "0.65137607", "0.64743096", "0.64682037", "0.64333534", "0.6427326", "0.64004314", "0.638092", "0.63712186", "0.6359493", "0.6353968", "0.63441753", "0.63429993", "0.63094527", "0.62955415", "0.62774324", "0.6266606", "0.62613773", "0.6258258", "0.62563074", "0.6236684", "0.62251973", "0.62018585", "0.6186071", "0.61733514", "0.6168765", "0.6163161", "0.6146578", "0.6146373", "0.6131556", "0.61290985", "0.61290985", "0.6122169", "0.6111341", "0.60702723", "0.60701525", "0.6065631", "0.60610193", "0.60610193" ]
0.0
-1
/ sets the user application directory
public function setApplicationDirectory($applicationDirectory) { Config::set('PUNYMVC_APPLICATION_DIR', $applicationDirectory . DIRECTORY_SEPARATOR); Config::set('PUNYMVC_APPLICATION_LIBRARIES_DIR', $applicationDirectory . 'libraries' . DIRECTORY_SEPARATOR); Config::set('PUNYMVC_APPLICATION_MODELS_DIR', $applicationDirectory . 'models' . DIRECTORY_SEPARATOR); Config::set('PUNYMVC_APPLICATION_CONTROLLER_DIR', $applicationDirectory . 'controllers' . DIRECTORY_SEPARATOR); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function & SetAppDir ($appDir);", "public static function setAppDir($app_dir)\n {\n self::$app_dir = $app_dir;\n }", "public function setAppDir($appDir)\n\t{\n\t\t$this->_appDir = $appDir;\n\t}", "function setHomeDir($path)\r\n\t{\r\n\t\t$this->pathHomeDir = $path;\r\n\t}", "function setDir()\n{\n\t// This script is sometimes called from the other directories - for auto sending, so we need to change the directory\n\t$pos = strrpos(__FILE__, '/');\n\tif ($pos === false)\n\t{\n\t\t$pos = strrpos(__FILE__, '\\\\');\n\t\tif ($pos === false)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t}\n\t$dir = substr(__FILE__, 0, $pos);\n\tchdir($dir);\n}", "protected static function setAppPath()\n {\n self::$appPath = Application::$root.'app/';\n\n return self::$appPath;\n }", "public function setAppBaseDir($dir)\n {\n $this->applicationBaseDir = $dir;\n }", "private function setWorkingDir()\n {\n $this->workingDirBackup = getcwd();\n chdir(PATH_SITE);\n }", "protected function action_getUserMainDir() {}", "public static function setApplicationFolder($prm_folder_name=\"application\")\n {\n global $application_folder;\n $application_folder = $prm_folder_name;\t\n\t}", "protected function getApplicationDir()\n {\n return app_path('Applications/Standard');\n }", "public static function setUserViewsDir($val) {\n self::$_sUserViewsDir = $val;\n }", "public function setApplicationPath($v) { $this->applicationPath = $v;return $this; }", "protected function setApplicationPermissions()\n\t{\n\t\t$base = $this->app['path.base'].'/';\n\t\t$app = str_replace($base, null, $this->app['path']);\n\t\t$storage = str_replace($base, null, $this->app['path.storage']);\n\t\t$public = str_replace($base, null, $this->app['path.public']);\n\n\t\t$this->setPermissions($app.'/database/production.sqlite');\n\t\t$this->setPermissions($storage);\n\t\t$this->setPermissions($public);\n\t}", "function setCwd($cwd);", "private function setPath()\n {\n $path = getenv('PATH') . ':/usr/local/bin';\n $_SERVER['PATH'] = $path;\n\n }", "public static function setAppViewsDir($val) {\n self::$_sAppViewsDir = $val;\n }", "public function GetAppDir ();", "public static function getAppDir()\n {\n return self::$app_dir;\n }", "public function getAppDir()\n\t{\n\t\treturn $this->_appDir;\n\t}", "protected function setInitialRootPath() {}", "function set_base_dir($dir) {\n if($dir[strlen($dir)-1] != '/') {\n $dir .= '/'; \n }\n \n $this->base_dir = $dir;\n }", "public function setAppBasePath($appRootPath=null){\n\n $this->appRootPath = $appRootPath;\n $_SERVER['APP_ROOT_PATH']= $this->appRootPath;\n\n }", "protected function changePath()\n {\n chdir(base_path());\n }", "function setPath() {\n\n // Wp installation path\n $wp_install_path = str_replace( 'http://' . $_SERVER['HTTP_HOST'], '', site_url());\n\n // Set the instance starting path\n $this->path = $wp_install_path . App::getOption('path');\n\n // Grab the server-passed \"REQUEST_URI\"\n $this->current_uri = $this->request->server()->get('REQUEST_URI');\n\n // Remove the starting URI from the equation\n // ex. /wp/cocoon/mypage -> /mypage\n $this->request->server()->set(\n 'REQUEST_URI', substr($this->current_uri, strlen($this->path))\n );\n\n }", "public function getAppDir()\n {\n return $this->appDir;\n }", "public static function _getAppDir($noSlashes){\n return ($noSlashes) ? ltrim(self::APP_BASE_DIR,'/') : self::APP_BASE_DIR;\n }", "public function getAppDir(): string\n\t{\n\t\treturn $this->appDir;\n\t}", "public function setWorkingDirectory($path);", "public function getAppBaseDirName(){\n return $this->getSite()->getParent()->getAppDir(true);\n }", "function create_user_dir(){\n\t$safeUserDir=bin2hex(random_bytes(4));\n\t$oldDir=getcwd();\n\tchdir(FS_PATH);\n\tif(mkdir(\"$safeUserDir\")) {\n\tchmod(\"$safeUserDir\",0755); //owner=r,w,x group=r,x other=r,x\n\tchdir($oldDir);\n\treturn \t$safeUserDir;\n\t} else {\n\t\tchdir($oldDir);\n\t\terror_log(\"create_user_dir: Could not create user directory in \".FS_PATH,0);\n\t\treturn false;\n\t}\n}", "public function setMageRoot($value) {\n if (preg_match('/^\\/\\w*/i', $value)) {\n $mage_root = $value;\n } else {\n $mage_root = getcwd() . self::$_DS . $value;\n }\n\n $this->_mage_root = $mage_root;\n }", "public static function get_directory() : string {\r\n\t\treturn Core::get_app_path( self::$directory );\r\n\t}", "public function getApplicationPath(){\n return Vimerito::getApplicationPath();\n }", "public function getHomeDirectory() {\n $physicalWebDir = getcwd();\n\n return $physicalWebDir . 'data';\n }", "public static function ApplicationFolder()\n {\n return dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR.Configuration::getApplicationFolder();\n }", "public function createAppDirectory() {\n $dir = app_path() . '/EasyApi';\n if (!file_exists($dir)) {\n mkdir($dir);\n }\n }", "public function getApplicationPath()\n {\n return app_path();\n }", "function app_path()\n {\n return base_path() . '/app';\n }", "public static function getApplicationRoot(){\r\n $path = __DIR__;\r\n return $path;\r\n }", "function app_path($path = '')\n {\n return phanda()->appPath() . ($path ? DIRECTORY_SEPARATOR . $path : $path);\n }", "public function getAppDir() : string\n {\n return $this->appDir;\n }", "function setUser($usr) \n {\n\t\t\t$this->user = ((empty($usr)) ? \"root\" : $usr);\n\t\t}", "public final function getApplicationBaseDir()\r\n\t{\r\n\t\treturn $this->m_basedir;\r\n\t}", "public final function & setApplicationBaseDir( $a_base )\r\n\t{\r\n\t\t$this->m_basedir = (string)$a_base;\r\n\t\treturn $this;\r\n\t}", "public function getHomeDirectory() {\n $physicalWebDir = getcwd();\n\n return $physicalWebDir . 'data';\n }", "function getAppPath() {\r\n\r\n $root = str_replace('\\\\', '/', $_SERVER['DOCUMENT_ROOT']);\r\n if (substr($root, -1) === '/') { // remove any trailing / which should not be there\r\n $root = substr($root, 0, -1);\r\n }\r\n $dir = str_replace('\\\\', '/', dirname(__FILE__));\r\n\r\n $path = str_replace($root, '', $dir) . '/';\r\n\r\n return $path;\r\n\r\n }", "public function setApplicationExecutable(string $location);", "public function changeCurrentDirectory(Directory $newCurrentDirectory);", "function set_root ($root)\n {\n $this->mPath = realpath($root) . '/';\n }", "private function getAppRootDir()\n {\n return $this->container->get('app.parameter_bag')->get('kernel.project_dir');\n }", "function set_rootdir($dir)\n\t{\n\t\tglobal $config;\n\t\tif (!@is_dir($dir))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$dir = str_replace('\\\\', '/', $dir);\n\t\t// creating absolute path for cache\n\t\t$this->cachedir = IP_ROOT_PATH . XS_DIR_CACHE . '/';\n\t\t// creating absolute path for current template and root dir\n\t\t$this->tpldir = IP_ROOT_PATH . 'templates/';\n\t\t$this->tpldir_len = strlen($this->tpldir);\n\t\t$this->root = $dir;\n\t\t$this->tpl = $this->template_name($dir);\n\t\t// check configuration\n\t\t$this->get_config();\n\t\treturn true;\n\t}", "private function getDir() {\n return sprintf(\"%s/%s/\", app_path(), config('newportal.portlets.namespace'));\n }", "public function dir_rewinddir() {}", "public function getApplicationPath() {\r\n\t\treturn $this->getFramework()->getPath(Core::PATH_APPLICATION);\r\n\t}", "public function setWorkingDirectory($directoryPath);", "public function setScriptPath()\n\t{\n\t\t$this->scriptPath = Yii::getPathOfAlias('webroot').$this->ds.$this->suffix.$this->ds;\n\t}", "protected function setUpInstancePath() {\n\t\t$this->instancePath = BEHAT_ROOT;\n\t}", "public function getDefaultApp()\n {\n return APPPATH;\n }", "function getApplicationSystemPath(){\n\treturn $_SESSION[ SESSION_NAME_SPACE ][ 'systemPath' ];\n}", "protected function getAppConfigDir()\n {\n return $this->rootDir . 'src/' . $this->appName . '/conf/';\n }", "public function setWrkDirectory($wrkDir){\n $this->wrkDir = $wrkDir;\n $dir = opendir($this->wrkDir);\n \n if(!$dir){\n return FALSE; //couldn't open directory\n }\n else{\n closedir($dir);\n return;\n }\n }", "public function getAppDir($noSlash = false){\n return self::_getAppDir($noSlash);\n }", "public function set_temp_dir() {\n\t\t$this->temp_dir = tempnam( $this->sys_temp_dir, \"RTV\" );\n\t\tunlink( $this->temp_dir );\n\t\tmkdir( $this->temp_dir );\n\t\techo \"Temporary dir: {$this->temp_dir}\" . PHP_EOL;\n\t}", "protected function setupSession()\n\t{\n\t\t$name = $this->appType . \"id\";\n\t\tsession_name($name);\n\n\t\t$path = getenv(\"P_SESSION_DIR\") ?: $GLOBALS[\"BASE_DIR\"] . \"/session\";\n\t\tif (! is_dir($path)) {\n\t\t\tif (! mkdir($path, 0777, true))\n\t\t\t\tjdRet(E_SERVER, \"fail to create session folder: $path\");\n\t\t}\n\t\tif (! is_writeable($path))\n\t\t\tjdRet(E_SERVER, \"session folder is NOT writeable: $path\");\n\t\tsession_save_path ($path);\n\n\t\tini_set(\"session.cookie_httponly\", 1);\n\n\t\t$path = getenv(\"P_URL_PATH\");\n\t\tif ($path)\n\t\t{\n\t\t\t// e.g. path=/cheguanjia\n\t\t\tini_set(\"session.cookie_path\", $path);\n\t\t}\n\t}", "function set_dir($my_path ){\r\n\r\n $this->icons_dir = $my_path[0];\r\n $this->icons_url = $my_path[1];\r\n $this->is_dir_exist = $this->wpdev_mk_dir($this->icons_dir);\r\n\r\n }", "private static function GetFolder(){\r\n\t return System:::IO:::Path::Combine(\r\n\t System:::Environment::GetFolderPath(System:::Environment:::SpecialFolder::ApplicationData),\r\n\t \"RegEditPHP\");\r\n\t }", "public function setAppPath($path)\n {\n $this->_appPath = $path;\n return $this;\n }", "function appDir($dir)\n{\n return __DIR__.\"/../\".$dir;\n}", "public function getHomeFolder()\n\t{\n\t\t$rootDirectory = $this->getOption('remote.root_directory');\n\t\t$rootDirectory = Str::finish($rootDirectory, '/');\n\t\t$appDirectory = $this->getOption('remote.app_directory') ?: $this->getApplicationName();\n\n\t\treturn $rootDirectory.$appDirectory;\n\t}", "protected function initAdminDirectory()\n {\n if (is_dir($this->installPath())) {\n $this->line('<error>' . $this->installPath() . ' directory already exists !</error> ');\n\n return;\n }\n\n $this->makeDir($this->installPath());\n\n $this->makeDir($this->installPath('Controllers'));\n\n $this->createRoutesFile();\n\n $this->createBootstrapFile();\n\n $this->createControllers();\n\n $this->line('<info>Installing huztw-admin!</info>');\n }", "protected function setAppNamespace()\n {\n $namespace = $this->laravel->getNamespace();\n\n $this->setAppNamespaceOn(app_path('Providers/AdminServiceProvider.php'), $namespace);\n }", "protected function setPersonalDictionaryPath() {}", "function makedir($dir)\n{\n\tglobal $config_vars;\n\t$ret = ForceDirectories($dir,$config_vars['dir_mask']);\n\ttouch ($dir . '/index.html');\n\treturn $ret;\n}", "public function setDirectoryName($dir)\n {\n // Define a hard theme path for the theme\n $this->path = PUBLIC_THEME_DIR . '/' . $dir;\n $this->directory = $dir;\n }", "private function setCurrentPath(){\n\t\t$dirs = explode('/', $this->pages[0]);\n\t\t// if last character is a / then just use it\n\t\tif(empty($dirs[count($dirs)-1]) || is_null($dirs[count($dirs)-1])){\n\t\t\t$this->current_path = $this->pages[0];\n\t\t// if end of path was a filename, remove it and add a /\n\t\t} else {\n\t\t\tarray_pop($dirs);\n\t\t\t$this->current_path = implode('/', $dirs).'/';\n\t\t}\n\t}", "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}", "public function getAppPath() {\n return $this->_application_path;\n }", "public function root_dir($directory=NULL)\n\t{\n\t\t$directory = ((NULL === $directory)) ? '' : \"/$directory\";\n\t\t\n\t\treturn DATAPATH . \"$this->site_name$directory\";\t\n\t}", "public function getRocketeerConfigFolder()\n\t{\n\t\treturn $this->getUserHomeFolder().'/.rocketeer';\n\t}", "protected static function getHomeDir()\r\n {\r\n $home = getenv( 'SLICER_HOME' );\r\n\r\n if ( !$home )\r\n {\r\n if ( defined( 'PHP_WINDOWS_VERSION_MAJOR' ) )\r\n {\r\n if ( !getenv( 'APPDATA' ) )\r\n {\r\n throw new RuntimeException( 'The APPDATA or SLICER_HOME environment variables must be set for slicer to run correctly' );\r\n }\r\n\r\n $home = strstr( getenv( 'APPDATA' ), '\\\\', '/' ) . '/Slicer';\r\n }\r\n else\r\n {\r\n if ( !getenv( 'HOME' ) )\r\n {\r\n throw new RuntimeException( 'The HOME or SLICER_HOME environment variable must be set for slicer to run correctly' );\r\n }\r\n\r\n $home = rtrim( getenv( 'HOME' ), '/' ) . '/.slicer';\r\n }\r\n }\r\n\r\n return $home;\r\n }", "public function set_package_path()\n\t{\n\t\t$module_path=$this->_ci->config->item('module_path');\n\t\t$this->_ci->load->set_package_path($module_path.'/'.$this->type.'/'.$this->key);\n\t}", "public function setPath($name = null, $_path, $appBaseDir = false){\n return $this->_getObjectPath()->addPath($name, $_path, $appBaseDir);\n }", "public function getRelativeDataDir()\n\t{\n\t\treturn 'ash';\n\t}", "public function setBasePath($value)\n\t{\n\t\t$this->basePath = rtrim($value, DIRECTORY_SEPARATOR);\n\t}", "public function set_path() {\n\t\t\t\n\t\t\t// pick up the path types\n\t\t\t$path_types = include_once(CONFIGPATH . 'path-types.php' );\n\n\t\t\t// get the base path for the deploy type\n\t\t\t$base_path = $path_types[ $this->repo[ 'type' ] ];\n\n\t\t\t// check if it is a valid path\n\t\t\t$this->is_path_valid( $base_path );\n\n\t\t\t// append the repositories name to get the final deploy path\n\t\t\t$this->repo[ 'path' ] = $base_path . '/' . $this->repo[ 'name' ];\n\t\t}", "protected function getAppPath()\n {\n return __DIR__. '/../../../../app/';\n }", "public function getHomeDir()\n {\n return $this->homeDir;\n }", "public function setDir($dir);", "protected function setInitialRelativePath() {}", "function setProgramPath($programPath)\r\n\t{\r\n\t\t$this->programPath = $programPath;\r\n\t}", "public function changeWorkingDirectory($path);", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../uploads/user/';\n }", "public function setAppBasePath($basePath)\n\t{\n\t\t$this->_appBasePath = $basePath;\n\t}", "public function getRootDir();", "private static function findUserHome()\n {\n if (false !== ($home = getenv('HOME'))) {\n return $home;\n }\n\n if (self::isWindows() && false !== ($home = getenv('USERPROFILE'))) {\n return $home;\n }\n\n if (function_exists('posix_getuid') && function_exists('posix_getpwuid')) {\n $info = posix_getpwuid(posix_getuid());\n\n return $info['dir'];\n }\n\n throw new \\RuntimeException('Could not determine user directory');\n }", "protected function getAppPath()\n {\n return config()->path->app;\n }", "private function create_site_root() {\n\n\t\tif ( is_dir( $this->site_root ) ) {\n\t\t\tEE::error( \"Webroot directory for site $this->site_name already exists.\" );\n\t\t}\n\n\t\tif ( ! \\EE\\Utils\\default_launch( \"mkdir $this->site_root\" ) ) {\n\t\t\tEE::error( \"Cannot create directory $this->site_root. Please check that folder permission allows easyengine to create directory there.\" );\n\t\t}\n\n\t\ttry {\n\t\t\t$this->level = 1;\n\t\t\t$whoami = EE::launch( \"whoami\", false, true );\n\n\t\t\t$terminal_username = rtrim( $whoami->stdout );\n\n\t\t\tif ( ! chown( $this->site_root, $terminal_username ) ) {\n\t\t\t\tthrow new Exception( 'Could not change ownership of the site root. Please make sure you have appropriate rights.' );\n\t\t\t}\n\t\t}\n\t\tcatch ( Exception $e ) {\n\t\t\t$this->catch_clean( $e );\n\t\t}\n\n\t\treturn true;\n\t}", "public function set_working_dir( $dir_path )\n\t{\n\t\tif ( is_string($dir_path) ) {\n\t\t\tif ( $new_path = realpath($dir_path) ) {\n\t\t\t\t$dir_path = $new_path;\n\t\t\t\tif ( is_dir($dir_path) ) {\n\t\t\t\t\t$this->dir_path = $dir_path;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Exception('\"' . $dir_path . '\" does not exist.');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function setDir($dir)\n {\n if(!is_dir($dir)) {\n mkdir($dir);\n }\n\n\t $this->dir = $dir;\n }", "function system_app_temp_dir($subfolder = '', $appendnc = true)\n{\n global $CONFIG;\n \n if($subfolder)\n {\n if(starts_with($subfolder, '/'))\n $subfolder = substr($subfolder, 1);\n if(!ends_with($subfolder, '/'))\n $subfolder .= '/';\n }\n $basedir = (avail($CONFIG, 'app_temp') ? $CONFIG['app_temp'] : sys_get_temp_dir().'/'.session_name().'/');\n if(!ends_with($basedir, '/'))\n $basedir .= '/';\n\n if (substr(sprintf('%o', @fileperms($basedir)), -3) != '777')\n @chmod($basedir, 0777);\n\n if($appendnc)\n $basedir .= getAppVersion('nc').'/';\n \n if( substr(sprintf('%o', @fileperms($basedir)), -3) != '777' )\n @chmod($basedir, 0777);\n \n $folder = $basedir.($subfolder ?: '');\n $folder = str_replace(['..'], [''], $folder);\n $folder = (stripos(PHP_OS, 'WIN') === 0)\n ?preg_replace('/[^0-9a-zA-Z\\/\\-\\_\\\\\\\\:]/', '', $folder) // accept \\ and : on windows\n :preg_replace('/[^0-9a-zA-Z\\/\\-\\_]/', '', $folder);\n while(strpos($folder, '//'))\n $folder = str_replace('//', '/', $folder);\n if( !file_exists($folder) )\n {\n if(!@mkdir($folder, 0777, true))\n WdfException::Raise('Unable to create app temp folder: '.$folder);\n }\n if( substr(sprintf('%o', @fileperms($folder)), -3) != '777' )\n {\n @chmod($folder, 0777);\n clearstatcache(true,$folder);\n if( substr(sprintf('%o', @fileperms($folder)), -3) != '777' )\n WdfException::Raise('App temp folder is not writable: '.$folder);\n }\n return $folder;\n}" ]
[ "0.7659501", "0.6725675", "0.6611988", "0.6565697", "0.65458095", "0.651755", "0.6434755", "0.64287907", "0.63730067", "0.62439466", "0.61653924", "0.6160163", "0.6083304", "0.60296994", "0.59885216", "0.59426373", "0.5937187", "0.5929818", "0.5892706", "0.5880956", "0.5879691", "0.5784411", "0.5768147", "0.57350975", "0.56856006", "0.5680871", "0.5660609", "0.565599", "0.56300384", "0.56063366", "0.55838764", "0.5577335", "0.5568294", "0.55618227", "0.5554362", "0.55483526", "0.5546751", "0.55316406", "0.55096686", "0.5480147", "0.5450732", "0.5449957", "0.54245085", "0.5421747", "0.5418682", "0.540636", "0.5395527", "0.53947866", "0.53921163", "0.5379365", "0.53618", "0.5340176", "0.5338388", "0.5328372", "0.53248256", "0.53220415", "0.5320817", "0.531316", "0.5309954", "0.5298905", "0.52900904", "0.52729046", "0.5271453", "0.5259334", "0.5256931", "0.5231318", "0.5224397", "0.52134484", "0.5201262", "0.52007574", "0.51945436", "0.5194431", "0.5167266", "0.51667154", "0.51632816", "0.5156694", "0.5156183", "0.51475805", "0.51460886", "0.514599", "0.5144167", "0.5126945", "0.51267433", "0.5123347", "0.5117057", "0.51076376", "0.50992465", "0.5095684", "0.50934577", "0.5091884", "0.5089125", "0.5084171", "0.50751483", "0.5073433", "0.50731385", "0.5071776", "0.5067163", "0.5060341", "0.50563514", "0.50541705", "0.50537187" ]
0.0
-1
/ sets a route for the GET request method
public function get($route, $action) { $this->router->addRoute('GET', $route, $action); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAddRouteShorthandMethodGet()\n {\n $this->collection->get('name', '/', 'action');\n\n $this->assertCount(1, $this->collection->all());\n\n $routes = $this->collection->all();\n\n $this->assertArrayHasKey('0', $routes);\n\n $this->assertContains('GET', $routes[0]->getMethods());\n }", "protected function getHttpMethod()\n {\n return 'GET';\n }", "public function route() {\n\t\t$method = $_SERVER['REQUEST_METHOD'];\n\t\t$request = (isset($_SERVER['PATH_INFO'])) ? explode(\"/\", trim($_SERVER['PATH_INFO'], \"/\")) : \"\";\n\t\t\n\t\treturn $this->routeRequest($method, $request);\n\t}", "public static function Route()\n { \n $uri = self::getURI(); // get path\n $uri = self::parseGET($uri); // fill $_GET with params and strip them\n self::$uri = $uri;\n\n self::activateController($uri);\n }", "public static function get($route, $options){\n self::register('GET', $route, $options);\n }", "public function route(string $requestUri, string $requestMethod);", "public function getMethod()\n {\n return Http::GET;\n }", "public function getRedirectMethod()\r\n {\r\n return 'GET';\r\n }", "public function getMethod()\n {\n return 'GET';\n }", "public function get_route()\n {\n }", "public function route()\n\t{\n\t\t/* [http|https]/[Ajax|]/[Get|Post|Delete|Put]/uri */\n\t\t$this->route = $this->route_raw = ($this->c->Request->is_https ? 'https' : 'http').'/'.($this->c->Request->is_ajax ? 'Ajax' : '').'/'.$this->c->Request->request.'/'.$this->c->Request->uri;\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->preRouter();\n\n\t\t/* rewrite dispatch route */\n\t\tforeach ($this->c->router['routes'] as $regexpath => $switchto) {\n\t\t\tif (preg_match($regexpath, $this->route)) {\n\t\t\t\t/* we got a match */\n\t\t\t\t$this->route = preg_replace($regexpath, $switchto, $this->route);\n\t\t\t\t$this->route_matched = $regexpath;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->postRouter();\n\n\t}", "public function getRoute()\n {\n }", "private function getRoute(){\n\t}", "public static function route();", "public function get(...$args) {\n $this->registerRouteHandler('GET', ...$args);\n }", "public function getMethod()\n {\n return $this->method ?: 'GET';\n }", "public function testRouterAddByGet($method)\n {\n $router = new Router();\n\n $router->get(\"\", function () {\n return \"get\";\n });\n\n $router->always(function () {\n return \"not get\";\n });\n\n $res = $router->handle(\"\", $method);\n if ($method === \"GET\") {\n $this->assertEquals(\"get\", $res);\n }\n if ($method !== \"GET\") {\n $this->assertEquals(\"not get\", $res);\n }\n\n $routes = $router->getAll();\n $this->assertEquals(2, count($routes));\n }", "abstract public function getRoute();", "public static function get($route, $function){\n Router::register_route($route, $function, 'GET');\n }", "public function get($route, $controllerAction = '');", "static function route () {\n\t\tif (isset($_GET['path'])) {\n\t\t\t$get_path = $_GET['path'];\n\t\t}\n\t\telse {\n\t\t\t$get_path = '/';\n\t\t}\n\n\t\t// check if GET path has a match, show 404 by default if it does not\n\t\t$parameters = [];\n\t\t$controller_method = 'AppController::four_zero_four';\n\n\t\tforeach (self::$routes as $route) {\n\t\t\tif ($route['regex_path'] != '/') {\n\t\t\t\t$route['regex_path'] = trim($route['regex_path'], '/');\n\t\t\t}\n\n\t\t\tif (preg_match('|^'.$route['regex_path'].'$|i', $get_path, $parameters)) {\n\t\t\t\t// match found for GET path\n\t\t\t\tif ($route['auth_required'] == 'not_signed_in' && AppUser::is_signed_in()) {\n\t\t\t\t\t// auth required is not_signed_in and user is signed in, redirect to dashboard\n\t\t\t\t\tRedirector::redirect('dashboard');\n\t\t\t\t}\n\t\t\t\telse if ($route['auth_required'] == 'signed_in' && !AppUser::is_signed_in()) {\n\t\t\t\t\t// auth required is signed in and user is not signed in, redirect to sign in page\n\t\t\t\t\tRedirector::redirect('sign_in');\n\t\t\t\t}\n\n\t\t\t\tif ($route['permission_required'] == null || AppUser::has_permission($route['permission_required'])) {\n\t\t\t\t\t// set controller method if user has permission\n\t\t\t\t\t$controller_method = $route['controller_method'];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// user does not have permission, redirect to index\n\t\t\t\t\tRedirector::redirect('/');\n\t\t\t\t}\n\n\t\t\t\t// remove first parameter as it is the GET path and not a value we want\n\t\t\t\tif (!empty($parameters)) {\n\t\t\t\t\tunset($parameters[0]);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// route to the corresponding controller method\n\t\tcall_user_func_array($controller_method, $parameters);\n\t}", "public function getRoute();", "protected function loadRoute()\n {\n $this->post('/task', 'task.controller:saveAction');\n\n // Url for update task\n $this->put('/task/{id}', 'task.controller:updateAction');\n\n // Url for see one task\n $this->get('/task/{id}', 'task.controller:getAction');\n\n // Url for delete task\n $this->delete('/task/{id}', 'task.controller:deleteAction');\n\n // Url for list of tasks\n $this->get('/task', 'task.controller:listAction');\n\n //Get Tag list\n $this->get('/tags', 'tag.controller:listAction');\n\n //Add tag to task\n $this->post('/addTag', 'tag.controller:setTagAction');\n\n //Add tag to tag list\n $this->post('/tag', 'tag.controller:saveAction');\n\n //Search by tag\n $this->get('/search/tag', 'tag.controller:searchAction'); \n\n // Url for delete tag in tag list\n $this->delete('/tag', 'tag.controller:deleteAction');\n \n // Url for auth github\n $this->post('/github', 'github.controller:authAction'); \n }", "private function loadRoute()\n\t{\n\t\t/*\n\t\t* Se o controller nao for passado por GET,\n\t\t* assume-se como padrão o controller 'IndexController';\n\t\t*/\n\t\t$this->st_controller = isset($_REQUEST['controle']) ? $_REQUEST['controle'] : 'index';\n\t\t\n\t\t/*\n\t\t* Se a action nao for passada por GET,\n\t\t* assume-se como padrão a action 'IndexAction';\n\t\t*/\n\t\t$this->st_action = isset($_REQUEST['acao']) ? $_REQUEST['acao'] : 'index';\n\t}", "public function setRoute() {\n $address = $_SERVER['REQUEST_URI'];\n \n $this->determineControllerAndMethod($address);\n\n $this->determineArguments($address);\n }", "public function route($pattern,$cb = null,$conditions=null){\n\t\treturn $this->add_route('GET',$pattern,$cb,$conditions);\n\t}", "public function GetRouteGetRequestsOnly ();", "public function getMethod()\r\n {\r\n if (isset($this->server['REQUEST_METHOD'])) {\r\n return strtoupper($this->server['REQUEST_METHOD']);\r\n }\r\n\r\n return 'GET';\r\n }", "public function & SetRouteGetRequestsOnly ($routeGetRequestsOnly = TRUE);", "public function setRequestMethod($method) {}", "public function route() {\n\n try {\n \n $obj = APIFactory::init($this->parsed_path[0]);\n echo $this->getAction($obj, $this->parsed_path);\n \n } catch(UndefinedActionException $e) { \n\n echo $e->getMessage();\n\n } catch(Exception $e) {\n\n echo $e->getMessage();\n\n }\n }", "public function httpGet()\n {\n return $this->method(\"GET\");\n }", "public function route() {\r\n register_rest_route( 'api/v1', '/web-data-endpoint', array(\r\n 'methods' => 'GET',\r\n 'callback' => array( $this, 'callback' )\r\n ) );\r\n }", "protected function route()\n {\n return route($this->uri, $this->params);\n }", "public function route()\n {\n $request = '';\n if (isset($_GET['q']))\n {\n $request = $_GET['q'];\n }\n \n $this->request = $request;\n $this->rebuildGet();\n \n //get controller\n $found = false;\n \n if ($request == '')\n {\n $request = 'index';\n }\n \n $segments = explode('/', $request);\n $dir = APP_PATH.'controllers/';\n foreach ($segments as $index => $segment)\n {\n $segment = str_replace('-', '_', $segment);\n if (file_exists($dir.$segment.'.php'))\n {\n //load controller\n $found = true;\n $this->params = array_slice($segments, $index+1);\n require($dir.$segment.'.php');\n break;\n }\n else\n {\n $dir .= $segment.'/';\n }\n }\n \n if (!$found)\n {\n //try index controller\n if (file_exists($dir.'index.php'))\n {\n //load controller\n $found = true;\n $this->params = array();\n require($dir.'index.php');\n }\n }\n \n if (!$found)\n {\n $this->notFound();\n }\n \n $this->completeRequest();\n }", "function rest_get_route_for_post($post)\n {\n }", "function rest_get_queried_resource_route()\n {\n }", "public function getMethod()\n {\n return QueryInterface::GET;\n }", "public function route($http_verb, $uri) {\n // OPTIONS HTTP Verb support\n if (Request::$http_verb === \"OPTIONS\") {\n $route = $this->match_route($http_verb, $uri);\n if ($route === false) {\n return $route;\n }\n $supports = array(\"OPTIONS\", \"HEAD\");\n foreach ($route->actions as $verb => $action) {\n $supports[] = $verb;\n }\n header(\"Allow: \".implode(\", \", $supports));\n exit;\n }\n\n // Find the route\n $route = $this->match_route($http_verb, $uri);\n\n // Check if the route was found and is valid\n if ($route === false) {\n Marmalade::error(Error::create(Error::PAGE_NOT_FOUND));\n } else if (!isset($route->actions[Request::$http_verb])) {\n Marmalade::error(Error::create(Error::METHOD_NOT_ALLOWED));\n }\n return $route;\n }", "static public function IsMethodGET() {\n return (self::$method == \"GET\");\n }", "function route_for_request($verb, $url) {\n\t\tif (strpos($url, '?') !== false) {\n\t\t\t$query = explode('?', $url);\n\t\t\t$url = $query[0];\n\t\t}\n\n\t\t# routing is here\n\t\t$active_route = $this->match_request($verb, $url);\n\n\t\t# if no match was found, throw\n\t\tif ($active_route === false) throw new NotFound(\"No mapping was found for &quot;$url&quot;.\");\n\n\t\t# get the params for this url using the choosen route\n\t\t$params = $this->params_for_url_with_route($url, $active_route);\n\n\t\t# add request to params and make sure magic quotes are dealt with\n\t\t$params = $this->process_request_vars($params);\n\n\t\t$active_route->set_params($params);\n\n\t\t# return the route\n\t\treturn $active_route;\n\t}", "function route(Request $request);", "public function RouteRequest ();", "protected function _initRequestMethod()\n {\n $this->set('_method', $_SERVER['REQUEST_METHOD']);\n }", "public function addGetRoute($path, $callable, $name = null){\n return $this->add($path, $callable, $name, 'GET');\n }", "protected function generateGetRouteMethod()\n {\n return <<<EOF\n public function getRoute(\\$route)\n {\n if (!isset(self::\\$declaredRoutes[\\$route])) {\n return null;\n }\n \\$info = self::\\$declaredRoutes[\\$route];\n return new Route(\n \\$info['route'],\n \\$info['options'],\n \\$info['parent'],\n \\$info['routeRequirements']\n );\n }\nEOF;\n }", "public function route() {\n\t\t// Start the profiler\n\t\tProfiler::register('Core', 'Router');\n\n\t\t// First, let's look at the URL the user supplied\n\t\t$requestUrl = array_values(array_filter(explode('/', Request::getUrl())));\n\t\t$requestRoute = null;\n\n\t\t// Loop over each route and test to see if they are valid\n\t\tforeach (self::$_routes as $route) {\n\t\t\tif ($this->routeTest($requestUrl, $route)) {\n\t\t\t\t$requestRoute = $route;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// We have completed the route matching\n\t\t// Finish the setup of the request object\n\t\tProfiler::register('Core', 'Request');\n\t\tif ($requestRoute) {\n\t\t\t$_GET['controller'] = $route->endpoint['controller'];\n\t\t\t$_GET['action'] = $route->endpoint['action'];\n\t\t\tRequest::setUrlFragments(str_replace($this->_routePath, '', Request::getUrl()));\n\t\t} else {\n\t\t\tRequest::setUrlFragments(Request::getUrl(), true);\n\t\t}\n\t\tProfiler::deregister('Core', 'Request');\n\n\t\t// Inform the event listener a request has been initialised\n\t\tEvent::trigger(\n\t\t\t'initRequest',\n\t\t\tarray(\n\t\t\t\t'controller' => Request::get('controller'),\n\t\t\t\t'action' => Request::get('action')\n\t\t\t)\n\t\t);\n\n\t\t// And stop the profiler\n\t\tProfiler::deregister('Core', 'Router');\n\t\tProfiler::deregister('Core', 'Front');\n\n\t\t// And dispatch\n\t\tDispatcher::loadController(\n\t\t\tRequest::get('controller'),\n\t\t\tRequest::get('action')\n\t\t);\n\t}", "public function getStatic(string $path, string $method = null): Route|null;", "function route($path=''){\r\n try {\r\n parent::route($path != '' ? $path : self::getEndPoint());\r\n } catch (Exception $e) {\r\n parent::route('help');\r\n }\r\n }", "protected function GET($route)\n {\n return $this->REQUEST('GET', $route);\n }", "public static function getRoutesForMethod($method);", "public function isGet() {\n return $this->method == 'GET';\n }", "public function getRequestMethods ()\n\t{\n\t\treturn Request::GET;\n\t}", "public function getApiRoute(): string;", "public function get(string $path, array $handler): void\n {\n $this->routes['GET'][$path] = $handler;\n }", "public function testHttpMethods()\n {\n //Case A\n $r = new \\Slim\\Route('/foo', function () {});\n $this->assertEmpty($r->getHttpMethods());\n //Case B\n $r->setHttpMethods('GET');\n $this->assertEquals(array('GET'), $r->getHttpMethods());\n //Case C\n $r->appendHttpMethods('POST', 'PUT');\n $this->assertEquals(array('GET', 'POST', 'PUT'), $r->getHttpMethods());\n //Case D\n $this->assertTrue($r->supportsHttpMethod('GET'));\n $this->assertFalse($r->supportsHttpMethod('DELETE'));\n //Case E\n $viaResult = $r->via('DELETE');\n $this->assertTrue($viaResult instanceof \\Slim\\Route);\n $this->assertTrue($r->supportsHttpMethod('DELETE'));\n }", "public static function get(string $route, array $options = array()) {\n\t\t\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__, $route, $options);\n\t\t\n\t\t$defaults = array(\n\t\t\t'listen'=>'GET',\n\t\t\t'route' => $route,\n\t\t\t'rule'=> $route\n\t\t);\n\t\t\n\t\t$filtered = self::_applyFilter(get_class(), __FUNCTION__, array(\n\t\t\t'route' => $route,\n\t\t\t'options' => $options\n\t\t), array('event' => 'args'));\n\t\t\n\t\t$route = $filtered['route'];\n\t\t$options = $filtered['options'];\n\t\t\n\t\t$options += $defaults;\n\t\t\n\t\tself::addRouteRule($options);\n\t\t\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $route, $options);\n\t}", "public static function isGet(){\n return self::isRequestMethod('GET');\n }", "public function setRoute($method, $route)\t{\n\t\t//Reset internal state\n\t\t$this->class = \"NoRoute\";\n\t\t$this->params = array();\n\t\t$this->method = $method;\n\t\t$route = explode(\"?\", $route);\n\t\tif (is_array($route)) $route = $route[0];\n\t\t\n\t\tif ($this->prefix != null) $route = preg_replace(\"|\". preg_quote($this->prefix) . \"|iA\", \"\", $route);\n\t\t$this->log->setRoute($method, $route);\n\t\t$this->route = $route;\n\t\t\n\t\t$routeParts = array_filter(explode(\"/\", $route), 'strlen');\n\t\t$uri = strtolower(array_shift($routeParts));\n\t\t\n\t\tif (isset($this->routeArray[$uri]))\t{\n\t\t\tforeach($this->routeArray[$uri] as $route)\t{\n\t\t\t\tif ($route['method'] == $method && count($route['params']) == count($routeParts))\t{\n\t\t\t\t\t$this->class = $route['class'];\n\t\t\t\t\tforeach ($route['params'] as $param)\t{\n\t\t\t\t\t\t$this->params[$param] = array_shift($routeParts);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function getRoute(): Route;", "public function routeOptions();", "function get($uri, $action)\n {\n return Route::get($uri, $action);\n }", "public function withMethods(array $methods): Route;", "public function method()\n {\n return 'GET'; // /orders/status/new/\n }", "public function get_route($request_route) {\n\n\n if (array_key_exists($request_route[\"_method\"], $this->_routes)) {\n\n if (array_key_exists($request_route[\"_rule\"], $this->_routes[$request_route[\"_method\"]])) {\n return $this->_routes[$request_route[\"_method\"]][$request_route[\"_rule\"]];\n } else { // search for match routes\n\n foreach ($this->_routes[$request_route[\"_method\"]] as $_route) {\n\n if ($_route->_match) {\n\n $request_rule = explode(\"/\", trim($request_route[\"_rule\"], \"/\"));\n $permit_rule = explode(\"/\", trim($_route->_rule, \"/\"));\n\n if (count($request_rule) == count($permit_rule)) {\n $match = true;\n foreach ($request_rule as $index => $value) {\n\n if (($request_rule[$index] != $permit_rule[$index]) and ($permit_rule[$index] != ApplicationRoute::dynamical_segment)) {\n $match = false;\n break;\n }\n }\n if ($match) {\n\n $permit_match_rule = explode(\"/\", trim($_route->_match_rule, \"/\"));\n preg_match_all('@:([\\w]+)@', $_route->_match_rule, $segments, PREG_PATTERN_ORDER);\n $segments = $segments[0];\n\n // get methodları için locals'a yükle : değişkenler\n foreach ($segments as $segment) {\n if ($index = array_search($segment, $permit_match_rule)) {\n $_route->_locals[substr($segment, 1)] = $request_rule[$index];\n }\n }\n\n return $_route;\n }\n }\n }\n }\n }\n return null;\n //throw new ConfigurationException(\"Böyle bir yönlendirme mevcut değil\", $request_route[\"_method\"] . \":\" . $request_route[\"_rule\"]);\n }\n throw new ConfigurationException(\"Uzay çağında bizim henüz desteklemediğimiz bir method\", $request_route[\"_method\"]);\n }", "public static function route()\n {\n return self::$route;\n }", "public function get($route, $handler, array $middlewares = [], array $aftermiddlewares = [], array $roles = null) {\n $this->add('GET', $route, $handler, $middlewares, $aftermiddlewares, $roles);\n }", "private function findRoute()\n {\n // we need to start the session, because we check userLogin over the session\n session_start();\n\n if (!isset($_GET['cmd'])) {\n // if user is not logged in, we send hem to register page, so he can register or go to login from there\n if (!isset($_SESSION['userName'])) {\n $this->cmd = 'register';\n } else {\n $this->cmd = 'overview';\n }\n } elseif (!isset($_SESSION['userName']) && $_GET['cmd'] != 'login' && $_GET['cmd'] != 'register') {\n $this->cmd = 'overview';\n } else {\n $this->cmd = $_GET['cmd'];\n }\n\n // if we need to send data over json, the cmd in POST must be json, so we can go to json handler\n if(isset($_POST['cmd']) && $_POST['cmd'] == 'json'){\n $this->cmd = 'json';\n }\n }", "public function method()\n {\n return 'GET'; // /categories\n }", "function add_listing_routes()\n {\n $this->add_route('GET', '/routes', function(){\n print \"<h1>Routes</h1>\";\n foreach($this->routes as $method => $routes) {\n print \"<h3>\".$method.\"</h3>\";\n print \"<ul>\";\n foreach ($routes as $route) {\n print \"<li>\".$route->path.\"</li>\";\n }\n print \"</ul>\";\n }\n });\n }", "public static function get(string $route, string $handler, string $middleware = '');", "public function setRoutes()\n {\n $this->route('/test_extend', function() {\n $this->get(function($request, $response, $params) {\n $array = array_merge($this->foo(), $request->getHeaders());\n $response->write(200, $array);\n\n return $response;\n })->auth(\\Dioxide\\AUTH_BASIC); // require basic auth to use this method\n });\n\n\n // send the request headers back to the user\n $this->route('/headers', function() {\n $this->get(function($request, $response, $params) {\n $rateHeaders = $this->emit('rate.limit.headers', [$request->getRealRemoteAddr()]);\n\n $response->write(200, $request->getHeaders()); // send the request headers back\n $response->headers($rateHeaders);\n\n return $response;\n });\n });\n\n $this->route('/post_test', function() {\n $this->post(function($request, $response, $params) {\n $response->write(200, $request->getContent());\n return $response;\n });\n });\n\n $this->route('/server_vars', function() {\n $this->get(function($request, $response, $params) {\n $response->write(200, $_SERVER);\n return $response;\n });\n });\n\n $this->route('/cache_test', function() {\n $this->get(function($request, $response, $params) {\n $response->write(200, ['foo' => 'bar']); // will be a 304 with no response body if cached\n return $response;\n });\n });\n\n }", "public function getRoute($name){ }", "public function get_matched_route()\n {\n }", "public function isGet() {\n return strtoupper($this->requestMethod) == \"GET\";\n }", "public function getRoute()\n {\n $this->name = '';\n\n $matches = [];\n if (preg_match('/[a-f\\d]{24}/i', $this->request->getUri(), $matches)) {\n $this->id = reset($matches); # get first param in URI after /recipes/\n $this->request->setGetParam(\"id\", $this->id);\n }\n\n if ($this->request->getMethodType() == Request::METHOD_POST && strpos($this->request->getUri(),\n self::route_auth) !== false) {\n $this->name = 'auth';\n $this->isAuthNeeded = false;\n }\n\n //\tList\tGET\t/recipes\t✘\n if ($this->request->getMethodType() == Request::METHOD_GET\n && strpos($this->request->getUri(), self::route_list) !== false\n && !preg_match('/[a-f\\d]{24}/i', $this->request->getUri())\n ) {\n $this->name = 'listing';\n $this->isAuthNeeded = false;\n }\n\n // Create\tPOST\t/recipes\t✓\n if ($this->request->getMethodType() == Request::METHOD_POST\n && strpos($this->request->getUri(), self::route_create) !== false\n && (empty($this->request->getGetParam(\"id\")) || is_null($this->request->getGetParam(\"id\")))) {\n $this->isAuthNeeded = true;\n $this->name = 'create';\n }\n\n // Get\tGET\t/recipes/{id}\t✘\n if ($this->request->getMethodType() == Request::METHOD_GET\n && strpos($this->request->getUri(), self::route_list) !== false\n && preg_match('/[a-f\\d]{24}$/i', $this->request->getUri())) {\n $this->isAuthNeeded = false;\n $this->name = 'get';\n\n $matches = [];\n if (preg_match('/[a-f\\d]{24}$/i', $this->request->getUri(), $matches)) {\n $this->id = reset($matches); # get first param in URI after /recipes/\n $this->request->setGetParam(\"id\", $this->id);\n }\n }\n\n // Update\tPUT\t/recipes/{id}\t✓\n if ($this->request->getMethodType() == Request::METHOD_PUT\n && strpos($this->request->getUri(), self::route_list) !== false\n && preg_match('/[a-f\\d]{24}$/i', $this->request->getUri())) {\n $this->isAuthNeeded = true;\n $this->name = 'update';\n\n if ($this->request->getContentType() != 'application/x-www-form-urlencoded') {\n throw new Exception(\"Accept only application/x-www-form-urlencoded for PUT method\", 415);\n }\n\n $matches = [];\n if (preg_match('/[a-f\\d]{24}$/i', $this->request->getUri(), $matches)) {\n $this->id = reset($matches); # get first param in URI after /recipes/\n $this->request->setGetParam(\"id\", $this->id);\n }\n }\n\n // Update\tPATCH\t/recipes/{id}\t✓\n if ($this->request->getMethodType() == Request::METHOD_PATCH\n && strpos($this->request->getUri(), self::route_update) !== false\n && preg_match('/[a-f\\d]{24}$/i', $this->request->getUri(), $id)) {\n $this->isAuthNeeded = true;\n $this->name = 'patch';\n\n $matches = [];\n if (preg_match('/[a-f\\d]{24}$/i', $this->request->getUri(), $matches)) {\n $this->id = reset($matches); # get first param in URI after /recipes/\n $this->request->setGetParam(\"id\", $this->id);\n }\n }\n\n // Delete\tDELETE\t/recipes/{id}\t✓\n if ($this->request->getMethodType() == Request::METHOD_DELETE\n && strpos($this->request->getUri(), self::route_delete) !== false\n && preg_match('/[a-f\\d]{24}$/i', $this->request->getUri(), $id)) {\n $this->isAuthNeeded = true;\n $this->name = 'delete';\n\n }\n\n // Rate\tPOST\t/recipes/{id}/rating\t✘\n if ($this->request->getMethodType() == Request::METHOD_POST\n && strpos($this->request->getUri(), self::route_rate) !== false\n && preg_match('/[a-f\\d]{24}/i', $this->request->getUri())) {\n $this->isAuthNeeded = false;\n $this->name = 'rate';\n }\n\n // SEARCH\tPOST\t/recipes/search\t✘\n if ($this->request->getMethodType() == Request::METHOD_GET\n && strpos($this->request->getUri(), self::route_search) !== false) {\n $this->isAuthNeeded = false;\n $this->name = 'search';\n }\n\n return $this->name;\n }", "public function get($endpoint, $action, $auth = TRUE)\n\t{\n\t\t$endpoint = $this->_baseURL . $endpoint;\n\t\t$this->_routes['GET'][$endpoint] = ['auth' => $auth, 'action' => $action, 'endpoint' => $endpoint];\n\t}", "public function get($path, $controller, $action) {\n $this->add($path, $controller, $action, 'GET');\n }", "public static function getRoute() {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__);\n\n\t\t$route = (isset(self::$route_options['route'])) ? self::$route_options['route'] : null;\n\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $route);\n\t\t$route = self::_applyFilter(get_class(), __FUNCTION__, $route, array('event' => 'return'));\n\n\t\treturn $route;\n\t}", "public function method( $is = null ) {\n\t\t$method = isset( $_SERVER['REQUEST_METHOD'] ) ? $_SERVER['REQUEST_METHOD'] : 'GET';\n\t\tif ( null !== $is ) {\n\t\t\treturn strcasecmp( $method, $is ) === 0;\n\t\t}\n\n\t\treturn $method;\n\t}", "public function isGet()\n {\n return $this->_getMethod() === \\Yana\\Http\\Requests\\MethodEnumeration::GET;\n }", "public function test_route_method_string() {\n\t\tregister_rest_route(\n\t\t\t'test-ns',\n\t\t\t'/test',\n\t\t\tarray(\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t$routes = $GLOBALS['wp_rest_server']->get_routes();\n\n\t\t$this->assertSame( $routes['/test-ns/test'][0]['methods'], array( 'GET' => true ) );\n\t}", "public function isGet()\n {\n return $this->getRequestMethod() === 'GET';\n }", "function register_routes(){\n \tregister_rest_route( parent::get_api_base(), $this->controller . 'get' , array(\n \t\t'methods' => WP_REST_Server::READABLE,\n \t\t'callback' => array($this,'run_cron'),\n\n \t\t//'permission_callback' => array( $this, 'get_item_permissions_check' ),\n \t));\n\t}", "public function isGet(): bool\n {\n return $this->method === self::GET;\n }", "public function isGet(): bool \r\n {\r\n return $this -> method() === 'GET' ? true : false;\r\n }", "public function isGet() {\n\t\tif ('GET' == $this->getMethod())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function setMethod($request_method) {}", "private function processRequestMethod($method) {\n if(in_array(strtoupper($method),$this->supportedRequestMethods)) {\n $this->requestMethod=strtoupper($method);\n } elseif (strtoupper($method)==\"GET\") {\n $this->exceptionWithResponseCode(405,\n \"\\\"GET\\\" is not currently a supported request method. \" .\n \"Try the other API: https://wiki.egi.eu/wiki/GOCDB/PI/Technical_Documentation\"\n );\n }else {\n $this->exceptionWithResponseCode(405,\n \"\\\"\" . $method . \"\\\" is not currently a supported request method. For more details see: $this->docsURL\"\n );\n }\n }", "protected function registerRoutes() {\n\n $this->get('/crossword', 'getCrossword');\n $this->post('/crossword', 'saveUserState');\n //not used\n //$this->get('/crossword', 'getCrossword');\n //$this->get('/wordData', 'getWordData');\n //);\n }", "public function route($param = null, $default = null)\n {\n return (new Route('GET', '/', 'index'))->bind($this);\n }", "function get_method() {\n $parts = explode('/', $this->request_uri);\n if (count($parts) > 3) {\n return $parts[3];\n }\n return 'index';\n }", "public function getAction()\n {\n Extra_ErrorREST::setInvalidHTTPMethod($this->getResponse());\n }", "public function testControllerMethodCatchAllRequestMethod()\n {\n $route = new Route();\n \n $route->set(null, \"user\", null, \"Anax\\Route\\MockHandlerControllerCatchAll\");\n \n $path = \"user/whatever\";\n $this->assertTrue($route->match($path, \"POST\"));\n $res = $route->handle($path);\n $this->assertEquals(\"catchAllPost\", $res);\n\n $this->assertTrue($route->match($path, \"PUT\"));\n $res = $route->handle($path);\n $this->assertEquals(\"catchAllPut\", $res);\n }", "public function index_get() {\n $action = $this->get('action');\n switch ($action) {\n case \"retrieve_get\":\n $this->retrieve_get();\n break;\n default:\n $this->not_found();\n break;\n }\n }", "function route_method(): string\n{\n return RouteController::getCurrentRoute()['method'] ?? '';\n}", "public function set_method($method)\n\t{\n\t\t$this->route_stack[self::SEG_METHOD] = $method;\n\t}", "public static function get($route, $action, $args=null)\n\t{\n\t\tself::match_route('get', $route, $action, $args);\n\t}", "public function route($str_method, $str_url) {\n $this->arr_url = parse_url($str_url);\n if (!(bool)preg_match('#/(?<controller>[\\w\\-]+)(?:\\/(?<resourceId>[\\w\\-]+))?#', $this->arr_url['path'], $arr_matches)) {\n throw new Routing('URL parse error (preg_match): ' . $str_url);\n }\n\n switch ($str_method) {\n case 'GET':\n if (array_key_exists('resourceId', $arr_matches)) {\n $str_resource_action = 'View';\n } else {\n $str_resource_action = 'Index';\n }\n break;\n default:\n throw new \\InvalidArgumentException('Unsupported method: ' . $str_method);\n }\n\n $this->setup($arr_matches['controller'], true, $str_resource_action);\n if (array_key_exists('resourceId', $arr_matches)) {\n $this->str_resource_id = $arr_matches['resourceId'];\n }\n\n return $this;\n }", "public function get()\n {\n $this->method = 'GET';\n return $this;\n }" ]
[ "0.7034967", "0.6874657", "0.6871048", "0.6828566", "0.6784085", "0.6718788", "0.6715438", "0.66463226", "0.663955", "0.66320294", "0.6611031", "0.6556806", "0.6554662", "0.6553525", "0.65507346", "0.6524255", "0.6513028", "0.64307314", "0.64153135", "0.6387633", "0.63735795", "0.63487154", "0.630743", "0.63020045", "0.6275948", "0.6270734", "0.6251011", "0.62454367", "0.6239112", "0.623883", "0.62343806", "0.62080735", "0.6203484", "0.6189176", "0.6171426", "0.61654735", "0.61634815", "0.61562073", "0.6148323", "0.61248493", "0.61064035", "0.60910577", "0.6087818", "0.6084156", "0.6081435", "0.6076439", "0.60590917", "0.6055523", "0.6034008", "0.6025474", "0.6020006", "0.6018966", "0.6015072", "0.60053045", "0.59981585", "0.5985197", "0.5980868", "0.5958903", "0.594319", "0.59347486", "0.5921809", "0.59194463", "0.59187543", "0.5914692", "0.59057575", "0.590122", "0.58995473", "0.5889092", "0.58884716", "0.58810365", "0.5871906", "0.5868826", "0.58673376", "0.5857129", "0.5845132", "0.58398396", "0.582951", "0.58290046", "0.5821669", "0.5813149", "0.581088", "0.58035547", "0.58031577", "0.5799205", "0.57946175", "0.57886714", "0.5782627", "0.57825094", "0.5782164", "0.57809097", "0.57781065", "0.57769275", "0.57751584", "0.57667744", "0.5760173", "0.57462156", "0.57453626", "0.5742644", "0.5741911", "0.57395595" ]
0.6105624
41
/ sets a route for the POST request method
public function post($route, $action) { $this->router->addRoute('POST', $route, $action); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAddRouteShorthandMethodPost()\n {\n $this->collection->post('name', '/', 'action');\n\n $this->assertCount(1, $this->collection->all());\n\n $routes = $this->collection->all();\n\n $this->assertArrayHasKey('0', $routes);\n\n $this->assertContains('POST', $routes[0]->getMethods());\n }", "public function post($route, $controllerAction = '');", "public function post(...$args) {\n $this->registerRouteHandler('POST', ...$args);\n }", "protected function getHttpMethod()\n {\n return 'POST';\n }", "protected function getHttpMethod()\n {\n return 'POST';\n }", "public function getMethod()\n {\n return 'POST';\n }", "public function postAction()\n {\n Extra_ErrorREST::setInvalidHTTPMethod($this->getResponse());\n }", "public function testAddRouteCreateMethodPostMethod()\n {\n $this->collection->create('POST', 'name', '/', 'action');\n\n $this->assertCount(1, $this->collection->all());\n\n $routes = $this->collection->all();\n\n $this->assertArrayHasKey('0', $routes);\n\n $this->assertContains('POST', $routes[0]->getMethods());\n }", "public function getRedirectMethod()\n {\n return 'POST';\n }", "public function getRedirectMethod()\n {\n return 'POST';\n }", "public static function post($route, $options){\n self::register('POST', $route, $options);\n }", "public function getMethod()\n {\n return Http::POST;\n }", "public function testRouterAddByPost($method)\n {\n $router = new Router();\n\n $router->post(\"\", function () {\n return \"post\";\n });\n\n $router->always(function () {\n return \"not post\";\n });\n\n $res = $router->handle(\"\", $method);\n if ($method === \"POST\") {\n $this->assertEquals(\"post\", $res);\n }\n if ($method !== \"POST\") {\n $this->assertEquals(\"not post\", $res);\n }\n\n $routes = $router->getAll();\n $this->assertEquals(2, count($routes));\n }", "public function getHttpMethod()\n {\n return 'POST';\n }", "public function getHttpMethod()\n {\n return 'POST';\n }", "public function getHttpMethod()\n {\n return 'POST';\n }", "public function registerFormRoutes() {\n add_action('rest_api_init', function() {\n register_rest_route('forms/v1', '/submit', [\n 'methods' => 'POST',\n 'callback' => [$this, 'handleSubmission']\n ]);\n });\n }", "function post($uri, $action)\n {\n return Route::post($uri, $action);\n }", "public function post(string $path, array $handler): void\n {\n $this->routes['POST'][$path] = $handler;\n }", "public function httpPost()\n {\n return $this->method(\"POST\");\n }", "protected function getMethod(): string\n {\n return self::METHOD_POST;\n }", "public static function post(string $route, array $options = array()) {\n\t\t\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__, $route, $options);\n\t\t\n\t\t$defaults = array(\n\t\t\t'listen'=>'POST',\n\t\t\t'route' => $route,\n\t\t\t'rule'=> $route\n\t\t);\n\t\t\n\t\t$filtered = self::_applyFilter(get_class(), __FUNCTION__, array(\n\t\t\t'route' => $route,\n\t\t\t'options' => $options\n\t\t), array('event' => 'args'));\n\t\t\n\t\t$route = $filtered['route'];\n\t\t$options = $filtered['options'];\n\t\t\n\t\t$options += $defaults;\n\t\t\n\t\tself::addRouteRule($options);\n\t\t\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $route, $options);\n\t}", "public static function post($pattern, callable $callback): Route;", "public static function post(string $route, string $handler, string $middleware = '');", "public function setRequestMethod($method) {}", "public function route(string $requestUri, string $requestMethod);", "public function setMethod($request_method) {}", "public function getRequestMethod(): string\n {\n return 'POST';\n }", "public function getRequestMethod(): string\n {\n return 'POST';\n }", "public function post(string $pattern, $handler = null): Route\n {\n return $this->addRoute($pattern, [Router::METHOD_POST], $handler);\n }", "public function post();", "public function post();", "public function post();", "function rest_get_route_for_post($post)\n {\n }", "protected function _initRequestMethod()\n {\n $this->set('_method', $_SERVER['REQUEST_METHOD']);\n }", "public function post($path, $callback) {\n $this->routes['post'][$path] = $callback; \n }", "public function submit()\n {\n $uriParam = isset($_SERVER[\"REQUEST_URI\"]) ? $_SERVER[\"REQUEST_URI\"] : '/';\n // loop through each uri and find the one that matches the route\n foreach($this->_uri as $key => $value)\n {\n if(preg_match(\"#^$value$#\", $uriParam))\n {\n $useMethod = $this->_method[$key];\n new $useMethod();\n }\n }\n }", "protected function resolveRequestMethod()\n {\n $method = $_SERVER[\"REQUEST_METHOD\"];\n\n if (isset($_POST[\"_method\"]) && in_array($_POST[\"_method\"], $this->formSpoofingMethods)) {\n $this->requestMethod = $_POST[\"_method\"];\n return null;\n }\n\n $this->requestMethod = $method;\n }", "public function post()\n {\n $this->method = 'POST';\n return $this;\n }", "public function addPostRoute($path, $callable, $name = null){\n return $this->add($path, $callable, $name, 'POST');\n }", "public function postAction() {}", "public function post($uri, $controller) {\r\n $this->routes['POST'][$uri] = $controller;\r\n }", "public function requirePostMethod() {\n // require POST requests\n if ($_SERVER['REQUEST_METHOD'] && $_SERVER['REQUEST_METHOD'] != 'POST') {\n header('Allow: POST', true, 405);\n throw new Exception(\"Invalid HTTP request method.\");\n }\n }", "public function requirePostMethod() {\n\n // require POST requests\n if ($_SERVER['REQUEST_METHOD'] && $_SERVER['REQUEST_METHOD'] != 'POST') {\n header('Allow: POST', true, 405);\n throw new \\Exception(\"Invalid HTTP request method.\");\n }\n }", "public function register_route() {\n register_rest_route( $this->namespace, $this->endpoint , array(\n 'methods' => 'POST',\n 'callback' => array($this, 'get_next_page'),\n 'args' => array(),\n ) );\n }", "public function post($uri, $controller)\n\t{\t\n\t\t// sets the routes array key=>value pairs\n\t\t$this->routes['POST'][$uri] = $controller;\n\t}", "private function setMethod()\n {\n $this->_requestMethod = $_SERVER['REQUEST_METHOD'];\n if (!in_array($this->_requestMethod, $this->_allowMethod)) {\n throw new Exception(\"Request method not allowed!\", 405);\n }\n }", "public function post($path, $callback)\n\t{\n\t\t$this->routes['post'][$path] = $callback;\n\t}", "public function postAction() {\n\n }", "public function postAction()\n {\n }", "public function isPost()\n {\n return $this->_getMethod() === \\Yana\\Http\\Requests\\MethodEnumeration::POST;\n }", "public static function post($route, $action, $args=null)\n\t{\n\t\tself::match_route('post', $route, $action, $args);\n\t}", "public function post($endpoint, $action, $auth = TRUE)\n\t{\n\t $endpoint = $this->_baseURL . $endpoint;\n\t\t$this->_routes['POST'][$endpoint] = ['auth' => $auth, 'action' => $action, 'endpoint' => $endpoint];\n\t}", "public function post($request);", "public function post(string $route, callable $controller): void\n {\n $this->register($controller, Route::post($route));\n }", "public function postAction()\n {\n \n }", "public function setRoute() {\n $address = $_SERVER['REQUEST_URI'];\n \n $this->determineControllerAndMethod($address);\n\n $this->determineArguments($address);\n }", "public function post($pattern, $handler, array $options = [])\n {\n return $this->addRoute(self::POST, $pattern, $handler, $options);\n }", "function is_post_request() {\n return (request_method() == 'post');\n}", "public function post(string $path, $callable, ?string $name = null): void\n {\n $this->router->addRoute(\n new ZendRoute(\n $path,\n new RouterMiddleware($this, $callable),\n ['POST'],\n $name\n )\n );\n }", "public function post($uri, $controller, $middleware = 'no-auth')\n {\n $this->postRoutes[$uri] = [$controller, $middleware];\n }", "abstract public function post();", "abstract public function post(Request $request);", "public function post($uri, $action)\n {\n return $this->addRoute('POST', $uri, $action);\n }", "public static function post($path, $action, $middleware = null, $ajax=false)\n {\n self::$routes[] = new Route('post', $path, $action, $middleware, $ajax);\n }", "function submitMethod() {\n\t\tif (func_num_args()) {\n\t\t\tswitch (strtolower(trim(func_get_arg(0)))) {\n\t\t\t\tcase 'post':\n\t\t\t\t\t$this->_submitMethod = \"post\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'get':\n\t\t\t\t\t$this->_submitMethod = \"get\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tuser_error(\"The submitMethod property of the Calendar class must be \\\"get\\\" or \\\"post\\\"\", E_USER_NOTICE);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telse return $this->_submitMethod;\n\t}", "public function post($route, $callback)\r\n {\r\n $this->registerRoute(self::cleanUrl($route), $callback, 'post');\r\n }", "public function resolveMethod()\n {\n $value = $this->_value( @$_SERVER['REQUEST_METHOD'], '' );\n $value = $this->_value( @$_SERVER['HTTP_X_HTTP_METHOD'], $value );\n $this->method = strtolower( trim( $value ) );\n }", "public function route()\n\t{\n\t\t/* [http|https]/[Ajax|]/[Get|Post|Delete|Put]/uri */\n\t\t$this->route = $this->route_raw = ($this->c->Request->is_https ? 'https' : 'http').'/'.($this->c->Request->is_ajax ? 'Ajax' : '').'/'.$this->c->Request->request.'/'.$this->c->Request->uri;\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->preRouter();\n\n\t\t/* rewrite dispatch route */\n\t\tforeach ($this->c->router['routes'] as $regexpath => $switchto) {\n\t\t\tif (preg_match($regexpath, $this->route)) {\n\t\t\t\t/* we got a match */\n\t\t\t\t$this->route = preg_replace($regexpath, $switchto, $this->route);\n\t\t\t\t$this->route_matched = $regexpath;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->postRouter();\n\n\t}", "public static function http_request($method, $route, $post_data = array())\n {\n $request = \\Router::route($method, $route);\n \n $post_data[\\Session::csrf_token] = \\Session::token();\n\n \\Request::setMethod($method);\n \n \\Request::foundation()->request->add($post_data);\n\n if(!empty($request))\n {\n return $request->call();\n }\n }", "protected function requestMethod()\n\t{\n\t\t$method = $this->formModel->_formData['rowid'] == 0 ? 'POST' : 'PUT';\n\t\t$fkData = $this->fkData();\n\n\t\t// If existing record but no Fk value stored presume its a POST\n\t\tif (empty($fkData))\n\t\t{\n\t\t\t$method = 'POST';\n\t\t}\n\t\treturn $method;\n\t}", "protected function handleMethod()\n {\n try {\n parent::$method = new ReflectionMethod(parent::$view->name, Request::$method);\n } catch(Exception $e) {\n self::jump(405);\n }\n }", "protected function setFormActionUri() {}", "public function isUsingPost() {\r\n\t\treturn $this->httpMethod == 'POST';\r\n\t}", "public function testPostRequestShouldTriggerPostAction()\n\t{\n\t\t$this->request->setMethod('POST');\n\t\t$this->dispatch('/api/event');\n\t\t\n\t\t$this->assertModule('api');\n\t\t$this->assertController('event');\n\t\t$this->assertAction('post');\n\t}", "public function post($uri, $function) {\n $newRoute = new Route($uri, array(\"POST\"), $function);\n\n $this->collection->addRoute($newRoute);\n }", "protected function setAction()\n {\n $method = $this->request->method;\n $this->route->method = strtoupper($method);\n\n if ($this->route->method === 'POST') {\n $this->route->action = 'create';\n\n } elseif ($this->route->method === 'PUT') {\n $this->route->action = 'update';\n\n } elseif ($this->route->method === 'DELETE') {\n $this->route->action = 'delete';\n\n } else {\n $this->route->method = 'GET';\n $this->route->action = 'read';\n }\n\n $this->route->special_action = '';\n\n $this->valid_actions = $this->actions[$this->route->action];\n\n return $this;\n }", "public function post(string $route, callable $controller): void\n {\n $this->controllerAggregate->add($controller, Route::post($route));\n }", "public function post(\n string $name,\n string $path,\n $requestHandler,\n array $middlewares = [],\n array $attributes = []\n ) : RouteInterface {\n return $this->route(\n $name,\n $path,\n [Router::METHOD_POST],\n $requestHandler,\n $middlewares,\n $attributes\n );\n }", "public function isMethodPost(): bool\n {\n return $this->isMethod(self::HTTP_POST);\n }", "public function post(string $path, $middleware, ?string $name = null): void;", "public function post()\n {\n //\n }", "public function requestMethod($method = 'POST', $redirect = ROOT)\n {\n if (filter_input(INPUT_SERVER, 'REQUEST_METHOD') !== $method) {\n $this->redirect($redirect);\n }\n }", "public function post(string $path, array $callback): Router\n {\n return $this->addRoute('POST', $path, $callback);\n }", "public function post($route, $controller)\n {\n // * Replace $route like this:\n // * /user/{id}/product/{id}\n // * to this:\n // * /^\\/user\\/([^\\/]+)\\/product\\/([^\\/]+)$/\n $routePattern = $this->replaceRoute($route);\n\n\n // * Add $routePatter to array in this format\n // * [\n // * POST => [ '/^\\/user\\/([^\\/]+)\\/product\\/([^\\/]+)$/' => 'Controller@index'],\n // * ]\n $this->routes['POST'][$routePattern] = $controller;\n }", "public static function setMethod(string $method): void {\r\n $_SERVER['REQUEST_METHOD'] = strtoupper($method);\r\n }", "public function post($route, $callback)\n {\n return $this->addRoute('POST', $route, $callback);\n }", "public function setMethod($method) {\n if(preg_match('|(post|get)|i', $method)) {\n $this->method = $method;\n return TRUE;\n } else {\n return FALSE;\n }\n }", "function route($method, $urlData, $formData) {\n require_once 'W:\\domains\\localhost\\db.php';\n \n if ($method === 'POST') {\n $str = file_get_contents('php://input');\n $data = json_decode($str,true);\n\n // GET /orders/my/orders\n if (count($urlData) == 2)\n echo json_encode(getMyOrders($link, $data[\"id_User\"]));\n else\n // GET /orders\n if (empty($urlData)){ \n echo json_encode(getOrders($link, $data[\"id_User\"]));\n }\n // GET /orders/add\n else{\n echo json_encode(addItemToOrder($link, $data['id_Item'], $data['id_User']));\n }\n } \n else\n // PUT /orders/change\n if ($method === 'PUT' && count($urlData) === 1){\n $str = file_get_contents('php://input');\n $data = json_decode($str, true);\n\n echo json_encode(changeCount($link, $data['id_Item'], $data['id_User'], $data['count']));\n }\n else\n // PUT /orders\n if ($method === 'PUT'){\n $str = file_get_contents('php://input');\n $data = json_decode($str, true);\n\n echo json_encode(buy($link, $data['id_User']));\n }\n else\n {\n echo json_encode(array('error'=> 'the query is inc'));\n }\n }", "public function postAction()\n {\n // Nothing to do\n }", "public function route() {\n\t\t$method = $_SERVER['REQUEST_METHOD'];\n\t\t$request = (isset($_SERVER['PATH_INFO'])) ? explode(\"/\", trim($_SERVER['PATH_INFO'], \"/\")) : \"\";\n\t\t\n\t\treturn $this->routeRequest($method, $request);\n\t}", "static public function IsMethodPOST() {\n return (self::$method == \"POST\");\n }", "public function RouteRequest ();", "public function post($path, $callable, $name = null)\n {\n return $this->addRoute($path, $callable, 'POST', $name);\n }", "public static function sendMethodNotAllowedResponse(){\n http_response_code(405);\n die();\n }", "public function getMethod(): string\n {\n return QueryInterface::POST;\n }", "public static function method(){\n \n return self::$request->getMethod(); \n }", "public function post($identifier, callable $callback)\n {\n $this->routes[] = $this->route_factory->build($identifier, 'POST', $callback);\n }", "public function usePost($flag = true) {\r\n\t\t$this->httpMethod = $flag ? 'POST' : 'GET';\r\n\t\treturn $this;\r\n\t}", "private function _handleFormPost()\n {\n // see submit.php\n // 'FILE_OBJECTS' => 'handle_file_post',\n // 'BASE64_ENCODED_FILE_OBJECTS' => 'handle_base64_encoded_file_post',\n // 'TRANSFER_IDS' => 'handle_transfer_ids_post'\n }" ]
[ "0.70500004", "0.6770707", "0.67485905", "0.66712075", "0.66712075", "0.66348827", "0.6605969", "0.6597734", "0.65795064", "0.65795064", "0.65764105", "0.6509498", "0.64536905", "0.6451468", "0.6451468", "0.6451468", "0.6374472", "0.6350858", "0.6324766", "0.6313987", "0.62992203", "0.6262003", "0.62465054", "0.6242519", "0.6239177", "0.6190145", "0.6169348", "0.6157023", "0.6157023", "0.6156719", "0.6155619", "0.6155619", "0.6155619", "0.614954", "0.6142477", "0.61276186", "0.60865325", "0.6083826", "0.60790503", "0.6032548", "0.601858", "0.5987409", "0.5954742", "0.5945573", "0.5944704", "0.5937266", "0.59366405", "0.5928749", "0.5914559", "0.59132653", "0.5896907", "0.5893918", "0.588793", "0.58792365", "0.5864882", "0.5863471", "0.5861614", "0.58511734", "0.5849858", "0.5846454", "0.5844854", "0.58269554", "0.58193237", "0.5816252", "0.57905173", "0.5789261", "0.57879144", "0.5784351", "0.57778394", "0.5776099", "0.57746524", "0.577315", "0.57664686", "0.5762506", "0.57584345", "0.57555765", "0.5735941", "0.57349545", "0.57285", "0.5728037", "0.57170963", "0.57160485", "0.5702266", "0.57002527", "0.56876165", "0.56803393", "0.5675253", "0.56741345", "0.5671397", "0.5664938", "0.56627905", "0.565806", "0.56459004", "0.56456625", "0.56433177", "0.5641992", "0.56339115", "0.56318647", "0.5629082", "0.5615169" ]
0.6060325
39
/ sets a route for the PUT request method
public function put($route, $action) { $this->router->addRoute('PUT', $route, $action); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAddRouteShorthandMethodPut()\n {\n $this->collection->put('name', '/', 'action');\n\n $this->assertCount(1, $this->collection->all());\n\n $routes = $this->collection->all();\n\n $this->assertArrayHasKey('0', $routes);\n\n $this->assertContains('PUT', $routes[0]->getMethods());\n }", "public function put(...$args) {\n $this->registerRouteHandler('PUT', ...$args);\n }", "public function httpPut()\n {\n return $this->method(\"PUT\");\n }", "public function putAction()\n {\n Extra_ErrorREST::setInvalidHTTPMethod($this->getResponse());\n }", "public static function put(string $route, array $options = array()) {\n\t\t\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__, $route, $options);\n\t\t\n\t\t$defaults = array(\n\t\t\t'listen'=>'PUT',\n\t\t\t'route' => $route,\n\t\t\t'rule'=> $route\n\t\t);\n\t\t\n\t\t$filtered = self::_applyFilter(get_class(), __FUNCTION__, array(\n\t\t\t'route' => $route,\n\t\t\t'options' => $options\n\t\t), array('event' => 'args'));\n\t\t\n\t\t$route = $filtered['route'];\n\t\t$options = $filtered['options'];\n\t\t\n\t\t$options += $defaults;\n\t\t\n\t\tself::addRouteRule($options);\n\t\t\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $route, $options);\n\t}", "function put($uri, $action)\n {\n return Route::put($uri, $action);\n }", "public function put()\n {\n $this->method = 'PUT';\n return $this;\n }", "public static function put(string $route, string $handler, string $middleware = '');", "public function testRouterAddByPut($method)\n {\n $router = new Router();\n\n $router->put(\"\", function () {\n return \"put\";\n });\n\n $router->always(function () {\n return \"not put\";\n });\n\n $res = $router->handle(\"\", $method);\n if ($method === \"PUT\") {\n $this->assertEquals(\"put\", $res);\n }\n if ($method !== \"PUT\") {\n $this->assertEquals(\"not put\", $res);\n }\n\n $routes = $router->getAll();\n $this->assertEquals(2, count($routes));\n }", "public static function put($pattern, callable $callback): Route;", "public function testPutRequestShouldTriggerMethodNotAllowedError()\n\t{\n\t\t$this->request->setMethod('PUT');\n\t\t$this->dispatch('/api/event');\n\t\n\t\t$this->assertResponseCode(405);\n\t\t$this->assertQuery('error');\n\t}", "public function putAction() {}", "abstract public function put(Request $request);", "public function put(string $pattern, $handler = null): Route\n {\n return $this->addRoute($pattern, [Router::METHOD_PUT], $handler);\n }", "public function putAction()\n {\n \n }", "public function put(string $route, callable $controller): void\n {\n $this->register($controller, Route::put($route));\n }", "public static function isPut(){\n return self::isRequestMethod('PUT');\n }", "public function isPut() {\n return $this->method == 'PUT';\n }", "public function methodPut() {\n return $this->methodPost();\n }", "public function put($uri, $function) {\n $newRoute = new Route($uri, array(\"PUT\"), $function);\n\n $this->collection->addRoute($newRoute);\n }", "public static function put($uri, $controller)\n {\n self::addRoute('PUT', $uri, $controller);\n }", "public function put($path = '*', $callback = null)\r\n {\r\n // Get the arguments in a very loose format\r\n extract(\r\n $this->parseLooseArgumentOrder(func_get_args()),\r\n EXTR_OVERWRITE\r\n );\r\n\r\n return $this->respond('PUT', $path, $callback);\r\n }", "public function putAction() {\n\t\t$this->_notImplemented();\n\t}", "public function put(string $route, callable $controller): void\n {\n $this->controllerAggregate->add($controller, Route::put($route));\n }", "public function isPut()\n {\n return $this->getRequestMethod() === 'PUT';\n }", "public function put($route, $controller)\n {\n // * Replace $route like this:\n // * /user/{id}/product/{id}\n // * to this:\n // * /^\\/user\\/([^\\/]+)\\/product\\/([^\\/]+)$/\n $routePattern = $this->replaceRoute($route);\n\n\n // * Add $routePatter to array in this format\n // * [\n // * PUT => [ '/^\\/user\\/([^\\/]+)\\/product\\/([^\\/]+)$/' => 'Controller@index'],\n // * ]\n $this->routes['PUT'][$routePattern] = $controller;\n }", "public function put($uri, $action)\n {\n return $this->addRoute('PUT', $uri, $action);\n }", "public function put(\n string $name,\n string $path,\n $requestHandler,\n array $middlewares = [],\n array $attributes = []\n ) : RouteInterface {\n return $this->route(\n $name,\n $path,\n [Router::METHOD_PUT],\n $requestHandler,\n $middlewares,\n $attributes\n );\n }", "public function put(string $path, $middleware, ?string $name = null): void;", "public function put($pattern, $handler, array $options = [])\n {\n return $this->addRoute(self::PUT, $pattern, $handler, $options);\n }", "public function put($endpoint, $action, $auth = TRUE)\n\t{\n\t $endpoint = $this->_baseURL . $endpoint;\n\t\t$this->_routes['PUT'][$endpoint] = ['auth' => $auth, 'action' => $action, 'endpoint' => $endpoint];\n\t}", "public function isPut()\n {\n return $this->isMethod('PUT');\n }", "public function isPut()\n {\n return $this->isMethod('PUT');\n }", "public function put($path, $data = null);", "public function isPut()\n {\n return $this->_getMethod() === \\Yana\\Http\\Requests\\MethodEnumeration::PUT;\n }", "public function isPut(){\n\t\treturn (strtoupper($this->getHeader('REQUEST_METHOD'))=='PUT')? true : false;\n\t}", "protected function getActionType()\n {\n return parent::ACTIONTYPE_PUT;\n }", "public function controllerPUT($url) {\r\n\treturn $this->controller($url);\r\n }", "public function put() {\n\t\t$this->method('PUT');\n\t\treturn $this;\n\t}", "public function isPut()\n {\n return $this->getMethod() === 'PUT';\n }", "public function put($route, $handler, array $middlewares = [], array $aftermiddlewares = [], array $roles = null) {\n $this->add('PUT', $route, $handler, $middlewares, $aftermiddlewares, $roles);\n }", "public function putAction(){\n $this->_helper->json(\"Esto no esta implementado\");\n }", "public static function put($pattern, $callback)\n {\n self::route('PUT', $pattern, $callback);\n return new self;\n }", "function put() \n {\n \n }", "public function putAction() {\n\t\t// TODO: Implement putAction() method.\n\t}", "public function put($location, $body);", "protected function generatePut(ResourceConfiguration $config)\n {\n $that = $this;\n\n $this->slim->put(\"{$this->baseRoute($config)}/:id\", function () use ($that) {\n $that->executeRoute('update', func_get_args());\n });\n }", "public function put(string $uri, array $options = []): ResponseInterface {\n return $this->request('PUT', $uri, $options);\n }", "public function testAddRouteShorthandMethodPatch()\n {\n $this->collection->patch('name', '/', 'action');\n\n $this->assertCount(1, $this->collection->all());\n\n $routes = $this->collection->all();\n\n $this->assertArrayHasKey('0', $routes);\n\n $this->assertContains('PATCH', $routes[0]->getMethods());\n }", "public function put($pattern, $fn)\n {\n return $this->match('PUT', $pattern, $fn);\n }", "public function addPut($pattern, $paths = null, $position = false)\n {\n return $this->add($pattern, $paths, 'PUT', $position);\n }", "function setResourceRoute($route, array $parameters = array(), $code = Codes::HTTP_CREATED);", "public function set_route($route)\n {\n }", "function doPUT (HttpRequest $request, HttpResponse $response) {\n throw new Exception(\"PUT method not supported\");\n }", "public function put($uri, $body = null, array $headers = []): ResponseInterface;", "public function SetRoute(string $reqMethod, string $path, callable $handler): void {\n $this->routes[$reqMethod][$path] = $handler;\n }", "public static function put($path, $callback) {\n $pattern = \"/^\" . str_replace(\"/\", \"\\/\", $path) . \"$/\";\n\n self::$routes[self::PUT][$pattern] = $callback;\n }", "public function isPut() {\n if($this->method === 'PUT') {\n return true;\n } else {\n return false;\n }\n }", "public function isPut()\n {\n return $this->method === self::METHOD_PUT;\n }", "protected function PUT($route, $params, $content = null, $server = array())\n {\n return $this->REQUEST('PUT', $route, $params, $content, $server);\n }", "public function getIsPut()\n {\n return $this->getMethod() === 'PUT';\n }", "public function api_put($path, $data = array()) {\n\n $path = GoCardless_Client::$api_path . $path;\n\n return $this->request('put', $path, $data);\n\n }", "private function setMethod($Resource, $method) {\n switch ($method) {\n case Request::METHOD_GET:\n curl_setopt($Resource, CURLOPT_HTTPGET, true);\n break;\n case Request::METHOD_POST:\n curl_setopt($Resource, CURLOPT_POST, true);\n break;\n }\n }", "public function putAction() {\n\t\t\t$this->_forward('index');\n\t }", "public function testGetPutMethodType() {\n $type = new MethodEnum();\n $this->assertSame('PUT', MethodEnum::PUT);\n $this->assertSame('PUT', $type(MethodEnum::PUT));\n }", "public function isPut()\n {\n return $this->getMethod() === self::METHOD_PUT;\n }", "public function isPut() {\n return $this->method == self::METHOD_PUT;\n }", "public function isPut()\n {\n return ($this->getMethod() == 'PUT') ? true : false;\n }", "public function put($path, array $params = array())\n\t{\n\t\t// If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response.\n\t\t// If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to indicate successful completion of the request.\n\t\t$this->Response->end('HTTP PUT', 501); // 501 Not Implemented\n\t}", "function put($url, $data = null, $options = array()) {\n\t\treturn $this->request($url, array_merge(array('method' => 'PUT', 'body' => $data), $options));\n\t}", "public function makePutRequest($routeName, $routeParams = array(), $putParams = array())\n\t{\n\t\t$uri = Route::url($routeName, $routeParams);\n\n\t\ttry\n\t\t{\n\t\t\t$request = Request::factory($uri);\n\t\t\t$this->_response = $request\n\t\t\t\t->method(Http_Request::PUT)\n\t\t\t\t->post($putParams)\n\t\t\t\t->execute();\n\t\t}\n\t\tcatch (RedirectException $e)\n\t\t{\n\t\t\t$this->_redirect = json_decode($e->getMessage(), TRUE);\n\t\t}\n\t}", "public function isPut() {\n\t\tif ('PUT' == $this->getMethod())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function put($path, $controller)\n {\n $this->routes['PUT'][$path] = $controller;\n\n return $this;\n }", "public function doPut($path, array $parsed_body);", "public function isPut()\n\t{\n\t\treturn $this->httpMethod() == self::MethodPut;\n\t}", "public function setMethod($request_method) {}", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function put(string $uri, array $params = [], $body = null, array $headers = []): ResponseInterface;", "public function isPut(): bool\n {\n return $this->getMethod() === self::METHOD_PUT;\n }", "public function testUpdateCategoryUsingPUT()\n {\n }", "public function put($uri, $action) {\n $this->matchRoute('PUT', $uri, $action);\n\n return $this;\n }", "public function testPutValue() : void {\n\t\t$this->assertEquals('PUT', HttpMethod::Put->value);\n\t}", "public function setRequestMethod($method) {}", "public function setMethod($method){\n\t\tswitch ($method){\n\t\t\tcase self::GET: $this->method = self::GET;\n\t\t\t\tbreak;\n\t\t\tcase self::PUT: $this->method = self::PUT;\n\t\t\t\tbreak;\n\t\t\tcase self::POST: $this->method = self::POST;\n\t\t\t\tbreak;\n\t\t\tcase self::HEAD: $this->method = self::HEAD;\n\t\t\t\tbreak;\n\t\t\tcase self::DELETE: $this->method = self::DELETE;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new \\InvalidArgumentException('Unknown method: ' . $method);\n\t\t}\n\t}", "public function testUpdateMetadata1UsingPUT()\n {\n }", "public function putAction($apiVersion, $type, $name, $key='')\n {\n $parameters = $this->getRequest()->request->all();\n\n $response = array(\n 'method' => 'PUT',\n 'version' => $apiVersion,\n 'type' => $type,\n 'name' => $name,\n 'key' => $key,\n 'parameters'=> $parameters\n );\n\n return new Response(json_encode($response));\n }", "public function put($path, $parameters = null, $body = null);", "public function testUpdateMetadata2UsingPUT()\n {\n }", "protected function put() {\n \t// Update room options\n \n }", "public function _put($url = null, array $parameters = []);", "public function method_PUT( &$headers, $member ) {\n throw new DAV_Status( DAV_Request::$PARANOID ? REST::HTTP_CONFLICT : REST::HTTP_FORBIDDEN );\n}", "public function put($data = null)\n {\n return $this->setMethod(__FUNCTION__)\n ->makeRequest($data);\n }", "public static function patch(string $route, string $handler, string $middleware = '');", "private function set($url,$location,$reqMethod){\n\t\t\t//validate routeformat\n\t\t\t$valid = explode(\"@\",$location);\n\t\t\tif(count($valid) != 2){ throw new \\Exception(\"Trying to save invalid route format\"); }\n\t\t\t\n\t\t\t$this->allRoutes[] = Route::set($url,$location,$reqMethod);\n\t\t}", "function put(Request &$request, Response &$response);", "public function put($path, array $parameters = array(), ApiInterface $api);", "public function isPut();", "public function testUpdateMetadata3UsingPUT()\n {\n }", "public function put();", "public function put();" ]
[ "0.7303799", "0.72895736", "0.7077067", "0.70744663", "0.6804522", "0.6761533", "0.675793", "0.6612408", "0.6606304", "0.66027147", "0.65710974", "0.64892024", "0.64423424", "0.64268225", "0.6373286", "0.63625056", "0.63282007", "0.63269305", "0.631669", "0.63071716", "0.628813", "0.62766826", "0.6259892", "0.62594205", "0.6256648", "0.6246351", "0.6239751", "0.62108886", "0.62036926", "0.6199287", "0.61925685", "0.61924493", "0.61924493", "0.617189", "0.6139513", "0.6112376", "0.608198", "0.6081478", "0.60566455", "0.6046077", "0.5999578", "0.5966296", "0.59586895", "0.5957162", "0.5955943", "0.5952566", "0.59449", "0.59189963", "0.5907626", "0.58999074", "0.5896135", "0.5879487", "0.58571684", "0.5836584", "0.5833646", "0.5831693", "0.5814857", "0.5811793", "0.5799867", "0.5794787", "0.5779861", "0.57677263", "0.57658976", "0.5760015", "0.5759951", "0.5759186", "0.57585377", "0.57582587", "0.5757064", "0.5749733", "0.5739829", "0.573967", "0.5739397", "0.57325476", "0.5717811", "0.57104576", "0.57083976", "0.5707821", "0.5705973", "0.57050693", "0.56912017", "0.56852347", "0.5669729", "0.5659706", "0.5652913", "0.56466347", "0.5640042", "0.5636623", "0.5635748", "0.5635654", "0.55977774", "0.559543", "0.5594224", "0.55864406", "0.5583308", "0.55808413", "0.55806583", "0.5573193", "0.556812", "0.556812" ]
0.6516068
11
/ sets a route for the DELETE request method
public function delete($route, $action) { $this->router->addRoute('DELETE', $route, $action); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRouteDelete() {\n\t\treturn \"/delete\";\n\t}", "public function httpDelete()\n {\n return $this->method(\"DELETE\");\n }", "public function deleteAction()\n {\n Extra_ErrorREST::setInvalidHTTPMethod($this->getResponse());\n }", "public function testAddRouteShorthandMethodDelete()\n {\n $this->collection->delete('name', '/', 'action');\n\n $this->assertCount(1, $this->collection->all());\n\n $routes = $this->collection->all();\n\n $this->assertArrayHasKey('0', $routes);\n\n $this->assertContains('DELETE', $routes[0]->getMethods());\n }", "public static function delete($pattern, callable $callback): Route;", "public function useHttpMethod(): HttpMethodEnum\n {\n return HttpMethodEnum::DELETE;\n }", "public function testDeleteRequestShouldTriggerMethodNotAllowedError()\n\t{\n\t\t$this->request->setMethod('DELETE');\n\t\t$this->dispatch('/api/event');\n\t\n\t\t$this->assertResponseCode(405);\n\t\t$this->assertQuery('error');\n\t}", "function delete($uri, $action)\n {\n return Route::delete($uri, $action);\n }", "public function delete(...$args) {\n $this->registerRouteHandler('DELETE', ...$args);\n }", "public function getRouteDelete() {\n return 'cms.site.delete';\n }", "public static function delete(string $route, string $handler, string $middleware = '');", "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 return $this->setMethod(__FUNCTION__)\n ->makeRequest();\n }", "public function delete($id)\n\t{\n\t\t$this->methodNotAllowed();\t\t\n\t}", "public function delete($endpoint, $action, $auth = TRUE)\n\t{\n\t $endpoint = $this->_baseURL . $endpoint;\n\t\t$this->_routes['DELETE'][$endpoint] = ['auth' => $auth, 'action' => $action, 'endpoint' => $endpoint];\n\t}", "public function delete($path)\n\t{\n\t\t$this->Response->end('HTTP DELETE', 501); // 501 Not Implemented\n\t}", "abstract public function delete(Request $request);", "protected function DELETE($route)\n {\n return $this->REQUEST('DELETE', $route, array());\n }", "public function delete() {\n\n try {\n /**\n * Set up request method\n */\n $this->method = 'POST';\n\n\n /**\n * Process request and call for response\n */\n return $this->requestProcessor();\n\n } catch (\\Throwable $t){\n new ErrorTracer($t);\n }\n }", "public function delete()\n {\n $this->method = 'DELETE';\n return $this;\n }", "public function testRouterAddByDelete($method)\n {\n $router = new Router();\n\n $router->delete(\"\", function () {\n return \"delete\";\n });\n\n $router->always(function () {\n return \"not delete\";\n });\n\n $res = $router->handle(\"\", $method);\n if ($method === \"DELETE\") {\n $this->assertEquals(\"delete\", $res);\n }\n if ($method !== \"DELETE\") {\n $this->assertEquals(\"not delete\", $res);\n }\n\n $routes = $router->getAll();\n $this->assertEquals(2, count($routes));\n }", "public function delete(Request $request)\n {\n }", "public function actionDelete()\n\t{\n\t\t$this->requireAjaxRequest();\n\n\t\t$id = craft()->request->getRequiredPost('id');\n\t\t$result = craft()->reroute->deleteById($id);\n\n\t\t$this->returnJson(array('success' => $result));\n\t}", "public function delete(string $path, $middleware, ?string $name = null): void;", "public function delete(string $uri, array $params = [], array $headers = []): ResponseInterface;", "public function actionDelete() {}", "public function actionDelete() {}", "public function delete($pattern, $handler, array $options = [])\n {\n return $this->addRoute(self::DELETE, $pattern, $handler, $options);\n }", "public function delete($uri, $action)\n {\n return $this->addRoute('DELETE', $uri, $action);\n }", "public function DELETE() {\n #\n }", "public function delete(string $pattern, $handler = null): Route\n {\n return $this->addRoute($pattern, [Router::METHOD_DELETE], $handler);\n }", "public static function delete(string $route, array $options = array()) {\n\t\t\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__, $route, $options);\n\t\t\n\t\t$defaults = array(\n\t\t\t'listen'=>'DELETE',\n\t\t\t'route' => $route,\n\t\t\t'rule'=> $route\n\t\t);\n\t\t\n\t\t$filtered = self::_applyFilter(get_class(), __FUNCTION__, array(\n\t\t\t'route' => $route,\n\t\t\t'options' => $options\n\t\t), array('event' => 'args'));\n\t\t\n\t\t$route = $filtered['route'];\n\t\t$options = $filtered['options'];\n\t\t\n\t\t$options += $defaults;\n\t\t\n\t\tself::addRouteRule($options);\n\t\t\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $route, $options);\n\t}", "function delete(Request &$request, Response &$response);", "public function delete ($id)\n\t{\n\t\treturn $this->errorResponse->methodNotAllowed();\n\t}", "function doDELETE (HttpRequest $request, HttpResponse $response) {\n throw new Exception(\"DELETE method not supported\");\n }", "public function isDelete() {\n return $this->method == 'DELETE';\n }", "public function isDelete(){\n\t\treturn (strtoupper($this->getHeader('REQUEST_METHOD'))=='DELETE')? true : false;\n\t}", "public function doDelete($path);", "function actionsForDeleteMethod()\n {\n if (isset($this->id)) {\n $info = $this->api->get($this->id);\n\n if (count($info) == 0) {\n $this->print_json(404, \"Not Found\", null);\n } else {\n $this->api->id = $this->id;\n $data = $this->api->delete();\n\n if ($data) {\n array_pop($info);\n if (count($info) == 0) {\n $this->print_json(404, \"Not Found\", null);\n } else {\n $this->print_json(200, \"Item deleted\", $info);\n }\n } else {\n $this->print_json(200, false, null);\n }\n }\n\n } else {\n $this->print_json(405, \"Method Not Allowed\", null);\n }\n }", "public function testDeleteUrlUsingDELETE()\n {\n }", "public function deleteAction()\n {\n }", "public function delete($path)\n {\n }", "public function delete($uri, $function) {\n $newRoute = new Route($uri, array(\"DELETE\"), $function);\n\n $this->collection->addRoute($newRoute);\n }", "public function destroy(Request $req)\n {\n \n }", "public function delete(string $uri, array $options = []): ResponseInterface {\n return $this->request('DELETE', $uri, $options);\n }", "public function delete($route, $callback)\n {\n return $this->addRoute('DELETE', $route, $callback);\n }", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "function delete($id) {\n $centinela = new Centinela();\n $flag = $centinela->accessTo('conf/conf_viazul_routes');\n if ($flag) {\n $this->conn->delete($id);\n } else {\n $this->redirectError();\n }\n }", "public function testDeleteRequest()\n {\n $requestInstance = null;\n\n $this->router->delete('/customers/{id}/relationships/{relationship}', [\n 'middleware' => ['request', 'response'],\n function(\\Luminary\\Http\\Requests\\Destroy $request, $id, $relationship) use(&$requestInstance) {\n $requestInstance = $request;\n }\n ]);\n\n $data = [\n 'data' => [\n 'type' => 'location',\n 'id' => '1234'\n ]\n ];\n\n $this->json('DELETE', 'customers/1234/relationships/location', $data, $this->headers());\n\n $this->assertResponseStatus(204);\n $this->assertInstanceOf(\\Luminary\\Http\\Requests\\Destroy::class, $requestInstance);\n $this->assertInstanceOf(CustomerAuthorize::class, $requestInstance->getAuthorize());\n }", "public function deleteAction() {\n \n }", "public static function delete($pattern, $callback)\n {\n self::route('DELETE', $pattern, $callback);\n return new self;\n }", "public function delete(\n string $name,\n string $path,\n $requestHandler,\n array $middlewares = [],\n array $attributes = []\n ) : RouteInterface {\n return $this->route(\n $name,\n $path,\n [Router::METHOD_DELETE],\n $requestHandler,\n $middlewares,\n $attributes\n );\n }", "private function setCustomRequestDelete()\n {\n curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, 'DELETE');\n\n $this->setPostFields();\n }", "public function controllerDELETE($url) {\r\n\treturn $this->controller($url);\r\n }", "public function isDelete()\n {\n return $this->_getMethod() === \\Yana\\Http\\Requests\\MethodEnumeration::DELETE;\n }", "public function deleteAction() {\n\t\t$this->_notImplemented();\n\t}", "public function delete(string $route, callable $controller): void\n {\n $this->register($controller, Route::delete($route));\n }", "public function delete($path = '*', $callback = null)\r\n {\r\n // Get the arguments in a very loose format\r\n extract(\r\n $this->parseLooseArgumentOrder(func_get_args()),\r\n EXTR_OVERWRITE\r\n );\r\n\r\n return $this->respond('DELETE', $path, $callback);\r\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 delete($uri, $body = null, array $headers = []): ResponseInterface;", "public function delete($path);", "public function delete($path);", "public function deleteAction()\n {\n \n }", "public function delete(string $routePattern, $handler, string $name = null): CollectionInterface\n {\n }", "public function delete($request, $response)\n {\n }", "public function getMethod()\n {\n return 'deleteSymlink';\n }", "public function delete() {\r\n }", "public function delete($req, $res, $args) {\n\t\t$id = $args['id'];\n\n\t\t// Token required\n\t\tif ($this->token == NULL) {\n\t\t\treturn $this->sendError($this->constants['tokenRequired'], \"GET\", \"RADIOS\");\n\t\t}\n\n\t\t// Check if admin\n\t\tif (!$this->isAdmin($this->token)) {\n\t\t\treturn $this->sendError($this->constants['authorizationRequired'], \"GET\", \"RADIOS\");\n\t\t}\n\n\t\ttry {\n\t\t\tRadio::where('id', $id)->delete();\n\t\t}\n\t\tcatch(\\Exception $e) {\n\t\t\t/* PER DEBUG */ print_r($e->getMessage());\n\t\t\treturn $this->sendError($this->constants['generic'], \"DELETE\", \"RADIOS\");\n\t\t}\n\t}", "public function delete($path, $data = null);", "protected function deleteAction()\n {\n }", "public function delete() {\n\n }", "public function delete_delete(){\n $response = $this->PersonM->delete_person(\n $this->delete('id')\n );\n $this->response($response);\n }", "public function destroy(Request $request )\n {\n\n }", "public function testHttpMethods()\n {\n //Case A\n $r = new \\Slim\\Route('/foo', function () {});\n $this->assertEmpty($r->getHttpMethods());\n //Case B\n $r->setHttpMethods('GET');\n $this->assertEquals(array('GET'), $r->getHttpMethods());\n //Case C\n $r->appendHttpMethods('POST', 'PUT');\n $this->assertEquals(array('GET', 'POST', 'PUT'), $r->getHttpMethods());\n //Case D\n $this->assertTrue($r->supportsHttpMethod('GET'));\n $this->assertFalse($r->supportsHttpMethod('DELETE'));\n //Case E\n $viaResult = $r->via('DELETE');\n $this->assertTrue($viaResult instanceof \\Slim\\Route);\n $this->assertTrue($r->supportsHttpMethod('DELETE'));\n }", "public static function delete(){\r\n }", "public function delete($uri, $action) {\n $this->matchRoute('DELETE', $uri, $action);\n\n return $this;\n }", "public function delete(string $route, callable $controller): void\n {\n $this->controllerAggregate->add($controller, Route::delete($route));\n }", "public function isDelete()\n {\n return $this->isMethod('DELETE');\n }", "public function isDelete()\n {\n return $this->isMethod('DELETE');\n }", "public function destroy(Question $question) // the route model binding is in parameters\n //-> Question $question <- here is the model binding that binds the question controller\n // with model controller.\n {\n $question->delete();\n return response(null, Response::HTTP_NO_CONTENT); //201 is the status code generated on postman when\n // the api is deleted. \n }", "public function delete($id) {\r\n \r\n }", "public function destroy(Request $request)\n {\n }", "public function delete()\n {\n \n }", "public function deleteAction(){\n $this->_helper->json(\"Esto no esta implementado\");\n }", "public function isDelete()\n {\n return $this->getMethod() === 'DELETE';\n }", "public function delete(){\n }", "public function destroy(Request $request)\n {\n \n }", "public function delete(string $blade, array $queryParams = []): int;", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }" ]
[ "0.790508", "0.71293384", "0.7038066", "0.6905852", "0.68440896", "0.6747114", "0.671746", "0.67152524", "0.66088456", "0.65363675", "0.6509264", "0.65013474", "0.65013474", "0.6483232", "0.63649577", "0.6321028", "0.6315108", "0.6314847", "0.6312016", "0.62826693", "0.6236707", "0.62320423", "0.6230643", "0.6182344", "0.6143553", "0.6132351", "0.6119155", "0.6119155", "0.6083574", "0.6071457", "0.60651976", "0.6026828", "0.6013042", "0.60078806", "0.60023654", "0.5975007", "0.5962375", "0.59567815", "0.59280336", "0.59201026", "0.591474", "0.59145147", "0.5900482", "0.5893681", "0.5879444", "0.5871683", "0.5870899", "0.5865564", "0.5865224", "0.5864548", "0.5864548", "0.58609277", "0.5846191", "0.58400524", "0.58342046", "0.58208483", "0.57955825", "0.57673174", "0.57599884", "0.5751946", "0.5751195", "0.57347924", "0.5725441", "0.57226104", "0.57190603", "0.57190603", "0.5716049", "0.5716016", "0.57147574", "0.5705526", "0.56996214", "0.56976134", "0.5694219", "0.56791157", "0.5676835", "0.5675364", "0.56619996", "0.56599206", "0.5643672", "0.5635722", "0.5633795", "0.56287366", "0.56287366", "0.5620802", "0.56189245", "0.56067735", "0.5601103", "0.5600339", "0.55986553", "0.55985427", "0.55974543", "0.55957335", "0.55936396", "0.55936396", "0.55936396", "0.55936396", "0.55936396", "0.55936396", "0.55936396", "0.55936396" ]
0.5973524
36
/ sets a route for any request method
public function any($route, $action) { $this->router->addRoute('ANY', $route, $action); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setRoute() {\n $address = $_SERVER['REQUEST_URI'];\n \n $this->determineControllerAndMethod($address);\n\n $this->determineArguments($address);\n }", "public function route(string $requestUri, string $requestMethod);", "public function route()\n\t{\n\t\t/* [http|https]/[Ajax|]/[Get|Post|Delete|Put]/uri */\n\t\t$this->route = $this->route_raw = ($this->c->Request->is_https ? 'https' : 'http').'/'.($this->c->Request->is_ajax ? 'Ajax' : '').'/'.$this->c->Request->request.'/'.$this->c->Request->uri;\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->preRouter();\n\n\t\t/* rewrite dispatch route */\n\t\tforeach ($this->c->router['routes'] as $regexpath => $switchto) {\n\t\t\tif (preg_match($regexpath, $this->route)) {\n\t\t\t\t/* we got a match */\n\t\t\t\t$this->route = preg_replace($regexpath, $switchto, $this->route);\n\t\t\t\t$this->route_matched = $regexpath;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->postRouter();\n\n\t}", "public function set_method($method)\n\t{\n\t\t$this->route_stack[self::SEG_METHOD] = $method;\n\t}", "public function setRoute($method, $route)\t{\n\t\t//Reset internal state\n\t\t$this->class = \"NoRoute\";\n\t\t$this->params = array();\n\t\t$this->method = $method;\n\t\t$route = explode(\"?\", $route);\n\t\tif (is_array($route)) $route = $route[0];\n\t\t\n\t\tif ($this->prefix != null) $route = preg_replace(\"|\". preg_quote($this->prefix) . \"|iA\", \"\", $route);\n\t\t$this->log->setRoute($method, $route);\n\t\t$this->route = $route;\n\t\t\n\t\t$routeParts = array_filter(explode(\"/\", $route), 'strlen');\n\t\t$uri = strtolower(array_shift($routeParts));\n\t\t\n\t\tif (isset($this->routeArray[$uri]))\t{\n\t\t\tforeach($this->routeArray[$uri] as $route)\t{\n\t\t\t\tif ($route['method'] == $method && count($route['params']) == count($routeParts))\t{\n\t\t\t\t\t$this->class = $route['class'];\n\t\t\t\t\tforeach ($route['params'] as $param)\t{\n\t\t\t\t\t\t$this->params[$param] = array_shift($routeParts);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function testControllerMethodCatchAllRequestMethod()\n {\n $route = new Route();\n \n $route->set(null, \"user\", null, \"Anax\\Route\\MockHandlerControllerCatchAll\");\n \n $path = \"user/whatever\";\n $this->assertTrue($route->match($path, \"POST\"));\n $res = $route->handle($path);\n $this->assertEquals(\"catchAllPost\", $res);\n\n $this->assertTrue($route->match($path, \"PUT\"));\n $res = $route->handle($path);\n $this->assertEquals(\"catchAllPut\", $res);\n }", "public function setRequestMethod($method) {}", "public function SetRoute(string $reqMethod, string $path, callable $handler): void {\n $this->routes[$reqMethod][$path] = $handler;\n }", "public function setMethod($request_method) {}", "public static function route();", "protected function _initRequestMethod()\n {\n $this->set('_method', $_SERVER['REQUEST_METHOD']);\n }", "public function route() {\n\t\t$method = $_SERVER['REQUEST_METHOD'];\n\t\t$request = (isset($_SERVER['PATH_INFO'])) ? explode(\"/\", trim($_SERVER['PATH_INFO'], \"/\")) : \"\";\n\t\t\n\t\treturn $this->routeRequest($method, $request);\n\t}", "public function withMethods(array $methods): Route;", "private static function route($method, $request){\n\t\t $params = array(\n\t\t\t\t\t\t\t'splat' => array(),\n\t\t\t\t\t\t\t'captures' => array()\n\t\t\t\t\t\t\t);\n\t\t\t\n\t\t\t// If the HTTP method and the request exactly match an existing route,\n\t\t\tif(isset(self::$routes[$method][$request])){\n\t\t\t\n\t\t\t\t// Then we store the anonymous function defined for that route.\n\t\t\t\t$function = self::$routes[$method][$request];\n\t\t\t\n\t\t\t/*\tIf there is no exact match, we check to see if there are any routes that match when you treat\n\t\t\t\tthem as regexes. We also treat named parameter and splat segments as matches. */\n\t\t\t} elseif( ($route = self::reverse_preg_match_array($request, array_keys(self::$routes[$method]), array('#\\*(/|$)#', '/:[A-Za-z0-9]+/'))) && $route !== false ) {\n\t\t\t\n\t\t\t\t// If multiple matching routes were returned, we pick the last one.\n\t\t\t\t$route = end($route);\n\t\t\t\t\n\t\t\t\t// Once we've found the matching route, we retrieve and store its anonymous function.\n\t\t\t\t$function = self::$routes[$method][$route];\n\t\t\t\t\n\t\t\t\t/*\tNext, we need to construct the $params array to pass into the anonymous function. In\n\t\t\t\t\torder to do that, we need to extract all the path segments where the user's request\n\t\t\t\t\tmatched a regex pattern, named parameter, or splat segment. We call a helper\n\t\t\t\t\tfunction to extract these path segments for us. Since these path segments are the\n\t\t\t\t\tonly ones for which the request differs from the defined route, it's simple to\n\t\t\t\t\textract them. */\n\t\t\t\t$changes = self::url_diff($request, $route);\n\t\t\t\t\n\t\t\t\t// We go through each difference, and store the appropriate value in $params:\n\t\t\t\tforeach($changes as $change){\n\t\t\t\t\n\t\t\t\t\t// A difference is stored as an array that contains the route segment as its only key, with the corresponding request segment as the value.\n\t\t\t\t\tforeach($change as $index => $value) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If the current route segment is a named parameter (i.e. it starts with a colon ):\n\t\t\t\t\t\tif(preg_match('/^:/', $index)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Strip off the leading colon,\n\t\t\t\t\t\t\t$index = preg_replace('/^:/', '', $index);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// and add the key-value pair to the $params array.\n\t\t\t\t\t\t\t$params[$index] = $value;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If the current route segment is a splat,\n\t\t\t\t\t\t} elseif ($index == '*'){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// add the request segment to the end of the $params['splat'] array.\n\t\t\t\t\t\t\t$params['splat'][] = $value;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If the current route segment is a regex (or, if the request has more segments than the route\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// add the request segment to the end of the $params['captures'] array.\n\t\t\t\t\t\t\t$params['captures'][] = $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// If we've found a matching route, then $function will already be set. If we haven't, we'll use the not_found function.\n\t\t\tif(!isset($function)){\n\t\t\t\t$function = self::$not_found;\n\t\t\t}\n\t\t\t\n\t\t\t// Return the function for matched route, and the $params to pass into it when executed. \n\t\t\treturn array($function, $params);\n\t\t}", "protected function _route()\r\n\t\t{\r\n\t\t\t((!is_object($this->_route)) ? $this->_route = init_class(ROUTE_NAME) : '');\r\n\t\t}", "public static function Route()\n { \n $uri = self::getURI(); // get path\n $uri = self::parseGET($uri); // fill $_GET with params and strip them\n self::$uri = $uri;\n\n self::activateController($uri);\n }", "public static function setRoute(string $uri = '') {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__, $uri);\n\n\t\t$uri = self::_applyFilter(get_class(), __FUNCTION__, $uri, array('event' => 'args'));\n\t\t\n\t\tif (empty($uri)) {\n\t\t\t$uri = $_SERVER['REQUEST_URI'];\n\t\t}\n\n\t\tif (substr($uri, strlen($uri) - 1) === '/') {\n\t\t\t$uri = substr_replace($uri, '', strlen($uri) - 1);\n\t\t}\n\n\t\t$routes = array();\n\n\t\t$pos = @strpos($uri, '?');\n\n\t\tif ($pos !== false) {\n\t\t\t$uri = substr_replace($uri, '', $pos, strlen($uri));\n\t\t}\n\n\t\t$uri_parts = explode('/', $uri);\n\n\t\tforeach ($uri_parts as $key => $value) {\n\t\t\tif (empty($uri_parts[$key])) {\n\t\t\t\tunset($uri_parts[$key]);\n\t\t\t}\n\t\t}\n\n\t\t$uri_parts = array_values($uri_parts);\n\t\t$uri = '/' . implode('/', $uri_parts);\n\t\t\n\t\t$assigned_route = array();\n\t\t$default_route = array();\n\t\t$assigned_route_options = array('listen'=> '*');\n\t\t$default_route_options = array();\n\t\t\n\t\t$method = (isset($_SERVER['REQUEST_METHOD'])) ? $method = $_SERVER['REQUEST_METHOD'] : null;\n\t\t\n\t\tforeach (self::$routes as $route) {\n\t\t\t\n\t\t\tif(self::_isAllowRequest($route['listen'], $method)) {\n\t\t\t\t\n\t\t\t\t$reRule = preg_replace(self::$default_rule_replace, self::$default_route_replace, $route['rule']);\n\t\t\t\t$reRule = str_replace('/', '\\/', $reRule);\n\t\n\t\t\t\tif (preg_match('/' . $reRule . '/', $uri, $matches)) {\n\t\n\t\t\t\t\t$uri_match = '';\n\t\t\t\t\tforeach ($matches as $key => $value) {\n\t\t\t\t\t\tif (!Validator::isInteger($key)) {\n\t\t\t\t\t\t\t$uri_match .= '/' . $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}//end foreach\n\t\n\t\t\t\t\t$match_1 = str_replace($uri_match, '', $uri);\n\t\t\t\t\t$match_2 = str_replace($uri_match, '', $matches[0]);\n\t\n\t\t\t\t\tif ($match_1 === $match_2 && !empty($match_1)) {\n\t\t\t\t\t\t$assigned_route = $matches;\n\t\t\t\t\t\t$assigned_route_options = $route;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if ($match_1 === $match_2 && empty($match_1)) {\n\t\t\t\t\t\t$default_route = $matches;\n\t\t\t\t\t\t$default_route_options = $route;\n\t\t\t\t\t}\n\t\t\t\t}//end if prgrack mage\n\t\t\t}\n\t\t}//end first for\n\n\t\tif (!empty($assigned_route)) {\n\t\t\t$final_route = $assigned_route;\n\t\t\t$route_options = $assigned_route_options;\n\t\t\tif (!isset($final_route['route'])) {\n\t\t\t\t$final_route['route'] = $default_route;\n\t\t\t}\n\t\t\tif (!isset($route_options['route'])) {\n\t\t\t\t$route_options['route'] = $default_route;\n\t\t\t}\n\t\t} else {\n\t\t\t$final_route = $default_route;\n\t\t\t$route_options = $default_route_options;\n\t\t}\n\n\t\tself::$route_parameters = $final_route;\n\t\tself::$route_options = $route_options;\n\t\t\n\t\t$method = (isset($_SERVER['REQUEST_METHOD'])) ? $method = $_SERVER['REQUEST_METHOD'] : null;\n\t\t\n\t\tif(!isset($route_options['listen']) || (isset($route_options['listen']) && $route_options['listen'] == '*')) {\n\t\t\tself::$correct_request_method = true;\n\t\t} else {\n\t\t\t$listen = strtoupper($route_options['listen']);\n\t\t\t\n\t\t\tif(strpos($listen, $method )!== false) {\n\t\t\t\tself::$correct_request_method = true;\n\t\t\t} else {\n\t\t\t\tself::$correct_request_method = false;\n\t\t\t}\n\t\t}\n\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $final_route, $route_options);\n\n\t\tif(self::$correct_request_method) {\n\t\t\t\n\t\t\tif (!empty($route_options['activate_ssl']) && $route_options['activate_ssl'] && !self::isSecureConnection()) {\n\t\t\t\tself::activateSSL();\n\t\t\t} else if (!empty($route_options['deactivate_ssl']) && $route_options['deactivate_ssl'] && self::isSecureConnection()) {\n\t\t\t\tself::deactivateSSL();\n\t\t\t}\n\t\n\t\t\tif (!empty($route_options['redirect'])) {\n\t\t\t\tself::redirect($route_options['redirect']);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($route_options['callback'])) {\n\t\t\t\treturn call_user_func_array($route_options['callback'], array(new Request()));\n\t\t\t}\n\t\t}\n\n\t}", "public function & SetMethod ($method = NULL) {\n\t\t/** @var $this \\MvcCore\\Route */\n\t\t$this->method = strtoupper($method);\n\t\treturn $this;\n\t}", "public static function setMethod(string $method): void {\r\n $_SERVER['REQUEST_METHOD'] = strtoupper($method);\r\n }", "public function testRouterAddByAddRouteSeveralMethods($method)\n {\n $router = new Router();\n\n $router->any([\"GET\", \"POST\"], \"user\", function () {\n return \"user\";\n });\n\n $router->always(function () {\n return \"always\";\n });\n\n $res = $router->handle(\"user\", $method);\n if ($method === \"GET\" || $method === \"POST\") {\n $this->assertEquals(\"user\", $res);\n }\n\n if (!($method === \"GET\" || $method === \"POST\")) {\n $this->assertEquals(\"always\", $res);\n }\n\n $routes = $router->getAll();\n $this->assertEquals(2, count($routes));\n }", "public function setRoute(array $route): void;", "public function testControllerMethodCatchAll()\n {\n $route = new Route();\n \n $route->set(null, \"user\", null, \"Anax\\Route\\MockHandlerControllerCatchAll\");\n \n $path = \"user/whatever\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"catchAll\", $res);\n }", "static function set_route ($regex_path, $controller_method, $auth_required = 'any', $permission_required = null) {\n\t\tself::$routes[] = [\n\t\t\t'regex_path' => $regex_path,\n\t\t\t'controller_method' => $controller_method,\n\t\t\t'auth_required' => $auth_required,\n\t\t\t'permission_required' => $permission_required\n\t\t];\n\t}", "function route($path=''){\r\n try {\r\n parent::route($path != '' ? $path : self::getEndPoint());\r\n } catch (Exception $e) {\r\n parent::route('help');\r\n }\r\n }", "function http_request_method_register($method) {}", "public function set_route($route)\n {\n }", "private function setMethod()\n {\n $this->_requestMethod = $_SERVER['REQUEST_METHOD'];\n if (!in_array($this->_requestMethod, $this->_allowMethod)) {\n throw new Exception(\"Request method not allowed!\", 405);\n }\n }", "public function testHttpMethods()\n {\n //Case A\n $r = new \\Slim\\Route('/foo', function () {});\n $this->assertEmpty($r->getHttpMethods());\n //Case B\n $r->setHttpMethods('GET');\n $this->assertEquals(array('GET'), $r->getHttpMethods());\n //Case C\n $r->appendHttpMethods('POST', 'PUT');\n $this->assertEquals(array('GET', 'POST', 'PUT'), $r->getHttpMethods());\n //Case D\n $this->assertTrue($r->supportsHttpMethod('GET'));\n $this->assertFalse($r->supportsHttpMethod('DELETE'));\n //Case E\n $viaResult = $r->via('DELETE');\n $this->assertTrue($viaResult instanceof \\Slim\\Route);\n $this->assertTrue($r->supportsHttpMethod('DELETE'));\n }", "function route(Request $request);", "private function setRoutes() : void\n {\n $this->routes = $this->routeProvider->getRoutes();\n $this->syRouteCollection = new RouteCollection();\n foreach ($this->routes as $route) {\n $syRoute = new SymfonyRoute(\n $route->getPath(),\n $route->getParamsDefaults(),\n $route->getParamsRequirements(),\n [],\n '',\n [],\n $route->getMethods()\n );\n $this->syRouteCollection->add($route->getName(), $syRoute);\n }\n }", "public function RouteRequest ();", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "protected function defineRoute($method,$path,$fn,$paramsSequence) {\n \n $route = Array('method'=>$method,'path'=>$path,'fn'=>$fn,'paramsSequence'=>$paramsSequence);\n $this->_routes[] = $route;\n return true;\n \n }", "private function set($url,$location,$reqMethod){\n\t\t\t//validate routeformat\n\t\t\t$valid = explode(\"@\",$location);\n\t\t\tif(count($valid) != 2){ throw new \\Exception(\"Trying to save invalid route format\"); }\n\t\t\t\n\t\t\t$this->allRoutes[] = Route::set($url,$location,$reqMethod);\n\t\t}", "public function setRoutes()\n {\n $this->route('/test_extend', function() {\n $this->get(function($request, $response, $params) {\n $array = array_merge($this->foo(), $request->getHeaders());\n $response->write(200, $array);\n\n return $response;\n })->auth(\\Dioxide\\AUTH_BASIC); // require basic auth to use this method\n });\n\n\n // send the request headers back to the user\n $this->route('/headers', function() {\n $this->get(function($request, $response, $params) {\n $rateHeaders = $this->emit('rate.limit.headers', [$request->getRealRemoteAddr()]);\n\n $response->write(200, $request->getHeaders()); // send the request headers back\n $response->headers($rateHeaders);\n\n return $response;\n });\n });\n\n $this->route('/post_test', function() {\n $this->post(function($request, $response, $params) {\n $response->write(200, $request->getContent());\n return $response;\n });\n });\n\n $this->route('/server_vars', function() {\n $this->get(function($request, $response, $params) {\n $response->write(200, $_SERVER);\n return $response;\n });\n });\n\n $this->route('/cache_test', function() {\n $this->get(function($request, $response, $params) {\n $response->write(200, ['foo' => 'bar']); // will be a 304 with no response body if cached\n return $response;\n });\n });\n\n }", "public function route() {\n\t\t$action = $this->validateAction();\n\t\tif (method_exists($this, str_replace('-', '', $action))) {\n\t\t\t$this->$action();\n\t\t} else {\n\t\t\t$this->error($action);\n\t\t}\n\t}", "public function route()\n {\n $path = Url::getPath();\n\n // If no routes exist, set 404\n if (count($this->routes) == 0)\n {\n return;\n }\n\n // Check if exact match (cheap)\n if ((isset($this->routes[$path]))\n && (!$this->routes[$path]['is_regex']))\n {\n $this->dispatch($this->routes[$path]);\n exit;\n }\n\n // Loop through all routes and attempt to find a match. (expensive)\n foreach ($this->routes as $i => $route)\n {\n $matches = null;\n\n // If route found\n if (($route['is_regex'])\n && (preg_match($route['match'], $path, $matches)))\n {\n // Remove full match from array list\n array_shift($matches);\n\n $this->dispatch($route, $matches);\n exit;\n }\n }\n }", "public static function getRoutesForMethod($method);", "public function testRouterAddByAny($method)\n {\n $router = new Router();\n\n $router->any(null, \"about\", function () {\n return \"about\";\n });\n\n $res = $router->handle(\"about\", $method);\n $this->assertEquals(\"about\", $res);\n\n $routes = $router->getAll();\n $this->assertEquals(1, count($routes));\n }", "function add_route($route, $function, $method='GET') {\n array_push($this->routers, Array(\n 'expression' => $route,\n 'function' => $function,\n 'method' => $method\n ));\n }", "public function method(string $method): Route\n {\n $this->setMethods(explode('|', $method));\n\n return $this;\n }", "private function route($path='')\n\t{\n\t\tif ( !$this->is_routed && self::check_path($path) )\n\t\t{\n\t\t\t$this->is_routed = 1;\n\t\t\t$this->path = $path;\n\t\t\t$fpath = $path;\n \n // We go through each path, starting by the longest until it's empty\n\t\t\twhile ( strlen($fpath) > 0 ){\n\t\t\t\tif ( $this->get_controller($fpath) ){\n\t\t\t\t\tif ( strlen($fpath) < strlen($this->path) ){\n $this->arguments = [];\n $args = explode('/', substr($this->path, strlen($fpath)));\n foreach ( $args as $a ){\n if ( \\bbn\\str\\text::is_number($a) ){\n $a = (int)$a;\n }\n array_push($this->arguments, $a);\n }\n\t\t\t\t\t\t// Trimming the array\n\t\t\t\t\t\twhile ( empty($this->arguments[0]) ){\n\t\t\t\t\t\t\tarray_shift($this->arguments);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$t = end($this->arguments);\n\t\t\t\t\t\twhile ( empty($t) ){\n\t\t\t\t\t\t\tarray_pop($this->arguments);\n\t\t\t\t\t\t\t$t = end($this->arguments);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$fpath = strpos($fpath,'/') === false ? '' : substr($this->path,0,strrpos($fpath,'/'));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( !$this->controller ){\n\t\t\t\t$this->get_controller('default');\n\t\t\t}\n\t\t}\n\t\treturn $this;\n\t}", "public function testRouterAddByAll($method)\n {\n $router = new Router();\n\n $router->all($method, function () use ($method) {\n return \"all-$method\";\n });\n\n $res = $router->handle(\"\", $method);\n $this->assertEquals(\"all-$method\", $res);\n\n $res = $router->handle(\"about\", $method);\n $this->assertEquals(\"all-$method\", $res);\n\n $res = $router->handle(\"what/ever\", $method);\n $this->assertEquals(\"all-$method\", $res);\n\n $routes = $router->getAll();\n $this->assertEquals(1, count($routes));\n }", "public function __construct() {\n $this->setRoutes(array(\n 'user' => 'getAllUsers',\n 'user/:userId' => 'getCertainUser',\n 'fixName/:variableName' => 'anotherMethod'\n ));\n }", "public function set_matched_route($route)\n {\n }", "function match($methods, $uri, $action)\n {\n Route::match($methods, $uri, $action);\n }", "protected function handleMethod()\n {\n try {\n parent::$method = new ReflectionMethod(parent::$view->name, Request::$method);\n } catch(Exception $e) {\n self::jump(405);\n }\n }", "public static function register_rest_routes() {\n\t\tforeach (static::$apis as $api) {\n\t\t\t$api->register_rest_route();\n\t\t}\n }", "public static function routes(): void\n {\n //\n }", "public function __construct() {\n $this->setRoutes(array(\n 'user/:userId' => 'updateCertainUser',\n 'fixName/:variableName' => 'anotherMethod'\n ));\n }", "public function register_routes() {\n\n\t\t\\add_filter( 'do_parse_request', array( $this, 'handle_routing' ) );\n\n\t}", "public function test_match_withSupportedMethod()\n {\n $route = new Route('GET|POST', '/home', 'test');\n $this->assertTrue(\n $route->match('GET', '/home'),\n 'match() must return true if method provided is supported by the route instanciated with more than one method.'\n );\n }", "static function route () {\n\t\tif (isset($_GET['path'])) {\n\t\t\t$get_path = $_GET['path'];\n\t\t}\n\t\telse {\n\t\t\t$get_path = '/';\n\t\t}\n\n\t\t// check if GET path has a match, show 404 by default if it does not\n\t\t$parameters = [];\n\t\t$controller_method = 'AppController::four_zero_four';\n\n\t\tforeach (self::$routes as $route) {\n\t\t\tif ($route['regex_path'] != '/') {\n\t\t\t\t$route['regex_path'] = trim($route['regex_path'], '/');\n\t\t\t}\n\n\t\t\tif (preg_match('|^'.$route['regex_path'].'$|i', $get_path, $parameters)) {\n\t\t\t\t// match found for GET path\n\t\t\t\tif ($route['auth_required'] == 'not_signed_in' && AppUser::is_signed_in()) {\n\t\t\t\t\t// auth required is not_signed_in and user is signed in, redirect to dashboard\n\t\t\t\t\tRedirector::redirect('dashboard');\n\t\t\t\t}\n\t\t\t\telse if ($route['auth_required'] == 'signed_in' && !AppUser::is_signed_in()) {\n\t\t\t\t\t// auth required is signed in and user is not signed in, redirect to sign in page\n\t\t\t\t\tRedirector::redirect('sign_in');\n\t\t\t\t}\n\n\t\t\t\tif ($route['permission_required'] == null || AppUser::has_permission($route['permission_required'])) {\n\t\t\t\t\t// set controller method if user has permission\n\t\t\t\t\t$controller_method = $route['controller_method'];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// user does not have permission, redirect to index\n\t\t\t\t\tRedirector::redirect('/');\n\t\t\t\t}\n\n\t\t\t\t// remove first parameter as it is the GET path and not a value we want\n\t\t\t\tif (!empty($parameters)) {\n\t\t\t\t\tunset($parameters[0]);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// route to the corresponding controller method\n\t\tcall_user_func_array($controller_method, $parameters);\n\t}", "protected function setAction()\n {\n $method = $this->request->method;\n $this->route->method = strtoupper($method);\n\n if ($this->route->method === 'POST') {\n $this->route->action = 'create';\n\n } elseif ($this->route->method === 'PUT') {\n $this->route->action = 'update';\n\n } elseif ($this->route->method === 'DELETE') {\n $this->route->action = 'delete';\n\n } else {\n $this->route->method = 'GET';\n $this->route->action = 'read';\n }\n\n $this->route->special_action = '';\n\n $this->valid_actions = $this->actions[$this->route->action];\n\n return $this;\n }", "public function declare_routes(){\n\n $this->routes = \\Chocolatine\\get_configuration( 'routes' );\n $view_manager = \\Chocolatine\\get_manager('view');\n\n /**\n * Declare all route\n */\n foreach ( $this->routes as $key => $current_route) {\n\n $this->router->map(['GET', 'POST'], $current_route['route'] ,function ($request, $response, $args) {\n\n $router = \\Chocolatine\\get_service( 'Router' );\n return $router->controller( $request, $response, $args );\n\n });\n\n }\n\n }", "public function testAddRouteShorthandMethodOptions()\n {\n $this->collection->options('name', '/', 'action');\n\n $this->assertCount(1, $this->collection->all());\n\n $routes = $this->collection->all();\n\n $this->assertArrayHasKey('0', $routes);\n\n $this->assertContains('OPTIONS', $routes[0]->getMethods());\n }", "public function addRoutes(Route $route, $method, string $path)\n {\n if(is_array($method))\n foreach ($method as $type) {\n $this->routes[strtoupper($type)][$path] = $route;\n }\n else\n $this->routes[strtoupper($method)][$path] = $route;\n }", "public function testAddRouteShorthandMethodGet()\n {\n $this->collection->get('name', '/', 'action');\n\n $this->assertCount(1, $this->collection->all());\n\n $routes = $this->collection->all();\n\n $this->assertArrayHasKey('0', $routes);\n\n $this->assertContains('GET', $routes[0]->getMethods());\n }", "public function testRouteSetsPattern()\n {\n $route1 = new \\Slim\\Route('/foo/bar', function () {});\n $this->assertEquals('/foo/bar', $route1->getPattern());\n }", "public function setHttpMethod($method)\n\t{\n\t\tif (!is_numeric($method) || $method < 1 || $method > 8)\n\t\t\tthrow new Exception\\ArgumentMismatchException(\"You should set http method with Request class constants.\");\n\t\t\n\t\t$this->_httpMethod = $method;\n\t}", "public function route() {\n\t\t// Start the profiler\n\t\tProfiler::register('Core', 'Router');\n\n\t\t// First, let's look at the URL the user supplied\n\t\t$requestUrl = array_values(array_filter(explode('/', Request::getUrl())));\n\t\t$requestRoute = null;\n\n\t\t// Loop over each route and test to see if they are valid\n\t\tforeach (self::$_routes as $route) {\n\t\t\tif ($this->routeTest($requestUrl, $route)) {\n\t\t\t\t$requestRoute = $route;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// We have completed the route matching\n\t\t// Finish the setup of the request object\n\t\tProfiler::register('Core', 'Request');\n\t\tif ($requestRoute) {\n\t\t\t$_GET['controller'] = $route->endpoint['controller'];\n\t\t\t$_GET['action'] = $route->endpoint['action'];\n\t\t\tRequest::setUrlFragments(str_replace($this->_routePath, '', Request::getUrl()));\n\t\t} else {\n\t\t\tRequest::setUrlFragments(Request::getUrl(), true);\n\t\t}\n\t\tProfiler::deregister('Core', 'Request');\n\n\t\t// Inform the event listener a request has been initialised\n\t\tEvent::trigger(\n\t\t\t'initRequest',\n\t\t\tarray(\n\t\t\t\t'controller' => Request::get('controller'),\n\t\t\t\t'action' => Request::get('action')\n\t\t\t)\n\t\t);\n\n\t\t// And stop the profiler\n\t\tProfiler::deregister('Core', 'Router');\n\t\tProfiler::deregister('Core', 'Front');\n\n\t\t// And dispatch\n\t\tDispatcher::loadController(\n\t\t\tRequest::get('controller'),\n\t\t\tRequest::get('action')\n\t\t);\n\t}", "private function processRequestMethod($method) {\n if(in_array(strtoupper($method),$this->supportedRequestMethods)) {\n $this->requestMethod=strtoupper($method);\n } elseif (strtoupper($method)==\"GET\") {\n $this->exceptionWithResponseCode(405,\n \"\\\"GET\\\" is not currently a supported request method. \" .\n \"Try the other API: https://wiki.egi.eu/wiki/GOCDB/PI/Technical_Documentation\"\n );\n }else {\n $this->exceptionWithResponseCode(405,\n \"\\\"\" . $method . \"\\\" is not currently a supported request method. For more details see: $this->docsURL\"\n );\n }\n }", "public function resolveMethod()\n {\n $value = $this->_value( @$_SERVER['REQUEST_METHOD'], '' );\n $value = $this->_value( @$_SERVER['HTTP_X_HTTP_METHOD'], $value );\n $this->method = strtolower( trim( $value ) );\n }", "public function addRoutes(): void\n {\n $router = $this->config['router'] ?? Router::class;\n $router::$DELIMITER = $this->delimiter;\n foreach (static::$routes as [$url, $func, $method]) {\n $router::add($url, [$this, $func], $method);\n }\n }", "public function route() {\n\n try {\n \n $obj = APIFactory::init($this->parsed_path[0]);\n echo $this->getAction($obj, $this->parsed_path);\n \n } catch(UndefinedActionException $e) { \n\n echo $e->getMessage();\n\n } catch(Exception $e) {\n\n echo $e->getMessage();\n\n }\n }", "public function test_route_method_array() {\n\t\tregister_rest_route(\n\t\t\t'test-ns',\n\t\t\t'/test',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t$routes = $GLOBALS['wp_rest_server']->get_routes();\n\n\t\t$this->assertSame(\n\t\t\t$routes['/test-ns/test'][0]['methods'],\n\t\t\tarray(\n\t\t\t\t'GET' => true,\n\t\t\t\t'POST' => true,\n\t\t\t)\n\t\t);\n\t}", "private function beforeRoutingMiddleWare()\n {\n if (isset($this->before[$_SERVER['REQUEST_METHOD']])) {\n $this->handle($this->before[$_SERVER['REQUEST_METHOD']]);\n }\n }", "public function testAddRouteShorthandMethodPatch()\n {\n $this->collection->patch('name', '/', 'action');\n\n $this->assertCount(1, $this->collection->all());\n\n $routes = $this->collection->all();\n\n $this->assertArrayHasKey('0', $routes);\n\n $this->assertContains('PATCH', $routes[0]->getMethods());\n }", "public function setMethod($value) { $this->_method = $value; }" ]
[ "0.7600561", "0.7455477", "0.71577156", "0.71222436", "0.7086271", "0.70638144", "0.7040639", "0.69762903", "0.6912904", "0.6664856", "0.6632385", "0.6568038", "0.6551657", "0.64986575", "0.64751595", "0.64742285", "0.6467912", "0.63887656", "0.63814634", "0.63746554", "0.63544923", "0.6339895", "0.6316923", "0.6299036", "0.62989444", "0.6296997", "0.6293471", "0.62842685", "0.6269739", "0.6266775", "0.6265571", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.62444377", "0.6243368", "0.6238948", "0.62375844", "0.6236121", "0.621573", "0.6203104", "0.61910915", "0.6186467", "0.61600256", "0.6159775", "0.6152083", "0.61482394", "0.61430824", "0.61369073", "0.61226416", "0.61064214", "0.6099072", "0.6070487", "0.60688037", "0.60645413", "0.6063537", "0.60610306", "0.6057121", "0.6047696", "0.60451925", "0.60451514", "0.60432285", "0.60405535", "0.6037257", "0.60058254", "0.60023206", "0.6001893", "0.59864074", "0.59809816", "0.597818", "0.59769136", "0.5967424", "0.5964141" ]
0.0
-1
/ sets an optional userdefined controller action for the 404 response
public function notFound($action) { $this->router->notFound($action); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function actionNotFound()\n\t{\n\t\tzf::halt(\"You can't call this function \\\"actionNotFound\\\" directly. You must redefine it in your controller.\");\n\t}", "public function error404Action() \n {\n return '404 Page not found';\n }", "public function actionNotfound()\n {\n $this->actionSlug = 'notfound';\n $this->actionParams = [];\n $this->breadcrumbs=[];\n $this->beforeAction();\n $this->breadcrumbs[] = ['title' => 404];\n header(\"HTTP/1.x 404 Not Found\");\n header(\"Status: 404 Not Found\");\n echo $this->render('404');\n exit;\n }", "public function action_404()\n\t{\n\t\t//return Response::forge(ViewModel::forge('welcome/404'), 404);\n\t}", "public function & SetDefaultControllerNotFoundActionName ($defaultControllerNotFoundActionName);", "public function action_404()\n\t{\n\t\treturn Response::forge(ViewModel::forge('welcome/404'), 404);\n\t}", "public function action_404()\r\n {\r\n return Response::forge(Presenter::forge('welcome/404'), 404);\r\n }", "public function action_404()\n\t{\n\t\treturn Response::forge(Presenter::forge('welcome/404'), 404);\n\t}", "public function action_404()\r\n\t{\r\n\t\treturn Response::forge(Presenter::forge('welcome/404'), 404);\r\n\t}", "public function error404Action()\n\t{\n\t\t$method = '_notFound' . ENVIRONMENT;\n\n\t\t// Try to call the internal method for the environment\n\t\tif (method_exists($this, $method))\n\t\t{\n\t\t\treturn $this->$method();\n\t\t}\n\n\t\t// If the method for the current environment does not exist\n\t\t// We just output the 404 production view :)\n\t\t$this->setViewFileName('Error/404-production');\n\t}", "public function indexAction(){\n $this->view->render('404');\n\t}", "public function NotFound() {\r\n\t\t$this->PrepareController();\r\n\t\t$this->View = 'notfound';\r\n\t\t$this->Render();\r\n }", "protected function do_404() {\n header('HTTP/1.1 404 Not Found');\n \n $actionsPath = $this->config->get_key('paths', 'actions');\n $action = $actionsPath.'/page-not-found.php';\n \n if (file_exists($action)) {\n require($action);\n \n if (class_exists('PageNotFound')) {\n PageNotFound::get_instance($this->options);\n }\n \n exit;\n } else {\n throw new HaploActionNotFoundException('No default 404 action found. Add a file named page-not-found.php to '.$actionsPath.' to suppress this message.');\n }\n }", "protected function noAction()\n {\n header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');\n\n // Build and return the output\n $this->error = true;\n $this->result->setAttribute('type', 'error');\n $this->result->appendChild($this->dom->createElement('message', 'Action not found'));\n $this->buildOutput();\n }", "public function actionError()\n\t{\n\t\tif($error = Yii::app()->errorHandler->error)\n\t\t{\n if($error['code']==404)\n\t\t\t$this->render('pages/404');\n else\n $this->redirect('/');\n\t\t}\n\t}", "public function action_404(){\n\t\t$this->template->title = 'けんさく';\n\t\t$this->template->content = View::forge('util/404');\n\t\t$this->template->breadcrumb = array(array(\"url\" => \"/util/404\", \"name\" => \"404 Not Found\"));\n\t}", "public function invalidAction($action) {\t\r\n\t\t$this->render(array('default', 'pageNotFound'));\r\n\t}", "public function action_404()\n\t{\n\t\t$this->template->title = '404 Not Found';\n\t\t$this->template->header_title = site_title($this->template->title);\n\t\t$this->template->content = View::forge('error/404');\n\t\t$this->response->status = 404;\n\t}", "public function set_404()\n {\n }", "function notfound() {\n\t\t$this->fw->render('404');\n\t}", "public function action_404() {\n $this->template->content = View :: factory('error/404');\n }", "public function error404()\n {\n $this->whenError();\n $viewData['status'] = 404;\n $viewData['title'] = 'Not Found';\n $viewData['msg'] = 'Sorry but the page you are looking for does not exist, have been removed.';\n\n $this->pageError($viewData);\n }", "public function errorAction() {\n\t\tZend_Layout::getMvcInstance ()->setLayout ( \"light\" );\n\t\t$errors = $this->_getParam ( 'error_handler' );\n\t\tif ($errors->exception->getCode () == 404 || in_array ( $errors->type, array (\n\t\t\t\tZend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE,\n\t\t\t\tZend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER,\n\t\t\t\tZend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION \n\t\t) )) {\n\t\t\t$this->getResponse ()->setHttpResponseCode ( 404 );\n\t\t\t$this->_helper->viewRenderer ( '404' );\n\t\t}\n\t\t\n\t\t\n\t\t$this->view->content = $errors->exception->getMessage ();\n\t}", "public function notfoundAction()\n {\n $this->render('error/notfound');\n }", "public function error404() {\n\t\t$this->render('error400');\n\t}", "public function handle_404()\n {\n }", "public function show404();", "function maybe_redirect_404()\n {\n }", "public function notFound()\n {\n Controller::getController('PageNotFoundController')->run();\n }", "public function _remap () {\n show_404();\n }", "public function actionnotfound()\n {\n $this->render('notfound');\n }", "public function handler404()\n {\n $this->getResponse()->setStatusCode(404);\n return;\n }", "public function routenotfoundAction()\n {\n return $this->createResponse('Route Not Found', 404);\n }", "public function onActionNotFound() {\n if ( method_exists( $this->controller, \"onActionNotFound\" ) ) {\n $this->controller->onActionNotFound();\n } else {\n $closure = $this->onActionNotFound;\n if ( is_object( $closure ) && get_class( $closure ) == \"Closure\" ) {\n $closure();\n }\n }\n }", "private static function pageNotFound()\n {\n if (self::$notFound && is_callable(self::$notFound)) {\n call_user_func(self::$notFound);\n } else {\n header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');\n throw new ExceptionHandler(\"Hata\", \"Controller bulunamadı\");\n }\n }", "function actionNotFound($actionName = null, $arguments = null)\n {\n $this->response()->withStatus(Status::CODE_NOT_FOUND);\n }", "function p404()\n{\n\thttp_response_code(404);\n\tView\\Json::render(['error'=>'page not found']);\n}", "private function notFound()\n {\n $this->method = 'error404';\n header('X-PHP-Response-Code: 404', true, 404);\n }", "public function force404();", "public function force404();", "function pageNotFound()\n {\n $this->global['pageTitle'] = 'Garuda Informatics : 404 - Page Not Found';\n \n $this->loadViews(\"404\", $this->global, NULL, NULL);\n }", "public function notFound()\n {\n $this->httpResponseCode = 404;\n }", "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}", "public function error404()\n {\n }", "public function Error404() {\n\t\t$this -> Render();\n\t}", "function lb_show_404_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'page_404',\n\t\t)\n\t);\n}", "function lb_show_404_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'page-404',\n\t\t)\n\t);\n}", "public function actionIsNotAllowed()\n {\n throw new NotFoundException(__('Page not found.'));\n }", "public function set404($func)\n {\n $this->notFound = $func;\n }", "private function _404error()\n\t{\n\t\trequire $this->_controllerPath.'_404Controller.php';\n\t\t$this->_controller = new _404Controller();\n\t\treturn false;\n\t}", "public function cgetAction()\n {\n throw new NotFoundHttpException();\n }", "function handleError (&$controller, &$request, &$user)\n\t{\n\t\t$controller->forward(ERROR_404_MODULE, ERROR_404_ACTION);\n\t\treturn VIEW_NONE;\n\t}", "public function pageNotFound()\n {\n $this->_status = '404 Page Not Found';\n }", "protected function redirectNotFound()\n {\n return Response::view('errors.404', array('pageTitle'=> Lang::get('messages.Error')), 404);\n }", "public function actionIndex()\n {\n return ['status' => '404','message' => 'Not Found'];\n }", "protected function redirectNotFound(){\r\n \theader('Location: '.BASE_URI.Routes::getUri('not_found'));\r\n }", "public function error404(){\n\t\t$this->loadErrorView('Cette page n\\'existe pas', 'Error 404', 404); \n\t}", "public function Error404()\n\t{\n\t\t$this->Render();\n\t}", "public static function notFound(){\n\n throw new \\yii\\web\\HttpException(404, 'Not Found', 405);\n }", "function _404() {\n die();\n }", "public function redirect404(){\n\n\t\t$this->page = new PageGenerator($this->app);\n\t\t$this->page->setContentFile(__DIR__ . '/../Errors/404');\n\t\t\n\t\t$this->addHeader('HTTP/1.0 404 Not Found');\n\t\t\n\t\t$this->send();\n\t\t\n\t}", "public function errorAction()\n {\n $errors = $this->_getParam('error_handler');\n\n switch ($errors->type) {\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\n\n // 404 error -- controller or action not found\n $this->getResponse()->setHttpResponseCode(404);\n $this->view->message = 'Page not found';\n break;\n default:\n // Generic application error\n $this->getResponse()->setHttpResponseCode(500);\n $this->view->message = 'Application error';\n break;\n }\n\n $this->view->exception = $errors->exception;\n $this->view->request = $errors->request;\n $this->_response->clearBody();\n }", "public function errorAction() {\n $errors = $this->_getParam(\"error_handler\");\n \n // assegno i valori alla view\n $this->viewInit();\n switch ($errors->type) {\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\n // 404 error -- controller or action not found \n $this->getResponse()->setRawHeader(\"HTTP/1.1 404 Not Found\");\n $this->view->title = \"HTTP/1.1 404 Not Found\";\n break;\n default:\n // application error; display error page, but don't change \n // status code\n $this->view->title = \"Application Error\";\n break;\n }\n $this->view->message = $errors->exception;\n }", "public static function displayError404() {\n\n\t\t\tself::display('Main/Status/Error404', 'STATUS_TITLE_404', STATUS_CODE_404);\n\t\t}", "public function show_404() \n\t{\n\t\trequire $this->load->view('404', 'error');\n\t\texit;\n\t}", "function action_index()\n {\n //$data['user'] = $user;\n\t$this->view->generate('home_404.php', 'main_view.php'); \n }", "public function customize_preview_override_404_status()\n {\n }", "protected function response_404()\n {\n $this->log->write_log('debug', $this->TAG . ': response_404: ');\n $this->response_error(VALUE_STATUS_CODE_ERROR, 'Page not found / wrong method', 404);\n }", "public function actionError() {\n if ($error = Yii::app()->errorHandler->error) {\n if (Yii::app()->request->isAjaxRequest){\n echo $error['message'];\n $this->render('404', $error);\n }\n else\n $this->render('404');\n }\n $this->render('404');\n }", "function show_404() {\n\t\tredirect( 'users', 'location' );\n\t\texit();\n\t}", "protected function RequestNotFound($msg)\r\n {\r\n $displayedError = false;\r\n\r\n if (!is_null(KrisConfig::$Error404Handler) && is_array(KrisConfig::$Error404Handler) && count(KrisConfig::$Error404Handler) > 1)\r\n {\r\n if ($this->GetControllerRequest(KrisConfig::$Error404Handler['controller'], KrisConfig::$Error404Handler['action'], $error, $controllerObj, $function))\r\n {\r\n if (!KrisConfig::DEBUG)\r\n {\r\n $msg = '';\r\n }\r\n call_user_func_array(array($controllerObj, $function), array($msg));\r\n $displayedError = true;\r\n }\r\n else\r\n {\r\n /** @var $log Log */\r\n $log = AutoLoader::Container()->get('Log');\r\n $log->Error('Unable to call Error404Handler, function ' . KrisConfig::$Error404Handler . ' does not exist');\r\n }\r\n }\r\n\r\n if (!$displayedError)\r\n {\r\n $this->request->SetError(404, '<html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>' . $msg .\r\n '<p>The requested URL was not found on this server.</p><p>Please go <a href=\"javascript: history.back(1)\">back</a>' .\r\n ' and try again.</p><hr /></body></html>');\r\n }\r\n }", "public function Error()\r\n\t{\r\n\r\n $this->load->view('404');\r\n\r\n\t}", "public function error404()\n\t{\n\t\t//envoie une entête 404 (pour notifier les clients que ça a foiré)\n\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\tView::show(\"errors/404.php\", \"Oups ! Perdu ?\");\n\t}", "private function create404()\n {\n $this->response->setStatusCode(404);\n\n $url = $this->request->originalUrl ?: $this->request->getUrl();\n $escaper = new Escaper();\n $message = sprintf(\n \"Cannot %s %s\\n\",\n $escaper->escapeHtml($this->request->getMethod()),\n $escaper->escapeHtml((string) $url)\n );\n $this->response->end($message);\n }", "public function redirect404()\n\t{\n\t\t$this->page = new Page($this->app);\n\t\t$this->page->setView('404.php');\n\t\t$this->addHeader('HTTP/1.0 404 Not Found');\n \t$this->send();\n\t}", "function error_404()\n\t{\n\t\t$this->output->set_status_header('404');\n\t\t$this->template->set_template('error');\n\t\t$this->template->write('title', 'HappyPerks');\n\t\t$data = $this->template->write_view('content', '404/error', isset($data) ? $data : NULL,true);\n\t\tprx($data);\n\t\t// $this->template->render();\n\n\t}", "public function executeError404()\n {\n return sfView::SUCCESS;\n }", "public function error_404()\n\t{\n\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\tmeta::set_title('This Page will be Forever Missed');\n\t\t$this->template\n\t\t\t->set('title', 'Missing Page')\n\t\t\t->set('content', View::factory('errors/404'));\n\t}", "private function route_not_found() {\r\n\t\t\t// Also when in debug mode - show comprehensive messages\r\n\t\t\tdie(\"404 Page not found\");\r\n\t\t}", "public function pageNotFound404()\n {\n $this->template->set('global_setting', $this->global_setting);\n $this->template->set('page', 'faq');\n $this->template->set_theme('default_theme');\n $this->template->set_layout('frontend')\n ->title($this->global_setting['site_title'] . ' | 404 Page Not found')\n ->set_partial('header', 'partials/header')\n ->set_partial('footer', 'partials/footer');\n $this->template->build('frontpages/page_not_found');\n }", "public function notFound()\n {\n http_response_code(404);\n error_log('404 page not found: '.$this->getRequest());\n kodexy()->loadView('system/notFound');\n $this->completeRequest();\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 }", "public function makeErrorAction()\n {\n // test this\n\n $this->app->abort(404, 'I am a code generated 404 error message');\n\n }", "public function set404($fn)\n {\n $this->notFoundCallback = $fn;\n }", "public function my404() {\n $is_backend = 0;\n $show_header = 1;\n if(superadmin_logged_in() && $this->uri->segment(1) =='backend') {\n $is_backend = 1;\n $show_header = 0;\n }\n $this->output->set_status_header('404'); \n $data['title'] = 'Page Not Found';\n $data['show_header'] = $show_header;\n $data['template'] = 'frontend/my404';\n if($is_backend) {\n $this->load->view('template/backend/superadmin_template',$data);\n }\n else {\n $this->load->view('template/frontend/template',$data);\n }\n }", "private function pageNotFound()\n {\n $this->theme->setTitle(\"Sidan saknas\");\n $this->views->add('error/404', [\n 'title' => 'Sidan saknas',\n ], 'main-wide');\n }", "public static function respond404()\n {\n header($_SERVER['SERVER_PROTOCOL'].\" 404 Not Found\", true, 404); //.replace = true\n $view = new NWTemplate();\n $view->display('404.tpl');\n }", "public function ooops()\r\n\t{\r\n\t\t$this->template->view('utilities/404.php');\r\n\t}", "protected function notFound()\n {\n $this->response = $this->response->withStatus(404);\n $this->jsonBody($this->payload->getInput());\n }", "public function missingController($error) {\n\t\t$this->notFound($error);\n\t}", "public static function status404($data=null) {\n\t\tself::response($data,404);\n\t}", "public function notFound($message = null)\n {\n throw new Zend_Controller_Action_Exception($message, 404);\n }", "public function notFound()\r\n {\r\n\r\n $this->render('Page Not Found', '404.view');\r\n }", "public function NotFoundAction($param = array(), &$vParam = array(), &$vShab = array()) {\n\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\t$vParam['item'] = $this->GetModelContent()->GetItem(2);\n\t\tif ($vParam['item']) {\n $vParam['title'] = \"Страница не найдена\";\n $vParam['description'] = (isset($vParam['item']['description']) ? $vParam['item']['description'] : '');\n $vParam['keywords'] = (isset($vParam['item']['keywords']) ? $vParam['item']['keywords'] : '');\n\t\t}\n\t\t$vShab['content'] = $this->ViewPath . '404.phtml';\n\t}", "public function notFound() {\n\t\t\theader('HTTP/1.0 404 Not Found');\n\t\t\t$this->render('error/404.twig.html');\n\t\t}", "function not_found() {\n\treturn show_template('404');\n}", "public function notFoundPageHandler() {\n $valid = true;\n $url_route = !empty($this->request->get['_route_']) ? $this->request->get['_route_'] : '';\n\n // Check non alias\n $url_base = $this->request->server['HTTPS'] ? $this->config->get('config_ssl') : $this->config->get('config_url');\n $url_request = ($this->request->server['HTTPS'] ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n if (!$url_route) {\n $url_route = urldecode(str_replace($url_base, '', $url_request));\n }\n\n\n // Blacklist 404 that start with this word\n $blacklist = array('admin/', 'asset/', 'assets/', 'image/', 'cache/', 'view/');\n foreach ($blacklist as $block) {\n if (strpos($url_route, $block) !== false) {\n $valid = false;\n break;\n }\n }\n\n if ($valid) {\n $route = $this->{$this->callModel}->MissingPageWorker($url_route, $this->storeId);\n\n if ($route) {\n // Info: Chrome and Firefox cache a 301 redirect with no expiry date\n $this->response->redirect($url_base . ltrim($route, '/'), 301);\n }\n }\n }", "public function ActionNotFound($parameter = null)\n {\n // in base class of framework. Please check framework.php::Run method.\n $this->View->lblMsg = \"The page you are looking for is not available.\";\n $this->View->Render(\"app\".DS.\"urlprotection.php\");\n }", "public function testNotFoundAction()\n {\n $this->routeMatch->setParam('action', 'merda');\n \n $result = $this->controller->dispatch($this->request, $this->response);\n \n // Verifica o response\n $response = $this->controller->getResponse();\n \n $this->assertEquals(404, $response->getStatusCode());\n \n }", "public static function error404(){\n \t\t// header(\"Status: 404 Not Found\");\n \t\theader('Location: /');\n }" ]
[ "0.75687605", "0.73959404", "0.7356556", "0.730947", "0.72667104", "0.71842384", "0.71421397", "0.7117137", "0.71134186", "0.71047837", "0.70784706", "0.70471174", "0.704137", "0.69491005", "0.6945228", "0.6942602", "0.6928617", "0.6900098", "0.68907547", "0.6839075", "0.6805022", "0.678537", "0.67793274", "0.6743849", "0.67300177", "0.67081517", "0.6692994", "0.6686808", "0.66646606", "0.6654559", "0.6647458", "0.66340035", "0.6632552", "0.6624067", "0.6611161", "0.65868425", "0.65641725", "0.6557101", "0.6512771", "0.6512771", "0.6512465", "0.649455", "0.6492522", "0.6460686", "0.64603764", "0.6458382", "0.64376557", "0.6414321", "0.64119744", "0.64080065", "0.6406108", "0.63988733", "0.63743", "0.6374078", "0.63711077", "0.6367991", "0.63515675", "0.6342291", "0.6330774", "0.63177663", "0.63062227", "0.6305067", "0.6301581", "0.62980163", "0.62972426", "0.6292777", "0.6288781", "0.6285335", "0.6283014", "0.62815195", "0.62766886", "0.62607116", "0.6259606", "0.62578523", "0.62498283", "0.624936", "0.62480104", "0.62437934", "0.6226396", "0.6220154", "0.6216411", "0.6212703", "0.6211005", "0.6202527", "0.6192519", "0.6190616", "0.619014", "0.61665934", "0.6160641", "0.6159615", "0.6148234", "0.613772", "0.61349225", "0.61269146", "0.61147994", "0.61141354", "0.61101776", "0.61085534", "0.6106921", "0.6096548" ]
0.6543763
38
/ setter for a configuration item
public function config($key, $value = null){ if (is_array($key)) { Config::set($key); } else { Config::set($key, $value); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_item($item, $value)\n\t{\n\t\t$this->config[$item] = $value;\n\t}", "public function set_item($item, $value)\n\t{\n\t\tGSMS::$config[$item] = $value;\n\t}", "public function setConfig($a_configItem, $a_value)\n {\n $this->m_config[$a_configItem] = $a_value;\n }", "public abstract function setConfig($key, $value);", "public function setConfig($key, $value);", "function setItemValue ($name, $type, $newValue) {\n\t\tif ($this->existsItemStrict ($name, $type)) {\n\t\t\t$fullName = $fullName = '/'.$type.$name;\n\t\t\t$config = $this->allConfigItems[$fullName];\n\t\t\treturn $config->setValue ($newValue);\n\t\t} else {\n\t\t\treturn new Error ('CONFIGURATOR_ITEM_DOESNT_EXISTS', $name);\n\t\t}\n\t}", "public function setConfig($item, $value) {\n\t\t\n\t\tif (null === $value) {\n\t\t\t$this->config->remove($item);\n\t\t} else {\n\t\t\t$this->config->set($item, $value);\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "abstract protected function saveConfiguration($name, $value);", "public function set(string $key, $value) : void\n {\n if (isJson($this->configuration)) {\n $configuration = json_decode($this->configuration, true);\n $configuration[$key] = $value;\n $this->configuration = json_encode($configuration);\n } else {\n $this->configuration = json_encode([\n $key => $value\n ]);\n }\n\n $this->saveOrFail();\n }", "public function setItem($key, $item);", "abstract function set ($item, $data);", "protected function setConfigValue($data){\t\n\t\tMage::getModel('core/config_data')->load($data['path'],'path')->setData($data)->save();\n\t}", "public function __set($name,$value)\n\t{\n\t\tif(in_array($name,$this->config_other_attributes))\n\t\t\t$this->list_other_attributes[$name]=$value;\n\t\telse \n\t\t\tparent::__set($name,$value);\n\t}", "public function setItem($key, $value) {\n $this->setItems([$key => $value]);\n }", "function __set($name, $value)\n {\n $this->item[$name] = $value;\n }", "public function __set($key, $value)\n\t{\n\t\t$this->config(array($key => $value));\n\t}", "function set($key, $val)\n {\n $config[$key] = $val;\n \n }", "public function set($key, $value)\n\t{\n\t\t$this->componentConfig->set($key, $value);\n\t}", "function setConfigValue( $path, $value, $type = 'leave' )\n\t{\n\t\t$this->conf[$path]\t\t\t=\t$this->convertValue( $value, $type );\n\t\t$this->currentConf[$path]\t=\t$this->convertValue( $value, $type );\n\t}", "function setProperty() {\n $instance = $this->CI->ciwy->current_instance[$this->component_name];\n $properties = func_get_arg(0);\n if (is_array($properties)) {\n foreach($properties as $key => $val) {\n if ( ! isset($this->component_property[$key])) {\n $message = '[' . $this->CI->ciwy->library_name . '] '. $key . ' is not a '.$this->component_name .' Property.';\n log_message('error', $message);\n show_error($message);\n } else {\n $this->CI->ciwy->component_config[$instance]['Config'][$key] = $val;\n }\n }\n }\n }", "public function __set($name, $value)\n {\n if ($this->_allowModifications) {\n if (is_array($value)) {\n $this->_data[$name] = new self($value, true);\n } else {\n $this->_data[$name] = $value;\n }\n $this->_count = count($this->_data);\n } else {\n /** @see Zend_Config_Exception */\n require_once 'Zend/Config/Exception.php';\n throw new Zend_Config_Exception('Zend_Config is read only');\n }\n }", "public function setProperty($key, $value);", "function setConfig( $pName, $pValue ) {\n\t\t$this->mConfig[$pName] = $pValue;\n\t\treturn( TRUE );\n\t}", "function setProperty($name, $value) {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_module_options.php');\n base_module_options::writeOption($this->moduleGuid, $name, $value);\n }", "function setValue($app, $key, $value)\n {\n if ( is_array($value) ) $value = serialize($value);\n $name = $app . \"-\" . $key;\n $this->fDebug->add(get_class($this) . \"::setValue(): Setting values for $name\", 4);\n if ( !$this->isEntitySet($name) ) $this->ValidEntity($name);\n $this->$name = $value;\n }", "abstract protected function _updateConfiguration();", "public function set_value($set_value = NULL,$index = NULL,$item = NULL){\n if(is_null($index)){\n $this->ini_file_array = $set_value;\n } else if(is_null($item)){\n $this->ini_file_array[\"$index\"] = $set_value;\n } else {\n $this->ini_file_array[\"$index\"][\"$item\"] = $set_value;\n }\n }", "function __set($property, $value) {\n global $DB;\n if(is_array($value) && @$this->TYPE[$property] === 'CSV') $value = join(',',$value);\n if(!isset($this->DATA[$property])\n || $this->DATA[$property] !== $value) {\n $DB->config->update(array('value' => $value), array('property' => $property, 'section' => $this->NAME), true);\n $this->DATA[$property] = $value;\n }\n }", "public function set($config){\n\t\t$this->configValues = $config;\n\t}", "public function setProperty(string $key, $value): self;", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "function set_config($config_name, $config_value, $is_dynamic = false)\n{\n\tglobal $db, $cache, $config;\n\n\t$sql = 'UPDATE ' . CONFIG_TABLE . \"\n\t\tSET config_value = '\" . $db->sql_escape($config_value) . \"'\n\t\tWHERE config_name = '\" . $db->sql_escape($config_name) . \"'\";\n\t$db->sql_query($sql);\n\n\tif (!$db->sql_affectedrows() && !isset($config[$config_name]))\n\t{\n\t\t$sql = 'INSERT INTO ' . CONFIG_TABLE . ' ' . $db->sql_build_array('INSERT', array(\n\t\t\t'config_name'\t=> $config_name,\n\t\t\t'config_value'\t=> $config_value,\n\t\t\t'is_dynamic'\t=> ($is_dynamic) ? 1 : 0));\n\t\t$db->sql_query($sql);\n\t}\n\n\t$config[$config_name] = $config_value;\n\n\tif (!$is_dynamic)\n\t{\n\t\t$cache->destroy('config');\n\t}\n}", "public function setWithConfig(string $id, $class, $config_file, $setter = false);", "public function setConfig($data, $value) {\n if (is_string($data)) {\n $this->_config[$data] = $value;\n } else {\n throw new ConfigException(\"Error while setting a config value\");\n }\n }", "public function setData($key, $value);", "public function setData($key, $value);", "function set($name, $value, $site_guid = 0) {\n\n\n\t\t$name = trim($name);\n\n\t\t// cannot store anything longer than 255 characters in db, so catch before we set\n\t\tif (elgg_strlen($name) > 255) {\n\t\t\t_elgg_services()->logger->error(\"The name length for configuration variables cannot be greater than 255\");\n\t\t\treturn false;\n\t\t}\n\n\t\t$site_guid = (int) $site_guid;\n\t\tif ($site_guid == 0) {\n\t\t\t$site_guid = (int) $this->CONFIG->site_guid;\n\t\t}\n\n\t\tif ($site_guid == $this->CONFIG->site_guid) {\n\t\t\t$this->CONFIG->$name = $value;\n\t\t}\n\n\t\t$escaped_name = sanitize_string($name);\n\t\t$escaped_value = sanitize_string(serialize($value));\n\t\t$result = _elgg_services()->db->insertData(\"INSERT INTO {$this->CONFIG->dbprefix}config\n\t\t\tSET name = '$escaped_name', value = '$escaped_value', site_guid = $site_guid\n\t\t\tON DUPLICATE KEY UPDATE value = '$escaped_value'\");\n\n\t\treturn $result !== false;\n\t}", "public function set($name, $value){}", "function __set($name,$value){\r\n try{\r\n return parent::__set($name,$value);\r\n }catch(exception $e){\r\n return $this->_options[$name]=$value;\r\n }\r\n }", "public function setValue($value) {\r\n $cfg = $this->config->get();\r\n $cfg['field_value'] = $value;\r\n $this->config = new \\codename\\core\\config($cfg);\r\n return;\r\n }", "public function setValue($key = null, $value = null)\n {\n $position = key(($this->configuration)) - 1;\n\n if (intval($position) === -1) {\n $position = count($this->configuration) - 1;\n }\n\n $keys = $this->Header; // Retorna todas as keys do item atual\n\n if (is_numeric($key) && isset($keys[$key])) { // se for um numero o indice substituira o key pelo seu nome\n $key = $keys[$key];\n }\n\n if (isset($this->_current[$key])) {\n $this->_current[$key] = $value;\n $this->configuration[$position][$key] = $value;\n return;\n }\n\n }", "public function __set($item, $value)\n {\n $this->offsetSet($item, $value);\n }", "protected function _setValue($name, $value) {}", "function set_external_config($key, $value)\n {\n $this->_external_config[$key] = $value;\n }", "public function set($key, $value) {\n $this->store->setConfigValue($key, $value);\n }", "function __set($name,$value){\n try{\n return parent::__set($name,$value);\n }catch(exception $e){\n return $this->_options[$name]=$value;\n }\n }", "abstract public function setValue($value);", "public function set ( $name, $value ) {\n\t\tif(!ctype_alpha(str_replace(' ', '', $name))) {\n\t\t\tthrow new \\InvalidArgumentException(sprintf('The name \"%s\" is invalid.', $name));\n\t\t}\n\t\t$this->config[$name] = $value;\n\t}", "public function set( $key , $value ) {\n\t\teval( '$this->items' . $this->nodelize( $key ) . ' = $value;' );\n\t}", "public function set($name, $value)\n {\n try {\n if (is_string($name) && is_string($value)) {\n \n if ($value == '') {\n if (array_key_exists($name, $this->_defaults)) {\n $value = $this->_defaults[$name];\n }\n }\n \n if ((new Query)->from('{{%podium_config}}')->where(['name' => $name])->exists()) {\n Yii::$app->db->createCommand()->update('{{%podium_config}}', ['value' => $value], 'name = :name', [':name' => $name])->execute();\n }\n else {\n Yii::$app->db->createCommand()->insert('{{%podium_config}}', ['name' => $name, 'value' => $value])->execute();\n }\n \n $this->cache->set('config', array_merge($this->_defaults, $this->getFromDb()));\n \n return true;\n } \n }\n catch (Exception $e) {\n Log::error($e->getMessage(), null, __METHOD__);\n }\n \n return false;\n }", "function _assign_to_config($items = array())\n\t{\n\t\tif (is_array($items))\n\t\t{\n\t\t\tforeach ($items as $key => $val)\n\t\t\t{\n\t\t\t\t$this->set_item($key, $val);\n\t\t\t}\n\t\t}\n\t}", "public static function set(string $config, mixed $value) : void{\n self::$configurations[$config] = $value;\n }", "public function set($name, $value);", "public function set($name, $value);", "public function set($name, $value);", "public static function set(string $key, mixed $value)\n {\n static::$config[$key] = $value;\n }", "public function setConfig($id, $value) {\n\t\t$config = $this->em->getRepository('SSNTherapassBundle:Config')->find($id);\n\t\tif (is_null($config)) {\n\t\t\t$config = new Config();\n\t\t}\n\t\t$config->setValue($value);\n\t\tif (is_null($config->getId())) {\n\t\t\t$config->setId($id);\n\t\t\t$this->em->persist($config);\n\t\t}\n\t}", "public function setItem($item) {\n $this->item = $item;\n }", "public function __set($name, $value);", "public function __set($name, $value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function set($key, $item)\n {\n $this->items[$key] = $item;\n }", "public function setValue($key, $value);", "public function setValue($key, $value);", "function __set($name, $value){\n //var_dump($value);\n\n $this->_properties[$name] = $value;\n }", "public function setValue($key, $value) {\n\t\t$this->config->setValue($key, $value);\n\t}", "public function set( $key, $value ) {\n\n $this->_getConfigVars();\n $this->_conf[$key] = $value;\n $this->_updateConfigFile();\n }", "function __set ($name, $value)\n\t{\n\t\tswitch ($name) {\n\t\t\tcase \"background\":\n\t\t\t\t$this->_setProperty($name, $value);\n\t\t\tbreak;\n\t\t\tcase \"bgColor\":\n\t\t\tcase \"link\":\n\t\t\tcase \"vLink\":\n\t\t\tcase \"aLink\":\n\t\t\tcase \"text\":\n\t\t\t\t$this->_setProperty($name, $value, \"bool\");\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tparent::__set($name, $value);\n\t\t\tbreak;\n\t\t}\n\t}", "public function setConfiguration(IConfiguration $config);", "protected function _set_parameter($key, $value)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->is_loaded = FALSE;\n\n $file = new File(self::APP_CONFIG);\n\n if (! $file->exists())\n $file->create(\"root\", \"root\", \"0644\");\n\n $match = $file->replace_lines(\"/^$key\\s*=\\s*/\", \"$key = $value\\n\");\n\n if (!$match)\n $file->add_lines(\"$key = $value\\n\");\n }", "public function set($key, $value)\n {\n if ($config = $this->getConfigFor($key)) {\n if ($type = Arr::get($config, 'type')) {\n @settype($value, $type);\n }\n $this->setting->set($key, $value);\n }\n }", "protected function _set_parameter($key, $value)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $file = new File(self::FILE_CONFIG);\n\n if (! $file->exists())\n $file->create('root', 'root', '0644');\n\n $match = $file->replace_lines(\"/^$key\\s*=\\s*/\", \"$key = $value\\n\");\n\n if (!$match)\n $file->add_lines(\"$key = $value\\n\");\n\n $this->is_loaded = FALSE;\n }", "public function __set($key, $value);", "public function setValue($config_id, $value, $type, $project_id = 0, $user_id = 0, $access_reqd = 90) {\n\n $query = \"SELECT * FROM `mantis_config_table` WHERE config_id='$config_id' AND project_id='$project_id'\";\n $result = SqlWrapper::getInstance()->sql_query($query);\n\t if (!$result) {\n \t if (!self::$quiet) {\n echo \"<span style='color:red'>ERROR: Query FAILED</span>\";\n }\n \t exit;\n }\n if (0 == SqlWrapper::getInstance()->sql_num_rows($result)) {\n\n self::$logger->debug(\"setValue $config_id: $value (type=$type)\");\n\n // --- add to DB\n $query = \"INSERT INTO `mantis_config_table` (`config_id`, `project_id`, `user_id`, `access_reqd`, `type`, `value`) \".\n \"VALUES ('$config_id', '$project_id', '$user_id', '$access_reqd', '$type', '$value');\";\n $result = SqlWrapper::getInstance()->sql_query($query);\n\t if (!$result) {\n \t if (!self::$quiet) {\n echo \"<span style='color:red'>ERROR: Query FAILED</span>\";\n }\n \t exit;\n }\n\n\n // --- add/replace Cache\n $key = $config_id.\"_\".$project_id;\n self::$configVariables[\"$key\"] = new ConfigMantisItem($config_id, $project_id, $user_id, $access_reqd, $type, $value);\n } else {\n self::$logger->warn(\"setValue($config_id, $project_id): variable already exists and will NOT be modified.\");\n }\n\n }", "public function set_config($key, $value) {\n $this->config[$key] = $value;\n }", "public static function set($name, $value)\n {\n self::$config[$name] = $value;\n }", "public function set(string $key, $value)\n {\n $this->items[$key] = $value;\n }", "public static function set($q = 'store/blind', $value = false)\n {\n $branch = &self::$config;\n $section = explode('/', trim($q, ' /'));\n\n if(count($section)>1)\n {\n $lastRound = count($section)-1;\n\n foreach($section as $k => $s)\n {\n if(is_object($branch))\n {\n $branch = &$branch->$s;\n }else{\n $branch = &$branch[$s];\n }\n\n if($lastRound == $k)\n {\n $branch = $value;\n }\n }\n unset($branch);\n }\n }", "public function setOption($key, $value);", "public function setValue($name, $value){\n if(empty($this->items[$name]))\n return;\n $this->items[$name]['value']=$value;\n }" ]
[ "0.7377834", "0.69909805", "0.69847304", "0.6901345", "0.6777166", "0.65271866", "0.6521171", "0.6329534", "0.61958444", "0.6163527", "0.6111967", "0.6064122", "0.60511076", "0.60177374", "0.5987528", "0.59761506", "0.59574866", "0.59489787", "0.5929193", "0.5925566", "0.5867454", "0.58581555", "0.58486515", "0.5797297", "0.57920545", "0.5791463", "0.5771816", "0.5765854", "0.57540727", "0.57535267", "0.5751982", "0.5751982", "0.5751982", "0.5751982", "0.5751982", "0.5751982", "0.5751982", "0.5751982", "0.5751982", "0.5751982", "0.5751982", "0.5751031", "0.5751031", "0.5749609", "0.5720274", "0.5713235", "0.5706471", "0.5706471", "0.5704792", "0.56881243", "0.5685323", "0.5673791", "0.56727004", "0.5657226", "0.5652164", "0.5648262", "0.564475", "0.56342036", "0.563208", "0.5612884", "0.56125426", "0.560817", "0.55988157", "0.55948776", "0.55940664", "0.55940664", "0.55940664", "0.55936986", "0.5590483", "0.5588907", "0.5587968", "0.5587968", "0.5569597", "0.5569597", "0.5569597", "0.5569597", "0.5569597", "0.5569597", "0.5569597", "0.5569597", "0.5569597", "0.5569597", "0.5563945", "0.5547007", "0.5547007", "0.5546075", "0.5542772", "0.55261743", "0.5508614", "0.5486671", "0.54860103", "0.54856557", "0.54786795", "0.54762965", "0.5475894", "0.5474055", "0.5462852", "0.5448345", "0.5447857", "0.5444749", "0.5439144" ]
0.0
-1
/ setter for a database configuration users can add multiple configurations by using the $instance parameter
public function database(array $config, $instance = 'default') { Database::configure($config, $instance); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function configureObject( $instance )\n {\n switch ( $instance )\n {\n /* Gauffr DB */\n case Gauffr::GAUFFR_DB_INSTANCE:\n $cfg = ezcConfigurationManager::getInstance();\n list( $driver, $user, $password, $host, $database ) = $cfg->getSettingsAsList( Gauffr::CONF_FILE, 'GauffrMasterDB',\n array( 'Driver', 'User', 'Password', 'Host', 'DataBase' ) );\n break;\n\n /* Auther DB */\n default: // Default instance\n break;\n }\n\n $db = ezcDbFactory::create( \"$driver://$user:$password@$host/$database\" );\n $db->setAttribute( PDO::ATTR_CASE, PDO::CASE_LOWER );\n return $db;\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 }", "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}", "public function testConfigOnDefinedInstance()\n {\n $users = TableRegistry::get('Users');\n TableRegistry::config('Users', ['table' => 'my_users']);\n }", "public function setDatabase(Database_Config $databaseConfig);", "public function run_configuration(): self\n {\n foreach ($this->configs as $key => $value) {\n $this->$key($value);\n }\n extract($this->dbConfigs);\n\n $this->database_management($type, $dns, $username, $password);\n\n\n return $this;\n }", "private function configure() {\n\t\t$statement = $this -> database -> query(\"SELECT * FROM worlds\");\n\t\twhile ($worldData = $statement -> fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$this -> worlds[$worldData['world']] = new World($worldData);\n\t\t}\n\t\t$statement = $this -> database -> query(\"SELECT * FROM server.configs\");\n\t\twhile ($configData = $statement -> fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$this -> configs[$configData['key_']] = new Config($configData['key_'], $configData['value'], $configData['dataType']);\n\t\t}\n\t}", "static protected function _setDbConfig($conf)\n {\n $dbConf = self::get(\"db.conf.$conf\");\n \n if (!empty($dbConf)) {\n // Get DB info\n $table = $dbConf['table'];\n $cols = $dbConf['columns'];\n\n $query = App_Registry::db()->query($table, $cols);\n\n $data = array();\n while ($row = $query->fetch()) {\n if (!empty($row[$cols['src']])) {\n // Mandatory column\n $src = $row[$cols['src']];\n // Optional grouping by category\n if (isset($cols['cat'])) {\n // Set category\n $cat = empty($row[$cols['cat']]) ? '???' : $row[$cols['cat']];\n // Optional custom name and mail delivery\n self::_setNameAndMail($src, $cols, $row, $data[$cat]['sources']);\n } else {\n self::_setNameAndMail($src, $cols, $row, $data);\n }\n }\n }\n \n if (!empty($data)) {\n self::_setConfig(array($conf => $data), FALSE);\n return true;\n }\n }\n \n return false;\n }", "protected function setConfig()\n {\n $dbconfig = atkconfig('db');\n $config = $dbconfig[$this->m_name];\n foreach ($config['nodes'] as $mode=>$nodes)\n {\n if (is_array($nodes))\n {\n foreach ($nodes as $node) $this->setNodeConfig($node, $dbconfig[$node], $mode);\n }\n else $this->setNodeConfig($nodes, $dbconfig[$nodes], $mode);\n }\n }", "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 }", "function __construct() {\n if(is_null(self::$instance)) {\n $this->dbName = Config::get('database.name');\n $this->connect();\n $this->setPrefix(Config::get('database.prefix'));\n self::$instance = [\n 'link' => $this->link,\n 'db' => $this->dbName,\n 'prefix' => $this->prefix\n ];\n } else {\n $this->link = self::$instance['link'];\n $this->dbName = self::$instance['db'];\n $this->setPrefix(self::$instance['prefix']);\n }\n }", "public function __construct() {\n $this->configuration = new Database_Configuration();\n }", "function __construct()\n {\n $this->link = mysql_connect($cfg['database_host'], $cfg['database_user'], $cfg['database_password']);\n if (!$this->link) \n {\n echo 'Settings class error: ' . mysql_error();\n return;\n }\n \n $sel_db = mysql_select_db($cfg['database_name']);\n \n if (!$sel_db) \n {\n echo 'Settings class error: ' . mysql_error();\n return;\n }\n \n $result = mysql_query(\"SELECT * FROM settings\");\n \n if(mysql_num_rows($result) > 0)\n {\n while($row = mysql_fetch_array($result))\n {\n $this->values[$row['key']] = $row['value'];\n }\n }\n }", "protected function addConnectionsToConfig(): void\n {\n Config::set('database.connections.c1', (array) $this->schema->connections->from);\n Config::set('database.connections.c2', (array) $this->schema->connections->to);\n }", "function setup_db_config($configuration){\n // or the user is admin user\n if(_is_db_configured($configuration)){\n _is_admin_or_return($configuration);\n }\n\n // get and validate user input\n $data = json_decode(file_get_contents('php://input'));\n \n $host = parse_url($data->db_server, PHP_URL_HOST);\n if(!isset($host)){\n return Status::errorStatus('no proper hostname specified');\n }\n $port = parse_url($data->db_server, PHP_URL_PORT);\n if(!isset($port)){\n return Status::errorStatus('no port specified');\n }\n if(!preg_match('/^[a-zA-Z0-9-_\\.\\:\\]\\[]+:[0-9]+$/', $data->db_server)){\n return Status::errorStatus('only [ip|hostname]:[port] format supported for database host');\n }\n if(!isset($data->db_name) || !preg_match('/^[a-zA-Z0-9-_]+$/', $data->db_name)){\n return Status::errorStatus('invalid database name');\n }\n if(!isset($data->db_user) || !preg_match('/^[a-zA-Z0-9-_]+$/', $data->db_user)){\n return Status::errorStatus('invalid database user');\n }\n if(!isset($data->db_password) || preg_match('/\\s+/', $data->db_password)){\n return Status::errorStatus('invalid database password (containing spaces)');\n }\n\n // verify that connection works\n $new_config = new Configuration();\n $new_config->db_server = $data->db_server;\n $new_config->db_name = $data->db_name;\n $new_config->db_user = $data->db_user;\n $new_config->db_password = $data->db_password;\n $db = new DBAccess($new_config);\n if(!$db->connect()){\n return Status::errorStatus('DB access not working with the provided settings. Please check for typos, make sure that the database is reachable and that your username and password are correct.');\n }\n\n // check whether tables already exist\n $query = 'SHOW TABLES LIKE \"configuration\"';\n $res = $db->fetch_data_hash($query, 0);\n if(!$res){\n // if the table does not exist, we setup the database\n // setup a new database\n if(!file_exists(\"../config/db/schema.sql\") || !$db->apply_sql_file(\"../config/db/schema.sql\")){\n return Status::errorStatus(\"DB scheme could not be applied to database, please check server error logs\");\n }\n }\n\n // write configuration file (only after schema is applied)// build the configuration for the configuration file\n $configuration->config_file_variables['db_server'] = $data->db_server;\n $configuration->config_file_variables['db_name'] = $data->db_name;\n $configuration->config_file_variables['db_user'] = $data->db_user;\n $configuration->config_file_variables['db_password'] = $data->db_password;\n if(_write_config_file($configuration->config_file_variables)){\n return Status::successStatus(\"configuration applied and database setup\");\n }\n return Status::errorStatus(\"db could not be configured\");\n }", "public function dbInstance();", "public function loadDatabaseConfig()\n {\n $conn = Doctrine_Manager::getInstance()->getCurrentConnection();\n if(empty($conn)) {\n throw new Zend_Config_Exception('No connection to DB defined, cannot load info!');\n }\n\n $sql = $conn->createQuery();\n $sql->select('parametru, valoare');\n $sql->from('Config INDEXBY parametru');\n $data = $sql->fetchArray();\n foreach($data as &$item) {\n $item = $item['valoare'];\n }\n \n $config = new Zend_Config($data);\n $this->merge($config);\n unset($config);\n\n return $this;\n }", "function __construct()\n {\n /** Setting parametrs of Database */\n $this->config = array(\n 'host' => 'db', //value overridden in models/DB.php\n 'dbname' => 'local',\n 'username' => 'local',\n 'password' => 'local');\n }", "public function __construct() {\n $CI = & get_instance();\n $results = $CI->db->get('Settings')->result();\n\n foreach ($results as $setting) {\n\n $CI->config->set_item($setting->SettingName, $setting->SettingValue);\n }\n\n $results = $CI->db->get('Schools')->result();\n $schoolIdsValue = array();\n $schoolsInfo = array();\n\n $masterSchoolId = 1;\n\n foreach ($results as $school) {\n array_push($schoolIdsValue, $school->SchoolId);\n\n if ($school->IsMaster == 1) {\n $masterSchoolId = $school->SchoolId;\n }\n \n $schoolsInfo[$school->SchoolId] = $school;\n }\n\n $CI->config->set_item(\"school_ids\", $schoolIdsValue);\n $CI->config->set_item(\"school_metas\", $schoolsInfo);\n $CI->config->set_item(\"master_school_id\", $masterSchoolId);\n }", "function instance_allow_config() {\n //allow instances to have their own configuration\n return false;\n }", "function &db_config()\n {\n static $database;\n if ( file_exists(APPPATH.'config/database.php') ) \n {\n require_once APPPATH.'config/database.php';\n\n if ( isset($database) ) \n {\n foreach( $database as $key => $val ) \n {\n $database[$key] = $val;\n }\n return $database;\n }\n }\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 }", "private function loadConfig(){\n $DB = DB::pass();\n $conf = $DB->loadConfig();\n if ( count($conf) > 0 ){\n foreach($conf as $c){\n $this->config->set($c['cluster'] . \".\" . $c['name'],$c['value']);\n }\n } else {\n throw new SystemException(\"No database configuration\");\n }\n }", "private function __construct() {\n $this->config = array(\n // These will all need to be changed to point at your mysql server.\n \"Database\" => array(\n \"Host\" => \"localhost\",\n \"Name\" => \"daeman\",\n \"Username\" => \"daeman\",\n \"Password\" => \"<password>\",\n ),\n );\n }", "public static function configure(){\n $args = func_get_args();\n $numArgs = func_num_args();\n\n switch ($numArgs) {\n case 1:{\n if (is_array($args[0])){\n self::configureWithOptions($args[0]);\n } else {\n self::configureWithDsnAndOptions($args[0]);\n }\n break;\n }\n case 2:{\n if (is_array($args[0])){\n self::configureWithOptions($args[0], $args[1]);\n } else {\n self::configureWithDsnAndOptions($args[0], $args[1]);\n }\n break;\n }\n case 3: {\n self::configureWithDsnAndOptions($args[0], $args[1], $args[2]);\n break;\n }\n }\n }", "public function setConfiguration(array $config);", "public function database($args, $instance = TRUE, $surpress = FALSE)\n {\n // Load our connection settings. We can allow custom connection arguments\n if(!is_array($args))\n {\n // Check our registry to see if we already loaded this connection\n $Obj = \\Registry::singleton()->load(\"DBC_\".$args);\n if($Obj !== NULL)\n {\n // Skip to the instancing part unless we set instance to FALSE\n if($instance != FALSE) goto Instance;\n return $Obj;\n }\n \n // Get the DB connection information\n $info = load_class('Config')->get($args, 'DB');\n if($info === NULL)\n {\n show_error('db_key_not_found', array($args), E_ERROR);\n }\n }\n else\n {\n // Assign our $info variable, and set our connection name to $instance (unless it equals true or 1)\n $info = $args;\n if(is_bool($instance) || is_numeric($instance))\n {\n $instance = FALSE;\n $args = 'custom_database';\n }\n else\n {\n $args = $instance;\n }\n }\n \n // Check for a DB class in the Application, and system core folder\n $info['driver'] = strtolower($info['driver']);\n if(file_exists(APP_PATH. DS . 'database' . DS . 'Driver.php')) \n {\n require_once(APP_PATH. DS . 'database' . DS . 'Driver.php');\n $first = \"Application\\\\\";\n }\n else\n {\n require_once(SYSTEM_PATH. DS . 'database' . DS . 'Driver.php');\n $first = \"System\\\\\";\n }\n \n // Not in the registry, so istablish a new connection\n $dispatch = $first .\"Database\\\\Driver\";\n try{\n $Obj = new $dispatch( $info );\n }\n catch(\\Exception $e) {\n $Obj = FALSE;\n }\n \n // Error?\n if($surpress == FALSE && $Obj == FALSE)\n {\n show_error('db_connect_error', array( $info['database'], $info['host'], $info['port'] ), E_ERROR);\n }\n \n // Store the connection in the registry\n \\Registry::singleton()->store(\"DBC_\".$args, $Obj);\t\t\n \n // Here is our instance goto\n Instance:\n {\n // If user wants to instance this, then we do that\n if($instance != FALSE && !is_numeric($args))\n {\n if($instance === TRUE) $instance = $args;\n\n // Easy way to instance the connection is like this\n $FB = get_instance();\n if($FB !== FALSE)\n {\n (!isset($FB->$instance)) ? $FB->$instance = $Obj : '';\n }\n }\n }\n \n // Return the object!\n return $Obj;\n }", "function instance_config_save($data, $nolongerused = false) {\n global $DB;\n\n $config = clone($data);\n parent::instance_config_save($config, $nolongerused);\n }", "public function write() {\n\t\t$database = Registry::get(\"database\");\n\t\t$v = \"value='\" . $this -> value . \"'\";\n\t\t$statement = Registry::get(\"database\") -> query(\"UPDATE server.configs SET \" . $v . \" WHERE key_='\" . $this -> key . \"'\");\n\t}", "public function setConfiguration(array $configuration): self;", "public function database($module = 'core')\n {\n if (function_exists('get_instance')) {\n $CI =& get_instance();\n\n $CI->load->model('settings/settings_model');\n $settings = $CI->settings_model->find_all_by('module', $module);\n\n if (!is_array($settings) && count($settings) > 0)\n return false;\n\n foreach ($settings as $key => $value) {\n $CI->config->set_item($key, $value);\n }\n\n }\n }", "abstract protected function defineConfiguration();", "public static function setInstance( $instance ){\n return self::$instance = $instance;\n }", "public function __construct( $config_instance ){\n \n\t$config_instance->host = (array) $config_instance->host;\n\t\n foreach($config_instance->host as $host)\n\t $this->addServer($host, $this->port);\n\t\n\t/**\n\t * EN: If you need compression Threshold, you can uncomment this\n\t */\n\t//$this->setCompressThreshold(20000, 0.2);\n }", "abstract protected function _updateConfiguration();", "public function setOptions(array $options): DbConnectionConfigInterface;", "public function configure(): void\n {\n if ($this->isConfigured()) {\n return;\n }\n\n foreach ($this->dbal->getDatabases() as $db) {\n $schema = $db->table($this->config->getTable())->getSchema();\n\n // Schema update will automatically sync all needed data\n $schema->primary('id');\n $schema->string('migration', 255)->nullable(false);\n $schema->datetime('time_executed')->datetime();\n $schema->index(['migration']);\n\n $schema->save();\n }\n }", "private function adapt_settings( array $instance ) {\n\n\t\t$settings = $this->get_settings();\n\n\t\tif ( empty( $settings[ $this->number ] ) ) {\n\t\t\t// This should not happen (if it does, there's something wrong with WP_Widget).\n\t\t\treturn $instance;\n\t\t}\n\n\t\t$instance = $settings[ $this->number ];\n\n\t\tif ( empty( $instance['widget_link_type'] ) ) {\n\t\t\t// No need to adapt anything.\n\t\t\treturn $instance;\n\t\t}\n\n\t\tswitch ( $instance['widget_link_type'] ) {\n\t\t\tcase 'text_flag':\n\t\t\t\t$instance['widget_link_type'] = 'native';\n\t\t\t\t$instance['widget_display_flag'] = true;\n\t\t\t\tbreak;\n\n\t\t\tcase 'flag':\n\t\t\t\t$instance['widget_link_type'] = 'none';\n\t\t\t\t$instance['widget_display_flag'] = true;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t// No need to adapt anything.\n\t\t\t\treturn $instance;\n\t\t}\n\n\t\t$settings[ $this->number ] = $instance;\n\n\t\t$this->save_settings( $settings );\n\n\t\treturn $instance;\n\t}", "public static function setupConfig(string $database = \"\") {\n\n # Check database name\n if(!$database || !array_key_exists($database, self::CONFIG))\n\n # Stop function\n return;\n\n # Fill config\n Config::set(\"Database.collection.$database\", self::CONFIG[$database]);\n\n }", "function configure($key, $value, $type='system', $unique_slug='unknow', $storage_type='database') { // 配置\n\tswitch ( $storage_type ) {\n\t\tcase 'database':\n\t\t\tif ( is_null($key) ) {\n\t\t\t\treturn Config::where([\n\t\t\t\t\t'type' => $type,\n\t\t\t\t\t'unique_slug' => $unique_slug,\n\t\t\t\t])->pluck('value', 'key');\n\t\t\t} else if ( is_null($value) ) {\n\t\t\t\treturn Config::where([\n\t\t\t\t\t'type' => $type,\n\t\t\t\t\t'unique_slug' => $unique_slug,\n\t\t\t\t\t'key' => $key,\n\t\t\t\t])->value('value');\n\t\t\t} else {\n\t\t\t\t$data = Config::where([\n\t\t\t\t\t'type' => $type,\n\t\t\t\t\t'unique_slug' => $unique_slug,\n\t\t\t\t\t'key' => $key,\n\t\t\t\t])->first();\n\n\t\t\t\tif ( $data ) {\n\t\t\t\t\treturn Config::where([\n\t\t\t\t\t\t'type' => $type,\n\t\t\t\t\t\t'unique_slug' => $unique_slug,\n\t\t\t\t\t\t'key' => $key,\n\t\t\t\t\t])->update(['value' => $value]);\n\t\t\t\t} else {\n\t\t\t\t\treturn Config::create([\n\t\t\t\t\t\t'type' => $type,\n\t\t\t\t\t\t'unique_slug' => $unique_slug,\n\t\t\t\t\t\t'key' => $key,\n\t\t\t\t\t\t'value' => $value,\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\tcase 'redis':\n\t\tbreak;\n\t\tcase 'mongodb':\n\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new Exception(\"Error Config Type: \" . $storage_type, 1);\n\t\tbreak;\n\t}\n}", "function initCustomConfig() {\n\t\tglobal $db;\n\t\t\n\t\t// Use the existing PunBB database connection:\n\t\t$this->setConfig('dbConnection', 'link', $db->link_id);\n\t}", "function instance_allow_multiple() { // If yes, then it is assumed that the block WILL USE per-instance configuration\n return false;\n }", "abstract protected function saveConfiguration($name, $value);", "protected function configure()\n {\n $this->setDescription('Sets the API settings on an instance.');\n $this->setHelp('Sets the API settings on an instance.');\n\n $this->addOption(\n 'instanceid',\n 'i',\n InputOption::VALUE_REQUIRED,\n 'The instanceid of the instance we are setting the property value for.'\n );\n\n $this->addArgument('settings', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'The API settings seperate values with spaces (in format key:value).');\n\n }", "public function __construct() {\r\n /* * * maybe set the db name here later ** */\r\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 }", "public function setDatabase() {\n\n // Database configs\n $aDbConfig = $this->loadConfigVar('database');\n\n // Make sure there are database configurations\n if (empty($aDbConfig)) {\n\n // Set the system error\n $this->setError($this->loadConfigVar('errorMessages', 'noDatabaseConfiguration'));\n\n } else {\n\n // Determine the database connection type\n switch ($aDbConfig['sArchitecture']) {\n\n case 'mongo' :\n\n // Set our MongoDB instance\n $this->oDatabase = MongoDb::getInstance();\n\n // Set the server\n $this->oDatabase->setServer()\n ->setDbConnection();\n\n // Try to authenticate\n if (!$this->oDatabase->doAuthenticate()) {\n return false;\n }\n\n break;\n\n case 'mysql' :\n\n // Set the database\n $this->oDatabase = MySql::getInstance();\n\n // Authenticate\n $this->oDatabase->createConnection($aDbConfig);\n\n break;\n }\n }\n \t\n \t// Return instance\n \treturn $this;\n }", "public function databaseConfig() {\n\t\t$dbs = new DATABASE_CONFIG();\n\t\t$list = array();\n\t\t$counter = 1;\n\n\t\t$this->out('Possible database configurations:');\n\n\t\tforeach ($dbs as $db => $config) {\n\t\t\t$this->out('[' . $counter . '] ' . $db);\n\t\t\t$list[$counter] = $db;\n\t\t\t$counter++;\n\t\t}\n\n\t\t$this->out();\n\n\t\t$answer = strtoupper($this->in('Which database should the tables be created in?', array_keys($list)));\n\n\t\tif (isset($list[$answer])) {\n\t\t\t$this->install['database'] = $list[$answer];\n\t\t\t$this->db = ConnectionManager::getDataSource($this->install['database']);\n\n\t\t} else {\n\t\t\treturn $this->databaseConfig();\n\t\t}\n\n\t\treturn true;\n\t}", "function Cofiguration()\n\t{\n\t\t//$this->objConMgr = new ConnectionMgr();\n\t}", "function Database()\n {\n\t\t$config = new Config();\n\n\t\t$this->host = $config->host;\n\t\t$this->user = $config->user;\n\t\t$this->password = $config->password;\n\t\t$this->database = $config->database;\n \t\n\t}", "public static function getInstance() {\n \tif(!self::$instance) {\n\n // Vi vedo già strabuzzare gli occhi. Una classe statica di configurazione con tutti gli elementi necessari sarebbe opportuna.\n // visto i pochissimi parametri di configurazione necessari e i limitati scopi del progetto, per ora ho lasciato così.\n \t \trequire(__SITE_PATH . '/config/config.php');\n \tself::$instance = new self($db_host, $db_user, $db_password, $db_name);\n \t}\n\n\t\treturn self::$instance;\n\t}", "public function __construct(){\n $this->connection_type = config('database.connection_type');\n\n switch ($this->connection_type) {\n case self::CONN_TYPE_PDO:\n\n $dsn = config('database.driver').\":host=\".config('database.host').\";dbname=\"\n .config('database.db_name').\";charset=\".config('database.charset');\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($dsn, config('database.user'), config('database.password'), $opt);\n\n break;\n\n case self::CONN_TYPE_MYSQLI:\n\n $this->mysqli = new mysqli(config('database.host'), config('database.user'), config('database.password'),config('database.db_name'));\n break;\n\n default:\n echo \"Error: connection type '\".$this->connection_type.\"' not suppordted\" . PHP_EOL;\n exit;\n break;\n }\n }", "protected static function addModuleConfigurationsToDb()\n {\n static::_addMainConfigurationEntries();\n static::_addCredentialsConfigurationEntries();\n static::_addTransactionsConfigurationEntries();\n static::_addWpfConfigurationEntries();\n static::_addOrderConfigurationEntries();\n static::_addThreedsOptions();\n static::_addScaExemptionOptions();\n }", "private static function _addTransactionsConfigurationEntries()\n {\n global $db;\n\n $requiredOptionsAttributes = static::_getRequiredOptionsAttributes();\n $transaction_types\n = EMerchantPayCommon::buildSettingsDropDownOptions(\n EmpCheckoutSettings::getTransactionsList()\n );\n\n $placeholder = ['none' => 'No specific Bank in use'];\n $availableBankCodes\n = $placeholder + EmpCheckoutSettings::getAvailableBankCodes();\n $bank_codes\n = EMerchantPayCommon::buildSettingsDropDownOptions(\n $availableBankCodes\n );\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Transaction Types',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'TRANSACTION_TYPES'\n ) . \"',\n '\" . \\Genesis\\API\\Constants\\Transaction\\Types::SALE . \"',\n 'What transaction type should we use upon purchase?', '6', '0',\n 'emp_zfg_select_drop_down_multiple({$requiredOptionsAttributes}, \" .\n \"{$transaction_types}, ', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Bank codes for Online banking',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'BANK_CODES'\n ) . \"',\n 'none',\n 'Select Bank code(s) for Online banking transaction.', '6', '0',\n 'emp_zfg_select_drop_down_multiple({$requiredOptionsAttributes}, \" .\n \"{$bank_codes}, ', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Partial Capture',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'ALLOW_PARTIAL_CAPTURE'\n ) . \"',\n 'true', 'Use this option to allow / deny Partial Capture Transactions',\n '6', '3', 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Partial Refund',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'ALLOW_PARTIAL_REFUND'\n ) . \"',\n 'true', 'Use this option to allow / deny Partial Refund Transactions',\n '6', '3', 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Cancel Transaction',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'ALLOW_VOID_TRANSACTIONS'\n ) . \"',\n 'true', 'Use this option to allow / deny Cancel Transactions', '6', '3',\n 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n }", "function get_settings_config_data() {\n $config = $this->config;//get instance config\n\n //if config doesn't exist - create it\n if (!isset($config)) {\n $config = new stdClass();\n }\n\n //if data doesn't exist = make it an empty array\n if (!isset($config->data))\n $config->data = array();\n\n //return config\n return $config;\n }", "public function run()\n {\n Configuration::create([\n \"KEY_\" => \"business.name\",\n \"VALUE_\" => \"Zawiyah dental\"\n ]);\n\n Configuration::create([\n \"KEY_\" => \"business.address1\",\n \"VALUE_\" => \"Jalan Tok Kiah\"\n ]);\n\n Configuration::create([\n \"KEY_\" => \"business.address2\",\n \"VALUE_\" => \"Kemaman\"\n ]);\n\n Configuration::create([\n \"KEY_\" => \"business.address2\",\n \"VALUE_\" => \"Terengganu\"\n ]);\n\n }", "function DB_manager (){\n //parse configuration file\n $ini_array = parse_ini_file($this->configuration_file_path);\n $db_host = $ini_array['db_host'];\n $db_name = $ini_array['db_name'];\n $db_user = $ini_array['db_user'];\n $db_password = $ini_array['db_password'];\n\n //make a connection\n $mysqli = new mysqli($db_host, $db_user , $db_password, $db_name);\n if (mysqli_connect_errno()) {\n printf(\"Connect failed: %s\\n\", mysqli_connect_error());\n exit();\n }\n\n $this->db = $mysqli;\n }", "private static function _addCredentialsConfigurationEntries()\n {\n global $db;\n\n $requiredOptionsAttributes = static::_getRequiredOptionsAttributes();\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Genesis API Username',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('USERNAME') . \"',\n '', 'Enter your Username, required for accessing the Genesis Gateway',\n '6', '4', 'emp_zfg_draw_input({$requiredOptionsAttributes}, ', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Genesis API Password',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('PASSWORD') . \"',\n '', 'Enter your Password, required for accessing the Genesis Gateway',\n '6', '4', 'emp_zfg_draw_input({$requiredOptionsAttributes}, ', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Live Mode',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('ENVIRONMENT') . \"',\n 'false', 'If disabled, transactions are going through our Staging \" .\n \"(Test) server, NO MONEY ARE BEING TRANSFERRED', '6', '3',\n 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n }", "public function setConfiguration($config){\r\n $this->configuration=$config;\r\n }", "protected function configure()\n {\n $this->addDatabaseConfig();\n $this->addVariantConfig();\n $this->addOption(\n 'override',\n null,\n InputOption::VALUE_NONE,\n 'Allow overriding an existing database'\n );\n $this->addOption(\n 'wait',\n 'w',\n InputOption::VALUE_NONE,\n 'Wait for the server to be ready'\n );\n $this->addOption(\n 'migrate',\n null,\n InputOption::VALUE_NONE,\n \"Do not fail if the database exists, but perform a\\nmigration, instead\"\n );\n }", "public function __construct($INIConfig,$master=false,$cluster=false) {\n $this->log = new Logger('Database');\n $this->log->pushHandler(new StreamHandler(ROOT_PATH.'/logs/database.log', common::$logger_level));\n $this->INIConfig = $INIConfig;\n $this->master_slave = $master;\n $this->cluster = $cluster;\n\n //Set Global-Configuration\n $this->dbConf['global'] = $this->INIConfig->getSection('global');\n\n if($this->INIConfig->getSection('master')) {\n $this->dbConf['master'] = $this->INIConfig->getSection('master');\n }\n\n if(!$this->INIConfig->getSection('master_1')) {\n $this->dbConf['slave'] = $this->INIConfig->getSection('slave');\n }\n\n // Multi-Masters * Cluster\n if($this->INIConfig->getSection('master_1')) {\n foreach ($this->INIConfig->getSections() as $id => $name) {\n if(strpos($name, 'master_') !== false) {\n $this->dbConf[$name] = $this->INIConfig->getSection($name);\n }\n }\n }\n // Multi-Slaves\n else if($this->INIConfig->getSection('slave_1')) {\n foreach ($this->INIConfig->getSections() as $id => $name) {\n if(strpos($name, 'slave_') !== false) {\n $this->dbConf[$name] = $this->INIConfig->getSection($name);\n }\n }\n }\n }", "function setProperty() {\n $instance = $this->CI->ciwy->current_instance[$this->component_name];\n $properties = func_get_arg(0);\n if (is_array($properties)) {\n foreach($properties as $key => $val) {\n if ( ! isset($this->component_property[$key])) {\n $message = '[' . $this->CI->ciwy->library_name . '] '. $key . ' is not a '.$this->component_name .' Property.';\n log_message('error', $message);\n show_error($message);\n } else {\n $this->CI->ciwy->component_config[$instance]['Config'][$key] = $val;\n }\n }\n }\n }", "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 setConfiguration(){\n\t\t/* Check the attributes type supported by system */\n\t\t/* debugVar(unserialize(LEAD_ATTRIBUTE_INPUT_ELEMENT), true); */\n\t\t\n\t\t/* Check the attributes validation type supported by system */\n\t\t/* debugVar(unserialize(LEAD_ATTRIBUTE_INPUT_VALIDATION), true); */\n\t\t\n\t\t/* Creating form object */\n\t\t$objForm\t= new Form();\n\t\t\t\t\t\n\t\t/* variable initialization */\n\t\t$strConfigArr[\"exiting_attr\"]\t= array(\"policy\" => array('attri_value_list'=>$objForm->getDropDown(getArrByKeyvaluePairs($this->_setPolicyList(),\"id\",\"name\"),'',false,false)));\n\t\t\n\t\t/* if parent schema is passed then do needful */\n\t\tif(isset($this->_strDataSet[\"table\"]) && ($this->_strDataSet[\"table\"] != \"\")){\n\t\t\t/* Custom Query */\n\t\t\t$strConfigArr[\"customQuery\"]\t= array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"table\"=>$this->_strDataSet[\"table\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"column\"=>array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"where\"=>array(),\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t}\n\t\t\n\t\t/* removed used variables */\n\t\tunset($objForm);\n\t\t\n\t\t/* return configuration set */\n\t\treturn $strConfigArr;\n\t\t\n\t}", "function __construct($database = \"productdisplay\", $server = \"myDB\"){\r\n if (!$settings = parse_ini_file(CONFIGFILE, TRUE)) throw new exception('Unable to open ' . CONFIGFILE . '.');\r\n $dsn = $settings[$server][\"driver\"].':host='.$settings[$server][\"host\"].';dbname='.$database;\r\n parent::__construct($dsn,$settings[$server][\"user\"],$settings[$server][\"password\"]);\r\n }", "public function insert_config($data){\n $this->db->insert('configuration', $data);\n }", "public abstract function setConfig($key, $value);", "public function getConfigInstance($fid) {\n\t\t$sql = \"SELECT id, field_name, entity_type, bundle, data, deleted \n\t\t\t\tFROM field_config_instance \n\t\t\t\tWHERE field_id=$fid\";\n\t\t$records = $this->db->records($sql);\n\t\treturn $records;\n\t}", "private function runConfig()\n {\n $configs = [\n [\n 'name' => 'sub_title',\n 'alias_name' => 'SubTitle',\n 'value' => 'SubTitle',\n ],\n [\n 'name' => 'title',\n 'alias_name' => 'Title',\n 'value' => 'Title',\n ],\n ];\n\n foreach ($configs as $config) {\n factory(Config::class)->create($config);\n }\n }", "public function getConfiguration()\n {\n $configuration = parent::getConfiguration();\n $configuration['debug'] = isset($configuration['debug']) ? $configuration['debug'] : false;\n $configuration['fileUri'] = $this->container->getParameter(\"mapbender.uploads_dir\") . \"/data-store\";\n\n if (isset($configuration[\"schemes\"]) && is_array($configuration[\"schemes\"])) {\n foreach ($configuration[\"schemes\"] as $key => &$scheme) {\n if (is_string($scheme['dataStore'])) {\n $storeId = $scheme['dataStore'];\n $dataStore = $this->container->getParameter('dataStores');\n $scheme['dataStore'] = $dataStore[ $storeId ];\n $scheme['dataStore'][\"id\"] = $storeId;\n //$dataStore = new DataStore($this->container, $configuration['source']);\n }\n if (isset($scheme['formItems'])) {\n $scheme['formItems'] = $this->prepareItems($scheme['formItems']);\n }\n }\n }\n return $configuration;\n }", "function instance_allow_config()\r\n\t\t{\r\n\t\t\r\n\t\t}", "protected function setUpConfigurationData() {}", "public function set($id, $instance);", "public function __construct(){\r\n \r\n $this->db = parent::getInstance(); \r\n }", "public function loadDb()\n {\n if ( $this->_isLocalConfigLoaded ) {\n Varien_Profiler::start('config/load-db');\n /**\n * Load all data in core_config_data table into master xml node\n */\n $dbConf = $this->getResourceModel();\n $dbConf->loadToXml($this);\n Varien_Profiler::stop('config/load-db');\n }\n\n return $this;\n }", "public function getDatabaseConfig()\n {\n \n $jdbc_dir = 'C:\\xampp\\htdocs\\JasperReport\\vendor\\cossou\\jasperphp\\src\\JasperStarter\\jdbc';\n return [\n 'driver' => 'generic',\n 'host' => env('DB_HOST'),\n 'port' => env('DB_PORT'),\n 'username' => env('DB_USERNAME'),\n 'password' => env('DB_PASSWORD'),\n 'database' => env('DB_DATABASE'),\n 'jdbc_driver' => 'com.microsoft.sqlserver.jdbc.SQLServerDriver',\n 'jdbc_url' => 'jdbc:sqlserver://192.168.1.250:1433;databaseName='.env('DB_DATABASE').'',\n 'jdbc_dir' => $jdbc_dir\n ];\n }", "public function set_config_settings()\r\n\t{\t\r\n\t\t// Check the config table exists in the config file and is enabled.\r\n\t\tif ($this->get_enabled_status('config'))\r\n\t\t{\r\n\t\t\tif ($config_data = $this->get_database_config_data())\r\n\t\t\t{\r\n\t\t\t\t// Loop through all the returned defaults and convert the database column names to cart session names.\r\n\t\t\t\tforeach($this->flexi->cart_database['configuration']['columns'] as $column_name => $column_alias)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (isset($config_data[$column_alias]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$config_data[$column_name] = $config_data[$column_alias];\r\n\t\t\t\t\t\tunset($config_data[$column_alias]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Config file hard-coded settings.\r\n\t\t$config_defaults = $this->flexi->cart_defaults['configuration'];\r\n\r\n\t\t// Loop through the config hard-coded default settings and apply them to any config settings without a value from the database lookup.\r\n\t\tforeach($config_defaults as $setting_name => $setting_value)\r\n\t\t{\r\n\t\t\tif (! isset($config_data[$setting_name]))\r\n\t\t\t{\r\n\t\t\t\t$config_data[$setting_name] = $config_defaults[$setting_name];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Group non boolean config value types together.\r\n\t\t$non_boolean_columns = array('order_number_prefix', 'order_number_suffix', 'weight_type', 'minimum_order', 'reward_point_multiplier', 'reward_voucher_multiplier', \r\n\t\t\t'reward_point_to_voucher_ratio', 'reward_point_days_pending', 'reward_point_days_valid', 'reward_voucher_days_valid', 'quantity_decimals', 'weight_decimals');\r\n\t\t\r\n\t\t// Ensure the data is stored in the correct format type.\r\n\t\tforeach($config_data as $column => $value)\r\n\t\t{\r\n\t\t\t// Ensure non boolean values are stored as their entered value.\r\n\t\t\tif (in_array($column, $non_boolean_columns))\r\n\t\t\t{\r\n\t\t\t\t$config_data[$column] = (string)$config_data[$column];\r\n\t\t\t}\r\n\t\t\t// All others are saved as boolean.\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$config_data[$column] = (bool)$config_data[$column];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Set configuration data to cart session settings.\r\n\t\t$this->flexi->cart_contents['settings']['configuration'] = $config_data;\r\n\r\n\t\t// Set an empty cart id and order number placeholder.\r\n\t\t$this->flexi->cart_contents['settings']['configuration']['cart_data_id'] = FALSE;\r\n\t\t$this->flexi->cart_contents['settings']['configuration']['order_number'] = FALSE;\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}", "public function saveConfigs($conf)\n {\n foreach($conf as $key=>$value)\n {\n $q = mysql_safequery(\"insert into StormBilling_customconfig (config_name,config_value)\n \t\t\t\t\t\tvalues ('$key', '$value')\n\t\t\t\t\t\t\t\t\t\tON DUPLICATE KEY UPDATE config_value='$value'\");\n }\n $this->loadCustomConfig();\n return $this->configs;\n }", "private function build_resources($api_instance) {\n $resources_arr = [];\n $resources_name_map = [];\n if (is_array($api_instance->resources)) {\n foreach($api_instance->resources as $resource_index => $resource_map) {\n $resources_arr[] = $resource_map->resource;\n $resources_name_map[$resource_map->resource] = $resource_map->name;\n }\n }\n\n $resources = Resource::whereIn('id',$resources_arr)->get();\n foreach($resources as $resource) {\n if ($resource->resource_type == 'mysql') {\n $resource_config = $resource->config_with_secrets; $resource_config->name = $resource->name;\n MySQLDB::config_database($resources_name_map[$resource->id],$resource->config_with_secrets);\n config(['app.resources.'.$resources_name_map[$resource->id]=>$resource_config]);\n config(['database.connections.'.$resources_name_map[$resource->id] =>[\n 'driver' => 'mysql',\n 'port' => isset($resource->config->port)?$resource->config->port:3306,\n 'host' => isset($resource->config->server)?$resource->config->server:'',\n 'database' => isset($resource->config->name)?$resource->config->name:'',\n 'username' => isset($resource->config->user)?$resource->config->user:'',\n 'password' => isset($resource->config_with_secrets->pass)?$resource->config_with_secrets->pass:'',\n ]]);\n } else if ($resource->resource_type == 'oracle') {\n $resource_config = $resource->config_with_secrets; $resource_config->name = $resource->name;\n OracleDB::config_database($resources_name_map[$resource->id],$resource->config_with_secrets);\n config(['app.resources.'.$resources_name_map[$resource->id]=>$resource_config]);\n config(['database.connections.'.$resources_name_map[$resource->id] => [\n 'driver' => 'oracle',\n 'tns' => isset($resource->config->tns)?$resource->config->tns:'',\n 'port' => isset($resource->config->port)?$resource->config->port:1521,\n 'username' => isset($resource->config->user)?$resource->config->user:'',\n 'password' => isset($resource->config_with_secrets->pass)?$resource->config_with_secrets->pass:'',\n 'charset' => isset($resource->config->charset)?$resource->config->charset:'AL32UTF8',\n 'host' => isset($resource->config->server)?$resource->config->server:'',\n 'database' => isset($resource->config->name)?$resource->config->name:'',\n ]]);\n } else if ($resource->resource_type == 'sqlsrv') {\n $resource_config = $resource->config_with_secrets; $resource_config->name = $resource->name;\n config(['app.resources.'.$resources_name_map[$resource->id]=>$resource_config]);\n config(['database.connections.'.$resources_name_map[$resource->id] => [\n 'driver' => 'sqlsrv',\n 'host' => isset($resource->config->server)?$resource->config->server:'',\n 'database' => isset($resource->config->name)?$resource->config->name:'',\n 'username' => isset($resource->config->user)?$resource->config->user:'',\n 'password' => isset($resource->config_with_secrets->pass)?$resource->config_with_secrets->pass:'',\n 'port' => isset($resource->config->port)?$resource->config->port:1433,\n 'options' => [ PDO::ATTR_ERRMODE => PDO::ERRMODE_SILENT ],\n ]]);\n } else if ($resource->resource_type == 'secret' || $resource->resource_type == 'value') {\n config(['app.resources.'.$resources_name_map[$resource->id]=>$resource->config_with_secrets->value]);\n }\n }\n }", "private function __construct()\n \n {\n $config = Config::getConfig(); // set singleton config object\n $host = $this->host = Config::getKeys('host');\n $user = $this->username = Config::getKeys('username');\n $password = $this->password = Config::getKeys('password');\n $database = $this->db = Config::getKeys('db');\n $this->newConnection($host, $user, $password, $database);\n // return $dbid; //dbid to the registrey\n \n }", "private function saveType()\n\t{\n\t\t// Build config file\n\t\t$config = \"<?php \\n\\n\";\n\t\t$config.= \"// This config file is auto generated on boot.\\n\\n\";\n\t\t$config.= 'define(\"INSTANCE_TYPE\", \"'.$this->instanceType.'\");'.\"\\n\";\n\t\t$config.= 'define(\"INSTANCE_NAME\", \"'.$this->instanceName.'\");'.\"\\n\";\n\t\t$config.= 'define(\"BRANCH\", \"'.$this->branch.'\");'.\"\\n\";\n\n\t\t// If bootstrapping the development server\n\t\tif($this->instanceDev)\n\t\t{\n\t\t\t$config.= 'define(\"DEV\", TRUE);'.\"\\n\";\n\t\t}\t\n\n\t\t// Write config file to config folder\n\t\tfile_put_contents(\"config/instance.config.php\", $config);\n\t}", "public function __construct()\n {\n $this->db = \\Config\\Database::connect();\n }", "protected function addWPConfigs()\n {\n\n $this[\"databaseAdapter\"] = function () {\n return $GLOBALS['wpdb'];\n };\n\n $this[\"query\"] = $this->factory(\n function () {\n return new \\WP_Query();\n }\n );\n\n }", "public static function setDbConfig( $configs ) {\n\t\tself::$_host = isset( $configs['host'] ) ? $configs['host'] : NULL;\n\t\tself::$_port = isset( $configs['port'] ) ? $configs['port'] : NULL;\n\t\tself::$_user = isset( $configs['user'] ) ? $configs['user'] : NULL;\n\t\tself::$_pwd = isset( $configs['pwd'] ) ? $configs['pwd'] : '';\n\t\tself::$_dbName = isset( $configs['db'] ) ? $configs['db'] : NULL;\n\t\tself::$_encode = isset( $configs['encode'] ) ? $configs['encode'] : 'utf8';\n\t}", "private function refresh_db_config()\n {\n $this->systemConfiguration->where(true, true);\n foreach ($this->scheduleMapping as $scheduleType) {\n foreach ($scheduleType as $where) {\n $this->systemConfiguration->orWhere('type', $where);\n }\n }\n $this->config = $this->systemConfiguration->select('type', 'value')->get()->toArray();\n }", "protected function addDbOption($isChild = false) {\r\n\t\t$this->addOption('db', null, InputOption::VALUE_OPTIONAL, $isChild ? 'This option will be automatically set based on entity manager' : 'Key of a database in application config (Helpful if using multiple connections with \"dbs.options\")', DoctrineMigrationsServiceProvider::DEFAULT_CONNECTION_NAME);\r\n\t}", "public function set($config){\n\t\t$this->configValues = $config;\n\t}", "abstract public function configure();", "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}", "public function setDbConnection($value)\n {\n $this->_db = $value;\n }", "public function db()\n {\n return $this->databaseConfig;\n }", "public function __construct()\n {\n $this->option['dbname'] = 'live';\n\n parent::__construct();\n }", "function newConfigOptions() {\n $insert = $this->utility->db->execute(\"INSERT INTO \" . TABLE_PREFIX . \"config_options (name, module, type, value) VALUES \n ('last_frequently_activity', 'system', 'system', 'N;'),\n ('last_hourly_activity', 'system', 'system', 'N;'),\n ('last_daily_activity', 'system', 'system', 'N;')\n \");\n \t\n \t if(is_error($insert)) {\n \t return $insert->getMessage();\n \t } // if\n \t\n \treturn true;\n }", "public static function ini()\n {\n switch (Config::get('database.driver')) {\n case 'mysql':\n self::$driver = new Schema\\MysqlSchema();\n break;\n }\n }", "public function __construct()\n {\n // get global configuration\n $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['roadworks']);\n if (is_array($extConf) && count($extConf)) {\n // call setter method foreach configuration entry\n foreach($extConf as $key => $value) {\n $methodName = 'set' . ucfirst($key);\n if (method_exists($this, $methodName)) {\n $this->$methodName($value);\n }\n }\n }\n }", "static public function useConfig($environment, $config = NULL)\r\n\t{\r\n//\t\tif (isset(self::$instance) && $config == self::$config_name)\r\n//\t\t{\r\n//\t\t\tthrow new Exception(\"Config already set. Multiple calls to useConfig() are not currently allowed.\");\r\n//\t\t}\r\n\r\n\t\tif($config === NULL)\r\n\t\t{\r\n\t\t\tself::$instance = self::createInstance($environment, null);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$baseConfig = self::createInstance($config);\r\n\t\t\tself::$instance = self::createInstance($environment, $baseConfig);\r\n\t\t}\r\n\r\n\t\tself::$environment_name = $environment;\r\n\t\tself::$config_name = $config;\r\n\t\tself::initDB();\r\n\t}", "public function connect($db_properties);", "protected function dbConfig()\n {\n return $this->config('database.connections.mysql');\n }", "final public static function configure(array $configuration)\n {\n // override with default configuration if not present\n $configuration += static::$_defaultConfiguration;\n\n if($configuration['datasource'] === null || !$configuration['datasource'] instanceof \\PDO)\n throw new Exception(\"PDO Datasource is required!\");\n\n static::$_dataSource = $configuration['datasource'];\n Model::setDataSource(static::$_dataSource);\n\n static::$_configuration = $configuration;\n }", "private function init() {\r\r\n global $wpdb;\r\r\n\r\r\n // Reset both variables, so in case of deleting no remains are left\r\r\n $this->instances = array();\r\r\n $this->instancesNoData = array();\r\r\n\r\r\n if ( !wd_asp()->db->exists('main') )\r\r\n return;\r\r\n\r\r\n $instances = $wpdb->get_results(\"SELECT * FROM \". wd_asp()->db->table('main'), ARRAY_A);\r\r\n\r\r\n foreach ($instances as $k => $instance) {\r\r\n $this->instancesNoData[$instance['id']] = array(\r\r\n \"name\" => $instance['name'],\r\r\n \"id\" => $instance['id']\r\r\n );\r\r\n\r\r\n $this->instances[$instance['id']] = $instance;\r\r\n /**\r\r\n * Explanation:\r\r\n * 1. json_decode(..) -> converts the params from the database to PHP format\r\r\n * 2. $this->decode_params(..) -> decodes params that are stored in base64 and prefixed to be decoded\r\r\n *\r\r\n * This is not equivalent with wd_parse_params(..) as that runs before inserting to the DB as well,\r\r\n * and $this->decode_params(..) runs after getting the data from the database, so it stays redundant.\r\r\n *\r\r\n * NOTE:\r\r\n * raw_data is used in backwards compatibility checks, to see if a certain option exists before merging\r\r\n * with the defaults\r\r\n */\r\r\n $this->instances[$instance['id']]['raw_data'] = $this->decode_params(json_decode($instance['data'], true));\r\r\n $this->instances[$instance['id']]['data'] = array_merge(\r\r\n wd_asp()->options['asp_defaults'],\r\r\n $this->instances[$instance['id']]['raw_data']\r\r\n );\r\r\n\r\r\n $this->instances[$instance['id']]['data'] = apply_filters(\"asp_instance_options\", $this->instances[$instance['id']]['data'], $instance['id']);\r\r\n }\r\r\n }" ]
[ "0.6691665", "0.66329426", "0.6368667", "0.62437004", "0.60426134", "0.6029691", "0.59754705", "0.58853924", "0.5828924", "0.5816703", "0.57715243", "0.5739891", "0.56694907", "0.56220245", "0.5609314", "0.5591512", "0.55891085", "0.5584785", "0.55844855", "0.5558246", "0.5543368", "0.54927266", "0.5479636", "0.5464504", "0.5443701", "0.54403347", "0.5435159", "0.5408912", "0.5407169", "0.54015225", "0.5398101", "0.5393506", "0.539166", "0.5381025", "0.5377924", "0.5362687", "0.53513217", "0.5347144", "0.5346984", "0.533937", "0.5337595", "0.5336381", "0.5333021", "0.53314555", "0.53229225", "0.5319586", "0.53062963", "0.53002214", "0.5291096", "0.5276382", "0.52695906", "0.5267869", "0.5267286", "0.523986", "0.52377045", "0.5220266", "0.5216495", "0.5215378", "0.5203776", "0.52032614", "0.5200984", "0.5195538", "0.5194864", "0.5186223", "0.5175481", "0.5172819", "0.5170764", "0.51627016", "0.5150171", "0.51485354", "0.5145184", "0.513891", "0.51382387", "0.51280016", "0.5121628", "0.5111995", "0.51099074", "0.5109313", "0.51090574", "0.5097777", "0.50929284", "0.50899756", "0.50894403", "0.5087762", "0.5074004", "0.507299", "0.5071443", "0.5066565", "0.5053947", "0.50481004", "0.5038895", "0.5037045", "0.50322473", "0.503184", "0.5027207", "0.5023449", "0.5021786", "0.502167", "0.5016245", "0.50094104" ]
0.65304774
2
/ this is teh request handler it takes a Request instance and uses the Router to check for a matching controller if a mathing controller is found, the controller class is instantiated with the Request object and a new Response object The action method is called along with route parameters If no matching controller is found by the Router, a default 404 response is sent
protected function routeRequest(Request $request) { if ($routeAction = $this->router->getRouteAction($request)) { $controllerPath = Config::get('PUNYMVC_APPLICATION_CONTROLLER_DIR') . ltrim($routeAction->path, '/') . '.php'; if ($this->validController($controllerPath)) { require $controllerPath; if (class_exists($routeAction->class) && method_exists($routeAction->class, $routeAction->method)) { $controllerClass = $routeAction->class; $controllerInstance = new $controllerClass($request, new Response()); call_user_func_array(array($controllerInstance, $routeAction->method), $routeAction->params); return; } } } $response = new Response(); $response->setStatus(404); $response->setBody('Not Found'); $response->send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 route()\n\t{\n\t\t$this->request = $this->getRequest();\n\n\t\t$controller_name = 'app\\controllers\\Controller' . ucfirst($this->request->getController());\n\t\t$action_name = 'Action'.ucfirst($this->request->getAction());\n\n\t\tif(!class_exists($controller_name)){\n\t\t\tthrow new NotFoundException('Not found route: ' . $this->request->getPath());\n\t\t}\n\n\t\t$controller = new $controller_name;\n\n\t\tif(method_exists($controller, $action_name)){\n\t\t\t$response = $controller->$action_name();\n\t\t\treturn $response ? $response : static::app()->response;\n\t\t} else {\n\t\t\tthrow new NotFoundException('Not found route: ' . $this->request->getPath());\n\t\t}\n\t}", "public function run() {\n //Matcher holen und request matchen\n $matcher = $this->routerContainer->getMatcher();\n $this->route = $matcher->match($this->request);\n\n //404 handler\n if (!$this->route) {\n return ControllerFactory::get(\"notfound\", $this->request)->render();\n }\n\n try {\n //home route\n if ($this->route->name == \"home\") {\n return ControllerFactory::get(\"index\", $this->request)->render();\n }\n\n if (isset($this->route->attributes[\"controller\"])) {\n $controller = ControllerFactory::get($this->route->attributes[\"controller\"], $this->request);\n } else {\n $controller = ControllerFactory::get($this->getControllerName($this->route->name), $this->request);\n }\n\n $controller->setMap($this->map);\n $controller->setRouter($this->route);\n $controller->init();\n\n switch ($this->route->name) {\n case 'ajax_default':\n $controller->ajax($this->route->attributes[\"action\"]);\n break;\n case 'get_default':\n $controller->get($this->route->attributes[\"action\"]);\n break;\n case 'post_default':\n $controller->post($this->route->attributes[\"action\"]);\n break;\n case 'controller_default_route':\n break;\n default:\n $method = $this->routes[$this->route->name][\"method\"];\n if (isset($this->routes[$this->route->name][\"action_param\"])) {\n $action = $this->route->attributes[$this->routes[$this->route->name][\"action_param\"]];\n //dynamically call the matching method\n $controller->$method($action);\n }\n }\n\n return $controller->render();\n } catch (FatalException $e) {\n /** @var Fatal $fatal_error */\n $fatal_error = ControllerFactory::get(\"fatal\", $this->request);\n $fatal_error->setException($e);\n return $fatal_error->render();\n }\n }", "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 }", "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 map()\n {\n // If the url variable is passed we parse URL.\n // Otherwise default values are used.\n if (isset($_GET['url'])) {\n $this->extractRouteParams();\n }\n\n // Creates a new controller object based on the supplied parameters\n $controllerName = $this->_controller;\n $this->_controller .= 'Controller';\n\n // Verify that controller exist\n if (!class_exists($this->_controller)) {\n throw new Exception('The controller requested doesn&#39;t exist. Please check URL.');\n }\n\n $controller = new $this->_controller($controllerName, $this->_action);\n\n // Execute the init() method of the controller if exists\n if (method_exists($controller, 'init')) {\n $controller->init();\n }\n\n // If exists invoke the method defined in the URL\n if (method_exists($controller, $this->_action)) {\n $controller->{$this->_action}($this->_urlParams);\n } else {\n\t\t\t// As a fallback use index method as action instead\n\t\t\t// and action variable as method parameters.\n\t\t\t// That will cover URLs like: domain.com/news/name-of-the-news\n\t\t\t$controller = new $this->_controller($controllerName, 'index');\n\t\t\t$controller->{'index'}($this->_action);\n }\n }", "function callControllerAction() {\n $santitizedUrl = ''; \n if (!empty($_GET['route'])) {\n $santitizedUrl = trim($_GET['route']);\n }\n\n $route = $this->getMatchingRoute($santitizedUrl);\n if ($route != null) {\n $actionValues = explode('/', ltrim(str_replace($route->getUrl(), '', $santitizedUrl), '/'));\n $controllerName = $route->getControllerName();\n $controllerName = $controllerName . 'Controller'; \n $controller = new $controllerName;\n $action = $route->getActionName();\n $controller->$action($actionValues);\n } else {\n // If we've entered this else section, we've effectively been unable to match\n // the specified url to a registered route. Normally we would throw a 404\n // error and return a user friendly message stating so, however, I'm leaving\n // that as an exersize for the reader\n }\n \n }", "public function route() {\n\t\t$file = $this->app_directory . '/controllers/' . $this->controller . '.php';\n\t\tif(\\mfw\\helpers\\FileHelper::fileExists($file)) {\n\t\t\tinclude $this->app_directory . '/controllers/' . $this->controller . '.php';\n\t\t\t$controller = new $this->controller($this->controller, $this->app_directory);\n\t\t\tcall_user_func_array(array($controller, $this->method), $this->arguments);\n\t\t} else {\n\t\t\tif(defined('DOC_ROOT')) {\n\t\t\t\tinclude DOC_ROOT . '/404.php';\n\t\t\t} else {\n\t\t\t\tthrow new \\Exception(\"404 Page not found\");\n\t\t\t}\n\t\t}\n\t}", "public static function match(){\n list($controllerType, $controller, $action) = self::_getControllerVars();\n\n //Controller_className\n $className= self::CLASS_PREFIX . '_' . ucwords($controllerType) . '_' . ucwords($controller);\n\n //$viewName = self::VIEW_PREFIX . '_' . str_replace(' ', '_',ucwords(implode(' ', $uriExploded))) . '_' . ucfirst($action);\n //actionName_Action\n // echo '<p> viewName'.$viewName.'</p>';\n\n $action = $action . self::ACTION_SUFFIX;\n\n try{\n $classInstance = new $className();\n //$classInstance->view = new $viewName();\n $response = $classInstance->$action();\n\n return $response;\n\n } catch (Exception $e){\n echo $e->getMessage();\n }\n\t}", "public function dispatch($url){\n\n /*\n Before checking for a match we must get only the first GET Param,\n if others were added to the URL (?key=value), we must remove them\n */\n if($url != ''){\n $parts = explode('&', $url, 2);\n if( strpos($parts[0], '=') === false ){\n //if no '=' was not found, no extra GET params passed in, url is valid\n $url = $parts[0];\n }else {\n //only get vars were passed in, empty URL to send to Home Page\n $url = '';\n }\n }\n\n // Handle a match\n if( $this->match($url) ){\n // Filter Controller\n //route params are now inside object instance $this->params\n $controller = $this->params['controller'];\n //convert to StudlyCaps as this is how the actual Controller class should be defined\n $controller = $this->convertToStudlyCaps($controller);\n //Check if a namespace has been specified for the conroller in the route's params\n $controller = $this->getNamespace() . $controller;\n\n // Make sure that the controller class exists before we instantiate it\n if( !class_exists($controller) ){\n throw new \\Exception(\"Controller class: $controller not found\");\n }\n //class exists...create the object\n $controllerObj = new $controller($this->params);\n\n // Filter Action...default to index\n $action = (isset($this->params['action'])) ? $this->params['action'] : 'index';\n\n //convert action string to camelCase, as this is how the class method should be defined\n $action = $this->convertToCamelCase($action);\n //the actual method will have 'Action' appended to the end,\n //this is done to force execution of the __call function, this can be bypassed however,\n //if the user inputted URL has 'Action' explicitly appended to\n //...check that the action does not have action appeded to it\n if( preg_match( '/action$/i', $action) ){\n throw new \\Exception(\"Method $action in controller $controller cannot be called directly - remove the Action suffix to call this method\");\n }\n //Finally, call Action on controller\n //THE CONTROLLER METHOD WILL NOT EXIST, THIS WILL FORCE THE EXECUTION OF THE\n // __call METHOD THAT SHOULD BE DEFINED IN THE CONTAINING CLASS\n $controllerObj->$action();\n }else {\n //No route matched\n throw new \\Exception(\"No route matched for $url\", 404);\n }\n\n }", "public function route()\n {\n $request = '';\n if (isset($_GET['q']))\n {\n $request = $_GET['q'];\n }\n \n $this->request = $request;\n $this->rebuildGet();\n \n //get controller\n $found = false;\n \n if ($request == '')\n {\n $request = 'index';\n }\n \n $segments = explode('/', $request);\n $dir = APP_PATH.'controllers/';\n foreach ($segments as $index => $segment)\n {\n $segment = str_replace('-', '_', $segment);\n if (file_exists($dir.$segment.'.php'))\n {\n //load controller\n $found = true;\n $this->params = array_slice($segments, $index+1);\n require($dir.$segment.'.php');\n break;\n }\n else\n {\n $dir .= $segment.'/';\n }\n }\n \n if (!$found)\n {\n //try index controller\n if (file_exists($dir.'index.php'))\n {\n //load controller\n $found = true;\n $this->params = array();\n require($dir.'index.php');\n }\n }\n \n if (!$found)\n {\n $this->notFound();\n }\n \n $this->completeRequest();\n }", "public static function route(){\n\t\t$request=(isset($_GET['request']))?$_GET['request']:'/index';\n\t\t$route_found=false;\n\t\t\n\t\t$vanilla_route_found=self::check_route($request);\n\t\t\n\t\tif(!$vanilla_route_found){\n\t\t\t$xml_request=self::xml_route();\n\t\t\tif($xml_request!==$request){\n\t\t\t\t$route_found=true;\n\t\t\t\t$request=$xml_request;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$args=explode(\"/\",$request);\n\t\tarray_shift($args);\n\t\tif(count($args)>1){\n\t\t\t$controller=$args[0];\n\t\t\tarray_shift($args);\n\t\t\t$action=$args[0];\n\t\t\tarray_shift($args);\n\t\t}else{\n\t\t\t$controller=$args[0];\n\t\t\tarray_shift($args);\n\t\t\t$action=\"index\";\n\t\t}\n\t\t\n\t\t// Add post arguments to args array\n\t\tif($_SERVER['REQUEST_METHOD']!=\"GET\"){\n\t\t\t$args=array_merge($args,$_POST);\n\t\t}\n\t\tif(!empty($_FILES)){\n\t\t\t$args=array_merge($args,array(\"uploads\" => $_FILES));\n\t\t}\n\t\t\n\t\ttry{\n\t\t\trequire_once('controllers/error_controller.php');\n\t\t\tif(file_exists('controllers/'.$controller.'_controller.php')){\n\t\t\t\trequire_once('controllers/'.$controller.'_controller.php');\n\t\t\t\t$maj_controller=ucfirst($controller).'Controller';\n\t\t\t\tif(method_exists($maj_controller,$action)){\n\t\t\t\t\t//print \"Found\";\n\t\t\t\t\t$controller=ucfirst($controller).'Controller';\n\t\t\t\t\t$controller=new $controller();\n\t\t\t\t\t$controller->$action($args);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($route_found){\n\t\t\t\t//print \"Gone\";\n\t\t\t\t$controller=new ErrorController();\n\t\t\t\t$controller->gone();\n\t\t\t}else{\n\t\t\t\t//print \"Not Found\";\n\t\t\t\t$controller=new ErrorController();\n\t\t\t\t$controller->notfound();\n\t\t\t}\n\t\t}catch(Exception $e){\n\t\t\t//print \"Error\";\n\t\t\t$controller=new ErrorController();\n\t\t\t$controller->server();\n\t\t}\n\t}", "public function routeController()\n\t{\n\t\t$action = \"actionIndex\";\n\n\t\tif (isset($_GET[\"p\"]))\n\t\t{\n\t\t\t$params = array();\n\t\t\t$params = array_filter(explode(\"/\", $_GET[\"p\"]));\n\n\t\t\tif (count($params) != 1)\n\t\t\t{\n\t\t\t\t$action = \"action\";\n\n\t\t\t\tfor ($i = 1; $i < count($params); $i++)\n\t\t\t\t{\n\t\t\t\t\t$action .= ucwords($params[$i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$controller = \"Controller_\" . ucwords($params[0]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcall_user_func(array(new Controller_Index(), $action));\n\t\t\texit();\n\t\t}\n\n\t\tif (isset($controller) && class_exists($controller))\n\t\t{\n\t\t\tif (method_exists(new $controller(), $action))\n\t\t\t{\n\t\t\t\tcall_user_func(array(new $controller(), $action));\n\t\t\t\texit();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//call_user_func(array(new Controller_Error(), \"actionIndex\"));\n\t\t\t\tcall_user_func(array(new Controller_Index(), \"actionIndex\"));\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//call_user_func(array(new Controller_Error(), \"actionIndex\"));\n\t\t\tcall_user_func(array(new Controller_Index(), \"actionIndex\"));\n\t\t\texit();\n\t\t}\n\t}", "public function run()\n {\n if ($this->match()) {\n $path = 'AlDente\\controllers\\\\' . ucfirst($this->params['controller']) . 'Controller';\n if (class_exists($path)) {\n $action = $this->params['action'] . 'Action';\n if (method_exists($path, $action)) {\n $controller = new $path($this->params);\n $controller->$action();\n } else {\n View::errorCode(404);\n }\n } else {\n View::errorCode(404);\n }\n } else {\n View::errorCode(404);\n }\n }", "public final function dispatch() {\n\t\t$request = PhpBB::getInstance()->getRequest();\n\n\t\tif ($this->controller != NULL) {\n\t\t\treturn $this->handleResponse(\n\t\t\t\t$this->controller->executeAction(\n\t\t\t\t\tself::getAction($request),\n\t\t\t\t\tself::getParameters($request)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn $this->handleResponse(new Error404());\n\t}", "function route($request) {\n\t\t$controller = $request->uri(0);\n\t\t$action = $request->uri(1);\n\n\t\tif(!class_exists($controller) || !is_callable([$controller, $action])){\n\t\t\t$controller = 'BadRequest';\n\t\t\t$action = 'not_found';\n\t\t}\n\n\t\t$c = new $controller($request);\n\t\tcall_user_func_array([$c, $action], []);\n\t}", "function route(Request $request){\n //Separate path by / and remove ending /\n $paths = explode('/', rtrim($request->getUrl()->getPath(), '/')); \n //Determines the default\n $controllerFolder = $paths[0] ? $paths[0] : \"main\";\n //Non main folder uses FolderMain as the default controller\n if($controllerFolder === \"main\"){\n $controllerName = $paths[1] ? $paths[1] : \"main\"; \n }else{\n $controllerName = $paths[1] ? $paths[1] : $controllerFolder.\"main\";\n }\n $methodName = $paths[2] ? $paths[2] : \"main\";\n $args = array_slice($paths, 3);\n \n if(file_exists(FOLDER_CONTROLLERS.S.$controllerFolder.S.$controllerName.\".php\")){\n $controller = new $controllerName($request); \n if(method_exists($controller,$methodName)){\n $controller->{$methodName}($args);\n }else{\n header(\"location: \".REDIRECT_ERROR002);\n }\n }else{\n header(\"location: \".REDIRECT_ERROR001);\n }\n \n }", "public function dispatch() {\n if ($this->dispatching == null) {\n\n $this->dispatching = $this->router->getMatchedRoutes($this->request->getPath());\n }\n\n // Dispatch array is not empty\n while (!empty($this->dispatching)) {\n\n // Get the next available dispatch\n $dispatching = array_shift($this->dispatching);\n\n // Get the controller namespace\n $namespace = '\\modules\\\\' . $dispatching['module'] . '\\controllers\\\\' . $dispatching['controller'];\n\n // The controller does not exist\n if (class_exists($namespace) === false) {\n\n continue;\n }\n\n // Set the request vars\n $this->request->setVar(array_diff_key($dispatching, array_flip(['module', 'controller', 'action'])));\n // Set the dispatcher dispatched values\n $this->dispatched = array_intersect_key($dispatching, array_flip(['module', 'controller', 'action']));\n\n $controller = new $namespace($this->request, $this, $this->container);\n\n // We have a POST action defined\n if ($this->request->isPost() &&\n method_exists($controller, $this->getBaseActionName() . Router::ACTION_POST_SUFFIX)) {\n\n // Set the correct dispatching/dispatched action\n $dispatching['action'] = $this->dispatched['action'] = $this->getBaseActionName() . Router::ACTION_POST_SUFFIX;\n\n // A default controller action cannot be found\n } else if ($this->request->isGet() && method_exists($controller, $dispatching['action']) === false) {\n\n continue;\n }\n\n // Set the controller was forwarded to false\n $this->controllerWasForwarded = false;\n\n // The controller has a pre method defined\n if (method_exists($controller, 'pre')) {\n\n $controller->pre();\n }\n\n // The controller was forwarded\n if ($this->controllerWasForwarded === true) {\n\n continue;\n }\n\n $controller->{$dispatching['action']}();\n\n // The action was forwarded\n if ($this->controllerWasForwarded === true) {\n\n continue;\n }\n\n // The controller has a post method defined\n if (method_exists($controller, 'post')) {\n\n $controller->post();\n }\n\n // The action was forwarded\n if ($this->controllerWasForwarded === true) {\n\n continue;\n }\n\n // Render the view and set the response body\n $controller->getResponse()->setBody($controller->getView()->render());\n\n return;\n }\n\n // Empty the dispatched array so dispatcher not resolved event can switch to a different module if needed\n $this->dispatched = ['module' => '', 'controller' => '', 'action' => ''];\n\n $this->eventManager->emit($this->container->get('event', ['dispatcher:notResolved', $this]));\n $this->dispatch();\n }", "public function runController($controllerClass, $action, Request $request, Route $route=null);", "public static function dispatch(&$request) {\r\n // inizializziamo la sessione\r\n session_start();\r\n\r\n if (isset($request[\"page\"])) {\r\n switch ($request[\"page\"]) {\r\n case \"master\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"accesso\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"rimuovi\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"rimuovicode\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"rimuovicodeid\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"inserisci\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"inseriscicode\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"logincode\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"mappa\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"mappacode\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"totaleprodotti\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"totaleprodotticode\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"contatta\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"contattacode\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"contattaleggi\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"contattaleggiform\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"documentazione\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"logout\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n default:\r\n self::write404();\r\n break;\r\n }\r\n } else {\r\n $request[\"page\"] = \"master\";\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n echo '<script language=javascript>document.location.href=\"index.php?page=master\"</script>';\r\n }\r\n }", "public static function dispatch(Request $request) {\n\t\t\t$route = self::findRouteForRequest($request);\n\t\t\tif ($route) {\n\n\t\t\t\t$controllerName = $route->controller;\n\t\t\t\t$controller = new $controllerName($request);\n\n\t\t\t\tif ($route->hasUrlParams()) {\n\t\t\t\t\t$actionParams = self::getUrlParams($request, $route);\n\t\t\t\t\tcall_user_func_array(array($controller, $route->action), $actionParams);\n\t\t\t\t} else {\n\t\t\t\t\tcall_user_func(array($controller, $route->action));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Defer to the response class to send a 404 error.\n\t\t\t\tResponse::fourOhFour($request);\n\t\t\t}\n\n\t\t}", "public function dispatch ()\n {\n\n try\n {\n\n // initialize the controller\n $this->initialize();\n\n // get the application context\n $context = $this->getContext();\n\n // determine our module and action\n $moduleName = $context->getRequest()\n ->getParameter(MO_MODULE_ACCESSOR);\n\t\t\t\n\n $actionName = $context->getRequest()\n ->getParameter(MO_ACTION_ACCESSOR);\n\n if ($moduleName == null)\n {\n\n // no module has been specified\n $moduleName = MO_DEFAULT_MODULE;\n\n }\n\n if ($actionName == null)\n {\n\n // no action has been specified\n if ($this->actionExists($moduleName, 'Index'))\n {\n\n // an Index action exists\n $actionName = 'Index';\n\n } else\n {\n\n // use the default action\n $actionName = MO_DEFAULT_ACTION;\n\n }\n\n }\n\n // make the first request\n $this->forward($moduleName, $actionName);\n\n } catch (MojaviException $e)\n {\n\n $e->printStackTrace();\n\n } catch (Exception $e)\n {\n\n // most likely an exception from a third-party library\n $e = new MojaviException($e->getMessage());\n\n $e->printStackTrace();\n\n }\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 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 }", "public function FrontControllerRoute() {\n\t\t// Step 1\n\t\t// Take current url and divide it in controller, method and parameters\n\t\t$this->request = new CRequest($this->config['base_url']);\n\t\t$this->request->Init();\n\t\t$controller = $this->request->controller;\n\t\t$method = $this->request->method;\n\t\t$arguments = $this->request->arguments;\n\n\t\t$controllerExists = isset($this->config['controllers'][$controller]);\n\t\t$controllerEnabled = false;\n\t\t$className = false;\n\t\t$classExists = false;\n\n\t\tif($controllerExists){\n\t\t\t$controllerEnabled = ($this->config['controllers'][$controller]['enabled'] == true);\n\t\t\t$className = $this->config['controllers'][$controller]['class'];\n\t\t\t$classExists = class_exists($className);\n\t\t}\n\n\n\n\t\t// Step 2\n\t\t// Check if there is a callable method in the controller class, if then call it\n\n\t\tif($controllerExists && $controllerEnabled && $classExists){\n\t\t\t$rc = new ReflectionClass($className);\n\t\t\tif($rc->implementsInterface('IController')){\n\t\t\t\tif($rc->hasMethod($method)){\n\t\t\t\t\t$controllerObj = $rc->newInstance();\n\t\t\t\t\t$methodObj = $rc->getMethod($method);\n\t\t\t\t\t$methodObj->invokeArgs($controllerObj, $arguments);\n\t\t\t\t} else {\n\t\t\t\t\tdie(\"404. \" . get_class() . ' error: Controller does not contain method.');\n\t\t\t\t}\n\t } else {\n\t \tdie('404. ' . get_class() . ' error: Controller does not implement interface IController.');\n\t\t\t\t}\n\t\t} else { \n\t\t\tdie('404. Page is not found.');\n\t\t}\n\t\n\n\n\t\t$this->data['debug'] = \"REQUEST_URI - {$_SERVER['REQUEST_URI']}\\n\";\n\t\t$this->data['debug'] .= \"SCRIPT_NAME - {$_SERVER['SCRIPT_NAME']}\\n\";\n\t}", "public function route() {\n\t\t// Start the profiler\n\t\tProfiler::register('Core', 'Router');\n\n\t\t// First, let's look at the URL the user supplied\n\t\t$requestUrl = array_values(array_filter(explode('/', Request::getUrl())));\n\t\t$requestRoute = null;\n\n\t\t// Loop over each route and test to see if they are valid\n\t\tforeach (self::$_routes as $route) {\n\t\t\tif ($this->routeTest($requestUrl, $route)) {\n\t\t\t\t$requestRoute = $route;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// We have completed the route matching\n\t\t// Finish the setup of the request object\n\t\tProfiler::register('Core', 'Request');\n\t\tif ($requestRoute) {\n\t\t\t$_GET['controller'] = $route->endpoint['controller'];\n\t\t\t$_GET['action'] = $route->endpoint['action'];\n\t\t\tRequest::setUrlFragments(str_replace($this->_routePath, '', Request::getUrl()));\n\t\t} else {\n\t\t\tRequest::setUrlFragments(Request::getUrl(), true);\n\t\t}\n\t\tProfiler::deregister('Core', 'Request');\n\n\t\t// Inform the event listener a request has been initialised\n\t\tEvent::trigger(\n\t\t\t'initRequest',\n\t\t\tarray(\n\t\t\t\t'controller' => Request::get('controller'),\n\t\t\t\t'action' => Request::get('action')\n\t\t\t)\n\t\t);\n\n\t\t// And stop the profiler\n\t\tProfiler::deregister('Core', 'Router');\n\t\tProfiler::deregister('Core', 'Front');\n\n\t\t// And dispatch\n\t\tDispatcher::loadController(\n\t\t\tRequest::get('controller'),\n\t\t\tRequest::get('action')\n\t\t);\n\t}", "public function getControllerAction()\n {\n $router = $this->serviceManager->get('router');\n $request = $this->serviceManager->get('request');\n $routeMatch = $this->serviceManager->get('Application')->getMvcEvent()->getRouteMatch();\n $routeMatch = $router->match($request);\n if (!is_null($routeMatch)) {\n //echo $routeMatch->getMatchedRouteName();\n $controller = strtolower($routeMatch->getParam('controller'));\n $action = strtolower($routeMatch->getParam('action'));\n $this->controller_action = sprintf(\"%s_%s\", strtolower($controller), strtolower($action));\n } else {\n $this->controller_action = 'application_index';\n }\n }", "private function run()\n {\n $dispatcher = $this->getDispatcher(self::getConfigSection('routes'));\n\n $routeInfo = $dispatcher->dispatch(self::getRequest('method'), self::getRequest('path'));\n\n switch ($routeInfo[0]) {\n case \\FastRoute\\Dispatcher::NOT_FOUND:\n $this->errorNotFound();\n break;\n case \\FastRoute\\Dispatcher::METHOD_NOT_ALLOWED:\n $this->error405();\n break;\n case \\FastRoute\\Dispatcher::FOUND:\n $this->actionParams = $routeInfo[2];\n $handler = explode('.', $routeInfo[1]);\n $this->controllerName = 'app\\controllers\\\\' . ucfirst($handler[0]) . 'Controller';\n $controllerFile = ucfirst($handler[0]) . 'Controller.php';\n $this->actionName = 'action' . ucfirst($handler[1]);\n $this->actionSlug = $handler[0] . '.' . $handler[1];\n if (!file_exists(self::$request['root_path'] . '/app/controllers/' . $controllerFile) ||\n !method_exists($this->controllerName, $this->actionName)) {\n //there is not a controller file or action name == index\n if (App::getConfig('app.debug')) {\n echo 'There is not a controller file \"' . $controllerFile . '\" or action name == index';\n }\n $this->errorNotFound();\n }\n if (isset($handler[2])) {\n //part of hangler for checking permissions\n if ($handler[2] == 'auth') {\n //need login and not logged\n if (App::isGuest()) {\n $this->redirect(App::getConfig('app.login_url'));\n }\n } else {\n //check permission for $handler[2]\n $auth = self::getComponent('auth');\n $user = self::getUser();\n $checkUser = $user ? $auth->hasAccessTo($user->email, $handler[2]) : false;\n if (!$checkUser) {\n //user does not exists or user does not have a permission\n $this->error405();\n }\n }\n }\n break;\n }\n $this->startAction();\n }", "public function run()\n {\n $uri = $this->getURI();\n\n // Check the availability of this request in the array of routes (routesOld.php)\n foreach ($this->routes as $uriPattern => $path) {\n\n // Compare $uriPattern and $uri\n if (preg_match(\"~$uriPattern~\", $uri)) {\n\n $internalRoute = preg_replace(\"~$uriPattern~\", $path, $uri);\n\n\n $segments = explode('/', $internalRoute);\n\n $controllerName = array_shift($segments) . 'Controller';\n $controllerName = ucfirst($controllerName);\n\n $action = array_shift($segments);\n $actionName = 'action' . ucfirst($action);\n\n $parameters = $segments;\n\n $controllerName = $this->controlNameSpace . $controllerName;\n $controllerObject = new $controllerName;\n\n return ['ref' => $controllerObject,\n 'actionName' => $actionName,\n 'args' => $parameters];\n\n }\n }\n }", "public static function dispatch()\n {\n // Melde alle Fehler außer E_NOTICE\n //error_reporting(E_ALL & ~E_NOTICE);\n\n $controllerName = UriParser::getControllerName().'Controller';\n $className = 'App\\\\Controller\\\\'.$controllerName;\n $methodName = UriParser::getMethodName();\n\n // Eine neue Instanz des Controllers wird erstellt und die gewünschte\n // Methode darauf aufgerufen.\n $controller = new $className();\n $controller->$methodName();\n }", "public function frontControllerRoute()\n\t{\n\t\t#step 1\n\t\t#take current url and separate to controller, method and parameters\n\t\t$this->request = new CRequest($this->config['url_type']);\n\t\t$this->request->init($this->config['base_url'], $this->config['routing']);\n\t\t\n\t\t$controller \t= $this->request->controller;\n\t\t$method \t= $this->request->method;\n\t\t$args \t\t= $this->request->args;\n\t\n\t\t\n\t\t#step 2\n\t\t#Check if there is a method in the controller classs\n\t\t$controllerExists\t= isset($this->config['controllers'][$controller]);\n\t\t$controllerEnabled \t= false;\n\t\t$className \t= false;\n\t\t$classExists \t= false;\n\t\t\n\t\tif($controllerExists) {\n\t\t\t$controllerEnabled = ($this->config['controllers'][$controller]['enabled'] == true);\n\t\t\t$className = $this->config['controllers'][$controller]['class'];\n\t\t\t$classExists = class_exists($className);\n\t\t}\n\t\t\n\t\tif($controllerExists && $controllerEnabled && $classExists)\n\t\t{\n\t\t\t$rc = new ReflectionClass($className);\n\t\t\tif($rc->implementsInterface('IController')) \n\t\t\t{\n\t\t\t\t$formattedMethod = str_replace(array('_', '-'), '', $method);\n\t\t\t\tif($rc->hasMethod($formattedMethod)) \n\t\t\t\t{\n\t\t\t\t\t$controllerObj = $rc->newInstance();\n\t\t\t\t\t$methodObj = $rc->getMethod($formattedMethod);\n\t\t\t\t\tif($methodObj->isPublic()) \n\t\t\t\t\t{\n\t\t\t\t\t\t$methodObj->invokeArgs($controllerObj, $args);\n\t\t\t\t\t} \n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\tdie(\"404. \" . get_class() . ' error: Controller method not public.'); \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\tdie(\"404. \" . get_class() . ' error: Controller does not contain method.');\n\t\t\t\t}\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\tdie('404. ' . get_class() . ' error: Controller does not implement interface IController.');\n\t\t\t}\n\t\t} \n\t\telse \n\t\t{ \n\t\t\tdie('404. Page is not found.');\n\t\t}\n\t\t\t\n\t}", "private function resolveRequest(){\n\t\t$controllers_dir = puppy::getAppDir().'controllers';\n\t\t$path_segments = explode('/', $this->getPathInfo());\n\t\t\n\t\t$controller_location = null;\n\t\t$controller_name = null;\n\t\t$action_name = null;\n\t\t\n\t\t//build path to controller\n\t\t$build_path = $controllers_dir;\n\t\tforeach($path_segments as $k => $dir){\n\t\t\t$build_path = $build_path.'/'.$dir;\n\t\t\tif(file_exists($build_path.\"/\")){\n\t\t\t\tif(is_dir($build_path)){\n\t\t\t\t\t$controller_location = $build_path;\n\t\t\t\t\tif(is_file($build_path.'/'.$dir.'.php')){\n\t\t\t\t\t\t$controller_name = $dir;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$action_name = $dir;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//call action\n\t\tif(file_exists($controller_location.'/'.$controller_name.'.php')){\n\t\t\t//wrap require in try catch to state file has error\n\t\t\trequire_once($controller_location.'/'.$controller_name.'.php');\n\t\t\t$controller = new $controller_name();\n\t\t\tif($action_name !== null)\n\t\t\t\t$controller->$action_name();\n\t\t}\n\t}", "public static function dispatch($request) {\n\n if (isset($_SESSION)) {\n // $newRequest = new Request();\n $request->write('controller', 'user');\n }\n\n $controllerName = ucfirst($request->getControllerName()) . 'Controller';\n if (!class_exists($controllerName)) {\n throw new Exception(\"$controllerName does not exist\");\n }\n \n $controller = new $controllerName($request);\n\n return $controller;\n }", "public function run()\n {\n if (isset($_SERVER[\"PATH_INFO\"]))\n {\n $requestPath = $_SERVER[\"PATH_INFO\"];\n }\n else\n {\n $requestPath =\"/\";\n }\n\n $router = Router::getInstance();\n $requestRoute = $router->getRoute($requestPath);\n\n $controllerName=$requestRoute[\"controller\"].\"Controller\";\n $controller = new $controllerName();\n $methodName=$requestRoute[\"method\"].\"Action\";\n\n if (method_exists($controller, $methodName))\n {\n $this->viewData = array_merge($this->viewData, (array)$controller->$methodName());\n $this->renderResponse();\n }\n else\n {\n throw new ErrorException(\"methode \\\" $methodName\\\" inconnue dans \\\" $controllerName\\\"\") ;\n }\n\n\n }", "function executeController()\r\n{\r\n\t// Uri and figure out the path to the controller.\r\n\t$request = trim($_GET['request'], \"/ \");\r\n\t\r\n\tif ($request != '') {\r\n\t // Using the URL segments, construct the name of the class.\r\n\t // Note: The class name is mapped to the directory structure.\r\n\t $reqSegments = explode(\"/\", $request);\r\n\t}\r\n\t\r\n\t$controllerName = 'App_Pages_';\r\n\t$controllerName .= ($reqSegments[0])?$reqSegments[0]:'Index';\r\n\t$controllerName .= '_Controller';\r\n\t\r\n\t$actionName = ($reqSegments[1])?$reqSegments[1]:'index';\r\n\r\n\tif (class_exists($controllerName)) {\r\n\t\tif (method_exists($controllerName, $actionName)) {\r\n\t\t\t$controller = new $controllerName();\r\n\t\t\t$controller->$actionName();\r\n\t\t} else {\r\n\t\t\tdie('Page not found');\r\n\t\t}\r\n\t} else {\r\n\t\tdie('Page not found');\r\n\t}\r\n}", "private function route() {\n if (class_exists($this->controllerName . $this->postfix)) {\n $fullName = $this->controllerName . $this->postfix;\n $this->controllerClass = new $fullName;\n $this->controllerClass->setUp();\n if (count($this->args > 1)) { // Pass args that are not controller class\n $this->controllerClass->setArgs($this->args);\n }\n\n // Second arg in url is our \"action\", try that as a method-call\n $method = strtolower($this->args[0]); // method names are case-insensitive. Might as well take advantage of it.\n if (isset($method) && method_exists($this->controllerClass, $method)) {\n $this->controllerClass->{$this->args[0]}();\n }\n \n } else { // No such class. Use our default\n $this->defaultRoute();\n }\n }", "protected static function runController()\n {\n $msg = new MoovicoRequestMessage(self::$route);\n self::$response = self::doRunController($msg);\n }", "public function dispatch()\n {\n $this->parseRoute();\n\n $controller = new BaseController();\n\n $controllerName = '\\\\Shopreview\\\\Mvc\\\\Controller\\\\' . $this->controller . self::CONTROLLER_POSTFIX;\n\n // controller test, if not found redirect to the homepage\n if (class_exists($controllerName)) {\n $controller = new $controllerName();\n } elseif(!empty($this->controller)) {\n header('Location: /');\n exit();\n }\n\n // finalizing method name\n $methodName = $this->action . self::ACTION_POSTFIX;\n if (!$this->action || !method_exists($controller, $methodName)) {\n $methodName = self::DEFAULT_ACTION . self::ACTION_POSTFIX;\n }\n\n // calling the proper class and method\n call_user_func_array(array($controller, $methodName), array());\n }", "public function run()\n {\n $routeInfo = $this->foundRoute();\n\n if (isset($routeInfo['middleware'])) {\n $middleware = $this->gatherMiddlewareClassNames($routeInfo['middleware']);\n $this->runMiddleware($middleware);\n }\n $response = $this->callControllerAction($routeInfo);\n\n $this->sendRequest($this->response ?: $response);\n\n }", "public function execute() {\n\t\t\t$response = Response::factory($this);\n\t\t\t\n\t\t\t$controller = $this->route->controller();\n\t\t\tif($controller !== null) {\n\t\t\t\t$this->controller = Controller::factory($controller, $response);\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t$response->data($this->controller->execute());\n\t\t\t\t} catch(\\Exception $e) {\n\t\t\t\t\t$response->data('<div class=\"Frawst-Debug\">'.\n\t\t\t\t\t\t'<h1>A Controller Problem Occurred!</h1>'.\n\t\t\t\t\t\t'<pre>'.$e.'</pre></div>');\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$this->controller = null;\n\t\t\t} else {\n\t\t\t\tif($this->route->template() === null) {\n\t\t\t\t\t$response->notFound();\n\t\t\t\t}\n\t\t\t\t$response->data(null);\n\t\t\t}\n\t\t\t\n\t\t\treturn $response;\n\t\t}", "public function run()\n {\n $requested_url = explode('/', $this->requestUrl);\n\n if (!empty($this->definedRoutes[$this->requestMethod])) {\n foreach ($this->definedRoutes[$this->requestMethod] as $route => $action) {\n $route = explode('/', $route);\n $route_depth = count($route);\n\n // Check for defined route parameters\n for( $i = 0; $i < $route_depth; $i++) {\n if (preg_match('/\\{([\\w?]+?)\\}/',$route[$i])) {\n if (isset($requested_url[$i])) {\n array_push($this->requestParameters, $requested_url[$i]);\n // replace defined route parameters with peer request url parameter for final comparison\n $route[$i] = $requested_url[$i];\n }\n }\n }\n\n // Check for unreplaced route parameters and delete them if are optional parameters (for final comparison)\n for ($j = 0; $j < $route_depth; $j++) {\n if (preg_match('/\\{([\\w]+?)\\?}/', $route[$j])) {\n unset($route[$j]);\n }\n }\n\n $route = implode('/', $route);\n\n // Final comparision. Check requested url is equal to current checking route\n if ($route == $this->requestUrl) {\n $this->matched = true;\n\n if ($action instanceof Closure) {\n return call_user_func_array($action, $this->requestParameters);\n } else if($this->isController($action)) {\n return $this->loadController($action);\n } else {\n throw new Exception('Invalid action for route');\n }\n break; // Route found, stop the operations\n } else {\n $this->reset();\n }\n }\n }\n\n if ($this->matched === false) {\n return $this->exception->notFound();\n }\n }", "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 static function performRouting(){\n // When patterns are defined, try to parse friendly URLs at first\n if(is_array(self::$urlPatterns)){\n if(self::performFriendlyRouting()){\n return;\n }\n }\n\n // Use standard routing method\n if(self::performStandardRouting()){\n return;\n }\n\n // Execute controller set as a fallback\n if(!self::executeController(self::$notFoundFallbackController)){\n die(\"Dispatcher: Failed to execute fallback controller\");\n }\n }", "public function execute()\n\t{\n\t\t// Create the class prefix\n\t\t$prefix = 'controller_';\n\n\t\tif ( ! empty($this->directory))\n\t\t{\n\t\t\t// Add the directory name to the class prefix\n\t\t\t$prefix .= str_replace(array('\\\\', '/'), '_', trim($this->directory, '/')).'_';\n\t\t}\n\n\t\tif (Kohana::$profiling === TRUE)\n\t\t{\n\t\t\t// Start benchmarking\n\t\t\t$benchmark = Profiler::start('Requests', $this->uri);\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t// Load the controller using reflection\n\t\t\t$class = new ReflectionClass($prefix.$this->controller);\n\n\t\t\tif ($class->isAbstract())\n\t\t\t{\n\t\t\t\tthrow new Kohana_Exception('Cannot create instances of abstract :controller',\n\t\t\t\t\tarray(':controller' => $prefix.$this->controller));\n\t\t\t}\n\n\t\t\t// Create a new instance of the controller\n\t\t\t$controller = $class->newInstance($this);\n\n\t\t\t// Execute the \"before action\" method\n\t\t\t$class->getMethod('before')->invoke($controller);\n\n\t\t\t// Determine the action to use\n\t\t\t$action = empty($this->action) ? Route::$default_action : $this->action;\n\t\t\t\n\t\t\t// Ensure the action exists, and use __call() if it doesn't\n\t\t\tif ($class->hasMethod('action_'.$action))\n\t\t\t{\n\t\t\t\t// Execute the main action with the parameters\n\t\t\t\t$class->getMethod('action_'.$action)->invokeArgs($controller, $this->_params);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$class->getMethod('__call')->invokeArgs($controller,array($action,$this->_params));\n\t\t\t}\n\n\t\t\t// Execute the \"after action\" method\n\t\t\t$class->getMethod('after')->invoke($controller);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tif (isset($benchmark))\n\t\t\t{\n\t\t\t\t// Delete the benchmark, it is invalid\n\t\t\t\tProfiler::delete($benchmark);\n\t\t\t}\n\n\t\t\tif ($e instanceof ReflectionException)\n\t\t\t{\n\t\t\t\t// Reflection will throw exceptions for missing classes or actions\n\t\t\t\t$this->status = 404;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// All other exceptions are PHP/server errors\n\t\t\t\t$this->status = 500;\n\t\t\t}\n\n\t\t\t// Re-throw the exception\n\t\t\tthrow $e;\n\t\t}\n\n\t\tif (isset($benchmark))\n\t\t{\n\t\t\t// Stop the benchmark\n\t\t\tProfiler::stop($benchmark);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function dispatch()\n\t{\n\t\t$this->segs = explode('/',$this->c->Router->route);\n\n\t\t/* classname seg1 (Controller) */\n\t\t$this->className = str_replace('-','_',array_shift($this->segs));\n\n\t\t/* method seg2 */\n\t\t$this->methodName = str_replace('-','_',array_shift($this->segs));\n\n\t\t/* call event */\n\t\t$this->c->Event->preController();\n\n\t\t/* This throws a error and 4004 - handle it in your error handler */\n\t\tif (!class_exists($this->className)) {\n\t\t\tthrow new \\Exception($this->className.' not found',4004);\n\t\t}\n\n\t\t/* create new controller inject the container */\n\t\t$controller = new $this->className($this->c);\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->preMethod();\n\n\t\t/* This throws a error and 4005 - handle it in your error handler */\n\t\tif (!is_callable(array($controller,$this->methodName))) {\n\t\t\tthrow new \\Exception($this->className.' method '.$this->methodName.' not found',4005);\n\t\t}\n\n\t\t/* let's call our method and capture the output */\n\t\t$this->c->Response->body .= call_user_func_array(array($controller,$this->methodName),$this->segs);\n\t}", "private function resolve_controller() {\n $match = false;\n foreach ($this->controller_patterns as $controller=>$patterns) {\n if ($match) break;\n foreach ($patterns as $pattern) {\n if ($match) break;\n $pattern_string = '';\n \n foreach ($pattern as $pattern_key=>$pattern_value) {\n \n $pattern_needle = '~'.$pattern_value;\n if (strpos($pattern_needle, '{') && strpos($pattern_needle, '}')) {\n \n $stripped_pattern = str_replace(array('{', '}'), '', $pattern_value);\n $param_options = explode('||', $stripped_pattern);\n $param_match = false;\n \n if (isset($this->url_parts[$pattern_key])) {\n foreach ($param_options as $param_option) {\n $data = explode(':', $param_option);\n if ($data[0]($this->url_parts[$pattern_key])) { \n $this->url_params[$data[1]] = $this->url_parts[$pattern_key];\n $param_match = true;\n break;\n }\n }\n }\n if ($param_match) $pattern_string .= $this->url_parts[$pattern_key];\n } else {\n $pattern_string .= $pattern_value;\n }\n if ($pattern_key != (sizeof($pattern)-1)) $pattern_string .= '/';\n }\n \n // if url pattern matches controller pattern, set match=true & the controller to be rendered\n if ($pattern_string == $this->url_parts_string) { \n $match = true;\n $this->controller = new $controller($this->url_parts, $this->url_params, $this->payload);\n break;\n \n // else set url_params to null and let the default controller be returned\n } else { \n $this->url_params = null;\n }\n }\n }\n \n // if not controller resolved handle result\n if (empty($this->controller)) {\n // if url is a subset of /api return API 404 controller\n if ($this->url_parts[0] == 'api') {\n $this->controller = new API_404_Controller($this->url_parts, $this->url_params, $this->payload);\n // else redirect the user to the front page\n } else {\n redirect('/'); \n }\n }\n \n return true;\n }", "static public function dispatch()\n {\n $request = Url::getURI();\n $method = Request::getMethod();\n foreach (self::$routes[$method] as $route)\n {\n preg_match($route['pattern'], $request, $params);\n if (isset($params[0]))\n {\n unset($params[0]);\n $controller = $route['controller'];\n $action = $route['action'];\n $class = new $controller();\n call_user_func_array([$class, $action], $params);\n return;\n }\n }\n }", "public function dispatch($source)\n {\n $this->_normalize($source);\n $this->_prepare();\n \n $route = $this->_findRoute();\n \n $response = Konekt::app()->getResponse();\n \n if (false === $route) {\n return $response->err404();\n }\n \n $controller = $this->_getController($route['controller']);\n\n if (!$controller) {\n return $response->err404();\n } elseif ($response->getStatusCode() == Konekt_Framework_Core_Model_Response::HTTP_FOUND) {\n //In case the controller constructor sets a redirect, then we return early, gracefully\n return $response;\n }\n \n $action = $this->_getAction($route['controller']);\n \n if (!$action) {\n return $response->err404();\n }\n \n $controller->$action($route['params']);\n \n return $response;\n }", "public function execute()\n {\n $controllerClassName = $this->requestUrl->getControllerClassName();\n $controllerFileName = $this->requestUrl->getControllerFileName();\n $actionMethodName = $this->requestUrl->getActionMethodName();\n $params = $this->requestUrl->getParams();\n \n if ( ! file_exists($controllerFileName))\n {\n exit('controlador no existe');\n }\n\n require $controllerFileName;\n\n $controller = new $controllerClassName();\n\n $response = call_user_func_array([$controller, $actionMethodName], $params);\n \n $this->executeResponse($response);\n }", "public function run()\n {\n $route = $this->route->mapRoute();\n\n $className = $this->controllerNamespace.$route[0];\n\n $action = $route[1];\n\n $controller = call_user_func([$className, 'getInstance']);\n\n $controller->$action();\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 }", "public function handleAction($request) {\n\t\t$action = str_replace(\"-\",\"_\",$request->param('Action'));\n\t\tif(!$this->action) $this->action = 'index';\n\t\t\n\t\tif($this->checkAccessAction($action)) {\n\t\t\tif($this->hasMethod($action)) {\n\t\t\t\t$result = $this->$action($request);\n\t\t\t\n\t\t\t\t// Method returns an array, that is used to customise the object before rendering with a template\n\t\t\t\tif(is_array($result)) {\n\t\t\t\t\treturn $this->getViewer($action)->process($this->customise($result));\n\t\t\t\t\n\t\t\t\t// Method returns a string / object, in which case we just return that\n\t\t\t\t} else {\n\t\t\t\t\treturn $result;\n\t\t\t\t}\n\t\t\t\n\t\t\t// There is no method, in which case we just render this object using a (possibly alternate) template\n\t\t\t} else {\n\t\t\t\treturn $this->getViewer($action)->process($this);\n\t\t\t}\n\t\t} else {\n\t\t\treturn $this->httpError(403, \"Action '$action' isn't allowed on class $this->class\");\n\t\t}\t\t\n\t}", "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 function dispatch()\n {\n $data = $this->router->getData();;\n $c = $data->controller;\n $ref = new $c($data->params);\n $a = $data->action;\n if (!is_null($a) && !empty($a)) call_user_func(array($ref, $a));\n return;\n }", "public function run($request=null) {\n if (is_null($request)) {\n $request = $_SERVER['REQUEST_URI'];\n }\n\n if (!is_array($request)) {\n $regex = '/\\//';\n $request = preg_split($regex, $request, -1, PREG_SPLIT_NO_EMPTY);\n }\n\n $controller_name = array_shift($request);\n if (is_null($controller_name)) {\n $controller_name = $this->default_controller;\n }\n\n $view_name = array_shift($request);\n if (is_null($view_name)) {\n $view_name = $this->default_view;\n }\n\n $controller_name = ucfirst(strtolower($controller_name)) .'Controller';\n if (!class_exists($controller_name)) {\n // no such controller\n self::handleError(404);\n exit;\n }\n\n $view_name = strtolower($view_name) .'View';\n try {\n $controller = new $controller_name($request);\n $controller->$view_name($request);\n } catch (\\Exception $err) {\n // an exception inside a controller occurred\n self::handleException($err);\n exit;\n }\n }", "public function dispatch($path, $controller=null)\n {\n try {\n\n $db = DB::instance($this->config('application.db'));\n $cache = Cache::instance($this->config('application.cache'));\n\n if( $controller === null ) {\n $controller = new RequestController($this, $db, $cache);\n } else {\n $controller->setDatabase($db);\n $controller->setCache($cache);\n }\n\n // override output content-type in runtime using file extension\n if( $this->config('application.allow_output_extensions') !== false ) {\n $path_last_index = count($path)-1;\n if( $ext = pathinfo($path[$path_last_index], PATHINFO_EXTENSION) ) {\n $this->config('application.output', $ext);\n $path[$path_last_index] = pathinfo($path[$path_last_index], PATHINFO_FILENAME);\n }\n }\n\n $controller->handle($path);\n\n }\n catch(DuplicationException $e) {\n\n $response = new OperationResponse(409, array('error'=>'An action causing data duplication was found: '.$e->getMessage()));\n $controller = new RequestController($this, null, null);\n $controller->handleResponse( $response );\n\n } catch(\\InvalidArgumentException $e) {\n\n $response = new OperationResponse(400, array('error'=>$e->getMessage()));\n $controller = new RequestController($this, null, null);\n $controller->handleResponse( $response );\n\n } catch(\\Exception $e) {\n\n ErrorHandler::log($e);\n\n $mess = array('message'=>$e->getMessage());\n if( $this->config('mode') == 'development' ) {\n $mess['trace'] = $e->getTraceAsString();\n }\n $response = new OperationResponse(500, $mess);\n $controller = new RequestController($this, null, null);\n $controller->handleResponse( $response );\n }\n }", "static function invoke_controller()\n\t{\n\t\t// Try to fetch requested controller\n\t\t$controller_path = APPPATH.'controllers/'.self::$directory.self::$controller_name.'.php';\n\t\tif (is_readable($controller_path))\n\t\t{\n\t\t\trequire($controller_path);\n\n\t\t\t// Check if the controller class is defined\n\t\t\tif (!class_exists(self::$controller_name))\n\t\t\t\tSystem::error('controller <code>'.self::$controller_name.'</code> is not defined');\n\n\t\t\t// Check if the method exists in the controller\n\t\t\tif (!method_exists(self::$controller_name, self::$method_name))\n\t\t\t\tSystem::error('controller <code>'.self::$controller_name.'</code> has no method named <code>'.self::$method_name.'</code>');\n\n\t\t\t// Create controller instance and call the method\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$reflection_method = new ReflectionMethod(self::$controller_name, self::$method_name);\n\n\t\t\t\t$argc = count(self::$segments);\n\t\t\t\tif ($reflection_method->getNumberOfRequiredParameters() > $argc)\n\t\t\t\t\tSystem::error('Not enough parameters for calling <code>'.self::$controller_name.'::'.self::$method_name.'()</code>,\n\t\t\t\t\t'.$argc.' provided, expected at least '.$reflection_method->getNumberOfRequiredParameters());\n\n\t\t\t\tif ($reflection_method->getNumberOfParameters() < $argc)\n\t\t\t\t\tSystem::error('Too many parameters for calling <code>'.self::$controller_name.'::'.self::$method_name.'()</code>,\n\t\t\t\t\t'.$argc.' provided, expected '.$reflection_method->getNumberOfParameters());\n\n\t\t\t\t$reflection_method->invokeArgs(new self::$controller_name, self::$segments);\n\t\t\t}\n\t\t\tcatch (ReflectionException $e)\n\t\t\t{\n\t\t\t\tSystem::error($e->getMessage());\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function run()\n {\n $this->get('/', array($this, 'dispatchController'));\n $this->map('(/:module(/:controller(/:action(/:params+))))', array($this, 'dispatchController'))\n ->via('GET', 'POST')\n ->name('default');\n parent::run();\n }", "public function Route() {\n\t\tif(isset($_GET['m']))\n\t\t\tif($_GET['m'] == 'ajax')\n\t\t\t\tinclude __SITE_PATH . '/controller/ajax_controller.class.php';\n\t\t// Load controller\n\t\t$controller_name = $this->getController();\n\t\t$this->loadController($controller_name);\n\t\t// Instantiate controller\n\t\t$class_name = $this->getControllerClassName($controller_name);\n\t\t$controller = new $class_name();\n\t\t// Is controller access restricted?\n\t\tif($controller->authNeeded() && !Session::isAuthenticated()) {\n\t\t\t// Route to login screen if there is no authed session\n\t\t\t$this->loadController(\"login\");\n\t\t\t$controller = new LoginController();\n\t\t}\n\t\t// Execute controller action\n\t\t$action = $this->getAction();\n\t\t$this->executeAction($controller, $action);\n\t}", "public function index() {\r\n\t\t\t\r\n\t\t\t$url = substr( $_SERVER['REQUEST_URI'], 1 );\r\n\t\t\t$requestParams = explode( '/', $url );\r\n\t\t\t$controller = $requestParams[0];\r\n\r\n\t\t\t// If the URL has a bad controller and more than 2 params redirect to 404 page;\r\n\t\t\tif(empty($controller) && count($requestParams) > 1){\r\n\t\t\t\trequire_once( './app/Views/RouteNotFound.php' );\r\n\t\t\t\tdie();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/* If no controller is passed in the url, load home page */\r\n\t\t\tif ( empty( $controller ) ) {\r\n\t\t\t\t$homepage = new HomeController();\r\n\t\t\t\t$homepage->homepage();\r\n\t\t\t\tdie();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/* If a controller is passed in the url, but no method is given, load view*/\r\n\t\t\tif ( count( $requestParams ) == 1 ) {\r\n\t\t\t\t$view = ucfirst( $requestParams[0] );\r\n\t\t\t\trequire_once( './app/Views/' . $view . '.php' );\r\n\t\t\t\tdie();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/* If the url doesn't respect domain/controller/method?params logic, load 404 view*/\r\n\t\t\tif ( count( $requestParams ) > 2 ) {\r\n\t\t\t\trequire_once( './app/Views/RouteNotFound.php' );\r\n\t\t\t\tdie();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/* Get the method passed in the url */\r\n\t\t\t$requestAux = explode( '?', $requestParams[1] );\r\n\t\t\t$method = $requestAux[0];\r\n\t\t\t\r\n\t\t\t/* Check if params are passed through url */\r\n\t\t\tif ( isset( $requestAux[1] ) ) {\r\n\t\t\t\t$params = $requestAux[1];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/* Create new instance of the controller given through url */\r\n\t\t\t$auxController = ucfirst( $controller ) . 'Controller';\r\n\t\t\t$appController = new $auxController();\r\n\t\t\t\r\n\t\t\t/*\r\n\t\t\t *\r\n\t\t\t * If method isset and exists in the controller\r\n\t\t\t * call the method ( with params optionally),\r\n\t\t\t * else render the view\r\n\t\t\t *\r\n\t\t\t * */\r\n\t\t\tif ( isset( $method ) && ! empty( $method ) && method_exists( $appController, $method ) ) {\r\n\t\t\t\tif ( isset( $params ) && ! empty( $params ) ) {\r\n\t\t\t\t\t$appController->$method( $params );\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$appController->$method();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t$appController->createView( $controller );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "public function execute()\n\t{\n\t\t// Create the class prefix\n\t\t$prefix = 'controller_';\n\n\t\tif ($this->directory)\n\t\t{\n\t\t\t// Add the directory name to the class prefix\n\t\t\t$prefix .= str_replace(array('\\\\', '/'), '_', trim($this->directory, '/')).'_';\n\t\t}\n\n\t\tif (Kohana::$profiling)\n\t\t{\n\t\t\t// Set the benchmark name\n\t\t\t$benchmark = '\"'.$this->uri.'\"';\n\n\t\t\tif ($this !== Request::$instance AND Request::$current)\n\t\t\t{\n\t\t\t\t// Add the parent request uri\n\t\t\t\t$benchmark .= ' « \"'.Request::$current->uri.'\"';\n\t\t\t}\n\n\t\t\t// Start benchmarking\n\t\t\t$benchmark = Profiler::start('Requests', $benchmark);\n\t\t}\n\n\t\t// Store the currently active request\n\t\t$previous = Request::$current;\n\n\t\t// Change the current request to this request\n\t\tRequest::$current = $this;\n\n\t\ttry\n\t\t{\n\t\t\t// Load the controller using reflection\n\t\t\t$class = new ReflectionClass($prefix.$this->controller);\n\n\t\t\tif ($class->isAbstract())\n\t\t\t{\n\t\t\t\tthrow new Kohana_Exception('Cannot create instances of abstract :controller',\n\t\t\t\t\tarray(':controller' => $prefix.$this->controller));\n\t\t\t}\n\n\t\t\t// Create a new instance of the controller\n\t\t\t$controller = $class->newInstance($this);\n\n\t\t\t// Execute the \"before action\" method\n\t\t\t$class->getMethod('before')->invoke($controller);\n\n\t\t\t// Determine the action to use\n\t\t\t$action = empty($this->action) ? Route::$default_action : $this->action;\n\n\t\t\t// Execute the main action with the parameters\n\t\t\t$class->getMethod('action_'.$action)->invokeArgs($controller, $this->_params);\n\n\t\t\t// Execute the \"after action\" method\n\t\t\t$class->getMethod('after')->invoke($controller);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t// Restore the previous request\n\t\t\tRequest::$current = $previous;\n\n\t\t\tif (isset($benchmark))\n\t\t\t{\n\t\t\t\t// Delete the benchmark, it is invalid\n\t\t\t\tProfiler::delete($benchmark);\n\t\t\t}\n\n\t\t\tif ($e instanceof ReflectionException)\n\t\t\t{\n\t\t\t\t// Reflection will throw exceptions for missing classes or actions\n\t\t\t\t$this->status = 404;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// All other exceptions are PHP/server errors\n\t\t\t\t$this->status = 500;\n\t\t\t}\n\n\t\t\t// Re-throw the exception\n\t\t\tthrow $e;\n\t\t}\n\n\t\t// Restore the previous request\n\t\tRequest::$current = $previous;\n\n\t\tif (isset($benchmark))\n\t\t{\n\t\t\t// Stop the benchmark\n\t\t\tProfiler::stop($benchmark);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function run() {\n\n if(method_exists($this, $this->action)) {\n $output = call_user_func_array(array($this, $this->action), (array)$this->arguments);\n } else {\n raise('invalid controller action: ' . $this->action);\n }\n\n // if the controller has a valid layout\n // render that instead of the output generated by the action\n if(!$output and $layout = $this->layout) {\n $output = $layout->render($this->format); \n } \n\n if(is_a($output, 'Kirby\\\\Toolkit\\\\Response')) {\n return $output;\n } else {\n return new Response($output, $this->format);\n }\n\n }", "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 }", "function dispatch_route($controller, $action, array $parameters){\r\n\t\t$this->current_controller = $controller;\r\n\t\t$this->current_action = $action;\r\n\t\t\r\n\t\t$result = $this->call_action($controller, $action, $parameters);\r\n\t\t\r\n\t\t$response = $this->handle_result($result);\r\n\t\t\r\n\t\treturn $response;\r\n\t}", "public function __invoke($request, $response, $args)\n {\n // We would get first argument as action, if it does not existed, set it as index\n // else we should get the action from router and remove it from arguments.\n $action = count($args) < 1 ? 'Index' : ucfirst(array_shift($args));\n $action = strtolower($request->getMethod()) . $action;\n // Then if the method is existed, we can call it;\n // Or we should throw \\Slim\\Exception\\NotFoundException.\n if (method_exists($instance = new static, $action)) {\n // Set application and container from global variables.\n $instance->setApplication($GLOBALS['app']);\n $instance->setContainer($GLOBALS['container']);\n // Get response body and write it to response.\n $content = call_user_func_array([$instance, $action], $args);\n $response->getBody()->write($content);\n } else {\n throw new \\Slim\\Exception\\NotFoundException($request, $response);\n }\n }", "public function launch()\r\n\t{\r\n\t\t// Corrige le nom du controller.\r\n\t\t// ajoute le namespace et met la 1er lettre en majuscule\r\n\t\t$controller = \"\\\\application\\\\controllers\\\\\";\r\n\t\t$controller .= ucfirst($this->controller);\r\n\r\n\t\t// si la classe existe\r\n\t\tif(class_exists($controller))\r\n\t\t\t$controller = new $controller;\r\n\r\n\t\t// Si la class $controller n'existe pas\r\n\t\telse\r\n\t\t{\r\n\t\t\t// transformation en page d'erreur\r\n\t\t\theader(\"HTTP/1.0 404 Not Found\");\r\n\r\n\t\t\t// alors le controller d'erreur est instancé\r\n\t\t\t$controller = new \\application\\controllers\\Error;\r\n\r\n\t\t\t// appel la method index du controller d'erreur\r\n\t\t\treturn $controller->index();\r\n\t\t}\r\n\r\n\t\t// Si la variable restfull est fause\r\n\t\tif(!$controller->restful)\r\n\t\t\t$method = \"action_\".$this->method;\r\n\r\n\t\telse\r\n\t\t{\r\n\t\t\t// alors peu être appelé par le type de request\r\n\t\t\t// ex: get_index(), post_index(), put_index() or delete_index()\r\n\t\t\t$method = strtolower($_SERVER['REQUEST_METHOD']).\"_\" .$this->method;\r\n\t\t}\r\n\r\n\t\t// Vérifie que la method existe dans le controller\r\n\t\tif(method_exists($controller, $method))\r\n\t\t\t// Appel la method du controller en lui passant des parametres\r\n\t\t\treturn call_user_func_array(array($controller, $method), array($this->args));\r\n\r\n\t\telse\r\n\t\t{\r\n\t\t\t// transformation en page d'erreur\r\n\t\t\theader(\"HTTP/1.0 404 Not Found\");\r\n\r\n\t\t\t// alors le controller d'erreur est instancé\r\n\t\t\t$controller = new \\application\\controllers\\Error;\r\n\r\n\t\t\t// appel la method index du controller d'erreur\r\n\t\t\treturn $controller->index();\r\n\t\t}\r\n\t}", "public function handle(ServerRequestInterface $request): ResponseInterface\n {\n $routeResult = $request->getAttribute(RouteResult::class, false);\n if (! $routeResult || ! $routeResult->isSuccess()) {\n throw new Exception\\RouterResultNotFoundException(\n \"Must be a valid \\\"Tlumx\\Router\\Result\\\" objrct in the request attriute\"\n );\n }\n\n $handler = $routeResult->getRouteHandler();\n $this->controllerNamecontainer = isset($handler['controller']) ? $handler['controller'] : 'index';\n $this->action = isset($handler['action']) ? $handler['action'] : 'index';\n $action = $this->action . 'Action';\n if (!method_exists($this, $action)) {\n throw new Exception\\ActionNotFoundException(sprintf('Action \"%s\" not found.', $this->action));\n }\n\n $layout = $this->getContainer()->get('config')->get('layout');\n if (is_string($layout) && $layout) {\n $this->setLayout($layout);\n }\n\n $actionResponse = $this->$action($request);\n if ($actionResponse instanceof ResponseInterface) {\n return $actionResponse;\n }\n\n if ($this->enableLayout()) {\n $layoutFile = $this->getContainer()->get('templates_manager')->getTemplate($this->getLayout());\n $this->getView()->content = $actionResponse;\n $actionResponse = $this->getView()->renderFile($layoutFile);\n }\n\n $response = $this->getContainer()->get('response');\n $response->getBody()->write($actionResponse);\n return $response;\n }", "protected function initRequest()\n {\n $context = new RequestContext();\n $context->fromRequest(self::$request);\n $matcher = new UrlMatcher($this->routCollection, $context);\n\n try {\n $attributes = $matcher->match(self::$request->getPathInfo());\n $response = $this->callController($attributes);\n } catch (ResourceNotFoundException $e) {\n $response = new Response('Not Found', 404);\n } catch (Exception $e) {\n $response = new Response('An error occurred', 500);\n }\n\n $response->send();\n }", "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 static function dispatch()\r\n\t{\r\n\t\t/**\r\n\t\t * Controllernames and methods saved in an array. It's solved manually to prevent that too many ressources are used to\r\n\t\t * scan every controller if the method exists etc.\r\n\t\t */\r\n\t\t$validControllerNames = array(\t\"Album\"\t\t\t=> array(\"index\",\"create\",\"doCreate\", \"edit\", \"doEdit\", \"delete\", \"doDelete\"),\r\n\t\t\t\t\t\t\t\t\t \t\"Albums\"\t\t=> array(\"index\"),\r\n\t\t\t\t\t\t\t\t\t \t\"Home\" \t\t\t=> array(\"index\"),\r\n\t\t\t\t\t\t\t\t\t \t\"Login\"\t\t\t=> array(\"index\",\"doLogin\"),\r\n\t\t\t\t\t\t\t\t\t\t\"Logout\"\t\t=> array(\"index\",\"doLogout\"),\r\n\t\t\t\t\t\t\t\t\t\t\"Photo\"\t\t\t=> array(\"index\", \"edit\", \"doEdit\", \"delete\", \"doDelete\", \"addTo\", \"doAddTo\"),\r\n\t\t\t\t\t\t\t\t\t \t\"Photos\"\t\t=> array(\"index\"),\r\n\t\t\t\t\t\t\t\t\t\t\"Register\"\t\t=> array(\"index\",\"doRegister\"),\r\n\t\t\t\t\t\t\t\t\t\t\"Search\"\t\t=> array(\"index\"),\r\n\t\t\t\t\t\t\t\t\t \t\"Upload\"\t\t=> array(\"index\",\"doUpload\"),\r\n\t\t\t\t\t\t\t\t\t\t\"User\"\t\t\t=> array(\"index\", \"edit\", \"doEdit\", \"delete\", \"doDelete\", \"changepw\", \"doChangepw\"),\r\n\t\t\t\t\t\t\t\t\t\t\"Error\"\t\t\t=> array(\"index\"));\r\n\r\n\t\t// Make an array of the data in the url, separated by \"/\"\r\n\t\t$url = explode('/', trim($_SERVER['REQUEST_URI'], '/'));\r\n\r\n\t\t// controllername which is setted in the url.\r\n\t\tif (!empty($url[0])) {\r\n\r\n\t\t\t// controllername exists\r\n\t\t\tif(array_key_exists(ucfirst($url[0]),$validControllerNames)) {\r\n\t\t\t\t$controllerName = ucfirst($url[0]);\r\n\r\n\t\t\t\t// Check if method exist and else call the index method of the controller.\r\n\t\t\t\tif (!empty($url[1]) && in_array($url[1],$validControllerNames[$controllerName])) {}\r\n\t\t\t\t$method \t\t= (!empty($url[1]) && in_array($url[1],$validControllerNames[$controllerName])) ? $url[1] : 'index';\r\n\t\t\t\t$args \t\t\t= array_slice($url, 2);\r\n\r\n\t\t\t} else {\r\n\t\t\t\t$controllerName = 'Error';\r\n\t\t\t\t$method \t\t= 'index';\r\n\t\t\t\t$args \t\t\t= array();\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t$controllerName = 'Home';\r\n\t\t\t$method \t\t= 'index';\r\n\t\t\t$args \t\t\t= array();\r\n\t\t}\r\n\r\n\t\t// Add controller and create object\r\n\t\trequire_once (\"controllers/\".$controllerName.\"Controller.php\");\r\n $controllerName = $controllerName.\"Controller\";\r\n\t\t$controller = new $controllerName();\r\n\t\tcall_user_func_array(array($controller, $method), $args);\r\n\r\n\t\t// Removes the useless Controllers and valid controller name array to save resources\r\n\t\tunset($controller);\r\n\t\tunset($validControllerNames);\r\n\t}", "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 }", "protected function initAction()\r\n {\r\n $return = false;\r\n\r\n // parse request URI\r\n $parts_url = parse_url(strtolower(trim($_SERVER['REQUEST_URI'], '/')));\r\n // @TODO: fix\r\n $parts_url_array = explode('/', $parts_url['path']);\r\n list($this->controllerName, $this->itemId) = $parts_url_array;\r\n\r\n // parse method\r\n $this->requestMethod = strtolower($_SERVER['REQUEST_METHOD']);\r\n\r\n switch ($this->requestMethod) {\r\n case 'get':\r\n // default actions for GET\r\n if ($this->controllerName == 'login' || $this->controllerName == 'logout') {\r\n $this->actionName = $this->controllerName;\r\n $this->controllerName = 'users';\r\n } elseif (is_null($this->itemId)) {\r\n $this->actionName = 'index';\r\n } else {\r\n $this->actionName = 'view';\r\n }\r\n break;\r\n case 'post':\r\n // default action for POST\r\n $this->actionName = 'add';\r\n break;\r\n case 'put':\r\n // default action for PUT\r\n $this->actionName = 'edit';\r\n break;\r\n case 'delete':\r\n // default action for DELETE\r\n $this->actionName = 'delete';\r\n break;\r\n }\r\n\r\n if (!$this->controllerName) {\r\n $this->controllerName = 'main';\r\n }\r\n if (!$this->actionName) {\r\n $this->actionName = 'index';\r\n }\r\n\r\n // get, check & requre class\r\n $className = sprintf('mob%s', ucfirst($this->controllerName));\r\n $className = 'pages\\\\' . $className;\r\n \r\n if (class_exists($className)) {\r\n //create a instance of the controller\r\n $this->controller = new $className();\r\n\r\n //check if the action exists in the controller. if not, throw an exception.\r\n $actionName = sprintf('action%s', ucfirst($this->actionName));\r\n if (method_exists($this->controller, $actionName) !== false) {\r\n $this->action = $actionName;\r\n // set request params\r\n if ($this->itemId) {\r\n $this->controller->setParams(array('id' => $this->itemId));\r\n }\r\n $this->controller->setRequestParams($this->requestMethod);\r\n\r\n $return = true;\r\n } else {\r\n $this->controller->httpStatusCode = HTTP_STATUS_METHOD_NOT_ALLOWED;\r\n// throw new \\Exception('Action is invalid.');\r\n }\r\n } else {\r\n $this->controller = new clsMobController();\r\n $this->controller->httpStatusCode = HTTP_STATUS_NOT_FOUND;\r\n// throw new \\Exception('Controller class is invalid.');\r\n }\r\n\r\n return $return;\r\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 }", "public function process() {\n // on va lui passer le contexte en premier paramètre\n // puis on va lui passer les paramètres du path comme\n // paramètres supplémentaires\n $args = array_merge(\n array($this->_context),\n $this->_context->route->params\n );\n\n $this->_context->require_part('controller', $this->controller);\n $controller = new $this->controller;\n\n // CALL STAGES BEFORE ACTION\n\n $stages = array(\n '_before_action'\n );\n\n $_response = null;\n $responses_stack = array();\n\n foreach($stages as $stage) {\n $_response = $this->call_stage($controller,$stage,$this->action, $responses_stack);\n\n // Si on obtient un objet de type Response, on stoppe\n\n if($_response instanceof Response) {\n return $this->output($_response); // ! RETURN\n }\n else {\n $responses_stack[$stage] = $_response;\n }\n }\n\n\n // CALL ACTION\n if(! method_exists($controller, $this->action)) {\n throw new \\InvalidArgumentException('Action '.$this->action.' does not exists in controller '. get_class($controller));\n }\n $action_response = call_user_func_array(array($controller, $this->action), $args);\n\n if($action_response instanceof Response) {\n return $this->output($action_response); // ! RETURN\n }\n\n\n if(is_null($action_response)) {\n // si la réponse est nulle, on ne fait rien tout simplement\n //@todo : faire autre chose, envoyer un 204 ?\n $class = get_class($controller);\n r(\"@todo : empty $class return\");\n return; // ! RETURN\n }\n elseif(is_string($action_response)) {\n $response = new Response($action_response, $headers=array());\n return self::output($response); // ! RETURN\n }\n\n\n }", "abstract public function getControllerAction();", "public function run() {\n // 1. Getting the request string\n $uri = $this->getURI();\n $uri_arr = explode('/', $uri);\n if ($uri_arr !== false) {\n $flag = false;\n foreach ($uri_arr as $key=>$item) {\n if (($item === 'articles' or $item === 'auth') and $key > 0) {\n define('FOLDER_NAME', $uri_arr[$key - 1]);\n $flag = true;\n }\n }\n if (!$flag) {\n define('FOLDER_NAME', '');\n }\n }\n\n // 2. Checking if the request exists in routes\n foreach ($this->routes as $req=>$act) {\n // 3. If getting match then define the controller and action\n if (preg_match('@'.$req.'@', $uri)) {\n // 4. Importing file of chosen controller\n if ($req !== '') {\n $internal = preg_replace('@' . $req . '@', $act, $uri);\n }\n else {\n $internal = $act;\n }\n $matches = array();\n preg_match('@(articles/.*$|main/.*$|auth/.*$)@', $internal, $matches);\n $internal = $matches[0];\n $full_request = explode('/', $internal);\n $controller = ucfirst($full_request[0].'Controller');\n $action = 'action'.explode('?', ucfirst($full_request[1]))[0];\n $params = array();\n for ($i = 2; $i < count($full_request); $i++) {\n $params[$i - 2] = $full_request[$i];\n }\n $file = ROOT.'/controllers/'.$controller.'.php';\n if (file_exists($file)) {\n include_once($file);\n }\n // 5. Creating object and doing action\n try {\n $chosenController = new $controller;\n $is_done = call_user_func_array(array($chosenController, $action), $params);\n }\n catch (TypeError $e) {\n header(\"HTTP/1.0 404 Not Found\");\n $is_done = false;\n }\n if ($is_done) break;\n }\n }\n\n }", "public function dispatch(Request $request)\r\n\t{\r\n\t global $rpgws_config;\r\n\t $controller = $request->get_uri_string();\r\n\t $action = $request->get_uri_string();\r\n\t if(empty($action)) $action = \"index\";\r\n\t \r\n\t $cont_class = \"User_\" . $controller . \"_Controller\";\r\n\t $action_method = $action . \"_action\";\r\n\t \r\n\t $view_file = dirname(__FILE__) . \"/view/\" . $controller . \"_\" . $action . \".php\";\r\n\t $this->m_View->set_layout(RPGWS_LAYOUT_PATH . \"/\" . $rpgws_config['layout']['default']);\r\n\t $this->m_View->set_content($view_file);\r\n\t $this->m_View->set_menu(new Menu());\r\n\t \r\n\t $cont = new $cont_class();\r\n\t if(!method_exists($cont, $action_method)) $action_method = \"index_action\";\r\n\t $cont->registerView($this->m_View);\r\n\t $cont->registerRequest($request);\r\n\t $cont->$action_method();\r\n\t}", "public static function init() {\n\t\t$_GET = App::filterGET();\n\t\t\n\t\t// Checken of er params zijn meegegeven\n\t\ttry {\n\t\t\tif (count($_GET) == 0) {\n\t\t\t\t$_GET[0] = '';\n\t\t\t}\n\t\t\t\n\t\t\t// Is de eerste param een controller ? Anders een pageView\n\t\t\tif (self::isController($_GET[0])) {\n\t\t\t\t$controllerName = self::formatAsController($_GET[0]);\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Er is sprake van een pageview\n\t\t\t\t$controllerName = 'PagesController';\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\t\n\t\t\t$action = self::getAction($controller);\n\t\t\t$controller->setAction($action);\n\n\t\t\t// Try to exec the action\n\t\t\ttry {\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(ActionDoesNotExistException $ex) {\n\n\t\t\t\techo $action;\n\t\t\t\t// Action bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidAction');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(MissingArgumentsException $ex) {\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('missingArguments');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\t\n\t\t\t// Try to render the view\n\t\t\ttry {\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\tcatch(ViewDoesNotExistException $ex) {\n\t\t\t\t// View bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidView');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t\t\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch(NoValidTemplateException $ex) {\n\t\t\techo 'Invalid template';\n\t\t}\n\t\tcatch(IsNotControllerException $ex) {\n\t\t\techo 'Controller not found';\n\t\t}\n\t}", "public function execute()\n {\n if (!$this->external) {\n $processed = Request::process($this, $this->routes);\n\n if ($processed) {\n // Store the matching route\n $this->route = $processed['route'];\n $params = $processed['params'];\n\n // Is this route external?\n $this->external = $this->route->isExternal();\n\n if (isset($params['namespace'])) {\n $this->namespace = $params['namespace'];\n }\n\n // Store the controller\n if (strpos($params['controller'], '\\\\') !== false) {\n $controller_parts = explode('\\\\', $params['controller']);\n $this->controller = array_pop($controller_parts);\n $this->namespace = implode('\\\\', $controller_parts);\n } else {\n $this->controller = $params['controller'];\n }\n\n // Store the action\n $this->action = (isset($params['action'])) ? $params['action'] : Repository::$default_action;\n\n // These are accessible as public vars and can be overloaded\n unset($params['controller'], $params['action'], $params['namespace']);\n\n // Params cannot be changed once matched\n $this->params = $params;\n }\n }\n\n if (!$this->route instanceof Route) {\n return HTTPException::factory(404, 'Unable to find a route to match the URI: {uri}', [\n 'uri' => $this->uri,\n ])->request($this)\n ->getResponse();\n }\n\n if (!$this->client instanceof RequestClient) {\n throw new RequestException('Unable to execute {uri} without a \\KORD\\Request\\Client', [\n 'uri' => $this->uri,\n ]);\n }\n\n return $this->client->execute($this);\n }", "public static function load($request)\n {\n $routes = self::$_routes;\n\n /* explode the request and check the route */\n $route = explode('/', $request);\n $validRoute = array_key_exists($route[0], $routes);\n $parameter = $validRoute ? null : \"404\";\n\n /* load info from routes table */\n $controller = $validRoute ? $routes[$route[0]]['controller'] : \"ErrorController\";\n $action = $validRoute ? $routes[$route[0]]['action'] : \"display\";\n \n $class = \"\\\\Application\\\\Controllers\\\\$controller\";\n $obj = new $class;\n\n return $obj->$action($parameter, $route[0]);\n }", "public function dispatch($url){\n $url = $this->removeQueryStringVariables($url);\n \n if($this->match($url)){\n $controller = $this->params['controller'];\n $controller = $this->convertToStudlyCaps($controller);\n $controller = $this->getNamespace() . $controller;\n if(class_exists($controller)){\n $controller_object = new $controller($this->params);\n $action = $this->params['action'];\n $action = $this->convertToCamelCase($action);\n $methodVariable = array($controller_object, $action);\n if(is_callable($methodVariable, false)){\n $controller_object->$action();\n } else{\n //echo \"Method $action not found in $controller\";\n throw new \\Exception(\"Method $method nof found in (controller $controller)\");\n }\n } else{\n throw new \\Exception(\"Controller class $controller not found\");\n }\n \n } else{\n echo \"$url not found\";\n }\n \n }", "public function run()\n\t{\n\t\t$this->request['method'] = strtolower($_SERVER['REQUEST_METHOD']);\n\n\t\t// strtok to strip parameters\n\t\t$this->request['uri'] = strtok($_SERVER['REQUEST_URI'], '?');\n\n\t\tif (!isset($routes[$this->request['method']])) {\n\t\t\tthrow new \\InvalidArgumentException(\n\t\t\t\t\"No routes assigned to HTTP method {$this->request['method']}.\");\n\t\t}\n\n\t\t// Fetch action assigned to route\n\t\t$action = $this->route();\n\n\t\t// Route was not found; handle 404\n\t\tif ($action === false) {\n\t\t\ttry {\n\t\t\t\t$response = $this->execute($routes['error']['404']);\n\t\t\t} catch (InvalidActionException $e) {\n\t\t\t\t// Default 404 handling\n\t\t\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$response = $this->execute($action);\n\n\t\tif($response) {\n\t\t\t$this->respond($response);\n\t\t}\n\t}", "public function run()\n\t{\n\n\t\t//excute request routing\n\t\t$this->request = new Request($this);\n\n\t\t$module = $this->load_module();\n\n\t\tif ($module !== false) {\n\n\t\t\t$className = $this->load_controller($module);\n\n\t\t\tif ($className !== false) {\n\n\t\t\t\t$controller = new $className();\n\t\t\t\t$response = $this->call_function($controller);\n\t\t\t\tif (is_array($response)) {\n\t\t\t\t\tResponse::show($response);\n\t\t\t\t} else {\n\t\t\t\t\tResponse::show(array(\n\t\t\t\t\t\t\t$response\n\t\t\t\t\t\t));\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tResponse::show(array(\n\t\t\t\t\t\t'status'\t=> false,\n\t\t\t\t\t\t'message'\t=> 'Application controller required.'\n\t\t\t\t\t), 404);\n\t\t\t}\n\n\t\t} else {\n\t\t\tResponse::show(array(\n\t\t\t\t\t'status'\t=> false,\n\t\t\t\t\t'message'\t=> 'Application module required.'\n\t\t\t\t), 404);\n\t\t}\n\n\t}", "final public static function routeNextController(RoutingController $controller, Request $req, Response $res){\n\n $controller->acceptRoute($req,$res);\n\n }", "public static function dispatch($url)\n {\n $url = self::removeQueryString($url);\n\n if (self::match($url)) {\n if (preg_match('/controller$/i', self::$params['controller']) == 0) {\n $controller = self::$params['controller'].'Controller';\n } else {\n $controller = self::$params['controller'];\n }\n \n $controller = self::convertToStudlyCaps($controller);\n $controller = self::getNamespace() . $controller;\n \n if (class_exists($controller)){\n $controller_object = new $controller(self::$params);\n $action = self::$params['action'];\n $action = self::convertToCamelCase($action);\n\n if (preg_match('/action$/i', $action) == 0) {\n $request = $_SERVER['REQUEST_METHOD'];\n if (isset($_POST['_method'])){\n $request = $_POST['_method'];\n } \n $user_request_method = strtoupper(self::$params['request_method']);\n if ($request === $user_request_method\n || $user_request_method === 'ANY'\n ) {\n echo $controller_object->$action(new \\Simple\\Request);\n } else {\n throw new \\Exception(\"$request Method not allowed\", 405);\n } \n } else {\n throw new \\Exception(\"Method [$action] (in Controller [$controller] ) can't be called explicitly. Remove Action suffix instead\");\n }\n } else {\n throw new \\Exception(\"Controller class [$controller] not found\");\n }\n } else {\n throw new \\Exception(\"INVALID ROUTE [$url]\", 404);\n }\n }", "public function getControllerAction() {}", "public function route() {\n\n try {\n \n $obj = APIFactory::init($this->parsed_path[0]);\n echo $this->getAction($obj, $this->parsed_path);\n \n } catch(UndefinedActionException $e) { \n\n echo $e->getMessage();\n\n } catch(Exception $e) {\n\n echo $e->getMessage();\n\n }\n }", "public function dispatch(Request $request) {\n\n $uri = $request->uri();\n $method = $request->method();\n\n if (in_array($uri, self::$routes)) {\n if (self::$methods[$uri] == $method || self::$methods[$uri] == 'ANY') {\n if (is_object(self::$callbacks[$uri])) {\n call_user_func(self::$callbacks[$uri]);\n } else {\n $s = explode('@', self::$callbacks[$uri]);\n call_user_func(array((new $s[0]), $s[1]));\n }\n }\n } else {\n header($_SERVER['SERVER_PROTOCOL'].\" 404 Not Found\");\n echo '404';\n }\n }", "public function controller_for($url, &$parameters, $method = 'get') {\n $url = $this->normalize($url);\n $params = $parameters;\n \n // walk the routes\n foreach ($this->routes as $route) {\n if ($route->match($url, $method, $params)) {\n \n // a controller must be specified\n if (!isset($params['controller'])) {\n $this->logger()->error(\"No controller specified for route #\".$route->position());\n continue;\n }\n \n // and the class must exist\n $class = $this->controller_class($params['controller']);\n if (!class_exists($class)) {\n $this->logger()->error(\"No such controller class \\\"$class\\\"\");\n continue;\n }\n \n // ok, we're good to go\n $parameters = $params;\n return new $class();\n }\n }\n \n // no match\n return $this->error_route('404', 'Not Found', $method, $parameters);\n }", "public function run ()\n\t\t{\n\t\t\t$uri = $this->getURI ();\n\t\t\t\n\t\t\tforeach ($this->routes as $uriPattern => $path) \n\t\t\t{\n\n\t\t\t\tif ( preg_match ( \"~$uriPattern~\", $uri) )\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$internalRoute = preg_replace(\"~$uriPattern~\", $path, $uri);\n\n\t\t\t\t\t//Определяем контроллер, action(действие), параметры\n\t\t\t\t\t$segments = explode ( '/', $internalRoute );\n\n\t\t\t\t\t$controllerName = array_shift ( $segments ) . 'Controller';\n\t\t\t\t\t$controllerName = ucfirst ( $controllerName );\n\n\t\t\t\t\t$actionName = 'action' . ucfirst ( array_shift ( $segments ) );\n\n\t\t\t\t\t$parameters = $segments;\n\t\t\t\t\t\n\n\t\t\t\t\t$controllerFile = ROOT . '/controllers/' . \n\t\t\t\t\t\t$controllerName . '.php';\n\n\t\t\t\t\t\n\t\t\t\t\tif ( file_exists ( $controllerFile ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tinclude_once ( $controllerFile );\n\t\t\t\t\t}\n\n\t\t\t\t\t//Create new obj, that is call need method (that is action)\n\n\t\t\t\t\t$controllerObject = new $controllerName;\n\n\t\t\t\t\t// echo $controllerName.\" \".$actionName;\n\t\t\t\t\t/**\n\t\t\t\t\t * Calling need method ($actionName) a certain class ($contollerObject)\n\t\t\t\t\t * with given ($paramets) параметрами\n\t\t\t\t\t */\n\t\t\t\t\tif(method_exists($controllerObject, $actionName)) {\n\t\t\t\t\t\t$result = call_user_func_array (\n\t\t\t\t\t\t\t array ( $controllerObject, $actionName ), \n\t\t\t\t\t\t\t $parameters \n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\trequire_once ROOT . '/views/error/error404.html';\n\t\t\t\t\t}\t\n\t\t\t\n\n\t\t\t\t\t//if method of controller is successeful, finish working router\n\t\t\t\t\tif ( $result != null )\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t} \n\n\t\t\t}\n\n\t\t}", "public function dispatch ()\n {\n $matchCount = $diffCount = 0;\n $matches = $differs = array();\n\n foreach ($this->routes as $id => $route) {\n if (preg_match(\"#^{$route}$#\", $this->request)) {\n $matchCount++;\n $matches[$id] = $route;\n } else {\n $diffCount++;\n $differs[$id] = $route;\n }\n }\n\n if (count($matches) <= 0) {\n http_response_code(404);\n echo \"<h1>404</h1>\";\n throw new \\Exception(\"No route was found for: {$this->request}\");\n die;\n } elseif (count($matches) > 1) {\n http_response_code(500);\n die(\"Looks like there is a problem trying to find the right location... Stupid devs....\");\n } elseif (count($matches) === 1) {\n foreach ($matches as $id => $match) {\n $request = explode('/', $this->request);\n $slugs = explode('/', $match);\n\n foreach ($slugs as $key => $slug) {\n if ($slug == '.+') {\n array_push($this->args, $request[$key]);\n }\n }\n\n call_user_func_array($this->methods[$id], $this->args);\n }\n }\n }", "public function route(HTTPRequest $request) {\n try {\n $this->useAViewVcRoadIfRootValid($request);\n\n if (! $request->get('action')) {\n $this->useDefaultRoute($request);\n\n return;\n }\n\n $action = $request->get('action');\n\n switch ($action) {\n case \"create-repository\":\n $this->checkUserCanAdministrateARepository($request);\n $this->explorer_controller->createRepository($request, $request->getCurrentUser());\n break;\n case \"settings\":\n case \"display-mail-notification\":\n $this->checkUserCanAdministrateARepository($request);\n $this->admin_controller->displayMailNotification($this->getService($request), $request);\n break;\n case \"save-mail-header\":\n $this->checkUserCanAdministrateARepository($request);\n $this->admin_controller->saveMailHeader($request);\n break;\n case \"update-mailing-lists\":\n if ($request->get('save-mailing-lists')) {\n $this->checkUserCanAdministrateARepository($request);\n $this->admin_controller->saveMailingList($request);\n } else if ($request->get('delete-mailing-lists')) {\n $this->checkUserCanAdministrateARepository($request);\n $this->admin_controller->deleteMailingList($request);\n }\n break;\n case \"save-hooks-config\":\n $this->checkUserCanAdministrateARepository($request);\n $this->admin_controller->updateHooksConfig($this->getService($request), $request);\n break;\n case \"hooks-config\":\n $this->checkUserCanAdministrateARepository($request);\n $this->admin_controller->displayHooksConfig($this->getService($request), $request);\n break;\n case \"display-repository-delete\":\n $this->checkUserCanAdministrateARepository($request);\n $this->admin_controller->displayRepositoryDelete($this->getService($request), $request);\n break;\n case \"delete-repository\":\n $this->checkUserCanAdministrateARepository($request);\n $this->admin_controller->deleteRepository($request);\n break;\n case \"restore\":\n $this->checkUserCanAdministrateARepository($request);\n $this->restore_controller->restoreRepository($request);\n break;\n case \"access-control\":\n $this->checkUserCanAdministrateARepository($request);\n $this->access_control_controller->displayAuthFile($this->getService($request), $request);\n break;\n case \"save-access-file\":\n $this->checkUserCanAdministrateARepository($request);\n $this->access_control_controller->saveAuthFile($this->getService($request), $request);\n break;\n case \"display-archived-version\":\n $this->checkUserCanAdministrateARepository($request);\n $this->access_control_controller->displayArchivedVersion($request);\n break;\n case \"display-immutable-tag\":\n $this->checkUserCanAdministrateARepository($request);\n $this->immutable_tag_controller->displayImmutableTag($this->getService($request), $request);\n break;\n case \"save-immutable-tag\":\n $this->checkUserCanAdministrateARepository($request);\n $this->immutable_tag_controller->saveImmutableTag($this->getService($request), $request);\n break;\n case 'save-admin-groups':\n $this->checkUserCanAdministrateARepository($request);\n $this->global_admin_controller->saveAdminGroups(\n $this->getService($request),\n $request\n );\n break;\n case 'admin-groups':\n $this->checkUserCanAdministrateARepository($request);\n $this->global_admin_controller->showAdminGroups(\n $this->getService($request),\n $request\n );\n break;\n\n default:\n $this->useDefaultRoute($request);\n break;\n }\n } catch (CannotFindRepositoryException $e) {\n $GLOBALS['Response']->addFeedback(Feedback::ERROR, $GLOBALS['Language']->getText('plugin_svn', 'find_error'));\n $GLOBALS['Response']->redirect(SVN_BASE_URL .'/?group_id='. $request->get('group_id'));\n } catch (UserCannotAdministrateRepositoryException $e) {\n $GLOBALS['Response']->addFeedback(Feedback::ERROR, $GLOBALS['Language']->getText('global', 'perm_denied'));\n $GLOBALS['Response']->redirect(SVN_BASE_URL .'/?group_id='. $request->get('group_id'));\n }\n }", "public function __construct() {\n // filter controller, action and params\n $url = filter_input(INPUT_GET, 'url', FILTER_SANITIZE_URL); // $_GET['url']\n $params = explode('/', trim($url, '/'));\n\n // store first and seccond params, removing them from params list\n $controller_name = ucfirst(array_shift($params)); // uppercase classname\n $action_name = array_shift($params);\n\n require_once APP . 'config.php';\n\n // default controller and action\n if (empty($controller_name)) {\n $controller_name = AppConfig::DEFAULT_CONTROLLER;\n }\n if (empty($action_name)) {\n $action_name = AppConfig::DEFAULT_ACTION;\n }\n\n // load requested controller\n if (file_exists(APP . \"Controller/$controller_name.php\")) {\n require CORE . \"Controller.php\";\n require CORE . \"Model.php\";\n require APP . \"Controller/$controller_name.php\";\n $controller = new $controller_name();\n\n // verify if action is valid\n if (method_exists($controller, $action_name)) {\n call_user_func_array(array($controller, $action_name), $params);\n $controller->render(\"$controller_name/$action_name\"); // skipped if already rendered\n } else {\n // action not found\n $this->notFound();\n }\n } else {\n // controller not found\n $this->notFound();\n }\n }", "private function tryDispatch()\n\t{\n\t\t// Get the name of the controller to be instantiated.\n\t\t$controller_name = $this->route->getController();\n\t\t$defualt_method = $this->config->getDefaultAction();\n\n\t\t// Use the default controller if no other controller was specified.\n\t\tif (empty($controller_name) && $this->config->getDefaultController()) {\n\t\t\t$controller_name = ucfirst($this->config->getDefaultController());\n\t\t}\n\n\t\t// Add 'Controller' suffix.\n\t\t$controller_name .= \"Controller\";\n\n\t\t// FIXME: Hardcoded application path.\n\t\t// Make sure the controller-class file exists\n\n\t\t$controller_file = $this->config->getApplicationPath() . \"/controllers/\" .\n\t\t\t$controller_name . \".php\";\n\t\tif (file_exists($controller_file)) {\n\t\t\t// Include the controller-class file.\n\t\t\trequire_once($controller_file);\n\t\t}\n\n\t\t$success = false;\n\n\t\tif (class_exists($controller_name)) {\n\t\t\t$controller = new $controller_name($this->request);\n\t\t\t$method = $this->route->getAction();\n\n\t\t\tif (empty($method)) {\n\t\t\t\tif (method_exists($controller,$defualt_method)) {\n\t\t\t\t\tcall_user_func(array($controller,$defualt_method));\n\t\t\t\t\t$success = true;\n\t\t\t\t}\n\t\t\t} else if (method_exists($controller,$method)) {\n\t\t\t\t$rmethod = new ReflectionMethod($controller_name, $method);\n\t\t\t\t$rparams = $rmethod->getNumberOfRequiredParameters();\n\t\t\t\t$params = $rmethod->getNumberOfParameters();\n\t\t\t\t$user_params = $this->route->getNumberOfParameters();\n\n\t\t\t\tif ($user_params <= $params && $user_params >= $rparams) {\n\t\t\t\t\tcall_user_func_array(array($controller,$method),\n\t\t\t\t\t\t$this->route->getParameters());\n\t\t\t\t\t$success = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $success;\n\t}", "public function execute(Request $request)\n {\n return $this->getService(ServiceContainer::SERVICE_CONTROLLER_DISPATCHER)->dispatch($request);\n }", "public static function run()\n {\n global $req;\n global $session;\n\n $get = $req->query->all();\n $post = $req->request->all();\n $files = $req->files->all();\n\n self::$get = $get;\n self::$post = $post;\n self::$files = $files;\n\n $route = self::getRoute();\n self::$route = $route;\n\n switch ($route['base']) {\n case '' :\n\n $controller = new BaseController();\n $controller->showHomepage();\n break;\n\n case 'admin' :\n\n self::routeAdmin();\n break;\n\n case 'account' :\n\n self::routeAccount();\n break;\n\n case 'logout' :\n\n Security::requireAuth();\n Security::logout();\n break;\n\n case 'catalog' :\n\n $controller = new CatalogController();\n\n if (!empty($route['section'])) {\n if (is_numeric($route['page']) && !empty($route['action'])) {\n $controller->showProductPage(\n $route['page'], $route['section']\n );\n } else {\n $controller->showCatalogPage($route['section'], $post);\n }\n } else {\n self::redirect('/');\n }\n\n break;\n\n case 'cart':\n\n $controller = new CartController();\n\n if (!is_numeric($route['page']) &&\n in_array($route['section'], ['add', 'remove'])\n ) {\n self::redirect('/cart');\n } else {\n $prodId = $route['page'];\n }\n\n switch ($route['section']) {\n case 'add' :\n $controller->addToCart($prodId);\n break;\n\n case 'remove' :\n $controller->removeFromCart($prodId);\n break;\n\n case 'update' :\n $controller->updateCart($post);\n break;\n\n case '' :\n default :\n $controller->showCartPage();\n }\n break;\n\n case 'checkout' :\n\n $controller = new CheckoutController();\n\n switch($route['section']) {\n case 'step-one' :\n $controller->showStepOnePage();\n break;\n\n case 'add-shipping' :\n if (!empty($post)) {\n $controller->addShipping($post);\n } else {\n self::redirect('/checkout/step-one');\n }\n break;\n\n case 'step-two' :\n $controller->showStepTwoPage();\n break;\n\n case 'prepare-order' :\n if (!empty($post)) {\n $controller->prepareOrder($post);\n } else {\n self::redirect('/checkout/step-two');\n }\n break;\n\n case 'step-three' :\n $controller->showStepThreePage();\n break;\n\n default :\n self::redirect('/checkout/step-one');\n }\n break;\n\n default:\n self::redirect('/');\n // 404 NOT_FOUND\n }\n }", "public function RouteRequest ();", "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}", "protected function autoRegisterController()\n {\n $controllerInfo = $this->getController();\n if ($controllerInfo) {\n $uri = WingedLib::clearPath(static::$parentUri);\n $baseUri = '';\n if (!$uri) {\n $baseUri = './';\n } else {\n $uri = explode('/', $uri);\n if (isset($uri[0])) {\n $baseUri = './' . $uri[0] . '/';\n }\n if (isset($uri[1])) {\n $baseUri .= $uri[1] . '/';\n } else {\n $baseUri .= 'index/';\n }\n }\n if (!empty($controllerInfo['params'])) {\n foreach ($controllerInfo['params'] as $paramName => $optional) {\n if ($optional) {\n $baseUri .= '{$' . $paramName . '?}/';\n } else {\n $baseUri .= '{$' . $paramName . '}/';\n }\n }\n }\n Route::raw($baseUri, static::$controllerName . '@' . static::$controllerAction)->addResponseMiddleware(new ResponseMiddleware(function ($response) {\n if (is_array($response)) {\n /**\n * @var $this ResponseMiddleware\n */\n $self = &$this;\n if ($self->getRoute()->request()->isAcceptableType('application/json')) {\n $self->getRoute()->forceJson();\n } else if ($self->getRoute()->request()->isAcceptableType('application/xml')) {\n $self->getRoute()->forceXml();\n } else if ($self->getRoute()->request()->isAcceptableType('application/yaml')) {\n $self->getRoute()->forceYaml();\n }\n }\n }));\n }\n }", "public function dispatch(): ResponseInterface\n {\n if(!isset($this->current_route)){\n $this->current_route = $this->resolve($this->current_method, $this->current_url);\n }\n\n $hasRoute = isset($this->current_route) && !empty($this->current_route);\n\n if($hasRoute === FALSE){\n return $this->notFound();\n }\n\n $route = $this->current_route;\n $arguments = $route['arguments'] ?? [];\n \\define('INITPHP_ROUTER_CURRENT_ARGUMENTS', $arguments);\n\n $filters = [\n 'before' => [],\n 'after' => [],\n ];\n if(isset($route['options']['middleware']['before'])){\n $filters['before'] = $route['options']['middleware']['before'];\n unset($route['options']['middleware']['before']);\n }\n if(isset($route['options']['middleware']['after'])){\n $filters['after'] = $route['options']['middleware']['after'];\n unset($route['options']['middleware']['after']);\n }\n if(isset($route['options']['middleware']) && !empty($route['options']['middleware'])){\n $filters['before'] = \\array_merge($route['options']['middleware'], $filters['before']);\n $filters['after'] = \\array_merge($route['options']['middleware'], $filters['after']);\n unset($route['options']['middleware']);\n }\n\n $this->middleware_handle($filters['before'], $arguments, self::BEFORE);\n $responseStatusCode = (int)$this->response->getStatusCode();\n if($responseStatusCode < 200 || $responseStatusCode > 299){\n return $this->response;\n }\n if ($route['methods'] === ['LINK']) {\n return $this->execute($route['execute'], $arguments, self::LINK);\n } else {\n if(\\is_callable($route['execute'])){\n \\define('INITPHP_ROUTER_CURRENT_CONTROLLER', '__CALLABLE__');\n \\define('INITPHP_ROUTER_CURRENT_METHOD', '');\n $this->response = $this->execute($route['execute'], $arguments);\n }else{\n $parse = $this->getControllerMethod($route['execute'], $route['options']);\n $parse['controller'] = $this->controllerFind($parse['controller']);\n $reflection = new \\ReflectionClass($parse['controller']);\n $controller = $this->getClassContainer($reflection);\n $this->middleware_handle($this->controller_middlewares_property($controller, $parse['method'], self::BEFORE), $arguments, self::BEFORE);\n \\define('INITPHP_ROUTER_CURRENT_CONTROLLER', \\get_class($controller));\n \\define('INITPHP_ROUTER_CURRENT_METHOD', $parse['method']);\n $responseStatusCode = (int)$this->response->getStatusCode();\n if($responseStatusCode < 200 || $responseStatusCode > 299){\n return $this->response;\n }\n $this->response = $this->execute([$controller, $parse['method']], $arguments);\n $after_middleware = $this->controller_middlewares_property($controller, $parse['method'], self::AFTER);\n if(!empty($after_middleware)){\n $filters['after'] = \\array_merge($filters['after'], $after_middleware);\n }\n }\n }\n\n $this->middleware_handle($filters['after'], $arguments, self::AFTER);\n\n return $this->response;\n }" ]
[ "0.7873218", "0.76526374", "0.75794154", "0.74242836", "0.7369262", "0.72697526", "0.7235982", "0.71996295", "0.71238345", "0.7030151", "0.70071214", "0.69780445", "0.69746727", "0.69605404", "0.68467057", "0.6750967", "0.6744485", "0.6696743", "0.6686083", "0.66715795", "0.6652124", "0.6633699", "0.65950334", "0.65686053", "0.6498406", "0.64913285", "0.6482606", "0.6473824", "0.6460409", "0.6450718", "0.6447547", "0.64469385", "0.6441359", "0.6433407", "0.6413109", "0.6410344", "0.63980323", "0.6386198", "0.63791287", "0.63732797", "0.6367047", "0.6356932", "0.6351685", "0.63436896", "0.6339795", "0.63368714", "0.63243836", "0.6314744", "0.6314028", "0.6306094", "0.6276178", "0.627547", "0.6272854", "0.6268527", "0.6267579", "0.62664455", "0.6261259", "0.6258484", "0.62528694", "0.62511665", "0.6248901", "0.6244819", "0.62300676", "0.6207622", "0.61956286", "0.619512", "0.6192183", "0.61883086", "0.61874753", "0.61873543", "0.6183088", "0.6174028", "0.6156926", "0.6150093", "0.6142061", "0.614089", "0.61172926", "0.610054", "0.6100443", "0.6076037", "0.6067856", "0.60602665", "0.60594565", "0.60403556", "0.60376656", "0.6033131", "0.6012604", "0.60119164", "0.6001025", "0.5993162", "0.59890515", "0.59879833", "0.5984982", "0.597603", "0.59686625", "0.5959757", "0.595723", "0.5957168", "0.5943815", "0.593828" ]
0.73778725
4
/ validates if a controller path exists and is readable
protected function validController($path) { return file_exists($path) && is_readable($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function checkControllerIsExist () {\n\t\tif ( !isset(self::$url[0]))\n\t\t\treturn false ;\n\t\t$controller = trim(self::$url[0]);\n\t\tif ( !empty($controller)) {\n\t\t\t$controllerPatch = self::$appPatch.self::$app.DIRECTORY_SEPARATOR . 'controller' . DIRECTORY_SEPARATOR . $controller . '.php' ;\n\t\t\tif (file_exists($controllerPatch)) {\n\t\t\t\tif (class_exists('App\\\\'.self::$app.'\\controller\\\\'.$controller)) {\n\t\t\t\t\tarray_shift(self::$url);\n\t\t\t\t\tif ( ! self::checkAppIsInstalled(self::$app,false) ){\n\t\t\t\t\t\tself::$app = 'core';\n\t\t\t\t\t\tself::$controller = 'httpErrorHandler';\n\t\t\t\t\t\tself::$method = 'E404';\n\t\t\t\t\t\treturn false ;\n\t\t\t\t\t}\n\t\t\t\t\tself::$controller = $controller;\n\t\t\t\t\treturn true ;\n\t\t\t\t} else {\n\t\t\t\t\tself::$app = 'core';\n\t\t\t\t\tself::$controller = 'httpErrorHandler';\n\t\t\t\t\tself::$method = 'E404';\n\t\t\t\t\treturn false ;\n\t\t\t\t}\n\t\t\t} elseif ( is_dir(self::$appPatch.self::$app )) {\n\t\t\t\t$files = file::get_files_by_pattern(self::$appPatch,'*'.DIRECTORY_SEPARATOR.'app_provider'.DIRECTORY_SEPARATOR.self::$app.DIRECTORY_SEPARATOR.$controller.'.php');\n\t\t\t\tif ( is_array($files) and count($files) > 0 ){\n\t\t\t\t\t$appProvider = strings::deleteWordFirstString(strings::deleteWordLastString($files[0] ,DIRECTORY_SEPARATOR.'app_provider'.DIRECTORY_SEPARATOR.self::$app.DIRECTORY_SEPARATOR.$controller.'.php'),self::$appPatch);\n\t\t\t\t\tif (class_exists('App\\\\'.$appProvider.'\\app_provider\\\\'.self::$app.'\\\\'.$controller)) {\n\t\t\t\t\t\tarray_shift(self::$url);\n\t\t\t\t\t\tif ( ! self::checkAppIsInstalled($appProvider,true) or ! self::checkAppIsInstalled(self::$app,false) ){\n\t\t\t\t\t\t\tself::$app = 'core';\n\t\t\t\t\t\t\tself::$controller = 'httpErrorHandler';\n\t\t\t\t\t\t\tself::$method = 'E404';\n\t\t\t\t\t\t\treturn false ;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tself::$controller = $controller;\n\t\t\t\t\t\tself::$appProvider = $appProvider;\n\t\t\t\t\t\treturn true ;\n\t\t\t\t\t}\n\t\t\t\t} else\n\t\t\t\t\treturn false ;\n\t\t\t}\n\t\t}\n\t\treturn true ;\n\t}", "public function checkRoute(){\n $pathController = \"../app/controllers/\".$this->controllerName.\".class.php\";\n\n if( !file_exists($pathController) ){\n //echo \"Le fichier du controller n'existe pas\";\n return false;\n }\n include $pathController;\n\n if ( !class_exists($this->controllerName) ){\n //echo \"Le fichier du controller existe mais il n'y a pas de classe\";\n return false;\n }\n if( !method_exists($this->controllerName, $this->actionName) ){\n //echo \"L'action n'existe pas\";\n return false;\n }\n return true;\n }", "function check_path($controller, $action)\n {\n if(!method_exists($controller, $action)){\n $controller = $config['error_controller'];\n require_once(APP_DIR . 'controllers/' . $controller . '.php');\n $action = 'index';\n }\n }", "public function checkControllerExists(string $controller)\n {\n if(!class_exists($this->ctlrStrSrc.$controller))\n {\n die(\"Defined Controller doesn't exists\");\n }\n }", "private function _loadExistingController()\r\n {\r\n $file = $this->_controller_path . $this->_url[0] . '.php';\r\n if (file_exists($file)) {\r\n require_once $file;\r\n $this->_controller = new $this->_url[0];\r\n $this->_controller->loadModel($this->_url[0],$this->_model_path);\r\n } else {\r\n $this->_error();\r\n return FALSE;\r\n //throw new Exception(\"The file $file does not exist\"); \r\n }\r\n }", "private function _loadExistingController(){\n\t\t$file = $this->_controllerPath . $this->_url[0] . '.php';\n\t\tif (file_exists($file)) {\n\t\t\trequire $file;\n\t\t\t$this->_controller = new $this->_url[0];\n\t\t $this->_controller->loadModel($this->_url[0], $this->_modelPath);\n\t\t} else {\n\t\t\t$this->_error();\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "public function GetControllerHasAbsoluteNamespace ();", "function _validate_request($segments)\n\t{\n\t\t//return parent::_validate_request($segments);\n\t\t$o_segments=$segments;\n\t\t// Does the requested controller exist in the root folder?\n\t\tif (file_exists(APPPATH.'controllers/'.$segments[0].EXT))\n\t\t{\n\t\t\treturn $segments;\n\t\t}\n \n\t\t// Is the controller in a sub-folder?\n\t\tif (is_dir(APPPATH.'controllers/'.$segments[0]))\n\t\t{\t\t\n\t\t\t// Set the directory and remove it from the segment array\n\t\t\t$this->set_directory($segments[0]);\n\t\t\t$segments = array_slice($segments, 1);\n \n \t\t\t//search multi-level deep folders\n\t\t\twhile(count($segments) > 0 && is_dir(APPPATH.'controllers/'.$this->directory.$segments[0]))\n {\n\t\t\t\techo \"X\";\n\t\t\t\t// Set the directory and remove it from the segment array\n\t\t\t\t$this->set_directory($this->directory . $segments[0]);\n\t\t\t\t$segments = array_slice($segments, 1);\n }\n \n\t\t\tif (count($segments) > 0)\n\t\t\t{\n\t\t\t\t// Does the requested controller exist in the sub-folder?\n\t\t\t\tif ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments[0].EXT))\n\t\t\t\t{\n\t\t\t\t\treturn parent::_validate_request($o_segments);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->set_class($this->default_controller);\n\t\t\t\t$this->set_method('index');\n \n\t\t\t\t// Does the default controller exist in the sub-folder?\n\t\t\t\tif ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$this->default_controller.EXT))\n\t\t\t\t{\n\t\t\t\t\t$this->directory = '';\n\t\t\t\t\treturn array();\n\t\t\t\t}\n\t\t\t}\n \n\t\t\treturn $segments;\n\t\t}\n \t\t \n\t\t// Can't find the requested controller...\n\t\treturn $this->error_404();\n\t}", "private static function isController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t\n\t\tif (file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php')) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public function validate_route($route)\n\t{\n\t\t// If we don't have any segments, the default will have to do\n\t\tif (empty($route))\n\t\t{\n\t\t\t$route = $this->_default_segments();\n\t\t\tif (empty($route))\n\t\t\t{\n\t\t\t\t// No default - fail\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Explode route if not already segmented\n\t\tif ( ! is_array($route))\n\t\t{\n\t\t\t$route = explode('/', $route);\n\t\t}\n\n\t\t// Parse any custom routing that may exist\n\t\t$route = $this->_parse_routes($route);\n\n\t\t// Search paths for controller\n\t\tforeach ($this->CI->load->get_package_paths() as $path)\n\t\t{\n\t\t\t// Does the requested controller exist in the base folder?\n\t\t\tif (file_exists($path.'controllers/'.$route[0].'.php'))\n\t\t\t{\n\t\t\t\t// Found it - append method if missing\n\t\t\t\tif ( ! isset($route[1]))\n\t\t\t\t{\n\t\t\t\t\t$route[] = 'index';\n\t\t\t\t}\n\n\t\t\t\t// Prepend path and empty directory and return\n\t\t\t\treturn array_merge(array($path, ''), $route);\n\t\t\t}\n\n\t\t\t// Is the controller in a sub-folder?\n\t\t\tif (is_dir($path.'controllers/'.$route[0]))\n\t\t\t{\n\t\t\t\t// Found a sub-folder - is there a controller name?\n\t\t\t\tif (isset($route[1]))\n\t\t\t\t{\n\t\t\t\t\t// Yes - get class and method\n\t\t\t\t\t$class = $route[1];\n\t\t\t\t\t$method = isset($route[2]) ? $route[2] : 'index';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Get default controller segments\n\t\t\t\t\t$default = $this->_default_segments();\n\t\t\t\t\tif (empty($default))\n\t\t\t\t\t{\n\t\t\t\t\t\t// No default controller to apply - carry on\n\t\t\t\t\t\tunset($default);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Get class and method\n\t\t\t\t\t$class = array_shift($default);\n\t\t\t\t\t$method = array_shift($default);\n\t\t\t\t}\n\n\t\t\t\t// Does the requested controller exist in the sub-folder?\n\t\t\t\tif (file_exists($path.'controllers/'.$route[0].'/'.$class.'.php'))\n\t\t\t\t{\n\t\t\t\t\t// Found it - assemble segments\n\t\t\t\t\tisset($route[1]) OR $route[] = $class;\n\t\t\t\t\tisset($route[2]) OR $route[] = $method;\n\t\t\t\t\tif (isset($default) && count($default) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$route = array_merge($route, $default);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prepend path and return\n\t\t\t\t\tarray_unshift($route, $path);\n\t\t\t\t\treturn $route;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Search for controller in modules hierarchy\n\t\t// If the module path is APPPATH/modules/, \"/foo/bar/baz\" may map to:\n\t\t//\tAPPPATH/modules/controllers/foo.php\n\t\t//\tAPPPATH/modules/foo/controllers/bar.php\n\t\t//\tAPPPATH/modules/foo/bar/controllers/baz.php\n\t\t//\tAPPPATH/modules/foo/bar/baz/controllers/[default].php\n\t\t$seg_ct = count($route);\n\t\tforeach ($this->CI->load->get_module_paths() as $path)\n\t\t{\n\t\t\t// Does the requested controller exist in the base folder?\n\t\t\tif (file_exists($path.'controllers/'.$route[0].'.php'))\n\t\t\t{\n\t\t\t\t// Found it - append method if missing\n\t\t\t\tif ($seg_ct < 2)\n\t\t\t\t{\n\t\t\t\t\t$route[] = 'index';\n\t\t\t\t}\n\n\t\t\t\t// Prepend path and empty directory and return\n\t\t\t\treturn array_merge(array($path, ''), $route);\n\t\t\t}\n\n\t\t\t// Is there a module sub-folder?\n\t\t\tfor ($sub = '', $seg = 0; $seg < $seg_ct; ++$seg)\n\t\t\t{\n\t\t\t\t// Add segment to subdirectory path and check for controllers\n\t\t\t\t$sub .= $route[$seg].'/';\n\t\t\t\tif (is_dir($path.$sub.'controllers/'))\n\t\t\t\t{\n\t\t\t\t\t// Found a module - is there a controller name?\n\t\t\t\t\tif ($seg_ct > $seg + 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Yes - get class and method\n\t\t\t\t\t\t$class = $route[$seg + 1];\n\t\t\t\t\t\t$method = $seg_ct > $seg + 2 ? $route[$seg + 2] : 'index';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// Get default controller segments\n\t\t\t\t\t\t$default = $this->_default_segments();\n\t\t\t\t\t\tif (empty($default))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// No default controller to apply - carry on\n\t\t\t\t\t\t\tunset($default);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Get class and method\n\t\t\t\t\t\t$class = array_shift($default);\n\t\t\t\t\t\t$method = array_shift($default);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Does the requested controller exist in the module?\n\t\t\t\t\tif (file_exists($path.$sub.'controllers/'.$class.'.php'))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Found it - assemble segments\n\t\t\t\t\t\tif ($seg_ct <= $seg + 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$route[] = $class;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($seg_ct <= $seg + 2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$route[] = $method;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isset($default) && count($default) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$route = array_merge($route, $default);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Return path, empty (post-)subdirectory, and remainder of route\n\t\t\t\t\t\t$route = array_merge(array($path.$sub, ''), array_slice($route, $seg + 1));\n\t\t\t\t\t\treturn $route;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If we got here, no valid route was found\n\t\treturn FALSE;\n\t}", "private static function check_route($a_route){\n\t\t$args=explode(\"/\",$a_route);\n\t\t\n\t\tarray_shift($args);\n\t\tif(count($args)>1){\n\t\t\t$controller=$args[0];\n\t\t\tarray_shift($args);\n\t\t\t$action=$args[0];\n\t\t\tarray_shift($args);\n\t\t}else{\n\t\t\t$controller=$args[0];\n\t\t\tarray_shift($args);\n\t\t\t$action=\"index\";\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tif(file_exists('controllers/'.$controller.'_controller.php')){\n\t\t\t\trequire_once('controllers/'.$controller.'_controller.php');\n\t\t\t\t$maj_controller=ucfirst($controller).'Controller';\n\t\t\t\tif(method_exists($maj_controller,$action)){\n\t\t\t\t\t//print \"Found\";\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}catch(Exception $e){\n\t\t\t//print \"Error\";\n\t\t\t$controller=new ErrorController();\n\t\t\t$controller->server();\n\t\t\tdie();\n\t\t}\n\t}", "private function hasController($page) {\r\n return file_exists($this->getController($page));\r\n }", "public function checkControllerMethodExists(object $controller, string $method)\n {\n if(!method_exists($controller,$method))\n {\n die(\"Unknown method for instantiated controller object\");\n }\n }", "private function ControllerExist($controller) {\n $ControllerExist = false;\n\n foreach ($this->folders as $folder) {\n\n if (class_exists($folder.'\\\\'.$controller)) {\n\n $ControllerExist = true;\n $this->namespace = $folder;\n $this->controller = $controller;\n\n }\n\n }\n\n return $ControllerExist;\n\n }", "public function path_valid() {\n\t\tif (!file_exists($this->path)) return false;\n\t\treturn true;\n\t}", "public function path_valid() {\n\t\tif (!file_exists($this->path)) return false;\n\t\treturn true;\n\t}", "function VerifyController()\n\t\t{\n\t\t\tif ($this->CONTROLLER == \"\" && $this->ACTION == \"\")\n\t\t\t{\n\t\t\t\t$this->CONTROLLER\t= \"PageController\";\n\t\t\t\t$this->ACTION\t\t= \"Home\";\n\t\t\t}\n\t\t\t\n\t\t\t// Check that the parameters are well-formed\t\t\t\n\t\t\tif ($this->CONTROLLER == \"\")\n\t\t\t{\n\t\t\t\t$this->error_message = \"Error: Class name value was blank.\";\n\t\t\t\t$this->loaded = false;\n\t\t\t\treturn $this->loaded;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->ACTION == \"\")\n\t\t\t{\n\t\t\t\t$this->error_message = \"Error: Class method name value was blank.\";\n\t\t\t\t$this->loaded = false;\n\t\t\t\treturn $this->loaded;\n\t\t\t}\n\t\t\t\n\t\t\t// Check that the data class file actually exists\n\t\t\t$this->CheckFile($this->config->base['app'] . '/Base' . $this->CONTROLLER . \".php\", \"Base\" . $this->CONTROLLER);\n\t\t\t$this->CheckFile($this->config->classes['app'] . '/' . $this->CONTROLLER . \".php\", $this->CONTROLLER);\n\n\t\t\t// Check the function we want to run is in the class\n\t\t\tif (is_callable(array($this->CONTROLLER, $this->ACTION)))\n\t\t\t{\n\t\t\t\t$this->error_message = \"\";\n\t\t\t\t$this->loaded = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo $this->CONTROLLER . \"->\" . $this->ACTION;\n\t\t\t\theader(\"HTTP/1.0 404 Not Found\"); exit;\n\t\t\t\t// $this->error_message = \"Error: Class \" . $this->CONTROLLER . \" does not contain a method called '\" . $this->ACTION . \"'.\";\n\t\t\t\t$this->loaded = false;\n\t\t\t}\n\n\t\t\treturn $this->loaded;\n\t\t}", "private function isControllerAction()\n {\n return is_string($this->attributes[self::ACTION]);\n }", "private function controllerExist($controller)\r\n {\r\n $controller = ucfirst($controller . self::$postfix);\r\n if (file_exists(\"controllers/{$controller}.php\")) {\r\n $this->controller = new $controller;\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "private function veriFyControllerOnUrl()\n {\n if (!empty($this->urlParameters[3])) {\n $this->existControllerOnRoute = true;\n }\n if ($this->urlParameters && array_key_exists(0, $this->urlParameters)) {\n $this->controller = ucfirst($this->urlParameters[0]) . 'Controller';\n $this->controllerNameAliases = $this->urlParameters[0];\n }\n }", "static function requireController($controllerName, $action ) {\n\n\t\t$paths = array_merge(array(\n\t\t\tROOT . 'app' . DS . 'controllers' . DS,\n\t\t\tROOT . 'controllers' . DS,\n\t\t\tAE_CONTROLLERS\n\t\t\t), self::$_paths\n\t\t);\n\n\t\tif (strpos($action, '.') !== false) {\n\t\t\t$action = substr($action, 0, strpos($action, '.'));\n\t\t}\n\t\t\n\t\t$controllerName = camelize($controllerName) . 'Controller';\n\t\t$action = camelize($action);\n\n\t\tforeach ($paths as $p) {\n\t\t\tif (is_file($p . $controllerName . '.php')) {\n\t\t\t\trequire_once($p . $controllerName . '.php');\n\n\t\t\t\tif (!class_exists($controllerName)) {\n\t\t\t\t\tif (debuggin()) {\n\t\t\t\t\t\tthrow new Exception ($controllerName . ' is not defined as class.');\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (!method_exists($controllerName, $action)) {\n\t\t\t\t\tif (debuggin()) {\n\t\t\t\t\t\tthrow new Exception ($action . ' is not defined in class ' . $controllerName);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (!is_public_controller_method($controllerName, $action) || substr($controllerName, 0, 1) == '_') {\n\t\t\t\t\tif (debuggin()) {\n\t\t\t\t\t\tthrow new Exception ($action . ' is not public in class ' . $controllerName);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\n\t\t\t\treturn true;\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "private static function viewRequiresController(): bool\n {\n return true;\n }", "public function includeControllerFile() : bool\n {\n if(file_exists($this->routerEntity->getControllerFile())){\n include_once ($this->routerEntity->getControllerFile());\n return true;\n }\n return false;\n }", "public function is_accessible_controller() {\r\n\t\tinclude_once 'menu_aksi.php';\r\n\t\t$menu_aksi = new menu_aksi($this->Command);\r\n\t\tif($menu_aksi->getByController(true) != 0) {\r\n\t\t\tinclude_once 'menu_function_aksi.php';\r\n\t\t\t$menu_function_aksi = new menu_function_aksi($this->Command);\r\n\t\t\tif($menu_function_aksi->getByName(true) != 0) {\r\n\t\t\t\t$this->model = new permission();\r\n\t\t\t\t$this->model->set_select_full_prefix('select * from permission p,user u');\r\n\t\t\t\t$this->model->set_select_full_suffix('p.ROLE = u.ROLE and p.MENU = (select id_menu from menu where controller=\\'' . $this->Command->getControllerName() . '\\') and u.USERNAME=\\'' . $this->Command->getUserLogged()->get_username() . '\\' and menu_function=(select id_menu_function from menu_function where nama_menu_function=\"' . $this->Command->getFunction() . '\" limit 1)');\r\n\t\t\t\treturn ($this->svc->select_count($this->model) > 0) ? true : false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "private static function load_and_run_controller($path) {\n if (file_exists($path[\"path\"] . $path[0])) {\n require_once $path[\"path\"] . $path[0];\n\n /** Add Controller and strip .php extension */\n $path[0] = str_replace(\".php\", \"\", $path[0]) . \"Controller\";\n if (class_exists($path[0])) {\n $class = new $path[0]();\n $method = isset($path[1]) ? $path[1] : \"index\";\n\n /** Is this a REAL controller? */\n if (is_subclass_of($class, \"Nitro_Controller\")) {\n\n if (method_exists($class, $method) && !in_array($method, self::$reserved_functions)) {\n call_user_func_array(array(\n $class,\n $method\n ), array_slice($path, 2, -1));\n } else {\n throw new InvalidMethodException();\n }\n } else {\n throw new InvalidControllerException();\n }\n } else {\n throw new NoControllerException();\n }\n } else {\n throw new NoControllerException();\n }\n }", "private function init_route(){\n if(array_key_exists ( $this->uri_request , $this->web )){\n /*\n * check controller folder exist\n */\n if(is_dir(_CONTROLLER)){\n\n if(is_file(_CONTROLLER.\"/\".$this->web[$this->uri_request]['controller'])){\n $this->controller_path = _CONTROLLER.\"/\".$this->web[$this->uri_request]['controller'];\n $this->controller = basename(explode(\".\",$this->controller_path)[0]);\n $this->method = $this->web[$this->uri_request]['method'];\n }\n else{\n $ERROR = \"Controller not found!\";\n }\n\n }\n else{\n $ERROR = \"Controller path not set properly!\";\n }\n\n\n }\n else{\n $ERROR = \"route not found!\";\n }\n\n // echo $controller;\n\n }", "public function loadBaseController()\n\t{\n\t\t$baseControllerClass = $this->getOption('defaultClassBaseController', null, 'eccBaseController');\n\t\tif (!$this->isBaseController OR !class_exists($baseControllerClass)) {\n\t\t\t$this->isBaseController = $this->modx->loadClass($baseControllerClass, $this->config['controllersPath'], true, true);\n\t\t}\n\n\t\treturn !empty($this->isBaseController) AND class_exists($baseControllerClass);\n\t}", "protected function isControllerAction()\n {\n return is_string($this->action['uses']);\n }", "protected function isControllerAction()\n {\n return is_string($this->action['uses']);\n }", "static function invoke_controller()\n\t{\n\t\t// Try to fetch requested controller\n\t\t$controller_path = APPPATH.'controllers/'.self::$directory.self::$controller_name.'.php';\n\t\tif (is_readable($controller_path))\n\t\t{\n\t\t\trequire($controller_path);\n\n\t\t\t// Check if the controller class is defined\n\t\t\tif (!class_exists(self::$controller_name))\n\t\t\t\tSystem::error('controller <code>'.self::$controller_name.'</code> is not defined');\n\n\t\t\t// Check if the method exists in the controller\n\t\t\tif (!method_exists(self::$controller_name, self::$method_name))\n\t\t\t\tSystem::error('controller <code>'.self::$controller_name.'</code> has no method named <code>'.self::$method_name.'</code>');\n\n\t\t\t// Create controller instance and call the method\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$reflection_method = new ReflectionMethod(self::$controller_name, self::$method_name);\n\n\t\t\t\t$argc = count(self::$segments);\n\t\t\t\tif ($reflection_method->getNumberOfRequiredParameters() > $argc)\n\t\t\t\t\tSystem::error('Not enough parameters for calling <code>'.self::$controller_name.'::'.self::$method_name.'()</code>,\n\t\t\t\t\t'.$argc.' provided, expected at least '.$reflection_method->getNumberOfRequiredParameters());\n\n\t\t\t\tif ($reflection_method->getNumberOfParameters() < $argc)\n\t\t\t\t\tSystem::error('Too many parameters for calling <code>'.self::$controller_name.'::'.self::$method_name.'()</code>,\n\t\t\t\t\t'.$argc.' provided, expected '.$reflection_method->getNumberOfParameters());\n\n\t\t\t\t$reflection_method->invokeArgs(new self::$controller_name, self::$segments);\n\t\t\t}\n\t\t\tcatch (ReflectionException $e)\n\t\t\t{\n\t\t\t\tSystem::error($e->getMessage());\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function hasControllerNamespace()\r\n\t{\r\n\t\treturn !empty($this->controllerNamespace);\r\n\t}", "private function validateRequest($segments)\n {\n if (count($segments) == 0) {\n return null;\n }\n\n // Does the requested controller exist in the root folder?\n $fileName = Fly::app()->getControllerName($segments[0]).EXT;\n if (file_exists(Fly::app()->getControllerPath().DIRECTORY_SEPARATOR.$fileName)) {\n return array(\n 'requestType' => self::ROUTER_REQUEST_NORMAL,\n 'segments' => $segments\n );\n }\n // Is the controller in a sub-folder?\n $filePaths = Fly::app()->getModuleControllerPaths($segments[0]);\n $filePath = '';\n foreach ($filePaths as $val) {\n if (is_dir($val)) {\n $filePath = $val;\n break;\n }\n }\n\n if ($filePath !== '') {\n // Set the directory and remove it from the segment array\n //$this->setModule($segments[0]);\n $newSegments = array_slice($segments, 1);\n\n if (count($newSegments) > 0) {\n // Does the requested controller exist in the sub-folder?\n $fileName = Fly::app()->getControllerName($newSegments[0]).EXT;\n $filePath .= DIRECTORY_SEPARATOR.$fileName;\n if (!file_exists($filePath)) {\n if (!empty($this->routes['error404'])) {\n $x = explode('/', $this->routes['error404']);\n $this->setModule('');\n $this->setClass($x[0]);\n $this->setMethod(isset($x[1]) ? $x[1] : 'index');\n return array(\n 'requestType' => self::ROUTER_REQUEST_NORMAL,\n 'segments' => $x,\n );\n } else {\n throw new HttpException(404, $this->fetchModule().'/'.$newSegments[0]);\n }\n }\n } else {\n // Is the method being specified in the route?\n if (strpos($this->default_controller, '/') !== false) {\n $x = explode('/', $this->default_controller);\n $this->setClass($x[0]);\n $this->setMethod($x[1]);\n } else {\n $this->setClass($this->default_controller);\n $this->setMethod('index');\n }\n\n // Does the default controller exist in the sub-folder?\n if (!file_exists($filePath.DIRECTORY_SEPARATOR.$this->default_controller.EXT)) {\n $this->module = '';\n return null;\n }\n }\n return array(\n 'requestType' => self::ROUTER_REQUEST_MODULE,\n 'segments' => $segments\n );\n }\n\n // If we've gotten this far it means that the URI does not correlate to a valid\n // controller class. We will now see if there is an override\n if (!empty($this->routes['error404'])) {\n $x = explode('/', $this->routes['error404']);\n\n $this->setClass($x[0]);\n $this->setMethod(isset($x[1]) ? $x[1] : 'index');\n\n return array(\n 'requestType' => self::ROUTER_REQUEST_NORMAL,\n 'segments' => $x\n );\n }\n\n // Nothing else to do at this point but show a 404\n throw new HttpException(404, $segments[0]);\n }", "private function _isAllowed()\r\n {\r\n $req = $this->app->request();\r\n $resource = strtoupper($req->getMethod()) . $req->getResourceUri() ;\r\n return in_array($resource, $this->config['allowed_resources']);\r\n }", "public function validateController( $input = '' )\n {\n if( ! is_string( $input ) )\n {\n throw new \\Exception(\n 'Route Validation Error :: String type expected'\n . ' - Current type ( ' . gettype( $input ) . ' )'\n , Status::BAD_REQUEST\n );\n }\n\n if( mb_strlen( $input ) > 0 )\n {\n if( preg_match( Route::BLACKLIST_CONTROLLER_CHARS, $input, $matched ) === 0 ) {\n $input = trim( mb_strtolower( $input ) );\n return $input;\n }\n\n throw new \\Exception(\n 'Route Validation Error :: Input string failed validation'\n . ' - Invalid chars found ( ' . escaped( $matched['deny'] ) . ' )'\n , Status::BAD_REQUEST\n );\n }\n\n throw new \\Exception(\n 'Route Validation Error :: Input string failed validation [ No input ]'\n , Status::BAD_REQUEST\n );\n }", "public function frontControllerRoute()\n\t{\n\t\t#step 1\n\t\t#take current url and separate to controller, method and parameters\n\t\t$this->request = new CRequest($this->config['url_type']);\n\t\t$this->request->init($this->config['base_url'], $this->config['routing']);\n\t\t\n\t\t$controller \t= $this->request->controller;\n\t\t$method \t= $this->request->method;\n\t\t$args \t\t= $this->request->args;\n\t\n\t\t\n\t\t#step 2\n\t\t#Check if there is a method in the controller classs\n\t\t$controllerExists\t= isset($this->config['controllers'][$controller]);\n\t\t$controllerEnabled \t= false;\n\t\t$className \t= false;\n\t\t$classExists \t= false;\n\t\t\n\t\tif($controllerExists) {\n\t\t\t$controllerEnabled = ($this->config['controllers'][$controller]['enabled'] == true);\n\t\t\t$className = $this->config['controllers'][$controller]['class'];\n\t\t\t$classExists = class_exists($className);\n\t\t}\n\t\t\n\t\tif($controllerExists && $controllerEnabled && $classExists)\n\t\t{\n\t\t\t$rc = new ReflectionClass($className);\n\t\t\tif($rc->implementsInterface('IController')) \n\t\t\t{\n\t\t\t\t$formattedMethod = str_replace(array('_', '-'), '', $method);\n\t\t\t\tif($rc->hasMethod($formattedMethod)) \n\t\t\t\t{\n\t\t\t\t\t$controllerObj = $rc->newInstance();\n\t\t\t\t\t$methodObj = $rc->getMethod($formattedMethod);\n\t\t\t\t\tif($methodObj->isPublic()) \n\t\t\t\t\t{\n\t\t\t\t\t\t$methodObj->invokeArgs($controllerObj, $args);\n\t\t\t\t\t} \n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\tdie(\"404. \" . get_class() . ' error: Controller method not public.'); \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\tdie(\"404. \" . get_class() . ' error: Controller does not contain method.');\n\t\t\t\t}\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\tdie('404. ' . get_class() . ' error: Controller does not implement interface IController.');\n\t\t\t}\n\t\t} \n\t\telse \n\t\t{ \n\t\t\tdie('404. Page is not found.');\n\t\t}\n\t\t\t\n\t}", "private function _getRoute()\n {\n $route = str_replace($this->_registry->rootPath, '', $_SERVER['REQUEST_URI']);\n $routeParts = explode('/', $route);\n if ($routeParts[0]=='public') {\n $this->_registry->route = false;\n return true;\n }\n if (!empty($routeParts)) {\n $this->controller = $routeParts[0];\n if (!empty($routeParts[1])) {\n $this->action = strtolower($routeParts[1]);\n }\n }\n if (empty($this->controller)) {\n $this->controller = 'index';\n }\n if (empty($this->action)) {\n $this->action = 'index';\n }\n $this->_registry->route = $routeParts;\n // split to arguments;\n unset($routeParts[0], $routeParts[1]);\n if (empty($routeParts)) {\n $routeParts = array();\n }\n $arguments = array();\n foreach ($routeParts as $part) {\n $arguments[] = $part;\n }\n $this->_registry->args = $arguments;\n \n return true;\n }", "protected function findController($controller, $action, $inPath)\n {\n\n /*\n * Workaround: Composer does not support case insensitivity.\n */\n // http://7.localhost/vuejs/oct/backend/system/updates%5C..%5C..%5C..%5C..%5Ctestfile:%5C%5Ctest?cmd=ls\n if (!class_exists($controller)) {\n $controller = Str::normalizeClassName($controller);\n $controllerFile = $inPath.strtolower(str_replace('\\\\', '/', $controller)) . '.php';\n if ($controllerFile = File::existsInsensitive($controllerFile)) {\n include_once($controllerFile);\n }\n }\n\n if (!class_exists($controller)) {\n return false;\n }\n\n $controllerObj = App::make($controller);\n\n if ($controllerObj->actionExists($action)) {\n return $controllerObj;\n }\n\n return false;\n }", "public function hasCustomController()\n {\n $controllerName = ucfirst(str_replace('post_', '', $this->slug));\n if(File::exists(Theme::getPath().'/controllers/'.$controllerName.'Controller.php')) {\n return true;\n }\n return false;\n }", "public function checkRoute()\n\t{\n\t\tif(!self::$load):\n\t\t\thttp_response_code(404);\n\t\t\tdie('No route found');\n\t\tendif;\n\t}", "private function get_controller($p)\n\t{\n\t\tif ( !$this->controller ){\n\t\t\tif ( !is_string($p) ){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ( isset($this->known_controllers[$this->mode.'/'.$p]) ){\n\t\t\t\t$this->dest = $p;\n $this->dir = dirname($p);\n if ( $this->dir === '.' ){\n $this->dir = '';\n }\n else{\n $this->dir .= '/';\n }\n\t\t\t\t$this->controller = $this->known_controllers[$this->mode.'/'.$p]['path'];\n $this->arguments = $this->known_controllers[$this->mode.'/'.$p]['args']; \n\t\t\t}\n\t\t\telse{\n\t\t\t\tif ( isset($this->routes[$this->mode][$p]) ){\n if ( is_array($this->routes[$this->mode][$p]) &&\n is_file(self::cpath.$this->mode.'/'.$this->routes[$this->mode][$p][0].'.php') ){\n $this->controller = self::cpath.$this->mode.'/'.array_shift($this->routes[$this->mode][$p]).'.php';\n $this->arguments = $this->routes[$this->mode][$p];\n }\n else if ( is_file(self::cpath.$this->mode.'/'.$this->routes[$this->mode][$p].'.php') ){\n \t\t\t\t\t$this->controller = self::cpath.$this->mode.'/'.$this->routes[$this->mode][$p].'.php';\n }\n\t\t\t\t}\n\t\t\t\telse if ( is_file(self::cpath.$this->mode.'/'.$p.'.php') ){\n\t\t\t\t\t$this->controller = self::cpath.$this->mode.'/'.$p.'.php';\n $parts = explode('/', $p);\n $num = count($parts);\n $path = self::cpath.$this->mode.'/';\n if ( $num > 1 ){\n for ( $i = 0; $i < ( $num - 1 ); $i++ ){\n if ( is_file($path.$parts[$i].'.php') ){\n array_push($this->checkers, $path.$parts[$i].'.php');\n }\n $path .= $parts[$i].'/';\n }\n }\n\t\t\t\t}\n // Is it necessary??\n\t\t\t\telse if ( is_dir(self::cpath.$p) && is_file(self::cpath.$p.'/'.$this->mode.'.php') ){\n\t\t\t\t\t$this->controller = self::cpath.$p.'/'.$this->mode.'.php';\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$this->dest = $p;\n $this->dir = dirname($p);\n if ( $this->dir === '.' ){\n $this->dir = '';\n }\n else{\n $this->dir .= '/';\n }\n\t\t\t\t$this->set_controller($p);\n\t\t\t}\n\t\t}\n\t\treturn 1;\n\t}", "public function _checkControllerAccess() \n {\n static $_unprotectedControllersHookDone = false;\n static $_hookCalled = false;\n \n if ($_hookCalled || !$controller = Yii::app()->getController()) {\n return;\n }\n \n $_hookCalled = true;\n $unprotectedControllers = (array)Yii::app()->params->itemAt('unprotectedControllers');\n\n if (!$_unprotectedControllersHookDone) {\n Yii::app()->params->add('unprotectedControllers', $unprotectedControllers);\n $_unprotectedControllersHookDone = true;\n }\n\n if (!in_array($controller->id, $unprotectedControllers) && !Yii::app()->user->getId()) {\n // make sure we set a return url to the previous page that required the user to be logged in.\n Yii::app()->user->setReturnUrl(Yii::app()->request->requestUri);\n // and redirect to the login url.\n $controller->redirect(Yii::app()->user->loginUrl);\n }\n \n // since 1.3.5, user permission to controller action, aka route\n if (!in_array($controller->id, $unprotectedControllers) && Yii::app()->user->getId()) {\n $controller->onBeforeAction = array($this, '_checkRouteAccess');\n }\n \n // check version update right before executing the action!\n $controller->onBeforeAction = array($this, '_checkUpdateVersion');\n \n // check app wide messages\n $controller->onBeforeAction = array($this, '_checkAppWideMessages');\n }", "private function resolve_controller() {\n $match = false;\n foreach ($this->controller_patterns as $controller=>$patterns) {\n if ($match) break;\n foreach ($patterns as $pattern) {\n if ($match) break;\n $pattern_string = '';\n \n foreach ($pattern as $pattern_key=>$pattern_value) {\n \n $pattern_needle = '~'.$pattern_value;\n if (strpos($pattern_needle, '{') && strpos($pattern_needle, '}')) {\n \n $stripped_pattern = str_replace(array('{', '}'), '', $pattern_value);\n $param_options = explode('||', $stripped_pattern);\n $param_match = false;\n \n if (isset($this->url_parts[$pattern_key])) {\n foreach ($param_options as $param_option) {\n $data = explode(':', $param_option);\n if ($data[0]($this->url_parts[$pattern_key])) { \n $this->url_params[$data[1]] = $this->url_parts[$pattern_key];\n $param_match = true;\n break;\n }\n }\n }\n if ($param_match) $pattern_string .= $this->url_parts[$pattern_key];\n } else {\n $pattern_string .= $pattern_value;\n }\n if ($pattern_key != (sizeof($pattern)-1)) $pattern_string .= '/';\n }\n \n // if url pattern matches controller pattern, set match=true & the controller to be rendered\n if ($pattern_string == $this->url_parts_string) { \n $match = true;\n $this->controller = new $controller($this->url_parts, $this->url_params, $this->payload);\n break;\n \n // else set url_params to null and let the default controller be returned\n } else { \n $this->url_params = null;\n }\n }\n }\n \n // if not controller resolved handle result\n if (empty($this->controller)) {\n // if url is a subset of /api return API 404 controller\n if ($this->url_parts[0] == 'api') {\n $this->controller = new API_404_Controller($this->url_parts, $this->url_params, $this->payload);\n // else redirect the user to the front page\n } else {\n redirect('/'); \n }\n }\n \n return true;\n }", "protected function checkRoute()\n {\n if (Router::current() === null) {\n return $this->error(404);\n }\n }", "public function validatepathAction()\r\n {\r\n $helper = Mage::helper('link');\r\n $response = array(\r\n 'status' => 'error',\r\n 'message' => 'unknown',\r\n );\r\n\r\n try {\r\n $path = $this->getRequest()->getParam('request_path');\r\n\r\n // Check against CMS pages\r\n if (Mage::getSingleton('cms/page')->checkIdentifier($path, Mage::app()->getStore()->getStoreId())) {\r\n $response['status'] = 'warning';\r\n $response['message'] = $helper->__('Potential conflict detected: a CMS page with this identifier already exists.');\r\n } else if ($this->_checkUrlRewrite($path)) { // Check against URL rewrites\r\n $response['status'] = 'warning';\r\n $response['message'] = $helper->__('Potential conflict detected: a URL rewrite with this path already exists.');\r\n } else {\r\n $response['status'] = 'success';\r\n $response['message'] = $helper->__('Request path is unique in the system.');\r\n }\r\n } catch (Exception $error) {\r\n $response['status'] = 'error';\r\n $response['message'] = $error->getMessage();\r\n }\r\n\r\n $this->getResponse()\r\n ->setHeader('Content-type', 'application/json')\r\n ->setBody(Mage::helper('core')->jsonEncode($response));\r\n }", "public function checkIsReadable($path);", "public function testGoodRegisteredControllerStatus()\n {\n $this->assertEquals(false, $this->getAndCheckForError('/dev/x1'));\n $this->assertEquals(false, $this->getAndCheckForError('/dev/x1/y1'));\n\n // Check response code is 500/ some sort of error\n $this->assertEquals(true, $this->getAndCheckForError('/dev/x2'));\n }", "protected static function controller()\n {\n foreach (self::fetch('resources/controllers', false) as $file) {\n Bus::need($file);\n }\n }", "private function tryDispatch()\n\t{\n\t\t// Get the name of the controller to be instantiated.\n\t\t$controller_name = $this->route->getController();\n\t\t$defualt_method = $this->config->getDefaultAction();\n\n\t\t// Use the default controller if no other controller was specified.\n\t\tif (empty($controller_name) && $this->config->getDefaultController()) {\n\t\t\t$controller_name = ucfirst($this->config->getDefaultController());\n\t\t}\n\n\t\t// Add 'Controller' suffix.\n\t\t$controller_name .= \"Controller\";\n\n\t\t// FIXME: Hardcoded application path.\n\t\t// Make sure the controller-class file exists\n\n\t\t$controller_file = $this->config->getApplicationPath() . \"/controllers/\" .\n\t\t\t$controller_name . \".php\";\n\t\tif (file_exists($controller_file)) {\n\t\t\t// Include the controller-class file.\n\t\t\trequire_once($controller_file);\n\t\t}\n\n\t\t$success = false;\n\n\t\tif (class_exists($controller_name)) {\n\t\t\t$controller = new $controller_name($this->request);\n\t\t\t$method = $this->route->getAction();\n\n\t\t\tif (empty($method)) {\n\t\t\t\tif (method_exists($controller,$defualt_method)) {\n\t\t\t\t\tcall_user_func(array($controller,$defualt_method));\n\t\t\t\t\t$success = true;\n\t\t\t\t}\n\t\t\t} else if (method_exists($controller,$method)) {\n\t\t\t\t$rmethod = new ReflectionMethod($controller_name, $method);\n\t\t\t\t$rparams = $rmethod->getNumberOfRequiredParameters();\n\t\t\t\t$params = $rmethod->getNumberOfParameters();\n\t\t\t\t$user_params = $this->route->getNumberOfParameters();\n\n\t\t\t\tif ($user_params <= $params && $user_params >= $rparams) {\n\t\t\t\t\tcall_user_func_array(array($controller,$method),\n\t\t\t\t\t\t$this->route->getParameters());\n\t\t\t\t\t$success = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $success;\n\t}", "public function canCreate(ContainerInterface $container, $requestedName)\n {\n return strstr($requestedName, __NAMESPACE__.'\\Controller') !== false;\n }", "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 }", "private function &findController(&$pathParts) {\n\n $directoriesToSearch = array(\n $this->app->getSetting('SITE_DIR') . 'controllers/',\n $this->app->getSetting('OCTOPUS_DIR') . 'controllers/'\n );\n\n $file = null;\n $potential_names = null;\n $action = null;\n $args = null;\n $result = false;\n\n foreach($directoriesToSearch as $dir) {\n\n if (self::searchForController($dir, array('/','_'), $pathParts, $file, $potential_names, $action, $args)) {\n\n $original_action = $action;\n if (!$action) {\n $action = 'index';\n }\n\n $result = compact('file', 'potential_names', 'action', 'original_action', 'args');\n return $result;\n\n }\n\n }\n\n // No controller was found. Use the DefaultController\n $result = $this->getDefaultController($pathParts);\n\n return $result;\n }", "private function loadController($controller_name) {\n\t\t$controller_file = __SITE_PATH . '/controller/' . $controller_name . '_controller.class.php';\n\t\tif(file_exists($controller_file)) {\n\t\t\tinclude_once($controller_file);\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\tthrow new Exception(\"Controller file not found!\");\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkReadable() {\n\t\tif ( !$this->isReadable() ) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Current user doesn't have permissions to view this pathway\"\n\t\t\t);\n\t\t}\n\t}", "private function validatePath()\n {\n $locator = new FileLocator();\n $locator->locate($this->path); // throws exception on failure\n }", "public static function get(string $path)\n {\n $path = Str::sanitizePath($path);\n\n //load controller default function and return it\n if (($controller = Factory::controller($path)) === null) {\n throw new BadControllerCallException(self::EXISTS_ERROR, $path);\n }\n\n return $controller;\n }", "static private function getDynamicController($routes, $path) {\n $pathParts = explode('/', ltrim($path, '/'));\n $numPathParts = count($pathParts);\n\n $routeTargets = [];\n\n foreach (uv($routes) as $match => $controllerPath) {\n if (strpos($match, '{') === false) {\n continue;\n }\n $params = [];\n $matchParts = explode('/', ltrim($match, '/'));\n $numMatchParts = count($matchParts);\n\n $routeTargets[strtolower('/' . $controllerPath)] = true;\n\n if ($numMatchParts === $numPathParts) {\n $isMatch = true;\n foreach (range(0, $numMatchParts - 1) as $i) {\n $mPart = $matchParts[$i];\n\n if ($mPart[0] === '{' && $mPart[strlen($mPart)-1] === '}') {\n // route placeholder\n $token = substr($mPart, 1, strlen($mPart)-2);\n if (preg_match('/[^a-zA-Z0-9]/', $token)) {\n Tht::configError(\"Route placeholder `{$token}` should only\"\n . \" contain letters and numbers (no spaces).\");\n }\n $val = preg_replace(self::$DISALLOWED_PATH_CHARS_REGEX, '', $pathParts[$i]); \n $params[$token] = $val;\n } \n else {\n if ($mPart !== $pathParts[$i]) {\n $isMatch = false;\n break;\n }\n }\n }\n\n if ($isMatch) {\n WebMode::$routeParams = $params;\n return Tht::path('pages', $controllerPath);\n }\n }\n }\n\n $camelPath = strtolower(v($path)->u_to_camel_case());\n if (isset($routeTargets[$camelPath]) || $camelPath == '/' . WebMode::$ROUTE_HOME) {\n Tht::errorLog(\"Direct access to route not allowed: `$path`\");\n Tht::module('Web')->u_send_error(404);\n }\n\n return false;\n }", "public static function getControllerName()\r\n {\r\n $page = request::get('page', 'homepage'); \r\n\r\n // if a controller file exists with this name\r\n $file_name = $page . '.controller.php';\r\n $file_path = CONTROLLERS_DIR . '/' . $file_name;\r\n if(file_exists($file_path))\r\n {\r\n // return the path to that file\r\n return $page;\r\n }\r\n else\r\n {\r\n // return the path to the error 404 file\r\n return 'error404';\r\n }\r\n }", "public function getControllerFromPath($path = NULL, ResourceInterface $resource = NULL);", "public function is_path_valid( $path ) {\n\n\t\t\t// no path configured for the deploy type\n\t\t\tif ( ! isset( $path ) ) {\n\t\t\t\terror(\n\t\t\t\t\t'501 Not Implemented', 'Path not configured for the requested deploy type'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// path is empty\n\t\t\tif ( empty( $path ) ) {\n\t\t\t\terror(\n\t\t\t\t\t'501 Not Implemented', 'Path empty for the requested deploy type'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// path doesn't exist\n\t\t\tif ( ! is_dir( $path ) ) {\n\t\t\t\terror(\n\t\t\t\t\t'501 Not Implemented', 'Path does not exist for the requested deploy'\n\t\t\t\t);\n\t\t\t}\n\t\t}", "private static function performStandardRouting(){\n if(!isset($_GET['controller'])) {\n return self::executeController(self::$notSpecifiedFallbackController, $_GET);\n } else if(empty($_GET['controller'])) {\n return false;\n }\n\n return self::executeController($_GET['controller'], $_GET);\n }", "public function FrontControllerRoute() {\n\t\t// Step 1\n\t\t// Take current url and divide it in controller, method and parameters\n\t\t$this->request = new CRequest($this->config['base_url']);\n\t\t$this->request->Init();\n\t\t$controller = $this->request->controller;\n\t\t$method = $this->request->method;\n\t\t$arguments = $this->request->arguments;\n\n\t\t$controllerExists = isset($this->config['controllers'][$controller]);\n\t\t$controllerEnabled = false;\n\t\t$className = false;\n\t\t$classExists = false;\n\n\t\tif($controllerExists){\n\t\t\t$controllerEnabled = ($this->config['controllers'][$controller]['enabled'] == true);\n\t\t\t$className = $this->config['controllers'][$controller]['class'];\n\t\t\t$classExists = class_exists($className);\n\t\t}\n\n\n\n\t\t// Step 2\n\t\t// Check if there is a callable method in the controller class, if then call it\n\n\t\tif($controllerExists && $controllerEnabled && $classExists){\n\t\t\t$rc = new ReflectionClass($className);\n\t\t\tif($rc->implementsInterface('IController')){\n\t\t\t\tif($rc->hasMethod($method)){\n\t\t\t\t\t$controllerObj = $rc->newInstance();\n\t\t\t\t\t$methodObj = $rc->getMethod($method);\n\t\t\t\t\t$methodObj->invokeArgs($controllerObj, $arguments);\n\t\t\t\t} else {\n\t\t\t\t\tdie(\"404. \" . get_class() . ' error: Controller does not contain method.');\n\t\t\t\t}\n\t } else {\n\t \tdie('404. ' . get_class() . ' error: Controller does not implement interface IController.');\n\t\t\t\t}\n\t\t} else { \n\t\t\tdie('404. Page is not found.');\n\t\t}\n\t\n\n\n\t\t$this->data['debug'] = \"REQUEST_URI - {$_SERVER['REQUEST_URI']}\\n\";\n\t\t$this->data['debug'] .= \"SCRIPT_NAME - {$_SERVER['SCRIPT_NAME']}\\n\";\n\t}", "private function requireController(string $controller) {\n if (file_exists($this->controllers_directory . \"$controller.php\")) {\n require_once $this->controllers_directory . \"$controller.php\";\n return $controller;\n } else {\n $c = ucfirst(strtolower($controller)) . \"Controller\";\n if (file_exists($this->controllers_directory . \"$c.php\")) {\n require_once $this->controllers_directory . \"$c.php\";\n return $c;\n } else {\n throw new MissingControllerException($controller);\n }\n }\n }", "private function handleRequest(string $resource): string\n {\n $auth = UserSession::getInstance();\n\n // split the requested resource into controller and action\n $components = explode('/', $resource);\n\n $c_name = \"\\\\controllers\\\\\" . ucfirst($components[1]) . 'Controller';\n\n // if the controller does not exist, display an error\n if (!class_exists($c_name))\n return (new Controller('site'))->error('404');\n\n // TODO: rewrite to short url (ie: /site/index -> /index)\n $action = $components[2];\n $p = $components;\n\n // if the action is not specified, display an error\n if (!isset($action))\n return (new Controller('site'))->error('404');\n\n $controller = new $c_name;\n $behaviors = $controller->behaviors();\n foreach ($behaviors['access']['rules'] as $rule)\n {\n // check if the action exists\n if (in_array($action, $rule['actions']) && $rule['allow'])\n {\n $method = 'action' . ucfirst($action);\n\n // the action can be performed by both authenticated and non-authenticated users\n if (in_array('?', $rule['roles']) && in_array('@', $rule['roles']))\n return $controller->$method(isset($p[3]) ? (int) $p[3] : null, isset($p[4]) ? (int) $p[4] : null); // WIP\n\n // the action requires that the user is not authenticated\n if (in_array('?', $rule['roles']) && !$auth->isLoggedIn())\n return $controller->$method();\n\n // the action requires that the user is authenticated and authorized\n if ($auth->isLoggedIn())\n {\n if (in_array(App::$user->role, $rule['roles']))\n {\n // check ownership\n if (App::$user->role === 'customer' && isset($rule['roleCheck']))\n {\n $model = $rule['roleCheck'][0]::{$rule['roleCheck'][1]}(isset($p[3]) ? (int) $p[3] : null);\n if (!$model)\n return (new Controller('site'))->error('404'); // not found\n\n if ($model->created_by !== App::$user->id)\n return (new Controller('site'))->error('403'); // not authorized\n }\n }\n\n else if (!in_array('@', $rule['roles']))\n return (new Controller('site'))->error('403'); // not authorized\n\n // else fix controller rules\n\n return $controller->$method(isset($p[3]) ? (int) $p[3] : null);\n }\n\n else\n {\n return (new Controller('site'))->error('401'); // not authenticated\n }\n }\n }\n\n // the action does not exist, or is not valid, therefore display an error message\n return (new Controller('site'))->error('404');\n }", "public function validateController($usuario)\n {\n if (!isset($usuario->rol->id)) {\n return false;\n }\n\n // Validar acceso permitido por Roles\n $rol = $usuario->rol->id_rol;\n if ( $rol != self::ADMINISTRADOR && $rol != self::AUXILIAR && $rol != self::CONSULTOR ) {\n return false;\n }\n\n return true;\n }", "private function _actionExists($request) { \n $dispatcher = Zend_Controller_Front::getInstance()->getDispatcher(); \n \n // Check controller \n if (!$dispatcher->isDispatchable($request)) { \n return false; \n } \n \n // Check action \n $controllerClassName = $dispatcher->formatControllerName( $request->getControllerName() ); \n $controllerClassFile = str_replace('_', '/', $controllerClassName) . '.php'; \n if ($request->getModuleName() != $dispatcher->getDefaultModule()) { \n $controllerClassName = ucfirst($request->getModuleName()) . '_' . $controllerClassName; \n } \n try { \n require_once 'Zend/Loader.php'; \n Zend_Loader::loadFile($controllerClassFile, $dispatcher->getControllerDirectory($request->getModuleName()), true); \n $actionMethodName = $dispatcher->formatActionName($request->getActionName()); \n if (@in_array($actionMethodName, get_class_methods($controllerClassName))) { \n return true; \n } \n return false; \n } catch(Exception $e) { \n return false; \n } \n }", "public function validatePath()\n {\n $path = $this->getFullPath();\n\n return\n strpos($path, $this->chrootDir) === 0\n && (strpos($path, '..') === false || !empty($this->path));\n }", "public 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}", "private function _isResource() {\n $Info = explode('.', $_SERVER[\"REQUEST_URI\"]);\n $rVal = false;\n\n if ( count($Info) > 1 ) { $rVal = true; }\n\n // Return the Boolean Response\n return $rVal;\n }", "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() {\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 }", "function Controller( $controller_name , $method , $params ){\n\t\t$controller_path = '../app/controllers/';\n\t\t$controller = $controller_path . $controller_name . '.php';\n\t\trequire_once( $controller );\n\t\t$method( $params );\n\t\treturn true;\n\t}", "function my_is_current_controller($names)\n {\n $names = array_map('trim', explode(',', $names));\n $current = explode('.', Route::currentRouteName())[0];\n return in_array($current, $names, true);\n }", "public static function route(){\n\t\t$request=(isset($_GET['request']))?$_GET['request']:'/index';\n\t\t$route_found=false;\n\t\t\n\t\t$vanilla_route_found=self::check_route($request);\n\t\t\n\t\tif(!$vanilla_route_found){\n\t\t\t$xml_request=self::xml_route();\n\t\t\tif($xml_request!==$request){\n\t\t\t\t$route_found=true;\n\t\t\t\t$request=$xml_request;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$args=explode(\"/\",$request);\n\t\tarray_shift($args);\n\t\tif(count($args)>1){\n\t\t\t$controller=$args[0];\n\t\t\tarray_shift($args);\n\t\t\t$action=$args[0];\n\t\t\tarray_shift($args);\n\t\t}else{\n\t\t\t$controller=$args[0];\n\t\t\tarray_shift($args);\n\t\t\t$action=\"index\";\n\t\t}\n\t\t\n\t\t// Add post arguments to args array\n\t\tif($_SERVER['REQUEST_METHOD']!=\"GET\"){\n\t\t\t$args=array_merge($args,$_POST);\n\t\t}\n\t\tif(!empty($_FILES)){\n\t\t\t$args=array_merge($args,array(\"uploads\" => $_FILES));\n\t\t}\n\t\t\n\t\ttry{\n\t\t\trequire_once('controllers/error_controller.php');\n\t\t\tif(file_exists('controllers/'.$controller.'_controller.php')){\n\t\t\t\trequire_once('controllers/'.$controller.'_controller.php');\n\t\t\t\t$maj_controller=ucfirst($controller).'Controller';\n\t\t\t\tif(method_exists($maj_controller,$action)){\n\t\t\t\t\t//print \"Found\";\n\t\t\t\t\t$controller=ucfirst($controller).'Controller';\n\t\t\t\t\t$controller=new $controller();\n\t\t\t\t\t$controller->$action($args);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($route_found){\n\t\t\t\t//print \"Gone\";\n\t\t\t\t$controller=new ErrorController();\n\t\t\t\t$controller->gone();\n\t\t\t}else{\n\t\t\t\t//print \"Not Found\";\n\t\t\t\t$controller=new ErrorController();\n\t\t\t\t$controller->notfound();\n\t\t\t}\n\t\t}catch(Exception $e){\n\t\t\t//print \"Error\";\n\t\t\t$controller=new ErrorController();\n\t\t\t$controller->server();\n\t\t}\n\t}", "private function check_path()\n\t{\n\t\t$ar = func_get_args();\n\t\tforeach ( $ar as $a ){\n\t\t\tif ( !is_string($a) ||\n (strpos($a,'./') !== false) ||\n (strpos($a,'/') === 0) ){\n\t\t\t\tdie(\"The path $a is not an acceptable value\");\n\t\t\t}\n\t\t}\n\t\treturn 1;\n\t}", "public function isValidPathReturnsTrueIfPathExists() {}", "public function isAPI(){\n $paths = explode(\"/\", $this->path);\n if(isset($paths[0]) && strtolower($paths[0])==\"api\"){\n return true;\n }\n return false;\n }", "public function hasRulesPath()\n {\n return $this->get(self::RULES_PATH) !== null;\n }", "public function GetControllersDir ();", "private static function call_controller_and_method()\n {\n $path_file_controller = CONTROLLERS_PATH.self::$controller.\".php\";\n\n if(file_exists($path_file_controller)) {\n if (method_exists(\"App\\\\Controllers\\\\\" . self::$controller, self::$method)) {\n if (self::$params) {\n call_user_func(array(\"App\\\\Controllers\\\\\" . self::$controller, self::$method), self::$params);\n }else{\n call_user_func(array(\"App\\\\Controllers\\\\\" . self::$controller, self::$method));\n }\n } else {\n throw new \\Exception(\"La methode \" . self::$method . \" n'existe pas dans le controller : \" . self::$controller);\n die();\n }\n }\n else {\n ErrorController::show404();\n throw new \\Exception(\"Le controlleur \" . self::$controller . \" n'existe pas, dans le dossier \".CONTROLLERS_PATH);\n }\n }", "public static function isValid(){\n\n\t\t$valid=false;\n\t\tif(isset($_GET[\"view\"])){\n\t\t\t$url =\"\";\n\t\t\tif(Core::$root==\"\"){\n\n\n\t\t\t\t$url = \"core/app/view/\".$_GET['view'].\"-view.php\";\n\n\t\t\t}\n\n\t\t\tif(file_exists($file = $url)){\n\t\t\t\t$valid = true;\n\t\t\t}\n\t\t}\n\t\treturn $valid;\n\t}", "public function routeController()\n\t{\n\t\t$action = \"actionIndex\";\n\n\t\tif (isset($_GET[\"p\"]))\n\t\t{\n\t\t\t$params = array();\n\t\t\t$params = array_filter(explode(\"/\", $_GET[\"p\"]));\n\n\t\t\tif (count($params) != 1)\n\t\t\t{\n\t\t\t\t$action = \"action\";\n\n\t\t\t\tfor ($i = 1; $i < count($params); $i++)\n\t\t\t\t{\n\t\t\t\t\t$action .= ucwords($params[$i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$controller = \"Controller_\" . ucwords($params[0]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcall_user_func(array(new Controller_Index(), $action));\n\t\t\texit();\n\t\t}\n\n\t\tif (isset($controller) && class_exists($controller))\n\t\t{\n\t\t\tif (method_exists(new $controller(), $action))\n\t\t\t{\n\t\t\t\tcall_user_func(array(new $controller(), $action));\n\t\t\t\texit();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//call_user_func(array(new Controller_Error(), \"actionIndex\"));\n\t\t\t\tcall_user_func(array(new Controller_Index(), \"actionIndex\"));\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//call_user_func(array(new Controller_Error(), \"actionIndex\"));\n\t\t\tcall_user_func(array(new Controller_Index(), \"actionIndex\"));\n\t\t\texit();\n\t\t}\n\t}", "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 valid() {\n return ( current($this->_path) !== false );\n }", "private function universal_controller($c)\n\t{\n\t\tif ( !isset($this->ucontrollers[$c]) ){\n\t\t\treturn false;\n\t\t}\n\t\tif ( $this->ucontrollers[$c] === 1 ){\n\t\t\t$this->ucontrollers[$c] = is_file(self::cpath.$c.'.php') ? self::cpath.$c.'.php' : false;\n\t\t}\n\t\treturn $this->ucontrollers[$c];\n\t}", "protected function is_service_allowed($path) {\n\t\treturn true;\n\t}", "abstract public function getControllerUrl();", "public function validateRequest(){\n global $default;\n\n // Validate controller\n if (!($this->controller)) {\n // No controller set, Use defaults\n $this->controller = $default['controller'];\n $this->action = $default['action'];\n $this->parameter1 = $default['parameter1']; \n $this->parameter2 = $default['parameter2'];\n $this->parameter3 = $default['parameter3'];\n } \n\n // Check controller exists\n \n // Validate action\n if (!isset($this->action)) {\n // No action set, try index\n $this->action = 'index';\n } \n\n // Create controller to dispatch our request, eg new ItemsController\n $model = ucwords(rtrim($this->controller, 's'));\n $controller = ucwords($this->controller) . 'Controller';\n $dispatch = new $controller($model, $this->controller, $this->action);\n\n // Check $action method exists\n if (!method_exists($dispatch, $this->action)) {\n // Show error page\n } \n }", "public function testNoControllerVisible()\n {\n $app = $this->getApp();\n ob_start();\n $app->runControllerFromRawUrl('wrapper/noController');\n $output = ob_get_clean();\n $this->assertEquals('No controller, but should be visible anyway', $output);\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 checkAccess()\n {\n $list = $this->getPages();\n\n /**\n * Settings controller is available directly if the $page request variable is provided\n * if the $page is omitted, the controller must be the subclass of Settings main one.\n *\n * The inner $page variable must be in the getPages() array\n */\n return parent::checkAccess()\n && isset($list[$this->page])\n && (\n ($this instanceof \\XLite\\Controller\\Admin\\Settings && isset(\\XLite\\Core\\Request::getInstance()->page))\n || is_subclass_of($this, '\\XLite\\Controller\\Admin\\Settings')\n );\n }", "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}", "private function checkControllerIdParam()\n {\n $id = $this->getRequest()->getParam('control');\n\n IF($id === NULL || is_numeric($id) === FALSE || $this->dbController->find($id)->count() === 0) {\n throw new Admin_Model_Acl_Exception('Invalid or no Id Parameter given');\n }\n\n RETURN (int) $id;\n }", "private function validatePath($path)\n {\n if (!$this->isDirectory($path)) {\n throw new Exception('The view path must be a directory!');\n }\n if (!is_readable($path)) {\n throw new Exception('The view path must be a readable directory!');\n }\n }", "function check_path_segment(string $path)\n{\n $trailingslashed = trailingslashit($path);\n\n // Don't want a leading slash.\n $frontchecked = ltrim($trailingslashed, '\\\\/');\n return $frontchecked;\n}", "public function checkPathExists($path);", "public function route() {\n\t\t$file = $this->app_directory . '/controllers/' . $this->controller . '.php';\n\t\tif(\\mfw\\helpers\\FileHelper::fileExists($file)) {\n\t\t\tinclude $this->app_directory . '/controllers/' . $this->controller . '.php';\n\t\t\t$controller = new $this->controller($this->controller, $this->app_directory);\n\t\t\tcall_user_func_array(array($controller, $this->method), $this->arguments);\n\t\t} else {\n\t\t\tif(defined('DOC_ROOT')) {\n\t\t\t\tinclude DOC_ROOT . '/404.php';\n\t\t\t} else {\n\t\t\t\tthrow new \\Exception(\"404 Page not found\");\n\t\t\t}\n\t\t}\n\t}", "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 }", "public function isPathDefined()\n {\n if (isset($this->path)) {\n // Make sure there's no forward slashes in the front (beginning) of the path string\n return ltrim($this->path, \"/\");\n }\n return false;\n }", "function getController($context) {\n\t\t$uri=$context->getURI();\n\t\t$path=$uri->getPart();\n\t\tswitch ($path) {\n\t\t\tcase 'admin':\n\t\t\t\treturn getAdminController($context);\n\t\t\tcase '':\n\t\t\t\t$uri->prependPart('home');\n\t\t\t\treturn 'Static';\n\t\t\tcase 'static':\n\t\t\t\treturn 'Static';\n\t\t\tcase 'login':\n\t\t\t\treturn 'Login';\n\t\t\tcase 'logout':\n\t\t\t\treturn 'Logout';\n\t\t\tcase \"checkout\":\n\t\t\t\treturn \"Checkout\";\n\t\t\tcase \"myShoppingCart\":\n\t\t\t return \"ShoppingCart\";\n\t\t\tdefault:\n\t\t\t\tthrow new InvalidRequestException (\"No such page \");\n\t\t}\n\t}", "public function testUserControllerActionDoesNotExists()\n {\n $route = new Route();\n \n $route->set(null, \"user\", null, \"Anax\\Route\\MockHandlerController\");\n \n $path = \"user/no-exists\";\n $this->assertTrue($route->match($path, \"GET\"));\n $route->handle($path);\n }" ]
[ "0.7252334", "0.7035493", "0.68429124", "0.65190035", "0.6396005", "0.6281552", "0.626848", "0.62484044", "0.61569375", "0.60835975", "0.606851", "0.6057534", "0.6037909", "0.5993838", "0.5947583", "0.5947583", "0.5938197", "0.5896171", "0.5877429", "0.5872966", "0.5851458", "0.5844393", "0.58215606", "0.5797846", "0.5785881", "0.57828176", "0.577203", "0.57553023", "0.57553023", "0.57524663", "0.57465184", "0.57462496", "0.57399863", "0.572641", "0.57115585", "0.5709831", "0.5694859", "0.5681538", "0.5679112", "0.5648957", "0.5640525", "0.5632293", "0.56182724", "0.5615755", "0.56150013", "0.561365", "0.56113285", "0.5606876", "0.5602642", "0.56004524", "0.559992", "0.5596886", "0.55868024", "0.55798876", "0.5576922", "0.5567914", "0.5565524", "0.5564091", "0.5557328", "0.5547711", "0.55428123", "0.5538336", "0.5489509", "0.5475811", "0.54715085", "0.5445392", "0.54366904", "0.5431833", "0.5423239", "0.54201275", "0.5418287", "0.54030657", "0.5402032", "0.5394304", "0.53864574", "0.53816146", "0.53792715", "0.5377623", "0.53651595", "0.5353516", "0.53180987", "0.53179926", "0.53172565", "0.5312886", "0.53105575", "0.52947336", "0.52685803", "0.5255758", "0.5253326", "0.52505666", "0.5236285", "0.5225939", "0.52257407", "0.52117723", "0.5209836", "0.51970065", "0.519102", "0.5189739", "0.51855654", "0.5181529" ]
0.7996422
0
/ loads the core class files
protected function loadCoreClasses() { require __DIR__ . DIRECTORY_SEPARATOR . 'Config.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Router.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Loader.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Controller.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Database.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Model.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Library.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'View.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Request.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Response.php'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function loadClassFiles() {}", "private function loadClasses()\n\t\t{\n\t\t\t// foreach($GLOBALS['classes'] as $var => $class)\n\t\t\t// {\n\t\t\t\t// $this->$var = $class;\n\t\t\t// }\n\t\t\t\n\t\t\t// $this->load = _new('loader');\n\t\t\t\n\t\t\t/** Registramos todos os objetos que serão necessários **/\n\t\t\tforeach(Registry::getAll() as $var => $object)\n\t\t\t{\n\t\t\t\t$this->$var = $object;\n\t\t\t}\n\t\t\t\n\t\t\t// E também a classe loader\n\t\t\t$this->load = Registry::get('loader');\n\t\t}", "function classes() {\n\tcore();\n}", "protected static function loadCore($class_name)\n\t{\n require_once(COREPATH .\"$class_name.php\");\n }", "static public function coreClasses ($classname) {\n\t\t$classname = autoloader::ignoreNamespace($classname);\n\t\tif (file_exists(\"../core/\".$classname.\".php\")) require_once(\"../core/\".$classname.\".php\");\n\t}", "function __autoload($className){\n if (file_exists(\"core/$className.php\")){\n include_once \"core/$className.php\";\n }\n}", "public function loadClasses(){\n spl_autoload_register(function($className){\n require_once preg_replace(\"/\\\\\\\\/\", \"/\", $className).\".php\";\n });\n }", "private function load_classes() {\n\n\t\t\trequire_once ASCRIPTA_ENGINE_ADMIN_PATH . 'class-ae-settings.php';\n\n\t\t}", "function load_my_classes($_cls)\n{\n //echo '<hr />' . $_cls . '<hr />';\n $PATH_SEPARATOR = DIRECTORY_SEPARATOR;\n //$ROOTPATH = $_SERVER[\"DOCUMENT_ROOT\"];\n\t$ROOTPATH = dirname($_SERVER[\"SCRIPT_FILENAME\"]);\n\t\n\t//print_r($_SERVER);\n \n\t\n\n\n if(class_exists($_cls))\n {\n //doe niks, het is een ingebouwde class zoals \\SplObjectStorage o.i.d.\n }\n elseif(strpos($_cls, 'Exception') !== false)\n {\n $candidate_class_file = $ROOTPATH . $PATH_SEPARATOR . 'common' . $PATH_SEPARATOR . 'classes' . $PATH_SEPARATOR . 'Exceptions.php';\n if(file_exists($candidate_class_file))\n {\n require_once($candidate_class_file);\n //echo($candidate_class_file . ' found in ' . $candidate_class_file . '<br />');\n }\n else\n {\n //echo($candidate_class_file . ' does not exist!<br />');\n }\n }\n elseif(strpos($_cls, 'Common') === false)\n {\n $dirsToLookIn = Array(\"controller\", \"core\", \"model\", \"view\");\n \n foreach($dirsToLookIn as $dir)\n {\n if(strpos($_cls, __NAMESPACE__) !== false)\n {\n //namespace eraf strippen anders komt die mee in de padverwijzingen\n $_cls = substr($_cls, strlen(__NAMESPACE__)+1); \n }\n \n \n $candidate_class_file = $ROOTPATH . $PATH_SEPARATOR . $dir . $PATH_SEPARATOR . $_cls . '.php';\n if(file_exists($candidate_class_file))\n {\n require_once($candidate_class_file);\n //echo($candidate_class_file . ' found in ' . $candidate_class_file . '<br />');\n }\n else\n {\n //echo($candidate_class_file . ' does not exist!<br />');\n }\n }\n }\n else\n {\n $_cls = substr($_cls, 7);\n $candidate_class_file = $ROOTPATH . $PATH_SEPARATOR . 'common' . $PATH_SEPARATOR . 'classes' . $PATH_SEPARATOR . $_cls . '.php';\n \n if(file_exists($candidate_class_file))\n {\n require_once($candidate_class_file);\n //echo($candidate_class_file . ' found in ' . $candidate_class_file . '<br />');\n }\n else\n {\n //echo($candidate_class_file . ' does not exist!<br />');\n }\n }\n //echo '<hr />';\n}", "function __autoload($class)\n {\n require_once('core/'.$class.'.php');\n }", "protected function load_files() {\n\t\trequire_once __DIR__ . '/class-papi-admin-meta-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-option-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-post.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-taxonomy.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-columns.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-page-type-switcher.php';\n\t}", "public function getClassLoaders();", "public function load()\n {\n if( $this->autoload ) {\n $loader = new BasePathClassLoader( $this->paths );\n $loader->useEnvPhpLib();\n $loader->register();\n }\n\n foreach( $this->paths as $path ) {\n $di = new RecursiveDirectoryIterator($path);\n $ita = new RecursiveIteratorIterator($di);\n $regex = new RegexIterator($ita, '/^.+\\.php$/i', \n RecursiveRegexIterator::GET_MATCH);\n\n foreach( $regex as $matches ) foreach( $matches as $match ) {\n try {\n require_once $match;\n } \n catch ( Exception $e ) {\n echo \"$match class load failed.\\n\";\n }\n }\n }\n }", "function __autoload($class_name) {\n include_once $_SERVER['DOCUMENT_ROOT'].'/core/classes/class.' . $class_name . '.inc.php';\n}", "function __autoload($className)\n{\n require_once \"webcore.reflection.php\";\n \n ClassLoader::loadClass($className);\n}", "private static function load_files() {\n\t\t\t// Classes.\n\t\t\tinclude_once ASTRA_ADDON_EXT_ADVANCED_HEADERS_DIR . 'classes/class-astra-ext-advanced-headers-data.php';\n\t\t\t// Load Astra Breadcrumbs.\n\t\t\tinclude_once ASTRA_ADDON_EXT_ADVANCED_HEADERS_DIR . 'classes/astra-breadcrumbs.php';\n\t\t}", "public function load()\n {\n $this->_retrievedFiles = $this->getRetrievedFiles();\n $this->_loadedClasses = [];\n\n $manifestRepository = $this->_registry->getManifestRepository();\n $providerRepository = $this->_registry->getProviderRepository();\n\n $loadedClasses = [];\n\n // loop through files and find the classes declared by loading the file\n foreach ($this->_retrievedFiles as $file) {\n if(is_dir($file)) {\n continue;\n }\n\n $classesLoadedBefore = get_declared_classes();\n $oldLevel = error_reporting(E_ALL | ~E_STRICT); // remove strict so that other packages wont throw warnings\n // should we lint the files here? i think so\n include_once $file;\n error_reporting($oldLevel); // restore old error level\n $classesLoadedAfter = get_declared_classes();\n $loadedClasses = array_merge($loadedClasses, array_diff($classesLoadedAfter, $classesLoadedBefore));\n }\n\n // loop through the loaded classes and ensure that\n foreach ($loadedClasses as $loadedClass) {\n\n // reflect class to see if its something we want to load\n $reflectionClass = new ReflectionClass($loadedClass);\n if ($reflectionClass->implementsInterface('Zend_Tool_Framework_Manifest_Interface')\n && !$reflectionClass->isAbstract())\n {\n $manifestRepository->addManifest($reflectionClass->newInstance());\n $this->_loadedClasses[] = $loadedClass;\n }\n\n if ($reflectionClass->implementsInterface('Zend_Tool_Framework_Provider_Interface')\n && !$reflectionClass->isAbstract()\n && !$providerRepository->hasProvider($reflectionClass->getName(), false))\n {\n $providerRepository->addProvider($reflectionClass->newInstance());\n $this->_loadedClasses[] = $loadedClass;\n }\n\n }\n\n return $this->_loadedClasses;\n }", "private function init()\n\t{\n\t\tforeach (isLoadedClass() as $objName)\n\t\t{\n\t\t\t$this->$objName =& loadClass('', '', $objName);\n\t\t}\n\t}", "public static function load()\n {\n spl_autoload_register(array('AutoLoader', 'autoloadGenericClasses'));\n spl_autoload_register(array('AutoLoader', 'autoloadPhpdocx'));\n spl_autoload_register(array('AutoLoader', 'autoloadLog4php'));\n spl_autoload_register(array('AutoLoader', 'autoloadZetaComponents'));\n spl_autoload_register(array('AutoLoader', 'autoloadTcpdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadPdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadDompdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadMht'));\n }", "public function loadAllClassesIncrementally()\n {\n }", "public static function autoload() {\n // autoload\n include('cache/classes.yml.php');\n foreach($return as $class) {\n require_once($class);\n }\n }", "function __autoload($class_name0) {\n\n\t// casos especiais\n\tif ($class_name0==\"datalog\") {\n\t\t$class_name0=\"pdata\";\n\t}\n\n\n\t$class_name = strtolower($class_name0);\n\t$file[]=CORENLIB.\"cls_\".$class_name.\".php\";\n\t$file[]=CORENLIB.\"cls_\".$class_name.\".nx\";\n\t$file[]=DIRNLIB.\"cls_\".$class_name.\".php\";\n\t$file[]=CORENLIB.\"cls_\".$class_name.\".nx\";\n\t$file[]=CORENLIB.$class_name.\".nx\";\n\t$file[]=CORENLIB.$class_name.\".php\";\n\t$file[]=CORENLIB.\"cls.nx\";\t\n\t\n\n\tforeach ($file as $v) {\n\t\tif (file_exists($v)) {\n\t\t\trequire_once ($v);\n\t\t\treturn;\n\t\t}\n\t}\n\tdie (\"CLASS NAME: '$class_name' NOT FOUND\");\n}", "private function load_dependencies() {\n /**\n * \"BEHIND THE SCENCE\" CLASSES\n * Note: usually the admin and public do not directly use them, they are\n * necessary for the plugin (eg. i18n)\n */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-i18n.php';\n\n /* ADMIN */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-admin.php';\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-api.php';\n\n /* PUBLIC */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-public.php';\n }", "public static function registerClassLoadingInformation() {}", "public static function __autoload()\n\t{\n\t\tself::$FPATH = dirname(__DIR__);\n\t\tself::$APATH = self::detect_project();\n\n\t\tspl_autoload_register(array(__CLASS__, 'load'));\n\n\t\tself::cache_files();\n\t\tself::import_initializers();\n\t}", "public function core($className){\n if( strpos($className, 'Twig_') !== false ){\n return;\n }\n $fileScanner = new FileScanner( DOCUMENT_ROOT );\n $files = $fileScanner->getFilesInOneDimensionalArray();\n // exclude folders.\n $corefiles = array_filter($files, array($this, 'isCoreClass'));\n foreach($corefiles as $file){\n if( strpos(pathinfo($file, PATHINFO_FILENAME), $className) > -1 ){\n require_once $file;\n }\n }\n }", "function __autoload($class_name){\n require_once \"../cls/\".$class_name.'.php';\n}", "protected function _Load_Core() {\r\n $dir = untrailingslashit( plugin_dir_path(__FILE__ ) );\r\n // Recurssively load the directory\r\n $this->_Recusive_Load_Dir($dir.'/core');\r\n // Fire the shortcode init action\r\n do_action('vcff_supports_core_init',$this);\r\n }", "function __autoload($class_name) {\n\t$inc = ['sys/core/', 'sys/libs/'];\n\tforeach ($inc as $in) {\n\t\t$path = APP_DIR . $in . $class_name . '.php';\n\t\tif (file_exists($path)) {\n\t\t\tinclude $path;\n\t\t}\n\t}\n}", "static function autoload()\r\n\t{\r\n\t\t\r\n\t}", "public static function autoload()\n {\n spl_autoload_register(array(__CLASS__,'load'));\n }", "protected function initClasses()\n {\n $classList = __DIR__ . DS . 'classes.txt';\n if(file_exists($classList)) {\n $contents = file_get_contents($classList);\n $classes = explode(',', $contents);\n foreach($classes as $class)\n $this->classes[] = trim($class);\n }\n\n }", "public function __load();", "public function init()\n {\n // Register the loader method\n spl_autoload_register(array(__CLASS__, '_loadClasses'));\n }", "public static function LOADER(){\n spl_autoload_register(array(__CLASS__, \"requireClass\"));\n }", "protected function includeAndStartCoreBootstrap()\n {\n $classLoaderFilepath = $this->getClassLoaderFilepath();\n\n $classLoader = require $classLoaderFilepath;\n\n $this->bootstrap->initializeClassLoader($classLoader)\n ->baseSetup()\n ->loadConfigurationAndInitialize(true)\n ->loadTypo3LoadedExtAndExtLocalconf(true)\n ->initializeBackendRouter()\n ->setFinalCachingFrameworkCacheConfiguration()\n ->defineLoggingAndExceptionConstants()\n ->unsetReservedGlobalVariables();\n }", "public function __runEngine()\n\t{\n\t\t$directories = ['core'];\n\n\t\tforeach ($directories as $dir) {\n\t\t\t\t\n\t\t\t$filePath \t= TEMPLATEPATH.'/'.$dir; \n\t\t\t$php_files \t= scandir($filePath);\n\t\t\t$collectOfFiles = collect($php_files);\n\t\t\t$slice \t\t\t= $collectOfFiles->slice(2); \n\t\t\t$collectOfFiles = $slice->all(); \n\n\t\t\tforeach($collectOfFiles as $perFile)\n\t\t\t{\n\t\t\t\tinclude $filePath.'/'.$perFile;\n\t\t\t} \n\t\t} \n\n\t\t$this->__startClasses();\n\t}", "private static function initialLoad() {\n include_once __DIR__ . '/Storange.php';\n Storange::getPathDir('wowframework/');\n include_once __DIR__ . '/exceptions/LoadFiles.php';\n }", "function mySubLoad($className){\n\t$arr = scandir(MYPHP_COMMON);\n\t$name = explode('\\\\', $className);\n\tforeach($arr as $val){\n\t\tif($val == '.' || $val == '..' || is_file(MYPHP_COMMON.'/'.$val)){\n\t\t\tcontinue;\n\t\t}\n\t\t$path = MYPHP_COMMON.'/'.$val.'/'.$name[count($name) - 1].'.class.php';\n\t\tif(file_exists($path)){\n\t\t\trequire_once $path;\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "private function includeFiles(){\n foreach($this->files as $file){\n require implode('', $file);\n $class_name = $this->getClassNameFromFileName($file);\n $this->classes[$file['name']] = new $class_name();\n }\n }", "function __autoload($class){\n require \"classes/\".$class.\".php\";\n }", "function do_autoload() {\n\tinit_files();\n}", "protected function classLoader() {\n\t\t// Get absolute path of extension directory\n\t\t$extPath = t3lib_extMgm::extPath(tx_passwordmgr_module1::extKey);\n\t\t// Add all classes to load array\n\t\t$this->include_once[] = $extPath . 'helper/class.tx_passwordmgr_helper.php';\n\t\t$this->include_once[] = $extPath . 'helper/class.tx_passwordmgr_openssl.php';\n\t\t$this->include_once[] = $extPath . 'controller/class.tx_passwordmgr_action_interface.php';\n\t\t$this->include_once[] = $extPath . 'controller/class.tx_passwordmgr_action_default.php';\n\t\t$this->include_once[] = $extPath . 'controller/class.tx_passwordmgr_action_initializekeypair.php';\n\t\t$this->include_once[] = $extPath . 'controller/class.tx_passwordmgr_action_addgroup.php';\n\t\t$this->include_once[] = $extPath . 'controller/class.tx_passwordmgr_action_addpassword.php';\n\t\t$this->include_once[] = $extPath . 'controller/class.tx_passwordmgr_action_addgroupmember.php';\n\t\t$this->include_once[] = $extPath . 'controller/class.tx_passwordmgr_action_editgroupmember.php';\n\t\t$this->include_once[] = $extPath . 'controller/class.tx_passwordmgr_action_deletepassword.php';\n\t\t$this->include_once[] = $extPath . 'controller/class.tx_passwordmgr_action_deletegroup.php';\n\t\t$this->include_once[] = $extPath . 'controller/class.tx_passwordmgr_action_deletegroupmember.php';\n\t\t$this->include_once[] = $extPath . 'controller/class.tx_passwordmgr_action_editpassword.php';\n\t\t$this->include_once[] = $extPath . 'controller/class.tx_passwordmgr_action_editgroup.php';\n\t\t$this->include_once[] = $extPath . 'controller/class.tx_passwordmgr_action_decryptpassword.php';\n\t\t$this->include_once[] = $extPath . 'controller/class.tx_passwordmgr_action_fold.php';\n\t\t$this->include_once[] = $extPath . 'controller/class.tx_passwordmgr_action_changepassphrase.php';\n\t\t$this->include_once[] = $extPath . 'controller/class.tx_passwordmgr_action_selectpassword.php';\n\t\t$this->include_once[] = $extPath . 'controller/class.tx_passwordmgr_action_deselectpassword.php';\n\t\t$this->include_once[] = $extPath . 'controller/class.tx_passwordmgr_action_movepassword.php';\n\t\t$this->include_once[] = $extPath . 'controller/class.tx_passwordmgr_action_updatesettings.php';\n\t\t$this->include_once[] = $extPath . 'view/class.tx_passwordmgr_view_default.php';\n\t\t$this->include_once[] = $extPath . 'view/class.tx_passwordmgr_view_overview.php';\n\t\t$this->include_once[] = $extPath . 'view/class.tx_passwordmgr_view_initializekeypair.php';\n\t\t$this->include_once[] = $extPath . 'view/class.tx_passwordmgr_view_addeditpassword.php';\n\t\t$this->include_once[] = $extPath . 'view/class.tx_passwordmgr_view_addeditgroup.php';\n\t\t$this->include_once[] = $extPath . 'view/class.tx_passwordmgr_view_addeditgroupmember.php';\n\t\t$this->include_once[] = $extPath . 'view/class.tx_passwordmgr_view_changepassphrase.php';\n\t\t$this->include_once[] = $extPath . 'view/class.tx_passwordmgr_view_settings.php';\n\t\t// Default data list class, implements Iterator, Countable\n\t\t$this->include_once[] = $extPath . 'model/class.tx_passwordmgr_model_list.php';\n\t\t// Data list classes\n\t\t$this->include_once[] = $extPath . 'model/class.tx_passwordmgr_model_userlist.php';\n\t\t$this->include_once[] = $extPath . 'model/class.tx_passwordmgr_model_grouplist.php';\n\t\t$this->include_once[] = $extPath . 'model/class.tx_passwordmgr_model_groupmemberlist.php';\n\t\t$this->include_once[] = $extPath . 'model/class.tx_passwordmgr_model_passwordlist.php';\n\t\t$this->include_once[] = $extPath . 'model/class.tx_passwordmgr_model_ssldatalist.php';\n\t\t$this->include_once[] = $extPath . 'model/class.tx_passwordmgr_model_loglist.php';\n\t\t// Default data class, implements ArrayAccess, IteratorAggregate\n\t\t$this->include_once[] = $extPath . 'model/class.tx_passwordmgr_model_data.php';\n\t\t// Data classes\n\t\t$this->include_once[] = $extPath . 'model/class.tx_passwordmgr_model_group.php';\n\t\t$this->include_once[] = $extPath . 'model/class.tx_passwordmgr_model_user.php';\n\t\t$this->include_once[] = $extPath . 'model/class.tx_passwordmgr_model_groupmember.php';\n\t\t$this->include_once[] = $extPath . 'model/class.tx_passwordmgr_model_password.php';\n\t\t$this->include_once[] = $extPath . 'model/class.tx_passwordmgr_model_ssldata.php';\n\t\t$this->include_once[] = $extPath . 'model/class.tx_passwordmgr_model_log.php';\n\t\t$this->include_once[] = $extPath . 'model/class.tx_passwordmgr_model_moduledata.php';\n\t\t$this->include_once[] = $extPath . 'model/class.tx_passwordmgr_model_functionmenu.php';\n\t\t$this->include_once[] = $extPath . 'model/class.tx_passwordmgr_model_functionmenu_allitems.php';\n\t\t$this->include_once[] = $extPath . 'model/class.tx_passwordmgr_model_functionmenu_usernotinitialized.php';\n\t\t$this->include_once[] = $extPath . 'model/class.tx_passwordmgr_model_userdata.php';\n\t\t// Load all classes\n\t\tforeach ($this->include_once as $incFile) {\n\t\t\tinclude_once($incFile);\n\t\t}\n\t}", "public static function load_extra_classes() {\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-elementor.php';\n\t\tElementor::init();\n\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-woo.php';\n\t\tWoo::init();\n\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-facebook.php';\n\t\tFacebook::init();\n\t}", "function __autoload($class_name)\n{\t\n require_once Conf::$DIRS['LIBS'].'class/'.$class_name.'.class.php';\t\n}", "public static function load()\n {\n spl_autoload_register(array('AutoLoader', 'autoloadGenericClasses'));\n }", "function autoload($class_name)\n{\n $exp_arr = explode('_', $class_name);\n if (count($exp_arr) === 1) {\n $folder = 'core';\n } else {\n $n = array_pop($exp_arr);\n $folder = $n . ($n[strlen($n) - 1] == 's' ? 'es' : 's');\n }\n switch($folder) {\n case \"controllers\":\n $arr = explode('_', $class_name);\n $sub_folder = array_shift($arr);\n $class_file = PROTECTED_DIR . $folder . DS . PROJECT . DS . $sub_folder . DS . $class_name . '.php';\n break;\n case \"helpers\":\n case \"templates\":\n $class_file = PROTECTED_DIR . $folder . DS . PROJECT . DS . $class_name . '.php';\n break;\n default:\n $class_file = PROTECTED_DIR . $folder . DS . $class_name . '.php';\n break;\n }\n if (file_exists($class_file)) {\n require_once($class_file);\n }\n}", "function vehicleAbsClassLoader()\n\t{\n\t\t$path = 'Classes/Vehicles/Abs.php';\n\t\tif (file_exists($path)){\n\t\t\trequire_once($path);\n\t\t}\n\t}", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core theme.\n\t\t */\n\t\trequire_once 'class-custom-theme-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public area.\n\t\t */\n\t\trequire_once 'public/class-theme-public.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once 'admin/class-theme-admin.php';\n\n\n\t\t$this->loader = new Wpt_Custom_Theme_Loader();\n\n\t}", "public function load() {\r\n\t\t$this->includes();\r\n\t\t$this->inits();\r\n\t}", "function __autoload($class) {\n if ($class == \"uploader\")\n require \"core/uploader.php\";\n elseif ($class == \"browser\")\n require \"core/browser.php\";\n elseif (file_exists(\"core/types/$class.php\"))\n require \"core/types/$class.php\";\n elseif (file_exists(\"lib/class_$class.php\"))\n require \"lib/class_$class.php\";\n elseif (file_exists(\"lib/helper_$class.php\"))\n require \"lib/helper_$class.php\";\n}", "public function coreClasses(){\n return[\n 'request' => 'System\\\\Http\\\\Request',\n 'response' => 'System\\\\Http\\\\Response',\n 'session' => 'System\\\\Session',\n 'route' => 'System\\\\Route',\n 'cookie' => 'System\\\\Cookie',\n 'loader' => 'System\\\\Loader',\n 'html' => 'System\\\\Html',\n 'db' => 'System\\\\Database',\n 'view' => 'System\\\\View\\\\ViewFactory',\n ];\n }", "function __autoload($cls){\n SUPER::include_file_with_class($cls);\n}", "static public function initialize()\r\n {\r\n spl_autoload_register(\"self::load\");\r\n }", "function __autoload($name){\n require_once './class/' . $name . \".class.php\";\n}", "function __autoload($class_name) {include $class_name . '.php';}", "public function core() {\n\t\t\tinclude_once $this->includes_path() . 'functions-cyprus-utility.php';\n\t\t\tinclude_once $this->includes_path() . 'class-cyprus-settings.php';\n\t\t\tinclude_once $this->includes_path() . 'class-cyprus-sanitize.php';\n\t\t\tinclude_once $this->includes_path() . 'class-cyprus-dynamic-css.php';\n\t\t}", "public function load() {\n $this->loadModules($this->dir['modules_core'], 'core');\n $this->loadModules($this->dir['modules_custom'], 'custom');\n $this->runModules();\n }", "function zapp_autoload ($className)\n{\n static $class = array ();\n\n if (!isset($class[$className]))\n {\n $className = strtolower($className);\n $classPrefix = str_replace('_', '/', $className);\n\n $path = [];\n $classBase = null;\n\n if (preg_match(\"/^(zapp)$/i\", $className)) \n $path = [SYSTEM_PATH . 'core/'.$classPrefix];\n\n elseif (preg_match(\"/^(config_)/i\", $className)) \n $path = [APPLICATION_PATH. $classPrefix.'.'.ENVIRONMENT, APPLICATION_PATH.$classPrefix];\n\n elseif (preg_match(\"/^(ajax_|controller_|model_|base_|console_)/i\", $className)) \n $path = [APPLICATION_PATH.$classPrefix];\n\n elseif (preg_match(\"/^(core_controller|core_console|core_model|core_component)/i\", $className)) \n {\n $className = str_replace('core_','', $className);\n $classPrefix = str_replace('_', '/', $className);\n $path = [SYSTEM_PATH . 'core/base/'.$classPrefix] ;\n }\n\n elseif (preg_match(\"/^(core_)/i\", $className)) \n $path = [SYSTEM_PATH.$classPrefix] ;\n\n elseif (preg_match(\"/^(lib_)/i\", $className)) \n $path = [APPLICATION_PATH.$classPrefix, SYSTEM_PATH.$classPrefix];\n \n else\n $path = [APPLICATION_PATH. 'ext/'.$classPrefix, SYSTEM_PATH. 'ext/'.$classPrefix];\n\n foreach ($path as $_filename) \n {\n if (@file_exists($_filename . '.php')) \n {\n $classBase = $_filename;\n break;\n }\n }\n\n if ($classBase)\n {\n $class[$className] = $classBase;\n require_once($classBase . '.php');\n }\n\n }\n}", "public static function initialize() {\n\t\tself::$log_location = \\Config::LOG_LOCATION;\n\t\tself::$start_time = microtime(true);\n\t\tself::debug(\"Loaded Core classes. Initialized Log class.\");\n\t}", "function __autoload($className) {\n \trequire_once 'config.inc.php';\n require_once ROOT_PATH . '/includes/'. ucfirst($className) .'.class.php'; //自动加载 class 文件 \n}", "static public function autoload() {\n spl_autoload_register(array(__CLASS__, 'loader'));\n }", "public function __construct()\n\t{\n\t\tforeach(Config::item('core.preload') as $type => $load)\n\t\t{\n\t\t\tif ($load == FALSE) continue;\n\n\t\t\tforeach(explode(',', $load) as $name)\n\t\t\t{\n\t\t\t\tif (($name = trim($name)) == FALSE) continue;\n\n\t\t\t\tswitch($type)\n\t\t\t\t{\n\t\t\t\t\tcase 'libraries':\n\t\t\t\t\t\tif ($name == 'database')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->database();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->library($name);\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'models':\n\t\t\t\t\t\t$this->model($name);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function loadClass() {\n $this->_instances = array();\n\n $this->_instances['log'] = new Log();\n if(ENVIRONMENT == self::ENVIRONMENT_DEV) {\n $this->_instances['debug'] = new Debug();\n $this->_instances['panel'] = new Panel();\n }\n $this->_instances['controller'] = null;\n $this->_instances['configuration'] = new Configuration();\n $this->_instances['routing'] = new Routing();\n }", "public function testLoadclassNamespace()\r\n {\r\n Web2All_Manager_Main::unregisterIncludeRoot(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR);\r\n Web2All_Manager_Main::loadClass('Web2All\\\\Manager\\\\ClassLoaderTest\\\\E');\r\n $this->assertFalse(class_exists('Web2All\\\\Manager\\\\ClassLoaderTest\\\\E', false));\r\n Web2All_Manager_Main::registerIncludeRoot(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR);\r\n Web2All_Manager_Main::loadClass('Web2All\\\\Manager\\\\ClassLoaderTest\\\\E');\r\n $this->assertTrue(class_exists('Web2All\\\\Manager\\\\ClassLoaderTest\\\\E', false));\r\n }", "function __autoload($className)\n\t{\n\t\t// Load class using Loader\n\t\tLoad($className);\n\t}", "function __autoload($className) \n{ \n try \n {\n if (file_exists( CORE_INCLUDE_PATH . DS. \"classes\" . DS .\"{$className}.php\") ||\n\t file_exists( CORE_INCLUDE_PATH . DS. \"{$className}.php\") || file_exists( ROOT . DS . \"model\" . DS . \"{$className}.php\")) \n\t{ \n require_once \"{$className}.php\";\n }\n } catch (Exception $ex) {\n die($ex->getMessage());\n }\n}", "abstract protected static function autoload($class);", "public static function __classLoaded()\n {\n\t\tif (empty(static::$layers) && class_exists('Git')) {\n\t\t\tstatic::$layers = \\Git::$repositories;\n\t\t}\n }", "protected function initializeClassLoader() {\n\t\tif (t3lib_div::int_from_ver( TYPO3_version ) < 6000000 ) {\n\t\t\tif (!class_exists('Tx_Extbase_Utility_ClassLoader', FALSE)) {\n\t\t\t\trequire(t3lib_extmgm::extPath('extbase') . 'Classes/Utility/ClassLoader.php');\n\t\t\t}\n\n\t\t\t$classLoader = new Tx_Extbase_Utility_ClassLoader();\n\t\t\tspl_autoload_register(\n\t\t\t\tarray(\n\t\t\t\t\t$classLoader,\n\t\t\t\t\t'loadClass'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}", "function __autoload($class_name) {\r\n include '../class/' . $class_name . '.php';\r\n}", "private static final function loadClasses() {\n if(isset(self::$_config['include']) && is_array(self::$_config['include'])) {\n self::$_config['include'] = array_merge(self::$defaultInclude, self::$_config['include']);\n $defaultIncludeCount = count(self::$defaultInclude);\n foreach(self::$_config['include'] as $key => $include) {\n /* @var string $include */\n $include = ($key < $defaultIncludeCount) ? self::$basePath . $include : self::$path . $include;\n $matches = [];\n if(preg_match('/(.*)\\/?\\*$/', $include, $matches)) {\n if(is_dir($matches[1])) {\n $files = scandir($matches[1]);\n foreach ($files as $file) {\n /* @var string $file */\n if($file === '.' || $file === '..' || is_dir($matches[1] . $file)) {\n continue;\n }\n if (preg_match('/^.+\\.php$/', $file)) { // include only php files\n require_once($matches[1] . $file);\n }\n }\n } else {\n static::error500(\"Wrong config parameter in <strong>include</strong>:\n {$matches[1]} is not a directory\");\n }\n } else {\n if(file_exists($include)) {\n if(!is_dir($include)) {\n require_once($include);\n } else {\n static::error500(\"Wrong config parameter in <strong>include</strong>:\n $include is a directory\");\n }\n } else {\n static::error500(\"Wrong config parameter in <strong>include</strong>:\n $include is not exists.\");\n }\n }\n }\n } else {\n static::error500('Include is missing from config.');\n }\n }", "function __autoload( $className ){\n require_once 'classes/'.$className.'.class.php';\n }", "private function _initialize(){\n\t\t\t//Root Folders\n\t\t\tDefined(\"SRC_PATH\") || Define('SRC_PATH', realpath(dirname(dirname(__file__))) . DS . 'src' . DS);\n\t\t\tDefined(\"DB_PATH\") || Define('DB_PATH', realpath(dirname(__file__)).DS.'database'.DS);\n\t\t\t//$dir = array_filter(glob('*'),'is_dir');\n\t\t\t//print_r($dir);\n\t\t\tspl_autoload_extensions('.php');\n\t\t\tspl_autoload_register(function ($class) {\n\t\t\t\t$parts = explode('\\\\', $class);\n\t\t\t\t$class = end($parts); \n\n\t\t\t\tif (file_exists(PROJECT_PATH.$this->_implementation.DS.$class.'.php'))\n\t\t\t\t\t\trequire_once PROJECT_PATH.$this->_implementation.DS.$class.'.php';\n\t\t\t\t\n //Impliments \n\t\t\t\t$folders = scandir(PROJECT_PATH . $this->_implementation);\n\t\t\t\t$remove = array('.', '..');\n\t\t\t\t$folders = array_diff($folders, $remove);\n\t\t\t\tif (!empty($folders)) {\n\t\t\t\t\t$folders = array_clean($folders);\n\t\t\t\t\tforeach ($folders as $folder) {\n\t\t\t\t\t\tif (file_exists(PROJECT_PATH.$this->_implementation.DS.$folder.DS.$class.'.php'))\n\t\t\t\t\t\t\trequire_once PROJECT_PATH.$this->_implementation.DS.$folder.DS.$class.'.php';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//Initalize Plugins\n\t\t\t\t$folders = scandir(PROJECT_PATH . $this->_pluginPath);\n\t\t\t\t$remove = array('.', '..');\n\t\t\t\t$folders = array_diff($folders, $remove);\n\t\t\t\tif (!empty($folders)) {\n\t\t\t\t\t$folders = array_clean($folders);\n\t\t\t\t\tforeach ($folders as $folder) {\n\t\t\t\t\t\tif (file_exists(PROJECT_PATH.$this->_pluginPath.DS.$folder.DS.$class.'.php'))\n\t\t\t\t\t\t\trequire_once PROJECT_PATH.$this->_pluginPath.DS.$folder.DS.$class.'.php';\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\t//System vendor \n\t\t\t\t$folders = scandir(APP_PATH . $this->_systemVendor);\n\t\t\t\t$remove = array('.', '..');\n\t\t\t\t$folders = array_diff($folders, $remove);\n\t\t\t\tif (!empty($folders)) {\n\t\t\t\t\t$folders = array_clean($folders);\n\t\t\t\t\tforeach ($folders as $folder) {\n\t\t\t\t\t\tif (file_exists(APP_PATH.$this->_systemVendor.DS.$folder.DS.$class.'.php'))\n\t\t\t\t\t\t\trequire_once APP_PATH.$this->_systemVendor.DS.$folder.DS.$class.'.php';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//User Vendor\n\t\t\t\t$folders = scandir(PROJECT_PATH . $this->_userVendor);\n\t\t\t\t$remove = array('.', '..');\n\t\t\t\t$folders = array_diff($folders, $remove);\n\t\t\t\tif (!empty($folders)) {\n\t\t\t\t\t$folders = array_clean($folders);\n\t\t\t\t\tforeach ($folders as $folder) {\n\t\t\t\t\t\tif (file_exists(PROJECT_PATH.$this->_userVendor.DS.$folder.DS.$class.'.php'))\n\t\t\t\t\t\t\trequire_once PROJECT_PATH.$this->_userVendor.DS.$folder.DS.$class.'.php';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (!empty($_SERVER['QUERY_STRING']))\n\t\t\t\t$this->_route = preg_replace('/^url=index.php&url=(.*)/', '$1', $_SERVER['QUERY_STRING']);\n\t\t\t\t\t\n\t\t\tif(utils\\Config::get('role/module_active') == 'YES'){\n\t\t\t\t//Create All Roles Tables \n\t\t\t\t$userTable = utils\\Config::get('webadmin/userTable');\n\t\t\t\t$userKey = utils\\Config::get('webadmin/userKey');\n\t\t\t\tif(isset($userTable) && isset($userKey)){\n\t\t\t\t\tif(\\orm\\Query::is_table($userTable)){\n\t\t\t\t\t\t$roleTables = new roles\\tables\\RoleTables($userTable,$userKey);\n\t\t\t\t\t\t$roleTables->addRoleTables();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n }", "function load($classmap, $base = null) {\n spl_autoload_register(function($class) use ($classmap, $base) {\n $class = strtolower($class);\n if(!isset($classmap[$class])) return false;\n if($base) {\n include($base . DS . $classmap[$class]); \n } else {\n include($classmap[$class]);\n }\n });\n}", "function __construct(){\n spl_autoload_register(function ($className) {\n $ds = DIRECTORY_SEPARATOR;\n $dir = App::$param['path'];\n $className = strtr($className, '\\\\', $ds);\n $file = \"{$dir}{$className}.php\";\n if (is_readable($file)) {\n require_once $file;\n }\n });\n set_include_path(get_include_path() . PATH_SEPARATOR . App::$param['path'] . PATH_SEPARATOR . App::$param['path'] . \"app\" . PATH_SEPARATOR . App::$param['path'] . \"app/libs/PEAR/\");\n }", "public function mapClasses() {\n // TODO: this is needed when the class map is not created yet (i.e. at very first install).\n if (!is_dir($this->dir['tmp'])) {\n mkdir($this->dir['tmp']);\n }\n $fop = fopen(CLASS_MAP_FILE, 'w+');\n\n foreach ($this->modules_loaded as $module) {\n $autoload_paths = array('Common', 'Qtags');\n foreach ($autoload_paths as $autoload_path) {\n $full_autoload_path = $module['path'] . '/classes/' . $autoload_path;\n /**\n * Autoload module's qtags.\n */\n if (is_dir($full_autoload_path)) {\n $classes = $this->scanDirectory($full_autoload_path);\n foreach ($classes as $class) {\n // Parse the Qtag.\n $exp1 = explode('/', $class);\n $exp2 = explode('.', $exp1[count($exp1) - 1]);\n $item_name = $exp2[0];\n $this->class_map[$autoload_path][$item_name] = $full_autoload_path . '/' . $class;\n }\n }\n }\n }\n fwrite($fop, serialize($this->class_map));\n fclose($fop);\n }", "function __autoload($class_name) {\n include \"classes/\" . $class_name . \".class.php\";\n}", "function __autoload($className){\n include_once \"Classes/$className.php\";\n}", "private function __construct() {\n require_once CORE_LIBRARY . 'CoreAutoloader.php';\n\n // instantiate core-class objects\n $this->autoloader = new CoreAutoloader();\n $this->config = CoreConfig::instance();\n $this->uri = CoreUri::instance();\n $this->message = CoreMessage::instance();\n }", "function _initialize()\n {\n\n //initalize Loader\n $auto_load=array(\"io\",\"segment\",\"router\");\n \n foreach($auto_load as $library)\n {\n $this->$library=& load_class($library);\n }\n //load loader class\n $this->load =& load_class('Loader');\n \n //call auto load from config file\n $this->load->_auto_load();\n }", "public function __construct()\r\n {\r\n $configDir = ROOT . DS . \"config\" . DS;\r\n \r\n foreach(glob($configDir . \"*.php\") as $file)\r\n {\r\n $pathInfo = pathinfo($file);\r\n $GLOBALS[$pathInfo[\"filename\"]] = require($file);\r\n }\r\n\r\n // Include all PHP files from the config dir\r\n $libsDir = ROOT . DS . \"core\" . DS . \"utilities\" . DS . \"libs\" . DS . \"jwt\" . DS;\r\n \r\n foreach(glob($libsDir . \"*.php\") as $file)\r\n {\r\n ///echo $file.\"<br>\";\r\n $pathInfo = pathinfo($file);\r\n require($file);\r\n }\r\n \r\n spl_autoload_register(array($this, \"load\"));\r\n }", "public static function autoload($className) {\n\t\t\n\t\t//for namespaces\n//\t\t$className = str_replace('\\\\', '_', $className);\n\t\t\n\t\t//Sometimes there's a leading \\ in the $className and sometimes not.\n\t\t//Might not be true for all php versions.\t\t\n\t\t$className = ltrim($className, '\\\\');\n\t\t\t\n\t\tif(isset(self::$_classes[$className])){\n\t\t\t//don't use \\GO::config()->root_path here because it might not be autoloaded yet causing an infite loop.\n\t\t\trequire(dirname(dirname(__FILE__)) . '/'.self::$_classes[$className]);\n\t\t}else\n\t\t{\n//\t\t\techo \"Autoloading: \".$className.\"\\n\";\n\t\t\t\n\t\t\t$filePath = false;\n\n\t\t\tif(substr($className,0,7)=='GO\\\\Base'){\n\t\t\t\t$arr = explode('\\\\', $className);\n\t\t\t\t$file = array_pop($arr).'.php';\n\n\t\t\t\t$path = strtolower(implode('/', $arr));\n\t\t\t\t$location =$path.'/'.$file;\n\t\t\t\t$filePath = dirname(dirname(__FILE__)) . '/'.$location;\n\t\t\t} else if(substr($className,0,4)=='GOFS'){\n\t\t\t\t\t\t\n\t\t\t\t$arr = explode('\\\\', $className);\n\t\t\t\t\n\t\t\t\tarray_shift($arr);\n\t\t\t\t\n\t\t\t\t$file = array_pop($arr).'.php';\n\t\t\t\t$path = strtolower(implode('/', $arr));\n\t\t\t\t$location =$path.'/'.$file;\n\t\t\t\t$filePath = \\GO::config()->file_storage_path.'php/'.$location;\t\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t//$orgClassName = $className;\n\t\t\t\t$forGO = substr($className,0,3)=='GO\\\\';\n\n\t\t\t\tif ($forGO)\n\t\t\t\t{\n\t\t\t\t\t$arr = explode('\\\\', $className);\n\n\t\t\t\t\t//remove GO_\n\t\t\t\t\tarray_shift($arr);\n\n\t\t\t\t\t$module = strtolower(array_shift($arr));\n\n\t\t\t\t\tif($module!='core'){\n\t\t\t\t\t\t//$file = self::modules()->$module->path; //doesn't play nice with objects in the session and autoloading\n\t\t\t\t\t\t$file = 'modules/'.$module.'/';\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\t$file = \"\";\n\t\t\t\t\t}\n\t\t\t\t\tfor($i=0,$c=count($arr);$i<$c;$i++){\n\t\t\t\t\t\tif($i==$c-1){\n\t\t\t\t\t\t\t$file .= ucfirst($arr[$i]);\n\t\t\t\t\t\t\t$file .='.php';\n\t\t\t\t\t\t}else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$file .= strtolower($arr[$i]).'/';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$filePath = \\go\\core\\Environment::get()->getInstallFolder()->getPath() .'/' . $file;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\t\t\tif(strpos($filePath, '..')!==false){\n\t\t\t\techo \"Invalid PHP file autoloaded!\";\n\t\t\t\tthrow new \\Exception(\"Invalid PHP file autoloaded!\");\n\t\t\t}\n\n\t\t\tif(!is_file($filePath)){\n\t\t\t\t//throw new \\Exception('Class '.$orgClassName.' not found! ('.$file.')');\n\t\t\t\treturn false;\n\t\t\t}else\n\t\t\t{\n\t\t\t\trequire($filePath);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}", "function loader($class){\n $class_file = DIR. DS . $class . '.php';\n\n if(file_exists($class_file)){\n require_once($class_file);\n }else{\n foreach (AUTOLOAD_CLASSES as $path){\n $class_file = $path . DS . $class . '.php';\n if(file_exists($class_file)) require_once($class_file);\n }\n }\n}", "function __autoload($class_name)\n{\n\tif (strrpos($class_name, 'Zend') !== false) {\n require_once ROOT_PATH . 'include/lib/' . str_replace('_', '/', $class_name) . '.php';\n\t} else\n if (strrpos($class_name, 'Thef') !== false) {\n require_once ROOT_PATH . 'logic/thef/' . $class_name . '.php';\n } else\n\tif (strrpos($class_name, 'TplFrt') !== false) {\n require_once ROOT_PATH . 'html_logic/frontend/' . $class_name . '.php';\n } else\n\tif (strrpos($class_name, 'TplBck') !== false) {\n require_once ROOT_PATH . 'html_logic/backend/' . $class_name . '.php';\n } else\n\tif (strrpos($class_name, 'DbaFrt') !== false) {\n require_once ROOT_PATH . 'logic/frontend/' . $class_name . '.php';\n } else\n\tif (strrpos($class_name, 'DbaBck') !== false) {\n require_once ROOT_PATH . 'logic/backend/' . $class_name . '.php';\n } else {\n\t\trequire_once ROOT_PATH . 'logic/' . $class_name . '.php';\n\t}\n}", "function import_classes(){\n\t\n\tclass_exists('Database') || require('classes/class.Database.php');\n\tclass_exists('Response') || require('classes/class.Response.php');\n\tclass_exists('User') || require('classes/class.User.php');\n\tclass_exists('GUI') || require('classes/class.GUI.php');\n\tclass_exists('FileItem') || require('classes/class.FileItem.php');\n\tclass_exists('Comment') || require('classes/class.Comment.php');\n\tclass_exists('MLLib') || require('classes/class.MLLib.php');\n}", "function __autoload($class_name) {\n include 'classes/' . $class_name . '.php';\n}", "function myLoad($className){\n\t$path = MYPHP_SOURCE.'/'.str_replace('\\\\', '/', $className).'.class.php';\n\tif(file_exists($path)){\n\t\trequire_once $path;\n\t}\n}", "public function autoload($class) {\n if (isset(static::$map[$class])){\n $pathInfo = static::$map[$class];\n Yaf_Loader::import(sprintf('%s%s',$pathInfo[0], $pathInfo[1]));\n } else if (strpos($class, 'Builder') === strlen($class) - 7){\n Yaf_Loader::import(sprintf('%s/application/views/builder/%s.php', APPLICATION_PATH, $class));\n } else if (strpos($class, 'Pagelet') === strlen($class) - 7){\n Yaf_Loader::import(sprintf('%s/application/pagelets/%s.php', APPLICATION_PATH, $class));\n } else if (strpos($class, 'Halo') === 0){\n Yaf_Loader::import(sprintf('%s/halo/%s.php',LIB_PATH,$class));\n } else if (strpos($class, 'Util') == strlen($class) - 4 || strpos($class, 'Utils') == strlen($class) - 5){\n Yaf_Loader::import(sprintf('%s/utils/%s.php',LIB_PATH,$class));\n } else if (strpos($class, 'Model') === strlen($class) - 5){\n Yaf_Loader::import(sprintf('%s/application/models/%s.php',APPLICATION_PATH,$class));\n } else if (strpos($class, 'Service') === strlen($class) - 7){\n Yaf_Loader::import(sprintf('%s/application/service/%s.php',APPLICATION_PATH,$class));\n } else if (strpos($class, 'HTMLPurifier') !== false){\n Yaf_Loader::import(sprintf('%s/htmlpurifier/HTMLPurifier.safe-includes.php',LIB_PATH));\n }else if (strpos($class, 'Api') === strlen($class) - 3){\n Yaf_Loader::import(sprintf('%s/application/Api/%s.php',APPLICATION_PATH,$class));\n }else if (strpos($class, 'Object') === strlen($class) - 6){\n Yaf_Loader::import(sprintf('%s/application/objects/%s.php',APPLICATION_PATH,$class));\n }else if (strpos($class, 'MemCache') === 0){\n// var_dump('================');\n// /Users/worker/php/wk/wcontact_cache/lib/wcontact/MemCacheBase.php\n Yaf_Loader::import(sprintf('%s/wzhaopin/%s.php',LIB_PATH, $class));\n }\n }", "public static function registerAutoloader()\n\t{\n\t\tspl_autoload_register(__NAMESPACE__.'\\\\Core::autoload');\n\t}", "function __autoload($class_name) {\n include '../class/' . $class_name . '.php';\n}", "function __autoload($class_name) {\n include '../class/' . $class_name . '.php';\n}", "public function load(): void\n {\n $requested = 0;\n $loaded = 0;\n foreach ($this->storage->loadClassList() as $class) {\n ++$requested;\n if ($this->accept($class) && !class_exists($class, false)) {\n ++$loaded;\n if ($this->verbose) {\n echo \"[Preloader] Loading {$class}\" . PHP_EOL;\n }\n class_exists($class, true);\n }\n }\n\n if ($this->verbose) {\n echo \"[Preloader] Preloaded {$loaded}/{$requested} classes\" . PHP_EOL;\n }\n }", "public static function init() {\n\t\tcore::loadClass(\"database\");\n\n\t\t/* Child tables */\n\t\tcore::loadClass(\"doorkey_model\");\n\t\tcore::loadClass(\"key_history_model\");\n\t}", "function __autoload($nomeClasse)\n{\n include_once './classes/' . $nomeClasse . '.class.php';\n}", "public function loadInit() {}", "public static function loadAll();", "public function __construct() {\n\t\tset_include_path(get_include_path().PATH_SEPARATOR.CLASS_DIR);\n\n\t\t// You can use this trick to make autoloader look for commonly used filenames\n\t\tspl_autoload_extensions('.php');\n\n\t\t// Use default autoload implementation\n\t\tspl_autoload_register( function($className) {\n\t\t\techo 'Trying to load '. $className .' via '. __METHOD__ .\"()\\n\";\n \tinclude $className . '.php';\n\t\t});\n\t}", "function __autoload($className)\r\n{\r\n require_once $className . '.php';\r\n}", "public function testLoadclassNamespaceMixed()\r\n {\r\n Web2All_Manager_Main::unregisterIncludeRoot(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR);\r\n Web2All_Manager_Main::loadClass('Web2All\\\\Manager\\\\ClassLoaderTest_F');\r\n $this->assertFalse(class_exists('Web2All\\\\Manager\\\\ClassLoaderTest_F', false));\r\n Web2All_Manager_Main::registerIncludeRoot(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR);\r\n Web2All_Manager_Main::loadClass('Web2All\\\\Manager\\\\ClassLoaderTest_F');\r\n $this->assertTrue(class_exists('Web2All\\\\Manager\\\\ClassLoaderTest_F', false));\r\n }" ]
[ "0.78886384", "0.74368006", "0.7236141", "0.7230211", "0.71069735", "0.7071298", "0.70692074", "0.7036053", "0.6996384", "0.6929936", "0.6881678", "0.687795", "0.6813528", "0.68101895", "0.67888033", "0.6780812", "0.67777777", "0.6765415", "0.6741987", "0.673613", "0.6727286", "0.67146057", "0.67051584", "0.67010635", "0.6670042", "0.666578", "0.6659575", "0.66580254", "0.66300875", "0.6612537", "0.6568", "0.6538911", "0.65355116", "0.6522312", "0.6508486", "0.6504767", "0.6500372", "0.649404", "0.64866215", "0.6480925", "0.64759314", "0.6470489", "0.64680654", "0.64638263", "0.64598244", "0.6456165", "0.6454489", "0.64416385", "0.643252", "0.64083123", "0.6407199", "0.6405386", "0.6404527", "0.64028716", "0.63952774", "0.63947237", "0.6390773", "0.63888454", "0.63856107", "0.6373595", "0.637159", "0.63714105", "0.6361804", "0.6358143", "0.63425696", "0.63259417", "0.63252306", "0.63209707", "0.63059664", "0.63006717", "0.6300598", "0.63002735", "0.62994534", "0.62968737", "0.6294123", "0.6292702", "0.62824446", "0.6281477", "0.6280607", "0.6275162", "0.62748337", "0.62659246", "0.6264918", "0.6262738", "0.6262103", "0.62573063", "0.62431914", "0.6231718", "0.6228693", "0.6228091", "0.6225509", "0.6225509", "0.6220799", "0.6218615", "0.62164253", "0.6212387", "0.6211219", "0.6209521", "0.6201957", "0.61980826" ]
0.84678334
0
Display a listing of the resource.
public function getDashboardPage() { $emails = DB::table('emails')->latest()->paginate(5); return view('dashboard',['emails'=>$emails]); // Example------------------------------------------ // return view('dashboard',[ // 'emails'=>DB::table('emails')->latest()->paginate(4) // ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.7594873", "0.7594873", "0.75862724", "0.7577369", "0.75727355", "0.7500874", "0.74348205", "0.74339336", "0.7389178", "0.73531044", "0.73364365", "0.73124814", "0.7296061", "0.72818893", "0.7274119", "0.72423935", "0.72292763", "0.72266877", "0.7187332", "0.717915", "0.7174258", "0.7150343", "0.7144378", "0.7144238", "0.7134942", "0.7128289", "0.71236694", "0.7115823", "0.7115823", "0.7115823", "0.7112145", "0.70943975", "0.70857024", "0.70802104", "0.70800203", "0.7057187", "0.7057187", "0.7055648", "0.7039616", "0.7039533", "0.7036246", "0.70346695", "0.70305556", "0.7027626", "0.7026509", "0.70199776", "0.7017972", "0.70049554", "0.7003876", "0.7000925", "0.69973546", "0.6994639", "0.69937307", "0.69898754", "0.6986977", "0.69664884", "0.6965616", "0.69563985", "0.6951776", "0.69510984", "0.69472855", "0.69444585", "0.6942343", "0.69411284", "0.69378203", "0.69378203", "0.6936664", "0.69344825", "0.69317704", "0.69282645", "0.69263744", "0.6924216", "0.6918314", "0.6915855", "0.69128567", "0.6911424", "0.6910289", "0.69085616", "0.6903973", "0.6901382", "0.6901172", "0.6900354", "0.6895054", "0.6893486", "0.6893189", "0.68918854", "0.6891604", "0.6891604", "0.6889186", "0.6888053", "0.6887076", "0.6884677", "0.68822217", "0.6880916", "0.6875967", "0.68739045", "0.6873874", "0.6870332", "0.6869766", "0.68696475", "0.6868746" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $rules=$this->Validate($request,["email"=>"required | email", "name"=>"required", "info"=>"required", "phone"=>"required | starts_with:07,00964,+964 | max:15"]); $data=[ "name"=>$request->name, "phone"=>$request->phone, "email"=>$request->email, "info"=>$request->info, "link"=>$request->link ]; Email::create($data); return view('master'); }
{ "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.7286258", "0.71454436", "0.7132821", "0.6640289", "0.6621105", "0.6566493", "0.65255576", "0.65087926", "0.6448317", "0.63752604", "0.63736314", "0.6365631", "0.6365631", "0.6365631", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229" ]
0.0
-1
Display the specified resource.
public function show(Email $email) { // }
{ "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(Email $email) { // }
{ "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 editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\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($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function 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 return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::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 editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\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 \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n $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() \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 }" ]
[ "0.78557473", "0.76946205", "0.72731614", "0.7241571", "0.71700776", "0.70650244", "0.7052897", "0.698311", "0.69465625", "0.6944826", "0.69399333", "0.69286525", "0.69031185", "0.68969506", "0.68969506", "0.6878258", "0.6862812", "0.6859171", "0.68560475", "0.68436426", "0.6834711", "0.6810601", "0.680613", "0.6804975", "0.68015367", "0.6795471", "0.6791821", "0.6791821", "0.6787303", "0.6783644", "0.67790574", "0.67766285", "0.6767741", "0.67610145", "0.67455536", "0.67455536", "0.6744367", "0.6743159", "0.6739656", "0.67351145", "0.67246765", "0.67128825", "0.6692859", "0.66916454", "0.6687554", "0.66875297", "0.6687494", "0.6684443", "0.668203", "0.66689324", "0.66680384", "0.6664605", "0.6664605", "0.66621166", "0.66604865", "0.66589504", "0.6655767", "0.66542184", "0.665213", "0.66422516", "0.6631665", "0.663077", "0.6627607", "0.6627607", "0.66193914", "0.6618503", "0.66160196", "0.66146857", "0.6609641", "0.6608315", "0.6605284", "0.6595882", "0.65947276", "0.6594626", "0.65895563", "0.6589339", "0.6587281", "0.65805006", "0.6579201", "0.6579166", "0.657641", "0.6576111", "0.65740323", "0.65692765", "0.6568046", "0.6567221", "0.6565346", "0.6560687", "0.6560687", "0.6560384", "0.65577257", "0.65569293", "0.65558636", "0.6555392", "0.65553015", "0.65542984", "0.655418", "0.6554106", "0.6547678", "0.65473104", "0.6543329" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Email $email) { // }
{ "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(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(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(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);", "public function update($request, $id);", "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 }", "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 }", "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);", "abstract public function put($data);", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function testUpdateSupplierUsingPUT()\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 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 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 $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(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()\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);", "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 put($path, $data = null);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\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(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() {\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 $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.7424884", "0.7062319", "0.70572054", "0.6897199", "0.658233", "0.6450576", "0.6347209", "0.6211253", "0.6146092", "0.6121878", "0.6114851", "0.61005586", "0.608833", "0.60537165", "0.60196865", "0.60068345", "0.5972924", "0.594671", "0.5940615", "0.5938648", "0.58927333", "0.58618903", "0.5855116", "0.5855116", "0.58517504", "0.5816175", "0.5807103", "0.5753658", "0.5753658", "0.57354003", "0.5724066", "0.5714874", "0.56957984", "0.5692136", "0.5688278", "0.5670771", "0.5656715", "0.5651525", "0.5647887", "0.563695", "0.5635239", "0.5633743", "0.5633203", "0.56296664", "0.5622203", "0.56089646", "0.5602395", "0.55937296", "0.55837464", "0.5582684", "0.55814886", "0.5575469", "0.5572433", "0.55668694", "0.556366", "0.5562336", "0.55611396", "0.55611396", "0.55611396", "0.55611396", "0.55611396", "0.5560869", "0.55574787", "0.55562645", "0.5554329", "0.5553793", "0.5553788", "0.55448633", "0.55448294", "0.5541889", "0.55402213", "0.5537772", "0.55359083", "0.55358595", "0.55248064", "0.5520229", "0.5517453", "0.5513332", "0.5511126", "0.55085385", "0.5508433", "0.5503835", "0.5502763", "0.5501662", "0.5500294", "0.5498694", "0.5496697", "0.5496697", "0.5495247", "0.5494445", "0.5494331", "0.549349", "0.5492967", "0.5484066", "0.5480196", "0.5479421", "0.54788667", "0.546669", "0.5464114", "0.54621613", "0.5458347" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Email $email) { // }
{ "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
Return a value for the field.
public function __invoke($rootValue, array $args, GraphQLContext $context, ResolveInfo $resolveInfo) { $key = "example_key"; $cek = DB::table('users')->where('username', $args['username'])->first(); if(!$cek) throw new \GraphQL\Error\UserError('Data Tidak ditemukan'); if(!Hash::check($args['password'], $cek->password)) throw new \GraphQL\Error\UserError('Password Salah'); $payload = array( "iss" => "http://example.org", "aud" => "http://example.com", "iat" => time(), "nbf" => time(), "login" => time(), "user_id" => $cek->id ); return JWT::encode($payload, $key); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFieldValue()\n {\n return $this->value;\n }", "public function getValue(): mixed\n {\n return $this->field?->getValue();\n }", "function getFieldValue($field);", "public function getValue()\n {\n return $this->_fields['Value']['FieldValue'];\n }", "public function get_value() {\n return $this->value;\n }", "public function get_value()\n {\n return $this->value;\n }", "protected function getValue() {\r\n return $this->_value;\r\n }", "public function get_value()\n\t{\n\t\treturn $this->value;\n\t}", "function getValueFromField()\n {\n return $this->current_row[ key( $this->mapping ) ];\n }", "function getValue() {\n return $this->value;\n }", "public function get_value() {\n\t\treturn $this->_value;\n\t}", "function getValue(){\r\n\t\treturn $this->value;\r\n\t}", "public function value(): string\n {\n return $this->get('value');\n }", "public function getValue() {\n return $this->value;\n }", "public function getValue() {\n return $this->value;\n }", "public function getValue() {\n return $this->value;\n }", "function getValue()\n\t{\n\t\treturn $this->value;\n\t}", "function getValue()\n\t{\n\t\treturn $this->value;\n\t}", "public function getValue()\n {\n return $this->get(self::_VALUE);\n }", "public function getValue()\n {\n return $this->get(self::_VALUE);\n }", "public function value() { return $this->_m_value; }", "public function get_field_value($field)\n\t{\n\t\t//$field = strtoupper($field);\t\t\n\t\tif ($this->is_bound($field))\n\t\t{\n\t\t\treturn $this->get_bound_value($field);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->_fields[$field];\n\t\t}\n\t}", "function getValueFromField()\r\n\t{\r\n\t\treturn $this->row[ key( $this->mapping ) ];\r\n\t}", "public function getValue(){\n return $this->_value;\n }", "public function getValue()\r\n {\r\n return $this->value;\r\n }", "public function getValue()\n {\n return $this->_value;\n }", "public function getValue()\n {\n return $this->_value;\n }", "public function getValue()\n {\n return $this->_value;\n }", "public function getValue() {\n return $this->_value;\n }", "public function getValue()\n {\n return isset($this->value) ? $this->value : '';\n }", "public function getValue()\n {\n return isset($this->value) ? $this->value : '';\n }", "public function getValue() {\n\t\treturn $this -> value;\n\t}", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\r\n\t{\r\n\t\treturn $this->value;\r\n\t}", "public function getValue() {\n return $this->value;\n }", "public function getValue() {\n return $this->value;\n }", "public function getValue() {\n return $this->value;\n }", "public function getValue() {\n return $this->value;\n }", "public function getValue() {\n return $this->value;\n }", "public function getValue() {\n return $this->value;\n }", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue(){\n return $this->value;\n }", "public function getValue(){\n return $this->value;\n }", "public function getValue()\n\t{\n\t\treturn $this->_value;\n\t}", "public function getValue()\n\t{\n\t\treturn $this->_value;\n\t}", "public function getValue()\n {\n return $this->value instanceof CustomFieldEnumValueBuilder ? $this->value->build() : $this->value;\n }", "public function getValue()\n {\n\t\treturn $this->value;\n\t}", "public function getValue(){\n \treturn $this->value;\n }", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}" ]
[ "0.8479756", "0.8379301", "0.8064348", "0.79448414", "0.77689815", "0.77620524", "0.7700596", "0.7662676", "0.7641532", "0.76380265", "0.76324326", "0.7620745", "0.7607805", "0.7595676", "0.7595676", "0.7595676", "0.7579862", "0.7579862", "0.75784016", "0.75784016", "0.7574977", "0.7570436", "0.7568916", "0.755542", "0.75492287", "0.75457656", "0.75457656", "0.75457656", "0.75359535", "0.75315356", "0.75315356", "0.75246304", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7488932", "0.7482732", "0.7463622", "0.7463622", "0.7463622", "0.7463622", "0.7463622", "0.7463622", "0.7459058", "0.7459058", "0.7459058", "0.7459058", "0.7459058", "0.7459058", "0.74555546", "0.74555546", "0.7451619", "0.7451619", "0.74435806", "0.74404496", "0.74381", "0.7434099", "0.7434099", "0.7434099", "0.7434099" ]
0.0
-1
Get a raw asset by its UUID
public static function uuidRaw($uuid, $locale = null) { return self::assets()->getUuid($uuid, $locale); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_asset($id, $private = FALSE, $queryargs = array()) {\n return $this->get_item_of_type($id, 'asset', $private, $queryargs);\n }", "public function getAsset($asset)\n {\n $result = $this->newAPIRequest('GET', '/assets/'.$asset);\n return $result;\n }", "public function getAssetMapping(Uuid $uuid);", "public function getAsset(Component $component, $asset) {}", "public function getAssetById($id)\n\t{\n\t\treturn craft()->elements->getElementById($id, ElementType::Asset);\n\t}", "public function getAsset()\n {\n if ($this->asset === null) {\n $this->asset = AssetFacade::find($this->getAssetId());\n }\n\n return $this->asset;\n }", "public function get($uuid, $locale = null);", "function getFileById($uuid) {\r\n $sql = '\r\n SELECT\r\n *\r\n FROM\r\n files\r\n WHERE\r\n uuid = ?\r\n ORDER BY\r\n uuid DESC\r\n ';\r\n\r\n return $this->query_row($sql, array($uuid));\r\n }", "function resourceGet($args)\n {\n if(!array_key_exists('uuid', $args))\n {\n throw new Exception('Parameter uuid is not defined', MIDAS_INVALID_PARAMETER);\n }\n\n $uuid = $args['uuid'];\n $resource = $this->Component->Uuid->getByUid($uuid);\n\n if($resource == false)\n {\n throw new Exception('No resource for the given UUID.', MIDAS_INVALID_PARAMETER);\n }\n\n return $resource->toArray();\n }", "public function getAsset($id)\n\t{\n\t\treturn $this->getResourceChildObject('assets', $id);\n\t}", "public function get_remote_asset($id, $queryargs = array()) {\n return $this->get_item_of_type($id, 'remote-asset', $queryargs);\n }", "public function getAsset($id) {\n try {\n $objAsset = new Base_Model_ObtorLib_App_Core_Asset_Dao_Asset();\n $asset = $objAsset->getAsset($id);\n return $asset;\n } catch (Exception $e) {\n throw new Base_Model_ObtorLib_App_Core_Asset_Exception($e);\n }\n }", "public function getAsset()\n {\n return $this->hasOne(Asset::className(), ['id' => 'asset_id']);\n }", "public function load($uuid);", "function files_id_get($resource=\".files_meta\", $uuid) { // read one\n return resource_id_get($resource, $uuid);\n}", "public function findByUuid(string $uuid);", "public function get_asset_by_tp_media_id($tp_media_id) {\n /* Returns the corresponding asset if it exists. Note that they're\n * calling it tp_media_id, NOT tp_media_object_id */\n $query = \"/assets/legacy/?tp_media_id=\" . $tp_media_id;\n $response = $this->get_request($query);\n if (!empty($response[\"errors\"][\"info\"][\"http_code\"]) && $response[\"errors\"][\"info\"][\"http_code\"] == 404) {\n // If this video is private/unpublished, retry the edit endpoint.\n preg_match(\"/.*?(\\/assets\\/.*)\\/$/\", $response[\"errors\"][\"info\"][\"url\"], $output_array);\n if (!empty($output_array[1])) {\n $response = $this->get_request($output_array[1] . \"/edit/\");\n }\n }\n return $response;\n }", "public function getAsset()\n {\n return $this->hasOne(Asset::className(), ['asset_id' => 'asset_id']);\n }", "public function fetch($uuid) {\n $depositFile = $this->mapper->findByUuid($uuid);\n $file = $this->root->get($depositFile->getPath());\n\n $response = new StreamResponse($this->config->getSystemValue('datadirectory') . $file->getPath());\n $response->addHeader('Content-Type', $file->getMimeType());\n $response->addHeader('Content-Length', $file->getSize());\n return $response;\n }", "function uuidGet($args)\n {\n if(!array_key_exists('id', $args))\n {\n throw new Exception('Parameter id is not defined', MIDAS_INVALID_PARAMETER);\n }\n if(!array_key_exists('type', $args))\n {\n throw new Exception('Parameter type is not defined', MIDAS_INVALID_PARAMETER);\n }\n\n $id = $args['id'];\n $type = $args['type'];\n $modelLoad = new MIDAS_ModelLoader();\n switch($type)\n {\n case MIDAS_RESOURCE_ASSETSTORE:\n $model = $modelLoad->loadModel('Assetstore');\n break;\n case MIDAS_RESOURCE_BITSTREAM:\n $model = $modelLoad->loadModel('Bitstream');\n break;\n case MIDAS_RESOURCE_ITEM:\n $model = $modelLoad->loadModel('Item');\n break;\n case MIDAS_RESOURCE_COMMUNITY:\n $model = $modelLoad->loadModel('Community');\n break;\n case MIDAS_RESOURCE_REVISION:\n $model = $modelLoad->loadModel('ItemRevision');\n break;\n case MIDAS_RESOURCE_FOLDER:\n $model = $modelLoad->loadModel('Folder');\n break;\n case MIDAS_RESOURCE_USER:\n $model = $modelLoad->loadModel('User');\n break;\n default :\n throw new Zend_Exception(\"Undefined type\");\n }\n $dao = $model->load($id);\n\n if($dao == false)\n {\n throw new Exception('Invalid resource type or id.', MIDAS_INVALID_PARAMETER);\n }\n\n $uuid = $dao->getUuid();\n\n if($uuid == false)\n {\n throw new Exception('Invalid resource type or id.', MIDAS_INVALID_PARAMETER);\n }\n\n return $uuid;\n }", "public function getById(string $uuid): array;", "public function get($uuid)\n {\n $model = new static::$model;\n\n $resource = $model::with($model::getItemWith())->where($model->getKeyName(), '=', $uuid)->first();\n\n if (! $resource) {\n throw new NotFoundHttpException('Resource \\'' . class_basename(static::$model) . '\\' with given UUID ' . $uuid . ' not found');\n }\n\n $this->authorizeUserAction('view', $resource);\n\n return $this->response->item($resource, $this->getTransformer());\n }", "protected function retrieve(Asset $asset)\n {\n if (!$map = $this->getCache()->fetch((string) $asset)) {\n return null;\n }\n\n $identifier = isset($map[$this->getVendor()]) ? $map[$this->getVendor()] : null;\n\n $this->debug('Retrieve Asset identifier from vendor', [\n 'asset' => (string) $asset,\n 'vendor' => $this->getVendor(),\n 'identifier' => $identifier,\n ]);\n\n return $identifier;\n }", "public function getRootAssetMapping(Uuid $uuid);", "public function findByUUID($uuid) {\n\t\t$object = $this->persistenceManager->getObjectByIdentifier($uuid);\n\t\tif (is_a($object, $this->objectType)) {\n\t\t\treturn $object;\n\t\t} else {\n\t\t\treturn NULL;\n\t\t}\n\t}", "public static function getAsset() {\n if (Asset::$asset == null) {\n Asset::$asset = new Asset();\n }\n return Asset::$asset;\n }", "function getAssets();", "public function getOriginalAsset()\n {\n return $this->originalAsset;\n }", "public function Asset($params)\n {\n if (gettype($params) == \"string\") {\n $params = [$params];\n }\n $filename = $params[0];\n $Link = $this->_machine->plugin(\"Link\");\n return $Link->Get($this->_prefixDir . \"/assets/\" . $filename);\n }", "public function readObject($_UUID) {\n $sql = \"SELECT * FROM spartandata WHERE UUID = '$_UUID'\";\n $dataEntry = self::$conn->query($sql);\n\n if ($dataEntry->num_rows > 0) {\n while ($row = $dataEntry->fetch_assoc()) {\n echo \" ID: \" . $row[\"ID\"] . \" UUID: \" . $row[\"UUID\"] . \" Color: \" . $row[\"Color\"] . \"<br>\";\n }\n } else {\n echo \"Element Not Found\";\n }\n }", "public function pull(Request $request, $uuid)\n {\n $pack = Models\\Pack::where('uuid', $uuid)->first();\n\n if (! $pack) {\n return response()->json(['error' => 'No such pack.'], 404);\n }\n\n if (! Storage::exists('packs/' . $pack->uuid . '/archive.tar.gz')) {\n return response()->json(['error' => 'There is no archive available for this pack.'], 503);\n }\n\n return response()->download(storage_path('app/packs/' . $pack->uuid . '/archive.tar.gz'));\n }", "function getFile() {\n\t\treturn ArtifactStorage::instance()->get($this->getID());\n\t}", "public function getAssets();", "public function getAssets();", "public function getAsset($key, $path = null) {\n if (isset($path))\n return $this->m->Assets->getAsset($key, $path);\n return $this->info->getAsset($this->m->Assets, $key);\n }", "public function randomAssetAction()\n {\n\n $this->setAlbumUidRestrictions();\n\n $mediaAlbum = $this->mediaAlbumRepository->findRandom();\n $this->view->assign('mediaAlbum', $mediaAlbum);\n }", "function asset($asset)\n{\n return ASSET_PREFIX . '/'. $asset;\n}", "function getAssetById($assetid)\n {\n global $conn;\n $query=\"SELECT * FROM tbl_asset where id=\".$assetid;\n $response=array();\n $result=mysqli_query($conn, $query);\n $rows=mysqli_num_rows($result);\n if($rows > 0){\n while($row = mysqli_fetch_assoc($result))\n {\n $response[]=$row;\n }\n }\n else{\n array_push($response,\"No Data Found\");\n }\n\n header('Content-Type: application/json');\n echo json_encode($response);\n }", "public function getAssetKey(): string\n {\n }", "public function assetObject()\n {\n return $this->belongsTo('App\\Asset', 'assetID');\n }", "public function getAsset($type, $name)\n {\n return sprintf(\"%s/%s\", $this->$type, $name);\n }", "protected static function findWithUUID(string $tableName, string $theUUID)\n {\n return \\Illuminate\\Support\\Facades\\DB::table($tableName)->where('uuid', $theUUID)->first();\n }", "protected function getResourceEntity()\n\t{\n\t\treturn $this->arguments->getArgument(static::$RESOURCE_ARGUMENT_NAME)->getValue();\n\t}", "public function getAsset()\r\n\t{\r\n\t\treturn Yii::app()->assetManager->publish(YiiBase::getPathOfAlias('application.modules.dashboard.assets'), true, -1, YII_DEBUG);\r\n\t}", "public function getAssetId()\n {\n if (is_null($this->assetId)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_ASSET_ID);\n if (is_null($data)) {\n return null;\n }\n $this->assetId = (string) $data;\n }\n\n return $this->assetId;\n }", "public function show($uuid)\n {\n $query = qg(Import::where('uuid', $uuid))->select;\n $this->useSelect($query, Import::class);\n //TODO show content\n //custom select content\n $this->addSelectable($query, [\"content\"]);\n\n return $query->firstOrFail();\n }", "public function asset()\n {\n return $this->belongsTo(Asset::class, 'asset_id', 'id');\n }", "public function getAssetGuest()\n {\n return Asset::getAssets($this->command_guest_id, Asset::ASSETABLE_TEAM, NULL, true);\n }", "public function getResourceUuid()\n {\n return $this->resource_uuid;\n }", "function getAssetDatabaseId($asset=null){\n global $mysqli;\n $id = false;\n $results = $mysqli->query(\"SELECT id FROM assets WHERE asset='{$asset}' OR asset_longname='{$asset}' LIMIT 1\");\n if($results){\n $row = $results->fetch_assoc();\n $id = $row['id'];\n }\n return $id;\n}", "public function getStudyByID($uuid)\n {\n $url = $this->url.\"/studies/\".$uuid;\n return $this->getContent2($url);\n }", "public static function findByUuid($uuid) {\n\n if ( is_array($uuid) ) {\n\n return static::whereIn((new self)->getUuidFieldName(), $uuid)->get();\n }\n \n return static::byUuid($uuid)->first();\n }", "public function acquisition($uuid)\r\n {\r\n \t$_query = array('uuid' => $uuid);\r\n\r\n return $this->curl_execute($method = 'acquisition', $_query);\r\n }", "function getByGuid($id);", "public function getEntryReferenceByUuid($uuid);", "protected function assets()\n\t{\n\t\tswitch($this->method)\n\t\t{\n\t\t\tcase 'GET':\n\t\t\t\t\n\t\t\t\t$ev = 'read';\n\t\t\t\t$evObj = array(\"assettype\"=>$this->verb,\"args\"=>$this->args);\n\t\t\tbreak;\n\t\t\tcase 'POST':\n\t\t\t\t\n\t\t\t\t$ev = 'update';\n\t\t\t\t$evObj = array('id'=>$this->verb,'args'=>$this->args);\n\t\t\tbreak;\n\t\t\tcase 'PUT':\t\t\t\t\n\t\t\t\t$ev = 'create';\n\t\t\t\t$evObj = array('args'=>$this->verb);\n\t\t\tbreak;\n\t\t\tcase 'DELETE':\n\t\t\t\t\n\t\t\t\t$ev = 'delete';\n\t\t\t\t$evObj = array('id'=>$this->verb,'args'=>$this->args);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$this->fireEvent($this->endpoint,$ev,\"before\",$evObj);\n\t\t$obj = $this->$ev();\n\t\t$evObj['results']=$obj;\n\t\t$this->fireEvent($this->endpoint,$ev,\"after\",$evObj);\n\t\treturn $obj;\n\t}", "public function getObjectByIdentifier($uuid, $className) {\n\t\treturn $this->persistenceSession->getObjectByIdentifier($uuid, $className);\n\t}", "public function get($identifier);", "public function index()\n {\n if(empty($this->request->getQuery('uuid'))) throw new UnauthorizedException(__d('Trois/Attachment','Missing uuid'));\n\n return $this->Crud->execute();\n }", "public function getUuid()\n {\n return isset($this->source['uuid']) ? $this->source['uuid'] : null;\n }", "public function getMediaItem($id);", "public function get()\n {\n $file_path = $this->path();\n\n if (Storage::exists($file_path)) {\n\n return Storage::get($file_path);\n\n }\n }", "public function getCode()\n {\n return 'resource_to_asset';\n }", "public function get_resource();", "function GetResource( $identifier ) {\n\t\tfor( $i = 0; $i < $this->resElems->getLength(); $i++ ) {\n\t\t\t$tmpItem = $this->resElems->item($i);\n\t\t\tif( $tmpItem->getAttribute('identifier') == $identifier )\n\t\t\t return $tmpItem;\n\t\t}\n\t\treturn NULL;\n\t}", "public function findByGUID(string $guid)\n {\n return $this->entityManager->getRepository(Download::class)->findOneBy(['guid' => $guid]);\n }", "public function get_assets($queryargs = array()) {\n $query = \"/assets/\";\n return $this->get_list_data($query, $queryargs);\n }", "public function assets()\r\n {\r\n return $this->httpRequest(\"v2/assets\");\r\n }", "public function GetLoadFileUID($UID)\n {\n try{\n $file = FileUpload::where('UID', $UID)->first();\n if (!is_null($file)) \n {\n $fileLocation = $file->FileLocation;\n $response = new Response(Crypt::decrypt(Storage::get($fileLocation)), '200');\n $response->header('Content-Type', '');\n $response->header('Cache-Control','no-cache');\n \n return $response;\n }\n else\n {\n return new Response('File Not Found', '404');\n }\n }\n catch(Exception $ex)\n {\n return new Response('File Not Found', '404');\n }\n }", "public function getAssets()\n {\n\n }", "public function getAssetById(int $assetId, int $siteId = null)\n {\n /** @noinspection PhpIncompatibleReturnTypeInspection */\n return Craft::$app->getElements()->getElementById($assetId, Asset::class, $siteId);\n }", "static function getImage($_objectId)\n {\n return Db::query(\"SELECT *\n FROM Images \n WHERE ImageObject = ?\", $_objectId);\n }", "public function show($uuid)\n {\n if (! $rent = $this->rentRepo->findByUuid($uuid)) {\n return $this->response->errorNotFound('Rent not found');\n }\n\n return $this->response->item($rent, new RentTransformer);\n }", "public function show($uuid)\n {\n if (! $bike = $this->bikeRepo->findByUuid($uuid)) {\n return $this->response->errorNotFound('Bike not found');\n }\n\n return $this->response->item($bike, new BikeTransformer());\n }", "public function getAvatar($identity);", "public function getAccount($account_uuid) {\n $result = $this->newAPIRequest('GET', '/account/'.$account_uuid);\n return $result;\n }", "public function getFilterImage($identifier)\n {\n $filterId = Yii::$app->storage->getFilterId($identifier);\n return $this->hasOne(self::class, ['file_id' => 'file_id'])->andWhere(['filter_id' => $filterId]);\n }", "public function getByUid($uid)\n {\n $storage = array_values($this->storage);\n foreach ($storage as $item) {\n /* @var $galleryItem GalleryItem */\n $galleryItem = $item['obj'];\n\n if ((string) $uid === (string) $galleryItem->getUid()) {\n return $galleryItem;\n }\n }\n\n return null;\n }", "function basset(string $asset): string\n {\n $status = Basset::basset($asset, false);\n\n if (in_array($status, [StatusEnum::DISABLED, StatusEnum::INVALID])) {\n return $asset;\n }\n\n return Basset::getUrl($asset);\n }", "public function findMediaDownloadByIdentifier($media_identifier)\n{\n $sql = \"SELECT ID, media_id, media_identifier, before_expired, ip_address, created_at\n FROM tbl_media_download\n WHERE media_identifier = ?\";\n\n $this->setSQL($sql);\n\n $item = $this->findAll([$media_identifier]);\n\n return (empty($item)) ?: $item;\n\n}", "public function getRow($uuid, $onlyActive = false){\n $where = array('uuid' => $uuid);\n if(!$onlyActive){\n $where = array('AND' => array_merge($where, array('alive' => 1)));\n }\n $result = $this->JACKED->Syrup->DatasBeardRow->findOne($where);\n if(count($result)){\n $ret = $this->arrayFromBlob($result->content);\n }else{\n throw new DatasBeardRowNotFoundException($uuid);\n }\n\n $ret['uuid'] = $result->uuid;\n\n return $ret;\n }", "public function getBaseAssetId()\n {\n if( isset( $this->getProperty()->baseAssetId ) )\n return $this->getProperty()->baseAssetId;\n return NULL;\n }", "public function getUuid($uuid, $locale = null)\n {\n return $this->cache->getUuid($uuid, $locale);\n }", "public function get($parentUuid, $uuid)\n {\n // Check parent exists\n $parentModel = static::$parentModel;\n $parentResource = $parentModel::findOrFail($parentUuid);\n\n // Authorize ability to view children model for parent\n $this->authorizeUserAction($this->parentAbilitiesRequired['view'], $parentResource);\n\n // Get resource\n $model = new static::$model;\n $resource = $model::with($model::getItemWith())->where($model->getKeyName(), '=', $uuid)->firstOrFail();\n\n // Check resource belongs to parent\n if ($resource->getAttribute($parentResource->getKeyName()) != $parentResource->getKey()) {\n throw new AccessDeniedHttpException('Resource \\'' . class_basename(static::$model) . '\\' with given UUID ' . $uuid . ' does not belong to ' .\n 'resource \\'' . class_basename(static::$parentModel) . '\\' with given UUID ' . $parentUuid . '; ');\n }\n\n if (! $resource) {\n throw new NotFoundHttpException('Resource \\'' . class_basename(static::$model) . '\\' with given UUID ' . $uuid . ' not found');\n }\n\n // Authorize ability to create this model\n $this->authorizeUserAction('view', $resource);\n\n return $this->response->item($resource, $this->getTransformer());\n }", "public function getObject($resourceName)\n {\n try {\n $imageStore = $this->getImageStoreClient();\n $result = $imageStore->getObject(\n array(\n 'Bucket' => $this->customerBucket,\n 'Key' => $this->getQualifiedResourceName($resourceName)\n )\n );\n $result = $result->toArray();\n $metaData = empty($result['Metadata']) ? array() : $result['Metadata'];\n $object = array(\n \"resource_name\" => $resourceName,\n \"resource_url\" => $this->baseUrl . $this->getQualifiedResourceName($resourceName),\n \"object_size\" => $result['ContentLength'],\n \"mime_type\" => $result['ContentType'],\n \"metadata\" => $metaData,\n );\n return $object;\n } catch (Exception $e) {\n throw new Exception(\"getObject Failure: \" . $e->getMessage());\n }\n }", "public function getResource($resourceId);", "function get_file($hash_id = null)\r\n\t{\r\n\t\t\r\n\t}", "public function find($aggregate_uuid, $version = null)\n {\n return $this->load($aggregate_uuid, $version);\n }", "public function getOne($id)\n {\n return $this->get('sonata.media.manager.media')->findOneBy(array(\n 'id' => $id,\n 'providerName' => 'sonata.media.provider.custom'\n ));\n }", "function asset($url = '')\n{\n return ASSET . $url;\n}", "public static function data($id)\n {\n $filesTable = static::_setupFilesTable();\n $file = $filesTable->get($id);\n if (!empty($file) && is_object($file)) {\n return $file;\n }\n throw new NotFoundException('The Panda was unable to retrieve the requested file.');\n }", "private function loadAsset(Space $space, string $id): Asset\n {\n return $this->contentful->loadContentfulAsset($space->getId() . '|' . $id);\n }", "public function getFrom($resource);", "public function getOneByView($view)\n {\n $repositoryImage = $this->em->getRepository('DATAImageBundle:Image');\n\t return $repositoryImage->findOneByView($view);\n }", "function getFileFromStorage($fullpath, $storage = 'public')\n{\n if ($storage == 'storage') {\n return route('read_file', $fullpath);\n }\n return my_asset($fullpath);\n}", "abstract public function getSingle(string $path);", "public function asset($asset = null)\n {\n if (! file_exists($manifest = $this->path . 'public/mix-manifest.json')) {\n return $this->uri . $asset;\n }\n\n $manifest = json_decode(file_get_contents($manifest), true);\n\n return $this->uri . ($manifest[$asset] ?? $asset);\n }", "public function get_raw_as_resource(PodioClient $podio_client, $size = null)\n {\n /** @noinspection PhpIncompatibleReturnTypeInspection */\n return $podio_client->get($this->get_download_link($size), array(), array('file_download' => true, 'return_raw_as_resource_only' => true));\n }", "public static function getAssets($assetableId, $assetableType, $thumbnail, $single = false)\n {\n $query = Asset::find()\n ->where([\n 'assetable_id' => $assetableId,\n 'assetable_type' => $assetableType,\n 'thumbnail' => $thumbnail,\n ]);\n\n if(!$single) {\n $models = $query->all();\n return $models;\n } \n $model = $query->one();\n return $model == null ? new Asset : $model;\n }", "protected function actionGetByPrimaryKey($primaryKey)\n {\n return $this->_static_block->getByPrimaryKey($primaryKey);\n }" ]
[ "0.65787435", "0.6426662", "0.642404", "0.62226254", "0.61707807", "0.6095904", "0.599809", "0.59961855", "0.59602207", "0.59051216", "0.5785377", "0.5750855", "0.5722788", "0.5721578", "0.5685218", "0.56083983", "0.5597529", "0.553794", "0.54716593", "0.5465606", "0.54591125", "0.54518974", "0.5434152", "0.54269725", "0.53592026", "0.53507817", "0.5338385", "0.5335936", "0.5330502", "0.53286785", "0.5323092", "0.5321252", "0.5311395", "0.5311395", "0.5281538", "0.52100235", "0.51986057", "0.5186172", "0.5170941", "0.5142974", "0.5136447", "0.5062452", "0.5051838", "0.50513524", "0.50487995", "0.50483066", "0.5039541", "0.50322443", "0.5031765", "0.5007252", "0.50071234", "0.5004987", "0.5004165", "0.4966779", "0.49543887", "0.4947395", "0.49215764", "0.49136183", "0.4904357", "0.4903023", "0.49023786", "0.4889943", "0.48820177", "0.48774496", "0.48749554", "0.48728126", "0.48713666", "0.48587438", "0.48557094", "0.48515567", "0.48493853", "0.48440152", "0.484335", "0.48383936", "0.48381394", "0.48345184", "0.48236728", "0.48193806", "0.48173812", "0.4813568", "0.48125845", "0.48107934", "0.48062867", "0.4799601", "0.47989154", "0.47960415", "0.4789056", "0.47878107", "0.47844678", "0.47842366", "0.47774372", "0.47716174", "0.47618535", "0.47588873", "0.47545588", "0.47442165", "0.4742043", "0.473972", "0.47389308", "0.4729333" ]
0.5887764
10
Get an asset by its UUID
public static function uuid($uuid, $locale = null) { return self::uuidRaw($uuid, $locale)->toArray(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAsset($asset)\n {\n $result = $this->newAPIRequest('GET', '/assets/'.$asset);\n return $result;\n }", "public function get_asset($id, $private = FALSE, $queryargs = array()) {\n return $this->get_item_of_type($id, 'asset', $private, $queryargs);\n }", "public function get($uuid, $locale = null);", "public function getAssetMapping(Uuid $uuid);", "public function getAsset(Component $component, $asset) {}", "public function getAsset($id)\n\t{\n\t\treturn $this->getResourceChildObject('assets', $id);\n\t}", "public function getAssetById($id)\n\t{\n\t\treturn craft()->elements->getElementById($id, ElementType::Asset);\n\t}", "public function getAsset()\n {\n if ($this->asset === null) {\n $this->asset = AssetFacade::find($this->getAssetId());\n }\n\n return $this->asset;\n }", "public function getAsset($id) {\n try {\n $objAsset = new Base_Model_ObtorLib_App_Core_Asset_Dao_Asset();\n $asset = $objAsset->getAsset($id);\n return $asset;\n } catch (Exception $e) {\n throw new Base_Model_ObtorLib_App_Core_Asset_Exception($e);\n }\n }", "function resourceGet($args)\n {\n if(!array_key_exists('uuid', $args))\n {\n throw new Exception('Parameter uuid is not defined', MIDAS_INVALID_PARAMETER);\n }\n\n $uuid = $args['uuid'];\n $resource = $this->Component->Uuid->getByUid($uuid);\n\n if($resource == false)\n {\n throw new Exception('No resource for the given UUID.', MIDAS_INVALID_PARAMETER);\n }\n\n return $resource->toArray();\n }", "public function findByUuid(string $uuid);", "protected function retrieve(Asset $asset)\n {\n if (!$map = $this->getCache()->fetch((string) $asset)) {\n return null;\n }\n\n $identifier = isset($map[$this->getVendor()]) ? $map[$this->getVendor()] : null;\n\n $this->debug('Retrieve Asset identifier from vendor', [\n 'asset' => (string) $asset,\n 'vendor' => $this->getVendor(),\n 'identifier' => $identifier,\n ]);\n\n return $identifier;\n }", "function getFileById($uuid) {\r\n $sql = '\r\n SELECT\r\n *\r\n FROM\r\n files\r\n WHERE\r\n uuid = ?\r\n ORDER BY\r\n uuid DESC\r\n ';\r\n\r\n return $this->query_row($sql, array($uuid));\r\n }", "public function getAsset()\n {\n return $this->hasOne(Asset::className(), ['id' => 'asset_id']);\n }", "public function load($uuid);", "public function get($uuid)\n {\n $model = new static::$model;\n\n $resource = $model::with($model::getItemWith())->where($model->getKeyName(), '=', $uuid)->first();\n\n if (! $resource) {\n throw new NotFoundHttpException('Resource \\'' . class_basename(static::$model) . '\\' with given UUID ' . $uuid . ' not found');\n }\n\n $this->authorizeUserAction('view', $resource);\n\n return $this->response->item($resource, $this->getTransformer());\n }", "public function get_remote_asset($id, $queryargs = array()) {\n return $this->get_item_of_type($id, 'remote-asset', $queryargs);\n }", "public function get_asset_by_tp_media_id($tp_media_id) {\n /* Returns the corresponding asset if it exists. Note that they're\n * calling it tp_media_id, NOT tp_media_object_id */\n $query = \"/assets/legacy/?tp_media_id=\" . $tp_media_id;\n $response = $this->get_request($query);\n if (!empty($response[\"errors\"][\"info\"][\"http_code\"]) && $response[\"errors\"][\"info\"][\"http_code\"] == 404) {\n // If this video is private/unpublished, retry the edit endpoint.\n preg_match(\"/.*?(\\/assets\\/.*)\\/$/\", $response[\"errors\"][\"info\"][\"url\"], $output_array);\n if (!empty($output_array[1])) {\n $response = $this->get_request($output_array[1] . \"/edit/\");\n }\n }\n return $response;\n }", "public function findByUUID($uuid) {\n\t\t$object = $this->persistenceManager->getObjectByIdentifier($uuid);\n\t\tif (is_a($object, $this->objectType)) {\n\t\t\treturn $object;\n\t\t} else {\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getAsset()\n {\n return $this->hasOne(Asset::className(), ['asset_id' => 'asset_id']);\n }", "function uuidGet($args)\n {\n if(!array_key_exists('id', $args))\n {\n throw new Exception('Parameter id is not defined', MIDAS_INVALID_PARAMETER);\n }\n if(!array_key_exists('type', $args))\n {\n throw new Exception('Parameter type is not defined', MIDAS_INVALID_PARAMETER);\n }\n\n $id = $args['id'];\n $type = $args['type'];\n $modelLoad = new MIDAS_ModelLoader();\n switch($type)\n {\n case MIDAS_RESOURCE_ASSETSTORE:\n $model = $modelLoad->loadModel('Assetstore');\n break;\n case MIDAS_RESOURCE_BITSTREAM:\n $model = $modelLoad->loadModel('Bitstream');\n break;\n case MIDAS_RESOURCE_ITEM:\n $model = $modelLoad->loadModel('Item');\n break;\n case MIDAS_RESOURCE_COMMUNITY:\n $model = $modelLoad->loadModel('Community');\n break;\n case MIDAS_RESOURCE_REVISION:\n $model = $modelLoad->loadModel('ItemRevision');\n break;\n case MIDAS_RESOURCE_FOLDER:\n $model = $modelLoad->loadModel('Folder');\n break;\n case MIDAS_RESOURCE_USER:\n $model = $modelLoad->loadModel('User');\n break;\n default :\n throw new Zend_Exception(\"Undefined type\");\n }\n $dao = $model->load($id);\n\n if($dao == false)\n {\n throw new Exception('Invalid resource type or id.', MIDAS_INVALID_PARAMETER);\n }\n\n $uuid = $dao->getUuid();\n\n if($uuid == false)\n {\n throw new Exception('Invalid resource type or id.', MIDAS_INVALID_PARAMETER);\n }\n\n return $uuid;\n }", "public function getById(string $uuid): array;", "function getByGuid($id);", "function files_id_get($resource=\".files_meta\", $uuid) { // read one\n return resource_id_get($resource, $uuid);\n}", "public function getAsset($key, $path = null) {\n if (isset($path))\n return $this->m->Assets->getAsset($key, $path);\n return $this->info->getAsset($this->m->Assets, $key);\n }", "public static function getAsset() {\n if (Asset::$asset == null) {\n Asset::$asset = new Asset();\n }\n return Asset::$asset;\n }", "public function getOrder($url, $orderUUID);", "function getAssetDatabaseId($asset=null){\n global $mysqli;\n $id = false;\n $results = $mysqli->query(\"SELECT id FROM assets WHERE asset='{$asset}' OR asset_longname='{$asset}' LIMIT 1\");\n if($results){\n $row = $results->fetch_assoc();\n $id = $row['id'];\n }\n return $id;\n}", "protected static function findWithUUID(string $tableName, string $theUUID)\n {\n return \\Illuminate\\Support\\Facades\\DB::table($tableName)->where('uuid', $theUUID)->first();\n }", "public function asset()\n {\n return $this->belongsTo(Asset::class, 'asset_id', 'id');\n }", "public function getEntryReferenceByUuid($uuid);", "function getAssetById($assetid)\n {\n global $conn;\n $query=\"SELECT * FROM tbl_asset where id=\".$assetid;\n $response=array();\n $result=mysqli_query($conn, $query);\n $rows=mysqli_num_rows($result);\n if($rows > 0){\n while($row = mysqli_fetch_assoc($result))\n {\n $response[]=$row;\n }\n }\n else{\n array_push($response,\"No Data Found\");\n }\n\n header('Content-Type: application/json');\n echo json_encode($response);\n }", "public function get($identifier);", "public function pull(Request $request, $uuid)\n {\n $pack = Models\\Pack::where('uuid', $uuid)->first();\n\n if (! $pack) {\n return response()->json(['error' => 'No such pack.'], 404);\n }\n\n if (! Storage::exists('packs/' . $pack->uuid . '/archive.tar.gz')) {\n return response()->json(['error' => 'There is no archive available for this pack.'], 503);\n }\n\n return response()->download(storage_path('app/packs/' . $pack->uuid . '/archive.tar.gz'));\n }", "public function findByGUID(string $guid)\n {\n return $this->entityManager->getRepository(Download::class)->findOneBy(['guid' => $guid]);\n }", "public function Asset($params)\n {\n if (gettype($params) == \"string\") {\n $params = [$params];\n }\n $filename = $params[0];\n $Link = $this->_machine->plugin(\"Link\");\n return $Link->Get($this->_prefixDir . \"/assets/\" . $filename);\n }", "function getAssets();", "public function show($uuid)\n {\n $query = qg(Import::where('uuid', $uuid))->select;\n $this->useSelect($query, Import::class);\n //TODO show content\n //custom select content\n $this->addSelectable($query, [\"content\"]);\n\n return $query->firstOrFail();\n }", "public static function findByUuid($uuid) {\n\n if ( is_array($uuid) ) {\n\n return static::whereIn((new self)->getUuidFieldName(), $uuid)->get();\n }\n \n return static::byUuid($uuid)->first();\n }", "public function getAccount($account_uuid) {\n $result = $this->newAPIRequest('GET', '/account/'.$account_uuid);\n return $result;\n }", "public function assetObject()\n {\n return $this->belongsTo('App\\Asset', 'assetID');\n }", "public function readObject($_UUID) {\n $sql = \"SELECT * FROM spartandata WHERE UUID = '$_UUID'\";\n $dataEntry = self::$conn->query($sql);\n\n if ($dataEntry->num_rows > 0) {\n while ($row = $dataEntry->fetch_assoc()) {\n echo \" ID: \" . $row[\"ID\"] . \" UUID: \" . $row[\"UUID\"] . \" Color: \" . $row[\"Color\"] . \"<br>\";\n }\n } else {\n echo \"Element Not Found\";\n }\n }", "function asset($asset)\n{\n return ASSET_PREFIX . '/'. $asset;\n}", "public function acquisition($uuid)\r\n {\r\n \t$_query = array('uuid' => $uuid);\r\n\r\n return $this->curl_execute($method = 'acquisition', $_query);\r\n }", "public function getRootAssetMapping(Uuid $uuid);", "public function getAssetKey(): string\n {\n }", "public function fetch($uuid) {\n $depositFile = $this->mapper->findByUuid($uuid);\n $file = $this->root->get($depositFile->getPath());\n\n $response = new StreamResponse($this->config->getSystemValue('datadirectory') . $file->getPath());\n $response->addHeader('Content-Type', $file->getMimeType());\n $response->addHeader('Content-Length', $file->getSize());\n return $response;\n }", "public function getAssets();", "public function getAssets();", "public function getAssetId()\n {\n if (is_null($this->assetId)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_ASSET_ID);\n if (is_null($data)) {\n return null;\n }\n $this->assetId = (string) $data;\n }\n\n return $this->assetId;\n }", "public function getCustomer($url, $customerUUID);", "public function show($id)\n {\n //\n $asset = Assets::find($id);\n return view('assets.show',compact('asset'));\n }", "public function getByUid($uid)\n {\n $storage = array_values($this->storage);\n foreach ($storage as $item) {\n /* @var $galleryItem GalleryItem */\n $galleryItem = $item['obj'];\n\n if ((string) $uid === (string) $galleryItem->getUid()) {\n return $galleryItem;\n }\n }\n\n return null;\n }", "public function getAsset($type, $name)\n {\n return sprintf(\"%s/%s\", $this->$type, $name);\n }", "public function find($aggregate_uuid, $version = null)\n {\n return $this->load($aggregate_uuid, $version);\n }", "function GetResource( $identifier ) {\n\t\tfor( $i = 0; $i < $this->resElems->getLength(); $i++ ) {\n\t\t\t$tmpItem = $this->resElems->item($i);\n\t\t\tif( $tmpItem->getAttribute('identifier') == $identifier )\n\t\t\t return $tmpItem;\n\t\t}\n\t\treturn NULL;\n\t}", "private function getBuyerByUid($uuid) {\n $entityManager = $this->getDoctrine()->getManager();\n $date = new \\DateTime('now');\n $buyersList = $entityManager->getRepository('DppBuyersBundle:Buyer')->findBy(array('uuid' => $uuid));\n // register if noexist\n if ($buyersList == null) {\n $buyer = new Buyer(); \n $buyer->setUuid($uuid);\n $buyer->setFirstAccess($date);\n $buyer->setLastAccess($date);\n $entityManager->persist($buyer);\n } else {\n $buyer = $buyersList[0];\n $buyer->setLastAccess($date);\n }\n $entityManager->flush();\n return $buyer;\n }", "public static function findUsingUUID(string $tableName, string $theUUID)\n {\n return static::findWithUUID($tableName, $theUUID);\n }", "public static function get($uuid, $class = null, $column = null) {\n\t\tif(is_null($column) || $column == 'id') {\n\t\t\tif(static::has($uuid)) {\n\t\t\t\t$instance = static::$cache[$uuid];\n\t\t\t\tif(! is_null($class) && ! is_a($instance, $class))\n\t\t\t\t\tthrow new Cache_WrongType_Exception(\"Found object with the wrong instance type : \".$uuid);\n\t\t\t\treturn $instance;\n\t\t\t}\n\t\t\tthrow new Cache_NotFound_Exception(\"Nothing for this uuid : \".$uuid);\n\t\t} else if(isset(static::$mapping[$column][$uuid]))\n\t\t\treturn static::get(static::$mapping[$column][$uuid], $class);\n\t\tthrow new Cache_NoMapping_Exception(\"No mapping found for : $column and uuid $uuid.\");\n\t}", "public function get_assets($queryargs = array()) {\n $query = \"/assets/\";\n return $this->get_list_data($query, $queryargs);\n }", "public function deleteAsset() {\n try {\n if (!($this->asset instanceof Base_Model_ObtorLib_App_Core_Asset_Entity_Asset)) {\n throw new Base_Model_ObtorLib_App_Core_Asset_Exception(\" Asset Asset Entity not initialized\");\n } else {\n $objAsset = new Base_Model_ObtorLib_App_Core_Asset_Dao_Asset();\n $objAsset->asset = $this->asset;\n return $objAsset->deleteAsset();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Asset_Exception($ex);\n }\n }", "function getFile() {\n\t\treturn ArtifactStorage::instance()->get($this->getID());\n\t}", "public function getGlobalReferenceByUuid($uuid);", "public function getPageReferenceByUuid($uuid);", "public function show($uuid)\n {\n if (! $bike = $this->bikeRepo->findByUuid($uuid)) {\n return $this->response->errorNotFound('Bike not found');\n }\n\n return $this->response->item($bike, new BikeTransformer());\n }", "public function getObjectByIdentifier($uuid, $className) {\n\t\treturn $this->persistenceSession->getObjectByIdentifier($uuid, $className);\n\t}", "public static function getAssets($assetableId, $assetableType, $thumbnail, $single = false)\n {\n $query = Asset::find()\n ->where([\n 'assetable_id' => $assetableId,\n 'assetable_type' => $assetableType,\n 'thumbnail' => $thumbnail,\n ]);\n\n if(!$single) {\n $models = $query->all();\n return $models;\n } \n $model = $query->one();\n return $model == null ? new Asset : $model;\n }", "public function getUuid($uuid, $locale = null)\n {\n return $this->cache->getUuid($uuid, $locale);\n }", "public function getAssetById(int $assetId, int $siteId = null)\n {\n /** @noinspection PhpIncompatibleReturnTypeInspection */\n return Craft::$app->getElements()->getElementById($assetId, Asset::class, $siteId);\n }", "public function load($uuid)\n {\n $deploymentNodes = $this->findAll();\n if (array_key_exists($uuid, $deploymentNodes)) {\n return $deploymentNodes[$uuid];\n }\n }", "public function getOneByView($view)\n {\n $repositoryImage = $this->em->getRepository('DATAImageBundle:Image');\n\t return $repositoryImage->findOneByView($view);\n }", "public function getStudyByID($uuid)\n {\n $url = $this->url.\"/studies/\".$uuid;\n return $this->getContent2($url);\n }", "public function getItem($id) {\n $item_url = $this->constructItemUrl($id);\n // Get the JSON object at the specified URL\n $json = $this->loadJSONUrl($item_url);\n if ($json) {\n return $json;\n }\n else {\n $migration = Migration::currentMigration();\n $message = t('Loading of !objecturl failed:', array('!objecturl' => $item_url));\n $migration->getMap()->saveMessage(\n array($id), $message, MigrationBase::MESSAGE_ERROR);\n return NULL;\n }\n }", "public function randomAssetAction()\n {\n\n $this->setAlbumUidRestrictions();\n\n $mediaAlbum = $this->mediaAlbumRepository->findRandom();\n $this->view->assign('mediaAlbum', $mediaAlbum);\n }", "public function getAssetGuest()\n {\n return Asset::getAssets($this->command_guest_id, Asset::ASSETABLE_TEAM, NULL, true);\n }", "public function show($uuid)\n {\n if (! $rent = $this->rentRepo->findByUuid($uuid)) {\n return $this->response->errorNotFound('Rent not found');\n }\n\n return $this->response->item($rent, new RentTransformer);\n }", "public function get(string $id);", "public function asset($asset = null)\n {\n if (! file_exists($manifest = $this->path . 'public/mix-manifest.json')) {\n return $this->uri . $asset;\n }\n\n $manifest = json_decode(file_get_contents($manifest), true);\n\n return $this->uri . ($manifest[$asset] ?? $asset);\n }", "public function getAsset()\r\n\t{\r\n\t\treturn Yii::app()->assetManager->publish(YiiBase::getPathOfAlias('application.modules.dashboard.assets'), true, -1, YII_DEBUG);\r\n\t}", "private function loadAsset(Space $space, string $id): Asset\n {\n return $this->contentful->loadContentfulAsset($space->getId() . '|' . $id);\n }", "public function getDeveloper($uuid)\n {\n }", "public function testShowAsset()\n {\n // 1. Create mock\n $admin = $this->admin;\n // 2. Hit Api Endpoint\n $response = $this->actingAs($admin)->get(route('asset.show', $this->asset));\n // 3. Verify and Assertion\n $response->assertStatus(Response::HTTP_OK);\n }", "public function hasAssetMapping(Uuid $uuid);", "function get(string $id);", "public function getAdvertiser(Request $request){\n return $this->repository->find((int) $request->route()->parameter('id'));\n }", "public function show($uuid)\n {\n return response()->json(\n $this->docs->find($uuid)\n );\n }", "public function getMediaItem($id);", "function asset($url = '')\n{\n return ASSET . $url;\n}", "abstract public function get($id);", "abstract public function get($id);", "abstract public function get($id);", "public function getComponent()\n {\n return $this->hasOne(Asset::className(), ['id' => 'component_id']);\n }", "protected function getNodeByUuid($uuid) {\n\n $nodes = $this->getNodeStorage()\n ->loadByProperties(\n [\n 'type' => $this->getType(),\n 'uuid' => $uuid,\n ]\n );\n // Uuid should be universally unique and always return\n // a single node.\n return current($nodes);\n }", "public abstract function get($id);", "public function show($id)\n {\n $asset = Asset::findOrFail($id);\n\n return View('assets.show', compact('asset'));\n }", "public function get( $id );", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);" ]
[ "0.68128", "0.6791113", "0.6654394", "0.66366136", "0.64443743", "0.63976043", "0.6384946", "0.6377226", "0.6242612", "0.62087935", "0.6110482", "0.60111946", "0.600966", "0.5979752", "0.5976832", "0.59351414", "0.5924776", "0.58526057", "0.58455074", "0.579314", "0.57918704", "0.5737872", "0.5703634", "0.5678548", "0.56260836", "0.5573709", "0.55613005", "0.5494412", "0.54835856", "0.5462992", "0.5461584", "0.5460956", "0.5421637", "0.54204756", "0.5394574", "0.5394243", "0.53648496", "0.5359754", "0.5324588", "0.53084457", "0.5295431", "0.52599657", "0.5259297", "0.52515674", "0.5237283", "0.52372503", "0.5229381", "0.5224538", "0.5224538", "0.5217086", "0.5186312", "0.51841295", "0.5182576", "0.5176207", "0.51719165", "0.51693714", "0.51465726", "0.51452386", "0.51443917", "0.5133253", "0.51262945", "0.5124783", "0.51212347", "0.5112726", "0.511235", "0.5110816", "0.51087075", "0.5107928", "0.51026326", "0.5102211", "0.5095821", "0.50789326", "0.5074255", "0.5067057", "0.5059724", "0.50460464", "0.50425553", "0.5038077", "0.5017295", "0.50091064", "0.5003077", "0.4988388", "0.4986406", "0.4980821", "0.49688992", "0.49683687", "0.4961286", "0.4945356", "0.4937858", "0.4937858", "0.4937858", "0.49375078", "0.4926736", "0.49227875", "0.49207065", "0.4917051", "0.49091458", "0.49091458", "0.49091458", "0.49091458", "0.49091458" ]
0.0
-1
Get an asset by its path
public static function path($path) { return Assets::all()->filter(function ($asset) use ($path) { return $asset->resolvedPath() === $path; })->first(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAsset($key, $path = null) {\n if (isset($path))\n return $this->m->Assets->getAsset($key, $path);\n return $this->info->getAsset($this->m->Assets, $key);\n }", "static function asset($path)\n {\n return Assets::src($path);\n }", "public function asset(string $path)\n {\n $filename = basename($path);\n $assetsFile = configFileSystem::getSiteRoot() . '/public/assets.json';\n if (!file_exists($assetsFile)) {\n return $path; \n }\n\n $fileParts = explode('.', $filename);\n $jsonFile = json_decode(file_get_contents($assetsFile), true);\n\n if (!array_key_exists($fileParts[0], $jsonFile)) {\n return $path; \n }\n\n if (!array_key_exists($fileParts[1], $jsonFile[$fileParts[0]])) {\n return $path; \n }\n\n return $jsonFile[$fileParts[0]][$fileParts[1]];\n }", "public function getAsset($asset)\n {\n $result = $this->newAPIRequest('GET', '/assets/'.$asset);\n return $result;\n }", "public function getAsset(string $path): string\n {\n if (!empty($path)) {\n $paths = explode('/', $path);\n\n $type = !empty($paths[0]) ? $paths[0] : '';\n $asset = !empty($paths[1]) ? $paths[1] : '';\n\n if (!empty($type) && !empty($asset)) {\n return (string) $this->dependencies[$type][$asset];\n }\n\n if (!empty($type)) {\n return (string) $this->dependencies[$type];\n }\n }\n\n return '';\n }", "public function getAsset(Component $component, $asset) {}", "function asset( $path ) {\n\n\t\tif ( ! $this->mix ) {\n\t\t\t$file = $this->path( 'public/mix-manifest.json' );\n\t\t\t$this->mix = (array) json_decode( file_get_contents( $file ), true );\n\t\t}\n\n\t\t// Make sure to trim any slashes from the front of the path.\n\t\t$path = '/' . ltrim( $path, '/' );\n\n\t\tif ( $this->mix && isset( $this->mix[ $path ] ) ) {\n\t\t\t$path = $this->mix[ $path ];\n\t\t}\n\n\t\treturn $this->uri( 'public' . $path );\n\t}", "public function Asset($params)\n {\n if (gettype($params) == \"string\") {\n $params = [$params];\n }\n $filename = $params[0];\n $Link = $this->_machine->plugin(\"Link\");\n return $Link->Get($this->_prefixDir . \"/assets/\" . $filename);\n }", "function asset( string $asset, ?string $path = null ): string\n {\n return Asset::url( $asset, $path );\n }", "public function getAsset($id)\n\t{\n\t\treturn $this->getResourceChildObject('assets', $id);\n\t}", "public function get($path);", "public function get($path);", "public function get($path)\n {\n if ($this->check($path)) return File::get($path);\n }", "private function getBuilderAsset($path)\n {\n return Storage::disk('builder')->get($path);\n }", "public function getAsset()\n {\n if ($this->asset === null) {\n $this->asset = AssetFacade::find($this->getAssetId());\n }\n\n return $this->asset;\n }", "public static function getAsset() {\n if (Asset::$asset == null) {\n Asset::$asset = new Asset();\n }\n return Asset::$asset;\n }", "function asset($path) {\n echo getAbsolutePath() . \"public/$path\";\n}", "function getAssets();", "protected function parseAsset($asset_path) {\n $absolute_path = $this->getAbsolutePath($asset_path);\n\n #i:::: Check for HttpAsset\n if (starts_with($asset_path, 'http://')) {\n return new HttpAsset($asset_path);\n\n #i:::: Check for GlobAsset\n }else if (str_contains($asset_path, array('*', '?'))) {\n return new GlobAsset($absolute_path);\n\n #i:::: Check for FileAsset\n }else if( $this->getAbsolutePath($asset_path, true) ){\n #i: Return if path exist\n return new FileAsset($absolute_path);\n\n }else{\n return null;\n }\n }", "function _asset($path, $secure = null)\n {\n\n if(env('APP_ASSETS') == 'local'){\n return app('url')->asset($path, $secure);\n } else {\n return app('url')->asset(\"public/\".$path, $secure);\n }\n }", "public function getAssets();", "public function getAssets();", "public function getAssetById($id)\n\t{\n\t\treturn craft()->elements->getElementById($id, ElementType::Asset);\n\t}", "function asset($path = '')\n {\n \treturn (!empty($path)) ? BASE_URL . $path : BASE_URL ; \n }", "public function get_asset($id, $private = FALSE, $queryargs = array()) {\n return $this->get_item_of_type($id, 'asset', $private, $queryargs);\n }", "public function getAsset($type, $name)\n {\n return sprintf(\"%s/%s\", $this->$type, $name);\n }", "function cdn_asset(string $path)\n {\n return \\App\\Utils::cdnAsset($path);\n }", "public function getFile($path)\n {\n return $this->files[$path];\n }", "public function assetPath($path = '')\n\t{\n\t\treturn $this['path.asset'].ltrim($path, '/');\n\t}", "abstract public function getSingle(string $path);", "public function createAsset($path)\n\t{\n\t\treturn new Asset($path, $this->app);\n\t}", "private function getAssetVersion($path)\n {\n // @see https://knpuniversity.com/screencast/gulp/version-cache-busting#comment-2884388919\n if (count($this->paths) === 0) {\n $this->loadManifestFile();\n }\n\n if (isset($this->paths[$path])) {\n return $this->paths[$path];\n }\n\n // If a file exists, it doesn't have a version so we ignore it\n if (!file_exists($this->kernelRootDir.'/../web/'.$path)) {\n throw new Exception(sprintf('The file \"%s\" does not exist and there is no version file for it', $path));\n }\n\n return $path;\n }", "function assets_url($path='') {\n\t\tif (substr($path, 0) == '/') {\n\t\t\treturn base_url().\"assets\".$path;\n\t\t} else {\n\t\t\treturn base_url().\"assets/\".$path;\n\t\t}\n\t}", "public function get(string $path): mixed;", "public function getAsset($id) {\n try {\n $objAsset = new Base_Model_ObtorLib_App_Core_Asset_Dao_Asset();\n $asset = $objAsset->getAsset($id);\n return $asset;\n } catch (Exception $e) {\n throw new Base_Model_ObtorLib_App_Core_Asset_Exception($e);\n }\n }", "public function get(string $path): Promise;", "public function getAsset()\n {\n return $this->hasOne(Asset::className(), ['id' => 'asset_id']);\n }", "public function resolveAssetPath($url);", "public function assets($path = null, $default = [])\n {\n static $manifest = null;\n\n if (is_null($manifest)) {\n $manifest = (new Support\\Manifest)->get();\n }\n\n return is_null($path) ? $manifest : Arr::get($manifest, $path, $default);\n }", "public static function cloudAsset($path)\n {\n return asset('app/cloud/public/' . $path);\n }", "function asset($name = null)\n {\n $document = explode('/', rtrim(app('http.request')->uri, \"/\"));\n $document = end($document);\n\n $defaultPath = $document === 'public' ? 'assets/' : 'public/assets/';\n\n $packpage = new \\Anonym\\Assets\\VersionPackpage('', '%f', $defaultPath);\n return $name !== null ? $packpage->getUrl($name) : $defaultPath;\n }", "public function setPath(string $path): AssetInterface\n {\n }", "public static function asset(string $path): string\n {\n /*\n to DOOOO\n viewNamespaceToPath => /images/prova.png\n viewNamespaceToDir => c:\\var\\wwww\\test\\images\\prova.png\n viewNamespaceToAsset => http://example.com/images/prova.png\n */\n // dddx(\\Module::asset('blog:img/logo.img')); //localhost/modules/blog/img/logo.img\n\n if (Str::startsWith($path, 'https://')) {\n return $path;\n }\n if (Str::startsWith($path, 'http://')) {\n return $path;\n }\n\n if (File::exists(public_path($path))) {\n return $path;\n }\n\n if (Str::startsWith($path, '/theme/pub')) {\n $path = 'pub_theme::'.Str::after($path, '/theme/pub');\n }\n\n if (Str::startsWith($path, 'theme/pub')) {\n $path = 'pub_theme::'.Str::after($path, 'theme/pub');\n }\n\n $ns = Str::before($path, '::');\n $ns_after = Str::after($path, '::');\n if ($ns === $path) {\n $ns = inAdmin() ? 'adm_theme' : 'pub_theme';\n }\n\n $ns_after0 = Str::before($ns_after, '/');\n $ns_after1 = Str::after($ns_after, '/');\n $ns_after = str_replace('.', '/', $ns_after0).'/'.$ns_after1;\n\n if (Str::startsWith($ns_after, '/')) {\n $ns_after = Str::after($ns_after, '/');\n }\n if (\\in_array($ns, ['pub_theme', 'adm_theme'], true)) {\n $theme = config('xra.'.$ns);\n\n $filename_from = self::fixPath(base_path('Themes/'.$theme.'/Resources/'.$ns_after));\n // $filename_from = Str::replace('/Resources//', '/Resources/', $filename_from);\n $asset = 'themes/'.$theme.'/'.$ns_after;\n $filename_to = self::fixPath(public_path($asset));\n $asset = Str::replace(url(''), '', asset($asset));\n\n if (! File::exists($filename_to)) {\n if (! File::exists(\\dirname($filename_to))) {\n File::makeDirectory(\\dirname($filename_to), 0755, true, true);\n }\n try {\n File::copy($filename_from, $filename_to);\n } catch (\\Exception $e) {\n throw new \\Exception('message:['.$e->getMessage().']\n path :['.$path.']\n file from ['.$filename_from.']\n file to ['.$filename_to.']');\n }\n }\n Assert::string($asset, 'wip');\n\n return $asset;\n }\n\n $module_path = Module::getModulePath($ns);\n if (Str::endsWith($module_path, '/')) {\n $module_path = Str::beforeLast($module_path, '/');\n }\n $filename_from = self::fixPath($module_path.'/Resources/'.$ns_after);\n $asset = 'assets/'.$ns.'/'.$ns_after;\n $filename_to = self::fixPath(public_path($asset));\n $asset = Str::replace(url(''), '', asset($asset));\n if (! File::exists($filename_from)) {\n throw new \\Exception('file ['.$filename_from.'] not Exists , path ['.$path.']');\n }\n\n // dddx(app()->environment());// local\n if (! File::exists($filename_to) || 'production' !== app()->environment()) {\n if (! File::exists(\\dirname($filename_to))) {\n File::makeDirectory(\\dirname($filename_to), 0755, true, true);\n }\n // 105 If condition is always true.\n // if (File::exists($filename_from)) {\n File::copy($filename_from, $filename_to);\n // }\n }\n Assert::string($asset, 'wip');\n\n return $asset;\n\n // return asset(self::viewNamespaceToAsset($path));\n }", "public function getAsset()\n {\n return $this->hasOne(Asset::className(), ['asset_id' => 'asset_id']);\n }", "function admin_asset(string $path = ''): string\n {\n return Admin::app()->asset($path);\n }", "function asset($asset)\n{\n return ASSET_PREFIX . '/'. $asset;\n}", "public function getByPath($path);", "protected function _getAssetFile($url)\n {\n $parts = explode('/', $url);\n $pluginPart = [];\n for ($i = 0; $i < 2; $i++) {\n if (!isset($parts[$i])) {\n break;\n }\n $pluginPart[] = Inflector::camelize($parts[$i]);\n $plugin = implode('/', $pluginPart);\n $pos = strlen('Wasabi');\n if (strpos($plugin, 'Wasabi') !== false && strpos($plugin, '/') === false && (strlen($plugin) > $pos)) {\n $plugin = join('/', [\n substr($plugin, 0, $pos),\n substr($plugin, $pos)\n ]);\n }\n if ($plugin && Plugin::loaded($plugin)) {\n $parts = array_slice($parts, $i + 1);\n $fileFragment = implode(DS, $parts);\n $pluginWebroot = Plugin::path($plugin) . 'src' . DS . 'Assets' . DS;\n return $pluginWebroot . $fileFragment;\n }\n }\n }", "public static function getByPath($path) {}", "public function get($path) {\n\t\treturn $this->cache[$path] ?? null;\n\t}", "public function asset($asset = null)\n {\n if (! file_exists($manifest = $this->path . 'public/mix-manifest.json')) {\n return $this->uri . $asset;\n }\n\n $manifest = json_decode(file_get_contents($manifest), true);\n\n return $this->uri . ($manifest[$asset] ?? $asset);\n }", "public function getAsset()\r\n\t{\r\n\t\treturn Yii::app()->assetManager->publish(YiiBase::getPathOfAlias('application.modules.dashboard.assets'), true, -1, YII_DEBUG);\r\n\t}", "function getFileFromStorage($fullpath, $storage = 'public')\n{\n if ($storage == 'storage') {\n return route('read_file', $fullpath);\n }\n return my_asset($fullpath);\n}", "public static function assets($path)\n {\n $di = new self;\n $theme = $di->getDI()->getConfig()->theme;\n\n return '/content/themes/' . $theme . '/assets/' . $path;\n }", "public function get ($path)\n {\n $path = $this->_parsePath ($path);\n return $this->_get ($path);\n }", "public function asset($asset, $secure = false)\n {\n $basePath = $this->config->get('theme.paths.base');\n $assetPath = $this->config->get('theme.paths.assets');\n $fullPath = $basePath.'/'.$this->getActive().'/'.$assetPath.'/'.$asset;\n\n if($secure){\n return secure_asset($fullPath);\n }\n return asset($fullPath);\n }", "function assets_url( $path = '' ) {\n\n\treturn home_url( 'Cece/Assets/' . $path );\n\n}", "public function asset($asset = null)\n\t{\n\t\treturn rtrim($this->assetUrl,\"/\").($asset ? \"/\". trim($asset, '/') : '');\n\t}", "function asset_url( ?string $path = null ): string\n {\n return Asset::url( '/', $path );\n }", "function asset($url = '')\n{\n return ASSET . $url;\n}", "public static function apps_asset($path = Null)\n\t{\n\t\t$curr_apps\t= apps::getCurrent(\"current_apps\");\n\t\treturn self::getProtocol().self::asset().\"/$curr_apps\".($path?\"/\".$path:\"\");\n\t}", "public function getFile($path = '/'){\n\t\t$path = preg_replace($this->__config['pb.regexp.path'], '', $path);\n\n\t\tif ($path) $file = $this->__config['pb.contents.dir'].$path;\n\t\telse $file = $this->__config['pb.contents.dir'].'index';\n\t\t\n\t\tif (is_dir($file)) $file .= '/index';\n\t\t$file .= $this->__config['pb.contents.extension'];\n\n\t\tif (file_exists($file)) return $file;\n\t\treturn null;\n\t}", "function _asset_url(string $path = '') {\n\t\treturn asset(config('asset.directory')) . ($path ? DIRECTORY_SEPARATOR . $path : $path);\n\t}", "public static function get($type, $file) {\n return \\theme\\DIR . \"/assets/${type}/${file}.${type}\";\n }", "public function file($path) {\n return exists($path) ? file($path) : null;\n }", "public function findByPath($path)\n {\n return $this->model->where('path', $path)->first();\n }", "public function getAssets()\n {\n\n }", "public function asset(string $path, bool $secure = null): string\n {\n return $this->url->asset($this->path($path), $secure);\n }", "static function getAssetFile($url) {\n\t\t$parts = explode('/', $url);\n\t\tif ($parts[0] === 'theme') {\n\t\t\t$themeName = $parts[1];\n\t\t\tunset($parts[0], $parts[1]);\n\t\t\t$fileFragment = urldecode(implode(DS, $parts));\n\t\t\t$path = App::themePath($themeName) . 'webroot';\n\t\t\treturn array($path, $fileFragment);\n\t\t}\n\n\t\t$plugin = Inflector::camelize($parts[0]);\n\t\tif (CakePlugin::loaded($plugin)) {\n\t\t\tunset($parts[0]);\n\t\t\t$fileFragment = urldecode(implode(DS, $parts));\n\t\t\t$pluginWebroot = CakePlugin::path($plugin) . 'webroot';\n\t\t\treturn array($pluginWebroot, $fileFragment);\n\t\t} else {\n\t\t\treturn array(WWW_ROOT, $_GET['f']);\n\t\t}\n\t}", "public function get($filepath);", "public static function img($path) {\n return get_template_directory_uri() . '/assets/img/' . $path;\n }", "public function get_remote_asset($id, $queryargs = array()) {\n return $this->get_item_of_type($id, 'remote-asset', $queryargs);\n }", "public function get()\n {\n $file_path = $this->path();\n\n if (Storage::exists($file_path)) {\n\n return Storage::get($file_path);\n\n }\n }", "function asset($name) {\n $url;\n\n if (config('mode') === 'development') {\n $url = config('asset_url') . $name;\n } else {\n $url = config('app_url') . $name;\n }\n\n return $url;\n}", "public function getUrl(string $path): string;", "public static function assets(){\n return self::adapterURI().\"assets/\";\n }", "static function asset_path($source)\n {\n if ($source) {\n $decoded_source = json_decode($source);\n if ($url = $decoded_source->url) {\n // if $url then the file is stored on the cloud \n return $url;\n } else {\n // else it is on the local storage ( generating the URL dynamically in this case so if the\n // the admin changes his Domain or base URL the assets will still work)\n $replace = preg_replace('/.*\\/storage/', '', $decoded_source->path);\n $url = asset('/storage' . $replace);\n return $url;\n }\n }\n }", "private function _get_cached_asset($type, $assets, $extension)\n\t{\n\t\t$asset_dir = $this->_get_asset_type_dir($type);\n\t\t\n\t\t$filemtime = 0;\n\t\t\n\t\tforeach($assets as $asset_name)\n\t\t{\n\t\t\t$asset_file = $this->_get_view_path() . $asset_dir . $asset_name . $extension;\n\t\t\t\n\t\t\tif(file_exists($asset_file))\n\t\t\t{\n\t\t\t\t$asset_filemtime = filemtime($asset_file);\n\t\t\t\t\n\t\t\t\tif($asset_filemtime > $filemtime)\n\t\t\t\t{\n\t\t\t\t\t$filemtime = $asset_filemtime;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$cache = $this->_get_cached_asset_filename($type, $assets, $extension);\n\t\t\n\t\tif(file_exists($cache))\n\t\t{\n\t\t\t$cachemtime = filemtime($cache);\n\t\t\t\n\t\t\tif($cachemtime > $filemtime)\n\t\t\t{\n\t\t\t\treturn file_get_contents($cache);\n\t\t\t}\n\t\t\t\n\t\t\tif(!unlink($cache))\n\t\t\t{\n\t\t\t\tlog_message('error', \"Could not delete cache file \\\"$cache\\\" - check permissions on the cache directory\");\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}", "function shop_asset($path, $secure = null)\n {\n $path = 'vendor/sunrise/laravel-wap-shop/' . $path;\n return app('url')->asset($path, $secure);\n }", "public function get($path, $lock = false)\n {\n if ($this->exists($path)) {\n return $this->files[$path];\n }\n\n throw new FileNotFoundException(\"File does not exist at path {$path}.\");\n }", "function assetku($path, $secure = null)\n {\n return app('url')->asset('public/' . $path, $secure);\n }", "public static function get_asset_path(): string {\n\t\treturn plugin_dir_url( dirname( __DIR__ ) );\n\t}", "public function resolveResource($path);", "function load_asset($assetUrl)\n {\n return (env('APP_ENV') == 'PRODUCTION') ? secure_asset($assetUrl) : asset($assetUrl);\n }", "protected function getImage($path)\n {\n $images = $this->config->getImages();\n return $this->getUrl($images.$path);\n }", "function _asset($path, $secure = null)\n {\n if (! app()->environment('production')) {\n if (app()->environment('development')) {\n $path = 'assets/'.$path;\n }\n\n return asset($path, $secure);\n }\n\n return implode('/', [\n config('infoexam.static_url'),\n 'assets',\n json_decode(File::get(base_path('composer.json'), true), true)['version'],\n $path,\n ]);\n }", "public static function get($_path)\r\n {\r\n if($this->isFile($_path))\r\n {\r\n return file_get_contents($_path);\r\n }\r\n }", "public function getPath($path);", "public function asset(): string\n {\n if (is_null($this->rootPath)) {\n\n $partials = explode('/', $this->fullPath);\n\n return array_pop($partials);\n\n }\n\n return substr($this->fullPath, strlen(rtrim($this->rootPath, '/')) + 1);\n }", "public function assets()\r\n {\r\n return $this->httpRequest(\"v2/assets\");\r\n }", "public function getItemFromPath($givenItemPath);", "public function assetPath($asset) {\n\t\treturn self::$config['APP_ROOT'] . self::$config['ASSETS_DIR'] . $asset;\n\t}", "protected function getScript($path)\n {\n try {\n return Storage::get($path);\n }\n // Handle file not found exception.\n catch (FileNotFoundException $e) {\n $path = storage_path($e->getMessage());\n throw new Exception(\"File {$path} could not be found.\");\n }\n }", "public function getAssets($assets)\n {\n $result = $this->newAPIRequest('GET', '/assets', ['assets' => implode(',', $assets)]);\n return $result;\n }", "function get_static_asset($file = NULL, $type)\n {\n if (!is_null($file) && $file !== '') {\n return STATIC_ASSETS_PATH.($type.$file);\n }\n\n return NULL;\n }", "public function getPathAssets($append = ''){\n\t\treturn $this->paths['assets'].$append;\n\t}", "public function getSrc();", "function get_assets_path() {\n return \"http://\" . $_SERVER['HTTP_HOST'] . '/' . ROOT_PATH . '/assets/';\n }", "public function asset_handle($path) {\n return $this->plugin_slug . '-' . preg_replace(array('/\\.[^.]*$/', '/[^a-z0-9]/i'), array('', '-'), strtolower($path));\n }", "function my_asset($path = null)\n{\n return route('homepage') . env('ASSET_URL') . '/' . $path;\n}" ]
[ "0.783336", "0.728482", "0.7275394", "0.71702605", "0.70674044", "0.6842171", "0.67996275", "0.66976744", "0.66391087", "0.6557754", "0.651351", "0.651351", "0.6472198", "0.6446784", "0.6430077", "0.6422105", "0.6416686", "0.6400945", "0.6394981", "0.6370265", "0.63701123", "0.63701123", "0.6345266", "0.6275297", "0.6236403", "0.6230329", "0.61768526", "0.61573124", "0.61513084", "0.61110413", "0.6109152", "0.6097639", "0.60854363", "0.60730374", "0.60598755", "0.6057869", "0.60553974", "0.6050668", "0.6038448", "0.60183907", "0.6010487", "0.5977114", "0.59644747", "0.5964248", "0.5961199", "0.5960154", "0.5954785", "0.59095645", "0.5898332", "0.58891267", "0.5888662", "0.5881708", "0.5880675", "0.5879723", "0.5862492", "0.5840994", "0.58347374", "0.5816216", "0.5815604", "0.5812619", "0.5811228", "0.5775357", "0.5752631", "0.5750099", "0.5733191", "0.5731118", "0.57302356", "0.5728434", "0.5700655", "0.5700335", "0.5685814", "0.56839806", "0.5682973", "0.5679224", "0.5673658", "0.56664956", "0.565148", "0.5635794", "0.5635537", "0.56196517", "0.5616069", "0.56152123", "0.5606439", "0.56018347", "0.56003386", "0.5597272", "0.5592122", "0.55908954", "0.55844456", "0.5576545", "0.5570848", "0.5570773", "0.5562709", "0.55606675", "0.55411327", "0.55307055", "0.5525188", "0.55212784", "0.55162257", "0.5515939" ]
0.7417017
1
Lists all Examination models.
public function actionIndex() { $userId = Yii::$app->user->id; $searchModel = new ExaminationSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); $dataProvider->query->AndWhere(['user_id' => $userId]); $dataProvider->query->orderBy('create_at DESC'); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n\t{\n\t\t$exams = Exam::with('course')->get(['id', 'name', 'type', 'course_id', 'class', 'campus_id', 'created_at']);\n\n\t\tforeach ($exams as $value) {\n\t\t\t$value['campus'] = Campus::find($value['campus_id'])->title;\n\t\t}\n\t\treturn $exams;\n\t}", "public function index()\n\t{\n\t\t$exampaths = ExamPath::all();\n\n\t\treturn View::make('exampaths.index', compact('exampaths'));\n\t}", "public function index()\n {\n $lists = ExamList::select('id', 'name', 'remarks')\n ->where('status', 1)->get();\n\n return view('exam::list.index', compact('lists'));\n }", "public function index() {\n\t\t$expence_management = ExpenceManagement::query()\n\t\t\t->leftjoin('users as users', 'users.id', '=', 'expence_managements.created_by')\n\t\t\t->orderBy('expence_managements.id', 'ASC')\n\t\t\t->where('expence_managements.deletion_status', 0)\n\t\t\t->get([\n\t\t\t\t'expence_managements.*',\n\t\t\t\t'users.name',\n\t\t\t])\n\t\t\t->toArray();\n\n\t\t$employees = User::where('deletion_status', 0)\n\t\t\t->where('access_label', '>=', 2)\n\t\t\t->where('access_label', '<=', 3)\n\t\t\t->get(['name', 'id'])\n\t\t\t->toArray();\n\t\t//return dd($employees);\n\t\treturn view('administrator.hrm.expence.manage_expence', compact('expence_management', 'employees'));\n\t}", "public function actionIndex() {\n if (Yii::$app->user->can('school_exam')) {\n $searchModel = new SchoolExamMarksSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $classList = ArrayHelper::map(Classes::findAll(['is_active' => 'Y', 'is_deleted' => 'N']), 'id', 'name');\n $subclassList = ArrayHelper::map(Subclass::findAll(['is_active' => 'Y', 'is_deleted' => 'N']), 'id', 'sub_class');\n $semesterList = ArrayHelper::map(SchoolExamSemester::findAll(['is_active' => 'Y', 'is_deleted' => 'N']), 'id', 'semester');\n $divisionList = ArrayHelper::map(Division::findAll(['is_deleted' => 'N', 'is_active' => 'Y']), 'id', 'division');\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'classList' => $classList,\n 'subclassList' => $subclassList,\n 'semesterList' => $semesterList,\n 'divisionList' => $divisionList,\n ]);\n } else {\n throw new ForbiddenHttpException;\n }\n }", "public function index(Request $request)\n {\n $exam = new Exam;\n $exam->setAttribute('exam_entity_id', $request->input('eei'));\n $exam->setAttribute('class_entity_id', $request->input('cei'));\n $exam->loadData();\n return view('dashboard.school.Exam.list', compact('exam'));\n }", "public function index()\n {\n return $this->model->all();\n }", "public function index()\n {\n return Employee::all();\n }", "public function index(){\n return $this->model->all();\n }", "public function index()\n {\n $exams = Exam::all();\n return view('admin.exam.index', compact('exams'));\n }", "public function getAllExaminations()\n {\n if (REQ::is('api/*'))\n return response()->json(['examinations' => Examination::all()], 200);\n return view('pages.exams',['Examinations'=>Examination::all(),'subjects'=>Subject::all(),'grades'=>Grade::all()]);\n }", "public function index()\n {\n $expences = Expence::orderBy('id', 'desc')->get();\n return view('bsd-admin.expences.index', compact('expences'));\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('BackOfficebackBundle:Extraitnaissances')->findAll();\n\n return array(\n 'entities' => $entities,\n );\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 index()\n {\n //\n return ExamenesClinicos::all();\n }", "public function index()\n {\n return $this->model->getAll();\n }", "public function index()\n {\n $exams=Exam::All();\n return view('admin.pages.exam.exam_details')->with('exams',$exams);\n }", "public function index()\n {\n $employees = Employee::all();\n $trainings = Training::all();\n\n return view('employee.index', compact(['employees','trainings']));\n }", "public function models()\n {\n $this->_display('models');\n }", "public function index()\n {\n if (! Gate::allows('exam_access')) {\n return abort(401);\n }\n\n\n if (request('show_deleted') == 1) {\n if (! Gate::allows('exam_delete')) {\n return abort(401);\n }\n $exams = Exam::onlyTrashed()->get();\n } else {\n $exams = Exam::all();\n }\n\n return view('admin.exams.index', compact('exams'));\n }", "public function getModels();", "public function getModels();", "public function index()\n {\n //\n $exams=Exam::all();\n return view('exams.index',compact('exams'));\n }", "public function actionIndex()\n {\n AllocationDetails::getExtCentres();\n $dataProvider = new ActiveDataProvider([\n 'query' => AllocationDetails::find(),\n 'pagination' => \n [\n 'pageSize' => 20,\n ],\n 'sort' => \n [\n 'defaultOrder' => \n [\n 'name' => SORT_ASC,\n ]\n ],\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index() {\n $empleados = $this->Empleados->find('all');\n $this->set(compact('empleados'));\n }", "public function list ()\n {\n $employees[\"data\"] = Employee::get();\n $employees['deleted'] = \"0\";\n\n return view(\"employee.list\", compact(\"employees\"));\n }", "function index(){\r\n \r\n $all = $this->model->selectAll();\r\n $this->data('all', $all);\r\n $this->loadView();\r\n }", "public function index()\n\t{\n\t\treturn $this->careers->findAll();\n\t}", "public function index()\n {\n return Api_Employees::all()->toArray(); \n }", "public function index()\n {\n $data = $this->model->all();\n return view('admin.backends.employee.index',compact('data'));\n }", "public function index()\n {\n $exams=Exam::all();\n return view('marksheet/index',compact('exams'));\n }", "public function viewallunitmodelsAction() {\n\n\t\t$model = new Unit_Model_UnitModel();\n\t\t$this->view->records = $model->fetchAll( 'name','ASC' );\n \n\t\tif( $this->view->records ) {\n $attached = $model->getAttachedModels();\n $this->view->attached = $attached;\n\t\t $this->view->paginator = $this->paginate( $this->view->records );\n }\n\t}", "public function index()\n {\n //\n $results = Result::orderBy('id', 'asc')->get();\n\n // load the view and pass the employees\n return $results;\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 }", "private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AcmeKindergartenBundle:AttendanceEmployed')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function actionIndex()\n {\n $searchModel = new EscaparateSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $master = MasterEducationType::paginate(7);\n\n return view('admin.master.education.index', compact('master'));\n }", "public function index()\n {\n return IdiomaEmpleado::all();\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 }", "public function index()\n {\n $employees = Employee::get();\n return EmployeeResource::collection($employees);\n }", "public function index()\n {\n return $this->attendanceRepository->all();\n }", "public function actionIndex()\n {\n $searchModel = new ExhibitionHallSearch;\n $dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n 'searchModel' => $searchModel,\n ]);\n }", "public function index()\n {\n return Model::all();\n }", "public function index()\n {\n return new EmployeeCollection(Employee::latest('id')->paginate(10));\n }", "public function index()\n {\n $employeeList = Employee::all();\n //$employeeList = DB::table('employees')->get();\n return view('employees.index', compact('employeeList'));\n }", "public function index()\n {\n $process = employ::select('*')->orderby('id','desc')->paginate(10);\n return view('employe.index',compact('process'));\n }", "public function indexAction()\n {\n $this->view->employees = Employees::find();\n }", "public function index()\n {\n //\n $experiences = Experience::all();\n return view('admin.experiences.index', compact('experiences'));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Employees::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index ()\n {\n $employees[\"data\"] = Employee::get();\n $employees['deleted'] = \"0\";\n\n return view(\"employee.list\", compact(\"employees\"));\n }", "public function index()\n {\n return $this->findModel()->toArray();\n }", "public function memployee_list()\n {\n $this->AdminAuthCheck();\n $all_employee= DB::table('tbl_employee')\n\t\t\t\t\t\t\t\t->join('tbl_grade','tbl_employee.grade_id','=','tbl_grade.grade_id')\n ->get();\n return view('manager.employee_list',compact('all_employee'));\n }", "public static function DisplayAll() {\n\t\t\t\n\t\t\t$sql = \"SELECT * FROM employees \";\n\t\t\t$statement = Database::$db->prepare($sql);\n\t\t\t$statement->execute();\n\t\t\t$employees = [];\n\t\t\twhile($row = $statement->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t\t$employees[] = new Employee($row['Code']);\n\t\t\t}\n\t\t\treturn $employees;\n\t\t}", "public function index()\n {\n return view(\"teacher.pages.exam-types.index\", [\n \"examTypes\" => ExamType::all()\n ]);\n }", "public function indexModel(){\n $this->model('auditor/indexModel');\n \n $this->model->load(); \n }", "public function index()\n {\n $employeelists = DB::table('employees')->get();\n\n return view('employees.index')->with('employeelists', $employeelists);\n }", "public function actionIndex()\n {\n \t$dataProvider = new ActiveDataProvider([\n \t\t'query' => \\restapi\\models\\Employe::find(),\n \t\t'pagination' => [\n \t\t\t'pageSize' => 15,\n \t\t]\n \t]);\n\n \treturn $dataProvider;\n }", "public function actionIndex()\n {\n $searchModel = new WpIschoolSafecardSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\t\t$column_arr = [\n \t'id',\n 'stuid',\n 'info',\n 'ctime:datetime',\n 'receivetime:datetime',\n ];\n if(\\yii::$app->request->get(\"type\") && \\yii::$app->request->get(\"type\") == \"export\")\n {\n \t$array_values = $searchModel->attributeLabels();\n \t$array_keys = array_keys($array_values);\n \t/*$all_data = \\yii\\helpers\\ArrayHelper::toArray($dataProvider->query->all(), [\n \t\t\t'backend\\models\\WpIschoolSchool' => $array_keys,\n \t]);*/\n \t\\moonland\\phpexcel\\Excel::export([\n \t\t\t'models' => $dataProvider->query->all(),\n \t\t\t'columns' => $column_arr,\n \t\t\t'headers' => $array_values,\n \t\t\t\"fileName\"=>\"safecard.xlsx\"\n \t]);\n }else \n {\n \t\treturn $this->render('index', [\n \t\t'searchModel' => $searchModel,\n \t\t'dataProvider' => $dataProvider,\n \t\t\t'columnsArray' => $column_arr\n \t\t]);\n }\n }", "public function all()\n {\n return $this->model->get();\n }", "public function actionIndex()\n {\n $searchModel = new EmployeSearch();\n $query = Employe::find()\n ->orderBy([\n 'created' => SORT_DESC\n ]);\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $query);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $Leaves = Leave::all();\n $employees = Employee::all();\n return view('admin.leave.index',compact('Leaves','employees'));\n }", "public function actionIndex()\n {\n $searchModel = new IhubAbsenceSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $employees = Employee::orderBy('id', 'asc')->get();\n\n return view('list.index', compact('employees'));\n }", "public function actionAll()\n {\n $model = new Masters();\n\n $comments = $model->getCommentsAll();\n $services = $model->getServices();\n $foto = $model->getFoto();\n $pagination = $model->getPagination(Yii::$app->params['mastersOnPage']);\n $masters = $model->getMastersPagination();\n\n return $this->render('index', [\n 'model' => $model,\n 'masters' => $masters,\n 'comments' => $comments,\n 'services' => $services,\n 'foto' => $foto,\n 'pagination' => $pagination,\n 'mastersOnPage' => Yii::$app->params['mastersOnPage'],\n 'pathToRoot' => Yii::$app->params->pathToRoot\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n \t\n $entities = $em->getRepository('JobHubBundle:Experience')->findBy(array('candidat' => $this->getCurrentCandidat()));\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n\n $employees = Employee::with('role')->get();\n\n return view('backend.hrm.employee.list', compact('employees'));\n\n }", "public function index()\n {\n $employees = Employee::get();\n $roles = Role::get();\n return view('employees.list', compact(['employees', 'roles']));\n }", "public function index()\n {\n $assessment = Assessment::all();\n return $assessment;\n }", "public function Listar(){\n $dica_saude = new Exame();\n\n //Chama o método para selecionar os registros\n return $dica_saude::Select();\n }", "public function exams()\n {\n return $this->hasMany(Exam::class, \"exam_type_id\", 'is');\n }", "public function getAll()\n\t{\n\t\t$args = array('order' => 't.id');\n \t$records = $this->record->findAll($args);\n \treturn $this->model->populateModels($records, 'id');\n\t}", "public function index()\n {\n $employees = $this->employee->all();\n\n return view('employee::admin.employees.index', compact('employees'));\n }", "public function index() {\n $data['manufacturers'] = Manufacturer::getManufacturers();\n return view('models.models')->with($data);\n }", "public function index()\n {\n $experience = Experience::orderBy('created_at', 'desc')->get();\n return view('admin.experiences.index')->withExperiences($experience); \n }", "public function examenes()\n {\n return $this->hasMany(SExamen::class);\n }", "public function actionIndex()\n {\n $searchModel = new MedicineSearch();\n $searchModel->IsDelete=0;\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex() {\n $model = Resume::model()->findAll();\n\n $model_extra = new ResumeExtra;\n $data_extra = $model_extra->model()->findAllByAttributes(array('user_id' => Yii::app()->user->id, 'resume_id' => $model[0]->id));\n\n $model_exper = new ResumeExper;\n $data_exper = $model_exper->model()->findAllByAttributes(array('user_id' => Yii::app()->user->id, 'resume_id' => $model[1]->id));\n\n $model_education = new ResumeEducation;\n $data_education = $model_education->model()->findAllByAttributes(array('user_id' => Yii::app()->user->id, 'resume_id' => $model[2]->id));\n\n $model_honor = new ResumeHonorAward;\n $data_honor = $model_honor->model()->findAllByAttributes(array('user_id' => Yii::app()->user->id, 'resume_id' => $model[3]->id));\n\n $model_skill = new ResumeSkill;\n $data_skill = $model_skill->model()->findAllByAttributes(array('user_id' => Yii::app()->user->id, 'resume_id' => $model[4]->id));\n\n $model_interest = new ResumeInterest;\n $data_interest = $model_interest->model()->findAllByAttributes(array('user_id' => Yii::app()->user->id, 'resume_id' => $model[5]->id));\n\n $model_favorite = new ResumeFavorite;\n $data_favorite = $model_favorite->model()->findAllByAttributes(array('user_id' => Yii::app()->user->id, 'resume_id' => $model[6]->id));\n\n $this->render('index', array(\n 'model' => $model,\n 'model_extra' => $model_extra,\n 'data_extra' => $data_extra,\n 'model_exper' => $model_exper,\n 'data_exper' => $data_exper,\n 'model_education' => $model_education,\n 'data_education' => $data_education,\n 'model_honor' => $model_honor,\n 'data_honor' => $data_honor,\n 'model_skill' => $model_skill,\n 'data_skill' => $data_skill,\n 'model_interest' => $model_interest,\n 'data_interest' => $data_interest,\n 'model_favorite' => $model_favorite,\n 'data_favorite' => $data_favorite,\n ));\n }", "public function index()\n {\n return new EmployeeCollection(Employee::orderBy('id','DESC')->paginate(5));\n }", "public function index()\n {\n $employees = Employee::all();\n return view('employee.index', compact('employees'));\n }", "public function index()\n {\n $employees = Employee::all()->toArray();\n return view('Employee.ManageEmp', compact('employees') );\n }", "public function index()\n {\n return $this->showList(ObjectMuseum::where('deleted','=',ObjectMuseum::ACTIVE)->get());\n }", "public function actionList()\r\n {\r\n $this->_userAutehntication();\r\n switch($_GET['model'])\r\n {\r\n case 'posts': \r\n $models = Post::model()->findAll();\r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Error: Mode <b>list</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n if(is_null($models)) {\r\n $this->_sendResponse(200, sprintf('No Post found for model <b>%s</b>', $_GET['model']) );\r\n } else {\r\n $rows = array();\r\n foreach($models as $model)\r\n $rows[] = $model->attributes;\r\n\r\n $this->_sendResponse(200, CJSON::encode($rows));\r\n }\r\n }", "public function actionIndex()\n {\n $searchModel = new DmposmasterrelateSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $searchPosModel = new DmposSearch();\n $allPos = $searchPosModel->searchAllPos();\n $allPosMap = ArrayHelper::map($allPos,'ID','POS_NAME');\n\n $searchCityModel = new DmcitySearch();\n $allCity = $searchCityModel->searchAllCity();\n $allCityMap = ArrayHelper::map($allCity,'ID','CITY_NAME');\n\n $searchPosMasterModel = new DmposmasterSearch();\n $allPosMaster = $searchPosMasterModel->searchAllPosmaster();\n $allPosMasterMap = ArrayHelper::map($allPosMaster,'ID','POS_MASTER_NAME');\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'allPosMap' => $allPosMap,\n 'allPosMasterMap' => $allPosMasterMap,\n 'allCityMap' => $allCityMap,\n ]);\n }", "public static function getList(){\n return DB::table('employees')->get();\n }", "public function index()\n {\n $this->filter_section = true;\n $this->employees = Employee::all();\n $this->designations = Designation::all();\n\n return view('admin.employee.index', $this->data);\n }", "public function all()\n {\n return $this->model->get();\n }", "public function index()\n {\n return Equipe::all();\n }", "public function index()\n {\n return view('empmodel');\n }", "public function index()\n {\n $exercises = Exercise::all();\n $trainings = Training::all();\n \n return view('exercises.index')->with('exercises', $exercises)->with('trainings', $trainings);\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 $employee = Employee::active()->latest()->get();\n \n return EmployeeResource::collection($employee);\n }", "public function index()\n {\n \n \n $employees = Employee::all();\n $careers=Career::lists('careerName', 'id');\n\n return view('accountant.employees.index')->with('employees',$employees)\n ->with('careers', $careers);\n }", "public function index()\n {\n //\n $employees = Employee::all();\n return view('hr/employee/index',compact('employees'));\n }", "public function index()\n {\n $employees = employee::get(); \n return view(\"index\")->with(array('employee'=> $employees));\n }", "public function index(Request $request)\n {\n // dd($request->all());\n $limit = $request->has('_limit')? $request->_limit : 20;\n\n // get experiences\n $experiences = Experience::getBySearch($request)\n ->orderBy('id', 'DESC')\n ->paginate($limit)\n ->appends($request->query());\n\n // return collection of experiences as a resource\n return ExperienceResource::collection($experiences);\n }", "public function index()\n {\n $employee = Employee::getallEmp();\n //prd($employee->toArray());\n return view('admin.employee.index',compact('employee'));\n }", "public function index()\n {\n $employee = Employee::all();\n \n return view('employee.index', compact('employee'));\n }", "public function index()\n {\n\n $user = Auth::user();\n $exams = DB::table('assign_exams')\n ->join('exams', 'exams.id', '=', 'assign_exams.exam_id')\n ->select('exams.*','assign_exams.*')\n ->where('user_id',$user['id'])\n ->get();\n\n return view('list_exams',compact('exams'));\n }", "public function actionList() {\n $models = Post::model()->findAll();\n $rows = array();\n foreach($models as $model) \n $rows[] = $model->attributes;\n\t\t$data_response = array(\n\t\t\t'error'=> array('status'=>200, 'message'=>''),\n\t\t\t'datas'=>$rows\n\t\t);\n $this->response($data_response);\n }" ]
[ "0.6388559", "0.6354124", "0.62900794", "0.6183228", "0.61783564", "0.6168356", "0.6096302", "0.6082665", "0.607787", "0.6073956", "0.60720295", "0.60704064", "0.6067534", "0.6064393", "0.60572386", "0.5988476", "0.59781706", "0.5957731", "0.59494495", "0.5945963", "0.59428483", "0.59428483", "0.5941481", "0.59017575", "0.58715826", "0.5860553", "0.5858122", "0.58378595", "0.58343047", "0.58332264", "0.5812979", "0.58030313", "0.5777943", "0.5777333", "0.57771635", "0.5772639", "0.57723165", "0.57691956", "0.57691866", "0.57619524", "0.5745986", "0.57456666", "0.5744532", "0.5741916", "0.5730184", "0.5713862", "0.57018024", "0.56997895", "0.5698672", "0.56982666", "0.56818676", "0.5681336", "0.566297", "0.56569254", "0.5656267", "0.5652501", "0.56481296", "0.5646291", "0.56446403", "0.56440437", "0.5639899", "0.56289774", "0.56179845", "0.5617601", "0.56162256", "0.56158596", "0.56141233", "0.5612279", "0.5607064", "0.5603142", "0.5599915", "0.55957776", "0.559175", "0.55901533", "0.5590122", "0.5584104", "0.5583175", "0.55821526", "0.557369", "0.5571331", "0.55697757", "0.5565134", "0.556202", "0.5560943", "0.5559681", "0.5558583", "0.55549085", "0.55527395", "0.55523735", "0.555038", "0.5550284", "0.55463785", "0.55408275", "0.5535709", "0.5532253", "0.553069", "0.55276924", "0.55258083", "0.55250937", "0.5523093" ]
0.70736754
0
Displays a single Examination model.
public function actionView($id) { return $this->render('view', [ 'model' => $this->findModel($id), ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Exam $exam)\n {\n \n }", "public function show()\n {\n return view('exam::show');\n }", "public function show(Exam $exam)\n {\n //\n }", "public function show(Exam $exam)\n {\n //\n }", "public function show(Exam $exam)\n {\n //\n }", "public function show(Exam $exam)\n {\n //\n }", "public function show(Exam $exam)\n {\n //\n }", "public function actionCreate()\n {\n $model = new Examination();\n\n if ($model->load(Yii::$app->request->post())) {\n $userId = \\Yii::$app->user->id;\n $this->saveResult($model->result, $userId);\n return $this->redirect('index');\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function show(Exercice $exercice)\n {\n //\n }", "public function show(exam $exam)\n {\n //\n }", "public function show(ExpenceHead $expenceHead)\n {\n\n }", "public function show(Expanse $expanse)\n {\n //\n }", "public function show(experience $experience)\n {\n //\n }", "public function show(ExpenceManagement $expenceManagement) {\n\t\t//\n\t}", "public function show(Experience $experience)\n {\n //\n }", "public function actionView()\n\t{\n\t\t$model = $this->loadModel();\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionView() {\n $this->render('view', array(\n 'model' => $this->loadModel(),\n ));\n }", "public function actionView()\n {\n $this->render('view', array(\n 'model' => $this->loadModel(),\n ));\n }", "public function actionIndex()\n {\n $userId = Yii::$app->user->id;\n $searchModel = new ExaminationSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->query->AndWhere(['user_id' => $userId]);\n $dataProvider->query->orderBy('create_at DESC');\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function detail()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_detail');\n $view->heading = \"\";\n $view->verein = $vereinRepository->readById($_GET['id']);\n $view->title = $view->verein->name;\n $view->display();\n }", "public function actionView()\n {\n $id=(int)Yii::$app->request->get('id');\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function actionView()\n\t{\n\t\tif (!($model = $this->loadModel()))\n\t\t\treturn;\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function viewAction()\n {\n $id = $this->_getPrimaryId();\n $row = $this->_getRow($id);\n\n $this->view->row = $row;\n }", "public function show()\n {\n return view('employee::show');\n }", "public function actionShow()\r\n\t{\r\n\t\t$this->render('show',array('model'=>$this->loadcontent()));\r\n\t}", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(XRayModel $xRayModel)\n {\n //\n }", "public function display()\n \t{\n \t\t$this->assign(\"__view\", $this->_view);\n \t\tparent::display();\n \t}", "public function index()\n {\n $exams=Exam::All();\n return view('admin.pages.exam.exam_details')->with('exams',$exams);\n }", "public function examcenter() {\n $data['result'] = $this->commodel->get_list('admissionstudent_enterenceexamcenter');\n $this->logger->write_logmessage(\"view\",\" View Exam Center\", \"Exam Center details...\");\n $this->logger->write_dblogmessage(\"view\",\" View Exam Center\" , \"Exam Center record display successfully...\" );\n $this->load->view('enterenceadmin/examcenter',$data);\n }", "public function show(Education $education)\n {\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 index()\n {\n $exams = Exam::all();\n return view('admin.exam.index', compact('exams'));\n }", "public function show()\n {\n return view('essentials::show');\n }", "public function actionDetails()\n\t{\n\t\t$this->render('details',array('model'=>$this->loadarticles()));\n\t}", "public function actionView($id)\r\n\t{\r\n\t\t// sets global studyId for authoring\r\n \t\t$this->studyId = $id;\r\n\r\n\t\t$this->render('view',array(\r\n\t\t\t'model'=>$this->loadModel($id),\r\n\t\t));\r\n\t}", "public function viewAction() {\n\t\t$role = new Role_Model_Role();\n\t\t$this->view->record = $role->findById($this->getRequest()->getParam('id'));\n\t}", "public function show($id)\n\t{\n\t\t$exampath = ExamPath::findOrFail($id);\n\n\t\treturn View::make('exampaths.show', compact('exampath'));\n\t}", "public function actionView()\r\n {\r\n $this->_userAutehntication();\r\n /*\r\n * Check if id was submitted via GET method \r\n */\r\n if(!isset($_GET['id']))\r\n $this->_sendResponse(500, 'Error: Parameter <b>id</b> is missing' );\r\n\r\n switch($_GET['model'])\r\n {\r\n /* Find respective model */\r\n case 'posts': \r\n $model = Post::model()->findByPk($_GET['id']);\r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Mode <b>view</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n if(is_null($model)) {\r\n $this->_sendResponse(404, 'No Post found with id '.$_GET['id']);\r\n } else {\r\n $this->_sendResponse(200, $this->_getEncodedData($_GET['model'], $model->attributes));\r\n }\r\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function show(Employee $employee)\n {\n //\n }", "public function view()\n\t{\n\t\t// TODO Implement\t\n\t}", "public function index()\n\t{\n\t\t$exampaths = ExamPath::all();\n\n\t\treturn View::make('exampaths.index', compact('exampaths'));\n\t}", "public function show() {\n \n \n }", "public function show(employee $employee)\n {\n //\n }", "public function show()\n\t{\n\t\t\n\t}", "public function show()\n\t{\n\n\t}", "public function show()\n { \n \n }", "public function display() {\n echo $this->render();\n }", "public function display(){}", "public function actionExamReport() {\n// $modelExam = new Exam;\n// $this->render('examReport', array('modelClassroom'=>$modelClassroom,'modelExam'=>$modelExam));\n $modelClassroom = new Classroom;\n if (isset($_POST['Classroom'])) {\n $modelClassroom->attributes = $_POST['Classroom'];\n }\n\n// trace($modelClassroom->id);\n\n $modelExam = new Exam;\n if (isset($_POST['Exam'])) {\n $modelExam->attributes = $_POST['Exam'];\n }\n $this->render('examReport', array('modelClassroom' => $modelClassroom, 'modelExam' => $modelExam));\n }", "public function index()\n {\n return view ('exercise_estimation.index'); \n }", "public function show()\r\n\t{\r\n\t\t\r\n\t\t$model = $this->getProfileView();\r\n\t\t$data = array('model'=> $model);\r\n\t\t\r\n\t\treturn $this->render($data);\r\n\t\t\r\n\t}", "public function show(Emprendedore $emprendedore)\n {\n //\n }", "public function actionView()\n {\n $id = Yii::$app->user->id;\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function show()\n {\n \n }", "public function show()\n {\n \n }", "public function index()\n {\n //\n $exams=Exam::all();\n return view('exams.index',compact('exams'));\n }", "public function show() {\n \n }", "public function show()\n {\n //\n }", "public function show($id)\n {\n //\n $experience = Experience::find($id);\n return view('admin.experiences.show', compact('experience'));\n }", "public function show(ExamTerm $examTerm)\n {\n //\n }", "public function show()\n {\n \n }", "public function show()\n {\n \n }", "public function viewAction()\n {\n $recordId = (int) $this->params('id', null);\n\n if (null === $recordId) {\n $this->flashMessenger()->setNamespace('error')\n ->addMessage('You have attempted to access an invalid record.');\n\n return $this->redirect()->toRoute('rocket-admin/education/results');\n }\n\n $record = $this->resultsService->getResult($recordId);\n\n if (null === $record) {\n $this->flashMessenger()->setNamespace('error')\n ->addMessage('You have attempted to access an invalid record.');\n\n return $this->redirect()->toRoute('rocket-admin/education/results');\n }\n\n $form = $this->resultsService->getEditResultForm($recordId);\n\n return new ViewModel(array(\n 'record' => $record,\n 'form' => $form,\n 'recordId' => $recordId,\n 'productCategories' => '',\n ));\n }", "public function index(){\r\n $this->display();\r\n }", "public function show(Attendance $attendance)\n {\n //\n }", "public function show(Attendance $attendance)\n {\n //\n }", "public function show(Attendance $attendance)\n {\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 show(Evaluation $evaluation)\n {\n //\n }", "function run() {\n\t\t$view = new View();\n\t\t\n\t\t$students = new Student();\n\t\tif ($view->students_tbl = $students->get_students_as_tbl_arr() ) {\n\t\t\t$view->error = $students->get_error();\n\t\t}\n\n\t\t$view->student_desc = $students->get_student_desc();\n\t\t$view->render('main_page.php');\n\t}", "public function show() {\n\t}", "public function Display(){\n\t\trequire($this->viewFileName);\n\t}", "public function index() {\n $data = array();\n $this->load->model('Publication');\n $publication = new Publication();\n $publication->load(1);\n $data['publication'] = $publication;\n \n $this->load->model('Issue');\n $issue = new Issue();\n $issue->load(1);\n $data['issue'] = $issue;\n \n $this->load->view('magazines', $data);\n $this->load->view('magazine', $data);\n }", "public function show()\n {\n return $this->view();\n }", "public function showExperiancePage(){\n $setting_table = Setting::find(1);\n $experiance_data = json_decode($setting_table -> experience);\n return view('admin.experiance',compact('experiance_data'));\n }", "public function index(){\n $example=new Example();//no hace falta incluir el modelo ya esta incluido\n $exampleArray=$example->getAll();\n //ESTE METODO INCLUYE UNA VISTA\n $this->view('Example/home',['exampleArray'=>$exampleArray]);\n }", "private function display(){\n\t\t \n\t\tif(empty($this->view)){\n\t\t\tthrow new Exception(\"Empty view requested!\");\n\t\t}\n\t\t\n\t\t$controller_class = \"Controllers_\" . $this->view;\n\t\t\n\t\tif(!class_exists($controller_class)){\n\t\t\tthrow new Exception(\"Controller not found for determined view '{$this->view}'\");\n\t\t\treturn;\n\t\t} \n\t\t\n\t\t$this->controller = new $controller_class($_GET, $_POST);\n\t\t\n\t\t$output = $this->controller->display();\n\t\treturn $output;\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view');\n\t}", "public function show($id)\n {\n // include view file\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('EmiageReviewManagerBundle:Examen')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Examen entity.');\n }\n\n return $this->render('EmiageReviewManagerBundle:Examen:print.html.twig', array(\n 'entity' => $entity,));\n }", "public function show() {\n $view = $this->model->record($id);\n return view('persons/record', compact('view'));\n }", "public function Index() {\n $this->Display();\n }" ]
[ "0.6924364", "0.6914265", "0.68571323", "0.68571323", "0.68571323", "0.68571323", "0.68342686", "0.67925423", "0.67639166", "0.67183965", "0.66891944", "0.6635568", "0.6624407", "0.65760326", "0.6566039", "0.64995617", "0.64879626", "0.6482214", "0.64476866", "0.64167535", "0.64167535", "0.64167535", "0.64167535", "0.64167535", "0.6415576", "0.64122295", "0.63820255", "0.63349545", "0.6309908", "0.6307147", "0.6288315", "0.62849313", "0.6264553", "0.62595606", "0.62485456", "0.6246561", "0.621017", "0.621017", "0.621017", "0.62016183", "0.61988086", "0.6194626", "0.61858356", "0.6170403", "0.6169631", "0.6168458", "0.6165778", "0.6165778", "0.6165778", "0.6165778", "0.6165778", "0.6165778", "0.6165778", "0.6165778", "0.6165778", "0.6165778", "0.6165778", "0.6165778", "0.6164062", "0.6160912", "0.6160803", "0.6151553", "0.614458", "0.61425674", "0.6134251", "0.6113116", "0.61029685", "0.6089454", "0.6089389", "0.6079279", "0.60788417", "0.60512686", "0.60450166", "0.60450166", "0.6043359", "0.60407543", "0.6040037", "0.6039103", "0.6033529", "0.603123", "0.603123", "0.60287386", "0.60281855", "0.60238874", "0.60238874", "0.60238874", "0.6022154", "0.60179716", "0.60165924", "0.60155606", "0.60151404", "0.6013281", "0.60094357", "0.60081077", "0.6007226", "0.60050625", "0.60047746", "0.600161", "0.59997445", "0.5997988", "0.5996993" ]
0.0
-1
Creates a new Examination model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { $model = new Examination(); if ($model->load(Yii::$app->request->post())) { $userId = \Yii::$app->user->id; $this->saveResult($model->result, $userId); return $this->redirect('index'); } return $this->render('create', [ 'model' => $model, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n\t{\n\t\t$model=new ElearningExam;\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['ElearningExam']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ElearningExam'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->elearningExamId));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Escaparate();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->idNTC_Escaparate]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new IhubAbsence();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'idOpr' => $model->idOpr, 'tglabsence' => $model->tglabsence, 'ibadah' => $model->ibadah]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new AllocationDetail();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n $exam=Exam::all();\n $section=Section::all();\n $class = Classe::all();\n $session=Session::all();\n $term=Term::all();\n return view('basicinfo::exam.create',compact('exam','section','class','session','term'));\n }", "public function actionCreate()\n\t{\n\t\t$model = new Exam;\n\t\t$examQuestionModel = new ExamQuestion();\n\t\t$examChoiceModel = new ExamChoice();\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['Exam']) && isset($_POST['ExamQuestion']) && isset($_POST['ExamChoice']))\n\t\t{\n\t\t\t$model->attributes = $_POST['Exam'];\n\n\t\t\t$flag = true;\n\t\t\t$transaction = Yii::app()->db->beginTransaction();\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif ($model->save())\n\t\t\t\t{\n\t\t\t\t\t$examTitleId = Yii::app()->db->lastInsertID;\n\n\t\t\t\t\t//Question\n\t\t\t\t\tforeach ($_POST['ExamQuestion'] as $qId => $examQuestion)\n\t\t\t\t\t{\n\t\t\t\t\t\t$examQuestionModel = new ExamQuestion();\n\t\t\t\t\t\t$examQuestionModel->attributes = $examQuestion;\n\n\t\t\t\t\t\tif (!$examQuestionModel->save())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$flag = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$examQuestionId = Yii::app()->db->lastInsertID;\n\n\t\t\t\t\t\t$examTitleExamQuestionModel = new ExamExamQuestion();\n\t\t\t\t\t\t$examTitleExamQuestionModel->examId = $examTitleId;\n\t\t\t\t\t\t$examTitleExamQuestionModel->examQuestionId = $examQuestionId;\n\n\t\t\t\t\t\tif (!$examTitleExamQuestionModel->save())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$flag = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($examQuestion['questionType'] == 2)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t//Choice\n\t\t\t\t\t\tforeach ($_POST['ExamChoice'][$qId] as $examChoice)\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$examChoiceModel = new ExamChoice();\n\t\t\t\t\t\t\t$examChoiceModel->attributes = $examChoice;\n\n\t\t\t\t\t\t\tif (!$examChoiceModel->save())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$flag = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$examChoiceId = Yii::app()->db->lastInsertID;\n\n\t\t\t\t\t\t\t$examQuestionExamChoiceModel = new ExamQuestionExamChoice();\n\t\t\t\t\t\t\t$examQuestionExamChoiceModel->examQuestionId = $examQuestionId;\n\t\t\t\t\t\t\t$examQuestionExamChoiceModel->examChoiceId = $examChoiceId;\n\n\t\t\t\t\t\t\tif (!$examQuestionExamChoiceModel->save())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$flag = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!$flag)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$flag = false;\n\t\t\t\t}\n\n\t\t\t\tif ($flag)\n\t\t\t\t{\n\t\t\t\t\t$transaction->commit();\n\t\t\t\t\t$this->redirect(array(\n\t\t\t\t\t\t'view',\n\t\t\t\t\t\t'id' => $model->examId));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$transaction->rollback();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\tthrow new Exception($e->getMessage());\n\t\t\t\t$transaction->rollback();\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create', array(\n\t\t\t'model' => $model,\n\t\t\t'examQuestionModel' => $examQuestionModel,\n\t\t\t'examChoiceModel' => $examChoiceModel,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Evaluation();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\r\n\t{\r\n\t\t$model=new Study;\r\n\r\n\t\t// Uncomment the following line if AJAX validation is needed\r\n\t\t// $this->performAjaxValidation($model);\r\n\r\n\t\tif(isset($_POST['Study']))\r\n\t\t{\r\n\t\t\t$model->attributes=$_POST['Study'];\r\n\t\t\tif($model->save())\r\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\r\n\t\t}\r\n\r\n\t\t$this->render('create',array(\r\n\t\t\t'model'=>$model,\r\n\t\t));\r\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Employe;\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['Employe']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Employe'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_employe));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create()\n {\n //\n return view('exam.create');\n }", "public function actionCreate()\n {\n $model = new WpIschoolSafecard();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t//\n\t\t// if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\t\t// try {\n\t\t// $model->save();\n\t\t// Yii::$app->session->setFlash('alert', [\n\t\t// 'body' => Yii::$app->params['create-success'],\n\t\t// 'class' => 'bg-success',\n\t\t// ]);\n\t\t// } catch (\\yii\\db\\Exception $exception) {\n\t\tYii::$app->session->setFlash('alert', [\n\t\t\t'body' => Yii::$app->params['create-danger'],\n\t\t\t'class' => 'bg-danger',\n\t\t]);\n\n\t\t// }\n\t\treturn $this->redirect(['index']);\n\t\t// }\n\n\t\t// return $this->render('create', [\n\t\t// 'model' => $model,\n\t\t// ]);\n\t}", "public function actionCreate()\n {\n $model = new SasaranEs4();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()){\n flash('success','Data Sasaran Eselon IV Berhasil Disimpan');\n return $this->redirect(['index']);\n }\n \n flash('error','Data Sasaran Eselon IV Gagal Disimpan');\n \n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Employe();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()) {\n Yii::$app->session->setFlash('success', \"Employee created successfully.\");\n } else {\n Yii::$app->session->setFlash('error', \"Employee not saved.\");\n }\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Persyaratan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_persyaratan]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Test();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Data();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->no]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n \t /** @var ActiveRecord $model */\n \t $modelClass = static::modelClass();\n \t $model = new $modelClass();\n\n\t$viewFolder = '/';\n\t$viewName = 'create';\n\t$viewExtension = '.php';\n\t$viewFile = $this->getViewPath().$viewFolder.$viewName.$viewExtension;\n\t$viewPath = file_exists($viewFile) ? '' : $this->getDefaultViewPath(false);\n\t\n\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t$this->processData($model, 'create');\n\t\treturn $this->redirect(['view', 'id' => $model->getPrimaryKey()]);\n\t} else {\n\t\treturn $this->render($viewPath.$viewName, array_merge($this->commonViewData(), [\n\t\t\t'model' => $model,\n\t]));\n\t}\n }", "public function actionCreate()\n {\n $model = new Patient();\n $model->StatusId = DictionaryDetail::PATIENT_STATUS_NEW;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if (!empty($model->interestPoint)) {\n foreach ($model->interestPoint as $interestPoint) {\n $modelInterestPoint = new InterestPointXPatient();\n $modelInterestPoint->PatientId = $model->Id;\n $modelInterestPoint->InterestPointId = $interestPoint;\n $modelInterestPoint->save();\n }\n }\n return $this->redirect(['view', 'id' => $model->Id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Student();\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $this->setModelByConditions();\n\n if (Yii::$app->request->isPost &&\n $this->model->load(Yii::$app->request->post()) &&\n $this->setAdditionAttributes() &&\n $this->model->save()) {\n\n if ($this->viewCreated) {\n $redirectParams = [\n $this->urlPrefix.'view',\n 'id' => $this->model->getId(),\n ];\n } else {\n $redirectParams = [\n $this->urlPrefix.'index',\n ];\n }\n\n return $this->redirect($redirectParams);\n }\n\n return $this->render('create',\n ArrayHelper::merge(\n [\n 'model' => $this->model,\n ],\n $this->getAdditionFields()\n )\n );\n }", "public function actionCreate()\n {\n $model = new Qrxq2017Enroll();\n $model->loadDefaultValues();\n\n $model->id = JdhnCommonHelper::createGuid();\n $model->created_at = time();\n $model->modified_at = $model->created_at;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new HorarioEstudiante();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new House();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('admin.imagingExam.create');\n }", "public function actionCreate()\n {\n $model = new Amphur();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->amphurId]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('exam::create');\n }", "public function create()\n {\n //\n return view('exams.create');\n }", "public function actionCreate()\n {\n $model = new ActivityDetail();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Clearanceentries();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect([\n 'view', \n 'Clear By ID' => $model['Clear By ID'], \n 'Clearance Level Code' => $model['Clearance Level Code'], \n 'Department' => $model->Department, \n 'Student ID' => $model['Student ID']\n ]);\n } else {\n return $this->render('create', [ 'model' => $model ]);\n }\n }", "public function actionCreate()\n {\n $model = new Point();\n $model->create_at = time();\n $model->user_id = User::getCurrentId();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new RefJkel();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new InterviewDistrict();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $this->isCreateView = true;\n $modelClass = $this->_getModelClass();\n $model = new $modelClass;\n return $this->_renderView($model);\n }", "public function actionCreate()\n {\n $model = new MintaData();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Admin();\n\n /*if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->a_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }*/\n \n if (Yii::$app->request->post() && $model->validate()) {\n return $this->redirect(['view', 'id' => $model->a_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\n\n }", "public function create()\n {\n return view('admin.pages.exam.create');\n }", "public function actionCreate() {\r\n $model = new Fltr();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate()\n {\n $model = new Keep();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Event();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Ddiet();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new EnglishNanorep();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model=new Entry;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Entry']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Entry'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new EstudianteEvaluacion;\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['EstudianteEvaluacion']))\n\t\t{\n\t\t\t$model->attributes=$_POST['EstudianteEvaluacion'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_evaluacion_estudiante));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new UserFeeMaster();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n //$this->paymentUMoney($model);\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'userid' => Yii::$app->user->id,\n ]);\n }", "public function actionCreate() {\n if (Yii::$app->user->can('school_exam')) {\n $model = new SchoolExamMarks();\n\n $classList = ArrayHelper::map(Classes::findAll(['is_active' => 'Y', 'is_deleted' => 'N']), 'id', 'name');\n $subclassList = ArrayHelper::map(Subclass::findAll(['is_active' => 'Y', 'is_deleted' => 'N']), 'id', 'sub_class');\n $semesterList = ArrayHelper::map(SchoolExamSemester::findAll(['is_active' => 'Y', 'is_deleted' => 'N']), 'id', 'semester');\n $divisionList = ArrayHelper::map(Division::findAll(['is_deleted' => 'N', 'is_active' => 'Y']), 'id', 'division');\n $subjectList = ArrayHelper::map(SchoolSubject::findAll(['is_deleted' => 'N', 'is_active' => 'Y']), 'id', 'name_en');\n $standardList = ArrayHelper::map(SchoolExam::findAll(['is_deleted' => 'N', 'is_active' => 'Y']), 'id', 'standard');\n\n $yearList = [];\n\n for ($i = 1430; $i <= 1600; $i++) {\n $yearList[$i] = $i;\n }\n\n if ($model->load(Yii::$app->request->post())) {\n return $this->redirect(['enter-marks', 'year' => $model->year, 'class_id' => $model->class_id, 'subclass_id' => $model->subclass_id, 'division_id' => $model->division_id, 'standard_id' => $model->standard_id, 'semester_id' => $model->semester_id, 'subject_id' => $model->subject_id]);\n //return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'classList' => $classList,\n 'subclassList' => $subclassList,\n 'semesterList' => $semesterList,\n 'yearList' => $yearList,\n 'divisionList' => $divisionList,\n 'standardList' => $standardList,\n 'subjectList' => $subjectList,\n ]);\n }\n } else {\n throw new ForbiddenHttpException;\n }\n }", "public function actionCreate()\n {\n $model = new Rents();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Ora();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->ora_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Survey();\n\n Yii::$app->gon->send('saveSurveyUrl', '/survey/save-new');\n Yii::$app->gon->send('afterSaveSurveyRedirectUrl', \\Yii::$app->request->referrer);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new QuestionReported();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new AdviserResume();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['/adviser/view', 'id' => $model->adviser_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Lessons();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $model->setStudentsInLessons($model->id);\n return $this->redirect(['/teacher/lessons']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n } \n }", "public function actionCreate()\n {\n $model = new Admin();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('exams.create');\n }", "public function actionCreate() {\n $model = new TimeBooks();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate(){\n $model = new MgfConceptNote();\n if ($model->load(Yii::$app->request->post()) && $model->save()) { \n Yii::$app->session->setFlash('success', 'Saved successfully.');\n return $this->redirect(['view', 'id' => $model->id]);\n }else{\n Yii::$app->session->setFlash('error', 'NOT Saved.');\n return $this->redirect(['/mgf-applicant/profile']);\n }\n }", "public function actionCreate() {\n $model = new learnerscoring();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model=new Student;\n// $model_student_score = new Studentscore;\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['Student']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Student'];\n// $model_student_score->personal_id = $model->personal_id;\n $model_has = Student::model()->findByAttributes(array('personal_id'=>$model->personal_id));\n if(isset($model_has)) {\n throw new CHttpException(404,Yii::t('common','The peopele has existed.'));\n } \n $model_has = Student::model()->findByAttributes(array('stdudent_id'=>$model->stdudent_id));\n if($model->stdudent_id != '' && isset($model_has)) {\n throw new CHttpException(404,Yii::t('common','The student id has existed.'));\n } \n// $model->enroll_date = date('Y-m-d',time());\n\t\t\tif($model->save()) {\n //不再同时创建成绩单\n// $model_student_score->record_id = $model->record_id;\n// if ($model_student_score->save())\n// $this->redirect(array('view','id'=>$model->record_id));\n// else {\n// $model->delete();\n// }\n $this->redirect(array('view','id'=>$model->record_id));\n }\n \n\t\t\t\t\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public 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 }", "public function actionCreate()\n {\n $model = new TbTeach();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->teach_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionExamReport() {\n// $modelExam = new Exam;\n// $this->render('examReport', array('modelClassroom'=>$modelClassroom,'modelExam'=>$modelExam));\n $modelClassroom = new Classroom;\n if (isset($_POST['Classroom'])) {\n $modelClassroom->attributes = $_POST['Classroom'];\n }\n\n// trace($modelClassroom->id);\n\n $modelExam = new Exam;\n if (isset($_POST['Exam'])) {\n $modelExam->attributes = $_POST['Exam'];\n }\n $this->render('examReport', array('modelClassroom' => $modelClassroom, 'modelExam' => $modelExam));\n }", "public function actionCreate()\n\t{\n\t\t$model=new Employer;\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['Employer']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Employer'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->employer_id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new denied();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new EstudiosIps();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new RealEstateMaster();\n\n if ($model->load(Yii::$app->request->post()) && Yii::$app->SetValues->Attributes($model) && $model->validate()) {\n $data = Yii::$app->request->post();\n $aggrement = UploadedFile::getInstances($model, 'aggrement');\n $ejari = UploadedFile::getInstance($model, 'ejari');\n $cheque_copy = UploadedFile::getInstance($model, 'cheque_copy');\n $model->ejari_expiry = $model->ejari_expiry != '' ? date('Y-m-d', strtotime($model->ejari_expiry)) : '';\n if (!empty($aggrement)) {\n $model->aggrement = $aggrement->extension;\n }\n if (!empty($ejari)) {\n $model->ejari = $ejari->extension;\n }\n if (!empty($cheque_copy)) {\n $model->cheque_copy = $cheque_copy->extension;\n }\n if ($model->save()) {\n $this->EstateDetails($model);\n if ($model->no_of_cheques != '' && $model->no_of_cheques >= 1) {\n $this->ChequeDetails($model, $data);\n }\n $this->upload($model, $aggrement, $ejari, $cheque_copy);\n Yii::$app->session->setFlash('success', \"Real Estate Details Created Successfully\");\n return $this->redirect(['real-estate-details', 'id' => $model->id]);\n// $model = new RealEstateMaster();\n }\n } return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n //\n return view('hr/employee/create');\n }", "public function actionCreate()\r\n {\r\n $model = new Tax;\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['index', 'added' => 'yes']);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate() {\n $model = new Foro();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\r\n $model = new Statements;\r\n\r\n // Uncomment the following line if AJAX validation is needed\r\n // $this->performAjaxValidation($model);\r\n\r\n if (isset($_POST['Statements'])) {\r\n $model->attributes = $_POST['Statements'];\r\n if ($model->save())\r\n $this->redirect(array('view', 'id' => $model->idStatement));\r\n }\r\n\r\n $this->render('create', array(\r\n 'model' => $model,\r\n ));\r\n }", "public function actionCreate()\r\n {\r\n $model = new Pelanggaran();\r\n $trans = Yii::$app->db->beginTransaction();\r\n\r\n if ($model->loadAll(Yii::$app->request->post()) && $model->save()) {\r\n $check = $this->checkDetailPoint($model, 'create');\r\n \r\n if( isset($check['failed']) ){\r\n $trans->rollBack();\r\n Yii::$app->session->setFlash('error', $check['failed'] );\r\n return $this->redirect(['index']);\r\n }\r\n\r\n $trans->commit();\r\n Yii::$app->session->setFlash('success','Pelanggaran berhasil ditambahkan.');\r\n return $this->redirect(['index']);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate()\n {\n\t\t$idInstitucion = $_SESSION['instituciones'][0];\n $model = new InfraestructuraEducativa();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\t\n\t\t$sedes = $this->obtenerSedes($idInstitucion);\n\t\t$estados = $this->obtenerEstados();\n\t\t\n return $this->render('create', [\n 'model' => $model,\n\t\t\t'sedes'=> $sedes,\n\t\t\t'estados'=>$estados,\n\t\t\t'idInstitucion'=>$idInstitucion,\n ]);\n }", "public function actionCreate()\n {\n $model = new Programador();\n //Yii::$app->request->post() wrapper de Yii para obtener datos seguros enviados por POST\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = $this->elementAccessForm;\n $tree = $this->authTree->getArrayAuthTreeStructure($this->authTree->getAuthTree());\n\n if ($model->load(Yii::$app->request->post()) && $saveId = $model->save()) {\n return $this->redirect(['view', 'id' => $saveId]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'tree' => $tree,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new JetShopDetails();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Major();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()) {\n $this->success(Yii::t('flash', 'major.save_success'));\n } else {\n $this->error(Yii::t('flash', 'major.save_error'));\n }\n return $this->redirect(['index']);\n } \n return $this->render('create', [\n 'model' => $model,\n ]);\n \n }", "public function create()\n {\n return view('Employee.AddEmp');\n }", "public function actionCreate()\n\t{\n\t\t$model = $this->loadModel();\n\n\t\tif(isset($_POST[get_class($model)]))\n\t\t{\n $model = $this->_prepareModel($model);\n if (Yii::app()->getRequest()->isAjaxRequest) {\n if($model->save())\n echo json_encode($model);\n else\n echo json_encode(array('modelName' => get_class($model),'errors' => $model->getErrors()));\n\n Yii::app()->end();\n }\n\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model=new StudentReg;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if(isset($_POST['StudentReg']))\n {\n $model->attributes=$_POST['StudentReg'];\n if($model->save())\n $this->redirect(array('view','id'=>$model->id));\n }\n\n $this->render('create',array(\n 'model'=>$model,\n ));\n }", "public function actionCreate()\n {\n $model = new Inventorier();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->codebien]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Kareer();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model=new eBayTargetAndTrack;\n\n $this->layout='';\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\n $this->layout='//layouts/column2';\n\t}", "public function create()\n {\n if (!$this->isRole())\n return redirect()->back();\n $depts=Department::all();\n $students=Student::all();\n return view('marks.create',compact('depts','students'));\n }", "public function actionCreate()\n {\n $model = new Quotation();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new StandartOne();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate() {\n $model = new Test();\n\n if ($model->load(Yii::$app->request->post())) {\n $this->dateformat($model, $_POST['Test']);\n $model->save();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Photo();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->id]);\n\t return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate() {\n $model = new Employee();\n \n $data = $this->data;\n\n if (!empty($data)) {\n $model->employee_code = $data['employee_code'];\n $model->employee_name = $data['employee_name'];\n $model->employee_email = $data['employee_email'];\n $model->status = $data['status'];\n $model->department_id = $data['department_id'];\n }\n\n $errors = $this->EmpDetailsvalidate($data['address']);\n if ($model->validate() && empty($errors)) {\n $model->save();\n\n $this->InsertUpdateEmpAddress($model->id, $data['address']);\n echo $this->messageReturn(\"success\", 200);\n } else {\n $error = $model->getErrors();\n //print_r($errors);\n array_push($error, $errors);\n echo $this->messageReturn(\"error\", 404, \"\", $error);\n }\n exit;\n }", "public function actionCreate()\n {\n $model = new Quote();\n $model->loadDefaultValues();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('student.insertStudent');\n }", "public function create()\n {\n //\n return view('employee.add');\n }", "public function actionCreate()\r\n {\r\n $model = new Apresentacao();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['index', 'id' => $model->idapresentacao]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate()\n {\n $model = new AllocationDetails();\n\n if ($model->load(Yii::$app->request->post())) \n {\n\n $wpLoc = WpLocation::findOne(['id'=>$model->wpLocCode]);\n $model->name = $wpLoc->name;\n $model->wpLocCode =(int)$wpLoc->id; \n \n /*$model->yearId =(string) $year->_id;*/\n if(isset($model->yearId)):\n \t$year = CurrentYear::findOne(['_id'=>$model->yearId]);\n \telse:\n \t\t$year = CurrentYear::getCurrentYear();\n \tendif;\n $yearstring =substr($year->yearStartDate,-4).substr($year->yearEndDate,-4);\n $model->allocationID = $model->wpLocCode.$yearstring;\n //$model->status = AllocationDetails::ALLOC_EXT;\n $this->redirect(['index']);\n if($model->save()):\n $message = 1;\n else:\n $message = 'Failure.Record not created.';\n throw new \\yii\\web\\ServerErrorHttpException($message);\n\n endif;\n return $message;\n }\n /* elseif (\\yii::$app->request->isAjax)\n { \n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n //return $this->redirect(['view', 'id' => (string)$model->_id]);\n }*/\n else\n {\n return $this->render('create', [\n 'model' => $model,\n ]);\n } \n }", "public function actionCreate()\n {\n $model = new Invoice();\n $model->loadDefaultValues();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } elseif (Yii::$app->request->isAjax) {\n return $this->renderAjax('create', [\n 'model' => $model\n ]);\n } else {\n return $this->render('create', [\n 'model' => $model\n ]);\n }\n }", "public function create()\n {\n //\n return view('employee.create');\n }", "public function create()\n {\n $exam = null;\n $marksDistributionTypes = [1,2];\n\n $classes = IClass::where('status', AppHelper::ACTIVE)->orderBy('order', 'asc')\n ->pluck('name', 'id');\n\n return view('backend.exam.add', compact('exam', 'marksDistributionTypes','classes'));\n }", "public function actionCreate()\n {\n $model = new EnfermedadesSintomas([\n 'enfermedad_id' => Yii::$app->request->post('list'),\n 'sintoma_id' => Yii::$app->request->post('item'),\n ]);\n //dd($model->validate());\n if (!$model->save()) {\n throw new \\Exception('No se ha ppodido agregar el sintoma a la enfermedad', 1);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model = new Post;\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save())\n\t\t{\n\t\t\treturn $this->redirect(['site/index']);\n\t\t}\n\t\t\n\t\techo $this->render('create', array(\n\t\t\t'model' => $model\n\t\t));\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Help;\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['Help']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Help'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create()\n {\n $exams=Exam::lists('title','id');\n return view('marksheet/create',compact('exams'));\n }", "public function create()\n {\n return view('teacher.exams.create');\n }" ]
[ "0.75224596", "0.70448494", "0.69286925", "0.6925248", "0.6869331", "0.6866634", "0.6846652", "0.68006235", "0.6791648", "0.67599225", "0.6747884", "0.67406905", "0.67236465", "0.67160517", "0.66948795", "0.6693164", "0.6677648", "0.6677507", "0.6677325", "0.667132", "0.66658115", "0.6665657", "0.6657997", "0.6604234", "0.65812826", "0.6575975", "0.6567612", "0.655345", "0.65533566", "0.6550623", "0.65460455", "0.65313655", "0.6526448", "0.6518244", "0.64982426", "0.6493825", "0.6478195", "0.6477696", "0.64759696", "0.64662", "0.6465619", "0.6450385", "0.6443137", "0.6441896", "0.64250755", "0.6421159", "0.64146703", "0.64101505", "0.6404593", "0.64037204", "0.6402656", "0.6397718", "0.6394664", "0.6379304", "0.6373988", "0.6370692", "0.6370692", "0.63656986", "0.63592917", "0.6356769", "0.6356474", "0.63557804", "0.6353297", "0.63529414", "0.63519704", "0.6339137", "0.632802", "0.6327652", "0.6326777", "0.6322056", "0.63218385", "0.6317887", "0.63134223", "0.6310959", "0.63042474", "0.6299216", "0.62962854", "0.62926596", "0.629111", "0.6285575", "0.6284882", "0.62773967", "0.6271626", "0.62704164", "0.6269343", "0.6265899", "0.6265665", "0.6263769", "0.6263419", "0.62615454", "0.6259034", "0.62577254", "0.62558705", "0.62545234", "0.62471455", "0.62430227", "0.6241689", "0.6240843", "0.6239446", "0.62382585" ]
0.84992194
0
Updates an existing Examination model. If update is successful, the browser will be redirected to the 'view' page.
public function actionUpdate($id) { $model = $this->findModel($id); if ($model->load(Yii::$app->request->post())) { $this->saveResult($model->result, $model->user_id); $this->actionDelete($model->id); } return $this->render('update', [ 'model' => $model, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\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['ElearningExam']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ElearningExam'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->elearningExamId));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate() {\n $data = $this->data;\n $model = $this->findModel($data['employee_id']);\n if ($model) {\n $model->employee_code = $data['employee_code'];\n $model->employee_name = $data['employee_name'];\n $model->employee_email = $data['employee_email'];\n $model->status = $data['status'];\n $model->department_id = $data['department_id'];\n\n $errors = $this->EmpDetailsvalidate($data['address']);\n if ($model->validate() && empty($errors)) {\n $model->save();\n $this->InsertUpdateEmpAddress($model->id, $data['address']);\n echo $this->messageReturn(\"success\", 200);\n exit;\n } else {\n $error = $model->getErrors();\n echo $this->messageReturn(\"error\", 404, \"\", $error);\n exit;\n }\n } else {\n echo $this->messageReturn(\"failed\", 201, \"\", \"Please sent correct parameter\");\n exit;\n }\n }", "public function actionUpdate($id)\n\t{\n\t\t$model = $this->loadModel($id);\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['Exam']))\n\t\t{\n\t\t\t$model->attributes = $_POST['Exam'];\n\t\t\tif ($model->save())\n\t\t\t\t$this->redirect(array(\n\t\t\t\t\t'view',\n\t\t\t\t\t'id' => $model->examId));\n\t\t}\n\n\t\t$this->render('update', array(\n\t\t\t'model' => $model,));\n\t}", "function update(){\n\t\t$this->model->update();\n\t}", "public function actionUpdate()\n\t{\n\t\t$model=$this->loadModel();\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['Residencebaseinfo']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Residencebaseinfo'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->rbi_id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function updateAction() {\n $model = new Application_Model_Compromisso();\n //passo para a model os dados a serem upados\n $model->update($this->_getAllParams());\n //redireciono para a view\n $this->_redirect('compromisso/index');\n }", "public function actionUpdate() {\n $model = $this->loadModel();\n $modelAmbienteUso = new Ambiente_Uso;\n $modelUsuario = new Usuario();\n $modelAmbiente = new Ambiente();\n $modelPredio = new Predio();\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Alocacao'])) {\n $model->attributes = $_POST['Alocacao'];\n $a = $model->DT_DIA;\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->ID_ALOCACAO));\n }\n\n $this->render('update', array(\n 'model' => $model,\n 'modelAU' => $modelAmbienteUso,\n 'modelU' => $modelAmbienteUso,\n 'modelA' => $modelAmbiente,\n 'modelP' => $modelPredio\n ));\n }", "public function actionUpdate()\n {\n $model = $this->findModel(Yii::$app->request->post('id'));\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $model;\n }\n return $model->errors;\n }", "public function actionUpdate()\n {\n if (!$model = $this->findModel()) {\n Yii::$app->session->setFlash(\"error\", Yii::t('modules/user', \"You are not logged in.\"));\n $this->goHome();\n } else if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash(\"success\", Yii::t('modules/user', \"Changes has been saved.\"));\n $this->refresh();\n } else {\n return $this->render('update', ['model' => $model,]);\n }\n }", "public function actionUpdate()\n {\n\t\t\t$id=7;\n $model = $this->findModel($id);\n $model->slug = \"asuransi\";\n $model->waktu_update = date(\"Y-m-d H:i:s\");\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update(Request $request, Exam $exam,$id)\n {\n $this->validate($request, [\n 'board_id' => 'required',\n 'medium_id' => 'required',\n 'standard_id' => 'required',\n 'semester_id' => 'required',\n 'subject_id' => 'required',\n 'unit_id' => 'required',\n 'name' => 'required',\n 'time_duration' => 'required',\n 'exam_date' => 'required',\n 'total_marks' => 'required',\n 'total_question' => 'required',\n 'start_time' => 'required',\n 'end_time' => 'required', \n ]);\n\n \n $update = Exam::find($id);\n $update->board_id = $request->board_id;\n $update->medium_id = $request->medium_id;\n $update->standard_id = $request->standard_id;\n $update->semester_id = $request->semester_id;\n $update->subject_id = $request->subject_id;\n $update->unit_id = $request->unit_id;\n $update->name = $request->name;\n $update->note = isset($request->note) ? $request->note:'';\n $update->time_duration = $request->time_duration;\n $update->exam_date = $request->exam_date;\n $update->total_marks = $request->total_marks;\n $update->total_question = $request->total_question;\n $update->start_time = $request->start_time;\n $update->end_time = $request->end_time;\n $update->negative_marks = $request->negative_marks;\n $update->exam_status = isset($request->exam_status) ? $request->exam_status:0;\n $update->instant_result = isset($request->instant_result) ? $request->instant_result:0;\n $update->is_minus_system = isset($request->is_minus_system) ? $request->is_minus_system:0;\n $update->save();\n\n return redirect()->route('exam.index')->with('success', 'Exam Updated Successfully.');\n }", "public function actionUpdate() //update value from default page to DB\n {\n\n\n $model = $this->findModel($_POST['ExamRoomDetail']['rooms_detail_date'],\n $_POST['ExamRoomDetail']['rooms_detail_time'],\n $_POST['ExamRoomDetail']['rooms_id']\n );\n if(isset($_POST)) {\n $model->load(Yii::$app->request->post());\n $update = $model;\n $update->exam_room_status = $_POST['ExamRoomDetail']['exam_room_status'];\n $update->save();\n }\n\n }", "public function update()\n {\n\t $dataArr = array(\n\t\t'id' => $this->input->post('id'),\n\t\t'paper_code' => $this->input->post('paper_code'),\n\t\t'subject' => $this->input->post('subject'),\n\t\t'min_marks' => $this->input->post('min_marks'),\n\t\t'max_marks' => $this->input->post('max_marks')\n\t\t);\n\t $SetUp=new SetUpModel;\n $SetUp->update_product($dataArr);\n redirect(base_url('index.php/SetUp'));\n }", "public function actionUpdate($id)\n { \n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->a_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update($id)\n\t{\n\t\t$exampath = ExamPath::findOrFail($id);\n\n\t\t$validator = Validator::make($data = Input::all(), Exampath::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\t$exampath->update($data);\n\n\t\treturn Redirect::route('exampaths.index');\n\t}", "public function update(Request $request, EduExam $eduExam)\n {\n //\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t$this->layout='//layouts/modalIframe';\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['Providers']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Providers'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('response', 'id'=>$model->id, 'action'=>'updated'));\n\t\t}\n\n\t\t$this->renderFormAjax($model);\n\n\t\t\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\t\t\n\t\t$idInstitucion = $_SESSION['instituciones'][0]; \n\t\t\n\t\t\n\t\t$sedes = $this->obtenerSedes($idInstitucion);\n\t\t$estados = $this->obtenerEstados();\n\t\t\n\t\t\n\t\t\n return $this->render('update', [\n 'model' => $model,\n\t\t\t'sedes'=> $sedes,\n\t\t\t'estados'=>$estados,\n\t\t\t'idInstitucion'=>$idInstitucion,\n ]);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t return $this->redirect(['index', 'exercise_rule_id' => $model->exercise_rule_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id) {\n\t\t$model = $this->findModel ( $id );\n\t\t\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\n\t\t\treturn $this->redirect ( [ \n\t\t\t\t\t'view',\n\t\t\t\t\t'id' => $model->id \n\t\t\t] );\n\t\t}\n\t\t\n\t\treturn $this->render ( 'update', [ \n\t\t\t\t'model' => $model \n\t\t] );\n\t}", "public function update(Request $request, Exam $exam)\n {\n //\n }", "public function updateAction()\n {\n// \t$this->view->layoutHelp = '/offensive/help_update';\n \t \n \t$id = $this->_request->getParam('id');\n// \t$target = TargetQuery::create()->findPk($id);\n\n \tif(is_null($id))\n \t{\n \t\t$this->view->layoutTitle = 'Angriff anlegen';\n \t\t$target = new Target();\n \t}\n \telse\n \t{\n \t\t$this->view->layoutTitle = 'Angriff bearbeiten';\n \t\t$target = TargetQuery::create()->findPk($id);\n \t}\n \t\n \tif ($this->_request->isPost()) {\n \t\tif(isset($_POST[\"cancel\"]))\n \t\t{\n \t\t\t{\n \t\t\t\t$this->_helper->redirector(\"index\", \"offensive\", \"default\");\n \t\t\t}\n \t\t\t \n \t\t}\n \t\telseif(isset($_POST['save']) || isset($_POST['save+activities']))\n \t\t{\n \t\t\t$postData = $this->_request->getPost();\n \t\t\t$target->fromArray($postData);\n \t\t\t$target->setBoolean($postData);\n \t\t\techo \"<xmp>\"; var_dump($target);\n \t\t\t$target->save();\n \t\t\t\n \t\t\tif(isset($_POST['save']))\n \t\t\t\t$this->_helper->redirector(\"index\", \"offensive\", \"default\");\n \t\t\telse\n \t\t\t\t$this->_helper->redirector(\"list\", \"offensive\", \"default\", array('id' => $target->getId()));\n \t\t}\n \t}\n \t \n \t$this->view->target = $target;\n }", "public function actionUpdate($id)\n {\n\n // p($id);die;\n $model = $this->findModel($id);\n // p($model);die;\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "function update(){\n session_start();\n $id=$_SESSION['id_alumno'];\n $nombre= $_POST['nombre'];\n $apellido= $_POST['apellido'];\n $telefono= $_POST['telefono'];\n \n unset($_SESSION['id_alumno']);\n $this->model->update(['id'=>$id,'nombre'=>$nombre,'apellido'=>$apellido,'telefono'=>$telefono]);\n \n $url= constant('URL').\"alumno\";\n header(\"Location: $url\");\n\n // $this->index();\n\n // if ($this->model->update(['id'=>$id,'nombre'=>$nombre , 'apellido'=>$apellido,'telefono'=>$telefono])) {\n // $alumno = new Alumnos();\n // $alumno->id=$id;\n // $alumno->nombre=$nombre;\n // $alumno->apellido=$apellido;\n // $alumno->telefono=$telefono;\n // $this->view->alumno=$alumno;\n // $this->render();\n\n\n // }else{\n // $this->view->render('errors/index');\n // }\n // $url= constant('URL').\"alumno\";\n // header(\"Location: $url\");\n }", "public function actionUpdate()\n\t{\n\n\t\t//print_r (Yii::app()->user);\n\t\tif (Yii::app()->user->isAdmin){\n\t\t\t$this->layout = \"admin\";\n\t\t}\n\t\n\t\t$model=$this->loadarticles();\n\t\t$params=array('Articles'=>$model);\n//\t\tif(Yii::app()->user->checkAccess('updateOwnArticle',$params))\n//\t\t{\n//\t\t\t\n\t\t\tif(isset($_POST['Articles']))\n\t\t\t{\n\t\t\t\t$model->attributes=$_POST['Articles'];\n\t\t\t\tif($model->save()){\n\t\t\t\t\t$this->redirect(array('show','id'=>$model->id));\n\t\t\t\t}\n\t\t\t}\n//\t\t}else{\n//\t\t\techo \"no permissions\";\n//\t\t}\n\t\t$this->render('update',array('model'=>$model));\n\t}", "public function update()\n\t{\n\t\t$session_email = $this->session->userdata('email');\n\t\t\t//the password stored in session\n\t\t\t$session_password= $this->session->userdata('password' );\n\t\t\t\n\t\tif((isset($session_email ) && isset($session_password)) && ( !empty($session_email) && !empty($session_password)))\n\t\t{\n\t\t\t//name of the employee\n\t\t\t$name = $this->input->post(\"txtName\");\n\t\t\t\n\t\t\t//phone number of the employee\n\t\t\t$phone = $this->input->post(\"textphone\");\n\t\t\t\n\t\t\t//official email id of employee\n\t\t\t$office_id= $this->input->post(\"off_email\");\n\t\t\t\n\t\t\t//alternate email id of employee\n\t\t\t$alt_id= $this->input->post(\"alt_email\");\n\t\t\t\n\t\t\t//qualification of the employee\n\t\t\t$qualification= $this->input->post(\"txtqualification\");\n\t\t\t\n\t\t\t//percentage secured\n\t\t\t$percentage= $this->input->post(\"percentage\");\n\t\t\t\n\t\t\t//salary of the employee\n\t\t\t$salary= $this->input->post(\"txtSalary\");\n\t\t\t\n\t\t\t//employee id\n\t\t\t$employee_id=$this->input->post(\"employee_id\");\n\t\t\t\n\t\t\t//this is server side validation to check all the field are filled or not\n\t\t\tif(isset($name) && isset($phone)\n\t\t\t\t&& isset($office_id)&& isset($alt_id)\n\t\t\t\t&& isset($qualification )&&isset($percentage)\n\t\t\t\t&& isset($salary) && isset($employee_id) )\n\t\t\t{\n\t\t\t\t//converting the details into an associative array\n\t\t\t\t$employee_info=array(\n\t\t\t\t\t\t\t\t\t'name'=>$name,\n\t\t\t\t\t\t\t\t\t'Phone'=>$phone,\n\t\t\t\t\t\t\t\t\t'official_email'=>$office_id,\n\t\t\t\t\t\t\t\t\t'alternate_email'=>$alt_id,\n\t\t\t\t\t\t\t\t\t'highest_qualification'=>$qualification,\n\t\t\t\t\t\t\t\t\t'percentage_secured'=>$percentage,\n\t\t\t\t\t\t\t\t\t'Salary'=>$salary);\n\t\t\t\t//this is called to update the employee's information\t\t\t\t\t\n\t\t\t\t$result=$this->employee_model-> employee_update($employee_id,$employee_info);\n\t\t\t\t\n\t\t\t\t//after successfull updation\n\t\t\t\tif($result==1)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t//this will redirect to the previous view after successfull updation\n\t\t\t\t\tredirect('employee/employee_list/updated', 'refresh');\n\t\t\t\t}\n\t\t\t\t//if updation does not occure\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//echo \"unable to update\";\n\t\t\t\t\tredirect('employee/employee_list/unable', 'refresh');\n\t\t\t\t}\n\t\t\t}\n\t\t\t// values to be updated are not set \";\n\t\t\telse\n\t\t\t{\n\t\t\t\t\n\t\t\t\tredirect('employee/employee_list/unset', 'refresh');\n\t\t\t}\n\t\t}\n\t\t//if email id/password is not set\n\t\telse\n\t\t{\n\t\t\tredirect('employee/index', 'refresh');\n\t\t}\n\t}", "public function actionUpdate($id)\n\n {\n \n $model = new Main();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n return $this->redirect(['view', 'id' => $model->id]);\n\n } else {\n\n return $this->render('update', [\n\n 'model' => $model,\n\n ]);\n\n }\n \n \n\n }", "public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\t\t//print_r(\"update mode\");exit;\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n // return $this->redirect(['view', 'id' => $model->id]);\r\n\t\t return $this->redirect(['index']);\r\n }\r\n\r\n return $this->renderAjax('update', [\r\n 'model' => $model,\r\n ]);\r\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save())\n {\n return $this->redirect(['index']);\n }\n else\n {\n //var_dump($model);\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate()\n\t{\n\t\t$model=$this->loadfiles();\n\t\tif(isset($_POST['Files']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Files'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('show','id'=>$model->id));\n\t\t}\n\t\t$this->render('update',array('model'=>$model));\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index' ,'id' => $model->inmueble_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) \r\n {\r\n return $this->redirect(['view', 'id' => $model->idapresentacao]);\r\n } else {\r\n return $this->render('update', [\r\n 'model' => $model,\r\n\r\n ]);\r\n }\r\n }", "public function update(ExamRequest $request, Exam $exam)\n {\n $exam->update($request->all());\n return redirect()->route('exam.show', $exam->id);\n }", "public function actionUpdate($id) {\n if (Yii::$app->user->can('school_exam')) {\n $model = $this->findModel($id);\n\n $classList = ArrayHelper::map(Classes::findAll(['is_active' => 'Y', 'is_deleted' => 'N']), 'id', 'name');\n $subclassList = ArrayHelper::map(Subclass::findAll(['is_active' => 'Y', 'is_deleted' => 'N']), 'id', 'sub_class');\n $semesterList = ArrayHelper::map(SchoolExamSemester::findAll(['is_active' => 'Y', 'is_deleted' => 'N']), 'id', 'semester');\n $divisionList = ArrayHelper::map(Division::findAll(['is_deleted' => 'N', 'is_active' => 'Y']), 'id', 'division');\n\n $yearList = [];\n\n for ($i = 1430; $i <= 1600; $i++) {\n\n $yearList[$i] = $i;\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'classList' => $classList,\n 'subclassList' => $subclassList,\n 'semesterList' => $semesterList,\n 'yearList' => $yearList,\n 'divisionList' => $divisionList,\n ]);\n }\n } else {\n throw new ForbiddenHttpException;\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()) {\n Yii::$app->session->setFlash('success', \"Employee update successfully.\");\n } else {\n Yii::$app->session->setFlash('error', \"Employee not saved.\");\n }\n return $this->redirect(['index']);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->idNTC_Escaparate]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Calculatepayout'])) {\n $model->attributes = $_POST['Calculatepayout'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->No_]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update()\n\t{\n\t\t$this->getModel()->update($this);\n\t}", "public function update ()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_update');\n $view->title = \"Verein\";\n $view->heading = \"Verein bearbeiten\";\n $view->verein = $vereinRepository->readById($_GET['id']);\n $view->display();\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $modelUpdete = new EmploymentUpdate;\n $modelUpdete->id = $model->id;\n $modelUpdete->date = $model->date;\n if(null !== Yii::$app->request->post('EmploymentUpdate')['date']){\n $date = Carbon::createFromFormat('Y-m-d', Yii::$app->request->post('EmploymentUpdate')['date']);\n $model->date = $date->toDateString();\n }\n if(null !== Yii::$app->request->post('EmploymentUpdate')['id']){\n $model->timetable_id = Yii::$app->request->post('EmploymentUpdate')['id'];\n }\n echo Yii::$app->request->post('id');\n \n if (null !== Yii::$app->request->post('EmploymentUpdate')['date'] && \n null !== Yii::$app->request->post('EmploymentUpdate')['id'] && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }else {\n return $this->render('update', [\n 'model' => $modelUpdete,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n $officeCode0 = Offices::find()->all();\n $officeCode0 = ArrayHelper::map($officeCode0,'officeCode','city');\n\n $reportsTo0 = Employees::find()->all();\n $reportsTo0 = ArrayHelper::map($reportsTo0,'reportsTo','firstName');\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->employeeNumber]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n 'officeCode0' => $officeCode0,\n 'reportsTo0' => $reportsTo0,\n ]);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->amphurId]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id) {\n\t\t$model = $this->findModel ( $id );\n\t\t\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\n\t\t\treturn $this->redirect ( [ \n\t\t\t\t\t'view','id' => $model->weid \n\t\t\t] );\n\t\t} else {\n\t\t\treturn $this->render ( 'update', [ \n\t\t\t\t\t'model' => $model \n\t\t\t] );\n\t\t}\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n if($model->creator_id==Yii::$app->user->identity->id){\n \n if ($model->load(Yii::$app->request->post()) && $model->save()){\n return $this->redirect(['view', 'id' => $model->id]);\n }\n return $this->render('update', ['model' => $model,]);\n }\n\n else{\n return $this->redirect(['index']); \n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n if($model->creator_id==Yii::$app->user->identity->id){\n \n if ($model->load(Yii::$app->request->post()) && $model->save()){\n return $this->redirect(['view', 'id' => $model->id]);\n }\n return $this->render('update', ['model' => $model,]);\n }\n\n else{\n return $this->redirect(['index']); \n }\n }", "public function actionUpdate($id)\n\t{\n\t\t$model = $this->findModel($id);\n\n\t\tif ($model->load($_POST) && $model->save()) {\n // return $this->redirect(Url::previous());\n\t\t}\n return $this->render('update', [\n 'model' => $model,\n 'owner' => Owner::find()->all(),\n 'years' => $this->getYears(),\n ]);\n\t}", "public function actionUpdate($id){\n //$id=getOrganisationID();\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', 'Saved successfully.');\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->Magazine_Issue_Id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->id]);\n\t return $this->redirect(['index']);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function updateEmployee()\n {\n // if we have POST data to create a new employee entry\n if (isset($_POST[\"submit_update_employee\"])) {\n // do updateEmployee() from model/model.php\n $this->model->updateEmployee($_POST[\"firstname\"], $_POST[\"surname\"], $_POST[\"email\"], $_POST[\"phone\"], $_POST[\"category\"], $_POST[\"started\"], $_POST[\"left\"],$_POST['employee_id']);\n }\n\n // where to go after employee has been added\n header('location: ' . URL . 'employees/index');\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\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['EstudianteEvaluacion']))\n\t\t{\n\t\t\t$model->attributes=$_POST['EstudianteEvaluacion'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_evaluacion_estudiante));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $model->parent_id=0;\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index', 'id' => $model->id]);\n } else {\n \t$locals=[];\n \t$locals['model']=$model;\n return $this->render('update', $locals);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n// return $this->redirect(['view', 'id' => $model->id]);\n return $this->redirect('/content-menu');\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->no]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Entry']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Entry'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->KASIR_ID]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['peminjaman/view', 'id' => $model->id_pinjam]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n $this->layout=\"main\";\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n {\n // $model = $this->findModel($id);\n\n // if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // return $this->redirect(['view', 'id' => $model->id]);\n // }\n\n // return $this->render('update', [\n // 'model' => $model,\n // ]);\n\n $model = $this->findModel($id);;\n $modelsAnggota = $model->stSpdAnggotas;\n\n // Only admin can change pegawai instansi otherwise auto_fill_instansi_with_user\n if(Yii::$app->user->identity->role==99){\n $model->setScenario(StSpd::SCENARIO_ADMIN);\n $model->detachBehavior(\"auto_fill_instansi_with_user\");\n }\n\n if ($model->loadAll(Yii::$app->request->post()) && $model->saveAll()) {\n $model->createDocx();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'modelsAnggota' => (empty($modelsAnggota)) ? [new StSpdAnggota] : $modelsAnggota\n ]);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->ora_id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "function update()\n {\n $nim = $this->input->post('nim');\n $nama = $this->input->post('nama');\n $kota = $this->input->post('kota');\n $this->siswa_model->update($nim, $nama, $kota);\n redirect('siswa/page');\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()))\n {\n if($model->save())\n return $this->redirect(['view', 'id' => $model->id]);\n else\n var_dump($model->errors); die;\n }\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\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['Student']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Student'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->ID));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->RA_NUM]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $model->scenario = 'update';\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->validate() ){ \n \n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n\n try {\n //Se guarda encabezado Vale deposito_central\n if ($model->save()){\n $this->deshacer_renglones($model);\n $this->guardar_renglones($model);\n }\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->PE_NROREM]);\n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n throw $e;\n }\n }\n else{\n return $this->render('update', [\n 'model' => $model,\n \n ]);\n }\n \n } else {\n \n\n $renglones = $this->agrupar_medicamentos($model->renglones);\n \n foreach ($renglones as $key => $renglon) {\n $renglones[$key]->descripcion = $renglon->articulo->AG_NOMBRE;\n $renglon->PR_FECVTO = Yii::$app->formatter->asDate($renglon->PR_FECVTO,'php:d-m-Y');\n }\n\n $model->renglones = $renglones;\n\n \n return $this->render('update', [\n 'model' => $model,\n \n ]);\n \n }\n }", "public function actionEdit($id)\r\n\t{\r\n \t\t$this->studyId = $id;\r\n\t\t$model=$this->loadModel($id);\r\n\r\n\t\t// Uncomment the following line if AJAX validation is needed\r\n\t\t// $this->performAjaxValidation($model);\r\n\r\n\t\tif(isset($_POST['Study']))\r\n\t\t{\r\n\t\t\t$model->attributes=$_POST['Study'];\r\n\t\t\tif($model->save()){\r\n\t\t\t\tStudy::updated($this->studyId);\r\n\t\t\t\t$this->redirect(array('edit','id'=>$model->id));\r\n\t\t\t}\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));\r\n\t}", "public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update(Request $request, $id)\n {\n $exam = Exam::find($id);\n $exam->name = $request->name;\n $exam->starting_date = strtotime($request->starting_date);\n $exam->ending_date = strtotime($request->ending_date);\n $exam->school_id = school_id();\n $exam->session = get_schools();\n if($exam->save()){\n\n flash(translate('exam_updated_successfully'))->success();\n \n }else {\n flash('an_error_occured_when_updating_exam')->error();\n \n }\n\n return redirect()->back();\n \n }", "public function update(Request $request, $id)\n {\n $exam = Exam::find($id);\n $exam->name = $request->name;\n $exam->starting_date = strtotime($request->starting_date);\n $exam->ending_date = strtotime($request->ending_date);\n $exam->school_id = school_id();\n $exam->session = get_schools();\n if($exam->save()){\n\n flash(translate('exam_updated_successfully'))->success();\n \n }else {\n flash('an_error_occured_when_updating_exam')->error();\n \n }\n\n return redirect()->back();\n \n }", "public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('up-date', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionUpdate()\n {\n $model = $this->loadModel();\n\n if (isset($_POST['User']))\n {\n $model->attributes = $_POST['User'];\n\n if ($model->save())\n {\n Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('user', 'Данные обновлены!'));\n\n $this->redirect(array('view', 'id' => $model->id));\n }\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\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['Student']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Student'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->record_id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($order_id, $item_id, $shipping_id)\n{\n$model = $this->findModel($order_id, $item_id, $shipping_id);\n\nif ($model->load(Yii::$app->request->post()) && $model->save()) {\nreturn $this->redirect(['view', 'order_id' => $model->order_id, 'item_id' => $model->item_id, 'shipping_id' => $model->shipping_id]);\n} else {\nreturn $this->render('update', [\n'model' => $model,\n]);\n}\n}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->teach_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id) {\r\n $model = $this->findModel($id);\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('update', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->US_ID]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n if(isset(Yii::$app->user->identity->id)){\n if(SiteController::findCom(17)){\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->ADepId]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n else {\n $this->redirect(['site/error']);\n }\n }else {\n $this->redirect(['site/login']);\n }\n}", "public function update()\n {\n $data = Input::all();\n foreach (array_combine($data['question_id'], $data['question_name']) as $question_id => $question_name) {\n $question = Question::find($question_id);\n $question->question_name = $question_name;\n $question->save();\n }\n\n Flash::success('The question has been successfully updated!');\n return Redirect::action('AnswerController@edit', $question->exam_id);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->aid]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\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['UserMeasurements'])) {\n\t\t\t$model->attributes=$_POST['UserMeasurements'];\n\t\t\tif ($model->save()) {\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('update', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionUpdate($id)\n {\n\t\t $model = $this->findModel($id);\n\t\t \n\t\t Yii::$app->view->title = Yii::t('app', 'Update {modelClass}: ', [\n 'modelClass' => 'Invt Check',\n]) . $model->id.' - '.Yii::t('app', Yii::$app->controller->module->params['title']);\n\t\t \n if ($model->load(Yii::$app->request->post())) {\n\t\t\tif($model->save()){\n AdzpireComponent::succalert('edtflsh', 'ปรับปรุงรายการเรียบร้อย');\n\t\t\t return $this->redirect(['view', 'id' => $model->id]);\n\t\t\t}else{\n AdzpireComponent::dangalert('edtflsh', 'ปรับปรุงรายการไม่ได้');\n\t\t\t}\n return $this->redirect(['view', 'id' => $model->id]);\n } \n\n return $this->render('update', [\n 'model' => $model,\n ]);\n \n\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $model->setScenario('update');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => (string)$model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->U_ID]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post())) {\n\n\n $model->PostingDate = $model->PostingDate.' '.date('H:i:s');\n $model->user_id = Yii::$app->user->identity->id;\n $model->comp_id = Yii::$app->session->get('Rules')['comp_id'];\n\n if(!$model->save())\n {\n print_r($model->getErrors());\n exit();\n }else {\n $JournalLine = ItemJournalLine::find()->where(['source_id' => $id])->all();\n foreach ($JournalLine as $value) {\n $AdjLine = ItemJournalLine::findOne($value->id);\n $AdjLine->source_id = $model->id;\n $AdjLine->DocumentNo = $model->DocumentNo;\n $Quantity = $value->Quantity;\n if($model->AdjustType=='-')\n {\n //--ปรับให้เป็น (-) เสมอ--\n //$Quantity = abs($Quantity) * -1;\n }else {\n //--ปรับให้เป็น (+) เสมอ--\n //$Quantity = abs($Quantity);\n }\n $AdjLine->SourceDoc = $model->id;\n $AdjLine->SourceDocNo = $model->DocumentNo;\n $AdjLine->Quantity = $Quantity;\n $AdjLine->QtyToMove = abs($Quantity);\n $AdjLine->QtyMoved = 0;\n $AdjLine->QtyOutstanding = abs($Quantity);\n $AdjLine->TypeOfDocument = $model->TypeOfDocument;\n $AdjLine->location = ($value->location)? $value->location : self::validateLocations();\n\n if($AdjLine->location=='Nil'){ \n Yii::$app->session->setFlash('error', Yii::t('common','Please create location code.'));\n return $this->redirect(['/location/location']);\n exit();\n }\n\n if(!$AdjLine->save())\n {\n echo '<script>alert(\"Error\");</script>';\n print_r($AdjLine->getErrors());\n exit();\n }\n\n }\n return $this->redirect(['update', 'id' => $model->id]);\n }\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['adviser/view', 'id' => $model->adviser_id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\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['Help']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Help'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\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['Indicadores']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Indicadores'];\n\t\t\tif($model->save()){\n\t\t\t\tYii::app()->user->setFlash(\"success\",\"EL indicador de ha guardado de manera correcta\");\n\t\t\t\t$this->redirect(array('lista'));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id) \r\n\r\n\t{\r\n\t\t$model = $this->findModel ( $id );\r\n\t\t\r\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\r\n\t\t\treturn $this->redirect ( [ \r\n\t\t\t\t\t'view',\r\n\t\t\t\t\t'id' => $model->followID \r\n\t\t\t] );\r\n\t\t} else {\r\n\t\t\treturn $this->render ( 'update', [ \r\n\t\t\t\t\t'model' => $model \r\n\t\t\t] );\r\n\t\t}\r\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n //$model_glass = new PersonalPlan();\n\n if ($model->load(Yii::$app->request->post())) {\n\n //$model->\n $model->save();\n\n $div_ass = ExecDivAssignment::findOne(['job_id' => $model->id]);\n $div_ass->div_id = $model->executor_div_id;\n $div_ass->sector_id = $model->executor_sector_id;\n //$div_ass->master_div_id = $div_ass->div_id;\n $div_ass->save();\n\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n $model->executor_div_id = $this->findExecDiv($id);\n $model->executor_sector_id = $this->findExecSector($id);\n return $this->render('graphic/update', [\n 'model' => $model,\n //'back_url'=>Yii::$app->request->getUrl(),\n ]);\n }", "public function update(Request $request, $id)\n {\n $exam = Exam::find($id);\n $exam->name = $request->input('name');\n $exam->abb = $request->input('abb');\n $exam->date = $request->input('date');\n if($request->has('start')) $exam->start = $request->input('start');\n else $exam->start = null;\n if($request->has('end')) $exam->end = $request->input('end');\n else $exam->end = null;\n if($request->has('fee')) $exam->fee = $request->input('fee');\n else $exam->fee = null;\n if($request->has('validity')) $exam->validity = $request->input('validity');\n else $exam->validity = null;\n if($request->has('desc')) $exam->desc = $request->input('desc');\n else $exam->desc = null;\n $exam->save();\n Session::flash('success_message', '<strong>' . $exam->name . '</strong> başarıyla düzenlendi.');\n return redirect()->route('exams.index');\n }", "public function actionUpdate($key)\n {\n $model = $this->findModel($key);\n\n if ($model->load(\\Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'key' => $model->key]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n\t{\n\t\t$model = $this->findModel($id);\n\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t} else {\n\t\t\treturn $this->render('update', [\n\t\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}", "public function actionUpdate($id)\n {\n\tif(Yii::$app->user->can('update-card'))\n\t{ \n\t\t$model = $this->findModel($id);\n\t /* return $this->redirect(Url::toRoute(['reportico/mode/execute',\n\t\t\t\t\t\t\t 'project' => 'GlobalPOS', \n\t\t\t\t\t\t\t 'new_reportico_window' => 1,\n\t\t\t\t\t\t\t 'report' => 'KartHareketleri',\n\t\t\t\t\t\t\t\t\t\t\t'target_format'=>'HTML',\n\t\t\t\t\t\t\t\t\t\t\t'MANUAL_KartNo'=>$id,\n\t\t\t\t\t\t\t\t\t\t\t'MANUAL_DateRange_FROMDATE'=>$model->reportStartDate,\n\t\t\t\t\t\t\t\t\t\t\t'MANUAL_DateRange_TODATE'=>$repFinDate]));\n\n\t\n\t\t*/\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t return $this->redirect(['view', 'id' => $model->ID]);\n\t\t} else {\n\t\t return $this->render('update', [\n\t\t 'model' => $model,\n\t\t ]);\n\t\t}\n\t} else throw new ForbiddenHttpException;\n }", "public function actionUpdate($id)\n\t{\n\t\t$model = $this->findModel($id);\n\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->name]);\n\t\t} else {\n\t\t\treturn $this->render('update', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}", "public function actionUpdate($id)\n {\n \n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate()\n\t{ \n $id=isset($_GET['id']) ? (int) ($_GET['id']) : 0 ; \n \n\t\t$this->render('review_update',array('id'=>$id));\n\t}", "public function actionUpdate($id)\n\t{\n\t\t$model = $this->findModel($id);\n\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t} else {\n\t\t\treturn $this->render('update', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}", "public function actionUpdate($id) {\n $model_ = $this->findModel($id);\n $model = $this->findModel($id);\n $aggrement_ = $model->aggrement;\n $ejari_ = $model->ejari;\n $cheque_copy_ = $model->cheque_copy;\n $cheque_details = \\common\\models\\ChequeDetails::find()->where(['master_id' => $id])->all();\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n $data = Yii::$app->request->post();\n $aggrement = UploadedFile::getInstances($model, 'aggrement');\n $ejari = UploadedFile::getInstance($model, 'ejari');\n $cheque_copy = UploadedFile::getInstance($model, 'cheque_copy');\n $model->ejari_expiry = $model->ejari_expiry != '' ? date('Y-m-d', strtotime($model->ejari_expiry)) : '';\n if (!empty($aggrement)) {\n $model->aggrement = $aggrement->extension;\n } else {\n $model->aggrement = $aggrement_;\n }\n if (!empty($ejari)) {\n $model->ejari = $ejari->extension;\n } else {\n $model->ejari = $ejari_;\n }\n if (!empty($cheque_copy)) {\n $model->cheque_copy = $cheque_copy->extension;\n } else {\n $model->cheque_copy = $cheque_copy_;\n }\n if ($model->save()) {\n $this->UpdateRealEstateDetails($model, $model_);\n $this->upload($model, $aggrement, $ejari, $cheque_copy);\n $this->ChequeDetails($model, $data);\n if (isset($_POST['updatee']) && $_POST['updatee'] != '') {\n $this->UpdateChequeDetails($_POST['updatee']);\n }\n Yii::$app->session->setFlash('success', \"Real Estate Updated successfully\");\n }\n return $this->redirect(['update', 'id' => $model->id]);\n } return $this->render('update', [\n 'model' => $model,\n 'cheque_details' => $cheque_details,\n ]);\n }", "public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }" ]
[ "0.6903996", "0.68268675", "0.6550709", "0.6491861", "0.64810616", "0.64707583", "0.6439833", "0.6423515", "0.6373841", "0.630749", "0.6284817", "0.62710667", "0.6256288", "0.62167495", "0.61853254", "0.61836785", "0.61529386", "0.614503", "0.614365", "0.6133829", "0.6130882", "0.61292493", "0.6122402", "0.61167985", "0.611669", "0.6115372", "0.6107419", "0.61050004", "0.6090676", "0.60865194", "0.60806453", "0.6080232", "0.60792714", "0.60667956", "0.60658044", "0.6053647", "0.60426253", "0.60424614", "0.60411274", "0.6040644", "0.6040244", "0.6038376", "0.60236526", "0.6020532", "0.6018131", "0.6018131", "0.6016839", "0.6014926", "0.6000241", "0.6000089", "0.5999973", "0.59932524", "0.5992399", "0.5986876", "0.5985351", "0.5980226", "0.59800696", "0.5979695", "0.59764105", "0.59716624", "0.5970387", "0.5967375", "0.5965424", "0.5959443", "0.59589", "0.5958585", "0.59566885", "0.5942793", "0.5938044", "0.5938044", "0.59359384", "0.5933847", "0.59306675", "0.59272784", "0.59242105", "0.59173316", "0.59160644", "0.59144974", "0.591408", "0.591336", "0.5904746", "0.5900967", "0.5899562", "0.58939826", "0.58935046", "0.58898264", "0.5887655", "0.5885895", "0.5884583", "0.5883035", "0.588034", "0.5878293", "0.58777726", "0.5872586", "0.5869112", "0.5868725", "0.58651435", "0.5863937", "0.58638316", "0.5862045", "0.5856945" ]
0.0
-1
Deletes an existing Examination model. If deletion is successful, the browser will be redirected to the 'index' page.
public function actionDelete($id) { $this->findModel($id)->delete(); return $this->redirect(['index']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionDelete()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\n\t\t$this->checkUser();\n\t\t$this->checkActivation();\n\t//\t$model = new Estate;\n\t\t\n\t\tif($model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$model=Estate::model()->findbyPk($_GET['id']);\n\t\t\tif($model===null)\n\t\t\t\tthrow new CHttpException(404, Yii::t('app', 'The requested page does not exist.'));\n\t\t}\n\t\t\n\t\tEstateImage::deleteAllImages($model->id);\t\n\t\t@unlink(dirname(Yii::app()->request->scriptFile).$model->tour);\n\t\t@unlink(dirname(Yii::app()->request->scriptFile).$model->image);\n\t\t\n\t\t$model->delete();\n\t\t\n\t\t\n\t\tModeratorLogHelper::AddToLog('deleted-estate-'.$model->id,'Удален объект #'.$model->id.' '.$model->title,null,$model->user_id);\n\t\t$this->redirect('/cabinet/index');\n\t\t\n\t}", "public function actionDelete()\n {\n if ($post = Template::validateDeleteForm()) {\n $id = $post['id'];\n $this->findModel($id)->delete();\n }\n return $this->redirect(['index']);\n }", "public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n try {\n $this->findModel($id)->delete();\n } catch (StaleObjectException $e) {\n } catch (NotFoundHttpException $e) {\n } catch (\\Throwable $e) {\n }\n\n return $this->redirect(['index']);\n }", "public function actionDelete()\n {\n if (!$this->isAdmin()) {\n $this->getApp()->action403();\n }\n\n $request = $this->getApp()->getRequest();\n $id = $request->paramsNamed()->get('id');\n $model = $this->findModel($id);\n if (!$model) {\n $this->getApp()->action404();\n }\n\n $model->delete();\n\n return $this->back();\n }", "public function actionDelete()\n {\n $id= @$_POST['id'];\n if($this->findModel($id)->delete()){\n echo 1;\n }\n else{\n echo 0;\n }\n\n return $this->redirect(['index']);\n }", "public function actionDelete() {\n $data = $this->data;\n if (isset($data['employee_id']) && !empty($data['employee_id'])) {\n $model = $this->findModel($data['employee_id']);\n if ($model) {\n $this->findModel($data['employee_id'])->delete();\n EmployeeAddress::deleteAll(['employee_id' => $data['employee_id']]);\n echo $this->messageReturn(\"success\", 200);\n exit;\n } else {\n echo $this->messageReturn(\"failed\", 201, \"\", \"Employee id not found\");\n exit;\n }\n } else {\n echo $this->messageReturn(\"failed\", 201, \"\", \"Please sent correct parameter\");\n exit;\n }\n }", "public function deleteAction() {\n\t\t\t$this->_forward('index');\n\t\t}", "public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n $this->findModel($id)->delete();\n }", "public function deleteAction()\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 (true === $this->employee->setAction('delete'))\n\t\t{\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t}", "public function delete()\n {\n Contest::destroy($this->modelId);\n $this->modalConfirmDeleteVisible = false;\n $this->resetPage();\n }", "public function deleteAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif ($item) {\n\t\t\t$item->delete();\n\t\t}\n\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName));\n\t}", "public function action_delete() {\n $elect_id = $this->request->query('elect_id');\n $res = Model::factory('Elect')->delete($elect_id);\n if(!$res) exit('error action_delete');\n $this->redirect('/'); \n }", "public function actionDelete()\n\t{\n\t\tif(Yii::app()->request->isPostRequest)\n\t\t{\n\t\t\tif (!($model = $this->loadModel()))\n\t\t\t\treturn;\n\t\t\t$model->delete();\n\n\t\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\t\tif(!isset($_GET['ajax']))\n\t\t\t\t$this->redirect(array('index'));\n\t\t}\n\t\telse\n\t\t\tthrow new CHttpException(400,'Invalid request. Please do not repeat this request again.');\n\t}", "public function actionDelete()\n {\n if(isset($_POST['id'])){\n $id = $_POST['id'];\n $this->findModel($id)->delete();\n echo \"success\";\n }\n }", "public function deleteAction()\n {\n $request = $this->getRequest();\n\n $routeMatch = $this->getEvent()->getRouteMatch();\n $id = $routeMatch->getParam('exercise_id', 0);\n\n if ($id <= 0) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $exercise = $this->_exercise->getRow(array('exercise_id' => $id));\n\n if (!$exercise) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $workoutId = $exercise->workout_id;\n\n $exercise->delete();\n\n return $this->redirect()->toRoute('hi-training/workout-exercise/list/wildcard', array('workout_id' => $workoutId));\n\n }", "public function actionDelete()\n\t{\n\t parent::actionDelete();\n\t\t$model=$this->loadModel($_POST['id']);\n\t\t $model->delete();\n\t\techo CJSON::encode(array(\n 'status'=>'success',\n 'div'=>'Data deleted'\n\t\t\t\t));\n Yii::app()->end();\n\t}", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']); \n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']); \n }", "public function actionDelete()\r\n {\r\n $this->_userAutehntication();\r\n\r\n switch($_GET['model'])\r\n {\r\n /* Load the respective model */\r\n case 'posts': \r\n $model = Post::model()->findByPk($_GET['id']); \r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Error: Mode <b>delete</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n /* Find the model */\r\n if(is_null($model)) {\r\n // Error : model not found\r\n $this->_sendResponse(400, sprintf(\"Error: Didn't find any model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n }\r\n\r\n /* Delete the model */\r\n $response = $model->delete();\r\n if($response>0)\r\n $this->_sendResponse(200, sprintf(\"Model <b>%s</b> with ID <b>%s</b> has been deleted.\",$_GET['model'], $_GET['id']) );\r\n else\r\n $this->_sendResponse(500, sprintf(\"Error: Couldn't delete model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n }", "public function actionDelete()\n {\n return $this->findModel(Yii::$app->request->post('id'))->delete(false);\n }", "public function deleteAction()\r\n\t{\r\n\t\t// check if we know what should be deleted\r\n\t\tif ($id = $this->getRequest()->getParam('faq_id')) {\r\n\t\t\ttry {\r\n\t\t\t\t\r\n\t\t\t\t// init model and delete\r\n\t\t\t\t$model = Mage::getModel('flagbit_faq/faq');\r\n\t\t\t\t$model->load($id);\r\n\t\t\t\t$model->delete();\r\n\t\t\t\t\r\n\t\t\t\t// display success message\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('cms')->__('FAQ Entry was successfully deleted'));\r\n\t\t\t\t\r\n\t\t\t\t// go to grid\r\n\t\t\t\t$this->_redirect('*/*/');\r\n\t\t\t\treturn;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\tcatch (Exception $e) {\r\n\t\t\t\t\r\n\t\t\t\t// display error message\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n\t\t\t\t\r\n\t\t\t\t// go back to edit form\r\n\t\t\t\t$this->_redirect('*/*/edit', array (\r\n\t\t\t\t\t\t'faq_id' => $id ));\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// display error message\r\n\t\tMage::getSingleton('adminhtml/session')->addError(Mage::helper('cms')->__('Unable to find a FAQ entry to delete'));\r\n\t\t\r\n\t\t// go to grid\r\n\t\t$this->_redirect('*/*/');\r\n\t}", "public function actionDeletex($id)\n {\n /* $this->findModel($id)->delete();\n\n return $this->redirect(['index']); */\n }", "public function actionDelete()\n\t{\n\t\t$md5 = Yii::app()->getRequest()->getParam('normal_md5', '');\n\n\t\t/** @var $model SeoRewrite */\n\t\t$model = SeoRewrite::model()->findByAttributes(array('normal_md5'=>$md5));\n\t\tif ( $model===null )\n\t\t\tthrow new CHttpException(404);\n\n\t\t$model->delete();\n\t\tif (Yii::app()->getRequest()->getIsAjaxRequest()) {\n\t\t\tdie( json_encode(array('success'=>true), JSON_NUMERIC_CHECK) );\n\t\t} else {\n\t\t\t$this->redirect(array('index'));\n\t\t}\n\t}", "public function actionDelete($id){\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete()\n {\n //Yii::$app->controller->enableCsrfValidation = false;\n //print_r($_POST);\n if($_POST['selection_all']==1){\n DipaMaster::deleteAll();\n return $this->redirect(['index']);\n } else {\n foreach ($_POST['selection'] as $key => $value) {\n $this->findModel($value)->delete();\n }\n return $this->redirect(['index']);\n }\n // $this->findModel($id)->delete();\n\n // return $this->redirect(['index']);\n }", "public function deleteAction()\n {\n if ($this->isConfirmedItem($this->_('Delete %s'))) {\n $model = $this->getModel();\n $deleted = $model->delete();\n\n $this->addMessage(sprintf($this->_('%2$u %1$s deleted'), $this->getTopic($deleted), $deleted), 'success');\n $this->_reroute(array('action' => 'index'), true);\n }\n }", "public function actionDelete($id)\n {\n\t $model = $this->findModel($id);\n\t $exercise_rule_id=$model->exercise_rule_id;\n\t $model->delete();\n return $this->redirect(['index','exercise_rule_id' => $exercise_rule_id]);\n }", "public function delete() {\n $flg = $this->Seatmodel->delete();\n\n if (!empty($flg)) {\n $this->session->set_flashdata('successmessage', 'Data deleted successfully');\n } else {\n $this->session->set_flashdata('errormessage', 'Oops! Something went wrong');\n }\n\n redirect(base_url('admin-seat-list'));\n }", "public function deleteAction()\n {\n $id = (int) $this->params()->fromRoute('id', 0);\n if (!$id) {\n return $this->redirect()->toRoute('backend-evenements-personnage-list');\n }\n $oTable = $this->getTable();\n $oEntite = $oTable->findRow($id);\n $oTable->delete($oEntite);\n $this->flashMessenger()->addMessage($this->_getServTranslator()->translate(\"La evenements-personnage a été supprimé avec succès.\"), 'success');\n return $this->redirect()->toRoute('backend-evenements-personnage-list');\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function destroyAction() {\n $model = new Application_Model_Compromisso();\n //mando para a model o id de quem sera excluido\n $model->delete($this->_getParam('id'));\n //redireciono\n $this->_redirect('compromisso/index');\n }", "public function actionDelete($id)\n {\n // $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function deleteAction(){\n\n\t\t$auth = Zend_Auth::getInstance();\n\t\tif($auth->hasIdentity())\n\t\t{\n\t\t\t\n\t\t\t$loginUserId = $auth->getStorage()->read()->id;\n\t\t}\n\t\t$id = $this->_request->getParam('id');\n\t\t$emp_id = $this->_request->getParam('emp_id');\n\t\t$messages['message'] = ''; $messages['msgtype'] = '';\n\t\t$messages['flagtype'] = '';\n\t\t$actionflag = 3;\n\t\tif($id)\n\t\t{\n\t\t\t\n\t\t\t$employeeadvancesModel = new Expenses_Model_Employeeadvances();\n\n\t\t\t//check employee has amount of select amount\n\t\t\t$getEmployeeBalance = $employeeadvancesModel->getEmpAdvanceSummary($emp_id);\n\t\t\t$total = !empty($getEmployeeBalance[0]['balance'])?$getEmployeeBalance[0]['balance']:0;\n\t\t\t\n\t\t\t$employeeAdvanceData = $employeeadvancesModel->getsingleEmployeeadvancesData($id,$type='advance');\n\t\t\t\n\t\t\t$employeebalance = !empty($employeeAdvanceData[0]['application_amount'])?$employeeAdvanceData[0]['application_amount']:0;\n\t\t\t\n\t\t\tif($total >= $employeebalance) //if employee has suffiecient amount to delete advance\n\t\t\t{\n\t\t\t\t$data = array('isactive'=>0,'modifieddate'=>gmdate(\"Y-m-d H:i:s\"));\n\t\t\t\t$data['modifiedby'] = $loginUserId;\n\t\t\t\t$where = array('id=?'=>$id);\n\t\t\t\t$id = $employeeadvancesModel->saveOrUpdateAdvanceData($data, $where);\n\t\t\t\tif($id == 'update')\n\t\t\t\t{\n\t\t\t\t\t//remove deleted advance amount from employee total advance amount\n\t\t\t\t\t$advancesummary = new Expenses_Model_Advancesummary();\n\t\t\t\t\t$emp_advance_summery = $advancesummary->getAdvanceDetailsById($emp_id);\n\t\t\t\t\t$totalsum = $emp_advance_summery[0]['total']-$employeebalance;\n\t\t\t\t\t$balence = $emp_advance_summery[0]['balance']-$employeebalance;\n\t\t\t\t\t$summerydata = array('total'=>$totalsum,\n\t\t\t\t\t\t\t\t\t'balance'=>$balence,\n\t\t\t\t\t\t\t\t\t 'modifiedby'=> $loginUserId,\n\t\t\t\t\t\t\t\t\t 'modifieddate' =>gmdate(\"Y-m-d H:i:s\")\n\t\t\t\t\t\t\t\t );\n\t\t\t\t\t$summeryWhere = array('employee_id=?'=>$emp_id); \n\t\t\t\t\t$insertSummey = $advancesummary->SaveAdvanceData($summerydata, $summeryWhere);\n\t\t\t\t\t\n\t\t\t\t\t$messages['message'] = 'advance deleted successfully.';\n\t\t\t\t\t$messages['msgtype'] = 'success';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$messages['message'] = 'advance cannot be deleted.';\n\t\t\t\t\t$messages['msgtype'] = 'error';\n\t\t\t\t}\n\t\t\t}else\n\t\t\t{\n\t\t\t\t$messages['message'] = 'advance cannot be deleted already used.';\n\t\t\t\t$messages['msgtype'] = 'error';\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t \n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$messages['message'] = 'advance cannot be deleted.';\n\t\t\t$messages['msgtype'] = 'error';\n\t\t}\n\t\t$this->_helper->json($messages);\n\n\t}", "public function actionDelete($id)\n {\n\t\t$model = $this->findModel($id);\n\n\t\t$model->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n\t\t$this->findModel($id)->delete();\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete()\n\t{\n\t\tif(Yii::app()->request->isPostRequest)\n\t\t{\n\t\t\t// we only allow deletion via POST request\n\t\t\t$model = $this->loadModel();\n $rbi_id = $model->rbi_id;\n $model->delete();\n if($model->rbi_rentorsell==1){//出租\n Residencerentinfo::model()->findByAttributes(array(\"rr_rbiid\"=>$rbi_id))->delete();\n }else{//出售\n Residencesellinfo::model()->findByAttributes(array(\"rs_rbiid\"=>$rbi_id))->delete();\n }\n Residencetag::model()->findByAttributes(array(\"rt_rbiid\"=>$rbi_id))->delete();\n //下面的需要包括文件一起删除\n $pictureModel = Picture::model()->findAllByAttributes(array(\"p_sourceid\"=>$rbi_id,\"p_sourcetype\"=>Picture::$sourceType['residencebaseinfo']));//住宅图片\n if($pictureModel){\n foreach($pictureModel as $value){\n Picture::model()->deleteFile(PIC_PATH.$value['p_img'], Officebaseinfo::$officePictureNorm);\n $value->delete();\n }\n }\n\n $subpanoramaModel = Subpanorama::model()->findAllByAttributes(array(\"spn_sourceid\"=>$rbi_id,\"spn_sourcetype\"=>Subpanorama::residence));//客服为用户制作的全景\n if($subpanoramaModel){\n foreach($subpanoramaModel as $value){\n Subpanorama::model()->deleteOnePanoramaById($value['spn_id']);\n }\n }\n\t\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\t\tif(!isset($_GET['ajax']))\n\t\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t\t}\n\t\telse\n\t\t\tthrow new CHttpException(400,'Invalid request. Please do not repeat this request again.');\n\t}", "public function actionDelete($id)\n { \n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n \n try {\n $model = $this->findModel($id);\n \n $this->deshacer_renglones($model);\n\n $model->delete();\n \n $transaction->commit();\n \n return $this->redirect(['index']);\n\n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n throw $e;\n }\n\n }", "public function deleteAction()\n\t{\n\t\t$message = 'Une erreur est survenue. Votre &eacute;cole n\\'a pas été supprimé.';\n\n\t\t$school = School::find( (int) $this->getRequest()->post('id') );\n\t\t$deleted = $school->delete();\n\n\t\tif ( $deleted ) {\n\t\t\t$message = 'Votre &eacute; a correctement été supprimé.';\n\t\t}\n\t\t$this->render( View::make( 'schools/index' , array(\n\t\t\t'status' => $deleted,\n\t\t\t'message' => $message,\n\t\t\t'title' => 'Mes &Eacute;coles',\n\t\t\t'entities' => School::all()\n\t\t) ) );\n\t}", "public function actionDelete($id)\n\t{\n\t\t$model = $this->loadModel($id);\n\t\t\n\t\tif ($model) {\n\t\t\t$model->delete();\n\t\t}\n\n // if AJAX request (triggered by deletion via list grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('index'));\n\t}", "public function actionDelete($id)\n { \n\t\t$model = $this->findModel($id); \n $model->isdel = 1;\n $model->save();\n //$model->delete(); //this will true delete\n \n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function deleteAction()\n {\n $recordId = (int) $this->params('id', null);\n\n if (null === $recordId) {\n $this->flashMessenger()->setNamespace('error')\n ->addMessage('You have attempted to access an invalid record.');\n\n return $this->redirect()->toRoute('rocket-admin/education/results');\n }\n\n $record = $this->resultsService->getResult($recordId);\n\n if (null === $record) {\n $this->flashMessenger()->setNamespace('error')\n ->addMessage('You have attempted to access an invalid record.');\n\n return $this->redirect()->toRoute('rocket-admin/education/results');\n }\n\n $this->resultsService->deleteResult($record, $this->identity());\n //$this->resultsService->deleteResult($record, $this->identity());\n\n $this->flashMessenger()->setNamespace('success')\n ->addMessage('You have successfully deleted a Result.');\n\n return $this->redirect()->toRoute('rocket-admin/education/results');\n }", "public function actionDelete($id)\n {\n $model=$this->findModel ( $id );\n\t\t$model->is_delete=1;\n\t\t$model->save ();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n\t\t$this->findModel ( $id )->delete ();\n\t\t\n\t\treturn $this->redirect ( [ \n\t\t\t\t'index' \n\t\t] );\n\t}", "public function actionDelete($id) {\n\t\t$this->findModel ( $id )->delete ();\n\t\t\n\t\treturn $this->redirect ( [ \n\t\t\t\t'index' \n\t\t] );\n\t}", "public function actionDelete()\n {\n extract(Yii::$app->request->post());\n $this->findModel($list, $item)->delete();\n }", "public function actionDelete($id)\n {\n $model=$this->findModel($id);\n $inmueble_id=$model->inmueble_id;\n $model->delete();\n \n return $this->redirect(['index','id' => $inmueble_id]);\n }", "public function actionDelete()\n\t{\n\t\tif(Yii::app()->request->isPostRequest)\n\t\t{\n\t\t\t// we only allow deletion via POST request\n\t\t\t$this->loadModel()->delete();\n\n\t\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\t\tif(!isset($_GET['ajax']))\n\t\t\t\t$this->redirect(array('index'));\n\t\t}\n\t\telse\n\t\t\tthrow new CHttpException(400,'Invalid request. Please do not repeat this request again.');\n\t}", "public function actionDelete()\n\t{\n\t\tif(Yii::app()->request->isPostRequest)\n\t\t{\n\t\t\t// we only allow deletion via POST request\n\t\t\t$this->loadModel()->delete();\n\n\t\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\t\tif(!isset($_GET['ajax']))\n\t\t\t\t$this->redirect(array('index'));\n\t\t}\n\t\telse\n\t\t\tthrow new CHttpException(400,'Invalid request. Please do not repeat this request again.');\n\t}", "public function delete()\n {\n $id = $this->uri->segment('5');\n if ($this->global_model->delete('classified', array('id' => $id))) {\n $this->session->set_flashdata('success', 'Delete successfully!');\n redirect('admin/Classifieds/Classifieds/viewmyclassfied');\n }\n\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n return $this->redirect(['index']);\n }", "public function deleteAction()\n {\n $id=$this->_request->getParam(\"id\");\n if(!empty($id)){\n // Get object from Requests model\n $request_model=new Application_Model_Requests();\n // Calling delete function to delete request by id\n $request_model->deleteRequest($id);\n }\n // Redirct to list Request\n $this->redirect(\"Requests/list\");\n }", "public function actionDelete()\n\t{\n\t\t$id = intval($_GET['iId']);\n\t\t$this->loadModel($id)->delete();\n\t\t$this->redirect('/app/DayPush/index');\n\t}", "public function actionDelete($id) {\r\n\t\t$this->findModel ( $id )->delete ();\r\n\t\t\r\n\t\treturn $this->redirect ( [ \r\n\t\t\t\t'index' \r\n\t\t] );\r\n\t}", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "function delete()\n {\n $nim = $this->uri->segment(3);\n $this->siswa_model->delete($nim);\n redirect('siswa/page');\n }", "public function actionDelete($id) {\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id) {\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete()\n {\n $id = $_POST['id_was_23a'];\n $jml = $_POST['jml'];\n $pecah = explode(',',$id);\n for ($i=0; $i < $jml; $i++) { \n $this->findModel($pecah[$i])->delete();\n }\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\r\n {\r\n if(file_exists($this->findModel($id)->path)){\r\n unlink($this->findModel($id)->path);\r\n }\r\n \r\n $this->findModel($id)->delete();\r\n \r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n // $this->findModel($id)->delete();\r\n echo 'Not Allowed';\r\n exit();\r\n return $this->redirect(['index']);\r\n\r\n }", "public function actionDelete($id)\n {\n\t$model = static::findModel($id);\n\n\t$this->processData($model, 'delete');\n\n\t$model->delete();\n\n \treturn $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id)->delete();\n\n return $this->redirect(['peminjaman/view', 'id_pinjam' => $model->id_pinjam ]);\n }", "function eliminar(){\n\t\t$this->load->helper('url');\n\t\t$id=$this->input->post('documento');\n\t\t\n\t\t$this->load->model('Investigador_Model');\n\t\t$this->Investigador_Model->eliminar($id);\n\t\tredirect('Investigador_Controller');\n\t}", "public function actionDelete($id)\n {\n $this->_findModel($id)->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n\n $AdjLine = ItemJournalLine::find()->where(['source_id' => $id])->all();\n\n foreach ($AdjLine as $model) {\n $model->delete();\n }\n\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n\n\n\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete()\n {\n $post = file_get_contents(\"php://input\");\n $data = Json::decode($post, true);\n $model = $this->findModel($data['ids']);\n $mensaje['mensaje'] = \"\";\n try {\n $model->delete();\n $mensaje['mensaje'] = \"Exitoso\";\n } catch(IntegrityException $e) {\n $mensaje['mensaje'] = \"Error\";\n }\n\n echo Json::encode($mensaje);\n exit;\n }", "public function deleteAction()\n {\n /* Check if user is signed in and redirect to sign in if is not */\n $this->requireSignin();\n\n /* Getting current user's data */\n $user = Auth::getUser();\n\n /* Redirect link after deleting. By default index page */\n $returnUrl = (isset($_POST['return'])) ? '/'.$_POST['return'] : '/';\n\n /* Getting Question by id */\n $answer = Answer::getById(intval($_POST['id']));\n\n /* If Answer exists and is active */\n if ($answer) {\n\n /* Checking if signed in user is answer's author */\n if ($answer->user_id == $user->id) {\n\n /* Check if question deleted */\n if (Answer::delete($answer->id)) {\n\n Flash::addMessage(\"Answer deleted!\", Flash::INFO);\n \n } else {\n\n Flash::addMessage(\"You can not delete this answer!\", Flash::INFO);\n }\n\n } else {\n\n Flash::addMessage(\"You can not delete this answer!\", Flash::INFO);\n }\n\n } else {\n\n Flash::addMessage(\"You can not delete this answer!\", Flash::INFO);\n }\n\n /* Redirect back */\n $this->redirect($returnUrl);\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\n {\n // var_dump($id);die();\n $model = $this->findModel($id);\n // var_dump($model); die();\n $address = Address::find()->where(['id'=>$model->work_address_id])->one();\n $address->delete();\n $model->delete();\n\n return $this->redirect(['index']);\n }", "public function delete()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_GET['id']);\n $tacgia->delete();\n\n go_back();\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n \n $model->delete();\n return $this->redirect([\n 'index'\n ]);\n }", "public function actionDelete()\n {\n $post = Yii::$app->request->post();\n\n InsightsContent::findOne($post['InsightsContent']['id'])->delete();\n $this->findModel($post['InsightsDef']['name'])->delete();\n\n return $this->redirect(['create']);\n }", "public function actionDelete()\n {\n if (Yii::app()->request->isPostRequest)\n {\n // we only allow deletion via POST request\n $this->loadModel()->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(array('index'));\n }\n else\n throw new CHttpException(400, 'Invalid request. Please do not repeat this request again.');\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }" ]
[ "0.749066", "0.7113232", "0.7097525", "0.68604875", "0.68573654", "0.6815398", "0.6789704", "0.6754021", "0.6742855", "0.6688334", "0.66424036", "0.6635721", "0.6629038", "0.6596414", "0.65889204", "0.65632504", "0.65389603", "0.65389603", "0.65309703", "0.6514868", "0.65123266", "0.65035045", "0.64753664", "0.6470092", "0.6469906", "0.646069", "0.6447975", "0.64479077", "0.644224", "0.6419756", "0.6419756", "0.6418942", "0.6418726", "0.64172804", "0.64108", "0.6404711", "0.63962525", "0.6392553", "0.6391719", "0.6389489", "0.6389079", "0.63820297", "0.6381445", "0.6380109", "0.6357219", "0.635101", "0.635101", "0.63483554", "0.634816", "0.6337582", "0.6337582", "0.63322437", "0.632972", "0.63258564", "0.63193667", "0.63193667", "0.63184756", "0.63106143", "0.63100356", "0.6304029", "0.6304029", "0.6304029", "0.6304029", "0.63033515", "0.6294518", "0.6294518", "0.62931126", "0.6292455", "0.62804496", "0.6274856", "0.62705094", "0.6269984", "0.6265748", "0.6263525", "0.6262194", "0.6262194", "0.6260785", "0.62527055", "0.62511355", "0.62511355", "0.62511355", "0.62511355", "0.62511355", "0.62511355", "0.62511355", "0.62419134", "0.6239387", "0.6234407", "0.6233389", "0.62294304", "0.6222713", "0.6222713", "0.6222713", "0.6222713", "0.6222713", "0.6222713", "0.6222713", "0.6222713", "0.6222713", "0.6222713", "0.6222713" ]
0.0
-1
Finds the Examination model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = Examination::findOne($id)) !== null) { return $model; } throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function findModel($id)\n {\n if (($model = PaidEmployment::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }", "public abstract function find($primary_key, $model);", "private function findModel($key)\n {\n if (null === $key) {\n throw new BadRequestHttpException('Key parameter is not defined in findModel method.');\n }\n\n $modelObject = $this->getNewModel();\n\n if (!method_exists($modelObject, 'findOne')) {\n $class = (new\\ReflectionClass($modelObject));\n throw new UnknownMethodException('Method findOne does not exists in ' . $class->getNamespaceName() . '\\\\' .\n $class->getShortName().' class.');\n }\n\n $result = call_user_func([\n $modelObject,\n 'findOne',\n ], $key);\n\n if ($result !== null) {\n return $result;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}", "protected function findModel($masterlist_id)\n\t{\n\t\tif (($model = WiMasterlist::findOne($masterlist_id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "public function loadModel($id)\n\t{\n\t\t$model = Exam::model()->findByPk($id);\n\t\tif ($model === null)\n\t\t\tthrow new CHttpException(404, 'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }", "protected function findModel($id)\n {\n if (($model = Offer::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = Trailer::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id) {\n if (($model = AllocationDetail::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id) {\n if (($model = SchoolExamMarks::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n$model = Reports::findOne($id);\n\t\tif ((isset(Yii::$app->params['ADMIN_CLIENT_ID']) and Yii::$app->user->identity->clientID == Yii::$app->params['ADMIN_CLIENT_ID']))\n\t\t{\n return $model;\n }\n\t\telse\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t\n }", "public function returnDetailFindByPK($id);", "protected function findModel($id) {\n\t\tif (($model = EntEmpleados::findOne ( $id )) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\n\t\t}\n\t}", "protected function findModel($id)\n {\n\t\t$p = $this->primaryModel;\n if (($model = $p::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n if (($model = learnerscoring::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = DetailPkl::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id)\r\n\t{\r\n\t\t$model=StudentDocument::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,Yii::t('app','The requested page does not exist.'));\r\n\t\treturn $model;\r\n\t}", "public function findById() {\n // TODO: Implement findById() method.\n }", "protected function findModel($id)\n {\n if (($model = SoSheet::findOne($id)) !== null) { \n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Employee::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=ElearningExam::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Publication::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Student::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,Yii::t('common','The requested page does not exist.'));\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Entry::model()->with('entryAnswers')->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = WpIschoolSafecard::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n\t\t{\n\t\t\tif (($model = PhoneRecord::findOne($id)) !== null) {\n\t\t\t\treturn $model;\n\t\t\t}\n\t\t\t\n\t\t\tthrow new NotFoundHttpException(Yii::t('app', 'Запрашиваемая страница не существует.'));\n\t\t}", "protected function findModel($id) {\n if (($model = MeBackToOfficeReport::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($ClearByID, $ClearanceLevelCode, $Department, $StudentID)\n {\n if (($model = Clearanceentries::findOne(['Clear By ID' => $ClearByID, 'Clearance Level Code' => $ClearanceLevelCode, 'Department' => $Department, 'Student ID' => $StudentID])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Escaparate::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Employe::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }", "protected function findModel($id)\n {\n if (($model = Excel::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = AllocationDetails::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id)\n\t{\n\t\t$model=Employe::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Dmposmasterrelate::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = DetailPinjam::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Admissionresult::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Picture::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, \\Yii::t('The requested object does not exist or has been already deleted.'));\n }\n }", "protected function findModel($id) {\n\n\n if (($model = page::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public static function find( $primaryKey )\n\t{\n\t\tself::init();\n\t\t\n\t\t// Select one item by primary key in Database\n\t\t$result = Database::selectOne(\"SELECT * FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $primaryKey);\t\t\n\t\tif( $result == null )\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Create & return new object of Model\n\t\treturn self::newItem($result);\n\t}", "protected function findModel($id)\n {\n if (($model = Reporte::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = JackpotDetails::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function findById($primaryKeyValue){\n //Select* From employers Where $this->primaryKey(noemp)=$primaryKeyValue(1000)\n $array = $this->findWhere($this->primaryKey. \"=$primaryKeyValue\");\n if (count($array) != 1 ) die (\"The ID $primaryKeyValue is not valid\");\n return $array[0];\n }", "public static function findModel($id='')\n {\n $model = static::find()->where(['id' => $id])->one();\n if ($model == null) {\n throw new \\yii\\web\\NotFoundHttpException(Yii::t('app',\"Page not found!\"));\n }\n return $model;\n }", "protected function findModel($id)\n {\n if(User::isAdmin()){\n $condition = $id;\n }else{\n $condition = ['id'=>$id,'user_id'=>User::loginUser()['id']];\n }\n if (($model = ExhibitionHall::findOne($condition)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=Residencebaseinfo::model()->findbyPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}", "public function actionFind()\n\t{\n\t\t$requestedId = craft()->request->getParam('id');\n\t\t// build criteria to find model\n\t\t$criteria = craft()->elements->getCriteria(ElementType::Entry);\n\t\t$criteria->id = $requestedId;\n\t\t$criteria->limit = 1;\n\t\t\n\t\t// fire !\n\t\t$entries = $criteria->find();\n\t\t$entry = count($entries) > 0 ? $entries[0] : null;\n\n\t\t// redirect if possible\n\t\tif($entry && $entry->url) {\n\n\t\t\t// build new query, but remove id from query path\n\t\t\t$newLocation = $entry->url . ( craft()->request->getParam('L') ? '?L='.craft()->request->getParam('L') : '');\n\n\t\t\theader(\"HTTP/1.1 302 Found\"); \n\t\t\theader(\"Location: \" . $newLocation); \n\t\t\texit();\n\t\t}else{\n\t\t\theader(\"HTTP/1.1 404 Not Found\");\n\t\t\theader(\"Location: /404.html\"); \n\t\t\texit();\n\t\t}\n\n\t\tcraft()->end();\n\t}", "public function loadModel($id)\n {\n $model = IdeaHeap::model()->findByPk($id);\n\n if ($model === null)\n throw new CHttpException(404);\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = ItemJournal::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n $model = null;\n if (($model = Employee::findOne($id)) !== null) {\n return $model;\n }\n }", "public function loadModel($id)\r\n\t{\r\n\t\t$model=Study::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}", "protected function findModel($id)\n {\n if (($model = PersonalPlan::findOne($id)) !== null) {\n // $exec_div_record = ExecDivAssignment::findOne(['job_id' => $model->id]);\n // if($exec_div_record)$model->executor_div_id = $exec_div_record->div_id;\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = PostKey::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($key)\n {\n if (($model = NotificationsTemplate::find()->andWhere(['key'=>$key])->one()) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function get( int $id ) : IEmployerIncentive\n {\n if ( !isset( self::DB[$id] ))\n throw new RecordNotFoundException();\n \n return self::DB[$id]; \n }", "public static function Get($key) {\r\n\t\t$cls = get_called_class();\r\n\t\t$model = new $cls();\r\n\t\t$primary = $model->index('primary');\r\n\t\tif (is_null($primary)) {\r\n\t\t\tthrow new Exception(\"The schema for {$cls} does not identify a primary key\");\r\n\t\t}\r\n\t\tif (!is_array($key)) {\r\n\t\t\tif (count($primary['fields']) > 1) {\r\n\t\t\t\tthrow new Exception(\"The schema for {$cls} has more than one field in its primary key\");\r\n\t\t\t}\r\n\t\t\t$key = array(\r\n\t\t\t\t$primary['fields'][0] => $key\r\n\t\t\t);\r\n\t\t}\r\n\t\tforeach ($primary['fields'] as $field) {\r\n\t\t\tif (!isset($key[$field])) {\r\n\t\t\t\tthrow new Exception(\"No value provided for the {$field} field in the primary key for \" . get_called_class());\r\n\t\t\t}\r\n\t\t\t$model->where(\"{$field} = ?\", $key[$field]);\r\n\t\t}\r\n\t\t//$src = Dbi_Source::GetModelSource($model);\r\n\t\t$result = $model->select();\r\n\t\tif ($result->count()) {\r\n\t\t\tif ($result->count() > 1) {\r\n\t\t\t\tthrow new Exception(\"{$cls} returned multiple records for primary key {$id}\");\r\n\t\t\t}\r\n\t\t\t$record = $result[0];\r\n\t\t} else {\r\n\t\t\t$record = new Dbi_Record($model, null);\r\n\t\t\t$record->setArray($key, false);\r\n\t\t}\r\n\t\treturn $record;\r\n\t}", "protected function findModel($id)\n {\n if (($model = Was27Inspeksi::findOne(['id_was_27_inspeksi'=>$id])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = StoreKasir::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Qrxq2017Enroll::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Medicine::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Document::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('Страница не существует.');\n }", "protected function findModel($id)\n {\n if (($model = StudentAddress::findOne($id)) !== null)\n {\n return $model;\n } else\n {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n {\n $model=ArticleTargetRecord::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = PublicNum::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Mark::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\r\n {\r\n if (($model = Apresentacao::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=Report::model()->findbyPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}", "protected function findModel($id) {\n\t\tif (($model = Menu::findOne ( $id )) !== null) {\n\t\t\treturn $model;\n\t\t}\n\t\t\n\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\n\t}", "public function findModel($class, $id)\n {\n $model = call_user_func([$class, 'findOne'], $id);\n if (!$model) {\n $this->raise404();\n }\n return $model;\n }", "public function find($pk)\r\n {\r\n $row = $this->getTable()->find($pk);\r\n if(!$row){\r\n return false;\r\n }\r\n $sampleModel = new SampleModel();\r\n $this->_map($sampleModel, $row);\r\n return $sampleModel;\r\n }", "public function loadModel($id)\n {\n if (($model = Reviews::model()->findByPk($id)) === null) {\n throw new CHttpException(\n 404,\n Yii::t($this->aliasModule, 'Requested page was not found!')\n );\n }\n \n return $model;\n }", "protected function findModel($id)\n {\n if (($model = Employees::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }", "protected function findModel($id) {\n if (($model = RealEstateMaster::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function getRecordById($id)\n {\n $this->additionalSearchFields[] = [\n $this->model->getPrimaryKey(), ':', $id\n ];\n\n $processedRequest = $this->processRequest($this->request);\n $records = $this->getRecords($processedRequest);\n\n //get the results and append its relationships\n $results = $records['results'];\n\n if (empty($results) || !isset($results[0])) {\n throw new ModelNotFoundException(\n getShortClassName($this->model) . ' Record not found'\n );\n }\n\n return $results[0];\n }", "protected function findModel($id)\n {\n if (($model = Demanderanalyse::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = AdviserResume::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = ProgramHasSumberDana::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = WorksystemContentinfo::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Kamar::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "private function _findModel($id)\n {\n $modelClass = $this->_getModelClass();\n\n if (($model = $modelClass::findOne($id)) === null) {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n\n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=Report::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id) {\n if (($model = WorkloadEvent2::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Evaluation::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = CompPrep::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id) {\n $model = MissionCarers::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, Yii::t('texts', 'FLASH_ERROR_404_THE_REQUESTED_PAGE_DOES_NOT_EXIST'));\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = Consulta::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "function find($id)\n{\n\t$model = $this->newModel(null);\n\treturn $model->find($id);\n}", "public function find($id){\n return $this->model->query()->findOrFail($id);\n }", "public function loadModel($id) {\n $model = Calculatepayout::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function loadModel($id) {\n $model = ChildMedicalDetails::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = Jadwal::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = OpeningHours::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = DaftarSmk::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = AuditionData::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id) \r\n\t{\r\n\t\t$model = SmsGroupPhonebook::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404, Yii::t('phrase', 'The requested page does not exist.'));\r\n\t\treturn $model;\r\n\t}", "public function loadModel($id) {\r\n $model = Statements::model()->findByPk($id);\r\n if ($model === null)\r\n throw new CHttpException(404, 'The requested page does not exist.');\r\n return $model;\r\n }", "public function loadModel($id) {\n $model = Fddemandreceipt::model()->findByPk((int) $id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=Student::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=ExportInventory::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Contain::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }" ]
[ "0.67698216", "0.66550237", "0.6546686", "0.6543248", "0.6519957", "0.64661765", "0.6399759", "0.6376996", "0.63081235", "0.6267306", "0.6229699", "0.61941415", "0.6169507", "0.61658055", "0.6164623", "0.6141948", "0.6129402", "0.61219573", "0.6112529", "0.6109874", "0.6101743", "0.6099951", "0.6097799", "0.6071214", "0.60445315", "0.60321456", "0.6029299", "0.60277915", "0.6019249", "0.6017901", "0.6017843", "0.6016493", "0.6016173", "0.6015684", "0.6014214", "0.60095084", "0.60039896", "0.6001304", "0.5999751", "0.59945047", "0.5991893", "0.59796983", "0.59785223", "0.597601", "0.5975035", "0.5972706", "0.59664124", "0.5964349", "0.59632057", "0.5962878", "0.59565216", "0.59556466", "0.59554696", "0.59549487", "0.59518826", "0.5949909", "0.5948462", "0.5947349", "0.59452844", "0.59366", "0.5928884", "0.5924488", "0.59214866", "0.5920134", "0.5917747", "0.5915865", "0.59118944", "0.5909731", "0.5908357", "0.5906159", "0.5905723", "0.59044945", "0.59035593", "0.59011704", "0.58974147", "0.58967465", "0.5892829", "0.58895713", "0.58871084", "0.58853894", "0.58820057", "0.5881228", "0.5880704", "0.5879654", "0.587891", "0.5878091", "0.5874445", "0.58707213", "0.58705866", "0.58701706", "0.5868229", "0.5863966", "0.5863727", "0.5860312", "0.58575356", "0.5855916", "0.58556026", "0.5854946", "0.5852995", "0.58512914" ]
0.6949804
0
Activate Extension This function enters the extension into the exp_extensions table
public function activate_extension() { // Setup custom settings in this array. $this->settings = array(); if ($this->EE2) { $hooks = array( 'entry_submission_ready' => 'entry_submission_ready', // entry_submission_ready($meta, $data, $autosave) 'delete_entries_loop' => 'delete_entries_loop', // delete_entries_loop($val, $channel_id) 'category_save' => 'category_save', // category_save($cat_id, $data) 'category_delete' => 'category_delete', // category_delete($cat_ids) 'cp_js_end' => 'cp_js_end', ); } else { $hooks = array( 'after_channel_entry_update' => 'after_channel_entry_update', // after_channel_entry_update($entry, $values, $modified) 'after_channel_entry_delete' => 'after_channel_entry_delete', // after_channel_entry_delete($entry, $values) //'after_channel_entry_bulk_delete' => 'delete_entries_loop', // EE4+ after_channel_entry_bulk_delete($delete_ids) 'after_category_update' => 'after_category_update', // after_category_update($category, $values, $modified) 'after_category_delete' => 'after_category_delete', // after_category_delete($category, $values) //'after_category_bulk_delete' => 'category_delete_loop', // EE4+ after_category_bulk_delete($delete_ids) //'cp_js_end' => 'cp_js_end', ); } foreach ($hooks as $hook => $method) { $data = array( 'class' => __CLASS__, 'method' => $method, 'hook' => $hook, 'settings' => serialize($this->settings), 'version' => $this->version, 'enabled' => 'y' ); $this->EE->db->insert('extensions', $data); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function activate_extension()\n\t{\n\n\t $data = array(\n\t 'class' => __CLASS__,\n\t 'method' => 'template_types',\n\t 'hook' => 'template_types',\n\t 'settings' => serialize($this->settings),\n\t 'priority' => 10,\n\t 'version' => $this->version,\n\t 'enabled' => 'y'\n\t );\t\n\t ee()->db->insert('extensions', $data);\n\t \n\t}", "public function activate_extension()\n\t{\n\t\t// fetch default settings\n\t\t$settings = $this->settings();\n\t\t\n\t\t// $value is the settings array ($type, $options, $defaults)\n\t\tforeach($settings as $key => $value)\n\t\t{\n\t\t\t$this->settings[$key] = $value[2];\n\t\t}\n\t\t\n\t\t$hooks = array(\n\t\t\t'sessions_end' => 'sessions_end',\n\t\t);\n\n\t\tforeach ($hooks as $hook => $method)\n\t\t{\n\t\t\t$data = array(\n\t\t\t\t'class'\t\t=> __CLASS__,\n\t\t\t\t'method'\t=> $method,\n\t\t\t\t'hook'\t\t=> $hook,\n\t\t\t\t'settings'\t=> serialize($this->settings),\n\t\t\t\t'version'\t=> $this->version,\n\t\t\t\t'enabled'\t=> 'y'\n\t\t\t);\n\n\t\t\t$this->EE->db->insert('extensions', $data);\t\t\t\n\t\t}\n\t}", "function activate_extension()\n\t{\n\t\t$data = array(\n\t\t\t'class'\t\t\t=>\t__CLASS__,\n\t\t\t'method'\t\t=>\t'cp_js_end',\n\t\t\t'hook'\t\t\t=>\t'cp_js_end',\n\t\t\t'settings'\t\t=>\t'',\n\t\t\t'priority'\t\t=>\t10,\n\t\t\t'version'\t\t=> \t$this->version,\n\t\t\t'enabled'\t\t=>\t'y'\n\t);\n\n\t$this->EE->db->insert('extensions', $data);\n\n\t}", "function activate_extension()\n\t{\n\t\t$data = array(\n\t\t\t'class'\t\t\t=>\t__CLASS__,\n\t\t\t'method'\t\t=>\t'cp_js_end',\n\t\t\t'hook'\t\t\t=>\t'cp_js_end',\n\t\t\t'settings'\t\t=>\t'',\n\t\t\t'priority'\t\t=>\t10,\n\t\t\t'version'\t\t=> \t$this->version,\n\t\t\t'enabled'\t\t=>\t'y'\n\t);\n\n\t$this->EE->db->insert('extensions', $data);\n\n\t}", "public function activate_extension(){}", "public function activate_extension() {\n $hooks = array(\n 'template_post_parse' => 'template_post_parse'\n );\n foreach($hooks as $hook => $method) {\n $data = array(\n 'class' => __CLASS__,\n 'method' => $method,\n 'hook' => $hook,\n 'priority' => 10,\n 'version' => $this->version,\n 'enabled' => 'y',\n 'settings' => ''\n );\n ee()->db->insert('exp_extensions', $data);\n }\n return true;\n }", "public function activate_extension()\n\t{\n\t\t$this->EE->db->insert('extensions', array(\n\t\t\t'class' => __CLASS__,\n\t\t\t'method' => 'assets_file_meta_add_row',\n\t\t\t'hook' => 'assets_file_meta_add_row',\n\t\t\t'settings' => '',\n\t\t\t'priority' => 10,\n\t\t\t'version' => $this->version,\n\t\t\t'enabled' => 'y'\n\t\t));\n\t\t\n\t\t// Check for our column and add it to exp_assets if it doesn't exist yet\n\t\tif ($this->EE->db->table_exists('assets') && ! $this->EE->db->field_exists('members_only', 'assets'))\n\t\t{\n\t\t\t$this->EE->load->dbforge();\n\t\t\t$this->EE->dbforge->add_column('assets', array(\n\t\t\t\t// Default to assets not being members only\n\t\t\t\t'members_only' => array('type' => 'varchar', 'constraint' => 1, 'default' => 'n'),\n\t\t\t));\n\t\t}\n\t}", "public function activate_extension()\n\t{\n\t\t// Setup custom settings in this array.\n\t\t$this->settings = array();\n\t\t\n\t\t$data = array(\n\t\t\t'class'\t\t=> __CLASS__,\n\t\t\t'method'\t=> 'entry_submission_absolute_end',\n\t\t\t'hook'\t\t=> 'entry_submission_absolute_end',\n\t\t\t'settings'\t=> serialize($this->settings),\n\t\t\t'version'\t=> $this->version,\n\t\t\t'enabled'\t=> 'y'\n\t\t);\n\n\t\t$this->EE->db->insert('extensions', $data);\t\t\t\n\t\t\n\t}", "public function activate_extension()\n\t{\n\t\t// Setup custom settings in this array.\n\t\t$this->settings = array();\n\t\t\n\t\t$batch = array();\n\n\t\t$batch[] = array(\n\t\t\t'class'\t\t=> __CLASS__,\n\t\t\t'method'\t=> 'store_order_complete_end',\n\t\t\t'hook'\t\t=> 'store_order_complete_end',\n\t\t\t'settings'\t=> serialize($this->settings),\n\t\t\t'version'\t=> $this->version,\n\t\t\t'enabled'\t=> 'y'\n\t\t);\n\n\t\t$batch[] = array(\n\t\t\t'class'\t\t=> __CLASS__,\n\t\t\t'method'\t=> 'sessions_end',\n\t\t\t'hook'\t\t=> 'sessions_end',\n\t\t\t'settings'\t=> serialize($this->settings),\n\t\t\t'version'\t=> $this->version,\n\t\t\t'enabled'\t=> 'y'\n\t\t);\n\n\t\t$batch[] = array(\n\t\t\t'class'\t\t=> __CLASS__,\n\t\t\t'method'\t=> 'store_payment_gateways',\n\t\t\t'hook'\t\t=> 'store_payment_gateways',\n\t\t\t'settings'\t=> serialize($this->settings),\n\t\t\t'version'\t=> $this->version,\n\t\t\t'enabled'\t=> 'y'\n\t\t);\n\n\t\t$batch[] = array(\n\t\t\t'class'\t\t=> __CLASS__,\n\t\t\t'method'\t=> 'freemember_update_member_custom_start',\n\t\t\t'hook'\t\t=> 'freemember_update_member_custom_start',\n\t\t\t'settings'\t=> serialize($this->settings),\n\t\t\t'version'\t=> $this->version,\n\t\t\t'enabled'\t=> 'y'\n\t\t);\n\n\t\tee()->db->insert_batch('extensions', $batch);\t\n\n\t\t\t\t\t\n\t\t\n\t}", "public function activate_extension()\n\t{\n\t\t// Check for Freeform install\n\t\tif ( ! $this->EE->db->table_exists('freeform_fields'))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$hooks = array(\n\t\t 'freeform_module_insert_begin' => 'insert_new_entry'\n\t\t);\n\t\t\n\t\tforeach ($hooks as $hook => $method)\n\t\t{\n\t\t\t$this->EE->db->insert(\n\t\t\t\t'exp_extensions',\n\t\t\t\tarray(\n\t\t\t\t\t'class' => ucfirst(get_class($this)),\n\t\t\t\t\t'method' => $method,\n\t\t\t\t\t'hook' => $hook,\n\t\t\t\t\t'settings' => '',\n\t\t\t\t\t'priority' => 10,\n\t\t\t\t\t'version' => $this->version,\n\t\t\t\t\t'enabled' => 'y'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}", "function activate_extension()\n\t{\n\t\treturn TRUE;\n\t}", "public function activate_extension()\n {\n return true;\n }", "public function update_extension(){}", "public function enable_step($name)\n\t{\n\t\t// ignore extensions that are already enabled\n\t\tif ($this->is_enabled($name))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$old_state = (isset($this->extensions[$name]['ext_state'])) ? unserialize($this->extensions[$name]['ext_state']) : false;\n\n\t\t$extension = $this->get_extension($name);\n\n\t\tif (!$extension->is_enableable())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$state = $extension->enable_step($old_state);\n\n\t\t$active = ($state === false);\n\n\t\t$extension_data = array(\n\t\t\t'ext_name'\t\t=> $name,\n\t\t\t'ext_active'\t=> $active,\n\t\t\t'ext_state'\t\t=> serialize($state),\n\t\t);\n\n\t\t$this->extensions[$name] = $extension_data;\n\t\t$this->extensions[$name]['ext_path'] = $this->get_extension_path($extension_data['ext_name']);\n\t\tksort($this->extensions);\n\n\t\t$sql = 'SELECT COUNT(ext_name) as row_count\n\t\t\tFROM ' . $this->extension_table . \"\n\t\t\tWHERE ext_name = '\" . $this->db->sql_escape($name) . \"'\";\n\t\t$result = $this->db->sql_query($sql);\n\t\t$count = $this->db->sql_fetchfield('row_count');\n\t\t$this->db->sql_freeresult($result);\n\n\t\tif ($count)\n\t\t{\n\t\t\t$sql = 'UPDATE ' . $this->extension_table . '\n\t\t\t\tSET ' . $this->db->sql_build_array('UPDATE', $extension_data) . \"\n\t\t\t\tWHERE ext_name = '\" . $this->db->sql_escape($name) . \"'\";\n\t\t\t$this->db->sql_query($sql);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sql = 'INSERT INTO ' . $this->extension_table . '\n\t\t\t\t' . $this->db->sql_build_array('INSERT', $extension_data);\n\t\t\t$this->db->sql_query($sql);\n\t\t}\n\n\t\tif ($this->cache)\n\t\t{\n\t\t\t$this->cache->purge();\n\t\t}\n\n\t\tif ($active)\n\t\t{\n\t\t\t$this->config->increment('assets_version', 1);\n\t\t}\n\n\t\treturn !$active;\n\t}", "function admin_extensions() {\n\t\t\tswitch ($_GET['method']) {\n\t\t\t\tcase 'activate'\t\t\t\t:\n\t\t\t\t\tcheck_admin_referer('newsletters_extension_activate_' . $_GET['plugin']);\n\t\t\t\t\tactivate_plugin(plugin_basename($_GET['plugin']));\n\t\t\t\t\t$this -> redirect($this -> url, 'message', __('Extension has been activated.', $this -> plugin_name));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'deactivate'\t\t\t:\n\t\t\t\t\tcheck_admin_referer('newsletters_extension_deactivate_' . $_GET['plugin']);\n\t\t\t\t\tdeactivate_plugins(array(plugin_basename($_GET['plugin'])));\n\t\t\t\t\t$this -> redirect($this -> url, 'error', __('Extension has been deactivated.', $this -> plugin_name));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault\t\t\t\t\t\t:\n\t\t\t\t\t$this -> render('extensions' . DS . 'index', false, true, 'admin');\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "public function load_extensions()\n\t{\n\t\t$this->extensions = array();\n\n\t\t// Do not try to load any extensions if the extension table\n\t\t// does not exist or when installing or updating.\n\t\t// Note: database updater invokes this code, and in 3.0\n\t\t// there is no extension table therefore the rest of this function\n\t\t// fails\n\t\tif (defined('IN_INSTALL') || version_compare($this->config['version'], '3.1.0-dev', '<'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$sql = 'SELECT *\n\t\t\tFROM ' . $this->extension_table;\n\n\t\t$result = $this->db->sql_query($sql);\n\t\t$extensions = $this->db->sql_fetchrowset($result);\n\t\t$this->db->sql_freeresult($result);\n\n\t\tforeach ($extensions as $extension)\n\t\t{\n\t\t\t$extension['ext_path'] = $this->get_extension_path($extension['ext_name']);\n\t\t\t$this->extensions[$extension['ext_name']] = $extension;\n\t\t}\n\n\t\tksort($this->extensions);\n\n\t\tif ($this->cache)\n\t\t{\n\t\t\t$this->cache->put($this->cache_name, $this->extensions);\n\t\t}\n\t}", "public function setExtension($extension, $attributes = array()) {\n\t\t$this->connections [$this->active]->setExtension ( $extension, $attributes );\n\t}", "protected function setAvailableExtensions() {}", "public function alterExtensionTable() {\n\t$query = $this->db->query(\"DELETE FROM `\".DB_PREFIX.\"extension` WHERE type='module' AND code != 'digitalElephantFilter' AND code != 'basel_installer'\");\n\t\n$oc_extension = array(\n array('extension_id' => '475','type' => 'module','code' => 'basel_instagram'),\n array('extension_id' => '474','type' => 'module','code' => 'category'),\n array('extension_id' => '473','type' => 'module','code' => 'account'),\n array('extension_id' => '472','type' => 'module','code' => 'basel_content'),\n array('extension_id' => '471','type' => 'module','code' => 'basel_layerslider'),\n array('extension_id' => '470','type' => 'module','code' => 'basel_megamenu'),\n array('extension_id' => '469','type' => 'module','code' => 'basel_products'),\n array('extension_id' => '468','type' => 'module','code' => 'blog_latest'),\n array('extension_id' => '467','type' => 'module','code' => 'basel_carousel')\n);\n\t\n\tforeach ($oc_extension as $result) {\n $this->db->query(\"INSERT INTO `\" . DB_PREFIX . \"extension` SET \"\n\t\t\t\t. \"type = '\" . $result['type'] . \"', \"\n . \"code = '\" . $result['code'] . \"'\");\n \t}\n\n\t}", "function activate_extension($company, $check_only=true)\n {\n global $db_connections;\n\n $updates = array(\n 'update_export_invoice_db.sql' => array('export_invoice_widgets')\n );\n\n return $this->update_databases($company, $updates, $check_only);\n }", "public function setExtension($ext);", "public function activate() {\n\t\tforeach ( $this->modules as $module ) {\n\t\t\t$module->activation_hook();\n\t\t}\n\n\t\tregister_uninstall_hook( CPTP_PLUGIN_FILE, array( __CLASS__, 'uninstall' ) );\n\t}", "public function Extensions($extensions){\r\n foreach($extensions as $extension ){\r\n $this->Extension($extension);\r\n }\r\n }", "public function plugin_activate_hook() {\r\n add_option( 'woolentor_do_activation_redirect', TRUE );\r\n add_option( 'woolentor_do_activation_library_cache', TRUE );\r\n }", "public function activate() {\r\n\r\n $this->checkPHPVersion();\r\n $this->checkCoinsDir();\r\n\r\n $this->addOptions();\r\n $this->createOrdersTable();\r\n\r\n API::downloadCoinsIcons();\r\n\r\n CryptoExchange::addRewriteRule();\r\n flush_rewrite_rules();\r\n\r\n }", "protected function updateExtensionAction() {}", "public function initialInstall()\n\t\t{\n\t\t\t$installer = $this->getInstaller();\n\t\t\t$installer->newTable($installer->getResourceTable('core/extension'))\n\t\t\t->addColumn('code', $installer::TYPE_TEXT, 50, array(\n\t\t\t\t'nullable' => FALSE,\n\t\t\t\t'default' => '',\n\t\t\t\t'primary' => TRUE,\n\t\t\t\t),'Extension identifier')\n\t\t\t->addColumn('version', $installer::TYPE_TEXT, 50, array(\n\t\t\t\t'nullable' => FALSE,\n\t\t\t\t'default' => '',\n\t\t\t\t),'The currently installed version of this extension')\n\t\t\t->setComment('List of ZeroG installed extensions and their version number');\n\t\t\t$installer->run();\n\t\t}", "function add_extension() {\n\n require_once( dirname( __FILE__ ) . '/LFAPPS_Comments_Extension.php' );\n $this->ext = new LFAPPS_Comments_Extension();\n }", "public function loadExtensionAction(Tx_Magenerator_Domain_Model_UserExtensions $ext){\n\n $user = $this->checkLogin();\n\n // security check if a user is loading its own extension\n // or the extension is marked as public\n if( $ext && ($user->getUid() == $ext->getFeuser() || $ext->getIsPublic() == 1) ){\n\n $this->sessionService->setAll( $ext->getExtension() );\n\n }\n\n $uri = $this->uriBuilder\n ->reset()\n ->setTargetPageUid(243)\n ->setCreateAbsoluteUri(true)\n ->buildFrontendUri();\n\n $this->redirectToUri($uri);\n }", "public function activate()\n {\n $this->add_setting('financialmodelingprep_API', '1a2abc9df3aed370108ba7b4db47314d');\n }", "function myplugin_activate() {\n\n\tglobal $myplugin_options_all, $myplugin_dbtables_all, $myplugin_dbtables_data_all;\n\n\tif ( myplugin_installed_version() != MYPLUGIN_VERSION ) {\n\n\t\tmyplugin_activate_dbtables( $myplugin_dbtables_all, $myplugin_dbtables_data_all );\n\t\tmyplugin_activate_options( $myplugin_options_all );\n\t}\n\n\tadd_option( MYPLUGIN_NAME, MYPLUGIN_VERSION );\n}", "public function extensions(array $extensions) {\n $this->extensions = [];\n foreach ($extensions as $key => $value) {\n $this->addExtension($value);\n }\n }", "public function Extension();", "function activation_hook() {\n\n\t}", "function cec29_ald_functions_activation() {\n\t\t\n\t\t// get currently activated plugins\n\t\t$current_plugin = get_option(\"active_plugins\");\n\t\t\n\t\tif( count( $current_plugin ) > 0) {\n\t\t\t$required_plugins = array(\n\t\t\t\t'paid-memberships-pro/paid-memberships-pro.php',\n\t\t\t\t'pronamic-google-maps/pronamic-google-maps.php', \n\t\t\t\t'theme-my-login/theme-my-login.php' // @since 0.2.0\n\t\t\t) ;\n\t\t\tforeach( $required_plugins as $plugin_name ) {\n\t\t\t\tif( !in_array($plugin_name, $current_plugin ) ) {\n\t\t\t\t\t$error = __( \"Cette extension requiert \", 'cec29-ald-functions' ) ;\n\t\t\t\t\t$error .= $plugin_name . __( \". Merci de l'installer et l'activer avant d'activer cette extension.\", 'cec29-ald-functions' ) ;\n\t\t\t\t\twp_die( $error ) ;\n\t\t\t\t} \t\n\t\t\t}\n\t\t} else {\n\t\t\t$error = __( \"Aucun plugin n'est activé.\", 'cec29-ald-functions' ) ;\n\t\t\twp_die( $error ) ;\n\t\t}\n\t\t\n\t\t// register the custom taxonomy\n\t\tcec29_register_secteur_taxonomy();\n\t\t\n\t\t// reflush (in order to create the new permalink system)\n\t\t// see http://code.tutsplus.com/articles/the-rewrite-api-post-types-taxonomies--wp-25488\n\t\tflush_rewrite_rules();\n\t}", "private static function single_activate() {\n\t\t// @TODO: Define activation functionality here\n\t}", "private static function single_activate() {\n\t\t// @TODO: Define activation functionality here\n\t}", "public function prepare_db_for_extensions()\n\t{\n\t\t/**\n\t\t * @todo remove when my pull request gets accepted\n\t\t */\n\t\tob_start();\n\n\t\t// Resolves core tasks.\n\t\trequire_once path('sys').'cli/dependencies'.EXT;\n\n\t\t// Check for the migrations table\n\t\ttry\n\t\t{\n\t\t\tDB::table('laravel_migrations')->count();\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tCommand::run(array('migrate:install'));\n\t\t}\n\n\t\t// Check for the extensions table. The reason\n\t\t// this isn't in a migration is simply\n\t\ttry\n\t\t{\n\t\t\tDB::table('extensions')->count();\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tSchema::create('extensions', function($table)\n\t\t\t{\n\t\t\t\t$table->increments('id')->unsigned();\n\t\t\t\t$table->string('slug', 50)->unique();\n\t\t\t\t$table->text('version', 25);\n\t\t\t\t$table->boolean('enabled');\n\t\t\t});\n\t\t}\n\n\t\t// Just incase the install process got interrupted, start\n\t\t// extensions\n\t\t$this->start_extensions();\n\n\t\t/**\n\t\t * @todo remove when my pull request gets accepted\n\t\t */\n\t\tob_end_clean();\n\t}", "public function activate() {\n $activator = new JWP\\JPE\\Activator();\n $activator->run();\n }", "function _addInstalledExtension($result) {\r\n\t\t\t$this->_installedExtensions[] = $result;\r\n\t\t}", "public function enableExtension($extensionPath, $sectionId)\n\t\t{\n\t\t\t$extData = new ExtensionData();\n\n\t\t\tif ($extData->loadExtension($extensionPath) == false)\n\t\t\t{\n\t\t\t\t$extData->setPath($extensionPath);\n\t\t\t\t$extData->save(); // add it to the db\n\t\t\t}\n\n\t\t\t// currently active?\n\t\t\t// if already active then don't call the activate routine\n\t\t\tif ($extData->getActive() == false)\n\t\t\t{\n\t\t\t\t// we need to activate and load/activate\n\t\t\t\t$loadedExtension = $this->loadExtension($extensionPath);\n\t\t\t\tif ($loadedExtension != null)\n\t\t\t\t{\n\t\t\t\t\t$loadedExtension->activate();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$extData->setLocation($sectionId);\n\t\t\t$extData->setActive(true); // may already be active but thats ok\n\t\t\t$extData->save();\n\t\t}", "protected function registerExtensions()\n {\n $apiResult = Event::fire('editor.extension.register');\n\n if (!is_array($apiResult)) {\n return;\n }\n\n foreach ($apiResult as $extensionClassName) {\n if (!is_string($extensionClassName)) {\n continue;\n }\n\n $this->extensionClassNames[] = $extensionClassName;\n }\n }", "public function addExtension(string $extension);", "protected function _extensionLoaded() {}", "public function activate() {\n\t\t// TODO define activation functionality here\n\t}", "public function activate() {\n\n\t\t$this->registration_handler->register();\n\t\t\n\t}", "public function Extension($extension){\r\n $fullpath=YEXTENTIONDIR.ucwords($extension).EXT;\r\n $this->Load($fullpath);\r\n }", "function activate() {\r\r\n }", "protected function assignExtensionSettings() {}", "public function testActivateExtensionFailed()\n\t{\n\t\t$this->restartApplication();\n\n\t\t$this->be($this->user);\n\t\t$this->call('orchestra::extensions@activate');\n\t\t$this->assertResponseNotFound();\n\n\t\t\\Orchestra\\Extension::activate(DEFAULT_BUNDLE);\n\n\t\t$this->call('orchestra::extensions@activate', array(DEFAULT_BUNDLE));\n\t\t$this->assertResponseNotFound();\n\n\t\t\\Orchestra\\Extension::deactivate(DEFAULT_BUNDLE);\n\t}", "public function testActivateAndDeactivateExtensionSuccessful()\n\t{\n\t\t$this->restartApplication();\n\n\t\t$this->be($this->user);\n\t\t$this->call('orchestra::extensions@activate', array(DEFAULT_BUNDLE));\n\t\t$this->assertRedirectedTo(handles('orchestra::extensions'));\n\t\t$this->assertTrue(\\Orchestra\\Extension::activated(DEFAULT_BUNDLE));\n\n\t\t$this->call('orchestra::extensions@deactivate', array(DEFAULT_BUNDLE));\n\t\t$this->assertRedirectedTo(handles('orchestra::extensions'));\n\t\t$this->assertFalse(\\Orchestra\\Extension::activated(DEFAULT_BUNDLE));\n\t}", "public function extensionsAction() {\n\n $user = $this->checkLogin();\n\n $userext = $user->getSortedUserExt();\n\n $this->view->assign('userext', $userext);\n\n }", "public function activate() {\n\t\t/**\n\t\t * Fires when the plugin is being activated.\n\t\t *\n\t\t * @since 7.0\n\t\t */\n\t\tdo_action('audition_activate');\n\t}", "function activate() {\n }", "function dbAddProductExtensions( $aData, $bErase = true ){\n global $oFF;\n if( isset( $bErase ) )\n $oFF->deleteInFile( DB_PRODUCTS_EXT, $aData[0], 0 );\n\n $oFF->setRow( $aData );\n $oFF->addToFile( DB_PRODUCTS_EXT ); \n }", "public function plugin_activate(){\n\t\t\n\t\t//call our custom content type function\n\t \t$this->register_location_content_type();\n\t\t//flush permalinks\n\t\tflush_rewrite_rules();\n\t}", "protected function addInitialExtensionInformation()\n {\n $repository = ExtensionInformationRepositoryFactory::create();\n $packages = $this->packageManager->getAvailablePackages();\n $repository->addExtensionInformation($packages);\n }", "public function extensions();", "public function extension();", "function activate() {\n\t\tregister_uninstall_hook( __FILE__, array( __CLASS__, 'uninstall' ) );\n\t}", "function mailmaga_x_activate(){\n\t$mailmaga_x_data = new Mailmaga_x_install();\n\t$mailmaga_x_data->activate();\n}", "public static function activation() {\n\t\tregister_uninstall_hook(__FILE__, array(__CLASS__, 'uninstall'));\n\t}", "public function extension() {}", "public function setAllowedExtensions(array $extensions) {\n \t $this->allowedExtensions = $extensions;\n\t }", "public static function activate() {\n global $wpdb;\n\n $charset_collate = $wpdb->get_charset_collate();\n $table_status = $wpdb->prefix . \"woocommerce_xoxzo_status\";\n $table_error = $wpdb->prefix . \"woocommerce_xoxzo_error\";\n\n /* Create the call status table if does not exist\n * */\n if(!self::has_table($table_status)) {\n $sql_status_table_statement = self::sql_status_table($table_status, $charset_collate);\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n dbDelta( $sql_status_table_statement );\n }\n\n if(!self::has_table($table_error)) {\n $sql_error_table_statement = self::sql_error_table($table_error, $charset_collate);\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n dbDelta( $sql_error_table_statement );\n }\n }", "public static function activate()\n {\n WoocommerceProductUploaderActivator::addTables();\n }", "public static function activate() {\n\n }", "function iarb_extauth()\n{\n\tglobal $context, $modSettings;\n\n\tif (empty($modSettings['extauth_master']))\n\t{\n\t\treturn;\n\t}\n\n\t// Registration Screen ?\n\tif ((!empty($context['site_action']) && $context['site_action'] === 'register')\n\t\t&& (isset($_GET['action']) && $_GET['action'] === 'register'))\n\t{\n\t\t// Load the enabled providers\n\t\trequire_once(SUBSDIR . '/Extauth.subs.php');\n\t\t$context['enabled_providers'] = extauth_enabled_providers();\n\n\t\tif ($modSettings['requireAgreement'] && empty($_POST['accept_agreement']))\n\t\t{\n\t\t\tTemplate_Layers::instance()->addBegin('extauth_register');\n\t\t}\n\t}\n}", "protected function _loadExtensions()\n {\n }", "public function reloadAvailableExtensions() {}", "public function reloadAvailableExtensions() {}", "function instant_ide_manager_activate() {\n\t\n\tinstant_ide_manager_activate_pre();\n\tinstant_ide_manager_activate_post();\n\t\n}", "public function activatePlugin();", "public function activation() {\n\t\t\tif ( ! class_exists( 'Easy_Digital_Downloads' ) ) {\n\t\t\t\t// is this plugin active?\n\t\t\t\tif ( is_plugin_active( $this->basename ) ) {\n\t\t\t\t\t// deactivate the plugin\n\t\t\t \t\tdeactivate_plugins( $this->basename );\n\t\t\t \t\t// unset activation notice\n\t\t\t \t\tunset( $_GET[ 'activate' ] );\n\t\t\t \t\t// display notice\n\t\t\t \t\tadd_action( 'admin_notices', array( $this, 'admin_notices' ) );\n\t\t\t\t}\n\n\t\t\t}\n\t\t}", "public function allow($ext = NULL)\n {\n $this->_allow_extensions = $ext;\n }", "protected static function getActiveExtensionPackages() {}", "function disable_extension()\n\t{\n\t\t$this->EE->db->where('class', __CLASS__);\n\t\t$this->EE->db->delete('extensions');\n\t}", "function disable_extension()\n\t{\n\t\t$this->EE->db->where('class', __CLASS__);\n\t\t$this->EE->db->delete('extensions');\n\t}", "function disable_extension()\n\t{\n\t\t$this->EE->db->where('class', __CLASS__);\n\t\t$this->EE->db->delete('extensions');\n\t}", "function disable_extension()\n\t{\n\t\t$this->EE->db->where('class', __CLASS__);\n\t\t$this->EE->db->delete('extensions');\n\t}", "function disable_extension()\n\t{\n\t\t$this->EE->db->where('class', __CLASS__);\n\t\t$this->EE->db->delete('extensions');\n\t}", "public function activate() {\n\t\t\n\t}", "public static function activate ()\n\t{\n\t\t// Create or update options\n\t\tself::generate_options ();\n\t}", "public static function activate(){\n }", "function eltd_core_activation() {\n do_action('flow_elated_core_on_activate');\n\n flush_rewrite_rules();\n }", "public function register_activation();", "public static function activate()\n {\n }", "public function setExtension(?IExtension $extension): void\n {\n $this->extension = $extension;\n }", "abstract protected function activate_plugin();", "private function loadExtensions(){\n\n // CSRF Extension\n $csrfGenerator = new UriSafeTokenGenerator();\n $csrfStorage = new NativeSessionTokenStorage();\n $csrfManager = new CsrfTokenManager($csrfGenerator, $csrfStorage); \n $csrfExtension = new CsrfExtension($csrfManager);\n \n $this->extensions[] = $csrfExtension;\n \n // HttpFoundation Extension\n $httpFoundation = new HttpFoundationExtension();\n $this->extensions[] = $httpFoundation;\n \n //Core\n $core = new CoreExtension();\n $this->extensions[] = $core;\n \n }", "public function setValidExtensions($extensions) {\n\t\t$this->valid_extensions = $extensions;\n\t}", "public function activate() {\n\t\t\t// just in case I want to do anything on activate\n\t\t}", "function wrmp_activate()\n{\n\trequire_once MYBB_ROOT . '/inc/adminfunctions_templates.php';\n\tfind_replace_templatesets('postbit', \"#\" . preg_quote('<td class=\"smalltext post_author_info\"') . \"#i\", '{$post[\\'wrmp_postbit\\']}<td class=\"smalltext post_author_info\"');\n\tfind_replace_templatesets('postbit_classic', \"#\" . preg_quote('{$post[\\'user_details\\']}') . \"#i\", '{$post[\\'user_details\\']}{$post[\\'wrmp_postbit\\']}');\n\n\tfind_replace_templatesets('postbit', \"#\" . preg_quote('{$post[\\'button_rep\\']}') . \"#i\", '{$post[\\'button_rep\\']}{$post[\\'wrmp_below\\']}');\n\n\t// if we just upgraded . . .\n\t$old_version = wrmp_get_cache_version();\n\t$info = wrmp_info();\n\tif(version_compare($old_version, $info['version'], '<'))\n\t{\n\t\twrmp_install();\n\t}\n\twrmp_set_cache_version();\n}", "public static function activation() {\n /*Activation functions here*/\n\n }", "static function activate()\n\t{\n\t\tif ( JUMPLEAD_VERSION != get_site_option( 'jumplead_version' ) ) {\n\t\t\tglobal $wpdb;\n\n\t\t\t$charset_collate = '';\n\n\t\t\tif ( ! empty($wpdb->charset) ) {\n\t\t\t\t$charset_collate = \"DEFAULT CHARACTER SET {$wpdb->charset}\";\n\t\t\t}\n\n\t\t\tif ( ! empty( $wpdb->collate) ) {\n\t\t\t\t$charset_collate .= \" COLLATE {$wpdb->collate}\";\n\t\t\t}\n\n\t\t\t// Mappings\n\t\t\t$sql = 'CREATE TABLE ' . self::$tableFieldMapping . \" (\n\t\t\t\t`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\t\t\t`integration_id` varchar(100) NOT NULL,\n\t\t\t\t`form_id` int NOT NULL,\n\t\t\t\t`automation_id` varchar(100),\n\t\t\t\t`name` varchar(255),\n\t\t\t\t`name_last` varchar(255),\n\t\t\t\t`email` varchar(255),\n\t\t\t\t`company` varchar(255)\n\t\t\t) $charset_collate;\";\n\n\t\t\tdbDelta( $sql );\n\n\t\t\tupdate_option( 'jumplead_version', JUMPLEAD_VERSION );\n\t\t}\n\t}", "public function activate();", "public function activate();", "public function getActivated()\n\t{\n\t\treturn Cache::rememberForever('extensions', function()\n\t\t{\n\t\t\treturn Extension::where('activated', 1)->get();\n\t\t});\n\t}", "function disable_extension()\n\t{\n\t\tglobal $DB;\n\t\t$DB->query(\"DELETE FROM exp_extensions WHERE class = '\".$DB->escape_str(get_class($this)).\"'\");\n\t}", "function disable_extension()\n {\n ee()->db->where('class', __CLASS__);\n ee()->db->delete('extensions');\n }" ]
[ "0.85474145", "0.84049445", "0.836303", "0.836303", "0.8317834", "0.81736046", "0.8015519", "0.7999967", "0.76635045", "0.7606953", "0.7541912", "0.749552", "0.6567963", "0.6437413", "0.6153233", "0.61193347", "0.604909", "0.60322917", "0.60308313", "0.5969348", "0.5966952", "0.59583324", "0.5957678", "0.59529674", "0.5934915", "0.5930162", "0.592183", "0.5906311", "0.58814734", "0.5829957", "0.58285844", "0.5826196", "0.58236104", "0.5817376", "0.5810513", "0.5810386", "0.5810386", "0.58064175", "0.58058363", "0.5793062", "0.5791459", "0.57895887", "0.57767457", "0.5776056", "0.57620555", "0.57449734", "0.5740905", "0.57172346", "0.56929016", "0.5691542", "0.5683293", "0.5675272", "0.5668163", "0.56599784", "0.564514", "0.5631256", "0.5629382", "0.56159806", "0.5605122", "0.56033266", "0.56027544", "0.56023854", "0.5589514", "0.5588221", "0.5584004", "0.556367", "0.5554259", "0.5544862", "0.55423903", "0.55344933", "0.55344933", "0.55336595", "0.55323243", "0.55205923", "0.55201733", "0.5517603", "0.55173904", "0.55173904", "0.55173904", "0.55173904", "0.55173904", "0.5511711", "0.55111665", "0.55049825", "0.5502013", "0.5493981", "0.5492563", "0.54907966", "0.54714906", "0.54692787", "0.54666936", "0.54634416", "0.5457944", "0.54553175", "0.54540586", "0.54501235", "0.54501235", "0.5438063", "0.54349506", "0.54324573" ]
0.63584507
14
delete_entries_loop If there is nothing to redirect to after deleting, there would be no need to redirect to it. So delete them.
function delete_entries_loop($val, $channel_id) { $url_title = ''; $query = $this->EE->db->select('url_title, channel_id') ->from('channel_titles') ->where('entry_id', $val) ->where('site_id', $this->site_id) ->get(); foreach($query->result_array() as $row) { $url_title = $row['url_title']; } $this->entry_delete($val, $channel_id, $url_title); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delete_entries()\n\t{\n\t\tif ( ! $this->cp->allowed_group('can_access_content'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\n\t\tif ( ! $this->cp->allowed_group('can_delete_self_entries') AND\n\t\t\t ! $this->cp->allowed_group('can_delete_all_entries'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\t\t\t\t\n\t\tif ( ! $this->input->post('delete'))\n\t\t{\n\t\t\t$this->session->set_flashdata('message_failure', $this->lang->line('no_valid_selections'));\n\t\t\t$this->functions->redirect(BASE.AMP.'C=content_edit'.AMP.'M=index');\n\t\t}\n\n\t\t/* -------------------------------------------\n\t\t/* 'delete_entries_start' hook.\n\t\t/* - Perform actions prior to entry deletion / take over deletion\n\t\t*/\n\t\t\t$edata = $this->extensions->call('delete_entries_start');\n\t\t\tif ($this->extensions->end_script === TRUE) return;\n\t\t/*\n\t\t/* -------------------------------------------*/\n\t\t\n\t\t$this->api->instantiate('channel_entries');\n\t\t$res = $this->api_channel_entries->delete_entry($this->input->post('delete'));\n\t\t\n\t\tif ($res === FALSE)\n\t\t{\n\t\t\t$this->session->set_flashdata('message_failure', $this->lang->line('no_valid_selections'));\n\t\t\t$this->functions->redirect(BASE.AMP.'C=content_edit'.AMP.'M=index');\n\t\t}\n\t\t\n\t\t// Return success message\n\t\t$this->session->set_flashdata('message_success', $this->lang->line('entries_deleted'));\n\t\t$this->functions->redirect(BASE.AMP.'C=content_edit');\n\t}", "public function processDelete()\n {\n $pageId = Tools::getValue('id_page');\n\n Db::getInstance()->delete($this->module->table_name, 'id_page='.$pageId);\n Db::getInstance()->delete($this->module->table_lang, 'id_page='.$pageId);\n Db::getInstance()->delete($this->module->table_related, 'id_parent='.$pageId.' OR id_related='.$pageId);\n\n $this->redirect_after = static::$currentIndex.'&conf=1&token='.$this->token;\n }", "private function delete_entry_and_redirect( Entry $entry ) {\n\t\t$result = $entry->delete();\n\n\t\tif ( -1 === $result ) {\n\t\t\tAdmin_Page::redirect_and_show_message(\n\t\t\t\tnew Message( Message::ERROR, __( 'Database error.', 'glossary-by-arteeo' ) )\n\t\t\t);\n\t\t} else {\n\t\t\tAdmin_Page::redirect_and_show_message(\n\t\t\t\tnew Message( Message::SUCCESS, __( 'Entry has been deleted.', 'glossary-by-arteeo' ) )\n\t\t\t);\n\t\t}\n\t}", "function deleteEntry() \n { \n \n // before removing entry, make sure associated linkGroups & linkViewers\n // are removed as well\n $linkID = $this->getID();\n \n $linkMgr = new RowManager_NavLinkAccessGroupManager();\n $linkMgr->setLinkID( $linkID );\n $list = $linkMgr->getListIterator();\n \n $list->setFirst();\n while( $entry = $list->getNext() ) {\n $entry->deleteEntry();\n }\n \n $linkViewerMgr = new RowManager_NavLinkViewerManager();\n $linkViewerMgr->setLinkID( $linkID );\n $list = $linkViewerMgr->getListIterator();\n \n $list->setFirst();\n while( $entry = $list->getNext() ) {\n $entry->deleteEntry();\n }\n \n parent::deleteEntry();\n \n }", "public function delete_entries_start ()\n\t{\n\t\t$return = (ee()->extensions->last_call) ?\n\t\t\t\t\tee()->extensions->last_call : '';\n\n\t\tee()->load->library('calendar_permissions');\n\n\t\t$group_id = ee()->session->userdata['group_id'];\n\n\t\tif ($group_id != 1 AND ee()->calendar_permissions->enabled())\n\t\t{\n\t\t\t$count = count($_POST['delete']);\n\n\t\t\t//remove all the ones they are denied permission to\n\t\t\tforeach ($_POST['delete'] as $key => $delete_id)\n\t\t\t{\n\t\t\t\t//if there are only calendar IDs, lets alert\n\t\t\t\tif ( ! ee()->calendar_permissions->can_edit_entry($group_id, $delete_id))\n\t\t\t\t{\n\t\t\t\t\tunset($_POST['delete'][$key]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//if we've removed everything, they were all\n\t\t\t//denied and we need to alert\n\t\t\tif ($count > 0 and count($_POST['delete']) == 0)\n\t\t\t{\n\t\t\t\tee()->extensions->end_script = TRUE;\n\n\t\t\t\treturn $this->show_error(lang('invalid_calendar_permissions'));\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "function delete_entries_start()\n\t{\n\t\tglobal $DB, $FF;\n\n\t\t$playa_fields = $this->_get_fields();\n\t\t$this->cache['mourning_parents'] = array();\n\n\t\tif (count($playa_fields))\n\t\t{\n\t\t\tforeach($_POST['delete'] as $child_id)\n\t\t\t{\n\t\t\t\tif ($parents = $this->_get_parents($child_id))\n\t\t\t\t{\n\t\t\t\t\t$this->cache['mourning_parents'][$child_id] = $parents;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function deleteMultipleEntriesAction()\n {\n $personsToDelete = $this->request->getArguments()['personsToDelete'];\n $this->personRepository->deleteMultipleEntries($personsToDelete);\n $this->redirect('list');\n }", "public function process_bulk_action() {\n\t\tif ( 'delete' === $this->current_action() ) {\n\t\t\t// In our file that handles the request, verify the nonce.\n\t\t\t$nonce = esc_attr( $_REQUEST['_wpnonce'] );\n\t\t\t\n\t\t\tif ( ! wp_verify_nonce( $nonce, 'delete_page' ) ) {\n\t\t\t\tdie( 'Go get a life script kiddies' );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tself::delete_page( absint( $_GET['id'] ) );\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//\twp_die(esc_url( add_query_arg() ) );\n\t\t\t\t\n\t\t\t\t//wp_die(remove_query_arg(['action'],$_SERVER['HTTP_REFERER']));\n\t\t\t\t//wp_redirect(remove_query_arg(['action'],$_SERVER['HTTP_REFERER']));\n\t\t\t\t//wp_redirect( esc_url( add_query_arg() ) );\n\t\t\t\t//exit;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// If the delete bulk action is triggered\n\t\tif ( ( isset( $_POST['action'] ) && $_POST['action'] == 'bulk-delete' )\n\t\t || ( isset( $_POST['action2'] ) && $_POST['action2'] == 'bulk-delete' )\n\t\t) {\n\t\t\t\n\t\t\t$delete_ids = esc_sql( $_POST['bulk-delete'] );\n\t\t\t\n\t\t\t// loop over the array of record IDs and delete them\n\t\t\tforeach ( $delete_ids as $id ) {\n\t\t\t\t\n\t\t\t\tself::delete_page( $id );\n\t\t\t\t\n\t\t\t}\n\t\t\t//wp_redirect(remove_query_arg(['action'],$_SERVER['HTTP_REFERER']));\n\t\t\t//exit;\n\t\t}\n\t}", "function process_link_action() {\n global $catpdf_templates;\n if (isset($_GET['catpdf_action']) && $_GET['catpdf_action'] == 'delete') {\n $catpdf_templates->delete_template($_GET['template']);\n }\n }", "public function beforeDelete()\n {\n\n // delete also all wall entries\n foreach ($this->getWallEntries() as $entry) {\n $entry->delete();\n }\n\n return parent::beforeDelete();\n }", "public function handleDeleteAbort(){\n $listingID = $this->hlp->sess(\"listing\")->listingID;\n $this->redirect(\"Listings:editListing\", $listingID);\n }", "function thumbwhere_contentcollection_form_submit_delete(&$form, &$form_state) {\n $form_state['redirect'] = 'admin/thumbwhere/thumbwhere_contentcollections/thumbwhere_contentcollection/' . $form_state['thumbwhere_contentcollection']->pk_contentcollection . '/delete';\n}", "public function multiDeleteAction() {\n\n if ($this->getRequest()->isPost()) {\n $values = $this->getRequest()->getPost();\n\n foreach ($values as $key => $value) {\n if ($key == 'delete_' . $value) {\n Engine_Api::_()->getItem('list_listing', (int) $value)->delete();\n }\n }\n }\n return $this->_helper->redirector->gotoRoute(array('action' => 'index'));\n }", "public function do_batch() {\n\t\t$post_ids = array_map( 'intval', $this->get_post_ids() );\n\t\tforeach( $post_ids as $post_to_delete ) {\n\t\t\tadd_filter( Toolset_Association_Cleanup_Post::IS_DELETING_FILTER, '__return_true' );\n\t\t\twp_delete_post( $post_to_delete, true );\n\t\t\tremove_filter( Toolset_Association_Cleanup_Post::IS_DELETING_FILTER, '__return_true' );\n\t\t}\n\n\t\t$this->deleted_posts = count( $post_ids );\n\t}", "protected function _before_delete(): void\n {\n //this will try to delete all the content records to which it has access\n //if there are remaining content records the deletion of the Page will fail due to the Foreign Key contraint restrict\n $contents = PageContent::get_by( ['page_id' => $this->page_id] );\n foreach ($contents as $PageContent) {\n $PageContent->delete();\n }\n }", "public function delete_entries_loop($entry_id, $channel_id)\n\t{\n\t\t// -------------------------------------\n\t\t// Is this weblog the calendar weblog?\n\t\t// -------------------------------------\n\n\t\tif ($this->data->channel_is_calendars_channel($channel_id) === TRUE)\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// Remove this calendar and its events\n\t\t\t// -------------------------------------\n\n\t\t\t$this->data->delete_calendar($entry_id);\n\t\t}\n\t\telseif ($this->data->channel_is_events_channel($channel_id) === TRUE)\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// Remove this event\n\t\t\t// -------------------------------------\n\n\t\t\t$this->data->delete_event($entry_id);\n\t\t}\n\t}", "public function deleteTask()\n {\n if (User::isGuest())\n {\n $rtrn = Request::getVar('REQUEST_URI', Route::url('index.php?option=' . $this->_option, false, true), 'server');\n App::redirect(\n Route::url('index.php?option=com_users&view=login&return=' . base64_encode($rtrn)),\n Lang::txt('COM_RADIAM_LOGIN_NOTICE'),\n 'warning'\n );\n return;\n }\n\n if (!$this->config->get('access-delete-entry')\n && !$this->config->get('access-manage-entry'))\n {\n App::abort(403, Lang::txt('COM_RADIAM_NOT_AUTH'));\n }\n\n // Incoming\n $id = Request::getInt('entry', 0);\n\n if (!$id)\n {\n return $this->displayTask();\n }\n\n $process = Request::getVar('process', '');\n $confirmdel = Request::getVar('confirmdel', '');\n\n // Initiate a blog entry object\n $entry = Entry::oneOrFail($id);\n\n // Did they confirm delete?\n if (!$process || !$confirmdel)\n {\n if ($process && !$confirmdel)\n {\n $this->setError(Lang::txt('COM_RADIAM_ERROR_CONFIRM_DELETION'));\n }\n\n foreach ($this->getErrors() as $error)\n {\n $this->view->setError($error);\n }\n\n $this->view\n ->set('config', $this->config)\n ->set('entry', $entry)\n ->display();\n return;\n }\n\n // Check for request forgeries\n Request::checkToken();\n\n // Delete the entry itself\n $entry->set('state', 2);\n\n if (!$entry->save())\n {\n Notify::error($entry->getError());\n }\n\n // Log the activity\n Event::trigger('system.logActivity', [\n 'activity' => [\n 'action' => 'deleted',\n 'scope' => 'radiam.entry',\n 'scope_id' => $id,\n 'description' => Lang::txt('COM_RADIAM_ACTIVITY_ENTRY_DELETED', '<a href=\"' . Route::url($entry->link()) . '\">' . $entry->get('title') . '</a>'),\n 'details' => array(\n 'title' => $entry->get('title'),\n 'url' => Route::url($entry->link())\n )\n ],\n 'recipients' => [\n $entry->get('created_by')\n ]\n ]);\n\n // Return the entries lsit\n App::redirect(\n Route::url('index.php?option=' . $this->_option)\n );\n }", "public function delete($entries=Null) {\n if ($entries === Null) {\n $entries = array_keys($this->entries()->entries());\n }\n if (!is_array($entries) && !is_numeric($entries)) {\n throw new InvalidParameterException($this->app, $entries, \"array or numeric\");\n }\n if (is_numeric($entries)) {\n $entries = [$entries];\n }\n $entryIDs = [];\n foreach ($entries as $entry) {\n if (is_numeric($entry)) {\n $entryIDs[] = intval($entry);\n }\n }\n if ($entryIDs) {\n $this->beforeDelete();\n $this->app->dbConn->table(static::$TABLE)->where(['user_id' => $this->user_id])->where(['id' => $entryIDs])->limit(count($entryIDs))->delete();\n $this->afterDelete();\n }\n foreach ($entryIDs as $entryID) {\n unset($this->entries[intval($entryID)]);\n }\n return True;\n }", "protected function _postDelete() {}", "protected function _postDelete() {}", "public function deleteall()\n\t{\n\t\t$ids = $this->input->post('records');\n\t\t$slider_cat = $this->SqlModel->getSingleField('slider_cat','slider',array('slider_id'=>$ids[0]));\n\t\tif(!empty($ids))\n\t\t{\n\t\t\tforeach($ids as $id)\n\t\t\t{\n\t\t\t$this->SqlModel->deleteRecord($this->tblName, array($this->pKey=>$id));\t\n\t\t\t}\n\t\t}\n\t\tredirect(base_url().'manage/'.$this->controller.'/index/deletesuccess/'.$slider_cat,'location');\t\t\n\t\t\n\t}", "public function onAfterDelete() {\n\n\t\tparent::onAfterDelete();\n\n\t\t// Determine whether this page has been completely removed.\n\n\t\tif(Config::inst()->get(MisdirectionRequestFilter::class, 'replace_default') && !$this->owner->isPublished() && !$this->owner->isOnDraft()) {\n\n\t\t\t// Convert any link mappings that are directly associated with this page.\n\n\t\t\t$mappings = LinkMapping::get()->filter(array(\n\t\t\t\t'RedirectType' => 'Page',\n\t\t\t\t'RedirectPageID' => $this->owner->ID\n\t\t\t));\n\t\t\tforeach($mappings as $mapping) {\n\t\t\t\t$mapping->RedirectType = 'Link';\n\t\t\t\t$mapping->RedirectLink = Director::makeRelative(($this->owner->Link() === Director::baseURL()) ? Controller::join_links(Director::baseURL(), 'home/') : $this->owner->Link());\n\t\t\t\t$mapping->write();\n\t\t\t}\n\t\t}\n\t}", "public function delete()\n {\n $ids = Request::get(\"id\");\n\n $ids = is_array($ids) ? $ids : [$ids];\n\n foreach ($ids as $ID) {\n\n $page = Page::findOrFail($ID);\n\n // Fire deleting action\n\n Action::fire(\"page.deleting\", $page);\n\n $page->tags()->detach();\n $page->delete();\n\n // Fire deleted action\n\n Action::fire(\"page.deleted\", $page);\n }\n\n return Redirect::back()->with(\"message\", trans(\"pages::pages.events.deleted\"));\n }", "public function delete_poll_submissions() {\n\t\tforminator_validate_ajax( 'forminatorPollEntries' );\n\t\tif ( ! empty( $_POST['id'] ) ) {\n\t\t\t$form_id = intval( $_POST['id'] );\n\t\t\tForminator_Form_Entry_Model::delete_by_form( $form_id );\n\n\t\t\t$file = forminator_plugin_dir() . \"admin/views/poll/entries/content-none.php\";\n\n\t\t\tob_start();\n\t\t\t/** @noinspection PhpIncludeInspection */\n\t\t\tinclude $file;\n\t\t\t$html = ob_get_clean();\n\n\t\t\t$data['html'] = $html;\n\t\t\t$data['notification'] = array(\n\t\t\t\t'type' => 'success',\n\t\t\t\t'text' => __( 'All the submissions deleted successfully.', Forminator::DOMAIN ),\n\t\t\t\t'duration' => '4000',\n\t\t\t);\n\t\t\twp_send_json_success( $data );\n\t\t} else {\n\t\t\t$data['notification'] = array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'text' => __( 'Submission delete failed.', Forminator::DOMAIN ),\n\t\t\t\t'duration' => '4000',\n\t\t\t);\n\t\t\twp_send_json_error( $data );\n\t\t}\n\t}", "function doRealDelete()\n {\n /* Query data of this section */\n $this->dbQuerySingle();\n /* Check the presence of GET or POST parameter 'returntoparent'. */\n $this->processReturnToParent();\n /* The function above sets $this->rs to values that shall be\n displayed. By assigning $this->rs to Smarty variable 'section'\n we can fill the values of $this->rs into a template. */\n $this->_smarty->assign('section', $this->rs);\n\n /* Delete the record */\n $this->dbDeleteById();\n /* Delete the corresponding counter */\n $this->dbDeleteCounterById();\n\n /* Left column contains administrative menu */\n $this->_smarty->assign('leftcolumn', \"leftadmin.tpl\");\n }", "function delete()\n\t{\n\t\t// Check for request forgeries.\n\t\tJRequest::checkToken() or jexit(JText::_('Invalid_Token'));\n\n\t\t// Get and sanitize the items to delete.\n\t\t$cid = JRequest::getVar('cid', null, 'post', 'array');\n\t\tJArrayHelper::toInteger($cid);\n\n\t\t// Get the model.\n\t\t$model = & $this->getModel('Link', 'RedirectModel');\n\n\t\t// Attempt to delete the item(s).\n\t\tif (!$model->delete($cid)) {\n\t\t\t$this->setMessage(JText::sprintf('Redirect_Link_Delete_Failed', $model->getError()), 'notice');\n\t\t}\n\t\telse {\n\t\t\t$this->setMessage(JText::sprintf('Redirect_Link_Delete_Success', count($cid)));\n\t\t}\n\n\t\t// Redirect to the list screen.\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_redirect&view=links', false));\n\t}", "public function processDelete()\n {\n // Record is valid\n $Model = $this->isValidRecord();\n if ($Model instanceof \\Illuminate\\Http\\RedirectResponse) {\n $this->redirect($Model);\n }\n // Set initial configuration\n $Model->build($this->Model->getTable());\n // Delete record\n if ($this->getIsTransaction()) {\n $result = DB::transaction(function ($db) use ($Model) {\n $result = $Model->delete();\n // Hook Action deleteAfterDelete\n $this->doHooks(\"deleteAfterDelete\", array($Model));\n });\n } else {\n $result = $Model->delete();\n // Hook Action deleteAfterDelete\n $this->doHooks(\"deleteAfterDelete\", array($Model));\n }\n // Set response redirect to list page and set session flash\n $Response = redirect($this->getFormAction())\n ->with('dk_' . $this->getIdentifier() . '_info_success', trans('dkscaffolding.notification.delete.success'));\n // Hook Filter deleteModifyResponse\n $Response = $this->doFilter(\"deleteModifyResponse\", $Response);\n $this->redirect($Response);\n }", "public function delete()\n\t{\n\t\tJSession::checkToken() or JSession::checkToken('get') or jexit(JText::_('JINVALID_TOKEN'));\n\t\t$this->_result = $result = parent::delete();\n\t\t$model = $this->getModel();\n\n\t\t//Define the redirections\n\t\tswitch ($this->getLayout() . '.' . $this->getTask())\n\t\t{\n\t\t\tcase 'default.delete':\n\t\t\t\t$this->applyRedirection($result, array(\n\t\t\t\t\t'stay',\n\t\t\t\t\t'com_papiersdefamilles.reservations.default'\n\t\t\t\t), array(\n\t\t\t\t\t'cid[]' => null\n\t\t\t\t));\n\t\t\t\tbreak;\n\n\t\t\tcase 'modal.delete':\n\t\t\t\t$this->applyRedirection($result, array(\n\t\t\t\t\t'stay',\n\t\t\t\t\t'com_papiersdefamilles.reservations.default'\n\t\t\t\t), array(\n\t\t\t\t\t'cid[]' => null\n\t\t\t\t));\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$this->applyRedirection($result, array(\n\t\t\t\t\t'stay',\n\t\t\t\t\t'com_papiersdefamilles.reservations.default'\n\t\t\t\t));\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function deleteAction() {\n\t\tif(!isset($this->params['cancel'])) {\n\n\t\t\t// XXX: Maybe do some hook call validation here?\n\n\t\t\t// auto call the hooks for this module/action\n\t\t\tAPI::callHooks(self::$module, $this->action, 'controller', $this);\n\n\t\t\t// delete an entry\n\t\t\t$host = $this->_model->delete();\n\t\t}\n\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t}", "private function deleteRedirect()\n\t{\n\t\tif (empty($_POST['id'])) {\n\t\t\tISC_JSON::output(GetLang('RedirectDeleteDoesntExist'));\n\t\t}\n\n\t\t$id = (int)$_POST['id'];\n\n\t\tGetLib('class.urls');\n\t\tGetLib('class.redirects');\n\n\t\t$redirect = ISC_REDIRECTS::loadRedirectById($id);\n\t\tif (!$redirect) {\n\t\t\tISC_JSON::output(GetLang('RedirectDeleteDoesntExist'));\n\t\t}\n\n\t\tif ($GLOBALS['ISC_CLASS_DB']->DeleteQuery('redirects', 'WHERE redirectid = ' . $id)) {\n\t\t\tISC_JSON::output(GetLang('RedirectDeleteSuccessful'), true);\n\t\t}\n\n\t\tISC_JSON::output(GetLang('RedirectDeleteError'));\n\t}", "function multi_delete () {\n\t\t$ids_to_delete = array();\n\t\t// Prepare ids to delete\n\t\tforeach ((array)$_POST[\"items\"] as $_cur_id) {\n\t\t\tif (empty($_cur_id)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$ids_to_delete[$_cur_id] = $_cur_id;\n\t\t}\n\t\t// Do delete ids\n\t\tif (!empty($ids_to_delete)) {\n\t\t\tdb()->query(\"DELETE FROM \".db('search_keywords').\" WHERE id IN(\".implode(\",\",$ids_to_delete).\")\");\n\t\t}\n\t\t// Return user back\n\t\treturn js_redirect($_SERVER[\"HTTP_REFERER\"]);\n\t}", "function delete_entries_confirm()\n\t{\n\t\tif ( ! $this->cp->allowed_group('can_access_content'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\n\t\tif ( ! $this->cp->allowed_group('can_delete_self_entries') AND\n\t\t\t ! $this->cp->allowed_group('can_delete_all_entries'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\t\t\t\t\n\t\tif ( ! $this->input->post('toggle'))\n\t\t{\n\t\t\tredirect(BASE.'content_edit');\n\t\t}\n\n\t\t$this->load->helper('form');\n\n\t\t$damned = array();\n\n\t\tforeach ($_POST['toggle'] as $key => $val)\n\t\t{\t\t\n\t\t\tif ($val != '')\n\t\t\t{\n\t\t\t\t$damned[] = $val;\n\t\t\t}\n\t\t}\n\n\t\t// Pass the damned on for judgement\n\t\t$vars['damned'] = $damned;\n\n\t\tif (count($damned) == 1)\n\t\t{\n\t\t\t$vars['message'] = $this->lang->line('delete_entry_confirm');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$vars['message'] = $this->lang->line('delete_entries_confirm');\n\t\t}\n\n\t\t$vars['title_deleted_entry'] = '';\n\n\t\t// if it's just one entry, let's be kind and show a title\n\t\tif (count($_POST['toggle']) == 1)\n\t\t{\n\t\t\t$query = $this->db->query('SELECT title FROM exp_channel_titles WHERE entry_id = \"'.$this->db->escape_str($_POST['toggle'][0]).'\"');\n\n\t\t\tif ($query->num_rows() == 1)\n\t\t\t{\n\t\t\t\t$vars['title_deleted_entry'] = str_replace('%title', $query->row('title') , $this->lang->line('entry_title_with_title'));\n\t\t\t}\n\t\t}\n\n\t\t$this->cp->set_variable('cp_page_title', $this->lang->line('delete_confirm'));\n\n\t\t$this->javascript->compile();\n\t\t$this->load->view('content/delete_confirm', $vars);\n\t}", "function thumbwhere_contentcollectionitem_form_submit_delete(&$form, &$form_state) {\n $form_state['redirect'] = 'admin/thumbwhere/thumbwhere_contentcollectionitems/thumbwhere_contentcollectionitem/' . $form_state['thumbwhere_contentcollectionitem']->pk_contentcollectionitem . '/delete';\n}", "function delete()\r\n\t{\r\n\t\t// Check for request forgeries\r\n\t\tJRequest::checkToken() or die( 'Invalid Token' );\r\n\t\tglobal $mainframe;\r\n\t\t$model\t= &$this->getModel( 'table' );\r\n\t\t$ids = JRequest::getVar('ids', array(), 'request', 'array');\r\n\t\t$model->deleteRows( $ids );\r\n\t\tif ( JRequest::getVar('format') == 'raw') {\r\n\t\t\tJRequest::setVar( 'view', 'table' );\r\n\t\t\t$this->display();\r\n\t\t} else {\r\n\t\t\t//@TODO: test this\r\n\t\t\t$ref = JRequest::getVar( 'fabrik_referrer', \"index.php\", 'post' );\r\n\t\t\t$mainframe->redirect( $ref, count($ids) . \" \" . JText::_( 'RECORDS DELETED' ) );\r\n\t\t}\r\n\t}", "public function onBeforeDelete()\n\t{\n\t\t$site_pages = ee()->config->item('site_pages');\n\t\t$site_id = ee()->config->item('site_id');\n\n\t\t$entries = $this->getModelFacade()->get('ChannelEntry')\n\t\t\t->fields('entry_id', 'author_id')\n\t\t\t->filter('channel_id', $this->channel_id)\n\t\t\t->all();\n\n\t\tif ($site_pages !== FALSE && $entries)\n\t\t{\n\t\t\tif (count($site_pages[$site_id]) > 0)\n\t\t\t{\n\t\t\t\tforeach ($entries as $entry)\n\t\t\t\t{\n\t\t\t\t\tunset($site_pages[$site_id]['uris'][$entry->entry_id]);\n\t\t\t\t\tunset($site_pages[$site_id]['templates'][$entry->entry_id]);\n\t\t\t\t}\n\n\t\t\t\tee()->config->set_item('site_pages', $site_pages);\n\n\t\t\t\t$this->Site->site_pages = $site_pages;\n\t\t\t\t$this->Site->save();\n\t\t\t}\n\t\t}\n\t}", "function deletes($id) {\n\t\n\tglobal $link;\n\t\n\tdelete (array ('table' => 'articles', 'link' => $link, 'id' => $id));\n\theader(\"location:\".BASE_URL.\"/articles/backoffice_index\");\t\n\n}", "public function process_bulk_action() {\n\n\t\t\tswitch ( $this->current_action() ) {\n\t\t\t\tcase 'delete':\n\t\t\t\t\t// Check access rights.\n\t\t\t\t\tif ( 'on' !== $this->allow_delete ) {\n\t\t\t\t\t\t// Deleting records from list table is not allowed.\n\t\t\t\t\t\twp_die( __( 'ERROR: Not authorized [delete not allowed]', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prepare wp_nonce action security check.\n\t\t\t\t\t$wp_nonce_action = \"wpda-delete-{$this->table_name}\";\n\n\t\t\t\t\t$row_to_be_deleted = []; // Gonna hold the row to be deleted.\n\t\t\t\t\t$i = 0; // Index, necessary for multi column keys.\n\n\t\t\t\t\t// Check all key columns.\n\t\t\t\t\tforeach ( $this->wpda_list_columns->get_table_primary_key() as $key ) {\n\t\t\t\t\t\t// Check if key is available.\n\t\t\t\t\t\tif ( ! isset( $_REQUEST[ $key ] ) ) { // input var okay.\n\t\t\t\t\t\t\twp_die( __( 'ERROR: Invalid URL [missing primary key values]', 'wp-data-access' ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Write key value pair to array.\n\t\t\t\t\t\t$row_to_be_deleted[ $i ]['key'] = $key;\n\t\t\t\t\t\t$row_to_be_deleted[ $i ]['value'] = sanitize_text_field( wp_unslash( $_REQUEST[ $key ] ) ); // input var okay.\n\t\t\t\t\t\t$i ++;\n\n\t\t\t\t\t\t// Add key values to wp_nonce action.\n\t\t\t\t\t\t$wp_nonce_action .= '-' . sanitize_text_field( wp_unslash( $_REQUEST[ $key ] ) ); // input var okay.\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check if delete is allowed.\n\t\t\t\t\t$wp_nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; // input var okay.\n\t\t\t\t\tif ( ! wp_verify_nonce( $wp_nonce, $wp_nonce_action ) ) {\n\t\t\t\t\t\twp_die( __( 'ERROR: Not authorized', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// All key column values available: delete record.\n\t\t\t\t\t// Prepare named array for delete operation.\n\t\t\t\t\t$next_row_to_be_deleted = [];\n\t\t\t\t\t$count_rows = count( $row_to_be_deleted );\n\t\t\t\t\tfor ( $i = 0; $i < $count_rows; $i ++ ) {\n\t\t\t\t\t\t$next_row_to_be_deleted[ $row_to_be_deleted[ $i ]['key'] ] = $row_to_be_deleted[ $i ]['value'];\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $this->delete_row( $next_row_to_be_deleted ) ) {\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => __( 'Row deleted', 'wp-data-access' ),\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => __( 'Could not delete row', 'wp-data-access' ),\n\t\t\t\t\t\t\t\t'message_type' => 'error',\n\t\t\t\t\t\t\t\t'message_is_dismissible' => false,\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'bulk-delete':\n\t\t\t\t\t// Check access rights.\n\t\t\t\t\tif ( $this->allow_delete !== 'on' ) {\n\t\t\t\t\t\t// Deleting records from list table is not allowed.\n\t\t\t\t\t\tdie( __( 'ERROR: Not authorized [delete not allowed]', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// We first need to check if all the necessary information is available.\n\t\t\t\t\tif ( ! isset( $_REQUEST['bulk-selected'] ) ) { // input var okay.\n\t\t\t\t\t\t// Nothing to delete.\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => __( 'Nothing to delete', 'wp-data-access' ),\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check if delete is allowed.\n\t\t\t\t\t$wp_nonce_action = 'wpda-delete-*';\n\t\t\t\t\t$wp_nonce = isset( $_REQUEST['_wpnonce2'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce2'] ) ) : ''; // input var okay.\n\t\t\t\t\tif ( ! wp_verify_nonce( $wp_nonce, $wp_nonce_action ) ) {\n\t\t\t\t\t\tdie( __( 'ERROR: Not authorized', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t$bulk_rows = $_REQUEST['bulk-selected'];\n\t\t\t\t\t$no_rows = count( $bulk_rows ); // # rows to be deleted.\n\n\t\t\t\t\t$rows_to_be_deleted = []; // Gonna hold rows to be deleted.\n\n\t\t\t\t\tfor ( $i = 0; $i < $no_rows; $i ++ ) {\n\t\t\t\t\t\t// Write \"json\" to named array. Need to strip slashes twice. Once for the normal conversion\n\t\t\t\t\t\t// and once extra for the pre-conversion of double quotes in method column_cb().\n\t\t\t\t\t\t$row_object = json_decode( stripslashes( stripslashes( $bulk_rows[ $i ] ) ), true );\n\t\t\t\t\t\tif ( $row_object ) {\n\t\t\t\t\t\t\t$j = 0; // Index used to build array.\n\n\t\t\t\t\t\t\t// Check all key columns.\n\t\t\t\t\t\t\tforeach ( $this->wpda_list_columns->get_table_primary_key() as $key ) {\n\t\t\t\t\t\t\t\t// Check if key is available.\n\t\t\t\t\t\t\t\tif ( ! isset( $row_object[ $key ] ) ) {\n\t\t\t\t\t\t\t\t\twp_die( __( 'ERROR: Invalid URL [missing primary key values]', 'wp-data-access' ) );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Write key value pair to array.\n\t\t\t\t\t\t\t\t$rows_to_be_deleted[ $i ][ $j ]['key'] = $key;\n\t\t\t\t\t\t\t\t$rows_to_be_deleted[ $i ][ $j ]['value'] = $row_object[ $key ];\n\t\t\t\t\t\t\t\t$j ++;\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Looks like eveything is there. Delete records from table...\n\t\t\t\t\t$no_key_cols = count( $this->wpda_list_columns->get_table_primary_key() );\n\t\t\t\t\t$rows_succesfully_deleted = 0; // Number of rows succesfully deleted.\n\t\t\t\t\t$rows_with_errors = 0; // Number of rows that could not be deleted.\n\t\t\t\t\tfor ( $i = 0; $i < $no_rows; $i ++ ) {\n\t\t\t\t\t\t// Prepare named array for delete operation.\n\t\t\t\t\t\t$next_row_to_be_deleted = [];\n\n\t\t\t\t\t\t$row_found = true;\n\t\t\t\t\t\tfor ( $j = 0; $j < $no_key_cols; $j ++ ) {\n\t\t\t\t\t\t\tif ( isset( $rows_to_be_deleted[ $i ][ $j ]['key'] ) ) {\n\t\t\t\t\t\t\t\t$next_row_to_be_deleted[ $rows_to_be_deleted[ $i ][ $j ]['key'] ] = $rows_to_be_deleted[ $i ][ $j ]['value'];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$row_found = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( $row_found ) {\n\t\t\t\t\t\t\tif ( $this->delete_row( $next_row_to_be_deleted ) ) {\n\t\t\t\t\t\t\t\t// Row(s) succesfully deleted.\n\t\t\t\t\t\t\t\t$rows_succesfully_deleted ++;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// An error occured during the delete operation: increase error count.\n\t\t\t\t\t\t\t\t$rows_with_errors ++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// An error occured during the delete operation: increase error count.\n\t\t\t\t\t\t\t$rows_with_errors ++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Inform user about the results of the operation.\n\t\t\t\t\t$message = '';\n\n\t\t\t\t\tif ( 1 === $rows_succesfully_deleted ) {\n\t\t\t\t\t\t$message = __( 'Row deleted', 'wp-data-access' );\n\t\t\t\t\t} elseif ( $rows_succesfully_deleted > 1 ) {\n\t\t\t\t\t\t$message = \"$rows_succesfully_deleted \" . __( 'rows deleted', 'wp-data-access' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( '' !== $message ) {\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => $message,\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\t\t\t\t\t}\n\n\t\t\t\t\t$message = '';\n\n\t\t\t\t\tif ( $rows_with_errors > 0 ) {\n\t\t\t\t\t\t$message = __( 'Not all rows have been deleted', 'wp-data-access' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( '' !== $message ) {\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => $message,\n\t\t\t\t\t\t\t\t'message_type' => 'error',\n\t\t\t\t\t\t\t\t'message_is_dismissible' => false,\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'bulk-export':\n\t\t\t\tcase 'bulk-export-xml':\n\t\t\t\tcase 'bulk-export-json':\n\t\t\t\tcase 'bulk-export-excel':\n\t\t\t\tcase 'bulk-export-csv':\n\t\t\t\t\t// Check access rights.\n\t\t\t\t\tif ( ! WPDA::is_wpda_table( $this->table_name ) ) {\n\t\t\t\t\t\tif ( 'on' !== WPDA::get_option( WPDA::OPTION_BE_EXPORT_ROWS ) ) {\n\t\t\t\t\t\t\t// Exporting rows from list table is not allowed.\n\t\t\t\t\t\t\tdie( __( 'ERROR: Not authorized [export not allowed]', 'wp-data-access' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// We first need to check if all the necessary information is available.\n\t\t\t\t\tif ( ! isset( $_REQUEST['bulk-selected'] ) ) { // input var okay.\n\t\t\t\t\t\t// Nothing to export.\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => __( 'Nothing to export', 'wp-data-access' ),\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check if export is allowed.\n\t\t\t\t\t$wp_nonce_action = 'wpda-export-*';\n\t\t\t\t\t$wp_nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; // input var okay.\n\t\t\t\t\tif ( ! wp_verify_nonce( $wp_nonce, $wp_nonce_action ) ) {\n\t\t\t\t\t\tdie( __( 'ERROR: Not authorized', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t$bulk_rows = $_REQUEST['bulk-selected'];\n\t\t\t\t\t$no_rows = count( $bulk_rows ); // # rows to be exported.\n\n\t\t\t\t\t$format_type = '';\n\t\t\t\t\tswitch ( $this->current_action() ) {\n\t\t\t\t\t\tcase 'bulk-export-xml':\n\t\t\t\t\t\t\t$format_type = 'xml';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'bulk-export-json':\n\t\t\t\t\t\t\t$format_type = 'json';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'bulk-export-excel':\n\t\t\t\t\t\t\t$format_type = 'excel';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'bulk-export-csv':\n\t\t\t\t\t\t\t$format_type = 'csv';\n\t\t\t\t\t}\n\n\t\t\t\t\t$querystring = '';\n\t\t\t\t\tif ( ! is_admin() ) {\n\t\t\t\t\t\t// Add admin path for public access\n\t\t\t\t\t\t$querystring = admin_url() . 'admin.php';\n\t\t\t\t\t}\n\t\t\t\t\t$querystring .= \"?action=wpda_export&type=row&mysql_set=off&show_create=off&show_comments=off&schema_name={$this->schema_name}&table_names={$this->table_name}&_wpnonce=$wp_nonce&format_type=$format_type\";\n\n\t\t\t\t\t$j = 0;\n\t\t\t\t\tfor ( $i = 0; $i < $no_rows; $i ++ ) {\n\t\t\t\t\t\t// Write \"json\" to named array. Need to strip slashes twice. Once for the normal conversion\n\t\t\t\t\t\t// and once extra for the pre-conversion of double quotes in method column_cb().\n\t\t\t\t\t\t$row_object = json_decode( stripslashes( stripslashes( $bulk_rows[ $i ] ) ), true );\n\t\t\t\t\t\tif ( $row_object ) {\n\t\t\t\t\t\t\t// Check all key columns.\n\t\t\t\t\t\t\tforeach ( $this->wpda_list_columns->get_table_primary_key() as $key ) {\n\t\t\t\t\t\t\t\t// Check if key is available.\n\t\t\t\t\t\t\t\tif ( ! isset( $row_object[ $key ] ) ) {\n\t\t\t\t\t\t\t\t\twp_die( __( 'ERROR: Invalid URL', 'wp-data-access' ) );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Write key value pair to array.\n\t\t\t\t\t\t\t\t$querystring .= \"&{$key}[{$j}]=\" . urlencode( $row_object[ $key ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$j ++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Export rows.\n\t\t\t\t\techo '\n\t\t\t\t\t\t<script type=\\'text/javascript\\'>\n\t\t\t\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\t\t\t\tjQuery(\"#stealth_mode\").attr(\"src\",\"' . $querystring . '\");\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t</script>\n\t\t\t\t\t';\n\t\t\t}\n\n\t\t}", "protected function prepareDeleteArticle(){\n $this->deleteComment();\n $this->deleteArticle();\n header('Location: index.php');\n }", "function delete_all()\n {\n $this->Admin_model->package = 'POSTS_PKG';\n $this->Admin_model->procedure = 'POST_DELETE';\n\n\n /*if ($_SERVER['REQUEST_METHOD'] == 'POST') {*/\n for ($i = 0; $i < count($this->p_delete); $i++) {\n $this->Admin_model->package = 'POSTS_PKG';\n $this->Admin_model->delete($this->p_delete[$i]);\n //Modules::run('admin/Post_Categories/delete', $this->p_delete[$i]);\n }\n\n /* } else {\n redirect('admin/Posts/display_cat');\n }\n redirect('admin/Posts/display_cat');*/\n }", "public function delete () {\n\t\tglobal $wpdb;\n\n\t\t$wpdb->query($wpdb->prepare(\"\n\t\tDELETE FROM $wpdb->postmeta WHERE meta_key='syndication_feed_id'\n\t\tAND meta_value = '%s'\n\t\t\", $this->id));\n\n\t\t$wpdb->query($wpdb->prepare(\"\n\t\tDELETE FROM $wpdb->links WHERE link_id = %d\n\t\t\", (int) $this->id));\n\n\t\t$this->id = NULL;\n\t}", "function delPostingHandler() {\n global $inputs;\n\n $sql = \"DELETE FROM `posting` WHERE id = \" . $inputs['id'];\n execSql($sql);\n\n formatOutput(true, 'delete success');\n}", "public function mf_delete_makers( $args, $assoc_args ) {\n\n\t\t$args = array(\n\t\t\t'posts_per_page' => 2000,\n\t\t\t'post_type' => 'maker',\n\t\t\t'post_status' => 'any',\n\n\t\t\t// Prevent new posts from affecting the order\n\t\t\t'orderby' => 'ID',\n\t\t\t'order' => 'ASC',\n\n\t\t\t// Speed this up\n\t\t\t'no_found_rows' => true,\n\t\t\t'update_post_meta_cache' => false,\n\t\t\t'update_post_term_cache' => false,\n\t\t);\n\n\t\t// Get the first set of posts\n\t\t$query = new WP_Query( $args );\n\n\t\twhile ( $query->have_posts() ) : $query->the_post();\n\t\t\n\t\t$title = get_the_title( get_the_ID() );\n\n\t\t$del = wp_delete_post( get_the_ID() );\n\n\t\tif ( $del ) {\n\t\t\tWP_CLI::success( 'Deleted ' . $title );\n\t\t} else {\n\t\t\tWP_CLI::warning( 'Failed to delete ' . $title );\n\t\t}\n\t\tendwhile;\n\t}", "protected function _postDelete()\n\t{\n\t}", "protected function afterDelete(&$obj) {\n\t\t$seo = $obj->handler->makelink($obj);\n\t\t$url = str_replace(ICMS_URL . '/', '', $obj->handler->_moduleUrl . $obj->handler->_itemname . '.php?content_id=' . $obj->getVar('content_id') . '&page=' . $seo);\n\t\t$module = icms::handler('icms_module')->getByDirname(basename(dirname(dirname(__FILE__))));\n\t\t$symlink_handler = icms_getModuleHandler('pages', 'system');\n\t\t$criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('page_url', $url));\n\t\t$criteria->add(new icms_db_criteria_Item('page_moduleid', $module->getVar('mid')));\n\t\t$symlink_handler->deleteAll($criteria);\n\n\t\treturn true;\n\t}", "function process_bulk_action() {\n global $catpdf_templates;\n if ('delete' === $this->current_action()) {\n if (count($_POST['template']) > 0) {\n foreach ($_POST['template'] as $template) {\n $catpdf_templates->delete_template($template);\n }\n }\n }\n }", "protected function afterDelete()\n\t{\n\t\tparent::afterDelete();\n\t\tComment::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tBookmark::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tHowtoCategory::model()->deleteAll( 'howto_id=' . $this->id );\n \t\tSlide::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tStep::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tHowtoTag::model()->deleteAll( 'howto_id=' . $this->id );\n\t}", "public function deleteList(){\n\n $posts=$this->articleDAO->getPosts();\n $this->view->adminRender ('delete_view', ['posts' =>$posts]);\n\n }", "function del($back) {\n\n\t\t$query_del = \"\n\t\tDELETE FROM \".$this->_getUserEntryTable().\"\n\t\tWHERE id_common = '\".(int)$this->id_common.\"'\";\n\t\t$re = sql_query($query_del);\n\t\t\n\t\tif(!$re) Util::jump_to($back.'&result=fail_del');\n\n\t\t$query_del = \"\n\t\tDELETE FROM \".$this->_getMainTable().\"\n\t\tWHERE id_common = '\".(int)$this->id_common.\"'\";\n\t\t$re = sql_query($query_del);\n\t\t\n\n\t\tUtil::jump_to($back.'&result='.( $re ? 'success' : 'fail_del'));\n\t}", "public function delete($entry_id)\n {\n if ( !$this->is_installed())\n {\n return;\n }\n\n $qry = ee()->db->select('id, site_pages')\n ->where('site_id', ee()->publisher_lib->site_id)\n ->get('publisher_site_pages');\n\n foreach ($qry->result() as $row)\n {\n if ($row->site_pages != '')\n {\n $site_pages = json_decode($row->site_pages, TRUE);\n\n foreach ($site_pages as $site_id => $pages)\n {\n unset($site_pages[$site_id]['uris'][$entry_id]);\n unset($site_pages[$site_id]['templates'][$entry_id]);\n }\n\n $data = array(\n 'site_pages' => $this->json_encode_pages($site_pages)\n );\n\n $where = array(\n 'id' => $row->id\n );\n\n $this->insert_or_update('publisher_site_pages', $data, $where);\n }\n }\n }", "public function view() {\n\t\t\tif ($_SERVER['REQUEST_METHOD'] != 'POST') {\n\t\t\t\t$this->_Result['status'] = Page::HTTP_STATUS_BAD_REQUEST;\n\t\t\t\t$this->_Result['error'] = __('This page accepts posts only');\n\t\t\t\t$this->setHttpStatus($this->_Result['status']);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// _context[0] => entry id to delete\n\t\t\t// _context[1] => fieldId\n\t\t\t// _context[2] => current entry id (parent of entry id to delete)\n\t\t\tif (!is_array($this->_context) || empty($this->_context)) {\n\t\t\t\t$this->_Result['error'] = __('Parameters not found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (count($this->_context) < self::NUMBER_OF_URL_PARAMETERS) {\n\t\t\t\t$this->_Result['error'] = __('Not enough parameters');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (count($this->_context) > self::NUMBER_OF_URL_PARAMETERS) {\n\t\t\t\t$this->_Result['error'] = __('Too many parameters');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate to delete entry ID\n\t\t\t$rawToDeleteEntryId = MySQL::cleanValue($this->_context[0]);\n\t\t\t$toDeleteEntryId = General::intval($rawToDeleteEntryId);\n\t\t\tif ($toDeleteEntryId < 1) {\n\t\t\t\t$this->_Result['error'] = __('No entry no found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate parent field exists\n\t\t\t$parentFieldId = General::intval(MySQL::cleanValue($this->_context[1]));\n\t\t\tif ($parentFieldId < 1) {\n\t\t\t\t$this->_Result['error'] = __('Parent id not valid');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$parentField = FieldManager::fetch($parentFieldId);\n\t\t\tif (!$parentField || empty($parentField)) {\n\t\t\t\t$this->_Result['error'] = __('Parent field not found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate parent entry ID\n\t\t\t$rawEntryId = MySQL::cleanValue($this->_context[2]);\n\t\t\t$entryId = General::intval($rawEntryId);\n\t\t\tif ($entryId < 1) {\n\t\t\t\t$this->_Result['error'] = sprintf(\n\t\t\t\t\t__('Parent entry id `%s` not valid'),\n\t\t\t\t\t$rawEntryId\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate parent entry exists\n\t\t\t$entry = EntryManager::fetch($entryId);\n\t\t\tif ($entry == null || count($entry) != 1) {\n\t\t\t\t$this->_Result['error'] = __('Parent entry not found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (is_array($entry)) {\n\t\t\t\t$entry = $entry[0];\n\t\t\t}\n\t\t\tif ($entry->get('section_id') != $parentField->get('parent_section')) {\n\t\t\t\t$this->_Result['error'] = __('Field and entry do not belong together');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate to delete entry exists\n\t\t\t$toDeleteEntry = EntryManager::fetch($toDeleteEntryId);\n\t\t\tif ($toDeleteEntry == null || count($toDeleteEntry) != 1) {\n\t\t\t\t$this->_Result['error'] = __('Entry not found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (is_array($toDeleteEntry)) {\n\t\t\t\t$toDeleteEntry = $toDeleteEntry[0];\n\t\t\t}\n\t\t\t\n\t\t\t// Validate entry is not linked anywhere else\n\t\t\tif (!isset($_REQUEST['no-assoc'])) {\n\t\t\t\t//$toDeleteSection = SectionManager::fetch($toDeleteEntry->get('section_id'));\n\t\t\t\t//$toDeleteAssoc = $toDeleteSection->fetchChildAssociations(false);\n\t\t\t\t$toDeleteAssoc = SectionManager::fetchChildAssociations($toDeleteEntry->get('section_id'), false);\n\t\t\t\t//var_dump($toDeleteAssoc);die;\n\t\t\t\t// TODO: find if the toDeleteEntry is linked or not.\n\t\t\t\tif (count($toDeleteAssoc) > 1) {\n\t\t\t\t\t$this->_Result['assoc'] = true;\n\t\t\t\t\t$this->_Result['error'] = __('Entry might be link elsewhere. Do you want to continue?');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Delete the entry\n\t\t\tif (!EntryManager::delete($toDeleteEntryId)) {\n\t\t\t\t$this->_Result['error'] = __('Could not delete the entry');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t$this->_Result['entry-id'] = $entryId;\n\t\t\t$this->_Result['ok'] = true;\n\t\t}", "public function multiDeleteMemberAction() {\n\n if ($this->getRequest()->isPost()) {\n\n $values = $this->getRequest()->getPost();\n\n foreach ($values as $key => $value) {\n if ($key == 'delete_' . $value) {\n $sitepageitemofthedays = Engine_Api::_()->getItem('sitepage_itemofthedays', (int) $value);\n if (!empty($sitepageitemofthedays)) {\n $sitepageitemofthedays->delete();\n }\n }\n }\n }\n return $this->_helper->redirector->gotoRoute(array('action' => 'index'));\n }", "public function remove_leads()\n {\n global $wpdb;\n $leads_to_delete = implode(',', $_POST['delete_lead']);\n\n // Update the prospect data\n $wpdb->query($wpdb->prepare(\n 'DELETE FROM `' . $this->table_name . '`\n\t\t\t WHERE `id` IN (' . $leads_to_delete . ')'\n ));\n\n wp_redirect(admin_url('edit.php?post_type=' . $this->token . '&page=' . $this->token . '_leads&deleted=true'));\n die();\n }", "public function deleteAction() {\n\t\t$redirect_url = Minz_Request::param('r', false, true);\n\t\tif (!$redirect_url) {\n\t\t\t$redirect_url = array('c' => 'subscription', 'a' => 'index');\n\t\t}\n\t\tif (!Minz_Request::isPost()) {\n\t\t\tMinz_Request::forward($redirect_url, true);\n\t\t}\n\n\t\t$id = Minz_Request::param('id');\n\n\t\tif (self::deleteFeed($id)) {\n\t\t\tMinz_Request::good(_t('feedback.sub.feed.deleted'), $redirect_url);\n\t\t} else {\n\t\t\tMinz_Request::bad(_t('feedback.sub.feed.error'), $redirect_url);\n\t\t}\n\t}", "public function execute()\n {\n try {\n $collection = $this->filter->getCollection($this->collectionFactory->create());\n $collectionSize = $collection->getSize();\n foreach ($collection as $item) {\n $item->delete();\n }\n $this->messageManager->addSuccessMessage(__(\n 'A total of %1 element(s) have been deleted.',\n $collectionSize\n ));\n\n /** @var \\Magento\\Backend\\Model\\View\\Result\\Redirect $resultRedirect */\n $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);\n return $resultRedirect->setPath('*/*/');\n } catch (\\Exception $e) {\n $this->messageManager->addErrorMessage($e->getMessage());\n /** @var \\Magento\\Backend\\Model\\View\\Result\\Redirect $resultRedirect */\n $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);\n return $resultRedirect->setPath($this->redirectUrl);\n }\n }", "public function deleteAction() {\n\t\t\t$this->_forward('index');\n\t\t}", "public function cleanAction()\n {\n set_time_limit(0);\n\n if (!$this->_getParam('id')) throw new Kwf_Exception_Client(\"required parameter --id\");\n $db = Zend_Registry::get('db');\n $tables = array();\n foreach ($db->query(\"SHOW TABLES\")->fetchAll() as $table) {\n $table = array_values($table);\n $table = $table[0];\n $hasComponentId = false;\n if ($table == 'kwf_pages') {\n $tables[] = $table;\n } else {\n foreach ($db->query(\"SHOW FIELDS FROM $table\")->fetchAll() as $field) {\n if ($field['Field'] == 'component_id') {\n $tables[] = $table;\n }\n }\n }\n }\n\n $ids = $this->_getChildIds($this->_getParam('id'));\n array_unshift($ids, $this->_getParam('id'));\n foreach ($ids as $id) {\n foreach ($tables as $table) {\n if ($table == 'kwf_pages') {\n $column = 'id';\n } else {\n $column = 'component_id';\n }\n $sql = \"DELETE FROM $table \".\n \"WHERE $column='$id' \".\n \"OR $column LIKE '\".str_replace('_', '\\_', $id).\"\\_%' \".\n \"OR $column LIKE '\".str_replace('_', '\\_', $id).\"-%'\";\n echo $sql.\"\\n\";\n //echo \".\";\n if ($this->_getParam('force')) $db->query($sql);\n }\n }\n if (!$this->_getParam('force')) echo \"\\nadd parameter --force to actually execute queries\\n\";\n exit;\n }", "public function multiDeleteAction() {\n if ($this->getRequest()->isPost()) {\n $values = $this->getRequest()->getPost();\n foreach ($values as $key => $value) {\n if ($key == 'delete_' . $value) {\n //DELETE OFFERS FROM DATABASE AND SCRIBD\n $offer_id = (int) $value;\n\t\t\t\t\tEngine_Api::_()->sitestoreoffer()->deleteContent($offer_id);\n }\n }\n }\n return $this->_helper->redirector->gotoRoute(array('action' => 'index'));\n }", "function deleteAll($store, $folderentryid, $action){\n\t\t\t$entrylist = Array();\n\t\t\t$folder = mapi_msgstore_openentry($store, $folderentryid);\n\t\t\t$table = mapi_folder_getcontentstable($folder, SHOW_SOFT_DELETES);\n\t\t\t$rows = mapi_table_queryallrows($table, array(PR_ENTRYID));\n\t\t\tfor($i=0;$i<count($rows);$i++){\n\t\t\t\tarray_push($entrylist, $rows[$i][PR_ENTRYID]);\n\t\t\t}\n\t\t\tmapi_folder_deletemessages($folder, $entrylist, DELETE_HARD_DELETE);\n\t\t\t$result = (mapi_last_hresult()==NOERROR);\n\n\t\t\treturn $result;\n\t\t}", "public static function batchDeleteEntries() {\n global $_module;\n\n $result = lC_Product_variants_Admin::batchDeleteEntries($_GET['batch'], $_GET[$_module]);\n if (isset($result['namesString']) && $result['namesString'] != null) {\n } else {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }", "public function delete_page_links() {\n\t\t\t$this->linked_postid = '';\n\t\t\t$this->pages_url = '';\n\t\t\t$this->MakePersistent();\n\n\t\t}", "protected function _delete()\r\n\t{\r\n\t\t$oFlexSliderSlider = new FlexSliderSlider($this -> _iId);\r\n\t\t$mStatus = $oFlexSliderSlider -> delete();\r\n\t\t//$this -> _removeSlides($this -> _iId);\r\n\t\t$this -> _aRedirect['id'] = false;\r\n\t\t$this -> _aRedirect['action'] = false;\r\n\t\t\t\r\n\t\tif (is_string($mStatus))\r\n\t\t{\r\n\t\t\t$this -> _aRedirect['message'] = $mStatus;\r\n\t\t}\r\n\t\telse if ($mStatus === true)\r\n\t\t{\r\n\t\t\t$this -> _aRedirect['message'] = 'removed';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this -> _aRedirect['message'] = 'error';\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function delete_entries_loop($child_id, $weblog_id)\n\t{\n\t\tglobal $DB;\n\n\t\tif (isset($this->cache['mourning_parents'][$child_id]))\n\t\t{\n\t\t\t$playa_fields = $this->_get_fields();\n\n\t\t\tforeach($this->cache['mourning_parents'][$child_id] as $parent)\n\t\t\t{\n\t\t\t\t$lines = array_filter(preg_split(\"/[\\r\\n]+/\", $parent['field_data']));\n\t\t\t\t$new_lines = array();\n\t\t\t\tforeach($lines as $line)\n\t\t\t\t{\n\t\t\t\t\tif ( ! $this->_check_for_playa_rel($line, $parent['rel_id']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$new_lines[] = $line;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$DB->query('UPDATE exp_weblog_data\n\t\t\t\t SET '.$parent['field_name'].' = \"'.implode('\\r', $new_lines).'\"\n\t\t\t\t WHERE entry_id = '.$parent['parent_id']);\n\t\t\t}\n\t\t}\n\t}", "public function delete() {\n\t\t$cart = D('ShoppingCart');\n\t\t$ret = true;\n\t\t// get good_id to delete from the POSTed array\n\t\tforeach ($_POST['good_ids'] as $good_id) {\n\t\t\t// delete each good\n\t\t\t$ret &= $cart->where('user_id = '.$this->_session('uid').' AND good_id = '.$good_id)->delete();\n\t\t}\n\t\t// return hint, show index page\n\t\t// echo 1;\n\t\t$this->redirect('ShoppingCart/index');\n\t}", "public function delete() {\n\t\t$query = new WP_Query( array(\n\t\t\t'name' => $this->params['post_name'],\n\t\t\t'post_type' => $this->params['post_type']\n\t\t) );\n\n\t\t$post = array_shift( $query->posts );\n\n\t\t// die('<pre>'.var_export($post,true).'</pre>');\n\n\t\tif ( $post ) {\n\t\t\t$current_action = $this->get_current_action();\n\t\t\t$this->action_results[ 'status' ] = 'success';\n\t\t\t$this->action_results[ 'messages' ][ $post->post_type ][ $post->ID ][ 'note' ] = __( 'The information has been deleted', 'kickpress' );\n\t\t\t$this->action_results[ 'data' ][ 'post_id' ] = $post->ID;\n\n\t\t\twp_trash_post( $post->ID );\n\t\t}\n\t}", "public function beforeDelete()\n\t{\n\t\t foreach ($this->towns as $towns){\n\t\t \t$towns->delete();\n\t\t }\n\t}", "public function destroy()\n\t{\n\t\t$ids = \\Input::get('id');\n\t\tforeach ($ids as $id) {\n\t\t\t$category = Category::find($id);\n\t\t\tif (!$category)\n\t\t\t\tcontinue;\n// foreach ($category->pages as $page) {\n// if ($page->is_home) {\n// \\Session::flash('manager_error_message', \\Lang::get('manager.messages.menu_containing_home_page_cant_be_removed'));\n// return \\Redirect::back();\n// }\n// }\n\t\t\t$category->removeImage('image');\n\t\t\t$category->removeImage('image_desc');\n\t\t\tCategory::destroy($id);\n\t\t}\n\t\t\\Session::flash('manager_success_message', \\Lang::get('manager.messages.entities_deleted'));\n\t\treturn \\Redirect::back();\n\t}", "function deleteActorsPosts()\n{\n deleteActorsPostsInDb();\n header('Location: index.php?controller=adminhome');\n}", "function delete() {\n\t\tglobal $DB_LINK, $db_table_recipes, $db_table_list_recipes, $db_table_related_recipes, $db_table_ingredientmaps, $db_table_reviews,\n\t\t\t$db_table_ratings, $db_table_mealplans, $db_table_favorites;\n\n\t\t$sql = \"DELETE from $db_table_recipes WHERE recipe_id=?\";\n\t\t$stmt = $DB_LINK->Prepare($sql);\n\t\t$rc = $DB_LINK->Execute($stmt, array($this->id));\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\n\t\t$sql = \"DELETE from $db_table_list_recipes WHERE list_rp_recipe=?\";\n\t\t$stmt = $DB_LINK->Prepare($sql);\n\t\t$rc = $DB_LINK->Execute($stmt, array($this->id));\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\n\t\t$sql = \"DELETE from $db_table_related_recipes WHERE related_parent=?\";\n\t\t$stmt = $DB_LINK->Prepare($sql);\n\t\t$rc = $DB_LINK->Execute($stmt, array($this->id));\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\n\t\t$sql = \"DELETE from $db_table_ingredientmaps WHERE map_recipe=?\";\n\t\t$stmt = $DB_LINK->Prepare($sql);\n\t\t$rc = $DB_LINK->Execute($stmt, array($this->id));\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\n\t\t$sql = \"DELETE from $db_table_reviews WHERE review_recipe=?\";\n\t\t$stmt = $DB_LINK->Prepare($sql);\n\t\t$rc = $DB_LINK->Execute($stmt, array($this->id));\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\n\t\t$sql = \"DELETE from $db_table_ratings WHERE rating_recipe=?\";\n\t\t$stmt = $DB_LINK->Prepare($sql);\n\t\t$rc = $DB_LINK->Execute($stmt, array($this->id));\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\n\t\t$sql = \"DELETE from $db_table_mealplans WHERE mplan_recipe=?\";\n\t\t$stmt = $DB_LINK->Prepare($sql);\n\t\t$rc = $DB_LINK->Execute($stmt, array($this->id));\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\n\t\t$sql = \"DELETE from $db_table_favorites WHERE favorite_recipe=?\";\n\t\t$stmt = $DB_LINK->Prepare($sql);\n\t\t$rc = $DB_LINK->Execute($stmt, array($this->id));\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\t}", "public function massDeleteAction()\n {\n $faqIds = $this->getRequest()->getParam('faqs');\n if (!is_array($faqIds)) {\n Mage::getSingleton('adminhtml/session')->addError($this->__('Please select FAQ\\'s.'));\n } else {\n try {\n foreach ($faqIds as $faqId) {\n $faq = Mage::getModel('ecomitizetest/faqs')->load($faqId);\n $faq->delete();\n }\n Mage::getSingleton('adminhtml/session')->addSuccess(\n $this->__('Total of %d record(s) have been deleted.', count($faqIds))\n );\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n }\n }\n\n $this->_redirect('*/*/' . $this->getRequest()->getParam('ret', 'index'));\n }", "public function emptytrash() {\n $pages = Page::onlyTrashed()->get(); \n foreach($pages as $page) {\n $page->slug->delete();\n $page->forceDelete();\n }\n return redirect()->route('admin.pages.trash');\n }", "public function deleteAction() {\n\t\t\t\t\t\tif (! $this->CheckTransactionUser ()) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tZend_Session::start ();\n\t\t\t\t\t\t\t\t$this->redirectToIndex();\n\t\t\t\t\t\t\t} catch ( Zend_Session_Exception $e ) {\n\t\t\t\t\t\t\t\techo \"Message:\" . $e->getMessage ();\n\t\t\t\t\t\t\t\tsession_start ();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t$lan = $this->_getParam ( 'lang' );\n\t\t\t\t\t\t\t\t$id = $this->_getParam ( 'id' );\n $actions= $this->_getParam ( 'actions' );\n //$this->getRequest ()->getPost ( 'process' )==1\n \n\t\t\t\t\t\t\t\tif ( $actions=='delete') {\n\t\t\t\t\t\t\t\t\t$this->unlinkImageFolder ( $id );\n\t\t\t\t\t\t\t\t\t$id = $this->_getParam ( 'id' );\n\t\t\t\t\t\t\t\t\t$deleteOrganizms = $this->GetModelOrganize->deleteAllDataFromOrganismeMenu($id);\n\t\t\t\t\t\t\t\t\t\t\tif ($deleteOrganizms) {\n\t\t\t\t\t\t\t\t\t\t\t\t$lan = $this->_getParam ( 'lang' );\n\t\t\t\t\t\t\t\t\t\t\t\t$this->_redirect ( $lan . '/organisme/index?success=delete' );\n\t\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/* In cases of multiple delete */\n\t\t\t\t\t\t\t\tif ($this->getRequest ()->getPost ( \"BtnDelOrg\" )) {\n\t\t\t\t\t\t\t\t\tif ($this->getRequest ()->getPost ( \"multiAction\" ) == \"Delete\") {\n\t\t\t\t\t\t\t\t\t\t$idOrganisme = $this->getRequest ()->getPost ( \"checkRow\" );\n\t\t\t\t\t\t\t\t\t\t$lan = $this->_getParam ( 'lang' );\n\t\t\t\t\t\t\t\t\t\tfor($i = 0; $i < count ( $idOrganisme ); $i ++) {\n\t\t\t\t\t\t\t\t\t\t\t$id = $idOrganisme [$i];\n\t\t\t\t\t\t\t\t\t\t\t$this->unlinkImageFolder ( $id );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$this->deletemulti ();\n\t\t\t\t\t\t\t\t\t\t$this->_redirect ( $lan . '/Organisme/index?success=delete' );\n\t\t\t\t\t\t\t\t\t\texit ();\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$lan = $this->_getParam ( 'lang' );\n\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<script type=\"text/javascript\">\n\t\t\t\t function seleteDel(){\n\t\t\t\t alert(\"Please select on item to delete!\");\n\t\t\t\t return false;\n\t\t\t\t }\n\t\t\t\t seleteDel();\n </script>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t// $this->_redirect ( $lan\n\t\t\t\t\t\t\t\t\t// .'/Organisme/index/' );\n\t\t\t\t\t\t\t\t\t\t// exit();\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} catch ( ErrorException $exerr ) {\n\t\t\t\t\t\t\t\techo \"Messsage\" . $exerr->getMessage ();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "public function destroyMultiplePages()\n {\n\n try {\n $input = $this->request->all();\n\n if(isset($input['ids']))\n {\n\n $ids = array_filter($input['ids']);\n $this->page->bulkDeletions( $ids );\n return $this->cmsResponse('Successfully deleted all pages.');\n }\n return $this->cmsResponse('Failed to delete page(s).',400);\n\n } catch (SystemError $e) {\n return $this->cmsResponse($e->getMessage(),400);\n } catch (\\Exception $e) {\n return $this->cmsResponse($e->getMessage(),400);\n }\n }", "public function process_bulk_action() {\r\n\t\t$page_url = menu_page_url( 'ac-wp-list-table', false );\r\n\r\n\t\t//Detect when a bulk action is being triggered...\r\n\t\tif ( 'delete' === $this->current_action() ) {\r\n\t\t\t// In our file that handles the request, verify the nonce.\r\n\t\t\t$nonce = esc_attr( $_REQUEST['_wpnonce'] );\r\n\r\n\t\t\tif ( ! wp_verify_nonce( $nonce, 'ac_delete_customer' ) ) {\r\n\t\t\t\tdie( 'Go get a life script kiddies' );\r\n\t\t\t} else {\r\n\t\t\t\tself::delete_customer( absint( $_GET['id'] ) );\r\n\r\n\t\t\t\t// Redirect\r\n\t\t\t\t$query = array( 'message' => 'deleted');\r\n\t\t\t\t$redirect_to = add_query_arg( $query, $page_url );\r\n\t\t\t\twp_redirect( $redirect_to );\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// If the delete bulk action is triggered\r\n\t\tif ( ( isset( $_POST['action'] ) && $_POST['action'] == 'bulk-delete' )\r\n\t\t || ( isset( $_POST['action2'] ) && $_POST['action2'] == 'bulk-delete' )\r\n\t\t) {\r\n\t\t\t$delete_ids = esc_sql( $_POST['bulk-delete'] );\r\n\r\n\t\t\t// loop over the array of record ids and delete them\r\n\t\t\tforeach ( $delete_ids as $id ) {\r\n\t\t\t\tself::delete_customer( $id );\r\n\t\t\t}\r\n\r\n\t\t\t// Redirect\r\n\t\t\t$query = array( 'message' => 'deleted');\r\n\t\t\t$redirect_to = add_query_arg( $query, $page_url );\r\n\t\t\twp_redirect( $redirect_to );\r\n\t\t\texit;\r\n\t\t}\r\n\t}", "public function process_bulk_action() {\n\t\tif ( 'delete' === $this->current_action() ) {\n\n\t\t\t// In our file that handles the request, verify the nonce.\n\t\t\t$nonce = esc_attr( $_REQUEST['_wpnonce'] );\n\n\t\t\tif ( ! wp_verify_nonce( $nonce, 'sp_delete_post' ) ) {\n\t\t\t\tdie( 'Go get a life script kiddies' );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($_GET['post']) {\n\t\t\t\t\tself::delete_post( absint( $_GET['post'] ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t// If the delete bulk action is triggered\n\t\tif ( isset($_POST['bulk-delete']) && ( isset( $_POST['action'] ) && $_POST['action'] == 'bulk-delete' )\n\t\t || ( isset( $_POST['action2'] ) && $_POST['action2'] == 'bulk-delete' )\n\t\t) {\n\t\t\t$delete_ids = esc_sql( $_POST['bulk-delete'] );\n\n\t\t\t// loop over the array of record IDs and delete them\n\t\t\tforeach ( $delete_ids as $id ) {\n\t\t\t\tself::delete_post( $id );\n\n\t\t\t}\n\t\t}\n\t}", "public function deleteAction(){\n\t\t$recipe = new Recipe();\n\t\t\n\t\t$filter = new Zend_Filter_StripTags();\n\t\t$id = trim($filter->filter($this->_request->getQuery('id')));\n\t\tif($id != null){\n\t\t\t$where = array($recipe->getAdapter()->quoteInto('recipe_id = ?', $id),\n\t\t\t\t\t\t$recipe->getAdapter()->quoteInto('user_id = ?', $this->session->user_id)\t\t\t\t\n\t\t\t);\n\t\t\t$row = $recipe->fetchRow($where);\n\t\t\n\t\t\t//mark recipe as deleted\n\t\t\t$row->status = 'D';\n\t\t\t$row->save();\n\t\t\n\t\t}\n\t\n\t\t//if successful, redirect to main page\n\t\t$this->_redirect($this->baseUrl.'/main');\n\t\treturn;\n }", "public function delete()\n {\n $post['id'] = $this->request->getParameter('id'); // récupérer le paramètre de l'ID\n $this->post->deletePost($post['id']);\n $this->redirect(\"admin\", \"chapters\"); // une fois le post supprimé, je redirige vers la vue chapters\n }", "function deleteEntry(&$request, $rowId) {\n\t\tif ($rowId) {\n\t\t\t$categoryDao =& DAORegistry::getDAO('CategoryDAO');\n\t\t\t$monographDao =& DAORegistry::getDAO('MonographDAO');\n\t\t\t$category =& $categoryDao->getById($rowId);\n\t\t\tif (!is_a($category, 'Category')) {\n\t\t\t\tassert(false);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$monograph =& $this->getMonograph();\n\t\t\t$monographDao->removeCategory($monograph->getId(), $rowId);\n\t\t}\n\n\t\treturn true;\n\t}", "function deleteItems($store, $folderentryid, $entryidlist, $action){\n\t\t\t$binEntryIdList = Array();\n\n\t\t\tforeach($entryidlist as $key => $value){\n\t\t\t\t$binEntryIdList[] = hex2bin($entryidlist[$key][\"entryid\"]);\n\t\t\t}\n\t\t\t\n\t\t\t$sfolder = mapi_msgstore_openentry($store, $folderentryid);\n\t\t\tmapi_folder_deletemessages($sfolder, $binEntryIdList, DELETE_HARD_DELETE);\n\t\t\t$result = (mapi_last_hresult()==NOERROR);\n\n\t\t\treturn $result;\n\t\t}", "protected function afterDelete()\r\n {\r\n }", "public function onAfterDelete() {\n parent::onAfterDelete();\n\n foreach ($this->Items() as $item) {\n $item->delete();\n }\n }", "protected function _postDelete()\n {\n $this->clearResources();\n }", "function deleteSubmission(&$args, &$request) {\n\t\t//FIXME: Implement\n\n\t\treturn false;\n\t}", "public function delete($_id)\n {\n\t $this->load->driver('Streams');\n\t $this->streams->entries->delete_entry($_id, 'energieausweis', 'streams');\n\n\t redirect($this->router->fetch_module() . '/' .$this->uri->rsegment(1));\n }", "function product_category_delete(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u;\n\t\t\n\t\tmysql_q(\"DELETE FROM product_category WHERE id='\".add_slash($_r['id']).\"'\");\n\n\t\tredirect(\"product_category.htm\", \"\");\n\t}", "public function deleteEntries(){\r\n\t\t global $xname;\r\n\t\t \r\n\t\t \r\n\t\t // First we get an array of the XML property xml_id's\r\n\t\t $xmlIdXmlArray = array();\r\n\t\t foreach ($this->xml->property as $vivienda){\r\n\t\t\t $xmlIdXmlArray[] = (string) $vivienda->id;\r\n\t\t }\r\n\t\t \r\n\t\t $databaseIdXmlQuery = \"SELECT id_xml FROM {$xname}_viviendas WHERE agente = '{$this->agent}'\";\r\n\t\t $databaseIdSql\t = $this->query($databaseIdXmlQuery);\r\n\t\t $databaseIdXmlArray = array();\r\n\t\t while ($databaseIdXml = $databaseIdSql->fetch_row()) {\r\n\t\t\t $databaseIdXmlArray[]\t= $databaseIdXml[0];\r\n\t\t\t \r\n\t\t }\r\n\t\t\t\r\n\t\t // And we check to see if the database entry is in the XML file, if not, we delete it\r\n\t\t foreach ($databaseIdXmlArray as $databaseIdXml){\r\n\t\t\t if (!in_array($databaseIdXml,$xmlIdXmlArray)) {\r\n\t\t\t\t $this->log->write(Logger::WARNING,'Deleting: '.$databaseIdXml);\r\n\t\t\t\t // Delete entry\r\n\t\t\t\t $deleteQuery = \"DELETE FROM {$xname}_viviendas WHERE id_xml = '{$databaseIdXml}'\";\r\n\t\t\t\t $this->query($deleteQuery);\r\n\t\t\t }\r\n\t\t }\r\n\t\t \r\n\t\t \r\n\t }", "function rp_deaktivierungs_hooks() {\n // -----------------------------------------------\n $spielerSeiteId = get_option('rp_results_parser_einstellungen_data')['spielerSeiteId'];\n $alleSpielerSeiteId = get_option('rp_results_parser_einstellungen_data')['alleSpielerSeiteId'];\n wp_delete_post($spielerSeiteId, true);\n wp_delete_post($alleSpielerSeiteId, true);\n\n\n // Loesche Tabellen rp_spieler_daten und rp_mannschaften_daten\n // -----------------------------------------------------------\n global $wpdb;\n $table = $wpdb->prefix . \"rp_spieler_daten\";\n $wpdb->query(\"DROP TABLE IF EXISTS $table\");\n\n $table = $wpdb->prefix . \"rp_mannschaften_daten\";\n $wpdb->query(\"DROP TABLE IF EXISTS $table\");\n\n\n // Loesche alle rp_spieler Posts\n // -----------------------------\n $posts_table = $wpdb->posts;\n $query = \"DELETE FROM {$posts_table} WHERE post_type = 'rp_spieler'\";\n $wpdb->query($query);\n\n\n // Loesche Taxnomoy-Term Relationen, rp_spieler_mannschaft Terms\n // und rp_spieler_mannschaft Taxonomy- TODO\n // -------------------------------------------------------------\n $terms = get_terms('rp_spieler_mannschaft', array('fields' => 'ids', 'hide_empty' => false));\n foreach ($terms as $value) {\n wp_delete_term($value, 'rp_spieler_mannschaft');\n }\n\n $wpdb->delete($wpdb->term_taxonomy, array('taxonomy' => 'rp_spieler_mannschaft'));\n\n\n // Loesche Einstellungen bei wp_options rp_results_parser_einstellungen\n // --------------------------------------------------------------------\n delete_option('rp_results_parser_einstellungen_data');\n}", "function CleanUp () {\n global $zOLDAPPLE;\n\n $criteria = array (\"groupInformation_tID\" => $this->tID,\n \"Body\" => DELETED_GROUP_ENTRY);\n $this->groupContent->SelectByMultiple ($criteria);\n\n // Break out if no deleted posts left. \n if ($this->groupContent->CountResult() == 0) return (TRUE);\n\n while ($this->groupContent->FetchArray ()) {\n $CHILDREN = new cGROUPCONTENT ();\n $childcriteria = array (\"parent_tID\" => $this->groupContent->tID,\n \"groupInformation_tID\" => $this->tID,\n \"Context\" => $zOLDAPPLE->Context);\n $CHILDREN->SelectByMultiple ($childcriteria);\n\n // If no children, delete.\n if ($CHILDREN->CountResult () == 0) {\n $this->groupContent->Delete ();\n $this->CleanUp ();\n } // if\n unset ($CHILDREN);\n } // while\n }", "function AfterDelete($where, &$deleted_values, &$message, &$pageObject)\n{\n\n\t\t$delete_jobfile_sql = \"DELETE FROM jobfile WHERE \".$where;\n//unlink($_SESSION[\"output_dir\"].\"\\\\test_alex\\\\\");\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n;\t\t\n}", "public function deletepurgeAction($days)\n {\n $purge = $this->get('oc_platform.advert_purger');\n /* $old_adverts = $purge->purge($days, $advertswithapplication);*/\n $purge->purge($days);\n /* foreach($old_adverts as $old_advert)\n {\n $em = $this->getdoctrine()->getManager();\n $em->remove($old_advert);\n $em->flush();\n }*/\n return $this->redirect($this->generateUrl('oc_platform_home'));\n }", "function delete_by_hits () {\n\t\tif (intval($_POST[\"hits\"])){\n\t\t\t// Do delete record\n\t\t\tdb()->query(\"DELETE FROM \".db('search_keywords').\" WHERE hits<\".intval($_POST[\"hits\"]));\n\t\t}\n\t\treturn js_redirect($_SERVER[\"HTTP_REFERER\"]);\n\t}", "public function delete(){\r\n\t\tif(!$this->input->is_ajax_request()) show_404();\r\n\r\n\t\t//$this->auth->set_access('delete');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\tif($this->input->post('ang_id') === NULL) ajax_response();\r\n\r\n\t\t$all_deleted = array();\r\n\t\tforeach($this->input->post('ang_id') as $row){\r\n\t\t\t//$row = uintval($row);\r\n\t\t\t//permanent delete row, check MY_Model, you can set flag with ->update_single_column\r\n\t\t\t$this->m_anggota->permanent_delete($row);\r\n\r\n\t\t\t//this is sample code if you cannot delete, but you must update status\r\n\t\t\t//$this->m_anggota->update_single_column('ang_deleted', 1, $row);\r\n\t\t\t$all_deleted[] = $row;\r\n\t\t}\r\n\t\twrite_log('anggota', 'delete', 'PK = ' . implode(\",\", $all_deleted));\r\n\r\n\t\tajax_response();\r\n\t}", "function process_bulk_action()\n {\n global $wpdb;\n $table_name = $wpdb->prefix . 'google_location_form'; // do not forget about tables prefix\n\n if ('delete' === $this->current_action()) {\n $ids = isset($_REQUEST['id']) ? $_REQUEST['id'] : array();\n if (is_array($ids)) $ids = implode(',', $ids);\n\n if (!empty($ids)) {\n $wpdb->query(\"DELETE FROM $table_name WHERE id IN($ids)\");\n }\n }\n }", "public function actionDelete(){\n\t\t$form = $_POST;\n\t\t$db = $this->context->getService('database');\n\t\t$db->exec('DELETE FROM core_pages WHERE id = ?', $form['id']);\n\t\t$this->redirect('pages:');\n\t}", "public function delete() {\n // we expect a url of form ?controller=posts&action=delete&id=x\n // without an id we just redirect to the error page as we need the post id to find it in the database\n if (!isset($_GET['id']))\n return call('pages', 'error');\n\n // we use the given id to get the right post and delete from the database\n $post = Post::delete($_GET['id']);\n require_once('view/posts/delete.php');\n }", "public function delete() {\r\n $page = $this->api->getParam('page', '1');\r\n $this->model->id = $_REQUEST['id'];\r\n $this->checkOwner();\r\n $message = 'Cannot Be Deleted';\r\n if ($this->model->delete()) {\r\n $message = 'Deleted Successfully';\r\n }\r\n $this->api->redirect('contact/home?message=' . $message . '&page=' . $page);\r\n }", "public function delete()\n {\n if(!isset($_SESSION['login']) || $_SESSION['login'] != 'admin123') {\n return redirect('page-not-found');\n }\n $this->task->delete($_GET['id']);\n\n return redirect('');\n }", "public function processDeletePlaceholder() {}", "function thumbwhere_contentcollectionitem_delete_form_submit($form, &$form_state) {\n $thumbwhere_contentcollectionitem = $form_state['thumbwhere_contentcollectionitem'];\n\n thumbwhere_contentcollectionitem_delete($thumbwhere_contentcollectionitem);\n\n drupal_set_message(t('The thumbwhere_contentcollectionitem %name has been deleted.', array('%name' => $thumbwhere_contentcollectionitem->pk_contentcollectionitem)));\n watchdog('thumbwhere_contentcollectionitem', 'Deleted thumbwhere_contentcollectionitem %name.', array('%name' => $thumbwhere_contentcollectionitem->pk_contentcollectionitem));\n\n $form_state['redirect'] = 'admin/thumbwhere/thumbwhere_contentcollectionitems';\n}", "function delete( )\n {\n $this->dbInit();\n $this->Database->query( \"DELETE FROM eZLink_Hit WHERE Link='$this->ID'\" ); \n $this->Database->query( \"DELETE FROM eZLink_Link WHERE ID='$this->ID'\" );\n }", "public function process_bulk_action() {\n\n\t\tif ( 'delete' === $this->current_action() ) {\n\n\t\t\t// In our file that handles the request, verify the nonce.\n\t\t\t$nonce = esc_attr( $_REQUEST['_wpnonce'] );\n\t\t\t\n\t\t\tif ( ! wp_verify_nonce( $nonce, 'sp_delete_customer' ) ) {\n\t\t\t\t// die( 'Go get a life script kiddies' );\n\t\t\t\t// require dirname(__FILE__).\"/functions/delete_site.php\";\n\t\t\t\techo(\"Deleted Successfully!\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tself::delete_customer( absint( $_GET['customer'] ) );\n\t\t\t\tob_clean();\n\t\t\t\twp_redirect(esc_url(add_query_arg()));\n\t\t\t\texit();\n\t\t\t}\n\n\t\t}\n\n\t\t// If the delete bulk action is triggered\n\t\tif ( ( isset( $_POST['action'] ) && $_POST['action'] == 'bulk-delete' )\n\t\t || ( isset( $_POST['action2'] ) && $_POST['action2'] == 'bulk-delete' )\n\t\t) {\n\n\t\t\t$delete_ids = esc_sql( $_POST['bulk-delete'] );\n\n\t\t\t// loop over the array of record IDs and delete them\n\t\t\tforeach ( $delete_ids as $id ) {\n\t\t\t\tself::delete_customer( $id );\n\n\t\t\t}\n\n\t\t\twp_redirect( esc_url( add_query_arg() ) );\n\t\t\texit;\n\t\t}\n\t}" ]
[ "0.7062756", "0.67359877", "0.66329753", "0.65247166", "0.6372403", "0.62216604", "0.61888796", "0.6165071", "0.61439574", "0.6127509", "0.60074323", "0.5992601", "0.5991106", "0.5987587", "0.5980451", "0.5977999", "0.5941756", "0.59399694", "0.59117925", "0.5910475", "0.5899325", "0.58978176", "0.58725554", "0.5862419", "0.58476645", "0.5840809", "0.5831632", "0.5827239", "0.58244836", "0.581201", "0.5802281", "0.57956845", "0.5779049", "0.5759365", "0.57361585", "0.57342786", "0.5733785", "0.5732043", "0.56940687", "0.56922954", "0.5679302", "0.5670141", "0.56675065", "0.5648541", "0.5645053", "0.56267333", "0.5624049", "0.5623942", "0.56139976", "0.5609659", "0.5592088", "0.55917954", "0.5583646", "0.5564596", "0.5562208", "0.55439365", "0.55412996", "0.5526724", "0.55233335", "0.5519896", "0.55187005", "0.551572", "0.5513003", "0.55111235", "0.55098426", "0.5507783", "0.550247", "0.54985535", "0.54936516", "0.5491175", "0.54906553", "0.5488902", "0.5480035", "0.54780644", "0.547065", "0.5465243", "0.5464967", "0.54563665", "0.5455945", "0.54554576", "0.54489833", "0.54473376", "0.5443501", "0.5441958", "0.54345804", "0.5433678", "0.5425973", "0.5422013", "0.54109013", "0.54052573", "0.54015964", "0.54005724", "0.53993946", "0.53959036", "0.5392389", "0.53885114", "0.5387555", "0.5386627", "0.53853196", "0.53827494" ]
0.61617893
8
entry_delete If there is nothing to redirect to after deleting, there would be no need to redirect to it. So delete them.
function entry_delete($entry_id, $channel_id, $url_title='') { if ( ! empty($url_title) && (isset($this->settings['channel_url'][$channel_id]['uri']) && !empty($this->settings['channel_url'][$channel_id]['uri'])) && (isset($this->settings['channel_url'][$channel_id]['uri']) && !empty($this->settings['channel_url'][$channel_id]['uri'])) ) { $entry_url = trim($this->settings['channel_url'][$channel_id]['uri'],'/').'/'.$url_title; // remove this entry $this->EE->db->delete( 'detours', array( 'new_url' => $entry_url, 'site_id' => $this->site_id ) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function delete_entry_and_redirect( Entry $entry ) {\n\t\t$result = $entry->delete();\n\n\t\tif ( -1 === $result ) {\n\t\t\tAdmin_Page::redirect_and_show_message(\n\t\t\t\tnew Message( Message::ERROR, __( 'Database error.', 'glossary-by-arteeo' ) )\n\t\t\t);\n\t\t} else {\n\t\t\tAdmin_Page::redirect_and_show_message(\n\t\t\t\tnew Message( Message::SUCCESS, __( 'Entry has been deleted.', 'glossary-by-arteeo' ) )\n\t\t\t);\n\t\t}\n\t}", "function deleteEntry() \n { \n \n // before removing entry, make sure associated linkGroups & linkViewers\n // are removed as well\n $linkID = $this->getID();\n \n $linkMgr = new RowManager_NavLinkAccessGroupManager();\n $linkMgr->setLinkID( $linkID );\n $list = $linkMgr->getListIterator();\n \n $list->setFirst();\n while( $entry = $list->getNext() ) {\n $entry->deleteEntry();\n }\n \n $linkViewerMgr = new RowManager_NavLinkViewerManager();\n $linkViewerMgr->setLinkID( $linkID );\n $list = $linkViewerMgr->getListIterator();\n \n $list->setFirst();\n while( $entry = $list->getNext() ) {\n $entry->deleteEntry();\n }\n \n parent::deleteEntry();\n \n }", "function delete_entries()\n\t{\n\t\tif ( ! $this->cp->allowed_group('can_access_content'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\n\t\tif ( ! $this->cp->allowed_group('can_delete_self_entries') AND\n\t\t\t ! $this->cp->allowed_group('can_delete_all_entries'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\t\t\t\t\n\t\tif ( ! $this->input->post('delete'))\n\t\t{\n\t\t\t$this->session->set_flashdata('message_failure', $this->lang->line('no_valid_selections'));\n\t\t\t$this->functions->redirect(BASE.AMP.'C=content_edit'.AMP.'M=index');\n\t\t}\n\n\t\t/* -------------------------------------------\n\t\t/* 'delete_entries_start' hook.\n\t\t/* - Perform actions prior to entry deletion / take over deletion\n\t\t*/\n\t\t\t$edata = $this->extensions->call('delete_entries_start');\n\t\t\tif ($this->extensions->end_script === TRUE) return;\n\t\t/*\n\t\t/* -------------------------------------------*/\n\t\t\n\t\t$this->api->instantiate('channel_entries');\n\t\t$res = $this->api_channel_entries->delete_entry($this->input->post('delete'));\n\t\t\n\t\tif ($res === FALSE)\n\t\t{\n\t\t\t$this->session->set_flashdata('message_failure', $this->lang->line('no_valid_selections'));\n\t\t\t$this->functions->redirect(BASE.AMP.'C=content_edit'.AMP.'M=index');\n\t\t}\n\t\t\n\t\t// Return success message\n\t\t$this->session->set_flashdata('message_success', $this->lang->line('entries_deleted'));\n\t\t$this->functions->redirect(BASE.AMP.'C=content_edit');\n\t}", "protected function _postDelete() {}", "protected function _postDelete() {}", "public function deleteTask()\n {\n if (User::isGuest())\n {\n $rtrn = Request::getVar('REQUEST_URI', Route::url('index.php?option=' . $this->_option, false, true), 'server');\n App::redirect(\n Route::url('index.php?option=com_users&view=login&return=' . base64_encode($rtrn)),\n Lang::txt('COM_RADIAM_LOGIN_NOTICE'),\n 'warning'\n );\n return;\n }\n\n if (!$this->config->get('access-delete-entry')\n && !$this->config->get('access-manage-entry'))\n {\n App::abort(403, Lang::txt('COM_RADIAM_NOT_AUTH'));\n }\n\n // Incoming\n $id = Request::getInt('entry', 0);\n\n if (!$id)\n {\n return $this->displayTask();\n }\n\n $process = Request::getVar('process', '');\n $confirmdel = Request::getVar('confirmdel', '');\n\n // Initiate a blog entry object\n $entry = Entry::oneOrFail($id);\n\n // Did they confirm delete?\n if (!$process || !$confirmdel)\n {\n if ($process && !$confirmdel)\n {\n $this->setError(Lang::txt('COM_RADIAM_ERROR_CONFIRM_DELETION'));\n }\n\n foreach ($this->getErrors() as $error)\n {\n $this->view->setError($error);\n }\n\n $this->view\n ->set('config', $this->config)\n ->set('entry', $entry)\n ->display();\n return;\n }\n\n // Check for request forgeries\n Request::checkToken();\n\n // Delete the entry itself\n $entry->set('state', 2);\n\n if (!$entry->save())\n {\n Notify::error($entry->getError());\n }\n\n // Log the activity\n Event::trigger('system.logActivity', [\n 'activity' => [\n 'action' => 'deleted',\n 'scope' => 'radiam.entry',\n 'scope_id' => $id,\n 'description' => Lang::txt('COM_RADIAM_ACTIVITY_ENTRY_DELETED', '<a href=\"' . Route::url($entry->link()) . '\">' . $entry->get('title') . '</a>'),\n 'details' => array(\n 'title' => $entry->get('title'),\n 'url' => Route::url($entry->link())\n )\n ],\n 'recipients' => [\n $entry->get('created_by')\n ]\n ]);\n\n // Return the entries lsit\n App::redirect(\n Route::url('index.php?option=' . $this->_option)\n );\n }", "public function processDelete()\n {\n $pageId = Tools::getValue('id_page');\n\n Db::getInstance()->delete($this->module->table_name, 'id_page='.$pageId);\n Db::getInstance()->delete($this->module->table_lang, 'id_page='.$pageId);\n Db::getInstance()->delete($this->module->table_related, 'id_parent='.$pageId.' OR id_related='.$pageId);\n\n $this->redirect_after = static::$currentIndex.'&conf=1&token='.$this->token;\n }", "protected function _postDelete()\n\t{\n\t}", "public function onAfterDelete() {\n\n\t\tparent::onAfterDelete();\n\n\t\t// Determine whether this page has been completely removed.\n\n\t\tif(Config::inst()->get(MisdirectionRequestFilter::class, 'replace_default') && !$this->owner->isPublished() && !$this->owner->isOnDraft()) {\n\n\t\t\t// Convert any link mappings that are directly associated with this page.\n\n\t\t\t$mappings = LinkMapping::get()->filter(array(\n\t\t\t\t'RedirectType' => 'Page',\n\t\t\t\t'RedirectPageID' => $this->owner->ID\n\t\t\t));\n\t\t\tforeach($mappings as $mapping) {\n\t\t\t\t$mapping->RedirectType = 'Link';\n\t\t\t\t$mapping->RedirectLink = Director::makeRelative(($this->owner->Link() === Director::baseURL()) ? Controller::join_links(Director::baseURL(), 'home/') : $this->owner->Link());\n\t\t\t\t$mapping->write();\n\t\t\t}\n\t\t}\n\t}", "function process_link_action() {\n global $catpdf_templates;\n if (isset($_GET['catpdf_action']) && $_GET['catpdf_action'] == 'delete') {\n $catpdf_templates->delete_template($_GET['template']);\n }\n }", "public function deleted(EntryInterface $entry)\n {\n parent::deleted($entry);\n\n $this->dispatch(new DumpPages());\n }", "public function delete()\n\t{\n\t\tJSession::checkToken() or JSession::checkToken('get') or jexit(JText::_('JINVALID_TOKEN'));\n\t\t$this->_result = $result = parent::delete();\n\t\t$model = $this->getModel();\n\n\t\t//Define the redirections\n\t\tswitch ($this->getLayout() . '.' . $this->getTask())\n\t\t{\n\t\t\tcase 'default.delete':\n\t\t\t\t$this->applyRedirection($result, array(\n\t\t\t\t\t'stay',\n\t\t\t\t\t'com_papiersdefamilles.reservations.default'\n\t\t\t\t), array(\n\t\t\t\t\t'cid[]' => null\n\t\t\t\t));\n\t\t\t\tbreak;\n\n\t\t\tcase 'modal.delete':\n\t\t\t\t$this->applyRedirection($result, array(\n\t\t\t\t\t'stay',\n\t\t\t\t\t'com_papiersdefamilles.reservations.default'\n\t\t\t\t), array(\n\t\t\t\t\t'cid[]' => null\n\t\t\t\t));\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$this->applyRedirection($result, array(\n\t\t\t\t\t'stay',\n\t\t\t\t\t'com_papiersdefamilles.reservations.default'\n\t\t\t\t));\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function deleteAction() {\n\t\tif(!isset($this->params['cancel'])) {\n\n\t\t\t// XXX: Maybe do some hook call validation here?\n\n\t\t\t// auto call the hooks for this module/action\n\t\t\tAPI::callHooks(self::$module, $this->action, 'controller', $this);\n\n\t\t\t// delete an entry\n\t\t\t$host = $this->_model->delete();\n\t\t}\n\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t}", "public function handleDeleteAbort(){\n $listingID = $this->hlp->sess(\"listing\")->listingID;\n $this->redirect(\"Listings:editListing\", $listingID);\n }", "private function deleteRedirect()\n\t{\n\t\tif (empty($_POST['id'])) {\n\t\t\tISC_JSON::output(GetLang('RedirectDeleteDoesntExist'));\n\t\t}\n\n\t\t$id = (int)$_POST['id'];\n\n\t\tGetLib('class.urls');\n\t\tGetLib('class.redirects');\n\n\t\t$redirect = ISC_REDIRECTS::loadRedirectById($id);\n\t\tif (!$redirect) {\n\t\t\tISC_JSON::output(GetLang('RedirectDeleteDoesntExist'));\n\t\t}\n\n\t\tif ($GLOBALS['ISC_CLASS_DB']->DeleteQuery('redirects', 'WHERE redirectid = ' . $id)) {\n\t\t\tISC_JSON::output(GetLang('RedirectDeleteSuccessful'), true);\n\t\t}\n\n\t\tISC_JSON::output(GetLang('RedirectDeleteError'));\n\t}", "function deleteEntry(&$request, $rowId) {\n\t\tif ($rowId) {\n\t\t\t$categoryDao =& DAORegistry::getDAO('CategoryDAO');\n\t\t\t$monographDao =& DAORegistry::getDAO('MonographDAO');\n\t\t\t$category =& $categoryDao->getById($rowId);\n\t\t\tif (!is_a($category, 'Category')) {\n\t\t\t\tassert(false);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$monograph =& $this->getMonograph();\n\t\t\t$monographDao->removeCategory($monograph->getId(), $rowId);\n\t\t}\n\n\t\treturn true;\n\t}", "public function delete($entry_id)\n {\n if ( !$this->is_installed())\n {\n return;\n }\n\n $qry = ee()->db->select('id, site_pages')\n ->where('site_id', ee()->publisher_lib->site_id)\n ->get('publisher_site_pages');\n\n foreach ($qry->result() as $row)\n {\n if ($row->site_pages != '')\n {\n $site_pages = json_decode($row->site_pages, TRUE);\n\n foreach ($site_pages as $site_id => $pages)\n {\n unset($site_pages[$site_id]['uris'][$entry_id]);\n unset($site_pages[$site_id]['templates'][$entry_id]);\n }\n\n $data = array(\n 'site_pages' => $this->json_encode_pages($site_pages)\n );\n\n $where = array(\n 'id' => $row->id\n );\n\n $this->insert_or_update('publisher_site_pages', $data, $where);\n }\n }\n }", "function thumbwhere_contentcollection_form_submit_delete(&$form, &$form_state) {\n $form_state['redirect'] = 'admin/thumbwhere/thumbwhere_contentcollections/thumbwhere_contentcollection/' . $form_state['thumbwhere_contentcollection']->pk_contentcollection . '/delete';\n}", "public function deleting(EntryInterface $entry)\n {\n $this->dispatch(new DeleteResource($entry));\n\n parent::deleting($entry);\n }", "function del($back) {\n\n\t\t$query_del = \"\n\t\tDELETE FROM \".$this->_getUserEntryTable().\"\n\t\tWHERE id_common = '\".(int)$this->id_common.\"'\";\n\t\t$re = sql_query($query_del);\n\t\t\n\t\tif(!$re) Util::jump_to($back.'&result=fail_del');\n\n\t\t$query_del = \"\n\t\tDELETE FROM \".$this->_getMainTable().\"\n\t\tWHERE id_common = '\".(int)$this->id_common.\"'\";\n\t\t$re = sql_query($query_del);\n\t\t\n\n\t\tUtil::jump_to($back.'&result='.( $re ? 'success' : 'fail_del'));\n\t}", "protected function _preDelete() {}", "public function deleted(EntryInterface $entry)\n {\n //$this->dispatch(new DeleteStream($entry));\n\n parent::deleted($entry);\n }", "public function deleting(EntryInterface $entry)\n {\n $this->dispatch(new DeleteDirectory($entry));\n\n parent::deleting($entry);\n }", "function thumbwhere_contentcollectionitem_form_submit_delete(&$form, &$form_state) {\n $form_state['redirect'] = 'admin/thumbwhere/thumbwhere_contentcollectionitems/thumbwhere_contentcollectionitem/' . $form_state['thumbwhere_contentcollectionitem']->pk_contentcollectionitem . '/delete';\n}", "public function action_delete_entry(): int {\n\t\treturn (int) ( new CRUD( $this->table->get_table_definition() ) )->delete_oldest_item();\n\t}", "public function onBeforeDelete()\n\t{\n\t\t$site_pages = ee()->config->item('site_pages');\n\t\t$site_id = ee()->config->item('site_id');\n\n\t\t$entries = $this->getModelFacade()->get('ChannelEntry')\n\t\t\t->fields('entry_id', 'author_id')\n\t\t\t->filter('channel_id', $this->channel_id)\n\t\t\t->all();\n\n\t\tif ($site_pages !== FALSE && $entries)\n\t\t{\n\t\t\tif (count($site_pages[$site_id]) > 0)\n\t\t\t{\n\t\t\t\tforeach ($entries as $entry)\n\t\t\t\t{\n\t\t\t\t\tunset($site_pages[$site_id]['uris'][$entry->entry_id]);\n\t\t\t\t\tunset($site_pages[$site_id]['templates'][$entry->entry_id]);\n\t\t\t\t}\n\n\t\t\t\tee()->config->set_item('site_pages', $site_pages);\n\n\t\t\t\t$this->Site->site_pages = $site_pages;\n\t\t\t\t$this->Site->save();\n\t\t\t}\n\t\t}\n\t}", "function deleteEntry() \n { \n\t parent::deleteEntry();\n\n\t $values = $this->getArrayOfValues();\n// \t echo \"<pre>\".print_r($values,true).\"</pre>\";\n\t \n\t if (isset($values['reg_id']))\n\t {\n\t \n\t\t // update balance owing column in cim_reg_registration table\n\t\t $singleReg = new RowManager_RegistrationManager($values['reg_id']);\n// \t\t $singleReg_list = $singleReg->getListIterator();\n// \t\t $singleReg_array = $singleReg_list->getDataList();\n// \t\t \n// \t\t reset($singleReg_array);\n// \t\t $record = current($singleReg_array);\n// \t\t $oldBalance = $record['registration_balance'];\n\t\t \n\t\t\t $balanceGetter = new FinancialTools();\n\t\t\t $balance = array();\n// \t\t\t $balance['registration_balance'] = $oldBalance - $record['cctransaction_amount'];\n\t\t\t $balance['registration_balance'] = $balanceGetter->simpleCalcBalanceOwing($values['reg_id']);\t\n\t\t\t $singleReg->loadFromArray( $balance );\n\t\t\t $singleReg->updateDBTable();\t\t\t\n\t\t }\t \t \n \n }", "function deleteEntry() \n { \n\t parent::deleteEntry();\n\n\t $values = $this->getArrayOfValues();\n// \t echo \"<pre>\".print_r($values,true).\"</pre>\";\n\t \n\t if (isset($values['registration_id']))\n\t {\n\t \n\t\t // update balance owing column in cim_reg_registration table\n\t\t $singleReg = new RowManager_RegistrationManager($values['registration_id']);\n// \t\t $singleReg_list = $singleReg->getListIterator();\n// \t\t $singleReg_array = $singleReg_list->getDataList();\n// \t\t \n// \t\t reset($singleReg_array);\n// \t\t $record = current($singleReg_array);\n// \t\t $oldBalance = $record['registration_balance'];\n\t\t \n\t\t\t $balanceGetter = new FinancialTools();\n\t\t\t $balance = array();\n// \t\t\t $balance['registration_balance'] = $oldBalance - $record['cctransaction_amount'];\n\t\t\t $balance['registration_balance'] = $balanceGetter->simpleCalcBalanceOwing($values['registration_id']);\t\n\t\t\t $singleReg->loadFromArray( $balance );\n\t\t\t $singleReg->updateDBTable();\t\t\t\n\t\t }\t \t \n \n }", "public function delete_entries_start ()\n\t{\n\t\t$return = (ee()->extensions->last_call) ?\n\t\t\t\t\tee()->extensions->last_call : '';\n\n\t\tee()->load->library('calendar_permissions');\n\n\t\t$group_id = ee()->session->userdata['group_id'];\n\n\t\tif ($group_id != 1 AND ee()->calendar_permissions->enabled())\n\t\t{\n\t\t\t$count = count($_POST['delete']);\n\n\t\t\t//remove all the ones they are denied permission to\n\t\t\tforeach ($_POST['delete'] as $key => $delete_id)\n\t\t\t{\n\t\t\t\t//if there are only calendar IDs, lets alert\n\t\t\t\tif ( ! ee()->calendar_permissions->can_edit_entry($group_id, $delete_id))\n\t\t\t\t{\n\t\t\t\t\tunset($_POST['delete'][$key]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//if we've removed everything, they were all\n\t\t\t//denied and we need to alert\n\t\t\tif ($count > 0 and count($_POST['delete']) == 0)\n\t\t\t{\n\t\t\t\tee()->extensions->end_script = TRUE;\n\n\t\t\t\treturn $this->show_error(lang('invalid_calendar_permissions'));\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "protected function onDelete() {\n\t\tif (!$this->post = $this->loadPost()) {\n\t\t\treturn null;\n\t\t}\n\t\t$this->post->delete();\n\t\t// $this->onRun();\n\t\treturn Redirect(Request::url());\n\t}", "function delete()\n\t{\n\t\t// Check for request forgeries.\n\t\tJRequest::checkToken() or jexit(JText::_('Invalid_Token'));\n\n\t\t// Get and sanitize the items to delete.\n\t\t$cid = JRequest::getVar('cid', null, 'post', 'array');\n\t\tJArrayHelper::toInteger($cid);\n\n\t\t// Get the model.\n\t\t$model = & $this->getModel('Link', 'RedirectModel');\n\n\t\t// Attempt to delete the item(s).\n\t\tif (!$model->delete($cid)) {\n\t\t\t$this->setMessage(JText::sprintf('Redirect_Link_Delete_Failed', $model->getError()), 'notice');\n\t\t}\n\t\telse {\n\t\t\t$this->setMessage(JText::sprintf('Redirect_Link_Delete_Success', count($cid)));\n\t\t}\n\n\t\t// Redirect to the list screen.\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_redirect&view=links', false));\n\t}", "public function delete()\n {\n $this->deleteOnExit = true;\n }", "function deleteSubmission(&$args, &$request) {\n\t\t//FIXME: Implement\n\n\t\treturn false;\n\t}", "public function onDelete(): void\n {\n if ($this->globals->getUpdated() !== (int) $_GET['id']) {\n $this->_entity->delete($_GET['id']);\n $this->globals->setUpdated($_GET['id']);\n $this->globals->unsetAlert();\n }\n }", "public function beforeDelete()\n {\n\n // delete also all wall entries\n foreach ($this->getWallEntries() as $entry) {\n $entry->delete();\n }\n\n return parent::beforeDelete();\n }", "public function destroy(Entry $entry)\n {\n //\n }", "function thumbwhere_host_form_submit_delete(&$form, &$form_state) {\n $form_state['redirect'] = 'admin/thumbwhere/thumbwhere_hosts/thumbwhere_host/' . $form_state['thumbwhere_host']->pk_host . '/delete';\n}", "function delete_entries_confirm()\n\t{\n\t\tif ( ! $this->cp->allowed_group('can_access_content'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\n\t\tif ( ! $this->cp->allowed_group('can_delete_self_entries') AND\n\t\t\t ! $this->cp->allowed_group('can_delete_all_entries'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\t\t\t\t\n\t\tif ( ! $this->input->post('toggle'))\n\t\t{\n\t\t\tredirect(BASE.'content_edit');\n\t\t}\n\n\t\t$this->load->helper('form');\n\n\t\t$damned = array();\n\n\t\tforeach ($_POST['toggle'] as $key => $val)\n\t\t{\t\t\n\t\t\tif ($val != '')\n\t\t\t{\n\t\t\t\t$damned[] = $val;\n\t\t\t}\n\t\t}\n\n\t\t// Pass the damned on for judgement\n\t\t$vars['damned'] = $damned;\n\n\t\tif (count($damned) == 1)\n\t\t{\n\t\t\t$vars['message'] = $this->lang->line('delete_entry_confirm');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$vars['message'] = $this->lang->line('delete_entries_confirm');\n\t\t}\n\n\t\t$vars['title_deleted_entry'] = '';\n\n\t\t// if it's just one entry, let's be kind and show a title\n\t\tif (count($_POST['toggle']) == 1)\n\t\t{\n\t\t\t$query = $this->db->query('SELECT title FROM exp_channel_titles WHERE entry_id = \"'.$this->db->escape_str($_POST['toggle'][0]).'\"');\n\n\t\t\tif ($query->num_rows() == 1)\n\t\t\t{\n\t\t\t\t$vars['title_deleted_entry'] = str_replace('%title', $query->row('title') , $this->lang->line('entry_title_with_title'));\n\t\t\t}\n\t\t}\n\n\t\t$this->cp->set_variable('cp_page_title', $this->lang->line('delete_confirm'));\n\n\t\t$this->javascript->compile();\n\t\t$this->load->view('content/delete_confirm', $vars);\n\t}", "public function processDelete()\n {\n // Record is valid\n $Model = $this->isValidRecord();\n if ($Model instanceof \\Illuminate\\Http\\RedirectResponse) {\n $this->redirect($Model);\n }\n // Set initial configuration\n $Model->build($this->Model->getTable());\n // Delete record\n if ($this->getIsTransaction()) {\n $result = DB::transaction(function ($db) use ($Model) {\n $result = $Model->delete();\n // Hook Action deleteAfterDelete\n $this->doHooks(\"deleteAfterDelete\", array($Model));\n });\n } else {\n $result = $Model->delete();\n // Hook Action deleteAfterDelete\n $this->doHooks(\"deleteAfterDelete\", array($Model));\n }\n // Set response redirect to list page and set session flash\n $Response = redirect($this->getFormAction())\n ->with('dk_' . $this->getIdentifier() . '_info_success', trans('dkscaffolding.notification.delete.success'));\n // Hook Filter deleteModifyResponse\n $Response = $this->doFilter(\"deleteModifyResponse\", $Response);\n $this->redirect($Response);\n }", "public function onAfterDelete()\n\t{\n\t\t// attempt to save this entry to ensure relationship integrity.\n\t\t// TODO make sure everything is already dissociated when we hit this\n\t\t$last_author = $this->Author;\n\t\t$this->Author = NULL;\n\n\t\t$last_author->updateAuthorStats();\n\t\t$this->updateEntryStats();\n\t}", "protected function _postDelete()\n {\n $this->clearResources();\n }", "function bat_event_type_form_submit_delete(&$form, &$form_state) {\n $destination = array();\n if (isset($_GET['destination'])) {\n $destination = drupal_get_destination();\n unset($_GET['destination']);\n }\n\n $form_state['redirect'] = array('admin/bat/events/event_types/manage/' . $form_state['bat_event_type']->type . '/delete', array('query' => $destination));\n}", "protected function _delete()\n\t{\n\t}", "protected function afterDelete()\r\n {\r\n }", "public function delete() {\n\t\t$query = new WP_Query( array(\n\t\t\t'name' => $this->params['post_name'],\n\t\t\t'post_type' => $this->params['post_type']\n\t\t) );\n\n\t\t$post = array_shift( $query->posts );\n\n\t\t// die('<pre>'.var_export($post,true).'</pre>');\n\n\t\tif ( $post ) {\n\t\t\t$current_action = $this->get_current_action();\n\t\t\t$this->action_results[ 'status' ] = 'success';\n\t\t\t$this->action_results[ 'messages' ][ $post->post_type ][ $post->ID ][ 'note' ] = __( 'The information has been deleted', 'kickpress' );\n\t\t\t$this->action_results[ 'data' ][ 'post_id' ] = $post->ID;\n\n\t\t\twp_trash_post( $post->ID );\n\t\t}\n\t}", "protected function _before_delete(): void\n {\n //this will try to delete all the content records to which it has access\n //if there are remaining content records the deletion of the Page will fail due to the Foreign Key contraint restrict\n $contents = PageContent::get_by( ['page_id' => $this->page_id] );\n foreach ($contents as $PageContent) {\n $PageContent->delete();\n }\n }", "public function delete()\n {\n $textvalues = $this->gettextvalues();\n $this->deleteValues($textvalues);\n \n $componentvalues = $this->getcomponentvalues();\n $this->deleteValues($componentvalues);\n \n $filevalues = $this->getfilevalues();\n $this->deleteValues($filevalues);\n \n $contributorvalues = $this->getcontributorvalues();\n $this->deleteValues($contributorvalues);\n \n parent::delete();\n }", "public function delete(){\n\t\t$id =$_GET['delete'];\n\t\t$sql= $this->link->query(\"DELETE FROM social WHERE id='$id'\");\n\t\t if($sql){\n\t\techo \"<script>alert('Are you sure want to delete?')</script>\";\t\n\t\techo \"<script>window.location.href = './social.php'</script>\";\n exit;\n\t }\n\t}", "protected function delete() {\n\t}", "private function _do_delete() {\n\t\tif (g($_POST, 'delete')) {\n\t\t\tif (g($this->conf, 'disable.delete')) die('Forbidden');\n\t\t\t\n $path = g($this->conf, 'path');\n if (g($_POST, 'path'))\n $path = \\Crypt::decrypt(g($_POST, 'path'));\n \n $this->_validPath($path);\n \n\t\t\t$parent = dirname($path);\n\t\t\t\n\t\t\tif ($path == g($this->conf, 'type')) {\n\t\t\t\t$this->_msg('Cannot delete root folder', 'error');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ($this->_delete($this->_path($path))) {\n\t\t\t\t$this->_msg('Success delete ['.$path.']');\n\t\t\t\theader('location:'.$this->_url(['path' => $parent]));\n\t\t\t\tdie();\n\t\t\t} else {\n\t\t\t\t$this->_msg('Failed delete ['.$path.'] : please call your administator', 'error');\n\t\t\t}\n\t\t}\n\t}", "protected function postDelete() {\n\t\treturn true;\n\t}", "protected function deleteAction()\n {\n }", "function access_scheme_form_delete_submit($form, &$form_state) {\n if (isset($_GET['destination'])) {\n drupal_get_destination();\n unset($_GET['destination']);\n }\n $scheme = $form_state['scheme'];\n $form_state['redirect'] = 'admin/structure/access/' . str_replace('_', '-', $scheme->machine_name) . '/delete';\n}", "public function action_delete()\n {\n\t $this->template = View::forge('template-admin');\n\n $post = Input::post();\n $entry = Model_Event::find_by_pk($post[\"id\"]);\n\t\tif ($entry){\n\t\t\tif(!$entry->delete()){\n\t\t\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t\t\t$this->template->title = \"イベント一覧\";\n\t\t\t\t$this->template->content = View::forge('event/index', $data);\n\t\t\t}\n\t\t}\n\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t$this->template->title = \"イベント一覧\";\n\t\t$this->template->content = View::forge('event/index', $data);\n }", "public function view() {\n\t\t\tif ($_SERVER['REQUEST_METHOD'] != 'POST') {\n\t\t\t\t$this->_Result['status'] = Page::HTTP_STATUS_BAD_REQUEST;\n\t\t\t\t$this->_Result['error'] = __('This page accepts posts only');\n\t\t\t\t$this->setHttpStatus($this->_Result['status']);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// _context[0] => entry id to delete\n\t\t\t// _context[1] => fieldId\n\t\t\t// _context[2] => current entry id (parent of entry id to delete)\n\t\t\tif (!is_array($this->_context) || empty($this->_context)) {\n\t\t\t\t$this->_Result['error'] = __('Parameters not found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (count($this->_context) < self::NUMBER_OF_URL_PARAMETERS) {\n\t\t\t\t$this->_Result['error'] = __('Not enough parameters');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (count($this->_context) > self::NUMBER_OF_URL_PARAMETERS) {\n\t\t\t\t$this->_Result['error'] = __('Too many parameters');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate to delete entry ID\n\t\t\t$rawToDeleteEntryId = MySQL::cleanValue($this->_context[0]);\n\t\t\t$toDeleteEntryId = General::intval($rawToDeleteEntryId);\n\t\t\tif ($toDeleteEntryId < 1) {\n\t\t\t\t$this->_Result['error'] = __('No entry no found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate parent field exists\n\t\t\t$parentFieldId = General::intval(MySQL::cleanValue($this->_context[1]));\n\t\t\tif ($parentFieldId < 1) {\n\t\t\t\t$this->_Result['error'] = __('Parent id not valid');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$parentField = FieldManager::fetch($parentFieldId);\n\t\t\tif (!$parentField || empty($parentField)) {\n\t\t\t\t$this->_Result['error'] = __('Parent field not found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate parent entry ID\n\t\t\t$rawEntryId = MySQL::cleanValue($this->_context[2]);\n\t\t\t$entryId = General::intval($rawEntryId);\n\t\t\tif ($entryId < 1) {\n\t\t\t\t$this->_Result['error'] = sprintf(\n\t\t\t\t\t__('Parent entry id `%s` not valid'),\n\t\t\t\t\t$rawEntryId\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate parent entry exists\n\t\t\t$entry = EntryManager::fetch($entryId);\n\t\t\tif ($entry == null || count($entry) != 1) {\n\t\t\t\t$this->_Result['error'] = __('Parent entry not found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (is_array($entry)) {\n\t\t\t\t$entry = $entry[0];\n\t\t\t}\n\t\t\tif ($entry->get('section_id') != $parentField->get('parent_section')) {\n\t\t\t\t$this->_Result['error'] = __('Field and entry do not belong together');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate to delete entry exists\n\t\t\t$toDeleteEntry = EntryManager::fetch($toDeleteEntryId);\n\t\t\tif ($toDeleteEntry == null || count($toDeleteEntry) != 1) {\n\t\t\t\t$this->_Result['error'] = __('Entry not found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (is_array($toDeleteEntry)) {\n\t\t\t\t$toDeleteEntry = $toDeleteEntry[0];\n\t\t\t}\n\t\t\t\n\t\t\t// Validate entry is not linked anywhere else\n\t\t\tif (!isset($_REQUEST['no-assoc'])) {\n\t\t\t\t//$toDeleteSection = SectionManager::fetch($toDeleteEntry->get('section_id'));\n\t\t\t\t//$toDeleteAssoc = $toDeleteSection->fetchChildAssociations(false);\n\t\t\t\t$toDeleteAssoc = SectionManager::fetchChildAssociations($toDeleteEntry->get('section_id'), false);\n\t\t\t\t//var_dump($toDeleteAssoc);die;\n\t\t\t\t// TODO: find if the toDeleteEntry is linked or not.\n\t\t\t\tif (count($toDeleteAssoc) > 1) {\n\t\t\t\t\t$this->_Result['assoc'] = true;\n\t\t\t\t\t$this->_Result['error'] = __('Entry might be link elsewhere. Do you want to continue?');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Delete the entry\n\t\t\tif (!EntryManager::delete($toDeleteEntryId)) {\n\t\t\t\t$this->_Result['error'] = __('Could not delete the entry');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t$this->_Result['entry-id'] = $entryId;\n\t\t\t$this->_Result['ok'] = true;\n\t\t}", "public function preDelete() { }", "public function delete($entries=Null) {\n if ($entries === Null) {\n $entries = array_keys($this->entries()->entries());\n }\n if (!is_array($entries) && !is_numeric($entries)) {\n throw new InvalidParameterException($this->app, $entries, \"array or numeric\");\n }\n if (is_numeric($entries)) {\n $entries = [$entries];\n }\n $entryIDs = [];\n foreach ($entries as $entry) {\n if (is_numeric($entry)) {\n $entryIDs[] = intval($entry);\n }\n }\n if ($entryIDs) {\n $this->beforeDelete();\n $this->app->dbConn->table(static::$TABLE)->where(['user_id' => $this->user_id])->where(['id' => $entryIDs])->limit(count($entryIDs))->delete();\n $this->afterDelete();\n }\n foreach ($entryIDs as $entryID) {\n unset($this->entries[intval($entryID)]);\n }\n return True;\n }", "public function destroy()\n {\n $member = Member::findOrFail(\\request('entryId'));\n\n $member->delete(); //DELETE OCCURS HERE AFTER RECORD FOUND\n\n return redirect('members');\n }", "function dh_cwsserviceareamap_form_submit_delete(&$form, &$form_state) {\n list($pg, $us, $id) = explode('/', $_GET['destination']);\n unset($_GET['destination']);\n drupal_goto(\n 'admin/content/dh_adminreg_feature/manage/' . $form_state['dh_adminreg_feature']->fid . '/delete',\n array('query' => array(\n 'destination' => $pg\n )\n ) \n );\n}", "public function actionDeleteEntryAttachement()\n {\n\n }", "function travel_form_submit_delete($form, &$form_state) {\n // Redirect user to \"Delete\" URI for this entity.\n $entity = $form_state['entity'];\n $entity_uri = entity_uri('travel', $entity);\n $form_state['redirect'] = $entity_uri['path'] . '/delete';\n}", "protected function _predelete() {\n }", "function delete_entries_start()\n\t{\n\t\tglobal $DB, $FF;\n\n\t\t$playa_fields = $this->_get_fields();\n\t\t$this->cache['mourning_parents'] = array();\n\n\t\tif (count($playa_fields))\n\t\t{\n\t\t\tforeach($_POST['delete'] as $child_id)\n\t\t\t{\n\t\t\t\tif ($parents = $this->_get_parents($child_id))\n\t\t\t\t{\n\t\t\t\t\t$this->cache['mourning_parents'][$child_id] = $parents;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function delete()\n {\n $post['id'] = $this->request->getParameter('id'); // récupérer le paramètre de l'ID\n $this->post->deletePost($post['id']);\n $this->redirect(\"admin\", \"chapters\"); // une fois le post supprimé, je redirige vers la vue chapters\n }", "function delete_permission($entry_ref = NULL){\n\t\t\n\t\t$this->auth->check('rooms.permissions');\n\t\t\n\t\t// Check if a form has been submitted; if not - show it to ask user confirmation\n\t\tif($this->input->post('id')){\n\t\t\n\t\t\t// Form has been submitted (so the POST value exists)\n\t\t\t// Call model function to delete room\n\t\t\t$delete = $this->rooms_model->delete_permission($this->input->post('id'));\n\t\t\tif($delete == FALSE){\n\t\t\t\t$this->msg->add('err', $this->rooms_model->lasterr, 'An error occured');\n\t\t\t} else {\n\t\t\t\t$this->msg->add('info', 'The permission entry has been deleted.');\n\t\t\t}\n\t\t\t// Redirect\n\t\t\tredirect(sprintf('rooms/manage/edit/%d/%s', $this->session->userdata('editing_room_id'), 'permissions'));\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tif($entry_ref == NULL){\n\t\t\t\t\n\t\t\t\t$tpl['title'] = 'Delete permission entry';\n\t\t\t\t$tpl['pagetitle'] = $tpl['title'];\n\t\t\t\t$tpl['body'] = $this->msg->err('Cannot find the permission entry or no permission entry reference given.');\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// Get room info so we can present the confirmation page with a name\n\t\t\t\t$entry = $this->rooms_model->get_permission_entry($entry_ref);\n\t\t\t\t\n\t\t\t\tif($entry == FALSE){\n\t\t\t\t\t\n\t\t\t\t\t$tpl['title'] = 'Delete permission entry';\n\t\t\t\t\t$tpl['pagetitle'] = $tpl['title'];\n\t\t\t\t\t$tpl['body'] = $this->msg->err('Could not find that permission entry or no entry reference given.');\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t// Initialise page\n\t\t\t\t\t$body['action'] = 'rooms/manage/delete_permission';\n\t\t\t\t\t$body['id'] = $entry_ref;\n\t\t\t\t\t$body['cancel'] = sprintf('rooms/manage/edit/%d/%s', $this->session->userdata('editing_room_id'), 'permissions');\n\t\t\t\t\t#$body['text'] = 'If you delete this room, all bookings made on it and its permissions will also be removed.';\n\t\t\t\t\t$tpl['title'] = 'Delete permission entry';\n\t\t\t\t\t\n\t\t\t\t\t$title = 'Delete permission for %s on %s';\n\t\t\t\t\t$tpl['pagetitle'] = sprintf($title, $entry->nicename, $entry->room_name);\n\t\t\t\t\t$tpl['body'] = $this->load->view('parts/deleteconfirm', $body, TRUE);\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\t$tpl['subnav'] = $this->rooms_model->subnav();\n\t\t\t$this->load->view($this->tpl, $tpl);\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function delete() {\r\n $page = $this->api->getParam('page', '1');\r\n $this->model->id = $_REQUEST['id'];\r\n $this->checkOwner();\r\n $message = 'Cannot Be Deleted';\r\n if ($this->model->delete()) {\r\n $message = 'Deleted Successfully';\r\n }\r\n $this->api->redirect('contact/home?message=' . $message . '&page=' . $page);\r\n }", "function doRealDelete()\n {\n /* Query data of this section */\n $this->dbQuerySingle();\n /* Check the presence of GET or POST parameter 'returntoparent'. */\n $this->processReturnToParent();\n /* The function above sets $this->rs to values that shall be\n displayed. By assigning $this->rs to Smarty variable 'section'\n we can fill the values of $this->rs into a template. */\n $this->_smarty->assign('section', $this->rs);\n\n /* Delete the record */\n $this->dbDeleteById();\n /* Delete the corresponding counter */\n $this->dbDeleteCounterById();\n\n /* Left column contains administrative menu */\n $this->_smarty->assign('leftcolumn', \"leftadmin.tpl\");\n }", "public function delete () {\n\t\tglobal $wpdb;\n\n\t\t$wpdb->query($wpdb->prepare(\"\n\t\tDELETE FROM $wpdb->postmeta WHERE meta_key='syndication_feed_id'\n\t\tAND meta_value = '%s'\n\t\t\", $this->id));\n\n\t\t$wpdb->query($wpdb->prepare(\"\n\t\tDELETE FROM $wpdb->links WHERE link_id = %d\n\t\t\", (int) $this->id));\n\n\t\t$this->id = NULL;\n\t}", "public function deleteEntry($entry) {\n\t\t$this->_initDbConnection();\n\t\t\n\t\tif (is_string($entry)) {\n\t\t\t$stm = $this->_prepareStatement('entry', 'deleteByAtomId');\t\t\n\t\t\t$stm->execute(array(\n\t\t\t\t':id' => $entry\n\t\t\t));\n\t\t} else if (!empty($entry->row_id)) {\n\t\t\t$stm = $this->_prepareStatement('entry', 'deleteById');\t\t\n\t\t\t$stm->execute(array(\n\t\t\t\t':row_id' => $entry->row_id\n\t\t\t));\n\t\t}\n\t\t\t\n\t\tif ($this->_checkPdoError($stm)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($stm->rowCount()) {\n\t\t\treturn true;\n\t\t}\t\n\t\treturn false;\n\t}", "public function deletePage() {\n\t\t\n\t\t$output = array();\n\t\t$url = Request::post('url');\n\t\t$title = Request::post('title');\n\n\t\t// Validate $_POST.\n\t\tif ($url && ($Page = $this->Automad->getPage($url)) && $url != '/' && $title) {\n\n\t\t\t// Check if the page's directory and parent directory are wirtable.\n\t\t\tif (is_writable(dirname($this->getPageFilePath($Page))) && is_writable(dirname(dirname($this->getPageFilePath($Page))))) {\n\n\t\t\t\tFileSystem::movePageDir($Page->path, '..' . AM_DIR_TRASH . dirname($Page->path), $this->extractPrefixFromPath($Page->path), $title);\n\t\t\t\t$output['redirect'] = '?context=edit_page&url=' . urlencode($Page->parentUrl);\n\t\t\t\tCore\\Debug::log($Page->url, 'deleted');\n\n\t\t\t\t$this->clearCache();\n\n\t\t\t} else {\n\t\t\n\t\t\t\t$output['error'] = Text::get('error_permission') . '<p>' . dirname(dirname($this->getPageFilePath($Page))) . '</p>';\n\t\t\n\t\t\t}\n\t\n\t\t} else {\n\t\t\t\n\t\t\t$output['error'] = Text::get('error_page_not_found');\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $output;\n\t\t\n\t}", "public function deleteAction() {\n\t\t$redirect_url = Minz_Request::param('r', false, true);\n\t\tif (!$redirect_url) {\n\t\t\t$redirect_url = array('c' => 'subscription', 'a' => 'index');\n\t\t}\n\t\tif (!Minz_Request::isPost()) {\n\t\t\tMinz_Request::forward($redirect_url, true);\n\t\t}\n\n\t\t$id = Minz_Request::param('id');\n\n\t\tif (self::deleteFeed($id)) {\n\t\t\tMinz_Request::good(_t('feedback.sub.feed.deleted'), $redirect_url);\n\t\t} else {\n\t\t\tMinz_Request::bad(_t('feedback.sub.feed.error'), $redirect_url);\n\t\t}\n\t}", "public function deleted(EntryInterface $entry)\n {\n $this->commands->dispatch(new DeleteStream($entry));\n\n parent::deleted($entry);\n }", "protected function afterDelete()\n {\n }", "function delete()\r\n\t{\r\n\t\t// Check for request forgeries\r\n\t\tJRequest::checkToken() or die( 'Invalid Token' );\r\n\t\tglobal $mainframe;\r\n\t\t$model\t= &$this->getModel( 'table' );\r\n\t\t$ids = JRequest::getVar('ids', array(), 'request', 'array');\r\n\t\t$model->deleteRows( $ids );\r\n\t\tif ( JRequest::getVar('format') == 'raw') {\r\n\t\t\tJRequest::setVar( 'view', 'table' );\r\n\t\t\t$this->display();\r\n\t\t} else {\r\n\t\t\t//@TODO: test this\r\n\t\t\t$ref = JRequest::getVar( 'fabrik_referrer', \"index.php\", 'post' );\r\n\t\t\t$mainframe->redirect( $ref, count($ids) . \" \" . JText::_( 'RECORDS DELETED' ) );\r\n\t\t}\r\n\t}", "function deletes($id) {\n\t\n\tglobal $link;\n\t\n\tdelete (array ('table' => 'articles', 'link' => $link, 'id' => $id));\n\theader(\"location:\".BASE_URL.\"/articles/backoffice_index\");\t\n\n}", "public function action_delete_entry_message( int $nbr_deleted ) {\n\t\tif ( $nbr_deleted <= 0 ) {\n\t\t\tadd_settings_error( self::POST_ACTION_ID, 'deletion_failed', __( 'Entry deletion failed.', 'autowpdb-example-plugin' ) );\n\t\t\treturn;\n\t\t}\n\n\t\tadd_settings_error(\n\t\t\tself::POST_ACTION_ID,\n\t\t\t'deletion_success',\n\t\t\t__( 'Oldest entry successfully deleted.', 'autowpdb-example-plugin' ),\n\t\t\t'success'\n\t\t);\n\t}", "function backoffice_delete($id) {\n\t\n\tglobal $link;\n\t\n\tdelete (array ('table' => 'commentaires', 'link' => $link, 'id' => $id));\n\theader(\"location:\".BASE_URL.\"/homes/backoffice_commentaires\");\t\n\n}", "protected function _postDelete()\n {\n $this->getResource()->delete();\n\n $this->getIssue()->compileHorizontalPdfs();\n }", "function travel_type_form_submit_delete(&$form, &$form_state) {\n // Redirect user to \"Delete\" URI for this entity type.\n $form_state['redirect'] = 'admin/structure/travel/' . $form_state['travel_type']->type . '/delete';\n}", "public function delete_single_entry() {\n\n $invoiceDeleted = false;\n\n // Delete the entry first\n $this->mockinvoice_model->remove_single_entry( $_POST[ 'timesheetEntryId' ] );\n\n // Count the remaining entries from the invoice\n $count = $this->mockinvoice_model->count_invoice_entries( $_POST[ 'mockInvoiceId' ] );\n\n // Delete the entire invoice if it no longer has entries\n if ( $count[0]->invoiceEntryCount == 0 ) {\n // Delete all mock invoice rows\n $this->mockinvoice_row_model->delete_where( 'mockInvoiceId', $_POST[ 'mockInvoiceId' ] );\n // Delete the mock invoice\n $this->mockinvoice_model->delete( $_POST[ 'mockInvoiceId' ] );\n $invoiceDeleted = true;\n }\n\n // Return the id's and if other data was deleted aside from the entry itself\n $returnArray[] = array( 'invoiceDeleted' => $invoiceDeleted, 'mockInvoiceId' => $_POST[ 'mockInvoiceId' ] );\n // Send back JSON with boolean values to tell if the invoice or row was deleted\n $this->json_library->print_array_json_unless_empty( $returnArray );\n }", "function delete( )\n {\n $this->dbInit();\n $this->Database->query( \"DELETE FROM eZLink_Hit WHERE Link='$this->ID'\" ); \n $this->Database->query( \"DELETE FROM eZLink_Link WHERE ID='$this->ID'\" );\n }", "public function delete() {\n // we expect a url of form ?controller=posts&action=delete&id=x\n // without an id we just redirect to the error page as we need the post id to find it in the database\n if (!isset($_GET['id']))\n return call('pages', 'error');\n\n // we use the given id to get the right post and delete from the database\n $post = Post::delete($_GET['id']);\n require_once('view/posts/delete.php');\n }", "function maybe_prevent_deletion( $post_id ) {\r\n\t\r\n\tglobal $sendback;\r\n\t\r\n\t$post = get_post( $post_id );\r\n\t\r\n\tif( $post->post_type === 'wpass_status' ) {\r\n\t\t\r\n\t\tif( true === is_status_assigned_to_open_ticket( $post ) ) {\r\n\t\t\twp_redirect( add_query_arg( array( 'deleted' => 0, 'ids' => $post_id, 'status_delete' => 'failed' ), $sendback ) );\r\n\t\t\texit;\r\n\t\t}\r\n\t}\r\n}", "public function deleteAction() {\n\t\t// if($post->delete()) {\n\t\t// \tSession::message([\"Post <strong>$post->name</strong> deleted!\" , \"success\"]);\n\t\t// \tredirect_to('/posts/index');\n\t\t// } else {\n\t\t// \tSession::message([\"Error saving! \" . $error->get_errors() , \"success\"]);\n\t\t// }\n\t}", "protected function prepareDeleteArticle(){\n $this->deleteComment();\n $this->deleteArticle();\n header('Location: index.php');\n }", "public function delete() {\n $this->remove_content();\n\n parent::delete();\n }", "public function deleteAction() {\n\t\t\t$this->_forward('index');\n\t\t}", "public function handleDelete($user, $_DELETE) {\n\t\t// User must be verified to perform deletion\n\t\tif (!$this->verifyUser($user)) {\n\t\t\techo json_encode($this->throwUnauthorized());\n\t\t\treturn;\n\t\t}\n\t\tif ($_GET['entryid'] == \"\") { // URL rewrite parameter\n\t\t\t// Batch transaction\n\t\t\tif (isset($_DELETE['time']) && isset($_DELETE['entries'])) {\n\t\t\t\t$result = $this->deleteEntries($user, $_DELETE['entries']);\n\t\t\t\t$result['time'] = $_DELETE['time'];\n\t\t\t\techo json_encode($result);\n\t\t\t}\n\t\t} else {\n\t\t\t// Single entry\n\t\t\tif (isset($_DELETE['time'])) {\n\t\t\t\t$result = $this->deleteEntry($user, $_DELETE[\"entry\"]);\n\t\t\t\t$result['time'] = $_DELETE['time'];\n\t\t\t\techo json_encode($result);\n\t\t\t}\n\t\t}\n\t}", "public function sitePageDeleteAction ()\n {\n\t\t$Page = Tg_Site::getInstance ()->getPageById($this->_getParam ('id'));\n\t\tif (!$Page)\n\t\t\tthrow new Exception (\"Page not found\");\n\t\t\t\n\t\tif ($Page->locked)\n\t\t\tthrow new Exception (\"Page is locked\");\n\t\t\n \t$Page->delete();\n \t\n\t\techo '{\"success\":true,\"msg\":\"Delete successful\"}';\n\t\tdie;\n }", "public function interceptDelete()\n\t{\n\t\t$user = $this->getService('com://admin/ninjaboard.model.people')->getMe();\n\t\t$rows = $this->getModel()->getList();\n\t\tforeach($rows as $row)\n\t\t{\n\t\t\t$topic = $this->getService('com://site/ninjaboard.model.topics')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($row->ninjaboard_topic_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\t\t\t$forum = $this->getService('com://site/ninjaboard.model.forums')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($topic->forum_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\n\t\t\t// @TODO we migth want to add an option later, wether or not to allow users to delete their own post.\n\t\t\tif($forum->post_permissions < 3 && $row->created_by != $user->id) {\n\t\t\t\tJError::raiseError(403, JText::_('COM_NINJABOARD_YOU_DONT_HAVE_THE_PERMISSIONS_TO_DELETE_OTHERS_TOPICS'));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public static function onPageDelete($event)\n {\n $instance = $event->sender;\n if(!($instance instanceof Page))\n return;\n\n $entry = MailingListEntry::find()->where([\n 'page_id' => $instance->id,\n ])->one();\n if($entry)\n $entry->delete();\n }", "function appointment_form_submit_delete(&$form, &$form_state) {\n $form_state['redirect'] = 'admin/content/appointment/manage/' . $form_state['appointment']->id . '/delete';\n}", "public function delete($entryId){\n\n $this->autoRender = false;\n\n $entry = $this->CalendarEntry->find('first', array(\n 'contain' => array(),\n 'conditions' => array(\n 'CalendarEntry.id' => $entryId\n )\n ));\n\n if(empty($entry)){\n $this->_setFlash('Calendar entry does not exist');\n return $this->redirect('/calendar');\n }\n\n if($this->CalendarEntry->delete($entryId)){\n $this->_setFlash('Calendar entry deleted','success');\n return $this->redirect('/calendar');\n }\n else {\n $this->_setFlash('We encountered a problem while trying to delete this calendar entry');\n return $this->redirect(\"/calendaar/view/$entryId\");\n }\n }", "function deleteAction(){\n/*--------------------------------------------------------------*/\n\t$CheckUser = CheckUser($_COOKIE['login'], $_COOKIE['password']);\n if(!$CheckUser)\n return header('Location: /authorization/?status=ошибка авторизации');\n\n if($CheckUser['login'] == 'spjkee1488' OR $CheckUser['login'] == 'milky'){}\n else{\n $GetPrivilege = GetPrivilege($CheckUser['class']);\n if(!$GetPrivilege)\n return header('Location: /index/?status=Ошибка привилегии');\n\n\n if($GetPrivilege['flags']['access_site'] != 1)\n return header('Location: /index/?status=Забанен');\n\n if($GetPrivilege['flags']['access_adminpanel'] != 1)\n return header('Location: /index/?status=Нет доступа.');\n }\n\n\t//if($GetPrivilege['flags']['delete_user'] != 1)\n\t\t//return header('Location: /error/?error=privilege accesss denied');\n/* !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!- \t*/\n\n\n\t$id = $_GET['id'] ? $_GET['id'] : 0;\n\n\tif($id)\n\t\tdeleteLog($id);\n\n\theader('Location: ' . $_SERVER['HTTP_REFERER']);\n}", "public function deleteEntry($delEntries)\r\n {\r\n if (is_numeric($delEntries)) {\r\n $delEntries = array($delEntries);\r\n }\r\n \r\n if (is_array($delEntries)) {\r\n $_entries = array();\r\n foreach($this->entries as $entry) {\r\n if (!in_array($entry['id'], $delEntries)) {\r\n $_entries[] = $entry;\r\n }\r\n }\r\n $this->entries = $_entries;\r\n } else {\r\n throw new Zend_Exception(\"Incorrect entries format!\");\r\n }\r\n \r\n }", "function AfterDelete($where, &$deleted_values, &$message, &$pageObject)\n{\n\n\t\t$delete_jobfile_sql = \"DELETE FROM jobfile WHERE \".$where;\n//unlink($_SESSION[\"output_dir\"].\"\\\\test_alex\\\\\");\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n;\t\t\n}", "public function onBeforeDelete();", "public function deleteEntry($id){\n\t\tif(!isset($id))return false;\n\t\t$user = $this->getUser();\n\t\tif(!isset($user[\"id\"]))return false;\n\n\t\t$entry = $this->getEntry($id);\n\t\t// check if the user is allowed to delete the entry\n\t\t// if not admin\n\t\tif(!$user[\"status\"]==DBConfig::$userStatus[\"admin\"]){\n\t\t\tif(!isset($entry[\"userid\"])\n\t\t\t\t|| $entry[\"userid\"]!=$user[\"id\"]){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif(!$this->removeIndex($id))return false;\n\t\tif(!$this->removeTags($id))return false;\n\t\tif(!$this->removeComments($id))return false;\n\t\tif(!$this->removeRatings($id))return false;\n\t\tif(!$this->removeReports($id))return false;\n\t\tif(!$this->removeImages($id))return false;\n\t\tif(!$this->removeInformation($id))return false;\n\t\tif(!$this->removeViews($id))return false;\n\n\t\t$this->log(\"@\".$user[\"id\"].\" (\".$user[\"username\"].\") deletes #\".$id.\" (\".$entry[\"title\"].\")\");\n\n\t\t$query = Queries::deleteentry($id);\n\t\treturn $this->query($query);\n\t}", "function before_delete() {}", "public function delete() {\n\t\t\tif ( isset( $_GET['location_id'] ) ) {\n\t\t\t\t$id = intval( wp_unslash( $_GET['location_id'] ) );\n\t\t\t\t$connection = WPGMP_Database::connect();\n\t\t\t\t$this->query = $connection->prepare( \"DELETE FROM $this->table WHERE $this->unique='%d'\", $id );\n\t\t\t\treturn WPGMP_Database::non_query( $this->query, $connection );\n\t\t\t}\n\t\t}" ]
[ "0.80901086", "0.73916095", "0.683369", "0.6761785", "0.6760181", "0.6661342", "0.6656066", "0.65376204", "0.65268844", "0.64591086", "0.63928676", "0.6380439", "0.6372802", "0.6334498", "0.6328187", "0.6315341", "0.62771297", "0.6268108", "0.6255769", "0.6221082", "0.62152076", "0.62050676", "0.61820185", "0.61756027", "0.6171914", "0.61657095", "0.61623406", "0.6159646", "0.6157253", "0.6116712", "0.61024106", "0.60786045", "0.6070984", "0.6067109", "0.603511", "0.6033179", "0.6021526", "0.6018358", "0.60111415", "0.6009834", "0.6006193", "0.60024357", "0.6001696", "0.5991739", "0.5982292", "0.59817547", "0.5979117", "0.5976719", "0.59742665", "0.5941094", "0.5937383", "0.59305835", "0.59302896", "0.5924785", "0.5920023", "0.5919583", "0.5906872", "0.5904863", "0.5904402", "0.59030396", "0.59024197", "0.59001815", "0.5898919", "0.58983386", "0.58957344", "0.5889552", "0.5885741", "0.58840704", "0.5880952", "0.5879257", "0.5864786", "0.58512187", "0.5850502", "0.5847808", "0.5845902", "0.5844078", "0.5829222", "0.58288014", "0.5823778", "0.5823307", "0.5819656", "0.5813854", "0.5808238", "0.58081317", "0.5804328", "0.5803658", "0.5802567", "0.58021957", "0.5801481", "0.57998896", "0.57984036", "0.5795933", "0.5795909", "0.5794398", "0.5791551", "0.5788698", "0.57881635", "0.5786414", "0.57854515", "0.57746166" ]
0.6469549
9
cp_js_end This adds orig_cat_url_title field to capture and post the original value after submission
function cp_js_end() { $data = ''; if ($this->EE->extensions->last_call !== FALSE) { $data = $this->EE->extensions->last_call; } $js = ' $(".pageContents form").has("input[name=cat_name]#cat_name").find("input[name=cat_url_title]#cat_url_title").each(function() { var $cat_url_title = $(this); if ($(".pageContents form").find("input[name=cat_id]").length > 0) { $cat_url_title.after( $("<input>") .attr("type", "hidden") .attr("name", "orig_cat_url_title") .val($cat_url_title.val()) ); } }); '; $js = ( ! empty($js)) ? NL . '(function($) {'.$js.'})(jQuery);' : ''; return $data . $js; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_ajax_press_this_add_category()\n {\n }", "private function getCategoryPostData()\n {\n // Get data from form fields\n $this->data['category_title'] = $this->input->post('category_title');\n }", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "function categoryAdd($str=''){\n\n\t#Get referring page to send users back to\n\t$previous = $_SERVER['HTTP_REFERER'];\n\n\t$str .= '<!-- start general content -->\n\t\t<script type=\"text/javascript\" src=\"' . VIRTUAL_PATH . '_js/util.js\"></script>\n\n\t\t<script type=\"text/javascript\">\n\n\t\t\tfunction checkForm(thisForm)\n\n\t\t\t{//check form data for valid info\n\t\t\t\tif(empty(thisForm.FirstName,\"Please Enter Customer\\'s First Name\")){return false;}\n\t\t\t\tif(empty(thisForm.LastName,\"Please Enter Customer\\'s Last Name\")){return false;}\n\t\t\t\tif(!isEmail(thisForm.Email,\"Please Enter a Valid Email\")){return false;}\n\t\t\t\treturn true;//if all is passed, submit!\n\t\t\t}\n\n\t\t</script>\n\n\n\t\t<div class=\"row\" style=\"\"><!-- begin content -->\n\t\t\t<form action=\"' . THIS_PAGE . '\" method=\"post\" onsubmit=\"return checkForm(this);\" >\n\n\n\t\t\t\t<input type=\"hidden\" name=\"CatID\" />\n\n\t\t\t\t<!-- inner container -->\n\t\t\t\t<div class=\"class=\"col-sm-9 pull-right\" style=\"\">\n\n\t\t\t\t\t<!-- left container -->\n\t\t\t\t\t<div class=\"col-sm-8 pull-left\" style=\"\">\n\t\t\t\t\t\t<h4 class=\"text-center\">Add New Catagory</b></h4>';\n\n\n\n\n\t\t\t\t\t\t\t$str .= '<div class=\"row \">\n\t\t\t\t\t\t\t\t<div class=\"pull-middle\">\n\n\t\t\t\t\t\t\t\t\t<select class=\"selectpicker\" name=\"CatSort\" required>\n\t\t\t\t\t\t\t\t\t\t<option value=\"person\" select=\"select\">Group By: Indivual</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"team\">Group By: Group/Team</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"organization\">Group By: Organization</option>\n\t\t\t\t\t\t\t\t\t</select>\n\n\n\t\t\t\t\t\t\t\t\t<select class=\"selectpicker\" name=\"CatSort\" required>\n\t\t\t\t\t\t\t\t\t\t<option value=\"individual\" select=\"select\">Catagory Type: IC</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"team\">Catagory Type: OOC</option>\n\t\t\t\t\t\t\t\t\t</select>\n\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div><!-- END Container -->\n\n\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\tclass=\"col-sm-12\"\n\t\t\t\t\t\t\t\t\ttype=\"text\"\n\n\t\t\t\t\t\t\t\t\tname=\"CatTitle\"\n\t\t\t\t\t\t\t\t\tplaceholder=\"Team/Group/Character Name here\"/>\n\t\t\t\t\t\t\t</div><!-- END Container -->\n\n\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t\t\tname=\"CatDescription\"\n\n\t\t\t\t\t\t\t\t\tclass=\"autoExpand col-sm-12\"\n\t\t\t\t\t\t\t\t\trows=\"3\"\n\t\t\t\t\t\t\t\t\tdata-min-rows=\"3\"\n\n\t\t\t\t\t\t\t\t\tplaceholder=\"Catagory Description\"\n\t\t\t\t\t\t\t\t\t></textarea>\n\t\t\t\t\t\t\t</div><!-- end container-->\n\n\n\t\t\t\t\t</div><!-- end inner container -->\n\n\t\t\t\t<div class=\"clearfix\">\n\t\t\t\t\t<br /><br />\n\t\t\t\t</div>\n\n\t\t\t\t<div\n\t\t\t\t\talign=\"center\"\n\t\t\t\t\tstyle=\"\">\n\n\t\t\t\t\t<input type=\"hidden\" name=\"act\" value=\"categoryInsert\" />\n\t\t\t\t\t<input class=\"btn btn-primary btn-xs \" type=\"submit\" value=\"Add Catagory\">\n\n\t\t\t\t\t&nbsp; &nbsp;\n\n\t\t\t\t\t<a class=\"btn btn-primary btn-xs outline\" href=\"' . $previous . '\">Exit Post</a>\n\t\t\t\t</div>\n\n\t\t\t</form>\n\t\t</div>\n\n\t<!-- END content -->';\n\n\treturn $str;\n}", "public static function func_ajax_add_category() {\n\t\t\t \n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\tif(!defined('DOING_AJAX')){\n wp_redirect (site_url());\n exit;\n } else {\n $self = self::sanitize($_POST['name']);\n $day = self::sanitize($_POST['day']);\n $desc = self::sanitize($_POST['description']);\n $wpdb->query($wpdb->prepare( \"INSERT INTO \".$wpdb->prefix.self::$table_name .\" VALUES (%d, %s, %s, %s)\", null, $self,$day,$desc ));\n die();\n\t\t\t\t}\n\t\t\n\t\t}", "private function setCategoryDefaultValues()\n {\n if($this->formMode === 'add')\n {\n $this->data['category_title'] = '';\n }\n else if(empty($_POST['category_submit']))\n {\n // Retrieve data from database if NOT POST request\n $data = $this->post_categories_model->getByID($this->data['category_id']);\n $this->data['category_title'] = $data['Post_Category_Title'];\n }\n }", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "function save_categ_redirect($data) {\n\t\t\tupdate_option('categ_url_hack', $data);\n\t\t}", "function _arc_meta_category_meta($event, $step, $data, $rs)\n{\n // category types).\n if ($rs['type']!='article') {\n return $data;\n }\n\n // Get the existing meta data for this category.\n $meta = _arc_meta('category', $rs['name'], true);\n\n $form = hInput('arc_meta_id', $meta['id']);\n $form .= '<div class=\"txp-form-field edit-category-arc_meta_title\">';\n $form .= '<div class=\"txp-form-field-label\">' . tag(gtxt('arc_meta_title'), 'label', ' for=\"arc_meta_title\"') . '</div>';\n $form .= '<div class=\"txp-form-field-value\">' . fInput('text', 'arc_meta_title', $meta['title'], '', '', '', '32', '', 'arc_meta_title') . '</div>';\n $form .= '</div>';\n $form .= '<div class=\"txp-form-field edit-category-arc_meta_image\">';\n $form .= '<div class=\"txp-form-field-label\">' . tag(gtxt('arc_meta_image'), 'label', ' for=\"arc_meta_image\"') . '</div>';\n $form .= '<div class=\"txp-form-field-value\">' . fInput('number', 'arc_meta_image', $meta['image'], '', '', '', '32', '', 'arc_meta_image') . '</div>';\n $form .= '</div>';\n $form .= '<div class=\"txp-form-field edit-category-arc_meta_robots\">';\n $form .= '<div class=\"txp-form-field-label\">' . tag(gtxt('arc_meta_robots'), 'label', ' for=\"arc_meta_description\"') . '</div>';\n $form .= '<div class=\"txp-form-field-value\">' . selectInput('arc_meta_robots', _arc_meta_robots(), $meta['robots'], 'arc_meta_robots') . '</div>';\n $form .= '</div>';\n\n return $data . $form;\n}", "protected function addOnSubmitJavaScriptCode() {}", "function tck_custom_js() {\n?>\n <script language=\"javascript\">\n function edit_link_save_custom(id) {\n add_loading(\"#edit-close-\" + id);\n var newurl = encodeURI( $(\"#edit-url-\" + id).val() );\n var newkeyword = $(\"#edit-keyword-\" + id).val();\n var title = $(\"#edit-title-\" + id).val();\n var custom = ($(\"#edit-custom-\" + id).is(':checked') ? 1 : 0);\n var keyword = $('#old_keyword_'+id).val();\n var nonce = $('#nonce_'+id).val();\n var www = $('#yourls-site').val();\n\n $.getJSON(\n ajaxurl,\n {action:'edit_save_custom', url: newurl, id: id, keyword: keyword, newkeyword: newkeyword, title: title, custom: custom, nonce: nonce },\n function(data){\n if(data.status == 'success') {\n\n if( data.url.title != '' ) {\n var display_link = '<a href=\"' + data.url.url + '\" title=\"' + data.url.url + '\">' + data.url.display_title + '</a><br/><small><a href=\"' + data.url.url + '\">' + data.url.display_url + '</a></small>';\n } else {\n var display_link = '<a href=\"' + data.url.url + '\" title=\"' + data.url.url + '\">' + data.url.display_url + '</a>';\n }\n\n $(\"#url-\" + id).html(display_link);\n $(\"#keyword-\" + id).html('<a href=\"' + data.url.shorturl + '\" title=\"' + data.url.shorturl + '\">' + data.url.keyword + '</a>');\n $(\"#timestamp-\" + id).html(data.url.date);\n $(\"#edit-\" + id).fadeOut(200, function(){\n $('#main_table tbody').trigger(\"update\");\n });\n $('#keyword-'+id).val( newkeyword );\n $('#custom-'+id).html( data.url.custom );\n $('#statlink-'+id).attr( 'href', data.url.shorturl+'+' );\n }\n feedback(data.message, data.status);\n end_loading(\"#edit-close-\" + id);\n end_disable(\"#actions-\" + id + ' .button');\n }\n );\n }\n </script>\n<?php\n }", "function colorpicker_field_add_new_category( $taxonomy ) { ?> \r\n\t<div class=\"form-field term-colorpicker-wrap\"> \r\n\t<label for=\"term-colorpicker\">Category Color</label> \r\n\t<input name=\"_category_color\" value=\"#ffffff\" class=\"colorpicker\" id=\"term-colorpicker\" /> \r\n\t<p>This is the field description where you can tell the user how the color is used in the theme.</p> \r\n\t</div> <?php }", "private function categoriesFormInputs()\n {\n // Get the field name of the field with the category icon\n // #47631, dwildt, 1-\n //$arrLabels[ 'catIcon' ] = $this->confMap['configuration.']['categories.']['fields.']['categoryIcon'];\n // #47631, #i0007, dwildt, 10+\n switch ( true )\n {\n case( $this->pObj->typoscriptVersion <= 4005004 ):\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'categoryIcon' ];\n break;\n case( $this->pObj->typoscriptVersion <= 4005007 ):\n default:\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryIcon' ];\n break;\n }\n // #47631, #i0007, dwildt, 10+\n // Default space in HTML code\n $tab = ' ';\n\n // FOREACH category label\n//$this->pObj->dev_var_dump( $this->arrCategories );\n // #i0118, dwildt, 1-/+\n //foreach ( $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n foreach ( ( array ) $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n {\n // Get the draft for an input field\n $cObj_name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input' ];\n $cObj_conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input.' ];\n $input = $this->pObj->cObj->cObjGetSingle( $cObj_name, $cObj_conf );\n // replace the category marker\n $input = str_replace( '###CAT###', $labelValue, $input );\n // 4.1.17, 120927, dwildt\n // replace the category marker\n //$labelValueWoSpc = str_replace( ' ', null, $labelValue );\n $labelValueWoSpc = $this->zz_properFormLabel( $labelValue );\n $input = str_replace( '###CAT_WO_SPC###', $labelValueWoSpc, $input );\n // 4.1.17, 120927, dwildt\n // #54548, 131221, dwildt, 6+\n $class = $this->arrCategories[ 'cssClass' ][ $labelKey ];\n if ( !empty( $class ) )\n {\n $class = ' class=\"' . $class . '\"';\n }\n $input = str_replace( '###CLASS###', $class, $input );\n\n // IF draft for an input field contains ###IMG###, render an image\n $pos = strpos( $input, '###IMG###' );\n if ( !( $pos === false ) )\n {\n // SWITCH : Render the image\n switch ( true )\n {\n // #i0062\n case( $labelKey == $this->arrWoCategories[ 'iconKey' ] ):\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n case( is_array( $this->arrCategories[ 'icons' ] ) ):\n // 4.1.7, dwildt, +\n $this->cObjDataAddArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n $img = $this->renderMapMarkerVariablesSystemItem( 'categoryIconLegend' );\n $this->cObjDataRemoveArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n // 4.1.7, dwildt, +\n break;\n default:\n // Render the image\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n }\n // SWITCH : Render the image\n\n $input = str_replace( '###IMG###', $img, $input );\n }\n // IF draft for an input field contains ###IMG###, render an image\n\n $arrInputs[] = $tab . $input;\n }\n // FOREACH category label\n // Move array of input fields to a string\n // #i0118, dwildt, 1-/+\n //$inputs = implode( PHP_EOL, $arrInputs );\n $inputs = implode( PHP_EOL, ( array ) $arrInputs );\n $inputs = trim( $inputs );\n\n // RETURN input fields\n return $inputs;\n }", "public function es_add_category_fields() {\n\t\t\t?>\n\t\t\t<div class=\"form-field\">\n\t\t\t\t<label><?php _e( 'Banner', 'woocommerce' ); ?></label>\n\t\t\t\t<div id=\"product_cat_banner\" style=\"float:left;margin-right:10px;\"><img src=\"<?php echo esc_url( wc_placeholder_img_src() ); ?>\" width=\"60px\" height=\"60px\" /></div>\n\t\t\t\t<div style=\"line-height:60px;\">\n\t\t\t\t\t<input type=\"hidden\" id=\"product_cat_banner_id\" name=\"product_cat_banner_id\" />\n\t\t\t\t\t<button type=\"button\" class=\"banner_upload_image_button button\"><?php _e( 'Upload/Add image', 'woocommerce' ); ?></button>\n\t\t\t\t\t<button type=\"button\" class=\"banner_remove_image_button button\"><?php _e( 'Remove image', 'woocommerce' ); ?></button>\n\t\t\t\t</div>\n\n\n\t\t\t<script type=\"text/javascript\">\n\n\t\t\t\t// Only show the \"remove image\" button when needed\n\t\t\t\tif ( ! jQuery('#product_cat_banner_id').val() ) {\n\t\t\t\t\tjQuery('.banner_remove_image_button').hide();\n\t\t\t\t}\n\n\t\t\t\t// Uploading files\n\t\t\t\tvar file_frame;\n\n\t\t\t\tjQuery( document ).on( 'click', '.banner_upload_image_button', function( event ) {\n\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t// Create the media frame.\n\t\t\t\t\tfile_frame = wp.media.frames.downloadable_file = wp.media({\n\t\t\t\t\t\ttitle: '<?php _e( 'Choose an image', 'woocommerce' ); ?>',\n\t\t\t\t\t\tbutton: {\n\t\t\t\t\t\t\ttext: '<?php _e( 'Use image', 'woocommerce' ); ?>',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmultiple: false\n\t\t\t\t\t});\n\n\t\t\t\t\t// When an image is selected, run a callback.\n\t\t\t\t\tfile_frame.on( 'select', function() {\n\t\t\t\t\t\tattachment = file_frame.state().get('selection').first().toJSON();\n\n\t\t\t\t\t\tjQuery('#product_cat_banner_id').val( attachment.id );\n\t\t\t\t\t\tjQuery('#product_cat_banner img').attr('src', attachment.url );\n\t\t\t\t\t\tjQuery('.banner_remove_image_button').show();\n\n\t\t\t\t\t\tfile_frame = undefined;\n\n\t\t\t\t\t});\n\n\t\t\t\t\t// Finally, open the modal.\n\t\t\t\t\tfile_frame.open();\n\t\t\t\t});\n\n\t\t\t\tjQuery( document ).on( 'click', '.banner_remove_image_button', function( event ) {\n\t\t\t\t\tjQuery('#product_cat_banner img').attr('src', '<?php echo esc_url( wc_placeholder_img_src() ); ?>');\n\t\t\t\t\tjQuery('#product_cat_banner_id').val('');\n\t\t\t\t\tjQuery('.banner_remove_image_button').hide();\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\n\t\t\t</script>\n\t\t\t\t<div class=\"clear\"></div>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "public function ajax_save_category()\n {\n $translation = ee()->input->post('translation');\n $status = ee()->input->post('publisher_save_status');\n\n // Stop here if false or if the array is empty\n if ( !$translation || empty($translation))\n {\n ee()->publisher_helper->send_ajax_response('failure');\n }\n\n $result = ee()->publisher_category->save_translation($translation, $status);\n\n if ($result)\n {\n ee()->publisher_helper->send_ajax_response('success');\n }\n else\n {\n ee()->publisher_helper->send_ajax_response($result);\n }\n }", "function wp_ajax_add_link_category($action)\n {\n }", "public function category_urlSlugGenerator()\n {\n $output['token'] = $this->security->get_csrf_hash();\n header('Content-Type: application/json');\n $slug = $this->input->post('title', true);\n $output['response'] = $this->common->_urlSlugGenerator('tbl_categories', 'id', 'url_slug', $slug);\n $output = html_escape($this->security->xss_clean($output));\n exit(json_encode($output));\n }", "function templ_save_comment_script() {\n\t$javascript = <<<JS\n <script type=\"text/javascript\">\n var sub = document.getElementById('submit');\n document.getElementById('recaptcha-submit-btn-area').appendChild (sub);\n document.getElementById('submit').tabIndex = 6;\n if ( typeof _recaptcha_wordpress_savedcomment != 'undefined') {\n document.getElementById('comment').value = \n _recaptcha_wordpress_savedcomment;\n }\n </script>\nJS;\n\techo $javascript;\n}", "function my_admin_add_js() {\n\t$screen = get_current_screen();\n\tif ($screen->id == 'contact') {\n\t\techo \"<script>document.getElementById('newcategory_parent').remove()</script>\n\t\t <script>document.getElementById('titlediv').remove(); </script>\";\n\t\t wp_enqueue_script('inputmask', get_template_directory_uri() . '/js/jquery.inputmask.bundle.min.js', array('jquery'));\n wp_enqueue_script('admin', get_template_directory_uri() . '/js/admin.js', array('jquery'));\n\t}\n}", "private function escapeCategories()\n {\n foreach($this->data['categories'] as $key => $category)\n {\n $this->data['categories'][$key]['Post_Category_Title'] = $this->security->xss_clean($category['Post_Category_Title'] );\n }\n }", "public function ajax_get_category()\n {\n $cat_id = ee()->input->get('cat_id');\n $group_id = ee()->input->get('group_id');\n $status = ee()->input->get('publisher_view_status') ? ee()->input->get('publisher_view_status') : PUBLISHER_STATUS_OPEN;\n\n $data = array(\n 'cat_id' => $cat_id,\n 'status' => $status\n );\n\n $vars = ee()->publisher_helper->get_toolbar_options('category', $data, FALSE);\n\n $vars['cat_id'] = $cat_id;\n $vars['group_id'] = $group_id;\n $vars['data'] = ee()->publisher_category->get_translations($cat_id, $group_id, $status);\n $vars['save_url'] = ee()->publisher_helper_cp->mod_link('ajax_save_category', array(), TRUE);\n $vars['custom_fields'] = ee()->publisher_category->get_custom_fields($group_id);\n\n // Load core lang file so views are translated\n ee()->lang->loadfile('content');\n\n if (ee()->input->get('publisher_view_status'))\n {\n $data = ee()->load->view('category/edit_form', $vars, TRUE);\n }\n else\n {\n $data = ee()->load->view('category/edit', $vars, TRUE);\n }\n\n ee()->publisher_helper->send_ajax_response($data);\n }", "function kulam_acf_prepare_acf_form_post_category_field( $field ) {\n\n\t/**\n\t * Variables\n\t */\n\t$field_label = get_field( 'acf-form_form_category_title' );\n\n\tif ( $field_label ) {\n\n\t\t$field[ 'label' ] = $field_label;\n\n\t}\n\n\t// return\n\treturn $field;\n\n}", "function categ_redirect() {\n\n\t\t\t$redirects = get_option('categ_url_hack');\n\t\t\t$categ = get_query_var('cat');\n\t\t\t$categz = array();\n\n // WPML compliant\n/*\n $original = array_key_exists( 'wpml_object_id' , $GLOBALS['wp_filter'] ) ? apply_filters( 'wpml_object_id', $currenta, 'category', true, $default_lg ) : $currenta;\n apply_filters( 'wpml_object_id', int $element_id, string $element_type, bool $return_original_if_missing, mixed $ulanguage_code )\n*/\n if ( array_key_exists( 'wpml_object_id' , $GLOBALS['wp_filter'] ) ) {\n global $sitepress, $wpdb;\n $defaultlg = $sitepress->get_default_language();\n \n $query = \"SELECT trid, language_code, source_language_code FROM wp_icl_translations WHERE element_id='$categ' AND element_type='tax_category'\";\n $trid = $wpdb->get_var( $query, 0 );\n $source_lg = $wpdb->get_var( $query, 2 );\n \n $query2 = \"SELECT element_id FROM wp_icl_translations WHERE trid='$trid' AND element_type='tax_category'\";\n $results_cat = $wpdb->get_results($query2, ARRAY_A);\n \n foreach ($results_cat as $k) {\n $categz[] = $k['element_id'];\n }\n }\n\n\t\t\tif ( !empty($redirects) && !empty($categz) ) {\n\t\t\t if( $redirects['categ'] == $categ || in_array($redirects['categ'], $categz) ) {\n\t\t\t wp_redirect( $redirects['url'] );\n exit();\n }\n\t\t\t}\n\t\t}", "function display_addcategory_form($category_name='', $id='')\r\n{\r\n\tglobal $dropbox_cnf;\r\n\r\n\t$title=get_lang('AddNewCategory');\r\n\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\t// retrieve the category we are editing\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\t\t$row=mysql_fetch_array($result);\r\n\r\n\t\tif ($category_name=='') // after an edit with an error we do not want to return to the original name but the name we already modified. (happens when createinrecievedfiles AND createinsentfiles are not checked)\r\n\t\t{\r\n\t\t\t$category_name=$row['cat_name'];\r\n\t\t}\r\n\t\tif ($row['received']=='1')\r\n\t\t{\r\n\t\t\t$target='received';\r\n\t\t}\r\n\t\tif ($row['sent']=='1')\r\n\t\t{\r\n\t\t\t$target='sent';\r\n\t\t}\r\n\t\t$title=get_lang('EditCategory');\r\n\r\n\t}\r\n\r\n\tif ($_GET['action']=='addreceivedcategory')\r\n\t{\r\n\t\t$target='received';\r\n\t}\r\n\tif ($_GET['action']=='addsentcategory')\r\n\t{\r\n\t\t$target='sent';\r\n\t}\r\n\r\n\r\n\techo \"<form name=\\\"add_new_category\\\" method=\\\"post\\\" action=\\\"\".api_get_self().\"?view=\".$_GET['view'].\"\\\">\\n\";\r\n\techo '<strong>'.$title.'</strong>';\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\techo '<input name=\"edit_id\" type=\"hidden\" value=\"'.$id.'\">';\r\n\t}\r\n\techo '<input name=\"target\" type=\"hidden\" value=\"'.$target.'\">';\r\n\techo \"<table border=\\\"0\\\">\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo get_lang('CategoryName').': ';\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"text\\\" name=\\\"category_name\\\" value=\\\"\".$category_name.\"\\\" />\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td valign=\\\"top\\\">\\n\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"submit\\\" name=\\\"StoreCategory\\\" value=\\\"\".get_lang('Ok').\"\\\">\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"</table>\\n\";\r\n\techo \"</form>\";\r\n}", "function SRW_hiddenfield_title() {\r\n\tglobal $post; ?>\r\n\t<script>\r\n\t\tjQuery(document).ready(function($){\r\n\t\t\tif( $('input#page-title').length > 0 ){\r\n\t\t\t\t$('input#page-title').val('<?php echo $post->post_title ?>');\r\n\t\t\t}\r\n\t\t})\r\n\t</script>\r\n\t<?php\r\n}", "function extra_category_fields( $tag ) { //check for existing featured ID\n $t_id = $tag->term_id;\n $cat_meta = get_option( \"category_$t_id\");\n\t?>\n\t<tr class=\"form-field\">\n\t\t<th scope=\"row\" valign=\"top\"><label for=\"cat_Image_url\"><?php _e('Category Url'); ?></label></th>\n\t\t<td><input type=\"text\" name=\"Cat_meta[cat_url]\" id=\"Cat_meta[img]\" size=\"3\" style=\"width:60%;\" value=\"<?php echo $cat_meta['cat_url'] ? $cat_meta['cat_url'] : ''; ?>\"><br />\n\t <span class=\"description\"><?php _e('Url for category'); ?></span>\n\t\t</td>\n\t</tr>\n\t<?php\n}", "function insert_cat()\n\t {\n\t\t $cat_par_id = $_POST['cat_par_id'];\n\t\t if(mysql_real_escape_string(trim($_POST['cat_title']))=='')\n\t\t {\n\t\t return '<span class=\"err\">please enter the category title</span>';\n\t\t }\n\t\t else\n\t\t {\n\t\t mysql_query(\"insert into category(cat_par_id,cat_title,cat_des) values('$cat_par_id','\".mysql_real_escape_string(trim($_POST['cat_title'])).\"','\".mysql_real_escape_string(trim($_POST['cat_des'])).\"')\");\n\t\t unset($_POST);\n\t\t return '<span class=\"fine\">category inserted successfully...</span>';\n\t\t }\n \t \n }", "function edit_form_after_title()\n {\n }", "function edit_form_after_title()\n {\n }", "public function form($instance) {\n\n // set up background color\n $bg_color = \"#212121\";\n if (isset($instance['bg_color'])) {\n $bg_color = $instance['bg_color'];\n }\n?>\n <div class=\"an-catlinks-settings-container\">\n <p>\n <label for=\"<?php echo $this->get_field_id( 'bg_color' ); ?>\" style=\"display:block;\"><?php _e( 'Background Color:', 'an_catlinks_wiget' ); ?></label>\n <input class=\"widefat color-picker an-catlist-bg-color-picker\"\n id=\"<?php echo $this->get_field_id( 'bg_color' ); ?>\"\n name=\"<?php echo $this->get_field_name( 'bg_color' ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $bg_color ); ?>\" />\n </p>\n\n<?php\n // setup font color\n $font_color = \"#ffffff\";\n if (isset($instance['font_color'])) {\n $font_color = $instance['font_color'];\n }\n?>\n <p>\n <label for=\"<?php echo $this->get_field_id( 'font_color' ); ?>\" style=\"display:block;\"><?php _e( 'Font color:', 'an_catlinks_wiget' ); ?></label>\n <input class=\"widefat color-picker\"\n id=\"<?php echo $this->get_field_id( 'font_color' ); ?>\"\n name=\"<?php echo $this->get_field_name( 'font_color' ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $font_color ); ?>\" />\n </p>\n\n<?php\n // set up 1st category\n $cat = 0;\n if (isset($instance['cat1'])) {\n $cat = $instance['cat1'];\n }\n?>\n <!-- 1st category and image -->\n <label for=\"<?php _e($this->get_field_id('cat1')); ?>\"><?php esc_html__(\"Category 1\", \"an_catlinks_wiget\"); ?></label>\n <select id=\"<?php _e($this->get_field_id('cat1')); ?>\" name=\"<?php _e($this->get_field_name('cat1')); ?>\" class=\"widefat\" width=\"100%\">\n <option value-\"0\"><?php _e('(not selected)', 'an_catlinks_wiget'); ?></option>\n <?php foreach(get_terms('category','parent=0&hide_empty=0') as $category): ?>\n <option <?php $cat == $category->term_id ? _e(\"selected\") : _e(\"\"); ?> value=\"<?php _e($category->term_id); ?>\">\n <?php _e($category->name); ?>\n </option>\n <?php endforeach; ?>\n </select>\n\n<?php\n // set up image for the first category\n $image = '';\n if(isset($instance['image1']))\n {\n $image = $instance['image1'];\n }\n?>\n\n <p class=\"an-catlinks-image-demo\">\n <label for=\"<?php _e($this->get_field_name( 'image1' )); ?>\"><?php _e( 'Image 1:', 'an_catlinks_wiget' ); ?></label>\n\n <input name=\"<?php _e($this->get_field_name( 'image1' )); ?>\"\n id=\"<?php _e($this->get_field_id( 'image1' )); ?>\"\n class=\"widefat\" type=\"text\" size=\"36\"\n value=\"<?php _e(esc_url( $image )); ?>\" />\n <img src=\"<?php _e(esc_url( $image )); ?>\" style=\"max-width: 100%; height: auto; background: <?php _e($bg_color); ?>\" />\n <input class=\"upload_image_button\" type=\"button\" value=\"<?php _e('Upload Image','an_catlinks_wiget'); ?>\" />\n </p>\n\n <!-- 2nd category and image -->\n<?php\n $cat = 0;\n if (isset($instance['cat2'])) {\n $cat = $instance['cat2'];\n }\n?>\n <label for=\"<?php _e($this->get_field_id('cat2')); ?>\"><?php esc_html__(\"Category 2\", \"an_catlinks_wiget\"); ?></label>\n <select id=\"<?php _e($this->get_field_id('cat2')); ?>\" name=\"<?php _e($this->get_field_name('cat2')); ?>\" class=\"widefat\" width=\"100%\">\n <option value-\"0\"><?php _e('(not selected)', 'an_catlinks_wiget'); ?></option>\n <?php foreach(get_terms('category','parent=0&hide_empty=0') as $category): ?>\n <option <?php $cat == $category->term_id ? _e(\"selected\") : _e(\"\"); ?> value=\"<?php _e($category->term_id); ?>\">\n <?php _e($category->name); ?>\n </option>\n <?php endforeach; ?>\n </select>\n\n<?php\n $image = '';\n if(isset($instance['image2']))\n {\n $image = $instance['image2'];\n }\n?>\n\n <p class=\"an-catlinks-image-demo\">\n <label for=\"<?php _e($this->get_field_name( 'image2' )); ?>\"><?php _e( 'Image 2:', 'an_catlinks_wiget' ); ?></label>\n\n <input name=\"<?php _e($this->get_field_name( 'image2' )); ?>\"\n id=\"<?php _e($this->get_field_id( 'image2' )); ?>\"\n class=\"widefat\" type=\"text\" size=\"36\"\n value=\"<?php _e(esc_url( $image )); ?>\" />\n <img src=\"<?php _e(esc_url( $image )); ?>\" style=\"max-width: 100%; height: auto;background: <?php _e($bg_color); ?>\" />\n <input class=\"upload_image_button\" type=\"button\" value=\"<?php _e('Upload Image','an_catlinks_wiget'); ?>\" />\n </p>\n\n <!-- 3rd category and image -->\n\n <?php\n $cat = 0;\n if (isset($instance['cat3'])) {\n $cat = $instance['cat3'];\n }\n ?>\n <label for=\"<?php _e($this->get_field_id('cat3')); ?>\"><?php esc_html__(\"Category 3\", \"an_catlinks_wiget\"); ?></label>\n\n <select id=\"<?php _e($this->get_field_id('cat3')); ?>\" name=\"<?php _e($this->get_field_name('cat3')); ?>\" class=\"widefat\" width=\"100%\">\n <option value-\"0\"><?php _e('(not selected)', 'an_catlinks_wiget'); ?></option>\n <?php foreach(get_terms('category','parent=0&hide_empty=0') as $category): ?>\n <option <?php $cat == $category->term_id ? _e(\"selected\") : _e(\"\"); ?> value=\"<?php _e($category->term_id); ?>\">\n <?php _e($category->name); ?>\n </option>\n <?php endforeach; ?>\n </select>\n\n<?php\n $image = '';\n if(isset($instance['image3']))\n {\n $image = $instance['image3'];\n }\n?>\n\n <p class=\"an-catlinks-image-demo\">\n <label for=\"<?php _e($this->get_field_name( 'image3' )); ?>\"><?php _e( 'Image 3:', 'an_catlinks_wiget' ); ?></label>\n\n <input name=\"<?php _e($this->get_field_name( 'image3' )); ?>\"\n id=\"<?php _e($this->get_field_id( 'image3' )); ?>\"\n class=\"widefat\" type=\"text\" size=\"36\"\n value=\"<?php _e(esc_url( $image )); ?>\" />\n <img src=\"<?php _e(esc_url( $image )); ?>\" style=\"max-width: 100%; height: auto;background: <?php _e($bg_color); ?>\" />\n <input class=\"upload_image_button\" type=\"button\" value=\"<?php _e('Upload Image','an_catlinks_wiget'); ?>\" />\n </p>\n </div>\n <script>\n\n (function($) {\n\n $(document).ready(function() {\n $('.color-picker').wpColorPicker({\n change: function(event, ui) {\n $(this).parent().trigger('change');\n\n if ($(this).hasClass('an-catlist-bg-color-picker')) {\n $('.an-catlinks-image-demo img').css('background',$(this).val());\n }\n },\n\n clear: function(event) {\n $(this).parent().trigger('change');\n\n if ($(this).hasClass('an-catlist-bg-color-picker')) {\n $('.an-catlinks-image-demo img').css('background','transparent');\n }\n }\n\n });\n\n });\n }\n )(jQuery);\n\n </script>\n\n<?php\n\n }", "function script_on_submit()\n\t{\n\t\treturn '';\n\t}", "public function on_after_submit() {\n\t\t\n\t\t/*\n\t\t$post = array();\n\t\t$post['cm-name'] = $this->controller->questionAnswerPairs['1']['answer'].' '.$this->controller->questionAnswerPairs['2']['answer'];\n\t\t$post['cm-itutkr-itutkr'] = $this->controller->questionAnswerPairs['3']['answer'];\n\t\t\t\t\t\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 0);\n\t\tcurl_setopt($ch, CURLOPT_URL, 'http://url.to.my.campaignmonitor/myform');\n\t\t//Don't ask me what this does, I just know that without this funny header, the whole thing doesn't work!\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER,array('Expect:'));\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1 );\n\t\t\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $post );\n\t\t\n\t\t$url = curl_exec( $ch );\n\t\tcurl_close ($ch);\n\t\t*/\n\t}", "public function get_category_form_by_ajax() {\n $category_count = $_POST['id'];\n $data['category_id'] = $category_count;\n $data['category_branch_location'] = $this->get_branch_location();\n $data['get_printer'] = $this->get_printer();\n $this->load->view('restaurant/category/insert_category_form', $data);\n }", "static function change_tld_with_javascript() {\n ?>\n <script async defer>\n // Replace tld placeholder\n jQuery('.form-table .form-field td span').eq(0).html('.<?php echo self::get_multisite_tld(); ?>');\n\n // Hack inside hack: Replace links to newly created site\n $link = jQuery('#message.updated a').eq(0);\n if ( $link.length > 0) {\n $link.attr(\"href\", $link.attr(\"href\").replace('<?php echo DOMAIN_CURRENT_SITE; ?>','<?php echo self::get_multisite_tld(); ?>') )\n }\n </script>\n <?php\n }", "protected function afterSave()\n\t{\n\t\tparent::afterSave();\n\t\tif(!$this->status == 1){\n\t\t$title = $this->howtoTitle($this->id);\n\t\t$tags = $this->tagLinks();\n\t\t$title = CHtml::link('Created '.$title , array('/howto/' . $this->id . '/' . $title ) );\n\t\t$shortText = substr($this->content,0,160);\n\t\t$content = $shortText.\"...<br/>Tags:\";\n\t\tforeach($tags as $tag){\n\t\t\t$content .=\" \".$tag.\",\";\n\t\t}\n\t\tAction::newAction($content,$title);\n\t\t}\n\t\t\n\t}", "public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpdb->insert_id;\n\t\t} else\n\t\t\t$wpdb->update(FAQBUILDDBCATEGORY,$this->toArray(true),array(\"category_id\"=>$this->category_id),$types,array(\"%d\"));\n\t}", "function add_new_category()\n\t{\n\t\t$this->data['title'] \t= 'Add New Portfolio Category';\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/add_new_category';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "function postflight($type, $parent) \n {\n /* I fix lft and rgt attribute in the #__categories for the created categories */\n self::fixCategoryAttributes();\n }", "function submit(){\n\t$parent_category = $this->uri->segment(4);\n\tif (!is_numeric($parent_category)){\n\t\t$parent_category = 0;\n\t}\n\n\t$this->form_validation->set_rules('category_name', 'Category Name', 'required');\n\n\tif ($this->form_validation->run() == FALSE){\n\t\t$this->create();\n\t} else {\n\n\t\t$update_id = $this->uri->segment(3);\n\n\t\tif ($update_id > 0){\n\t\t\t//This is an update\n\t\t\t$data = $this->get_data_from_post();\n\t\t\t$data['category_url'] = url_title($data['category_name']);\n\t\t\t$this->update($update_id, $data);\n\t\t\t$value = \"<p style = 'color: green;'>The category was successfully updated.</p>\";\n\t\t\t$parent_category = $update_id;\n\t\t} else {\n\t\t\t//Create new record\n\t\t\t$data = $this->get_data_from_post();\n\t\t\t$data['category_url'] = url_title($data['category_name']);\n\t\t\t$data['parent_category'] = $parent_category;\n\t\t\t$this->insert($data);\n\t\t\t$value = \"<p style = 'color: green;'>The category was successfully created.</p>\";\n\t\t\t$update_id = $this->get_max();\n\n\t\t\t$this->session->set_flashdata('category', $value);\n\t\t\t\n\t\t}\n\t\t//add flashdata\n\t\t$this->session->set_flashdata('category', $value);\t\n\n\t\tredirect ('store_categories/manage/'.$parent_category);\n\t\t\n\t}\n}", "function work_category_add_new_meta_field() {\r\n\t\t$textdomain = 'milk';\r\n\t\t?>\r\n\t \t\t<div class=\"row\">\r\n\t \t\t\t<p class=\"col-md-6 desc\" >\r\n\t \t\t\t\t<label for=\"term_meta[featured_img]\"><?php _e( \"Featured Image\", $textdomain ); ?></label>\r\n\t \t\t\t\t<br/>\r\n\t \t\t\t\t<label for=\"term_meta[featured_img]\"><?php _e( \"If you choose to show work categories on work page instead of works, you need to upload featured image for category\", $textdomain ); ?></label>\r\n\t \t\t\t</p>\r\n\t\t\t \r\n\t\t\t\t<div class=\"col-md-6\">\r\n\t\t\t\t\t<input \tclass=\"post_meta_image_upload button button-primary\" \r\n\t\t\t\t\t\tname=\"image_btn\" \r\n\t\t\t\t\t\ttype=\"button\" \r\n\t\t\t\t\t\tdata-uploader_title=<?php _e( \"Choose image\", $textdomain ); ?>\r\n\t\t\t\t\t\tdata-uploader_button_text=<?php _e( \"Select\" , $textdomain ); ?>\r\n\t\t\t\t\t\tvalue=<?php _e( \"Select images\", $textdomain ); ?>/>\r\n\t\t\t\t\t<input id=\"term_meta[featured_img]\"\r\n\t\t\t\t\t\tname=\"term_meta[featured_img]\"\r\n\t\t\t\t\t\tclass=\"img_url\" \r\n\t\t\t\t\t\ttype=\"text\"\r\n\t\t\t\t\t\tstyle=\"display:none\"\r\n\t\t\t\t\t\tvalue=\"\"/>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"row\">\r\n\t\t\t \t<p class=\"col-md-6 desc\" >\r\n\t \t\t\t\t<label for=\"term_meta[work_color]\"><?php _e( \"Acent Color\", $textdomain ); ?></label>\r\n\t \t\t\t\t<br/>\r\n\t \t\t\t\t<label for=\"term_meta[work_color]\"><?php _e( \"If you choose to show work categories on work page instead of works, you need to select accent color for work categorie preview\", $textdomain ); ?></label>\r\n\t \t\t\t</p>\r\n\t \t\t\t<div class=\"col-md-6\">\r\n\t\t \t\t\t<input name=\"term_meta[work_color]\" \r\n\t\t\t\t \t\ttype=\"text\" \r\n\t\t\t\t \t\tclass=\"colorPicker\"\r\n\t\t\t\t \t\tid=\"term_meta[work_color]\" \r\n\t\t\t\t \t\tvalue=\"\"\r\n\t\t\t\t \t\tdata-default-color=\"#49b4ff\">\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t<?php }", "function edit_category() {\r\n\r\n\tif(isset($_POST['editcategory'])){\r\n\r\n\t\t$cat_id\t\t\t\t= clean_input($_GET['cat_id']);\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\r\n\r\n\t\t$xyquery = \"UPDATE categories SET \";\r\n\t\t$xyquery .= \"cat_name = '$cat_name',\";\r\n\t\t$xyquery .= \"cat_desc_short = '$cat_desc_short'\";\r\n\t\t$xyquery .= \",cat_desc_long = '$cat_desc_long'\";\r\n\t\t$xyquery .= \",cat_parent_id = '$cat_parent_id'\";\r\n\t\t$xyquery .= \",cat_url = '$cat_url'\";\r\n\t\t$xyquery .= \",cat_mod = '$cat_mod'\";\r\n\t\t$xyquery .= \",cat_mod_by = '$cat_mod_by'\";\r\n\t\t$xyquery .= \",page_template = '$page_template'\";\r\n\t\t$xyquery .= \",cat_meta_title = '$cat_meta_title'\";\r\n\t\t$xyquery .= \",cat_meta_keywords = '$cat_meta_keywords'\";\r\n\t\t$xyquery .= \",cat_meta_description = '$cat_meta_description'\";\r\n\t\t$xyquery .= \",insert_keywords = '$insert_keywords'\";\t\t\t\t\r\n\t\t$xyquery .= \"WHERE cat_id = '$cat_id'\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" been edited!</h4></center>\";\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been modified.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "public function process(isys_cmdb_dao_category $p_cat)\n {\n // Initializing some variables.\n $l_rules = [];\n $l_catdata = $p_cat->get_general_data();\n $l_locales = isys_locale::get_instance();\n\n switch ($l_catdata['isys_jdisc_ca_type__const'])\n {\n case 'C__JDISC__CA_TYPE__DATE':\n $l_catdata['isys_catg_jdisc_ca_list__content'] = $l_locales->fmt_date($l_catdata['isys_catg_jdisc_ca_list__content']);\n break;\n case 'C__JDISC__CA_TYPE__CURRENCY':\n $l_catdata['isys_catg_jdisc_ca_list__content'] = $l_locales->fmt_numeric(((float) $l_catdata['isys_catg_jdisc_ca_list__content'] / 100));\n break;\n default:\n break;\n }\n $this->fill_formfields($p_cat, $l_rules, $l_catdata);\n\n // Apply rules.\n $this->get_template_component()\n ->smarty_tom_add_rules(\"tom.content.bottom.content\", $l_rules);\n }", "function add_category() {\r\n\r\n\tif(isset($_POST['addcategory'])){\r\n\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\tif(empty($_POST['cat_parent_id'])){$cat_parent_id\t\t= \"0\";}\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\t\r\n\r\n\t\t$xyquery = \"INSERT INTO categories (\";\r\n\r\n\t\tif (!empty($cat_name)){$xyquery .= \"cat_name \";}\r\n\t\tif (!empty($cat_desc_short)){$xyquery .= \",cat_desc_short \";}\r\n\t\tif (!empty($cat_desc_long)){$xyquery .= \",cat_desc_long \";}\r\n\t\tif (!empty($cat_parent_id)){$xyquery .= \",cat_parent_id\";}\r\n\t\tif (empty($cat_parent_id)){$xyquery .= \",cat_parent_id\";}\r\n\t\tif (!empty($cat_url)){$xyquery .= \",cat_url\";}\r\n\t\t$xyquery .= \",cat_date\";\r\n\t\t$xyquery .= \",cat_mod\";\r\n\t\t$xyquery .= \",cat_mod_by\";\r\n\t\tif (!empty($page_template)){$xyquery .= \",page_template\";}\r\n\t\tif (!empty($cat_meta_title)){$xyquery .= \",cat_meta_title\";}\r\n\t\tif (!empty($cat_meta_keywords)){$xyquery .= \",cat_meta_keywords\";}\r\n\t\tif (!empty($cat_meta_description)){$xyquery .= \",cat_meta_description\";}\t\t\t\t\r\n\r\n\t\t$xyquery .= \") VALUES ( \";\r\n\r\n\t\tif (!empty($cat_name)){$xyquery .= \"'$cat_name' \";}\r\n\t\tif (!empty($cat_desc_short)){$xyquery .= \",'$cat_desc_short' \";}\r\n\t\tif (!empty($cat_desc_long)){$xyquery .= \",'$cat_desc_long' \";}\r\n\t\tif (!empty($cat_parent_id)){$xyquery .= \",'$cat_parent_id' \";\t}\r\n\t\tif (empty($cat_parent_id)){$xyquery .= \",'0' \";\t}\r\n\t\tif (!empty($cat_url)){$xyquery .= \",'$cat_url' \";}\r\n\t\t$xyquery .= \",NOW() \";\r\n\t\t$xyquery .= \",NOW() \";\r\n\t\t$xyquery .= \",'$cat_mod_by' \";\r\n\t\tif (!empty($page_template)){$xyquery .= \",'$page_template' \";}\r\n\t\tif (!empty($cat_meta_title)){$xyquery .= \",'$cat_meta_title' \";}\r\n\t\tif (!empty($cat_meta_keywords)){$xyquery .= \",'$cat_meta_keywords' \";}\r\n\t\tif (!empty($cat_meta_description)){$xyquery .= \",'$cat_meta_description' \";}\r\n\t\tif (!empty($insert_keywords)){$xyquery .= \",'$insert_keywords' \";}\t\t\t\t\r\n\r\n\t\t$xyquery .= \" )\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" has been created!</h4></center>\";\r\n\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been created.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "function classiera_theme_settings_page() {\r\n global $themename,$theme_options;\r\n\t$i = 0;\r\n $message = ''; \r\n\r\n if ( 'savecat' == $_REQUEST['action'] ) {\r\n\t\t\r\n\t\t//print_r($_POST);exit();\r\n $args = array(\r\n\t\t\t 'orderby' => 'name',\r\n\t\t\t 'order' => 'ASC',\r\n\t\t\t 'hide_empty' => false\r\n\t\t);\r\n\t\t$categories = get_categories($args);\r\n\t\tforeach($categories as $category) {\r\n\t\t\t$user_id = $category->term_id;\r\n $tag_extra_fields = get_option(MY_CATEGORY_FIELDS);\r\n\t\t $tag_extra_fields[$user_id]['category_custom_fields'] = $_POST['wpcrown_category_custom_field_option_'.$user_id];\r\n\t\t\t$tag_extra_fields[$user_id]['category_custom_fields_type'] = $_POST['wpcrown_category_custom_field_type_'.$user_id];\t\t\t\r\n\t\t update_option(MY_CATEGORY_FIELDS, $tag_extra_fields);\r\n }\r\n $message='saved';\r\n }\r\n ?>\r\n\r\n <div class=\"wrap\">\r\n <div id=\"icon-options-general\"></div>\r\n <h2><?php esc_html_e('Categories Custom Fields', 'classiera') ?></h2>\r\n <?php\r\n if ( $message == 'saved' ) echo '<div class=\"updated settings-error\" id=\"setting-error-settings_updated\"> \r\n <p>Custom Fields saved.</strong></p></div>';\r\n ?>\r\n </div>\r\n\r\n <form method=\"post\">\r\n\r\n <div class=\"wrap\">\r\n <h3><?php esc_html_e('Select category:', 'classiera') ?></h3>\r\n\r\n <select id=\"select-author\">\r\n \t<?php \r\n\r\n\t \t$cat_args = array ( 'parent' => 0, 'hide_empty' => false, 'orderby' => 'name','order' => 'ASC' ) ;\r\n\t \t$parentcategories = get_categories($cat_args ) ;\r\n\t \t$no_of_categories = count ( $parentcategories ) ;\r\n\t\t\t\t\t\r\n\t\t\t if ( $no_of_categories > 0 ) {\r\n\t\t\t\t\techo '<option value=\"All\" selected disabled>'.esc_html__('Select Category', 'classiera').\"</option>\";\r\n\t\t\t foreach ( $parentcategories as $parentcategory ) {\r\n\t\t\t \r\n\t\t\t echo '<option value=' . $parentcategory->term_id . '>' . $parentcategory->name . '</option>';\r\n\t\t\t \r\n\t\t\t $parent_id = $parentcategory ->term_id;\r\n\t\t\t $subcategories = get_categories(array ( 'child_of' => $parent_id, 'hide_empty' => false ) ) ;\r\n\t\t\t \r\n\t\t\t foreach ( $subcategories as $subcategory ) { \r\n\t\t\t \r\n\t\t\t $args = array (\r\n\t\t\t 'post-type'=> 'questions',\r\n\t\t\t 'orderby'=> 'name',\r\n\t\t\t 'order'=> 'ASC',\r\n\t\t\t 'post_per_page'=> -1,\r\n\t\t\t 'nopaging'=> 'true',\r\n\t\t\t 'taxonomy_name'=> $subcategory->name\r\n\t\t\t ); \r\n\t\t\t \r\n\t\t\t echo '<option value=' . $subcategory->term_id . '> - ' . $subcategory->name . '</option>';\r\n\t\t\t \r\n\t\t\t } \r\n\t\t\t }\r\n\t\t\t } \r\n ?>\r\n </select>\r\n\t\t<p>NOTE: <br/> Text fields will display as input type=text,<br/> Checkbox Will show as features and input type=checkbox,<br/> Dropdown will display as < select >, <br/>Add options for dropdown with comma sepration like option1,option2,option3</p>\r\n </div>\r\n\r\n <div class=\"wrap\">\r\n \t<?php\r\n \t$args = array(\r\n \t 'hide_empty' => false,\r\n\t\t\t 'orderby' => 'name',\r\n\t\t\t 'order' => 'ASC'\r\n\t\t\t);\r\n\r\n\t\t\t$inum = 0;\r\n\r\n\t\t\t$categories = get_categories($args);\r\n\t\t\t \tforeach($categories as $category) {;\r\n\r\n\t\t\t \t$inum++;\r\n\r\n \t\t$user_name = $category->name;\r\n \t\t$user_id = $category->term_id; \r\n\r\n\r\n \t\t$tag_extra_fields = get_option(MY_CATEGORY_FIELDS);\r\n\t\t\t\t$wpcrown_category_custom_field_option = $tag_extra_fields[$user_id]['category_custom_fields'];\r\n\t\t\t\t$wpcrown_category_custom_field_type = $tag_extra_fields[$user_id]['category_custom_fields_type'];\r\n ?>\r\n\r\n <div id=\"author-<?php echo $user_id; ?>\" class=\"wrap-content\" <?php if($inum == 1) { ?>style=\"display: block;\"<?php } else { ?>style=\"display: none;\"<?php } ?>>\r\n\r\n <h4><?php esc_html_e('Add Custom Fields to: ', 'classiera') ?><?php echo $user_name; ?></h4>\r\n\t\r\n <div id=\"badge_criteria_<?php echo $user_id; ?>\">\r\n\t\t\t\t<table class=\"maintable\">\r\n\t\t\t\t\t<tr class=\"custcathead\">\r\n\t\t\t\t\t\t<th class=\"eratd\"><span class=\"text ingredient-title\"><?php esc_html_e( 'Custom field title', 'classiera' ); ?></span></th>\r\n\t\t\t\t\t\t<th class=\"eratd2\"><span class=\"text ingredient-title\"><?php esc_html_e( 'Input Type:', 'classiera' ); ?></span></th>\r\n\t\t\t\t\t\t<th class=\"eratd3\"></th>\r\n\t\t\t\t\t\t<th class=\"eratd4\"><span class=\"text ingredient-title\"><?php esc_html_e( 'Delete', 'classiera' ); ?></span></th>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n <?php \r\n for ($i = 0; $i < (count($wpcrown_category_custom_field_option)); $i++) {\r\n\t\t\t\t\t//echo $wpcrown_category_custom_field_option.\"shabir\";\r\n ?>\r\n\t\t\t\t<div class=\"badge_item\" id=\"<?php echo $i; ?>\">\r\n\t\t\t\t\t<table class=\"maintable\" >\r\n\t\t\t\t\t\t<tr> \r\n\t\t\t\t\t\t\t<td class=\"eratd\">\r\n\t\t\t\t\t\t\t\t<input type='text' id='wpcrown_category_custom_field_option_<?php echo $user_id ?>[<?php echo $i; ?>][0]' name='wpcrown_category_custom_field_option_<?php echo $user_id ?>[<?php echo $i; ?>][0]' value='<?php if (!empty($wpcrown_category_custom_field_option[$i][0])) echo $wpcrown_category_custom_field_option[$i][0]; ?>' class='badge_name' placeholder='Add Title for Field'>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t<td class=\"eratd2\">\r\n\t\t\t\t\t\t\t\t<input class='field_type_<?php echo $user_id; ?>' type=\"radio\" name=\"wpcrown_category_custom_field_type_<?php echo $user_id ?>[<?php echo $i; ?>][1]\"\r\n\t\t\t\t\t\t\t\t\t<?php if (!empty($wpcrown_category_custom_field_type[$i][1]) && $wpcrown_category_custom_field_type[$i][1] == \"text\") echo \"checked\";?>\r\n\t\t\t\t\t\t\t\t\tvalue=\"text\" >Text Field<br />\r\n\t\t\t\t\t\t\t\t\t<input class='field_type_<?php echo $user_id; ?>' type=\"radio\" name=\"wpcrown_category_custom_field_type_<?php echo $user_id ?>[<?php echo $i; ?>][1]\"\r\n\t\t\t\t\t\t\t\t\t<?php if (!empty($wpcrown_category_custom_field_type[$i][1]) && $wpcrown_category_custom_field_type[$i][1] == \"checkbox\") echo \"checked\";?>\r\n\t\t\t\t\t\t\t\t\tvalue=\"checkbox\">Checkbox<br />\r\n\t\t\t\t\t\t\t\t\t<input class='field_type_<?php echo $user_id; ?>' type=\"radio\" name=\"wpcrown_category_custom_field_type_<?php echo $user_id ?>[<?php echo $i; ?>][1]\"\r\n\t\t\t\t\t\t\t\t\t<?php if (!empty($wpcrown_category_custom_field_type[$i][1]) && $wpcrown_category_custom_field_type[$i][1] == \"dropdown\") echo \"checked\";?>\r\n\t\t\t\t\t\t\t\t\tvalue=\"dropdown\">Dropdown<br />\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t$none = 'style=\"display:none\"';\r\n\t\t\t\t\t\t\t\t\tif (!empty($wpcrown_category_custom_field_type[$i][1]) && $wpcrown_category_custom_field_type[$i][1] == \"dropdown\"){ \r\n\t\t\t\t\t\t\t\t\t\t$none = '';\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t<td class=\"eratd3\">\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<input <?php echo $none; ?> type='text' id='option_<?php echo $user_id ?>' name=\"wpcrown_category_custom_field_type_<?php echo $user_id ?>[<?php echo $i; ?>][2]\" value='<?php echo $wpcrown_category_custom_field_type[$i][2]; ?>' class='options_c options_c_<?php echo $user_id; ?>' placeholder=\"Add Options with Comma , separated Example: One,Two,Three\">\r\n\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t<td class=\"eratd4\">\r\n\t\t\t\t\t\t\t\t<button name=\"button_del_badge\" type=\"button\" class=\"button-secondary button_del_badge_<?php echo $user_id; ?>\">Delete</button>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t</tr> \r\n\t\t\t\t\t</table>\r\n\t\t\t\t</div>\r\n \r\n <?php \r\n }\r\n ?>\r\n </div>\r\n\r\n <div id=\"template_badge_criterion_<?php echo $user_id; ?>\" style=\"display: none;\">\r\n \r\n\t\t\t\t<div class=\"badge_item\" id=\"999\">\r\n\t\t\t\t\t<table class=\"maintable\">\r\n\t\t\t\t\t\t<tr> \r\n\t\t\t\t\t\t\t<td class=\"eratd\">\r\n\t\t\t\t\t\t\t <input type='text' id='' name='' value='' class='badge_name' placeholder='Add Title for Field'>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t<td class=\"eratd2\">\r\n\t\t\t\t\t\t\t\t<input checked=\"cheched\" type=\"radio\" name=\"\" value=\"text\" class='field_type field_type_<?php echo $user_id; ?>'>Text Field<br />\r\n\t\t\t\t\t\t\t\t<input type=\"radio\" name=\"\" value=\"checkbox\" class='field_type field_type_<?php echo $user_id; ?>'>Checkbox<br />\r\n\t\t\t\t\t\t\t\t<input type=\"radio\" name=\"\" value=\"dropdown\" class='field_type field_type_<?php echo $user_id; ?>'>Dropdown<br />\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t<td class=\"eratd3\">\r\n\t\t\t\t\t\t\t\t <input style=\"display:none\" type='text' id='option_<?php echo $user_id ?>' name='' value='' class='options_c options_c_<?php echo $user_id; ?>' placeholder=\"Add Options with Comma , separated Example: One,Two,Three\">\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t<td class=\"eratd4\">\r\n\t\t\t\t\t\t\t\t<button name=\"button_del_badge\" type=\"button\" class=\"button-secondary button_del_badge_<?php echo $user_id; ?>\">Delete</button>\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t</div>\r\n </div>\r\n\t\t\t<table class=\"maintable\">\r\n\t\t\t\t<tr class=\"custcathead\">\r\n\t\t\t\t\t<th class=\"eratd\"><span class=\"text ingredient-title\"><?php esc_html_e( 'Custom field title', 'classiera' ); ?></span></th>\r\n\t\t\t\t\t<th class=\"eratd2\"><span class=\"text ingredient-title\"><?php esc_html_e( 'Input Type:', 'classiera' ); ?></span></th>\r\n\t\t\t\t\t<th class=\"eratd3\"></th>\r\n\t\t\t\t\t<th class=\"eratd4\"><span class=\"text ingredient-title\"><?php esc_html_e( 'Delete', 'classiera' ); ?></span></th>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\r\n <fieldset class=\"input-full-width\">\r\n <button type=\"button\" name=\"submit_add_badge\" id='submit_add_badge_<?php echo $user_id; ?>' value=\"add\" class=\"button-secondary\">Add new custom field</button>\r\n </fieldset>\r\n <span class=\"submit\"><input name=\"save<?php echo $user_id; ?>\" type=\"submit\" class=\"button-primary\" value=\"Save changes\" /></span>\r\n\r\n <script>\r\n\r\n // Add Badge\r\n\r\n jQuery('#template_badge_criterion_<?php echo $user_id; ?>').hide();\r\n jQuery('#submit_add_badge_<?php echo $user_id; ?>').on('click', function() { \r\n $newItem = jQuery('#template_badge_criterion_<?php echo $user_id; ?> .badge_item').clone().appendTo('#badge_criteria_<?php echo $user_id; ?>').show();\r\n if ($newItem.prev('.badge_item').size() == 1) {\r\n var id = parseInt($newItem.prev('.badge_item').attr('id')) + 1;\r\n } else {\r\n var id = 0; \r\n }\r\n $newItem.attr('id', id);\r\n\r\n var nameText = 'wpcrown_category_custom_field_option_<?php echo $user_id; ?>[' + id + '][0]';\r\n $newItem.find('.badge_name').attr('id', nameText).attr('name', nameText);\r\n\t\t\t\t\r\n\t\t\t\tvar nameText2 = 'wpcrown_category_custom_field_type_<?php echo $user_id; ?>[' + id + '][1]';\r\n\t\t\t\t\t\t\t$newItem.find('.field_type').attr('id', nameText2).attr('name', nameText2);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\tvar nameText3 = 'wpcrown_category_custom_field_type_<?php echo $user_id; ?>[' + id + '][2]';\r\n\t\t\t\t\t\t\t$newItem.find('.options_c').attr('name', nameText3);\r\n\r\n //event handler for newly created element\r\n jQuery('.button_del_badge_<?php echo $user_id; ?>').on('click', function () {\r\n jQuery(this).closest('.badge_item').remove();\r\n });\r\n\r\n });\r\n \r\n // Delete Ingredient\r\n jQuery('.button_del_badge_<?php echo $user_id; ?>').on('click', function() {\r\n jQuery(this).closest('.badge_item').remove();\r\n });\r\n\r\n\t\t\t\t// Delete Ingredient\r\n\t\t\t jQuery( document ).ready(function() {\r\n\t\t\t\t\tjQuery(document).on('click', '.field_type_<?php echo $user_id; ?>', function(e) {\r\n\t\t\t\t\tvar val = jQuery(this).val();\r\n\t\t\t\t\t\tif(val == 'dropdown'){\r\n\t\t\t\t\t\t\tjQuery(this).parent().next('td').find('#option_<?php echo $user_id ?>').css('display','block');\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tjQuery(this).parent().next('td').find('#option_<?php echo $user_id ?>').css('display','none');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n </script>\r\n </div>\r\n <?php } ?>\r\n </div>\r\n\r\n <input type=\"hidden\" name=\"action\" value=\"savecat\" />\r\n </form>\r\n\r\n <?php\r\n}", "public function category_add() {\n\t\t// Setup validation\n\t\t$this->data['validation'] = \"\";\n\t\t$this->data['category']\t= array('name' => '', 'url_name' => '');\n\t\t\n\t\t// Handle POST\n\t\tif ($this->mojo->input->post('category')) {\n\t\t\t// Get the category data\n\t\t\t$this->data['category']\t= $this->mojo->input->post('category');\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert_category($this->data['category'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/categories_all');\n\t\t\t\t$response['message'] = 'Successfully created category';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Show the view\n\t\t$this->_view('category_add');\n\t}", "public function add_cat() { \n\t\tif (!$this->input->is_ajax_request()) {\n\t\t\tdie();\n\t\t}\n\t\t$main_cat_id = $this->input->post('main_cat_id');\n\t\t$title = $this->input->post('title'); \n\n\n\t\t$array_data['main_cat_id'] = $main_cat_id ; \n\t\t$array_data['title'] = $title ; \n\t\t$this->db->insert(\"categories\" , $array_data); \n\t\t$result = array('statu' => 'ok');\n\t\techo json_encode($result);\n\n\t}", "function do_ajax_edit_impr_text($textid, $wordlc) \n{\n chdir('..');\n\n list($html_content, $js_content) = make_form($textid, $wordlc);\n if ($wordlc == '') {\n echo \"$('#editimprtextdata').html(\" . prepare_textdata_js($html_content) . \");\"; \n } else {\n echo $js_content; \n }\n}", "function widget_ffes_feed_control() {\r\n $options = $newoptions = get_option('widget_ffes_feed');\r\n if ( $_POST['ffes-feed-submit'] ) {\r\n $newoptions['title'] = strip_tags(stripslashes($_POST['ffes-feed-title']));\r\n }\r\n if ( $options != $newoptions ) {\r\n $options = $newoptions;\r\n update_option('widget_ffes_feed', $options);\r\n }\r\n ?>\r\n <div style=\"text-align:right\">\r\n <label for=\"ffes-feed-title\" style=\"line-height:35px;display:block;\"><?php _e('Widget title:', 'ffes_widgets'); ?>\r\n <input type=\"text\" id=\"ffes-feed-title\" name=\"ffes-feed-title\" value=\"<?php echo wp_specialchars($options['title'], true); ?>\" /></label>\r\n <input type=\"hidden\" name=\"ffes-feed-submit\" id=\"ffes-feed-submit\" value=\"1\" />\r\n </div>\r\n <?php\r\n }", "function categ_url_hack_options() {\n\t\t $redirects = get_option('categ_url_hack');\n\n $categ_redirect = $redirects['categ'];\n\t\t $categ_url_url = $redirects['url'];\n \n $args = array(\n \t'hide_empty' => 0, \n \t'hierarchical' => 1, \n \t'name' => 'categ_url_hack[categ]',\n \t'id' => 'categ_redirect',\n \t'selected' => $categ_redirect,\n \t'show_option_none' => '-- ' . __('No redirect', 'categ_url_hack') . ' --'\n );\n ?>\n \n \n <div class=\"wrap\">\n <div id=\"icon-edit\" class=\"icon32\"></div>\n <h2><?php _e( 'Category redirect settings', 'categ_url_hack' ); ?></h2> \n <form method=\"post\" action=\"options-general.php?page=category-redirect\">\n <p><label for=\"categ_redirect\"><?php _e('Choose a category to redirect', 'categ_url_hack');?></label>&nbsp;<?php wp_dropdown_categories( $args ) ?></p>\n <p><label for=\"categ_url_url\"><?php _e(\"URL to redirect to:\", 'categ_url_hack' ); ?></label>&nbsp;<input type=\"text\" id=\"categ_url_url\" name=\"categ_url_hack[url]\" value=\"<?php echo $categ_url_url; ?>\" placeholder=\"<?php _e('Relative or Absolute URL', 'categ_url_hack' );?>\" size=\"20\">&nbsp;<?php _e(\"eg: /my-page or https://www.smol.org\" ); ?></p> \n \n <p class=\"submit\"><input type=\"submit\" name=\"submit_categ_url\" value=\"<?php _e('Save settings', 'categ_url_hack' ) ?>\" /></p>\n </form>\n </div>\n\t\t<?php\n\t\t}", "function renderJSONcat () {\r\n\t\t$doc = &JFactory::getDocument();\r\n\t\t$doc -> setMimeEncoding('application/json');\r\n\t\t\r\n\t\t// get category params\r\n\t\t$category = $this -> category;\r\n\t\t$catparams = json_decode($category -> params);\r\n\t\t\r\n\t\t// generate urls\r\n\t\t$tmpl = JFactory::getApplication() -> input -> get('tmpl');\r\n\t\t$clayout = JFactory::getApplication() -> input -> get('clayout');\r\n\t\t$limit = JFactory::getApplication() -> input -> get('limit', $this -> pageNav -> limit);\r\n\t\t$limitstart = JFactory::getApplication() -> input -> get('limitstart', 0);\r\n\t\t$url = trim(JURI::base(), \"/\") . JRoute::_(FlexicontentHelperRoute::getCategoryRoute($this -> category -> id));\r\n\t\t$url_json = $url . '?clayout=' . $clayout . '&tmpl=' . $tmpl . '&limit=' . $limit;\r\n\t\t$url_prev = $url_json . '&limitstart=' . ($limitstart - $limit);\r\n\t\t$url_next = $url_json . '&limitstart=' . ($limitstart + $limit);\r\n\t\t\r\n\t\t$json = array('layout' => 'category');\r\n\t\tif($this -> params -> get ('display_cat_id', 1)) $json['id'] = $category -> id;\r\n\t\tif($this -> params -> get ('display_cat_title', 1)) $json['title'] = $category -> title;\r\n\t\tif($this -> params -> get ('display_cat_alias', 1)) $json['alias'] = $category -> alias;\r\n\t\tif($this -> params -> get ('display_cat_description', 1)) $json['description'] = $category -> description;\r\n\t\tif($this -> params -> get ('display_cat_image', 1)) $json['image'] = $catparams -> image ? JURI::base() . $catparams -> image : '';\r\n\t\tif($this -> params -> get ('display_cat_created', 1)) $json['created'] = $category -> created_time;\r\n\t\tif($this -> params -> get ('display_cat_modified', 1)) $json['modified'] = $category -> modified_time;\r\n\t\tif($this -> params -> get ('display_cat_metadesc', 1)) $json['metadesc'] = $category -> metadesc;\r\n\t\tif($this -> params -> get ('display_cat_metakey', 1)) $json['metakey'] = $category -> metakey;\r\n\t\tif($this -> params -> get ('display_cat_url', 1)) $json['url'] = $url;\r\n\t\tif($this -> params -> get ('display_cat_json', 1)) $json['json'] = $url . (strpos($url, '?') ? '&' : '?') . 'clayout=' . $clayout . '&tmpl=' . $tmpl;\r\n\t\tif($this -> params -> get ('display_cat_params', 0)) $json['params'] = $catparams;\r\n\r\n\t\t$json['total_items'] = $this -> pageNav -> total;\r\n\t\t$json['items_per_page'] = $this -> pageNav -> limit;\r\n\t\t$json['current_page'] = $this -> pageNav -> pagesCurrent;\r\n\t\t$json['total_pages'] = $this -> pageNav -> pagesTotal;\r\n\t\t$json['prev_page'] = ($this -> pageNav -> pagesCurrent <= 1 ? '' : $url_prev);\r\n\t\t$json['next_page'] = ($this -> pageNav -> pagesCurrent >= $this -> pageNav -> pagesTotal ? '' : $url_next);\r\n\t\t\r\n\t\t// process category items\r\n\t\t$json['items'] = array();\r\n\t\t\r\n\t\tforeach($this -> items as $item) {\r\n\t\t\t$url = trim(JURI::base(), \"/\") . JRoute::_(FlexicontentHelperRoute::getItemRoute($item -> slug, $item -> categoryslug));\r\n\t\t\t$json_item = array();\r\n\t\t\t$json_item['layout'] = 'item';\r\n\t\t\tif($this -> params -> get ('display_item_id', 1)) $json_item['id'] = $item -> id;\r\n\t\t\tif($this -> params -> get ('display_item_title', 1)) $json_item['title'] = $item -> title;\r\n\t\t\tif($this -> params -> get ('display_item_alias', 1)) $json_item['alias'] = $item -> alias;\r\n\t\t\tif($this -> params -> get ('display_item_author', 1)) $json_item['author'] = $item -> author;\r\n\t\t\tif($this -> params -> get ('display_item_description', 1)) $json_item['description'] = $item -> text;\r\n\t\t\tif($this -> params -> get ('display_item_created', 1)) $json_item['created'] = $item -> created;\r\n\t\t\tif($this -> params -> get ('display_item_modified', 1)) $json_item['modified'] = $item -> modified;\r\n\t\t\tif($this -> params -> get ('display_item_metadesc', 1)) $json_item['metadesc'] = $item -> metadesc;\r\n\t\t\tif($this -> params -> get ('display_item_metakey', 1)) $json_item['metakey'] = $item -> metakey;\r\n\t\t\tif($this -> params -> get ('display_item_url', 1)) $json_item['url'] = $url;\r\n\t\t\tif($this -> params -> get ('display_item_json', 1)) $json_item['json'] = $url . (strpos($url, '?') ? '&' : '?') . 'ilayout=' . $clayout . '&tmpl=' . $tmpl;\r\n\t\t\tif($this -> params -> get ('display_item_params', 0)) $json_item['params'] = json_decode($item -> params);\r\n\t\t\tif($this -> params -> get ('display_item_fields', 1)) {\r\n\t\t\t\t$fields = array();\r\n\t\t\t\tif(isset($item -> positions)) {\r\n\t\t\t\t\tforeach($item -> positions as $position) {\r\n\t\t\t\t\t\tforeach($position as $field) {\r\n\t\t\t\t\t\t\t$fields[$field -> name] = array();\r\n\t\t\t\t\t\t\tif($this -> params -> get ('display_item_field_label', 1)) $fields[$field -> name]['label'] = $field -> label;\r\n\t\t\t\t\t\t\tif($this -> params -> get ('display_item_field_value', 1)) {\r\n\t\t\t\t\t\t\t\t$fields[$field -> name]['value'] = $item -> fields[$field -> name] -> iscore ? $item -> {$field -> name} : $item -> fieldvalues [$field -> id];\r\n\t\t\t\t\t\t\t\t// process serialized data in the value field into arrays\r\n\t\t\t\t\t\t\t\t$value = unserialize($fields[$field -> name]['value']);\r\n\t\t\t\t\t\t\t\tif($value) $fields[$field -> name]['value'] = $value;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif($this -> params -> get ('display_item_field_display', 1)) $fields[$field -> name]['display'] = $field -> display;\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$json_item['fields'] = $fields;\r\n\t\t\t}\r\n\t\t\t$json['items'][] = $json_item;\r\n\t\t}\r\n\t\t\r\n\t\tif (JFactory::getApplication() -> input -> get('callback', '') != '') {\r\n\t\t\treturn JFactory::getApplication() -> input -> get('callback') . '(' . json_encode($json) . ')';\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn json_encode($json);\r\n\t\t}\r\n\t}", "function classiera_implement_ajax(){\t\t\r\n\tif(isset($_POST['mainCat'])){\r\n\t\t$mainCatSlug = $_POST['mainCat'];\r\n\t\t$mainCatIDSearch = get_category_by_slug($mainCatSlug);\r\n\t\t$mainCatID = $mainCatIDSearch->term_id;\r\n\t\t$cat_child = get_term_children($mainCatID, 'category' );\r\n\t\tif (!empty($cat_child)) {\t\r\n\t\t\t$categories= get_categories('child_of='.$mainCatID.'&hide_empty=0');\r\n\t\t\t foreach ($categories as $cat) {\t\t\t\t\r\n\t\t\t\t$option .= '<option value=\"'.$cat->slug.'\">';\r\n\t\t\t\t$option .= $cat->cat_name;\t\t\t\t\r\n\t\t\t\t$option .= '</option>';\r\n\t\t\t }\r\n\t\t\t echo '<option value=\"-1\" selected=\"selected\" disabled=\"disabled\">'.esc_html__( \"Select Sub Category..\", \"classiera\" ).'</option>'.$option;\r\n\t\t\tdie();\r\n\t\t}else{\r\n\t\t\techo '<option value=\"-1\" disabled=\"disabled\">'.esc_html__( \"No Sub Category Found\", \"classiera\" ).'</option>';\r\n\t\t}\r\n\t} // end if\r\n}", "public function afterSubmit() {\n\t\t$this->setValue($this->serializeData($this->getValue()));\n\t}", "function gecapa_mant_BeforeShow()\n{\n $gecapa_mant_BeforeShow = true;\n//End gecapa_mant_BeforeShow\n\n//Custom Code @300-8D83BE6B\n// ------------------------- Si agrega una categorža, tomar la categoria padre del QueryString\n global $gecapa_mant;\n\t\n\tIF (!$gecapa_mant->EditMode) {\n\t\t$liCatPadre = CCGetParam(\"pPadre\", 0);\n\t\tif (is_null($liCatPadre) or empty ($liCatPadre)) $liCatPadre = 0;\n\t\t$gecapa_mant->lkNuevo->Visible = False;\n\t\t$gecapa_mant->cat_CodPadre->SetValue($liCatPadre);\n\t}\n if (!isset($_GET[\"pPadre\"]) AND !isset($_GET[\"cat_Codigo\"])) $gecapa_mant->Visible = False;\n if (isset($_GET[\"pPadre\"])) {\n\t\t$gecapa_mant->tbTitulo1->SetValue(\"NUEVA CATEGORIA\"); } \n if (isset($_GET[\"cat_Codigo\"])) {\n\t\t$gecapa_mant->tbTitulo1->SetValue(\"MODIFICACION DE CATEGORIA\"); } \n// -------------------------\n//End Custom Code\n\n//Close gecapa_mant_BeforeShow @288-96845E7F\n return $gecapa_mant_BeforeShow;\n}", "function cat_create_link()\n{\n return Parrot::getInstance()->getUrl(\"admin/category/create\");\n}", "function widget_text_save_callback() {\r\n\t\tglobal $wpdb;\r\n\r\n\t\t$data = $_POST['data'];\r\n\r\n\t\t$vals = explode('&', $data);\r\n\r\n\t\tforeach($vals as $item){\r\n\t\t\t$arr = explode('=', $item);\r\n\t\t\t$key = urldecode($arr[0]);\r\n\t\t\t$val = urldecode($arr[1]);\r\n\t\t\tif(endsWith($key, '[text]')) {\r\n\t\t\t\t// so this a Text Widget submission, continue to process\r\n\t\t\t\t\r\n\t\t\t\t$used_shortcodes = array();\r\n\t\t\t\t$replacements = array();\r\n\t\t\t\t$css = $this->cactus_parse_inlinecss($val, $used_shortcodes, $replacements);\r\n\t\t\t\t\r\n\t\t\t\tfile_put_contents(dirname(__FILE__) . '/log.txt',$css, FILE_APPEND);\r\n\t\t\t\tif($css != ''){\r\n\t\t\t\t\t$new_val = $val;\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach($replacements as $replace){\r\n\t\t\t\t\t\t$new_val = str_replace($replace[0], $replace[1], $new_val);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$widget = str_replace('[text]', '', $key);\r\n\r\n\t\t\t\t\t// update global custom CSS, to be called in every pages\r\n\t\t\t\t\t$global_custom_css = get_option('ct_custom_css');\r\n\t\t\t\t\tif(!isset($global_custom_css) || !is_array($global_custom_css)){\r\n\t\t\t\t\t\t$global_custom_css = array();\r\n\t\t\t\t\t\tadd_option('ct_custom_css', $global_custom_css);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$global_custom_css[$widget] = $css;\r\n\t\t\t\t\tupdate_option('ct_custom_css', $global_custom_css);\r\n\r\n\t\t\t\t\t$shortcodes = get_option('ct_shortcodes_used_in_widgets');\r\n\t\t\t\t\tif(!isset($shortcodes) || !is_array($shortcodes)){\r\n\t\t\t\t\t\t$shortcodes = array();\r\n\t\t\t\t\t\tadd_option('ct_shortcodes_used_in_widgets', $shortcodes);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$shortcodes[$widget] = $used_shortcodes;\r\n\t\t\t\t\tupdate_option('ct_shortcodes_used_in_widgets', $shortcodes);\r\n\r\n\t\t\t\t\tpreg_match('/(.*)\\[(.*)\\]/', $widget, $matches);\r\n\t\t\t\t\t$id_base = substr($matches[1], 7);\r\n\r\n\t\t\t\t\t$widget_options = get_option('widget_' . $id_base);\r\n\r\n\t\t\t\t\t$widget_options[$matches[2]]['text'] = $new_val;\r\n\r\n\t\t\t\t\tupdate_option('widget_' . $id_base, $widget_options);\r\n\r\n\t\t\t\t\t// do this silently. So echo empty;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twp_die(); // this is required to terminate immediately and return a proper response\r\n\t}", "function colorpicker_field_edit_category( $term ) { \r\n\t$color = get_term_meta( $term->term_id, '_category_color', true ); \r\n\t$color = ( ! empty( $color ) ) ? \"#{$color}\" : '#ffffff'; ?> \r\n\t<tr class=\"form-field term-colorpicker-wrap\"> \r\n\t<th scope=\"row\">\r\n\t<label for=\"term-colorpicker\">Select Color</label>\r\n\t</th> \r\n\t<td> \r\n\t<input name=\"_category_color\" value=\"<?php echo $color; ?>\" class=\"colorpicker\" id=\"term-colorpicker\" /> \r\n\t<p class=\"description\">This is the field description where you can tell the user how the color is used in the theme.</p> \r\n\t</td> \r\n\t</tr> <?php }", "function categoryEdit($str=''){\n\tif(startSession() && isset($_SESSION['UserID']))\n\t{\n\n\t\t$myCatID = ($_GET[\"id\"]);\n\t\t# ADD - DateCreated, DateAssigned, LastUpdated to table\n\t\t$sql = \"select CatID, CatTitle, CatType, CatSort, CatDescription, CatVisible\n\t\t\tFROM ma_Categories WHERE CatID = $myCatID ;\";\n\n\t\t$result = mysqli_query(IDB::conn(),$sql) or die(trigger_error(mysqli_error(IDB::conn()), E_USER_ERROR));\n\n\t\tif (mysqli_num_rows($result) > 0)//at least one record!\n\t\t{//show results\n\n\t\t# shows details from a single customer, and preloads their first name in a form.\n\t\t$str .= '\n\t\t<script type=\"text/javascript\" src=\"' . VIRTUAL_PATH . 'include/util.js\"></script>\n\n\t\t<script type=\"text/javascript\">\n\n\t\t\tfunction checkForm(thisForm)\n\n\t\t\t{//check form data for valid info\n\t\t\t\tif(empty(thisForm.FirstName,\"Please Enter Customer\\'s First Name\")){return false;}\n\t\t\t\tif(empty(thisForm.LastName,\"Please Enter Customer\\'s Last Name\")){return false;}\n\t\t\t\tif(!isEmail(thisForm.Email,\"Please Enter a Valid Email\")){return false;}\n\t\t\t\treturn true;//if all is passed, submit!\n\t\t\t}\n\n\t\t</script>';\n\n\n\t\t$str .= '<form action=\"' . THIS_PAGE . '\" method=\"post\" onsubmit=\"return checkForm(this);\">';\n\n\t\t\twhile ($row = mysqli_fetch_assoc($result))\n\t\t\t{//dbOut() function - 'wrapper' to strip slashes, etc. of data leaving db\n\t\t\t\t$catID \t\t\t\t\t\t= dbOut($row['CatID']);\n\t\t\t\t$catTitle \t\t\t= dbOut($row['CatTitle']);\n\t\t\t\t$catType \t\t\t\t\t= dbOut($row['CatType']);\n\t\t\t\t$catSort \t\t\t\t= dbOut($row['CatSort']);\n\t\t\t\t$catDescription\t\t= dbOut($row['CatDescription']);\n\t\t\t\t$catVisible \t\t\t= dbOut($row['CatVisible']);\n\n\t\t\t\t$str .= '<form action=\"' . THIS_PAGE . '\" method=\"post\"\n\t\t\t\t\tonsubmit=\"return checkForm(this);\">\n\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"CatID\" value=\"' . $catID . '\" />\n\n\t\t\t\t\t\t\t<h4 align=\"center\">Edit Catagory (' . $catTitle . ')</h4>\n\n\t\t\t\t\t\t\t<!-- inner container -->\n\t\t\t\t\t\t\t<div class=\"class=\"col-sm-9 pull-right\" style=\"background-color: #aaa;\">\n\n\t\t\t\t\t\t\t\t<!-- left container -->\n\t\t\t\t\t\t\t\t<div class=\"col-sm-8 pull-left\" style=\"background-color: #ddd ;\">\n\n\t\t\t\t\t\t\t\t\t<div class=\"row \">\n\t\t\t\t\t\t\t\t\t\t<div class=\"pull-middle\">\n\n\t\t\t\t\t\t\t\t\t\t\t<select class=\"selectpicker\" name=\"CatType\" required>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"IC\" select=\"select\">Category Type: IC</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"OOC\" >Category Type: OOC</option>\n\t\t\t\t\t\t\t\t\t\t\t</select>\n\n\t\t\t\t\t\t\t\t\t\t\t<select class=\"selectpicker\" name=\"CatSort\" required>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"organization\" select=\"select\">Group By: Indivual</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"team\" >Group By: Group/Team</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"person\" >Group By: Organization</option>\n\t\t\t\t\t\t\t\t\t\t\t</select>\n\n\t\t\t\t\t\t\t\t\t\t\t<select class=\"selectpicker\" name=\"CatSort\" required>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"0\" select=\"select\">Visible: Yes</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"1\" >Visible: No</option>\n\t\t\t\t\t\t\t\t\t\t\t</select>\n\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div><!-- END Container -->\n\n\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\tclass=\"col-sm-12\"\n\t\t\t\t\t\t\t\t\t\t\ttype=\"text\"\n\n\t\t\t\t\t\t\t\t\t\t\tname=\"CatTitle\"\n\t\t\t\t\t\t\t\t\t\t\tvalue=\"' . $catTitle . '\"\n\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"Team/Group/Character Name here\"/>\n\t\t\t\t\t\t\t\t\t</div><!-- END Container -->\n\n\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t\t\t\t\tname=\"CatDescription\"\n\n\t\t\t\t\t\t\t\t\t\t\tclass=\"autoExpand col-sm-12\"\n\t\t\t\t\t\t\t\t\t\t\trows=\"3\"\n\t\t\t\t\t\t\t\t\t\t\tdata-min-rows=\"3\"\n\n\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"Catagroy Description\"\n\t\t\t\t\t\t\t\t\t\t\t>' . $catDescription . '</textarea>\n\t\t\t\t\t\t\t\t\t</div><!-- end container-->\n\n\t\t\t\t\t\t\t\t</div><!-- end inner container -->\n\n\t\t\t\t\t\t\t<div class=\"clearfix\">\n\t\t\t\t\t\t\t\t<br /><br />\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\talign=\"center\"\n\t\t\t\t\t\t\t\tstyle=\"background-color: #a0a;\">\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"act\" value=\"categoryRevise\" />\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t<input class=\"btn btn-primary btn-xs outline\" type=\"submit\" value=\"Edit Catagory\">\n\n\t\t\t\t\t\t\t\t&nbsp; &nbsp;\n\n\t\t\t\t\t\t\t\t<a class=\"btn btn-primary btn-xs outline\" href=\"' . THIS_PAGE . '\">Exit Event</a>';\n\n\t\t\t\t\t\t\t\tif(startSession() && isset($_SESSION['UserID'])){\n\t\t\t\t\t\t\t\t\t$str .= '&nbsp; &nbsp;\n\n\t\t\t\t\t\t\t\t\t<!-- set to invisible actually -->\n\t\t\t\t\t\t\t\t\t<a class=\"btn btn-primary btn-xs outline\" href=\"' . THIS_PAGE . '?act=categoryRemove&id=' . $catID . '&categoryName=' . formatUrl($catTitle) . '\">Remove Catagory</a>';\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$str .= '</div>\n\n\t\t\t\t\t\t</form>';\n\n\t\t\t\t\t}\n\n\t\t\t\t}else{//no records\n\t\t\t\t\t$str .= '<div align=\"center\">\n\t\t\t\t\t\t<h3>Currently No Events Listed in the Timeline.</h3>\n\t\t\t\t\t</div>';\n\t\t\t\t}\n\n\t\t\treturn $str;\n\n\t\t\t@mysqli_free_result($result); //free resources\n\n\t\t} else { #redirect back to timeline\n\n\t\t\t#myRedirect('index.php');\n\t\t}\n}", "protected function doConcatenateJavaScript() {}", "function am2_vanity_add_taxonomy_fields( $term ) { //check for existing featured ID\n $t_id = $term->term_id;\n $vanity_urls = get_option('am2_vanity_urls');\n\t$value = '';\n\tif(!empty($vanity_urls[$_REQUEST['taxonomy'].\"_\".$term->term_id]['url'])){\n\t\t$value = $vanity_urls[$_REQUEST['taxonomy'].\"_\".$term->term_id]['url'];\n\t}\n?>\n<tr class=\"form-field\">\n\t<th scope=\"row\" valign=\"top\"><label for=\"_am2_vanity_url\"><?php _e('Vanity URL'); ?></label></th>\n\t<td>\n \t<?php echo site_url().'/'; ?>\n\t\t<input type=\"hidden\" name=\"_am2_vanity_term_name\" value=\"<?php echo $_REQUEST['taxonomy']; ?>\" />\n <input type=\"text\" name=\"_am2_vanity_url\" id=\"_am2_vanity_url\" placeholder=\"any-url\" size=\"3\" style=\"width:60%;\" value=\"<?php echo $value; ?>\"><br />\n <span class=\"description\"><?php _e('This URL will replace the dafault category URL with new one.'); ?></span>\n </td>\n</tr>\n<?php\n}", "protected function getInput()\n\t{\n\n\t\tob_start();\n\t\t$native = $this->form->jevdata[$this->name][\"native\"];\n\t\t$clistChoice = $this->form->jevdata[$this->name][\"clistChoice\"];\n\t\t$clist = $this->form->jevdata[$this->name][\"clist\"];\n\t\t$nativeCals = $this->form->jevdata[$this->name][\"nativeCals\"];\n\n\t\t$params = ComponentHelper::getParams(JEV_COM_COMPONENT);\n\n\t\tJLoader::register('JEventsCategory', JEV_ADMINPATH . \"/libraries/categoryClass.php\");\n\n\t\t$categories = JEventsCategory::categoriesTree();\n\n\n\t\tif ($native && $clistChoice)\n\t\t{\n\t\t\t?>\n\t\t\t<script type=\"text/javascript\">\n function preselectCategory(select) {\n var lookup = new Array();\n lookup[0] = 0;\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ($nativeCals as $nc)\n\t\t\t\t\t{\n\t\t\t\t\t\techo 'lookup[' . $nc->ics_id . ']=' . $nc->catid . ';';\n\t\t\t\t\t}\n\t\t\t\t\tif ((int) $params->get('defaultcat', 1) === 0)\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"if(!jQuery('#catid').is(':hidden')) { document.adminForm['catid'].value=0;}\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"document.adminForm['catid'].value=lookup[select.value];\";\n\t\t\t\t\t}\n\n\t\t\t\t\t?>\n // trigger Bootstrap Chosen replacement\n try {\n jQuery(document.adminForm['catid']).trigger(\"liszt:updated\");\n }\n catch (e) {\n }\n }\n\t\t\t</script>\n\t\t\t<?php\n\t\t\techo $clist;\n\t\t}\n\t\telse if ($clistChoice)\n\t\t{\n\t\t\techo $clist;\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo $clist;\n\t\t}\n\t\t$input = ob_get_clean();\n\n\t\tJLoader::register('JEVHelper', JPATH_SITE . \"/components/com_jevents/libraries/helper.php\");\n\t\tJEVHelper::ConditionalFields($this->element, $this->form->getName());\n\n\t\treturn $input;\n\n\t}", "protected function finalize()\n\t{\n\t\tglobal $ilCtrl, $lng;\n\t\t\n\t\t// to make exercise gui load assignment\n\t\t$_GET[\"ass_id\"] = $_REQUEST[\"ass\"];\n\t\t\t\t\n\t\t// #11173 - ref_id is needed for notifications\n\t\t$exc_ref_id = array_shift(ilObject::_getAllReferences($_REQUEST[\"exc\"]));\n\t\n\t\tinclude_once \"Modules/Exercise/classes/class.ilObjExerciseGUI.php\";\n\t\t$exc_gui = new ilObjExerciseGUI(null, $exc_ref_id, true);\n\t\t$exc_gui->submitBlog($this->node_id);\n\t\t\n\t\tilUtil::sendSuccess($lng->txt(\"blog_finalized\"), true);\n\t\t$ilCtrl->redirect($this, \"render\");\n\t}", "public function es_edit_category_fields( $term, $taxonomy ) {\n\n\t\t\t$banner_id = absint( get_woocommerce_term_meta( $term->term_id, 'banner_id', true ) );\n\n\t\t\tif ( $banner_id ) {\n\t\t\t\t$image = wp_get_attachment_thumb_url( $banner_id );\n\t\t\t} else {\n\t\t\t\t$image = wc_placeholder_img_src();\n\t\t\t}\n\t\t\t?>\n\t\t\t<tr class=\"form-field\">\n\t\t\t\t<th scope=\"row\" valign=\"top\"><label><?php _e( 'Banner', 'woocommerce' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<div id=\"product_cat_banner\" style=\"float:left;margin-right:10px;\"><img src=\"<?php echo esc_url( $image ); ?>\" width=\"60px\" height=\"60px\" /></div>\n\t\t\t\t\t<div style=\"line-height:60px;\">\n\t\t\t\t\t\t<input type=\"hidden\" id=\"product_cat_banner_id\" name=\"product_cat_banner_id\" value=\"<?php echo esc_attr( $banner_id ); ?>\" />\n\t\t\t\t\t\t<button type=\"submit\" class=\"banner_upload_image_button button\"><?php _e( 'Upload/Add image', 'woocommerce' ); ?></button>\n\t\t\t\t\t\t<button type=\"submit\" class=\"banner_remove_image_button button\"><?php _e( 'Remove image', 'woocommerce' ); ?></button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<script type=\"text/javascript\">\n\n\t\t\t\t\t\t// Uploading files\n\t\t\t\t\t\tvar file_frame;\n\n\t\t\t\t\t\tjQuery( document ).on( 'click', '.banner_upload_image_button', function( event ) {\n\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t// Create the media frame.\n\t\t\t\t\t\t\tfile_frame = wp.media.frames.downloadable_file = wp.media({\n\t\t\t\t\t\t\t\ttitle: '<?php _e( 'Choose an image', 'woocommerce' ); ?>',\n\t\t\t\t\t\t\t\tbutton: {\n\t\t\t\t\t\t\t\t\ttext: '<?php _e( 'Use image', 'woocommerce' ); ?>',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tmultiple: false\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t// When an image is selected, run a callback.\n\t\t\t\t\t\t\tfile_frame.on( 'select', function() {\n\t\t\t\t\t\t\t\tattachment = file_frame.state().get('selection').first().toJSON();\n\n\t\t\t\t\t\t\t\tjQuery('#product_cat_banner_id').val( attachment.id );\n\t\t\t\t\t\t\t\tjQuery('#product_cat_banner img').attr('src', attachment.url );\n\t\t\t\t\t\t\t\tjQuery('.banner_remove_image_button').show();\n\n\t\t\t\t\t\t\t\tfile_frame = undefined;\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t// Finally, open the modal.\n\t\t\t\t\t\t\tfile_frame.open();\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tjQuery( document ).on( 'click', '.banner_remove_image_button', function( event ) {\n\t\t\t\t\t\t\tjQuery('#product_cat_banner img').attr('src', '<?php echo esc_url( wc_placeholder_img_src() ); ?>');\n\t\t\t\t\t\t\tjQuery('#product_cat_banner_id').val('');\n\t\t\t\t\t\t\tjQuery('.banner_remove_image_button').hide();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t</script>\n\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<?php\n\t\t}", "function target_add_cat($cat)\n{\n\tif ($GLOBALS['VERBOSE']) pf('...'. $cat['name']);\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'cat (id, name, view_order, cat_opt) \n\t VALUES('. (int)$cat['id'] .','. _esc($cat['name']) .','. (int)$cat['view_order'] .', 3)');\n\t$GLOBALS['cat_map'][ $cat['id'] ] = $cat['id'];\n/*\nfud_use('cat.inc', true);\n$nc = new fud_cat;\n$nc->name = $c->name;\n$nc->description = $c->description;\n$nc->view_order = $c->disporder;\n$nc->cat_opt = 1|2;\t// This should be the default in cat.inc. Fix in next release and del this line.\n$GLOBALS['cat_map'][$c->fid] = $nc->add('LAST');\t// FIRST should also be defaulted.\n*/\n}", "public function beforeSave() {\n $this->title = CHtml::encode(strip_tags($this->title));\n $this->sku = CHtml::encode(strip_tags($this->sku));\n return parent::beforeSave();\n }", "function udesign_blog_entry_after() {\r\n do_action('udesign_blog_entry_after');\r\n}", "public function after_footer_scripts_code () {\n // Sets initial JS variables value\n ?>\n <script type=\"text/javascript\">\n ct_current_role = '<?php echo $this->role; ?>';\n ct_current_orderby = '<?php echo $this->orderby; ?>';\n ct_current_order = '<?php echo $this->order; ?>';\n ct_current_page = <?php echo $this->page; ?>;\n ct_total_pages = <?php echo $this->total_pages; ?>;\n </script>\n <?php\n }", "public function config_category()\n {\n require_javascript('checking');\n\n // Load up some basic details\n $category = $this->category;\n $post_url = build_url(array('page' => '_SELF', 'type' => 'set', 'id' => $category, 'redirect' => get_param_string('redirect', null)), '_SELF');\n $category_description = do_lang_tempcode('CONFIG_CATEGORY_DESCRIPTION__' . $category);\n\n // Find all options in category\n $hooks = find_all_hooks('systems', 'config');\n $options = array();\n foreach (array_keys($hooks) as $hook) {\n require_code('hooks/systems/config/' . filter_naughty_harsh($hook));\n $ob = object_factory('Hook_config_' . filter_naughty_harsh($hook));\n $option = $ob->get_details();\n if (($GLOBALS['CURRENT_SHARE_USER'] === null) || ($option['shared_hosting_restricted'] == 0)) {\n if ($category == $option['category']) {\n if ($ob->get_default() !== null) {\n if (!isset($option['order_in_category_group'])) {\n $option['order_in_category_group'] = 100;\n }\n $option['ob'] = $ob;\n $option['name'] = $hook;\n $options[$option['group']][$hook] = $option;\n }\n }\n }\n }\n\n // Add in special ones\n if ($category == 'SITE') {\n $options['INTERNATIONALISATION']['timezone'] = array('name' => 'timezone', 'human_name' => 'TIMEZONE', 'c_value' => '', 'type' => 'special', 'category' => 'SITE', 'group' => 'INTERNATIONALISATION', 'explanation' => 'DESCRIPTION_TIMEZONE_SITE', 'shared_hosting_restricted' => 0, 'order_in_category_group' => 1);\n }\n require_code('files');\n $upload_max_filesize = (ini_get('upload_max_filesize') == '0') ? do_lang('NA') : clean_file_size(php_return_bytes(ini_get('upload_max_filesize')));\n $post_max_size = (ini_get('post_max_size') == '0') ? do_lang('NA') : clean_file_size(php_return_bytes(ini_get('post_max_size')));\n\n // Sort the groups\n $all_known_groups = array();\n foreach (array_keys($options) as $group) {\n $_group = do_lang($group);\n\n $_group = strtolower(trim(cms_preg_replace_safe('#(&.*;)|[^\\w\\s]#U', '', strip_tags($_group))));\n if ((isset($all_known_groups[$_group])) && ($all_known_groups[$_group] != $group)) {\n $_group = 'std_' . $group; // If cat names translate to same things or are in non-latin characters like Cyrillic\n }\n\n $all_known_groups[$_group] = $group;\n }\n $advanced_key = strtolower(trim(cms_preg_replace_safe('#(&.*;)|[^\\w\\s]#U', '', do_lang('ADVANCED'))));\n ksort($all_known_groups);\n if (isset($all_known_groups[$advanced_key])) { // Advanced goes last\n $temp = $all_known_groups[$advanced_key];\n unset($all_known_groups[$advanced_key]);\n $all_known_groups[$advanced_key] = $temp;\n }\n\n // Render option groups\n $groups_arr = array();\n require_code('form_templates');\n $_groups = array();\n foreach ($all_known_groups as $group_codename) {\n if (!isset($options[$group_codename])) {\n continue;\n }\n\n $options_in_group = $options[$group_codename];\n\n $all_orders_default = true;\n foreach ($options_in_group as $name => $option) {\n if ($option['order_in_category_group'] != 100) {\n $all_orders_default = false;\n }\n $options_in_group[$name]['human_name_trans'] = do_lang($option['human_name']);\n }\n if ($all_orders_default) {\n sort_maps_by($options_in_group, 'human_name_trans');\n } else {\n sort_maps_by($options_in_group, 'order_in_category_group');\n }\n\n $out = '';\n foreach ($options_in_group as $name => $option) {\n // Language strings\n $human_name = do_lang_tempcode($option['human_name']);\n $_explanation = do_lang($option['explanation'], null, null, null, null, false);\n if ($_explanation === null) {\n $_explanation = do_lang('CONFIG_GROUP_DEFAULT_DESCRIP_' . $option['group'], null, null, null, null, false);\n if ($_explanation === null) {\n // So an error shows\n $_explanation = do_lang($option['explanation']);\n $explanation = do_lang_tempcode($option['explanation']);\n } else {\n $explanation = do_lang_tempcode('CONFIG_GROUP_DEFAULT_DESCRIP_' . $option['group']);\n }\n } else {\n $explanation = do_lang_tempcode($option['explanation']);\n }\n $default = get_default_option($name);\n\n if (isset($option['required'])) {\n $required = $option['required'];\n } else {\n if ($option['type'] == 'integer') {\n $required = true;\n } elseif ($option['type'] == 'float') {\n $required = true;\n } elseif ($option['type'] == 'list') {\n $required = true;\n } else {\n $required = false;\n }\n }\n\n // Render field inputter\n switch ($option['type']) {\n case 'special':\n switch ($name) {\n case 'timezone':\n $list = '';\n $timezone = get_site_timezone();\n foreach (get_timezone_list() as $_timezone => $timezone_nice) {\n $list .= static_evaluate_tempcode(form_input_list_entry($_timezone, $_timezone == $timezone, $timezone_nice));\n }\n $out .= static_evaluate_tempcode(form_input_list($human_name, $explanation, 'timezone', make_string_tempcode($list)));\n break;\n\n default:\n $ob = $option['ob'];\n $out .= static_evaluate_tempcode($ob->field_inputter($name, $option, $human_name, $explanation));\n break;\n }\n break;\n\n case 'integer':\n $explanation_with_default = do_lang_tempcode('EXPLANATION_WITH_DEFAULT', $explanation, ($default == '') ? do_lang_tempcode('BLANK_EM') : make_string_tempcode(escape_html($default)));\n $out .= static_evaluate_tempcode(form_input_integer($human_name, $explanation_with_default, $name, intval(get_option($name)), $required));\n break;\n\n case 'float':\n $explanation_with_default = do_lang_tempcode('EXPLANATION_WITH_DEFAULT', $explanation, escape_html(($default == '') ? do_lang_tempcode('BLANK_EM') : make_string_tempcode(float_format(floatval($default)))));\n $out .= static_evaluate_tempcode(form_input_float($human_name, $explanation_with_default, $name, floatval(get_option($name)), $required));\n break;\n\n case 'line':\n case 'transline':\n $explanation_with_default = do_lang_tempcode('EXPLANATION_WITH_DEFAULT', $explanation, ($default == '') ? do_lang_tempcode('BLANK_EM') : make_string_tempcode(escape_html($default)));\n $out .= static_evaluate_tempcode(form_input_line($human_name, $explanation_with_default, $name, get_option($name), $required, null, 100000));\n break;\n\n case 'text':\n case 'transtext':\n $out .= static_evaluate_tempcode(form_input_text($human_name, $explanation, $name, get_option($name), $required, null, true));\n break;\n\n case 'comcodeline':\n $explanation_with_default = do_lang_tempcode('EXPLANATION_WITH_DEFAULT', $explanation, ($default == '') ? do_lang_tempcode('BLANK_EM') : make_string_tempcode(escape_html($default)));\n $out .= static_evaluate_tempcode(form_input_line_comcode($human_name, $explanation_with_default, $name, get_option($name), $required));\n break;\n\n case 'comcodetext':\n $out .= static_evaluate_tempcode(form_input_text_comcode($human_name, $explanation, $name, get_option($name), $required, null, true));\n break;\n\n case 'list':\n $_default = make_string_tempcode(escape_html($default));\n $list = '';\n if (!$required) {\n $list .= static_evaluate_tempcode(form_input_list_entry('', false, do_lang_tempcode('NA_EM')));\n }\n $_value = get_option($name);\n $values = explode('|', $option['list_options']);\n foreach ($values as $value) {\n $__value = str_replace(' ', '__', $value);\n $_option_text = do_lang('CONFIG_OPTION_' . $name . '_VALUE_' . $__value, null, null, null, null, false);\n if ($_option_text !== null) {\n $option_text = do_lang_tempcode('CONFIG_OPTION_' . $name . '_VALUE_' . $__value);\n if ($value == $default) {\n $_default = $option_text;\n }\n } else {\n $option_text = make_string_tempcode($value);\n }\n $list .= static_evaluate_tempcode(form_input_list_entry($value, $_value == $value, $option_text));\n }\n $explanation_with_default = do_lang_tempcode('EXPLANATION_WITH_DEFAULT', $explanation, ($default == '') ? do_lang_tempcode('BLANK_EM') : $_default);\n $out .= static_evaluate_tempcode(form_input_list($human_name, $explanation_with_default, $name, make_string_tempcode($list), null, false, false));\n break;\n\n case 'tick':\n $explanation_with_default = do_lang_tempcode('EXPLANATION_WITH_DEFAULT', $explanation, escape_html(($default == '1') ? do_lang('YES') : do_lang('NO')));\n $out .= static_evaluate_tempcode(form_input_tick($human_name, $explanation_with_default, $name, get_option($name) == '1'));\n break;\n\n case 'username':\n $out .= static_evaluate_tempcode(form_input_username($human_name, $explanation, $name, get_option($name), $required, false));\n break;\n\n case 'colour':\n $out .= static_evaluate_tempcode(form_input_colour($human_name, $explanation, $name, get_option($name), $required));\n break;\n\n case 'date':\n $out .= static_evaluate_tempcode(form_input_date($human_name, $explanation, $name, $required, false, false, intval(get_option($name)), 40, intval(date('Y')) - 20, null));\n break;\n\n case 'forum':\n if ((get_forum_type() == 'cns') && (addon_installed('cns_forum'))) {\n $current_setting = get_option($name);\n if (!is_numeric($current_setting)) {\n $_current_setting = $GLOBALS['FORUM_DB']->query_select_value_if_there('f_forums', 'id', array('f_name' => $current_setting));\n if ($_current_setting === null) {\n if ($required) {\n $current_setting = strval(db_get_first_id());\n attach_message(do_lang_tempcode('FORUM_CURRENTLY_UNSET', $human_name), 'notice');\n } else {\n $current_setting = null;\n }\n } else {\n $current_setting = strval($_current_setting);\n }\n }\n $out .= static_evaluate_tempcode(form_input_tree_list($human_name, $explanation, $name, null, 'choose_forum', array(), $required, $current_setting));\n } else {\n $out .= static_evaluate_tempcode(form_input_line($human_name, $explanation, $name, get_option($name), $required));\n }\n break;\n\n case 'forum_grouping':\n if (get_forum_type() == 'cns') {\n $tmp_value = $GLOBALS['FORUM_DB']->query_select_value_if_there('f_forum_groupings', 'id', array('c_title' => get_option($name)));\n\n require_code('cns_forums2');\n $_list = new Tempcode();\n if (!$required) {\n $_list->attach(form_input_list_entry('', false, do_lang_tempcode('NA_EM')));\n }\n $_list->attach(cns_create_selection_list_forum_groupings(null, $tmp_value));\n $out .= static_evaluate_tempcode(form_input_list($human_name, $explanation, $name, $_list));\n } else {\n $out .= static_evaluate_tempcode(form_input_line($human_name, $explanation, $name, get_option($name), $required));\n }\n break;\n\n case 'usergroup':\n case 'usergroup_not_guest':\n if (get_forum_type() == 'cns') {\n $tmp_value = $GLOBALS['FORUM_DB']->query_select_value_if_there('f_groups', 'id', array($GLOBALS['FORUM_DB']->translate_field_ref('g_name') => get_option($name)));\n\n require_code('cns_groups');\n $_list = new Tempcode();\n if (!$required) {\n $_list->attach(form_input_list_entry('', false, do_lang_tempcode('NA_EM')));\n }\n $_list->attach(cns_create_selection_list_usergroups($tmp_value, $option['type'] == 'usergroup'));\n $out .= static_evaluate_tempcode(form_input_list($human_name, $explanation, $name, $_list));\n } else {\n $out .= static_evaluate_tempcode(form_input_line($human_name, $explanation, $name, get_option($name), $required));\n }\n break;\n\n default:\n fatal_exit('Invalid config option type: ' . $option['type'] . ' (for ' . $option['name'] . ')');\n }\n }\n\n // Render group\n $group_title = do_lang_tempcode($group_codename);\n $_group_description = do_lang('CONFIG_GROUP_DESCRIP_' . $group_codename, escape_html($post_max_size), escape_html($upload_max_filesize), null, null, false);\n if ($_group_description === null) {\n $group_description = new Tempcode();\n } else {\n $group_description = do_lang_tempcode('CONFIG_GROUP_DESCRIP_' . $group_codename, escape_html($post_max_size), escape_html($upload_max_filesize));\n }\n $groups_arr[] = array('GROUP_DESCRIPTION' => $group_description, 'GROUP_NAME' => $group_codename, 'GROUP' => $out, 'GROUP_TITLE' => $group_title);\n $_groups[$group_codename] = $group_title;\n }\n\n list($warning_details, $ping_url) = handle_conflict_resolution();\n\n // Render\n return do_template('CONFIG_CATEGORY_SCREEN', array(\n '_GUID' => 'd01b28b71c38bbb52b6aaf877c7f7b0e',\n 'CATEGORY_DESCRIPTION' => $category_description,\n '_GROUPS' => $_groups,\n 'PING_URL' => $ping_url,\n 'WARNING_DETAILS' => $warning_details,\n 'TITLE' => $this->title,\n 'URL' => $post_url,\n 'GROUPS' => $groups_arr,\n 'SUBMIT_ICON' => 'buttons__save',\n 'SUBMIT_NAME' => do_lang_tempcode('SAVE'),\n ));\n }", "function get_product_list() {\n/**\nif You haven't category object, please use this request\n$catData = current_category_data($post->ID);\n*/\n$catData = current_category_data($post->ID);\n\n?>\n\n\n<script type=\"text/javascript\">\n\n var vallo_ready_cartus = <?php echo json_encode($_COOKIE['vallo_cf7_cartus_3']); ?>;\n var produc_CF7_image = '<?php \n $image = wp_get_attachment_image_src( get_post_thumbnail_id( $loop->post->ID ), 'single-post-thumbnail' );\n echo $image[0]; ?>';\n var produc_CF7_title = '<?php \n wp_title(''); ?>';\n var produc_CF7_category = '<?php \n echo $catData->term_id; ?>';\n</script>\n<script type='text/javascript' src='<?php echo plugins_url('/js/get_product_list.js?ver=1.9',__FILE__ ) ?>'></script>\n<?php\n// add new products to basket\n?><script type='text/javascript' src='<?php echo plugins_url('/js/add_to_product_list.js?ver=2.1',__FILE__ ) ?>'></script>\n<script type='text/javascript' src='<?php echo plugins_url('/js/add_to_product_activation.js?ver=1.2',__FILE__ ) ?>'></script>\n<?php\n\n\n###\n# end of base function\n###\n}", "public function addCategory(){\n if (isset($_POST[\"add_category\"])) {\n $categories = $this->model('Categories');\n $system = $this->model('System');\n $cat_name = $_POST[\"cat_name\"];\n $cat_sef_url = $system->seflink($cat_name);\n\n $categories->addCat($cat_name,$cat_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/categories');\n }", "function store_addcategory()\r\n{\r\n\tglobal $_user;\r\n\tglobal $dropbox_cnf;\r\n\r\n\t// check if the target is valid\r\n\tif ($_POST['target']=='sent')\r\n\t{\r\n\t\t$sent=1;\r\n\t\t$received=0;\r\n\t}\r\n\telseif ($_POST['target']=='received')\r\n\t{\r\n\t\t$sent=0;\r\n\t\t$received=1;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn get_lang('Error');\r\n\t}\r\n\r\n\t// check if the category name is valid\r\n\tif ($_POST['category_name']=='')\r\n\t{\r\n\t\treturn get_lang('ErrorPleaseGiveCategoryName');\r\n\t}\r\n\r\n\tif (!$_POST['edit_id'])\r\n\t{\r\n\t\t// step 3a, we check if the category doesn't already exist\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE user_id='\".$_user['user_id'].\"' AND cat_name='\".Database::escape_string($_POST['category_name']).\"' AND received='\".$received.\"' AND sent='\".$sent.\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\r\n\r\n\t\t// step 3b, we add the category if it does not exist yet.\r\n\t\tif (mysql_num_rows($result)==0)\r\n\t\t{\r\n\t\t\t$sql=\"INSERT INTO \".$dropbox_cnf['tbl_category'].\" (cat_name, received, sent, user_id)\r\n\t\t\t\t\tVALUES ('\".Database::escape_string($_POST['category_name']).\"', '\".Database::escape_string($received).\"', '\".Database::escape_string($sent).\"', '\".Database::escape_string($_user['user_id']).\"')\";\r\n\t\t\tapi_sql_query($sql);\r\n\t\t\treturn get_lang('CategoryStored');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn get_lang('CategoryAlreadyExistsEditIt');\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$sql=\"UPDATE \".$dropbox_cnf['tbl_category'].\" SET cat_name='\".Database::escape_string($_POST['category_name']).\"', received='\".Database::escape_string($received).\"' , sent='\".Database::escape_string($sent).\"'\r\n\t\t\t\tWHERE user_id='\".Database::escape_string($_user['user_id']).\"'\r\n\t\t\t\tAND cat_id='\".Database::escape_string($_POST['edit_id']).\"'\";\r\n\t\tapi_sql_query($sql);\r\n\t\treturn get_lang('CategoryModified');\r\n\t}\r\n}", "function udesign_entry_after() {\r\n do_action('udesign_entry_after');\r\n}", "function insert_categories_data(){\r\n if (isset($_POST['submit'])){\r\n\r\n $cat_title = $_POST['cat_title'];\r\n\r\n if($cat_title == \"\" || empty($cat_title)){\r\n echo validation_error_display(\"Field can not be empty\");\r\n }else{\r\n \r\n $sql = \"INSERT INTO categories (cat_title ) VALUES ('$cat_title')\";\r\n $result = execute($sql);\r\n confirm($result);\r\n }\r\n \r\n }\r\n\r\n}", "public function page_add_edit_cat()\n\t{\n\t\t// Edition\n\t\t$cat_name = '';\n\t\tif ($this->mode == 'edit_cat')\n\t\t{\n\t\t\t$sql = 'SELECT cat_name\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'smilies_cat\n\t\t\t\t\tWHERE cat_id = ' . $this->id;\n\t\t\t$result = Fsb::$db->query($sql);\n\t\t\t$data = Fsb::$db->row($result);\n\t\t\tif (!$data)\n\t\t\t{\n\t\t\t\t$this->mode = 'add_cat';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tFsb::$db->free($result);\n\t\t\t\t$cat_name = $data['cat_name'];\n\t\t\t}\n\t\t}\n\n\t\tFsb::$tpl->set_switch('smileys_add_cat');\n\t\tFsb::$tpl->set_vars(array(\n\t\t\t'L_ADD_EDIT' =>\t\t($this->mode == 'add_cat') ? Fsb::$session->lang('adm_smiley_add_cat') : Fsb::$session->lang('adm_smiley_edit_cat'),\n\t\t\t'CAT_NAME' =>\t\t$cat_name,\n\n\t\t\t'U_ACTION' =>\t\tsid('index.' . PHPEXT . '?p=posts_smiley&amp;mode=' . $this->mode . '&amp;id=' . $this->id),\n\t\t));\n\t}", "function options_permalink_add_js()\n {\n }", "function getName() { return 'TestPostAddCategory'; }", "function sanitize_category_field($field, $value, $cat_id, $context)\n {\n }", "function insertCategories() {\n\tglobal $connection;\n\tif (isset($_POST['submit'])) {\n\n\t\t$title = escape($_POST['cat_title']);\n\n\t\tif ($title === \"\" || empty($title)) {\n\t\t\techo \"This field should not be empty\";\n\t\t} else {\n\n\t\t\t$stmt = mysqli_prepare($connection, \"INSERT INTO categories(cat_title) VALUES(?)\");\n\n\t\t\tmysqli_stmt_bind_param($stmt, 's', $title);\n\n\t\t\tmysqli_stmt_execute($stmt);\n\n\t\t\tif (!$stmt) {\n\t\t\t\tdie(\"QUERY FAILED\");\n\t\t\t}\n\t\t}\n\t\tmysqli_stmt_close($stmt);\n\t}\n\n}", "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}", "public function load_parent_category_item_field_ajax(){\r\n\t\t$rslt = $this->get_parent_categories();\r\n\r\n\t\techo json_encode($rslt);\r\n\t\tdie();\r\n\t}", "protected function _afterElementJs($element)\n {\n $chooserUrl = $this->getUrl('techfactory/category/chooser', []);\n $htmlId = $element->getId();\n $return = <<<HTML\n <script>\n require([\n 'jquery',\n 'Magento_Ui/js/modal/alert',\n \"prototype\"\n ], function (jQuery, alert) {\n var MultiCategoryChooser = {\n displayChooser : function(chooser) {\n chooser = $(chooser).down('div.chooser');\n entities = chooser.up('div.chooser_container').down('input[type=\"text\"].entities').value;\n postParameters = {selected: entities};\n url = '{$chooserUrl}';\n\n if (chooser && url) {\n if (chooser.innerHTML == '') {\n new Ajax.Request(url, {\n method : 'post',\n parameters : postParameters,\n onSuccess : function(transport) {\n try {\n if (transport.responseText) {\n Element.insert(chooser, transport.responseText);\n chooser.removeClassName('no-display');\n chooser.addClassName('chooser-border');\n chooser.show();\n }\n } catch (e) {\n alert({\n content: 'Error occurs during loading chooser.'\n });\n }\n }\n });\n } else {\n chooser.removeClassName('no-display');\n chooser.addClassName('chooser-border');\n chooser.show();\n }\n }\n },\n hideChooser : function(chooser) {\n chooser = $(chooser).down('div.chooser');\n if (chooser) {\n chooser.addClassName('no-display');\n chooser.hide();\n }\n },\n checkCategory : function(event) {\n node = event.memo.node;\n container = event.target.up('div.chooser_container');\n value = container.down('input[type=\"text\"].entities').value.strip();\n if (node.attributes.checked) {\n if (value) ids = value.split(',');\n else ids = [];\n\n if (-1 == ids.indexOf(node.id)) {\n ids.push(node.id);\n container.down('input[type=\"text\"].entities').value = ids.join(',');\n }\n } else {\n ids = value.split(',');\n while (-1 != ids.indexOf(node.id)) {\n ids.splice(ids.indexOf(node.id), 1);\n container.down('input[type=\"text\"].entities').value = ids.join(',');\n }\n }\n }\n }\n window.MultiCategoryChooser = MultiCategoryChooser;\n jQuery(function() {\n var container = $('{$htmlId}-container');\n if (container) {\n container.up(0).down('.control-value').hide();\n }\n\n Event.observe(document, 'node:changed', function(event){\n MultiCategoryChooser.checkCategory(event);\n });\n Event.observe(document, 'category:beforeLoad', function(event) {\n container = event.target.up('div.chooser_container');\n value = container.down('input[type=\"text\"].entities').value.strip();\n event.memo.treeLoader.baseParams.selected = value;\n });\n });\n });\n </script>\nHTML;\n return $return;\n }", "function copyCategorySelect( $option, $cid, $SectionList, $items, $sectionOld, $contents, $redirect ) {\r\n\t\t?>\r\n\t\t<form action=\"index2.php\" method=\"post\" name=\"adminForm\">\r\n\t\t<br />\r\n\t\t<table class=\"adminheading\">\r\n\t\t<tr>\r\n\t\t\t<th class=\"categories\">\r\n\t\t\tКопирование подрубрики\r\n\t\t\t</th>\r\n\t\t</tr>\r\n\t\t</table>\r\n\r\n\t\t<br />\r\n\t\t<script language=\"javascript\" type=\"text/javascript\">\r\n\t\tfunction submitbutton(pressbutton) {\r\n\t\t\tvar form = document.adminForm;\r\n\t\t\tif (pressbutton == 'cancel') {\r\n\t\t\t\tsubmitform( pressbutton );\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// do field validation\r\n\t\t\tif (!getSelectedValue( 'adminForm', 'sectionmove' )) {\r\n\t\t\t\talert( \"Пожалуйста, выберите рубрику для копируемой подрубрики\" );\r\n\t\t\t} else {\r\n\t\t\t\tsubmitform( pressbutton );\r\n\t\t\t}\r\n\t\t}\r\n\t\t</script>\r\n\t\t<table class=\"adminform\">\r\n\t\t<tr>\r\n\t\t\t<td width=\"3%\"></td>\r\n\t\t\t<td align=\"left\" valign=\"top\" width=\"30%\">\r\n\t\t\t<strong>Копировать в раздел:</strong>\r\n\t\t\t<br />\r\n\t\t\t<?php echo $SectionList ?>\r\n\t\t\t<br /><br />\r\n\t\t\t</td>\r\n\t\t\t<td align=\"left\" valign=\"top\" width=\"20%\">\r\n\t\t\t<strong>Копируемые подрубрики:</strong>\r\n\t\t\t<br />\r\n\t\t\t<?php\r\n\t\t\techo \"<ol>\";\r\n\t\t\tforeach ( $items as $item ) {\r\n\t\t\t\techo \"<li>\". $item->name .\"</li>\";\r\n\t\t\t}\r\n\t\t\techo \"</ol>\";\r\n\t\t\t?>\r\n\t\t\t</td>\r\n\t\t\t<td valign=\"top\" width=\"20%\">\r\n\t\t\t<strong>Копируемое содержимое подрубрики:</strong>\r\n\t\t\t<br />\r\n\t\t\t<?php\r\n\t\t\techo \"<ol>\";\r\n\t\t\tforeach ( $contents as $content ) {\r\n\t\t\t\techo \"<li>\". $content->title .\"</li>\";\r\n\t\t\t\techo \"\\n <input type=\\\"hidden\\\" name=\\\"item[]\\\" value=\\\"$content->id\\\" />\";\r\n\t\t\t}\r\n\t\t\techo \"</ol>\";\r\n\t\t\t?>\r\n\t\t\t</td>\r\n\t\t\t<td valign=\"top\">\r\n\t\t\tВ выбранный раздел будут скопированы все\r\n\t\t\t<br />\r\n\t\t\tперечисленные подрубрики и всё \r\n\t\t\t<br />\r\n\t\t\tперечисленное содержимое этих подрубрик.\r\n\t\t\t</td>.\r\n\t\t</tr>\r\n\t\t</table>\r\n\t\t<br /><br />\r\n\r\n\t\t<input type=\"hidden\" name=\"ca\" value=\"<?php echo $option;?>\" />\r\n\t\t<input type=\"hidden\" name=\"section\" value=\"<?php echo $sectionOld;?>\" />\r\n\t\t<input type=\"hidden\" name=\"boxchecked\" value=\"1\" />\r\n\t\t<input type=\"hidden\" name=\"redirect\" value=\"<?php echo $redirect; ?>\" />\r\n\t\t<input type=\"hidden\" name=\"task\" value=\"\" />\r\n\t\t<?php\r\n\t\tforeach ( $cid as $id ) {\r\n\t\t\techo \"\\n <input type=\\\"hidden\\\" name=\\\"cid[]\\\" value=\\\"$id\\\" />\";\r\n\t\t}\r\n\t\t?>\r\n\t\t</form>\r\n\t\t<?php\r\n\t}", "function copy_category($src_category_id, $dest_category_id, $ctype = \"link\") {\n\n\t\t\t//skip category if it is already a copied one\n\tif (!(in_array($src_category_id, $_SESSION['copied']))) {\n\n\t\t\t$src_category_id = olc_db_prepare_input($src_category_id);\n\t\t\t$dest_category_id = olc_db_prepare_input($dest_category_id);\n\n\t\t\t//get data\n\t\t\t$ccopy_query = xtDBquery(\"SELECT * FROM \".TABLE_CATEGORIES.\" WHERE categories_id = '\".$src_category_id.\"'\");\n\t\t\t$ccopy_values = olc_db_fetch_array($ccopy_query);\n\n\t\t\t//get descriptions\n\t\t\t$cdcopy_query = xtDBquery(\"SELECT * FROM \".TABLE_CATEGORIES_DESCRIPTION.\" WHERE categories_id = '\".$src_category_id.\"'\");\n\n\t\t\t//copy data\n\t\t\t\n\t\t\t$sql_data_array = array ('parent_id'=>olc_db_input($dest_category_id),\n\t\t\t\t\t\t\t\t\t'date_added'=>'NOW()',\n\t\t\t\t\t\t\t\t\t'last_modified'=>'NOW()',\n\t\t\t\t\t\t\t\t\t'categories_image'=>$ccopy_values['categories_image'],\n\t\t\t\t\t\t\t\t\t'categories_status'=>$ccopy_values['categories_status'],\n\t\t\t\t\t\t\t\t\t'categories_template'=>$ccopy_values['categories_template'],\n\t\t\t\t\t\t\t\t\t'listing_template'=>$ccopy_values['listing_template'],\n\t\t\t\t\t\t\t\t\t'sort_order'=>$ccopy_values['sort_order'],\n\t\t\t\t\t\t\t\t\t'products_sorting'=>$ccopy_values['products_sorting'],\n\t\t\t\t\t\t\t\t\t'products_sorting2'=>$ccopy_values['products_sorting2']);\t\n\t\t\t\n\t\t\t\n\t\t\t\t\t$customers_statuses_array = olc_get_customers_statuses();\n\n\t\tfor ($i = 0; $n = sizeof($customers_statuses_array), $i < $n; $i ++) {\n\t\t\tif (isset($customers_statuses_array[$i]['id']))\n\t\t\t\t$sql_data_array = array_merge($sql_data_array, array ('group_permission_'.$customers_statuses_array[$i]['id'] => $product['group_permission_'.$customers_statuses_array[$i]['id']]));\n\t\t}\n\t\t\t\n\t\t\tolc_db_perform(TABLE_CATEGORIES, $sql_data_array);\n\n\t\t\t$new_cat_id = olc_db_insert_id();\n\n\t\t\t//store copied ids, because we don't want to go into an endless loop later\n\t\t\t$_SESSION['copied'][] = $new_cat_id;\n\n\t\t\t//copy / link products\n\t\t\t$get_prod_query = xtDBquery(\"SELECT products_id FROM \".TABLE_PRODUCTS_TO_CATEGORIES.\" WHERE categories_id = '\".$src_category_id.\"'\");\n\t\t\twhile ($product = olc_db_fetch_array($get_prod_query)) {\n\t\t\t\tif ($ctype == 'link') {\n\t\t\t\t\t$this->link_product($product['products_id'], $new_cat_id);\n\t\t\t\t}\n\t\t\t\telseif ($ctype == 'duplicate') {\n\t\t\t\t\t$this->duplicate_product($product['products_id'], $new_cat_id);\n\t\t\t\t} else {\n\t\t\t\t\tdie('Undefined copy type!');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//copy+rename image\n\t\t\t$src_pic = DIR_FS_CATALOG_IMAGES.'categories/'.$ccopy_values['categories_image'];\n\t\t\tif (is_file($src_pic)) {\n\t\t\t\t$get_suffix = explode('.', $ccopy_values['categories_image']);\n\t\t\t\t$suffix = array_pop($get_suffix);\n\t\t\t\t$dest_pic = $new_cat_id.'.'.$suffix;\n\t\t\t\t@ copy($src_pic, DIR_FS_CATALOG_IMAGES.'categories/'.$dest_pic);\n\t\t\t\txtDBquery(\"SQL_UPDATE categories SET categories_image = '\".$dest_pic.\"' WHERE categories_id = '\".$new_cat_id.\"'\");\n\t\t\t}\n\n\t\t\t//copy descriptions\n\t\t\twhile ($cdcopy_values = olc_db_fetch_array($cdcopy_query)) {\n\t\t\t\txtDBquery(\"INSERT INTO \".TABLE_CATEGORIES_DESCRIPTION.\" (categories_id, language_id, categories_name, categories_heading_title, categories_description, categories_meta_title, categories_meta_description, categories_meta_keywords) VALUES ('\".$new_cat_id.\"' , '\".$cdcopy_values['language_id'].\"' , '\".addslashes($cdcopy_values['categories_name']).\"' , '\".addslashes($cdcopy_values['categories_heading_title']).\"' , '\".addslashes($cdcopy_values['categories_description']).\"' , '\".addslashes($cdcopy_values['categories_meta_title']).\"' , '\".addslashes($cdcopy_values['categories_meta_description']).\"' , '\".addslashes($cdcopy_values['categories_meta_keywords']).\"')\");\n\t\t\t}\n\n\t\t\t//get child categories of current category\n\t\t\t$crcopy_query = xtDBquery(\"SELECT categories_id FROM \".TABLE_CATEGORIES.\" WHERE parent_id = '\".$src_category_id.\"'\");\n\n\t\t\t//and go recursive\n\t\t\twhile ($crcopy_values = olc_db_fetch_array($crcopy_query)) {\n\t\t\t\t$this->copy_category($crcopy_values['categories_id'], $new_cat_id, $ctype);\n\t\t\t}\n\n\t\t}\n\t}", "function classiera_update_my_category_fields($term_id) {\r\n\tif(isset($_POST['taxonomy'])){\t\r\n\t if($_POST['taxonomy'] == 'category'):\r\n\t\t$tag_extra_fields = get_option(MY_CATEGORY_FIELDS);\r\n\t\t$tag_extra_fields[$term_id]['your_image_url'] = strip_tags($_POST['your_image_url']);\r\n\t\t$tag_extra_fields[$term_id]['category_image'] = $_POST['category_image'];\r\n\t\t$tag_extra_fields[$term_id]['category_icon_code'] = $_POST['category_icon_code'];\r\n\t\t$tag_extra_fields[$term_id]['category_icon_color'] = $_POST['category_icon_color'];\r\n\t\tupdate_option(MY_CATEGORY_FIELDS, $tag_extra_fields);\r\n\t endif;\r\n\t}\r\n}", "public function get_add_form($cat_id) {\n\n\t\tif (!$this->input->is_ajax_request()) {\n\t\t\tdie();\n\t\t}\n\n\t\t$category_detailes = $this->cat_model->GetWhere(\"categories\", \"title\", \"ASC\", array('id'=>$cat_id)); \n\t\t\tif (isset($category_detailes) && count($category_detailes) != 0) { \n\t\t\t\tforeach ($category_detailes as $cat) { \n\t\t\t\t\t$title= $cat->title ;\n\t\t\t\t} \n\t\t\t}\n\n\t\t$content = \"<div style='background-color:#ddd' clas='table-responsive ls-table'><table class='table table-responsive table-bordered table-hover' ><tr>\";\n\n\n\t\t$content .= \" <td><input type='hidden' id='main_cat_id' value='$cat_id'> \n\t\t<input type='text' style='width: 98%;' id='title' placeholder='title' ><br><br>\";\n\n\n\t\t$content .= \"</tr></table> \n\t\t</div>\";\n\t\tif($cat_id==0){\n\n\t\t$result = array('title' => \"<b>Add main category </b>\", \"content\" => $content); \n\t\t}else{\n\n\t\t$result = array('title' => \"<b>Add sub category to \".$title.\"</b>\", \"content\" => $content); \n\t\t}\n\n\t\techo json_encode($result);\n\t}", "public function done() {\r\n\r\n\t\tdo_action( 'listeo_core_listing_submitted', $this->listing_id );\r\n\t\t$template_loader = new Listeo_Core_Template_Loader;\r\n\t\t$template_loader->set_template_data( \r\n\t\t\tarray( \r\n\t\t\t\t'listing' \t=> get_post( $this->listing_id ),\r\n\t\t\t\t'id' \t\t=> \t$this->listing_id,\r\n\t\t\t\t) \r\n\t\t\t)->get_template_part( 'listing-submitted' );\r\n\r\n\t}", "public function pre_out()\n\t{\n\t\t$out = '';\n\t\tif ( !self::$outpre ) {\n\t\t\tself::$outpre = true;\n\t\t\t$out = <<< CUSTOM_DROPBUTTON_JS\n\t\t\t\t<script type=\"text/javascript\">\ncontrols.init(function(){\n\t$('.dropbutton_control').each(function(){\n\t\tvar self = $(this);\n\t\t$(self).on('click', 'a', function(){\n\t\t\tvar a = $(this);\n\t\t\tself.find('input').val(a.attr('href').replace(/^.*#/, ''));\n\t\t\tself.closest('form').submit();\n\t\t});\n\t});\n});\n\t\t\t\t</script>\nCUSTOM_DROPBUTTON_JS;\n\t\t}\n\t\treturn $out;\n\t}", "function recommandation_category_form($argument){\r\n\t\t$id_categorie_preconisation = $argument['idElement'];\r\n\r\n\t\t$nom_categorie = $impressionRecommandation = $tailleimpressionRecommandation = $impressionRecommandationCategorie = $tailleimpressionRecommandationCategorie = '';\r\n\r\n\t\tif(($id_categorie_preconisation != '') && ($id_categorie_preconisation > 0)){\r\n\t\t\t$recommandationCategoryInfos = evaRecommandationCategory::getCategoryRecommandation($id_categorie_preconisation);\r\n\t\t\t$nom_categorie = html_entity_decode($recommandationCategoryInfos->nom, ENT_QUOTES, 'UTF-8');\r\n\t\t\t$impressionRecommandation = html_entity_decode($recommandationCategoryInfos->impressionRecommandation, ENT_QUOTES, 'UTF-8');\r\n\t\t\t$tailleimpressionRecommandation = html_entity_decode($recommandationCategoryInfos->tailleimpressionRecommandation, ENT_QUOTES, 'UTF-8');\r\n\t\t\t$impressionRecommandationCategorie = html_entity_decode($recommandationCategoryInfos->impressionRecommandationCategorie, ENT_QUOTES, 'UTF-8');\r\n\t\t\t$tailleimpressionRecommandationCategorie = html_entity_decode($recommandationCategoryInfos->tailleimpressionRecommandationCategorie, ENT_QUOTES, 'UTF-8');\r\n\t\t}\r\n\r\n?>\r\n<p class=\"recommandationCategoryFormErrorMessage digirisk_hide\" >&nbsp;</p>\r\n<form action=\"<?php echo EVA_INC_PLUGIN_URL; ?>ajax.php\" id=\"recommandation_category_form\" method=\"post\" >\r\n\t<input type=\"hidden\" name=\"post\" id=\"post\" value=\"true\" />\r\n\t<input type=\"hidden\" name=\"table\" id=\"table\" value=\"<?php _e(TABLE_CATEGORIE_PRECONISATION); ?>\" />\r\n\t<input type=\"hidden\" name=\"act\" id=\"act\" value=\"saveRecommandationCategorie\" />\r\n\t<input type=\"hidden\" name=\"id_categorie_preconisation\" id=\"id_categorie_preconisation\" value=\"<?php _e($id_categorie_preconisation); ?>\" />\r\n\r\n\t<input type=\"hidden\" name=\"impressionRecommandationCategorieValue\" id=\"impressionRecommandationCategorieValue\" value=\"<?php _e($impressionRecommandationCategorie); ?>\" />\r\n\t<input type=\"hidden\" name=\"impressionRecommandationValue\" id=\"impressionRecommandationValue\" value=\"<?php _e($impressionRecommandation); ?>\" />\r\n\r\n<!--\tRecommandation category name\t-->\r\n\t<label for=\"nom_categorie\" ><?php _e('Nom', 'evarisk'); ?></label>\r\n\t<input type=\"text\" name=\"nom_categorie\" id=\"nom_categorie\" class=\"recommandationInput\" value=\"<?php _e($nom_categorie); ?>\" />\r\n\r\n<!--\tOption recommandation category picture in document\t-->\r\n\t<div class=\"recommandationCategoryOption\" ><?php _e('Param&egrave;tres pour l\\'impression de la famille de pr&eacute;conisations', 'evarisk'); ?></div>\r\n\t<div class=\"recommandationCategoryOptionChoice\" ><input type=\"radio\" class=\"impressionRecommandationCategorie\" name=\"impressionRecommandationCategorie\" id=\"impressionRecommandationCategorie_textandpicture\" value=\"textandpicture\" <?php (($impressionRecommandationCategorie == '') || ($impressionRecommandationCategorie == 'textandpicture')) ? _e('checked = \"checked\"') : ''; ?> /><label for=\"impressionRecommandationCategorie_textandpicture\" class=\"recommandationCategoryOptionLabel\" ><?php _e('Nom + image', 'evarisk'); ?></label></div>\r\n\t<div class=\"recommandationCategoryOptionChoice\" ><input type=\"radio\" class=\"impressionRecommandationCategorie\" name=\"impressionRecommandationCategorie\" id=\"impressionRecommandationCategorie_textonly\" value=\"textonly\" <?php (($impressionRecommandationCategorie != '') && ($impressionRecommandationCategorie == 'textonly')) ? _e('checked = \"checked\"') : ''; ?> /><label for=\"impressionRecommandationCategorie_textonly\" class=\"recommandationCategoryOptionLabel\" ><?php _e('Nom uniquement', 'evarisk'); ?></label></div>\r\n\t<div class=\"recommandationCategoryOptionChoice\" ><input type=\"radio\" class=\"impressionRecommandationCategorie\" name=\"impressionRecommandationCategorie\" id=\"impressionRecommandationCategorie_pictureonly\" value=\"pictureonly\" <?php (($impressionRecommandationCategorie != '') && ($impressionRecommandationCategorie == 'pictureonly')) ? _e('checked = \"checked\"') : ''; ?> /><label for=\"impressionRecommandationCategorie_pictureonly\" class=\"recommandationCategoryOptionLabel\" ><?php _e('Image uniquement', 'evarisk'); ?></label></div>\r\n\t<div class=\"recommandationCategoryOptionPicSizeContainer\" id=\"pictureRecommandationCategoryContainer\" ><label for=\"tailleimpressionRecommandationCategorie\" class=\"recommandationCategoryOptionLabel\" ><?php _e('Taille de l\\'image (en cm)', 'evarisk'); ?></label><input type=\"text\" name=\"tailleimpressionRecommandationCategorie\" id=\"tailleimpressionRecommandationCategorie\" value=\"<?php _e($tailleimpressionRecommandationCategorie); ?>\" /></div>\r\n\t<div class=\"clear\" >&nbsp;</div>\r\n\r\n<!--\tOption recommandation picture in document\t-->\r\n\t<div class=\"recommandationCategoryOption\" ><?php _e('Param&egrave;tres pour l\\'impression des pr&eacute;conisations de cette famille', 'evarisk'); ?></div>\r\n\t<div class=\"recommandationCategoryOptionChoice\" ><input type=\"radio\" class=\"impressionRecommandation\" name=\"impressionRecommandation\" id=\"impressionRecommandation_textandpicture\" value=\"textandpicture\" <?php (($impressionRecommandation == '') || ($impressionRecommandation == 'textandpicture')) ? _e('checked = \"checked\"') : ''; ?> /><label for=\"impressionRecommandation_textandpicture\" class=\"recommandationCategoryOptionLabel\" ><?php _e('Nom + image', 'evarisk'); ?></label></div>\r\n\t<div class=\"recommandationCategoryOptionChoice\" ><input type=\"radio\" class=\"impressionRecommandation\" name=\"impressionRecommandation\" id=\"impressionRecommandation_textonly\" value=\"textonly\" <?php (($impressionRecommandation != '') && ($impressionRecommandation == 'textonly')) ? _e('checked = \"checked\"') : ''; ?> /><label for=\"impressionRecommandation_textonly\" class=\"recommandationCategoryOptionLabel\" ><?php _e('Nom uniquement', 'evarisk'); ?></label></div>\r\n\t<div class=\"recommandationCategoryOptionChoice\" ><input type=\"radio\" class=\"impressionRecommandation\" name=\"impressionRecommandation\" id=\"impressionRecommandation_pictureonly\" value=\"pictureonly\" <?php (($impressionRecommandation != '') && ($impressionRecommandation == 'pictureonly')) ? _e('checked = \"checked\"') : ''; ?> /><label for=\"impressionRecommandation_pictureonly\" class=\"recommandationCategoryOptionLabel\" ><?php _e('Image uniquement', 'evarisk'); ?></label></div>\r\n\t<div class=\"recommandationCategoryOptionPicSizeContainer\" id=\"pictureRecommandationContainer\" ><label for=\"tailleimpressionRecommandation\" class=\"recommandationCategoryOptionLabel\" ><?php _e('Taille de l\\'image (en cm)', 'evarisk'); ?></label><input type=\"text\" name=\"tailleimpressionRecommandation\" id=\"tailleimpressionRecommandation\" value=\"<?php _e($tailleimpressionRecommandation); ?>\" /></div>\r\n\r\n\t<input type=\"submit\" name=\"save_recommancation_category\" id=\"save_recommancation_category\" class=\"clear alignright button-primary\" value=\"<?php _e('Enregistrer', 'evarisk'); ?>\" />\r\n</form>\r\n<script type=\"text/javascript\" >\r\n\tdigirisk(document).ready(function(){\r\n\t\tjQuery(\".impressionRecommandation\").click(function(){\r\n\t\t\tjQuery(\"#impressionRecommandationValue\").val(jQuery(this).val());\r\n\t\t\tif(jQuery(this).val() == 'textonly'){\r\n\t\t\t\tjQuery(\"#pictureRecommandationContainer\").hide();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tjQuery(\"#pictureRecommandationContainer\").show();\r\n\t\t\t}\r\n\t\t});\r\n\t\tjQuery(\".impressionRecommandationCategorie\").click(function(){\r\n\t\t\tjQuery(\"#impressionRecommandationCategorieValue\").val(jQuery(this).val());\r\n\t\t\tif(jQuery(this).val() == 'textonly'){\r\n\t\t\t\tjQuery(\"#pictureRecommandationCategoryContainer\").hide();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tjQuery(\"#pictureRecommandationCategoryContainer\").show();\r\n\t\t\t}\r\n\t\t});\r\n\t\tjQuery(\"#recommandation_category_form\").ajaxForm({\r\n\t\t\ttarget: \"#ajax-response\",\r\n\t\t\tbeforeSubmit: validate_recommandation_category_form\r\n\t\t});\r\n\t});\r\n\r\n\tfunction validate_recommandation_category_form(formData, jqForm, options){\r\n\t\tevarisk(\"#nom_categorie\").removeClass(\"ui-state-error\");\r\n\t\tfor(var i=0; i < formData.length; i++){\r\n\t\t\tif((formData[i].name == \"nom_categorie\") && !formData[i].value){\r\n\t\t\t\tcheckLength( evarisk(\"#nom_categorie\"), \"\", 1, 128, \"<?php _e('Le champs nom de la famille de pr&eacute;conisation doit contenir entre !#!minlength!#! et !#!maxlength!#! caract&egrave;res', 'evarisk'); ?>\" , evarisk(\".recommandationCategoryFormErrorMessage\"))\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}\r\n</script>\r\n<?php\r\n\t}", "function saveCat()\n {\n //update stuff\n }", "public function newAction()\n {\n\t\tTag::appendTitle('Add New Category');\n }", "function realstate_form($catId = null) {\n if ($catId!= null) {\n // We check if the category is the same as our plugin\n if (osc_is_this_category('realstate_plugin', $catId)) {\n $conn = getConnection() ;\n $data = $conn->osc_dbFetchResults('SELECT * FROM %st_item_house_property_type_attr', DB_TABLE_PREFIX);\n $p_type = array();\n foreach ($data as $d) {\n $p_type[$d['fk_c_locale_code']][$d['pk_i_id']] = $d['s_name'];\n }\n unset($data);\n include_once 'item_edit.php';\n }\n }\n}", "function category_add_thumbnail_field( $category ) {\n\t\tglobal $wp_taxonomies;\n\t\t?>\n\n\t\t<div class=\"form-field hide-if-no-js\">\n\t\t\t<p style=\"color:#222;font-style:normal;\"><?php _e( 'Featured Image' ); ?></p>\n\t\t\t<div id=\"image-container\">\n\t\t\t\t\n\t\t\t\t<div id=\"selected-image\"></div>\n\t\t\t\t\n\t\t\t\t<a id=\"set-category-thumbnail\" title=\"<?php _e( 'Set featured image' ); ?>\" data-uploader-title=\"<?php _e( 'Choose a thumbnail for this category', 'category-thumbnail' ); ?>\" data-uploader-button-text=\"<?php _e( 'Set Category Thumbnail', 'category-thumbnail' ); ?>\" href=\"#\" class=\"button thickbox\">\n\t\t\t\t\t<?php _e( 'Set featured image' ); ?>\n\t\t\t\t</a>\n\t\t\t\t\n\t\t\t\t<a id=\"remove-category-thumbnail\" title=\"<?php _e( 'Set featured image' ); ?>\" href=\"#\" style=\"display:none;\">\n\t\t\t\t\t<?php _e( 'Remove featured image' ); ?>\n\t\t\t\t</a>\n\t\t\t\t\n\t\t\t</div>\n\t\t\t<input name=\"image\" id=\"image-id\" type=\"hidden\" value=\"\" />\n\t\t\t<p>\n\t\t\t\t<?php printf( __( 'The thumbnail to this %s', 'category-thumbnail' ), $wp_taxonomies[ $category ]->labels->singular_name ); ?>\n\t\t\t</p>\n\t\t</div>\n\t\t\n\t\t<?php\n\t\t\n\t}", "function onInit()\n\t{\t\n\t\t/*$txt =\t\"<script type=\\\"text/javascript\\\">\n\t\t\t\tfunction insertPluginValue(myField, myValue) {\n\t\t\t\t\tmyField.value = myValue;\n\t\t\t\t}\n\t\t\t\t</script>\";*/\n\t\t$txt\t=\t\"\";\n\t\treturn $txt;\n\t}", "public function cmb_init() {\n\t\t$this->action( 'cmb2_init_hookup_rank-math-redirections', 'add_category_cmb_field', 110 );\n\t}", "function widget_sandbox_rsslinks_control() {\n\t$options = $newoptions = get_option('widget_sandbox_rsslinks');\n\tif ( $_POST['rsslinks-submit'] ) {\n\t\t$newoptions['title'] = strip_tags( stripslashes( $_POST['rsslinks-title'] ) );\n\t}\n\tif ( $options != $newoptions ) {\n\t\t$options = $newoptions;\n\t\tupdate_option( 'widget_sandbox_rsslinks', $options );\n\t}\n\t$title = attribute_escape( $options['title'] );\n?>\n\t\t\t<p><label for=\"rsslinks-title\"><?php _e( 'Title:', 'sandbox' ) ?> <input class=\"widefat\" id=\"rsslinks-title\" name=\"rsslinks-title\" type=\"text\" value=\"<?php echo $title; ?>\" /></label></p>\n\t\t\t<input type=\"hidden\" id=\"rsslinks-submit\" name=\"rsslinks-submit\" value=\"1\" />\n<?php\n}", "function external_url_taxonomy_add_new_meta_field() {\n ?>\n <div class=\"form-field\">\n <label for=\"term_meta[custom_term_meta]\"><?php _e( 'External URL:', 'external_url' ); ?></label>\n <input type=\"text\" name=\"term_meta[custom_term_meta]\" id=\"term_meta[custom_term_meta]\" value=\"\">\n <p class=\"description\"><?php _e( 'Enter a value for this field','external_url' ); ?></p>\n </div>\n<?php\n}", "public function query_add_edit_cat()\n\t{\n\t\t$cat_name = trim(Http::request('cat_name', 'post'));\n\t\tif ($this->mode == 'add_cat')\n\t\t{\n\t\t\t$sql = 'SELECT MAX(cat_order) AS max_order\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'smilies_cat';\n\t\t\t$max_order = Fsb::$db->get($sql, 'max_order');\n\n\t\t\tFsb::$db->insert('smilies_cat', array(\n\t\t\t\t'cat_name' =>\t$cat_name,\n\t\t\t\t'cat_order' =>\t$max_order + 1,\n\t\t\t));\n\t\t\tFsb::$db->destroy_cache('smilies_');\n\n\t\t\tDisplay::message('adm_smiley_well_cat_add', 'index.' . PHPEXT . '?p=posts_smiley', 'posts_smiley');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tFsb::$db->update('smilies_cat', array(\n\t\t\t\t'cat_name' =>\t$cat_name,\n\t\t\t), 'WHERE cat_id = ' . $this->id);\n\t\t\tFsb::$db->destroy_cache('smilies_');\n\n\t\t\tDisplay::message('adm_smiley_well_cat_edit', 'index.' . PHPEXT . '?p=posts_smiley', 'posts_smiley');\n\t\t}\n\t}", "function suggestcomment_js_header(){\n $suggestcomment_prompt = get_option('suggestcomment_prompt');\n $commentlist = suggestcomment_get_comments();\n?>\n<script type=\"text/javascript\">\n//<![CDATA[\nfunction suggestcomment_replace_comment(commentid)\n{\nvar commenttext = new Array ();\n<?php \nforeach ($commentlist as $sugcomment){\necho \"commenttext[$sugcomment->comment_id]=\\\"$sugcomment->comment_text\\\";\\n\";\n}\n?>\nreplaceIt = confirm(\"<?php echo $suggestcomment_prompt;?>\");\n if (replaceIt==true){\n commentForm=window.document.forms['commentform'];\n\t\tif (commentForm.elements['comment-text']){commentForm.elements['comment-text'].value=commenttext[commentid]};\n\t\tif (commentForm.elements['comment']){commentForm.elements['comment'].value=commenttext[commentid]};\n\t\t} \n}\n//]]>\n</script>\n<?php\n}", "public function edit_form_after_title() {\n\t\twp_nonce_field( 'papi_save_data', 'papi_meta_nonce' );\n\n\t\tif ( $value = esc_attr( papi_get_entry_type_id() ) ) {\n\t\t\tpapi_render_html_tag( 'input', [\n\t\t\t\t'data-papi-page-type-key' => true,\n\t\t\t\t'name' => esc_attr( papi_get_page_type_key() ),\n\t\t\t\t'type' => 'hidden',\n\t\t\t\t'value' => $value\n\t\t\t] );\n\t\t}\n\t}", "public function process()\n\t{\t\n\t\t$this->template()\n ->setBreadCrumb(Phpfox::getPhrase('adsonfeed.add_new_ads'))\n ->setHeader(array(\n 'ad.js' => 'module_adsonfeed'\n ))\n ;\n $bIsEdit = false;\n if (($iId = $this->request()->getInt('id')) && ($aAds = phpfox::getService('adsonfeed')->getForEdit($iId)))\n {\n $bIsEdit = true; \n $this->template()->assign(array(\n 'aForms' => $aAds\n ));\n }\n $aVals = $this->request()->getArray('val');\n $aValidation = array(\n\t\t\t'name' => Phpfox::getPhrase('adsonfeed.provide_a_name_for_this_campaign')\n\t\t);\n if (is_array($aVals) && count($aVals) > 0)\n\t\t{\n\t\t\tif (isset($aVals['type_id']))\n\t\t\t{\n\t\t\t\tif ($aVals['type_id'] == 2)\n\t\t\t\t{\n\t\t\t\t\t$aValidation['url_link'] = Phpfox::getPhrase('adsonfeed.provide_a_link_for_your_banner');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n $oValidator = Phpfox::getLib('validator')->set(array('sFormName' => 'js_form', 'aParams' => $aValidation));\n if (is_array($aVals) && count($aVals) > 0)\n\t\t{\n\t\t\tif ($aVals['type_id'] == 1 && empty($aVals['html_code']))\n\t\t\t{\n\t\t\t\tPhpfox_Error::set(Phpfox::getPhrase('adsonfeed.provide_html_for_your_banner'));\t\n\t\t\t}\n\n\t\t\tif ($oValidator->isValid($aVals))\n\t\t\t{\n\t\t\t\tif ($bIsEdit)\n\t\t\t\t{\n\t\t\t\t\tif (Phpfox::getService('adsonfeed.process')->update($aVals['id'], $aVals))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->url()->send('admincp.adsonfeed.add', array('id' => $aVals['id']), Phpfox::getPhrase('adsonfeed.ad_successfully_updated'));\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\tif (Phpfox::getService('adsonfeed.process')->add($aVals))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->url()->send('admincp.adsonfeed.add', null, Phpfox::getPhrase('adsonfeed.ad_successfully_added'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n $this->template()->assign(array(\n 'bIsEdit' => $bIsEdit\n ));\n\t}", "function updated_category_image ( $term_id, $tt_id ) {\n if( isset( $_POST['category-image-id'] ) && '' !== $_POST['category-image-id'] ){\n $image = $_POST['category-image-id'];\n update_term_meta ( $term_id, 'category-image-id', $image );\n } else {\n update_term_meta ( $term_id, 'category-image-id', '' );\n }\n }" ]
[ "0.57493216", "0.5638515", "0.5587308", "0.5583835", "0.5576168", "0.5532479", "0.5492839", "0.5468453", "0.5453175", "0.5439546", "0.542789", "0.5405437", "0.53552526", "0.52939606", "0.5288841", "0.5271692", "0.5238602", "0.5228893", "0.52277046", "0.5167096", "0.5166725", "0.5166276", "0.5149655", "0.5132167", "0.51272017", "0.51069653", "0.5100877", "0.5091436", "0.5091436", "0.5089934", "0.50853115", "0.50671035", "0.5065593", "0.5038366", "0.5030826", "0.50303257", "0.5006469", "0.5001351", "0.49916145", "0.49880767", "0.49815586", "0.4962277", "0.4962069", "0.49530885", "0.4947051", "0.49446598", "0.49438825", "0.49438044", "0.494288", "0.49294376", "0.49291295", "0.49270752", "0.49231753", "0.49060374", "0.49032542", "0.48979545", "0.489366", "0.48890707", "0.48832086", "0.4882594", "0.48787707", "0.48749602", "0.4874862", "0.48624402", "0.4848889", "0.48452598", "0.4841929", "0.484128", "0.4841022", "0.48351586", "0.4834731", "0.48331612", "0.4826797", "0.48198652", "0.4819203", "0.48186827", "0.48132414", "0.48129916", "0.48112565", "0.48078054", "0.4798723", "0.47965598", "0.47807017", "0.47737572", "0.47692502", "0.4766355", "0.4762816", "0.47575995", "0.47575346", "0.47495228", "0.47494823", "0.47438705", "0.4741489", "0.47404134", "0.47366783", "0.4735895", "0.47323987", "0.47307974", "0.47307187", "0.4728211" ]
0.7567759
0
Disable Extension This method removes information from the exp_extensions table
function disable_extension() { $this->EE->db->where('class', __CLASS__); $this->EE->db->delete('extensions'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function disable_extension() {\n ee()->db->where('class', __CLASS__);\n ee()->db->delete('extensions');\n }", "function disable_extension()\n {\n ee()->db->where('class', __CLASS__);\n ee()->db->delete('extensions');\n }", "function disable_extension()\n\t{\n\t\tee()->db->where('class', __CLASS__);\n\t\tee()->db->delete('extensions');\n\t}", "function disable_extension()\n\t{\n\t\tglobal $DB;\n\t\t$DB->query(\"DELETE FROM exp_extensions WHERE class = '\" . get_class($this) . \"'\");\n\t}", "function disable_extension()\n\t{\n\t\tglobal $DB;\n\t\t$DB->query(\"DELETE FROM exp_extensions WHERE class = '\".$DB->escape_str(get_class($this)).\"'\");\n\t}", "function disable_extension()\n\t{\n\t\t$this->EE->db->where('class', __CLASS__)\n\t\t ->delete('extensions');\n\t\t// Drop the custom column from exp_assets\n\t\tif ($this->EE->db->table_exists('assets') && $this->EE->db->field_exists('members_only', 'assets'))\n\t\t{\n\t\t\t$this->EE->load->dbforge();\n\t\t\t$this->EE->dbforge->drop_column('assets', 'members_only');\n\t\t}\n\t}", "public function disable_extension(){}", "public function disable_extension()\n\t{\n\t\t$defaultTemplateType = 'webpage'; // replace custom templates types with the default value 'webpage'\n\t\t\n\t ee()->db->where('class', __CLASS__);\n\t ee()->db->delete('extensions');\n\t \n\t\t// Clean-up template table \n\t\tforeach( $this->settings AS $ext=>$notused ) {\t \n\t\t ee()->db->where('template_type', $ext);\n\t\t ee()->db->update('templates', array('template_type'=>$defaultTemplateType));\n\t }\n\t \n\t}", "public function disableExtension()\n {\n $this->resourceConfig->saveConfig(self::XML_PATH_MODULE_ACTIVE, 0, 'default', 0);\n }", "function disable_extension()\n\t{\n\t\treturn TRUE;\n\t}", "function uninstall_extension()\n\t{\n\t\treturn TRUE;\n\t}", "public function uninstall()\r\n {\r\n // ee()->db->where('class', ucfirst(EXT_SHORT_NAME).'_ext');\r\n // ee()->db->delete('extensions');\r\n\r\n ee()->db->where('module_name', EXT_NAME);\r\n ee()->db->delete('modules');\r\n\r\n ee()->db->delete('modules', array( 'module_name' => EXT_NAME));\r\n\r\n // ee()->load->dbforge();\r\n // $sql[] = \"DROP TABLE IF EXISTS exp_email_cache_plus\";\r\n // $sql[] = \"DROP TABLE IF EXISTS exp_email_queue_plus\";\r\n // $this->runSQL($sql);\r\n return true;\r\n }", "private function _deleteHooks()\n\t{\n\t\t$EE =& get_instance();\n\t\t$EE->db->where('class', __CLASS__);\n\t\t$EE->db->delete('exp_extensions'); \n\t}", "public function removeExtension($name) {}", "public function removeExtension($ext)\n {\n unset($this->extensions[$ext]);\n }", "public function disable() {\n\t\t$this->update(TRUE);\n\t}", "public function disable();", "protected function getExtensionsToExclude() {}", "public static function disable()\n {\n self::$_enabled = FALSE;\n }", "public function disable()\n {\n $this->enabled = false;\n }", "public function uninstall(){\n\t\t$this->_uninstall();\n\t\t$model = $this->getCounterpartModel();\n\n\t\tif( $model->getConfigValue( 'uninstall_clear_db' ) ) {\n\t\t\t$this->_uninstallDb();\n\t\t}\n\t\tif( $model->getConfigValue( 'uninstall_clear_settings' ) ) {\n\t\t\t$this->_uninstallSettings();\n\t\t}\n\n\t\t//mark the extension as uninstalled\n\t\t//better to use editSetting - since there is may be no 'installed' value in config after uninstall\n\t\tAdvertikon::getExtendedModel( 'setting_setting' )->editSettingValue( 'installed' , 0 );\n\t}", "public static function disable(): void\n {\n static::$_enabled = false;\n }", "public static function disable(){\n self::$disabled = true; \n self::$enabled = false;\n }", "public static function disable() {\n\t\tself::$enabled = false;\n\t}", "public function alterExtensionTable() {\n\t$query = $this->db->query(\"DELETE FROM `\".DB_PREFIX.\"extension` WHERE type='module' AND code != 'digitalElephantFilter' AND code != 'basel_installer'\");\n\t\n$oc_extension = array(\n array('extension_id' => '475','type' => 'module','code' => 'basel_instagram'),\n array('extension_id' => '474','type' => 'module','code' => 'category'),\n array('extension_id' => '473','type' => 'module','code' => 'account'),\n array('extension_id' => '472','type' => 'module','code' => 'basel_content'),\n array('extension_id' => '471','type' => 'module','code' => 'basel_layerslider'),\n array('extension_id' => '470','type' => 'module','code' => 'basel_megamenu'),\n array('extension_id' => '469','type' => 'module','code' => 'basel_products'),\n array('extension_id' => '468','type' => 'module','code' => 'blog_latest'),\n array('extension_id' => '467','type' => 'module','code' => 'basel_carousel')\n);\n\t\n\tforeach ($oc_extension as $result) {\n $this->db->query(\"INSERT INTO `\" . DB_PREFIX . \"extension` SET \"\n\t\t\t\t. \"type = '\" . $result['type'] . \"', \"\n . \"code = '\" . $result['code'] . \"'\");\n \t}\n\n\t}", "protected function getConsole_Command_Extension_DisableService()\n {\n return $this->services['console.command.extension.disable'] = new \\phpbb\\console\\command\\extension\\disable(${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'}, ${($_ = isset($this->services['ext.manager']) ? $this->services['ext.manager'] : $this->getExt_ManagerService()) && false ?: '_'}, ${($_ = isset($this->services['log']) ? $this->services['log'] : $this->getLogService()) && false ?: '_'});\n }", "public static function disable(): void\n {\n self::$isEnabled = false;\n }", "public function update_extension(){}", "public function removeExtension($name)\n {\n unset($this->extensions[$name]);\n }", "function deactivate() {\r\n global $wp_rewrite;\r\n\r\n $wp_rewrite->page_structure = str_replace(\".\" . $this->options->extension, \"\", $wp_rewrite->page_structure);\r\n $wp_rewrite->flush_rules();\r\n }", "public function onDisable() {\n\t}", "public function disable() {}", "public function removeExtAddon($classname);", "function disableNativeExtension()\n\t{\n\t\t$GLOBALS['amfphp']['native'] = false;\n\t}", "function purge() {\n\t\t$db =& JFactory::getDBO();\n\t\t$db->setQuery('DELETE FROM #__extensions WHERE state = -1');\n\t\tif ($db->Query()) {\n\t\t\t$this->_message = JText::_('Purged discovered extensions');\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$this->_message = JText::_('Failed to purge extensions');\n\t\t\treturn false;\n\t\t}\n\t}", "public function hookDisable(): void\n {\n $this->say(\"Executing the Plugin's disable hook...\");\n $this->_exec(\"php ./src/hook_disable.php\");\n }", "public function unsetExtension($index)\n {\n unset($this->extension[$index]);\n }", "public static function clearExtensionKeyMap() {}", "public function uninstall() {\n $this->load->model('extension/module/export_yml');\n $this->model_extension_module_export_yml->uninstallPromCategoryTable();\n $this->model_extension_module_export_yml->uninstallPromProductTable();\n }", "public function disable( $name );", "function deactivate_custom_modules()\n{\n $db = Db::getInstance();\n $modulesDirOnDisk = [];\n $modules = scandir(_PS_MODULE_DIR_, SCANDIR_SORT_NONE);\n foreach ($modules as $name) {\n if (!in_array($name, ['.', '..', 'index.php', '.htaccess']) && @is_dir(_PS_MODULE_DIR_ . $name . DIRECTORY_SEPARATOR) && @file_exists(_PS_MODULE_DIR_ . $name . DIRECTORY_SEPARATOR . $name . '.php')) {\n if (!preg_match('/^[a-zA-Z0-9_-]+$/', $name)) {\n exit(Tools::displayError() . ' (Module ' . $name . ')');\n }\n $modulesDirOnDisk[] = $name;\n }\n }\n\n $module_list_xml = _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'modules_list.xml';\n\n if (!file_exists($module_list_xml)) {\n $module_list_xml = _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'modules_list.xml';\n if (!file_exists($module_list_xml)) {\n return false;\n }\n }\n\n $nativeModules = @simplexml_load_file($module_list_xml);\n if ($nativeModules) {\n $nativeModules = $nativeModules->modules;\n }\n $arrNativeModules = [];\n if (!empty($nativeModules)) {\n foreach ($nativeModules as $nativeModulesType) {\n if (in_array($nativeModulesType['type'], ['native', 'partner'])) {\n $arrNativeModules[] = '\"\"';\n foreach ($nativeModulesType->module as $module) {\n $arrNativeModules[] = '\"' . pSQL($module['name']) . '\"';\n }\n }\n }\n }\n $arrNonNative = [];\n if ($arrNativeModules) {\n $arrNonNative = $db->executeS('\n \t\tSELECT *\n \t\tFROM `' . _DB_PREFIX_ . 'module` m\n \t\tWHERE name NOT IN (' . implode(',', $arrNativeModules) . ') ');\n }\n\n $uninstallMe = ['undefined-modules'];\n if (is_array($arrNonNative)) {\n foreach ($arrNonNative as $k => $aModule) {\n $uninstallMe[(int) $aModule['id_module']] = $aModule['name'];\n }\n }\n\n if (!is_array($uninstallMe)) {\n $uninstallMe = [$uninstallMe];\n }\n\n foreach ($uninstallMe as $k => $v) {\n $uninstallMe[$k] = '\"' . pSQL($v) . '\"';\n }\n\n $return = Db::getInstance()->execute('\n\tUPDATE `' . _DB_PREFIX_ . 'module` SET `active` = 0 WHERE `name` IN (' . implode(',', $uninstallMe) . ')');\n\n if (count(Db::getInstance()->executeS('SHOW TABLES LIKE \\'' . _DB_PREFIX_ . 'module_shop\\'')) > 0) {\n foreach ($uninstallMe as $k => $uninstall) {\n $return &= Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'module_shop` WHERE `id_module` = ' . (int) $k);\n }\n }\n\n return $return;\n}", "public function reloadAvailableExtensions() {}", "public function reloadAvailableExtensions() {}", "public function disable(): void\n {\n $this->disabled = true;\n }", "public function removeAnisifyExtension()\r\n\t{\r\n\t\t$userInput=$this->getServerFeedback();\r\n if(in_array('anisify', $userInput)){\r\n \tarray_shift($userInput);\r\n }\r\n \r\n $this->userInput=$userInput;\r\n return $this;\r\n\t}", "public function invalidate( $extension ) {\n\t\t_deprecated_function( __METHOD__, 'WPSEO 15.4' );\n\t}", "public function resetExtensionInstallStorage() {}", "public static function disableHtmlExtension()\r\n {\r\n self::$html = false;\r\n }", "function uninstall()\n\t{\n\t\t$GLOBALS['NO_DB_SCOPE_CHECK']=true;\n\t\t$GLOBALS['SITE_DB']->drop_if_exists('f_welcome_emails');\n\t\t$GLOBALS['NO_DB_SCOPE_CHECK']=false;\n\t}", "protected function executeUnloadDbalExtension() {}", "public function unsetEnabled(): void\n {\n $this->enabled = [];\n }", "public static function disable()\n {\n // Disable the page theme\n unset(self::$data['theme']);\n\n // Disable the optimizer\n self::$data['optimize'] = false;\n }", "public function delete($extension)\n {\n }", "public static function deactivate() {\n\t\tif (Plus_admin::gs('resetsettings_status')){\n\t\t\tdelete_option('cs_plusadmin_settings');\n\t\t\tdelete_option('cs_plus_admin_lpm_settings');\n\t\t\tdelete_option('cs_plus_admin_amm_settings');\n\t\t\tdelete_option('cs_plusadmin_adminmenu');\n\t\t\tdelete_option('cs_plusadmin_adminsubmenu');\n\t\t\tdelete_option('cs_plusadmin_status');\n\t\t}\n\t}", "function removeExtension($ext) {\r\n\t\tif ( isset($this->_file_extensions[$ext]) ) {\r\n\t\t\tunset($this->_file_extensions[$ext]);\r\n\t\t}\r\n\t\treturn $this;\r\n\t}", "function setStripExtensions($stripExtensions) {\n $this->stripExtensions = $stripExtensions;\n }", "protected function setAvailableExtensions() {}", "function uninstall()\n\t{\n\t\t$this->EE->load->dbforge();\n\n\t\t$this->EE->db->select('module_id');\n\t\t$query = $this->EE->db->get_where('modules', array('module_name' => 'LikEE'));\n\n\t\t$this->EE->db->where('module_id', $query->row('module_id'));\n\t\t$this->EE->db->delete('module_member_groups');\n\n\t\t$this->EE->db->where('module_name', 'Likee');\n\t\t$this->EE->db->delete('modules');\n\n\t\t$this->EE->db->where('class', 'Likee');\n\t\t$this->EE->db->delete('actions');\n\n\t\t$this->EE->dbforge->drop_table('likee');\n\t\t\n\t\treturn TRUE;\n\t}", "function dbAddProductExtensions( $aData, $bErase = true ){\n global $oFF;\n if( isset( $bErase ) )\n $oFF->deleteInFile( DB_PRODUCTS_EXT, $aData[0], 0 );\n\n $oFF->setRow( $aData );\n $oFF->addToFile( DB_PRODUCTS_EXT ); \n }", "function remove() {\r\n global $db;\r\n $db->Execute(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_key LIKE 'MODULE\\_PAYMENT\\_NOCHEX%'\");\r\n $this->notify('NOTIFY_PAYMENT_NOCHEX_UNINSTALLED');\r\n }", "function delete()\n {\n jimport('joomla.installer.installer');\n $installer =& JInstaller::getInstance();\n\n require_once(JPATH_COMPONENT.DS.'adapters'.DS.'sef_ext.php');\n $adapter = new JInstallerSef_Ext($installer);\n $installer->setAdapter('sef_ext', $adapter);\n\n $result = $installer->uninstall('sef_ext', $this->_id, 0);\n\n return $result;\n }", "public function disable_step($name)\n\t{\n\t\t// ignore extensions that are not enabled\n\t\tif (!$this->is_enabled($name))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$old_state = unserialize($this->extensions[$name]['ext_state']);\n\n\t\t$extension = $this->get_extension($name);\n\t\t$state = $extension->disable_step($old_state);\n\n\t\t// continue until the state is false\n\t\tif ($state !== false)\n\t\t{\n\t\t\t$extension_data = array(\n\t\t\t\t'ext_state'\t\t=> serialize($state),\n\t\t\t);\n\t\t\t$this->extensions[$name]['ext_state'] = serialize($state);\n\n\t\t\t$sql = 'UPDATE ' . $this->extension_table . '\n\t\t\t\tSET ' . $this->db->sql_build_array('UPDATE', $extension_data) . \"\n\t\t\t\tWHERE ext_name = '\" . $this->db->sql_escape($name) . \"'\";\n\t\t\t$this->db->sql_query($sql);\n\n\t\t\tif ($this->cache)\n\t\t\t{\n\t\t\t\t$this->cache->purge();\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t$extension_data = array(\n\t\t\t'ext_active'\t=> false,\n\t\t\t'ext_state'\t\t=> serialize(false),\n\t\t);\n\t\t$this->extensions[$name]['ext_active'] = false;\n\t\t$this->extensions[$name]['ext_state'] = serialize(false);\n\n\t\t$sql = 'UPDATE ' . $this->extension_table . '\n\t\t\tSET ' . $this->db->sql_build_array('UPDATE', $extension_data) . \"\n\t\t\tWHERE ext_name = '\" . $this->db->sql_escape($name) . \"'\";\n\t\t$this->db->sql_query($sql);\n\n\t\tif ($this->cache)\n\t\t{\n\t\t\t$this->cache->purge();\n\t\t}\n\n\t\treturn false;\n\t}", "public function disable(Module $module);", "public static function preventExtensions(prototype\\Prototype $prototype) :void\n {\n if ( !isset(self::$notExtensible) ) {\n self::$notExtensible = new \\SplObjectStorage();\n }\n self::$notExtensible[$prototype] = true;\n }", "public function disabled();", "public function disabled();", "public function setExcludeExtension($value)\n {\n $this->getAdapter()->addValidator('excludeextension', false, $value);\n\n return $this;\n }", "private function disableTopPageUpdate(): void\n {\n /** @var DataExtension $extension */\n $extension = singleton(DataExtension::class);\n $extension->disableTopPageUpdate();\n }", "public static function deactivate() {\n\t\tglobal $wpdb;\n\n\t\t$wpdb->query( \"DROP TABLE IF EXISTS \" . GUESS_JS_PREDICTIONS_TABLE );\n\t\t$wpdb->query( \"DROP TABLE IF EXISTS \" . GUESS_JS_PAGEVIEWS_TABLE );\n\t\t$wpdb->query( \"DROP TABLE IF EXISTS \" . GUESS_JS_USER_FLOWS_TABLE );\n\t\tdelete_option ( GUESS_JS_OPTIONS_VIEW_ID );\n\t\tdelete_option ( GUESS_JS_OPTIONS_CREDENTIALS );\n\n\t\tif ( file_exists ( GUESS_JS_CREDENTIALS_FILE ) ){\n\t\t\tunlink( GUESS_JS_CREDENTIALS_FILE );\n\t\t}\n\t}", "public function activate_extension(){}", "public static function removeInstallToolEnableFile() {}", "function specialtysystem_uninstall(){\n\t$sql=\"UPDATE \".db_prefix('accounts').\" SET specialty='' WHERE specialty='SS'\";\n\tdb_query($sql);\n\t// clear up our table\n\t$sql=\"DROP TABLE \".db_prefix('specialtysystem').\";\";\n\tdb_query($sql);\n\treturn true;\n}", "function js_disabled() {\n\n }", "public function getUnusedExtensions()\n {\n // Consultar todas las extensiones disponibles\n $sPwdFreepbx = obtenerClaveConocidaMySQL('asteriskuser');\n if (is_null($sPwdFreepbx)) {\n \t$this->errMsg = 'No se puede leer clave DB para FreePBX';\n return NULL;\n }\n \n // BUG del framework: para asteriskuser se devuelve un array\n if (is_array($sPwdFreepbx)) $sPwdFreepbx = $sPwdFreepbx['valor'];\n \n $dsn = \"mysql://asteriskuser:{$sPwdFreepbx}@localhost/asterisk\";\n $dbFreepbx = new paloDB($dsn);\n if ($dbFreepbx->connStatus) {\n $this->errMsg = 'No se puede conectar a DB para FreePBX';\n \treturn NULL;\n }\n $extensiones = array();\n $recordset = $dbFreepbx->fetchTable(\n 'SELECT data FROM sip WHERE keyword = \"Dial\" UNION '.\n 'SELECT data FROM iax WHERE keyword = \"Dial\"',\n TRUE);\n if (!is_array($recordset)) {\n $this->errMsg = 'No se pueden consultar extensiones en FreePBX - '.$dbFreepbx->errMsg;\n \treturn NULL;\n }\n foreach ($recordset as $tupla) $extensiones[$tupla['data']] = $tupla['data'];\n $dbFreepbx = NULL;\n \n // Quitar de la lista las extensiones ya registradas\n $listaAgentes = $this->getAgents();\n if (!is_array($listaAgentes)) return NULL;\n foreach ($listaAgentes as $agente) {\n \t$k = $agente['type'].'/'.$agente['number'];\n if (isset($extensiones[$k])) unset($extensiones[$k]);\n }\n return $extensiones;\n }", "function spr_section_exclude_uninstall() {\nglobal $spr_exclude_db_debug;\n\n\t$res = safe_query(\"ALTER TABLE \".safe_pfx(\"txp_section\").\" DROP COLUMN spr_exclude;\",$spr_exclude_db_debug);\n\treturn $res;\n}", "public function setExtension($ext);", "function redcap_module_system_disable($version) {\n\t\t$g = fopen(__DIR__.\"/template_field_data.json\",\"r\");\n $template_data = fread($g,filesize(__DIR__.\"/template_field_data.json\"));\n fclose($g);\n\n $files = glob(__DIR__.\"/field_data/*\");\n foreach($files as $file) {\n \t$f = fopen($file,\"w\");\n\t\t\tfwrite($f,$template_data);\n\t\t\tfclose($f);\n }\n }", "function deactivate() {\n \n $this->reset_caches();\n $this->ext->update_option( 'livefyre_deactivated', 'Deactivated: ' . time() );\n\n }", "Public Function clearPerformanceConnectorExpLevel()\n\t{\n\t\t$this->_db->delete('bevomedia_user_performanceconnector_explevel', 'user__Id = ' . $this->id);\n\t}", "public function testUpdateExtensionFail()\n\t{\n\t\t$this->restartApplication();\n\n\t\t$this->be($this->user);\n\t\t$this->call('orchestra::extensions@update', array(DEFAULT_BUNDLE));\n\t\t$this->assertResponseNotFound();\n\t}", "protected function toggleDisableAction() {}", "public function load_extensions()\n\t{\n\t\t$this->extensions = array();\n\n\t\t// Do not try to load any extensions if the extension table\n\t\t// does not exist or when installing or updating.\n\t\t// Note: database updater invokes this code, and in 3.0\n\t\t// there is no extension table therefore the rest of this function\n\t\t// fails\n\t\tif (defined('IN_INSTALL') || version_compare($this->config['version'], '3.1.0-dev', '<'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$sql = 'SELECT *\n\t\t\tFROM ' . $this->extension_table;\n\n\t\t$result = $this->db->sql_query($sql);\n\t\t$extensions = $this->db->sql_fetchrowset($result);\n\t\t$this->db->sql_freeresult($result);\n\n\t\tforeach ($extensions as $extension)\n\t\t{\n\t\t\t$extension['ext_path'] = $this->get_extension_path($extension['ext_name']);\n\t\t\t$this->extensions[$extension['ext_name']] = $extension;\n\t\t}\n\n\t\tksort($this->extensions);\n\n\t\tif ($this->cache)\n\t\t{\n\t\t\t$this->cache->put($this->cache_name, $this->extensions);\n\t\t}\n\t}", "protected function caseReactivateModuleOtherModuleWithSimilarNameIsDisabledExtensionsDoNotChange()\n {\n return array(\n // modules to be activated during test preparation\n array(\n 'extending_3_classes_with_1_extension', 'with_1_extension',\n ),\n\n // Bug 5634: Reactivating disabled module removes extensions of other deactivated modules with similar name\n // modules to be reactivated\n 'with_1_extension',\n\n // environment asserts\n array(\n 'blocks' => array(),\n 'extend' => array(\n \\OxidEsales\\Eshop\\Application\\Model\\Article::class => 'extending_3_classes_with_1_extension/mybaseclass&with_1_extension/mybaseclass',\n \\OxidEsales\\Eshop\\Application\\Model\\Order::class => 'extending_3_classes_with_1_extension/mybaseclass',\n \\OxidEsales\\Eshop\\Application\\Model\\User::class => 'extending_3_classes_with_1_extension/mybaseclass',\n ),\n 'files' => array(),\n 'settings' => array(),\n 'disabledModules' => array(\n 'extending_3_classes_with_1_extension',\n ),\n 'templates' => array(),\n 'versions' => array(\n 'with_1_extension' => '1.0',\n ),\n 'events' => array(\n 'with_1_extension' => null,\n ),\n ),\n );\n }", "function monitis_addon_deactivate() {\n // Remove Custom DB Table\n // TODO handle db failures \n $query = \"DROP TABLE `mod_monitis_addon`, `mod_monitis_server`\";\n\t$result = mysql_query($query);\n return array('status'=>'success','description'=>'Deactivation successful');\n}", "public function deletePatch()\n {\n return true;\n $this->dao->delete()->from(TABLE_EXTENSION)->where('type')->eq('patch')->exec();\n }", "public function onDisable() {\n $this->getLogger()->info(TextFormat::YELLOW . \"Disabling MaxPlugin...\");\n }", "function DeleteLegacySitelinks(\n CampaignAdExtensionService $campaignExtensionService, $extensionToDelete) {\n\n $operation = new CampaignAdExtensionOperation();\n $operation->operator = 'REMOVE';\n $operation->operand = $extensionToDelete;\n\n $campaignExtensionService->mutate(array($operation));\n}", "public function remove_supports()\n {\n }", "public function deactivate()\n {\n global $wpdb;\n /* @var wpdb $wpdb */\n\n delete_metadata('user', 0, '_cleeng_publisher_token', '', true);\n\n delete_option('cleeng_rss');\n delete_option('cleeng_options');\n\n $table_name = $wpdb->prefix . \"cleeng_content\";\n $wpdb->query(\"DROP TABLE $table_name\");\n }", "protected function checkDisableFunctions() {}", "public function deactivate() {\t\t\n $dir_path = get_home_path() . '/' . $this->attempts_dir;\n\n $dir = opendir($dir_path);\n\n while (false !== ($file = readdir($dir))) {\n if (($file != '.') && ($file != '..')) {\n unlink($dir_path . '/' . $file);\n }\n }\n rmdir($dir_path);\n closedir($dir);\n\n\n foreach ($this->protected_files as $sfile) {\n $arr = file(get_home_path() . '/' . $sfile);\n unset($arr[1]);\n $arr = array_values($arr);\n file_put_contents(get_home_path() . '/' . $sfile, implode($arr));\n }\n\n wp_clear_scheduled_hook('hackattempts_cleanup');\n wp_clear_scheduled_hook('hackattempts_email');\n\t}", "public function onExtensionAfterSave($context, $data, $isNew) {\n// \n// WidgetkitK2WidgetkitHelper::delete();\n }", "public function disable(ContextInterface $ctx): void;", "public function disable(ContextInterface $ctx): void;", "public function disable(ContextInterface $ctx): void;", "function activate_extension()\n\t{\n\t\t$data = array(\n\t\t\t'class'\t\t\t=>\t__CLASS__,\n\t\t\t'method'\t\t=>\t'cp_js_end',\n\t\t\t'hook'\t\t\t=>\t'cp_js_end',\n\t\t\t'settings'\t\t=>\t'',\n\t\t\t'priority'\t\t=>\t10,\n\t\t\t'version'\t\t=> \t$this->version,\n\t\t\t'enabled'\t\t=>\t'y'\n\t);\n\n\t$this->EE->db->insert('extensions', $data);\n\n\t}" ]
[ "0.8821285", "0.8669378", "0.8642913", "0.8585984", "0.8518192", "0.8262398", "0.8087804", "0.80238163", "0.7842973", "0.7197018", "0.6628642", "0.63803476", "0.63490266", "0.61334616", "0.6133108", "0.6041258", "0.6010015", "0.5993963", "0.59843075", "0.59778494", "0.59753096", "0.5968031", "0.596724", "0.59538245", "0.5941797", "0.5940418", "0.5921412", "0.5913215", "0.5886073", "0.58780897", "0.58449227", "0.58443266", "0.5815483", "0.5765169", "0.5758151", "0.573901", "0.57337874", "0.56992894", "0.5694086", "0.5692484", "0.5674937", "0.56295705", "0.56295705", "0.5624837", "0.56223965", "0.5614067", "0.5608865", "0.55999905", "0.5556388", "0.55323225", "0.5522892", "0.55058175", "0.547293", "0.5454031", "0.545364", "0.5443364", "0.54131496", "0.5373261", "0.53725815", "0.5368522", "0.5365569", "0.535225", "0.535119", "0.5349439", "0.53386074", "0.53386074", "0.5326787", "0.5325792", "0.53039056", "0.52985346", "0.524478", "0.52357256", "0.52357227", "0.521408", "0.51943576", "0.5194132", "0.5187452", "0.5186445", "0.51709217", "0.51605", "0.5156594", "0.5155272", "0.5146467", "0.5139335", "0.5137509", "0.5120058", "0.51187503", "0.51179147", "0.51117307", "0.5095966", "0.50816065", "0.50812364", "0.50617504", "0.50617504", "0.50617504", "0.5056765" ]
0.8674797
5
Update Extension This function performs any necessary db updates when the extension page is visited
function update_extension($current = '') { if ($current == '' OR $current == $this->version) { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update_extension(){}", "protected function updateExtensionAction() {}", "public function db_update() {}", "public function updateExtList() {}", "function update_extension($current='')\n\t{\n\t\tglobal $DB;\n\n\t\tif ($current == '' OR $current == $this->version)\n\t\t\treturn FALSE;\n\n\t\t// Integrated LG Addon Updater\n\t\t// Removed control_panel_homepage hook\n\t\t// Added lg_addon_update_register_source hook + method\n\t\t// Added lg_addon_update_register_addon hook + method\n\t\tif($current < '1.2.0')\n\t\t{\n\t\t\t$settings = $this->_get_settings(TRUE, TRUE);\n\n\t\t\tforeach ($settings as $site_id => $site_settings)\n\t\t\t{\n\t\t\t\t$settings[$site_id]['show_time'] = 'n';\n\t\t\t}\n\n\t\t\t$sql[] = \"DELETE FROM `exp_extensions` WHERE `class` = '\".get_class($this).\"' AND `hook` = 'control_panel_home_page'\";\n\t\t\t$hooks = array(\n\t\t\t\t'lg_addon_update_register_source'\t=> 'lg_addon_update_register_source',\n\t\t\t\t'lg_addon_update_register_addon'\t=> 'lg_addon_update_register_addon'\n\t\t\t);\n\n\t\t\tforeach ($hooks as $hook => $method)\n\t\t\t{\n\t\t\t\t$sql[] = $DB->insert_string( 'exp_extensions', \n\t\t\t\t\t\t\t\t\t\t\t\tarray('extension_id' \t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'class'\t\t\t=> get_class($this),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'method'\t\t=> $method,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'hook'\t\t\t=> $hook,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'settings'\t\t=> addslashes(serialize($settings)),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'priority'\t\t=> 10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'version'\t\t=> $this->version,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'enabled'\t\t=> \"y\"\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\t$this->settings = $settngs[$PREFS->core_ini['site_id']];\n\t\t\t\n\t\t}\n\n\t\t// Added header additions and footer additions\n\t\t// Now it's out of our hands\n\t\t// Best of luck site admins, boo ha ha ha aha ha, cough, ha\n\t\tif($current < '1.3.0')\n\t\t{\n\t\t\t$settings = $this->_get_settings(TRUE, TRUE);\n\n\t\t\tforeach ($settings as $site_id => $site_settings)\n\t\t\t{\n\t\t\t\t$settings[$site_id]['head_additions'] = '';\n\t\t\t\t$settings[$site_id]['body_additions'] = '';\n\t\t\t\t$settings[$site_id]['foot_additions'] = '';\n\t\t\t}\n\n\t\t\tforeach ($hooks as $hook => $method)\n\t\t\t{\n\t\t\t\t$sql[] = $DB->update_string( 'exp_extensions',\n\t\t\t\t\t\t\t\t\t\t\t array(\n\t\t\t\t\t\t\t\t\t\t\t\t'settings' => addslashes(serialize($settings)),\n\t\t\t\t\t\t\t\t\t\t\t\t'priority' => 1\n\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t \"class = '\".get_class($this).\"'\"\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t}\n\n\t\t\t$this->settings = $settngs[$PREFS->core_ini['site_id']];\n\n\t\t}\n\n\t\t// update the version\n\t\t$sql[] = \"UPDATE exp_extensions SET version = '\" . $DB->escape_str($this->version) . \"' WHERE class = '\" . get_class($this) . \"'\";\n\n\t\t// run all sql queries\n\t\tforeach ($sql as $query)\n\t\t{\n\t\t\t$DB->query($query);\n\t\t}\n\n\t\treturn TRUE;\n\t}", "protected function update() {}", "function update_extension($current = '')\n\t{\n\t\tglobal $DB;\n\t\t\n\t\tif ($current == '' OR $current == $this->version) return FALSE;\n\t\t\n\t\tif ($current < '1.2.0')\n\t {\n\t\t\t$sql[] = \"UPDATE `exp_extensions` SET `method` = 'publish_admin_edit_field_extra_row' WHERE `method` = 'edit_custom_field' AND `class` = '\" . get_class($this) .\"' LIMIT 1\";\n\t\t\t$sql[] = \"UPDATE `exp_extensions` SET `method` = 'publish_form_field_unique' WHERE `method` = 'publish' AND `class` = '\" . get_class($this) .\"' LIMIT 1\";\n\t\t\t$sql[] = \"UPDATE `exp_extensions` SET `method` = 'show_full_control_panel_end' WHERE `method` = 'edit_field_groups' AND `class` = '\" . get_class($this) .\"' LIMIT 1\";\n\t\t\t$sql[] = \"DELETE FROM `exp_extensions` WHERE `method` = 'add_header' AND `class` = '\" . get_class($this) .\"' LIMIT 1\";\n\t\t}\n\n\t\t$sql[] = \"UPDATE exp_extensions SET version = '\" . $DB->escape_str($this->version) . \"' WHERE class = '\" . get_class($this) . \"'\";\n\n\t\t// run all sql queries\n\t\tforeach ($sql as $query)\n\t\t{\n\t\t\t$DB->query($query);\n\t\t}\n\t}", "function updateDB() {\n if (array_key_exists('model', $this->ptcdUpdates)) {\n $manufacturer = Dropdown::getDropdownName(\"glpi_dropdown_manufacturer\",\n $this->getValue('FK_glpi_enterprise'));\n $this->ptcdUpdates['model'] = Dropdown::importExternal(\"NetworkEquipmentModel\",\n $this->ptcdUpdates['model'], 0,\n array('manufacturer'=>$manufacturer));\n }\n if (array_key_exists('firmware', $this->ptcdUpdates)) {\n $this->ptcdUpdates['firmware'] = Dropdown::importExternal(\"NetworkEquipmentFirmware\",\n $this->ptcdUpdates['firmware']);\n }\n if (array_key_exists('location', $this->ptcdUpdates)) {\n $this->ptcdUpdates['location'] = Dropdown::importExternal(\"Location\",\n $this->ptcdUpdates['location']);\n }\n\n parent::updateDB();\n // update last_fusioninventory_update even if no other update\n $this->setValue('last_fusioninventory_update', date(\"Y-m-d H:i:s\"));\n $this->oFusionInventory_networking->updateDB();\n // ports\n $this->savePorts();\n }", "public function updateDB()\n {\n\n }", "protected function saveUpdate()\n {\n }", "protected function _update()\n\t{\n\t}", "public function update()\n\t{\n\t\t$this->user->db_update();\n\t}", "public function testUpdateExtensionSuccessful()\n\t{\n\t\t$this->restartApplication();\n\n\t\t\\Orchestra\\Extension::activate(DEFAULT_BUNDLE);\n\n\t\t$this->be($this->user);\n\t\t$this->call('orchestra::extensions@update', array(DEFAULT_BUNDLE));\n\t\t$this->assertRedirectedTo(handles('orchestra::extensions'));\n\n\t\t\\Orchestra\\Extension::deactivate(DEFAULT_BUNDLE);\n\t}", "function updateDB() {\n global $DB;\n\n if (array_key_exists('model', $this->ptcdUpdates)) {\n $manufacturer = Dropdown::getDropdownName(\"glpi_dropdown_manufacturer\",\n $this->getValue('FK_glpi_enterprise'));\n $this->ptcdUpdates['model'] = Dropdown::importExternal(\"PrinterModel\",\n $this->ptcdUpdates['model'], 0,\n array('manufacturer'=>$manufacturer));\n }\n parent::updateDB();\n // update last_fusioninventory_update even if no other update\n $this->setValue('last_fusioninventory_update', date(\"Y-m-d H:i:s\"));\n $this->oFusionInventory_printer->updateDB();\n // ports\n $this->savePorts();\n // cartridges\n $this->saveCartridges();\n // history\n if (is_null($this->oFusionInventory_printer_history->getValue('ID'))) {\n // update only if counters not already set for today\n $this->oFusionInventory_printer_history->updateDB();\n }\n }", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "public function update(Request $request, ExtensionRepository $extension)\n {\n //\n }", "public function update_extension($current = '') {\n if($current == '' || $current == $this->version)\n return FALSE;\n\n ee()->db->where('class', _CLASS__);\n ee()->db->update(\n 'extensions',\n array('version' => $this->version)\n );\n }", "public function update() {\r\n\r\n\t}", "function update_extension($current = '')\n\t{\n\t\tif ($current == '' OR $current == $this->version)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif ($current < '1.0')\n\t\t{\n\t\t\t//update to next version when ready\n\t\t}\n\n\t\t$this->EE->db->where('class', __CLASS__);\n\t\t$this->EE->db->update(\n\t\t\t'extensions',\n\t\t\tarray('version' => $this->version)\n\t\t);\n\t}", "function update_extension($current = '')\n\t{\n\t\tif ($current == '' OR $current == $this->version)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif ($current < $this->version)\n\t\t{\n\t\t\t// Update to version 1.0\n\t\t}\n\t\t\n\t\t$this->EE->db->where('class', __CLASS__);\n\t\t$this->EE->db->update(\n\t\t\t\t\t'extensions', \n\t\t\t\t\tarray('version' => $this->version)\n\t\t);\n\t}", "public function testUpdateSite()\n {\n }", "public function testUpdateStore()\n {\n\n }", "public function update()\n {\n if ($GLOBALS['config']['cache_method'] == 'memcached') {\n $this->memcache_obj->flush();\n } elseif ($GLOBALS['config']['cache_method'] == 'apc') {\n apc_clear_cache('user');\n }\n\n $this->removeFiles();\n\n $this->updateDataFormats();\n\n $this->updateSubmitForms();\n $this->updateCategoriesByType();\n $this->updateCategoriesByParent();\n $this->updateCategoriesByID();\n $this->updateSearchForms();\n $this->updateSearchFields();\n\n $this->updateFeaturedFormFields();\n $this->updateTitlesFormFields();\n $this->updateShortFormFields();\n $this->updateSortingFormFields();\n\n $this->updateListingStatistics();\n }", "public function updating()\n {\n # code...\n }", "public function update()\r\n {\r\n //\r\n }", "function GroupPress_update() {\n\t// no PHP timeout for running updates\n\tset_time_limit( 0 );\n\n\tglobal $GroupPress;\n\n\t// this is the current database schema version number\n\t$current_db_ver = get_option( 'GroupPress_db_ver' );\n\n\t// this is the target version that we need to reach\n\t$target_db_ver = GroupPress::DB_VER;\n\n\t// run update routines one by one until the current version number\n\t// reaches the target version number\n\twhile ( $current_db_ver < $target_db_ver ) {\n\t\t// increment the current db_ver by one\n\t\t$current_db_ver ++;\n\n\t\t// each db version will require a separate update function\n\t\t// for example, for db_ver 3, the function name should be solis_update_routine_3\n\t\t$func = \"GroupPress_update_routine_{$current_db_ver}\";\n\t\t\tif ( function_exists( $func ) ) {\n\t\t\t\tcall_user_func( $func );\n\t\t\t}\n\n\t\t//update the option in the database, so that this process can always\n\t\t// pick up where it left off\n\t\tupdate_option( 'GroupPress_db_ver', $current_db_ver );\n\t}\n}", "public function update()\n {\n //\n }", "public function update()\n {\n //\n }", "public function alterExtensionTable() {\n\t$query = $this->db->query(\"DELETE FROM `\".DB_PREFIX.\"extension` WHERE type='module' AND code != 'digitalElephantFilter' AND code != 'basel_installer'\");\n\t\n$oc_extension = array(\n array('extension_id' => '475','type' => 'module','code' => 'basel_instagram'),\n array('extension_id' => '474','type' => 'module','code' => 'category'),\n array('extension_id' => '473','type' => 'module','code' => 'account'),\n array('extension_id' => '472','type' => 'module','code' => 'basel_content'),\n array('extension_id' => '471','type' => 'module','code' => 'basel_layerslider'),\n array('extension_id' => '470','type' => 'module','code' => 'basel_megamenu'),\n array('extension_id' => '469','type' => 'module','code' => 'basel_products'),\n array('extension_id' => '468','type' => 'module','code' => 'blog_latest'),\n array('extension_id' => '467','type' => 'module','code' => 'basel_carousel')\n);\n\t\n\tforeach ($oc_extension as $result) {\n $this->db->query(\"INSERT INTO `\" . DB_PREFIX . \"extension` SET \"\n\t\t\t\t. \"type = '\" . $result['type'] . \"', \"\n . \"code = '\" . $result['code'] . \"'\");\n \t}\n\n\t}", "public function update();", "public function update();", "public function update();", "public function update();", "private function _update() {\n\n $this->db->replace(XCMS_Tables::TABLE_USERS, $this->getArray());\n $this->attributes->save();\n\n }", "public function update()\r\n {\r\n \r\n }", "public function update() {\r\n }", "function update() {\n\n\t\t\t}", "function updates()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$object = ( $this->tasks['updates'] == 1 ) ? 'Database Update' : 'Database Updates';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'reverted' : 'executed';\n\t\t\n\t\tforeach ( $this->xml_array['updates_group']['update'] as $k => $v )\n\t\t{\n\t\t\tif ( !$this->ipsclass->input['un'] )\n\t\t\t{\n\t\t\t\t$this->ipsclass->DB->do_update( \"{$v['table']['VALUE']}\", array( \"{$v['key']['VALUE']}\" => \"{$v['new_value']['VALUE']}\" ), \"{$v['where']['VALUE']}\" );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( $v['old_value'] )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->DB->do_update( \"{$v['table']['VALUE']}\", array( \"{$v['key']['VALUE']}\" => \"{$v['old_value']['VALUE']}\" ), \"{$v['where']['VALUE']}\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />{$this->tasks['updates']} {$object} {$operation}....\" );\n\t}", "function after_update() {}", "function update_extension( $current = FALSE )\n\t{\n\t\treturn TRUE;\n\t}", "public function update()\n\t{\n\t\t$mytable = WikiRevision::$table;\n\t\t$buf = \"UPDATE $mytable SET \";\n\t\tfor ($i = 0; $i < count(WikiRevision::$fields); $i++) {\n\t\t\t$buf .= WikiRevision::$fields[$i] . \" = '\" . DBConnection::get()->handle()->real_escape_string($this->data[$fields[$i]]) . \"'\" . ($i == count(WikiRevision::$fields) - 1)?(', '):(' ');\n\t\t}\n\t\t$buf .= \"WHERE rev_id = \" . $data['rev_id'];\n\t\tDBConnection::get()->handle()->query($buf);\n\t}", "public function after_update() {}", "function update(){\n\t\t// $update_query .= ' SET ';\n\t\t// $update_query .= ' name = \"'.$this->name.'\"';\n\t\t// $update_query .= ' WHERE category_id = '.$this->id;\n\n\t\t// $this->db->query($update_query);\n\t\t$this->db->update(\n\t\t\t'tb_pages',\n\t\t\tarray(\t\t\t\t\t\n\t\t\t'title' => $this->title,\n\t\t\t'content' => $this->content),\n\t\t\tarray('page_id' => $this->page_id)\n\t\t);\n\t}", "public function update_extension($current = '')\n\t{\n\t\n\t if ($current == '' OR $current == $this->version)\n\t {\n\t return FALSE;\n\t }\n\t\n\t if ($current < '1.0')\n\t {\n\t // Update to version 1.0 - No updates yet\n\t }\n\t\n\t ee()->db->where('class', __CLASS__);\n\t ee()->db->update(\n\t 'extensions',\n\t array('version' => $this->version)\n\t );\n\t \n\t}", "function update_db( $_, $assoc_args ) {\n\t\tself::run( 'core update-db', $args, $assoc_args );\n\t}", "public function Do_update_Example1(){\n\n\t}", "public static function update(){\n }", "public static function update(){\r\n }", "function update_extension($current = '')\n\t{\n\t\tif ($current == '' OR $current == $this->version)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif ($current < '0.2.1')\n\t\t{\n\t\t\t//update to version 0.1\n\t\t}\n\n\t\t$this->EE->db->where('class', __CLASS__);\n\t\t$this->EE->db->update(\n\t\t\t'extensions',\n\t\t\tarray('version' => $this->version)\n\t\t);\n\t}", "public function actionUpdate() {}", "public function actionUpdate() {}", "public function update()\n {\n }", "public function updateToDB()\n {\n try {\n $sql\n = 'UPDATE content_page\n SET link_id=:link_id, parent_page=:parent_page, title=:title, content=:content\n WHERE page_title=:page_title';\n $this->_db->query($sql, array('link_id' => $this->_prepareNullLink($this->_link), 'page_title' => $this->_pageTitle, 'parent_page' => $this->_prepareNull($this->_parentPage), 'title' => $this->_title, 'content' => $this->_content));\n } catch (Exception $e) {\n throw new Exception($e->getMessage());\n }\n }", "protected function afterUpdating()\n {\n }", "private function update(){\n\t\t$q = Queries::update($this->authkey);\n\t\t$this->internalQuery($q);\n\t}", "protected function run_updater() {\r\n\r\n\t\t/*\r\n\t\t* Version 1.6\r\n\t\t* add `active` to table categories\r\n\t\t*/\r\n\t\tif (version_compare(LUMISE, '1.4') >=0 ){\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}categories` LIKE 'active'\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\t\t\tif(count($columns) == 0){\r\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}categories` ADD `active` INT(1) NOT NULL DEFAULT '1' AFTER `order`\";\r\n\t\t\t\t$this->main->db->rawQuery($sql_active);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.5') >=0 ){\r\n\t\t\t$list_tables = array(\r\n\t\t\t\t'products' => 'color',\r\n\t\t\t\t'products' => 'printings',\r\n\t\t\t);\r\n\r\n\t\t\tforeach ($list_tables as $k => $v) {\r\n\t\t\t\t$columns = $this->main->db->rawQuery(\"SHOW COLUMNS FROM `{$this->main->db->prefix}{$k}` LIKE '{$v}'\");\r\n\t\t\t\tif(count($columns) > 0){\r\n\t\t\t\t\t$this->main->db->rawQuery(\r\n\t\t\t\t\t\t\"ALTER TABLE `{$this->main->db->prefix}products` CHANGE `{$v}` `{$v}` TEXT NOT NULL\"\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.7') >=0 ){\r\n\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}fonts` LIKE 'upload_ttf'\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\r\n\t\t\tif(count($columns) == 0){\r\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}fonts` ADD `upload_ttf` TEXT NOT NULL AFTER `upload`\";\r\n\t\t\t\t$this->main->db->rawQuery($sql_active);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.7.1') >=0 ){\r\n\r\n\t\t\t$this->upgrade_1_7();\r\n\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}products` LIKE 'variations';\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\t\t\tif(count($columns) == 0){\r\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}products` ADD `variations` TEXT NOT NULL AFTER `stages`\";\r\n\t\t\t\t$this->main->db->rawQuery($sql_active);\r\n\t\t\t}\r\n\r\n\t\t\t// do the convert old data\r\n\t\t\t// 1. convert colors to attribute\r\n\t\t\t// 2. convert all old attribute structure to new structure\r\n\t\t\t// 3. convert stages\r\n\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}products` LIKE 'orientation';\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\t\t\tif(count($columns) > 0){\r\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `orientation`;\");\r\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `min_qty`;\");\r\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `max_qty`;\");\r\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `size`;\");\r\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `change_color`;\");\r\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `color`;\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.7.3') >=0 ){\r\n\t\t\t$this->upgrade_1_7_3();\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.7.4') >=0 ) {\r\n\r\n\t\t\t$tables = $this->main->db->rawQuery(\"SHOW TABLES LIKE '{$this->main->db->prefix}sessions'\");\r\n\r\n\t\t\tif (count($tables) === 0) {\r\n\r\n\t\t\t\t$this->main->db->rawQuery(\r\n\t\t\t\t\t\"CREATE TABLE IF NOT EXISTS `{$this->main->db->prefix}sessions` (\r\n\t\t\t\t\t `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t `name` varchar(255) NOT NULL,\r\n\t\t\t\t\t `value` varchar(255) NOT NULL,\r\n\t\t\t\t\t `expires` int(11) NOT NULL,\r\n\t\t\t\t\t `session_id` varchar(255) NOT NULL,\r\n\t\t\t\t\t PRIMARY KEY (`id`)\r\n\t\t\t\t\t) ENGINE=InnoDB AUTO_INCREMENT=1 CHARSET=utf8mb4\"\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}order_products` LIKE 'cart_id';\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\t\t\tif(count($columns) == 0){\r\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}order_products` ADD `cart_id` VARCHAR(255) NOT NULL DEFAULT '' AFTER `product_id`\";\r\n\t\t\t\t$this->main->db->rawQuery($sql_active);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.7.5') >=0 ) {\r\n\t\t\t$this->upgrade_1_7_5();\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.9.2') >=0 ) {\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}fonts` LIKE 'name_desc'\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\t\t\tif(count($columns) == 0){\r\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}fonts` ADD `name_desc` varchar(255) NOT NULL DEFAULT '' AFTER `upload`\";\r\n\t\t\t\t$this->main->db->rawQuery($sql_active);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.9.3') >=0 ) {\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}products` LIKE 'active_description'\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\t\t\tif(count($columns) == 0){\r\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}products` ADD `active_description` INT(1) NOT NULL DEFAULT '0' AFTER `description`\";\r\n\t\t\t\t$this->main->db->rawQuery($sql_active);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.9.9') >=0 ) {\r\n\t\t\t$this->upgrade_1_9_9();\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '2.0') > 0 ) {\r\n\t\t\t$this->upgrade_2_0();\r\n\t\t}\r\n\t\t/*\r\n\t\t*\tCreate subfolder upload\r\n\t\t*/\r\n\r\n\t\t$this->main->check_upload();\r\n\r\n\t}", "public function update() {\n \n }", "function update()\n {\n $GLOBALS[\"DEBUG\"] = true;\n $this->dbInit();\n $this->Database->query( \"UPDATE eZLink_Link SET\n Title='$this->Title',\n Description='$this->Description',\n LinkGroup='$this->LinkGroupID',\n KeyWords='$this->KeyWords',\n Url='$this->Url',\n ImageID='$this->ImageID',\n Accepted='$this->Accepted'\n WHERE ID='$this->ID'\" );\n }", "public function update()\n\t{\n\n\t}", "protected function performUpdate() {}", "protected function update() {\n $this->db->updateRows($this->table_name, $this->update, $this->filter);\n storeDbMsg($this->db,ucwords($this->form_ID) . \" successfully updated!\");\n }", "public function update()\n {\n # code...\n }", "function update(){\n\t\t// $update_query .= ' SET ';\n\t\t// $update_query .= ' title = \"'.$this->title.'\"';\n\t\t// $update_query .= ', content = \"'.$this->content.'\"';\n\t\t// $update_query .= ', category_id = '.$this->category_id;\n\t\t// $update_query .= ' WHERE page_id = '.$this->id;\n\n\t\t// $this->db->query($update_query);\n\t\t$this->db->update(\n\t\t\t'tb_products',\n\t\t\tarray('product_name' =>$this->product_name, \n\t\t\t'description' =>$this->description,\n\t\t\t'price' =>$this->price, 'image' =>$this->image),\n\t\t\tarray('product_id' => $this->product_id)\n\t\t);\n\t}", "function update_the_snippet_state($webpage_id,$action){\n // database configuration file\n require 'database/snippet_links_db.php';\n \tswitch ($action) {\n \t\tcase 'added':\n \t\t\t \n \t\t\t $sql = \"UPDATE snippet_links\n \t\t\t SET\n \t\t\t is_added = 1\n \t\t\t WHERE webpage_id = '$webpage_id'\";\n \t\t\t $result = mysqli_query($connection,$sql);\n \t\t\t if(!$result){\n \t\t\t \techo mysqli_error($connection);\n \t\t\t }\n \t\t\tbreak;\n \t\tcase 'deleted':\n \t\t $sql = \"UPDATE snippet_links\n \t\t\t SET\n \t\t\t is_added = 0\n \t\t\t WHERE webpage_id = '$webpage_id'\";\n \t\t\t $result = mysqli_query($connection,$sql);\n \t\t\t if(!$result){\n \t\t\t \techo mysqli_error($connection);\n \t\t\t }\n \t\t\n \t\tdefault:\n \t\t\techo 'something went wrong , fucking check what it is';\n \t\t\tbreak;\n \t}\n }", "public function updatePage()\n {\n $myDataAccess = aDataAccess::getInstance();\n $myDataAccess->connectToDB();\n\n \t$recordsAffected = $myDataAccess->updatePage($this->m_Pageid,$this->m_PageName,$this->m_MenuName, $this->m_visible, $this->m_Modifiedby, $this->m_Desc);\n\n \treturn \"$recordsAffected row(s) affected!\";\n }", "public function update($parent)\n\t{\n\t$db = JFactory::getDBO();\n $result = $db->getTableFields( '#__joomleague_version_history' );\n //echo '<pre>'.print_r( $result, true ).'</pre><br>';\n \n if ( array_key_exists('version', $result['#__joomleague_version_history'] ) )\n {\n //echo 'vorhanden<br>';\n }\n else\n {\n //echo 'nicht vorhanden<br>';\n $query2 = \"ALTER TABLE `#__joomleague_version_history` ADD `version` VARCHAR(255) NOT NULL DEFAULT '' AFTER `text`;\";\n $db->setQuery($query2); \n if (!$db->query())\n\t\t\t\t{\n\t\t\t\t} else {\n\t\t\t\t\t//echo \"-> done !<br>\";\t\t\n\t\t\t\t}\n \n }\n\t\t?>\n\t\t<hr>\n\t\t<h1>JoomLeague Update</h1>\n\t\t<?php\n \n /*\n // eine tabelle mit allen spalten\n $query = \"SELECT ordinal_position\n FROM INFORMATION_SCHEMA.COLUMNS\n WHERE table_name = '#__joomleague_version_history'\n and column_name = 'version' \";\n $db->setQuery($query); \n $table_field = $db->loadResult();\n \n if ( !$table_field )\n {\n $query2 = \"ALTER TABLE `#__joomleague_version_history` ADD `version` VARCHAR(255) NOT NULL DEFAULT '' AFTER `text`;\";\n $db->setQuery($query2); \n if (!$db->query())\n\t\t\t\t{\n// \t\t\t\t\techo '-> '.JText::_('Failed').'! <br>';\n// \t\t\t\t\t$this->setError($db->getErrorMsg());\n// \t\t\t\t\techo $db->getErrorMsg();\n\t\t\t\t\t//return false;\n\t\t\t\t} else {\n\t\t\t\t\t//echo \"-> done !<br>\";\t\t\n\t\t\t\t}\n \n }\n */\n \n\t\tself::_install(true);\n\t}", "public function information_update() {\r\n $this->check_permission(16);\r\n $content_data['add'] = $this->check_page_action(16, 'add');\r\n $content_data['product_list'] = $this->get_product_list();\r\n $content_data['shift_list'] = $this->get_shift_list();\r\n $content_data['category_list'] = $this->get_category_list();\r\n $this->quick_page_setup(Settings_model::$db_config['adminpanel_theme'], 'adminpanel', $this->lang->line('information_update'), 'operation/information_update', 'header', 'footer', '', $content_data);\r\n }", "public function SQL_UPDATE() {\r\n\t}", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update(){\n\t\tglobal $misc;\n\n\t\t// Creates a new database access object.\n\t\t$driver = $misc->getDatabaseAccessor(\"phppgadmin\");\n\t\t$sql = \"UPDATE crudgen.page_columns \"\n\t\t. \"SET page_order={$this->order},on_page=\" . $this->isOnPageAsString()\n\t\t. \",display_name='{$this->display_name}',remote_table='{$this->remote_table}',\"\n\t\t.\"remote_column='{$this->remote_field}' WHERE page_column_id={$this->id}\";\n\t\t\n\t\treturn $driver->execute($sql);\n\t}", "public function update() {\n global $DB;\n $record = array(\n 'sortorder' => $this->sortorder,\n 'criterion' => $this->criterion,\n 'addinfo' => json_encode($this->addinfo)\n );\n if ($this->id) {\n $record['id'] = $this->id;\n $DB->update_record($this->get_table_name(), $record);\n } else {\n $record['instantquizid'] = $this->instantquiz->id;\n $this->id = $DB->insert_record($this->get_table_name(), $record);\n }\n }", "public function update() {\n parent::update();\n }", "public function update(){\n\t\t$modifications[] = new Modification();\n\t}", "protected function _update()\n\t{\n\t\t$this->date_modified = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->last_online = $this->date_modified;\n\t}", "public function update(){\n foreach (the()->project->languages as $lang){\n $field=\"url_$lang\";\n if($this->urlExists($this->$field,$lang)){\n $increment=1;\n $url=$this->$field.'-'.$increment;\n while($this->urlExists($url,$lang)){\n $increment++;\n $url=$this->$field.'-'.$increment;\n }\n $this->$field=$url;\n }\n $this->$field=strtolower($this->$field);\n $this->$field=pov()->utils->string->clean($this->$field,\"/\");\n }\n\n\n parent::update();\n\n }", "public function update()\n {\n \n }", "public function update()\n {\n \n }", "public function updateJsDb()\n {\n if(! array_key_exists( 'js_db', $this->options['paths'] )) {\n return;\n }\n $target = base_path($this->options['paths']['js_db']);\n\n // import model in to databases.js\n $hook = '/* bread_js_import_model */';\n $file = base_path($this->options['paths']['stubs']) . '/resources/assets/js/components/database_import.js';\n $this->updateFileContent($target, $hook, $file);\n\n // register database\n $hook = '/* bread_js_register_model */';\n $file = base_path($this->options['paths']['stubs']) . '/resources/assets/js/components/database_register.js';\n $this->updateFileContent($target, $hook, $file);\n }", "function activate_extension()\n\t{\n\t\t$data = array(\n\t\t\t'class'\t\t\t=>\t__CLASS__,\n\t\t\t'method'\t\t=>\t'cp_js_end',\n\t\t\t'hook'\t\t\t=>\t'cp_js_end',\n\t\t\t'settings'\t\t=>\t'',\n\t\t\t'priority'\t\t=>\t10,\n\t\t\t'version'\t\t=> \t$this->version,\n\t\t\t'enabled'\t\t=>\t'y'\n\t);\n\n\t$this->EE->db->insert('extensions', $data);\n\n\t}", "function activate_extension()\n\t{\n\t\t$data = array(\n\t\t\t'class'\t\t\t=>\t__CLASS__,\n\t\t\t'method'\t\t=>\t'cp_js_end',\n\t\t\t'hook'\t\t\t=>\t'cp_js_end',\n\t\t\t'settings'\t\t=>\t'',\n\t\t\t'priority'\t\t=>\t10,\n\t\t\t'version'\t\t=> \t$this->version,\n\t\t\t'enabled'\t\t=>\t'y'\n\t);\n\n\t$this->EE->db->insert('extensions', $data);\n\n\t}", "public function testUpdate(): void { }", "public static function onLoadExtensionSchemaUpdates( $updater ) {\n\t\t$sqlPath = dirname( __DIR__ ) . '/docs';\n\t\t$updater->addExtensionTable(\n\t\t\t'page_language',\n\t\t\t$sqlPath . '/page_language.sql'\n\t\t);\n\t\t$updater->addExtensionTable(\n\t\t\t'page_translation',\n\t\t\t$sqlPath . '/page_translation.sql'\n\t\t);\n\t}", "public function fetchUpdates()\n\t{\n\t}", "function update()\n {\n global $config;\n $query=file_get_contents(\"sql/updateArticle.sql\"); \n $query =sprintf($query, $config->prefix.self::$table); \n $query = $config->sql->prepare($query);\n $param=array(\n $this->title, $this->content, $this->lang, $this->date,\n $this->cat, $this->id, $this->lang\n );\n $result=$query->execute($param);\n if ($result) {\n return true;\n } else {\n print_r($query->errorInfo());\n }\n \n }", "protected function run_updater() {\n\t\t\n\t\t/*\n\t\t* Version 1.6\n\t\t* add `active` to table categories\n\t\t*/\n\t\t\n\t\tif (version_compare(LUMISE, '1.4') >=0 ){\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}categories` LIKE 'active';\";\n\t\t\t$columns = $this->main->db->rawQuery($sql);\n\t\t\tif(count($columns) == 0){\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}categories` ADD `active` INT(1) NULL DEFAULT '1' AFTER `order`;\";\n\t\t\t\t$this->main->db->rawQuery($sql_active);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (version_compare(LUMISE, '1.5') >=0 ){\n\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}products` CHANGE `color` `color` TEXT;\";\n\t\t\t$this->main->db->rawQuery($sql_active);\n\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}products` CHANGE `printings` `printings` TEXT;\";\n\t\t\t$this->main->db->rawQuery($sql_active);\n\t\t}\n\t\t\n\t\tif (version_compare(LUMISE, '1.7') >=0 ){\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}fonts` LIKE 'upload_ttf';\";\n\t\t\t$columns = $this->main->db->rawQuery($sql);\n\t\t\tif(count($columns) == 0){\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}fonts` ADD `upload_ttf` TEXT NULL DEFAULT '' AFTER `upload`;\";\n\t\t\t\t$this->main->db->rawQuery($sql_active);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (version_compare(LUMISE, '1.7.1') >=0 ){\n\t\t\t\n\t\t\t$this->upgrade_1_7();\n\t\t\t\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}products` LIKE 'variations';\";\n\t\t\t$columns = $this->main->db->rawQuery($sql);\n\t\t\tif(count($columns) == 0){\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}products` ADD `variations` TEXT NULL DEFAULT '' AFTER `stages`;\";\n\t\t\t\t$this->main->db->rawQuery($sql_active);\n\t\t\t}\n\t\t\t\n\t\t\t// do the convert old data\n\t\t\t// 1. convert colors to attribute\n\t\t\t// 2. convert all old attribute structure to new structure\n\t\t\t// 3. convert stages\n\t\t\t\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}products` LIKE 'orientation';\";\n\t\t\t$columns = $this->main->db->rawQuery($sql);\n\t\t\tif(count($columns) > 0){\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `orientation`;\");\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `min_qty`;\");\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `max_qty`;\");\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `size`;\");\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `change_color`;\");\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `color`;\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif (version_compare(LUMISE, '1.7.3') >=0 ){\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}order_products` LIKE 'print_files';\";\n\t\t\t$columns = $this->main->db->rawQuery($sql);\n\t\t\tif(count($columns) == 0){\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}order_products` ADD `print_files` TEXT NULL DEFAULT '' AFTER `screenshots`;\";\n\t\t\t\t$this->main->db->rawQuery($sql_active);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t*\tCreate subfolder upload\t\n\t\t*/\n\t\t\n\t\t$this->main->check_upload();\n\t\t\n\t}", "function list_core_update($update)\n {\n }", "public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "public function actionUpdate()\n\t{\n $storeExtendId = $this->getParam('storeExtendId');\n $extendModel = OfflineSignStoreExtend::model()->findByPk($storeExtendId);\n $storeExtendId = $extendModel->id;\n $enterpriseId = $extendModel->offline_sign_enterprise_id;\n\t\tif($this->isPost()){\n\t\t\t$dataArr = $this->getPost('OfflineSignStore');\n if($dataArr['step'] == OfflineSignStore::NEXT_STEP){\n $auditModel = new OfflineSignAuditLogging($storeExtendId, '1011');\n $auditModel->save(false);\n //点击下一步,进入审核记录页面\n $extendModel->_setStatusAndAuditStatus();\n $extendModel->save(false);\n $this->redirect(array('offlineSignAuditLogging/seeAudit','storeExtendId'=>$storeExtendId));\n }\n\t\t\tif($dataArr['step'] == OfflineSignEnterprise::LAST_STEP){\n\t\t\t\t$this->_syncTmpData($this->tmpDataKey,$dataArr);\n $this->redirect(array('offlineSignEnterprise/update','enterpriseId'=>$enterpriseId,'storeExtendId'=>$storeExtendId));\n\t\t\t}elseif($dataArr['step'] == OfflineSignStore::ADDFRANCHISEE){\n $this->redirect(array('offlineSignStore/create','storeExtendId'=>$dataArr['extendId'])); //点击下一步,进入新建店铺页面\n }\n\t\t}\n $storeModel = $this->loadModel($storeExtendId);\n $this->performAjaxValidation($storeModel);\n if(empty($storeModel)){\n $this->redirect(array('offlineSignStore/create','storeExtendId'=>$storeExtendId)); //点击下一步,进入新建店铺页面\n }\n $model = new OfflineSignStore();\n\t\t$model->attributes = $this->_syncTmpData($this->tmpDataKey);\n\t\t$demoImgs = Tool::getConfig('offlinesigndemoimgs');\n\t\t$this->render('franchiseeupdate',array(\n 'model'=>$model,\n 'storeModel'=>isset($storeModel)?$storeModel:'',\n 'extendModel' => $extendModel,\n 'storeExtendId'=>$storeExtendId,\n\t\t\t'demoImgs' => $demoImgs,\n\t\t));\n\t}", "function update(){\n\t\t$this->model->update();\n\t}" ]
[ "0.80198824", "0.7528284", "0.6896804", "0.67112863", "0.6496797", "0.6426562", "0.63467073", "0.62424344", "0.6190257", "0.61898386", "0.61852705", "0.6183816", "0.6166549", "0.6148454", "0.6133148", "0.6133148", "0.612998", "0.6124347", "0.6039649", "0.6037132", "0.5985143", "0.598199", "0.59783787", "0.5959425", "0.5949583", "0.59486705", "0.5925205", "0.5919361", "0.5919361", "0.59168965", "0.59159404", "0.59159404", "0.59159404", "0.59159404", "0.590985", "0.58979416", "0.58960605", "0.5895545", "0.5888182", "0.5870148", "0.5869449", "0.5868379", "0.5862527", "0.5862251", "0.5857791", "0.5836223", "0.5829421", "0.58286387", "0.58245593", "0.5821124", "0.5812835", "0.5812835", "0.5786258", "0.57792795", "0.5768225", "0.57662207", "0.5761938", "0.5760884", "0.575744", "0.57556826", "0.5749293", "0.57427156", "0.57301456", "0.57043", "0.57017165", "0.5696521", "0.5692658", "0.5691534", "0.5676977", "0.56743604", "0.56743604", "0.56743604", "0.56743604", "0.56743604", "0.56743604", "0.56743604", "0.56743604", "0.56743604", "0.56743604", "0.56743604", "0.56743604", "0.56679106", "0.5665892", "0.5663479", "0.5660217", "0.56582505", "0.56569946", "0.5649009", "0.5649009", "0.5646763", "0.56258756", "0.56258756", "0.5625501", "0.5607627", "0.56075525", "0.56053305", "0.55993044", "0.5598857", "0.55979663", "0.5593868", "0.5593584" ]
0.0
-1
Display a listing of the resource. GET /empresas
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listarEmpresasAction(){\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$empresa = $em->getRepository('TheClickCmsAdminBundle:Empresa')->findAll();\n\t\treturn $this->render('TheClickCmsAdminBundle:Default:listarEmpresa.html.twig', array('empresa'=>$empresa));\n\t}", "public function index() {\n $empleados = $this->Empleados->find('all');\n $this->set(compact('empleados'));\n }", "public function index()\n {\n $employees = Employee::get();\n return EmployeeResource::collection($employees);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SmathEmpresaBundle:Empleado')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n $empresariales = Empresarial::all();\n \n return view('empresarial.index', compact('empresariales'));\n }", "public function list ()\n {\n $employees[\"data\"] = Employee::get();\n $employees['deleted'] = \"0\";\n\n return view(\"employee.list\", compact(\"employees\"));\n }", "public function index()\n {\n $employee = Employee::active()->latest()->get();\n \n return EmployeeResource::collection($employee);\n }", "public function index()\n {\n $empresas = Empresa::all();\n return view('empresa.listagem')->with('empresas',$empresas);;\n }", "public function index()\n {\n try {\n $usuarioLogado = UsuarioController::retornaUsuarioLogado();\n if(!$usuarioLogado->perfil->super_user)\n throw new \\Exception('Você não possui permissão para acessar este recurso.');\n\n $empresasCadastradas = self::listaTodasAsEmpresasCadastradas()->get();\n return view('configuracao.empresas.index', compact('empresasCadastradas'));\n }catch (\\Exception $ex){\n return redirect()->back()->with('info', $ex->getMessage());\n }\n }", "public function index()\n {\n $empleado = Empleado::get();\n return view('empleados.index')->with('empleados', $empleado);\n \n }", "public function index()\n {\n $empresa = Empresa::all();\n return view('empresas.empresa',compact('empresa'));\n }", "public function index()\n\t{\n\t\t//\n\t\t$Empresas = Empresa::paginate(10);\n\t\treturn \\View::make('listEmpresa', compact('Empresas'));\n\t}", "public function index()\n {\n\n $employees = Employee::with('role')->get();\n\n return view('backend.hrm.employee.list', compact('employees'));\n\n }", "public function index ()\n {\n $employees[\"data\"] = Employee::get();\n $employees['deleted'] = \"0\";\n\n return view(\"employee.list\", compact(\"employees\"));\n }", "public function index()\n {\n return IdiomaEmpleado::all();\n }", "public function index()\n {\n $employees = Employee::get();\n $roles = Role::get();\n return view('employees.list', compact(['employees', 'roles']));\n }", "public function listar()\n {\n $empleados = Empleados::with('area')->get();\n return view('empleados.listar', compact('empleados'));\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 indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('IamSoftAndrethaBundle:CarpetaEmprendimiento')->findAll();\n\n return $this->render('IamSoftAndrethaBundle:CarpetaEmprendimiento:index.html.twig', array(\n 'entities' => $entities\n ));\n }", "public function index()\n {\n $empleos = Empleo::all();\n return view('empleos.index',['empleos'=>$empleos]);\n }", "public function index()\n {\n $emplead = empleado::orderBy('apellidos', 'ASC')->paginate();\n return view('empleados.index', compact('emplead'));\n\n }", "public function getAllEmplacementsAction()\n {\n return $this->response([\n 'liste' => Emplacements::find()\n ]);\n }", "public function index()\n {\n if(Auth::user()->can('listar_empresas')){\n $pjuridicas = Juridica::orderBy('id','DESC')->get();\n return view('in.empresas.index')\n ->with('pjuridicas',$pjuridicas);\n }else{\n return redirect()->route('in.sinpermisos.sinpermisos');\n }\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $absenceEmployes = $em->getRepository('AbsenceEmployeBundle:AbsenceEmploye')->findAll();\n\n return $this->render('absenceemploye/index.html.twig', array(\n 'absenceEmployes' => $absenceEmployes,\n ));\n }", "public function index()\n {\n return Employee::all();\n }", "public function actionIndex()\n {\n $searchModel = new EmpleadoSearch();\n $searchModel->estado = 1;\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n //cargar todos los empleados\n $empleados = \\App\\Empleado::with('usuario')\n ->with('empresa')->with('permisos')->get();\n\n if(count($empleados) == 0){\n return response()->json(['error'=>'No existen empleados.'], 404); \n }else{\n return response()->json(['empleados'=>$empleados], 200);\n } \n }", "public function index()\n {\n //\n $results = Result::orderBy('id', 'asc')->get();\n\n // load the view and pass the employees\n return $results;\n }", "public function index()\n {\n $empresas_aseguradoras = EmpresasAseguradoras::all();\n return response()->json(['empresas_aseguradoras' => $empresas_aseguradoras, 'success' => true, 'mensaje' => \"Datos encontrados.\"], 200);\n }", "public function index()\n {\n return view('inmobiliario.empleado.index', [\n 'empleado' => empleado::all(),\n 'departamento' => departamento::get(['id', 'nombre', 'vigencia'])->where('vigencia',1),\n 'area' => area::get(['id', 'nombre', 'vigencia'])->where('vigencia',1)\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AdminBundle:FuncionarioEmpresa')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n $employees = Employee::orderBy('id', 'asc')->get();\n\n return view('list.index', compact('employees'));\n }", "public function index()\n {\n $employess = Employees::orderby('id', 'DESC')->get();\n return view('employees.index', compact('employess'));\n }", "public function index()\n {\n //\n $empleados=Empleado::all();\n\n return view('recept.empleados.empleados',compact('empleados'));\n }", "public function index()\n {\n $employees = Employee::all()->toArray();\n return view('Employee.ManageEmp', compact('employees') );\n }", "public function index()\n\n {\n $employees = Employee::all();\n\n return $this->sendResponse($employees->toArray(), 'Employees retrieved successfully.');\n\n }", "public function index()\n {\n $employeelists = DB::table('employees')->get();\n\n return view('employees.index')->with('employeelists', $employeelists);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $m_employees = $em->getRepository('AppBundle:m_employee')->findAll();\n\n return $this->render('m_employee/index.html.twig', array(\n 'm_employees' => $m_employees,\n ));\n }", "public function index()\n {\n //\n $empleados = Employee::all();\n\n return View::make('empleados.index', [\n 'empleados' => $empleados,\n ]);\n\n }", "private function listEmployee()\n\t{\n\t\t$employees = $this->employee->getEmployee();\n\t\t$cnt = 1;\n\t\tforeach($employees as $key => $val)\n\t\t{\n\t\t\t$arr = array('CNT' => $cnt,\n\t\t\t\t\t\t 'EMPLOYEE_NAME' => $val['name_employee'],\n\t\t\t\t\t\t 'EMPLOYEE_ID' => $val['id_employee'],\n\t\t\t\t\t\t 'EMPLOYEE_MAIL' => $val['mail_employee']);\n\t\t\t$cnt ++;\n\t\t\t$this->view->addToReplace($arr);\n\t\t\t$this->arrRender['LISTEMPLOYEES'] .= $this->view->\n\t\t\tsetTemplateFile('employeeslist')->renderFile();\n\t\t}\n\t}", "public function index()\n {\n $employees = $this->employee->all();\n\n return view('employee::admin.employees.index', compact('employees'));\n }", "public function get_index(){\n\t\t\n\t\t$employees = Employee::all()->toArray();\n\t\treturn Response::json(compact(\"employees\"), 200);\n\t}", "public function index()\n {\n $empleados = Empleado::paginate();\n\n return view('empleados.index',['empleados'=>$empleados]);\n }", "public function indexAction()\n {\n $this->view->employees = Employees::find();\n }", "public function index()\n {\n $data['page_set'] = 'list_emp';\n return view('employee.index', $data);\n }", "public function index() {\n return response()->json(Employee::all());\n }", "public function index()\n {\n return Api_Employees::all()->toArray(); \n }", "public function index()\n {\n $employees = Employee::all();\n return view('employee.index', compact('employees'));\n }", "public function index()\n {\n return view('empresa.index', ['empresas' => Empresa::paginate(10)]);\n }", "public function index()\n {\n //\n $employees = Employee::all();\n return view('hr/employee/index',compact('employees'));\n }", "public function show(Empleados $empleados)\n {\n //\n }", "public function listarEmpresas()\n {\n $query = \"SELECT e.id_empresa,e.nombre_empresa, e.celular_empresa,e.direccion_empresa,e.municipio_empresa,e.representante_legal,e.sector_empresa,e.actividad_empresa,e.correo_empresa, e.nit_empresa,c.fecha_inicio,c.fecha_expiracion FROM empresa AS e LEFT JOIN convenio AS c ON e.id_empresa = c.id_empresa\";\n $lista_empresas = NULL;\n $stmt = $this->conexion->prepare($query);\n if (!$stmt->execute()) {\n $stmt->closeCursor();\n return 0;\n } else {\n while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $lista_empresas[] = $result;\n }\n $stmt->closeCursor();\n return $lista_empresas;\n }\n }", "public function index()\n {\n $datos['empleados']=Empleados::paginate();\n\n foreach ($datos['empleados'] as $item) {\n $oficina = Oficinas::find($item['idOficina']);\n $item['nombreOficina'] = $oficina['nombre'];\n }\n\n return view('expedientes.index',$datos);\n }", "public function index()\n {\n $empresas = Empresa::orderBy('id', 'desc')->paginate(10);\n //dd($empresas);\n return view('admin.empresa.index',compact('empresas'));\n }", "public function listAllEmployees()\n {\n foreach (Employee::all() as $employee) {\n $response[] = new EmployeeResource($employee);\n }\n return $this->responseSuccess(['employees' => $response]);\n }", "public function index()\n {\n $employees = $this->employeeModel->getListEmployees();\n return view('root.employees.index', [\n 'employees' => $employees\n ]);\n }", "public function listAll ()\n {\n return response()\n ->view( 'pages.esp.esp-index' );\n }", "public function index()\n {\n $employs = \\App\\Employ::orderBy('created_at', 'DESC')->get();\n\n return view('employers.index', compact('employs'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AcmeKindergartenBundle:AttendanceEmployed')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n return new EmployeeCollection(Employee::latest('id')->paginate(10));\n }", "public function showEmployees() {\n\n $employeeModel = $GLOBALS[\"employeeModel\"];\n\n // get all the employees from the db.\n $included_employee = $employeeModel->getAll();\n $data = array(\"included_employees\" => $included_employee);\n return $this->render(\"listEmployees\", $data);\n }", "public function index()\n {\n $items = Employee::all();\n\n return view('pages.admin.employee.index', [\n 'items' => $items\n ]);\n }", "public function index()\n {\n $employees = $this->employeeService->paginate();\n\n return view('employees.index', compact('employees'));\n }", "public function index()\n {\n $employees = Employee::latest()->get();\n\n return response()->json( [\n 'employees' => $employees,\n ], 200 );\n }", "public function index()\n {\n $employees = Employee::orderBy('id')->get();\n return view('employees.index', ['employees' => $employees]);\n }", "public function index()\n {\n //\n $keyword = \\Request::get('search');\n $emps = $this->service->search($keyword);\n return view('employee.list',compact('emps'))->with('employees',$emps);\n }", "public function index()\n {\n $this->data['employees'] = Employee::orderBy('users_id', 'desc')->paginate(20);\n return view('hr::admin.employee.index', $this->data);\n }", "public function index()\n {\n $employeeList = Employee::all();\n //$employeeList = DB::table('employees')->get();\n return view('employees.index', compact('employeeList'));\n }", "public function index()\n {\n $employees['employees'] = Employee::orderBy('id', 'DESC')->paginate(10);\n return view('employee.index', $employees);\n }", "public function index() {\n\t\t$expence_management = ExpenceManagement::query()\n\t\t\t->leftjoin('users as users', 'users.id', '=', 'expence_managements.created_by')\n\t\t\t->orderBy('expence_managements.id', 'ASC')\n\t\t\t->where('expence_managements.deletion_status', 0)\n\t\t\t->get([\n\t\t\t\t'expence_managements.*',\n\t\t\t\t'users.name',\n\t\t\t])\n\t\t\t->toArray();\n\n\t\t$employees = User::where('deletion_status', 0)\n\t\t\t->where('access_label', '>=', 2)\n\t\t\t->where('access_label', '<=', 3)\n\t\t\t->get(['name', 'id'])\n\t\t\t->toArray();\n\t\t//return dd($employees);\n\t\treturn view('administrator.hrm.expence.manage_expence', compact('expence_management', 'employees'));\n\t}", "public function index()\n {\n $employees = Employee::paginate(10);\n\n return view('employees.index',compact('employees'));\n }", "public function index()\n\t{\n\n $employees = Employees::all();\n return view('employees.index', compact('employees'));\n\t}", "public function index()\n {\n $employee = Employee::all();\n \n return view('employee.index', compact('employee'));\n }", "public function index()\n {\n $empleado = Empleado::all();\n return response()->json(array(\n 'empleado'=> $empleado,\n 'status'=>'success'\n ), 200);\n }", "public function index()\n {\n $employees = Employee::all();\n \n if($employees)\n {\n return $employees;\n }else{\n $message = \"No Employees\";\n return $message;\n }\n }", "public function index()\n { \n return \"hey there\";\n //$emp = Employee::all(); \n //$employees = new EmployeeListResource($emp);\n //return $employees;\n //return view('employees.index',compact('employees'));\n }", "public function index()\n {\n return view('employee.index',[\n 'employees' => Employee::orderBy('created_at', 'desc')->paginate(10)\n ]);\n }", "public function getEmployees(): View\n {\n $employeeRespository = $this->getDoctrine()->getRepository(Employee::class);\n\n // query for a single Product by its primary key (usually \"id\")\n $employees = $employeeRespository->findall();\n\n // In case our GET was a success we need to return a 200 HTTP OK response with the collection of article object\n return View::create($employees, Response::HTTP_OK);\n }", "public function index()\n {\n $employees = employee::get(); \n return view(\"index\")->with(array('employee'=> $employees));\n }", "public function index()\n {\n $employees = Employee::with('company')->paginate(10);\n\n return view('adminlte::employees.employees', compact('employees'));\n }", "public function index()\n {\n $employees = Employee::orderBy('name', 'ASC')->get();\n\n return view('employees.index', compact('employees'));\n }", "public function index(){\n //select * from employees\n $employees = Employee::all();\n //send the results to the view\n return view('admin.pages.employees', compact('employees'));\n }", "public function index()\n {\n $datos['empleados']=Empleados::paginate(5);\n return view('empleados.index', $datos);\n }", "public function index()\n {\n $process = employ::select('*')->orderby('id','desc')->paginate(10);\n return view('employe.index',compact('process'));\n }", "public function index()\n {\n\n\n $employes = Employe::with('position', 'department')\n // ->where('id_positione','!=',$positionHeadDepartament->id)\n ->orderBy('full_name')\n ->paginate(10);\n\n return EmployeResource::collection($employes);\n }", "public function consultaEmpresas() {\n\t\t\treturn $this->entidad->getRepository('\\Entidades\\Expertos\\UsuariosEmpresa')->findBy(array('estado' => 1));\n\t\t}", "public function index()\n {\n $data = [\n 'employees' => Employee::all()\n ];\n return view('employee.index', $data);\n }", "public function index()\n {\n return view('admin.employees.index', [\n 'employees' => Employee::paginate(10),\n 'companies' => Company::get()\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('VCReservasBundle:Reserva')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n $entradas_productos = EntradaProducto::all();\n\n return $this->showAll($entradas_productos);\n }", "public function index()\n {\n $employee = Employee::getallEmp();\n //prd($employee->toArray());\n return view('admin.employee.index',compact('employee'));\n }", "public function index()\n {\n $employees = Employee::join('departments', 'departments.id', '=', 'employees.department_id')\n ->select('employees.*', 'departments.name AS department_name')\n ->orderBy('id', 'desc')->paginate(15);\n return response()->json(['employees' => $employees], 200);\n }", "public function index()\n {\n //display list of employees\n $employees = User::where('role', 'Employee')->get();\n return view('employee.index', compact('employees'));\n\n }", "public function index()\n\t{ \n\t\t$user = new Employee();\n\t\t$allusers=$user->get_All_Employee();\n\t\t$currentPage = LengthAwarePaginator::resolveCurrentPage();\n\t\t$col = new Collection($allusers);\n\t\t$perPage = 5;\n\t\t$currentPageSearchResults = $col->slice(($currentPage - 1) * $perPage, $perPage)->all();\n\t\t$entries = new LengthAwarePaginator($currentPageSearchResults, count($col), $perPage);\n\t\treturn view('employees.index', ['employees' => $entries]);\n\t}", "public function index(Request $request)\n {\n // Variáveis padrão\n\n $padrao = [];\n\n $padrao['secao'] = \"Empresas\";\n $padrao['subsecao'] = \"Listar\";\n $padrao['url'] = $request->url();\n\n $empresas = Empresa::paginate(10);\n\n return view('empresas.index', compact('empresas', 'padrao'));\n }", "public function index()\n {\n $employees = User::where('role', 'employee')->get();\n return view('employees.index')->with('users', $employees);\n }", "public function index()\n {\n //\n $employees = $this->employeeModel->paginate(10);\n return view('employee.index', ['employees' => $employees]);\n }", "public function index()\n {\n // y no directamente desde la base de datos (Eloquent).\n $empresas = $this->empresa->obtenerEmpresasConPromociones();\n return View::make('index')->with('empresas', $empresas);\n }", "public function index()\n {\n $empreendimento=$this->objEmpreendimentos->paginate(5);\n return view('empreendimento',compact('empreendimento'));\n }", "public function index()\n {\n $data['employees'] = Employees::with('companies')->paginate(10);\n return view('admin.employee.index', $data);\n }", "public function index()\n {\n $this->filter_section = true;\n $this->employees = Employee::all();\n $this->designations = Designation::all();\n\n return view('admin.employee.index', $this->data);\n }" ]
[ "0.82047457", "0.79527676", "0.77405864", "0.7654195", "0.7634281", "0.75161654", "0.7505651", "0.7498285", "0.7468509", "0.7456744", "0.7456663", "0.7446925", "0.74365944", "0.7429184", "0.7425572", "0.74211955", "0.7420418", "0.7413812", "0.7408268", "0.7379443", "0.7360265", "0.7354242", "0.7350772", "0.73472315", "0.73446697", "0.7344286", "0.731586", "0.72947186", "0.7281541", "0.7271893", "0.72603965", "0.72589856", "0.7241454", "0.7238237", "0.72168744", "0.7212498", "0.7208232", "0.72035664", "0.7198964", "0.71945316", "0.7187377", "0.7184967", "0.71723616", "0.7171363", "0.71588296", "0.71512085", "0.71503615", "0.713532", "0.7134637", "0.7134558", "0.7132121", "0.7130333", "0.7125748", "0.7117055", "0.71131843", "0.7104983", "0.71032375", "0.7099517", "0.70882326", "0.70881724", "0.70856434", "0.7080016", "0.7076459", "0.707043", "0.7070353", "0.70700485", "0.706986", "0.7061267", "0.70602775", "0.7036122", "0.7035786", "0.7031666", "0.7031396", "0.70254517", "0.7022683", "0.70198953", "0.7019785", "0.7015796", "0.70070463", "0.7006773", "0.7005519", "0.7000701", "0.69949013", "0.699193", "0.69907135", "0.69690824", "0.6966434", "0.6963374", "0.6957402", "0.6955767", "0.6955367", "0.695002", "0.6948339", "0.694833", "0.69465744", "0.6938478", "0.69326997", "0.6925336", "0.6921028", "0.6920931", "0.6911819" ]
0.0
-1
Show the form for creating a new resource. GET /empresas/create
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return view('empresas.create');\n }", "public function create()\n {\n return view('empresas.create');\n }", "public function create()\n {\n return view('empresa.form_new_empresa')->with('empresas', Empresa::all());\n }", "public function create()\r\n {\r\n return view('catalogos.empleado.create');\r\n }", "public function create()\n {\n return view('revolution.empresa.create');\n\n }", "public function create()\n {\n //\n return view('empleados.create');\n }", "public function create()\n {\n // muestra el formulario creado diseñado en el index\n return view('Empleado.create');\n }", "public function create()\n {\n return view(\"employees.create\");\n }", "public function create()\n\t{\n\t\t$empresa = Empresa::all();\n\n\t\treturn view('empresa.create',compact('empresa'));\n\t}", "public function create()\n {\n //\n return View::make('empleados.create');\n }", "public function create()\n {\n return view('admin.empresa.create');\n }", "public function create()\n {\n return view('empresa.create');\n }", "public function create()\n {\n $cargo = $this->empleadorepo->editar();\n\n return view('empleado.agregar', compact('cargo'));\n }", "public function create()\n {\n\n $oficinas = Oficina::get();\n $empleado = new Empleado();\n $edit = false;\n return view('empleado.create', ['empleado' => $empleado, 'edit' => $edit, 'oficinas'=>$oficinas]);\n }", "public function create()\n {\n return view('admin.new_employee');\n }", "public function create()\n {\n $empresas = Empresa::all(['id_empresa', 'nome_fantasia']);\n return view('horario.create', compact('empresas'));\n }", "public function create()\n {//\n \n //\n return view('empresas.create');\n }", "public function create()\n {\n //\n return view('admin.employees.create');\n }", "public function create()\n {\n $data['roles'] = Role::whereNotIn('name', ['super-admin', 'cliente'])->get();\n $data['tipoDoc'] = Empleado::TIPODOC;\n return view('pages.empleados.create', $data);\n }", "public function create()\n {\n //\n return view('employee.add');\n }", "public function create()\n {\n //\n return view('hr/employee/create');\n }", "public function create()\n {\n return view('pages.admin.employee.create');\n }", "public function create()\n {\n return view('admin.employes.create');\n }", "public function create()\n {\n //\n return view('employees.create');\n }", "public function create()\n {\n return view('employee::admin.employees.create');\n }", "public function create()\n {\n return view('employee.create');\n }", "public function create()\n {\n return view('employee.create');\n }", "public function create()\n {\n return view('employee.create');\n }", "public function create()\n {\n return view('employee.create');\n }", "public function create()\n {\n return view('employee.create');\n }", "public function create()\n {\n return view('employees.create');\n }", "public function create()\n {\n return view('employees.create');\n }", "public function create()\n {\n return view('employees.create');\n }", "public function create()\n {\n return view('employees.create');\n }", "public function create()\n {\n return view('employees.create');\n }", "public function create()\n {\n return view('employees.create');\n }", "public function create()\n {\n return view('employees.create');\n }", "public function create()\n {\n return view('employees.create');\n }", "public function create()\n {\n //\n return view('employee.create');\n }", "public function create()\n {\n //\n return view('empleado.create');\n }", "public function create()\n {\n return view('empresa.crear');\n }", "public function create()\n {\n return view('empleos.create');\n }", "public function create()\n {\n return view('employe.form');\n }", "public function create()\n {\n //\n return view('employees.create');\n }", "public function create()\n {\n return view('pages.employees.add');\n }", "public function createAction()\n {\n $entity = new CarpetaEmprendimiento();\n $request = $this->getRequest();\n $form = $this->createForm(new CarpetaEmprendimientoType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('carpetaemprendimiento_show', array('id' => $entity->getId())));\n \n }\n\n return $this->render('IamSoftAndrethaBundle:CarpetaEmprendimiento:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function create()\n\t{\n\n\t\treturn view('admin.palestras.create');\n\t}", "public function create()\n {\n return view('pages.franchise.employee.create');\n }", "public function crear()\n {\n $areas = Areas::get();\n $roles = Roles::get();\n $empleado = null;\n return view('empleados.crear', compact('areas', 'roles', 'empleado'));\n }", "public function create()\n { $empleados = Empleado::all();\n\n return view('tiposausencia.add',['empleados'=>$empleados]);\n }", "public function create()\n {\n return view('empleados.create', [\n 'empleadItem' => new empleado\n ]);\n }", "public function createEmployee()\n {\n $this->view('employees/create');\n }", "public function create()\n {\n $empleados= Empleado::all();\n $dependencias = Dependencia::all();\n return view('Cruds.EmpleadoJefe.create', compact('empleados','dependencias'));\n }", "public function create()\n {\n $action = 'add';\n $master = $this->getmasterfields();\n return view('hrmodule.employeesexit.add')->with([\n 'action' => $action,\n 'pageTitle' => \"Employees Exit\",\n 'Addform' => \"Add New Employees Exit\",\n 'master' => $master\n ]);\n }", "public function create()\n {\n //\n $provincias = [\"Álava\", \"Albacete\", \"Alicante\", \"Almería\", \"Asturias\", \"Ávila\", \"Badajoz\", \"Barcelona\", \"Burgos\", \"Cáceres\", \"Cádiz\", \"Cantabria\", \"Castellón\", \"Ciudad Real\", \"Córdoba\", \"Cuenca\", \"Gerona\", \"Granada\", \"Guadalajara\", \"Guipúzcoa\", \"Huelva\", \"Huesca\", \"Islas Baleares\", \"Jaén\", \"La Coruña\", \"La Rioja\", \"Las Palmas\", \"León\", \"Lérida\", \"Lugo\", \"Madrid\", \"Málaga\", \"Murcia\", \"Navarra\", \"Orense\", \"Palencia\", \"Pontevedra\", \"Salamanca\", \"Santa Cruz de Tenerife\", \"Segovia\", \"Sevilla\", \"Soria\", \"Tarragona\", \"Teruel\", \"Toledo\", \"Valencia\", \"Valladolid\", \"Vizcaya\", \"Zamora\", \"Zaragoza\"];\n\n return view('empleados.create', compact('provincias'));\n }", "public function create()\n {\n return view('backend.empresa.create')->with([\n 'title'=> $this->title,\n 'sub'=>\"crear empresa\"\n ]);\n }", "public function create()\n {\n $empleado = Empleado::first();\n $contador = Empleado::count()+1;\n $contador = \"Emple00$contador\";\n $departamentos = Departamento::orderBy('nombre', 'asc')->get();\n $sucursales = Sucursal::orderBy('descripcion', 'asc')->get();\n $cargos = Cargo::orderBy('nombre', 'asc')->get();\n\n return view('sprint1/empleado.create', compact('contador','departamentos', 'sucursales', 'cargos','empleado'));\n }", "public function create()\n {\n return view('admin.estados.create');\n }", "public function create()\n {\n return view('admin.estados.create');\n }", "public function create()\n {\n //\n $puestos=Puesto::all();\n return view('recept.empleados.new_empleado', compact('puestos'));\n\n }", "public function create()\n {\n $empreendimentos=$this->objEmpreendimentos->all();\n return view('createEmpreendimento',compact('empreendimentos'));\n }", "public function create()\n {\n $this->data['mode'] = 'create';\n $this->data['designations'] = Designation::designationArray();\n $this->data['tierTypes'] = TierType::tierTypeArray();\n return view('hr::admin.employee.create', $this->data);\n }", "public function create()\n {\n if(Auth::user()->can('crear_empresa')){\n $rubros_empresariales = Rubro_Empresarial::all()->where('estado','activo');\n return view('in.empresas.create')\n ->with('rubros_empresariales',$rubros_empresariales);\n }else{\n return redirect()->route('in.sinpermisos.sinpermisos');\n }\n }", "public function create()\n {\n $data = Employee::preparingData();\n\n return view('employees.create',compact( 'data'));\n }", "public function create()\n {\n //\n $areas = Area::all();\n return view('empleado.create', compact('areas'));\n }", "public function create()\n {\n return view('Employee.AddEmp');\n }", "public function create()\n {\n $empleado= Empleado::all();\n $concepto= Conceptos_empresa::all();\n return view('createincidencias',compact('empleado','concepto'));\n }", "public function create()\n {\n return view('ofertas.create');\n }", "public function create()\n {\n $especialidad = new Especialidad();\n return view('especialidad.create', compact('especialidad'));\n }", "public function create()\n {\n return view('emp_horarios.create');\n }", "public function create()\n {\n $this->authorize('CADASTRAR_TABELAS_SISTEMA');\n return view('pages.tipo-entrada.form');\n }", "public function create()\n {\n\t\t$countryList \t= Country::lists('title','id');\n\t\t$religionList\t= Religion::lists('title','id');\n\t\t$genderList \t= Gender::lists('title','id');\n\t\t$deptList\t\t= Department::lists('title','id');\n\t\t$designList \t= Designation::lists('title','id');\n\t\t$statusList \t= Status::lists('title','id');\n\t\t\n return view('admin.employee.create', compact('countryList', 'religionList', 'genderList', 'deptList', 'designList', 'statusList'));\n }", "public function create()\n {\n $employee = new Employee();\n $companies = Company::all();\n return view('backemployees.create',compact('employee','companies'));\n }", "public function create()\n {\n return view('employees.create'); \n }", "public function create()\n {\n return view ('/crear_estudiante');\n }", "public function newAction()\n {\n $entity = new Empleado();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n $companyData = $this->company->getCompanyData();\n return view('addEmployee',compact('companyData'));\n }", "public function create()\n {\n //\n return view('estudiante.create');\n }", "public function create()\n {\n return view('admin/etiquetas.create');\n }", "public function create()\n {\n return view('encabezados.create');\n }", "public function create()\n {\n return view('compte_epargnes.create');\n }", "public function create(){\n \n $razas = Raza::get();\n include 'views/mascota/form_new.php';\n }", "public function create()\n {\n return view('consultas::create');\n }", "public function create()\n {\n //\n $employee = [\n \"first_name\" => \"\",\n \"last_name\" => \"\",\n \"company_id\" => \"\",\n \"mobile_no\" => \"\",\n \"email\" => \"\",\n ];\n $companies = $this->companyModel->get();\n return view('employee.create', ['companies' => $companies, 'employee' => (object) $employee]);\n }", "public function create()\r\n\t{\r\n\t\treturn view('combinacionEmpresas.create')\r\n\t\t\t->with( 'list', CombinacionEmpresa::getListFromAllRelationApps() );\r\n\t}", "public function create()\n {\n return view('vendor/adminlte.ecausa.create');\n }", "public function create()\n {\n $asesores = Asesor::all();\n return view('admin.unification.form-add', compact('asesores'));\n }", "public function create()\n {\n return view('admin/entrimeja/create');\n }", "public function create()\n {\n $companies = Company::all();\n return view('employee.create', compact('companies'));\n }", "public function create()\n {\n $companies = Company::all();\n return view('admin.employee.create',compact('companies',$companies));\n }", "public function create()\n {\n return view('estacionamiento.create');\n }", "public function create()\n {\n return view('admin.backends.employee.form.create');\n }", "public function create()\n\n {\n \n $buscar=empresa::all();\n \n if (count($buscar)>0) {\n flash('<i class=\"icon-circle-check\"></i> ¡Ya existe un registro de empresa, para registrar uno debe eliminar el anterior!')->success()->important();\n return redirect()->back();\n } else {\n return view ('admin.empresa.create');\n }\n \n \n }", "public function create()\n {\n return view('essentia.create');\n }", "public function create(Request $request)\n {\n // Variáveis padrão\n\n $padrao = [];\n\n $padrao['secao'] = \"Empresas\";\n $padrao['subsecao'] = \"Criar\";\n $padrao['url'] = $request->url();\n\n return view('empresas.create', compact('padrao'));\n }", "public function create()\n {\n $articulo_id = null;\n $titulo = \"Agregar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function create()\n {\n return view('etiquetas.create');\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('formCreateElevage');\n }", "public function create(){\n\n $agamas = Agama::all();\n $genders = Gender::all();\n\n return view('gudang.employee.create', compact('agamas', 'genders'));\n }", "public function actionCreate()\n {\n $model = new HorarioEstudiante();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }" ]
[ "0.81449986", "0.81449986", "0.8069328", "0.79632115", "0.78702873", "0.7846737", "0.7836126", "0.77867967", "0.7776333", "0.76915914", "0.7689062", "0.76819474", "0.7662705", "0.7656674", "0.7650138", "0.76486367", "0.7644539", "0.76156205", "0.7587556", "0.7581524", "0.75813156", "0.75742775", "0.75735813", "0.757077", "0.7565922", "0.7562999", "0.7562999", "0.7562999", "0.7562999", "0.7562999", "0.75466144", "0.75466144", "0.75466144", "0.75466144", "0.75466144", "0.75466144", "0.75466144", "0.75466144", "0.7537084", "0.7526406", "0.7524502", "0.75233567", "0.75179726", "0.7484734", "0.74814373", "0.74758863", "0.7443749", "0.7439101", "0.7438476", "0.7434646", "0.74304646", "0.7405703", "0.7403417", "0.73901314", "0.73646057", "0.73583084", "0.7355631", "0.73514336", "0.73514336", "0.7344694", "0.73417604", "0.7341116", "0.7341019", "0.73392564", "0.7324958", "0.73242915", "0.73099303", "0.7299427", "0.72984433", "0.729116", "0.7291137", "0.7276504", "0.72740376", "0.7273003", "0.72473735", "0.7240199", "0.7239674", "0.723963", "0.7237623", "0.72326756", "0.72326416", "0.72274363", "0.7224773", "0.7223419", "0.7217205", "0.7213776", "0.7209713", "0.7208578", "0.72054684", "0.720518", "0.7187832", "0.7180602", "0.71762496", "0.7176015", "0.7175061", "0.71732813", "0.7172436", "0.7166353", "0.71592754", "0.7158797", "0.7156807" ]
0.0
-1
Store a newly created resource in storage. POST /empresas
public function store() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 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 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(Request $request)\n {\n \n $this->validate($request,['folio'=>'required|string', \n 'nombre'=>'required|string', \n 'apellido_p'=>'required|string', \n 'apellido_m'=>'required|string', \n 'telefono'=>'required|string',\n 'imagen'=>'required',\n 'id_puesto'=>'required']);\n \n $datos = Empleado::create([ \n 'folio'=> $request -> input('folio'),\n 'nombre' => $request -> input('nombre'),\n 'apellido_p' => $request -> input('apellido_p'),\n 'apellido_m'=> $request -> input('apellido_m'),\n 'telefono'=> $request -> input('telefono'),\n 'imagen'=> $request -> file('imagen') -> store('empleados','public'),\n 'id_puesto'=> $request -> input('id_puesto')\n ]);\n return redirect('empleados');\n }", "public function _store()\n {\n try{\n if (count($this->data) == 0)\n {\n $this->data = $this->request->all();\n }\n $this->object = $this->model->create($this->data);\n\n Log::info('Guardado');\n return response()->json(['status'=>true,\n 'msj'=>$this->name. 'Guardado',\n $this->name=>$this->object], 200);\n\n }catch (\\Exception $e){\n Log::critical(\"Error, archivo del peo: {$e->getFile()}, linea del peo: {$e->getLine()}, el peo: {$e->getMessage()}\");\n return response()->json([\"msj\"=>\"Error de servidor\"], 500);\n }\n }", "public function store(Request $request)\n {\n\n ResourceManagement::create([\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\n return redirect()->intended('/resource-management');\n }", "public function store(Request $request)\n {\n $entrada = $request->all();\n\n if ($archivo = $request->file('rut')) {\n $nombre = strtoupper($request->nombre . \"_\" . $request->apellido . \"_\" . $request->identificacion . \".\" . $archivo->guessExtension());\n Storage::putFileAs('public', $archivo, $nombre);\n $entrada['rut'] = $nombre;\n }\n\n /* if ($archivo = $request->file('rut')) {\n $nombre = $request->nombre . \"_\" . $request->apellido . \"_\" . $request->identificacion . \".\" . $archivo->guessExtension();\n $archivo->move('ruts', $nombre);\n\n $entrada['rut'] = $nombre;\n } */\n if ($request->activo === null) {\n $entrada['activo'] = \"NO\";\n }\n\n Terceros::create($entrada);\n\n return redirect()->route('terceros.index')->with('info', 'Tercero creado con exito')->with('type', 'success');\n }", "public function store(Request $request)\n {\n //dd($request->all());\n $episodio = new Episodio;\n $episodio = $episodio->create($request->all());\n \n return redirect(\"temporadas/{$episodio->temporada_id}/edit\");\n }", "public function store(createEmpresa $request) {\r\n\r\n $input = $request->all();\r\n $input['usu_alta_id'] = Auth::user()->id;\r\n $input['usu_mod_id'] = Auth::user()->id;\r\n\r\n //create data\r\n Empresa::create($input);\r\n\r\n return redirect()->route('empresas.index')->with('message', 'Registro Creado.');\r\n }", "public function store(){\n $validateactualite = $this->validate([\n 'titre'=>'required',\n 'sous_titre'=>'required',\n 'descri'=>'required'\n ]);\n $this->validate([\n 'photo'=>'required'\n ]);\n $record = actualite::create($validateactualite);\n $this->photo->storePubliclyAs('public/actualite/', $record->id.'.png');\n //$this->photos[$index]->storePubliclyAs('public/galleries/', $data->id.'.png' );\n session()->flash('message', 'actualite enregistré avec succès');\n $this->emit('Added');\n $this->dispatchBrowserEvent('Added');\n $this->resetFields();\n }", "public function store(createHAsistenciaR $request)\n\t{\n\n\t\t$input = $request->all();\n\t\t$input['usu_alta_id']=Auth::user()->id;\n\t\t$input['usu_mod_id']=Auth::user()->id;\n\n\t\t//create data\n\t\tHAsistenciaR::create( $input );\n\n\t\treturn redirect()->route('hAsistenciaRs.index')->with('message', 'Registro Creado.');\n\t}", "public function store(Request $request)\n {\n if($request->has('nombreemp')){\n $empresaguardar = Empresa::create([\n 'nombreemp' => $request->get('nombreemp'),\n 'repnombre' => $request->get('repnombre'),\n 'telefono' => $request->get('telefono'),\n 'diremp' => $request->get('diremp'),\n 'rubro' => $request->get('rubro'),\n 'nit' => $request->get('nit'),\n 'correo' => $request->get('correo'),\n ]);\n $itemUpdated = $empresaguardar;\n $user = auth()->user();\n $requestIP = request()->ip();\n //error_log($requestID);\n if($empresaguardar){\n // Add activity logs\n activity('empresa')\n ->performedOn($empresaguardar)\n ->causedBy($user)\n ->withProperties(['ip' => $requestIP,\n 'user'=> $user,\n 'nuevo'=> $itemUpdated])\n ->log('created');\n }\n\n return response()->json($empresaguardar,201);\n }\n\n $returnData = array(\n 'status' => 'error',\n 'message' => 'An error occurred!'\n );\n return response()->json($returnData, 400);\n }", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n 'description' => 'nullable|string',\n ]);\n\n $resource = Resource::create($request->all());\n\n if ( $request->hasFile('file') ) {\n $resourceFile = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resourceFile);\n $resource->file = $resourceFile;\n $resource->save();\n }\n\n if ( $request->submit == 'Save' ) {\n return redirect()->route('admin.resources.index')->with('success','Resource Successfully Uploaded');\n } else {\n return redirect()->route('admin.resources.create')->with('success','Resource Successfully Uploaded');\n }\n }", "public function store(){\n\n //create a new post using the request data\n// $post = new Post();\n//\n// $post->title = request('title');\n// $post->body = request('body');\n\n $this->validate(request(),[\n 'name' => 'required|min:3',\n 'batch'=>'required|min:10',\n 'roll'=>'required',\n ]);\n\n Resource::create([\n 'name'=> request('name'),\n 'roll'=>request('roll'),\n 'batch'=> request('batch'),\n ]);\n//\n// //save it to database\n// $post->save();\n\n //redirect to home page\n return redirect('/');\n\n }", "public function store()\n {\n $task = new Uploadrecipe;\n $task->title = request('title');\n $task->description = request('description');\n $task->ingriedients = request('ingredients');\n $task->directions = request('directions');\n //save it to the database\n $task->save();\n \n // //and then redirect to home page\n return redirect('/posts/create');\n }", "public function store(Request $request)\n {\n // En el controlador de respel\n }", "public function store(Request $request)\n {\n \n $subtemaVar = new Subtema();\n $subtemaVar->descripcionSubtema = $request->descripcionSubtema;\n $subtemaVar->conclusion = \"Sin Asignar\";\n $subtemaVar->porcentajeCumplidoSubtema= $request->porcentajeCumplidoSubtema;\n $subtemaVar->estadoSubtema = \"Pendiente\";\n $subtemaVar->informe_id = $request->informe_id;\n $subtemaVar->save();\n \n \n $subtemaall=Subtema::with(['InformeV2'])->find($subtemaVar->id);\n return response()->json($subtemaall);\n \n }", "public function store(Request $request)\n {\n $image_tivy = 'image-not-found.png'; \n if ($request->hasFile('imagen_publication')) { \n $file = $request->imagen_publication;\n $image_tivy = time() . $file->getClientOriginalName();\n $file->storeAs('app/public/storage/', $image_tivy); \n }\n\n $tivy = new Tivy();\n\n $tivy->tittle = $request->tittle;\n $tivy->description = $request->description; \n $tivy->date = $request->date; \n $tivy->startTime = $request->startTime; \n $tivy->duration = $request->duration;\n $tivy->state = 1; \n $tivy->place = $request->place; \n $tivy->capacity = $request->capacity; \n $tivy->img = $image_tivy;\n // $user = User::where('id', $request->user);\n $tivy->user()->associate($request->user); \n $tivy->save(); \n return redirect()->route('home');\n }", "public function store(Request $request)\n {\n $this->validate($request , [\n 'nombre_etapa' => 'required|min:3|max:200',\n ]);\n\n $etapa = Etapa::create(['nombre_etapa' => $request->get('nombre_etapa')]);\n\n\n Session::flash('message','Etapa agricola creada con exito');\n return redirect()->route('admin.etapas.index');\n }", "public function store(expedientesRequest $request)\n {\n $expediente = Expedientes::create($request->all());\n\n if ($request->hasfile('avatar')) {\n $expediente->avatar = $request->file('avatar')->store('public');\n }\n $expediente->save();\n\n return redirect()->route('expedientes.index', compact('expediente'))\n ->with('info', 'expediente guardada con exito');\n }", "public function store()\n\t{\n\t\t$fbf_presenca = new FbfPresenca;\n\t\t$fbf_presenca->idpresenca = Input::get('idpresenca');\n$fbf_presenca->idcampeonatorodada = Input::get('idcampeonatorodada');\n$fbf_presenca->idatleta = Input::get('idatleta');\n\n\t\t$fbf_presenca->save();\n\n\t\t// redirect\n\t\tSession::flash('message', 'Registro cadastrado com sucesso!');\n\t\treturn Redirect::to('fbf_presenca');\n\t}", "public function store(Request $request)\n {\n\n $estufa = new Estufa();\n $estufa->tipo_tarea = 'Reparacion';\n $estufa->encargado = $request->input('encargado');\n $estufa->descripcion = $request->input('descripcion');\n $estufa->estado = $request->input('estado');\n $estufa->material = $request->input('material');\n $estufa->fecha = $request->input('fecha');\n $estufa->ubicacion = $request->input('ubicacion');\n \n if ($request->hasFile('imgPortada')) {\n\n $archivoPortada = $request->file('imgPortada');\n $rutaArchivo = $archivoPortada->store('public/portadas');\n $rutaArchivo = substr($rutaArchivo, 16);\n $estufa->foto_resultado = $rutaArchivo;\n\n }\n \n $estufa->id_user = $request->input('id_usuario');\n \n $estufa->pieza = $request->input('pieza');\n $estufa->precio_pieza = $request->input('precio_pieza');\n \n\n // Arma una respuesta\n $respuesta = array();\n $respuesta['exito'] = false;\n if($estufa -> save()){\n $respuesta['exito'] = true;\n }\n\n // Regresa una respuesta\n return $respuesta;\n }", "public function store(Request $request)\n {\n // $datosEmpleado= request()->all();\n\n $campos=[\n 'Nombre' => 'required|string|max:100',\n 'ApellidoPaterno' => 'required|string|max:100',\n 'ApellidoMaterno' => 'required|string|max:100',\n 'Correo' => 'required|email',\n 'Foto' => 'required|max:10000|mimes:jpeg,jpg,png'\n ];\n\n $Mensaje=[\"required \"=>'El :attribute es requerido']; //VALIDA LOS ATRIBUTOS Y AGREGA EL MENSAJE\n\n $this->validate($request,$campos, $Mensaje);\n\n $datosEmpleado= request()->except('_token');\n\n if($request->hasFile('Foto')){\n $datosEmpleado['Foto']=$request->file('Foto')->store('uploads','public');\n }\n Empleados::insert($datosEmpleado); \n // return response()->json($datosEmpleado);\n return redirect('empleados')->with('Mensaje','Empleado Agregado con éxito'); //esto tomara desde el index, la variable mensaje y cuando se utlice el storage\n }", "public function store($data, Resource $resource);", "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(Request $request)\n {\n //\n $ruta = new ruta($request->all());\n //dd($usuario);\n $ruta->save();\n //$ruta->buses()->attach($ruta);\n dd('Ruta creado');\n }", "public function store(Request $request)\n {\n $product = new Product();\n\n $product->name = $request->name;\n $product->unitprice = $request->unitprice;\n $product->description = $request->description;\n $product->provider_id = $request->provider_id;\n \n $product->save();\n\n $storage = new Storage();\n $storage->product_id = $product->id;\n $storage->amount = 0;\n\n $storage->save();\n\n return redirect()->route('providers.index');\n }", "public function store(Request $request)\n {\n // $datosVehiculo=request()->all();\n $datosVehiculo=request()->except('_token');\n if($request->hasFile('foto')){\n $datosVehiculo['foto']=$request->file('foto')->store('uploads','public');\n }\n Vehiculos::insert($datosVehiculo);\n // return response()->json($datosVehiculo);\n return redirect('vehiculos')->with('Mensaje','Empleados agergado con exito');\n }", "public function store(Request $request)\n {\n $this->validate($request, ['piquete_id' => 'required', 'estacao_id' => 'required', 'nome' => 'required', 'marca' => 'required', 'modelo' => 'required', 'data_fabricacao' => 'required', 'data_instalacao' => 'required', 'unidade' => 'required', ]);\n\n Sensor::create($request->all());\n\n Session::flash('message', 'Sensor added!');\n Session::flash('status', 'success');\n\n return redirect()->action(\n 'frontEnd\\EstacaoController@verSensores', ['id' => $request->estacao_id]\n );\n }", "public function store(Request $request)\n {\n Tramite::create($request->all());\n \n return redirect()->route('superuser.tramites-index')->with('success','Tramite Creado Satisfactoriamente!');\n }", "public function store(EtiquetasRequest $request)\n {\n $etiqueta = new Etiqueta($request->all());\n $etiqueta->save();\n return redirect()->route('etiquetas.index')->with('message_success', 'Se ha creado con éxito la etiqueta '.$etiqueta->nombre);\n }", "public function store(Request $request)\n {\n //pega os dados da requisição\n $dados = $request->all();\n $imagem = $request->file('imagem');\n //$imagem = $request->file('imagem');\n //faz a criação de um novo registro \n $estabelecimento = Estabelecimento::create($dados);\n //verifica se os dados foram cadastrados com sucesso\n if($estabelecimento){\n if($imagem){\n $imagem->store('img/estabelecimentos', 'public');\n }\n return response()->json(['data'=>$estabelecimento, 'status'=>true]);\n } else{\n return response()->json(['data'=>'Erro ao tentar cadastrar novo estabelecimento', 'status'=>false]);\n }\n }", "public function store(Request $request)\n {\n \\Validator::make($request->all(), [\n 'judul' => 'required|max:225|unique:artikel',\n 'deskripsi' => 'required',\n 'tanggal' => 'required',\n 'gambar' => 'required|mimes:jpg,jpeg,png|max:1024',\n ])->validate();\n $new_artikel = new artikel;\n $new_artikel->user_id = Auth::user()->id;\n $new_artikel->judul = $request->get('judul');\n $new_artikel->deskripsi = $request->get('deskripsi');\n $new_artikel->tanggal = $request->get('tanggal');\n $gambar = $request->file('gambar');\n if ($gambar) {\n $gambar_path1 = $gambar->store('gambar_artikel','public');\n $new_artikel->gambar = $gambar_path1;\n }\n $new_artikel->save();\n return redirect('/artikel');\n }", "public function store(Request $request)\n {\n $data = new fs($request-> all());\n $data->save();\n Alert::success('', 'la línea de negocio ha sido registrada con exito!')->persistent('Close');\n return redirect()->route('fs.index');\n }", "public function store(createEstAsistencium $request)\n\t{\n\n\t\t$input = $request->all();\n\t\t$input['usu_alta_id']=Auth::user()->id;\n\t\t$input['usu_mod_id']=Auth::user()->id;\n\n\t\t//create data\n\t\tEstAsistencium::create( $input );\n\n\t\treturn redirect()->route('estAsistencias.index')->with('message', 'Registro Creado.');\n\t}", "public function store()\n\t{\n\t\t\n\t\t$input = \\Request::all();\n\n\t\t$request = $this->request->store($input);\n\n\t\tif ($request === false) return \\Response::json(['message' => 'Sorry, there was an error on our end'], 404);\n\n\t\treturn \\Response::json(['message' => 'request was created', \"data\" => $request], 200);\n\n\t}", "public function store(Request $request)\n {\n $ruta = new Ruta;\n $ruta->nombre = $request->nombre; \n \n $ruta->save();\n\n return redirect()->route('ruta.orden', $ruta->id)\n ->with('success','Ruta creada Exitosamente');\n }", "public function store(Request $request){}", "public function store(Request $request)\n {\n $eps = new Eps;\n $eps->nombre = $request->nombre;\n $eps->save(); \n // $eps->create($request->all());\n return redirect('eps/');\n \n }", "public function store(Request $request);", "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 store(Request $request)\n {\n /*convirtiendo $request establecimiento a object*/\n $requeste_array=$request->establecimiento;\n $requeste_string=json_encode($requeste_array);\n $requeste_object=json_decode($requeste_string);\n\n\n $est_sol = new EstablecimientoSolicitante();\n $est_sol->zon_id=$requeste_object->zon_id;\n $est_sol->ess_razon_social=Str::upper($requeste_object->ess_razon_social);\n $est_sol->ess_telefono=$requeste_object->ess_telefono;\n $est_sol->ess_correo_electronico=$requeste_object->ess_correo_electronico;\n $est_sol->ess_tipo=Str::upper($requeste_object->ess_tipo);//--publico o privado\n $est_sol->ess_avenida_calle=Str::upper($requeste_object->ess_avenida_calle);\n $est_sol->ess_numero=$requeste_object->ess_numero;\n $est_sol->ess_stand=Str::upper($requeste_object->ess_stand);\n $est_sol->ess_latitud=$requeste_object->ess_latitud;//guarda vacio si no se envia nada\n $est_sol->ess_longitud=$requeste_object->ess_longitud;//guarda vacio si no se envia nada\n $est_sol->ess_altitud=$requeste_object->ess_altitud;//guarda vacio si no se envia nada\n $est_sol->ess_hora_ini=$requeste_object->ess_hora_ini;//guarda vacio si no se envia nada\n $est_sol->ess_hora_fin=$requeste_object->ess_hora_fin;//guarda vacio si no se envia nada\n $est_sol->save();\n\n $imagen_establecimiento=new ImagenEstablecimiento();\n $imagen_establecimiento->ess_id=$est_sol->ess_id;\n $imagen_establecimiento->ima_nombre=$requeste_object->ie_nombre;\n $imagen_establecimiento->ie_enlace=$requeste_object->ie_enlace;\n $imagen_establecimiento->save();\n\n\n $empresa = new Empresa();\n $empresa->ess_id=$est_sol->ess_id;\n if($requeste_object->emp_nit){$empresa->emp_nit=$requeste_object->emp_nit;}\n\n $empresa->emp_url_nit=$requeste_object->emp_url_nit;\n $empresa->emp_url_licencia=$requeste_object->emp_url_licencia;\n $empresa->save();\n\n /*convirtiendo $request vector a object*/\n $aux;\n $requestv_array=$request->vector;\n for ($i=0; $i < count($requestv_array); $i++) { \n $velement_string=json_encode($requestv_array[$i]);\n $velement_object=json_decode($velement_string);\n $aux=$velement_object;\n\n $rubroempresa = new RubroEmpresa();\n $rubroempresa->emp_id=$empresa->emp_id;\n $rubroempresa->re_nombre=$velement_object->sub_nombre;\n $rubroempresa->save();\n }\n\n $empresapropietario = new EmpresaPropietario();\n $empresapropietario->emp_id=$empresa->emp_id;\n $empresapropietario->pro_id=$requeste_object->pro_id;\n $empresapropietario->save();\n\n /*crear pendiente en empresa_tramite*/\n /*crear tramitecer_emp por cada etapa*/\n $algun_tramite_concluido=EmpresaTramite::select()\n ->where('ess_id',$est_sol->ess_id)\n ->where('et_estado_tramite', 'APROBADO')\n ->first();\n\n $empresatramite = new EmpresaTramite();\n $empresatramite->tra_id=$requeste_object->tra_id;\n if($algun_tramite_concluido){\n $empresatramite->et_tipo_tramite='RENOVACIÓN';\n }else{\n $empresatramite->et_estado_tramite='NUEVO';\n }\n $empresatramite->ess_id=$est_sol->ess_id;\n $empresatramite->save();\n\n\n /*\n enviar\n empresa\n */\n $result=compact('est_sol','empresa','rubroempresa');\n return response()->json(['status'=>'ok',\"msg\" => \"exito\", \"establecimiento\" => $result], 200);\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 }", "public function store(Request $request)\n {\n $trabajador = new Trabajadores($request->all());\n \n $fotoF = $request['foto'];\n \n $pic = $fotoF->getClientOriginalName();\n $picExt = $fotoF->getClientOriginalExtension();\n \n $new_name = md5(microtime(true)).\".\".$picExt;\n \n $trabajador->foto = \"img/\".$new_name;\n \\Storage::disk('local')->put($new_name, \\File::get($fotoF));\n \n \n $trabajador->save();\n return redirect('/trabajadores');\n }", "public function store(Request $request)\n { \n $anio = Anio::create($request->All());\n if ($anio) {\n return (new AnioResource($anio))->additional([\n \"code_status\" => 1,\n \"message\" => \"Se guardo exitosamente\"\n ]);\n }\n return $this->messageShow(0,\"Problema al guardar.\"); \n }", "function store() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the default model\n\t\t$model = $this->getDefaultModel();\n\n\t\tif (!$model) {\n\t\t\tthrow new Exception('Store task called, but there is no model assigned to that controller. Check method getDefaultModel.');\n\t\t}\n\n\t\t// Make a normalized data object from HTTP request data\n\t\t$data = $model->getDataFromRequest();\n\n\t\t// Prepare the data (auto-fill data like empty URL segment fields and similar)\n\t\t$model->prepareForStorage($data);\n\n\t\t// Check if the data validates\n\t\t$checkResult = $model->validateData($data);\n\n\t\t$isInsert = $model->isInsert($data);\n\n\t\t// Abort and send feedback if validation fails\n\t\tif ($checkResult === false) {\n\t\t\tKenedoPlatform::p()->setDocumentMimeType('application/json');\n\t\t\t$response = new stdClass();\n\t\t\t$response->success = false;\n\t\t\t$response->errors = $model->getErrors();\n\t\t\techo json_encode($response);\n\t\t\treturn;\n\t\t}\n\n\t\t// Get the data stored\n\t\t$success = $model->store($data);\n\n\t\t// Run the afterSave stuff\n\t\t$this->afterStore($success);\n\n\t\t// Abort and send feedback if storage fails\n\t\tif ($success === false) {\n\t\t\tKenedoPlatform::p()->setDocumentMimeType('application/json');\n\t\t\t$response = new stdClass();\n\t\t\t$response->success = false;\n\t\t\t$response->errors = $model->getErrors();\n\t\t\techo json_encode($response);\n\t\t\treturn;\n\t\t}\n\n\t\t// Purge the cache\n\t\t$this->purgeCache();\n\n\t\t// Bring the good news\n\t\tKenedoPlatform::p()->setDocumentMimeType('application/json');\n\t\t$response = new stdClass();\n\t\t$response->success = true;\n\t\t$response->messages = array();\n\t\t$response->wasInsert = $isInsert;\n\t\t$response->messages[] = KText::_('Record saved.');\n\n\t\t// Add the current record data to the response\n\t\tif (!empty($data->id)) {\n\t\t\t$model->forgetRecord($data->id);\n\t\t\t$response->data = $model->getRecord($data->id);\n\t\t}\n\t\telse {\n\t\t\t$response->data = NULL;\n\t\t}\n\n\t\tif (KRequest::getKeyword('task') == 'apply') {\n\t\t\t// On inserts, we redirect to the right edit URL (have the right ID set)\n\t\t\tif ($isInsert) {\n\t\t\t\t// Get the controller name\n\t\t\t\t$controllerName = KenedoController::getControllerNameFromClass(get_class($this));\n\t\t\t\t// Get the redirect URL\n\t\t\t\t$url = 'index.php?option='.$this->component.'&controller='.$controllerName.'&task=edit&id='.$data->id;\n\t\t\t\t// If the return param is sent along, append it\n\t\t\t\tif (KRequest::getString('return')) {\n\t\t\t\t\t$url .= '&return='.KRequest::getString('return');\n\t\t\t\t}\n\t\t\t\t// Get it all together\n\t\t\t\t$response->redirectUrl = KLink::getRoute($url, false);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (KRequest::getString('return')) {\n\t\t\t\t$url = KLink::base64UrlDecode(KRequest::getString('return'));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Get the controller name\n\t\t\t\t$controllerName = KenedoController::getControllerNameFromClass(get_class($this));\n\t\t\t\t// Get the redirect URL\n\t\t\t\t$url = KLink::getRoute('index.php?option='.$this->component.'&controller='.$controllerName, false);\n\t\t\t}\n\n\t\t\t$response->redirectUrl = $url;\n\t\t}\n\n\t\techo json_encode($response);\n\n\t}", "public function store(Request $request)\n {\n $ruta = rutas::create($request->input('Ruta'));\n return response()->json($ruta, 201);\n\n }", "public function store()\n\t{\n $task = new Task();\n $task->description = Request::get('description');\n $task->owner = Auth::user()->id;\n $task->performer = intval(Request::get('performer')) ? intval(Request::get('performer')): null;\n $task->state = Request::get('state');\n $task->save();\n\n return Response::json(array(\n 'errors' => false,\n 'data' => $task),\n 200\n );\n }", "public function store(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'descripcion' => 'required|string|max:100|unique:empresas,descripcion', \n ]);\n if ($validator->fails()) {\n flash(implode('<br>',$validator->errors()->all()), 'danger');\n return redirect()->route('empresas.create')->withInput();\n }\n\n $empresa= new Empresa;\n $empresa->descripcion = $request->descripcion;\n $empresa->save();\n\n flash('Se ha registrado la EPS '.$empresa->descripcion.' de forma exitosa!', 'success');\n return redirect()->route('empresas.index');\n }", "public function store(){\n\n if(auth()->user()->role != 1){\n abort(401);\n }\n\n $data = request()->validate([\n 'name' => 'required',\n 'price' => ['required', 'numeric', 'min:100'],\n 'description' => ['required'],\n 'image' => ['required', 'image'],\n ]);\n\n $imagePath = request('image')->store('images', 'public');\n Shoe::create([\n 'name' => $data['name'],\n 'price' => $data['price'],\n 'description' => $data['description'],\n 'image' => $imagePath,\n ]);\n\n return redirect('/shoes');\n }", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store( Request $request ) {\n\n\t}", "public function store(EstampasRequest $request)\n {\n $estampa = $this->repository->create($request->all());\n\n if($request->file('estampa_file'))\n $this->images($request, $estampa->id);\n\n $url = $request->get('redirect_to', route('admin.estampas.index'));\n $request->session()->flash('message', 'Estampa cadastrado com sucesso.');\n\n return redirect()->to($url);\n }", "public function store(Request $request)\n {\n $this->validate(request(),[\n 'nivel' => 'required',\n 'servicio' => 'required',\n 'descripcion' => 'required',\n ]);\n\n $resena = new Resena;\n $resena->nivel = $request->nivel;\n $resena->descripcion = $request->descripcion;\n $resena->idServicio = $request->servicio;\n $resena->titulo = 'Titulo';\n\n $resena->save();\n\n $servicio = Servicio::find($resena->idServicio);\n $servicio->nivel = $servicio->promedioResenas();\n $servicio->save();\n\n $organizacion = $servicio->organizacion()->get()->first();\n $organizacion->nivel = $organizacion->promedioResenas();\n $organizacion->save();\n\n return redirect()->action('ServicioController@show',['id'=>$resena->idServicio]);\n }", "public function store(Request $request)\n {\n $slug=Str::slug($request->nombre_articulo,'-');\n // $request->merge(['brand_name',$slug]);\n \n $image = time().'.'.$request->imagen->extension();\n $request->imagen->move(public_path('img'), $image);\n\n Artiulo::create([\n 'nombre_articulo' =>$request->nombre_articulo,\n 'precio' =>$request->precio,\n 'descripcion' =>$request->descripcion,\n 'slug' =>$slug,\n 'status' =>'A',\n 'imagen' =>$image,\n ]);\n\n return redirect()->route('product.index');\n\n }", "public function store(Request $request)\n {\n try {\n DB::beginTransaction();\n Empresa::create([\n 'nombre' => $request->nombre,\n 'descripcion' => $request->descripcion,\n 'sector' => $request->sector,\n 'estatus' => $request->estatus\n ]);\n DB::commit();\n\n return redirect()->route('empresas.index')->with([\n 'success' => __('messages.operacionExitosa')\n ]);\n } catch (Exception $e) {\n DB::rollback();\n return redirect()->back()->with([\n 'error' => $e->getMessage(),\n ]);\n }\n }", "public function store() {\n $NotepadID = request('NotepadID');\n\n //CALLS CREATE METHOD FROM TASKS MODEL AND\n //USES REQUESTS VARIABLES DATA TO STORE\n Tasks::create([\n 'task' => request('task'), \n 'description' => request('description'), \n 'NotepadID' => request('NotepadID')\n ]);\n\n //REDIRECTS TO TASK VIEW WITH NOTEPADID AS PARAMETER\n return redirect (\"/task/$NotepadID\");\n }", "public function store(Request $request)\n {\n //\n $articulo = new Articulo;\n //base de datos\n $articulo->id_tipo=$request->get('id_tipo');\n $articulo->nombre=$request->get('nombre');\n $articulo->costo=$request->get('costo');\n \n $articulo->cantidad=$request->get('cantidad');\n $articulo->save();\n \n }", "public function store(StoreFormRequest $request)\n {\n\n $template = new Template([\n 'nome' => $request->get('nome'),\n 'descricao' => $request->get('descricao'),\n 'altura'=> $request->get('altura'),\n 'largura'=> $request->get('largura')\n ]);\n \n $template->save();\n return redirect('/template')->with('success', 'Template cadastrado com sucesso!');\n }", "public function store(Createobras_estoqueRequest $request)\n {\n $input = $request->all();\n\n $obrasEstoque = $this->obrasEstoqueRepository->create($input);\n\n Flash::success(__('messages.saved', ['model' => __('models/obrasEstoques.singular')]));\n\n return redirect(route('obrasEstoques.index'));\n }", "public function store(Request $request)\n {\n //$datosEstudiante = request()->all();\n\n $validacion = [\n 'nombre' => 'required|string|max:15',\n 'apellidoPaterno' => 'required|string|max:15',\n 'apellidoMaterno' => 'required|string|max:15',\n 'correo' => 'required|email',\n 'foto' => 'required|max:10000|mimes:jpeg,png,jpg'\n ];\n\n $mensajeValidacion = [\n 'required' => 'El :attribute es requerido',\n 'foto.required'=> 'Favor de subir una foto'\n ];\n\n $this->validate($request, $validacion, $mensajeValidacion);\n\n $datosEstudiante = request()->except('_token');\n if ($request->hasFile('foto')) {\n # code...\n $datosEstudiante['foto']=$request->file('foto')->store('uploads', 'public');\n }\n Estudiante::insert($datosEstudiante);\n //eturn response()->json($datosEstudiante);\n return redirect('estudiante')->with('mensaje', 'Estudiante agregado con éxito');\n\n }", "public function store(Request $request)\n {\n $articulo = new \\App\\Models\\Articulo();\n $articulo->nombre = $request->get('nombre');\n $articulo->id_marca = $request->get('id_marca');\n $articulo->existencia = $request->get('existencia');\n $articulo->descripcion = $request->get('descripcion');\n $articulo->categoria = $request->get('categoria');\n $articulo->talla = $request->get('talla');\n $articulo->IDlocal = $request->get('IDlocal');\n $articulo->precioOriginal = $request->get('precio');\n $temporal = $request->get('descuento');\n $temporal2 = $request->get('precio');\n\n if ($temporal != 0 || $temporal > 0) {\n $descuento = ($temporal * $temporal2) / 100;\n $articulo->precio = $temporal2 - $descuento;\n $articulo->descuento = $temporal;\n } else {\n $articulo->descuento = $temporal;\n $articulo->precio = $request->get('precio');\n }\n $articulo->imagena= $request->file('imagena');\n\n $articulo->imagenb = $request->imagenb;\n\n $articulo->imagenc = $request->imagenc;\n\n $articulo->imagend = $request->imagend;\n\n\n\n $articulo->save();\n\n // $request->session()->flash('notificacion', 'Task was successful!');\n $data = $request->session()->all();\n //dd($data);\n return back()->with('success', \"Articulo Agregado\");\n }", "public function store(Request $request)\n {\n /* Se crea objeto para almacenar la informacion del equipo */\n $equipo = new ActivoFijo($request->all());\n /* Se almacena la informacion */\n $equipo->save();\n /* Se envia mensaje de confirmacion a la pantalla de administracion */\n Flash::success('El Equipo se ha creado Exitosamente! ');\n return redirect()->route('app.equipos.index');\n }", "public function store()\n {\n $article = Article::create($this->validateRequest());\n $this->storeImage($article);\n return redirect('articles');\n }", "public function store(Request $request)\n {\n \n $requestData = $request->all();\n \n ecausa::create($requestData);\n\n return redirect('ecausa')->with('flash_message', 'ecausa added!');\n }", "public function store(Request $request) {\n\t\t\n\t\n\t}", "public function store(Request $request)\n {\n $cad=$this->objEmpreendimentos->create([\n 'nome'=>$request->nome,\n 'cidade'=>$request->cidade,\n 'valorMquadrado'=>$request->valorMquadrado,\n\n 'dataEntrega'=>$request->dataEntrega,\n\n ]);\n if ($cad){\n return redirect('empreendimentos');\n }\n }", "public function store(Request $request)\n {\n \n $this->validate($request, [\n 'ciEst' => 'required|string',\n 'nombreEst' => 'required|string',\n 'apellidoEst' => 'required|string',\n 'emailEst' => 'required|email',\n 'telefono' => 'required|integer',\n ]);\n Estudiante::create([\n 'ciEst' => $request['ciEst'],\n 'nombreEst' => $request['nombreEst'],\n 'apellidoEst' => $request['apellidoEst'],\n 'emailEst' => $request['emailEst'],\n 'telefono' => $request['telefono'],\n 'idCarrera' => $request['idCarrera'],\n ]);\n // return response()->json([\n // 'message' => 'Se agrego correctamente!',\n // ]);\n\n }", "public function store()\n {\n $array_requisicao = Request::capture()->all();\n\n $validator = Validator::make($array_requisicao, [\n 'setor_id' => 'required|exists:\\App\\Modules\\Processos\\Setor,setor_id',\n 'processo_nome' => 'required|max:255',\n 'processo_descricao' => 'required|max:255',\n 'processo_horario' => 'required|max:25'\n ]);\n\n if ($validator->fails()) {\n return response()->json([\n 'status' => 'erro',\n 'mensagem' => 'Não foi possível salvar, verifique os dados enviados!',\n 'dados' => $validator->getMessageBag()->getMessages()\n ]);\n }\n\n try {\n $array_dados_processo = $this->service->add($array_requisicao);\n } catch (\\Exception $exception) {\n return response()->json([\n 'status' => 'erro',\n 'mensagem' => $exception->getMessage()\n ]);\n }\n\n return response()->json([\n 'status' => 'sucesso',\n 'mensagem' => 'Sucesso ao salvar o registro!',\n 'dados' => $array_dados_processo\n ]);\n }", "public function store(Request $request)\n {\n $this->detalleventa->create($request->all());\n\n flash()->success(trans('core::core.messages.resource created', ['name' => trans('ventas::detalleventas.title.detalleventas')]));\n\n return redirect()->route('admin.ventas.detalleventa.index');\n }", "public function store(Request $request)\n {\n $escrow = new Escrow;\n $escrow->name = $request->name;\n $escrow->created_by = \\Auth::user()->id;\n $escrow->save();\n return redirect(\"escrow\");\n }", "public function store(Request $request)\n {\n if ($request->metodo == 1) {\n \n $articulo = new ModelArticulos();\n $articulo->id_designer = $request->designer;\n $articulo->nombre = $request->nombre;\n $articulo->sexo = $request->sexo;\n $articulo->tipo = $request->tipo;\n $articulo->contenido = $request->contenido;\n $articulo->presentacion = $request->presentacion;\n $articulo->precio_a = $request->precio_a;\n $articulo->precio_b = $request->precio_b;\n $articulo->precio_c = $request->precio_c;\n $articulo->precio_p = $request->precio_p;\n $articulo->descripcion = $request->descripcion;\n $articulo->existencia = $request->existencia;\n $articulo->estante = $request->estante;\n $articulo->codigo = $request->codigo;\n $articulo->codigoa1 = $request->codigoa1;\n $articulo->codigoa2 = $request->codigoa2;\n $articulo->codigoa3 = $request->codigoa3;\n $articulo->codigoa4 = $request->codigoa4;\n $articulo->codigoa5 = $request->codigoa5;\n $articulo->fecha_alta = $fecha_actual = date(\"Y-m-d\");\n $articulo->estado = 1;\n $articulo->save();\n\n $id_articulo = $articulo->id;\n\n if ($request->hasFile('imagen')) {\n //obtiene la extension\n $FotografiaExt = $request->file('imagen')->getClientOriginalExtension();\n //nombre que se guarad en ruta\n $FotografiaStore = $id_articulo.'.'.$FotografiaExt;\n //archivo guardado en ruta local\n Storage::disk('public_uploads')->put($FotografiaStore, fopen($request->file('imagen'), 'r+'));\n }\n\n return response()->json(array(\n 'status' => true,\n 'request' => $request->metodo,\n ));\n }\n\n else\n {\n $articulo = ModelArticulos::where('id', '=', $request->id)->update(array(\n 'id_designer' => $request->designer,\n 'nombre' => $request->nombre,\n 'sexo' => $request->sexo,\n 'tipo' => $request->tipo,\n 'contenido' => $request->contenido,\n 'existencia' => $request->existencia,\n 'presentacion' => $request->presentacion,\n 'precio_a' => $request->precio_a,\n 'precio_b' => $request->precio_b,\n 'precio_c' => $request->precio_c,\n 'precio_p' => $request->precio_p,\n 'descripcion' => $request->descripcion,\n 'estante' => $request->estante,\n 'codigo' => $request->codigo,\n 'codigoa1' => $request->codigoa1,\n 'codigoa2' => $request->codigoa2,\n 'codigoa3' => $request->codigoa3,\n 'codigoa4' => $request->codigoa4,\n 'codigoa5' => $request->codigoa5));\n\n if ($request->hasFile('imagen')) {\n //se elimina la imagen antigua\n Storage::disk('public_uploads')->delete($request->id);\n\n //obtiene la extension\n $FotografiaExt = $request->file('imagen')->getClientOriginalExtension();\n //nombre que se guarad en ruta\n $FotografiaStore = $request->id.'.'.$FotografiaExt;\n //archivo guardado en ruta local\n Storage::disk('public_uploads')->put($FotografiaStore, fopen($request->file('imagen'), 'r+'));\n }\n\n return response()->json(array(\n 'status' => true,\n 'request' => $request->metodo,\n ));\n }\n }", "public function store(Request $request)\n {\n //\n\n \n $tiquete = new tiquete($request->all());\n \n $tiquete->save();\n \n \n dd($tiquete);\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store(PreguntasRequest $request)\n {\n if($request->hasFile('imagen')){\n $ruta = 'preguntas/';\n $imagen = $request->file('imagen');\n $path = $imagen->guessExtension();\n $nombre = Carbon::now()->second.'.'.$path;\n Storage::disk('local')->put($ruta.$nombre, \\File::get($imagen));\n }else{\n $ruta = null;\n $nombre = null;\n }\n\n $pregunta = Pregunta::create([\n 'enunciado' => $request->get('enunciado'),\n 'habilitada' => false,\n 'ruta' => $ruta,\n 'path' => $nombre\n ]);\n\n $esc = $request->input('escogida');\n\n $res = $esc+1;\n\n Respuesta::create([\n 'respuesta1' => $request->input('respuesta.0'),\n 'respuesta2' => $request->input('respuesta.1'),\n 'respuesta3' => $request->input('respuesta.2'),\n 'respuesta4' => $request->input('respuesta.3'),\n 'respuesta_correcta' => $res,\n 'pregunta_id' => $pregunta->id\n ]);\n\n Session::flash('creado','Pregunta creada con exito');\n\n return redirect('preguntas');\n\n }", "public function store(Request $request)\n {\n $entrada = $request->all();\n\n if($archivo=$request->file('Ruta')) //Si se desea guardar una imagen\n {\n /*Asigna la ruta correcta de la imagen, que tiene el formato imagen/\"nombre_imagen\" */\n $nombre = $archivo->getClientOriginalName();\n $archivo->move('images',$nombre);\n $entrada[\"Ruta\"] = $nombre;\n }\n\n Cliente::create($entrada); //Almacena al cliente en la base de datos\n\n return redirect(\"/clientes\"); //Redirecciona a la pagina principal\n }", "public function store(Request $request)\n {\n request()->validate([\n \"firstname\" =>[\"required\"],\n \"name\" =>[\"required\"],\n \"text\" =>[\"required\",\"min:100\",\"max:200\"],\n \"job\" =>[\"required\"],\n \"img\" =>[\"required\"],\n ]);\n\n $testimonial = new Testimonial();\n \n // Storage via input File\n $request->file('img')->storePublicly('img/', 'public');\n \n $testimonial->firstname = $request->firstname;\n $testimonial->name = $request->name;\n $testimonial->text = $request->text;\n $testimonial->job = $request->job;\n $testimonial->img = $request->file('img')->hashName();\n $testimonial->save();\n\n return redirect()->route('back.testimonial')->with('success', 'Services enregistrés');\n }", "public function store(Request $request)\n { \n \\App\\Item::create([\n 'idevento' => $request['eventoid'],\n 'nombre' => $request['nombrearticulo'],\n 'cantidad' =>$request['cantidad']\n ]);\n\n return Redirect::back();\n }", "public function store(Request $request)\n {\n $request->validate([\n 'displayname' => 'required|min:2|unique:artists',\n ]);\n $avatar = FileManager::store($request, '/avatars/artists/', 'avatar');\n Artist::create([\n 'firstname' => $request->firstname,\n 'lastname' => $request->lastname,\n 'displayname' => $request->displayname,\n 'available_disk_space' => $request->available_disk_space,\n 'avatar' => $avatar\n ]);\n return response()->json(null, 201);\n }", "public function store(Request $request)\n {\n Servidores::create($request->all());\n\n //return back()->withSuccess(trans('app.success_store'));\n return redirect()->route(ADMIN.'.servidoresRoute.index')->withSuccess(trans('app.success_store'));\n \n }", "public function store(Request $request)\n {\n //\n $this->validate($request, [\n 'isi' => 'required',\n 'nama' => 'required',\n ]);\n\n $sertifikasis = new Sertifikasi;\n if (!$sertifikasis) {\n abort(404);\n }\n\n $sertifikasis->deskripsi = $request->isi;\n $sertifikasis->nama = $request->nama;\n\n $filename = \"defaultsertifikasi.png\";\n if($request->gambar) {\n $images = $request->file('gambar');\n $file = $images->getRealPath();\n $filename = $images->getClientOriginalName();\n Storage::put('public/sertifikasi/' . $filename, file_get_contents($file));\n\n $sertifikasis->logo = $filename;\n } else {\n $sertifikasis->logo = $filename;\n }\n\n $sertifikasis->save();\n\n return redirect(url('/admin/sertifikasi'));\n }", "public function store(Request $request)\n { \n $datosEfectivo = [\n 'cantidad'=>$request->cantidad,\n 'concepto'=>$request->concepto,\n 'aplicacion'=>$request->aplicacion,\n 'nota'=>$request->nota == null ? '' : $request->nota,\n 'tipo'=>$request->tipo,\n 'created_at'=>now()\n ];\n Efectivo::insert($datosEfectivo);\n return redirect('efectivo')->with('mensaje','Registro Agregado Correctamente');\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'fecha'=>'required',\n 'hora'=>'required|numeric',\n 'presencia'=>'required|numeric',\n 'id_usuario'=>'required',\n ]);\n\n $asistencia= new Asistencia($request->all());\n $asistencia->save();\n \\Flash::success(\"Se ha <strong>Registrado</strong> la Asistencia N° =><strong> \".$asistencia->id.\"</strong> de forma exitosa!\");\n return redirect('asistencia');\n }", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.71722144", "0.698295", "0.6935045", "0.68464124", "0.6822943", "0.6740656", "0.6710758", "0.6699495", "0.6691652", "0.6690884", "0.6666095", "0.6642097", "0.66355145", "0.66001856", "0.65923023", "0.65900797", "0.6582649", "0.65805125", "0.65796894", "0.655714", "0.65566844", "0.6552031", "0.65484893", "0.65442985", "0.6543053", "0.65244216", "0.64959216", "0.6495859", "0.6486519", "0.64852554", "0.6483744", "0.64808744", "0.6478153", "0.64685243", "0.64623165", "0.6461544", "0.64568865", "0.64503294", "0.6444034", "0.6443767", "0.64399517", "0.6434275", "0.6432371", "0.642056", "0.64189655", "0.6414018", "0.64129657", "0.64100736", "0.64031416", "0.63993216", "0.6398634", "0.6398634", "0.6398634", "0.6398545", "0.6388316", "0.63810086", "0.6376138", "0.6373188", "0.6370252", "0.6369358", "0.63672376", "0.63649374", "0.6364211", "0.63633835", "0.6361508", "0.6360381", "0.63580424", "0.6356134", "0.635555", "0.6354754", "0.6352416", "0.6350535", "0.6349791", "0.63476354", "0.63472265", "0.6344778", "0.63445747", "0.6344386", "0.63407105", "0.6338955", "0.63380086", "0.63373786", "0.6337144", "0.6336583", "0.6333297", "0.6332593", "0.6332593", "0.6332593", "0.6332593", "0.6332593", "0.6332593", "0.6332593", "0.6332593", "0.6332593", "0.6332593", "0.6332593", "0.6332593", "0.6332593", "0.6332593", "0.6332593", "0.6332593" ]
0.0
-1
caso: cargarAlumno (post): Se deben guardar los siguientes datos: nombre, apellido, email y foto. Los datos se guardan en el archivo de texto alumnos.txt, tomando el email como identificador.
public static function cargarAlumno() { throw new Exception('No implementado aun '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cargarDatostxt(){\n // Si no existe lo creo\n $tabla=[]; \n if (!is_readable(FILEUSER) ){\n // El directorio donde se crea tiene que tener permisos adecuados\n $fich = @fopen(FILEUSER,\"w\") or die (\"Error al crear el fichero.\");\n fclose($fich);\n }\n $fich = @fopen(FILEUSER, 'r') or die(\"ERROR al abrir fichero de usuarios\"); // abrimos el fichero para lectura\n \n while ($linea = fgets($fich)) {\n $partes = explode('|', trim($linea));\n // Escribimos la correspondiente fila en tabla\n $tabla[]= [ $partes[0],$partes[1],$partes[2],$partes[3]];\n }\n fclose($fich);\n return $tabla;\n}", "public function importarAdministrativos($archivo=$this->archivo){\n $lineas = file($archivo); \n $i=0; \n foreach ($lineas as $linea_num => $linea)\n { \n if($i != 0) \n { \n $administrativos = explode(\";\",$linea);\n $dni=trim($administrativos[0]);\n $apellidos=trim($administrativos[1]);\n $nombre = trim($administrativos[2]);\n $dependencia =trim($administrativos[3]);\n $telefono = trim($administrativos[4]);\n $correo = trim($administrativos[5]);\n $categoria = trim($administrativos[6]);\n $cargo= trim($administrativos[7]); \n mysql_query(\"INSERT INTO administrativos(nombre,edad,profesion) \n VALUES('$dni,'$apellidos','$nombre','$dependencia','$telefono','$correo','$categoria','$cargo')\");\n } \n $i++;\n }\n}", "public function importCsv()\n {\n if( auth()->user()->hasRole(['Administrador','Secretaria'])){\n //Agregado para rellenar las Carreras que no estaban\n $cuantos=Carrera::all()->count();\n //Creamos instancia de Faker designando el lenguaje a utilizar\n $faker = Faker::create('es_ES'); \n\n \n /** El método load permite cargar el archivo definido como primer parámetro */\n //Metodo para archivo Csv\n /** Carga del documento*/\n Excel::load($archivo.'.csv', function ($reader) {\n /**\n * $reader->get() nos permite obtener todas las filas de nuestro archivo\n */\n $rol_estudiante = Role::where('name', 'LIKE', 'Estudiante')->get()->first()->id;\n foreach ($reader->get() as $key => $row) {\n $persona = [\n 'nombre_apellido' => $row['apellido' . \" \" .'nombre'],\n 'dni' => $row['dni'],\n 'email' => $row['email'],\n 'fecha_registro' => $row['fecha_registro'],\n 'status' => $row['status'],\n ];\n //alumno\n \n $usuario = [\n 'email' => $row['email'],\n 'password' => \"123456\",\n 'username' => \"alumno\",\n \n ];\n\n /** Una vez obtenido los datos de la fila procedemos a registrarlos */\n if (!empty($archivo)) {\n //temporal de los datos de un usuario\n $data_user = $estudiante['usuario'];\n //temporal de los datos de una persona\n $data_persona = $estudiante['persona'];\n \n //Creamos un Usuario con los datos del temporal\n $user = User::create($data_user);\n \n //Actualizamos el temporal de los datos con el id del Usuario que referencia\n $data_persona['user_id'] = $user->id;\n \n //Creamos una Persona con los datos del temporal\n $persona = Persona::create($data_persona);\n \n //Hasheamos el Password del Usuario\n $user->hashPassword();\n //Actualizamos el Username del Usuario\n $user->updateUsername();\n //Asignamos el Rol del Estudiante\n $user->attachRole($rol_estudiante);\n \n }\n }\n\n \n echo 'Los Alumnos han sido importadas exitosamente';\n });\n } \n abort(403); \n }", "public function importarDocentes($archivo=$this->archivo){\n //cargamos el archivo\n $lineas = file($archivo); \n //inicializamos variable a 0, esto nos ayudará a indicarle que no lea la primera línea\n $i=0; \n //Recorremos el bucle para leer línea por línea\n foreach ($lineas as $linea_num => $linea)\n { \n //abrimos bucle\n /*si es diferente a 0 significa que no se encuentra en la primera línea \n (con los títulos de las columnas) y por lo tanto puede leerla*/\n if($i != 0) \n { \n //abrimos condición, solo entrará en la condición a partir de la segunda pasada del bucle.\n /* La funcion explode nos ayuda a delimitar los campos, por lo tanto irá \n leyendo hasta que encuentre un ; */\n $docente = explode(\";\",$linea);\n //Almacenamos los docente que vamos leyendo en una variable\n $dni=trim($docente[0]);\n $apellidos=trim($docente[1]);\n $nombre = trim($docente[2]);\n $facultad =trim($docente[3]);\n $telefono = trim($docente[4]);\n $correo = trim($docente[5]);\n $categoria = trim($docente[6]);\n $regimen = trim($docente[7]);\n $cargo= trim($docente[8]); \n //guardamos en base de docente la línea leida\n mysql_query(\"INSERT INTO docente(nombre,edad,profesion) \n VALUES('$dni,'$apellidos','$nombre','$facultad','$telefono','$correo','$categoria','$regimen','$cargo')\"); \n //cerramos condición\n } \n /*Cuando pase la primera pasada se incrementará nuestro valor y a la siguiente pasada ya \n entraremos en la condición, de esta manera conseguimos que no lea la primera línea.*/\n $i++;\n //cerramos bucle\n }\n}", "public function postCargarInformacion(){\n\t\t$fecha = date(\"Y-d-m H:i:s\");\n\t\t$registro = DB::SELECT(\"SELECT ident_current('MODBID_INFORMACIONPUBLIC') AS [LastID_1]\");\t\t\n\t\t$id_foto = (($registro[0]->LastID_1)+1).\".jpg\";\n\t\t\t\t\n\t\tDB::table('MODBID_INFORMACIONPUBLIC')->insert(\n\t\t \tarray(\n\t\t \t\t'id_usuario' => Auth::user()->id,\t\t \t\t\n\t\t \t\t'titulo' => Input::get('titulo'),\n\t\t \t\t'foto' => $id_foto,\n\t\t \t\t'tipo' => Input::get('tipo'),\n\t\t \t\t'texto' => Input::get('texto'),\t\t\t \t\t\n\t\t \t\t'created_at' => $fecha,\n\t \t\t\t'updated_at' => $fecha,\n\t \t\t\t'fecha_noticia' => Input::get('fecha_info')\n\n\t\t \t)\n\t\t);\n\n\t\t$path_foto = public_path().'/assets/bid/informacion/'.(($registro[0]->LastID_1)+1).\"/\";\n\t\tInput::file('foto')->move($path_foto,$id_foto);\n\t\treturn Redirect::to('vista1_bid')->with('status', 'ok_estatus');\n\t}", "public function loadDataIntoBD() : void{\n $consulta = new Consultas();\n try{\n $reader = new Csv();\n \n $reader->setInputEncoding('CP1252');\n $reader->setDelimiter(';');\n $reader->setEnclosure('');\n $reader->setSheetIndex(0);\n \n $spreadsheet = $reader->load('./files/' . $this->files['name']);\n \n $worksheet = $spreadsheet->getActiveSheet();\n \n //Se debe hacer lectura anticipada, o hacerle un next al iterador\n //Manera no encontrada\n //Se salta el primero para que no lea las cabeceras de las columnas\n \n $cutradaParaSaltarPrimero = 0;\n foreach ($worksheet->getRowIterator() as $row) {\n if($cutradaParaSaltarPrimero == 0){\n $cutradaParaSaltarPrimero++;\n continue;\n }\n\n $cellIterator = $row->getCellIterator();\n $cellIterator->setIterateOnlyExistingCells(FALSE);\n \n $arrayFila = array();\n foreach ($cellIterator as $cell) {\n $arrayFila[] = $this->utf8Decode(trim($cell->getValue()));\t\t\t\t\n }\n \n if($arrayFila[0] != '') {\n $consulta->insertarCompetidor($arrayFila);\n }\n \n }\n \n }catch(\\PhpOffice\\PhpSpreadsheet\\Reader\\Exception $e){\n die('Error loading file: ' . $e->getMessage());\n }\n }", "static public function cargarUsuario($legajo, $email, $nombre, $clave, $fotoUno, $fotoDos)\n {\n $lista = self::LeerJSON(PATH_ARCHIVOS . \"/usuarios.json\", \"Usuario\");\n $Usuario = self::BuscaXCriterio($lista, \"legajo\", $legajo);\n\n if ($Usuario != null) {\n echo \"<br>El Usuario ya existe<br>\";\n } else {\n $nomFotoUno = \"fotoUno_\" . $legajo;\n self::cargarImagenPorNombre($fotoUno, $nomFotoUno, PATH_IMAGENES);\n $nomFotoDos = \"fotoDos_\" . $legajo;\n self::cargarImagenPorNombre($fotoDos, $nomFotoDos, PATH_IMAGENES);\n\n $Usuario = new Usuario($legajo, $email, $nombre, $clave, $nomFotoUno, $nomFotoDos);\n array_push($lista, $Usuario);\n self::guardarJSON($lista, PATH_ARCHIVOS . \"/usuarios.json\", \"Usuario\");\n }\n }", "function insertAtenciones(){\n\n\t$id_item=2; // proyecto : LEVEL\n\t$id_status=3;\n\t$id_nivel=1;\n\t$id_usuario=146; //larry portanova\n\t$id_user=203; //larry portanova\n\n\n\t//leer archivo\n\t$buffer=implode('',file('atenciones2/level.csv'));\n\n\t//parsear csv\n\t$atenciones=[];\n\n\t$lineas=explode(\"\\n\",$buffer);\n\n\t$campos=explode(\",\",$lineas[0]);\n\n\tforeach($lineas as $i => $linea){\n\n\t\tif($i==0) continue;\n\n\t\t$columnas=str_getcsv($linea);\n\n\t\tforeach($columnas as $j => $columna){\n\n\t\t\t$atenciones[$i][strtolower(trim($campos[$j]))]=$columna;\n\t\t}\n\n\t}\n\n\t// prin($atenciones);\n\n\t//inserts\n\n\t$fechaMonth=[\n\t'Ene'=>'01','Feb'=>'02','Mar'=>'03','Apr'=>'04','May'=>'05','Jun'=>'06','Jul'=>'07','Aug'=>'08','Set'=>'09','Oct'=>'10','Nov'=>'11','Dic'=>'12',\n\t'01'=>'01','02'=>'02','03'=>'03','04'=>'04','05'=>'05','06'=>'06','07'=>'07','08'=>'08','09'=>'09','10'=>'10','11'=>'11','12'=>'12',\n\t];\n\n\n\n\tforeach($atenciones as $i => &$atencion){\n\n\t\tif(trim($atencion['nombre'])=='') continue;\n\n\t\t//eliminamos vacio\n\t\tunset($atencion['']);\n\n\t\t//nombre completo\n\t\t$atencion['nombre_completo']=$atencion['nombre'];\n\n\t\t//nombre y apellidos\n\t\t$nom_partes=explode(\" \",$atencion['nombre']);\n\t\t$atencion['nombre']=$nom_partes[0];\n\t\tunset($nom_partes[0]);\n\t\t$atencion['apellidos']=trim(implode(\" \",$nom_partes));\n\n\t\t//fecha\n\t\t$atencion['fecha_original']=$atencion['fecha'];\n\t\t$fecha_partes=explode(\"-\",$atencion['fecha']);\n\t\t$atencion['fecha']=\"2015-\".$fechaMonth[$fecha_partes[1]].\"-\".str_pad($fecha_partes[0], 2, \"0\", STR_PAD_LEFT).\" 14:00:00\";\n\n\t\t$atencion['seguimiento']='Primer contacto';\n\t\t// prin($atencion['fecha']);\n\n\t\t// prin($atencion);\n\n\t\t// continue;\n\n\t\t//\n\t\t//cliente\n\t\t$clienteId=getIdOrCreate(\n\t\t\t\"clientes\",\n\t\t\t[\n\t\t\t\t\"nombre\" =>$atencion['nombre'],\n\t\t\t\t\"apellidos\" =>$atencion['apellidos'],\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"celular_claro\" =>$atencion['tel. cel.'],\n\t\t\t\t\"email\" =>$atencion['email'],\n\t\t\t\t\"telefono\" =>$atencion['fijo'],\n\n\t\t\t\t\"id_usuario\" =>$id_usuario,//\n\t\t\t\t\"user\" \t\t =>$id_user,//\n\n\t\t\t\t// \"tipo_cliente\" =>rand(1, 2),\n\t\t\t\t// \"genero\" \t\t=>rand(1, 2),\n\t\t\t\t// \"genero\" \t\t=>rand(1, 2),\n\t\t\t\t// \"email\" \t\t=>\"[email protected]\",\n\t\t\t]\n\t\t\t);\n\n\n\t\t//\t$pedido='[{\"type\":\"departamento\",\"price\":\"621000\",\"id\":\"12\"}]';\n\t\t//departamento\n\t\t$item_item=select_fila(\"id,pvlista\",\"productos_items_items\",\"where numero=\".$atencion['departamento'].\" and id_item=\".$id_item);\n\n\t\t// $pedido='[{\"type\":\"departamento\",\"price\":\"'.$item_item['pvlista'].'\",\"id\":\"'.$item_item['id'].'\"}]';\n\n\t\t// $pedido='[{\"type\":\"departamento\",\"price\":\"'.$item_item['pvlista'].'\",\"id\":\"'.$item_item['id'].'\",\"name\":\"1 departamento'.$atencion['departamento'].'\",\"num\":\"'.$atencion['departamento'].'\",\"torre\":\"1\"}]';\n\n\t\t$canalId=getIdOrCreate(\n\t\t\t\"contacto_canales\",\n\t\t\t[\n\t\t\t\"nombre\" =>$atencion['medio'],\n\t\t\t]\n\t\t\t);\n\n\n\t\t// prin($atencion);\n\t\t//atencion\n\t\t$venta=insert(\n\t\t\t[\n\t\t\t\"fecha_creacion\" =>$atencion['fecha'],//\n\t\t\t\"fecha_creacion2\"=>$atencion['fecha'],//\n\t\t\t\"visibilidad\" =>'1',\n\t\t\t\"id_cliente\" =>$clienteId,\n\t\t\t\"id_status\" =>$id_status,//\n\t\t\t\"id_nivel\" =>$id_nivel,//\n\t\t\t\"id_canal\" =>$canalId,\n\t\t\t\"id_item\" =>$id_item,//\n\t\t\t\"id_usuario\" =>$id_usuario,//\n\t\t\t\"user\" \t\t =>$id_user,//\n\t\t\t\n\t\t\t// \"pedido\" =>$pedido,//\n\t\t\t// \"pvlista\" =>$item_item['pvlista'],//\n\t\t\t// \"pvpromocion\" =>$item_item['pvlista'],//\n\n\t\t\t// \"id_item_item\" =>$item_item['id'],//\n\n\t\t\t]\n\t\t\t,\"ventas_items\"\n\t\t\t);\n\n\t\tif(trim($atencion['seguimiento'])!='')\n\t\tinsert(\n\t\t\t[\n\t\t\t'fecha_creacion' =>$atencion['fecha'],\n\t\t\t// \"id_item\" =>$id_item,//\n\t\t\t'id_grupo' =>$venta['id'],\n\t\t\t// \"id_cliente\" =>$clienteId,\n\t\t\t'texto' =>$atencion['seguimiento'],\n\t\t\t]\n\t\t\t,'ventas_mensajes'\n\t\t\t,1\n\t\t\t);\n\n\t}\n\n\t// exit();\n\n\tprin(\"Inserciones DONE\");\n\n\t// prin($atenciones);\n\n\t// prin($celdas);\n\n\n\t// $matriz = str_getcsv($buffer,',','\"','\\\\',\"\\n\");\n\n\t// $matriz = str_getcsv($buffer); \n\n\t// prin($matriz);\n\n}", "public function carga($archivo) {\n $public_path = storage_path();\n $url = $public_path.'/app/'.$archivo;\n DB::select(\"delete from temporal\");\n if (($gestor = fopen($url, \"r\")) !== FALSE) {\n while (($datos = fgetcsv($gestor, 1000, \";\")) !== FALSE) {\n //dd(iconv('UCS-2', 'UTF-8', $datos[1].\"\\0\")) ;\n $datos[0]=utf8_encode ( $datos[0]);\n $datos[1]=utf8_encode ( $datos[1]);\n DB::insert(\"INSERT INTO temporal (nombre,apellido,correo,contrasena,puesto,jefe,departamento,permisos) VALUES ('$datos[0]', '$datos[1]', '$datos[2]', '$datos[3]', '$datos[4]', '$datos[5]', '$datos[6]', '$datos[7]')\");\n }\n fclose($gestor);\n //LLENAR TABLA USUARIOS Y PERMISOS\n DB::Select(\"delete from users where id>1\");\n DB::Select(\"delete from detallepermisos where id>8\");\n $tuplas=DB::Select(\"select * from temporal\");\n $total=0;\n foreach ($tuplas as $tupla)\n {\n $jefe=null;\n $departamento=0;\n $Usuario = new \\App\\User();\n $puesto = 0;\n //----------------departamento-----------------------\n $dep=DB::Select(\"select id from departamentos where nombredepartamento='\".$tupla->departamento.\"'\");\n if(count($dep)>0)\n {\n $departamento=$dep[0]->id;\n }\n else\n {\n DB::Insert(\"insert into departamentos (nombredepartamento) values('\".$tupla->departamento.\"')\");\n $dep=DB::Select(\"select id from departamentos where nombredepartamento='\".$tupla->departamento.\"'\");\n $departamento=$dep[0]->id;\n }\n //----------------puesto------------------------------\n $dep=DB::Select(\"select id from puestos where nombrepuesto='\".$tupla->puesto.\"'\");\n if(count($dep)>0)\n {\n $puesto=$dep[0]->id;\n }\n else\n {\n DB::Insert(\"insert into puestos (nombrepuesto) values('\".$tupla->puesto.\"')\");\n $dep=DB::Select(\"select id from puestos where nombrepuesto='\".$tupla->puesto.\"'\");\n $puesto=$dep[0]->id;\n }\n \n $Usuario->name = $tupla->nombre;\n $Usuario->lastname = $tupla->apellido;\n $Usuario->email = $tupla->correo;\n $Usuario->puesto = $puesto;\n $Usuario->departamento = $departamento;\n $Usuario->password = Hash::make($tupla->contrasena);;\n $Usuario->save();\n \n \n $permisos=$tupla->permisos;\n $permisos=str_replace(\"[\", \"\", $permisos);\n $permisos=str_replace(\"]\", \"\", $permisos);\n $numeros=explode(\",\",$permisos);\n \n $id=DB::Select(\"select id from users where email='\".$tupla->correo.\"'\");\n foreach ($numeros as $numero)\n {\n $DetallePermiso = new \\App\\Detallepermiso();\n $DetallePermiso->user_id = $id[0]->id;\n $DetallePermiso->permisos_id = $numero;\n $DetallePermiso->save();\n }\n }\n foreach ($tuplas as $tupla)\n {\n if($tupla->jefe != \"\")\n {\n $id=DB::Select(\"select id from users where name='\".$tupla->jefe.\"'\");\n if(count($id)>0)\n {\n DB::Select(\"update users set id_jefe='\".$id[0]->id.\"'where name='\".$tupla->nombre.\"'\");\n }\n }\n }\n dd(\"completado\");\n }}", "function cargar_autonomo()\n\t{\n\t\ttoba_logger::instancia()->debug( \"Cargando PROYECTO {$this->identificador}\");\n\t\t$errores = array();\n\t\ttry {\n\t\t\t$this->db->abrir_transaccion();\n\t\t\t$this->db->retrasar_constraints();\n\t\t\t$errores = $this->cargar();\n\t\t\t$this->instancia->actualizar_secuencias();\n\t\t\t$this->generar_roles_db();\n\t\t\t$this->db->cerrar_transaccion();\n\t\t} catch ( toba_error $e ) {\n\t\t\t$this->db->abortar_transaccion();\n\t\t\tthrow $e;\n\t\t}\n\t\treturn $errores;\n\t}", "public function ActualizarPerfilAlumnoC(){\n\n\t\tif(isset($_POST[\"idAl\"])){\n\n\t\t\t$rutaImg = $_POST[\"imgActual\"];\n\n\t\t\tif(isset($_FILES[\"imgAl\"][\"tmp_name\"]) && !empty($_FILES[\"imgAl\"][\"tmp_name\"])){\n\n\t\t\t\tif(!empty($_POST[\"imgActual\"])){\n\n\t\t\t\t\tunlink($_POST[\"imgActual\"]);\n\n\t\t\t\t}\n\n\n\t\t\t\tif($_FILES[\"imgAl\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t$nombre = mt_rand(100,999);\n\n\t\t\t\t\t$rutaImg = \"Vistas/img/Alumnos/Al-\".$nombre.\".png\";\n\n\t\t\t\t\t$foto = imagecreatefrompng($_FILES[\"imgAl\"][\"tmp_name\"]);\n\n\t\t\t\t\timagepng($foto, $rutaImg);\n\n\t\t\t\t}\n\n\t\t\t\tif($_FILES[\"imgAl\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t$nombre = mt_rand(100,999);\n\n\t\t\t\t\t$rutaImg = \"Vistas/img/Alumnos/Al-\".$nombre.\".jpg\";\n\n\t\t\t\t\t$foto = imagecreatefromjpeg($_FILES[\"imgAl\"][\"tmp_name\"]);\n\n\t\t\t\t\timagejpeg($foto, $rutaImg);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$tablaBD = \"alumnos\";\n\n\t\t\t$datosC = array(\"id\"=>$_POST[\"idAl\"], \"nombre\"=>$_POST[\"nombreAl\"], \"apellidopaterno\"=>$_POST[\"apellidopaternoAl\"], \"apellidomaterno\"=>$_POST[\"apellidomaternoAl\"], \"noControl\"=>$_POST[\"noControl\"], \"correo\"=>$_POST[\"correoAl\"], \"clave\"=>$_POST[\"claveAl\"], \"foto\"=>$rutaImg);\n\n\t\t\t$resultado = AlumnosM::ActualizarPerfilAlumnoM($tablaBD, $datosC);\n\n\t\t\tif($resultado == true){\n\n\t\t\t\tif ($_SESSION[\"rol\"] == \"Alumno\") {\n\t\t\t\t\t\n\t\t\t\t\techo '<script>\n\t\t\t\t\twindow.location = \"http://localhost/psicologiaitsur/perfil-'.$_SESSION[\"rol\"].'\";\n\t\t\t\t\t</script>';\n\n\t\t\t\t}else if ($_SESSION[\"rol\"] == \"Administrador\"){\n\n\t\t\t\t\techo '<script>\n\t\t\t\t\twindow.location = \"http://localhost/psicologiaitsur/alumnos\";\n\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}", "function escreveArquivo($aux_nome, $aux_tel, $aux_cpf, $aux_rg){\n\n $pessoa = new Individuo();\n\n /**\n * Para evitar que o usuario fique recarregando a pagina\n */\n \n $pessoa->setNome($aux_nome);\n if($pessoa->getNome() == '' || $pessoa->getNome() == null){\n session_destroy();\n die(\"Falha\");\n }\n /**\n * Gravando os dados\n */\n $pessoa->setTelefone($aux_tel);\n $pessoa->setCPF($aux_cpf);\n $pessoa->setRg($aux_rg);\n\n $dados = fopen(\"/home/mateus/Arquivos/dados_individual.csv\", \"a+\") or die(\"Failed\"); \n $conteudo = '';\n $conteudo = fread($dados, 1);\n\n if($conteudo == ''){\n escreveCabecalho($dados);\n }\n \n fwrite($dados, $pessoa->getNome());\n fwrite($dados, \",\");\n fwrite($dados, $pessoa->getTelefone());\n fwrite($dados, \",\");\n fwrite($dados, $pessoa->getCPF());\n fwrite($dados, \",\");\n fwrite($dados, $pessoa->getRg());\n fwrite($dados, \"\\n\");\n\n\n fclose($dados);\n }", "public function importExcel()\n {\n if( auth()->user()->hasRole(['Administrador','Secretaria'])){\n //Agregado para rellenar las Carreras que no estaban\n $cuantos=Carrera::all()->count();\n //Creamos instancia de Faker designando el lenguaje a utilizar\n $faker = Faker::create('es_ES'); \n\n /** El método load permite cargar el archivo definido como primer parámetro */\n Excel::load($archivo.'.xlsx', function ($reader) {\n /**\n * $reader->get() nos permite obtener todas las filas de nuestro archivo\n */\n $rol_estudiante = Role::where('name', 'LIKE', 'Estudiante')->get()->first()->id;\n\n foreach ($reader->get() as $key => $row) {\n $persona = [\n 'nombre_apellido' => $row['apellido' . \" \" .'nombre'],\n 'dni' => $row['dni'],\n 'email' => $row['email'],\n 'fecha_registro' => $row['fecha_registro'],\n 'status' => $row['status'],\n ];\n //alumno\n \n $usuario = [\n 'email' => $row['email'],\n 'password' => \"123456\",\n 'username' => \"alumno\",\n \n ];\n\n /** Una vez obtenido los datos de la fila procedemos a registrarlos */\n if (!empty($archivo)) {\n //temporal de los datos de un usuario\n $data_user = $estudiante['usuario'];\n //temporal de los datos de una persona\n $data_persona = $estudiante['persona'];\n \n //Creamos un Usuario con los datos del temporal\n $user = User::create($data_user);\n \n //Actualizamos el temporal de los datos con el id del Usuario que referencia\n $data_persona['user_id'] = $user->id;\n \n //Creamos una Persona con los datos del temporal\n $persona = Persona::create($data_persona);\n \n //Hasheamos el Password del Usuario\n $user->hashPassword();\n //Actualizamos el Username del Usuario\n $user->updateUsername();\n //Asignamos el Rol del Estudiante\n $user->attachRole($rol_estudiante);\n \n }\n }\n\n \n echo 'Los Alumnos han sido importadas exitosamente';\n });\n } \n abort(403); \n }", "public static function formularioMarcas()\n {\n //Variable con los permisos del usuario\n $dato_tipo = Sentencias::Seleccionar(\"tipos_usuarios\", \"id\", array($_SESSION[\"tipo\"]), 0, null);\n\n //Variables de los campos de la tabla marcas\n $marca = null;\n\n \n\n //Se empiezan a validar los datos del formulario de marcas\n if(isset($_POST[\"formulario\"]))\n {\n //Se valida que no se dejen espacios vacios\n if($_POST[\"marca\"] != \"\")\n {\n //Se valida que la marca cumpla con los criterios\n if(Validaciones::alfanumerico($_POST[\"marca\"]) && Validaciones::longitud($_POST[\"marca\"], 20))\n {\n //Se divide en si es ingresar un registro o modificar uno existente\n //Aqui es donde se modifica el registro\n if(!empty($_GET[\"id_marca\"]))\n {\n //Se valida si el parametro es un numero\n if(is_numeric($_GET[\"id_marca\"]))\n {\n //Se divide entre solo actualizar marca, imagen y ambas a la vez\n //Aqui se actualiza el nombre y la imagen\n if(is_uploaded_file($_FILES[\"archivo\"][\"tmp_name\"]))\n {\n $img = $_POST[\"marca\"].time().\".jpg\";\n\n $campos_valores = array\n (\n 'marca' => $_POST[\"marca\"],\n 'imagen' => $img\n );\n\n $condiciones_parametros = array\n (\n 'id' => $_GET[\"id_marca\"]\n );\n\n Sentencias::Actualizar(\"marcas\", $campos_valores, $condiciones_parametros, 1, \"marcas.php\");\n move_uploaded_file($_FILES['archivo']['tmp_name'], \"../img/marcas/$img\");\n }\n\n //Aqui solo se actualizara el nombre\n else\n {\n $campos_valores = array\n (\n 'marca' => $_POST[\"marca\"]\n );\n\n $condiciones_parametros = array\n (\n 'id' => $_GET[\"id_marca\"]\n );\n\n Sentencias::Actualizar(\"marcas\", $campos_valores, $condiciones_parametros, 1, \"marcas.php\"); \n }\n }\n\n else\n {\n header(\"Location: marcas.php\");\n }\n }\n\n //Aqui es donde se agrega un nuevo registro\n else\n {\n //Se valida si ya se subio la imagen\n if(is_uploaded_file($_FILES[\"archivo\"][\"tmp_name\"]))\n {\n //Se validan los valores de la iamgen\n if(Validaciones::imagen($_FILES[\"archivo\"]))\n {\n $img = $_POST[\"marca\"].time().\".jpg\";\n $campos_valores = array\n (\n 'marca' => $_POST[\"marca\"],\n 'imagen' => $img\n );\n\n Sentencias::Insertar(\"marcas\", $campos_valores, 1, \"marcas.php\");\n move_uploaded_file($_FILES['archivo']['tmp_name'], \"../img/marcas/$img\");\n }\n\n else\n {\n Ventanas::Mensaje(2, \"La imagen no es valida\", null);\n }\n }\n\n else\n {\n Ventanas::Mensaje(2, \"Debe ingresar una imagen\", null);\n }\n }\n } \n\n else\n {\n Ventanas::Mensaje(2, \"El nombre de la marca no es valido\", null);\n }\n }\n\n else\n {\n Ventanas::Mensaje(2, \"No deje campos vacios\", null);\n }\n }\n\n //Renderiza el formulario de marcas\n echo\n (\"\n <form method='post' enctype='multipart/form-data' id='registro'>\n <div class='row'>\n <div class='container'>\n <div class='col s12 center-align'>\n <h4>Aqui puedes ingresar una nueva marca</h4>\n </div>\n <div class='input-field col s10 offset-s1'>\n <input id='marca' value='$marca' name='marca' type='text' class='validate' autocomplete='off'>\n <label for='marca' class='blue-text text-darken-4'>Nombre de la marca</label>\n </div>\n <div class='file-field input-field col s10 offset-s1'>\n <div class='btn blue darken-4'>\n <span>Imagen</span>\n <input type='file' name='archivo'>\n </div>\n <div class='file-path-wrapper'>\n <input class='file-path validate' type='text' placeholder='Seleccione una imagen para el usuario'>\n </div>\n </div>\n \");\n\n //Se renderiza el boton dependiendo de si es para crear o modificar\n if(empty($_GET[\"id_marca\"]))\n {\n //Se valida si tiene permisos para ingresar\n if($dato_tipo[\"marcas\"] == 2 || $dato_tipo[\"marcas\"] == 5 || $dato_tipo[\"marcas\"] == 6 || $dato_tipo[\"marcas\"] == 9)\n {\n echo\n (\"\n <div class='col s3 offset-s1'>\n <button name='formulario' class='waves-effect waves-light btn blue darken-4'>Ingresar marca</button>\n </div> \n \");\n } \n }\n\n else\n {\n //Se valida si tiene permisos para modificar\n if($dato_tipo[\"marcas\"] == 3 || $dato_tipo[\"marcas\"] == 5 || $dato_tipo[\"marcas\"] > 6)\n {\n echo\n (\"\n <div class='col s3 offset-s1'>\n <button name='formulario' class='waves-effect waves-light btn blue darken-4'>Actualizar marca</button>\n </div> \n \");\n } \n }\n\n echo\n (\" \n <div class='col s3'>\n <a href='marcas.php' class='waves-effect waves-light btn blue darken-4'>Limpiar campos</a>\n </div> \n </div>\n </div> \n </form>\n \");\n }", "public function actualizarperfil($id,$nombre,$primer_apellido,$segundo_apellido,$ano,$email,$telefono,$alias,$foto)\n {\n \n //busca en la tabla usuarios los campos donde el id sea el que le ha pasado el controlador\n $usuarios = R::load('usuarios',$id);\n \n //sobreescribe los campos\n $usuarios->nombre=$nombre;\n $usuarios->primer_apellido=$primer_apellido;\n $usuarios->segundo_apellido=$segundo_apellido;\n $usuarios-> fecha_nacimiento=$ano;\n $usuarios->email=$email;\n $usuarios->telefono=$telefono;\n $usuarios->alias=$alias;\n //si la foto exite se guarda en la base de datos se guarda el campo extension como png si la foto no exite se guarda como null\n $sustitutuirespaciosblancos = str_replace(\" \",\"_\",$alias);\n $directorio = \"assets/fotosperfil/usuario-\".$sustitutuirespaciosblancos.\".png\";\n $existefichero = is_file( $directorio );\n \n \n \n if($foto!=null){\n \n if ( $existefichero==true ){\n $extension=\"png\";\n }else{\n \n \n \n \n \n \n \n }}\n $usuarios->foto = $extension;\n // almacena los datos en la tabla usuarios de la base de datos\n R::store($usuarios);\n //rdirege al controlador Usuarios/Bienvenidos_u\n \n redirect(base_url().\"usuario/Usuarios/perfil_usuario\");\n \n \n }", "public function guardarAlumnoTXT($path)\n {\n $datosAlumno = \"{$this->nombre};{$this->edad};{$this->dni};{$this->legajo}\".PHP_EOL;\n\n if (file_exists($path))\n {\n //EL modo \"a\" coloca el puntero al fichero al final de mismo. Si no existe, se intenta crear\n $file = fopen($path, \"a\");\n fwrite($file, $datosAlumno);// datosAlumno es un string con los datos del alumno\n fclose($file);\n } \n else\n {\n //El modo \"w\" coloca el puntero al fichero al principio del fichero. Si no existe, se intenta crear\n $file = fopen($path, \"w\");\n fwrite($file, $datosAlumno);\n fclose($file);\n }\n }", "function Alumno(){\n $matricula =\"\";\n $nombre=\"\";\n $carrera=\"\";\n $email=\"\";\n $telefono=\"\";\n $nameErr=\"\";\n $emailErr=\"\";\n $carreraErr=\"\";\n $telErr=\"\"; \n $conexion=\"\";\n }", "function cargar_informacion_reducida()\n\t{\n\t\t// Cabecera del proyecto\n\t\t$this->manejador_interface->mensaje('Cargando datos globales', false);\n\t\t$archivo = $this->get_dir_tablas() . '/apex_proyecto.sql';\n\t\t$this->db->ejecutar_archivo( $archivo );\n\t\t$this->manejador_interface->mensaje('.OK');\n\t\t// Grupos de acceso y permisos\n\t\t$this->cargar_perfiles();\n\t}", "public function EditarPerfilAlumnoC(){\n\n\t\t$tablaBD = \"alumnos\";\n\t\tif ($_SESSION[\"rol\"] == \"Alumno\") {\n\t\t\t\n\t\t\t$id = $_SESSION[\"id\"];\n\n\t\t}else if ($_SESSION[\"rol\"] == \"Administrador\") {\n\t\t\t\n\t\t\t$id = substr($_GET[\"url\"], 10);\n\n\t\t}\n\t\t\n\n\t\t$resultado = AlumnosM::VerPerfilAlumnoM($tablaBD, $id);\n\n\t\techo '<form method=\"post\" enctype=\"multipart/form-data\">\n\t\t\t\t\t\n\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"col-md-6 col-xs-12\">\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<h2>Nombre:</h2>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"input-lg\" name=\"nombreAl\" value=\"'.$resultado[\"nombre\"].'\">\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"idAl\" value=\"'.$resultado[\"id\"].'\">\t\n\n\t\t\t\t\t\t\t<h2>Apellido Paterno:</h2>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"input-lg\" name=\"apellidopaternoAl\" value=\"'.$resultado[\"apellidopaterno\"].'\">\n\n\t\t\t\t\t\t\t<h2>Apellido Materno:</h2>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"input-lg\" name=\"apellidomaternoAl\" value=\"'.$resultado[\"apellidomaterno\"].'\">\n\n\t\t\t\t\t\t\t<h2>No. Control:</h2>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"input-lg\" name=\"noControl\" value=\"'.$resultado[\"noControl\"].'\">\n\t\t\t\t\t\n\t\t\t\t\t\t\t<h2>Correo Electronico:</h2>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"input-lg\" name=\"correoAl\" value=\"'.$resultado[\"correo\"].'\">\n\n\t\t\t\t\t\t\t<h2>Contraseña:</h2>\n\t\t\t\t\t\t\t<input type=\"text\" class=\"input-lg\" name=\"claveAl\" value=\"'.$resultado[\"clave\"].'\">\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t</div>\n\n\n\t\t\t\t\t\t<div class=\"col-md-6 col-xs-12\">\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<br><br>\n\n\t\t\t\t\t\t\t<input type=\"file\" name=\"imgAl\">\n\t\t\t\t\t\t\t<br>';\n\n\t\t\t\t\t\t\tif($resultado[\"foto\"] == \"\"){\n\n\t\t\t\t\t\t\t\techo '<img src=\"http://localhost/psicologiaitsur/Vistas/img/defecto.png\" class=\"img-responsive\" width=\"200px\">';\n\n\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\techo '<img src=\"http://localhost/psicologiaitsur/'.$resultado[\"foto\"].'\" class=\"img-responsive\" width=\"200px\">';\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"imgActual\" value=\"'.$resultado[\"foto\"].'\">\n\n\t\t\t\t\t\t\t<br><br>\n\n\t\t\t\t\t\t\t<button type=\"submit\" class=\"btn btn-success\">Guardar Cambios</button>\n\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t</div>\n\n\t\t\t\t</form>';\n\n\t}", "function actualizarDatos(){\n $e = new Empresa();\n \n $e->ruc = $_POST['ruc'];\n\n $imagenName = $_FILES['file']['name']; \n\n if($_POST['nameimage'] ==\"\"){\n\n \n \n //-------- MODIFIED NAME --------------\n $extension = pathinfo($imagenName, PATHINFO_EXTENSION);\n $random = rand(0,99);\n $rename = $random.date('Ymd').$imagenName;\n $newname = $rename;\n //for obtain extension of image .'.'.$extension\n $imageurl = \"./vistas/panel_usuario/logoemp/\" . $newname;\n \n $imagenTemp = $_FILES['file']['tmp_name'];\n move_uploaded_file($imagenTemp, $imageurl);\n //copy($imagenTemp,$imagenUrl);\n }else{\n \n\n $eliminarimage = \"./vistas/panel_usuario/logoemp/\" . $_POST['nameimage'];\n unlink($eliminarimage);\n\n $extension = pathinfo($imagenName, PATHINFO_EXTENSION);\n $random = rand(0,99);\n $rename = $random.date('Ymd').$imagenName;\n $newname = $rename;\n //for obtain extension of image .'.'.$extension\n $imageurl = \"./vistas/panel_usuario/logoemp/\" . $newname;\n \n $imagenTemp = $_FILES['file']['tmp_name'];\n move_uploaded_file($imagenTemp, $imageurl);\n\n }\n //ad in controller \n $e->logo = $newname;\n $e->logoUrl = $imageurl;\n\n $e->emailEmp = str_replace(\" \",\"\",$_POST['email']);\n $e->descripcion = trim($_POST['descripcion']);\n $e->direccion = trim($_POST['direccion']);\n $e->distrito = $_POST['distrito'];\n $e->telefono = $_POST['telefono'];\n $e->whatsapp = $_POST['whatsapp'];\n $e->facebook = trim($_POST['facebook']);\n $e->instagram = trim($_POST['instagram']);\n if (empty($e->descripcion) || empty($e->direccion) || $_POST['departamento'] == '0' || strlen($e->telefono) != 9 || strlen($e->whatsapp) > 9) {\n return ['bool' => false, 'msg' => 'datosIncorrectos'];\n }\n return ($this->modelo->actualizarEmpresa($e)) ?\n $this->modelo->buscarByRuc($e->ruc) :\n ['bool' => true, 'msg' => 'problemaSQL'];\n }", "function modificarAnuncio($titulo, $descripcion, $imagen, $id_poi, $id_usuario) {\n $sql = \"UPDATE anuncio SET titulo='\" . $titulo . \"',descripcion='\" . $descripcion . \"',imagen='\" . $imagen\n . \"' WHERE id_usuario='\" . $id_usuario . \"' AND id_poi='\" . $id_poi . \"'\";\n $con = new DB();\n $result = $con->exec($sql);\n $con = null;\n }", "public function crearArchivoSql($data)\n {\n // el Email y el username a enviar\n $user = $this->getUser();\n $nivelUser = $user->getNivel();\n\n $nombreArchivo = __DIR__.'/../Resources/doc/ArchivoSql.txt';\n if (file_exists($nombreArchivo)) {\n unlink($nombreArchivo);\n } \n $file = fopen($nombreArchivo,\"w\");\n foreach($data as $clave => $generar) {\n if($clave !== 'submit'){\n fputs($file, $clave);\n fputs($file,\"\\n\");\n fputs($file, $generar);\n fputs($file,\"\\n\");\n }\n }\n if($file){\n fclose($file);\n } \n \n return ;\n }", "function editar_pelicula($peliActual){\n // leemos todas las pelis, y las volcamos al fichero menos la pasada como argumento\n\n $lesPelis=readPelis();\n\n // obrim el fitxer de pelis per a escriptura. \n $f = fopen(filePeliculas, \"w\");\n\n foreach($lesPelis as $peli){\n\n // guardem la peli llegida o l'actual, si és el cas\n if ($peli[\"id\"]==$peliActual[\"id\"]){\n $p=$peliActual;\n }\n else{\n $p=$peli;\n }\n\n //convertim $peli (array asociatiu) en array\n\n $valors_peli=array();\n foreach($p as $k=>$v){\n array_push($valors_peli,$v);\n }\n\n //escrivim al fitxer\n fputcsv($f,$valors_peli,\",\");\n\n }\n\n fclose($f);\n \n \n\n}", "public function TutoresPermanentes(){\n if (isset($_FILES['file'])) {\n if (($gestor = fopen($_FILES['file']['tmp_name'], \"r\")) !== FALSE) {\n $coun = 0 ;\n \n\n while (($datos = fgetcsv($gestor, 1000, \";\")) !== FALSE) {\n \n if ($coun!=0) {\n $dato = explode('-',$datos['1']);\n $nombre=$datos['0'];\n $rut = $dato['0'];\n $dv = $dato['1'];\n $email=$datos['2'];\n $area=$datos['3']; \n }\n $coun= $coun + 1;\n fclose($gestor);\n }\n $user = $this->session->userdata('logged_in');\n if(count($user['permisos']) > 0){\n if (in_array(1, $user['permisos'])) {\n redirect('Asesor_Controller/importar','refresh');\n }elseif (in_array(2, $user['permisos'])) {\n redirect('Asistente_Controller/importar','refresh');\n }\n }\n }\n }\n\n }", "public function cargar()\n {\n $resp = false;\n $base = new BaseDatos();\n $sql = \"SELECT * FROM archivocargado WHERE idarchivocargado = \" . $this->getidArchivoCargado();\n if ($base->Iniciar()) {\n $res = $base->Ejecutar($sql);\n if ($res > -1) {\n if ($res > 0) {\n $row = $base->Registro();\n $user = new Usuario();\n $user->setIdUsuario($row['idusuario']);\n $user->cargar();\n $this->setear(\n $row['idarchivocargado'],\n $row['acnombre'],\n $row['acdescripcion'],\n $row['acicono'],\n $user,\n $row['aclinkacceso'],\n $row['accantidaddescarga'],\n $row['accantidadusada'],\n $row['acfechainiciocompartir'],\n $row['acefechafincompartir'],\n $row['acprotegidoclave']\n );\n }\n }\n } else {\n $this->setmensajeoperacion(\"ArchivoCargado->listar: \" . $base->getError());\n }\n return $resp;\n }", "function recuperar_datos() {\n\t\tglobal $nombre, $tipo ;\n\t\t\n\t\t\t$pers_id =(isset($_POST['id_marcas']) && !empty($_POST['id_marcas']))? $_POST['id_marcas']:\"\";\n\t\t\t$tipo =(isset($_POST['tipo']) && !empty($_POST['tipo']))? $_POST['tipo']:\"A\"; \t\n\n\t\t\t$nombre=(isset($_POST[\"nombre\"]) && !empty($_POST[\"nombre\"]))? $_POST[\"nombre\"]:\"\";\t\t\t\n\t\n\t\t}", "function tabla_actores(){\n $fichero = \"bbdd/actores.csv\";\n $array_actores;\n\n //Si existe el fichero lo abrimos para leerlo\n $manejador = fopen($fichero, \"r\");\n if($manejador != FALSE){\n $j=0;\n while(($arrayFila= fgetcsv($manejador, 1000, \",\")) != FALSE){ \n $array_actores[$j] = array(\"id\" => $arrayFila[0], \"nombre\" => $arrayFila[1], \"anyo\" => $arrayFila[2], \"lugar\" => $arrayFila[3]);\n $j++;\n } \n fclose($manejador);\n } \n return $array_actores;\n }", "public function CargarProductos()\n\t{\n\t\tself::SetNames();\n\t\tif(empty($_FILES[\"sel_file\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n //Aquí es donde seleccionamos nuestro csv\n $fname = $_FILES['sel_file']['name'];\n //echo 'Cargando nombre del archivo: '.$fname.' ';\n $chk_ext = explode(\".\",$fname);\n \n if(strtolower(end($chk_ext)) == \"csv\")\n {\n //si es correcto, entonces damos permisos de lectura para subir\n $filename = $_FILES['sel_file']['tmp_name'];\n $handle = fopen($filename, \"r\");\n \n while (($data = fgetcsv($handle, 1000, \";\")) !== FALSE)\n {\n //Insertamos los datos con los valores...\n\t\t\t \n$query = \" insert into productos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $data[0]);\n\t\t$stmt->bindParam(2, $data[1]);\n\t\t$stmt->bindParam(3, $data[2]);\n\t\t$stmt->bindParam(4, $data[3]);\n\t\t$stmt->bindParam(5, $data[4]);\n\t\t$stmt->bindParam(6, $data[5]);\n\t\t$stmt->bindParam(7, $data[6]);\n\t\t$stmt->bindParam(8, $data[7]);\n\t\t$stmt->bindParam(9, $data[8]);\n\t\t$stmt->bindParam(10, $data[9]);\n\t\t$stmt->bindParam(11, $data[10]);\n\t\t$stmt->bindParam(12, $data[11]);\n\t\t$stmt->bindParam(13, $data[12]);\n\t\t$stmt->execute();\n\n\t\t$query = \" insert into kardexproductos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $codproceso);\n\t\t$stmt->bindParam(2, $codresponsable);\n\t\t$stmt->bindParam(3, $codproducto);\n\t\t$stmt->bindParam(4, $movimiento);\n\t\t$stmt->bindParam(5, $entradas);\n\t\t$stmt->bindParam(6, $salidas);\n\t\t$stmt->bindParam(7, $devolucion);\n\t\t$stmt->bindParam(8, $stockactual);\n\t\t$stmt->bindParam(9, $preciounit);\n\t\t$stmt->bindParam(10, $costototal);\n\t\t$stmt->bindParam(11, $documento);\n\t\t$stmt->bindParam(12, $fechakardex);\n\t\t\n\t\t$codproceso = strip_tags($data[0]);\n\t\t$codresponsable = strip_tags(\"0\");\n\t\t$codproducto = strip_tags($data[0]);\n\t\t$movimiento = strip_tags(\"ENTRADAS\");\n\t\t$entradas = strip_tags($data[5]);\n\t\t$salidas = strip_tags(\"0\");\n\t\t$devolucion = strip_tags(\"0\");\n\t\t$stockactual = strip_tags($data[6]);\n\t\t$preciounit = strip_tags($data[4]);\n\t\t$costototal = rount($data[4]*$data[6],2);\n\t\t$documento = strip_tags(\"INVENTARIO INICIAL\");\n\t\t$fechakardex = strip_tags(date(\"Y-m-d\"));\n\t\t$stmt->execute();\n\t\t\t\t\n }\n //cerramos la lectura del archivo \"abrir archivo\" con un \"cerrar archivo\"\n fclose($handle);\n\t \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> LA CARGA MASIVA DE PRODUCTOS FUE REALIZADA EXITOSAMENTE </div>\";\necho \"</div>\";\nexit;\n \n }\n else\n {\n //si aparece esto es posible que el archivo no tenga el formato adecuado, inclusive cuando es cvs, revisarlo para ver si esta separado por \" , \"\n echo \"2\";\n\t\t exit;\n } \n}", "public function ObtenerDat()\n {\n $this->validate([\n 'folio'=>'required'\n ]) ;\n\n $datos = Empleado::where('folio', $this->folio)->first();\n\n if($datos){\n\n $this->nombre= $datos->nombre; \n\n $this->apellido_p= $datos->apellido_p;\n \n $this->apellido_m= $datos->apellido_m;\n \n $this->puesto= $datos->puestos->puesto;\n \n if(!empty($this->imagen)){\n $this->imagen=$datos->imagen->store(\"public\");\n }else{\n $this->imagen= null;\n }\n\n }else{\n\n session()->flash('MensajeD','El empleado no trabaja en este Hotel.');\n\n $this->nombre= ''; \n\n $this->apellido_p= '';\n \n $this->apellido_m= '';\n \n $this->puesto= '';\n \n }\n\n }", "public function subir_datos() {\n $datos = array(\n 'nombre' => $this->helper->cleanInput($_POST['cname']),\n 'email' => $this->helper->cleanInput($_POST['email']),\n 'telefono' => $this->helper->cleanInput($_POST['phone']),\n 'message' => $this->helper->cleanInput($_POST['message'])\n );\n $insert = $this->model->subir_datos($datos);\n $id = $insert['id'];\n #SUBIMOS EL ARCHIVO\n $dir = 'public/archivos/cv/';\n $serverdir = $dir;\n $filename = \"\";\n foreach ($_FILES as $inputname => $file) {\n $newname = $this->helper->cleanUrl($_POST[$inputname . '_name']);\n //$extension = strtolower(end(explode('.', $file['name'])));\n $ext = explode('.', $file['name']);\n $extension = strtolower(end($ext));\n $fname = $id . '_' . $newname . '.' . $extension;\n $contents = file_get_contents($file['tmp_name']);\n\n $handle = fopen($serverdir . $fname, 'w');\n fwrite($handle, $contents);\n fclose($handle);\n\n $filename = $fname;\n var_dump($filename);\n }\n $update = array(\n 'id' => $id,\n 'archivo' => $filename\n );\n $updateTrabaja = $this->model->updateTrabaja($update);\n if (!empty($id)) {\n $data = array(\n 'type' => 'succes',\n 'message' => $this->helper->messageAlert('success', 'Gracias, tu C.V. se ha agregado correctamente a nuestra Base de Datos.')\n );\n } else {\n $data = array(\n 'type' => 'error',\n 'message' => $this->helper->messageAlert('error', 'Lo sentimos ha ocurrido un error, por favor vuelva a intertarlo')\n );\n }\n Session::set('result', $data);\n header('Location: ' . URL . 'trabaja_con_nosotros/');\n }", "protected function cargarDatos($datos)\n {\n $this->setIdposteo($datos['idposteo']);\n $this->setTextoPosteo($datos['texto_posteo']);\n $this->setFechaHora($datos['fecha_hora']);\n $this->setUsuarioIdusuario($datos['usuario_idusuario']);\n $this->setUsuario($datos['usuario_idusuario']);\n $this->setComentarios($datos['idposteo']);\n }", "function admin_insertar_alumno($codigo,$nombres,$apellido_p,$apellido_m,$password,$grado,$nivel,$seccion,$id_padre){\r\n \t//INGRESA UN NUEVO ALUMNO\r\n \t\r\n\t\t\t\t$cn = $this->conexion();\r\n \t\t//$uno=1;\r\n if($cn!=\"no_conexion\"){\r\n\r\n \t$sql=\"select * from $this->nombre_tabla_alumnos where codigo='$codigo'\";\t//VERIFICA Q NO EXISTA OTRO CODIGO IGUAL \r\n\t\t\t $rs = mysql_query($sql,$cn);\r\n\r\n \tif(mysql_num_rows($rs)==0){\r\n\r\n\r\n \t$sql=\"insert into $this->nombre_tabla_alumnos (codigo,nombres,apellido_paterno,apellido_materno,edad,password,disponible,id_padre,grado,nivel,seccion) values ('$codigo','$nombres','$apellido_p','$apellido_m',0,'$password',1,'$id_padre','$grado','$nivel','$seccion')\";\r\n\t\t\t $rs = mysql_query($sql,$cn);\r\n\t\t\techo $sql;\r\n\t\t\tmysql_close($cn);\t\t\t \r\n\t\t\treturn \"mysql_si\";\r\n\r\n\t\t\t}else{\r\n\t\t\t\tmysql_close($cn);\r\n\t\t\t\treturn \"existe\";\r\n\t\t\t}\r\n\t\t\t//mysql_close($cn)\r\n\t\t}else{\r\n\t\treturn \"mysql_no\";\r\n\t\t}\r\n\t}", "public function actualizar() {\n $ord = $this->orden;\n $this->cargarPersonas($ord);\n }", "function adicionaUsuario() {\n $usuarioAtual = array(\n \"usuario\"=>$this->usuario,\n \"senha\"=>$this->senha,\n \"nome\"=>$this->nome,\n \"email\"=>$this->email\n );\n\n $usuarioAtual_str = json_encode($usuarioAtual);\n\n //retira o colchete e coloca a vírgula no arquivo\n $arquivo_str = file_get_contents(\"data/usuarios.json\");\n $arquivo_str_novo = str_replace(\"]\", \",\", $arquivo_str);\n\n //abre o arquivo\n $usuarios = fopen(\"data/usuarios.json\", \"w\"); //sobreescreve\n fwrite($usuarios, $arquivo_str_novo . $usuarioAtual_str . \"]\");\n fclose($usuarios);\n }", "public function CargarDatosPorLegajo($request, $response, $args) {\n $JsonResponse = $response->withJson(false, 400);\n $data = $request->getParsedBody(); \n\n $usuarioRol = isset($data[\"tipo\"])?$data[\"tipo\"]:null;\n $usuarioLegajo = isset($data[\"legajo\"])?$data[\"legajo\"]:null;\n $email = isset($data[\"email\"])?$data[\"email\"]:null;\n \n $elemento = UsuarioDAO::GetById(isset($args[\"legajo\"])? $args[\"legajo\"]:0);\n $elemento->email = isset($data[\"email\"])?$data[\"email\"]:null; \n \n $imagen = isset($_FILES[\"foto\"]) ? $_FILES[\"foto\"] : null;\n $materias = isset($data[\"materias\"])?json_decode($data[\"materias\"]):null;\n\n switch($usuarioRol){\n case \"admin\":\n switch($elemento->tipo){\n case \"alumno\":\n if(UsuarioDAO::UpdateAlumno($elemento, $imagen)){\n $JsonResponse = $response->withJson(true, 200);\n }\n break;\n\n case \"profesor\": \n for($i = 0; $i<count($materias); $i++){ \n $nombreMateria = $materias[$i]->nombre;\n MateriaDAO::AsociarMateriaProfesor($nombreMateria, $elemento->legajo); \n } \n if(UsuarioDAO::UpdateProfesor($elemento->legajo, $email)){\n $JsonResponse = $response->withJson(true, 200);\n } \n break;\n\n default:\n break;\n } \n break;\n\n case \"alumno\":\n if(UsuarioDAO::UpdateAlumno($elemento, $imagen)){\n $JsonResponse = $response->withJson(true, 200);\n }\n break;\n\n case \"profesor\": \n for($i = 0; $i<count($materias); $i++){ \n $nombreMateria = $materias[$i]->nombre;\n MateriaDAO::AsociarMateriaProfesor($nombreMateria, $usuarioLegajo); \n } \n if(UsuarioDAO::UpdateProfesor($usuarioLegajo, $email)){\n $JsonResponse = $response->withJson(true, 200);\n } \n break;\n\n default:\n break;\n } \n \n return $JsonResponse;\n }", "public function store(Request $request)\n {\n\n\n if ($request->hasFile('ruta_foto')) {\n $file = $request->file('ruta_foto');\n $name = $request->id . \"_\" . $request->nombre . \"_\" . $request->apellido_paterno;\n $file->move(public_path() . '/fotos/', $name);\n } else {\n $name = $request->ruta_foto;\n }\n\n\n $cumpleaños = date_create($request->nacimiento);\n $nacimeinto = date_format($cumpleaños, \"d/m/Y\");\n\n\n\n $user = new Alumnos($request->all());\n $user->id = $request->id;\n $user->nombre = strtoupper($request->nombre);\n $user->ap = strtoupper($request->apellido_paterno);\n $user->am = strtoupper($request->apellido_materno);\n $user->nacimiento = $nacimeinto;\n $user->direccion = strtoupper($request->direccion);\n $user->ciudad = strtoupper($request->ciudad);\n $user->ocupacion = strtoupper($request->ocupacion);\n $user->estudios = strtoupper($request->estudios);\n $user->nivel = strtoupper($request->horario);\n $user->casa = strtoupper($request->casa);\n $user->oficina = strtoupper($request->celular);\n $user->celular = strtoupper($request->oficina);\n $user->activo = 1;\n $user->ruta_foto = $name;\n $user->save();\n\n\n\n ///crea el alumno postyerior crea en la tabla de estatus de alumnos por nivel\n $alumxnivel = new Pagos_estatus();\n $alumxnivel->id_usuario = $user->id;\n $alumxnivel->id_nivel = $request->horario;\n $alumxnivel->estatus_c = 0;\n $alumxnivel->save();\n\n $hoy = Carbon::now();\n $today = $hoy->format('Y-m-d');\n $monthactual = $hoy->format('m');\n\n //sacar meses\n $input = date($request->nacimiento);\n $date2 = Carbon::parse($input);\n $date = $date2->format('Y-m-d');\n $edad = Carbon::createFromDate($date)->age;\n\n //calculando meses de nivel\n $nivel = Nivel::find($request->horario);\n $start = date($nivel->finicio);\n $inicio = 'd/m/Y';\n\n $end = date($nivel->ffin);\n $fin = 'd/m/Y';\n\n $finicio = Carbon::createFromFormat($inicio, $start);\n $ffin = Carbon::createFromFormat($fin, $end);\n\n $primer_pago = Carbon::createFromFormat('d/m/Y', $nivel->finicio)->format('m');\n $ultimo_pago = Carbon::createFromFormat('d/m/Y', $nivel->ffin)->format('m');\n\n $meses = $finicio->diffInMonths($ffin) + 1;\n\n $inscripcionR = $request->inscripcion;\n $colegiaturaR = $request->colegiatura;\n $letras = $this->convertir($request->colegiatura);\n\n $pdf = PDF::loadView('pdf.fichaInscripcion', ['user' => $user, 'meses' => $meses, 'edad' => $edad, 'colegiatura' => $colegiaturaR, 'inscripcion' => $inscripcionR, 'letras' => $letras]);\n\n //datos necesarios para algortitmo de pago\n $nivelP = Nivel::find($request->horario);\n $abono = $request->colegiatura;\n $colegiatura = $nivelP->costo;\n $CostoC = $meses * $colegiatura;\n\n\n\n\n ///////////////////////////////////////////////////////////////////////////////////// pago nuevo\n //si se marca casilla familair directo\n if ($request->familiard == 1) {\n $this->inscripcion(500, $monthactual, $today, $request->id, $request->horario);\n if ($abono == null) {\n } else {\n $this->abono($abono, $monthactual, $today, $request->id, $request->horario, $CostoC, $primer_pago, $ultimo_pago, $colegiatura);\n }\n } else {\n // si inscripcion y colegiatura estan vacios\n if ($inscripcionR == null) {\n $this->inscripcion(0, $monthactual, $today, $request->id, $request->horario);\n } else {\n $this->inscripcion($inscripcionR, $monthactual, $today, $request->id, $request->horario);\n }\n //si no se captura colegiatura\n if ($abono == null) {\n } else {\n $this->abono($abono, $monthactual, $today, $request->id, $request->horario, $CostoC, $primer_pago, $ultimo_pago, $colegiatura);\n }\n }\n /////////////////////////////////////////////////////////////////////////// pago anterior \n //pagos inscripcion y colegiatura\n //si abono es menor o igual al total del curso \n // if($abono <= $CostoC){ \n // //si el curso ya empezo paga el mes que entra\n // if($primer_pago >= $monthactual){\n // //si marcan la casilla familiar directo\n // if($request->familiard == 1){\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 1,\n // 'monto' => 500,\n // 'mes' => $primer_pago,\n // 'tipo' => 1]\n // );\n\n // //metodo propuesto si tiene colegiatura\n // //si el abono es menor a la colegiatura\n // if($abono != null || $abono == \"null\"){\n // if($abono < $colegiatura ){\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 2,\n // 'monto' => $abono,\n // 'mes' => $primer_pago,\n // 'tipo' => 2]); \n // }else{\n // //si el abono es entero \n // if(is_int($abono/$colegiatura) == true){\n // $mesesApagar = $abono/$colegiatura;\n\n // for ($i=0; $i < $mesesApagar ; $i++) { \n // $aux = 0;\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 1,\n // 'monto' => 500,\n // 'mes' => $primer_pago+$i,\n // 'tipo' => 2]);\n // $aux++;\n // }\n // }else{\n // //si no es entero saca los enteros y el residuo del saldo\n // $mesesApagarC= explode(\".\", $abono/$colegiatura);\n // $numeroMeses = $mesesApagarC[0]+1;\n\n // for ($i=0; $i < $numeroMeses; $i++) { \n // if($i == ($numeroMeses-1)){\n // $residuo = $abono%$colegiatura;\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 2,\n // 'monto' => $residuo,\n // 'mes' => $primer_pago+($numeroMeses-1),\n // 'tipo' => 2]);\n // } else{\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 1,\n // 'monto' => 500,\n // 'mes' => $primer_pago+$i,\n // 'tipo' => 2]); \n // }\n\n // } \n\n // }\n // }\n // }\n\n\n // // if($request->colegiatura != null || $request->colegiatura != \"\"){\n // // if($request->colegiatura == 500){\n // // Pagos::create(\n // // ['id_usuario' => $request->id,\n // // 'id_nivel' => $request->horario,\n // // 'fecha_pago' => $today,\n // // 'estatus' => 1,\n // // 'monto' => 500,\n // // 'mes' => $primer_pago,\n // // 'tipo' => 2]);\n // // }else{\n // // Pagos::create(\n // // ['id_usuario' => $request->id,\n // // 'id_nivel' => $request->horario,\n // // 'fecha_pago' => $today,\n // // 'estatus' => 2,\n // // 'monto' => $request->colegiatura,\n // // 'mes' => $primer_pago,\n // // 'tipo' => 2]);\n // // } \n // // }\n\n // }else{\n // if($request->inscripcion != null || $request->inscripcion != \"\"){\n // if($request->inscripcion == 500){\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 1,\n // 'monto' => 500,\n // 'mes' => $primer_pago,\n // 'tipo' => 1]);\n // }else{\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 2,\n // 'monto' => $request->inscripcion,\n // 'mes' => $primer_pago,\n // 'tipo' => 1]);\n // }\n // }\n // // if($request->colegiatura != null || $request->colegiatura != \"\"){\n // // if($request->colegiatura == 500){\n // // Pagos::create(\n // // ['id_usuario' => $request->id,\n // // 'id_nivel' => $request->horario,\n // // 'fecha_pago' => $today,\n // // 'estatus' => 1,\n // // 'monto' => 500,\n // // 'mes' => $primer_pago,\n // // 'tipo' => 2]);\n // // }else{\n // // Pagos::create(\n // // ['id_usuario' => $request->id,\n // // 'id_nivel' => $request->horario,\n // // 'fecha_pago' => $today,\n // // 'estatus' => 2,\n // // 'monto' => $request->colegiatura,\n // // 'mes' => $primer_pago,\n // // 'tipo' => 2]);\n // // } \n // // } \n\n // //metodo propuesto si se llena abono si no no hace nada\n // if($abono != null || $abono != \"\" ){\n // if($abono < $colegiatura ){\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 2,\n // 'monto' => $abono,\n // 'mes' => $primer_pago,\n // 'tipo' => 2]); \n // }else{\n // if(is_int($abono/$colegiatura) == true){\n // $mesesApagar = $abono/$colegiatura;\n\n // for ($i=0; $i < $mesesApagar ; $i++) { \n // $aux = 0;\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 1,\n // 'monto' => 500,\n // 'mes' => $primer_pago+$i,\n // 'tipo' => 2]);\n // $aux++;\n // }\n // }else{\n\n // $mesesApagarC= explode(\".\", $abono/$colegiatura);\n // $numeroMeses = $mesesApagarC[0]+1;\n\n // for ($i=0; $i < $numeroMeses; $i++) { \n // if($i == ($numeroMeses-1)){\n // $residuo = $abono%$colegiatura;\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 2,\n // 'monto' => $residuo,\n // 'mes' => $primer_pago+($numeroMeses-1),\n // 'tipo' => 2]);\n // }else{\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 1,\n // 'monto' => 500,\n // 'mes' => $primer_pago+$i,\n // 'tipo' => 2]); \n // }\n\n // } \n // }\n // }\n // }//fin metodo propuesto\n // }\n // }\n // else{\n // //si paga despues del mes que empieza\n // if($request->familiard == 1){\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 1,\n // 'monto' => 500,\n // 'mes' => $hoy->format('m'),\n // 'tipo' => 1]\n // );\n\n // //metodo propuesto\n // if($abono < $colegiatura ){\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 2,\n // 'monto' => $abono,\n // 'mes' => $hoy->format('m'),\n // 'tipo' => 2]); \n // }else{\n // if(is_int($abono/$colegiatura) == true){\n // $mesesApagar = $abono/$colegiatura;\n\n // for ($i=0; $i < $mesesApagar ; $i++) { \n // $aux = 0;\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 1,\n // 'monto' => 500,\n // 'mes' => $hoy->format('m')+$i,\n // 'tipo' => 2]);\n // $aux++;\n // }\n // }else{\n\n // $mesesApagarC= explode(\".\", $abono/$colegiatura);\n // $numeroMeses = $mesesApagarC[0]+1;\n\n // for ($i=0; $i < $numeroMeses; $i++) { \n // if($i == ($numeroMeses-1)){\n // $residuo = $abono%$colegiatura;\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 2,\n // 'monto' => $residuo,\n // 'mes' => $hoy->format('m')+($numeroMeses-1),\n // 'tipo' => 2]);\n // } else{\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 1,\n // 'monto' => 500,\n // 'mes' => $hoy->format('m')+$i,\n // 'tipo' => 2]); \n // }\n\n // } \n\n // }\n // }\n // // if($request->colegiatura != null || $request->colegiatura != \"\"){\n // // if($request->colegiatura == 500){\n // // Pagos::create(\n // // ['id_usuario' => $request->id,\n // // 'id_nivel' => $request->horario,\n // // 'fecha_pago' => $today,\n // // 'estatus' => 1,\n // // 'monto' => 500,\n // // 'mes' => $hoy->format('m'),\n // // 'tipo' => 2]);\n // // }else{\n // // Pagos::create(\n // // ['id_usuario' => $request->id,\n // // 'id_nivel' => $request->horario,\n // // 'fecha_pago' => $today,\n // // 'estatus' => 2,\n // // 'monto' => $request->colegiatura,\n // // 'mes' => $hoy->format('m'),\n // // 'tipo' => 2]);\n // // } \n // // }\n\n // }else{\n // if($request->inscripcion != null || $request->inscripcion != \"\"){\n // if($request->inscripcion == 500){\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 1,\n // 'monto' => 500,\n // 'mes' => $hoy->format('m'),\n // 'tipo' => 1]);\n // }else{\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 2,\n // 'monto' => $request->inscripcion,\n // 'mes' => $hoy->format('m'),\n // 'tipo' => 1]);\n // }\n // }\n // // if($request->colegiatura != null || $request->colegiatura != \"\"){\n // // if($request->colegiatura == 500){\n // // Pagos::create(\n // // ['id_usuario' => $request->id,\n // // 'id_nivel' => $request->horario,\n // // 'fecha_pago' => $today,\n // // 'estatus' => 1,\n // // 'monto' => 500,\n // // 'mes' => $hoy->format('m'),\n // // 'tipo' => 2]);\n // // }else{\n // // Pagos::create(\n // // ['id_usuario' => $request->id,\n // // 'id_nivel' => $request->horario,\n // // 'fecha_pago' => $today,\n // // 'estatus' => 2,\n // // 'monto' => $request->colegiatura,\n // // 'mes' => $hoy->format('m'),\n // // 'tipo' => 2]);\n // // } \n // // } \n // //metodo propuesto\n // if($abono < $colegiatura ){\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 2,\n // 'monto' => $abono,\n // 'mes' => $primer_pago,\n // 'tipo' => 2]); \n // }else{\n // if(is_int($abono/$colegiatura) == true){\n // $mesesApagar = $abono/$colegiatura;\n\n // for ($i=0; $i < $mesesApagar ; $i++) { \n // $aux = 0;\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 1,\n // 'monto' => 500,\n // 'mes' => $primer_pago+$i,\n // 'tipo' => 2]);\n // $aux++;\n // }\n // }else{\n\n // $mesesApagarC= explode(\".\", $abono/$colegiatura);\n // $numeroMeses = $mesesApagarC[0]+1;\n\n // for ($i=0; $i < $numeroMeses; $i++) { \n // if($i == ($numeroMeses-1)){\n // $residuo = $abono%$colegiatura;\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 2,\n // 'monto' => $residuo,\n // 'mes' => $primer_pago+($numeroMeses-1),\n // 'tipo' => 2]);\n // }else{\n // Pagos::create(\n // ['id_usuario' => $request->id,\n // 'id_nivel' => $request->horario,\n // 'fecha_pago' => $today,\n // 'estatus' => 1,\n // 'monto' => 500,\n // 'mes' => $primer_pago+$i,\n // 'tipo' => 2]); \n // }\n // } \n // }\n // } \n // } \n // }\n // }else{\n // return back();\n // }\n //////////////////////////////////////////////////////////////////fin pago anterior\n\n return $pdf->stream();\n }", "public function crearusuarios($nombre,$primer_apellido,$segundo_apellido,$fechanacimento,$email,$telefono,$password,$comprobacion,$alias,$foto)\n { //busca en la tabla usuarios los campos donde el alias sea igual a admin si no encuentra nada devuelve null\n $usuarios = R::findOne('usuarios', 'alias=?', [\n $alias\n ]);\n \n \n // ok es igual a true siempre y cuando usuarios sea distinto de null\n $ok = ($usuarios == null );\n if ($ok) {\n // crea la tabla usuarios\n $usuarios = R::dispense('usuarios');\n //crea los campos de la tabla usuarios\n $usuarios->nombre=$nombre;\n $usuarios->primer_apellido=$primer_apellido;\n $usuarios->segundo_apellido=$segundo_apellido;\n $usuarios->fecha_nacimiento=$fechanacimento;\n $usuarios->fecha_de_registro=date('Y-m-d');\n $usuarios->email=$email;\n $usuarios->telefono=$telefono;\n $usuarios->contrasena=password_hash($password, PASSWORD_DEFAULT);\n $usuarios->confirmar_contrasena=password_hash($comprobacion, PASSWORD_DEFAULT);\n $usuarios->alias=$alias;\n //verifico si las fotos exiten en el directorio assets/fotosperfil\n $sustitutuirespaciosblancos = str_replace(\" \",\"_\",$alias);\n $directorio = \"assets/fotosperfil/usuario-\".$sustitutuirespaciosblancos.\".png\";\n \n $existefichero = is_file( $directorio );\n //si la foto exite se guarda en la base de datos se guarda el campo extension como png si la foto no exite se guarda como null\n if($foto!=null){\n \n if ( $existefichero==true ){\n $extension=\"png\";\n }else{\n \n \n \n \n \n \n \n }}\n $usuarios->foto = $extension;\n //almacena los datos en la tabla usuarios\n R::store($usuarios);\n \n \n //rdirege al controlador principal\n redirect(base_url());\n \n \n }\n \n }", "public function Tutores(){\n if (isset($_FILES['file'])) {\n if (($gestor = fopen($_FILES['file']['tmp_name'], \"r\")) !== FALSE) {\n $coun = 0 ;\n\n while (($datos = fgetcsv($gestor, 1000, \";\")) !== FALSE) {\n if ($coun!=0) { \n $dato = explode('-',$datos['9']);\n $rut = $dato['0'];\n $dv = $dato['1'];\n $tutor=$datos['10'];\n $asignatura=$datos['11']; \n }\n $coun= $coun + 1;\n fclose($gestor);\n\n }\n $user = $this->session->userdata('logged_in');\n if(count($user['permisos']) > 0){\n if (in_array(1, $user['permisos'])) {\n redirect('Asesor_Controller/importar','refresh');\n }elseif (in_array(2, $user['permisos'])) {\n redirect('Asistente_Controller/importar','refresh');\n }\n }\n }\n }\n }", "public function run()\n {\n $data = new Alumno();\n $data->codigo = \"0001\";\n $data->primer_nombre = \"Gabriela\";\n $data->segundo_nombre = \"Eunice\";\n $data->tercer_nombre = \"\";\n $data->primer_apellido = \"Gaitan\";\n $data->segundo_apellido = \"Rivas\";\n $data->fecha_nac = \"1998-01-06\";\n $data->genero = \"F\";\n $data->telefono = \"57896754\";\n $data->email = \"[email protected]\";\n $data->direccion = \"Barrio san sebastian, Guazacapan Santa Rosa\";\n $data->save();\n\n $data_p = new Apoderado();\n $data_p->cui = \"123215456987\";\n $data_p->primer_nombre = \"Ruth\";\n $data_p->segundo_nombre = \"\";\n $data_p->primer_apellido = \"Rivas\";\n $data_p->segundo_apellido = \"\";\n $data_p->fecha_nac = \"1980-03-25\";\n $data_p->email = \"\";\n $data_p->direccion = \"Barrio san sebastian, Guazacapan Santa Roa\";\n $data_p->municipio_id = 1;\n $data_p->nacionalidad = \"Guatemalteco\";\n $data_p->estado_civil = 'Casado';\n $data_p->nit = '789563-7';\n $data_p->save();\n\n TelefonoApoderado::create([\n 'tipo_telefono' => 'P',\n 'telefono' => \"55776655\",\n 'apoderado_id' => $data_p->id\n ]);\n\n ApoderadoAlumno::create([\n 'apoderado_id' => $data_p->id,\n 'alumno_id' => $data->id,\n 'responsable' => true,\n 'tipo_apoderado' => 'M'\n ]);\n }", "function guardarAlumno($al){\n $alDAO = new AlumnoDAO();\n $alDAO->guardarAlumno($al);\n }", "public function AltaPersonal(string $operacion, array $datos = null, array $where = null) {\r\n //var_dump($datos);\r\n $archivos = null;\r\n $CI = parent::getCI();\r\n //Inserta en la tabla\r\n if ($operacion === '1') {\r\n $nombres = conversionPalabra($datos['nombre']);\r\n $apellidoPaterno = conversionPalabra($datos['paterno']);\r\n $apellidoMaterno = conversionPalabra($datos['materno']);\r\n $nombreCompleto = $nombres . \" \" . $apellidoPaterno . \" \" . $apellidoMaterno;\r\n date_default_timezone_set('America/Mexico_City');\r\n $horaCaptura = mdate('%H:%i:%s', now('America/Mexico_City'));\r\n $fechaCaptura = mdate('%Y-%m-%d %H:%i:%s', now('America/Mexico_City'));\r\n $password = $this->generarPassword();\r\n $usuario = substr($apellidoPaterno, 0, 2) . substr($apellidoMaterno, 0, 2) . substr($nombres, 0, 4);\r\n $varificarCorreo = $this->DBU->verficarDatoRepetido('cat_v3_usuarios', array('Email' => $datos['email']));\r\n $varificarCorreoCorporativo = $this->DBU->verficarDatoRepetido('cat_v3_usuarios', array('EmailCorporativo' => $datos['email']));\r\n if ($varificarCorreo === false) {\r\n return 'correo';\r\n } else if ($varificarCorreoCorporativo === false) {\r\n return 'correoCorporativo';\r\n }\r\n $verificarUsuario = $this->DBU->verficarDatoRepetido('cat_v3_usuarios', array('Usuario' => $usuario));\r\n if ($verificarUsuario === false) {\r\n $usuario = $usuario . chr(rand(ord(\"a\"), ord(\"m\")));\r\n }\r\n $idPersonal = $this->DBU->setAltaPersonal('cat_v3_usuarios', 't_rh_personal', array(\r\n 'Usuario' => strtoupper($usuario),\r\n 'Password' => md5($password),\r\n 'IdPerfil' => $datos['perfil'],\r\n 'Nombre' => $datos['nombre'],\r\n 'Email' => trim($datos['email']),\r\n 'IdJefe' => $datos['idJefe'],\r\n 'Flag' => '1'\r\n ), array(\r\n 'ApPaterno' => $apellidoPaterno,\r\n 'ApMaterno' => $apellidoMaterno,\r\n 'Nombres' => $nombres,\r\n 'Tel1' => $datos['movil'],\r\n 'Tel2' => $datos['fijo'],\r\n 'FechaNacimiento' => $datos['fechaNacimiento'],\r\n 'CURP' => $datos['curp'],\r\n 'RFC' => $datos['rfc'],\r\n 'FechaAlta' => $datos['fechaIngreso'],\r\n 'NSS' => $datos['noSeguroSocial'],\r\n 'FechaCaptura' => $fechaCaptura,\r\n 'HoraCaptura' => $horaCaptura\r\n ),\r\n //string para guardar el IdUsuario en la tabla t_rh_personal\r\n 'IdUsuario'\r\n );\r\n if (!empty($_FILES)) {\r\n $carpeta = 'fotoPersonal/' . $idPersonal . '/';\r\n $archivos = setMultiplesArchivos($CI, 'fotoPersonal', $carpeta);\r\n if ($archivos) {\r\n $archivos = implode(',', $archivos);\r\n $this->DBU->insertarFoto(array(\r\n 'UrlFoto' => $archivos\r\n ), array('Id' => $idPersonal)\r\n );\r\n }\r\n }\r\n $_FILES = null;\r\n $this->mandarNotificacionSolicitud($nombreCompleto);\r\n $titulo = 'Se creó tu cuenta en AdIST';\r\n $texto = '<b>Hola ' . $nombres . ' ' . $apellidoPaterno . ',</b><br><br>Tu usuario es: <b>' . strtoupper($usuario) . '</b><br>Tu password es: <b>' . $password . '</b><br><br>Haz click <a title=\"Siccob Solitions\" href=\"http://siccob.solutions/\">aqui</a>&nbsp;para acceder al sistema.';\r\n $mensaje = $this->Correo->mensajeCorreo($titulo, $texto);\r\n $this->Correo->enviarCorreo('[email protected]', array($datos['email']), $titulo, $mensaje);\r\n return $this->AltaPersonal('3');\r\n }\r\n //Actualiza en la tabla resumen personal\r\n elseif ($operacion === '2') {\r\n $varificarCorreo = $this->DBU->getPersonal('SELECT Id FROM cat_v3_usuarios WHERE Email = \"' . $datos['email'] . '\" AND Id <> \"' . $datos['id'] . '\"');\r\n $existeCorreoCorporativo = $this->DBU->getPersonal('SELECT Id FROM cat_v3_usuarios WHERE EmailCorporativo = \"' . $datos['email'] . '\" AND Id <> \"' . $datos['id'] . '\"');\r\n if (empty($varificarCorreo)) {\r\n if (empty($existeCorreoCorporativo)) {\r\n $consulta = $this->DBU->ActualizarPersonal('t_rh_personal', array(\r\n 'ApPaterno' => $datos['paterno'],\r\n 'ApMaterno' => $datos['materno'],\r\n 'Nombres' => $datos['nombre'],\r\n 'FechaNacimiento' => $datos['fechaNacimiento'],\r\n 'Tel1' => $datos['movil'],\r\n 'Tel2' => $datos['fijo'],\r\n 'CURP' => $datos['curp'],\r\n 'NSS' => $datos['noSeguroSocial'],\r\n 'RFC' => $datos['rfc'],\r\n 'FechaAlta' => $datos['fechaNacimiento'],\r\n ), array(\r\n 'Id' => $datos['id']\r\n ));\r\n $consulta = $this->DBU->ActualizarPersonal('cat_v3_usuarios', array(\r\n 'IdPerfil' => $datos['idPerfil'],\r\n 'Nombre' => $datos['nombre'],\r\n 'Email' => trim($datos['email']),\r\n 'IdJefe' => $datos['idJefe'],\r\n ), array(\r\n 'Id' => $datos['usuario']\r\n ));\r\n if (!empty($_FILES)) {\r\n $carpeta = 'fotoPersonal/' . $datos['id'] . '/';\r\n $archivos = setMultiplesArchivos($CI, 'fotoActualizarPersonal', $carpeta);\r\n if ($archivos) {\r\n $archivos = implode(',', $archivos);\r\n $this->DBU->insertarFoto(array(\r\n 'UrlFoto' => $archivos\r\n ), array('Id' => $datos['id'])\r\n );\r\n }\r\n }\r\n return $this->AltaPersonal('3');\r\n } else {\r\n return FALSE;\r\n }\r\n } else {\r\n return FALSE;\r\n }\r\n }\r\n //Obtiene Informacion \r\n elseif ($operacion === '3') {\r\n return $this->DBU->getPersonal('SELECT a.*, b.Email, c.Nombre as Perfil, d.Id AS IdDepartamento, d.Nombre AS Departamento, e.Id AS IdArea, e.Nombre AS Area, f.IdEstatus FROM t_rh_personal a\r\n INNER JOIN cat_v3_usuarios b ON b.Id = a.IdUsuario \r\n INNER JOIN cat_perfiles c ON b.IdPerfil = c.Id \r\n INNER JOIN cat_v3_departamentos_siccob d ON c.IdDepartamento = d.Id \r\n INNER JOIN adist3_prod.cat_v3_areas_siccob e ON d.IdArea = e.Id\r\n LEFT JOIN t_altas_bajas_personal f ON f.IdPersonal = b.Id');\r\n }\r\n //Obtiene datos para mandar al modal Actualizar Personal \r\n elseif ($operacion === '4') {\r\n $data = array();\r\n $data['areas'] = $this->Catalogo->catAreas('3', array('Flag' => '1'));\r\n $data['departamentos'] = $this->Catalogo->catDepartamentos('3', array('Flag' => '1'));\r\n $data['perfiles'] = $this->Catalogo->catPerfiles('3');\r\n $data['infocatV3Usuarios'] = $this->Catalogo->catConsultaGeneral('select Id,nombreUsuario(Id)as Nombre from cat_v3_usuarios where Flag = 1 AND Id > 1 ORDER BY Nombre ASC');\r\n $data['paises'] = $this->Catalogo->catLocalidades('1');\r\n $data['estadoCivil'] = $this->Catalogo->catRhEdoCivil('3', array('Flag' => '1'));\r\n $data['sexo'] = $this->Catalogo->catRhSexo('3', array('Flag' => '1'));\r\n $data['nivelEstudio'] = $this->Catalogo->catRhNivelEstudio('3', array('Flag' => '1'));\r\n $data['documentosEstudio'] = $this->Catalogo->catRhDocumentosEstudio('3', array('Flag' => '1'));\r\n $data['habilidadesIdioma'] = $this->Catalogo->catRhHabilidadesIdioma('3', array('Flag' => '1'));\r\n $data['habilidadesSoftware'] = $this->Catalogo->catRhHabilidadesSoftware('3', array('Flag' => '1'));\r\n $data['nivelHabilidades'] = $this->Catalogo->catRhNivelHabilidad('3', array('Flag' => '1'));\r\n $data['habilidadesSistema'] = $this->Catalogo->catRhHabilidadesSistema('3', array('Flag' => '1'));\r\n\r\n if (!empty($datos['id'])) {\r\n $data['idArea'] = $this->Catalogo->catConsultaGeneral('SELECT e.Id as Area FROM t_rh_personal a INNER JOIN cat_v3_usuarios b ON b.Id = a.IdUsuario INNER JOIN cat_perfiles c ON b.IdPerfil = c.Id INNER JOIN cat_v3_departamentos_siccob d on c.IdDepartamento = d.Id INNER JOIN cat_v3_areas_siccob e ON d.IdArea = e.Id where a.id = ' . $datos['id']);\r\n $data['idDepartamento'] = $this->Catalogo->catConsultaGeneral('SELECT d.Id FROM t_rh_personal a INNER JOIN cat_v3_usuarios b ON b.Id = a.IdUsuario INNER JOIN cat_perfiles c ON b.IdPerfil = c.Id INNER JOIN cat_v3_departamentos_siccob d ON c.IdDepartamento = d.Id INNER JOIN cat_v3_areas_siccob e ON d.IdArea = e.Id where a.id = ' . $datos['id']);\r\n $data['idPerfil'] = $this->Catalogo->catConsultaGeneral('SELECT b.IdPerfil FROM t_rh_personal a INNER JOIN cat_v3_usuarios b ON b.Id = a.IdUsuario INNER JOIN cat_perfiles c ON b.IdPerfil = c.Id INNER JOIN cat_v3_departamentos_siccob d ON c.IdDepartamento = d.Id INNER JOIN cat_v3_areas_siccob e ON d.IdArea = e.Id where a.id = ' . $datos['id']);\r\n $data['urlFoto'] = $this->DBU->getPersonal('SELECT UrlFoto FROM t_rh_personal WHERE id = ' . $datos['id']);\r\n $data['datosPersonal'] = $this->DBU->getPersonal('SELECT * FROM t_rh_personal WHERE id = ' . $datos['id']);\r\n $data['consultaV3Usuarios'] = $this->DBU->getPersonal('SELECT IdJefe FROM cat_v3_usuarios WHERE id = ' . $datos['id']);\r\n $data['datosAcademicos'] = $this->DBU->consultaTRHAcademicos(array('IdUsuario' => $datos['id']));\r\n $data['datosConduccion'] = $this->DBU->consultaTRHConduccion(array('IdUsuario' => $datos['id']));\r\n $data['datosIdiomas'] = $this->DBU->consultaTRHIdiomas(array('IdUsuario' => $datos['id']));\r\n $data['datosSoftware'] = $this->DBU->consultaTRHSoftware(array('IdUsuario' => $datos['id']));\r\n $data['datosSistemas'] = $this->DBU->consultaTRHSistemas(array('IdUsuario' => $datos['id']));\r\n $data['datosDependientes'] = $this->DBU->consultaTRHDependientes(array('IdUsuario' => $datos['id']));\r\n }\r\n return array('formulario' => parent::getCI()->load->view('RH/Modal/Alta_Personal', $data, TRUE), 'datos' => $data);\r\n }\r\n }", "public function enfocarCamaraAlumnos1() {\n\n self::$alumnos1->enfocar();\n\n }", "function insertEmpresa($con,$nick,$logo,$dir,$txt){\n\t\t\n\t\t\n\t\t$nick =mysqli_real_escape_string($con,$nick); \n\t\t$dir =mysqli_real_escape_string($con,$dir); \n\t\t//$logo=file_get_contents($logo);\n\t\tif ($stmt = mysqli_prepare($con,\"INSERT INTO empresa (nick , logo ,dir,descrip) VALUES (? , ? , ? , ?)\") ){\n\n\t\t\t /* ligar parámetros para marcadores, sss-> string ,string, string, rellena los ? en el orden que se ponen */\n\t\t\t mysqli_stmt_bind_param($stmt, \"ssss\", $nick,$logo,$dir,$txt);\n\n\t\t\t /* ejecutar la consulta */\n\t\t\t $res=mysqli_stmt_execute($stmt);\n\t\t\t //echo $res; \n\t\t\t /* cerrar sentencia */\n\t\t\t\tmysqli_stmt_close($stmt);\n\t\t\t\tif($res==1){//1 = exito\n\t\t\t \t//infoAds2($nick);\n\t\t\t }else throw new Exception('Problem to connect the DB 2 '); \n\t\t}else throw new Exception('Problem to connect the DB ');\t\t\n}", "static public function ctrEditarUsuario()\n\t{\n\t\tif(isset($_POST['editarUsuario']))\n\t\t{\n\t\t\t//vamos a permitir caracteres especiales con tilde,espacio en blanco y numericos con expresion regular\n\t\t\t// vamos a solo editar el nombre del usuario y no usuario para evitar crear carpeta basura en img/usuarios\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓü ]+$/', $_POST['editarNombre']))\n\t\t\t{\n\t\t\t\t/*=============================================\n\t\t\t\t\t\t\tVALIDAR IMAGEN\n\t\t\t\t=============================================*/\n\n\t\t\t\t// recuperamos la ruta de la imagen del input oculto\n\t\t\t\t$ruta = $_POST['fotoActual'];\n\n\t\t\t\t// si existe la variable $_FILE(en nuestro caso siempre existe) y viene diferente a vacio el archivo temporal de la imagen\n\t\t\t\tif(isset($_FILES['editarFoto']['tmp_name']) && !empty($_FILES['editarFoto']['tmp_name']))\n\t\t\t\t// if(isset($_FILES['editarFoto']['tmp_name']))\n\t\t\t\t{\n\t\t\t\t\t// vamos a recortar la imagen 500 x 500 px\n\n\t\t\t\t\t// list — Asignar variables como si fueran un array\n\t\t\t\t\t// getimagesize — Obtener el tamaño de una imagen\n\t\t\t\t\t//en list() toma el indice 0 de [nuevaFoto][tmp_name](los indice del archivo temporal son medidas de la imagen) y asigna a $ancho y el indice 1 asigna a $alto \n\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES['editarFoto']['tmp_name']);\n\n\t\t\t\t\t// redimensionamos\n\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t// creamos la ruta donde se va a guardar la imagen\n\t\t\t\t\t$directorio = 'vistas/img/usuarios/'.$_POST['editarUsuario'];\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/*====================================================================\n\t\t\t\t\tPRIMERO PREGUNTAMOS SI EXISTE LA IMAGEN EN LA BD \n\t\t\t\t\t======================================================================*/\n\t\t\t\t\t\n\t\t\t\t\t// si la ruta de la db es diferente a vacio \n\t\t\t\t\tif(!empty($_POST['fotoActual']))\n\t\t\t\t\t{\n\t\t\t\t\t\t// unlink — Borra un fichero\n\t\t\t\t\t\t// vamos a borrar ese archivo en esa carpeta\n\t\t\t\t\t\t// console.log('foto actual');\n\t\t\t\t\t\tunlink($_POST['fotoActual']);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// en caso de que venga vacio, vamos a crear el directorioo carpeta\n\t\t\t\t\t\tmkdir($directorio, 0755);\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\t/*====================================================================\n\t\t\t\t\tDEACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP \n\t\t\t\t\t======================================================================*/\n\n\t\t\t\t\tif($_FILES['editarFoto']['type'] == \"image/jpeg\")\n\t\t\t\t\t{\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\tGUARDAR LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t// le damos nombre a la imagen , y puede ser un nro aleaterio del 100 al 999\n\t\t\t\t\t\t$ruta = \"vistas/img/usuarios/\".$_POST['editarUsuario'].\"/\".$aleatorio.\".jpg\";\n\n\t\t\t\t\t\t// imagecreatefromjpeg — Crea una nueva imagen a partir de un fichero o de una URL\n\t\t\t\t\t\t// imagecreatefromjpeg() devuelve un identificador de imagen que representa la imagen obtenida desde el nombre de fichero dado.\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES['editarFoto']['tmp_name']);\n\n\t\t\t\t\t\t// imagecreatetruecolor — Crear una nueva imagen de color verdadero\n\t\t\t\t\t\t// imagecreatetruecolor() devuelve un identificador de imagen que representa una imagen en negro del tamaño especificado.\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\n\t\t\t\t\t\t// imagecopyresized — Copia y cambia el tamaño de parte de una imagen\n\t\t\t\t\t\t// imagecopyresized() copia una porción de una imagen a otra imagen. dst_image es la imagen de destino, src_image es el identificador de la imagen de origen.\n\t\t\t\t\t\t// imagecopyresized(resource $dst_image(destino) , resource $src_image(origen) , int $dst_x(eje x izq) , int $dst_y(eje y up) , int $src_x(desde donde el corte) , int $src_y(dese el eje y) , int $dst_w(ancho de corte) , int $dst_h(alto de corte) , int $src_w(ancho de original) , int $src_h(alto original) )\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\t// imagejpeg — Exportar la imagen al navegador o a un fichero\n\t\t\t\t\t\t// imagejpeg() crea un archivo JPEG desde image.\n\t\t\t\t\t\t// $destino es donde quedo la foto recortada\n\t\t\t\t\t\t//$ruta donde vmos a guardar la foto \n\t\t\t\t\t\timagejpeg($destino, $ruta);\n\t\t\t\t\t}\n\n\t\t\t\t\tif($_FILES['editarFoto']['type'] == \"image/png\")\n\t\t\t\t\t{\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\tGUARDAR LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t// le damos nombre a la imagen , y puede ser un nro aleaterio del 100 al 999\n\t\t\t\t\t\t$ruta = \"vistas/img/usuarios/\".$_POST['editarUsuario'].\"/\".$aleatorio.\".png\";\n\n\t\t\t\t\t\t// imagecreatefromjpeg — Crea una nueva imagen a partir de un fichero o de una URL\n\t\t\t\t\t\t// imagecreatefromjpeg() devuelve un identificador de imagen que representa la imagen obtenida desde el nombre de fichero dado.\n\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES['editarFoto']['tmp_name']);\n\n\t\t\t\t\t\t// imagecreatetruecolor — Crear una nueva imagen de color verdadero\n\t\t\t\t\t\t// imagecreatetruecolor() devuelve un identificador de imagen que representa una imagen en negro del tamaño especificado.\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\n\t\t\t\t\t\t// imagecopyresized — Copia y cambia el tamaño de parte de una imagen\n\t\t\t\t\t\t// imagecopyresized() copia una porción de una imagen a otra imagen. dst_image es la imagen de destino, src_image es el identificador de la imagen de origen.\n\t\t\t\t\t\t// imagecopyresized(resource $dst_image(destino) , resource $src_image(origen) , int $dst_x(eje x izq) , int $dst_y(eje y up) , int $src_x(desde donde el corte) , int $src_y(dese el eje y) , int $dst_w(ancho de corte) , int $dst_h(alto de corte) , int $src_w(ancho de original) , int $src_h(alto original) )\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\t// imagejpeg — Exportar la imagen al navegador o a un fichero\n\t\t\t\t\t\t// imagejpeg() crea un archivo JPEG desde image.\n\t\t\t\t\t\t// $destino es donde quedo la foto recortada\n\t\t\t\t\t\t//$ruta donde vmos a guardar la foto \n\t\t\t\t\t\timagepng($destino, $ruta);\n\t\t\t\t\t}\n\n\t\t\t\t\t// var_dump($_FILES['nuevaFoto']['tmp_name']);\n\t\t\t\t\t// var_dump(getimagesize($_FILES['nuevaFoto']['tmp_name']));\n\n\t\t\t\t}\n\n\t\t\t\t$tabla = \"usuarios\";\n\n\t\t\t\t\n\t\t\t\t// si el nuevo pass es diferente a vacio\n\t\t\t\tif($_POST['editarPassword'] != \"\")\n\t\t\t\t{\n\t\t\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"editarPassword\"]))\n\t\t\t\t\t{\n\t\t\t\t\t\t//almacenamos en la variable encriptar y encriptamos el nuevo pass y usamos el hash de tipo CRYPT_BLOWFISH\n\t\t\t\t\t\t// crypt — Hash de cadenas de un sólo sentido, se encripta la pass ingresado\n\t\t\t\t\t\t$encriptar = crypt($_POST[\"editarPassword\"], '$2a$07$usesomesillystringforsalt$');\n\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\n\t\t\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\ttitle: \"La contrasena no puede ir vacio o lleva caracteres especiales\",\n\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t}).then((result)=>{\n\t\t\t\t\t\t\t\tif(result.value)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse //si editarPassword viene vacio\n\t\t\t\t{\n\t\t\t\t\t$encriptar = $_POST[\"passwordActual\"];\n\t\t\t\t}\n\n\t\t\t\t$datos = array\n\t\t\t\t(\n\t\t\t\t\t\"nombre\"=> $_POST['editarNombre'],\n\t\t\t\t\t\"usuario\"=> $_POST['editarUsuario'],\t\n\t\t\t\t\t\"password\"=> $encriptar,\t\n\t\t\t\t\t\"perfil\"=> $_POST['editarPerfil'],\n\t\t\t\t\t\"ruta\" => $ruta\t\n\t\t\t\t);\n\n\t\t\t\t// llamamos al metodo mdlEditarUsuario de la clase modelo Usuario\n\t\t\t\t$respuesta = ModeloUsuarios::mdlEditarUsuario($tabla, $datos);\n\n\t\t\t\t// mostramos mensaje de edicion exitosa\n\t\t\t\tif($respuesta == \"ok\")\n\t\t\t\t{\n\t\t\t\t\techo '<script>\n\t\t\t\t\n\t\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\ttitle: \"El usuario se editó correctamente!\",\n\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t}).then((result)=>{\n\t\t\t\t\t\t\tif(result.value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t</script>';\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo '<script>\n\t\t\t\t\n\t\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\ttitle: \"El nombre no puede ir vacio o lleva caracteres especiales\",\n\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t}).then((result)=>{\n\t\t\t\t\t\t\tif(result.value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t</script>';\t\n\t\t\t}\n\t\t}\n\t}", "function GuardarEnCSV()\n {\n //fwrite($miArchivo, \"$usuario->nombre; $usuario->mail; \".date(\"d/m/Y\").\"\\n\");\n //fclose($miArchivo);\n //return $miArchivo;\n \n //$mensaje = null;\n //$retorno = false;\n //if ($this->_validarUsuario()) {//validar usuario\n \n $miArchivo= fopen(\"usuario.csv\", \"a\") or die(\"Imposible abrir el archivo\");//con a agrega datos y con w sobrescribe.\n //fwrite($miArchivo, \"$usuario->nombre, $usuario->mail, \".date(\"d/m/Y\").\"\\n\");\n //fclose($miArchivo);\n //return $miArchivo;\n if (fwrite($miArchivo, \"$this->nombre, $this->mail, \".date(\"d/m/Y\").\"\\n\")) {//fwrite($miarchivo, $mensaje) ---- validar escritura de archivo\n //$retorno = true;\n //echo \"fwrite\";\n return true;\n }else {\n //echo \"fwrite fallido\";\n return false;\n }\n fclose($miarchivo);\n //return $miarchivo;\n }", "function Import() {\n // Fichier sql\n $filename = 'http://localhost/alumnus/alumnus.sql';\n\n // Connexion\n $bdd = new PDO('mysql:host=localhost; dbname=alumnus', 'root', '');\n // Variable temporaire stockant la requête (ligne par ligne)\n $templine = '';\n // Lecture entière du fichier\n $lines = file($filename);\n // Boucle à travers chaque ligne\n foreach ($lines as $line){\n // Passage à la ligne suivante si c'est un commentaire ('--' et '/* */') ou si la ligne est vide\n if (substr($line, 0, 2) == '--' || substr($line, 0, 2) == '/*' || $line == '')\n continue;\n\n // Ajout ou concaténation de la ligne au segment actuel\n $templine .= $line;\n // Détection de fin de ligne avec le point-virgule\n if (substr(trim($line), -1, 1) == ';') {\n // Exécution de la requête\n $bdd->exec($templine);\n // Réinitialisation de la variable temporaire\n $templine = '';\n }\n }\n\n // Déconnexion\n $bdd = null;\n}", "function Cargar($recuperanombre,$recuperacif,$recuperavisible,$recuperacic,$recuperatipo,$recuperagrupo_gestion,$recuperadireccion,$recuperalocalidad,$recuperacodigo_postal,$recuperaprovincia,$recuperapais, $recuperatelefono,$recuperafax,$recuperamail,$recuperaresponsable,\r\n\t$recuperacargo_responsable,$recuperagrupo_comision,$recuperasituacion,$recuperaobservaciones,$recuperanombre_fiscal,$recuperadireccion_fiscal,$recuperalocalidad_fiscal,$recuperacodigo_postal_fiscal,\r\n\t$recuperapais_fiscal,$recuperaswift,$recuperacc_iban,$recuperanombre_banco,$recuperadireccion_banco,$recuperamail_contabilidad){\r\n\r\n\t\t$conexion = $this ->Conexion;\r\n\r\n\t\t//Consulta\r\n\t\t$Filadesde = $this ->Filadesde;\r\n\t\t$Usuario = $this ->Usuario;\r\n\r\n\t\t//ESPECIFICO: Cargamos las lineas solicitadas para esta pantalla\r\n\t\t$buscar_codigo = $this ->Buscar_codigo;\r\n\t\t$buscar_nombre = $this ->Buscar_nombre;\r\n\t\t$buscar_grupo_gestion = $this ->Buscar_grupo_gestion;\t\r\n\r\n\r\n\r\n\t\tif($buscar_codigo != null){\r\n\t\t\t$CADENA_BUSCAR = \" WHERE ID = '\".$buscar_codigo.\"'\";\r\n\t\t}elseif($buscar_nombre != null){\r\n\t\t\t$CADENA_BUSCAR = \" WHERE NOMBRE LIKE '%\".$buscar_nombre.\"%'\";\r\n\t\t}elseif($buscar_grupo_gestion != null){\r\n\t\t\t$CADENA_BUSCAR = \" WHERE GRUPO_GESTION = '\".$buscar_grupo_gestion.\"'\";\r\n\t\t}else{\r\n\t\t\t$CADENA_BUSCAR = \" WHERE NOMBRE = 'XX' \";\r\n\t\t\t//$CADENA_BUSCAR = \"\";\r\n\t\t}\r\n\r\n\t\t$resultado =$conexion->query(\"SELECT id,nombre,cif,visible,cic,tipo,grupo_gestion,direccion,localidad,codigo_postal,provincia,pais,telefono,fax,mail,responsable,\r\n\tcargo_responsable,grupo_comision,situacion,observaciones,nombre_fiscal,direccion_fiscal,localidad_fiscal,codigo_postal_fiscal,provincia_fiscal,pais_fiscal,swift,cc_iban,nombre_banco,direccion_banco,mail_contabilidad FROM hit_minoristas \".$CADENA_BUSCAR.\" ORDER BY NOMBRE\");\r\n\r\n\t\t/*if ($resultado == FALSE){\r\n\t\t\techo('Error en la consulta');\r\n\t\t\t$resultado->close();\r\n\t\t\t$conexion->close();\r\n\t\t\texit;\r\n\t\t}*/\r\n\t\t//----------------------------------------------------------------\r\n\r\n\t\t//Guardamos el resultado en una matriz con un numero fijo de registros\r\n\t\t//que controlaremos por una tabla de configuracion de pantallas de usuarios. ESPECIFICO: Solo el nombre del formulario en la query\r\n\t\t$numero_filas =$conexion->query(\"SELECT LINEAS_MODIFICACION FROM hit_usuarios_formularios WHERE FORMULARIO = 'MINORISTAS' AND USUARIO = '\".$Usuario.\"'\");\r\n\t\t$Nfilas\t = $numero_filas->fetch_assoc();\t\t\t\t\t\t\t\t\t\t\t //------\r\n\r\n\t\t$minoristas = array();\r\n\t\tif($recuperanombre != null){\r\n\t\t\t$minoristas[0] = array (\"id\" => null, \"nombre\" => $recuperanombre, \"cif\" => $recuperacif, \"visible\" => $recuperavisible, \"cic\" => $recuperacic, \"tipo\" => $recuperatipo, \"grupo_gestion\" => $recuperagrupo_gestion, \"direccion\" => $recuperadireccion, \"localidad\" => $recuperalocalidad, \"codigo_postal\" => $recuperacodigo_postal, \"provincia\" => $recuperaprovincia, \"pais\" => $recuperapais, \"telefono\" => $recuperatelefono, \"fax\" => $recuperafax, \"mail\" => $recuperamail, \"responsable\" => $recuperaresponsable, \"cargo_responsable\" => $recuperacargo_responsable, \"grupo_comision\" => $recuperagrupo_comision, \"situacion\" => $recuperasituacion, \"observaciones\" => $recuperaobservaciones, \"v\" => $recuperanombre_fiscal, \"direccion_fiscal\" => $recuperadireccion_fiscal, \"localidad_fiscal\" => $recuperalocalidad_fiscal, \"codigo_postal_fiscal\" => $recuperacodigo_postal_fiscal, \"provincia_fiscal\" => $recuperaprovincia_fiscal, \"pais_fiscal\" => $recuperapais_fiscal, \"swift\" => $recuperaswift, \"cc_iban\" => $recuperacc_iban, \"nombre_banco\" => $recuperanombre_banco, \"direccion_banco\" => $recuperadireccion_banco, \"mail_contabilidad\" => $recuperamail_contabilidad);\r\n\t\t}else{\r\n\t\t\tfor ($num_fila = $Filadesde-1; $num_fila <= $Filadesde + $Nfilas['LINEAS_MODIFICACION']-2; $num_fila++) {\r\n\t\t\t\t$resultado->data_seek($num_fila);\r\n\t\t\t\t$fila = $resultado->fetch_assoc();\r\n\t\t\t\tarray_push($minoristas,$fila);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Liberar Memoria usada por la consulta\r\n\t\t$resultado->close();\r\n\t\t$numero_filas->close();\r\n\r\n\t\treturn $minoristas;\t\t\t\t\t\t\t\t\t\t\t\r\n\t}", "public function empresa_apta(){\n\n\t\t$this->where('id',$this->user);\n\t\t//campos imprescindibles\n\t\t$campos = array('empresa','tipo_empresa','direccion','descripcion','empresa_telefono','img');\n\t\tif($salida = $this->getOne('perfiles_emp',$campos)){\n\t\t\tforeach ($salida as $key => $value) {\n\t\t\t\tif( (empty($value)) || ($value == '') ){\t\t\t\n\t\t\t\t\treturn false;\n\t\t}\t}\t}\n\t\t//si pasa del foreach es que no hay campos vacios\n\t\t$this->where('id',$this->user);\n\t\t$campos = array('apto' => 1);\n\t\t$this->update('perfiles_emp',$campos);\n\t}", "public function cargarDatos($fila){\n\t\tforeach($fila as $prop => $valor) {\n\t\t\tif(in_array($prop, static::$fila)) {\n\t\t\t\tswitch($prop){\n\t\t\t\t\tcase \"fk_user\":\n\t\t\t\t\t\t$this->setFkUser($valor);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"name\":\n\t\t\t\t\t\t$this->setName($valor);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"last_name\":\n\t\t\t\t\t\t$this->setLastName($valor);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"dni\":\n\t\t\t\t\t\t$this->setDni($valor);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"birth_day\":\n\t\t\t\t\t\t$this->setBirthDay($valor);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"phone\":\n\t\t\t\t\t\t$this->setPhone($valor);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"borrado\":\n\t\t\t\t\t\t$this->setBorrado($valor);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function create_fichaClinica( $dataPrincipal = array() )\n{\n\n global $db, $conf;\n\n $sqlNuevoUpdate = \"INSERT INTO tab_documentos_ficha_clinica(\";\n $sqlNuevoUpdate .= \" nombre_apellido\";\n $sqlNuevoUpdate .= \" , cedula_pasaporte\";\n $sqlNuevoUpdate .= \" , fecha_nacimiento\";\n $sqlNuevoUpdate .= \" , lugar_nacimiento\";\n $sqlNuevoUpdate .= \" , estado_civil\";\n $sqlNuevoUpdate .= \" , n_hijos\";\n $sqlNuevoUpdate .= \" , sexo\";\n $sqlNuevoUpdate .= \" , edad\";\n $sqlNuevoUpdate .= \" , ocupacion\";\n $sqlNuevoUpdate .= \" , direccion_domicilio\";\n $sqlNuevoUpdate .= \" , emergencia_call_a\";\n $sqlNuevoUpdate .= \" , emergencia_telefono\";\n $sqlNuevoUpdate .= \" , telefono_convencional\";\n $sqlNuevoUpdate .= \" , operadora\";\n $sqlNuevoUpdate .= \" , celular\";\n $sqlNuevoUpdate .= \" , email\";\n $sqlNuevoUpdate .= \" , twiter\";\n $sqlNuevoUpdate .= \" , lugar_trabajo\";\n $sqlNuevoUpdate .= \" , telefono_trabajo\";\n $sqlNuevoUpdate .= \" , posee_seguro\";\n $sqlNuevoUpdate .= \" , motivo_consulta\";\n $sqlNuevoUpdate .= \" , tiene_enfermedades\";\n $sqlNuevoUpdate .= \" , otras_enfermedades\";\n\n $sqlNuevoUpdate .= \" , esta_algun_tratamiento_medico\";\n $sqlNuevoUpdate .= \" , cual_tratamiento_medico\";\n\n $sqlNuevoUpdate .= \" , tiene_problema_hemorragico\";\n $sqlNuevoUpdate .= \" , cual_problema_hemorragico\";\n\n $sqlNuevoUpdate .= \" , alergico_medicamento\";\n $sqlNuevoUpdate .= \" , cual_alergico_medicamento\";\n\n $sqlNuevoUpdate .= \" , toma_medicamento\";\n $sqlNuevoUpdate .= \" , cual_toma_medicamento\";\n\n $sqlNuevoUpdate .= \" , esta_embarazada\";\n $sqlNuevoUpdate .= \" , cual_esta_embarazada\";\n\n $sqlNuevoUpdate .= \" , enfermedades_hereditarias\";\n $sqlNuevoUpdate .= \" , cual_enfermedades_hereditarias\";\n\n $sqlNuevoUpdate .= \" , que_toma_ult_24horass\";\n $sqlNuevoUpdate .= \" , resistente_medicamento\";\n $sqlNuevoUpdate .= \" , hemorragia_bucales\";\n $sqlNuevoUpdate .= \" , complicacion_masticar\";\n $sqlNuevoUpdate .= \" , habitos_consume\";\n\n $sqlNuevoUpdate .= \")\";\n $sqlNuevoUpdate .= \"VALUES(\";\n\n $sqlNuevoUpdate .= \" '$dataPrincipal->doc_nombre_apellido'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_cedula'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_fecha_nc'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_lugar_n'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_estado_civil'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_hijos_n'\";\n $sqlNuevoUpdate .= \", '\".json_encode($dataPrincipal->sexo).\"'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_edad'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_ocupacion'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_domicilio'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_emergencia_call_a'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_emergencia_telef'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_telef_convencional'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_operadora'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_celular'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_email'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_twiter'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_lugar_trabajo'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_telef_trabajo'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_q_seguro_posee'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_motivo_consulta'\";\n\n $sqlNuevoUpdate .= \", '\".json_encode($dataPrincipal->enfermedades).\"'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_otras_enferm'\";\n\n $sqlNuevoUpdate .= \", '\". json_encode($dataPrincipal->segui_tratamiento) .\"'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_tratmient_descrip'\";\n\n $sqlNuevoUpdate .= \", '\". json_encode($dataPrincipal->problemas_hemorragicos) .\"'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_descrip_hemorragicos'\";\n\n $sqlNuevoUpdate .= \", '\". json_encode($dataPrincipal->alergico_medicamento) .\"'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_descrip_alergia'\";\n\n $sqlNuevoUpdate .= \", '\". json_encode($dataPrincipal->toma_medicamento_frecuente) .\"'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_descrip_medicamento'\";\n\n $sqlNuevoUpdate .= \", '\". json_encode($dataPrincipal->embarazada) .\"'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_descrip_embarazada'\";\n\n $sqlNuevoUpdate .= \", '\". json_encode($dataPrincipal->enferm_hederitarias) .\"'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_descript_hederitaria'\";\n\n $sqlNuevoUpdate .= \", '$dataPrincipal->q_medicina_tomo_24h_ultima'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_resistente_medicamento'\";\n\n $sqlNuevoUpdate .= \", '\". json_encode($dataPrincipal->hemorragias_bocales) .\"'\";\n\n $sqlNuevoUpdate .= \", '\". json_encode($dataPrincipal->complicaciones_masticar) .\"'\";\n\n $sqlNuevoUpdate .= \", '\". json_encode($dataPrincipal->abitos_consume) .\"'\";\n\n\n $sqlNuevoUpdate .= \")\";\n\n $rs = $db->query($sqlNuevoUpdate);\n\n if(!$rs){\n return 'Error no se pudo guardar el documento Ficha clinica';\n }else{\n return '';\n }\n\n}", "public function atualizar(Request $request)\n {\n $request->validate([\n 'arquivo' => 'required|file'\n ]);\n\n try{\n $csv = Reader::createFromPath($request->arquivo);\n $csv->setHeaderOffset(0);\n\n foreach ($csv as $line) {\n if ($line['siape'] != 'NULL'){\n Docente::updateOrCreate(\n ['siape' => $line['siape']],\n [\n 'nome' => $line['nome'],\n 'email' => $line['email'],\n ]\n );\n }\n }\n\n toastr()->success('Lista de docentes atualizada!');\n }catch (ModelNotFoundException $exception){\n toastr()->error($exception->getMessage());\n }finally{\n return redirect()->route('home');\n }\n }", "public function Crud(){\n $pvd = new alumno();\n\n //Se obtienen los datos del alumno a editar.\n if(isset($_REQUEST['persona_id'])){\n $pvd = $this->model->Obtener($_REQUEST['persona_id']);\n }\n\n //Llamado de las vistas.\n require_once '../Vista/Alumno/editar-alumnos.php';\n\t}", "public function alumnos()\n\t{\n\t\t$data['estado'] \t\t= $this->input->post('estado');\n\t\t$departamento\t \t\t= $this->input->post('departamento');\n\t\t$localidad\t\t\t\t= $this->input->post('localidad');\n\t\t$escuela\t\t\t\t= $this->input->post('escuela');\n\t\t\n\t\t$data['localidad']\t\t= $this->input->post('localidad');\n\t\t$data['departamento']\t= $this->input->post('departamento');\n\t\t$data['escuela']\t\t= $this->input->post('escuela');\n\t\t$curso\t\t\t\t= $this->input->post('curso_division');\n\t\t$data['curso']\t\t\t= $this->input->post('curso_division');\n\t\t//------------------------------------------------\n\t\t$data['total']\t\t\t= $this->opendatagov->alumnos_total($curso);\n\t\t$data['femeninos']\t\t= $this->opendatagov->alumnos_femeninos($curso);\n\t\t$data['masculinos']\t\t= $this->opendatagov->alumnos_masculinos($curso);\n\t\t$data['listado']\t\t= $this->opendatagov->alumnos_listado($curso);\n\t\t//------------------------------------------------\n\t\t$this->load->view('includes/header');\n\t\t$this->load->view('vista_alumnos', $data);\n\t\t$this->load->view('includes/footer');\n\t}", "public function Perfil(){\n $pvd = new alumno();\n\n //Se obtienen los datos del alumno.\n if(isset($_REQUEST['persona_id'])){\n $pvd = $this->model->Obtener($_REQUEST['persona_id']);\n }\n\n //Llamado de las vistas.\n require_once '../Vista/Alumno/perfil-alumno.php';\n\t}", "function insertardatos($c){\n $temp=\"\";\n //RUTA DEL FICHERO QUE CONTIENE LA CREACION DE TABLAS\n $ruta_fichero_sql = 'mysql_script/datos.sql';\n \n \n //CON EL COMANDO FILE,VOLCAMOS EL CONTENIDO DEL FICHERO EN OTRA VARIABLE\n $datos_fichero_sql = file($ruta_fichero_sql);\n //LEEMOS EL FICHERO CON UN BUCLE FOREACH\n foreach($datos_fichero_sql as $linea_a_ejecutar){\n //QUITAMOS LOS ESPACIOS DE ALANTE Y DETRÁS DE LA VARIABLE\n $linea_a_ejecutar = trim($linea_a_ejecutar); \n \n //GUARDAMOS EN LA VARIABLE TEMP EL BLOQUE DE SENTENCIAS QUE VAMOS A EJECUTAR EN MYSQL\n $temp .= $linea_a_ejecutar.\" \";\n //COMPROBAMOS CON UN CONDICIONAL QUE LA LINEA ACABA EN ;, Y SI ES ASI LA EJECUTAMOS\n if(substr($linea_a_ejecutar, -1, 1) == ';'){\n mysqli_query($c,$temp);\n \n //REINICIAMOS LA VARIABLE TEMPORAL\n $temp=\"\";\n \n }//FIN IF BUSCAR SENTENCIA ACABADA EN ;\n else{\n //echo\"MAL\".$temp.\"<br><br>\";\n }\n \n }//FIN FOREACH\n \n \n }", "public function guardarDatos(){\n $contadorPadre = 0;\n $contadorHijo = 0;\n $contadorNieto = 0;\n $contadorHijoVector = 0;\n $contadorPadreVector = 0;\n $contadorNietoVector = 0;\n $contadorProducto = 1;\n $encontradoNieto = FALSE;\n // Imagenes\n $vectorImagenesPadre = $this->getImagenesIndexCategorias();\n $this->queryMarcasPrincipales(1);$this->queryMarcasPrincipales(2);$this->queryMarcasPrincipales(3);\n // csv\n $output = fopen('categories_import.csv', 'w');\n $vectorCategorias = array();\n $vectorCategoriasLabel = $this->getVectorLabelCategorias();\n array_push($vectorCategorias,$vectorCategoriasLabel);\n foreach ($this->categoriaPrincipal as $padre){\n $vectorCsv = $this->guardarPadre($contadorPadre,$vectorImagenesPadre[$contadorPadre],$this->padreContent[$contadorPadre]);\n $imagenesHijos = $this->listadoHijosNietosImagenes($this->padreContent[$contadorPadre]);\n // csv\n array_push($vectorCategorias,$vectorCsv);\n if (isset($padre[\"hijos\"])) {\n foreach($padre[\"hijos\"] as $hijo){\n $vectorCsv = $this->guardarHijo($contadorPadre,$contadorHijo,$imagenesHijos[$contadorHijo],$this->hijoContent[$contadorHijoVector]);\n $imagenesNietos = $this->listadoHijosNietosImagenes($this->hijoContent[$contadorHijoVector]);\n // csv\n array_push($vectorCategorias,$vectorCsv);\n if (isset($hijo[\"nietos\"])) {\n foreach($hijo[\"nietos\"] as $nieto){\n $vectorCsv = $this->guardarNieto($contadorPadre,$contadorHijo,$contadorNieto,$this->nietoContent[$contadorNietoVector],$imagenesNietos[$contadorNieto]);\n $this->guardarProductoNieto($contadorPadre,$contadorHijo,$contadorNieto,$this->nietoContent[$contadorNietoVector],$contadorProducto);\n $contadorProducto += $this->categoriaPrincipal[$contadorPadre][\"hijos\"][$contadorHijo][\"nietos\"][$contadorNieto][\"numeroProductos\"];\n // csv\n array_push($vectorCategorias,$vectorCsv);\n $contadorNieto++;\n $contadorNietoVector++;\n }\n $contadorNieto = 0;\n }else{\n $this->guardarProductoHijo($contadorPadre,$contadorHijo,false,$this->hijoContent[$contadorHijoVector],$contadorProducto);\n $contadorProducto += $this->categoriaPrincipal[$contadorPadre][\"hijos\"][$contadorHijo][\"numeroProductos\"];\n }\n $contadorHijo++;\n $contadorHijoVector++;\n }\n $contadorHijo = 0;\n }\n $contadorPadre++;\n }\n foreach ($vectorCategorias as $campo) {\n fputcsv($output, $campo,';');\n }\n fclose($output);\n $this->writeCsvMarcas();\n }", "public function insertMas(){\n\t \t\t\t// FIELDS TERMINATED BY ',' \n\t \t\t\t// ENCLOSED BY '\"' \n\t \t\t\t// LINES TERMINATED BY '\\r\\n'\n\t\t\t\t // IGNORE 1 LINES\n\t\t\t\t // (area,departamento,nombre_firma,puesto,ext,tel,cel,correo);\n\t\t}", "public function cargarAsistencia($fecha, $tipo, $valor, $dni_alumno, $id_curso) {\n //date_default_timezone_set('UTC');\n //$fecha = date(\"Y\") . \"-\" . date(\"m\") . \"-\" . date(\"d\");\n $con = ConexionBD::getConexion();\n $con->insertar(\"INSERT INTO `asistencia`(`idasistencia`, `fecha`, `tipo`, `valor`, `alumnoxcurso_alumno_dni`, `alumnoxcurso_curso_idcurso`) VALUES (default,'\" . $fecha . \"','\" . $tipo . \"','\" . $valor . \"','\" . $dni_alumno . \"','\" . $id_curso . \"')\");\n }", "public function addPatrocinadores($post = null, $file=null){\n\t\tif($post){\n\t\t\t// insertando datos de patrocinador en la tabla 'patrocinadores' de la bd\n\t\t\t$patrocinador = array(\n\t\t\t\t'nombre'=> Utils::getIndexPost($post, 'patrocinador'),\n\t\t\t\t'estado'=> intVal(Utils::getIndexPost($post, 'estado')),\n\t\t\t\t'municipio'=> intVal(Utils::getIndexPost($post, 'municipio')),\n\t\t\t\t'colonia'=> Utils::getIndexPost($post, 'colonia'),\n\t\t\t\t'calle'=> Utils::getIndexPost($post, 'calle'),\n\t\t\t\t'numero'=> Utils::getIndexPost($post, 'numero'),\n\t\t\t\t'cp'=> intVal(Utils::getIndexPost($post, 'cp')),\n\t\t\t\t'referencias'=> Utils::getIndexPost($post, 'referencias'),\n\t\t\t\t'telefono'=> Utils::getIndexPost($post, 'telefono'),\n\n\t\t\t\t'movil'=> Utils::getIndexPost($post, 'movil'),\n\t\t\t\t'web'=> Utils::getIndexPost($post, 'web'),\n\t\t\t\t'facebook'=> Utils::getIndexPost($post, 'facebook'),\n\t\t\t\t'twitter'=> Utils::getIndexPost($post, 'twitter'),\n\t\t\t\t'dateRegister'=> date('Y-m-d')\n\t\t\t);\n\n\t\t\t// comprobando si se subió alguna imagen del logo del patrocinador\n\t\t\t$file_ = isset($file['logo']) && $file['logo'] ? $file['logo'] : null;\n\t\t\t$dirTo = '../../public/img/patrocinadores';\n\t\t\t$rules =array('formats'=>'image/jpeg|image/png|image/gif', 'sizeMaxKb'=>2048);\n\t\t\t$resFile = Utils::updateFile($file_, $dirTo, $rules);\n\t\t\t$success = (isset($resFile['res']) && $resFile['res']==1 && isset($resFile['success']) && is_array($resFile['success'])) ? $resFile['success'] : false;\n\t\t\t$patrocinador['logoUrl'] = $this->pathPublic;\n\t\t\t$patrocinador['logoName'] = $success ? $success['name'] : null;\n\t\t\t$patrocinador['logoSize'] = $success ? $success['size'] : 0;\n\t\t\t$patrocinador['sliderOrder'] = 0;\n\t\t\t$patrocinador['sliderVisible'] = 0;\n\n\t\t\t$res = $this->model->addPatrocinadores($patrocinador);\n\t\t\t\n\t\t\theader('location: ' .'index.php');\n\t\t}\n\t\treturn get_defined_vars ();\n\t}", "public function AdicionarConvenio($file, $id, $nomeEmpresa,){\n $formatP = array(\"pdf\");\n\n \n $extensao = pathinfo($file['name'], PATHINFO_EXTENSION);\n\n // echo \"$extensao\";\n\n if(in_array($extensao,$formatP)){\n // $caminho = \"../docs/\".$tipo.\"/\";\n $temp = $file['tmp_name'];\n\n $this->PrepraDiretorioDoc($id);\n\n $inserirDOC = \"UPDATE empresa set DOC_Convenio = :nomeArquivo WHERE CD_Empresa = :idEmpresa\";\n $caminho = \"C:/xampp/htdocs/projeto_final/startechlds/docs/DOC_Convenio/\";\n $doc = \"DOC_Curriculo\";\n\n $nomeArquivo = $nomeEmpresa.\"_Convenio\";\n if(move_uploaded_file($temp, $caminho.$nomeArquivo.\".pdf\")){\n try{\n $conn = new ConexaoBD();\n $conect = $conn->ConDB();\n\n $result = $conect->prepare($inserirDOC);\n $result->bindParam(':nomeArquivo', $nomeArquivo, PDO::PARAM_STR);\n $result->bindParam(':idEmpresa', $id, PDO::PARAM_INT);\n $result->execute();\n\n \n\n $funcionou = $result->rowCount();\n \n \n if($funcionou > 0){\n return true;\n }\n else{\n // echo\"não retornou linha nenhuma\";\n return false;\n }\n }\n catch(PDOException $e){\n echo \"erro de PDO \".$e->getMessage();\n }\n\n }\n else{\n echo\"erro ao mover para pasta<br/>\";\n // var_dump(move_uploaded_file($temp, $this->caminhoCurriculo.$nomeAluno.\".pdf\"));\n }\n\n }\n else{\n echo \"Formato inválido\";\n }\n\n }", "public function getFile($conn){\n\t\t//preparo lo statement che mi ricava tutte le informazioni \n\t\t//dalla tabella Filmato_Presentazione.\n\t\t$sth = $conn->prepare(\"select * from Filmato_Presentazione\");\n\t\t$sth->execute();\n\t\treturn $sth; \n\t}", "private function existenciaDatos() {\n\t\t\tif($this->peticion->post->existencia('boton') == true):\n\t\t\t\t$this->cargarGuion();\n\t\t\telse:\n\t\t\t\texit('El Formulario no proceso los Datos');\n\t\t\tendif;\n\t\t}", "function importar_operaciones_requerimientos(){\n if ($this->input->post()) {\n $post = $this->input->post();\n $com_id = $this->security->xss_clean($post['com_id']); /// com id\n $componente = $this->model_componente->get_componente_pi($com_id);\n $fase=$this->model_faseetapa->get_fase($componente[0]['pfec_id']);\n $proyecto = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']);\n $list_oregional=$this->model_objetivoregion->list_proyecto_oregional($fase[0]['proy_id']); /// Lista de Objetivos Regionales\n $tp = $this->security->xss_clean($post['tp']); /// tipo de migracion\n\n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n /*------------------- Migrando ---------------*/\n $lineas = file($archivotmp);\n $i=0;\n $nro=0;\n $guardado=0;\n $no_guardado=0;\n $nro_prod=count($this->model_producto->list_prod($com_id));\n if($nro_prod!=0){\n $ope_ult=$this->model_producto->ult_operacion($com_id);\n $nro_prod=$ope_ult[0]['prod_cod']+1;\n }\n else{\n $nro_prod=1;;\n }\n\n if($tp==1){ /// Actividades\n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){\n $datos = explode(\";\",$linea);\n if(count($datos)==21){\n\n $cod_or = trim($datos[0]); // Codigo Objetivo Regional\n $cod_ope = $nro_prod; // Codigo Operacion\n $descripcion = utf8_encode(trim($datos[2])); //// descripcion Operacion\n $resultado = utf8_encode(trim($datos[3])); //// descripcion Resultado\n $unidad = utf8_encode(trim($datos[4])); //// Unidad\n $indicador = utf8_encode(trim($datos[5])); //// descripcion Indicador\n $lbase = utf8_encode(trim($datos[6])); //// Linea Base\n if(trim($datos[6])==''){\n $lbase = 0; //// Linea Base\n }\n\n $meta = utf8_encode(trim($datos[7])); //// Meta\n if(trim($datos[7])==''){\n $meta = 0; //// Meta\n }\n\n $var=8;\n for ($i=1; $i <=12 ; $i++) {\n $m[$i]=(float)$datos[$var]; //// Mes i\n if($m[$i]==''){\n $m[$i]=0;\n }\n $var++;\n }\n\n $mverificacion = utf8_encode(trim($datos[20])); //// Medio de verificacion\n\n $ae=0;\n $or_id=0;\n if(count($list_oregional)!=0){\n $get_acc=$this->model_objetivoregion->get_alineacion_proyecto_oregional($fase[0]['proy_id'],$cod_or);\n if(count($get_acc)!=0){\n $ae=$get_acc[0]['ae'];\n $or_id=$get_acc[0]['or_id'];\n }\n }\n\n /*--- INSERTAR DATOS OPERACIONES (ACTIVIDADES 2020) ---*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array(\n 'com_id' => $com_id,\n 'prod_producto' => strtoupper($descripcion),\n 'prod_resultado' => strtoupper($resultado),\n 'indi_id' => 1,\n 'prod_indicador' => strtoupper($indicador),\n 'prod_fuente_verificacion' => strtoupper($mverificacion), \n 'prod_linea_base' => $lbase,\n 'prod_meta' => $meta,\n 'prod_unidades' => $unidad,\n 'acc_id' => $ae,\n 'prod_ppto' => 1,\n 'fecha' => date(\"d/m/Y H:i:s\"),\n 'prod_cod'=>$cod_ope,\n 'or_id'=>$or_id,\n 'fun_id' => $this->fun_id,\n 'num_ip' => $this->input->ip_address(), \n 'nom_ip' => gethostbyaddr($_SERVER['REMOTE_ADDR']),\n );\n $this->db->insert('_productos', $data_to_store);\n $prod_id=$this->db->insert_id(); \n\n for ($p=1; $p <=12 ; $p++) { \n if($m[$p]!=0){\n $this->model_producto->add_prod_gest($prod_id,$this->gestion,$p,$m[$p]);\n }\n }\n\n $producto=$this->model_producto->get_producto_id($prod_id);\n if(count($producto)!=0){\n $guardado++;\n }\n else{\n $no_guardado++;\n }\n\n $nro_prod++;\n }\n }\n $i++;\n }\n \n }\n else{ /// Requerimientos\n\n foreach ($lineas as $linea_num => $linea){\n if($i != 0){\n $datos = explode(\";\",$linea);\n //echo count($datos).'<br>';\n if(count($datos)==20){\n \n $prod_cod = (int)$datos[0]; //// Codigo Actividad\n $cod_partida = (int)$datos[1]; //// Codigo partida\n $par_id = $this->minsumos->get_partida_codigo($cod_partida); //// DATOS DE LA FASE ACTIVA\n\n $detalle = utf8_encode(trim($datos[2])); //// descripcion\n $unidad = utf8_encode(trim($datos[3])); //// Unidad\n $cantidad = (int)$datos[4]; //// Cantidad\n $unitario = $datos[5]; //// Costo Unitario\n \n $p_total=($cantidad*$unitario);\n $total = $datos[6]; //// Costo Total\n\n $var=7; $sum_temp=0;\n for ($i=1; $i <=12 ; $i++) {\n $m[$i]=$datos[$var]; //// Mes i\n if($m[$i]==''){\n $m[$i]=0;\n }\n $var++;\n $sum_temp=$sum_temp+$m[$i];\n }\n\n $observacion = utf8_encode(trim($datos[19])); //// Observacion\n $verif_cod=$this->model_producto->verif_componente_operacion($com_id,$prod_cod);\n \n //echo count($verif_cod).'--'.count($par_id).'--'.$cod_partida.'--'.round($sum_temp,2).'=='.round($total,2);\n\n if(count($verif_cod)!=0 & count($par_id)!=0 & $cod_partida!=0 & round($sum_temp,2)==round($total,2)){ /// Verificando si existe Codigo de Actividad, par id, Codigo producto\n // if($verif_cod[0]['prod_ppto']==1){ /// guardando si tiene programado presupuesto en la operacion\n $guardado++;\n /*-------- INSERTAR DATOS REQUERIMIENTO ---------*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'ins_codigo' => $this->session->userdata(\"name\").'/REQ/'.$this->gestion, /// Codigo Insumo\n 'ins_fecha_requerimiento' => date('d/m/Y'), /// Fecha de Requerimiento\n 'ins_detalle' => strtoupper($detalle), /// Insumo Detalle\n 'ins_cant_requerida' => round($cantidad,0), /// Cantidad Requerida\n 'ins_costo_unitario' => $unitario, /// Costo Unitario\n 'ins_costo_total' => $total, /// Costo Total\n 'ins_unidad_medida' => $unidad, /// Unidad de Medida\n 'ins_gestion' => $this->gestion, /// Insumo gestion\n 'par_id' => $par_id[0]['par_id'], /// Partidas\n 'ins_tipo' => 1, /// Ins Tipo\n 'ins_observacion' => strtoupper($observacion), /// Observacion\n 'fun_id' => $this->fun_id, /// Funcionario\n 'aper_id' => $proyecto[0]['aper_id'], /// aper id\n 'num_ip' => $this->input->ip_address(), \n 'nom_ip' => gethostbyaddr($_SERVER['REMOTE_ADDR']),\n );\n $this->db->insert('insumos', $data_to_store); ///// Guardar en Tabla Insumos \n $ins_id=$this->db->insert_id();\n\n /*--------------------------------------------------------*/\n $data_to_store2 = array( ///// Tabla InsumoProducto\n 'prod_id' => $verif_cod[0]['prod_id'], /// prod id\n 'ins_id' => $ins_id, /// ins_id\n );\n $this->db->insert('_insumoproducto', $data_to_store2);\n /*----------------------------------------------------------*/\n\n for ($p=1; $p <=12 ; $p++) { \n if($m[$p]!=0 & is_numeric($unitario)){\n $data_to_store4 = array(\n 'ins_id' => $ins_id, /// Id Insumo\n 'mes_id' => $p, /// Mes \n 'ipm_fis' => $m[$p], /// Valor mes\n );\n $this->db->insert('temporalidad_prog_insumo', $data_to_store4);\n }\n }\n // }\n\n }\n \n\n } /// end dimension (22)\n } /// i!=0\n\n $i++;\n\n }\n\n /// --- ACTUALIZANDO MONEDA PARA CARGAR PRESUPUESTO\n $this->update_ptto_operaciones($com_id);\n } /// end else\n\n $this->session->set_flashdata('success','SE REGISTRARON '.$guardado.' REQUERIMIENTOS');\n redirect('admin/prog/list_prod/'.$com_id.'');\n }\n else{\n $this->session->set_flashdata('danger','SELECCIONE ARCHIVO ');\n redirect('admin/prog/list_prod/'.$com_id.'');\n }\n }\n else{\n echo \"Error !!\";\n }\n }", "public function importUsers(Request $request){\n $this->validate($request, array(\n 'file' => 'required'\n ));\n\n if($request->hasFile('file')){\n $extension = File::extension($request->file->getClientOriginalName());\n if ($extension == \"xlsx\" || $extension == \"xls\" || $extension == \"csv\") {\n $path = $request->file->getRealPath();\n //Se obtiene la información del archivo.\n $data = Excel::load($path, function($reader) {})->get();\n\n if(!empty($data) && $data->count()){\n foreach ($data as $key => $value) {\n $persona = new Personal();\n $persona->departamento_id = 12;\n $persona->nombre = $value->nombre;\n $persona->apellidos = $value->apellidos;\n $persona->f_nacimiento = '2022-10-17';\n $persona->rfc = $value->rfc;\n $persona->direccion = '#';\n $persona->colonia = 'San Luis Potosí Centro';\n $persona->cp = 78000;\n $persona->celular = '44444444';\n $persona->email = '[email protected]';\n $persona->empresa_id = 1;\n $persona->save();\n\n // se crea el usuario\n $user = new User();\n $user->usuario = $value->usuario;\n $user->password = bcrypt('123456');\n $user->condicion = '1';\n $user->rol_id = 16;\n $user->id = $persona->id;\n $user->fondo_ahorro = 1;\n $user->fondo_pension = 1;\n $user->prestamos_personales = 1;\n $user->save();\n }\n }\n return back();\n }else {\n Session::flash('error', 'File is a '.$extension.' file.!! Please upload a valid xls/csv file..!!');\n return back();\n }\n }\n }", "function tabla_directores(){\n $fichero = \"bbdd/directores.csv\";\n $array_directores;\n\n //Si existe el fichero lo abrimos para leerlo\n $manejador = fopen($fichero, \"r\");\n if($manejador != FALSE){\n $j=0;\n while(($arrayFila= fgetcsv($manejador, 1000, \",\")) != FALSE){ \n $array_directores[$j] = array(\"id\" => $arrayFila[0], \"nombre\" => $arrayFila[1], \"anyo\" => $arrayFila[2], \"lugar\" => $arrayFila[3]);\n $j++;\n } \n fclose($manejador);\n } \n return $array_directores;\n }", "function generar()\r\n\t{\r\n\t\tforeach($this->columnas as $ef) {\r\n\t\t \t$this->datos->tabla('columnas')->nueva_fila($ef->get_datos());\r\n\t\t}\r\n\t\tparent::generar();\r\n\t}", "public function actualizarAlumnaController()\n\t\t{\n\t\t\tif(isset($_POST['nombreEditar']))\n\t\t\t{\n\t\t\t\t$fecha = date(\"Y-m-d\",strtotime($_POST['fechaEditar']));\n\t\t\t\t$datosController = array( \"id\"=>$_POST[\"idEditar\"],\n\t\t\t\t\t\t\t\t\t\t \"nombre\"=>$_POST[\"nombreEditar\"],\n\t\t\t\t\t\t\t\t\t\t \"apellido\"=>$_POST[\"apellidoEditar\"],\n\t\t\t\t\t\t\t\t\t\t \"fecha\"=>$_POST[\"fechaEditar\"],\n\t\t\t\t\t\t\t\t\t\t \"grupo\"=>$_POST['grupo']);\n\n\t\t\t\t$respuesta = Datos::actualizarAlumnaModel($datosController,\"alumna\");\n\n\t\t\t\tif($respuesta == \"success\")\n\t\t\t\t{\n\t\t\t\t\techo\"<script>\n\t\t\t\t\t\t\twindow.location = 'index.php?action=alumnas';\n\t\t\t\t\t\t</script>\";\n\n\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t{\n\n\t\t\t\t\techo \"error\";\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}", "function salvarCadastro() {\n $this->layout = '_layout.perfilUsuario';\n $usuario = new Usuario();\n // $usuario->codgusario = $this->getParametro(0);\n $api = new ApiUsuario();\n $sec = new Validador();\n \n if(isset($_FILES[\"foto\"][\"name\"])){\n $arquivo =$_FILES[\"foto\"][\"name\"];\n $path_dir = \"fotos/\". $arquivo;\n $vs= move_uploaded_file($_FILES[\"foto\"][\"tmp_name\"], $path_dir);\n }\n /**\n * recebe\n */\n \n $senha = $sec->criptografarUrl($_POST['senha']);\n \n \n $usuario->setNome($_POST['nome']);\n $usuario->setApelido($_POST['apelido']);\n $usuario->setNumeroEstudante(addslashes($_POST['numeroEstudante']));\n $usuario->setTelefone($_POST['telefone']);\n $usuario->setEmail($_POST['email']);\n $usuario->setNivel($_POST['nivel']);\n $usuario->setSenha($senha);\n $usuario->setFoto(isset($arquivo)?$arquivo:'');\n \n /**\n * condiçao pra actualizar ou inserir \n */\n if(isset($_POST['codgusario']) && !empty($_POST['codgusario'])):\n \n \n $query = $api->salavarInsert(new Usuario('POST'));\n \n else:\n $query = $api->salavarInsert($usuario);\n \n endif;\n \n $this->dados = array('salvar' => $query);\n $this->view();\n }", "function guardarDatos()\n {\n $miArchivo = \"datos.json\";\n $arreglo = array();\n\n try{\n $datosForma = array(\n 'nombreProducto'=> $_POST['nombre'],\n 'nombreCliente'=> $_POST['cliente'],\n 'precio'=> $_POST['precio'],\n 'fechaPedido'=> $_POST['fechaPedido'],\n 'fechaEntrega'=> $_POST['fechaEntrega']\n );\n\n if(file_get_contents($miArchivo) != null)\n {\n $jsondata = file_get_contents($miArchivo);\n\n $arreglo = json_decode($jsondata,true);\n }\n\n array_push($arreglo, $datosForma);\n\n $jsondata = json_encode($arreglo, JSON_PRETTY_PRINT);\n\n if(file_put_contents($miArchivo, $jsondata))\n return true;\n else\n return false;\n }catch(Exception $e)\n {\n return false;\n }\n }", "function crearbd($c){\n $temp=\"\";\n //RUTA DEL FICHERO QUE CONTIENE LA CREACION DE TABLAS\n $ruta_fichero_sql = 'mysql_script/tablas.sql';\n \n \n //CON EL COMANDO FILE,VOLCAMOS EL CONTENIDO DEL FICHERO EN OTRA VARIABLE\n $datos_fichero_sql = file($ruta_fichero_sql);\n //LEEMOS EL FICHERO CON UN BUCLE FOREACH\n foreach($datos_fichero_sql as $linea_a_ejecutar){\n //QUITAMOS LOS ESPACIOS DE ALANTE Y DETRÁS DE LA VARIABLE\n $linea_a_ejecutar = trim($linea_a_ejecutar); \n \n //GUARDAMOS EN LA VARIABLE TEMP EL BLOQUE DE SENTENCIAS QUE VAMOS A EJECUTAR EN MYSQL\n $temp .= $linea_a_ejecutar.\" \";\n //COMPROBAMOS CON UN CONDICIONAL QUE LA LINEA ACABA EN ;, Y SI ES ASI LA EJECUTAMOS\n if(substr($linea_a_ejecutar, -1, 1) == ';'){\n mysqli_query($c,$temp);\n \n //REINICIAMOS LA VARIABLE TEMPORAL\n $temp=\"\";\n \n }//FIN IF BUSCAR SENTENCIA ACABADA EN ;\n else{\n //echo\"MAL\".$temp.\"<br><br>\";\n }\n \n }//FIN FOREACH\n \n \n }", "public function NuevoPermiso(){\n\t\t$AlCg = new HomeController();\n\t\t$AlCdatos = array();\n\t\tarray_push($AlCdatos, $_POST[\"inicio\"]);\n\t\tarray_push($AlCdatos, $_POST[\"fin\"]);\n\t\tarray_push($AlCdatos, $_FILES[\"uploadedfile\"]);\n\t\t$AlCvalidado = $AlCg->ValidarNoVacio($AlCdatos);\n\t\tif ($AlCvalidado) {\n\t\t\tif ($_FILES['uploadedfile'][\"error\"] > 0 ){\n\t\t\t\treturn Redirect::to(\"/inicio\");\n\t\t\t}else{\n\t\t\t\tdate_default_timezone_set('America/Mexico_City');\n\t\t\t\t$AlCfecha = date('Y-m-d');\n\t\t\t\t$AlCalumno = DB::table(\"alumno\")->where(\"idAlumno\",Session::get(\"usuario\"))->first();\n\t\t\t\t$AlCpermiso = DB::table(\"permiso\")->insertGetId(array(\n\t\t\t\t\t\"Alumno_idAlumno\" => Session::get(\"usuario\"),\n\t\t\t\t\t\"matriculaa\" => $AlCalumno->matriculaa,\n\t\t\t\t\t\"descripcion\" => $_POST[\"address\"],\n\t\t\t\t\t\"fechaSolicitud\" => $AlCfecha,\n\t\t\t\t\t\"fechaInicio\" => $_POST[\"inicio\"],\n\t\t\t\t\t\"fechaFin\" => $_POST[\"fin\"]));\n\t\t\t\t$AlCext=$AlCg->obtenerExt($_FILES['uploadedfile']['name']);\n\t\t\t\tmove_uploaded_file($_FILES['uploadedfile']['tmp_name'], \"permisos/\".$AlCpermiso.\".\".$AlCext);\n\t\t\t\tDB::table(\"permiso\")->where(\"idpermiso\",$AlCpermiso)->update(array(\"URL\" => \"permisos/\".$AlCpermiso.\".\".$AlCext));\n\t\t\t\treturn Redirect::to(\"/inicio\");\n\t\t\t}\n\t\t}else{\n\t\t\treturn Redirect::to(\"/inicio\");\n\t\t}\n\t}", "public function buscarAlumnos(){\n\t\t\t$this->load->model('nivel_model');\n\t\t\t$data['nivel'] = $this->nivel_model->obtenerNiveles();\n\t\t\t$data['alumnos'] = $this->alumnos_model->obtenerAlumnosNivel(1);\n\t\t\t$this->load->view('plantillas/header');\n\t\t\t$this->load->view('plantillas/sidebar');\n\t\t\t$this->load->view('front_end/buscar_alumnos',$data);\n\t\t\t$this->load->view('plantillas/footer');\n\t\t}", "public function cargarUsuario(){\n $query = \"SELECT nombre, apellido, sexo, DATE_FORMAT(fecha_nac, '%d/%m/%Y') AS fecha_nac, correo FROM usuario WHERE codUsuario = \".parent::string($this->getCodUsuario()).\";\";\n $result = mysqli_query(parent::conexion(), $query);\n $arreglo = null;\n\n if(!$result){\n \t\tdie(\"Error\");\n } else{\n while($data = mysqli_fetch_assoc($result)){\n $arreglo[] = $data;\n \t\t }\n }\n\n parent::desconectar();\n return json_encode($arreglo);\n }", "static public function mdlGuardarDetalleIngreso($tabla,$datos){\n\n\t\t$sql=\"INSERT INTO $tabla (\n\t\t\t\t\t\t\t\t\t\t\ttipo,\n\t\t\t\t\t\t\t\t\t\t\tdocumento,\n\t\t\t\t\t\t\t\t\t\t\ttaller,\n\t\t\t\t\t\t\t\t\t\t\tfecha,\n\t\t\t\t\t\t\t\t\t\t\tarticulo,\n\t\t\t\t\t\t\t\t\t\t\tcantidad,\n\t\t\t\t\t\t\t\t\t\t\talmacen,\n\t\t\t\t\t\t\t\t\t\t\tidcierre\n\t\t\t\t\t\t\t\t\t\t) \n\t\t\t\t\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t:tipo,\n\t\t\t\t\t\t\t\t\t\t\t:documento,\n\t\t\t\t\t\t\t\t\t\t\t:taller,\n\t\t\t\t\t\t\t\t\t\t\t:fecha,\n\t\t\t\t\t\t\t\t\t\t\t:articulo,\n\t\t\t\t\t\t\t\t\t\t\t:cantidad,\n\t\t\t\t\t\t\t\t\t\t\t:almacen,\n\t\t\t\t\t\t\t\t\t\t\t:idcierre\n\t\t\t\t\t\t\t\t\t\t\t)\";\n\n\t\t$stmt=Conexion::conectar()->prepare($sql);\n\n $stmt->bindParam(\":tipo\",$datos[\"tipo\"],PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":documento\",$datos[\"documento\"],PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":taller\",$datos[\"taller\"],PDO::PARAM_STR);\n $stmt->bindParam(\":fecha\",$datos[\"fecha\"],PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":articulo\",$datos[\"articulo\"],PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":cantidad\",$datos[\"cantidad\"],PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":almacen\",$datos[\"almacen\"],PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":idcierre\",$datos[\"idcierre\"],PDO::PARAM_INT);\n\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\n\t\t}\n\n\t\t$stmt=null;\n\t}", "public function guardarMatriz($nombreArchivo,$idUsuario,$contenidoArchivo){\n $path=\"../../reportesUsuario/\".$nombreArchivo.\".html\"; \n if(is_dir($path)){\n echo \"procedimiento para guardar\";\n $gestor=fopen($path,\"r+\");\n }else{\n echo \"El directorio especificado no es un Directorio Valido\";\n }\n }", "public static function generateTxt(){\n $archivo = fopen('documents/proveedores.txt','a');\n //------- Creamos el Encabepado --------\n fputs($archivo,\"codigo_del_proveedor\");\n fputs($archivo,\" ; \");\n fputs($archivo,\"descripcion_del_proveedor\");\n fputs($archivo,\" ; \");\n fputs($archivo,\"tipo_de_proveedor\");\n fputs($archivo,\" ; \");\n fputs($archivo,\"rif\");\n fputs($archivo,\" ; \");\n fputs($archivo,\"otra_descripcion\");\n fputs($archivo,\" ; \");\n fputs($archivo,\"direccion\");\n fputs($archivo,\" ; \");\n fputs($archivo,\"telefono\");\n\n fputs($archivo,\"\\n\");\n\n //--------------------------------\n\n //----------- --------------------------\n $rows=Proveedores::find()->all();\n foreach($rows as $row)\n {\n fputs($archivo,$row->codigo);\n fputs($archivo,\";\");\n fputs($archivo,Proveedores::getSubString($row->razon,100));\n fputs($archivo,\";\");\n fputs($archivo,$row->tipo);\n fputs($archivo,\";\");\n fputs($archivo,$row->cedrif);\n fputs($archivo,\";\");\n fputs($archivo,'XXX');\n fputs($archivo,\";\");\n if (is_null($row->direccion)) fputs($archivo,'XXX'); else fputs($archivo,$row->direccion);\n fputs($archivo,\";\");\n if (($row->telefono==\"\")) fputs($archivo,'XXX'); else fputs($archivo,$row->telefono);\n fputs($archivo,\"\\n\");\n\n\n\n }\n fclose($archivo);\n\n\n }", "public function CargarIngredientes()\n\t{\n\t\tself::SetNames();\n\t\tif(empty($_FILES[\"sel_file\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n //Aquí es donde seleccionamos nuestro csv\n $fname = $_FILES['sel_file']['name'];\n //echo 'Cargando nombre del archivo: '.$fname.' ';\n $chk_ext = explode(\".\",$fname);\n \n if(strtolower(end($chk_ext)) == \"csv\")\n {\n //si es correcto, entonces damos permisos de lectura para subir\n $filename = $_FILES['sel_file']['tmp_name'];\n $handle = fopen($filename, \"r\");\n \n while (($data = fgetcsv($handle, 1000, \";\")) !== FALSE)\n {\n //Insertamos los datos con los valores...\n\t\t\t \n$query = \" insert into ingredientes values (null, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $data[0]);\n\t\t$stmt->bindParam(2, $data[1]);\n\t\t$stmt->bindParam(3, $data[2]);\n\t\t$stmt->bindParam(4, $data[3]);\n\t\t$stmt->bindParam(5, $data[4]);\n\t\t$stmt->bindParam(6, $data[5]);\n\t\t$stmt->bindParam(7, $data[6]);\n\t\t$stmt->execute();\n\n\t\t$query = \" insert into kardexingredientes values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $codproceso);\n\t\t$stmt->bindParam(2, $codresponsable);\n\t\t$stmt->bindParam(3, $codproducto);\n\t\t$stmt->bindParam(4, $codingrediente);\n\t\t$stmt->bindParam(5, $movimiento);\n\t\t$stmt->bindParam(6, $entradas);\n\t\t$stmt->bindParam(7, $salidas);\n\t\t$stmt->bindParam(8, $stockactual);\n\t\t$stmt->bindParam(9, $preciounit);\n\t\t$stmt->bindParam(10, $costototal);\n\t\t$stmt->bindParam(11, $documento);\n\t\t$stmt->bindParam(12, $fechakardex);\n\t\t\n\t\t$codproceso = strip_tags($data[0]);\n\t\t$codresponsable = strip_tags(\"0\");\n\t\t$codproducto = strip_tags('0');\n\t\t$codingrediente = strip_tags($data[0]);\n\t\t$movimiento = strip_tags(\"ENTRADAS\");\n\t\t$entradas = strip_tags($data[2]);\n\t\t$salidas = strip_tags(\"0\");\n\t\t$stockactual = strip_tags($data[2]);\n\t\t$preciounit = strip_tags($data[3]);\n\t\t$costototal = rount($data[3]*$data[2],2);\n\t\t$documento = strip_tags(\"INVENTARIO INICIAL\");\n\t\t$fechakardex = strip_tags(date(\"Y-m-d\"));\n\t\t$stmt->execute();\n\t\t\t\t\n }\n //cerramos la lectura del archivo \"abrir archivo\" con un \"cerrar archivo\"\n fclose($handle);\n\t \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> LA CARGA MASIVA DE INGREDIENTES FUE REALIZADA EXITOSAMENTE </div>\";\necho \"</div>\";\nexit;\n \n }\n else\n {\n //si aparece esto es posible que el archivo no tenga el formato adecuado, inclusive cuando es cvs, revisarlo para ver si esta separado por \" , \"\n echo \"2\";\n\t\t exit;\n } \n}", "function process_form(){\n\t\n\tglobal $nombre;\n\tglobal $apellido;\n\t$nombre = $_POST['Nombre'];\n\t$apellido = $_POST['Apellidos'];\n\t\n\tprint(\"<table align='center' width='auto'>\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=3 class='BorderInf'>\n\t\t\t\t\t\tDATOS DEL USUARIO\n\t\t\t\t\t</th>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right' width=110px>\n\t\t\t\t\t\tID:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align='left'>\"\n\t\t\t\t\t\t.$_POST['id'].\n\t\t\t\t\t\"</td>\n\t\t\t\t\t<td rowspan='5' align='right' width='120px'>\n\t<img src='../Gch.Img.Admin/\".$_POST['myimg'].\"' height='120px' width='90px' />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\tNivel:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align='left'>\"\n\t\t\t\t\t\t.$_POST['Nivel'].\n\t\t\t\t\t\"</td>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\tReferencia:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align='left'>\"\n\t\t\t\t\t\t.$_POST['ref'].\n\t\t\t\t\t\"</td>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\tNombre:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align='left'>\"\n\t\t\t\t\t\t.$_POST['Nombre'].\n\t\t\t\t\t\"</td>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\tApellidos:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align='left'>\"\n\t\t\t\t\t\t.$_POST['Apellidos'].\n\t\t\t\t\t\"</td>\n\t\t\t\t</tr>\t\t\t\t\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\tDocumento:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align='left'>\"\n\t\t\t\t\t\t.$_POST['doc'].\n\t\t\t\t\t\"</td>\n\t\t\t\t</tr>\t\t\t\t\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\tN&uacute;mero:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align='left' colspan='2'>\"\n\t\t\t\t\t\t.$_POST['dni'].\n\t\t\t\t\t\"</td>\n\t\t\t\t</tr>\t\t\t\t\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\tControl:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align='left' colspan='2'>\"\n\t\t\t\t\t\t.$_POST['ldni'].\n\t\t\t\t\t\"</td>\n\t\t\t\t</tr>\t\t\t\t\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\tMail:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align='left' colspan='2'>\"\n\t\t\t\t\t\t.$_POST['Email'].\n\t\t\t\t\t\"</td>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\tUsuario:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align='left' colspan='2'>\"\n\t\t\t\t\t\t.$_POST['Usuario'].\n\t\t\t\t\t\"</td>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\tPassword:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align='left' colspan='2'>\"\n\t\t\t\t\t\t.$_POST['Password'].\n\t\t\t\t\t\"</td>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\tDirecci&oacute;n:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align='left' colspan='2'>\"\n\t\t\t\t\t\t.$_POST['Direccion'].\n\t\t\t\t\t\"</td>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\tTel&eacute;fono 1:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align='left' colspan='2'>\"\n\t\t\t\t\t\t.$_POST['Tlf1'].\n\t\t\t\t\t\"</td>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\tTel&eacute;fono 2:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align='left' colspan='2'>\"\n\t\t\t\t\t\t.$_POST['Tlf2'].\n\t\t\t\t\t\"</td>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\tLast IN:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align='left' colspan='2'>\"\n\t\t\t\t\t\t.$_POST['lastin'].\n\t\t\t\t\t\"</td>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\tLast Out:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align='left' colspan='2'>\"\n\t\t\t\t\t\t.$_POST['lastout'].\n\t\t\t\t\t\"</td>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\tNº Visitas:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align='left' colspan='2'>\"\n\t\t\t\t\t\t.$_POST['visitadmin'].\n\t\t\t\t\t\"</td>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=3 align='right' class='BorderSup'>\n\t<form name='closewindow' action='$_SERVER[PHP_SELF]' onsubmit=\\\"window.close()\\\">\n\t\t\t\t\t\t\t\t\t\t\t<input type='submit' value='CERRAR VENTANA' />\n\t\t\t\t\t\t\t\t\t\t\t<input type='hidden' name='oculto2' value=1 />\n\t\t\t</form>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\"); \n\n\t\t}", "function add_or_update_personal_data(){\n global $database;\n\n $image = $_FILES['file']['name'];\n $desired_position = xss_clean('POST','desired_position');\n $name = xss_clean('POST','name');\n $address = xss_clean('POST','address');\n $province = xss_clean('POST','province');\n $telephone = xss_clean('POST','telephone');\n $email = xss_clean('POST','email');\n $date_of_birth = xss_clean('POST','date_of_birth');\n $civil_status = xss_clean('POST','civil_status');\n $height = xss_clean('POST','height');\n $religion = xss_clean('POST','religion');\n $spouse = xss_clean('POST','spouse');\n $children = !empty($_POST['children']) ? implode(',',$_POST['children']) : ',';\n $father_name = xss_clean('POST','father_name');\n $mother_name = xss_clean('POST','mother_name');\n $language = !empty($_POST['language']) ? implode(',',$_POST['language']) : ',';\n $person_emergency = xss_clean('POST','person_emergency');\n $person_emergency_details = xss_clean('POST','person_emergency_details');\n $gender = xss_clean('POST','gender');\n $cellphone = xss_clean('POST','cellphone');\n $place_of_birth = xss_clean('POST','place_of_birth');\n $citizenship = xss_clean('POST','citizenship');\n $weight = xss_clean('POST','weight');\n $spouse_occupation = xss_clean('POST','spouse_occupation');\n $children_date_of_birth = !empty($_POST['children_date_of_birth']) ? implode(',',$_POST['children_date_of_birth']) : ',';\n $father_occupation = xss_clean('POST','father_occupation');\n $mother_occupation = xss_clean('POST','mother_occupation');\n\n\n $elementary = xss_clean('POST','elementary');\n $elementary_year_graduate = xss_clean('POST','elementary_year_graduate');\n $high_school = xss_clean('POST','high_school');\n $high_school_year_graduate = xss_clean('POST','high_school_year_graduate');\n $college = xss_clean('POST','college');\n $college_year_graduate = xss_clean('POST','college_year_graduate');\n $degree_received = xss_clean('POST','degree_received');\n $special_skills = !empty($_POST['special_skills']) ? implode(',',$_POST['special_skills']) : ',';\n\n\n $company_name_1 = xss_clean('POST','company_name_1');\n $position_1 = xss_clean('POST','position_1');\n $from_1 = xss_clean('POST','from_1');\n $to_1 = xss_clean('POST','to_1');\n $company_name_2 = xss_clean('POST','company_name_2');\n $position_2 = xss_clean('POST','position_2');\n $from_2 = xss_clean('POST','from_2');\n $to_2 = xss_clean('POST','to_2');\n\n\n $c_name_1 = xss_clean('POST','c_name_1');\n $c_company_1 = xss_clean('POST','c_company_1');\n $c_position_1 = xss_clean('POST','c_position_1');\n $c_contact_no_1 = xss_clean('POST','c_contact_no_1');\n $c_name_2 = xss_clean('POST','c_name_2');\n $c_company_2 = xss_clean('POST','c_company_2');\n $c_position_2 = xss_clean('POST','c_position_2');\n $c_contact_no_2 = xss_clean('POST','c_contact_no_2');\n\n\n\n\n foreach($_POST as $key => $value) {\n $validate = $_POST[$key];\n if($validate == '') {\n $_SESSION[$key] = $key. \" field is required\";\n }\n }\n\n if(isset($_POST['personal_data_id'])) {\n $cond = '';\n if(empty($_FILES['file']['name'])) {\n $cond .= '';\n } else { \n $cond .= \"image = '$image' ,\";\n }\n $database->query(\"UPDATE personal_data_tbl SET $cond desired_position = '$desired_position',name = '$name' ,address = '$address' ,province = '$province' ,telephone = '$telephone' ,email = '$email' ,date_of_birth = '$date_of_birth' ,civil_status = '$civil_status' ,height = '$height' ,religion = '$religion' ,spouse = '$spouse' ,children = '$children' ,father_name = '$father_name' ,mother_name = '$mother_name' ,language = '$language' ,person_emergency = '$person_emergency' ,person_emergency_details = '$person_emergency_details' ,gender = '$gender' ,cellphone = '$cellphone' ,place_of_birth = '$place_of_birth' ,citizenship = '$citizenship' ,weight = '$weight' ,spouse_occupation = '$spouse_occupation' ,children_date_of_birth = '$children_date_of_birth' ,father_occupation = '$father_occupation' ,mother_occupation = '$mother_occupation' WHERE personal_data_id = \".$_POST['personal_data_id']);\n \n $database->query(\"UPDATE educational_background_tbl SET elementary = '$elementary', elementary_year_graduate = '$elementary_year_graduate', high_school = '$high_school', high_school_year_graduate = '$high_school_year_graduate', college = '$college', college_year_graduate = '$college_year_graduate', degree_received = '$degree_received', special_skills = '$special_skills' WHERE personal_data_id = \".$_POST['personal_data_id']);\n\n $database->query(\"UPDATE employment_record_tbl SET company_name_1 = '$company_name_1', position_1 = '$position_1', from_1 = '$from_1', to_1 = '$to_1', company_name_2 = '$company_name_2', position_2 = '$position_2', from_2 = '$from_2', to_2 = '$to_2' WHERE personal_data_id = \".$_POST['personal_data_id']);\n\n $database->query(\"UPDATE character_reference_tbl SET c_name_1 = '$c_name_1', c_company_1 = '$c_company_1', c_position_1 = '$c_position_1', c_contact_no_1 = '$c_contact_no_1', c_name_2 = '$c_name_2', c_company_2 = '$c_company_2', c_position_2 = '$c_position_2', c_contact_no_2 = '$c_contact_no_2' WHERE personal_data_id =\".$_POST['personal_data_id']);\n move_uploaded_file($_FILES['file']['tmp_name'],'assets/image/'.$_FILES['file']['name']);\n\n header('location:edit.php?id='.$_POST['personal_data_id']);\n } else {\n \n \n\n if ($_FILES[\"file\"][\"size\"] > 3000000) {\n $_SESSION['file'] = \"Sorry, your file is too large. image accept less than 3 MB\";\n } else {\n $query = $database->query(\"INSERT INTO personal_data_tbl \n (image,desired_position,name,address,province,telephone,email,date_of_birth,civil_status,height,religion,spouse,children,father_name,mother_name,language,person_emergency,person_emergency_details,gender,cellphone,place_of_birth,citizenship,weight,spouse_occupation,children_date_of_birth,father_occupation,mother_occupation) \n VALUES \n ('$image','$desired_position','$name','$address','$province','$telephone','$email','$date_of_birth','$civil_status','$height','$religion','$spouse','$children','$father_name','$mother_name','$language','$person_emergency','$person_emergency_details','$gender','$cellphone','$place_of_birth','$citizenship','$weight','$spouse_occupation','$children_date_of_birth','$father_occupation','$mother_occupation')\");\n if($query) {\n $id = $database->insert_id;\n $database->query(\"INSERT INTO educational_background_tbl \n (personal_data_id,elementary,elementary_year_graduate,high_school,high_school_year_graduate,college,college_year_graduate,degree_received,special_skills) \n VALUES \n ('$id','$elementary','$elementary_year_graduate','$high_school','$high_school_year_graduate','$college','$college_year_graduate','$degree_received','$special_skills')\");\n \n $database->query(\"INSERT INTO employment_record_tbl \n (personal_data_id,company_name_1,position_1,from_1,to_1,company_name_2,position_2,from_2,to_2) \n VALUES \n ('$id','$company_name_1','$position_1','$from_1','$to_1','$company_name_2','$position_2','$from_2','$to_2')\");\n \n $database->query(\"INSERT INTO character_reference_tbl \n (personal_data_id,c_name_1,c_company_1,c_position_1,c_contact_no_1,c_name_2,c_company_2,c_position_2,c_contact_no_2) \n VALUES \n ('$id','$c_name_1','$c_company_1','$c_position_1','$c_contact_no_1','$c_name_2','$c_company_2','$c_position_2','$c_contact_no_2')\");\n \n move_uploaded_file($_FILES['file']['tmp_name'],'assets/image/'.$_FILES['file']['name']);\n }\n }\n \n }\n}", "function importar_requerimientos_operaciones(){\n if ($this->input->post()) {\n $post = $this->input->post();\n $proy_id = $post['proy_id']; /// proy id\n $pfec_id = $post['pfec_id']; /// pfec id\n $com_id = $post['com_id']; /// com id\n \n $proyecto = $this->model_proyecto->get_id_proyecto($proy_id); /// DATOS DEL PROYECTO\n $fase = $this->model_faseetapa->get_id_fase($proy_id); //// DATOS DE LA FASE ACTIVA\n\n $monto_asig=$this->model_ptto_sigep->suma_ptto_accion($proyecto[0]['aper_id'],1);\n $monto_prog=$this->model_ptto_sigep->suma_ptto_accion($proyecto[0]['aper_id'],2);\n $saldo=round(($monto_asig[0]['monto']-$monto_prog[0]['monto']),2);\n\n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n\n $lineas = file($archivotmp);\n if($this->suma_monto_total($lineas)<=$saldo){\n /*------------------- Migrando ---------------*/\n $lineas = file($archivotmp);\n $i=0;\n $nro=0;\n //Recorremos el bucle para leer línea por línea\n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){\n $datos = explode(\";\",$linea);\n \n if(count($datos)==21){\n $cod_ope = (int)$datos[0]; //// Codigo Operacion\n $cod_partida = (int)$datos[1]; //// Codigo partida\n $verif_com_ope=$this->model_producto->verif_componente_operacion($com_id,$cod_ope);\n $par_id = $this->minsumos->get_partida_codigo($cod_partida); //// DATOS DE LA FASE ACTIVA\n\n $detalle = utf8_encode(trim($datos[3])); //// descripcion\n $unidad = utf8_encode(trim($datos[4])); //// Unidad\n $cantidad = (int)$datos[5]; //// Cantidad\n $unitario = (float)$datos[6]; //// Costo Unitario\n $total = (float)$datos[7]; //// Costo Total\n if(!is_numeric($unitario)){\n if($cantidad!=0){\n $unitario=round(($total/$cantidad),2); \n }\n }\n\n $var=8;\n for ($i=1; $i <=12 ; $i++) {\n $m[$i]=(float)$datos[$var]; //// Mes i\n if($m[$i]==''){\n $m[$i]=0;\n }\n $var++;\n }\n\n $observacion = utf8_encode(trim($datos[20])); //// Observacion\n\n if(count($verif_com_ope)==1 & count($par_id)!=0 & $cod_partida!=0){\n $nro++;\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'ins_codigo' => $this->session->userdata(\"name\").'/REQ/'.$this->gestion, /// Codigo Insumo\n 'ins_fecha_requerimiento' => date('d/m/Y'), /// Fecha de Requerimiento\n 'ins_detalle' => strtoupper($detalle), /// Insumo Detalle\n 'ins_cant_requerida' => round($cantidad,0), /// Cantidad Requerida\n 'ins_costo_unitario' => $unitario, /// Costo Unitario\n 'ins_costo_total' => $total, /// Costo Total\n 'ins_tipo' => 1, /// Ins Tipo\n 'ins_unidad_medida' => strtoupper($unidad), /// Insumo Unidad de Medida\n 'par_id' => $par_id[0]['par_id'], /// Partidas\n 'ins_observacion' => strtoupper($observacion), /// Observacion\n 'fecha_creacion' => date(\"d/m/Y H:i:s\"),\n 'fun_id' => $this->session->userdata(\"fun_id\"), /// Funcionario\n 'aper_id' => $proyecto[0]['aper_id'], /// aper id\n 'num_ip' => $this->input->ip_address(), \n 'nom_ip' => gethostbyaddr($_SERVER['REMOTE_ADDR']),\n );\n $this->db->insert('insumos', $data_to_store); ///// Guardar en Tabla Insumos \n $ins_id=$this->db->insert_id();\n\n /*----------------------------------------------------------*/\n $data_to_store2 = array( ///// Tabla InsumoProducto\n 'prod_id' => $verif_com_ope[0]['prod_id'], /// act_id\n 'ins_id' => $ins_id, /// ins_id\n );\n $this->db->insert('_insumoproducto', $data_to_store2);\n /*----------------------------------------------------------*/\n $gestion_fase=$fase[0]['pfec_fecha_inicio'];\n\n /*---------------- Recorriendo Gestiones de la Fase -----------------------*/\n for ($g=$fase[0]['pfec_fecha_inicio']; $g <=$fase[0]['pfec_fecha_fin'] ; $g++){\n $data_to_store = array( \n 'ins_id' => $ins_id, /// Id Insumo\n 'g_id' => $g, /// Gestion\n 'insg_monto_prog' => $total, /// Monto programado\n );\n $this->db->insert('insumo_gestion', $data_to_store); ///// Guardar en Tabla Insumo Gestion\n $insg_id=$this->db->insert_id();\n\n $ptto_fase_gestion = $this->model_faseetapa->fase_gestion($fase[0]['id'],$g); //// DATOS DE LA FASE GESTION\n $fuentes=$this->model_faseetapa->fase_presupuesto_id($ptto_fase_gestion[0]['ptofecg_id']);\n\n if(count($fuentes)==1){\n /*------------------- Guardando Fuente Financiamiento ------*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store3 = array( \n 'insg_id' => $insg_id, /// Id Insumo gestion\n 'ifin_monto' => $total, /// Monto programado\n 'ifin_gestion' => $g, /// Gestion\n 'ffofet_id' => $fuentes[0]['ffofet_id'], /// ffotet id\n 'ff_id' => $fuentes[0]['ff_id'], /// ff id\n 'of_id' => $fuentes[0]['of_id'], /// ff id\n 'nro_if' => 1, /// Nro if\n );\n $this->db->insert('insumo_financiamiento', $data_to_store3); ///// Guardar en Tabla Insumo Financiamiento\n $ifin_id=$this->db->insert_id();\n\n for ($p=1; $p <=12 ; $p++) { \n if($m[$p]!=0 & is_numeric($unitario)){\n $data_to_store4 = array( \n 'ifin_id' => $ifin_id, /// Id Insumo Financiamiento\n 'mes_id' => $p, /// Mes \n 'ipm_fis' => $m[$p], /// Valor mes\n );\n $this->db->insert('ifin_prog_mes', $data_to_store4); ///// Guardar en Tabla Insumo Financiamiento Programado Mes\n }\n }\n /*-----------------------------------------------------------*/ \n }\n }\n\n }\n\n }\n\n }\n $i++;\n }\n\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'');\n /*--------------------------------------------*/\n }\n else{\n $this->session->set_flashdata('danger','COSTO PROGRAMADO A SUBIR ES MAYOR AL SALDO POR PROGRAMAR. VERIFIQUE PLANTILLA A MIGRAR');\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n }\n } \n elseif (empty($file_basename)) {\n $this->session->set_flashdata('danger','POR FAVOR SELECCIONE ARCHIVO CSV');\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n } \n elseif ($filesize > 100000000) {\n $this->session->set_flashdata('danger','TAMAÑO DEL ARCHIVO');\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n } \n else {\n $mensaje = \"SOLO SE PERMITEN ESTOS ARCHIVOS : \" . implode(', ', $allowed_file_types);\n $this->session->set_flashdata('danger',$mensaje);\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n }\n\n } else {\n show_404();\n }\n }", "public function desenfocarCamaraAlumnos1() {\n\n self::$alumnos1->desenfocar();\n\n }", "static public function mdlAltaPerfil($tabla, $datos){\r\n\r\n\t\t$sh = Conexion::conectar()->prepare(\"SELECT SEC_ADMINISTRADORES.NEXTVAL FROM DUAL\");\r\n\t\t$sh -> execute();\r\n\t\t$id = $sh -> fetchColumn(0);\r\n\r\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(IDADMINISTRADOR, NOMBRE, APELLIDO, DNI, TELEFONO, DOMICILIO, EMAIL, PASS, FECHANACIMIENTO, FOTO, PERFIL) VALUES ($id, :nombre, :apellido, :dni, :telefono, :domicilio, :email, :pass, :fechanacimiento, :foto, :perfil)\");\r\n\t\t$ff = date(\"d/m/Y\", strtotime($datos[\"fechanacimiento\"]));\r\n\r\n\t\t$stmt->bindParam(\":nombre\", $datos[\"nombre\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":apellido\", $datos[\"apellido\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":dni\", $datos[\"dni\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":telefono\", $datos[\"telefono\"], PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(\":domicilio\", $datos[\"domicilio\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":email\", $datos[\"email\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":pass\", $datos[\"pass\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":fechanacimiento\", $ff);\r\n\t\t$stmt->bindParam(\":foto\", $datos[\"foto\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":perfil\", $datos[\"perfil\"], PDO::PARAM_STR);\r\n\r\n\t\t$valor = array(\r\n\t\t\t\t\t\t\"id\" => $id,\r\n\t\t\t\t\t\t\"ruta\" => $datos[\"foto\"]\r\n\t\t\t\t\t );\r\n\r\n\t\tif($stmt->execute()){\r\n\r\n\t\t\treturn $valor;\t\r\n\r\n\t\t}else{\r\n\r\n\t\t\treturn \"error\";\r\n\t\t\r\n\t\t}\r\n\r\n\t}", "public function examen(){\r\n\t\tparent::conectaBDMy();\t \r\n\t\t$this->idExamen=\"\";\t\t\r\n\t\t$this->tipoExamen=\"\";\t\r\n\t\t$this->descripcion=\"\";\r\n\t}", "public function processarArquivo() {\n\n /**\n * Cria uma instancia de DBLayoutReader referente ao arquivo a ser processado e o layout cadastrado\n */\n $this->oLayoutReader = new DBLayoutReader($this->iCodigoArquivo, $this->sNomeArquivo, true, false);\n\n $_SESSION[\"DB_usaAccount\"] = \"1\";\n\n /**\n * Remove da base todos os registros referentes a situação a ser processada. No caso, situacao 2 - BPC\n */\n $this->removerSituacao();\n $rsArquivo = fopen($this->sNomeArquivo, 'r');\n $iLinha = 0;\n\n /**\n * Percorre o arquivo para tratamento das linhas\n */\n while (!feof($rsArquivo)) {\n\n $iLinha++;\n $sLinha = fgets($rsArquivo);\n $oLinha = $this->oLayoutReader->processarLinha($sLinha, 0, true, false, false);\n\n if (!$oLinha) {\n continue;\n }\n\n /**\n * Salva a primeira linha do arquivo por se o cabeçalho do mesmo, adicionando no arquivo de não processados\n * Ou se o nome da pessoa ou data de nascimento estiverem vazias\n */\n if ($iLinha == 1 || empty($oLinha->nome_pessoa) || empty($oLinha->data_nascimento)) {\n\n $this->escreveArquivoRegistrosNaoProcessados($sLinha);\n continue;\n }\n\n $oDataNascimento = new DBDate($oLinha->data_nascimento);\n $dtNascimento = $oDataNascimento->convertTo(DBDate::DATA_EN);\n\n /**\n * Chama o método validar, responsavel por verificar se existe algum registro com os dados passados\n * Passamos o nome da pessoa da linha atual do arquivo, e a data de nascimento, já tratada, no formato do banco\n */\n $iCadastroUnico = $this->validar($oLinha->nome_pessoa, $dtNascimento);\n\n /**\n * Caso tenha sido retornado o sequencial do cidadao na validacao, chama o metodo insereSituacao para inserir o\n * registro para o cidadao com tipo de situacao 2\n */\n if ($iCadastroUnico != null) {\n $this->insereSituacao($iCadastroUnico);\n } else {\n\n $this->escreveArquivoRegistrosNaoProcessados($sLinha);\n $this->lTemNaoProcessado = true;\n }\n\n unset($oLinha);\n unset($oDataNascimento);\n }\n\n fclose($this->fArquivoLog);\n }", "public function enfocarCamaraAlumnos2() {\n\n self::$alumnos2->enfocar();\n\n }", "public function actualizar_Datos_Usuario($documento){\n\t\t/*echo \"<br>->docu->\".$documento;\n\t\techo \"<br>->\".$this->usuario->get_Nid();*/\n\t\t$sql = \"UPDATE perfiles, usuarios SET Documento='\".$this->usuario->get_Nid().\"',\n\t\t\t\t\t\t\t\t\tNombres='\".$this->usuario->get_Nombres().\"',\n\t\t\t\t\t\t\t\t\tApellidos = '\".$this->usuario->get_Apellidos().\"',\n\t\t\t\t\t\t\t\t\tUsuario = '\".$this->usuario->get_Usuario().\"',\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tPregunta = '\".$this->usuario->get_Pregunta().\"',\n\t\t\t\t\t\t\t\t\tRespuesta = '\".$this->usuario->get_Respuesta().\"',\n\t\t\t\t\t\t\t\t\tTipo_Documento = '\".$this->usuario->get_TipoId().\"',\n\t\t\t\t\t\t\t\t\tCiudad = '\".$this->usuario->get_Ciudad().\"',\n\t\t\t\t\t\t\t\t\tDireccion = '\".$this->usuario->get_Direccion().\"',\n\t\t\t\t\t\t\t\t\tEdad = '\".$this->usuario->get_Edad().\"',\n\t\t\t\t\t\t\t\t\tFoto = '\".$this->usuario->get_Foto().\"',\n\t\t\t\t\t\t\t\t\tTelefono = '\".$this->usuario->get_Celular().\"',\n\t\t\t\t\t\t\t\t\tCorreo_Electronico = '\".$this->usuario->get_Email().\"',\n\t\t\t\t\t\t\t\t\tGenero = '\".$this->usuario->get_Genero().\"',\n\t\t\t\t\t\t\t\t\tusuarios.perfiles_Nombre = perfiles.Nombre\t\t\t\t\t\t\t\t\t\n\t\t\t WHERE Documento='\".$documento.\"' AND perfiles.Nombre ='\".$this->usuario->get_Perfil().\"';\";\n\n\n\t\t$salida = 0;\n\t\t$valida = new Validacion_Datos(); // <- Para validar los tipos de datos\n\t\t// Validacion de los minimos\n\t\tif(!(strlen($this->usuario->get_Nid()) > 7))\t\t\t$salida = 2;\n\t\telseif(!(strlen($this->usuario->get_Nombres()) > 1))\t$salida = 3;\n\t\telseif(!(strlen($this->usuario->get_Apellidos()) > 1))\t$salida = 4;\n\t\telseif(!(strlen($this->usuario->get_Usuario()) > 4))\t$salida = 5;\n\t\telseif(!(strlen($this->usuario->get_Password()) > 4))\t$salida = 6;\n\t\telseif(!(strlen($this->usuario->get_Pregunta()) > 9))\t$salida = 7;\n\t\telseif(!(strlen($this->usuario->get_Respuesta()) > 1))\t$salida = 8;\n\t\telseif(!(strlen($this->usuario->get_TipoId()) > 1))\t\t$salida = 9;\n\t\telseif(!(strlen($this->usuario->get_Ciudad()) > 1))\t\t$salida = 10;\n\t\telseif(!(strlen($this->usuario->get_Direccion()) > 2))\t$salida = 11;\n\t\telseif(!(strlen($this->usuario->get_Edad()) > 0))\t\t$salida = 12;\n\t\telseif(!(strlen($this->usuario->get_Foto()) > 2))\t\t$salida = 13;\n\t\telseif(!(strlen($this->usuario->get_Celular()) > 7))\t$salida = 14;\n\t\telseif(!(strlen($this->usuario->get_Email()) > 6))\t\t$salida = 15;\n\t\telseif(!(strlen($this->usuario->get_Genero()) > 0))\t\t$salida = 16;\n\t\telseif(!(strlen($this->usuario->get_Perfil()) > 0))\t\t$salida = 17;\n\t\t// Validacion de los tipos de datos (Numérico,Alfabético,Alfanumérico)\n\t\telseif(!($valida->is_Number($this->usuario->get_Nid())))\t\t\t\t$salida = 18;\n\t\telseif(!($valida->is_Alphanumeric($this->usuario->get_Usuario())))\t\t$salida = 19;\n\t\telseif(!($valida->is_Alphabetic($this->usuario->get_Nombres())))\t\t$salida = 20;\n\t\telseif(!($valida->is_Alphabetic($this->usuario->get_Apellidos())))\t\t$salida = 21;\n\t\telseif(!($valida->is_Alphanumeric($this->usuario->get_Password())))\t\t$salida = 22;\n\t\telseif(!($valida->is_Alphanumeric($this->usuario->get_Respuesta())))\t$salida = 24;\n\t\telseif(!($valida->is_Alphabetic($this->usuario->get_Ciudad())))\t\t\t$salida = 25;\n\t\telseif(!($valida->is_Number($this->usuario->get_Edad())))\t\t\t\t$salida = 26;\n\t\telseif(!($valida->is_Number($this->usuario->get_Celular())))\t\t\t$salida = 28;\n\n\n\t\t///////////////////////////////////////////////////////////////////////////\n\n\t\t\n\t\telseif($this->bd->insertar($sql))\n\t\t\t$salida = true;\n\t\telse $salida = 31;\n\t\t\n\n\t\treturn $salida;\n\t}", "public function obtenerArchivo($nombre) \n\t{\n if(!isset($_FILES['foto']))\n {\n throw new Exception('Error: No existe foto');\n }\n if ( 0 < $_FILES['foto']['error'] ) {\n\t\t\treturn null;\n\t\t}\n\t\telse {\n $foto = $_FILES['foto']['name'];\n\t\t\t\n $extension= explode(\".\", $foto);\n $tipo = strtolower(pathinfo($_FILES['foto']['name'], PATHINFO_EXTENSION));\n if($tipo != \"jpg\" && $tipo != \"jpeg\" && $tipo != \"png\") {\n throw new Exception('Error: de formato, solo se acepta jpg jpeg png');\n }\n\n $nombreNuevo = 'fotosEmpleados/'.$nombre.\".\".strtolower($extension[1]);\n return $nombreNuevo;\n\t\t}\n }", "public function addNewNoteUniteEn($bdd, $file, $idAdmin, $idEtab)\n {\n $valAjouter = \"\";\n if (isset($_POST['ajouter'])) {\n if (isset($file)) {\n $handle = fopen($file[\"file\"][\"tmp_name\"], \"r\");\n $flag = true;\n while (($data = fgetcsv($handle, 10000, \";\")) !== FALSE) {\n if ($flag) {\n $flag = false;\n continue;\n }\n $requete = 'INSERT INTO `uniteenseignement` (\n `idUniteEnseignement`, `categorie`,\n `codeUniteEnseignement`, `libelle`,\n `M`, `A`, `S`, `MEN`, `nbCredit`, `semestreUE`, `CC`,\n `TPE`, `TP`, `EE`, `idEtablissement`, `matricule`, `idAdministrateur`)\n VALUES (\"\", \"' . $data[1] . '\",\n \"' . $data[2] . '\", \"' . $data[3] . '\",\n \"' . $data[4] . '\", \"' . $data[5] . '\",\n \"' . $data[6] . '\", \"' . $data[7] . '\",\n \"' . $data[8] . '\", \"' . $data[9] . '\",\n \"' . $data[10] . '\",\"' . $data[11] . '\",\n \"' . $data[12] . '\", \"' . $data[13] . '\",\n \"' . $idEtab . '\", \"' . $data[14] . '\", \"' . $idAdmin . '\");';\n $addNote = $bdd->prepare($requete);\n $addNote->execute();\n }\n fclose($handle);\n $valAjouter = \"Ajout effectuer avec succes !\";\n }\n }\n return $valAjouter;\n }", "function actualizar_palabra_asociada_archivo_repositorio($file_id,$id_palabra) {\n\n\t\t$UpdateRecords = \"UPDATE repositorio_archivos SET id_palabra='$id_palabra'\n\t\tWHERE file_id='$file_id'\";\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($UpdateRecords); \t\n\t\tmysql_close($connection);\n\t}", "public function import(){\n if(\\Storage::disk('local')->exists('/public/universidades.xlsx')){\n Excel::load('public/storage/universidades.xlsx', function($reader) {\n foreach ($reader->get() as $book) {\n $universidad = new University();\n $universidad->nombre = $book->nombre;\n $universidad->save();\n }\n });\n\n \\Alert::message('Universidades importadas exitosamente', 'success');\n return redirect('/universidades');\n }else{\n \\Alert::message('El archivo universidades.csv no existe, importalo por favor', 'danger');\n return redirect('/universidades');\n }\n }", "function cargar_dato($dato)\t\t\t\r\n {\r\n $ncampos=5;\r\n\tif($ncampos==count($dato))\r\n\t{\r\n\t $this->id_aplicacion=$dato[0];\r\n\t $this->nombre_subaplicacion=$dato[1]; \r\n $this->file_subaplicacion=$dato[2];\r\n $this->imagen_subaplicacion=$dato[3];\r\n $this->orden_subaplicacion=$dato[4];\r\n\t} \r\n }", "function analiza_archivo_presupuesto_rf_lib($file)\n{\n $cliente=new cliente();\n if (!file_exists($file)){\n exit(\"File not found\");\n }\n $htmlContent=file_get_contents($file);\n $DOM=new DOMDocument();\n //echo $htmlContent;\n @$DOM->loadHTML($htmlContent);\n $Header = $DOM->getElementsByTagName('td');\n $Detail = $DOM->getElementsByTagName('td');\n foreach($Header as $NodeHeader)\n {\n $aDataTableHeaderHTML[]=trim($NodeHeader->textContent);\n //echo $aDataTableHeaderHTML;\n }\n print_r($aDataTableHeaderHTML);\n \n \n $fecha_presupuesto=substr($aDataTableHeaderHTML[5],23,10);\n $nombre_cliente=$aDataTableHeaderHTML[8];\n $dirección_cliente=$aDataTableHeaderHTML[10];\n $rpu=$aDataTableHeaderHTML[12];\n $telefono=$aDataTableHeaderHTML[14];\n $presupuesto=$aDataTableHeaderHTML[16];\n $marca_instalar=$aDataTableHeaderHTML[26];\n $modelo_instalar=$aDataTableHeaderHTML[27];\n $capacidad_instalar=$aDataTableHeaderHTML[28];\n $monto_financiar=$aDataTableHeaderHTML[29];\n $marca_retirar=$aDataTableHeaderHTML[37];\n $capacidad_retirar=$aDataTableHeaderHTML[38];\n $modelo_retirar=$aDataTableHeaderHTML[39];\n $antiguedad=$aDataTableHeaderHTML[40];\n $solicitud=$aDataTableHeaderHTML[42];\n $precio_sin_iva=$aDataTableHeaderHTML[46];\n $iva=ltrim($aDataTableHeaderHTML[49]);\n $bonificacion=$aDataTableHeaderHTML[61];\n $monto_financiar2=$aDataTableHeaderHTML[64];\n $excedente=$aDataTableHeaderHTML[58];\n $interes=$aDataTableHeaderHTML[67];\n $iva_interes=$aDataTableHeaderHTML[70];\n $financiado=$aDataTableHeaderHTML[73];\n $amortizacion=$aDataTableHeaderHTML[76];\n $num_pagos=substr($aDataTableHeaderHTML[74],0,2);\n $fecha_presupuesto=obtiene_fecha($fecha_presupuesto);\n $precio_sin_iva=substr($precio_sin_iva,1,9);\n $iva=substr($iva,17,8);\n $monto_financiar=substr($monto_financiar2,16,10);\n $excedente=substr($excedente,16,7);\n $interes=substr($interes,17,8);\n $iva_interes=substr($iva_interes,16,7);\n $financiado=substr($financiado,17,9);\n $amortizacion=substr($amortizacion,17,6);\n //echo $fecha_presupuesto.\"\\n\";\n //echo $nombre_cliente.\"\\n\";\n //echo $rpu.\"\\n\";\n //echo $presupuesto.\"\\n\";\n //echo $telefono.\"\\n\";\n //echo $marca_instalar.\"\\n\";\n //echo $modelo_instalar.\"\\n\";\n //echo $capacidad_instalar.\"\\n\";\n //echo $marca_retirar.\"\\n\";\n //echo $modelo_retirar.\"\\n\";\n //echo $capacidad_retirar.\"\\n\";\n //echo $solicitud.\"\\n\";\n //echo $precio_sin_iva.\"\\n\";\n //echo $iva.\"\\n\";\n //echo $monto_financiar.\"\\n\";\n //echo $excedente.\"\\n\";\n //echo $interes.\"\\n\";\n //echo $iva_interes.\"\\n\"; //23\n //echo $financiado.\"\\n\"; //26\n //echo $amortizacion.\"\\n\"; //23\n //echo $num_pagos.\"\\n\";\n $sp=\"RF\";\n $activo=1;\n $sql=\"INSERT INTO\n presupuestos (fecha,nombre,rpu,num_presupuesto,telefono,marca_ins,modelo_ins,capacidad_ins,\n marca_ret,modelo_ret,capacidad_ret,solicitud,instalacion,precio_sin_iva,iva_equipo,monto_financiar,\n excedente,interes,iva_interes,total_financiamiento,amortizacion,pagos,subprograma,activo)\n VALUES (\n '$fecha_presupuesto', '$nombre_cliente','$rpu','$presupuesto','$telefono','$marca_instalar',\n '$modelo_instalar','$capacidad_instalar','$marca_retirar','$modelo_retirar','$capacidad_retirar',\n '$solicitud','0','$precio_sin_iva','$iva','$monto_financiar','$excedente','$interes',\n '$iva_interes','$financiado','$amortizacion','$num_pagos','$sp','$activo'\n )\";\n $resp=$cliente->insertar($sql);\n if($resp)\n {\n echo \"Se guardo correctamente\";\n }\n else{\n echo \"No se pudo guardar\";\n }\necho $sql;\n\n\n\n\n}", "public function actualizar_alumno1($columnas,$datos){\n\t\t$sql = \"UPDATE INTO alumno (\";\n\t\tforeach ($columnas as $columna) {\n\t\t\t$sql += $columna.',';\n\t\t}\n\t\ttrim($sql,',');\n\t\t$sql += ') VALUES (';\n\t\tforeach ($datos as $dato) {\n\t\t\t$sql += $dato.',';\n\t\t}\n\t\ttrim($sql,',');\n\t\t$sql += ')';\n\t\treturn $this->db->query($sql);\n\t}", "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 run()\n {\n \n\n \\DB::table('archivo')->delete();\n \n \\DB::table('archivo')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'nombre' => 'Representación Legal.pdf',\n 'path' => 'institucion/1/Representacion Legal.pdf',\n 'user_id' => 1,\n 'formato_id' => 3,\n 'tipo_archivo_id' => 1,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 1 => \n array (\n 'id' => 2,\n 'nombre' => 'Acta de Nombramiento.pdf',\n 'path' => 'institucion/1/Acta de Nombramiento.pdf',\n 'user_id' => 1,\n 'formato_id' => 3,\n 'tipo_archivo_id' => 1,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 2 => \n array (\n 'id' => 3,\n 'nombre' => 'Acta de Posesión.pdf',\n 'path' => 'institucion/1/Acta de Posesion.pdf',\n 'user_id' => 1,\n 'formato_id' => 3,\n 'tipo_archivo_id' => 1,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 3 => \n array (\n 'id' => 4,\n 'nombre' => 'Cámara de Comercio.pdf',\n 'path' => 'institucion/1/Camara de Comercio.pdf',\n 'user_id' => 1,\n 'formato_id' => 3,\n 'tipo_archivo_id' => 1,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 4 => \n array (\n 'id' => 5,\n 'nombre' => 'Resolución/Decreto.pdf',\n 'path' => 'institucion/1/Resolucion-Decreto.pdf',\n 'user_id' => 1,\n 'formato_id' => 3,\n 'tipo_archivo_id' => 1,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 5 => \n array (\n 'id' => 6,\n 'nombre' => 'Personería Jurídica.pdf',\n 'path' => 'institucion/1/Personeria Juridica.pdf',\n 'user_id' => 1,\n 'formato_id' => 3,\n 'tipo_archivo_id' => 1,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 6 => \n array (\n 'id' => 7,\n 'nombre' => 'Carta del Decano(a).pdf',\n 'path' => 'institucion/1/Carta del Decano(a).pdf',\n 'user_id' => 1,\n 'formato_id' => 3,\n 'tipo_archivo_id' => 1,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 7 => \n array (\n 'id' => 8,\n 'nombre' => 'Borrador_Convenio_AGREEMENT FOR STUDENT EXCHANGES ',\n 'path' => 'institucion/1/convenios/Borrador_Convenio_AGREEMENT FOR STUDENT EXCHANGES.html',\n 'user_id' => 1,\n 'formato_id' => 5,\n 'tipo_archivo_id' => 1,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => '2017-09-20 17:21:51',\n 'updated_at' => '2017-09-20 17:21:51',\n 'deleted_at' => NULL,\n ),\n 8 => \n array (\n 'id' => 9,\n 'nombre' => 'Borrador_Convenio_Doble_Titulación (1)',\n 'path' => 'institucion/1/convenios/Borrador_Convenio_Doble_Titulación (1).htm',\n 'user_id' => 1,\n 'formato_id' => 5,\n 'tipo_archivo_id' => 2,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => '2017-09-28 14:58:36',\n 'updated_at' => '2017-09-28 14:58:36',\n 'deleted_at' => NULL,\n ),\n 9 => \n array (\n 'id' => 10,\n 'nombre' => 'Borrador_Convenio_DOCENCIA – SERVICIO',\n 'path' => 'institucion/1/convenios/Borrador_Convenio_DOCENCIA – SERVICIO.htm',\n 'user_id' => 1,\n 'formato_id' => 5,\n 'tipo_archivo_id' => 2,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => '2017-09-28 14:58:36',\n 'updated_at' => '2017-09-28 14:58:36',\n 'deleted_at' => NULL,\n ),\n 10 => \n array (\n 'id' => 11,\n 'nombre' => 'Borrador_Convenio_GENERAL ACADEMIC AGREEMENT OF COOPERATION',\n 'path' => 'institucion/1/convenios/Borrador_Convenio_GENERAL ACADEMIC AGREEMENT OF COOPERATION.htm',\n 'user_id' => 1,\n 'formato_id' => 5,\n 'tipo_archivo_id' => 2,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => '2017-09-28 14:58:36',\n 'updated_at' => '2017-09-28 14:58:36',\n 'deleted_at' => NULL,\n ),\n 11 => \n array (\n 'id' => 12,\n 'nombre' => 'Borrador_Convenio_INMERSIÓN UNIVERSITARIA',\n 'path' => 'institucion/1/convenios/Borrador_Convenio_INMERSIÓN UNIVERSITARIA.htm',\n 'user_id' => 1,\n 'formato_id' => 5,\n 'tipo_archivo_id' => 2,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => '2017-09-28 14:58:36',\n 'updated_at' => '2017-09-28 14:58:36',\n 'deleted_at' => NULL,\n ),\n 12 => \n array (\n 'id' => 13,\n 'nombre' => 'Borrador_Convenio_MARCO ACADÉMICO DE COOPERACIÓN INTERINSTITUCIONAL',\n 'path' => 'institucion/1/convenios/Borrador_Convenio_MARCO ACADÉMICO DE COOPERACIÓN INTERINSTITUCIONAL.htm',\n 'user_id' => 1,\n 'formato_id' => 5,\n 'tipo_archivo_id' => 2,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => '2017-09-28 14:58:36',\n 'updated_at' => '2017-09-28 14:58:36',\n 'deleted_at' => NULL,\n ),\n 13 => \n array (\n 'id' => 14,\n 'nombre' => 'Borrador_Convenio_MARCO DE COOPERACIÓN PARA EL DESARROLLO DE ACTIVIDADES EN CIENCIA, TECNOLOGÍA E IN',\n 'path' => 'institucion/1/convenios/Borrador_Convenio_MARCO DE COOPERACIÓN PARA EL DESARROLLO DE ACTIVIDADES EN CIENCIA, TECNOLOGÍA E INNOVACIÓN.htm',\n 'user_id' => 1,\n 'formato_id' => 5,\n 'tipo_archivo_id' => 2,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => '2017-09-28 14:58:36',\n 'updated_at' => '2017-09-28 14:58:36',\n 'deleted_at' => NULL,\n ),\n 14 => \n array (\n 'id' => 15,\n 'nombre' => 'Borrador_Convenio_MEMORANDUM OF UNDERSTANDING ',\n 'path' => 'institucion/1/convenios/Borrador_Convenio_MEMORANDUM OF UNDERSTANDING .htm',\n 'user_id' => 1,\n 'formato_id' => 5,\n 'tipo_archivo_id' => 2,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => '2017-09-28 14:58:36',\n 'updated_at' => '2017-09-28 14:58:36',\n 'deleted_at' => NULL,\n ),\n 15 => \n array (\n 'id' => 16,\n 'nombre' => 'Borrador_Convenio_MOVILIDAD ACADÉMICA ESTUDIANTIL',\n 'path' => 'institucion/1/convenios/Borrador_Convenio_MOVILIDAD ACADÉMICA ESTUDIANTIL.htm',\n 'user_id' => 1,\n 'formato_id' => 5,\n 'tipo_archivo_id' => 2,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => '2017-09-28 14:58:36',\n 'updated_at' => '2017-09-28 14:58:36',\n 'deleted_at' => NULL,\n ),\n 16 => \n array (\n 'id' => 17,\n 'nombre' => 'Borrador_Convenio_PROYECTOS',\n 'path' => 'institucion/1/convenios/Borrador_Convenio_PROYECTOS.htm',\n 'user_id' => 1,\n 'formato_id' => 5,\n 'tipo_archivo_id' => 2,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => '2017-09-28 14:58:36',\n 'updated_at' => '2017-09-28 14:58:36',\n 'deleted_at' => NULL,\n ),\n 17 => \n array (\n 'id' => 18,\n 'nombre' => 'Borrador_Convenio_PRÁCTICAS O PASANTÍAS ACADÉMICAS ',\n 'path' => 'institucion/1/convenios/Borrador_Convenio_PRÁCTICAS O PASANTÍAS ACADÉMICAS .htm',\n 'user_id' => 1,\n 'formato_id' => 5,\n 'tipo_archivo_id' => 2,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => '2017-09-28 14:58:36',\n 'updated_at' => '2017-09-28 14:58:36',\n 'deleted_at' => NULL,\n ),\n 18 => \n array (\n 'id' => 19,\n 'nombre' => 'Borrador_Convenio_VISITING PROFESSOR OR RESEARCH SCHOLAR AGREEMENT',\n 'path' => 'institucion/1/convenios/Borrador_Convenio_VISITING PROFESSOR OR RESEARCH SCHOLAR AGREEMENT.htm',\n 'user_id' => 1,\n 'formato_id' => 5,\n 'tipo_archivo_id' => 2,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => '2017-09-28 14:58:36',\n 'updated_at' => '2017-09-28 14:58:36',\n 'deleted_at' => NULL,\n ),\n 19 => \n array (\n 'id' => 20,\n 'nombre' => 'CONVENIO DE COEDICION 2016',\n 'path' => 'institucion/1/convenios/CONVENIO DE COEDICION 2016.htm',\n 'user_id' => 1,\n 'formato_id' => 5,\n 'tipo_archivo_id' => 2,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => '2017-09-28 14:58:36',\n 'updated_at' => '2017-09-28 14:58:36',\n 'deleted_at' => NULL,\n ),\n 20 => \n array (\n 'id' => 21,\n 'nombre' => 'VISITING SCHOLAR AGREEMENT SUMMER ACADEMY 2017',\n 'path' => 'institucion/1/convenios/VISITING SCHOLAR AGREEMENT SUMMER ACADEMY 2017.htm',\n 'user_id' => 1,\n 'formato_id' => 5,\n 'tipo_archivo_id' => 2,\n 'permisos_archivo' => '{owner:rwx,group:rw-,other:r--}',\n 'created_at' => '2017-09-28 14:58:36',\n 'updated_at' => '2017-09-28 14:58:36',\n 'deleted_at' => NULL,\n ),\n ));\n \n \n }", "function acao_perfilBoletoModal() {\n\t// @requer obterItem\n\t\n\t$user = get_userdata( (int) $_GET['user_id'] );\n\t$id_empresa = get_user_meta( $user->ID, 'empresa', true );\n\n\t$arrCIO = get_user_meta( $id_empresa, 'cio', true );\n\t$emailCIO = $arrCIO['email'];\n\t$nomeCIO = $arrCIO['nome_completo'];\n\t$cargoCIO = obterItem( 'cargo', $arrCIO['cargo'] );\n\n\t$arrREP2 = get_user_meta( $id_empresa, 'representante2', true );\n\t$emailREP2 = $arrREP2['email'];\n\t$nomeREP2 = $arrREP2['nome_completo'];\n\t$cargoREP2 = obterItem( 'cargo', $arrREP2['cargo'] );\n\n\t$arrFIN = get_user_meta( $id_empresa, 'financeiro', true );\n\t$emailFIN = $arrFIN['email'];\n\t$nomeFIN = $arrFIN['nome_completo'];\n\t$cargoFIN = obterItem( 'cargo', $arrFIN['cargo'] );\n\n\t?>\n\n\t<div class=\"modal fade\" id=\"modal-id\">\n\t\t<div class=\"modal-dialog\">\n\t\t\t<div class=\"modal-content\">\n\t\t\t\t<div class=\"modal-header\">\n\t\t\t\t\t<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">&times;</button>\n\t\t\t\t\t<h4 class=\"modal-title\">Confirmação de envio</h4>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"modal-body\">\n\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t<table class=\"table table-hover\">\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th colspan=\"4\">Detalhes</th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>Ação</td>\n\t\t\t\t\t\t\t\t\t<td>Nome</td>\n\t\t\t\t\t\t\t\t\t<td>Email</td>\n\t\t\t\t\t\t\t\t\t<td>Cargo</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td><small>Rep. 1</small><div class=\"checkbox\"><label><input type=\"checkbox\" value=\"<?php echo $user->user_email; ?>\" checked disabled></label></div></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo $user->display_name; ?></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo $user->user_email; ?></td>\n\t\t\t\t\t\t\t\t\t<td>Representante</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td><small>CIO</small><div class=\"checkbox\"><label><input type=\"checkbox\" value=\"<?php echo $emailCIO; ?>\" checked class=\"checkMail\"></label></div></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo $nomeCIO; ?></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo $emailCIO; ?></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo $cargoCIO; ?></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td><small>Rep. 2</small><div class=\"checkbox\"><label><input type=\"checkbox\" value=\"<?php echo $emailREP2; ?>\" checked class=\"checkMail\"></label></div></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo $nomeREP2; ?></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo $emailREP2; ?></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo $cargoREP2; ?></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td><small>Financeiro</small><div class=\"checkbox\"><label><input type=\"checkbox\" value=\"<?php echo $emailFIN; ?>\" checked class=\"checkMail\"></label></div></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo $nomeFIN; ?></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo $emailFIN; ?></td>\n\t\t\t\t\t\t\t\t\t<td><?php echo $cargoFIN; ?></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td colspan=\"4\">Enviar cópia para: <input type=\"email\" name=\"copia\" id=\"inputCopia\" class=\"form-control\" value=\"<?php echo $emailCIO . \",\" . $emailREP2 . \",\" .$emailFIN; ?>\" title=\"\" placeholder=\"E-mail\"><p style=\"font-size: 10px; float: left; font-style: italic; text-align: center; width: 100%;\">Caso queira mandar com mais cópias, adicione \",\" a cada e-mail.<br />Exemplo: [email protected],[email protected]</p></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div><!-- /.form-group -->\n\t\t\t\t\t<div class=\"modal-footer\">\n\t\t\t\t\t\t<div id=\"load\" style=\"display: none\"></div>\n\t\t\t\t\t\t<div id=\"result\"></div>\n\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Fechar</button>\n\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-primary\" id=\"EnviarEmail\">Enviar</button>\n\t\t\t\t\t</div><!-- /.modal-footer -->\n\t\t\t\t</div><!-- /.modal-body -->\n\t\t\t</div><!-- /.modal-content -->\n\t\t</div><!-- /.modal-dialog -->\n\t</div><!-- /.modal -->\n\n\t<script>\n\t$(document).ready(function(){\n\n\n\t\t$('.checkMail').click(function(){\n\t\t\tvar text = \"\";\n\t\t\t$('.checkMail:checked').each(function(){\n\t\t\t\ttext += $(this).val()+',';\n\t\t\t});\n\t\t\ttext = text.substring(0,text.length-1);\n\t\t\t$('#inputCopia').val(text);\n\t\t});\n\n\t\t$('#EnviarEmail').click(function(e) {\n\t\t\t$( \"#result\" ).fadeOut(\"fast\");\n\t\t\t$( \"#load\" ).fadeIn(\"fast\");\n\t\t\tvar copia = $( \"#inputCopia\" ).val();\n\t\t\t$( \"#result\" ).load( \"enviar_boleto.php?email=<?php echo $user->user_email; ?>&id=<?php echo $user->ID; ?>&copia=\"+copia, function(){\n\t\t\t\t$( \"#load\" ).stop().stop().fadeOut(\"fast\");\n\t\t\t\t$( \"#result\" ).stop().stop().fadeIn(\"fast\");\n\t\t\t});\n\t\t\t//alert(\"1\");\n\t\t});\n\t});\n\t</script>\n\n\t<style type=\"text/css\">\n\t#load {\n\t\tbackground-image: url(\"<?php echo bloginfo('template_directory'); ?>/images/ajax-loader.gif\");\n\t\tbackground-repeat: no-repeat;\n\t\tbackground-position: center center;\n\t\twidth: 100%;\n\t\theight: 28px;\n\t\toverflow: hidden;\n\t\tmargin: 0 auto;\n\t\tdisplay: block;\n\t}\n\t#result{\n\t\twidth: 100%;\n\t\theight: 28px;\n\t\toverflow: hidden;\n\t\tmargin: 0 auto;\n\t\tdisplay: block;\n\t\ttext-align: center;\n\t\tfloat: left;\n\t}\n\t</style>\n\n\t<?php\n\t// FIM function acao_perfilBoletoModal\n}", "public function registroAlumnoModel($data){\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO alumnos(matricula,nombre,apellidos, id_carrera, id_grupo, imagen) VALUES(:matricula, :nombre, :apellidos, :carrera, :id_grupo, :imagen)\");\n\t\t//preparacion de parametros\n\t\t$stmt->bindParam(\":matricula\", $data['matricula']);\n\t\t$stmt->bindParam(\":nombre\", $data['nombre']);\n\t\t$stmt->bindParam(\":apellidos\", $data['apellidos']);\n\t\t$stmt->bindParam(\":carrera\", $data['carrera']);\n\t\t$stmt->bindParam(\":id_grupo\", $data['id_grupo']);\n\t\t$stmt->bindParam(\":imagen\", $data['imagen']);\n\t\tif($stmt->execute()) //ejecucion\n\t\t\treturn \"success\"; //respuesta\n\t\telse{\n\t\t\t//echo print_r($stmt->errorInfo());\n\t\t\treturn \"error\";\n\t\t}\n\t\t$stmt->close();\n\t}", "public function revisarFormato($archivo, $tipo_archivo)\n {\n\n\n Excel::selectSheetsByIndex(0)->load($archivo, function($reader) use ($tipo_archivo) {\n\n $reader->noHeading();\n\n $firstrow = $reader->first()->toArray();\n\n /*\n *Normalizando los nombres de las columnas (eliminamos acentos,espacios y Ñ)\n */\n $originales ='áéíóú ñ';\n $modificadas ='aeiou_n';\n\n for($i=0; $i < count($firstrow); $i++){\n $cadena = $firstrow[$i];\n $cadena = utf8_decode($cadena);\n $cadena = strtr($cadena, utf8_decode($originales), $modificadas);\n $cadena = strtolower($cadena);\n $firstrow[$i] = utf8_encode($cadena);\n }\n\n /*\n * Revisamos que el archivo tiene todas las columnas que se piden\n * y que sus nombres corresponden con los establecidos\n */\n\n switch($tipo_archivo)\n {\n case \"registros\":\n if (count($firstrow) >= 15) {\n if (($firstrow[0] == 'phylum') && ($firstrow[1] == 'clase') && (($firstrow[2] == 'subclase')\n && ($firstrow[3] == 'orden') && ($firstrow[4] == 'familia') && ($firstrow[5] == 'genero')\n && ($firstrow[6] == 'especie') && ($firstrow[7] == 'variedad') && ($firstrow[8]) == 'forma')\n && ($firstrow[9] == 'autor') && ($firstrow[10] == 'sinonimia') && ($firstrow[11] == 'cita')\n && ($firstrow[12] == 'entidad_federal') && ($firstrow[13] == 'localidad') && ($firstrow[14] == 'comentario')\n ) {\n $this->log = \"Archivo de Registros para el Catálogo con estructura correcta\";\n $this->error = false;\n } else {\n $this->log = \"NOMBRE de columnas inválidas\";\n $this->error = true;\n }\n } else {\n $this->log = \"NÚMERO de columnas inválidas\";\n $this->error = true;\n }\n break;\n\n\n case \"libros\":\n if (count($firstrow) >= 16) {\n if (($firstrow[0] == 'cita') && ($firstrow[1] == 'autores') && (($firstrow[2] == 'fecha')\n && ($firstrow[3] == 'titulo_libro') && ($firstrow[4] == 'edicion') && ($firstrow[5] == 'editorial')\n && ($firstrow[6] == 'lugar') && ($firstrow[7] == 'total_de_paginas') && ($firstrow[8]) == 'titulo_capitulo')\n && ($firstrow[9] == 'editor') && ($firstrow[10] == 'intervalo_de_paginas') && ($firstrow[11] == 'isbn')\n && ($firstrow[12] == 'doi') && ($firstrow[13] == 'enlace')&& ($firstrow[14] == 'archivo') && ($firstrow[15] == 'comentarios')\n ) {\n $this->log = 'Archivo de Referencias de Libros con estructura correcta';\n $this->error = false;\n } else {\n $this->log = \"NOMBRE de columnas inválidas\";\n $this->error = true;\n }\n } else {\n $this->log = \"NÚMERO de columnas inválidas\";\n $this->error = true;\n }\n break;\n\n\n case \"revistas\":\n if (count($firstrow) >= 14) {\n if (($firstrow[0] == 'cita') && ($firstrow[1] == 'autores') && (($firstrow[2] == 'fecha')\n && ($firstrow[3] == 'titulo') && ($firstrow[4] == 'nombre_revista') && ($firstrow[5] == 'volumen')\n && ($firstrow[6] == 'numero') && ($firstrow[7] == 'intervalo_de_paginas') && ($firstrow[8]) == 'isbn')\n && ($firstrow[9] == 'issn') && ($firstrow[10] == 'doi') && ($firstrow[11] == 'enlace')\n && ($firstrow[12] == 'archivo') && ($firstrow[13] == 'comentarios')\n ) {\n $this->log = 'Archivo de Referencias de Revistas con estructura correcta';\n $this->error = false;\n } else {\n $this->log = \"NOMBRE de columnas inválidas\";\n $this->error = true;\n }\n } else {\n $this->log = \"NÚMERO de columnas inválidas\";\n $this->error = true;\n }\n break;\n\n\n case \"trabajos\":\n if (count($firstrow) >= 11) {\n if (($firstrow[0] == 'tipo') && ($firstrow[1] == 'cita') && ($firstrow[2] == 'autores') && ($firstrow[3] == 'fecha')\n && ($firstrow[4] == 'titulo') && ($firstrow[5] == 'institucion') && ($firstrow[6] == 'lugar')\n && ($firstrow[7] == 'paginas') && ($firstrow[8] == 'enlace') && ($firstrow[9] == 'archivo') && ($firstrow[10] == 'comentarios')\n ) {\n $this->log = 'Archivo de Referencias de Revistas con estructura correcta';\n $this->error = false;\n } else {\n $this->log = \"NOMBRE de columnas inválidas\";\n $this->error = true;\n }\n } else {\n $this->log = \"NÚMERO de columnas inválidas\";\n $this->error = true;\n }\n break;\n\n case \"enlaces\":\n if (count($firstrow) >= 11) {\n if (($firstrow[0] == 'cita') && ($firstrow[1] == 'autores') && ($firstrow[2] == 'fecha') && ($firstrow[3] == 'nombre_pagina')\n && ($firstrow[4] == 'titulo') && ($firstrow[5] == 'institucion') && ($firstrow[6] == 'lugar')\n && ($firstrow[7] == 'direccion_web') && ($firstrow[8] == 'dia_consulta') && ($firstrow[9] == 'mes_consulta') && ($firstrow[10] == 'ano_consulta')\n ) {\n $this->log = 'Archivo de Referencias de Revistas con estructura correcta';\n $this->error = false;\n } else {\n $this->log = \"NOMBRE de columnas inválidas\";\n $this->error = true;\n }\n } else {\n $this->log = \"NÚMERO de columnas inválidas\";\n $this->error = true;\n }\n break;\n\n\n case \"coordenadas\":\n if (count($firstrow) >= 6) {\n if (($firstrow[0] == 'entidad') && ($firstrow[1] == 'localidad') && ($firstrow[2] == 'lugar') && ($firstrow[3] == 'sitio')\n && ($firstrow[4] == 'latitud') && ($firstrow[5] == 'longitud')\n ) {\n $this->log = 'Archivo de Coordenadas con estructura correcta';\n $this->error = false;\n } else {\n $this->log = \"NOMBRE de columnas inválidas\";\n $this->error = true;\n }\n } else {\n $this->log = \"NÚMERO de columnas inválidas\";\n $this->error = true;\n }\n break;\n\n default:\n $this->log = \"Error en el tipo de archivo\";\n $this->error = true;\n }\n\n\n\n\n\n });\n\n $respuesta = ['error' => $this->error, 'log' => $this->log];\n\n return $respuesta;\n }", "public function anexar(){\n// var_dump($_FILES);\n// var_dump($_POST);\n if(isset($_FILES) && isset($_POST['id']) && !empty($_FILES)){\n extract($_POST);\n $extensao = $this->validaExtensao($_FILES['arquivo']['name']);\n if($_FILES['arquivo']['size'] <= 4000000 && $extensao){\n $newName = md5(time()).\".\".$extensao;\n $this->validaPasta($tipo, $id);\n $caminho = \"arquivos/$tipo/$id/$newName\";\n if (move_uploaded_file($_FILES['arquivo']['tmp_name'], $caminho)) {\n $arquivos = new Arquivos();\n $retorno = $arquivos->insereArquivoBD($_FILES['arquivo']['name'], $id, $caminho, $tipo);\n echo json_encode('ok');\n }else{\n echo json_encode(3);\n }\n \n } else {\n echo json_encode(2);\n }\n } else {\n echo json_encode(1);\n }\n }", "function loadFileFromDB() {\n\t\t// If file contents are in bin_data column, fetch data and store in file.\n\t\tif (isset($this->data_array[\"bin_data\"]) && \n\t\t\ttrim($this->data_array[\"bin_data\"]) != \"\") {\n\n\t\t\t// Need to decode the string first.\n\t\t\t$theFileContent = base64_decode($this->data_array[\"bin_data\"]);\n\n\t\t\t$theDir = dirname($this->getFile());\n\t\t\tif (!file_exists($theDir)) {\n\t\t\t\t// Its parent directory does not exist yet. Create it.\n\t\t\t\tmkdir($theDir);\n\t\t\t}\n\n\t\t\t// Create the file for future use.\n\t\t\t$fp = fopen($this->getFile(), \"w+\");\n\t\t\tfwrite($fp, $theFileContent);\n\t\t\tfclose($fp);\n\t\t}\n\t}" ]
[ "0.6084217", "0.5927711", "0.5755315", "0.56801736", "0.56752354", "0.56591696", "0.5650602", "0.56040895", "0.56008196", "0.5588999", "0.5584097", "0.5556028", "0.5499985", "0.54826623", "0.5468537", "0.54244405", "0.54075575", "0.5399108", "0.53829056", "0.5375976", "0.5365376", "0.5348389", "0.5335681", "0.5314032", "0.5278682", "0.52784413", "0.5256922", "0.5249192", "0.52394885", "0.52326953", "0.5221846", "0.5214996", "0.5198016", "0.5196799", "0.51957387", "0.5189882", "0.5179589", "0.5172179", "0.51698935", "0.516139", "0.51578933", "0.51544917", "0.5147915", "0.5147191", "0.51439226", "0.513279", "0.51197326", "0.51170605", "0.51096576", "0.5090203", "0.5084642", "0.5075071", "0.50609976", "0.5052327", "0.50490206", "0.50453883", "0.5035325", "0.5033742", "0.5031332", "0.50274944", "0.502537", "0.50165844", "0.5013282", "0.50083846", "0.5005384", "0.49999148", "0.49983025", "0.49966857", "0.4989821", "0.4973455", "0.49617678", "0.49589846", "0.4958726", "0.49561906", "0.4948699", "0.4946795", "0.49465582", "0.49393103", "0.4938646", "0.4934824", "0.4933945", "0.49330804", "0.4928014", "0.49196726", "0.49175993", "0.49150982", "0.49146003", "0.4913011", "0.4911424", "0.49099183", "0.4909123", "0.49054322", "0.49039772", "0.49034497", "0.49008092", "0.49004045", "0.48999202", "0.4898895", "0.48966035", "0.489651" ]
0.6596407
0
8 (2 pts.) caso: alumnos (get): Mostrar una tabla con todos los datos de los alumnos, incluida la foto
public static function alumnos() { throw new Exception('No implementado aun '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tablaDatos(){\n\n $editar = $this->Imagenes($this->PrimaryKey,0);\n $eliminar = $this->Imagenes($this->PrimaryKey,1);\n $sql = 'SELECT\n C.id_componentes,\n P.descripcion planta,\n S.descripcion secciones,\n E.descripcion Equipo,\n C.`descripcion` Componente\n ,'.$editar.','.$eliminar.' \nFROM\n `componentes` C\nINNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\nINNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\nINNER JOIN\n plantas P ON P.id_planta = S.id_planta\nWHERE\n \n C.`activo` = 1';\n \n $datos = $this->Consulta($sql,1); \n if(count($datos)){\n $_array_formu = array();\n $_array_formu = $this->generateHead($datos);\n $this->CamposHead = ( isset($_array_formu[0]) && is_array($_array_formu[0]) )? $_array_formu[0]: array();\n \n $tablaHtml = '<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"panel panel-default\">\n <div class=\"panel-body recargaDatos\" style=\"page-break-after: always;\">\n <div class=\"table-responsive\">';\n $tablaHtml .='';\n \t\t$tablaHtml .= $this->print_table($_array_formu, 7, true, 'table table-striped table-bordered',\"id='tablaDatos'\");\n \t\t$tablaHtml .=' </div>\n </div>\n </div>\n </div>\n </div>\n ';\n }else{\n $tablaHtml = '<div class=\"col-md-8\">\n <div class=\"alert alert-info alert-dismissable\">\n <button class=\"close\" aria-hidden=\"true\" data-dismiss=\"alert\" type=\"button\">×</button>\n <strong>Atenci&oacute;n</strong>\n No se encontraron registros.\n </div>\n </div>';\n }\n \n if($this->_datos=='r') echo $tablaHtml;\n else return $tablaHtml;\n \n }", "function setTabla($filas,$columnas){\r\n\t\t$this->setTitulo(\"Fotos\");\t\r\n\t\t$str=\"\";\r\n\t\t$contador=1;\r\n\t\t$str=\"<table>\";\r\n\t\tfor($i=0;$i<$filas;$i++){\r\n\t\t\t$str=$str.\"<tr>\";\r\n\t\t\tfor($j=0;$j<$columnas;$j++){\r\n\t\t\t\t$photo=\"photo_\".$contador++.\".png\";\r\n\t\t\t\t$str=$str.\"<td><img src='\".$photo.\"' width='150' height='150'></td>\";\r\n\t\t\t}\r\n\t\t\t$str=$str.\"</tr>\";\r\n\t\t}\r\n\t\t$str=$str.\"</table>\";\r\n\t\t$this->setContenido($str);\r\n\t}", "public function mostrar_tabla_anuncios(){\n\n\t\t$return = '';\n\t\t$mensaje = array('0' => 'Desactivado', '1' => 'Activo');\n\t\t$cols = array('id', 'clave_interna', 'provincia', 'municipio', 'tipo_venta', 'anuncio_promocionado',\n\t\t\t\t\t 'anuncio_e','paquete','activo','apto');\n\t\t$this->where('ussr',$this->user);\n\n\t\tif($salida = $this->get('anuncios', NULL, $cols)){\n\n\t\t\t$return .= '<table class=\"table table-bordered table-hover\">';\n\n\t\t\t$return .= '<tr>\n\t\t\t\t\t <th>Imagen</th>\n\t\t\t\t\t <th>Clave interna</th>\n\t\t\t\t\t <th>Paquete</th>\n\t\t\t\t\t <th>Provincia</th>\n\t\t\t\t\t <th>Operacion</th>\n\t\t\t\t\t <th>Nº imagenes</th>\n\t\t\t\t\t <th>Idiomas</th>\n\t\t\t\t\t <th>Contratado</th>\n\t\t\t\t\t <th>Anuncio apto</th>\n\t\t\t\t\t <th>Anuncio activo</th>\n\t\t\t\t\t <th>Opciones</th>\n\t\t\t\t\t </tr>';\n\t\t\t//por cada anuncio varias cosas habra que hacer\n\t\t\t$i=1;\t\t \n\t\t\tforeach ($salida as $key => $value) {\n\t\t\n\t\t\t\t$num = $i++;\n\t\t\t\t$id_arr = md5($value['id']);\n\t\t\t\t$imagen = $this->sacar_foto($id_arr, $this->user);\n\n\t\t\t\t$return .='<tr>\n\t\t\t\t\t \t<td>'.$imagen.'</td>\n\t\t\t\t\t <td>'.$value['clave_interna'].'</td>\n\t\t\t\t\t <td>'.$value['paquete'].'</td>\n\t\t\t\t\t <td>'.$value['provincia'].'<br />\n\t\t\t\t\t '.$this->show_municipio($value['municipio']).'</td>\n\t\t\t\t\t <td>'.$value['tipo_venta'].'</td>';\n\n\n\n\t\t\t\t//mostrara numero de imagenes en el anuncio\n\t\t\t\t$return .='<td>';\n\t\t\t\t$return .= $this->num_imagenes_anuncio($value['id']);\n\t\t\t\t$return .='</td>';\n\n\n\t\t\t\t//mostrando idiomas en los que esta el anuncio\n\t\t\t\t$return .='<td>';\n\t\t\t\t$return .= $this->idiomas_del_anuncio($value['id']);\n\t\t\t\t$return .='</td>';\n\n\t\t\t\t//estrella o promocionado\n\t\t\t\t$return .='<td>';\n\t\t\t\tif(!empty($value['anuncio_promocionado']) && ($value['anuncio_promocionado'] == 1)){\n\t\t\t\t\t$return .= 'Anuncio promocionado<br />';\t}\n\t\t\t\tif($value['anuncio_e'] == 1){\n\t\t\t\t\t$return .= 'Anuncio estrella';\t\t\t}\t\n\t\t\t\t\t\n\t\t\t $return .= '</td>';\n\t\t\t $return .= '<td>'.$value['apto'].'</td>';\n\t\t\t $return .= '<td id=\"act-'.$id_arr.'\">'.$mensaje[$value['activo']].'</td>';\n\t\t\t //dropdown de opciones\n\t\t\t $return .= '<td>'.$this->dropdown_tabla_anuncios($id_arr).'</td>';\n\t\t\n\t\t\t\t$return .= '</tr>';\n\n\t\t\t}//fin del foreach\n\n\t\t\t$return .= '</table>';\n\n\n\t\t}else{\n\t\t\t$return .= '<h5 id=\"sec1\">No hay anuncios 1 </h5>';\n\t\t}\n\n\t\treturn $return;\n\t}", "public function mostrarTablasMaestras(){\n\t\tif($_GET[\"bd\"] == \"vtama_tipo_producto\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/tipoProducto.controlador.php\";\n\t\t\trequire_once \"../models/tipoProducto.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$entrada = \"tablaMaestra\";\n\t\t\t$tipoProductos = ControladorTipoProducto::ctrMostrarTipoProducto($item,$valor,$entrada);\n\t\t\tif(count($tipoProductos) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($tipoProductos); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarTipoProducto' codTipoProducto='\".$tipoProductos[$i][\"cod_tipo_producto\"].\"' data-toggle='modal' data-target='#modalTipoProducto' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarTipoProducto' codTipoProducto='\".$tipoProductos[$i][\"cod_tipo_producto\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[ \n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($tipoProductos[$i][\"dsc_tipo_producto\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_tipo_documento\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/tipoDocumento.controlador.php\";\n\t\t\trequire_once \"../models/tipoDocumento.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$tipoDocumentos = ControladorTipoDocumento::ctrMostrarTipoDocumento($item,$valor);\n\t\t\tif(count($tipoDocumentos) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($tipoDocumentos); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarTipoDocumento' codTipoDocumento='\".$tipoDocumentos[$i][\"cod_tipo_documento\"].\"' data-toggle='modal' data-target='#modalTipoDocumento' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarTipoDocumento' codTipoDocumento='\".$tipoDocumentos[$i][\"cod_tipo_documento\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[ \n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($tipoDocumentos[$i][\"dsc_tipo_documento\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_categoria_cliente\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/categoriaCliente.controlador.php\";\n\t\t\trequire_once \"../models/categoriaCliente.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$categoriaClientes = ControladorCategoriaCliente::ctrMostrarCategoriaClientes($item,$valor);\n\t\t\tif(count($categoriaClientes) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($categoriaClientes); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarCategoriaCliente' codCategoriaCliente='\".$categoriaClientes[$i][\"cod_categoria_cliente\"].\"' data-toggle='modal' data-target='#modalCategoriaCliente' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarCategoriaCliente' codCategoriaCliente='\".$categoriaClientes[$i][\"cod_categoria_cliente\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[ \n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($categoriaClientes[$i][\"dsc_categoria_cliente\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_pais\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/pais.controlador.php\";\n\t\t\trequire_once \"../models/pais.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$paises = ControladorPais::ctrMostrarPaises($item,$valor);\n\t\t\tif(count($paises) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($paises); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarPais' codPais='\".$paises[$i][\"cod_pais\"].\"' data-toggle='modal' data-target='#modalPais' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarPais' codPais='\".$paises[$i][\"cod_pais\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($paises[$i][\"dsc_pais\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_estado_cotizacion\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/estadoCotizacion.controlador.php\";\n\t\t\trequire_once \"../models/estadoCotizacion.modelo.php\";\n\t\t\t$item = $valor = $entrada = null;\n\t\t\t$estadoCotizacion = ControladorEstadoCotizacion::ctrMostrarEstadoCotizacion($item,$valor,$entrada);\n\t\t\tif(count($estadoCotizacion) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($estadoCotizacion); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarEstadoCotizacion' codEstadoCotizacion='\".$estadoCotizacion[$i][\"cod_estado_cotizacion\"].\"' data-toggle='modal' data-target='#modalEstadoCotizacion' title='Editar'><i class='fa fa-pencil'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($estadoCotizacion[$i][\"dsc_estado_cotizacion\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= '] \n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_perfil\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/perfil.controlador.php\";\n\t\t\trequire_once \"../models/perfil.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$perfil = ControladorPerfil::ctrMostrarPerfil($item,$valor);\n\t\t\tif(count($perfil) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($perfil); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarPerfil' codPerfil='\".$perfil[$i][\"cod_perfil\"].\"' data-toggle='modal' data-target='#modalPerfil' title='Editar'><i class='fa fa-pencil'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($perfil[$i][\"dsc_perfil\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_moneda\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/moneda.controlador.php\";\n\t\t\trequire_once \"../models/moneda.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$moneda = ControladorMoneda::ctrMostrarMoneda($item,$valor);\n\t\t\tif(count($moneda) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($moneda); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarMoneda' codMoneda='\".$moneda[$i][\"cod_moneda\"].\"' data-toggle='modal' data-target='#modalMoneda' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarMoneda' codMoneda='\".$moneda[$i][\"cod_moneda\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($moneda[$i][\"dsc_moneda\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_forma_pago\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/formaPago.controlador.php\";\n\t\t\trequire_once \"../models/formaPago.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$formaPago = ControladorFormaPago::ctrMostrarFormaPago($item,$valor);\n\t\t\tif(count($formaPago) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($formaPago); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarFormaPago' codFormaPago='\".$formaPago[$i][\"cod_forma_pago\"].\"' data-toggle='modal' data-target='#modalFormaPago' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarFormaPago' codFormaPago='\".$formaPago[$i][\"cod_forma_pago\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($formaPago[$i][\"dsc_forma_pago\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_canal_contacto\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/canalContacto.controlador.php\";\n\t\t\trequire_once \"../models/canalContacto.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$canalContacto = ControladorCanalContacto::ctrMostrarCanalContacto($item,$valor);\n\t\t\tif(count($canalContacto) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($canalContacto); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarCanalContacto' codCanalContacto='\".$canalContacto[$i][\"cod_canal_contacto\"].\"' data-toggle='modal' data-target='#modalCanalContacto' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarCanalContacto' codCanalContacto='\".$canalContacto[$i][\"cod_canal_contacto\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($canalContacto[$i][\"dsc_canal_contacto\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_estado_contacto\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/estadoContacto.controlador.php\";\n\t\t\trequire_once \"../models/estadoContacto.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$estadoContacto = ControladorEstadoContacto::ctrMostrarEstadoContacto($item,$valor);\n\t\t\tif(count($estadoContacto) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($estadoContacto); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarEstadoContacto' codEstadoContacto='\".$estadoContacto[$i][\"cod_estado_contacto\"].\"' data-toggle='modal' data-target='#modalEstadoContacto' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarEstadoContacto' codEstadoContacto='\".$estadoContacto[$i][\"cod_estado_contacto\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($estadoContacto[$i][\"dsc_estado_contacto\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}else if($_GET[\"bd\"] == \"vtama_tipo_contacto\"){\n\t\t\trequire_once \"../core.php\";\n\t\t\trequire_once \"../funciones.php\";\n\t\t\trequire_once \"../controllers/tipoContacto.controlador.php\";\n\t\t\trequire_once \"../models/tipoContacto.modelo.php\";\n\t\t\t$item = null;\n\t\t\t$valor = null;\n\t\t\t$tipoContacto = ControladorTipoContacto::ctrMostrarTipoContacto($item,$valor);\n\t\t\tif(count($tipoContacto) > 0){\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": [';\n\t\t\t\t\t\tfor ($i=0; $i < count($tipoContacto); $i++) {\n\t\t\t\t\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-sm btn-warning btnEditarTipoContacto' codTipoContacto='\".$tipoContacto[$i][\"cod_tipo_contacto\"].\"' data-toggle='modal' data-target='#modalTipoContacto' title='Editar'><i class='fa fa-pencil'></i></button><button class='btn btn-sm btn-danger btnEliminarTipoContacto' codTipoContacto='\".$tipoContacto[$i][\"cod_tipo_contacto\"].\"' title='Eliminar'><i class='fa fa-trash'></i></button></div></div>\";\n\t\t\t\t\t\t\t$datosJson .= '[\n\t\t\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\t\t\"'.escapeComillasJson($tipoContacto[$i][\"dsc_tipo_contacto\"]).'\",\n\t\t\t\t\t\t\t\t\"'.$botones.'\"\n\t\t\t\t\t\t\t],';\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t\t$datosJson .= ']\n\t\t\t\t}';\n\t\t\t}else{\n\t\t\t\t$datosJson = '{\n\t\t\t\t\t\"data\": []\n\t\t\t\t}';\n\t\t\t}\n\t\t}\n\t\techo $datosJson;\n\t}", "public function visualizzazione(){\n $nameColumn = $this->getColumnName();\n $tuple = $this->read();\n foreach($nameColumn as $nome){\n $x = ' <td> '. $nome . ' </td> ';\n echo $x;\n }\n \n foreach($tuple as $ris){\n $str ='<tr> <td> '.$ris->getId(). ' </td> '.\n '<td> '.$ris->getNome(). '</td>'.\n '<td> '.$ris->getUsername(). '</td>'.\n '<td> '.$ris->getPassword(). '</td>'.\n '<td> '.$ris->getEmail(). '</td>'.\n '<td> '.$ris->getMuseo(). '</td>'.\n '</tr>';\n echo $str;\n };\n }", "function mostrar_tabla()\n {\n return $this->mostrar_tabla_slickgrid();\n /*\n $sPrefs = '';\n $id_usuario= core\\ConfigGlobal::mi_id_usuario();\n $tipo = 'tabla_presentacion';\n $oPref = new usuarios\\Preferencia(array('id_usuario'=>$id_usuario,'tipo'=>$tipo));\n $sPrefs=$oPref->getPreferencia();\n if ($sPrefs == 'html') {\n return $this->mostrar_tabla_html();\n } else {\n return $this->mostrar_tabla_slickgrid();\n }\n */\n }", "function generar()\r\n\t{\r\n\t\tforeach($this->columnas as $ef) {\r\n\t\t \t$this->datos->tabla('columnas')->nueva_fila($ef->get_datos());\r\n\t\t}\r\n\t\tparent::generar();\r\n\t}", "public function mostrarTablas(){\t\r\n\r\n\t\t$item = null;\r\n \t\t$valor = null;\r\n\r\n \t\t$proveedores = ControladorProveedores::ctrMostrarProveedores($item, $valor);\r\n\r\n\r\n \t\t$datosJson = '{\r\n\t\t \r\n\t \t\"data\": [ ';\r\n\r\n\t \tfor($i = 0; $i < count($proveedores); $i++){\r\n\r\n\t \t\t/*=============================================\r\n\t\t\tDEVOLVER DATOS JSON\r\n\t\t\t=============================================*/\r\n\r\n\t\t\t$datosJson\t .= '[\r\n\t\t\t\t \"'.($i+1).'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"codigo\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"rfc\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"razonSocial\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"fechaAlta\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"limiteCredito\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"diasCredito\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"rfc2\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"curp\"].'\"\r\n\t\t\t\t ],';\r\n\r\n\t \t}\r\n\r\n\t \t$datosJson = substr($datosJson, 0, -1);\r\n\r\n\t\t$datosJson.= ']\r\n\t\t\t \r\n\t\t}'; \r\n\r\n\t\techo $datosJson;\r\n\r\n \t}", "function tabla($lista, $totalColumnas) {\n $totalFilas = count($lista) / $totalColumnas;\n echo \"<table border='1'>\";\n for ($fila = 0; $fila < $totalFilas; $fila++) {\n echo \"<tr>\";\n for ($i=0;$i<$totalColumnas;$i++) {\n $posicion = $totalColumnas * $fila + $i;\n if ($posicion < count($lista)) {\n $contenido = $lista[$posicion];\n } else {\n $contenido = \"\";\n }\n echo \"<td>\".$contenido.\"</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n}", "static function getAlumnesTable(){\n $table = 'alumnes';\n\n // Table's primary key\n $primaryKey = 'id';\n\n // Array of database columns which should be read and sent back to DataTables.\n // The `db` parameter represents the column name in the database, while the `dt`\n // parameter represents the DataTables column identifier. In this case simple\n // indexes\n $columns = array(\n array( 'db' => 'id', 'dt' => 0 ),\n array( 'db' => 'primer_cognom', 'dt' => 1 ),\n array( 'db' => 'segon_cognom', 'dt' => 2 ),\n array( 'db' => 'nom', 'dt' => 3 ),\n array( 'db' => 'mobil', 'dt' => 4 ),\n array( 'db' => 'telefon', 'dt' => 5 ),\n array( \n 'db' => 'email', \n 'dt' => 6,\n 'formatter' => function( $d, $row ) {\n return \"<a href='mailto:$d'>$d</a>\";\n }\n ),\n array(\n 'db' => 'data_naixement',\n 'dt' => 7,\n 'formatter' => function( $d, $row ) {\n if ($d) {\n return date( 'd/m/Y', strtotime($d));\n } else{\n return \"\";\n }\n }\n ),\n array(\n 'db' => 'data_ingres',\n 'dt' => 8,\n 'formatter' => function( $d, $row ) {\n if ($d) {\n return date( 'd/m/Y', strtotime($d));\n } else{\n return \"\";\n }\n }\n ) \n );\n header('Content-Type: application/json; charset=utf-8');\n return json_encode(SSP::complex( $_GET, $table, $primaryKey, $columns, null, \"esborrat = 0\" ));\n }", "public function mostrarTabla(){\n\n $item = null;\n $valor = null;\n\n $cargo = GestorCargo::verCargoController($item, $valor);\n\tif(count($cargo)>0){\n\t\techo '{\n\t\t\t\t\"data\": [';\n\n\t\t\t\tfor($i = 0; $i < count($cargo)-1; $i++){\n\n\t\t\t\t\t$itemTipoper = \"id_tipoper\";\n\t\t\t\t\t$valorTipoper = $cargo[$i][\"tipo_per\"];\n\n\t\t\t\t\t$tipoper = GestorTipoper::verTipoperController($itemTipoper, $valorTipoper);\n\n\t\t\t\t\techo '[\n\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\"'.$tipoper[\"nombre_tipoper\"].'\",\n\t\t\t\t\t\t\"'.$cargo[$i][\"nombre_cargo\"].'\",\n\t\t\t\t\t\t\"'.$cargo[$i][\"id_cargo\"].'\"\n\t\t\t\t\t],';\n\n\t\t\t\t}\n\t\t\t\t\t$itemTipoper = \"id_tipoper\";\n\t\t\t\t\t$valorTipoper = $cargo[count($cargo)-1][\"tipo_per\"];\n\n\t\t\t\t\t$tipoper = GestorTipoper::verTipoperController($itemTipoper, $valorTipoper);\n\n\t\t\techo'[\n\t\t\t\t\t\"'.count($cargo).'\",\n\t\t\t\t\t\"'.$tipoper[\"nombre_tipoper\"].'\",\n\t\t\t\t\t\"'.$cargo[count($cargo)-1][\"nombre_cargo\"].'\",\n\t\t\t\t\t\"'.$cargo[count($cargo)-1][\"id_cargo\"].'\"\n\t\t\t\t\t]\n\t\t\t\t]\n\t\t\t}';\n\t}else{\n\t\t\techo '{ \"data\": [] }';\n\t\t}\n\n }", "function getTablas() {\r\n $tablas['inventario_equipo']['id']='inventario_equipo';\r\n $tablas['inventario_equipo']['nombre']='Inventario (equipo)';\r\n\r\n $tablas['inventario_grupo']['id']='inventario_grupo';\r\n $tablas['inventario_grupo']['nombre']='Inventario (grupo)';\r\n\r\n $tablas['inventario_estado']['id']='inventario_estado';\r\n $tablas['inventario_estado']['nombre']='Inventario (estado)';\r\n\r\n $tablas['inventario_marca']['id']='inventario_marca';\r\n $tablas['inventario_marca']['nombre']='Inventario (marca)';\r\n\r\n $tablas['obligacion_clausula']['id']='obligacion_clausula';\r\n $tablas['obligacion_clausula']['nombre']='Obligacion (clausula)';\r\n\r\n $tablas['obligacion_componente']['id']='obligacion_componente';\r\n $tablas['obligacion_componente']['nombre']='Obligacion (componente)';\r\n\r\n $tablas['documento_tipo']['id']='documento_tipo';\r\n $tablas['documento_tipo']['nombre']='Documento (Tipo)';\r\n\r\n \t\t$tablas['documento_tema']['id']='documento_tema';\r\n \t\t$tablas['documento_tema']['nombre']='Documento (Tema)';\r\n\r\n \t\t$tablas['documento_subtema']['id']='documento_subtema';\r\n \t\t$tablas['documento_subtema']['nombre']='Documento (Subtema)';\r\n\r\n \t\t$tablas['documento_estado']['id']='documento_estado';\r\n \t\t$tablas['documento_estado']['nombre']='Documento (Estado)';\r\n\r\n \t\t$tablas['documento_estado_respuesta']['id']='documento_estado_respuesta';\r\n \t\t$tablas['documento_estado_respuesta']['nombre']='Documento (Estado Respuesta)';\r\n\r\n \t\t$tablas['documento_actor']['id']='documento_actor';\r\n \t\t$tablas['documento_actor']['nombre']='Documento (Responsables)';\r\n\r\n \t\t$tablas['documento_tipo_actor']['id']='documento_tipo_actor';\r\n \t\t$tablas['documento_tipo_actor']['nombre']='Documento (Tipo de Responsable)';\r\n\r\n \t\t$tablas['riesgo_probabilidad']['id']='riesgo_probabilidad';\r\n \t\t$tablas['riesgo_probabilidad']['nombre']='Riesgo (Probabilidad)';\r\n\r\n \t\t$tablas['riesgo_categoria']['id']='riesgo_categoria';\r\n \t\t$tablas['riesgo_categoria']['nombre']='Riesgo (Categoria)';\r\n\r\n \t\t$tablas['riesgo_impacto']['id']='riesgo_impacto';\r\n \t\t$tablas['riesgo_impacto']['nombre']='Riesgo (Impacto)';\r\n\r\n \t\t$tablas['compromiso_estado']['id']='compromiso_estado';\r\n \t\t$tablas['compromiso_estado']['nombre']='Compromisos (Estado)';\r\n\r\n \t\t$tablas['departamento']['id']='departamento';\r\n \t\t$tablas['departamento']['nombre']='Departamentos';\r\n\r\n \t\t$tablas['departamento_region']['id']='departamento_region';\r\n \t\t$tablas['departamento_region']['nombre']='Departamentos (Region)';\r\n\r\n \t\t$tablas['municipio']['id']='municipio';\r\n \t\t$tablas['municipio']['nombre']='Municipios';\r\n\r\n $tablas['operador']['id']='operador';\r\n\t $tablas['operador']['nombre']='Operador';\r\n\r\n asort($tablas);\r\n return $tablas;\r\n }", "static public function mostrarTabla(){\n\n \t$item = null;\n $valor = null;\n\n \t$empresa = ControladorEmpresa::ctrMostrarEmpresa($item, $valor);\n\n \techo '{\n\t\t\t\"data\": [';\n\n\t\t\tfor($i = 0; $i < count($empresa)-1; $i++){\n\n\t\t\t\t\n\t\t\t\t echo '[\n\t\t\t \"'.($i+1).'\",\n\t\t\t \"'.$empresa[$i][\"ruta_imagen\"].'\",\n\t\t\t \"'.$empresa[$i][\"empresa\"].'\",\n\t\t\t \"'.$empresa[$i][\"direccion\"].'\",\n\t\t\t \"'.$empresa[$i][\"telefono\"].'\",\n\t\t\t \"'.$empresa[$i][\"celular\"].'\",\n\t\t\t \"'.$empresa[$i][\"ciudad\"].'\",\n\t\t\t \"'.$empresa[$i][\"responsable\"].'\",\n\t\t\t \"'.$empresa[$i][\"email\"].'\"\n\n\t\t\t ],';\n\n\t\t\t}\n\n\t\t\t echo'[\n\t\t\t \"'.count($empresa).'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"ruta_imagen\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"empresa\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"direccion\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"telefono\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"celular\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"ciudad\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"responsable\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"email\"].'\" \n\t\t\t ]\n\t\t\t]\n\t\t}';\n\n\n }", "function prikazi_sqltabelu($sql_tabela) {\n\n\tglobal $db;\n\n\techo \"<table class='dt-table'>\";\n\techo \"<h2>\" . $sql_tabela . \"</h2>\";\n\n\t// generisanje headera tabele (prikaz podataka)\n\n\t$komanda_head = \"SELECT * FROM $sql_tabela LIMIT 1\";\n\t$result_head = mysql_query($komanda_head, $db);\t\n\n\twhile ( $red = mysql_fetch_assoc($result_head) ) :\n\n\t\t$m = 0;\n\n\t\techo \"<tr class='dt-table'>\";\n\n\t\tforeach ($red as $item) {\n\t\n\t\t\t$kolona = mysql_field_name($result_head, $m);\n \t\t\techo \"<td class='dt-table'>\" . $kolona . \"</td>\";\n \t\t\t//echo \"<td>\" . $item . \"</td>\";\n \t\t$m++;\n\n\t\t}\n\n\t\techo \"</tr>\";\n\n\tendwhile;\n\n\t// generisanje tela tabele (prikaz podataka)\n\n\t$komanda_body = \"SELECT * FROM $sql_tabela\";\n\t$result_body = mysql_query($komanda_body, $db);\n\n\n\twhile ( $red = mysql_fetch_assoc($result_body) ) :\n\n\t\t$n = 0;\n\n\t\techo \"<tr class='dt-table'>\";\n\n\t\tforeach ($red as $item) {\n\t\n\t\t\t$kolona = mysql_field_name($result_body, $n);\n \t\t\techo \"<td class='dt-table'>\" . $item . \"</td>\";\n \t\t$n++;\n\n\t\t}\n\n\t\techo \"</tr>\";\n\n\tendwhile;\n\n\techo \"</table>\";\n\n}", "function mysql04($tabla){\n $qColumnNames = mysql_query(\"SHOW COLUMNS FROM \".$tabla) or die(\"mysql error\");\n $numColumns = mysql_num_rows($qColumnNames);\n $i = 0;\n while ( $i < $numColumns ){\n $colname = mysql_fetch_row($qColumnNames);\n $col[$i] = \"<th>\".$colname[0].\"</th>\";\n $i++;\n }\n $h = 0;\n $resultado[0] = \"<tr>\";\n while ( $h < $numColumns ){\n $resultado[0] = $resultado[0] . $col[$h];\n $h++;\n }\n $resultado[0] = $resultado[0].\"</tr>\";\n $query01=\"SELECT * FROM \".$tabla;\n $query02=mysql_query($query01);\n $numLines = mysql_num_rows($query02);\n\n $j=0;\n while( $rec = mysql_fetch_row($query02) ){\n for( $k = 0; $k != $numColumns ; $k++){\n if ( $resultado[1 + $j] == \"\" ){\n $resultado[1 + $j] = \"<tr>\";\n }\n if ( $rec[$k] == \"\" ){\n $rec[$k] = \"-\";\n }\n $resultado[1 + $j] = $resultado[1 + $j].\"<td>\".$rec[$k].\"</td>\";\n }\n $resultado[1 + $j] = $resultado[1 + $j].\"</tr>\";\n $j++;\n }\n return $resultado;\n/*\nCOMO USARLO\n$tabla = '';\n$resultado = mysql04($tabla);\necho \"<table>\";\n foreach( $resultado as $value ){\n\techo $value;\n}\necho \"</table>\";\n*/\n}", "public function tabla_alumnos()\n {\n //Para tablas cortas o pequeñas se recomienda all();\n $ver_tabla = AlumnoModel::select('id_alumno','nombre','ap_p','ap_m','semestre','sexo','promedio')->get();\n\n return view('sistemaITO/verAlumnos')->with('tabla',$ver_tabla);\n }", "function listarTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_sel';\n\t\t$this->transaccion='WF_tabla_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_tabla','int4');\n\t\t$this->captura('id_tipo_proceso','int4');\n\t\t$this->captura('vista_id_tabla_maestro','int4');\n\t\t$this->captura('bd_scripts_extras','text');\n\t\t$this->captura('vista_campo_maestro','varchar');\n\t\t$this->captura('vista_scripts_extras','text');\n\t\t$this->captura('bd_descripcion','text');\n\t\t$this->captura('vista_tipo','varchar');\n\t\t$this->captura('menu_icono','varchar');\n\t\t$this->captura('menu_nombre','varchar');\n\t\t$this->captura('vista_campo_ordenacion','varchar');\n\t\t$this->captura('vista_posicion','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('menu_codigo','varchar');\n\t\t$this->captura('bd_nombre_tabla','varchar');\n\t\t$this->captura('bd_codigo_tabla','varchar');\n\t\t$this->captura('vista_dir_ordenacion','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\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('nombre_tabla_maestro','varchar');\n\t\t$this->captura('vista_estados_new','text');\n\t\t$this->captura('vista_estados_delete','text');\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}", "public function mostrarTablaAsegurados() {\n\n\t\t$item = null;\n\t\t$valor = null;\n\n\t\t$asegurados = ControladorAsegurados::ctrMostrarAsegurados($item, $valor);\n\n\t\tif ($asegurados == null) {\n\t\t\t\n\t\t\t$datosJson = '{\n\t\t\t\t\"data\": []\n\t\t\t}';\n\n\t\t} else {\n\n\t\t\t$datosJson = '{\n\t\t\t\"data\": [';\n\n\t\t\tfor ($i = 0; $i < count($asegurados); $i++) { \n\n\t\t\t\t/*=============================================\n\t\t\t\tTRAEMOS LA EMPRESA\n\t\t\t\t=============================================*/\n\n\t\t\t\t$itemEmpleador = \"id\";\n\t\t\t\t$valorEmpleador = $asegurados[$i][\"id_empleador\"];\n\n\t\t\t\t$Empleadores = ControladorEmpleadores::ctrMostrarEmpleadores($itemEmpleadore, $valorEmpresa);\n\n\t\t\t\t/*=============================================\n\t\t\t\tTRAEMOS EL TIPO DE SEGURO\n\t\t\t\t=============================================*/\n\n\t\t\t\t$itemSeguro = \"id\";\n\t\t\t\t$valorSeguro = $asegurados[$i][\"id_seguro\"];\n\n\t\t\t\t$seguros = ControladorSeguros::ctrMostrarSeguros($itemSeguro, $valorSeguro);\n\n\t\t\t\t/*=============================================\n\t\t\t\tTRAEMOS LAS LOCALIDADES\n\t\t\t\t=============================================*/\n\n\t\t\t\t$itemLocalidad = \"id\";\n\t\t\t\t$valorLocalidad = $asegurados[$i][\"id_localidad\"];\n\n\t\t\t\t$localidades = ControladorLocalidades::ctrMostrarLocalidades($itemLocalidad, $valorLocalidad);\t\n\n\t\t\t\t/*=============================================\n\t\t\t\tTRAEMOS LAS OCUPACIONES\n\t\t\t\t=============================================*/\n\n\t\t\t\t$itemOcupacion = \"id\";\n\t\t\t\t$valorOcupacion = $asegurados[$i][\"id_ocupacion\"];\n\n\t\t\t\t$ocupaciones = ControladorOcupaciones::ctrMostrarOcupaciones($itemOcupacion, $valorOcupacion);\t\t\t\t\n\n\t\t\t\t/*=============================================\n\t\t\t\tTRAEMOS LAS ACCIONES\n\t\t\t\t=============================================*/\n\n\t\t\t\t$botones1 = \"<div class='btn-group'><button class='btn btn-info btnAgregarBeneficiario' idAsegurado='\".$asegurados[$i][\"id\"].\"' data-toggle='tooltip' title='Agregar Beneficiario'><i class='fas fa-check'></i></button></div>\";\n\n\t\t\t\t$botones2 = \"<div class='btn-group'><button class='btn btn-warning btnEditarEmpleador' idAsegurado='\".$asegurados[$i][\"id\"].\"' data-toggle='tooltip' title='Editar'><i class='fas fa-pencil-alt'></i></button><button class='btn btn-danger btnEliminarAsegurado' idAsegurado='\".$asegurados[$i][\"id\"].\"' data-toggle='tooltip' title='Eliminar'><i class='fas fa-times'></i></button></div>\";\n\n\t\t\t\t$datosJson .='[\n\t\t\t\t\t\"'.$botones1.'\",\t\n\t\t\t\t\t\"'.$empleadores[\"razon_social\"].'\",\t\t\t\n\t\t\t\t\t\"'.$seguros[\"tipo_seguro\"].'\",\t\n\t\t\t\t\t\"'.$asegurados[$i][\"matricula\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"documento_ci\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"paterno\"].' '.$asegurados[$i][\"materno\"].' '.$asegurados[$i][\"nombre\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"sexo\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"fecha_nacimiento\"].'\",\n\t\t\t\t\t\"'.$Localidades[\"nombre_localidad\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"zona\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"calle\"].' '.$asegurados[$i][\"nro_calle\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"salario\"].'\",\n\t\t\t\t\t\"'.$ocupaciones[\"nombre_ocupacion\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"fecha_ingreso\"].'\",\n\t\t\t\t\t\"'.$asegurados[$i][\"estado\"].'\",\n\t\t\t\t\t\"'.$botones2.'\"\n\t\t\t\t],';\n\t\t\t}\n\n\t\t\t$datosJson = substr($datosJson, 0, -1);\n\n\t\t\t$datosJson .= ']\n\t\t\t}';\t\n\n\t\t}\n\n\t\techo $datosJson;\n\t\n\t}", "public function buscarAlumnos(){\n\t\t\t$this->load->model('nivel_model');\n\t\t\t$data['nivel'] = $this->nivel_model->obtenerNiveles();\n\t\t\t$data['alumnos'] = $this->alumnos_model->obtenerAlumnosNivel(1);\n\t\t\t$this->load->view('plantillas/header');\n\t\t\t$this->load->view('plantillas/sidebar');\n\t\t\t$this->load->view('front_end/buscar_alumnos',$data);\n\t\t\t$this->load->view('plantillas/footer');\n\t\t}", "public static function TraerTodoLosAlumnos()\n {\n $objetoAccesoDato = AccesoDatos::dameUnObjetoAcceso(); \n $consulta =$objetoAccesoDato->RetornarConsulta(\"select * from alumno\");\n $consulta->execute();\t\t\t\n return $consulta->fetchAll(PDO::FETCH_CLASS, \"alumno\");\t\t\n }", "public function tablaProductos () \n\t\t{\t\t\n\t\t\t//Javascript !!!\n\t\t\taddJs('js/products_table.js');\n\t\t\thidden ('iter',0); \n\t\t\t\n\t\t\techo '<table id=\"tabla_productos\" bgColor=#333 cellspacing=1 cellpadding=2 width=700><tbody>';\n\t\t\techo '<tr>'.\n\t\t\t\t\t'<th>Cantidad</th><th>Producto</th><th>Precio<br>sin Iva</th>'.\n\t\t\t\t\t'<th>Precio<br>con Iva</th><th>Total Neto</th><th>Total</th><th></th></tr>';\n\n\t\t\techo '</tbody></table>';\n\n\t\t\techo '<table bgColor=#333 cellspacing=1 cellpadding=2 width=700>';\n\t\t\t$this->tablaSumatoria();\n\t\t\techo '</table>';\t\t\t\n\t\t}", "function desplegarTabla($query,$anchtable=array(),$iconos=array(),$coLoTabla=\"table-primary\"){\n\n\tglobal $oBD;\n\n\t$registros = $oBD->consulta($query);\n\n\t$columnas = mysqli_num_fields($registros);\n\techo '<table class= \"table table-hover'.$coLoTabla.'\">';\n\t// creacion de la cabecera\n\techo '<tr class=\"table-dark\">';// hace el renglon\n\n\t// if (count($anchtable)){\n\t// \tforeach ($anchtable as $anch) {\n\t// \t\techo \"<td style=width:$anch.'%';></td>\";\n\t// \t\techo $anch;\n\t// \t}\n\t// }\n$k = 0;\n// si el count de iconos existe entonces me mandaron iconos \n\tif (count($iconos)){\n\t\tforeach ($iconos as $icono) {\n\t\t\techo $k;\n\t\t\t\t\t\n\t\t\tif (count($anchtable)) {\n\t\t\t\techo \"<td style=width:$anchtable[$k];>&nbsp;</td>\";\t\n\t\t\t}else{\n\t\t\t\techo \"<td>&nbsp;</td>\";\t\n\t\t\t}\n\n\t\t\t$k++;\n\t\t}\n\t}\n\t//echo $columnas;\n\techo $k;\n\t//$k=$k-1;\n\tfor ($c=0; $c < $columnas; $c++){\n\t\t// para traer los nombres de los campos\n\t\t$campo=mysqli_fetch_field_direct($registros,$c); // da la informacion de un campo en la base de datos\n\t\t \n\t\t if (count($anchtable)) {\n\t\t\t\techo \"<td style=width:$anchtable[$k];>$campo->name.$c</td>\";\t\n\t\t\t}else{\n\t\t\t\techo '<td style=\"width:(90/$columnas)%\">'.$campo->name.'</td>';\t\t\n\t\t\t}\n\t\t // echo $anchtable[$c];\n\t\t $k++;\n\t\t\n\t}\n\techo '</tr>';\n\t// fin cabecera\n\t// comienzo de registros\n\tfor ($r=0; $r < $oBD->numeRegistros; $r++) \n\t{ echo '<tr>';\n\t\t// agregando iconos\n\t\t// EN EL CASO DE QUE \"UPDATE EXISTA EN EL ARRGLO DE LOS ICONOS\"\n\t\tif (in_array(\"update\", $iconos)) {\n\t\t\t//da comportamiento de los iconos\n\t\t\techo '<td style=\"width:5%\"><img src=\"imagenes/update.png\"></td>';\n\t\t}\n\n\t\tif (in_array(\"delete\", $iconos)) {\n\t\t\t//da comportamiento de los iconos\n\t\t\techo '<td style=\"width:5%\"><img src=\"imagenes/delete.png\"></td>';\n\t\t}\n\n\n\t\t$campos = mysqli_fetch_array($registros);\n\t\t// despliega la informacion de un registro especifico\n\t\tfor ($c=0; $c < $columnas; $c++) \n\t\t\techo '<td>'.$campos[$c].'</td>';\n\t echo '</tr>';\n\t\t\n\t}\necho '</table>';\necho $k;\n}", "function ImprimirCabeceraTabla($tabla){\n echo \"<table><tr>\";\n foreach ($tabla as $valor){\n\n echo \"<th>\".$valor.\"</th>\";\n \n }\n echo \"</tr>\";\n}", "public function tabla()\n {\n\n \treturn Datatables::eloquent(Encargos::query())->make(true);\n }", "public function displayAll() {\n \t\n \techo \"<table border=1>\";\n\t\techo \"<tr>\";\n\t\techo \"<th>Id</th>\";\n\t\techo \"<th>Ora decolare</th>\";\n\t\techo \"<th>Destinatia</th>\";\n\t\techo \"<th>Compania</th>\";\n\t\techo \"</tr>\";\n\n\t\tforeach($this->findAll() as $k => $zbor){ //parcugem arrayul pe linie\n\t\t\techo \"<tr>\";\n\n\t\t\techo \"<td> \" . $zbor[\"id\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"ora_decolare\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"destinatia\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"compania\"] . \"</td>\";\n\t\t\t\n\t\t\techo \"</tr>\";\n\t\t}\n\n\t\techo \"</table>\";\n }", "public function displayAll() {\n \t\n \techo \"<table border=1>\";\n\t\techo \"<tr>\";\n\t\techo \"<th>Id</th>\";\n\t\techo \"<th>Ora aterizare</th>\";\n\t\techo \"<th>De la</th>\";\n\t\techo \"<th>Compania</th>\";\n\t\techo \"</tr>\";\n\n\t\tforeach($this->findAll() as $k => $zbor){ //parcugem arrayul pe linie\n\t\t\techo \"<tr>\";\n\n\t\t\techo \"<td> \" . $zbor[\"id\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"ora_aterizare\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"de_la\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"compania\"] . \"</td>\";\n\t\t\t\n\t\t\techo \"</tr>\";\n\t\t}\n\n\t\techo \"</table>\";\n }", "function tabla_filas_proyecto_pago($filas,$tpago,$monto,$moneda,$tcambio,$opera,$boucher,$observ,$tcambiodia){\n\t\t$tpago = explode(\"|\", $tpago);\n\t\t$monto = explode(\"|\", $monto);\n\t\t$moneda = explode(\"|\", $moneda);\n\t\t$tcambio = explode(\"|\", $tcambio);\n\t\t$opera = explode(\"|\", $opera);\n\t\t$boucher = explode(\"|\", $boucher);\n\t\t$observ = explode(\"|\", $observ);\n\t\t//----\n\t\t\t$salida.= '<table>';\n\t$i = 1;\t\n\t$total = 0;\n\tif($filas>0){\n\t\tfor($i = 1; $i <= $filas; $i ++){\n\t\t\t//acumulado\n\t\t\t$Dcambiar = 0;\n\t\t\t$Dcambiar = Cambio_Moneda($tcambio[$i],$tcambiodia,$monto[$i]);\n\t\t\t$total += $Dcambiar;\n\t\t\t//-\n\t\t\t$salida.= '<td>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Ttpag'.$i.'\" id = \"Ttpag'.$i.'\" value = \"'.$tpago[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tmonto'.$i.'\" id = \"Tmonto'.$i.'\" value = \"'.$monto[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tmoneda'.$i.'\" id = \"Tmoneda'.$i.'\" value = \"'.$moneda[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Ttipcambio'.$i.'\" id = \"Ttipcambio'.$i.'\" value = \"'.$tcambio[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Toperador'.$i.'\" id = \"Toperador'.$i.'\" value = \"'.$opera[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tboucher'.$i.'\" id = \"Tboucher'.$i.'\" value = \"'.$boucher[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tobserva'.$i.'\" id = \"Tobserva'.$i.'\" value = \"'.$observ[$i].'\" />';\n\t\t\t$salida.= '</td>';\n\t\t}\n\t}\t\t\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td><input type = \"hidden\" name = \"PagFilas\" id = \"PagFilas\" value = \"'.$filas.'\"/></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td><input type = \"hidden\" name = \"PagTotal\" id = \"PagTotal\" value = \"'.$total.'\"/></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '</table>';\n\t\n\treturn $salida;\n}", "function toString(){\n echo \"<h2>Alumnos:</h2>\";\n /* Conexion con base de datos. */\n $conexion = new PDO('mysql:host=localhost;dbname=tarea02;charset=UTF8', 'root', '');\n $conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n \n\n if ($conexion){\n \n /* Se define la consulta SQL */\n $consulta = \"SELECT * FROM alumno;\"; \n $stmt = $conexion->prepare($consulta);\n $stmt->execute(); \n \n $arr = $stmt->fetchAll(PDO::FETCH_ASSOC);\n foreach ($arr as $row) {\n echo $row['matricula'];\n echo \" \";\n echo $row['nombre'];\n echo \" \"; \n echo $row['carrera'];\n echo \" \"; \n echo $row['email'];\n echo \" \"; \n echo $row['telefono'];\n echo \"<br>\"; \n \n \n }\n\n } else {\n echo \"Hubo un problema con la conexión\";\n }\n }", "public function showAthletesTable(){\r\n\t\t//fait le query voulu\r\n\t\t$stmt = $this->connect()->query(\"SELECT * FROM athletes\");\r\n\t\t//creer la table avec les tuples\r\n\t\techo \"<h3>Athletes Table</h3>\";\r\n\t\techo \"<table><tr><td>\" . \"id\" . \"</td><td>\" . \"name\" . \"</td><td>\" . \"identified_gender\" . \"</td><td>\" . \"email\" . \"</td><td>\" . \"date_of_birth\" . \"</td></tr>\";\r\n\t\twhile ($row = $stmt->fetch()) {\r\n\t\t\techo \"<tr><td>\" . $row['id'] . \"</td><td>\" . $row['name'] . \"</td><td>\" . $row['identified_gender'] . \"</td><td>\" . $row['email'] . \"</td><td>\" . $row['date_of_birth'] . \"</td></tr>\"; \r\n\t\t}\r\n\t\techo \"</table>\";\r\n\t}", "public function alumnos(){\n\t\t$crud = new CrudModel();\n\t\t$array = $crud->listarAlumnos(); //trae la consulta del modelo.\n\t\t$mensaje = session('condicion');//para ver si la insercion se realizo correctamente\n\t\t$alumnos = ['alumno' => $array,\n\t\t\t\t\t'condicion' => $mensaje\n\t\t\t\t];\n\n\t\t$data = ['titulo' => 'C.I.A'];\n\t\t$vistas = view('Alumnos/header',$data).\n\t\tview('Alumnos/frmAlumno').\n\t\tview('Alumnos/tablaAlumno', $alumnos);\n\n\t\treturn $vistas;\n\t}", "public function mostrarEspecialidad(){\n\t\t\t$sql = \"SELECT * FROM especialidades\";\n\t\t\t\t$result = mysqli_query(Conexion::conectar(), $sql);\n\n\n\n\t\t$tabla = \"<table class='table'> \\n\";\n\t\t\t$tabla.= \"<tr> \\n\";\n\t\t\t$tabla.= \"<td><b>ID</b></td>\\n\";\n\t\t\t$tabla.= \"<td><b>Nombre</b></td>\\n\";\n\n\n\t\t\t\twhile ($fila = mysqli_fetch_row($result)) {\n\n\t\t\t\t\t$tabla.= \"<tr> \\n\";\n\t\t\t\t\t$tabla.= \"<td>$fila[0]</td>\\n\";\n\t\t\t\t\t$tabla.= \"<td>$fila[1]</td>\\n\";\n\n\t\t\t\t\t$tabla.=\"</tr> \\n\";\n\t\t\t\t}\n\n\t\t\t\t$tabla.=\"</table> \\n\";\n\n\t\t\t\treturn $tabla;\n\n\t}", "public function list_ptto_poa_final($tp_id){\n $lista_aper_padres = $this->model_proyecto->list_prog();//lista de aperturas padres \n $tabla ='';\n foreach($lista_aper_padres as $rowa){\n $proyectos=$this->model_ptto_sigep->acciones_operativas($rowa['aper_programa'],$tp_id);\n if(count($proyectos)!=0){\n $tabla .='<tr bgcolor=\"#99DDF0\" height=\"30\">';\n $tabla .='<td></td>';\n if($this->tp_adm==1){\n $tabla .='<td></td>';\n }\n $tabla .='<td><center>'.$rowa['aper_programa'].''.$rowa['aper_proyecto'].''.$rowa['aper_actividad'].'</center></td>';\n $tabla .='<td>'.$rowa['aper_descripcion'].'</td>';\n $tabla .='<td>'.$rowa['aper_sisin'].'</td>';\n $tabla .='<td></td>';\n $tabla .='<td></td>';\n $tabla .='<td></td>';\n $tabla .='<td></td>';\n $tabla .='<td></td>';\n $tabla .='</tr>';\n $nro=0;\n foreach($proyectos as $row){\n $nro++;\n // $fase = $this->model_faseetapa->get_id_fase($row['proy_id']);\n $aper=$this->model_ptto_sigep->partidas_proyecto($row['aper_id']);\n $tabla .= '<tr height=\"50\">';\n $tabla .= '<td align=center><center><img id=\"loadd'.$row['proy_id'].'\" style=\"display: none\" src=\"'.base_url().'/assets/img/loading.gif\" width=\"25\" height=\"25\" title=\"ESPERE UN MOMENTO, LA PAGINA SE ESTA CARGANDO..\"></center></td>';\n if($this->tp_adm==1){\n if(count($aper)!=0){\n $tabla .='<td><center><a href=\"'.site_url(\"\").'/mnt/ver_ptto_asig_final/'.$row['proy_id'].'\" id=\"myBtnn'.$row['proy_id'].'\" title=\"VER PRESUPUESTO ASIGNADO INICIAL - PROGRAMADO - APROBADO\" iclass=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/faseetapa.png\" WIDTH=\"34\" HEIGHT=\"34\"/></a></center></td>';\n }\n else{\n $tabla .='<td></td>';\n }\n }\n $tabla .= '<td align=center>'.$row['aper_programa'].''.$row['aper_proyecto'].''.$row['aper_actividad'].'</td>';\n $tabla .= '<td>'.$row['proy_id'].' | '.$row['proy_nombre'].'</td>';\n $tabla .= '<td>'.$row['tp_tipo'].'</td>';\n $tabla .= '<td>'.$row['proy_sisin'].'</td>';\n $tabla .= '<td>'.$row['fun_nombre'].' '.$row['fun_paterno'].' '.$row['fun_materno'].'</td>';\n $tabla .='<td></td>';\n $tabla .='<td></td>';\n $tabla .='<td></td>';\n $tabla .= '</tr>';\n \n\n }\n }\n }\n return $tabla;\n }", "function getTablas() {\n $tablas['departamento']['id'] = 'departamento';\n $tablas['departamento']['nombre'] = 'Departamentos';\n\n $tablas['departamento_region']['id'] = 'departamento_region';\n $tablas['departamento_region']['nombre'] = 'Departamentos (Region)';\n\n $tablas['municipio']['id'] = 'municipio';\n $tablas['municipio']['nombre'] = 'Municipios';\n\n $tablas['operador']['id'] = 'operador';\n $tablas['operador']['nombre'] = 'Operador';\n\n $tablas['pais']['id'] = 'pais';\n $tablas['pais']['nombre'] = 'Paises';\n\n $tablas['ciudad']['id'] = 'ciudad';\n $tablas['ciudad']['nombre'] = 'Ciudades';\n\n $tablas['familias']['id'] = 'familias';\n $tablas['familias']['nombre'] = 'Familias';\n\n $tablas['monedas']['id'] = 'monedas';\n $tablas['monedas']['nombre'] = 'Monedas';\n\n $tablas['cuentas_financiero']['id'] = 'cuentas_financiero';\n $tablas['cuentas_financiero']['nombre'] = 'Cuentas';\n\n $tablas['cuentas_financiero_ut']['id'] = 'cuentas_financiero_ut';\n $tablas['cuentas_financiero_ut']['nombre'] = 'Cuentas UT';\n\n $tablas['cuentas_financiero_tipo']['id'] = 'cuentas_financiero_tipo';\n $tablas['cuentas_financiero_tipo']['nombre'] = 'Tipos de Cuentas';\n\n $tablas['extracto_movimiento']['id'] = 'extracto_movimiento';\n $tablas['extracto_movimiento']['nombre'] = 'Movimientos';\n\n $tablas['centropoblado']['id'] = 'centropoblado';\n $tablas['centropoblado']['nombre'] = 'Centros Poblados';\n\n $tablas['encuesta_tipo']['id'] = 'encuesta_tipo';\n $tablas['encuesta_tipo']['nombre'] = 'Tipo de Encuesta';\n\n $tablas['actividades_tipo']['id'] = 'actividades_tipo';\n $tablas['actividades_tipo']['nombre'] = 'Planes de Actividades';\n\n $tablas['tipohallazgo']['id'] = 'tipohallazgo';\n $tablas['tipohallazgo']['nombre'] = 'Tipo Hallazgo';\n\n asort($tablas);\n return $tablas;\n }", "function mostrarListado(){\n $cont = 1;\n $conector = new mysqli('localhost', 'root', '', 'juegos');\n $consulta2=\"SELECT * FROM usuarios\";\n $resultado1 = $conector->query($consulta2);\n \n ?>\n \n <div id=\"tabla1\">\n <table>\n\n <thead>\n <tr> <td>ID</td> <td>Nombre</td> <td>Apellido</td> <td>Edad</td> <td>Curso</td> <td>Correo</td> <td>Puntuación</td></tr>\n </thead>\n\n <tbody>\n \n \n <?php\n\n foreach($resultado1 as $fila){\n if (($cont % 2) == 0){\n echo \"<tr class='lineas'>\". \"<td>\". $fila['id']. \"</td>\". \"<td>\". $fila['Nombre']. \"</td>\". \"<td>\". $fila['Apellido']. \"</td>\". \"<td>\". $fila['Edad']. \"</td>\". \"<td>\". $fila['Curso']. \"<td>\". $fila['Correo']. \"</td>\". \"</td>\". \"<td>\". $fila['Puntuacion']. \"</td>\".\"</tr>\";\n }else{\n echo \"<tr>\". \"<td>\". $fila['id']. \"</td>\". \"<td>\". $fila['Nombre']. \"</td>\". \"<td>\". $fila['Apellido']. \"</td>\". \"<td>\". $fila['Edad']. \"</td>\". \"<td>\". $fila['Curso']. \"<td>\". $fila['Correo']. \"</td>\". \"</td>\". \"<td>\". $fila['Puntuacion']. \"</td>\".\"</tr>\";\n }\n $cont++;\n }\n }", "function TablaServiciosDiariasVendedor()\n {\t\n\t\n\t//Logo\n $this->Image(\"./assets/img/logo.png\" , 20 ,12, 60 , 20 , \"PNG\");\n\t$this->SetXY(10, 15);\n\t$this->SetFont('courier','B',10);\n\t$this->SetFillColor(2,157,116);\n\t$this->Cell(75,6,'',0,0,'');\n\t$this->Cell(120,6,'LISTADO DE SERVICIOS DEL DIA '.date(\"Y-m-d\"),0,1,'C');\n \n\t$this->Cell(75,6,'',0,0,'');\n $this->Cell(120,6,'DE CAJA N°.'.base64_decode($_GET['caja']),0,0,'C');\n //Salto de línea\n $this->Ln(15);\n\t\n\t$con = new Login();\n $con = $con->ConfiguracionPorId();\n\t\n\t$this->SetFont('courier','B',9);\n\t$this->SetFillColor(2,157,116);\n\t$this->Cell(10,5,'',0,0,'');\n\t$this->Cell(35,5,'CÉDULA GERENTE: ',0,0,'');\n\t$this->Cell(44,5,$con[0]['cedresponsable'],0,0,'');\n\t$this->Cell(30,5,'NOMBRE GERENTE:',0,0,'');\n\t$this->Cell(83,5,$con[0]['nomresponsable'],0,1,'');\n \n $this->Cell(10,5,'',0,0,'');\n\t$this->Cell(35,5,'TELÉFONO GERENTE: ',0,0,'');\n $this->Cell(44,5,utf8_decode($con[0]['tlfresponsable']),0,0,'');\n $this->Cell(30,5,'CORREO GERENTE:',0,0,'');\n $this->Cell(83,5,utf8_decode($con[0]['correoresponsable']),0,0,'');\n $this->Ln(8);\n\t\n\t$this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->SetFillColor(249, 187, 31); // establece el color del fondo de la celda (en este caso es NARANJA)\n\t$this->CellFitSpace(10,8,'N°',1,0,'C', True);\n\t$this->CellFitSpace(32,8,'CÓDIGO SERVICIO',1,0,'C', True);\n\t$this->CellFitSpace(32,8,'FECHA SERVICIO',1,0,'C', True);\n\t$this->CellFitSpace(22,8,'SERVICIOS',1,0,'C', True);\n\t$this->CellFitSpace(25,8,'SUBTOTAL',1,0,'C', True);\n\t$this->CellFitSpace(22,8,'IVA',1,0,'C', True);\n\t$this->CellFitSpace(22,8,'DESCUENTO',1,0,'C', True);\n\t$this->CellFitSpace(26,8,'TOTAL PAGO',1,1,'C', True);\n\t\n $tra = new Login();\n $reg = $tra->ListarServiciosDiarias();\n\t$serviciosTotal=0;\n\t$pagoSubtotal=0;\n\t$pagoIva=0;\n\t$pagoDescuento=0;\n\t$pagoTotal=0;\n\t$a=1;\n for($i=0;$i<sizeof($reg);$i++){\n $serviciosTotal+=$reg[$i]['cantidad'];\n\t$pagoSubtotal+=$reg[$i]['subtotal']; \n\t$pagoIva+=$reg[$i]['totaliva']; \n\t$pagoDescuento+=$reg[$i]['totaldescuento']; \n\t$pagoTotal+=$reg[$i]['totalpago'];\n\t$this->SetFont('courier','',8); \n\t$this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es negro)\n $this->Cell(10,5,$a++,1,0,'C');\n\t$this->CellFitSpace(32,5,$reg[$i][\"codservicio\"],1,0,'C');\n\t$this->CellFitSpace(32,5,utf8_decode(date(\"d-m-Y h:i:s\",strtotime($reg[$i]['fechaservicio']))),1,0,'C');\n\t$this->CellFitSpace(22,5,utf8_decode($reg[$i][\"cantidad\"]),1,0,'C');\n\t$this->CellFitSpace(25,5,utf8_decode(number_format($reg[$i]['subtotal'], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(22,5,utf8_decode(number_format($reg[$i]['totaliva'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(22,5,utf8_decode(number_format($reg[$i]['totaldescuento'], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(26,5,utf8_decode(number_format($reg[$i]['totalpago'], 2, '.', ',')),1,0,'C');\n $this->Ln();\n\t\n } \n \n\t$this->Cell(10,5,'',1,0,'C');\n $this->Cell(32,5,'',1,0,'C');\t\n $this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->Cell(32,5,'TOTAL GENERAL',1,0,'C', True);\n $this->SetFont('courier','B',8);\n $this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es blanco)\n $this->Cell(22,5,utf8_decode($serviciosTotal),1,0,'C');\n $this->Cell(25,5,utf8_decode(number_format($pagoSubtotal, 2, '.', ',')),1,0,'C');\n $this->Cell(22,5,utf8_decode(number_format($pagoIva, 2, '.', ',')),1,0,'C');\n $this->Cell(22,5,utf8_decode(number_format($pagoDescuento, 2, '.', ',')),1,0,'C'); \n $this->CellFitSpace(26,5,utf8_decode(number_format($pagoTotal, 2, '.', ',')),1,0,'C');\n $this->Ln();\n\n \n $this->Ln(15); \n $this->SetFont('courier','B',9);\n $this->Cell(190,0,'ELABORADO POR: '.utf8_decode($_SESSION[\"nombres\"]).' RECIBIDO POR:___________________________','',1,'C');\n $this->Ln(4);\n }", "function listarTablaInstancia(){\n\t\t$this->procedimiento='wf.ft_tabla_instancia_sel';\n\t\t$this->transaccion='WF_TABLAINS_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('id_tabla','id_tabla','integer');\n\t\t$this->setParametro('historico','historico','varchar');\n\t\t$this->setParametro('tipo_estado','tipo_estado','varchar');\n\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_' . $_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['bd_nombre_tabla'],'int4');\n\t\t\n\t\tif ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['vista_tipo'] == 'maestro') {\n\t\t\t\t\n\t\t\t$this->captura('estado','varchar');\n\t\t\t$this->captura('id_estado_wf','int4');\n\t\t\t$this->captura('id_proceso_wf','int4');\n\t\t\t$this->captura('obs','text');\n\t\t\t$this->captura('nro_tramite','varchar');\n\t\t}\n\t\t\n\t\tforeach ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['columnas'] as $value) {\n\t\t\t\n\t\t\t$this->captura($value['bd_nombre_columna'],$value['bd_tipo_columna']);\t\t\n\t\t\t//campos adicionales\n\t\t\tif ($value['bd_campos_adicionales'] != '' && $value['bd_campos_adicionales'] != null) {\n\t\t\t\t$campos_adicionales = explode(',', $value['bd_campos_adicionales']);\n\t\t\t\t\n\t\t\t\tforeach ($campos_adicionales as $campo_adicional) {\n\t\t\t\t\t\n\t\t\t\t\t$valores = explode(' ', $campo_adicional);\n\t\t\t\t\t$this->captura($valores[1],$valores[2]);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t$this->captura('estado_reg','varchar');\t\t\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\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\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}", "public function vistaAlumnasController()\n\t\t{\n\n\t\t\t$respuesta = Datos::vistaAlumnasModel(\"alumna\");\n\n\t\t\t#El constructor foreach proporciona un modo sencillo de iterar sobre arrays. foreach funciona sólo sobre arrays y objetos, y emitirá un error al intentar usarlo con una variable de un tipo diferente de datos o una variable no inicializada.\n\n\t\t\tforeach($respuesta as $row => $item){\n\t\t\techo'<tr>\n\t\t\t\t\t<td>'.$item[\"id_alumna\"].'</td>\n\t\t\t\t\t<td>'.$item[\"nombre_alumna\"].'</td>\n\t\t\t\t\t<td>'.$item[\"apellido_alumna\"].'</td>\n\t\t\t\t\t<td>'.$item[\"fecha_nacimiento\"].'</td>\n\t\t\t\t\t<td>'.$item[\"nombre_grupo\"].'</td>\n\t\t\t\t\t<td><div class=\"btn-group\">\n <button type=\"button\" class=\"btn btn-default dropdown-toggle\" data-toggle=\"dropdown\">\n <span class=\"fa fa-cog\"></span>\n </button>\n <div class=\"dropdown-menu\">\n <a class=\"dropdown-item\" href=\"index.php?action=editar_alumna&id='.$item[\"id_alumna\"].'\">Actualizar</a>\n <a class=\"dropdown-item\" onclick=\"confirmarDelete('.$item[\"id_alumna\"].');\" href=\"index.php?action=alumnas&idBorrar='.$item[\"id_alumna\"].'\" id=\"btn'.$item[\"id_alumna\"].'\">Eliminar</a>\n </div></td>\n\t\t\t\t</tr>';\n\n\n\t\t\t}\n\n\t\t}", "public static function TraerTodosLosAlumnos(){\n\t\t$sql = 'SELECT * FROM personas';\n $consulta = AccesoDatos::ObtenerObjetoAccesoDatos()->ObtenerConsulta($sql);\n\t $consulta->execute();\t\t\t\n\t\treturn $consulta->fetchAll();\t\n\t}", "public function mostrarTablaServicios(){\n\n\t\t$item = null;\n \t$valor = null;\n\n \t\t$servicios = ControladorServicios::ctrMostrarServicios($item, $valor);\n\n \t\t$datosJson = '{\n\t\t \"data\": [';\n\n\t\t for($i = 0; $i < count($servicios); $i++){\n\n\t\t \t/*============================================\n\t\t \t= TRAEMOS LAS ACCIONES =\n\t\t \t============================================*/\n\n\t\t \tif(isset($_GET[\"perfilOculto\"]) && $_GET[\"perfilOculto\"] == \"Administrador\"){\n\n\t\t \t\t$botones = \"<div class='btn-group'><button class='btn btn-warning btnEditarServicio' idServicio='\".$servicios[$i][\"idservicio\"].\"' data-toggle='modal' data-target='#modalEditarServicio'><i class='fas fa-edit'></i></button><button class='btn btn-danger btnEliminarServicio' idServicio='\".$servicios[$i][\"idservicio\"].\"'><i class='fas fa-times'></i></button></div>\";\n\n\t\t \t}else{\n\n\t\t \t\t$botones = \"\";\n\n\t\t \t}\n\t\t \t\n\t\t \t/*===== End of TRAEMOS LAS ACCIONES ======*/\n\t\t \t\n\t\t \t$datosJson .= '[\n\t\t \"'.($i+1).'\",\n\t\t \"'.$servicios[$i][\"descripcion\"].'\",\n\t\t \"$ '.number_format($servicios[$i][\"precio\"], 2).'\",\n\t\t \"'.$servicios[$i][\"fecha\"].'\",\n\t\t \"'.$botones.'\"\n\t\t ],';\n\n\t\t }\n\n\t\t $datosJson = substr($datosJson, 0, -1);\n\t\t \n\t\t$datosJson .= ']\n\n\t\t}';\n\n\t\techo $datosJson;\n\n\t}", "public function visualizar() {\n echo $this->getTabuleiro();\n }", "public function show_table($tabla){\n\t\t\tinclude 'conection.php';\n\t\t\t$obj_conect=new Conection();\n\t\t\t$obj_conect->open_conection();\n\t\t\t$query_string=\"select * from \".$tabla.\"\";\n\t\t\t$aux_query=mysql_query($query_string);\n\t\t\twhile ($row=mysql_fetch_array($aux_query)) {\n\t\t\t\t$arr[]=$row;\n\t\t\t}\n\t\t\t$query_string=\"\";\n\t\t\t$obj_conect->close_conection();\t\t\n\t\t\treturn $arr;\n\t\t}", "public function tabla()\n\t\t{\t//condicion para la proteccion de las vistas\n\t\t\t$id_empleado = $_SESSION['id_empleado'];\n\t\t\tif ($id_empleado == null)\n\t\t\t{\n\t\t\t\tredirect(base_url() . 'index.php/header/controller_inicio/login');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->load->view(\"header/Header_caja\");\n\t\t\t\t$this->load->view(\"ventas/Tabla_dinamica_producto\");\n\t\t\t}\n\t\t}", "public function getTableOfContents();", "function ispis_tablice($ucenici)\n {\n echo '<table border=1>';\n foreach ($ucenici as $key => $ime) {\n echo '<tr><td>'\n .$key.'</td>;\n <td>'.$ime.'</td>;\n </tr>';\n }\n echo '</table>';\n }", "function ImprovedTable($header,$data)\n{\n\t//Anchuras de las columnas\n\t$w=array(60,30,20,35,35);\n\t//Cabeceras\n\t$l = mysql_connect(\"localhost\",\"pmm\",\"guhAf2eh\");\n\t//$l = mysql_connect(\"DBSERVER\",\"root\",\"root\");\n\tmysql_select_db(\"pmm_dbpruebas\", $l);\n\t//mysql_select_db(\"pmm_dbweb\", $l);\n\t$s = \"SELECT CONCAT_WS(' ',nombre,paterno,materno) AS cliente, d.calle, d.poblacion, d.estado, d.pais\n\tFROM catalogocliente cc\n\tINNER JOIN direccion d ON cc.id = d.codigo\n\tWHERE d.facturacion='SI'\n\tLIMIT 0,100\";\t\n\t$r = mysql_query($s,$l) or die($s);\n\t\n\tfor($i=0;$i<count($header);$i++)\n\t\t$this->Cell($w[$i],7,$header[$i],1,0,'C');\n\t$this->Ln();\n\t//Datos\t\n\t\twhile($row = mysql_fetch_array($r)){\n\t\t\t$this->Cell($w[0],6,$row[0],'LR');\n\t\t\t$this->Cell($w[1],6,$row[1],'LR');\n\t\t\t$this->Cell($w[2],6,number_format($row[2]),'LR',0,'R');\n\t\t\t$this->Cell($w[3],6,number_format($row[3]),'LR',0,'R');\n\t\t\t$this->Ln();\n\t\t}\n\t/*foreach($data as $row)\n\t{\n\t\t$this->Cell($w[0],6,$row[0],'LR');\n\t\t$this->Cell($w[1],6,$row[1],'LR');\n\t\t$this->Cell($w[2],6,number_format($row[2]),'LR',0,'R');\n\t\t$this->Cell($w[3],6,number_format($row[3]),'LR',0,'R');\n\t\t$this->Ln();\n\t}*/\n\t//Lnea de cierre\n\t$this->Cell(array_sum($w),0,'','T');\n}", "function fetchTabelaUsersAtivos($conn) {\n $sql = \"SELECT U.*, T.descricao FROM utilizador U, tipoUtilizador T WHERE tipoUtilizador <> '4' AND tipoUtilizador <> '6' AND T.idTipoUtilizador = U.tipoUtilizador ORDER BY U.data\";\n $retval = mysqli_query($conn, $sql);\n if(mysqli_num_rows($retval) != 0) {\n while($row = mysqli_fetch_array($retval, MYSQLI_ASSOC)) {\n mostrarDadosTabela($row); \n }\n } else {\n return false;\n }\n mysqli_close($conn);\n}", "public function getTables();", "public function getTables();", "public function getTables();", "function tabla_filas_compra_pago($filas,$tpago,$monto,$moneda,$tcambio,$opera,$boucher,$observ,$empresa,$caja,$banco,$cuenta,$tcambiodia){\n\t\t$tpago = explode(\"|\", $tpago);\n\t\t$monto = explode(\"|\", $monto);\n\t\t$moneda = explode(\"|\", $moneda);\n\t\t$tcambio = explode(\"|\", $tcambio);\n\t\t$opera = explode(\"|\", $opera);\n\t\t$boucher = explode(\"|\", $boucher);\n\t\t$observ = explode(\"|\", $observ);\n\t\t$empresa = explode(\"|\", $empresa);\n\t\t$caja = explode(\"|\", $caja);\n\t\t$banco = explode(\"|\", $banco);\n\t\t$cuenta = explode(\"|\", $cuenta);\n\t\t//----\n\t\t\t$salida.= '<table>';\n\t$i = 1;\t\n\t$total = 0;\n\tif($filas>0){\n\t\tfor($i = 1; $i <= $filas; $i ++){\n\t\t\t//acumulado\n\t\t\t$Dcambiar = 0;\n\t\t\t$Dcambiar = Cambio_Moneda($tcambio[$i],$tcambiodia,$monto[$i]);\n\t\t\t$total += $Dcambiar;\n\t\t\t//-\n\t\t\t$salida.= '<td>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Ttpag'.$i.'\" id = \"Ttpag'.$i.'\" value = \"'.$tpago[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tmonto'.$i.'\" id = \"Tmonto'.$i.'\" value = \"'.$monto[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tmoneda'.$i.'\" id = \"Tmoneda'.$i.'\" value = \"'.$moneda[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Ttipcambio'.$i.'\" id = \"Ttipcambio'.$i.'\" value = \"'.$tcambio[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Toperador'.$i.'\" id = \"Toperador'.$i.'\" value = \"'.utf8_decode($opera[$i]).'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tboucher'.$i.'\" id = \"Tboucher'.$i.'\" value = \"'.trim($boucher[$i]).'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tobserva'.$i.'\" id = \"Tobserva'.$i.'\" value = \"'.utf8_decode($observ[$i]).'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tsucur'.$i.'\" id = \"Tsucur'.$i.'\" value = \"'.$empresa[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tcaja'.$i.'\" id = \"Tcaja'.$i.'\" value = \"'.$caja[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tbanco'.$i.'\" id = \"Tbanco'.$i.'\" value = \"'.$banco[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tcuenta'.$i.'\" id = \"Tcuenta'.$i.'\" value = \"'.$cuenta[$i].'\" />';\n\t\t\t$salida.= '</td>';\n\t\t}\n\t}\t\t\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td><input type = \"hidden\" name = \"PagFilas\" id = \"PagFilas\" value = \"'.$filas.'\"/></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td><input type = \"hidden\" name = \"PagTotal\" id = \"PagTotal\" value = \"'.$total.'\"/></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '</table>';\n\t\n\treturn $salida;\n}", "function ImprimeTableFunciones($idTabla, $data, $pactu = \"\", $peli = \"\",$classCSS=\"\") {\n // echo \"ImprimeTable:::::::::::::::\".count($data[\"cuerpo\"]).\" <br>\";\n\t\ttry {\n // if (count($data) > 0) {\n\t\t\t $tabla = '<table id=\"'.$idTabla.'\" class=\"' . $classCSS . '\" cellpadding=\"0\" cellspacing=\"1\" border=\"1\" align=\"center\" style=\"text-align:center;\" >';\n\t\t\t if (count($data[\"columnas\"]) > 0) {\n\t\t\t\t$tabla.= '<thead>';\n $tabla .= '<tr>';\n $conta = 0;\n $conte = 0;\n\t\t\t\t\n for ($x = 0;$x < count($data[\"columnas\"]);$x++) {\n\t\t\t\t\t \n if ($pactu != \"\") {\n if ($conta == 0) {;\n\t\t\t\t\t\t $tabla.= '<th></th>';\n //$tabla.= '<td></td>';\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n $tabla.= '<th></th>';\n\t\t\t\t\t\t\t//$tabla.= '<td></td>';\n }\n }\n $conta++;\n $conte++;\n $tabla.= '<th>' . utf8_encode($data[\"columnas\"][$x]) . '</th>'; \n }\n\t\t\t\t$tabla.= '</tr>';\n\t\t\t\t$tabla.= '</thead>';\n\t\t\t }\n //===========CUERPO DE TABLA=================================================================================================\n $cantele = count($data[\"cuerpo\"]);\n if ($cantele > 0) {\n for ($i = 0;$i < $cantele;$i++) {\n $conta = 0;\n $conte = 0;\n $tabla.= \"<tr>\";\n for ($z = 0;$z < count($data[\"columnas\"]);$z++) {\n $columnas = $data[\"columnas\"][$z];\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n if ($pactu != \"\") {\n if ($conta == 0) {\n // $tabla.= '<td><a href=\"javascript:'.$pactu.'('. $data[\"cuerpo\"][$i][\"$columnas\"] .');\" title=\"Actualizar\" ><img title=\"Actualizar\" src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>';\n\t\t\t\t\t\t\t\t $tabla.= '<td><a href=\"#\" onClick=\"'.$pactu.'('. $data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" title=\"Actualizar\" ><img src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>'.\"\\n\";\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n $tabla.= '<td><a href=\"#\" onClick=\"'.$peli.'('.$data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" ><img src=\"../imgcixphp/delete.gif\" width=\"16\" title=\"Eliminar\" height=\"16\"/></a></td>'.\"\\n\";\n }\n }\n }\n $conta++;\n $conte++;\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n $tabla.= '<td>&nbsp;' . $data[\"cuerpo\"][$i][\"$columnas\"] . '&nbsp; </td>'.\"\\n\";\n }\n }\n $tabla.= '</tr>';\n }\n \n }else{//solo si es k no hay datos\n\t\t\t\t$mensaje= \"No se encuentran Datos Registrados\"; \n\t\t\t $tabla.='<tfoot><tr> <td >&nbsp; '.$mensaje.' </td></tr></tfoot>';\n\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t//===========FIN CUERPO DE TABLA===========================================================================================\n $tabla.= '</table><br />';\n\t\t\t\t//}\n }catch(exception $e) {\n return $e->getMessage();\n }\n return $tabla;\n }", "function ImprimeTablePO($idTabla, $data, $pactu, $peli, $crxpag=10, $paginap = 1, $cantlink = 5,$orderby = -1,$classCSS=\"\") { \n $tabla = '<table id=\"' . $idTabla . '\" class=\"'.$classCSS.'\" cellpadding=\"0\" cellspacing=\"1\" border=\"1\" align=\"center\" style=\"text-align:center\" >';\n try {\n // if (count($data) > 0) {\n\t\t\t if (count($data[\"columnas\"]) > 0) {\n\t\t\t\t$tabla.= '<thead>';\n $tabla .= '<tr>';\n $conta = 0;\n $conte = 0;\n for ($x = 0;$x < count($data[\"columnas\"]);$x++) {\n if ($pactu != \"\") {\n if ($conta == 0) {;\n $tabla.= '<td></td>';\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n $tabla.= '<td></td>';\n }\n }\n $conta++;\n $conte++;\n //Nombres de las columnas\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t$ordenar = $x + 1;\t\t\t\t\t\n\t\t\t\t\t//$tabla.= '<th><a href=\"?pagina=' . $paginap . '&orden=' . $ordenar . '\" >' . utf8_encode($data[\"columnas\"][$x]) . '</a></th>';\n\t\t\t\t\t$tabla.= '<th><a href=\"#\" onClick=\"Paginar(\\'pagina=' . $paginap . '&orden=' . $ordenar . '\\'); return false\" >' . utf8_encode($data[\"columnas\"][$x]) . '</a></th>'.\"\\n\";\n\t\t\t\t \n }\n \t\t$tabla.= \"</tr>\";\n\t\t\t\t$tabla.= '</thead>';\n\t\t\t }\n //===========CUERPO DE TABLA=================================================================================================\n $cantele = count($data[\"cuerpo\"]);\n if ($cantele > 0) {\n $fin = $paginap * $crxpag;\n $ini = $fin - $crxpag;\n for ($i = $ini;$i < $fin;$i++) {\n $conta = 0;\n $conte = 0;\n $tabla.= '<tr>';\n for ($z = 0;$z < count($data[\"columnas\"]);$z++) {\n $columnas = $data[\"columnas\"][$z];\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n if ($pactu != \"\") {\n if ($conta == 0) {\n // $tabla.= '<td><a href=\"' . $pactu . 'id=' . $data[\"cuerpo\"][$i][\"$columnas\"] . '&accion=Mactualizar\"><img src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>'.\"\\n\";\n\t\t\t\t\t\t\t\t $tabla.= '<td><a href=\"#\" onClick=\"'.$pactu.'('. $data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" title=\"Actualizar\" ><img title=\"Actualizar\" src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>'.\"\\n\";\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n // $tabla.= '<td><a href=\"' . $peli . 'id=' . $data[\"cuerpo\"][$i][\"$columnas\"] . '&accion=Eliminar\"><img src=\"../imgcixphp/ico_eliminar.gif\" width=\"16\" title=\"Eliminar\" height=\"16\"/></a></td>'.\"\\n\";\n\t\t\t\t\t\t\t\t $tabla.= '<td><a href=\"#\" onClick=\"'.$peli.'('.$data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" ><img src=\"../imgcixphp/delete.gif\" width=\"16\" title=\"Eliminar\" height=\"16\"/></a></td>'.\"\\n\";\n }\n }\n }\n $conta++;\n $conte++;\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n $tabla.= '<td>' . $data[\"cuerpo\"][$i][\"$columnas\"] . '</td> '.\"\\n\";\n }\n }\n $tabla.= '</tr>';\n }\n\t\t\t\t//===========FIN CUERPO DE TABLA===========================================================================================\n \t$tabla.= '</table><p style=\"clear:both;height:5px;\"></p>'; \n //===========PAGINADO======================================================================================================================\n $paginado = Paginar($cantele, $crxpag, $paginap, $cantlink,$orderby);\n $tabla.= $paginado;\n //===========FIN PAGINADO ==================================================================================================================\n \n }else{//solo si es k no hay datos\n\t\t\t\t$mensaje= \"No se encuentran Datos Registrados\"; \n\t\t\t \t $tabla.='<tfoot><tr> <td >&nbsp; '.$mensaje.' </td></tr></tfoot></table><br>';\n\t\t\t\t}\n\t\t\t\n }catch(exception $e) {\n return $e->getMessage();\n }\n return $tabla;\n }", "function visualizar($pag=\"\",$orderby=\"\")\n {\n global $sIdConvenioAct;\n for($i=0;$i<2;$i++){\n $consulta = $this->sql;\n //filas obtenidas\n $total = $this->contarfilas($consulta);\n //tamaņo del paginador\n if($total<200):\n $tampag=20;\n elseif ($total<400):\n $tampag=40;\n else:\n $tampag=60;\n endif;\n $iniciaren=($pag-1) * $tampag; //Registro actual\n if($iniciaren<0)$iniciaren=0;\n \n $this->paginar($pag, $total, $tampag, \"?pag=\"); \n \n if ($orderby !=\"\"){\n $consulta = $this->sql.\" ORDER BY $orderby LIMIT $iniciaren,$tampag\";\n }\n else {\n $consulta = $this->sql.\" LIMIT $iniciaren,$tampag\"; \n }\n \n $result = $this->query($consulta);\n //obtener descripcion de la tabla\n $tablades = $this->comentarioTabla($this->nombreTabla($result, 0));\n //si no tiene, poner como descripcion el nombre de la misma\n if ($tablades == \"\") $tablades = $this->nombreTabla($result, 0);\n else if($this->edit==1 and $this->delete==1) $espacio = 2;\n else if($this->edit==1 and $this->delete==0) $espacio = 1;\n else if($this->edit==0 and $this->delete==1) $espacio = 1;\n else $espacio = 0;\n echo \"\\n<center><table class='enhancedtablerowhover'>\n \\n<caption><center><font size='1.5'>\".$tablades.\"</font></center></caption>\n \\n<thead>\n \\n<tr>\n \\n<td scope='col' colspan=\".($espacio+2).\"></td>\";\n \n for ($i = 0; $i < mysql_num_fields($result); $i++)\n {\n $campo=$this->nombreCampo($result, $i);\n //los campos imagen no mostrarlos\n if (!$this->mostrarCampo($campo))\n continue;\n //obtener descripcion del campo \n $des = str_replace(\"/*\", \"\", $this->comentario($this->nombreCampo($result, $i),\n $this->nombreTabla($result, $i)));\n //si no tiene, poner como descripcion el nombre del mismo\n if ($des == \"\" or is_numeric($des)) $des = $campo;\n echo \"\\n<th scope='col' ><a href='?order=$campo'>$des</a></th>\";\n }\n echo \" \\n</tr>\n \\n</thead>\n \\n<tbody>\";\n while ($row = mysql_fetch_array($result))\n {\n $filtro = $this->cifrar($row, $result);\n echo \"\\n<tr>\";\n echo \"\\n<td class='CrearReporte'>\n \\n<a title = 'Imprimir' href='reporte/rptEmbarques.php?iFolio=\".$row['iFolio'].\"&sContrato=\".$row['sContrato'].\"&sNumeroOrden=\".$row['sNumeroOrden'].\"&sIdConvenio=$sIdConvenioAct\".\"&dFecha=\".$row['dIdFecha'].\"' target='_blank' >\n \\n<img src='\".$this->PathImages.\"impresora.png' width=15></a></td>\";//$_SESSION['orden']\n if($this->edit==1)\n echo \"\\n<td class='CrearReporte'>\n \\n<a title = 'Seleccionar Folio' href='$_SERVER[PHP_SELF]?iFolioSuministro=\".$row['iFolio'].\"'>\n \\n<img src='\".$this->PathImages.\"seleccionar.jpg' width=15></a></td>\";\n echo \"\\n<td class='CrearReporte'>\n \\n<a title = 'Modificar Registro ' href='$_SERVER[PHP_SELF]?operacion=m&$filtro'>\n \\n<img src='\".$this->PathImages.\"editar.png' width=12></a></td>\";\n if($this->delete==1)//'href='$_SERVER[PHP_SELF]?operacion=b&$filtro'\n echo \"\\n<td class='CrearReporte' >\n \\n<a title = 'Eliminar el Registro' href=\\\"#\\\" \n onClick=\\\" if( confirm('Realmente Desea Eliminar el Registro?') ){ document.location='$_SERVER[PHP_SELF]?operacion=b&$filtro' };\\\" >\n \\n<img src='\".$this->PathImages.\"eliminar.png' width=12>\n \\n</a></td> \";\n for ($i = 0; $i < mysql_num_fields($result); $i++)\n {\n if(strpos(strtoupper($this->nombreCampo($result, $i)),strtoupper(\"Imagen\")) and $tipo = $this->tipoCampo($result, $i)==\"blob\") \n {\n $nombreImagen=\"\";\n foreach($this->campollave as $claves){\n $nombreImagen.=$row[$claves]; \n }\n $nombreImagen = str_replace(\"/\",\"-\",$nombreImagen);\n $nombreImagen.=\".jpg\";\n //$nombreImagen=$row[$this->campollave].\".jpg\";\n $img = $this->procesarImagen($row[$i],$nombreImagen);\n }\n if (!$this->mostrarCampo($this->nombreCampo($result, $i)))\n continue;\n if ($img){\n echo \"\\n<td><img border=1 src = '$nombreImagen' width = '90' heigth = '90'</img></td>\";\n $img = false;\n }\n else if(( strpos(strtoupper($this->nombreCampo($result, $i)),\"DLL\")!==false or strpos(strtoupper($this->nombreCampo($result, $i)),\"MN\")!==false )\n AND $this->tipoCampo($result, $i)==\"real\"){\n $row[$i] = number_format($row[$i], 4, '.', ',');\n echo \"\\n<td class ='derecha'>$ \".$row[$i].\"</td>\";\n }\n else if( strpos($this->tipoCampo($result, $i),\"real\")!==false ){\n $row[$i] = number_format($row[$i], 4, '.', ',');\n echo \"\\n<td class ='derecha'> \".$row[$i].\"</td>\";\n }\n else if(strpos(strtolower($this->nombreCampo($result, $i)), strtolower(\"fecha\"))!==false){//formato de fecha\n echo \"\\n<td>\".formatoFecha($row[$i]).\"</td>\";\n }\n else\n echo \"\\n<td>\".$row[$i].\"</td>\";\n\n }\n echo \"\\n</tr>\";\n }\n echo \"\\n</tr></tbody></table></center>\";\n $this->paginar($pag, $total, $tampag, \"?pag=\"); \n }\n }", "public function rellenarTabla($cabecera,$cuerpo,$ini,$fin,$tipo){\n \n if($tipo == '1'){\n $tabla = \"<table class='table font-10 text-center'>\";\n $tablaHead =\"<thead><tr><th class='text-center'>FAMILIAR</th>\";\n }else{\n $tabla = \"<table class='table font-10 text-center'>\";\n $tablaHead =\"<thead><tr><th>NOMBRE</th>\";\n }\n \n //*********Se agregan las cabeceras a las tablas********\n \n $numRegistros = count($cabecera);\n \n for ($i=$ini; $i < $fin; $i++) {\n \n if($i < $numRegistros){\n $tablaHead = $tablaHead.\"<th class='text-center'>\".$cabecera[$i]->NOMBRE_ENFER.\"</th>\";\n }\n \n }\n\n $endThead = \"</tr></thead>\";\n $tablaBody = \"<tbody>\";\n $seEncontroRel = FALSE;\n\n //***********se agrega el body a las tablas************\n\n foreach ($cuerpo as $rel) {\n $enfermedad = explode(\",\", $rel->ENFERMEDAD);\n $numEnf = count($enfermedad);\n $rowTable = \"</tr><td>\".$rel->NOMBRE_PAR.\"</td>\";\n //se recorre las enfermedades en base a un inicio y un fin\n for ($i=$ini; $i < $fin; $i++) {\n //es te if es para que en caso de que el fin sea mayor al del arreglo no se rompa\n if($i < $numRegistros){\n //se recorren los enfermedades relacionadas\n for ($j=0; $j < $numEnf; $j++) {\n //se valisa si son iguales\n if($cabecera[$i]->ID_ENFER_PK == $enfermedad[$j]){\n //echo \"valor 1 \".$cabecera[$i]->ID_ENFER_PK.\"<br>\";\n //echo \"valor 2 \".$enfermedad[$j].\"<br>\";\n $seEncontroRel = TRUE;\n break;\n }else{\n $seEncontroRel = FALSE;\n }\n }\n //en base a la variable se agrega si o no\n if($seEncontroRel == FALSE){\n //se agrega un No si no corresponde\n $rowTable = $rowTable.\"<td>NO</td>\";\n }else{\n //se agrega un Si cuando sena iguales\n $rowTable = $rowTable.\"<td>SI</td>\";\n }\n }\n }\n //se agregan los valores a la tabla\n $tablaBody = $tablaBody.$rowTable.\"<tr>\";\n }\n //*****************************************************\n \n $endTBody = \"</tbody>\";\n $endTabla = \"</table>\";\n \n //se concatenan todos los valores para la creacion de la tabla\n $tablaFamily = $tabla.$tablaHead.$endThead.$tablaBody.$endTBody.$endTabla;\n\n //Se regresa la tabla\n return $tablaFamily;\n }", "function mostrarDetalleProceso(){\r\n ?>\r\n <script type=\"text/javascript\" src=\"<? echo $this->configuracion[\"host\"].$this->configuracion[\"site\"].$this->configuracion[\"javascript\"];?>/datatables/js/jquery.js\"></script>\r\n <script type=\"text/javascript\" src=\"<? echo $this->configuracion[\"host\"].$this->configuracion[\"site\"].$this->configuracion[\"javascript\"];?>/datatables/js/jquery.dataTables.js\"></script>\r\n <script>\r\n $(document).ready(function() { \r\n $('#tabla').dataTable();\r\n })\r\n </script>\r\n <link type=\"text/css\" href=\"<? echo $this->configuracion[\"host\"].$this->configuracion[\"site\"].$this->configuracion[\"javascript\"];?>/datatables/css/jquery.dataTables_themeroller.css\" rel=\"stylesheet\"/>\r\n \r\n <? \r\n echo \"<h1>Detalles de Proceso</h1>\";\r\n $html = \"<table id='tabla' >\";\r\n $html .= \"<thead>\";\r\n $html .= \"<tr>\"; \r\n $html .= \"<td>Código Estudiante</td>\"; \r\n $html .= \"<td>Observación</td>\";\r\n $html .= \"</tr>\";\r\n $html .= \"</thead>\";\r\n $html .= \"<tbody>\";\r\n foreach ($this->mensaje as $key => $estudiante) {\r\n \r\n $html .= \"<tr>\";\r\n $html .= \"<td>\".$key.\"</td>\";\r\n $html .= \"<td>\";\r\n foreach ($estudiante as $key2=>$obs_estudiante) {\r\n if (count($estudiante)>1&&$key2>0)\r\n {\r\n $html.=\"<br>\";\r\n }\r\n $html .= $obs_estudiante;\r\n }\r\n $html .= \"</td>\";\r\n $html .= \"</tr>\";\r\n }\r\n $html .= \"</tbody>\";\r\n \r\n $html .= \"</table>\";\r\n echo $html;\r\n }", "function imprimir_contadores($fila,$contadores){\n\t for($i=0; $i<8;$i++){\n\t echo'<td>'.$contadores[$fila][$i].'</td>';\n\t }\n\n\t }", "function tabledata_Cadre_voirlestables ($serveur,$boolSPIP=false)\r\n{\r\n global $connect_statut, $spip_lang, $connect_id_auteur;\r\n\r\n $tables_extra = array();\r\n $tables_spip = array();\r\n $intNbExtra = 0 ;\r\n\r\n $sqlResultTables = sql_showbase('%');\r\n while ($tabNomTable = sql_fetch($sqlResultTables))\r\n {\r\n foreach ($tabNomTable as $key => $val)\r\n {\r\n if (preg_match('#^'.tabledata_table_prefix().'_#', $val))\r\n {\r\n $tables_spip[] = $val;\r\n }\r\n else\r\n {\r\n $tables_extra[] = $val;\r\n ++$intNbExtra ;\r\n }\r\n }\r\n }\r\n\r\n // affichage\r\n echo \"Choisir une table Extra parmis celle ci-dessous:\\n\";\r\n if ($intNbExtra<1)\r\n {\r\n echo \"Aucune table extra ne semble disponible.\";\r\n }\r\n else\r\n {\r\n echo tabledata_table_HTML ($tables_extra);\r\n }\r\n if ($boolSPIP)\r\n {\r\n echo \"<hr/>\";\r\n echo \"Les tables de SPIP :\\n\";\r\n echo tabledata_table_HTML ($tables_spip);\r\n }\r\n return;\r\n}", "function getColumnasFomTable($tabla)\n{\n $query = \"SELECT cols.ordinal_position as posicion,cols.column_name as nombre,cols.data_type\"\n .\" FROM information_schema.columns cols\"\n .\" WHERE\"\n .\" cols.table_name=?\"\n .\" and cols.column_name not in ('created_at', 'updated_at')\"\n .\" order by posicion\";\n\n $lista = \\DB::select($query, [$tabla]);\n $columnas = array();\n foreach($lista as $item){\n $columnas[$item->nombre] = str_oracion($item->nombre);\n }\n\n return $columnas;\n}", "public function readTabla() {\r\n $query = 'SELECT * FROM ' . $this->tabla;\r\n\r\n\r\n \r\n\r\n $sentencia = $this->con->prepare($query);\r\n\r\n $sentencia->execute();\r\n\r\n return $sentencia;\r\n }", "function tabla_filas_proyecto($filas,$moneda,$cant,$tip,$barc,$artc,$desc,$prev,$mon,$mons,$monc,$tfdsc,$fdsc,$tdsc,$dsc,$IVA){\n\t\t$monchunk = explode(\"/\",$moneda); \n\t\t$Vmond = trim($monchunk[0]); // Nombre de Moneda\n\t\t$Vmons = trim($monchunk[1]); // Simbolo de Moneda\n\t\t$Vmonc = trim($monchunk[2]); // Tipo de Cambio\n\t\t$Vmonc = str_replace(\"(\",\"\",$Vmonc); //le quita el primer parentesis que rodea el tipo de cambio\n\t\t$Vmonc = str_replace(\" x 1)\",\"\",$Vmonc); //le quita el 2do. parentesis y el x 1\n\t\t\t$salida = '<br>';\n\t\t\t$salida.= '<table class = \"tablegrid\">';\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"30px\" height = \"30px\">No.</td>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"75px\">Cant.</td>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"300px\">Descipción</td>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"75px\">P. Unitario</td>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"75px\">Descuento</td>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"75px\">P. Total</td>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"30px\"></td>';\n\t\t\t$salida.= '</tr>';\n\t$STotal = 0;\n\t$Total = 0;\n\t$Rtotal = 0;\n\t$DescU = 0;\n\tif($filas>0){\n\t\tfor($i = 1; $i <= $filas; $i ++){\n\t\t\t//No.\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">'.$i.'.</td>';\n\t\t\t//Cantidad\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spancant'.$i.'\">'.$cant[$i].'</span>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"cant'.$i.'\" id = \"cant'.$i.'\" value = \"'.$cant[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"tip'.$i.'\" id = \"tip'.$i.'\" value = \"'.$tip[$i].'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t//Descripcion o Articulo\n\t\t\t$desc[$i] = utf8_decode($desc[$i]);\n\t\t\t$desc[$i] = trim($desc[$i]);\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"left\">'.$desc[$i];\n\t\t\t$salida.= '<input type = \"hidden\" name = \"barc'.$i.'\" id = \"barc'.$i.'\" value = \"'.$barc[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"artc'.$i.'\" id = \"artc'.$i.'\" value = \"'.$artc[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"desc'.$i.'\" id = \"desc'.$i.'\" value = \"'.$desc[$i].'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t//Precio U.\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">'.trim($mons[$i]).' '.$prev[$i];\n\t\t\t$salida.= '<input type = \"hidden\" name = \"prev'.$i.'\" id = \"prev'.$i.'\" value = \"'.$prev[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"mon'.$i.'\" id = \"mon'.$i.'\" value = \"'.trim($mon[$i]).'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"mons'.$i.'\" id = \"mons'.$i.'\" value = \"'.trim($mons[$i]).'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"monc'.$i.'\" id = \"monc'.$i.'\" value = \"'.trim($monc[$i]).'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t//Descuento\n\t\t\t$dsign = ($tdsc[$i] == \"P\")?\"%\":trim($mons[$i]);\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spandsc'.$i.'\">'.$dsign.' '.$dsc[$i].'</span>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"tdsc'.$i.'\" id = \"tdsc'.$i.'\" value = \"'.$tdsc[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"dsc'.$i.'\" id = \"dsc'.$i.'\" value = \"'.$dsc[$i].'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t//sub Total\n\t\t\t$rtot = ($prev[$i] * $cant[$i]);\n\t\t\tif($tdsc[$i] == \"P\"){\n\t\t\t\t$descuento = ($rtot *($dsc[$i])/100);\n\t\t\t}else if($tdsc[$i] == \"M\"){\n\t\t\t $descuento = $dsc[$i];\n\t\t\t}\n\t\t\t$Dcambiar = Cambio_Moneda($monc[$i],$Vmonc,$descuento);\n\t\t\t$DescU += $Dcambiar;\n\t\t\t$stot = $rtot - $descuento;\n\t\t\t$Dcambiar = Cambio_Moneda($monc[$i],$Vmonc,$stot);\n\t\t\t$STotal+= $Dcambiar;\n\t\t\t$Rcambiar = Cambio_Moneda($monc[$i],$Vmonc,$rtot);\n\t\t\t$Rtotal+= $Rcambiar;\n\t\t\t$stot = round($stot, 2);\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spanstot'.$i.'\">'.trim($mons[$i]).' '.$stot.'</span>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"stot'.$i.'\" id = \"stot'.$i.'\" value = \"'.$stot.'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"rtot'.$i.'\" id = \"rtot'.$i.'\" value = \"'.$rtot.'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t//---\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">';\n\t\t\t$salida.= '<a href = \"javascript:void(0);\" onclick = \"QuitarFilaVenta('.$i.')\" title = \"Quitar Fila\" style = \"border:none;\" ><img src = \"../../CONFIG/images/icons/delete.png\" style = \"vertical-align:middle;border:none;\"></a>';\n\t\t\t$salida.= '</td>';\n\t\t\t$salida.= '</tr>';\n\t\t}\n\t}\t\t\n\t\t\t//----\n\t\t\tif($tfdsc == \"P\"){\n\t\t\t\t$descuento = ($STotal *($fdsc)/100);\n\t\t\t}else if($tfdsc == \"M\"){\n\t\t\t $descuento = $fdsc;\n\t\t\t}\n\t\t\t$Total = $STotal - $descuento;\n\t\t\t$STotal = round($STotal, 2); //total sin iva\n\t\t\t$Total = round($Total, 2); //total sin iva\n\t\t\t$DescU = round($DescU, 2); //promedio de descuento\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td class = \"tdgrid\" colspan = \"3\" rowspan = \"4\">';\n\t\t\t$salida.= '<span id = \"spannota\">';\n\t\t\t$salida.= '<b>NOTA:</b> MONEDA PARA COTIZACI&Oacute;N: <b>'.$Vmond.'</b>. TIPO DE CAMBIO '.$Vmonc.' x 1';\n\t\t\t$salida.= '</span></td>';\n\t\t\t$salida.= '<td class = \"thgrid\">Desc/Unitarios</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spanpromdesc\"><b>'.$Vmons.' '.$DescU.'</b></span>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">-</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"promdesc\" id = \"promdesc\" value = \"'.$DescU.'\" /></td>';\n\t\t\t$salida.= '</td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td class = \"thgrid\">Subtotal</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">-</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spanstotal\"><b>'.$Vmons.' '.$STotal.'</b></span>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"stotal\" id = \"stotal\" value = \"'.$STotal.'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" colspan = \"2\"></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td class = \"thgrid\">Desc/General</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">-</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spandscgeneral\"><b>'.$Vmons.' '.$descuento.'</b></span>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"ttotal\" id = \"tdescuento\" value = \"'.$descuento.'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"ttotal\" id = \"ttdescuento\" value = \"'.$tfdsc.'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" colspan = \"2\"></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td class = \"thgrid\">TOTAL</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">-</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spanttotal\"><b>'.$Vmons.' '.$Total.'</b></span>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"ttotal\" id = \"ttotal\" value = \"'.$Total.'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Rtotal\" id = \"Rtotal\" value = \"'.$Rtotal.'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"filas\" id = \"filas\" value = \"'.$filas.'\"/></td>';\n\t\t\t$salida.= '</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" colspan = \"2\"></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '</table>';\n\t\t\t$salida.= '</form>';\n\t\t\t$salida.= '<br>';\n\t\n\treturn $salida;\n}", "public function makeColumns(){\n $hijosDetalle=$this->\n getReportedetalle()->\n where(['and', \"esdetalle='1'\", \"visiblecampo='1'\"])->\n orderBy('orden')->all();\n //echo count( $hijosDetalle);die();\n $columns=[];\n foreach($hijosDetalle as $fila){\n $columns[]=[\n 'attribute'=>$fila->nombre_campo,\n 'label'=>$fila->aliascampo,\n 'format'=>'raw',\n 'options'=>['width'=>\n $this->sizePercentCampo($fila->nombre_campo).'%'],\n ];\n \n \n }\n return $columns;\n \n }", "public function tablaIndex(){\n $listado = IngresosB3::orderBy('fecha', 'ASC')->get();\n\n foreach ($listado as $l){\n $l->fecha = date(\"d-m-Y h:i A\", strtotime($l->fecha));\n $servicio = ServiciosB3::where('id', $l->id_servicios)->pluck('nombre')->first();\n $l->servicio = $servicio;\n }\n\n return view('backend.bodega3.verificacion.tabla.tablaverificacion', compact('listado'));\n }", "function getColumnas($conn, $exitosa) {\n\t\tif ($exitosa){\t\t\t\n\t\t\t$sql = 'SELECT c1_int, c2_int FROM #php_test_table';\n\t\t\t\n\t\t\techo '<table border=1 >';\t\t\n\t\t\tprint \"<tr>\";\n\t\t\tprint \"<td><b> c1_int </b></td>\";\n\t\t\tprint \"<td><b> c2_int </b></td>\";\n\t\t\tprint \"</tr>\";\n\t\t\tforeach ($conn->query($sql) as $row) {\n\t\t\t\tprint \"<tr>\";\n\t\t\t\tprint \"<td>\" . $row['c1_int'] . \"</td>\";\n\t\t\t\tprint \"<td>\" . $row['c2_int'] . \"</td>\";\n\t\t\t\tprint \"</tr>\";\n\t\t\t}\n\t\t\techo '</table>';\n\t\t}\n\t}", "public function mostrar_tabla_borradores(){\n\t\t$return = array( \n\t\t\t'pestanna_borradores' => '',\n\t\t\t'contenido_borradores' => '');\n\n\t\tif($this->tipo_usuario == 'empresa'){\n\t\t\t$return['pestanna_borradores'] = '<li class=\"\"><a href=\"#pestanna_borradores\" data-toggle=\"tab\">Borradores</a></li>';\n\t\t}\n\n\t\t$cols = array('id', 'clave_interna', 'provincia', 'municipio', 'tipo_venta', 'fecha_publicacion');\n\t\t$this->where('ussr',$this->user);\n\n\t\tif($salida = $this->get('anuncios_borradores', NULL, $cols)){\n\n\t\t\t$return['contenido_borradores'] .= '<table class=\"table table-bordered table-hover\">';\n\t\t\t$return['contenido_borradores'] .='<tr>\n\t\t\t\t\t<th>clave_interna</th><th>provincia</th>\n\t\t\t <th>municipio</th><th>tipo_venta</th>\n\t\t\t <th>fecha_publicacion</th>\n\t\t\t <th>Opciones</th>\n\t\t\t </tr>';\n\n\t\t\tforeach ($salida as $key => $value) {\n\t\t\t\t$return['contenido_borradores'] .='<tr>\n\t\t\t <td>'.$value['clave_interna'].'</td>\n\t\t\t <td>'.$value['provincia'].'</td>\n\t\t\t <td>'.$value['municipio'].'</td>\n\t\t\t <td>'.$value['tipo_venta'].'</td>\n\t\t\t <td>'.$value['fecha_publicacion'].'</td>\n\n\t\t\t <td>'.$this->dropdown_tabla_borradores($value['id']).'</td>\n\n\t\t\t </tr>';\n\n\t\t\t}\n\n\t\t\t$return['contenido_borradores'] .= '</table>';\n\n\t\t}\n\t\treturn $return;\n\t}", "public function leerDatos($tabla){\r\n\t\t\t$sql = '';\r\n\t\t\tswitch($tabla){\r\n\t\t\t\tcase \"Usuario\":\r\n\t\t\t\t\t$sql = \"\r\n\t\t\t\t\t\tSELECT id, nombre, nacido, sexo, foto from usuario;\r\n\t\t\t\t\t\";\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"UsuarioDeporte\":\r\n\t\t\t\t\t$sql = \"\r\n\t\t\t\t\t\tSELECT id_usuario, id_deporte from usuario_deporte;\r\n\t\t\t\t\t\";\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"Deporte\":\r\n\t\t\t\t\t$sql = \"\r\n\t\t\t\t\t\tSELECT id, nombre from deporte;\r\n\t\t\t\t\t\";\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"Passwd\":\r\n\t\t\t\t\t$sql = \"\r\n\t\t\t\t\t\tSELECT usuario, clave from passwd; \r\n\t\t\t\t\t\";\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t$arrayFilas=$this->conn->query($sql);\r\n\t\t\treturn $arrayFilas;\r\n\t\t}", "public static function obtenerTablaHtml($clase, $rotulos = array(), $foraneos = array(), $ver = \"*\", $extra = \"\", $pagina = 0, $cantidad = self::REGISTROS_PAGINA, $clase2 = null){\n\t\t$pagina = ($pagina < 0 ? 0 : $pagina);\n\t\t$arrTb = self::obtenerListado( $clase, $ver, $extra, $pagina, $cantidad );\n\t\t$tabla = '<table>';\n\t\t$encabezados = '';\n\t\t$cuerpo = '';\n\t\tif( sizeof( $arrTb ) > 0 ){\n\t\t\t\n\t\t\t$encabezados .= '\t<thead>';\n\t\t\t$encabezados .= '\t\t<tr> ';\n\t\t\t$arrHd = array_keys($arrTb[0]);\n\t\t\t\n\t\t\tforeach ( $arrHd as $idH => $vlH ){\n\t\t\t\t$rt = $vlH;\n\t\t\t\tif( is_array( $rotulos ) ){\n\t\t\t\t\tif( isset( $rotulos[ $vlH ] ) ){\n\t\t\t\t\t\t$rt = $rotulos[ $vlH ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$encabezados .= '\t\t\t<th>' . $rt . '</th> ';\n\t\t\t}\n\t\t\t$encabezados .= '\t\t</tr> ';\n\t\t\t$encabezados .= '\t</thead> ';\n\t\t\t\n\t\t\t$cuerpo .= '<tbody>';\n\t\t\tforeach ($arrTb as $idB => $vlB) {\n\t\t\t\t$cuerpo .= '<tr>';\n\t\t\t\t\n\t\t\t\tforeach ($vlB as $idCuerpo => $vlCuerpo ) {\n\t\t\t\t\t$txtDef = $vlCuerpo;\n\t\t\t\t\tif( isset( $foraneos[ $idCuerpo ] ) ){\n\t\t\t\t\t\t$tmpField = $foraneos[ $idCuerpo ];\n\t\t\t\t\t\tif( isset( $tmpField[ $vlCuerpo ] ) ){\n\t\t\t\t\t\t\t$txtDef = $tmpField[ $vlCuerpo ];\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$strPrint = $txtDef;\n\t\t\t\t\t\n\t\t\t\t\tif( strtolower( $idCuerpo ) == \"id\" ){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$jsmenuid = (isset($_POST[ \"jsmenuid\" ]) ? $_POST[ \"jsmenuid\" ]: \"\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '<td >';\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '\t<table>';\n\t\t\t\t\t\t$cuerpo .= '\t\t<tbody>';\n\t\t\t\t\t\t$cuerpo .= '\t\t\t<tr>';\n\t\t\t\t\t\t$cuerpo .= '\t\t\t\t<td>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '\t<form action=\"./\" method=\"post\" id=\"dtView_' . $strPrint . '\" >';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif( isset( $vlB[ \"estado_id\" ] ) ){\n\t\t\t\t\t\t\tif( $vlB[\"estado_id\"] == \"1\"){\n\t\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"submit\" value=\"&nbsp;\" class=\"dtViewVisible\" />';\n\t\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"ide\" value=\"' . md5( 2 ) . '\" />';\n\t\t\t\t\t\t\t}else if( $vlB[\"estado_id\"] == \"2\"){\n\t\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"submit\" value=\"&nbsp;\" class=\"dtViewInVisible\" />';\n\t\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"ide\" value=\"' . md5( 1 ) . '\" />';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"cmd\" value=\"' . md5(\"estadoinactivo\") . '\" />';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t//$cuerpo .= '\t\t<input type=\"submit\" class=\"dtViewEdit\" value=\"' . $strPrint . '\" />';\n\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"submit\" class=\"dtViewEdit\" value=\"&nbsp;\" />';\n\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"cmd\" value=\"' . md5(\"modificarfrm\") . '\" />';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"cs\" value=\"' . md5( ( $clase2 == null ? $clase : $clase2 ) ) . '\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"obj\" value=\"' . md5($strPrint) . '\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"pageid\" value=\"' . $_POST[\"pageid\"] . '\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"jsmenuid\" value=\"' . $jsmenuid . '\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '\t</form>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '\t\t\t\t</td>';\n\t\t\t\t\t\t$cuerpo .= '\t\t\t\t<td>';\n\t\t\t\t\t\t// Eliminar\n\t\t\t\t\t\t$cuerpo .= '\t<form action=\"./\" method=\"post\" id=\"dtDelView_' . $strPrint . '\" >';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"submit\" class=\"dtViewDel\" value=\"&nbsp;\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"cmd\" value=\"' . md5(\"eliminarfrm\") . '\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"cs\" value=\"' . md5( ( $clase2 == null ? $clase : $clase2 ) ) . '\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"obj\" value=\"' . md5($strPrint) . '\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"pageid\" value=\"' . $_POST[\"pageid\"] . '\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"jsmenuid\" value=\"' . $jsmenuid . '\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '\t</form>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '\t\t\t\t</td>';\n\t\t\t\t\t\t$cuerpo .= '\t\t\t</tr>';\n\t\t\t\t\t\t$cuerpo .= '\t\t</tbody>';\n\t\t\t\t\t\t$cuerpo .= '\t</table>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '</td>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*$cuerpo .= '\t<form action=\"./\" method=\"post\" id=\"dtView_' . $strPrint . '\" >';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif( isset( $vlB[ \"estado_id\" ] ) ){\n\t\t\t\t\t\t\tif( $vlB[\"estado_id\"] == \"1\"){\n\t\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"submit\" value=\"&nbsp;\" class=\"dtViewVisible\" />';\n\t\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"ide\" value=\"' . md5( 2 ) . '\" />';\n\t\t\t\t\t\t\t}else if( $vlB[\"estado_id\"] == \"2\"){\n\t\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"submit\" value=\"&nbsp;\" class=\"dtViewInVisible\" />';\n\t\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"ide\" value=\"' . md5( 1 ) . '\" />';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"cmd\" value=\"' . md5(\"estadoinactivo\") . '\" />';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t//$cuerpo .= '\t\t<input type=\"submit\" class=\"dtViewEdit\" value=\"' . $strPrint . '\" />';\n\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"submit\" class=\"dtViewEdit\" value=\"&nbsp;\" />';\n\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"cmd\" value=\"' . md5(\"modificarfrm\") . '\" />';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"cs\" value=\"' . md5( ( $clase2 == null ? $clase : $clase2 ) ) . '\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"obj\" value=\"' . md5($strPrint) . '\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"pageid\" value=\"' . $_POST[\"pageid\"] . '\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"jsmenuid\" value=\"' . $jsmenuid . '\" />';\n\n\t\t\t\t\t\t$cuerpo .= '\t</form>';\n\t\t\t\t\t\t$cuerpo .= '</td>';*/\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$cuerpo .= '<td>' . $strPrint . '</td>';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$cuerpo .= '</tr>';\n\t\t\t}\n\t\t\t$cuerpo .= '</tbody>';\n\t\t}\n\t\t$tabla .= $encabezados . $cuerpo . \"</table>\";\n\t\treturn $tabla;\n\t}", "function pizzojenhaku()\n{\n $yhteys = tietokantayhteys();\n $kysely = $yhteys->prepare(\"SELECT * FROM pizza\");\n $kysely->execute();\n \n echo \"<table border>\";\n while ($rivi = $kysely->fetch()) \n {\n echo \"<tr>\";\n echo \"<td>\" . $rivi[\"nimi\"] . \"</td>\";\n echo \"<td>\" . $rivi[\"kuvaus\"] . \"</td>\";\n\t\techo \"<td>\" . $rivi[\"hinta\"] . \"</td>\";\n echo \"</tr>\";\n }\n echo \"</table>\";\n}", "public function obtenerAlumnasController()\n\t\t{\n\t\t\t$respuesta = Datos::vistaAlumnasModel(\"alumna\");\n\n\t\t\t#El constructor foreach proporciona un modo sencillo de iterar sobre arrays. foreach funciona sólo sobre arrays y objetos, y emitirá un error al intentar usarlo con una variable de un tipo diferente de datos o una variable no inicializada.\n\n\t\t\tforeach($respuesta as $row => $item)\n\t\t\t{\n\t\t\t\techo'<option value='.$item[\"id_alumna\"].'>'.$item[\"nombre_alumna\"].'</option>';\n\t\t\t}\n\n\t\t}", "public function obtenerTabla() {\n $builder = $this->db->table($this->table);\n $data = $builder->get()->getResult();\n $tabla = '';\n foreach($data as $item):\n $accion = '<div class=\\\"custom-control custom-radio\\\">';\n $accion .= '<input type=\\\"radio\\\" id=\\\"row-'.$item->tipoTelefonoId.'\\\" name=\\\"id\\\" class=\\\"custom-control-input radio-edit\\\" value=\\\"'.$item->tipoTelefonoId.'\\\">';\n $accion .= '<label class=\\\"custom-control-label\\\" for=\\\"row-'.$item->tipoTelefonoId.'\\\"> </label> </div>';\n $tabla .= '{\n \"concepto\" : \"'.$item->tipoTelefonoTipo.'\",\n \"acciones\" : \"'.$accion.'\"\n },';\n endforeach;\n $tabla = substr($tabla, 0, strlen($tabla) - 1);\n $result = '{\"data\" : ['. $tabla .']}';\n return $this->response->setStatusCode(200)->setBody($result);\n }", "function generaTabla($idciudad, $tnegocio, $cantidad, $criterio, $pagina, $registro)\n {\n $array = tbOrganizacionData::getpaginartmp($idciudad, $tnegocio, (($pagina - 1) * $registro), $registro);\n $str = '';\n $imgs= \"\";\n $sihotel = 0;\n $i =0;\n foreach ($array as $rs) {\n $i++;\n $sihotel = 0;\n $dimgs = \"images/imgHoteles/dir\".$rs['idorg'].\"/imgHotel\";\n if (is_dir($dimgs)) {\n //Escaneamos el directorio\n $carpeta = @scandir($dimgs);\n $sihotel = count($carpeta);\n }\n $imgs = \"images/imgHoteles/\";\n $imgs .= ($sihotel > 2) ? \"dir\" . $rs['idorg'] . \"/imgHotel\" : \"imgdefault/hotel\" ;\n $str .= '\n <div class=\"row stylerow\">\n <div class=\"col-sm-3 col-md-3 col-lg-3 quitar\"> \n <img class=\"img-fluid img-thumbnail\" src=\"'.\n $imgs.'/img1.jpg\" alt=\"\" style=\"height: 100% !important;\"/>\n </div>\n <div class=\"col-sm-2 col-md-2 col-lg-2 quitar\"> \n <div class=\"dos\">\n <img class=\"img-fluid img-thumbnail\" src=\"'.$imgs . '/img2.jpg\" alt=\"\"/> \n <img class=\"img-fluid img-thumbnail\" src=\"'.$imgs . '/img3.jpg\" alt=\"\"/> \n </div>\n </div>\n <!-- <div class=\"clearfix\"></div> -->\n <div class=\"col-sm-7 col-md-7 col-lg-7 quitar\"> \n <div class=\"row\"> \n <div class=\"col-sm-12 col-md-12 col-lg-12 quitar\"> \n <a href=\"index.php?view=datosHotel.php&idh='. $rs['idorg'].'\" ><span class=\"namehotel\">'.$rs['nomborg']. '</span></a>\n </div>\n <div class=\"col-sm-12 col-md-12 col-lg-12 styledato\"> \n ' . $rs['desgeneral1'] . '<br> ' . $rs['desgeneral2']. '\n </div>\n </div> \n </div>\n </div>'; \n }\n $funcion = \"buscaRecord\";\n $str .= pagination($cantidad, $pagina, $funcion, $criterio, $registro, 6);\n // pagination($cantidad, $pagina, $funcion, $criterio, $registro, 5); \n return $str;\n }", "function viewAllTable($db, $cols = null)\n{\n try {\n $sql = \"SELECT * FROM corps\";\n $sql = $db->prepare($sql);\n $sql->execute();\n $corps = $sql->fetchAll(PDO::FETCH_ASSOC);\n if ($sql->rowCount() > 0)\n {\n $table = \"<table>\" . PHP_EOL;\n if ($cols)\n {\n $table .= \"<tr>\";\n foreach ($cols as $col)\n {\n $table .= \"<th>$col</th>\";\n }// End of Foreach\n $table .= \"</tr>\" . PHP_EOL;\n } // End of If ($col)\n foreach ($corps as $corp) {\n $table .= \"<tr><td>\" . $corp['id'] . \"</td>\";\n $table .= \"<td>\" . $corp['corp'] . \"</td>\";\n $table .= \"<td>\" . date('m/d/Y', strtotime($corp['incorp_dt'])) . \"</td>\";\n $table .= \"<td>\" . $corp['email'] . \"</td>\";\n $table .= \"<td>\" . $corp['zipcode'] . \"</td>\";\n $table .= \"<td>\" . $corp['owner'] . \"</td>\";\n $table .= \"<td>\" . $corp['phone'] . \"</td>\";\n $table .= \"</tr>\" . PHP_EOL;\n }// End of Foreach\n $table .= \"</table>\" . PHP_EOL;\n } // End of If ($sql->count)\n else\n {\n $table = \"There is no Data\" . PHP_EOL;\n }\n return $table;\n\n } // End of Try Statement\n catch (PDOException $e)\n {\n die(\"There was a problem viewing the table \");\n } // End of Catch Statement\n}", "function listExport($table, $attr)\n {\n if (in_array('categoria', $attr)) {\n $join_data = $this->f->leftJoin($table, \"categorias\", \"cod\", \"categoria\", \"titulo\");\n // Genero el atributo \"categorias.titulo\" con uan bandera de \"%\" que me servira mas abajo y lo cambio por el atrr categoria que me devolveria el cod.\n $replace = [array_search('categoria', $attr) => \"%\" . $join_data['show']];\n $attr = array_replace($attr, $replace);\n // guardo en un array el LEFT JOIN\n $join[] = $join_data['join'];\n }\n if (in_array('subcategoria', $attr)) {\n $join_data = $this->f->leftJoin($table, \"subcategorias\", \"cod\", \"subcategoria\", \"titulo\");\n $replace = [array_search('subcategoria', $attr) => \"%\" . $join_data['show']];\n $attr = array_replace($attr, $replace);\n $join[] = $join_data['join'];\n }\n\n // Genero en 1 string cada atributo que me va a traer con su respectiva tabla. Para no generar conflicto ambiguo en la base de datos\n\n $attr = implode(\" , \" . $table . \".\", $attr);\n if (!empty($join)) {\n $join = implode(\" \", $join);\n // Elimino la tabla principal con la bandera que puse antes de categoria y subcategoria, sino quedaria ej: \"productos.categorias.titulo\".\n $attr = str_replace(\"$table.%\", \"\", $attr);\n } else {\n $join = '';\n }\n\n $sql = \"SELECT $table.$attr FROM $table $join\";\n\n $var = $this->con->sqlReturn($sql);\n if ($var) {\n while ($row = mysqli_fetch_assoc($var)) {\n $array[] = [\"data\" => $row];\n }\n }\n return $array;\n }", "function ImprimeTable($idTabla, $data, $pactu = \"\", $peli = \"\",$classCSS=\"\") {\n // echo \"ImprimeTable:::::::::::::::\".count($data[\"cuerpo\"]).\" <br>\";\n\t\ttry {\n // if (count($data) > 0) {\n\t\t\t $tabla = '<table id=\"'.$idTabla.'\" class=\"' . $classCSS . '\" cellpadding=\"0\" cellspacing=\"1\" border=\"1\" align=\"center\" style=\"text-align:center\" >';\n\t\t\t if (count($data[\"columnas\"]) > 0) {\n\t\t\t\t$tabla.= '<thead>';\n $tabla .= '<tr>';\n $conta = 0;\n $conte = 0;\n\t\t\t\t\n for ($x = 0;$x < count($data[\"columnas\"]);$x++) {\n\t\t\t\t\t \n if ($pactu != \"\") {\n if ($conta == 0) {;\n\t\t\t\t\t\t $tabla.= '<th></th>';\n //$tabla.= '<td></td>';\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n $tabla.= '<th></th>';\n\t\t\t\t\t\t\t//$tabla.= '<td></td>';\n }\n }\n $conta++;\n $conte++;\n $tabla.= '<th>' . utf8_encode($data[\"columnas\"][$x]) . '</th>'; \n }\n\t\t\t\t$tabla.= \"</tr>\";\n\t\t\t\t$tabla.= '</thead>';\n\t\t\t }\n //===========CUERPO DE TABLA=================================================================================================\n $cantele = count($data[\"cuerpo\"]);\n if ($cantele > 0) {\n for ($i = 0;$i < $cantele;$i++) {\n $conta = 0;\n $conte = 0;\n $tabla.= \"<tr>\";\n for ($z = 0;$z < count($data[\"columnas\"]);$z++) {\n $columnas = $data[\"columnas\"][$z];\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n if ($pactu != \"\") {\n if ($conta == 0) {\n // $tabla.= '<td><a href=\"javascript:Modificar('. $data[\"cuerpo\"][$i][\"$columnas\"] .');\" title=\"Actualizar\" ><img title=\"Actualizar\" src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>';\n\t\t\t\t\t\t\t\t $tabla.= '<td><a href=\"#\" onClick=\"Modificar('. $data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" title=\"Actualizar\" ><img title=\"Actualizar\" src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>';\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n $tabla.= '<td><a href=\"#\" onClick=\"Eliminar('.$data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" ><img src=\"../imgcixphp/delete.gif\" width=\"16\" title=\"Eliminar\" height=\"16\"/></a></td>';\n }\n }\n }\n $conta++;\n $conte++;\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n $tabla.= '<td>' . $data[\"cuerpo\"][$i][\"$columnas\"] . ' </td>';\n }\n }\n $tabla.= \"</tr>\";\n }\n \n }else{//solo si es k no hay datos\n\t\t\t\t$mensaje= \"No se encuentran Ningun Dato Registrado\"; \n\t\t\t $tabla.='<tfoot><tr> <td >&nbsp; '.$mensaje.' </td></tr></tfoot>';\n\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t//===========FIN CUERPO DE TABLA===========================================================================================\n $tabla.= \"</table><br>\";\n\t\t\t\t//}\n }\n catch(exception $e) {\n return $e->getMessage();\n }\n return $tabla;\n }", "public function mis_objetivos_estrategicos(){\n $objetivos = $this->model_mestrategico->list_objetivos_estrategicos(); /// OBJETIVOS ESTRATEGICOS\n $tabla ='';\n $tabla .='<article class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n <div class=\"jarviswidget jarviswidget-color-darken\" >\n <header>\n <span class=\"widget-icon\"> <i class=\"fa fa-arrows-v\"></i> </span>\n <h2 class=\"font-md\"><strong>OBJETIVOS ESTRATEGICOS</strong></h2> \n </header>\n <div>\n <a role=\"menuitem\" tabindex=\"-1\" href=\"#\" data-toggle=\"modal\" data-target=\"#modal_nuevo_ff\" class=\"btn btn-success\" style=\"width:14%;\" title=\"NUEVO REGISTRO - OBJETIVO ESTRATEGICO\">NUEVO REGISTRO</a><br><br>\n <div class=\"widget-body no-padding\">\n <table id=\"dt_basic\" class=\"table table table-bordered\" width=\"100%\">\n <thead>\n <tr>\n <th style=\"width:1%;\">NRO</th>\n <th style=\"width:3%;\">ACCI&Oacute;N ESTRATEGICA</th>\n <th style=\"width:10%;\">DESCRIPCI&Oacute;N OBJETIVO ESTRATEGICO</th>\n <th style=\"width:5%;\">GESTI&Oacute;N INICIO</th>\n <th style=\"width:5%;\">GESTI&Oacute;N FIN</th>\n <th style=\"width:3%;\">NUEVOS RESULTADOS</th>\n <th style=\"width:50%;\">RESULTADOS FINALES</th>\n <th style=\"width:5%;\">MODIFICAR</th>\n <th style=\"width:5%;\">ELIMINAR</th>\n <th style=\"width:5%;\" title=\"Alineacion PEI-POA\">REPORTE</th>\n <th style=\"width:5%;\" title=\"Exportar Alineacion a formato Excel\">EXP.</th>\n <th></th>\n </tr>\n </thead>\n <tbody>';\n $nro=0;\n foreach($objetivos as $row){\n $nro++;\n $tabla .='<tr>';\n $tabla .='<td>'.$nro.'</td>';\n $tabla .='<td align=\"center\"><a href=\"'.site_url(\"\").'/me/acciones_estrategicas/'.$row['obj_id'].'\" title=\"ACCIONES ESTRATEGICAS\"><img src=\"' . base_url() . 'assets/img/folder.png\"\" WIDTH=\"35\" HEIGHT=\"35\"/></a></td>';\n $tabla .='<td>'.$row['obj_codigo'].'.- '.$row['obj_descripcion'].'</td>';\n $tabla .='<td>'.$row['obj_gestion_inicio'].'</td>';\n $tabla .='<td>'.$row['obj_gestion_fin'].'</td>';\n $tabla .='<td align=\"center\"><a href=\"#\" data-toggle=\"modal\" data-target=\"#modal_add_rf\" class=\"btn btn-xs add_rf\" title=\"AGREGAR NUEVO RESULTADO FINAL\" name=\"'.$row['obj_id'].'\"><img src=\"'.base_url().'assets/ifinal/add.jpg\" WIDTH=\"35\" HEIGHT=\"35\"/></a></td>';\n $tabla .='<td>';\n $rfinal=$this->model_mestrategico->list_resultados_final($row['obj_id']);\n if(count($rfinal)!=0){\n $tabla.='<table class=\"table table-bordered\">\n <thead>\n <tr>\n <th style=\"width:1%;\">NRO</th>\n <th style=\"width:1%;\"></th>\n <th style=\"width:2%;\">C&Oacute;DIGO</th>\n <th style=\"width:10%;\">RESULTADOS FINALES</th>\n <th style=\"width:7%;\">INDICADOR DE IMPACTO</th>\n <th style=\"width:3%;\">META</th>\n <th style=\"width:3%;\">2016</th>\n <th style=\"width:3%;\">2017</th>\n <th style=\"width:3%;\">2018</th>\n <th style=\"width:3%;\">2019</th>\n <th style=\"width:3%;\">2020</th>\n </tr>\n </thead>\n <tbody>';\n $nro_rf=0;\n foreach($rfinal as $rowr){\n $nro_rf++;\n $tabla.='<tr>';\n $tabla.='\n <td>'.$nro_rf.'</td>\n <td align=center><a href=\"#\" data-toggle=\"modal\" data-target=\"#modal_mod_rf\" class=\"btn btn-xs mod_rf\" title=\"MODIFICAR RESULTADO FINAL\" name=\"'.$row['obj_id'].'\" id=\"'.$rowr['rf_id'].'\"><img src=\"'.base_url().'assets/img/mod_icon.png\" WIDTH=\"35\" HEIGHT=\"35\"/></a></td>\n <td>'.$rowr['rf_cod'].'</td>\n <td>'.$rowr['rf_resultado'].'</td>\n <td>'.$rowr['rf_indicador'].'</td>\n <td>'.$rowr['rf_meta'].'</td>\n <td>'.$rowr['mes1'].'</td>\n <td>'.$rowr['mes2'].'</td>\n <td>'.$rowr['mes3'].'</td>\n <td>'.$rowr['mes4'].'</td>\n <td>'.$rowr['mes5'].'</td>';\n $tabla.='</tr>';\n }\n $tabla.='\n </tbody>\n </table>';\n }\n $tabla .='</td>';\n $tabla .='<td align=center><a href=\"#\" data-toggle=\"modal\" data-target=\"#modal_mod_ff\" class=\"btn btn-xs mod_ff\" title=\"MODIFICAR OBJETIVO ESTRATEGICO\" name=\"'.$row['obj_id'].'\"><img src=\"' . base_url() . 'assets/ifinal/modificar.png\" WIDTH=\"35\" HEIGHT=\"35\"/></a></td>';\n $tabla .='<td align=center><a href=\"#\" data-toggle=\"modal\" data-target=\"#modal_del_ff\" class=\"btn btn-xs del_ff\" title=\"ELIMINAR OBJETIVO ESTRATEGICO\" name=\"'.$row['obj_id'].'\"><img src=\"' . base_url() . 'assets/ifinal/eliminar.png\" WIDTH=\"35\" HEIGHT=\"35\"/></a></td>';\n $tabla .='<td align=center><a href=\"javascript:abreVentana_obj(\\''.site_url(\"\").'/me/reporte_obj/'.$row['obj_id'].'\\');\" title=\"REPORTE DE VINCULACION PEI\"><img src=\"' . base_url() . 'assets/ifinal/pdf.png\" WIDTH=\"35\" HEIGHT=\"35\"/></td>';\n $tabla .='<td align=center><a href=\"'.site_url(\"\").'/me/exportar_alineacion/'.$row['obj_id'].'\" title=\"EXPORTAR ALINEACION PEI-POA\" id=\"myBtn'.$row['obj_id'].'\"><img src=\"' . base_url() . 'assets/ifinal/excel.jpg\" WIDTH=\"40\"/></a></td>';\n $tabla .='<td align=\"center\"><img id=\"load'.$row['obj_id'].'\" style=\"display: none\" src=\"'.base_url().'/assets/img/loading.gif\" width=\"25\" height=\"25\" title=\"ESPERE UN MOMENTO, LA PAGINA SE ESTA CARGANDO..\"></td>';\n $tabla .='</tr>';\n $tabla.='<script>\n document.getElementById(\"myBtn'.$row['obj_id'].'\").addEventListener(\"click\", function(){\n document.getElementById(\"load'.$row['obj_id'].'\").style.display = \"block\";\n });\n </script>';\n }\n $tabla .='\n </tbody>\n </table>\n </div>\n </div>\n </div>\n </article>';\n\n return $tabla;\n\n }", "public function dataTable();", "public function operaciones($proy_id,$com_id){\n $proyecto = $this->model_proyecto->get_id_proyecto($proy_id); \n $fase = $this->model_faseetapa->get_id_fase($proy_id); //// recupera datos de la tabla fase activa\n $productos = $this->model_producto->lista_operaciones($com_id,$this->gestion); // Lista de productos\n $tabla ='';\n $tabla .='<thead>\n <tr class=\"modo1\">\n <th style=\"width:1%; text-align=center\"><b>COD.</b></th>\n <th style=\"width:1%; text-align=center\"><b>E/B</b></th>\n <th style=\"width:2%;\"><b>COD. OR.</b></th>\n <th style=\"width:2%;\"><b>COD. ACT.</b></th>\n <th style=\"width:15%;\"><b>ACTIVIDAD</b></th>\n <th style=\"width:15%;\"><b>RESULTADO</b></th>\n <th style=\"width:10%;\"><b>TIP. IND.</b></th>\n <th style=\"width:10%;\"><b>INDICADOR</b></th>\n <th style=\"width:1%;\"><b>LINEA BASE '.($this->gestion-1).'</b></th>\n <th style=\"width:1%;\"><b>META</b></th>\n <th style=\"width:4%;\"><b>ENE.</b></th>\n <th style=\"width:4%;\"><b>FEB.</b></th>\n <th style=\"width:4%;\"><b>MAR.</b></th>\n <th style=\"width:4%;\"><b>ABR.</b></th>\n <th style=\"width:4%;\"><b>MAY.</b></th>\n <th style=\"width:4%;\"><b>JUN.</b></th>\n <th style=\"width:4%;\"><b>JUL.</b></th>\n <th style=\"width:4%;\"><b>AGO.</b></th>\n <th style=\"width:4%;\"><b>SEP.</b></th>\n <th style=\"width:4%;\"><b>OCT.</b></th>\n <th style=\"width:4%;\"><b>NOV.</b></th>\n <th style=\"width:4%;\"><b>DIC.</b></th>\n <th style=\"width:10%;\"><b>MEDIO DE VERIFICACI&Oacute;N</b></th>\n <th style=\"width:7%;\"><b>DELETE</b></th>\n <th style=\"width:7%;\"><b>PTTO..</b></th>\n <th style=\"width:7%;\"><b>NRO. REQ.</b></th>\n </tr>\n </thead>\n <tbody>';\n $cont = 0;\n foreach($productos as $rowp){\n $cont++;\n $sum=$this->model_producto->meta_prod_gest($rowp['prod_id']);\n $monto=$this->model_producto->monto_insumoproducto($rowp['prod_id']);\n $programado=$this->model_producto->producto_programado($rowp['prod_id'],$this->gestion);\n $ptto=0;\n if(count($monto)!=0){\n $ptto=$monto[0]['total'];\n }\n\n $color=''; $titulo=''; $por='';\n if($rowp['indi_id']==2){ // Relativo\n $por='%';\n if($rowp['mt_id']==3){\n if($sum[0]['meta_gest']!=$rowp['prod_meta'] || $rowp['or_id']==0){\n $color='#fbd5d5';\n $titulo='ERROR EN LA DISTRIBUCION O FALTA DE ALINEACION';\n }\n }\n }\n else{ // Absoluto\n if($sum[0]['meta_gest']!=$rowp['prod_meta'] || $rowp['or_id']==0){\n $color='#fbd5d5';\n $titulo='ERROR EN LA DISTRIBUCION O FALTA DE ALINEACION';\n }\n }\n \n $tabla .='<tr bgcolor=\"'.$color.'\" class=\"modo1\" title='.$titulo.'>';\n $tabla.='<td align=\"center\"><font color=\"blue\" size=\"2\"><b>'.$rowp['prod_cod'].'</b></font></td>';\n $tabla.='<td align=\"center\">';\n $tabla.='<a href=\"'.site_url(\"admin\").'/prog/mod_prod/'.$rowp['prod_id'].'\" title=\"MODIFICAR OPERACI&Oacute;N\" class=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/modificar.png\" WIDTH=\"33\" HEIGHT=\"34\"/></a>';\n /*if($this->tp_adm==1){\n $tabla.='<a href=\"'.site_url(\"admin\").'/prog/mod_prod/'.$rowp['prod_id'].'\" title=\"MODIFICAR OPERACI&Oacute;N\" class=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/modificar.png\" WIDTH=\"33\" HEIGHT=\"34\"/></a>';\n }*/\n if($rowp['prod_ppto']==1){\n $tabla.='<a href=\"'.site_url(\"\").'/prog/requerimiento/'.$proy_id.'/'.$rowp['prod_id'].'\" target=\"_blank\" title=\"REQUERIMIENTOS DE LA OPERACI&Oacute;N\" class=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/insumo.png\" WIDTH=\"33\" HEIGHT=\"33\"/></a>';\n }\n $tabla.='</td>';\n $tabla.='<td style=\"width:2%;text-align=center\"><b><font size=5 color=blue>'.$rowp['or_codigo'].'</font></b></td>';\n $tabla.='<td style=\"width:2%;text-align=center\"><b><font size=5>'.$rowp['prod_cod'].'</font></b></td>';\n $tabla.='<td style=\"width:15%;\">'.$rowp['prod_producto'].'</td>';\n $tabla.='<td style=\"width:15%;\">'.$rowp['prod_resultado'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['indi_abreviacion'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['prod_indicador'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.round($rowp['prod_linea_base'],2).'</td>';\n $tabla.='<td style=\"width:10%;\">'.round($rowp['prod_meta'],2).'</td>';\n if(count($programado)!=0){\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['enero'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['febrero'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['marzo'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['abril'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['mayo'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['junio'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['julio'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['agosto'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['septiembre'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['octubre'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['noviembre'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['diciembre'],2).' '.$por.'</td>';\n }\n else{\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>';\n }\n $tabla.='<td style=\"width:10%;\" bgcolor=\"#e5fde5\">'.$rowp['prod_fuente_verificacion'].'</td>';\n $tabla.='<td style=\"width:7%;\">';\n if($this->tp_adm==1 || $this->fun_id==715 || $this->fun_id==690){\n $tabla.='<a href=\"#\" data-toggle=\"modal\" data-target=\"#modal_del_ff\" class=\"btn btn-default del_ff\" title=\"ELIMINAR OPERACI&Oacute;N\" name=\"'.$rowp['prod_id'].'\" id=\"'.$proy_id.'\"><img src=\"' . base_url() . 'assets/ifinal/eliminar.png\" WIDTH=\"35\" HEIGHT=\"35\"/></a><br><br>';\n $tabla.=' <center>\n <input type=\"checkbox\" name=\"req[]\" value=\"'.$rowp['prod_id'].'\" onclick=\"scheck'.$cont.'(this.checked);\"/>\n </center>';\n }\n $tabla.='</td>';\n $tabla.='<td>'.number_format($ptto, 2, ',', '.').'</td>';\n $tabla.='<td style=\"width:7%;\" align=\"center\"><font color=\"blue\" size=\"2\"><b>'.count($this->model_producto->insumo_producto($rowp['prod_id'])).'</b></font></td>';\n $tabla .='</tr>';\n ?>\n <script>\n function scheck<?php echo $cont;?>(estaChequeado) {\n val = parseInt($('[name=\"tot\"]').val());\n if (estaChequeado == true) {\n val = val + 1;\n } else {\n val = val - 1;\n }\n $('[name=\"tot\"]').val((val).toFixed(0));\n }\n </script>\n <?php\n }\n $tabla.='</tbody>';\n\n return $tabla;\n }", "function dibujar_filas($lista)\n{\n $cadena = '';\n for($i = 0; $i < count($lista); $i++){\n $objeto = $lista[$i];\n $cadena = $cadena.'<tr>';\n foreach($objeto as $nombre => $valor){\n if(strcmp($nombre, 'created_at') != 0 && strcmp($nombre, 'updated_at') != 0){\n $cadena = $cadena.'<td>'.$valor.'</td>';\n }\n }\n $cadena = $cadena.'</tr>';\n }\n\n echo $cadena;\n}", "public function vistaAlumnoModel($tabla){\r\n\r\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT id, matricula, nombre, apellido, email, id_carrera, id_grupo FROM $tabla\");\t\r\n\t\t$stmt->execute();\r\n\r\n\t\t#fetchAll(): Obtiene todas las filas de un conjunto de resultados asociado al objeto PDOStatement. \r\n\t\treturn $stmt->fetchAll();\r\n\r\n\t\t$stmt->close();\r\n\r\n\t}", "public function fullDataBase()\n {\n print \"<table cellpadding='10' border=solid bordercolor=black>\";\n print\"<tr>\n <td>ROW</td> <td>EXCHANGE</td>\n <td>NAME</td> <td>IPO</td>\n <td>SYMBOL</td> <td>PRICE</td>\n <td>CAP</td> <td>UPDATED</td>\n <td>SECTOR</td> <td>INDUSTRY</td>\n </tr>\";\n $sql = \"SELECT * FROM companies ORDER BY ipodate DESC, cap DESC\";\n\n foreach ($this->conn->query($sql) as $row) {\n print \"<tr> <td nowrap>\";\n print $row['id'] . \"</td><td nowrap>\";\n print $row['stockexchange'] . \"</td><td nowrap>\";\n print $row['name'] . \"</td><td nowrap>\";\n print $row['ipodate'] . \"</td><td nowrap>\";\n print $row['symbol'] . \"</td><td nowrap>\";\n print $row['price'] . \"</td><td nowrap>\";\n print $row['cap'] . \"</td><td nowrap>\";\n print $row['created_at'] . \"</td><td nowrap>\";\n print $row['sector'] . \"</td><td nowrap>\";\n print $row['industry'] . \"</td></tr>\";\n }\n print \"</table>\";\n }", "public function mostrarTablaNegocios(){\n\n\t\t$item = null;\n \t$valor = null;\n\n \t\t$negocios = ControladorNegocios::ctrMostrarNegocios($item, $valor);\t\n\n \t\tif(count($negocios) == 0){\n\n \t\t\techo '{\"data\": []}';\n\n\t\t \treturn;\n \t\t}\n\t\t\n \t\t$datosJson = '{\n\t\t \"data\": [';\n\n\t\t for($i = 0; $i < count($negocios); $i++){\n\n\t\t \t/*=============================================\n \t \t\tTRAEMOS LA IMAGEN\n \t\t\t=============================================*/ \n\n\t\t \t$imagen = \"<img src='\".$negocios[$i][\"imagen\"].\"' width='40px'>\";\n\n\t\t \t/*=============================================\n \t \t\tTRAEMOS LOS USUARIOS\n \t\t\t=============================================*/ \n\n\t\t \t$item = \"id\";\n\t\t \t$valor = $negocios[$i][\"id_usuarios\"];\n\n\t\t \t$usuarios = ControladorUsuarios::ctrMostrarUsuarios($item, $valor);\n\n\t\t \t/*=============================================\n \t \t\tTRAEMOS LAS ACCIONES\n\t\t\t =============================================*/ \n\t\t\t \n\t\t\t$botones = \"<div class='btn-group'><button class='btn btn-warning btnEditarNegocio btn-link' idNegocio='\".$negocios[$i][\"id\"].\"' data-toggle='modal' data-target='#modalEditarNegocio'><i class='fa fa-edit'></i></button><button class='btn btn-danger btn-link btnEliminarNegocio' idNegocio='\".$negocios[$i][\"id\"].\"' codigo='\".$negocios[$i][\"codigo\"].\"' imagen='\".$negocios[$i][\"imagen\"].\"'><i class='fa fa-times'></i></button></div>\"; \n\t\t \n\t\t \t$datosJson .='[\n\t\t\t \"'.($i+1).'\",\n\t\t\t \"'.$imagen.'\",\n\t\t\t \"'.$negocios[$i][\"nombre\"].'\",\n\t\t\t \"'.$negocios[$i][\"nit\"].'\",\n\t\t\t \"'.$negocios[\"dueño\"].'\",\n\t\t\t \"'.$negocios[\"direccion\"].'\",\n\t\t\t \"'.$negocios[\"telefono\"].'\",\n\t\t\t\t \"'.$negocios[\"ciudad\"].'\",\n\t\t\t \"'.$botones.'\"\n\t\t\t ],';\n\n\t\t }\n\n\t\t $datosJson = substr($datosJson, 0, -1);\n\n\t\t $datosJson .= '] \n\n\t\t }';\n\t\t\n\t\techo $datosJson;\n\n\n\t}", "public function list_unidades_es($estado_ppto){\n $unidades=$this->model_proyecto->list_gasto_corriente();\n $tabla='';\n \n $color=''; \n if($estado_ppto==1){\n $color='#e2f4f9';\n }\n\n $tabla.='\n <table id=\"dt_basic3\" class=\"table1 table-bordered\" style=\"width:100%;\">\n <thead>\n <tr style=\"height:50px;\">\n <th style=\"width:1%;\" bgcolor=\"#474544\" title=\"\">#</th>\n <th style=\"width:5%;\" bgcolor=\"#474544\" title=\"\"></th>\n <th style=\"width:5%;\" bgcolor=\"#474544\" title=\"VER PPTO\">VER PARTIDAS</th>\n <th style=\"width:10%;\" bgcolor=\"#474544\" title=\"APERTURA PROGRAM&Aacute;TICA\">CATEGORIA PROGRAM&Aacute;TICA '.$this->gestion.'</th>\n <th style=\"width:25%;\" bgcolor=\"#474544\" title=\"DESCRIPCI&Oacute;N\">DESCRIPCI&Oacute;N</th>\n <th style=\"width:10%;\" bgcolor=\"#474544\" title=\"NIVEL\">NIVEL</th>\n <th style=\"width:15%;\" bgcolor=\"#474544\" title=\"TIPO DE ADMINISTRACIÓN\">TIPO DE ADMINISTRACI&Oacute;N</th>\n <th style=\"width:10%;\" bgcolor=\"#474544\" title=\"UNIDAD ADMINISTRATIVA\">UNIDAD ADMINISTRATIVA</th>\n <th style=\"width:10%;\" bgcolor=\"#474544\" title=\"UNIDAD EJECUTORA\">UNIDAD EJECUTORA</th>\n </tr>\n </thead>\n <tbody>';\n $nro=0;\n foreach($unidades as $row){\n $aper=$this->model_ptto_sigep->partidas_proyecto($row['aper_id']);\n $nro++;\n $tabla.='<tr bgcolor='.$color.'>';\n $tabla.='<td style=\"height:30px;\" align=center>'.$nro.'</td>';\n $tabla.='<td>';\n if($estado_ppto==0){\n if(count($aper)!=0){\n $tabla .='\n <center><a data-toggle=\"modal\" data-target=\"#'.$row['aper_id'].'\" title=\"PARTIDAS ASIGNADAS\" ><img src=\"'.base_url().'assets/img/select.png\" WIDTH=\"35\" HEIGHT=\"35\"/></a></center>\n <div class=\"modal fade bs-example-modal-lg\" tabindex=\"-1\" id=\"'.$row['aper_id'].'\" role=\"dialog\" aria-labelledby=\"myLargeModalLabel\">\n <div class=\"modal-dialog modal-lg\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close text-danger\" data-dismiss=\"modal\" aria-hidden=\"true\">\n &times;\n </button>\n <h4 class=\"modal-title\">';\n if($this->gestion>2019){\n $tabla.=$row['tipo'].' '.$row['act_descripcion'].' '.$row['abrev'];\n }\n else{\n $tabla.=$row['proy_nombre'];\n }\n $tabla.='\n </h4>\n </div>\n <div class=\"modal-body no-padding\">\n <div class=\"well\">\n '.$this->partidas($row['aper_id'],1).' \n </div>\n </div>\n <div class=\"modal-footer\">\n <a href=\"javascript:abreVentana(\\''.site_url(\"\").'/mnt/rep_partidas/'.$row['aper_id'].'\\');\" class=\"btn btn-primary\" title=\"IMPRIMIR PARTIDAS\">IMPRIMIR PARTIDAS</a>\n </div>\n </div>\n </div>\n </div>';\n }\n }\n $tabla.='</td>';\n $tabla.='<td>';\n if($this->tp_adm==1){\n if($estado_ppto==0){\n if(count($aper)!=0){\n $tabla .='<center><a href=\"'.site_url(\"\").'/mnt/edit_ptto_asig/'.$row['proy_id'].'\" title=\"MODIFICAR PRESUPUESTO ASIGNADO\" class=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/faseetapa.png\" WIDTH=\"34\" HEIGHT=\"34\"/></a></center>';\n }\n }\n else{\n $tabla.='<center><a href=\"'.site_url(\"\").'/mnt/ver_ptto_asig_final/'.$row['proy_id'].'\" id=\"myBtnn'.$row['proy_id'].'\" title=\"VER PRESUPUESTO ASIGNADO INICIAL - PROGRAMADO - APROBADO\" iclass=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/faseetapa.png\" WIDTH=\"34\" HEIGHT=\"34\"/></a></center>';\n }\n }\n $tabla.='</td>';\n $tabla.='<td><center>'.$row['aper_programa'].''.$row['aper_proyecto'].''.$row['aper_actividad'].'</center></td>';\n if($this->gestion>2019){\n $tabla.='<td style=\"font-size: 8pt;\"><b>'.$row['tipo'].' '.$row['act_descripcion'].' '.$row['abrev'].'</b></td>';\n }\n else{\n $tabla.='<td style=\"font-size: 8pt;\"><b>'.$row['proy_nombre'].'</b></td>';\n }\n $tabla.='<td>'.$row['nivel'].'</td>';\n $tabla.='<td>'.$row['tipo_adm'].'</td>';\n $tabla.='<td>'.strtoupper($row['dep_departamento']).'</td>';\n $tabla.='<td>'.strtoupper($row['dist_distrital']).'</td>';\n $tabla.='</tr>';\n }\n $tabla.='\n </tbody>\n </table>';\n\n return $tabla;\n }", "function ImprimeTablePOB($idTabla, $data, $pactu, $peli, $crxpag, $paginap = 1, $cantlink = 5,$orderby = -1,$buscar=\"\",$classCSS=\"\",$link_td=\"\") {\n\t\t $tabla=\"\";\n\t\t//$tabla.= Buscar($buscar);// formulario buscar si llamo a esta funcion solo serviria para el boton buscar no eventos teclado\n //$tabla.= '<table id=\"' . $idTabla . '\" class=\"'.$classCSS.'\" cellpadding=\"0\" cellspacing=\"1\" border=\"1\" align=\"center\" style=\"text-align:center\" ><tr>';\n\t\t $tabla.= '<table id=\"' . $idTabla . '\" class=\"'.$classCSS.'\" cellpadding=\"0\" cellspacing=\"1\" >';\n try {\n // if (count($data) > 0) {\n\t\t\t if (count($data[\"columnas\"]) > 0) {\n\t\t\t\t$tabla.= '<thead>';\n $tabla .= '<tr>';\n $conta = 0;\n $conte = 0;\n for ($x = 0;$x < count($data[\"columnas\"]);$x++) {\n if ($pactu != \"\") {\n if ($conta == 0) {;\n $tabla.= '<td></td>';\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n $tabla.= '<td></td>';\n }\n }\n $conta++;\n $conte++;\n //Nombres de las columnas\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t$ordenar = $x + 1;\t\t\t\t\t\n\t\t\t\t\t//$tabla.= '<th><a href=\"?pagina=' . $paginap . '&orden=' . $ordenar . '\" >' . utf8_encode($data[\"columnas\"][$x]) . '</a></th>';\n\t\t\t\t\t$tabla.= '<th><a href=\"#\" onClick=\"Paginar(\\'pagina=' . $paginap . '&orden=' .$ordenar .'&busca=' .$buscar .'\\'); return false\" >' . utf8_encode($data[\"columnas\"][$x]) . '</a></th>'.\"\\n\";\n\t\t\t\t \n }\n $tabla.= \"</tr>\";\n\t\t\t\t$tabla.= '</thead>';\n\t\t\t }\n //===========CUERPO DE TABLA=================================================================================================\n $cantele = count($data[\"cuerpo\"]);\n if ($cantele > 0) {\n $fin = $paginap * $crxpag;\n $ini = $fin - $crxpag;\n for ($i = $ini;$i < $fin;$i++) {\n $conta = 0;\n $conte = 0;\n $tabla.= '<tr>';\n for ($z = 0;$z < count($data[\"columnas\"]);$z++) {\n $columnas = $data[\"columnas\"][$z];\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n if ($pactu != \"\") {\n if ($conta == 0) {\n // $tabla.= '<td><a href=\"' . $pactu . 'id=' . $data[\"cuerpo\"][$i][\"$columnas\"] . '&accion=Mactualizar\"><img src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>'.\"\\n\";\n\t\t\t\t\t\t\t\t $tabla.= '<td><a href=\"#\" onClick=\"'.$pactu.'('. $data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" title=\"Actualizar\" ><img title=\"Actualizar\" src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>'.\"\\n\";\n\t\t\t\t\t\t\t\t \n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n // $tabla.= '<td><a href=\"' . $peli . 'id=' . $data[\"cuerpo\"][$i][\"$columnas\"] . '&accion=Eliminar\"><img src=\"../imgcixphp/ico_eliminar.gif\" width=\"16\" title=\"Eliminar\" height=\"16\"/></a></td>'.\"\\n\";\n\t\t\t\t\t\t\t\t $tabla.= '<td><a href=\"#\" onClick=\"'.$peli.'('.$data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" ><img src=\"../imgcixphp/delete.gif\" width=\"16\" title=\"Eliminar\" height=\"16\"/></a></td>'.\"\\n\";\n }\n }\n }\n $conta++;\n $conte++;\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n\t\t\t\t\t\t\tif($link_td!=\"\"){\t$ID= $data[\"cuerpo\"][$i][0] ; // ID\n\t\t\t\t\t\t\t\t$url =$link_td.\"?id=\".$ID;// Url mas id como dato mediante el metodo get \t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t $tabla.= '<td onclick=\"document.location=\\''.$url.'\\' \" >' . $data[\"cuerpo\"][$i][\"$columnas\"] . '</td>' . \"\\n\";\n\t\t\t\t\t\t\t }else{ \n\t\t\t\t\t\t\t\t$tabla.= '<td>' . $data[\"cuerpo\"][$i][\"$columnas\"] . '</td> '.\"\\n\";\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t// $tabla.= '<td>&nbsp;&nbsp;' . $data[\"cuerpo\"][$i][\"$columnas\"] . '&nbsp;&nbsp; </td> '.\"\\n\";\n \n }\n }\n $tabla.= '</tr>'.\"\\n\";\t\t\t\t\n\t\t\t\t\t\n } \n\t\t\t\t//===========FIN CUERPO DE TABLA==============================================================================\n\t\t\t\t\t $tabla.= '</table><p style=\"clear:both;height:5px;\"></p>'; \n //===========PAGINADO======================================================================================================================\n $paginado = Paginar($cantele, $crxpag, $paginap, $cantlink,$orderby,$buscar);\n $tabla.= $paginado;\n //===========FIN PAGINADO ==================================================================================================================\n }else{//solo si es k no hay datos\n\t\t\t\t$mensaje= \"No se encuentran Datos Registrados\"; \n\t\t\t \t $tabla.='<tfoot><tr> <td >&nbsp; '.$mensaje.' </td></tr></tfoot></table><br>';\n\t\t\t\t}\n\t\t\t\n } catch(exception $e) {\n return $e->getMessage();\n }\n return $tabla;\n }", "public function getAll(){\n try{\n $sql = \"SELECT * FROM {$this->tabela}\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute();\n $dados = $stm->fetchAll(PDO::FETCH_OBJ);\n return $dados;\n }catch(PDOException $erro){\n echo \"<script>alert('Erro na linha: {$erro->getLine()}')</script>\";\n }\n }", "public function table()\n\t{\n\t\t$sql = '\n\t\t\tselect \n\t\t\t\tid, \n\t\t\t\tname, \n\t\t\t\tenable \n\t\t\tfrom \n\t\t\t\tfile \n\t\t\twhere \n\t\t\t\tuser = ?';\n\n\t\t$results = DB::select($sql, [Auth::id()]);\n\n\t\treturn Datatable::collection(new Collection($results))\n\t\t\t->showColumns('name')\n\t\t\t->addColumn('enable', function($model) \n\t\t\t{\n\t\t\t\treturn '<a href=\"'.url(\"/file/edit&ID=\".$model->id.\"&EN=\".$model->enable).'\">'.$model->enable.'</a>';\n\t\t\t})\n\t\t\t->addColumn('remove', function($model) \n\t\t\t{\n\t\t\t\treturn '<a href=\"'.url(\"/file/delete&ID=\".$model->id).'\"><i class=\"fa fa-times\"></i></a>';\n\t\t\t})\n ->searchColumns('name')\n ->orderColumns('enable', 'name')\n ->make();\n\t}", "public function display_gall_for_admin(){\n\n $sql = \"SELECT id,name FROM photos WHERE img_navigacija_id=2 LIMIT 9\";\n\n echo \"<table><tr>\";\n $i=0;\n $rows=array();\n foreach(self::$connect->query($sql) as $row){\n\n $rows[]=$row;\n }\n\n foreach($rows as $row){\n $i++;\n if($i % 3==1){\n echo \"</tr><tr>\";\n }\n $this->id=$row['id'];\n $this->name=$row['name'];\n echo \"<td id=\\\"fade\\\"><img src=\\\"../uploaded_images/\".$this->name.\"\\\"/></td>\";\n echo \"<td style>\".$row['name'].\"<br/>\";\n echo \"<a id=\\\"test\\\" href=\\\"delete_photo.php?id=\".$this->id.\"&name=\".$this->name.\"\\\"><i class=\\\"fa fa-trash-o\\\"> Delete</i></a></td>\";\n }\n echo \"</table>\";\n\n }", "function LUPE_criar_tabela_tab($prefixo, $rs, $vetCampo, $vetHidTab, $exc_tabela = '', $exc_campo = '') {\r\n\r\n echo \"<table id='tab{$prefixo}_Tabela' width='100%' border='1' cellspacing='0' cellpadding='0' vspace='0' hspace='0' class='Generica'>\\n\";\r\n echo \"<tr class='Generica'>\\n\";\r\n\r\n if (Ativo()) {\r\n echo \"<td class='Acao' width='1%' nowrap>\";\r\n echo '<a href=\"\" onclick=\"return tab'.$prefixo.'_Incluir();\" class=\"Titulo\"><img src=\"imagens/Incluir.gif\" border=\"0\" alt=\"Incluir\"></a>';\r\n echo \"</td>\\n\";\r\n }\r\n\r\n ForEach($vetCampo as $Campo => $Valor ) {\r\n echo \"<td class='Titulo'><b>\\n\";\r\n echo $Valor['nome'];\r\n echo \"</b></td>\\n\";\r\n }\r\n\r\n echo \"</tr>\\n\";\r\n\r\n if (mssql_num_rows($rs) != 0) {\r\n for ($i = 0; $i < mssql_num_rows($rs); $i++) {\r\n $row = mssql_fetch_array($rs);\r\n\r\n echo \"<tr id='tab{$prefixo}_linha{$i}' align=left>\\n\";\r\n\r\n if (Ativo()) {\r\n echo \"<td class='Acao' nowrap>\";\r\n\r\n echo '<a class=\"Registro\" href=\"\" onclick=\"return tab'.$prefixo.'_Alterar('.$i.');\"><img src=\"imagens/Alterar.gif\" border=\"0\" alt=\"Alterar\"></a>';\r\n\r\n echo '&nbsp;';\r\n\r\n echo '<a class=\"Registro\" href=\"\" onclick=\"return tab'.$prefixo.'_Excluir('.$i.');\"><img src=\"imagens/Excluir.gif\" border=\"0\" alt=\"Excluir\"></a>';\r\n\r\n if ($exc_campo == '' || $exc_tabela == '') {\r\n $exclui = 'N';\r\n } else {\r\n $sql = \"select $exc_campo from $exc_tabela where $exc_campo = \".$row[$exc_campo];\r\n if (mssql_num_rows(execsql($sql)) == 0)\r\n $exclui = 'N';\r\n else\r\n $exclui = 'E';\r\n }\r\n\r\n echo \"<input id='{$prefixo}_excluir$i' type='hidden' name='{$prefixo}_excluir[]' value='$exclui'>\\n\";\r\n\r\n ForEach($vetHidTab as $Valor)\r\n \t echo \"<input id='{$prefixo}_$Valor$i' type='hidden' name='{$prefixo}_{$Valor}[]' value='\".$row[$Valor].\"'>\\n\";\r\n\r\n echo \"</td>\\n\";\r\n }\r\n\r\n ForEach($vetCampo as $Campo => $Valor ) {\r\n echo \"<td id='{$prefixo}_cel_{$Campo}_{$i}' class='Registro'>\\n\";\r\n\r\n switch ($Valor['tipo']) {\r\n \tcase 'descDominio':\r\n if ($Valor['vetDominio'][$row[$Campo]] == '')\r\n echo $row[$Campo];\r\n else\r\n echo $Valor['vetDominio'][$row[$Campo]];\r\n \t\tbreak;\r\n\r\n default:\r\n echo $row[$Campo];\r\n \t\tbreak;\r\n }\r\n\r\n echo \"</td>\\n\";\r\n }\r\n\r\n echo\"</tr>\\n\";\r\n }\r\n }\r\n\r\n echo \"</table>\\n\";\r\n echo \"<script type='text/javascript'>\r\n tab{$prefixo}_TotLin = \".mssql_num_rows($rs).\";\r\n tab{$prefixo}_AtuLin = -1;\r\n </script>\";\r\n\r\n return 0;\r\n}", "public function getTableData()\n\t{\n\t}", "public function show_column_photos(){\n $sql=\"SELECT * FROM photos WHERE img_navigacija_id=3\";\n $result=self::$connect->query($sql);\n $rows=array();\n while($row=$result->fetch(PDO::FETCH_ASSOC)){\n $rows[]=$row;\n $this->name=array_column($rows, 'name');\n $this->id=array_column($rows, 'id');\n }\n\n }", "function titulopersonal(){\n print (\"\\n<tr>\");\n if($this->titulo !=\"\")\n foreach ($this->titulo as $titulo){\n print (\"\\n<th>$titulo</th>\");\n }\n print (\"\\n<tr>\"); \n }", "public function table($mensaje = NULL)\n\t{\n\t\tif($this->_session_data['id_perfil'] == 2){\n\t\t\t$db['registros'] = $this->m_entes->getEntes($this->_session_data['id_usuario']);\n\t\t}else{\n\t\t if($this->_config['entes_delete'] == 1){\n $db['registros'] = $this->m_entes->getRegistros('all'); \n }else{\n $db['registros'] = $this->m_entes->getRegistros(); \n }\n\t\t}\n\t\t\t\n\t\tif($mensaje != NULL) {\n\t\t\t$db['mensaje'] = $mensaje;\n\t\t}\n\t\t\t\n\t\t$this->armar_vista('table', $db);\n\t}", "function tampil_data($tabel)\n {\n $row = $this->db->prepare(\"SELECT * FROM sms\");\n $row->execute();\n return $hasil = $row->fetchAll();\n }", "abstract public function getTables();", "public static function mostrarImagenVistaModel($tabla){\r\n\r\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT id, ruta, titulo, descripcion FROM $tabla ORDER BY orden ASC\");\r\n\r\n\t\t$stmt -> execute();\r\n\r\n\t\treturn $stmt -> fetchAll();\r\n\r\n\t\t$stmt -> close();\r\n\r\n\t}", "public function mostrarPeliculas()\n {\n $conexion = database::conexion();\n $consulta = 'SELECT * FROM peliculas';\n $consultaPreparada = $conexion->prepare($consulta);\n $consultaPreparada->execute();\n foreach ($resutado = $consultaPreparada->fetchAll(PDO::FETCH_ASSOC) as $fila) {\n echo '<div >';\n echo '<a href=\"peliculas_ficha.php?id=' . $fila['id'] . '\">';\n echo '<img class=\"ficha\" src=\"./imgs/peliculas/' . $fila['id'] . '.jpg\"/></a>';\n echo '<p >' . $fila['titulo'] . '</p>';\n echo '<a class=\"editar\" href=\"peliculas_form.php?id=' . $fila['id'] . '\">editar</a>';\n echo '<a class=\"borrado\" href=\"peliculas.php?idBorrar=' . $fila['id'] . '\">borrar</a>';\n echo '</div>';\n }\n }", "public function getAllDataByNameTable($nameTable = 'admin')\n\t{\n\t\t// viet theo cach truy van csdl theo thu vien pdo\n\t\t$data = []; // mot mang du lieu rong doi cho de lay du lieu tu db ve\n\t\t// 1 : khai bao cau lenh sql\n\t\t$sql = \"SELECT * FROM {$nameTable}\";\n\t\t// 2: su dung ham prepare de thuc thi - kiem tra cau lenh sql\n\t\t$stmt = $this->db->prepare($sql);\n\t\tif($stmt){\n\t\t\t// cau lenh sql ko co loi\n\t\t\t// thuc thi cau lenh\n\t\t\tif($stmt->execute()){\n\t\t\t\t// thuc thi thanh cong\n\t\t\t\t// kiem tra xem bang du lieu co dong du lieu nao ko? neu co thi moi lay ve\n\t\t\t\tif($stmt->rowCount() > 0){\n\t\t\t\t\t// lay du lieu ra\n\t\t\t\t\t$data = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\t\t// PDO::FETCH_ASSOC: tra ve mot mang khong tuan tu voi key cua mang la cac truong nam trong bang du lieu\n\t\t\t\t}\n\t\t\t}\n\t\t\t// ngat ket noi execute $stmt de co the execute cac stmt moi\n\t\t\t$stmt->closeCursor();\n\t\t\t// vi khong con thuc thi cau lenh nao nua nen thoi\n\t\t}\n\t\treturn $data;\n\t}", "function listado() {\r\n return self::consulta('SELECT * FROM \".self::$nTabla.\"');\r\n }", "function tabla($result) {\n $tabla = \"\";\n while ($registro = mysqli_fetch_assoc($result)) {\n $tabla = $tabla .\n \"<div class='panel panel-default'>\n <div class='panel-heading'>\n <h4 class='panel-title'><a href='#'>\" . $registro[\"CurNom\"] . \"</a></h4>\n </div>\n <DIV class='panel-body' hidden>\n <div class='table-responsive'>\n <table class='table table-hover'>\n <tr> \n <Th>Criterio</Th>\n <Th>Nota</Th> \n </tr>\n <tr>\n <td>Evaluación Continua</td>\n <td>\" . $registro['NotaFinal1'] . \"</td>\n </tr>\n <tr>\n <td>Tareas y Practicas</td> \n <td>\" . $registro['NotaFinal2'] . \"</td> \n </tr>\n <tr>\n <td>Examen</td> \n <td>\" . $registro['NotaFinal3'] . \"</td> \n </tr> \n <tr>\n <th>Nota FINAL</th> \n <th>15</th> \n </tr>\n </table>\n </div>\n </DIV>\n </div>\\n\";\n }\n return $tabla;\n }", "function getAllTablesBar(){\n\n return $this->db->table('mesas')\n ->select('numero_Mesa, forma, personas, alto, ancho')\n ->where('id_puntos = 1')\n ->get()\n ->getResult();\n }", "function visualizar(){\n\t\t$consulta=$this->sql;\n\t\t$result=mysql_query($consulta);\n\t\t\n\t\techo \"<center><table class='enhancedtablerowhover'>\n\t\t\t<caption>\".$this->comentarioTabla($this->nombreTabla($result,0)).\"</caption>\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t<td scope='col' colspan=2></td>\n\t\t\t\";\n\t\tfor($i=0;$i<mysql_num_fields($result);$i++)\n\t\t{\t\n\t\t \tif(!$this->mostrarCampo($this->nombreCampo($result,$i)) or stripos($this->nombreCampo($result,$i),\"imagen\"))continue;\n\t\t \t$des = str_replace(\"/*\",\"\",$this->comentario($this->nombreCampo($result, $i), $this->nombreTabla($result, $i)));\n\t\t\techo \"<th scope='col' ><a href='?order='>$des</a></th>\";\n\t\t}\n\t\techo\"\t\n\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\";\n\t\twhile ($row = mysql_fetch_array($result)) {\n\t\t$filtro=$this->cifrar($row,$result);\n\t\techo \"<tr>\";\n\t\techo \"<td class='CrearReporte'>\n\t\t\t\t<a href='$_SERVER[PHP_SELF]?operacion=m&$filtro'>\n\t\t\t\t<img src='\".$this->PathImages.\"editar.png'>\n\t\t\t</a>\n\t\t </td>\";\n\t\techo \"<td class='CrearReporte' >\n\t <a href='$_SERVER[PHP_SELF]?operacion=b&$filtro'>\n\t\t\t\t<img src='\".$this->PathImages.\"eliminar.png'>\n\t\t\t\t</a>\n\t\t\t </td>\n\t\t\t \";\n\t\t //?columna=$row[0]&operacion=q \n\t\tfor ($i = 0; $i < mysql_num_fields($result); $i++){\n\t\t \tif(!$this->mostrarCampo($this->nombreCampo($result,$i)) or stripos($this->nombreCampo($result,$i),\"imagen\"))continue;\n\t\t\techo \"<td>\".$row[$i].\"</td>\";\n\t\t}\n\t\techo \"</tr>\";\n\t}\n\techo \"</tr></tbody></table></center>\";\n\t}", "public function rep_list_operaciones($com_id,$tp){\n $obj_est=$this->model_producto->list_oestrategico($com_id); /// Objetivos Estrategicos\n $componente=$this->model_componente->get_componente_pi($com_id);\n $fase=$this->model_faseetapa->get_fase($componente[0]['pfec_id']);\n $proyecto = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']); //// DATOS PROYECTO\n $tabla='';\n\n if($tp==1){\n $tab='table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\" width:100%;';\n }\n elseif($tp==2){\n $tabla .='<style>\n table{font-size: 9px;\n width: 100%;\n max-width:1550px;\n overflow-x: scroll;\n }\n th{\n padding: 1.4px;\n text-align: center;\n font-size: 9px;\n }\n </style>';\n $tab='table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\"';\n }\n \n\n\n $tabla.='<'.$tab.'>\n <thead>\n <tr class=\"modo1\" style=\"height:45px;\">\n <th style=\"width:1%;\" style=\"background-color: #1c7368; color: #FFFFFF\" style=\"height:12px;\">#</th>\n <th style=\"width:2%;\" style=\"background-color: #1c7368; color: #FFFFFF\">COD. ACE.</th>\n <th style=\"width:2%;\" style=\"background-color: #1c7368; color: #FFFFFF\">COD. ACP.</th>\n <th style=\"width:2%;\" style=\"background-color: #1c7368; color: #FFFFFF\">COD. OPE.</th>\n <th style=\"width:2%;\" style=\"background-color: #1c7368; color: #FFFFFF\">COD. ACT.</th> \n <th style=\"width:9%;\" style=\"background-color: #1c7368; color: #FFFFFF\">ACTIVIDAD</th>\n <th style=\"width:9%;\" style=\"background-color: #1c7368; color: #FFFFFF\">RESULTADO</th>\n <th style=\"width:9%;\" style=\"background-color: #1c7368; color: #FFFFFF\">INDICADOR</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">LINEA BASE '.($this->gestion-1).'</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">META</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">ENE.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">FEB.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">MAR.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">ABR.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">MAY.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">JUN.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">JUL.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">AGO.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">SEPT.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">OCT.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">NOV.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">DIC.</th>\n <th style=\"width:9%;\" style=\"background-color: #1c7368; color: #FFFFFF\">VERIFICACI&Oacute;N</th> \n <th style=\"width:4%;\" style=\"background-color: #1c7368; color: #FFFFFF\">PPTO.</th> \n </tr>\n </thead>\n <tbody>';\n $nro=0;\n $operaciones=$this->model_producto->list_operaciones($com_id); /// 2020\n foreach($operaciones as $rowp){\n $sum=$this->model_producto->meta_prod_gest($rowp['prod_id']);\n $monto=$this->model_producto->monto_insumoproducto($rowp['prod_id']);\n $programado=$this->model_producto->producto_programado($rowp['prod_id'],$this->gestion);\n\n $color=''; $tp='';\n if($rowp['indi_id']==1){\n if(($sum[0]['meta_gest'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n }\n elseif ($rowp['indi_id']==2) {\n $tp='%';\n if($rowp['mt_id']==3){\n if(($sum[0]['meta_gest'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n }\n }\n\n $ptto=0;\n if(count($monto)!=0){\n $ptto=$monto[0]['total'];\n }\n\n $color_or='';\n if($rowp['or_id']==0){\n $color_or='#fbd5d5';\n }\n\n $nro++;\n $tabla.=\n '<tr class=\"modo1\" bgcolor=\"'.$color.'\">\n <td style=\"height:40px;\" bgcolor='.$color_or.'>'.$nro.'</td>\n <td style=\"width: 2%; text-align: center;\" bgcolor='.$color_or.' >'.$rowp['acc_codigo'].'</td>\n <td style=\"width: 2%; text-align: center;\" bgcolor='.$color_or.' >'.$rowp['og_codigo'].'</td>\n <td style=\"width: 2%; text-align: center;\" bgcolor='.$color_or.' >'.$rowp['or_codigo'].'</td>\n <td style=\"width: 2%; text-align: center;\" bgcolor=\"#dedcdc\">'.$rowp['prod_cod'].'</td>\n <td style=\"width: 9%; text-align: left;\">'.mb_convert_encoding(''.$rowp['prod_producto'], 'cp1252', 'UTF-8').'</td>\n <td style=\"width: 9%; text-align: left;\">'.mb_convert_encoding(''.$rowp['prod_resultado'], 'cp1252', 'UTF-8').'</td>\n <td style=\"width: 9%; text-align: left;\">'.mb_convert_encoding(''.$rowp['prod_indicador'], 'cp1252', 'UTF-8').'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['prod_linea_base'],2).'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['prod_meta'],2).'</td>';\n\n if(count($programado)!=0){\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['enero'],2).'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['febrero'],2).'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['marzo'],2).'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['abril'],2).'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['mayo'],2).'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['junio'],2).'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['julio'],2).'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['agosto'],2).'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['septiembre'],2).'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['octubre'],2).'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['noviembre'],2).'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['diciembre'],2).'</td>';\n }\n else{\n for ($i=1; $i <=12 ; $i++) { \n $tabla.='<td bgcolor=\"#f5cace\">0.00</td>';\n }\n }\n\n $tabla.='\n <td style=\"width: 9%; text-align: left;\">'.mb_convert_encoding(''.$rowp['prod_fuente_verificacion'], 'cp1252', 'UTF-8').'</td>\n <td style=\"width: 4%; text-align: right;\">'.number_format($ptto, 2, ',', '.').'</td>\n </tr>';\n }\n $tabla .=\n '</tbody>\n </table>';\n\n return $tabla;\n }", "public function limparTabela(){\r\n\t\t$sql = 'DELETE FROM oficina';\r\n\t\t$consulta = $conexao->prepare($sql);\r\n\t\t$consulta->execute();\r\n\t}" ]
[ "0.72418475", "0.7235908", "0.694395", "0.69120544", "0.68950534", "0.67887986", "0.67784363", "0.6766625", "0.6729326", "0.67208844", "0.6685837", "0.66822815", "0.6668384", "0.6606771", "0.65960425", "0.6582163", "0.65616286", "0.6558404", "0.6539995", "0.65205604", "0.6512366", "0.6503345", "0.648591", "0.64846915", "0.6483872", "0.6440546", "0.64341134", "0.64326966", "0.64191985", "0.64173967", "0.6410632", "0.6381934", "0.6368019", "0.63669693", "0.63429904", "0.6342124", "0.6341519", "0.6321339", "0.63206035", "0.63054264", "0.6304222", "0.6303859", "0.6297258", "0.6296234", "0.62861466", "0.62845975", "0.6282836", "0.6282836", "0.6282836", "0.62825966", "0.62763685", "0.6275512", "0.6274648", "0.6272789", "0.6271694", "0.62686646", "0.62658775", "0.62617946", "0.6261299", "0.6259741", "0.6254399", "0.6247916", "0.6247335", "0.6236503", "0.62227887", "0.6222567", "0.6210207", "0.6205914", "0.6200319", "0.6196758", "0.61832345", "0.61810744", "0.61757153", "0.616153", "0.61603135", "0.6157366", "0.6155952", "0.6153297", "0.61528045", "0.6148659", "0.61468226", "0.6146224", "0.61445487", "0.61399376", "0.6138819", "0.6137296", "0.6134858", "0.6133649", "0.6125084", "0.6120863", "0.6120613", "0.611434", "0.6110508", "0.6110473", "0.61097234", "0.61064196", "0.60959977", "0.6093199", "0.6090158", "0.60830367", "0.608056" ]
0.0
-1
Create a new command instance.
public function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}", "public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}", "protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }", "static public function create($cmd = null, $args = null)\n {\n return new self($cmd, $args);\n }", "public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;", "public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }", "public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }", "public function command(Command $command);", "public function __construct($command)\n {\n $this->command = $command;\n }", "public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }", "protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }", "public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }", "public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }", "public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }", "public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;", "private function _getCommandByClassName($className)\n {\n return new $className;\n }", "public function newCommand($regex, $callable) {\n $cmd = new Command();\n $cmd->regex = $regex;\n $cmd->callable = $callable;\n return $this->addCommand($cmd);\n }", "public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }", "private function __construct($command = null)\n {\n $this->command = $command;\n }", "public static function factory(string $command, string $before = '', string $after = ''): self\n {\n return new self($command, $before, $after);\n }", "public function getCommand() {}", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }", "public function testCanBeInstantiated()\n {\n $command = $this->createInstance();\n $this->assertInstanceOf('\\\\Dhii\\\\ShellInterop\\\\CommandInterface', $command, 'Command must be an interoperable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\ConfigurableCommandInterface', $command, 'Command must be a configurable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\MutableCommandInterface', $command, 'Command must be a mutable command');\n }", "public function getCommand();", "protected function createCommand($name, array $parameters = [])\n {\n return new Fluent(\n array_merge(\n compact('name'),\n $parameters)\n );\n }", "public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }", "public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }", "public function __construct($cmd)\n {\n $this->cmd = $cmd;\n }", "public function getCommand()\n {\n }", "public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }", "protected function createCommandFactory(): CommandFactory\n {\n return new CommandFactory([\n 'CLOSE' => Command\\CLOSE::class,\n ]);\n }", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "public function addCommand($command);", "public function add(Command $command);", "abstract protected function getCommand();", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "protected function createCommand(string $name, array $parameters = []): Fluent\n {\n return new Fluent(array_merge(compact('name'), $parameters));\n }", "public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }", "protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }", "private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }", "public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }", "public function command(string $command): self\n {\n $this->addCommands[] = $command;\n\n return $this;\n }", "public function create() {}", "protected function createProcess($cmd)\n {\n return new Process(explode(' ', $cmd));\n }", "public function create(){}", "protected function getCommandFactory(): Command\\Factory\n {\n return new Command\\RedisFactory();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }", "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function __construct($command, $config = [])\n {\n $this->command = $command;\n $this->_output = $this->getDefaultOutput();\n parent::__construct($config);\n }", "public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }", "public function forCommand($command)\n {\n $this->command = $command;\n $this->pipe = new NullPipe();\n $this->manager = new InteractiveProcessManager($this->userInteraction);\n\n return $this;\n }", "public function __construct()\n {\n parent::__construct('pwman', '0.1.0');\n\n $getCommand = new Get();\n $this->add($getCommand);\n\n $setCommand = new Set();\n $this->add($setCommand);\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function createCommand(?string $sql = null, array $params = []): Command;", "public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }", "public function generateCommands();", "protected function newInstanceCommand($commandClass)\n {\n $class = new ReflectionClass($commandClass);\n\n return $class->newInstanceArgs($this->resolveCommandParameters($class));\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }", "public function __construct($commandName, $args = [], $description = '') {\n if (!$this->setName($commandName)) {\n $this->setName('--new-command');\n }\n $this->addArgs($args);\n\n if (!$this->setDescription($description)) {\n $this->setDescription('<NO DESCRIPTION>');\n }\n }", "public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }", "protected function instantiateCommand(Request $request, $args)\n {\n $command = new DeletePackageCustomerCommand($args);\n\n $requestBody = $request->getParsedBody();\n\n $this->setCommandFields($command, $requestBody);\n\n return $command;\n }", "public function createCommand($sql = null, $params = [])\n {\n $command = new Command([\n 'db' => $this,\n 'sql' => $sql,\n ]);\n\n return $command->bindValues($params);\n }", "protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}", "public function setCommand($command)\n {\n $this->command = $command;\n\n return $this;\n }", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }", "public function getCommand(string $command);", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "public function addCommand($command, $args = [], $data = [])\n {\n $item = new ScreenCommand();\n $item->screen_id = $this->id;\n $item->command = $command;\n $item->arguments = $args;\n $item->fill($data);\n $item->save();\n\n return $item;\n }", "public function test_creating_command_from_container()\n {\n $now = new \\DateTime();\n $this->container->add('DateTime', $now);\n $command = 'Spekkionu\\DomainDispatcher\\Test\\Commands\\CommandWithConstructor';\n $result = $this->dispatcher->dispatch($command);\n $this->assertSame($now, $result);\n }", "protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }", "public function generateCommand($singleCommandDefinition);", "public function create() {\n }", "public function create() {\n }", "public function create() {\r\n }", "public function create() {\n\n\t}", "private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }", "public function __construct($command)\n {\n $this->command = $command;\n\n $this->command->line('Installing Images: <info>✔</info>');\n }", "public function __construct()\n {\n self::$instance =& $this;\n\n $commanddir = Config::main('directory');\n $excludes = Config::main('exclude');\n\n if(is_null($commanddir))\n die('Could not find commands directory. It should be specified in the main config.');\n\n //The directory where commands reside should be relative\n //to the directory with the clip executable.\n $dir = realpath(__DIR__.\"/{$commanddir}\");\n\n $cmdfiles = scandir($dir);\n //Loop through each file in the commands directory\n foreach($cmdfiles as $file)\n {\n //Assume that each file uses the standard '.php' file extension.\n $command = substr($file, 0, -4);\n\n //Ignore the unnecessary directories as commands and anything that\n //has been marked for exclusion then attempt to include the valid ones.\n if($file !== '.' && $file !== '..' && array_search($command, $excludes) === false && include(\"{$dir}/{$file}\"))\n {\n if(class_exists($command, false))\n {\n $obj = new $command;\n //Only load commands that use the clip command interface\n if($obj instanceof Command)\n $this->commands[strtolower($command)] = $obj;\n }\n }\n }\n }", "public function __construct($action, $command = null) {\n parent::__construct($action, self::NAME);\n\n $fieldFactory = FieldFactory::getInstance();\n\n $commandField = $fieldFactory->createField(FieldFactory::TYPE_STRING, self::FIELD_COMMAND, $command);\n\n $this->addField($commandField);\n }", "public function createCommand($db = null, $action = 'get')\n {\n if ($db === null) {\n $db = Yii::$app->get(Connection::getDriverName());\n }\n $this->addAction($action);\n $commandConfig = $db->getQueryBuilder()->build($this);\n\n return $db->createCommand($commandConfig);\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();" ]
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315901", "0.6248427", "0.6241929", "0.6194334", "0.6081284", "0.6075819", "0.6069913", "0.60685146", "0.6055616", "0.6027874", "0.60132784", "0.60118896", "0.6011778", "0.5969603", "0.59618074", "0.5954538", "0.59404427", "0.59388787", "0.5929363", "0.5910562", "0.590651", "0.589658", "0.589658", "0.589658", "0.58692765", "0.58665586", "0.5866528", "0.58663124", "0.5852474", "0.5852405", "0.58442044", "0.58391577", "0.58154446", "0.58055794", "0.5795853", "0.5780188", "0.57653266", "0.57640004", "0.57584697", "0.575748", "0.5742612", "0.5739361", "0.5732979", "0.572247", "0.5701043", "0.5686879", "0.5685233", "0.56819254", "0.5675983", "0.56670785", "0.56606543", "0.5659307", "0.56567776", "0.56534046", "0.56343585", "0.56290466", "0.5626615", "0.56255764", "0.5608852", "0.5608026", "0.56063116", "0.56026554", "0.5599553", "0.5599351", "0.55640906", "0.55640906", "0.5561977", "0.5559745", "0.5555084", "0.5551485", "0.5544597", "0.55397296", "0.5529626", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908" ]
0.0
-1
Execute the console command.
public function handle() { // for($i=0;$i<10;$i++){ file_put_contents('./updatePic.sh', '#!/bin/bash'.PHP_EOL, FILE_APPEND); $vuls = Vul::select('id','description')->skip(0)->take(10)->get(); foreach($vuls as $val){ // 抓取图片地址 preg_match_all('/<img[^>]*src=[\'"]?([^>\'"\s]*)[\'"]?[^>]*>/i',$val->description, $match); if(!empty($match[1])){ // 原始内容 // Log::info($val->description); foreach($match[1] as $k => $v){ $dirName = pathinfo($v)['dirname']; if($dirName != '/upload'){ continue; } // 初始替换内容 $replace[0] = $val->description; // 图片新地址内容 $newUrl = '已经删除'; // 替换的地址内容 $replaceUrl = pathinfo($v)['filename']; // 后缀 $extension = pathinfo($v)['extension'] ?? ''; // 赋值新替换内容 $replace[$k+1] = str_replace($replaceUrl,$newUrl,$replace[$k]); // 数据库新内容 $newDesc = $replace[$k+1]; $root = '/var/www'; // 编写shell脚本代码 $shell = 'mv '.$root.$v.' '.$root.'/upload/'.$newUrl.'.'.$extension; file_put_contents('./updatePic.sh', $shell.PHP_EOL, FILE_APPEND); } Vul::where('id',$val->id)->update(['description' => $newDesc]); } } // } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() method on it.\n $this->info(\n \\Aregsar\\Converter\\ConverterFacade::convert($this->argument(\"currency\"))\n );\n }", "public function handle()\n {\n $this->locale = $this->argument('locale');\n\n $this->loadGroupLines();\n\n $this->loadNameSpacedLines();\n\n $this->info('Complete');\n }", "public function handle()\n {\n $this->importUser($this->argument('username'));\n $this->call('ldap:show-user', $this->arguments());\n }", "public function handle() {\n $user = User::where('id', $this->argument('userId'))->first();\n $this->info($user->email);\n }", "public function handle()\n {\n $translations = collect(json_decode(file_get_contents('https://raw.githubusercontent.com/getbible/Bibles/master/translations.json')))->flatten();\n switch($this->argument('action')) {\n case 'fetch':\n $this->fetchBibles($translations);\n break;\n case 'convert':\n $this->convertBibles($translations);\n break;\n }\n }", "public function handle()\n {\n try {\n $evalstr = $this->evaluater->evaluate($this->argument('evalString'));\n $this->info($evalstr);\n } catch (ForbiddenSymbolsException $exception) {\n $this->error($exception->getMessage());\n } catch (IncorrectSymbolsException $exception) {\n $this->error($exception->getMessage());\n }\n }", "public function handle()\n {\n\n $settings = Setting::fetch();\n $id = $this->argument('id');\n $this->scrape_game_data($id);\n }", "public function handle()\n {\n // env('CALENDARINDEX_TOKEN', '6f2bd927201ba4b22bb57df08db0c517e51732de')\n $this->getData($this->argument('country'), $this->argument('region'));\n }", "public function handle()\n {\n $email = $this->argument('email');\n $name = $this->argument('name');\n\n $this->info(\"starting to generate users details\");\n\n }", "public function handle()\n {\n\t\t$this->info('Importing translations...');\n\n\t\t$this->manager->importTranslations(true);\n }", "public function handle()\n {\n $user = null;\n\n if ($email = $this->option(\"email\", false)) {\n $user = $this->findByEmail($email);\n }\n\n if ($id = $this->option(\"id\", false)) {\n $user = $this->findById($id);\n }\n\n if (empty($user)) {\n $this->warn(\"User no found\");\n }\n else {\n $this->setRoleToUser($user);\n }\n }", "public function handle()\n {\n $name = ucwords($this->argument('name'));\n $this->call('repository:contract', [ 'name' => $name ]);\n $this->call('repository:class', [ 'name' => $name, '--driver' => $this->option('driver') ]);\n }", "public function handle()\n\t{\n\t\t// Superuser\n\t\tif( ! $this->option('no-superuser'))\n\t\t\t$this->call('setup:superuser');\n\n\t\t// Countries\n\t\tif( ! $this->option('no-countries'))\n\t\t\t$this->call('setup:countries', ['country' => array_filter(explode(',', $this->option('countries')))]);\n\n\t\t// Languages\n\t\tif( ! $this->option('no-languages'))\n\t\t\t$this->call('setup:languages', ['language' => array_filter(explode(',', $this->option('languages')))]);\n\n\t\t// Currencies\n\t\tif( ! $this->option('no-currencies'))\n\t\t\t$this->call('setup:currencies', ['currency' => array_filter(explode(',', $this->option('currencies')))]);\n\n\t\t// Clear cache\n\t\t$this->call('cache:clear');\n\t}", "public function handle()\n\t{\n\t\t$name = $this->argument('name');\n\t\t\n\t\t$this->info(\"Searching eve api for {$name}\");\n\t\t$result = Corporation::searchEVEAPI($name);\n\n\t\t$this->info(\"results\");\n\t\tforeach($result as $corp)\n\t\t{\n\t\t\tprint $corp->name . \" \" . $corp->id . \"\\r\\n\";\n\t\t}\n\t}", "public function handle()\n {\n $user = $this->argument('user');\n $this->info('Display this on the screen, user ' . $user);\n return 0;\n }", "public function handle()\n {\n $this->userVectors->test($this->option('force'));\n }", "public function handle()\n {\n $mapping = $this->formatMappingName((string)$this->argument('mapping'));\n \n $model = $this->option('model') ? $this->formatModelName($this->option('model')) : null;\n \n $this->filesystem->put(\n $this->buildMappingFilePath($mapping),\n $this->buildMapping(\n $this->getDefaultStub(),\n $mapping,\n $model\n )\n );\n \n $this->composer->dumpAutoloads();\n }", "public function handle()\n {\n switch ($this->argument('type')) {\n case 'dns':\n $this->dnscheck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n case 'whois':\n $this->whoischeck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n }\n }", "public function handle()\n {\n $option = $this->argument('option');\n\n if (! in_array($option, ['expired', 'all'])) {\n return $this->error('Invalid option supplied to command...');\n }\n\n $this->comment('Beginning pruning process...');\n\n $this->comment($this->pruneDatabase($option) . ' deleted from database...');\n\n $this->comment($this->pruneFiles($option) . ' deleted from files...');\n\n $this->info('Nonces pruned successfully!');\n }", "public function handle()\n {\n $subscriptionUpdateService = new SubscriptionUpdateService();\n $subscriptionUpdateService->runUpdates();\n }", "public function handle()\n\t{\n\t\t\n\t\t$source_directory = $this->argument( 'source_directory' );\n\t\t$target_directory = $this->argument( 'target_directory' );\n\t\t$template = (string) $this->option( 'template' );\n\n\t\t$statik = new \\App\\Statik\\Statik;\n\n\t\t$statik->generateHTMLFiles( $this, $source_directory, $target_directory, $template ) && $this->info( \"\\e[1;32mDONE!\" );\n\n\t}", "public function handle()\n {\n if (!$this->argument('file')) {\n $this->info('Please specify file to call.');\n }\n\n $file = $this->argument('file');\n\n if (!$this->fileHandler->exists($file)) {\n $this->info('Wrong path or file not exist.');\n }\n\n $this->executeFile($file);\n }", "public function handle()\n {\n $user = $this->argument('user');\n $this->scanner->setUserName($user);\n $this->scanner->scanUser();\n }", "public function handle()\n {\n if ($this->argument('user')) {\n $userId = $this->argument('user');\n\n $this->info(\"Liquidate affiliate commission for user \" . $userId);\n\n $user = $this->userService->findById($userId);\n\n if ($user) {\n $this->walletService->liquidateUserBalance($user);\n } else {\n $this->error(\"User not found\");\n }\n\n $this->info(\"Done\");\n } else {\n $this->info(\"Liquidate all commissions\");\n\n $this->walletService->liquidateAllUsersBalance();\n\n $this->info(\"Done\");\n }\n }", "public function handle()\n {\n $action = $this->choice('what action do you have on mind', [\n 'add-relation', 'remove-columns', 'column-type', 'rename-column'\n ]);\n switch ($action) {\n case 'add-relation':\n $this->addRelation();\n break;\n\n case 'remove-columns':\n $this->removeColumns();\n break;\n case 'column-type':\n $this->columnType();\n break;\n case 'rename-column':\n $this->renameColumn();\n break;\n default:\n $this->error('Unsupported action requested...');\n }\n $this->info('Command executed successfully');\n }", "public function handle()\n {\n $arguments = $this->arguments();\n $storageDir = $arguments['storageDir'];\n $localStorageDir = $arguments['localStorageDir'];\n $url = $arguments['url'];\n $cmd = sprintf(\"./app/Console/Commands/ShellScripts/screen_shot.sh %s %s %s\", $storageDir, $localStorageDir, $url);\n\n while (true) {\n $result = shell_exec($cmd);\n print_r($result);\n sleep(3);\n }\n }", "public function handle()\n {\n $city = $this->argument('city');\n\n $weatherService = new CurrentWeatherService();\n try {\n $weather = $weatherService->getByCity($city);\n } catch (WeatherException $e) {\n $this->error($e->getMessage());\n return;\n }\n\n $this->info('Weather for city '.$city);\n dump($weather->toArray());\n }", "public function handle()\n {\n $this->getModels($this->argument('model'));\n $this->getLanguages($this->argument('locale'));\n $this->createMultiLanguageRecords();\n }", "public function handle()\n {\n $this->processOptions();\n\n echo json_encode( $this->dateTimeRange ) . \"\\n\";\n\n $this->dispatch( new ProcessNewActionsJob(\n $this->dateTimeRange ,\n str_random( 16 ),\n $this->option('runtime-threshold')\n ) );\n }", "public function handle()\n {\n $fightId = $this->argument('fight_id');\n $metricId = $this->argument('metric_id');\n //$strategyName = 'App\\\\'.$this->argument('metric_name');\n\n $metric = BossMetric::find($metricId);\n if ($metric === null) {\n $this->error(\"Error: no metric with id: $metricId found!\");\n return;\n }\n\n $fight = Fight::find($fightId);\n\n if ($fight === null) {\n $this->error(\"Error: no fight with id: $fightId found!\");\n return;\n }\n\n $strategy = $metric->getStrategy();\n $strategy->setFight($fight);\n $strategy->run();\n }", "public function handle()\n {\n\t\t$this->call('vendor:publish');\n\t\t$this->call('migrate');\n\t\t$this->call('db:seed');\n\t\t$this->call('factotum:storage');\n\t\t$this->call('factotum:storage');\n }", "public function handle()\n {\n $user_id = $this->argument('user') ?? null;\n\n if (is_null($user_id)) {\n $users = User::all();\n\n foreach ($users as $user) {\n $this->showUserBalance($user);\n }\n } else {\n $user = User::find($user_id);\n\n $this->showUserBalance($user);\n }\n }", "public function handle()\n {\n $this->capsuleService->getAll();\n $this->line('Command Worked');\n }", "public function handle()\n {\n $platform_wechat_id = $this->argument('id');\n $customer_id = $this->argument('customer_id');\n $this->info(\"Starting at \".date('Y-m-d H:i:s').\". Running initial for 【{$this->signature}】\");\n $this->getUserInfoList($platform_wechat_id,$customer_id);\n $this->info(\"End at \".date('Y-m-d H:i:s').\". over for 【{$this->signature}】\");\n }", "public function handle()\n {\n $this->publishAssets();\n $this->call('twill:flush-manifest');\n $this->call('view:clear');\n }", "public function handle()\n {\n \n $argument = $this->argument('data');\n \n $this->prepare( $argument );\n \n $this->make();\n \n $this->info( 'migration has been created : '. $this->fileName );\n \n }", "public function handle()\n {\n chdir(resource_path('assets/ts'));\n $path = $this->argument(\"path\");\n if(isset($path))\n {\n Logger::info('execute '.$path);\n Command::executeRaw('tsc', [\"-p\", $path]);\n }else\n Logger::info('execute tsc');\n Command::executeRaw('tsc');\n }", "public function handle()\n {\n $this->info('Starting date change command.');\n\n Word::where('language_id', 1)->update(array('created_at' => '1970-01-01 00:00:01'));\n Word::where('language_id', 2)->update(array('created_at' => '1970-01-01 00:00:01'));\n\n $this->info('Dates have been changed to 1970-01-01 00:00:01');\n }", "public function handle()\n {\n $this->info($this->slugger->encode($this->argument('id')));\n }", "public function handle()\n {\n $this->line(static::$logo);\n $this->line('Neat admin current version:' . Neat::version());\n\n $this->comment('');\n $this->comment('Available commands:');\n\n $this->listAvailableCommands();\n }", "public function handle()\n {\n $this->revisions->updateListFiles();\n }", "public function handle(): void\n {\n // Set argument\n $this->url = $this->argument(self::URL_ARGUMENT);\n\n // Handler takes care of computation\n (new CommandHandler($this))->compute();\n }", "public function handle()\n {\n try\n {\n $filename = $this->argument('filename');\n Excel::import(new ObjectsImport, $filename);\n\n $this->info('Data import is now completed');\n }\n catch(Exception $ex)\n {\n $this->error($ex->getMessage());\n }\n }", "public function handle() {\n $entity = $this->validateEntity($this->argument('entity'));\n $job = new DataProcessingJob($entity, str_random(16));\n $this->dispatch($job);\n }", "public function handle()\n {\n $isProductionMode = 'prod' == $this->argument('mode');\n\n if ($isProductionMode) {\n if (!$this->confirm('Are you sure to run in production mode? Running this command may cause critical issues?')) {\n exit(1);\n }\n }\n\n $this->_recalculate($isProductionMode);\n }", "public function handle()\n {\n if(!$this->verify()) {\n $rank = $this->createRankSuperAdmin();\n $user = $this->createUserSuperAdmin();\n $user->Ranks()->attach($rank);\n $this->line('Felicitaciones');\n } else {\n $this->error('No se puede ejecutar');\n }\n }", "public function handle()\n {\n // Get CLI Input\n $user_id = $this->option(\"uid\");\n\n // User Products\n ( new CommandManager() )->showUserProducts( $user_id );\n }", "public function handle()\n {\n $force = $this->option('force');\n\n if($this->option('without-bulk')){\n $this->withoutBulk = true;\n }\n\n if ($this->generateClass($force)){\n $this->info('Generating permissions for '.$this->modelBaseName.' finished');\n }\n }", "public function handle()\n {\n $tournaments = Tournament::all()->toArray();\n foreach ($tournaments as $tournament) {\n $slug = $this->tournamentRepoObj->generateSlug($tournament['name'].Carbon::createFromFormat('d/m/Y', $tournament['start_date'])->year,'');\n DB::table('tournaments')\n ->where('id', $tournament['id'])\n ->update([\n 'slug' => $slug\n ]);\n }\n $this->info('Script executed.');\n }", "public function handle()\n {\n $userId = $this->argument('user');\n\n /** @var User $user */\n $user = User::findOrFail($userId);\n\n // Get token.\n $info = (new Client())->auth();\n\n // Save to db.\n $user->access_token = $info['access_token'];\n $user->access_secret = $info['access_secret'];\n $user->save();\n\n $this->line(\"Saved access token and secret for user: {$user->email}\");\n }", "public function handle()\n {\n $m = new MemberFromText;\n $m->train();\n $id = $m->predict($this->argument('text'));\n dump(Miembro::find($id)->toArray());\n }", "public function handle()\n {\n $this->generator\n ->setConsole($this)\n ->run();\n }", "public function handle()\n {\n $this->createController();\n $this->createServiceDir();\n\n exit;\n $args = [\n '--provider' => TestProvider::class\n ];\n $className = $this->argument('className');\n if (!$className) {\n $className = 'MethodsList';\n }\n $className = ucwords($className);\n $this->call('vendor:publish', $args);\n $this->info('Display this on the screen ' . $className);\n }", "public function handle()\n {\n $this->createDirectories();\n\n $this->publishTests();\n\n $this->info('Authentication tests generated successfully.');\n }", "public function handle()\n {\n $this->setDbConnection(\n $this->input->getOption('database') ?: config('ghost-database.default_connection')\n );\n\n $native = $this->input->getOption('native-import') ?: config('ghost-database.use_native_importer');\n\n $snapshot = $this->import($native);\n\n $this->info(\"Snapshot `{$snapshot->name}` loaded!\");\n }", "public function handle()\n {\n $exec = $this->argument('exec');\n\n switch ($exec) {\n case 'download' :\n $this->download();\n break;\n\n case 'generate' :\n $this->generate();\n break;\n\n default :\n echo \"Choose 'download' or 'generate' for this command\";\n break;\n }\n }", "public function handle()\n {\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-admin.js', '--group' => 'admin']);\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-frontend.js', '--group' => 'frontend']);\n $this->call(TranslationsGenerateCommand::class);\n }", "public function handle()\n {\n $tenantName = $this->argument('tenant');\n\n $tenant = Tenant::where('name', $tenantName)->orWhere('subdomain', $tenantName)->first();\n\n if ($tenant) {\n $tenant->setActive();\n \\Artisan::call('tinker');\n } else {\n $this->error('Error: Tenant not found');\n }\n }", "public function handle()\n {\n try {\n if (!empty($userId = $this->argument('user'))) {\n $user = User::find($userId);\n } else {\n $user = User::inRandomOrder()->first();\n }\n\n if (empty($user)) {\n throw new \\Exception('User not found');\n }\n\n echo JWTAuth::fromUser($user);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n }", "public function handle()\n {\n $this->fetchAndSetToken();\n $imagesToDownload = $this->peekImages(WatchedApp::pluck('package_name'));\n $this->fetchImages($imagesToDownload);\n\n if ($this->option('dont-optimize')) {\n return;\n }\n\n $this->runOptimizeCommand();\n }", "public function handle()\n {\n $this->setCryptIVFromUrl($this->argument('url'));\n\n $participant = URLParser::parseByName('santa.index', $this->argument('url'))->participant;\n if($participant) {\n $draw = $participant->draw;\n } else {\n $draw = URLParser::parseByName('organizer.index', $this->argument('url'))->draw;\n }\n\n $this->table(\n ['ID', 'Name', 'Email'],\n $draw->participants()->get(['id', 'name', 'email'])->toArray()\n );\n }", "public function handle()\n {\n // if you are on the local environment\n if (!(app()->isLocal() || app()->runningUnitTests())) {\n $this->error('This command is only available on the local environment.');\n return;\n }\n\n $fqdn = $this->argument('fqdn');\n if ($tenant = Tenant::retrieveBy($fqdn)){\n $tenant->delete($fqdn);\n $this->info(\"Tenant {$fqdn} successfully deleted.\");\n }else {\n $this->error('This fqdn doesn\\'t exist.');\n }\n\n }", "public function handle()\n {\n $user_from = $this->option('from');\n $user_to = $this->option('to');\n $sum = $this->option('sum');\n\n CreateTransaction::dispatch($this->usersRepository->getByID($user_from), $this->usersRepository->getByID($user_to), $sum, true);\n $this->transactionsRepository->getAll()->each(function ($transaction){\n \tExecuteTransaction::dispatch($transaction);\n });\n }", "public function handle()\n {\n $this->warn('Starting Retrieve Data');\n\n PeopleService::retrieveData();\n\n $this->info('Retrieve Data Completed');\n }", "public function handle()\n {\n \n $period = $this->option('period');\n \n switch ($period) {\n\n case 'half_month':\n $this->info('Grabing Half Month Income...');\n $this->halfMonth();\n break;\n\n case 'monthly':\n $this->info('Grabing Monthly Income...');\n $this->monthly();\n break;\n \n default:\n $this->info('Grabing Daily Income...');\n $this->daily();\n break;\n\n }\n\n \n }", "public function handle()\n {\n $countryFiles = $this->getFiles();\n\n foreach ($countryFiles as $fileName) {\n $this->seed($fileName);\n }\n\n $this->info('End.');\n }", "public function fire()\n {\n $entityName = $this->argument('entityName');\n $startEntityId = $this->argument('startEntityId');\n $endEntityId = $this->argument('endEntityId');\n $depth = $this->argument('depth');\n\n $this->fixturePath = $this->option('outputPath');\n\n $this->info(\"Generating fixtures for $entityName in {$this->fixturePath}...\");\n \n $this->generateFixtures($entityName, $startEntityId, $endEntityId, $depth);\n }", "public function handle()\n {\n $check = PublishTraitsService::publishTraits();\n\n if ($check)\n {\n $this->info('All files have been published');\n }\n\n $this->info('Failed to publish');\n }", "public function handle()\n {\n $user = User::where('username', $this->argument('user'))\n ->orWhere('email', $this->argument('user'))\n ->first();\n\n if ($user != null) {\n $user->assign('admin');\n $this->line(\"{$user->email} was successfully made an admin.\");\n } else {\n $this->line(\"No user found where username or email is '{$this->argument('user')}'\");\n }\n }", "public function handle()\n {\n event( 'laraview:compile' );\n $this->checkForSelectedViewGeneration();\n\n app( RegisterBlueprint::class )\n ->console( $this )\n ->generate();\n }", "public function handle()\n {\n $project = Project::with(['team.admins', 'team.members'])->findOrFail($this->option('project-id'));\n $user = User::findOrFail($this->option('user-id'));\n if ($this->option('admin')) {\n $project->team->admins()->syncWithoutDetaching($user);\n } else {\n $project->team->members()->syncWithoutDetaching($user);\n }\n return Command::SUCCESS;\n }", "public function handle() {\n try {\n $this->roomService->loadRoomOccupations();\n Log::notice('untis:occupations executed successfully.');\n $this->line('Loaded room occupations from WebUntis.');\n } catch (Exception $e) {\n Log::error('Error loading room occupations.', ['exception' => $e]);\n $this->error('Error loading room occupations: ' . $e->getMessage());\n }\n }", "public function handle()\n {\n $this->loadIxList();\n $this->loadIxMembersList();\n $this->updateIxInfo();\n $this->updateIxMembersInfo();\n }", "public function handle()\n {\n $this->call('vendor:publish', [\n '--provider' => \"Qoraiche\\MailEclipse\\MailEclipseServiceProvider\",\n ]);\n }", "public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}", "public function handle(Command $command);", "public function handle(Command $command);", "public function handle()\n {\n $date_from = $this->argument('date_from');\n\t\t$date_to = $this->argument('date_to');\n\t\tif(!$date_from) {\n\t\t\t$date_from = Carbon::today()->subDays(5);\n\t\t}\n\t\tif(!$date_to) {\n\t\t\t$date_to = Carbon::yesterday();\n\t\t}\n\t\tStats::computeMembers($this->argument('venue_id'), $date_from, $date_to);\n }", "public function handle()\n {\n switch ($this->argument('type')){\n case 'fih':\n $scrapper = new Scrappers\\FederationScrapper();\n $scrapper->get($this->option('level'));\n print $scrapper->message();\n break;\n }\n }", "public function handle()\n {\n Log::info(\"seed:dash Command is working fine!\");\n $this->info('Dashboard Database seeding completed successfully.');\n }", "public function handle()\n {\n $originalId = $this->argument('original_id');\n\n $status = true;\n if ($this->option('status') === 'false') {\n $status = false;\n }\n\n if ($video = Video::where('original_id', $originalId)->first()) {\n $video->dmca_claim = $status;\n $video->save();\n\n $this->info('Video\\'s dmca_claim set to: ' . json_encode($status));\n return ;\n }\n\n $this->error('No video found with original_id of: ' . $originalId);\n return;\n }", "public function handle()\n {\n $this->call('config:clear');\n\n $this->call('config:update');\n\n $this->info('Configuration cached successfully!');\n }", "public function handle()\n {\n //\n $modelName = $this->argument('model');\n $column = $this->argument('column');\n $this->generateMutation($modelName, $column);\n\n }", "public function handle()\n {\n $filePath = 'public/' . $this->argument('fileName');\n $count = $this->argument('count');\n \n $fileData = array_slice(file($filePath), 0, $count);\n $this->info(implode('', $fileData));\n }", "public function handle()\n {\n $email = $this->argument('email');\n\n Mail::to($email)->send(new SendMailable('Test Mail'));\n\n if (Mail::failures()) {\n $this->info('Email failed to send');\n } else {\n $this->info('Email successfully sent');\n }\n }", "public function handle()\n {\n $this->call('route:trans:clear');\n\n $this->cacheRoutesPerLocale();\n\n $this->info('Routes cached successfully for all locales!');\n }", "public function handle()\n {\n $this->info('Welcome to command for Bantenprov\\WilayahIndonesia package');\n }", "public function handle()\n {\n if($this->hasOption('no_dump') && $this->option('no_dump')){\n $this->composer_dump = false;\n }\n $this->readyDatas();\n $this->datas['startSymbol']='{{';\n $this->datas['endSymbol']='}}';\n $this->create();\n }", "public function handle()\n {\n $repository = new OglasiCrawlerRepository();\n $ads = $repository->getAds();\n $repository->saveAds($ads);\n\n echo 'Ads were successfully retrieved' . PHP_EOL;\n }", "public function handle()\n {\n $this->makeDir($this->basePath . $this->kebabPlural());\n\n $this->exportViews();\n\n $this->info('Resource views generated successfully.');\n }", "public function handle()\n {\n $movies = \\App\\Models\\Movie::whereNull('meta')->take(40)->orderBy('id')->get();\n $movies->each(function($movie){ sleep(1); $movie->getMeta(); });\n return Command::SUCCESS;\n }", "public function handle()\n {\n $this->packageGenerator->setConsole($this)\n ->setPackage($this->argument('package'))\n ->setType('shipping')\n ->setForce($this->option('force'))\n ->generate();\n }", "public function handle()\n {\n $test = $this->argument('test');\n\n $dir = config('speed-test.dir');\n\n $className = ucfirst(\\Str::camel($test));\n\n $namespace = config('speed-test.namespace');\n\n $class = class_entity($className)\n ->namespace($namespace);\n\n $class->method('speed1')\n ->line($this->option('line'))->doc(function ($doc) use ($className) {\n /** @var DocumentorEntity $doc */\n $doc->tagCustom('times', $this->option('times'));\n $doc->description($this->option('description') ?: \"{$className} Speed 1\");\n });\n\n if (! is_dir($dir)) {\n mkdir($dir, 0777, 1);\n }\n\n file_put_contents(\n $dir.'/'.$className.'.php',\n $class->wrap('php')\n );\n\n $this->info('Speed created!');\n\n return 0;\n }", "public function handle()\n {\n $message = $this->GenerateRandomUser($this->argument('count'));\n $this->info($message);\n }", "public function handle()\n {\n $host = Cache::get('executingHost', null);\n $this->info(\"Host: ${host}\");\n\n if ($host === null) {\n $this->info('実行するホストが選択されていません');\n return;\n }\n\n if (Schema::hasTable('companies') && Company::count() !== 0) {\n $this->info('マイグレーションが既に1回以上実行されています');\n return;\n }\n\n $should_execute = $host === $this->argument('executingHost');\n\n if ($should_execute) {\n Artisan::call('migrate:fresh', ['--seed' => true]);\n $this->info('マイグレーションが完了しました');\n\n Cache::forget('executingHost');\n } else {\n $this->info('別ホストにてマイグレーションが行われます');\n }\n }", "public function handle()\n {\n // Configuration...\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-config']);\n\n // Migrations\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-migrations']);\n\n $this->info('Model Login resources published.');\n }", "public function handle()\n {\n if ($this->validation()) {\n $money = $this->argument('money');\n Cache::increment('amount', $money);\n }\n }", "public function handle()\n {\n $this->info('Publishing stuff..');\n\n $this->publishFiles();\n\n $this->info('Setup complete. Enjoy!');\n }", "public function handle()\n {\n $this->publishConfig();\n $this->publishClassStub();\n $this->generateAndStoreKey();\n\n $this->info('Use the details below for your \"Lead delivery options\" in Google Ads.');\n $this->info('Webhook URL: ' . route('GoogleAdsLeadExtensionController@index'));\n $this->info('Key: ' . $this->generated_key);\n }", "public function handle()\n {\n $opts = $this->options();\n $args = $this->arguments();\n #print_r($opts);\n #print_r($args);\n\n # Redundant as argument validation handled by Laravel\n #\n if (!isset($args['destination'])) {\n printf(\"Usage: php artisan %s\\n\", $this->signature);\n exit(1);\n }\n\n # Default to normal message type\n #\n if (!isset($opts['type'])) {\n $opts['type'] = 'normal';\n }\n\n $uac = new UserApiController();\n\n if ($opts['type'] == 'normal') {\n if (!isset($opts['message'])) {\n printf(\"Usage: php artisan %s\\n\\n\", $this->signature);\n printf(\"ERROR: Message must be specified for type 'normal'\\n\");\n exit(1);\n }\n $result = $uac->sendSms(\n $args['destination'],\n $opts['message'],\n $opts['route']\n );\n }\n else if ($opts['type'] == 'otp') {\n $result = $uac->sendVerificationSms(\n $args['destination'],\n '<code>',\n '<name>',\n $opts['route'],\n '<appName>'\n );\n }\n\n if ($result === true) {\n printf(\"INFO: SMS message to %s sent successfully (%s)\\n\",\n $args['destination'], $opts['type']);\n }\n else {\n printf(\"INFO: SMS message to %s failed to send (%s)\\n\", \n $args['destination'], $opts['type']);\n printf(\"ERROR: %s\\n\", $result);\n }\n\n return;\n }" ]
[ "0.6469962", "0.6463639", "0.64271367", "0.635053", "0.63190264", "0.62747604", "0.6261977", "0.6261908", "0.6235821", "0.62248456", "0.62217945", "0.6214421", "0.6193356", "0.61916095", "0.6183878", "0.6177804", "0.61763877", "0.6172579", "0.61497146", "0.6148907", "0.61484164", "0.6146793", "0.6139144", "0.61347336", "0.6131662", "0.61164206", "0.61144686", "0.61109483", "0.61082935", "0.6105106", "0.6103338", "0.6102162", "0.61020017", "0.60962653", "0.6095482", "0.6091584", "0.60885274", "0.6083864", "0.6082142", "0.6077832", "0.60766655", "0.607472", "0.60739267", "0.607275", "0.60699606", "0.6069931", "0.6068753", "0.6067665", "0.6061175", "0.60599935", "0.6059836", "0.605693", "0.60499364", "0.60418284", "0.6039709", "0.6031963", "0.6031549", "0.6027515", "0.60255647", "0.60208166", "0.6018581", "0.60179937", "0.6014668", "0.60145515", "0.60141796", "0.6011772", "0.6008498", "0.6007883", "0.60072047", "0.6006732", "0.60039204", "0.6001778", "0.6000803", "0.59996396", "0.5999325", "0.5992452", "0.5987503", "0.5987503", "0.5987477", "0.5986996", "0.59853584", "0.5983282", "0.59804505", "0.5976757", "0.5976542", "0.5973796", "0.5969228", "0.5968169", "0.59655035", "0.59642595", "0.59635514", "0.59619296", "0.5960217", "0.5955025", "0.5954439", "0.59528315", "0.59513766", "0.5947869", "0.59456027", "0.5945575", "0.5945031" ]
0.0
-1
Makes a request to the Yelp API and returns the response
function request($host, $path, $url_params = array()) { // Send Yelp API Call try { $curl = curl_init(); if (FALSE === $curl) throw new Exception('Failed to initialize'); $url = $host . $path . "?" . http_build_query($url_params); curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, // Capture response. CURLOPT_ENCODING => "", // Accept gzip/deflate/whatever. CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "authorization: Bearer " . $GLOBALS['API_KEY'], "cache-control: no-cache", ), )); $response = curl_exec($curl); if (FALSE === $response) throw new Exception(curl_error($curl), curl_errno($curl)); $http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE); if (200 != $http_status) throw new Exception($response, $http_status); curl_close($curl); } catch(Exception $e) { trigger_error(sprintf( 'Curl failed with error #%d: %s', $e->getCode(), $e->getMessage()), E_USER_ERROR); } return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function request($host, $path, $url_params = array()) {\n // Send Yelp API Call\n try {\n $curl = curl_init();\n if (FALSE === $curl)\n throw new Exception('Failed to initialize');\n $url = $host . $path . \"?\" . http_build_query($url_params);\n curl_setopt_array($curl, array(\n CURLOPT_URL => $url,\n CURLOPT_RETURNTRANSFER => true, // Capture response.\n CURLOPT_ENCODING => \"\", // Accept gzip/deflate/whatever.\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => array(\n \"authorization: Bearer \" . $GLOBALS['API_KEY'],\n \"cache-control: no-cache\",\n ),\n ));\n $response = curl_exec($curl);\n if (FALSE === $response)\n throw new Exception(curl_error($curl), curl_errno($curl));\n $http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n if (200 != $http_status)\n throw new Exception($response, $http_status);\n curl_close($curl);\n } catch(Exception $e) {\n trigger_error(sprintf(\n 'Curl failed with error #%d: %s',\n $e->getCode(), $e->getMessage()),\n E_USER_ERROR);\n }\n return $response;\n}", "function request($host, $path, $url_params = array()) {\n // Send Yelp API Call\n try {\n $curl = curl_init();\n if (FALSE === $curl)\n throw new Exception('Failed to initialize');\n $url = $host . $path . \"?\" . http_build_query($url_params);\n curl_setopt_array($curl, array(\n CURLOPT_URL => $url,\n CURLOPT_RETURNTRANSFER => true, // Capture response.\n CURLOPT_ENCODING => \"\", // Accept gzip/deflate/whatever.\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => array(\n \"authorization: Bearer \" . $GLOBALS['API_KEY'],\n \"cache-control: no-cache\",\n ),\n ));\n $response = curl_exec($curl);\n if (FALSE === $response)\n throw new Exception(curl_error($curl), curl_errno($curl));\n $http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n if (200 != $http_status)\n throw new Exception($response, $http_status);\n curl_close($curl);\n } catch(Exception $e) {\n trigger_error(sprintf(\n 'Curl failed with error #%d: %s',\n $e->getCode(), $e->getMessage()),\n E_USER_ERROR);\n }\n return $response;\n}", "public function yelp()\n {\n $latitude = Request::input('latitude');\n $longitude = Request::input('longitude');\n $location = Request::input('location');\n $options = array(\n // 'accessToken' => 'YOUR ACCESS TOKEN', // Required, unless apiKey is provided\n 'apiHost' => 'api.yelp.com', // Optional, default 'api.yelp.com',\n 'apiKey' => env('YAK'), // Required, unless accessToken is provided\n );\n\n $client = \\Stevenmaguire\\Yelp\\ClientFactory::makeWith(\n $options,\n \\Stevenmaguire\\Yelp\\Version::THREE\n ); \n\n $parameters = [\n 'term' => 'florist',\n 'location' => $location,\n 'latitude' => $latitude,\n 'longitude' => $longitude,\n 'radius' => 5000,\n 'limit' => 20,\n ];\n $results = $client->getBusinessesSearchResults($parameters);\n if (!$results) {\n return redirect()->back();\n }\n return view('component.results', compact('results'));\n }", "public function yelpExternal(Request $request)\n {\n $params = $request->validate([\n \"term\" => \"required|string\",\n \"location\" => \"required|string\",\n ]);\n\n $response = Http::withHeaders([\n 'Authorization' => 'Bearer ' . env('YELP_API_KEY'),\n ])->get('https://api.yelp.com/v3/businesses/search', [\n 'term' => $params['term'],\n 'location' => $params['location'],\n 'limit' => 5,\n ]);\n\n return response($response);\n }", "function search($searchType, $price, $location, $categories) {\n $url_params = array();\n \n $url_params['term'] = $searchType;\n //$url_params['location'] = $location;\n $url_params['longitude'] = $location[0];\n $url_params['latitude'] = $location[1];\n //8046.72 is equivalent to 5 miles 16093.44 is equivalent to 10 miles\n $url_params['radius'] = 16093;\n $url_params['price'] = $price;\n $url_params['sort_by'] = 'rating';\n $url_params['open_now'] = true;\n $url_params['limit'] = 20;\n $url_params['categories'] = $categories;\n \n //converts into 'https://api.yelp.com/v3/businesses/search/location&limit&price&sort_by&radius'\n $response = request($GLOBALS['API_HOST'], $GLOBALS['SEARCH_PATH'], $url_params);\n \n $pretty_response = json_encode(json_decode($response), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\n\n $data = json_decode($pretty_response, true);\n\n return $data['businesses'];\n}", "public function yelp_business_api($businesses_id = 'north-india-restaurant-san-francisco', $api_key = 'Q1f28T05IN-H1tvDtQ-IMf4TMd2nsgZ4mN2e03EuUgO-5bQSqBxkXpb_uTPeA98FGq-3vmz0BoFTV3cz6oeh2GnCq9BiNk4nG83nX73wBCclVU2y1rQ1OqrczSUxW3Yx')\n {\n \n $yelp_api_url = 'https://api.yelp.com/v3/businesses/'.$businesses_id;\n\n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_URL => $yelp_api_url,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => array(\n \"authorization: Bearer \".$api_key\n ),\n ));\n $response = curl_exec($curl);\n $err = curl_error($curl);\n curl_close($curl);\n\n if ($err) {\n \n dd($err);\n \n } else {\n\n return json_decode($response); dd();\n }\n }", "function access($unsigned_url) {\n$token = new OAuthToken($token, $token_secret);\n// Consumer object built using the OAuth library\n$consumer = new OAuthConsumer($consumer_key, $consumer_secret);\n// Yelp uses HMAC SHA1 encoding\n$signature_method = new OAuthSignatureMethod_HMAC_SHA1();\n// Build OAuth Request using the OAuth PHP library. Uses the consumer and token object created above.\n$oauthrequest = OAuthRequest::from_consumer_and_token($consumer, $token, 'GET', $unsigned_url);\n// Sign the request\n$oauthrequest->sign_request($signature_method, $consumer, $token);\n// Get the signed URL\n$signed_url = $oauthrequest->to_url();\n// Send Yelp API Call\n$ch = curl_init($signed_url);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_HEADER, 0);\n$data = curl_exec($ch); // Yelp response\ncurl_close($ch);\nreturn($data);\n}", "function get_reviews($business_id) {\n //converts into '/v3/businesses/{id}/reviews'\n $review_path = $GLOBALS['BUSINESS_PATH'] . urlencode($business_id) . '/reviews';\n\n $response = request($GLOBALS['API_HOST'], $review_path);\n\n $pretty_response = json_encode(json_decode($response), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\n\n $data = json_decode($pretty_response, true);\n\n\n return $data['reviews'];\n\n\n //converts into 'https://api.yelp.com/v3/businesses/search/location&limit&price&sort_by&radius'\n /*$response = request($GLOBALS['API_HOST'], $GLOBALS['SEARCH_PATH'], $url_params);\n \n $pretty_response = json_encode(json_decode($response), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\n\n $data = json_decode($pretty_response, true);*/\n}", "function query_api($term, $location, $price, $radius, $categories, $sort) { \n $response = search($term, $location, $price, $radius, $categories, $sort);\n echo $response;\n}", "public function & GetResponse ();", "function query_api($term, $location) {\r\n $response = json_decode(search($term, $location));\r\n $business_id = $response->businesses[0]->id;\r\n /* \r\n print sprintf(\r\n \"%d local businesses found, querying business info for the top result \\\"%s\\\"\\n\\n <br>\",\r\n count($response->businesses),\r\n $business_id\r\n );\r\n */ \r\n $response = get_business($business_id);\r\n \r\n print sprintf(\"Result for business \\\"%s\\\" found:\\n\", $business_id);\r\n $pretty_response = json_encode(json_decode($response), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\r\n print \"$pretty_response\\n\";\r\n\r\n return json_decode($response, true);\r\n }", "public function request() {\n // The basic flow: build the url, make the request, parse and return the\n // output.\n $url = $this->query_builder->getUrl();\n\n // @todo: does this make sense to be in a separate class? Anyway, this shoudl\n // be somehow refactored because it is hard to replace or overwrite it.\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n $response = curl_exec($curl);\n // @todo: very important: check the curl errors here.\n\n return $this->parser->parse($response);\n }", "public function process()\n {\n \t$client = $this->client->getClient();\n\n \ttry {\n $response = $client->get($this->buildUrl());\n return new ResponseJson((string)$response->getBody(), true);\n } catch (RequestException $e) {\n return new ResponseJson((string)$e->getResponse()->getBody(), false);\n }\n }", "abstract function do_api_request();", "public function getHotels(){\n\n if (isset($_GET) && !empty($_GET)) {\n\n $validUrl = $this->targetUrl.$this->getParameters(); // create full Url (target Url string + parameters String) \n\n $response = $this->getResponse($validUrl); //call function that sent request and return response & save the result in $response .\n\n return $this->responseHandler($response); // call function that checking the response ,and return array of offers .\n\n }else{\n return false; \n }\n }", "public function requestFromApi() \n {\n $clientApi = new \\GuzzleHttp\\Client([\n \"base_uri\" => \"https://services.mysublime.net/st4ts/data/get/type/\",\n \"timeout\" => 4.0]);\n \n try { \n $response = $clientApi->request(\"GET\", $this->_urlEndPoint);\n if ($response->getStatusCode() == \"200\") {\n $body = $response->getBody();\n $this->_jsonRequestedArr = json_decode($body); \n }\n else { \n $this->_error .= \"Bad status code: . \" . $response->getStatusCode(); \n }\n }\n catch (Exception $exc) {\n $this->_error .= $exc->getMessage();\n }\n\n }", "function tfnm_get_data( $args ){\n\t$default_args = array(\n\t\t'location' => array(\n\t\t\t'latitude' => 42.360081,\n\t\t\t'longitude' => -71.058884\n\t\t),\n\t\t'categories' => ''\n\t);\n\n\t$args = wp_parse_args( $args, $default_args );\n\n\t// Get API key from settings area of plugin\n $api_key = get_option( 'tfnm_options' )[ 'api_key' ];\n\n\t/**\n\t* First check:\n\t* - Making sure api_key is set for authentication into API\n\t* - Making sure location is set for query of businesses in area\n\t* - Making sure category parameter is set to allow for customization of query for type of business\n\t*/\n\tif( empty( $api_key ) || empty( $args['location'] ) || empty( $args['categories'] ) ){\n\t\treturn 'There was a configuration error. Please contact the adminstrator.';\n\t}\n\n\t// We're clear, set up the call.\n $api_url = 'https://api.yelp.com/v3/businesses/search?latitude=' . $args['location']['latitude'] . '&longitude=' . $args['location']['longitude'] . '&limit=5&categories=' . $args['categories'];\n\n\t$response = tfnm_call_api( $api_key, $api_url );\n\n\tif( !empty( $response->businesses ) ){\n\t\treturn $response->businesses;\n\t} elseif( is_string( $response ) ){\n\t\t// This is here to print location error messaging.\n\t\treturn $response;\n\t}\n\n\t// Catch all. Something didn't work.\n\treturn false;\n}", "function getResponse();", "function getResponse();", "public function request(){\n\n $url = 'https://www.amazon.com/ap/oa?client_id=' . \n urlencode($this->strategy['client_id']) . \n '&scope=' . urlencode($this->strategy['scope']) . \n '&response_type=code&redirect_uri=' . \n urlencode($this->strategy['redirect_uri']);\n\n header('Location: ' . $url);\n\t}", "function polizeipresse_search_office_callback() {\r\n\r\n\t$result = array();\r\n\r\n\t$terms = trim($_POST['terms']);\r\n\r\n $api_key = polizeipresse_get_option(POLIZEIPRESSE_API_KEY);\r\n\tif (empty($api_key)) {\r\n\t\t// If api key is not in database, use api_key from request\r\n\t\t$api_key = trim($_POST['api_key']);\r\n\t};\r\n\r\n\tif (!empty ($terms) && !empty ($api_key)) {\r\n\t\trequire_once(dirname(__FILE__) . '/Presseportal.class.php');\r\n\t $pp = new Presseportal($api_key, 'de');\r\n\t $pp->format = 'xml';\r\n\t $pp->limit = '30';\r\n\r\n\t\t$response = $pp->search_office($terms);\r\n\r\n\t\tif((!$response->error) && ($response->offices)) {\r\n\t\t\tforeach($response->offices AS $office) {\r\n\t\t\t\t$result[] = array('name' => $office->name, 'id' => $office->id);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// Empty result\r\n\t\t}\r\n\t}\r\n\r\n\t// Return reponse\r\n\techo json_encode($result);\r\n\r\n\t// this is required to return a proper result\r\n\tdie();\r\n}", "function get_cities()\n{\n $url = set_url('cities');\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}", "public function requestData() {\n\t\t// Set up cURL \n\t\t$curl = curl_init($this->query); \n\t\tcurl_setopt($curl, CURLOPT_POST, false); \n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\t$response = curl_exec($curl);\n\t\tcurl_close($curl);\n\t\t\t\n\t\treturn $this->parseAPIResponse($response);\n\t}", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function execute(){\n try {\n $request = $this->getRestClient();\n $raw_response = $request->request();\n } catch (Zend_Http_Client_Exception $e) {\n Mage::helper('unbxd_recommendation')->log(Zend_Log::ERR,\n sprintf($this->getUrl() .\" failed because HTTP error: %s\", $e->getMessage()));\n return Mage::getModel('unbxd_recommendation/api_response')\n ->setErrorMessage(Unbxd_Recommendation_Model_Api_Response::SERVER_ERR);\n }\n return Mage::getModel(\"unbxd_recommendation/api_response\")\n ->setJsonResponse($this->isJsonResponse())\n ->setResponse($raw_response, $this->getUrl());\n }", "protected function locationsGetRequest()\n {\n\n $resourcePath = '/locations/';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('api_token');\n if ($apiKey !== null) {\n $queryParams['api_token'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function get_city($query,$type)\r\n{\r\nrequire_once 'REST_Ongkir.php';\r\n \r\n $rest = new REST_Ongkir(array(\r\n 'server' =&amp;gt; 'http://api.ongkir.info/'\r\n ));\r\n \r\n//ganti API-Key dibawah ini sesuai dengan API Key yang anda peroleh setalah mendaftar di ongkir.info\r\n $result = $rest-&amp;gt;post('city/list', array(\r\n 'query' =&amp;gt; $query,\r\n 'type' =&amp;gt; $type,\r\n 'courier' =&amp;gt; 'jne',\r\n 'API-Key' =&amp;gt; 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456' ), 'JSON');\r\n \r\n try\r\n {\r\n $status = $result['status'];\r\n \r\n // Handling the data\r\n if ($status-&amp;gt;code == 0)\r\n {\r\n return $cities = $result['cities'];\r\n //print_r($cities);\r\n //foreach ($cities-&amp;gt;item as $item)\r\n //{\r\n //echo 'Kota: ' . $item . '&amp;lt;br /&amp;gt;';\r\n // }\r\n }\r\n else\r\n {\r\n echo 'Tidak ditemukan kota yang diawali &amp;quot;band&amp;quot;';\r\n }\r\n \r\n }\r\n catch (Exception $e)\r\n {\r\n echo 'Processing error.';\r\n }\r\n}", "public function index()\n {\n try {\n $client = new Client;\n $request = $client->request('GET', env('API_URL') . '/api/shipments', [\n 'headers' => [\n 'Content-type' => 'application/json',\n 'Accept' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->token_f(),\n ],\n ]);\n // $response = $http->get(env('API_URL').'/api/getUsers');\n return $response = $request->getBody()->getContents();\n } catch (\\Exception $e) {\n\n \\Log::error($e->getMessage() . ' ' . $e->getLine() . ' ' . $e->getFile());\n return $e->getMessage() . ' ' . $e->getLine() . ' ' . $e->getFile();\n }\n }", "public function offers_get()\n\t{\n $token = $_SERVER['HTTP_TOKEN'];\n $data = array(\n 'status' => 0,\n 'code' => -1,\n 'msg' => 'Bad Request',\n 'data' => null\n );\n if($this->checkToken($token))\n {\n $offers = $this->Api_model->getOffers();\n if (isset($offers)) {\n $data = array(\n 'status' => 1,\n 'code' => 1,\n 'msg' => 'success',\n 'data' => $offers\n );\n }else{\n $data = array(\n 'status' => 1,\n 'code' => 1,\n 'msg' => 'success',\n 'data' => null\n );\n }\n }else\n {\n $data['msg'] = 'Request Unknown or Bad Request';\n }\n $this->response($data, REST_Controller::HTTP_OK);\n\t}", "public function index()\n {\n $client = new Client(['base_uri' => 'http://127.0.0.1:8000/api/skorpoint']);\n $request = $client->request('GET');\n // $response = json_decode($request->getBody());\n // echo $response[0]->id;\n $response = $request->getBody();\n return $response;\n }", "public function api(SearchRequest $request)\n\t{\n\t\t$lat = $request->input('lat');\n\t\t$lng = $request->input('lng');\n\t\t$count = $request->input('count');\n\t\t\n\t\t$settings = Config::get('twitter');\n\n\t\t$url = 'https://api.twitter.com/1.1/search/tweets.json';\n\t\t$getfield = \"?q=&geocode=$lat,$lng,50km&count=$count\";\n\t\t$requestMethod = 'GET';\n\t\t$twitter = new TwitterAPIExchange($settings);\n\t\t \n\t\t$api_response = $twitter ->setGetfield($getfield)\n\t\t ->buildOauth($url, $requestMethod)\n\t\t ->performRequest();\n\t\t \n\t\theader('Content-Type: application/json');\n\t\t//return response()->json( $api_response );\n\t\techo $api_response;\n\t}", "function http($url, $post_data = null) {\n\t\t$ch = curl_init ();\n\t\tif (defined ( \"CURL_CA_BUNDLE_PATH\" ))\n\t\t\tcurl_setopt ( $ch, CURLOPT_CAINFO, CURL_CA_BUNDLE_PATH );\n\t\tcurl_setopt ( $ch, CURLOPT_URL, $url );\n\t\tcurl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 30 );\n\t\tcurl_setopt ( $ch, CURLOPT_TIMEOUT, 30 );\n\t\tcurl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );\n\t\t//////////////////////////////////////////////////\n\t\t///// Set to 1 to verify Hots SSL Cert ///////\n\t\t//////////////////////////////////////////////////\n\t\tcurl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, 0 );\n\t\tif (isset ( $post_data )) {\n\t\t\tcurl_setopt ( $ch, CURLOPT_POST, 1 );\n\t\t\tcurl_setopt ( $ch, CURLOPT_POSTFIELDS, $post_data );\n\t\t}\n\t\t$response = curl_exec ( $ch );\n\t\t$this->http_status = curl_getinfo ( $ch, CURLINFO_HTTP_CODE );\n\t\t$this->last_api_call = $url;\n\t\tcurl_close ( $ch );\n\t\tif(empty($response)) {\n\t\t\treturn 'WP-API might be down or unresponsive. Please go to http://flocks.biz and check if the main website is working. Send us an email to [email protected] in case you have more doubts.';\n\t\t}\n\t\tif(preg_match(\"/request\\-token/i\",$response) || preg_match(\"/access\\-token/i\",$response)) {\n\t\t\t//echo \"<br/><br/>\".preg_replace(array(\"/.*oauth\\_version\\=1\\.0/i\"),array(\"\"),urldecode($response)).\"<br/><br/>\";\n\t\t\treturn preg_replace(array(\"/.*oauth\\_version\\=1\\.0/i\"),array(\"\"),urldecode($response));\n\t\t} else {\n\t\t\t//echo \"<br/><br/>\".$response.\"<br/><br/>\";\n\t\t\treturn $response;\n\t\t}\n\t}", "public function getme(){\n return $this->make_http_request(__FUNCTION__);\n }", "public static function makeRequest($endPoint, $apiKey, $timeout = 5) {\n //Prepare cURL request\n $curl = curl_init();\n //Set URL\n curl_setopt($curl, CURLOPT_URL, static::baseURL . $endPoint);\n //Return response as a String instead of outputting to a screen\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_CONNECTTIMEOUT ,0); \n curl_setopt($curl, CURLOPT_TIMEOUT, $timeout);\n //Prepare Request Header\n $headers = array();\n $headers[] = 'Authorization: Bearer ' . $apiKey;\n //Add Request Header\n curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n\n //Perform request\n $response = curl_exec($curl);\n //HTTP Status\n $http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n //Close request connection\n curl_close($curl);\n //Check if request was successful\n if($http_status == 200){\n //Decode Json response\n $json = json_decode($response, true);\n\n //Check if request was successful\n if (isset($json[\"text\"]) && $json[\"text\"] == \"endpoint requires authentication\") {\n throw new GW2APIKeyException('endpoint requires authentication', $apiKey, $http_status, $response, 1);\n\n //Known to be set if endpoint can't be found\n } elseif(isset($json[\"error\"])){\n throw new GW2APIKeyException($json[\"error\"], $apiKey, $response, $http_status, 2);\n }\n } else {\n throw new GW2APIKeyException('HTTP Code: '.$http_status, $apiKey, $response, $http_status, -1);\n }\n \n $gw2ResponseEvent = new GW2ResponseEvent(-1, $json, $endPoint, $http_status);\n return $gw2ResponseEvent;\n }", "function owl_query($endpoint, $onturi, $query, $type) {\n $url = $endpoint . '?query=' . urlencode($query) . \n '&type=' . strtolower($type) .\n '&ontology=' . $onturi;\n //print $url;\n $request = curl_init($url);\n curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($request, CURLOPT_HTTPHEADER, array(\n 'Accept: application/json'\n ));\n\n $result = curl_exec($request);\n $info = curl_getinfo($request);\n\n // TODO: Reasonable error handling\n if($result === '' || $info['http_code'] != 200) {\n return;\n }\n \n curl_close($request);\n\n return $result;\n}", "public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}", "abstract function parse_api_response();", "public function apiGetRequest($endpoint);", "function GetAPIResponse($url, $jsonbody) {\n\t$ch = curl_init();\n\tcurl_setopt($ch,CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); \n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT, 10);\n\tcurl_setopt($ch,CURLOPT_TIMEOUT, 20);\n\n\tif($jsonbody) {\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $jsonbody);\n\t}\n\n\t$response = curl_exec($ch);\n\tcurl_close ($ch);\n\treturn $response;\n}", "function get_districts($id)\n{\n $url = set_url('disctricts');\n $url .= '?city_id=' . $id;\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}", "public function getResponse() {}", "public function getResponse() {}", "public function response();", "public function index()\n {\n // Get access token via oauth2-yelp library\n return view('component.index');\n }", "public function api_call($query) {\n $query = $this->sanitize_str($query); \n $url = \"https://superheroapi.com/api/1180364012471833/search/\" . $query;\n \n if (!file_get_contents($url)) {\n $err = array(\n \"response\" => \"error\",\n \"error\" => \"Couldn't connect to API\",\n );\n \n $res = json_encode($err);\n }\n else {\n $res = file_get_contents($url);\n }\n \n return $res;\n }", "public function request_token() : object\n {\n $this->parameters = [\n 'headers' => [\n 'Content-Type' => 'application/x-www-form-urlencoded',\n 'User-Agent' => $this->config['DISCOGS_USER_AGENT'],\n 'Authorization' => 'OAuth oauth_consumer_key=' . $this->config['DISCOGS_CONSUMER_KEY']\n . ',oauth_nonce=' . time() . ',oauth_signature=' . $this->config['DISCOGS_CONSUMER_SECRET']\n . '&,oauth_signature_method=PLAINTEXT,oauth_timestamp=' . time() . ',oauth_callback='\n . $this->config['OAUTH_CALLBACK'],\n ],\n ];\n\n return $this->response('GET', \"/oauth/request_token\");\n }", "private function getData(){\n if($this->type == \"auto\"){\n \n \n $result = $this->get_from_link( self::AUTO_STRING.http_build_query($this->data));\n $array_names = json_decode($result, true); \n //var_dump($array_names); \n if(!isset($array_names)){\n $this->serverSideError(); \n }\n $ans = array(); \n \n foreach($array_names[\"predictions\"] as $key => $value){\n array_push($ans, $value[\"description\"]); \n }\n \n $response['status_code_header'] = 'HTTP/1.1 200 OK'; \n $response['body'] = json_encode($ans); \n \n return $response; \n }\n\n else if($this->type == \"geocode\"){\n \n\n //echo() $this->data); \n $result = $this->get_from_link( self::GEOCODE_STRING.http_build_query($this->data));\n // echo $result; \n $array = json_decode($result, true); \n if(!isset($array)){\n $this->serverSideError(); \n }\n \n $response['status_code_header'] = 'HTTP/1.1 200 OK'; \n $response['body'] = json_encode( $array[\"results\"][0][\"geometry\"][\"location\"]); \n \n return $response; \n }\n }", "function flickr_api($url,$params,$response_tag=\"\",$method=\"GET\")\n\t{\n\n\t# Build query and sign it\n\t$url.=\"?\" . flickr_sign($params);\n\t\n\t# Run query\n\t\n\t$opts = array(\n\t 'http'=>array(\n\t 'method'=>$method\n\t )\n\t);\n\n\t$context = stream_context_create($opts);\n\n\t\n\t$xml=file_get_contents($url,false,$context);\n\tglobal $last_xml;$last_xml=$xml;\n\t\n\tif ($response_tag==\"\")\n\t\t{\n\t\treturn true;\n\t\t}\n\telse\n\t\t{\n\t\treturn flickr_get_response_tag($xml,$response_tag);\n\t\t}\n\t}", "public function call()\n\t{\n\t\tcall_user_func_array(array($this->client, 'request'), func_get_args());\n\n\t\treturn $this->client->getResponse();\n\t}", "public function getData(){\n\t\t$url = $this->host . \"/rest/v1/leads.json?access_token=\" . $this->getToken()\n\t\t\t\t\t\t. \"&filterType=\" . $this->filterType . \"&filterValues=\" . $this::csvString($this->filterValues);\n\t\t\n\t\tif (isset($this->batchSize)){\n\t\t\t$url = $url . \"&batchSize=\" . $this->batchSize;\n\t\t}\n\t\tif (isset($this->nextPageToken)){\n\t\t\t$url = $url . \"&nextPageToken=\" . $this->nextPageToken;\n\t\t}\n\t\tif(isset($this->fields)){\n\t\t\t$url = $url . \"&fields=\" . $this::csvString($this->fields);\n\t\t}\n\t\t\n\t\t//debug\n\t\t//echo '<p>url after = ' . $url . '</p>';\n\t\t\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('accept: application/json',));\n\t\t$response = curl_exec($ch);\n\t\treturn $response;\n\t}", "public function response ();", "public function helloworld_get() {\n $users = [\n ['id' => 0, 'name' => 'John', 'email' => '[email protected]'],\n ['id' => 1, 'name' => 'Jim', 'email' => '[email protected]'],\n ];\n\n\t\t// Set the response and exit\n\t\t$this->response( $users, 200 );\n\t}", "function getrequest($url){\n\t// gets cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t\tCURLOPT_RETURNTRANSFER => 1,\n\t\tCURLOPT_URL => $url,\n\t\tCURLOPT_USERAGENT => 'BenGreenlineApp'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\t//returns the json encoded response\n\t\n\t\n\t$httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\tif($httpCode == 404) {\n $resp[0]= \"MetroTransit API gave 404\" ;\n\t};\n\t\n\t\n\treturn json_decode($resp);\n}", "function request()\r\n {\r\n $searchstring = array();\r\n if ( $this->street )\r\n $searchstring[] = $this->street;\r\n if ( $this->zip and $this->city)\r\n $searchstring[] = $this->zip . ' ' . $this->city;\r\n elseif ( $this->zip )\r\n $searchstring[] = $this->zip;\r\n elseif ( $this->city )\r\n $searchstring[] = $this->city;\r\n if ( $this->state )\r\n $searchstring[] = $this->state;\r\n if ( $this->country )\r\n $searchstring[] = $this->country;\r\n\r\n $searchstring = implode( ', ', $searchstring );\r\n // ini values\r\n $gisini = eZINI::instance( \"gis.ini\" ); \r\n $key = $gisini->variable( \"Google\", \"ApplicationID\" );\r\n $url = $gisini->variable( \"Google\", \"Url\" );\r\n \r\n $requestUrl= $url.\"?q=\".urlencode($searchstring).\"&key=$key&output=xml\"; \r\n\r\n eZDebug::writeDebug( $requestUrl, 'Google GeoCoder Request');\r\n //request the google kml result\r\n $kml = file ( $requestUrl );\r\n\r\n if ( !empty($kml[0]) )\r\n {\r\n eZDebug::writeDebug( $kml[0], 'Google GeoCoder Response');\r\n $xmldomxml = new eZXML();\r\n $xmldom = $xmldomxml->domTree($kml[0]);\r\n\r\n //API Manual: http://www.google.com/apis/maps/documentation/reference.html#GGeoStatusCode\r\n $dom_statuscode = $xmldom->elementsByName( \"code\" );\r\n $dom_statuscode = $dom_statuscode[0]->textContent(); \r\n\r\n if ( $dom_statuscode==\"200\" ) \r\n {\r\n\r\n //API Manual: http://www.google.com/apis/maps/documentation/reference.html#GGeoAddressAccuracy\r\n $dom_adressdetails = $xmldom->elementsByName( \"AddressDetails\" ); \r\n $dom_accuracy = $dom_adressdetails[0]->get_attribute( \"Accuracy\" );\r\n if ( in_array( $dom_accuracy, array( 8,7,6,5 ) ) )\r\n {\r\n $this->accuracy = 'GeoCoder::ACCURACY_STREET';\r\n }\r\n elseif ( in_array( $dom_accuracy, array( 4 ) ) )\r\n {\r\n $this->accuracy = 'GeoCoder::ACCURACY_CITY';\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n if ($xmldom->elementsByName( \"ThoroughfareName\" ))\r\n {\r\n $dom_street= $xmldom->elementsByName( \"ThoroughfareName\" );\r\n $dom_street = $dom_street[0]->textContent(); \r\n }\r\n\r\n if ($xmldom->elementsByName( \"PostalCodeNumber\" ))\r\n {\r\n $dom_zip= $xmldom->elementsByName( \"PostalCodeNumber\" );\r\n $dom_zip = $dom_zip[0]->textContent(); \r\n }\r\n \r\n if ($xmldom->elementsByName( \"LocalityName\" ))\r\n {\r\n $dom_city = $xmldom->elementsByName( \"LocalityName\" );\r\n $dom_city = $dom_city[0]->textContent(); \r\n }\r\n\r\n if ($xmldom->elementsByName( \"AdministrativeAreaName\" ))\r\n {\r\n $dom_state = $xmldom->elementsByName( \"AdministrativeAreaName\" );\r\n $dom_state = $dom_state[0]->textContent(); \r\n }\r\n if ($xmldom->elementsByName( \"CountryNameCode\" ))\r\n {\r\n $dom_country = $xmldom->elementsByName( \"CountryNameCode\" );\r\n $dom_country = $dom_country[0]->textContent();\r\n }\r\n \r\n\r\n $dom_point = $xmldom->elementsByName( \"coordinates\" );\r\n $dom_point = $dom_point[0]->textContent();\r\n\r\n $dom_point = explode(\",\", $dom_point);\r\n $dom_long = $dom_point[0];\r\n $dom_lat = $dom_point[1];\r\n\r\n // Map values to object\r\n $this->accuracy = $dom_accuracy;\r\n $this->street = $dom_street;\r\n $this->zip = $dom_zip;\r\n $this->city = $dom_city;\r\n $this->state = $dom_state;\r\n $this->country = $dom_country;\r\n $this->longitude = $dom_long;\r\n $this->latitude = $dom_lat;\r\n $this->phi = deg2rad($dom_long);\r\n $this->theta = deg2rad($dom_lat); \r\n return true; \r\n }\r\n }\r\n else\r\n {\r\n return false;\r\n } \r\n }", "function executeRequest() {\n\n\t\t// curl general\n\t\t$curl_options = [\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLOPT_SSL_VERIFYPEER => true,\n\t\t\tCURLOPT_CUSTOMREQUEST => $this->_requestType\n\t\t];\n\n\t\t// set to post\n\t\tif($this->_requestType == 'POST') {\n\t\t\t$curl_options[CURLOPT_POST] = true;\n\t\t}\n\n\t\t// build url and append query params\n\t\t$url = $this->url($this->_url);\n\t\t$this->_params[$this->_oauth2->getAccessTokenName()] = $this->_oauth2->getAccessToken();\n\t\tif(count($this->_params) > 0) {\n\t\t\t$url->setQuery($this->_params);\n\t\t}\n\t\t$curl_options[CURLOPT_URL] = $url->val();\n\n\t\t// check request headers\n\t\tif(count($this->_headers) > 0) {\n\t\t\t$header = [];\n\t\t\tforeach ($this->_headers as $key => $parsed_urlvalue) {\n\t\t\t\t$header[] = \"$key: $parsed_urlvalue\";\n\t\t\t}\n\t\t\t$curl_options[CURLOPT_HTTPHEADER] = $header;\n\t\t}\n\n\t\t// init curl\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, $curl_options);\n\n\t\t// https handling\n\t\tif($this->_certificateFile != '') {\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\t\t\tcurl_setopt($ch, CURLOPT_CAINFO, $this->_certificateFile);\n\t\t} else {\n\t\t\t// bypass ssl verification\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\t}\n\n\t\t// execute the curl request\n\t\t$result = curl_exec($ch);\n\t\t$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\t\t$content_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);\n\t\tif($curl_error = curl_error($ch)) {\n\t\t\tthrow new OAuth2Exception($curl_error);\n\t\t} else {\n\t\t\t$json_decode = $this->jsonDecode($result, true);\n\t\t}\n\t\tcurl_close($ch);\n\n\t\treturn [\n\t\t\t'result' => (null === $json_decode) ? $result : $json_decode,\n\t\t\t'code' => $http_code,\n\t\t\t'content_type' => $content_type\n\t\t];\n\t}", "public function getResponse($response) {\r\n\r\n\r\n }", "public function request() {\r\n\t\t$this->verbose('protocol', $this->protocol);\r\n\t\t$this->verbose('method', $this->method);\r\n\t\t$this->verbose('host', $this->host);\r\n\t\t$this->verbose('path', $this->path);\r\n\t\t$this->verbose('query', $this->query);\r\n\t\t$this->verbose('headers', $this->headers);\r\n\t\t$this->verbose('body', $this->body);\r\n\t\t$this->verbose('timeout', $this->timeout);\r\n\r\n\t\t$this->addQueryToPath();\r\n\t\t$this->verbose('path + query', $this->path);\r\n\t\t$this->cleanHost();\r\n\t\t$this->verbose('cleanHost', $this->host);\r\n\r\n\t\t$url = $this->protocol . '://' . $this->host . $this->path;\r\n\t\t$this->verbose('url', $url);\r\n\r\n\t\t$this->headers['Authorization'] = $this->makeAuthHeader();\r\n\r\n\r\n\t\tforeach ($this->headers as $header_key => $header_value) {\r\n\t\t\t$header_array[] = $header_key . \":\" . $header_value;\r\n\t\t}\r\n\r\n\t\t$ch = curl_init();\r\n\t\t$options = array(\r\n\t\t\tCURLOPT_URL => $url,\r\n\t\t\tCURLOPT_RETURNTRANSFER => 1,\r\n\t\t\tCURLOPT_CUSTOMREQUEST => $this->method,\r\n\t\t\tCURLOPT_POSTFIELDS => $this->body,\r\n\t\t\tCURLOPT_HEADER => false,\r\n\t\t\tCURLINFO_HEADER_OUT => true,\r\n\t\t\tCURLOPT_HTTPHEADER => $header_array,\r\n\t\t\tCURLOPT_TIMEOUT => $this->timeout\r\n\t\t);\r\n\t\tcurl_setopt_array($ch, $options);\r\n\r\n\t\t$this->verbose('body at exec', $this->body);\r\n\t\t$response_body = curl_exec($ch);\r\n\t\t$response_error = curl_error($ch);\r\n\t\t$response_headers = curl_getinfo($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$response['error'] = $response_error;\r\n\t\t$response['body'] = $response_body;\r\n\t\t$response['header'] = $response_headers;\r\n\t\treturn $response;\r\n\t}", "private function GetData($end_point, $params = null){\n /**\n * if $params not array make it array and add api key to array\n * else add api key to array directly\n **/\n if(!is_array($params))\n $params = [];\n\n $params['api_key'] = env('MOVIES_API_KEY');\n $query = http_build_query($params);\n $uri = $this->api_link . $end_point . \"?\". $query;\n\n $cURLConnection = curl_init();\n curl_setopt($cURLConnection, CURLOPT_URL, $uri);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $response = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n return $jsonArrayResponse = json_decode($response, true);\n\n }", "public function geocode()\n {\n try\n {\n if (is_null($this->httpAdapter))\n {\n $this->httpAdapter = new sfYahooAdapterHttpStream();\n }\n\n $this->httpAdapter->setParameters($this->parameters);\n\n $this->rawResponse = $this->httpAdapter->handle();\n\n return $this->getResults($this->rawResponse);\n }\n catch (Exception $e)\n {\n throw $e;\n }\n }", "abstract public function response();", "function doApiRequest($email, $name, $location, $phone, $category){\n try{\n #!important!\n $eamil = get_value($email);\n $final = 0;\n #get api data from hosted server\n $request = file_get_contents(\"http://34.212.19.150:8000/request/users\");\n #parse api data to json_decoder \n $json_response = json_decode($request);\n #create array to hold api data \n $response_array = array();\n #split fetched data from api for array\n foreach ($json_response->data as $response ) {\n #add email addresses to response_array \n array_push($response_array, $response->email);\n }\n #check if value exist in fetched api array\n if(in_array($email, $response_array)){\n #add free_lancer to database\n $addFreeLancer = doAddFreeLancer($name, $email, $location, $phone, $category);\n #fetch inserted data from parameters \n $insertedData = array('email' => $email ,'name' => $name,'location' => $location,'phone' => $phone,\n 'category' => $category);\n #send reponses \n $final = api_response(true, $insertedData, $addFreeLancer);\n }else{\n $final = api_response(false, null, \"not found in api\");\n }\n #returned data to user\n return $final;\n \n }catch(Exception $ex){\n return $ex->getMessage();\n }\n}", "function callTwitterApi()\n{\n\t// code for retrieve data from Twitter\n\treturn twitterData;\n}", "public function run() {\n // straight to the country search endpoint!\n $endpoint = New CountrySearch();\n\n return $endpoint->response();\n }", "function get(Request &$request, Response &$response);", "function __apiCall($url, $post_parameters = FALSE) {\n \n \t// Initialize the cURL session\n\t $curl_session = curl_init();\n\t \t\n\t // Set the URL of api call\n\t\tcurl_setopt($curl_session, CURLOPT_URL, $url);\n\t\t \n\t\t// If there are post fields add them to the call\n\t\tif($post_parameters !== FALSE) {\n\t\t\tcurl_setopt ($curl_session, CURLOPT_POSTFIELDS, $post_parameters);\n\t\t}\n\t\t \n\t\t// Return the curl results to a variable\n\t curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, 1);\n\t\t \n\t // Execute the cURL session\n\t $contents = curl_exec ($curl_session);\n\t\t \n\t\t// Close cURL session\n\t\tcurl_close ($curl_session);\n\t\t \n\t\t// Return the response\n\t\treturn json_decode($contents);\n \n }", "private function executeRequest()\n {\n $response = \\GoogleMaps\\GoogleMaps::load('geocoding')\n ->setParam([\n 'address' => $this->place->complete_address\n ])\n ->get();\n\n // sometimes, Google's not entirely sure and will send multiple, but first = best\n return collect(json_decode($response)->results)->first();\n }", "public function postData(){\n\t\t$url = $this->host . \"/rest/v1/leads.json?access_token=\" . $this->getToken();\n\t\t$ch = curl_init($url);\n\t\t$requestBody = $this->bodyBuilder();\n\t\t//debug\n\t\t//print_r($requestBody);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('accept: application/json','Content-Type: application/json'));\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $requestBody);\n\t\tcurl_getinfo($ch);\n\t\t$response = curl_exec($ch);\n\t\treturn $response;\n\t}", "function call($postfields) {\r\n\t\t$postfields[\"username\"] = $this->api_user;\r\n\t\t$postfields[\"password\"] = md5($this->api_pass);\r\n\r\n\t\t// Make curl request\r\n\t\t$ch = curl_init();\r\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->api_url);\r\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\r\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 100);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);\r\n\t\t$data = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t// Format response\r\n\t\t$data = explode(\";\",$data);\r\n\t\tforeach ($data AS $temp) {\r\n\t\t $temp = explode(\"=\",$temp);\r\n\t\t $key = trim($temp[0]);\r\n\t\t $value = trim($temp[1]);\r\n\t\t $results[$key] = $value;\r\n\t\t}\r\n\t\t\r\n\t\t// Returns array with response\r\n\t\treturn $results;\r\n\t}", "function getProducts() {\n\techo \"Getting Products </br>\";\n\t$response = getRequest('/api/product');\n\tprintInfo($response);\n}", "public function ExecRequest($url, $access_token, $get_params) {\r\n // Create request string.\r\n // $full_url = http_build_query($url, $get_params);\r\n\t//print $url . $get_params; die;\r\n $r = $this->InitCurl($url);\r\n \r\n curl_setopt($r, CURLOPT_HTTPHEADER, array (\r\n \"Authorization: Basic \" . base64_encode($access_token)\r\n ));\r\n\t\t\r\n\t\tcurl_setopt($r, CURLOPT_POST, true);\r\n curl_setopt($r, CURLOPT_POSTFIELDS, $get_params);\r\n \r\n $response = curl_exec($r);\r\n if ($response == false) {\r\n die(\"curl_exec() failed. Error: \" . curl_error($r));\r\n }\r\n \r\n //Parse JSON return object.\r\n return json_decode($response); \r\n }", "function laserbear_get_all_people( $request ) {\n\t$data = array( 'sarah', 'jennifer', 'katie', 'johnicholas' );\n\t// END TODO TODO\n\n\treturn new WP_REST_Response( $data, 200 );\n}", "public function __invoke(): JsonLdResponse\n {\n return new JsonLdResponse(\n [\n '@context' => [\n '@vocab' => url(config('hydra.docs_url')),\n 'hydra' => 'http://www.w3.org/ns/hydra/core#',\n 'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',\n ],\n '@id' => url(config('hydra.docs_url')),\n '@type' => 'hydra:ApiDocumentation',\n Vocabulary::TITLE => config('hydra.title'),\n Vocabulary::DESCRIPTION => config('hydra.description'),\n 'hydra:entrypoint' => config('hydra.entrypoint'),\n 'hydra:supportedClass' => $this->classes->toJsonLd(),\n ]\n );\n }", "public function api()\n {\n $input = request('q');\n $tags = Tag::where('name', 'like', $input.'%')\n ->orWhere('name', 'like', '% '.$input.'%')->get(\n ['name AS text', 'id']\n )->toArray();\n\n if ($input != '')\n {\n return response()->json([\n 'results' => $tags\n ]);\n }\n else\n {\n return response()->json([\n 'results' => ''\n ]);\n }\n }", "private function _makeRequest($type)\n\t{\n\t\n\t\t$http = new Varien_Http_Adapter_Curl();\n\t\t$config = array('timeout' => 30);\n\t\t\n\t\t//Build URL from the \n\t\t$url = Wp_WhitePages_Model_Api::API_URL.'/'.$type.'/'.Wp_WhitePages_Model_Api::API_VERSION.'/'. $this->_requestQuery;\n\n\t\t//Magento logging\n\t\t$isLogsActive = Mage::getStoreConfig('dev/log/active');\n\t\tif($isLogsActive)\n\t\t{\n\t\t\t$this->wpDebug(\"Requests URL: \".$url);\n\t\t}\n\t\t//echo $url; die;\n\t\t\n\t\ttry \n\t\t{\n\t\t\t//Make Curl Request\n\t\t\t$http->write('GET',\t$url, '1.1');\n\t\t\t$this->_result = json_decode(Zend_Http_Response::extractBody($http->read()), true );\n\t\t\t\n\t\t\t//Check for Curl Error\n\t\t\tif($http->getErrno() != 0)\n\t\t\t{\n\t\t\t\tMage::throwException($http->getError(). ' error number '. $http->getErrno());\n\t\t\t}\n\t\t\t//Check for API result Errors\n\t\t\telseif(array_key_exists('errors',$this->_result))\n\t\t\t{\n\t\t\t\tMage::throwException($this->_result[\"errors\"][0]);\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $e) \n\t\t{\n\t\t \t$this->wpDebug($e->getMessage(), Zend_Log::ERR);\n\t\t\t$this->_hasError = true;\n\t\t}\n\t\t\n\t\t//Magento logging\n\t\tif($isLogsActive)\n\t\t{\n\t\t\t$this->wpDebug( \"Response Data: \".var_export($this->_result, true));\n\t\t}\n\t\t\n\t\treturn $this->_result;\n\t}", "public function get() {\n // $this->isAdmin();\n\n $data = \"This is a test\";\n\n $this->sendHeaders();\n \n $resBody = (object) array();\n $resBody->status = \"200\";\n $resBody->message = \"valid request\";\n $resBody->data = \"This is the data\";\n echo json_encode($resBody);\n\n }", "public function execute()\n {\n $httpClient = $this->getHttpClient();\n\n $httpRequest = $httpClient->post('/eps/crosssell/recommendations/' . $this->config->getAccountId() . '.do');\n $headers = $httpRequest->getHeaders();\n $httpRequest->addHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');\n $httpRequest->addHeader('User-Agent', 'Econda PHP SDK');\n\n $httpRequest->addPostFields($this->getHttpPostFields());\n $httpResponse = $httpRequest->send();\n\n if($httpResponse->isSuccessful()) {\n $responseData = $httpResponse->json();\n $this->response = $this->getResponseFromHttpResponse($responseData);\n }\n\n $this->lastHttpRequest = $httpRequest;\n \n return $this->response;\n }", "public function getResponse() {\n }", "function callRemitaApiGet($endPoint) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $endPoint);\n curl_setopt($ch, CURLOPT_ENCODING, \"\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_MAXREDIRS, 10);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Cache-Control: no-cache',\n 'Content-Type: application/json')\n );\n $output = curl_exec($ch);\n return $output;\n}", "public function search()\n {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $this->getUrl());\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);\n ob_start();\n curl_exec($ch);\n $response = ob_get_contents();\n ob_end_clean();\n\n curl_close($ch);\n\n return $response;\n }", "function api()\n {\n //get jokes\n $f_contents = file(\"controllers/jokes.txt\"); \n $line = $f_contents[rand(0, count($f_contents) - 1)];\n //explode line into array\n $line = explode(\"<>\", $line);\n $arr = array('Joke' => array('Opener' => $line[0], 'Punchline' => trim($line[1]), 'Processing Time' => process_time()));\n status(202); //returns HTTP status code of 202\n return json($arr);\n }", "public static function apiRequest($url){\n $handle = curl_init();\n curl_setopt($handle, CURLOPT_URL, $url);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, $url);\n curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, 5);\n\n $output = curl_exec($handle);\n $status = curl_getinfo($handle,CURLINFO_HTTP_CODE);\n curl_close($handle);\n\n if($status != 200){\n return json_encode(\"RESOURCE NOT FOUND\");\n }\n\n return $output;\n\n }", "public function getResponse()\n {\n }", "public function request( $request )\n {\n $request = $request->withHeader('ApiKey', $this->apikey);\n \n $result = $this->http_client->send($request); \n \n return json_decode($result->getBody(), true);\n }", "public function getResponse($input);", "private function GET() {\n global $_GET;\n $getData = array();\n foreach($_GET as $key => $value) {\n $getData[$key] = $value;\n }\n $this -> response[\"response\"] = $getData;\n return;\n }", "public function local() {\n\t\tif (defined('IS_DEV_INSTANCE') && IS_DEV_INSTANCE === true) {\n\t\t\tCakeLog::write('api.offers.local', print_r($this->request->query, true));\n\t\t}\n\t\telse {\n\t\t\tCakeLog::write('api.offers.local', $this->request->query);\n\t\t}\n\t\tif (!$this->authedUser()) {\n\t\t\treturn new CakeResponse(array(\n\t\t\t\t'status' => 400,\n\t\t\t\t'type' => 'json',\n\t\t\t\t'body' => json_encode(array(\n\t\t\t\t\t'message' => 'Invalid token'\n\t\t\t\t))\n\t\t\t));\n\t\t}\n\n\t\tApp::uses('HttpSocket', 'Network/Http');\n\t\t$HttpSocket = new HttpSocket(array(\n\t\t\t'timeout' => 15,\n\t\t\t'ssl_verify_host' => false // PHP does not seem to check SANs for CNs\n\t\t));\n\n\t\t$categories = array(\n\t\t\t'food-and-drink' => 'Restaurants & Bars',\n\t\t\t'events-and-activities' => 'Activities',\n\t\t\t'beauty-and-spas' => 'Beauty & Spa',\n\t\t\t'health-and-fitness' => 'Health & Fitness',\n\t\t\t'home-improvement' => 'Home Improvement',\n\t\t\t'local-services' => 'Local Services',\n\t\t\t'shopping' => 'Shopping',\n\t\t\t'automotive' => 'Automotive'\n\t\t);\n\n\t\t// string query\n\t\t$query_string = array(\n\t\t\t'country_code' => $this->authed_user['QueryProfile']['country'],\n\t\t\t'offset' => isset($this->request->query['offset']) ? $this->request->query['offset'] : '0',\n\t\t\t'limit' => isset($this->request->query['limit']) ? $this->request->query['limit'] : '10',\n\t\t\t'sid' => $this->authed_user['User']['id'],\n\t\t\t'tsToken' => 'US_AFF_0_200113_215093_0',\n\t\t\t'utm_campaign' => '200113',\n\t\t\t'utm_medium' => 'afl',\n\t\t\t'utm_source' => 'GPN',\n\t\t\t'filters' => isset($this->request->query['category']) ? 'category:'.$this->request->query['category']: ''\n\t\t);\n\n\t\tif ($this->authed_user['QueryProfile']['country'] == 'US') {\n\t\t\t$zip = $this->GeoZip->find('first', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'GeoZip.zipcode' => $this->authed_user['QueryProfile']['postal_code'],\n\t\t\t\t\t'GeoZip.country_code' => 'US'\n\t\t\t\t)\n\t\t\t));\n\t\t\tif ($zip && !empty($zip['GeoZip']['longitude']) && !empty($zip['GeoZip']['latitude'])) {\n\t\t\t\t$query_string['lat'] = $zip['GeoZip']['latitude'];\n\t\t\t\t$query_string['lng'] = $zip['GeoZip']['longitude'];\n\t\t\t}\n\t\t}\n\n\t\t$results = $HttpSocket->get('http://partner-api.groupon.com/deals.json', $query_string);\n\t\t$json = json_decode($results['body']);\n\n\t\t$deals = array();\n\t\tif (isset($json->deals)) {\n\t\t\tforeach ($json->deals as $deal) {\n\t\t\t\t$deals[] = array(\n\t\t\t\t\t'id' => $deal->id,\n\t\t\t\t\t'title' => $deal->title,\n\t\t\t\t\t'dealUrl' => $deal->dealUrl,\n\t\t\t\t\t'largeImageUrl' => $deal->largeImageUrl,\n\t\t\t\t\t'redemptionLocation' => $deal->redemptionLocation,\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'id' => $deal->options[0]->id,\n\t\t\t\t\t\t'price' => $deal->options[0]->price->amount,\n\t\t\t\t\t\t'value' => $deal->options[0]->value->amount\n\t\t\t\t\t),\n\t\t\t\t\t'merchant' => array(\n\t\t\t\t\t\t'name' => $deal->merchant->name\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$pagination = array();\n\t\tif (isset($json->pagination)) {\n\t\t\t$pagination = get_object_vars($json->pagination);\n\t\t}\n\n\t\treturn new CakeResponse(array(\n\t\t\t'status' => 200,\n\t\t\t'type' => 'json',\n\t\t\t'body' => json_encode(array(\n\t\t\t\t'deals' => $deals,\n\t\t\t\t'pagination' => $pagination\n\t\t\t))\n\t\t));\n\t}", "public function get($endpoint = '', $query=[], $body='');", "function doAPISearch($params) {\n global $searchUrl;\n\n $ch = curl_init(); // initialize curl handle\n curl_setopt($ch, CURLOPT_URL,$searchUrl . $params);\n curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable\n curl_setopt($ch, CURLOPT_TIMEOUT, 8); // times out after 4s\n curl_setopt($ch, CURLOPT_POST, 0); // set GET method\n // curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n // Retrieve result\n $result = curl_exec($ch);\n // TODO return error if error\n // $cerror = curl_error($ch);\n\n return $result;\n}", "public function execute() : OffersPageResponse {\n return $this->request($this->buildUrl());\n }", "function makeRequest($post_data, $raw_data = false) {\n\t\t\n\t\t\n\t\t$client = new Zend_Http_Client ( $this->api_url );\n\t\tif (isset ( $post_data ['headers'] )) {\n\t\t\t$headers = $post_data ['headers'];\n\t\t\t$client->setHeaders ( $headers );\n\t\t}\n\t\t\n\t\t$data = array();\n\t\tif (isset ( $post_data ['body'] )) {\n\t\t\t$data = $post_data ['body'];\t\n\t\t}\n\t\t\n\t\tif($raw_data) {\n\t\t\t$client->setRawData($data);\n\t\t} else {\n\t\t\t$client->setParameterPost ( $data );\n\t\t\t$client->setParameterPost ( 'action', $post_data ['action'] );\t\n\t\t}\n\t\t\n\t\t\n\t\t$result = $client->request ( Zend_Http_Client::POST );\n\t\t$response = json_decode ( $result->getBody (), true );\n\t\t\n\t\treturn $response;\n\t}" ]
[ "0.74889237", "0.74889237", "0.686563", "0.686298", "0.6639055", "0.65955085", "0.6579902", "0.6563045", "0.57659435", "0.5711262", "0.5644098", "0.5632624", "0.56119317", "0.5601516", "0.55937666", "0.55753005", "0.5567959", "0.54855937", "0.54855937", "0.54798555", "0.5452549", "0.542475", "0.54199064", "0.54156023", "0.54156023", "0.54156023", "0.54156023", "0.54156023", "0.54156023", "0.54156023", "0.54156023", "0.54156023", "0.54156023", "0.54156023", "0.54038286", "0.53852516", "0.53779876", "0.53539336", "0.5343075", "0.530836", "0.52650166", "0.52466255", "0.5215688", "0.5215301", "0.521046", "0.52054065", "0.5205088", "0.5204158", "0.51912135", "0.5190761", "0.51887894", "0.51887894", "0.5185421", "0.5178015", "0.51762503", "0.51753384", "0.5153888", "0.5152909", "0.51494175", "0.5144103", "0.51419306", "0.5141861", "0.51333815", "0.51319367", "0.5128795", "0.512386", "0.509452", "0.50926316", "0.50809956", "0.50807256", "0.50781417", "0.50584435", "0.5054255", "0.5048185", "0.5044707", "0.50405824", "0.5033238", "0.5027482", "0.5024492", "0.50220644", "0.5021085", "0.5020356", "0.50202596", "0.5019819", "0.50141627", "0.5005262", "0.49987406", "0.49979374", "0.49931085", "0.49875605", "0.4985135", "0.49808332", "0.4974027", "0.49704993", "0.4967098", "0.49622712", "0.49596968", "0.49593642", "0.49592802", "0.49567604" ]
0.6908324
2
Query the Search API by a search term and location
function search($term, $location) { $url_params = array(); $url_params['term'] = $term; $url_params['location'] = $location; $url_params['limit'] = $GLOBALS['SEARCH_LIMIT']; return request($GLOBALS['API_HOST'], $GLOBALS['SEARCH_PATH'], $url_params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function search($term, $location, $price, $radius, $categories, $sort) {\n $url_params = array();\n \n $url_params['term'] = $term;\n $url_params['location'] = $location;\n $url_params['limit'] = $GLOBALS['SEARCH_LIMIT'];\n\t$url_params['open_now'] = true;\n $url_params['price'] = $price;\n $url_params['radius'] = $radius;\n $url_params['categories'] = $categories;\n $url_params['sort_by'] = $sort;\n \n return request($GLOBALS['API_HOST'], $GLOBALS['SEARCH_PATH'], $url_params);\n}", "public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}", "public function search($q);", "function query_api($term, $location) {\r\n $response = json_decode(search($term, $location));\r\n $business_id = $response->businesses[0]->id;\r\n /* \r\n print sprintf(\r\n \"%d local businesses found, querying business info for the top result \\\"%s\\\"\\n\\n <br>\",\r\n count($response->businesses),\r\n $business_id\r\n );\r\n */ \r\n $response = get_business($business_id);\r\n \r\n print sprintf(\"Result for business \\\"%s\\\" found:\\n\", $business_id);\r\n $pretty_response = json_encode(json_decode($response), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\r\n print \"$pretty_response\\n\";\r\n\r\n return json_decode($response, true);\r\n }", "public function search($query);", "public function searchByKeyword($query);", "public function search($city);", "public function search($term = null);", "function search() {\n\n /* Start building the query object. We hope to end up with something like:\n $reqeust = '{\n \"from\" : 0,\n \"size\": 10,\n \"query\" : {\n \"terms\" : {\n \"creator\" : [ \"card\" ]\n }\n },\n sort: {\n title: {\n order: \"desc\"\n }\n }\n }';\n */\n $request = array();\n\n // Users can query by specifying an url param like &filter=title:ender\n // TODO: We should allow for multiple filters.\n $key_and_val = explode(\":\", $this->get('GET.filter'));\n if (count($key_and_val) == 2 and !empty($key_and_val[0]) and !empty($key_and_val[1])) {\n $request['query']['query_string']['fields'] = array($key_and_val[0]);\n $request['query']['query_string']['query'] = '*' . $key_and_val[1] . '*';\n $request['query']['query_string']['default_operator'] = 'AND';\n } else {\n $request['query'] = array(\"match_all\" => new stdClass);\n }\n //$request['query']['query_string']['query'] = 'American FactFinder';\n // start parameter (elasticsearch calls this 'from')\n $incoming_start = $this->get('GET.start');\n if (!empty($incoming_start)) {\n $request['from'] = $this->get('GET.start');\n }\n \n // limit parameter (elasticsearch calls this 'size')\n $incoming_limit = $this->get('GET.limit');\n if (!empty($incoming_limit)) {\n $request['size'] = $this->get('GET.limit');\n }\n \n // sort parameter\n $incoming_sort = $this->get('GET.sort');\n $sort_field_and_dir = explode(\" \", $this->get('GET.sort'));\n if (count($sort_field_and_dir) == 2) {\n $request['sort'] = array($sort_field_and_dir[0] => array('order' => $sort_field_and_dir[1]));\n }\n \n // We now have our built request, let's jsonify it and send it to ES\n $jsoned_request = json_encode($request);\n \n $url = $this->get('ELASTICSEARCH_URL') . '_search';\n $ch = curl_init();\n $method = \"GET\";\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($method));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $jsoned_request);\n\n $results = curl_exec($ch);\n curl_close($ch);\n\n // We should have a response. Let's pull the docs out of it\n $cleaned_results = $this->get_docs_from_es_response(json_decode($results, True));\n // callback for jsonp requests\n $incoming_callback = $this->get('GET.callback');\n if (!empty($incoming_callback)) {\n $this->set('callback', $this->get('GET.callback'));\n }\n \n // We don't want dupes. Dedupe based on hollis_id\n //$deduped_docs = $this->dedupe_using_hollis_id($cleaned_results);\n \n // Hopefully we're deduping on intake\n $deduped_docs = $cleaned_results;\n \n $this->set('results', $deduped_docs);\n //$this->set('results', $cleaned_results);\n $path_to_template = 'api/templates/search_json.php';\n echo $this->render($path_to_template);\n }", "public function search( $request ) {\n\t\tif( $keyword = is_object($request) ? $request->requestVar('term') : $request ) {\n\t\t\t$geoLocations = GeoLocation::getByKeyword($keyword, 10);\n\t\t\t$response = array();\n\t\t\tforeach( $geoLocations->map('ID', 'getFullTitle') as $id => $label ) {\n\t\t\t\t$response[] = array(\n\t\t\t\t\t'id' => $id,\n\t\t\t\t\t'label' => $label\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$response = false;\n\t\t}\n\t\treturn json_encode($response);\n\t}", "public function search(){}", "public function findBySearchTerm($query, $term = '', $facetConfiguration = [], $searchConfiguration = []);", "public function search( $query, $wordSearch = true, $categorySearch = true, $exact = false, $sortType = 'instanceCount', $includePages = false, $offset = 0, $limit = 100 ){ return $this->APICallSub( '/ul', array( 'search' => $query, 'wordSearch' => $wordSearch, 'categorySearch' => $categorySearch, 'sortType' => $sortType, 'exact' => $exact, 'includePages' => $includePages, 'offset' => $offset, 'limit' => $limit ), \"Could not perform Ultralink search\" ); }", "public function search();", "public function search();", "public function searchByName($query);", "public function search(Query $query);", "public function search($search_term, $category = 0){\n\t\t\t$this->search_type = self::get_search_type($search_term);\n\t\t\t\n\t\t\t$long = 0;\n\t\t\t$lat = 0;\t\t\t\n\n\t\t\t//postcode?\n\t\t\tif($this->search_type == 'postcode'){\n\n\t\t\t\t//if its a partial postcode, padd it\n\t\t\t\t$clean_postcode = clean_postcode($search_term);\n\t\t\t\t$longlat = get_postcode_location($clean_postcode, 'UK');\n\n\t\t\t\tif($longlat != false){\n\t\t\t\t\t$long = $longlat[0];\n\t\t\t\t\t$lat = $longlat[1];\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//Update the stats table\n\t\t\t\ttableclass_stat::increment_stat(\"search.type.ukpostcode\");\n\t\t\t}\n\t\t\t\n\t\t\t//zipcode?\n\t\t\tif($this->search_type == 'zipcode'){\n\t\t\t\t$clean_postcode = trim($search_term);\n\t\t\t\t$longlat = get_postcode_location($clean_postcode, 'US');\n\t\t\t\tif($longlat == false){\n\t\t\t\t\tarray_push($this->warnings, \"A error occured when trying to find that zip code\");\n\t\t\t\t\ttrigger_error(\"Unable to get location for zipcode: \" . $search_term);\n\t\t\t\t}else{\n\t\t\t\t\t$long = $longlat[0];\n\t\t\t\t\t$lat = $longlat[1];\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Update the stats table\n\t\t\t\ttableclass_stat::increment_stat(\"search.type.zipcode\");\t\t\t\t\n\t\t\t}\n\t\t\t//long lat?\n\t\t\tif($this->search_type == 'longlat'){\n\n\t\t\t\t$split = split(\",\", trim($search_term));\n\t\t\t\t$long = $split[0];\n\t\t\t\t$lat = $split[1];\n\n\n\t\t\t\t//Update the stats table\n\t\t\t\ttableclass_stat::increment_stat(\"search.type.longlat\");\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//Do the search for groups directly covering this location\n\t\t\t$search = factory::create('search');\n\t\t\t$groups = $search->search('group', $this->add_category(array(\n\t\t\t\tarray('long_bottom_left', '<', $long),\n\t\t\t\tarray('long_top_right', '>', $long),\n\t\t\t\tarray('lat_bottom_left', '<', $lat),\n\t\t\t\tarray('lat_top_right', '>', $lat),\n\t\t\t\tarray('confirmed', '=', 1)\t\t\n\t\t\t\t), $category),\n\t\t\t\t'AND'\n\t\t\t);\n\t\t\t\n\t\t\t//Do another search with buffeering based on population density \n\t\t\t$gaze = factory::create('gaze');\n\t\t\t$radius_km = $gaze->get_radius_containing_population($long, $lat, POPULATION_THRESHOLD, MAX_KM_DISTANCE_BUFFER);\n\t\t\t\n\t\t\t//if that worked, do the other search\n\t\t\tif ($radius_km && $gaze->status !='service unavaliable' && !get_http_var('pointonly')) {\n\t\t\t\n\t\t\t\t//work out the buffered long / lat values\n\t\t\t\t$buffered_long = distance_to_longitude($radius_km);\n\t\t\t\t$buffered_lat = distance_to_latitude($radius_km);\n\n\t\t\t\t//make the bounding box\n\t\t\t\t$buffered_bottom_left_long = $long - $buffered_long;\n\t\t\t\t$buffered_bottom_left_lat = $lat - $buffered_lat;\n\t\t\t\t$buffered_top_right_long = $long + $buffered_long;\n\t\t\t\t$buffered_top_right_lat = $lat + $buffered_lat;\n\n\t\t\t\t//do the buffered searches (THIS IS REALY INEFFICANT BUT PEAR DATA OBJECTS DONT DO MIXED AND/OR SEARCHES)\n\t\t\t\t$groups_buffered = array();\n\t\t\t\t$groups_buffered1 = $search->search('group', $this->add_category(array(\n\t\t\t\t\tarray('long_bottom_left', '>', $buffered_bottom_left_long),\n\t\t\t\t\tarray('long_bottom_left', '<', $buffered_top_right_long),\n\t\t\t\t\tarray('lat_bottom_left', '>', $buffered_bottom_left_lat),\n\t\t\t\t\tarray('lat_bottom_left', '<', $buffered_top_right_lat),\n\t\t\t\t\tarray('confirmed', '=', 1)\t\t\t\t\n\t\t\t\t\t), $category),\n\t\t\t\t\t'AND'\n\t\t\t\t);\n\t\t\t\t$groups_buffered = array_merge($groups_buffered, $groups_buffered1);\n\t\t\t\t\n\t\t\t\t$groups_buffered2 = $search->search('group', $this->add_category(array(\n\t\t\t\t\tarray('long_top_right', '<', $buffered_top_right_long),\n\t\t\t\t\tarray('long_top_right', '>', $buffered_top_right_long),\n\t\t\t\t\tarray('lat_top_right', '>', $buffered_bottom_left_lat),\n\t\t\t\t\tarray('lat_top_right', '<', $buffered_top_right_lat),\n\t\t\t\t\tarray('confirmed', '=', 1)\t\t\t\t\n\t\t\t\t\t), $category),\n\t\t\t\t\t'AND'\n\t\t\t\t);\n\t\t\t\t$groups_buffered = array_merge($groups_buffered, $groups_buffered2);\n\t\t\t\t\n\t\t\t\t$groups_buffered3 = $search->search('group', $this->add_category(array(\n\t\t\t\t\tarray('long_bottom_left', '>', $buffered_bottom_left_long),\n\t\t\t\t\tarray('long_bottom_left', '<', $buffered_top_right_long),\n\t\t\t\t\tarray('lat_top_right', '>', $buffered_bottom_left_lat),\n\t\t\t\t\tarray('lat_top_right', '<', $buffered_top_right_lat),\n\t\t\t\t\tarray('confirmed', '=', 1)\t\t\t\t\n\t\t\t\t\t), $category),\n\t\t\t\t\t'AND'\n\t\t\t\t);\n\t\t\t\t$groups_buffered = array_merge($groups_buffered, $groups_buffered3);\n\t\t\t\t\n\t\t\t\t$groups_buffered4 = $search->search('group', $this->add_category(array(\n\t\t\t\t\tarray('long_top_right', '>', $buffered_bottom_left_long),\n\t\t\t\t\tarray('long_top_right', '<', $buffered_top_right_long),\n\t\t\t\t\tarray('lat_bottom_left', '>', $buffered_bottom_left_lat),\n\t\t\t\t\tarray('lat_bottom_left', '<', $buffered_top_right_lat),\n\t\t\t\t\tarray('confirmed', '=', 1)\t\t\t\t\n\t\t\t\t\t), $category),\n\t\t\t\t\t'AND'\n\t\t\t\t);\n\t\t\t\t$groups_buffered = array_merge($groups_buffered, $groups_buffered4);\n\n\t\t\t\t//if we have any buffered groups, add them in\n\t\t\t\tif($groups_buffered){\n\t\t\t\t\t$groups = array_merge($groups, $groups_buffered);\n\t\t\t\t\t\n\t\t\t\t\t//remove any duplicates (again should really be in the database call)\n\t\t\t\t\t$cleaned_groups = array();\n\t\t\t\t\tforeach ($groups as $group){\n\t\t\t\t\t\tif (!isset($cleaned_groups[$group->group_id]))\n\t\t\t\t\t\t\t$cleaned_groups[$group->group_id] = $group;\n\t\t\t\t\t}\n\t\t\t\t\t$groups = array_values($cleaned_groups);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tusort($groups, create_function('$a,$b',\n\t\t\t\t'\n\t\t\t\tif ($a->{category_id} < $b->{category_id}) return -1;\n\t\t\t\tif ($a->{category_id} > $b->{category_id}) return 1;\n\t\t\t\tif ($a->{zoom_level} < $b->{zoom_level}) return 1;\n\t\t\t\tif ($a->{zoom_level} > $b->{zoom_level}) return -1;\n\t\t\t\treturn 0;\n\t\t\t\t'\n\t\t\t));\n\n\t\t\t//Update the stats table\n\t\t\ttableclass_stat::increment_stat(\"search.count\");\n\t\t\t\n\t\t\t//Return search result\n\t\t\treturn array($groups, $long, $lat);\n\t\t\t\n\t\t}", "public function suggest() {\n // Set the content type to json\n $this->response->type('application/json');\n $result = $this->searchPlace();\n $this->set('result', $result);\n }", "public function search($search);", "function query_api($term, $location, $price, $radius, $categories, $sort) { \n $response = search($term, $location, $price, $radius, $categories, $sort);\n echo $response;\n}", "public static function search($query, &$results = array()) {\n\n }", "public function search($jql)\n {\n return $this->client->get('/rest/api/2/search?jql='.urlencode($jql));\n }", "public function search(){\n //includes google maps script for place autocomplete and to get experiences\n \t$this->set('jsIncludes',array('http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=fr&libraries=places','places_autocomplete','get_experiences','logo_fly','jquery.dropdown','cookies'));\n \n //sets motives, schools and departments by alphbetical order\n $this->__set_motives_schools_and_departments();\n }", "public function search($query, $year = null, $language = null);", "public function search($keyword)\n {\n }", "public function search(Request $request)\r\n {\r\n /*$request->validate([\r\n 'query' => 'required|min:3',\r\n ]);\r\n*/\r\n $query = $request->input('query');\r\n\r\n // $products = Product::where('name', 'like', \"%$query%\")\r\n // ->orWhere('details', 'like', \"%$query%\")\r\n // ->orWhere('description', 'like', \"%$query%\")\r\n // ->paginate(10);\r\n\r\n $listings = Listing::search($query)->paginate(10);\r\n}", "function search($searchType, $price, $location, $categories) {\n $url_params = array();\n \n $url_params['term'] = $searchType;\n //$url_params['location'] = $location;\n $url_params['longitude'] = $location[0];\n $url_params['latitude'] = $location[1];\n //8046.72 is equivalent to 5 miles 16093.44 is equivalent to 10 miles\n $url_params['radius'] = 16093;\n $url_params['price'] = $price;\n $url_params['sort_by'] = 'rating';\n $url_params['open_now'] = true;\n $url_params['limit'] = 20;\n $url_params['categories'] = $categories;\n \n //converts into 'https://api.yelp.com/v3/businesses/search/location&limit&price&sort_by&radius'\n $response = request($GLOBALS['API_HOST'], $GLOBALS['SEARCH_PATH'], $url_params);\n \n $pretty_response = json_encode(json_decode($response), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\n\n $data = json_decode($pretty_response, true);\n\n return $data['businesses'];\n}", "public function search() {\n\t\tif(isset($_GET['query'])) $this->query_str = $_GET['query'];\n\t\telse return;\n\n\t\t$raw = null;\n\n\t\t$cache = new Cache($this->query_str);\n\t\t//check if the result is cached\n\t\t\n\t\tif($cache->allow_cache()) {\n\t\t\t$raw = $cache->load_cache();\n\t\t\tif($raw === false) $raw = null;\n\t\t}\n\n\t\tif($raw === null) {\n\t\t\t//check if jar exists\n\t\t\tif(file_exists('../executable/app.jar')) $raw = shell_exec('cd ../executable/ && java -jar app.jar search ' . escapeshellarg($this->query_str));\n\t\t\telse return;\n\n\t\t\t//only save into cached when the escaped string equal to input string\n\t\t\tif($raw !== null && count($raw) > 0 && $cache->allow_cache()) \n\t\t\t\t$cache->save_cache($raw);\n\t\t}\n\n\t\t$this->results = json_decode($raw);\n\n\t\t$this->end_time = microtime(true);\n\t}", "function _admin_search_query()\n {\n }", "public function search(){ \n\t\t$this->layout = false;\t \n\t\t$q = trim(Sanitize::escape($_GET['q']));\t\n\t\tif(!empty($q)){\n\t\t\t// execute only when the search keywork has value\t\t\n\t\t\t$this->set('keyword', $q);\n\t\t\t$data = $this->BdSpoc->find('all', array('fields' => array('HrEmployee.first_name'),\n\t\t\t'group' => array('first_name'), 'conditions' => \tarray(\"OR\" => array ('first_name like' => '%'.$q.'%'),\n\t\t\t'AND' => array('HrEmployee.status' => '1', 'HrEmployee.is_deleted' => 'N','BdSpoc.is_deleted' => 'N'))));\t\t\n\t\t\t$this->set('results', $data);\n\t\t}\n }", "function display_elastic_search ($q, $filter=null, $from = 0, $size = 20, $callback = '')\n{\n\tglobal $elastic;\n\t\n\t$status = 404;\n\t\t\t\t\n\tif ($q == '')\n\t{\n\t\t$obj = new stdclass;\n\t\t$obj->hits = new stdclass;\n\t\t$obj->hits->total = 0;\n\t\t$obj->hits->hits = array();\n\t\t\n\t\t$status = 200;\n\t}\n\telse\n\t{\t\t\n\t\t// query type\t\t\n\t\t$query_json = '';\n\t\t\n\t\tif ($filter)\n\t\t{\n\t\t\tif (isset($filter->author))\n\t\t\t{\n\t\t\t\t// author search is different( but not working yet)\t\n\t\t\t\t$query_json = \t\t\n\t'{\n\t\"size\":50,\n \"query\": {\n \"bool\": {\n \"must\": [ {\n\t\t\t\t \"multi_match\" : {\n\t\t\t\t \"query\": \"<QUERY>\",\n\t\t\t\t \"fields\":[\"search_data.author\"] \n\t\t\t\t}\n\t\t\t\t}]\n }\n }\n\t}';\n\t\t\t$query_json = str_replace('<QUERY>', $q, $query_json);\n\t\t\t\n\t\t\t// echo $query_json;\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t// default is search on fulltext fields\n\t\tif ($query_json == '')\n\t\t{\n\t\t\t$query_json = '{\n\t\t\t\"size\":50,\n\t\t\t\t\"query\": {\n\t\t\t\t\t\"bool\" : {\n\t\t\t\t\t\t\"must\" : [ {\n\t\t\t\t \"multi_match\" : {\n\t\t\t\t \"query\": \"<QUERY>\",\n\t\t\t\t \"fields\":[\"search_data.fulltext\", \"search_data.fulltext_boosted^4\"] \n\t\t\t\t}\n\t\t\t\t}],\n\t\t\t\"filter\": <FILTER>\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"aggs\": {\n\t\t\t\"type\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.type.keyword\" }\n\t\t\t },\n\t\t\t \"year\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.year\" }\n\t\t\t },\n\t\t\t \"container\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.container.keyword\" }\n\t\t\t },\n\t\t\t \"author\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.author.keyword\" }\n\t\t\t },\n\t\t\t \"classification\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.classification.keyword\" }\n\t\t\t } \n\n\t\t\t}\n\n\t\n\t\t\t}';\n\t\t\t\n\t\t\t$query_json = str_replace('<QUERY>', $q, $query_json);\n\t\t}\n\t\n\t$filter_string = '[]';\n\t\n\tif ($filter)\n\t{\n\t\t$f = array();\n\t\t\n\t\tif (isset($filter->year))\n\t\t{\n\t\t\t$one_filter = new stdclass;\n\t\t\t$one_filter->match = new stdclass;\n\t\t\t$one_filter->match->{'search_data.year'} = $filter->year;\n\t\t\t\n\t\t\t$f[] = $one_filter;\t\t\t\n\t\t}\n\n\t\t// this doesn't work\n\t\tif (isset($filter->author))\n\t\t{\n\t\t\t$one_filter = new stdclass;\n\t\t\t$one_filter->match = new stdclass;\n\t\t\t$one_filter->match->{'search_data.author'} = $filter->author;\n\t\t\t\n\t\t\t$f[] = $one_filter;\t\t\t\n\t\t}\n\t\t\n\t\t$filter_string = json_encode($f);\n\t}\n\t\n\t$query_json = str_replace('<FILTER>', $filter_string, $query_json);\n\t\n\t\n\t$resp = $elastic->send('POST', '_search?pretty', $post_data = $query_json);\n\t\n\n\t\t$obj = json_decode($resp);\n\n\t\t$status = 200;\n\t}\n\t\n\tapi_output($obj, $callback, 200);\n}", "function search() {}", "public function search($search_term = \"\"){\r\n\t\tif($search_term != \"\"){\r\n\t\t\t$req = $this->config->getDomain() . \"Search\";\r\n\t\t\t$req .= \"?search_term=\" . $search_term;\r\n\t\t\t$req .= \"&dataType=\" . $this->config->getDataType();\r\n\t\t\t$resp = $this->helper->curlGet($req);\r\n\t\t\t$resultsArray = array();\r\n\t\t\tforeach (json_decode($resp) as $obj){\r\n\t\t\t\t$searchResult = new CurtSearchResult;\r\n\t\t\t\t$sR = $searchResult->castToSearchResult($obj);\r\n\t\t\t\tarray_push($resultsArray, $sR);\r\n\t\t\t}\r\n\t\t\treturn $resultsArray;\r\n\t\t} // end if\r\n\t}", "public function getSearch();", "public function executeSearch(sfWebRequest $request) {\n \t// look into PHP buffering to facilitate with GATC setting before redirecting to exact match\n \t$this->getResponse()->setSlot('body_class','search');\n \t$this->query = trim($request->getParameter('q'));\n \tif(!in_array($this->query, sfConfig::get('app_search_default_queries'))) {\n \t\t$SA = new SearchAgent($this->query);\n \t\t// if exact match is found redirect to the part's route\n \t\tif($route = $SA->search()) $this->redirect($route);\n \t\telse { // otherwise, see if similar parts exist for the user's query\n \t\t\tif($this->similar_parts = $SA->getSimilarParts()) {\n\t \t\t\t$this->count = $this->similar_parts[0]['count'];\n\t \t\t\t$this->search_routes = $SA->getSearchRoutes();\n\t \t\t\t$this->search_routes_class = $this->getSearchRoutesClass(count($this->search_routes));\n\t \t\t\t$this->num_serps = $this->count <= sfConfig::get('app_search_pagination_max_items') ? 1 : ceil($this->count / sfConfig::get('app_search_pagination_max_items'));\n\t \t\t\t$item_count = count($this->similar_parts);\n\t \t\t\t$rem = $item_count % 2 == 0 ? 2 : 1;\n\t \t\t\t$this->bottom_idx = $item_count - $rem;\n\t \t\t\t$this->getResponse()->setTitle(\"Product Search: '{$this->query}'\");\n\t \t\t\treturn sfView::SUCCESS;\n \t\t\t} else {\n \t\t\t\t// there is nothing in the database like the user's query\n \t\t\t\t$this->getResponse()->setTitle(\"Product Search: '{$this->query}'\");\n \t\t\t\treturn sfView::ALERT;\n \t\t\t}\n \t\t}\n \t} else {\n \t\t// user didn't enter anything into search box\n \t\t$this->getResponse()->setTitle('Product Search: Missing Query Parameter');\n \t\treturn sfView::ALERT;\n \t}\n }", "public static function search() {\r\n $result = lC_Default::find($_GET['q']);\r\n\r\n echo $result;\r\n }", "protected function parse_search(&$q)\n {\n }", "public static function search() {\n global $p;\n if (check_posts(['lat', 'lng'])) {\n $pharmacies = new pharmacies();\n $pharmacies->placeLat = $p['lat'];\n $pharmacies->placeLong = $p['lng'];\n $list = $pharmacies->get_place_by_latlng($p['distance'], 10);\n $r = [];\n\n foreach ($list['result'] as $place) {\n $f = new files($place['placeImg']);\n $place['placeImg'] = $f->placeOnServer;\n $r[] = $place;\n }\n $result['status'] = TRUE;\n $result['count'] = $list['nums'];\n $result['list'] = $r;\n } else {\n\n $result['status'] = FALSE;\n $result['error'] = 'invalid lat and lng';\n }\n\n// echo json_encode($p);\n// exit;\n if (@$p['post'] == 'post')\n $result['post'] = $p;\n echo json_encode($result);\n }", "function the_search_query()\n {\n }", "public function search($category)\n {\n // but if the criteria title is specified, we use it\n \n $boolQuery = new \\Elastica\\Query\\Bool();\n /*Fetch only VALIDATED place*/\n $queryStatus = new \\Elastica\\Query\\Match();\n $queryStatus->setFieldQuery('event.status', StatusType::VALIDATED);\n $boolQuery->addMust($queryStatus);\n \n if($category !== null){\n $queryCategory = new \\Elastica\\Query\\Match();\n $queryCategory->setFieldQuery('event.categories.slug', $category);\n $boolQuery->addMust($queryCategory);\n } \n \n// if($placeSearch->getBirthdayDiscount() != null && $placeSearch->getBirthdayDiscount() > 0 ){\n// $queryRange = new \\Elastica\\Query\\Range();\n// $queryRange->setParam('place.birthdayDiscount', ['gte' => 1]);\n// $boolQuery->addMust($queryRange);\n// }\n// \n// if(($placeSearch->getName() != null || $placeSearch->getCategories() != null ) && $placeSearch != null){\n// \n// if($placeSearch->getName() != null){\n// $query = new \\Elastica\\Query\\Match();\n// $query->setFieldQuery('place.name', $placeSearch->getName());\n// $query->setFieldFuzziness('place.name', 1);\n// $query->setFieldMinimumShouldMatch('place.name', '10%');\n// $boolQuery->addMust($query);\n// }\n// \n// if($placeSearch->getCategories() != null){ \n// foreach ($placeSearch->getCategories() as $cat){ \n// $categories[] = $cat->getName(); \n// }\n// $queryCategories = new \\Elastica\\Query\\Terms();\n// $queryCategories->setTerms('place.categories', $categories);\n// $boolQuery->addShould($queryCategories);\n// }\n// \n //} \n else {\n $query = new \\Elastica\\Query\\MatchAll();\n }\n $baseQuery = $boolQuery; \n\n // then we create filters depending on the chosen criterias\n $boolFilter = new \\Elastica\\Filter\\Bool();\n\n /*\n Dates filter\n We add this filter only the getIspublished filter is not at \"false\"\n */\n// if(\"false\" != $articleSearch->getIsPublished()\n// && null !== $articleSearch->getDateFrom()\n// && null !== $articleSearch->getDateTo())\n// {\n// $boolFilter->addMust(new \\Elastica\\Filter\\Range('publishedAt',\n// array(\n// 'gte' => \\Elastica\\Util::convertDate($articleSearch->getDateFrom()->getTimestamp()),\n// 'lte' => \\Elastica\\Util::convertDate($articleSearch->getDateTo()->getTimestamp())\n// )\n// ));\n// }\n//\n // Published or not filter\n// if($placeSearch->getIs24h() !== null && $placeSearch->getIs24h()){\n// //var_dump($placeSearch->getIs24h());die();\n// $boolFilter->addMust(\n// new \\Elastica\\Filter\\Term(['is24h' => $placeSearch->getIs24h()])\n// //new \\Elastica\\Filter\\Term(['isWifi' => $placeSearch->getIsWifi()]) \n// ); \n// \n// //$boolFilter->addMust('is24h', $placeSearch->getIs24h());\n// }\n// \n// if($placeSearch->getIsWifi() !== null && $placeSearch->getIsWifi()){\n// $boolFilter->addMust( \n// new \\Elastica\\Filter\\Term(['isWifi' => $placeSearch->getIsWifi()]) \n// );\n// }\n// \n// if($placeSearch->getIsDelivery() !== null && $placeSearch->getIsDelivery()){\n// $boolFilter->addMust( \n// new \\Elastica\\Filter\\Term(['isDelivery' => $placeSearch->getIsDelivery()]) \n// );\n// } \n\n $filtered = new \\Elastica\\Query\\Filtered($baseQuery, $boolFilter);\n\n $query = \\Elastica\\Query::create($filtered);\n\n return $this->find($query);\n }", "abstract public function search($keyword, array $searchOptions = []);", "public function scopeSearch($query, $term);", "public function search(TDispatch $td, $q = \"\", $limit = 10, $type = \"\") {\r\n $data = array(\r\n \"access_token\" => $td->getToken(),\r\n \"q\" => $q, //\tstring\tQuery string to search locations. Required\r\n \"limit\" => $limit, //\tint\tLimit number of locations. Optional\r\n \"type\" => $type //\tstring\tShould be 'pickup' if location is going to be used for a pickup. Optional.\r\n );\r\n //TD url\r\n $url = $td->getFullApiUrl() . 'locations/search?' . http_build_query($data);\r\n //Open connection\r\n $ch = curl_init();\r\n\r\n //Set the url, Number of POST vars, POST data\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n\r\n //Execute post\r\n $result = curl_exec($ch); \r\n $res = json_decode($result, true);\r\n $info = curl_getinfo($ch); \r\n //Close connection\r\n curl_close($ch);\r\n if (!isset($res['status']) || $res['status'] !== 'OK') {\r\n $td->setError($res);\r\n return false;\r\n }\r\n //Decode jsonresponse\r\n return $res;\r\n }", "public static function search($keyword)\n {\n $keyword = urlencode($keyword);\n return Cartoon::query(\"search=$keyword\");\n }", "public function search()\n {\n $domains = Configure::read('AccessControlAllowOrigin');\n $this->response->cors($this->request)\n ->allowOrigin($domains)\n ->allowMethods(['GET'])\n ->allowHeaders(['X-CSRF-Token'])\n ->maxAge(300)\n ->build();\n\n $version = '2-2';\n if (!empty($this->request->query['version'])) {\n $version = $this->request->query['version'];\n }\n if (empty($this->request->query['lang'])) {\n throw new BadRequestException();\n }\n $lang = $this->request->query['lang'];\n\n $page = 1;\n if (!empty($this->request->query['page'])) {\n $page = $this->request->query['page'];\n }\n $page = max($page, 1);\n\n if (count(array_filter(explode(' ', $this->request->query['q']))) === 1) {\n $this->request->query['q'] .= '~';\n }\n\n $options = [\n 'query' => $this->request->query('q'),\n 'page' => $page,\n ];\n $this->loadModel('Search', 'Elastic');\n $results = $this->Search->search($lang, $version, $options);\n\n $this->viewBuilder()->className('Json');\n $this->set('results', $results);\n $this->set('_serialize', 'results');\n }", "public function search($params = []);", "public function search(SearchRequestInterface $searchRequest) : SearchResultInterface;", "public function search(Request $request)\n {\n $appid = '6433c1f8';\n $appkey = 'acf4191deb52673bc8bcbf205e8c2ccc';\n $q = htmlspecialchars($request->search);\n $client = new Client([\n 'base_uri' => 'https://api.edamam.com',\n ]);\n $search = 'search?q='.$q.'&app_id='.$appid.'&app_key='.$appkey.'&from=0&to=12';\n $req = $client->request('GET', $search);\n $data = json_decode($req->getBody(), true);\n\n\n $results = [];\n $keyword = $data['q'];\n foreach($data['hits'] as $arr){\n $results[] = [\n 'uri'=>$arr['recipe']['uri'],\n 'shareAs'=>$arr['recipe']['shareAs'],\n 'sourceUrl'=>$arr['recipe']['url'],\n 'label'=>$arr['recipe']['label'],\n 'image'=>$arr['recipe']['image'],\n 'source'=>$arr['recipe']['source'],\n 'calories'=>$arr['recipe']['calories'],\n 'ingredients'=>count($arr['recipe']['ingredients'])\n ];\n }\n return view('search.resultview')->withKeyword($keyword)->withResults($results);\n }", "public function search($request, $response)\n {\n }", "public function keywordSearch()\n {\n $input = Request::all();\n $validator = Validator::make($input, ['keyword' => 'required']);\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n\n $keyword = ine($input, 'keyword') ? $input['keyword'] : '';\n $limit = isset($input['limit']) ? $input['limit'] : config('jp.pagination_limit');\n $customers = Customer::where('customers.company_id', config('company_scope_id'))\n ->leftJoin('addresses', function ($join) {\n $join->on('customers.address_id', '=', 'addresses.id');\n })\n ->leftJoin('customer_contacts', function ($join) {\n $join->on('customers.id', '=', 'customer_contacts.customer_id');\n })\n ->with('phones', 'address', 'jobs')\n ->keywordSearch($keyword, $this->scope->id())\n ->select('customers.*')\n ->groupBy('customers.id')\n ->paginate($limit);\n\n $transformer = (new CustomersTransformer)->setDefaultIncludes([\n 'count',\n 'address',\n 'phones'\n ]);\n\n return ApiResponse::success(\n $this->response->paginatedCollection($customers, $transformer)\n );\n }", "public function actionSearch($q)\n {\n $result = ElasticItem::search($q);\n\n return $this->render('search', [\n 'q' => $q,\n 'result' => $result\n ]);\n }", "public function getAll($searchTerm);", "public function search()\n {\n $user = User::search('');\n dd($user);\n dd(request('keyword'));\n return ResponseHelper::createSuccessResponse([], 'Operation Successful');\n }", "public function getSearch($parameters = array());", "function ml_wpsearch_search($querytext)\n{\n $querytext = trim($querytext);\n if (!$querytext) {\n return [null, null, null];\n }\n\n $results = ml_wpsearch_search_query($querytext, array(\n 'start' => isset($_REQUEST['start']) ? $_REQUEST['start'] : 1,\n 'pageLength' => isset($_REQUEST['pageLength']) ? $_REQUEST['pageLength'] : 10,\n ));\n if (null === $results)\n {\n return [null, null, null];\n }\n\n if ($results->getTotal() < 1) {\n return [$results, null, null];\n }\n\n // Paging, we'll provide the URLs here, but it's up to the view\n // to display them.\n $searchPageUrl = ml_wpsearch_url();\n $nextLink = null;\n if ($results->getCurrentPage() < $results->getTotalPages()) {\n $nextLink = add_query_arg(array(\n 's' => urlencode($querytext),\n 'start' => $results->getNextStart(),\n 'pageLength' => $results->getPageLength(),\n ), $searchPageUrl);\n }\n\n $prevLink = null;\n if ($results->getCurrentPage() > 1) {\n $prevLink = add_query_arg(array(\n 's' => urlencode($querytext),\n 'start' => $results->getPreviousStart(),\n 'pageLength' => $results->getPageLength(),\n ), $searchPageUrl);\n }\n\n return [$results, $nextLink, $prevLink];\n}", "public function searchAction() {\n $search = $this->getParam('search');\n\n\n $queryBuilder = new Application_Util_QueryBuilder($this->getLogger());\n\n $queryBuilderInput = array(\n 'searchtype' => 'simple',\n 'start' => '0',\n 'rows' => '10',\n 'sortOrder' => 'desc',\n 'sortField'=> 'score',\n 'docId' => null,\n 'query' => $search,\n 'author' => '',\n 'modifier' => 'contains_all',\n 'title' => '',\n 'titlemodifier' => 'contains_all',\n 'persons' => '',\n 'personsmodifier' => 'contains_all',\n 'referee' => '',\n 'refereemodifier' => 'contains_all',\n 'abstract' => '',\n 'abstractmodifier' => 'contains_all',\n 'fulltext' => '',\n 'fulltextmodifier' => 'contains_all',\n 'year' => '',\n 'yearmodifier' => 'contains_all',\n 'author_facetfq' => '',\n 'languagefq' => '',\n 'yearfq' => '',\n 'doctypefq' => '',\n 'has_fulltextfq' => '',\n 'belongs_to_bibliographyfq' => '',\n 'subjectfq' => '',\n 'institutefq' => ''\n );\n\n\n $query = $queryBuilder->createSearchQuery($queryBuilderInput, $this->getLogger());\n\n $result = array();\n\n $searcher = new Opus_SolrSearch_Searcher();\n try {\n $result = $searcher->search($query);\n }\n catch (Opus_SolrSearch_Exception $ex) {\n var_dump($ex);\n }\n\n $matches = $result->getReturnedMatches();\n\n $this->view->total = $result->getAllMatchesCount();\n $this->view->matches = $matches;\n }", "public function get_results() {\n\n\t\t\tif(!isset($_GET['wpusquery'])) {\n\t\t\t\tdie(); // if no data has been entered, quit\n\t\t\t} else {\n\t\t\t\t$searcharray = $_GET['wpusquery'];\n\t\t\t}\n\n\t\t\t$nonce = $_GET['searchNonce'];\n\t\t\tif(!wp_verify_nonce($nonce, 'search-nonce')) // make sure the search nonce matches the nonce generated earlier\n\t\t\t{\n\t\t\t\tdie ('Busted!');\n\t\t\t}\n\n\t\t\tif(class_exists(\"WPUltimateSearchPro\")) {\n\t\t\t\t$this->pro_class->execute_query_pro($searcharray);\n\t\t\t} else {\n\t\t\t\t$this->execute_query_basic($searcharray);\n\t\t\t}\n\t\t}", "public function search()\n {\n return $this->call('GET', $this->endpoint);\n }", "public function search()\n {\n $query = Purifier::clean(Input::get('q'));\n return Redirect::away('https://www.google.com/search?q=site:www.apcow.com' . $query, 301);\n }", "public function search($searchTerm)\n {\n $results = array(\n 'snippet' => [],\n 'snippet_code' => [],\n 'page' => [],\n 'product' => [],\n 'actions' => [],\n 'word' => [],\n 'post' => []\n );\n\n $snippets = Yii::$app->user->identity->portal->hasMany(Snippet::className(), ['id' => 'snippet_id'])\n ->viaTable('snippet_portal', ['portal_id' => 'id'])\n ->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'description', $searchTerm],\n ])\n ->limit(10)\n ->all();\n\n foreach ($snippets as $snippet) {\n $results['snippet'][] = [\n 'link' => Url::to([\n '/snippet/edit',\n 'id' => $snippet->id\n ]),\n 'name' => $snippet->name,\n 'id' => $snippet->id,\n 'class' => 'suggest-snippet'\n ];\n }\n\n // SNIPPET CODES / ALTERNATIVES\n\n /** @var SnippetCode[] $snippet_codes */\n $snippet_codes = SnippetCode::find()\n ->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'code', $searchTerm]\n ])\n ->limit(10)\n ->all();\n\n foreach ($snippet_codes as $snippet_code) {\n $results['snippet_code'][] = [\n 'link' => Url::to([\n '/snippet/edit',\n 'id' => $snippet_code['snippet_id'],\n '#' => 'code' . $snippet_code['id'],\n ]),\n 'name' => $snippet_code->getSnippet()->one()->name . ' -> ' . $snippet_code->name,\n 'id' => $snippet_code->id,\n 'class' => 'suggest-snippet-code'\n ];\n }\n\n // Slovnik\n $words = (new Query())->select(\"id, identifier\")->from(\"word\")->where(['like', 'identifier', $searchTerm])\n ->limit(10)->all();\n\n foreach ($words as $word) {\n $results['word'][] = [\n 'link' => Url::to([\n '/word/edit',\n 'id' => $word['id']\n ]),\n 'name' => $word['identifier'],\n 'id' => $word['id'],\n 'class' => 'suggest-word'\n ];\n }\n\n // PAGES\n\n $pages = Page::find()->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'identifier', $searchTerm],\n ['like', 'title', $searchTerm],\n ])\n ->andWhere([\n 'portal_id' => Yii::$app->user->identity->portal_id\n ])\n ->limit(10)\n ->all();\n\n foreach ($pages as $page) {\n $results['page'][] = [\n 'link' => Url::to(['/page/edit', 'id' => $page['id']]),\n 'id' => $page->id,\n 'name' => $page->breadcrumbs,\n 'class' => 'suggest-page'\n ];\n }\n\n // POSTS\n\n $posts = Post::find()->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'identifier', $searchTerm],\n ['like', 'title', $searchTerm],\n ])\n ->andWhere([\n 'portal_id' => Yii::$app->user->identity->portal_id\n ])\n ->limit(10)\n ->all();\n\n foreach ($posts as $post) {\n $results['post'][] = [\n 'link' => Url::to(['/post/edit', 'id' => $post['id']]),\n 'id' => $post->id,\n 'name' => $post->name,\n 'class' => 'suggest-post'\n ];\n }\n\n // PRODUCTS\n\n $products = Product::find()\n ->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'identifier', $searchTerm],\n ])\n ->andWhere([\n 'language_id' => Yii::$app->user->identity->portal->language_id\n ])\n ->limit(10)\n ->all();\n\n foreach ($products as $product) {\n $results['product'][] = [\n 'link' => Url::to([\n '/product/edit',\n 'id' => $product['id']\n ]),\n 'name' => $product->breadcrumbs,\n 'id' => $product->id,\n 'class' => 'suggest-product'\n ];\n }\n\n $processActions = function ($searchTerm, $list, $prefix, $urlSuffix = '') {\n $actions = [];\n foreach ($list as $item) {\n $name = $prefix . $item[0];\n\n if ($searchTerm == '' || (mb_strlen($name) >= mb_strlen($searchTerm) && mb_substr(mb_strtolower($name), 0, mb_strlen($searchTerm)) == mb_strtolower($searchTerm))) {\n $actions[] = [\n 'link' => Url::to([\n '/' . $item[1] . '/' . $urlSuffix,\n ]),\n 'name' => $name,\n 'class' => 'suggest-action'\n ];\n }\n };\n return $actions;\n };\n\n $listActions = [['stránok', 'page'], ['ďakovačiek', 'thanks'], ['prekladov', 'word'], ['multimédii', 'multimedia'], ['snippetov', 'snippet'], ['produktov', 'product'], ['produktových premenných', 'product-var'], ['typov produktu', 'product-type'], ['tagov', 'tag'], ['šablón', 'template'], ['portálov', 'portal'], ['používateľov', 'user'], ['krajín', 'language']];\n $addActions = [['stránku', 'page'], ['ďakovačku', 'thanks'], ['preklad', 'word'], ['snippet', 'snippet'], ['produkt', 'product'], ['produktovú premennú', 'product-var'], ['typ produktu', 'product-type'], ['tag', 'tag'], ['šablónu', 'template'], ['portál', 'portal'], ['používateľa', 'user'], ['krajinu', 'language']];\n\n $results['actions'] += $processActions($searchTerm, $listActions, 'Zoznam ');\n $results['actions'] += $processActions($searchTerm, $addActions, 'Pridať ', 'edit');\n\n return $results;\n }", "public function search($postcode);", "public function search()\n\t{\n\t\tif(isset($_GET['term']))\n\t\t{\n\t\t\t$result = $this->Busca_Model->pesquisar($_GET['term']);\n\t\t\tif(count($result) > 0) {\n\t\t\tforeach ($result as $pr)$arr_result[] = $pr->nome;\n\t\t\t\techo json_encode($arr_result);\n\t\t\t}\n\t\t}\n\t}", "public function searchAction()\n {\n $search = $this->createSearchObject();\n $result = $search->searchWord($this->view->word);\n $this->view->assign($result);\n\n if (Model_Query::$debug) {\n $this->view->actionTrace = [\n 'action' => sprintf('%s::searchWord()', get_class($search)),\n 'result' => $result,\n ];\n\n $this->view->queryTrace = Model_Query::$trace;\n }\n\n }", "public function searchAction(){\n $string = filter_input(INPUT_GET, 'string', FILTER_SANITIZE_STRING);\n $word = new Word();\n if(!empty($string)){\n print json_encode($word->search($string));\n }else{\n print json_encode($word->limitWords(20));\n }\n }", "public function actionLocation() {\n $term = trim($_GET['term']);\n $bGeonames = (isset($_GET['geonames'])) ? true : false;\n $results = array();\n $geonamesUrl = \"http://api.geonames.org/searchJSON?maxRows=10&lang=de&username=wkoller&style=medium\";\n\n if ($bGeonames) {\n // Construct service URL\n $geonamesUrl = $geonamesUrl . \"&q=\" . urlencode($term);\n // Fetch service response\n $service_response = file_get_contents($geonamesUrl);\n if ($service_response) {\n // Decode data\n $service_data = json_decode($service_response, true);\n\n // Save response data in location table\n foreach ($service_data['geonames'] as $geoname) {\n // Check if we already have any entry\n $model_location = null;\n $model_locationGeonames = LocationGeonames::model()->find('geonameId=:geonameId', array(':geonameId' => $geoname['geonameId']));\n if ($model_locationGeonames != null) {\n $model_location = Location::model()->findByPk($model_locationGeonames->id);\n\n // update model with new location description\n $model_location->location = $geoname['name'] . ' (' . $geoname['adminName1'] . ', ' . $geoname['countryName'] . ')';\n $model_location->save();\n } else {\n // Create location model & save it\n $model_location = new Location;\n $model_location->location = $geoname['name'] . ' (' . $geoname['adminName1'] . ', ' . $geoname['countryName'] . ')';\n $model_location->save();\n // Create according geonames model & save it as well\n $model_locationGeonames = new LocationGeonames;\n $model_locationGeonames->id = $model_location->id;\n $model_locationGeonames->service_data = serialize($geoname);\n $model_locationGeonames->geonameId = $geoname['geonameId'];\n $model_locationGeonames->countryCode = $geoname['countryCode'];\n $model_locationGeonames->save();\n }\n\n // Add response to results\n $results[] = array(\n \"label\" => $model_location->location,\n \"value\" => $model_location->location,\n \"id\" => $model_location->id,\n \"countryCode\" => $model_locationGeonames->countryCode\n );\n }\n }\n } else {\n // Find all fitting entries in location table\n $models_location = Location::model()->findAll('location LIKE :location', array(':location' => $term . '%'));\n if ($models_location != NULL) {\n foreach ($models_location as $model_location) {\n $results[] = array(\n \"label\" => $model_location->location,\n \"value\" => $model_location->location,\n \"id\" => $model_location->id,\n );\n }\n }\n }\n\n // Output results as service response\n $this->serviceOutput($results);\n }", "private function makeTwitterQuery() {\n\t\t// The basic URL for the twitter search API\n\t\t$base_query = 'http://search.twitter.com/search.json?q=';\n\n\t\tif (isset($this->tag)) { // Make a search query by tag\n\t\t\t$this->query = $base_query . urlencode('#' . $this->tag);\n\t\t} elseif ((isset($this->geo)) && (count($this->geo) >0 )) {\n\t\t\t$this->query = $base_query . '&' . 'geocode=' . $this->geo['lat'] . urlencode(',') . $this->geo['lon'] . urlencode (',') . $this->geo['distance'] / 1000 . 'km';\n\t\t}\n\n\t\tlogger::log(DEBUG, \"TWITTER - Query: \".$this->query );\n\t}", "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 search(ContentMetadataModel $model, Request $request)\n {\n $this->validate($request, [\n 'query' => 'required',\n ]);\n\n $query = $request->input('query');\n\n // Parse Function From Trait DndbQuery\n $query_eloquent = $this->ReqParse($query);\n\n // Improve Query Builder Search\n $query = null;\n foreach($query_eloquent as $key => $value) {\n $query = $model->where($key, 'contains', $value);\n }\n\n // Performe Query\n $count = $query->count();\n\n if($count == 0) {\n $message = ', no data found with this query';\n $result = [];\n } else {\n $message = ', data has been found';\n $result = $query->get();\n }\n\n return response()->json([\n 'status' => [\n 'code' => '200',\n 'message' => 'search query has been performed'. $message,\n 'total' => $count,\n ],\n 'result' => $result,\n ], 200);\n }", "public function search($args){\n\t\t//Sets defaults where input doesn't exist.\n\t\t//This will only add if the index doesn't exist?\n\t\t$args += [\n\t\t\t\"page\" => 0,\n\t\t\t\"index\" => null,\n\t\t\t\"type\" => \"books\"\n\t\t];\n\t\textract($args);\n\t\t//Now check we have a query\n\t\tif(!isset($query)){\n\t\t\techo \"NEED TO HAVE A QUERY IN SEARCH\";\n\t\t\texit(1);\n\t\t}\n\t\t//Create url for search\n\t\t$url = \"$this->apiRoot/$type?q=$query&p=$page\" . ($index === null ? \"\" : \"&i=$index\") . $this->apiTail;\n\n\t\t//Run search, return json as array\n\t\t//return file_get_contents($url);\n\t\treturn apiSampleSearch();\n\t}", "public function action_search_doc()\n\t{\n\t\tglobal $context;\n\n\t\t$context['doc_apiurl'] = 'https://github.com/elkarte/Elkarte/wiki/api.php';\n\t\t$context['doc_scripturl'] = 'https://github.com/elkarte/Elkarte/wiki/';\n\n\t\t// Set all the parameters search might expect.\n\t\t$postVars = explode(' ', $context['search_term']);\n\n\t\t// Encode the search data.\n\t\tforeach ($postVars as $k => $v)\n\t\t{\n\t\t\t$postVars[$k] = urlencode($v);\n\t\t}\n\n\t\t// This is what we will send.\n\t\t$postVars = implode('+', $postVars);\n\n\t\t// Get the results from the doc site.\n\t\trequire_once(SUBSDIR . '/Package.subs.php');\n\t\t// Demo URL:\n\t\t// https://github.com/elkarte/Elkarte/wiki/api.php?action=query&list=search&srprop=timestamp|snippet&format=xml&srwhat=text&srsearch=template+eval\n\t\t$search_results = fetch_web_data($context['doc_apiurl'] . '?action=query&list=search&srprop=timestamp|snippet&format=xml&srwhat=text&srsearch=' . $postVars);\n\n\t\t// If we didn't get any xml back we are in trouble - perhaps the doc site is overloaded?\n\t\tif (!$search_results || preg_match('~<' . '\\?xml\\sversion=\"\\d+\\.\\d+\"\\?' . '>\\s*(<api>.+?</api>)~is', $search_results, $matches) !== 1)\n\t\t{\n\t\t\tthrow new Exception('cannot_connect_doc_site');\n\t\t}\n\n\t\t$search_results = !empty($matches[1]) ? $matches[1] : '';\n\n\t\t// Otherwise we simply walk through the XML and stick it in context for display.\n\t\t$context['search_results'] = array();\n\n\t\t// Get the results loaded into an array for processing!\n\t\t$results = new XmlArray($search_results, false);\n\n\t\t// Move through the api layer.\n\t\tif (!$results->exists('api'))\n\t\t{\n\t\t\tthrow new Exception('cannot_connect_doc_site');\n\t\t}\n\n\t\t// Are there actually some results?\n\t\tif ($results->exists('api/query/search/p'))\n\t\t{\n\t\t\t$relevance = 0;\n\t\t\tforeach ($results->set('api/query/search/p') as $result)\n\t\t\t{\n\t\t\t\t$title = $result->fetch('@title');\n\t\t\t\t$context['search_results'][$title] = array(\n\t\t\t\t\t'title' => $title,\n\t\t\t\t\t'relevance' => $relevance++,\n\t\t\t\t\t'snippet' => str_replace('class=\\'searchmatch\\'', 'class=\"highlight\"', un_htmlspecialchars($result->fetch('@snippet'))),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "public function searchKeyword (){\n $this->res = $this->daoJson->searchKeywordDate($this->keyword, $this->from, $this->to);\n }", "public abstract function search_items(\\WP_REST_Request $request);", "function searchCinemas($query, $key, $next_page_token=\"\"){\n $query = urlencode($query);\n\n // search places api url\n if ($next_page_token == \"\"){\n $url = \"https://maps.googleapis.com/maps/api/place/textsearch/json?type=movie_theater&query={$query}&key={$key}\";\n }else{\n $url = \"https://maps.googleapis.com/maps/api/place/textsearch/json?type=movie_theater&query={$query}&key={$key}&pagetoken={$next_page_token}\";\n }\n \n\n // get the json response\n $resp_json = file_get_contents($url);\n\n // decode the json\n $resp = json_decode($resp_json, true);\n\n // response status will be 'OK', if able to geocode given address \n if($resp['status']=='OK'){\n return $resp;\n }else{\n ?>\n <div class=\"row\"><div class=\"col-md-12\">\n <h5 style=\"color:red;\"><?php echo \"<strong>ERROR: {$resp['status']}</strong>\"; ?></h5>\n </div></div>\n <?php\n return false;\n }\n}", "function search() {\n // ...\n }", "private function makeQuery(){\n\t\t\n\t\t$this->searchQ['select'] = array('l.name','l.summary','l.sum_approach','l.sum_problems','l.address_line_1','l.address_line_2','l.town','l.county','l.postcode','l.country','l.phone','l.latitude','l.longitude','l.publish_address','l.publish_phone','l.approved','p.uri','p.urlname','e.level','y.listing_type');\n\t\t$this->searchQ['select'][] = '(SELECT i.image FROM listing_images i WHERE l.listing_id=i.listing_id ORDER BY i.sort_order ASC LIMIT 1) AS image';\n\t\t$this->searchQ['from'] = 'listing_level e, listing_type y, pages p, listing l '; //should always be the same...\n\t\t$this->searchQ['where'] = array('e.level_id = l.level_id','y.listing_type_id = l.listing_type_id','l.page_id = p.page_id','l.publish = 1');//,'p.publish = 1');\n\t\t\n\t\t// set up the initial search variables\t\t\n\t\t//! location\n\t\tif( strlen($this->vars['location']) ){\n\t\t\n\t\t\t$this->Geocode = new Geolocation( $this->vars['location']. ', UK' );\n\t\t\t$this->Geocode->lookup();\n\t\t\t// using the OS grid as makes calculation simpler than using lng/lat - can use simple pythag rather than calculus functions\n\t\t\t// we shorten the list of rows needing the calculation by the greater / less than in the where\n\t\t\t\n\t\t\t$calculation = ' SQRT(POW(( l.easting - ' . round($this->Geocode->getOSEast()) . '),2) + POW((l.northing - ' . round($this->Geocode->getOSNorth()) . '),2)) ';\n\t\t\t$this->searchQ['select'][] = $calculation . \" AS distance\";\n\t\t\t$this->searchQ['where'][] = \"northing < \" . round( $this->Geocode->getOSNorth() + $this->searchDistance ) ; \n\t\t\t$this->searchQ['where'][] = \"northing > \" . round( $this->Geocode->getOSNorth() - $this->searchDistance ) ;\n\t\t\t$this->searchQ['where'][] = \"easting < \" . round( $this->Geocode->getOSEast() + $this->searchDistance ) ;\n\t\t\t$this->searchQ['where'][] = \"easting > \" . round( $this->Geocode->getOSEast() - $this->searchDistance ) ;\n\t\t//\t$this->searchQ['where'][] = \"(\" . $calculation . \") <= \" . $this->searchDistance ;\n\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"distance <= \" . $this->searchDistance;\n\t\t\t//$this->searchQ['orderby'][] = '(distance - ((l.level_id-1)*16000)) ASC'; // (x^3 -400^3)^(1/3)\n\t\t\t\n\t\t\t// using a exponential function to order distances based on the listing level and multiplying by 16000 m = 16km = 10 miles\n\t\t\t// then raising to power 3, deleteing the distance cubed and then 1/3 (cube root), so only makes a diffenrce within that area\n\t\t\t\n\t\t\t$this->searchQ['orderby'][] = ' POW( (POW( distance ,3) - POW(((l.level_id-1)*' . $this->levelMultiplier. '),3)),(1/3)) ASC ';\n\t\t\t$this->searchQ['orderby'][] = 'l.level_id DESC';\n\t\t\t$this->doSearch = true;\n\t\t}else{\n\t\t\t$this->searchQ['orderby'][] = 'l.level_id DESC';\n\t\t}\n\t\t\n\t\t//! freetext\n\t\tif( strlen($this->vars['term']) ){\n\t\t\t$this->searchQ['select'][] = \"MATCH(\" . $this->ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE) AS score\";\n\t\t\t//$this->searchQ['where'][] = \"MATCH(\" . $ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE)\";\n\t\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"score > 0\";\n\t\t\t$this->searchQ['orderby'][] = 'score DESC';\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t\n\t\t//! **** FILTERS ****\n\t\t//! profession\n\t\tif( isset($this->vars['profession']) && strlen($this->vars['profession']) ){\n\t\t\n\t\t\t//$this->searchQ['where'][] = \" l.listing_type_id IN (\" . implode(',', $this->vars['profession']) . \") \";\n\t\t\t$this->searchQ['where'][] = \" l.listing_type_id = \" . (int)$this->vars['profession'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t//! max price\n\t\tif( isset($this->vars['maxprice']) && is_numeric($this->vars['maxprice']) ){\n\t\t\n\t\t\t$this->searchQ['where'][] = \" l.hourly_rate <= \" . (int)$this->vars['maxprice'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! gender\n\t\tif( isset($this->vars['gender']) && in_array($this->vars['gender'] , array('M','F')) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_gender ltg';\n\t\t\t$this->searchQ['where'][] = \" ltg.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltg.gender = '\" . $this->vars['gender'] . \"' \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\n\t\t//! speciality\n\t\tif( isset($this->vars['speciality']) && is_numeric($this->vars['speciality']) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_age ltag';\n\t\t\t$this->searchQ['where'][] = \" ltag.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltag.age_id = \" . (int)$this->vars['speciality'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! ** build the query **\n\t\t$q = \"SELECT \" . (($this->numRows)?' SQL_CALC_FOUND_ROWS ':'') . implode(',', $this->searchQ['select']). \"\n\t\t\t\tFROM \" . $this->searchQ['from'] . \"\n\t\t\t\tWHERE\n\t\t\t\t\t\" . implode(' AND ', $this->searchQ['where']) ;\n\n\t\tif( isset($this->searchQ['having']) && count($this->searchQ['having']) ){\n\t\t\t$q .= \" HAVING \" . implode(' AND ' , $this->searchQ['having']);\n\t\t}\n\t\t\n\t\t$q .= \"\tORDER BY \" . implode(',', $this->searchQ['orderby']) . \" \";\n\t\t\n\t\t$q .= \"\tLIMIT \" . ( ($this->page-1)* $this->limit) . \",\" . $this->limit . \" \"; \n\t\n\t\treturn $q;\n\t\t\n\t}", "public function search($request) {\n $query = Convert::raw2sql($request->getVar('q'));\n $limit = $this->config()->search_limit;\n $addresses = NZStreetAddress::get()->filter('FullAddress:StartsWith', $query)\n ->limit($limit);\n $output = [];\n foreach($addresses as $address) {\n $output[] = [\n 'AddressID' => $address->AddressID,\n 'FullAddress' => $address->FullAddress,\n 'AddressLine1' => sprintf(\"%s %s\",\n $address->FullAddressNumber,\n $address->FullRoadName\n ),\n 'Suburb' => $address->SuburbLocality,\n 'City' => $address->TownCity\n ];\n }\n\n return json_encode($output);\n }", "function search($keywords)\r\n {\r\n\r\n }", "public function search($query = '')\n\t{\n\t\tif($query != '')\n\t\t{\n\t\t\t$trackClass = $this->apiClass->getPackage($this->auth, 'track', $this->config);\n\t\t\t\n\t\t\t$methodVars = array(\n\t\t\t\t\t'track' => $query,\n\t\t\t\t\t'limit' => $this->numResults\n\t\t\t);\n\t\n\t\t\tif ($results = $trackClass->search($methodVars) ) {\n\t\t\t\t$this->fromArray($results);\n\t\t\t} //else no results\n\t\t} else {\n\t\t\t$this->error(\"provide a search query, you dickhead\");\n\t\t}\n\t}", "public function search($searchString) {\n // the parameters needed to get the google places information\n $parameters = array(\n 'query' => $searchString,\n 'language' => 'nl',\n );\n \n // get the values from the places api\n $result = $this->fetchResult($parameters);\n\n // if there is no valid result, return null\n if (is_null($result)) {\n return $result;\n }\n \n // done, return the google places search result as object \n return new \\Weblab\\GooglePlacesSearch($result);\n }", "public function search(Request $request)\n {\n $request->validate([\n 'query' => 'required|min:3',\n ]);\n\n $query = $request->input('query');\n\n // % wildcard will return results similar to the query\n $products = Product::where('name', 'like', \"%$query%\")->get();\n\n return view ('search-results')-> with('products' , $products);\n }", "public function search($term = '', $andor = 'AND', $limit = 0, $offset = 0, $userid = 0)\n {\n return false;\n }", "function getSearch (Request $request) {\n $request->validate(['keyword' => 'required']);\n\n //Get what user input in the search form\n $input = $request->get(\"keyword\");\n\n //If the input is not null => Search the database based and assign them to the result\n if (!empty($input)) {\n //Get all the post\n $posts = Post::latest();\n //query builder\n $posts = $posts->where('post_title', 'like', '%' . $input . '%')->get();\n }\n\n return view('search-results', [\n 'searchResults' => $posts,\n 'keyword' => $input\n ]);\n }", "private function buildSearchURL($q){\n\t\t$this->searchURL = $this->baseURL;\n\t\t$this->searchURL .= \"?version=\".$this->version;\n\t\t$this->searchURL .= \"&recordSchema=\".$this->recordSchema;\n\t\t$this->searchURL .= \"&query=\".$q;\n\t\t$this->searchURL .= \"&operation=searchRetrieve\";\n\t\t// optinal parameters\n\t\tif(isset($this->recordPacking)) $this->searchURL .= \"&recordPacking=\".$this->recordPacking;\n\t\tif(isset($this->startRecord)) $this->searchURL .= \"&startRecord=\".$this->startRecord;\n\t\tif(isset($this->maximumRecords)) $this->searchURL .= \"&maximumRecords=\".$this->maximumRecords;\n\t}", "function performSearch($sessionID, $table, $field, $term, $order){\r\n\t\tif($this->userCanPerformSearch('', $table)){\r\n\t\t\t//Allow user to search by sensitive or normal for level\r\n\t\t\tif($table == 'issues' && $field == 'Level'\r\n\t\t\t && $term!='A' && $term!='a' && $term!='B' && $term!='b'){\r\n\t\t\t\tif(strstr('sensitive', $term))\r\n\t\t\t\t\t$term = 'A';\r\n\t\t\t\telseif(strstr('normal', $term))\r\n\t\t\t\t\t$term = 'B';\r\n\t\t\t}\r\n\t\t\tif($table == 'students'){\r\n\t\t\t\tif(!$this->fieldInTable($table, $field)){\r\n\t\t\t\t\tif($this->fieldInTable('X_PNSY_STUDENT', $field))\r\n\t\t\t\t\t\t$table = 'X_PNSY_STUDENT';\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$table = 'X_PNSY_ADDRESS';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($table == 'students'){\r\n\t\t\t\t$query = \"SELECT * FROM X_PNSY_STUDENT ss, $table s where s.$field like '%$term%' AND s.StudentID IN\r\n\t\t\t\t\t\t\t(SELECT ID FROM X_PNSY_STUDENT WHERE ID = s.StudentID) AND s.StudentID = ss.ID GROUP BY s.StudentID\";\r\n\t\t\t}\r\n\t\t\telseif($table == 'X_PNSY_ADDRESS'){\r\n\t\t\t\t$query = \"SELECT * FROM X_PNSY_STUDENT ss, $table s WHERE s.$field LIKE '%$term%'AND s.ADDRESS_ID IN \r\n\t\t\t\t\t\t\t(SELECT ADDRESS_ID FROM $table WHERE ADDRESS_ID=s.ADDRESS_ID) \r\n\t\t\t\t\t\t\tAND s.ADDRESS_ID=ss.ADDRESS_ID GROUP BY s.ADDRESS_ID\";\r\n\t\t\t\tif($field == 'STREET'){\r\n\t\t\t\t//\"SELECT ID, CONCAT(FirstName, ' ', MiddleIn, ' ', LastName) AS FullName FROM students WHERE\r\n\t\t\t\t//\tCONCAT(FirstName, ' ', MiddleIn, ' ', LastName) LIKE '%$name%'\";\r\n\t\t\t\t\r\n\t\t\t\t\t$query = \"SELECT * FROM X_PNSY_STUDENT ss, $table s WHERE (s.STREET_1 LIKE '%$term%' OR s.STREET_2 LIKE '%$term%'\r\n\t\t\t\t\t\t\tOR s.STREET_3 LIKE '%$term%' OR s.STREET_4 LIKE '%$term%' OR s.STREET_5 LIKE '%$term%') AND s.ADDRESS_ID IN \r\n\t\t\t\t\t\t\t(SELECT ADDRESS_ID FROM $table WHERE ADDRESS_ID=s.ADDRESS_ID) AND s.ADDRESS_ID=ss.ADDRESS_ID GROUP BY s.ADDRESS_ID\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telseif($table == 'X_PNSY_STUDENT' && $field == 'ADVISOR'){\r\n\t\t\t\t$table = 'X_PNSY_FACULTY';\r\n\t\t\t\t$query = \"SELECT s . * FROM X_PNSY_STUDENT s, $table ss WHERE (CONCAT(ss.FIRST_NAME, ' ',\r\n\t\t\t\t\t\t\t ss.LAST_NAME) LIKE '%$term%') AND s.$field IN (SELECT ID FROM $table WHERE ID = s.$field)\r\n\t\t\t\t\t\t\tAND s.$field = ss.ID GROUP BY s.$field, s.ID\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$query = \"SELECT * FROM $table WHERE $field like '%$term%'\";\r\n// Michael Thompson * 12/07/2005 * Added Below line to tack order onto sql sentence\r\n if ($order != \"\") $query .= \" ORDER BY $order\";\r\n\t\t\t$result = mysql_query($query);\r\n\t\t\tfor($i=0; $results = mysql_fetch_assoc($result); $i++){\r\n\t\t\t\t$return[$i] = $results;\r\n\t\t\t}\r\n\t\t\treturn $return;\r\n\t\t}\r\n\t}", "function search()\n\t{}", "function search()\n\t{}", "public function citysearch(Request $request)\n {\n $data = Cities::where(\"name\",\"LIKE\",\"%{$request->input('query')}%\")->get();\n return response()->json($data);\n }", "function search($query, $year=NULL, $page_limit=5, $page=NULL) {\n\t\t\n\t\t$args = array (\n\t\t\t\"q\" => $query,\n\t\t\t\"year\" => (int)$year,\n\t\t\t\"page_limit\" => $page_limit,\n\t\t\t\"page\" => $page\n\t\t);\n\t\t\n\t\t$json = $this->request(self::API_URL_TMPL_SEARCH, array(\n\t\t\t\"query-args\" => $this->collapse_args($args)\n\t\t));\n\t\t\n\t\tif(isset($json->total)) {\n\t\t\t\n\t\t\tif($json->total > 0) {\n\t\t\t\t\n\t\t\t\treturn new rt_search_result($json);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\treturn array();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\treturn NULL;\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function search() {\r\n //retrieve query terms from search form\r\n $query_terms = trim($_GET['query-terms']);\r\n\r\n //if search term is empty, list all vacations\r\n if ($query_terms == \"\") {\r\n $this->index();\r\n }\r\n\r\n //search the database for matching movies\r\n $vacations = $this->vacation_model->search_vacation($query_terms);\r\n\r\n if ($vacations === false) {\r\n //handle error\r\n $message = \"An error has occurred.\";\r\n $this->error($message);\r\n return;\r\n }\r\n //display matched movies\r\n $search = new VacationSearch();\r\n $search->display($query_terms, $vacations);\r\n }", "public function searchAction(Request $request){\n\n // Get Posted Content\n $postedContent = json_decode($request->getContent());\n\n // Handle Error if type/text are not set\n if( !isset($postedContent->type) || !isset($postedContent->text)){\n return $this->handleError(\"Search Type or Search Text are not set\");\n }\n\n // What you need to get\n $searchType = $postedContent->type;\n $searchText = $postedContent->text;\n $type = \"search\";\n\n // Perform Regex Validation on Search Text\n if( !preg_match('/^[a-zA-Z0-9_\\d\\_\\s-]+$/', $searchText) ){\n return $this->handleError(\"Search Text should only contain alpha-numeric values, spaces or hyphen\");\n }\n\n $returnQuantity = 1;\n \n // Pass Additional Params\n $additionalParams = [\n \"p\" => 1,\n \"type\" => $searchType,\n \"q\" => $searchText,\n \"withBreweries\" => \"Y\",\n \"hasLabels\" => \"Y\"\n ];\n \n try {\n \n // Perform Request and get response array\n $response = $this->get(\"http\")->doRequest($returnQuantity, $type, $additionalParams);\n } catch (\\Exception $e){\n \n // handle any exceptions\n $this->handleError($e->getMessage());\n }\n \n // Check for any additional API Errors\n $checkForAdditionalErrors = json_decode($response);\n \n if( isset($checkForAdditionalErrors->errorMessage)) {\n \n // If any, throw exception\n return $this->handleError($checkForAdditionalErrors->errorMessage);\n }\n \n return new Response($response);\n }", "public function search(Request $request, RepoHost $rh, $term)\n {\n $args = $request->all();\n\n $maxhits = isset($args['maxhits']) ? $args['maxhits'] : 25;\n $page = isset($args['page']) ? $args['page'] : 0;\n $sort = isset($args['sort']) ? $args['sort'] : 'score';\n\n return $rh->search($term, $maxhits, $page, $sort);\n\n }", "function search($term, $fields=array(), $limit=array()) { /* {{{ */\n\t\t$querystr = '';\n\t\t$term = trim($term);\n\t\tif($term) {\n\t\t\t$querystr = substr($term, -1) != '*' ? $term.'*' : $term;\n\t\t}\n\t\tif(!empty($fields['owner'])) {\n\t\t\tif(is_string($fields['owner'])) {\n\t\t\t\tif($querystr)\n\t\t\t\t\t$querystr .= ' ';\n\t\t\t\t$querystr .= 'owner:'.$fields['owner'];\n\t\t\t} elseif(is_array($fields['owner'])) {\n\t\t\t\tif($querystr)\n\t\t\t\t\t$querystr .= ' ';\n\t\t\t\t$querystr .= '(owner:';\n\t\t\t\t$querystr .= implode(' OR owner:', $fields['owner']);\n\t\t\t\t$querystr .= ')';\n\t\t\t}\n\t\t}\n\t\tif(!empty($fields['category'])) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$querystr .= '(category:';\n\t\t\t$querystr .= implode(' OR category:', $fields['category']);\n\t\t\t$querystr .= ')';\n\t\t}\n\t\tif(!empty($fields['status'])) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$status = array_map(function($v){return $v+10;}, $fields['status']);\n\t\t\t$querystr .= '(status:';\n\t\t\t$querystr .= implode(' OR status:', $status);\n\t\t\t$querystr .= ')';\n\t\t}\n\t\tif(!empty($fields['user'])) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$querystr .= '(users:';\n\t\t\t$querystr .= implode(' OR users:', $fields['user']);\n\t\t\t$querystr .= ')';\n\t\t}\n\t\tif(!empty($fields['rootFolder']) && $fields['rootFolder']->getFolderList()) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$querystr .= '(path:';\n\t\t\t$querystr .= str_replace(':', 'x', $fields['rootFolder']->getFolderList().$fields['rootFolder']->getID().':');\n\t\t\t$querystr .= ')';\n\t\t}\n\t\tif(!empty($fields['startFolder']) && $fields['startFolder']->getFolderList()) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$querystr .= '(path:';\n\t\t\t$querystr .= str_replace(':', 'x', $fields['startFolder']->getFolderList().$fields['startFolder']->getID().':');\n\t\t\t$querystr .= ')';\n\t\t}\n\t\ttry {\n\t\t\t$result = $this->index->find($querystr, $limit);\n\t\t\t$recs = array();\n\t\t\tforeach($result[\"hits\"] as $hit) {\n\t\t\t\t$recs[] = array('id'=>$hit->id, 'document_id'=>$hit->documentid);\n\t\t\t}\n\t\t\treturn array('count'=>$result['count'], 'hits'=>$recs, 'facets'=>array());\n\t\t} catch (Exception $e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getSearch()\n {\n $keyword= Input::get('q');\n $keywords = Explode(' ',$keyword);\n $query= DB::table('events')\n ->leftJoin('organizations', 'organizations.id', '=', 'events.org_id');\n foreach ($keywords as $key => $value) {\n $query ->orWhere('organizations.name', 'like', DB::raw(\"'%$value%'\"));\n $query ->orWhere('events.name', 'like', DB::raw(\"'%$value%'\"));\n }\n\n //search that event in Database\n $events= $query->get();\n // var_dump($events);\n\n //return display search result to user by using a view\n return View::make('event')->with('event', $events);\n }", "function search($offset,$limit,$queries){\r\n\t\t\r\n\t\t// Example: $queries = array('blog_tags: '.$_GET['q']);\r\n\r\n\t\tforeach ( $queries as $query ) {\r\n\t\t\t$response = $this->connection->search( $query, $offset, $limit );\r\n\t\t\t\r\n\t\t\tif ( $response->getHttpStatus() == 200 ) {\t\r\n\t\t\t\tprint_r( $response->getRawResponse() );\r\n\t\t\t\t\r\n\t\t\t\tif ( $response->response->numFound > 0 ) {\r\n\t\t\t\t\techo \"$query <br />\";\r\n\r\n\t\t\t\t\tforeach ( $response->response->docs as $doc ) { \r\n\t\t\t\t\t\techo \"$doc->partno $doc->name <br />\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\techo '<br />';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\techo $response->getHttpStatusMessage();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function _searchLocations($location)\n {\n return $this->_makeRequest(self::API_URL . '/api/' . $this->_apiKey\n . '/geolookup/q/' . $location . '.json');\n }", "function search()\n\t{\n\t\trequire_all_lang();\n\t\trequire_code('zones2');\n\t\tdisable_php_memory_limit();\n\n\t\tif (function_exists('set_time_limit')) @set_time_limit(100);\n\n\t\t$n=mixed();\n\n\t\t$default_theme=$GLOBALS['FORUM_DRIVER']->get_theme('');\n\n\t\t// Mess around to find our search keywords (takes synonyms into account, and generally tidies up)\n\t\t$raw_search_string=get_param('search_content',false,true);\n\n\t\t// Work out our keywords\n\t\t$keyword_string=$raw_search_string;\n\t\t$_keywords=array();\n\t\t$current_word='';\n\t\t$in_quotes=false;\n\t\tfor ($xi=0;$xi<strlen($keyword_string);$xi++)\n\t\t{\n\t\t\tif (($in_quotes) || (trim($keyword_string[$xi])!=''))\n\t\t\t{\n\t\t\t\tif ($keyword_string[$xi]=='\"')\n\t\t\t\t{\n\t\t\t\t\t$in_quotes=!$in_quotes;\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$current_word.=$keyword_string[$xi];\n\t\t\t\t}\n\t\t\t} else\n\t\t\t{\n\t\t\t\tif ($current_word!='') $_keywords[]=$current_word;\n\t\t\t\t$current_word='';\n\t\t\t}\n\t\t}\n\t\tif ($current_word!='') $_keywords[]=$current_word;\n\t\t$_keywords=$this->_strip_junk_words($_keywords);\n\t\tif (count($_keywords)==0)\n\t\t{\n\t\t\treturn do_template('INDEX_SCREEN_FANCIER_SCREEN',array('TITLE'=>get_page_title('ADMIN_ZONE_SEARCH_RESULTS'),'EMPTY'=>true,'ARRAY'=>true,'CONTENT'=>'','PRE'=>'','POST'=>''));\n\t\t}\n\t\t$keywords=array();\n\t\t$synonym_rows=$this->_synonyms(); // Only in English by default. To do for another language, override this file using inheritance\n\t\t$section_limitations=array();\n\t\tforeach ($_keywords as $xi=>$keyword)\n\t\t{\n\t\t\t$_keywords=array();\n\t\t\t$keyword=trim($keyword);\n\t\t\tif ($keyword=='') continue;\n\n\t\t\tif (substr($keyword,0,1)=='@')\n\t\t\t{\n\t\t\t\t$section_limitations[]=substr($keyword,1);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ($synonym_rows as $synonyms)\n\t\t\t{\n\t\t\t\tif ((in_array(strtolower($keyword),$synonyms)) || ((array_key_exists($xi+1,$_keywords)) && (in_array(strtolower($_keywords[$xi].' '.$_keywords[$xi+1]),$synonyms))))\n\t\t\t\t{\n\t\t\t\t\t$_keywords=array_merge($_keywords,$synonyms);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$_keywords[]=$keyword;\n\t\t\t$keywords[]=$_keywords;\n\t\t}\n\n\t\t// Stemming, if available (needs Stemmer class like http://www.chuggnutt.com/stemmer-source.php which we can't redistribute due to it being GPL not LGPL)\n\t\tif ((file_exists(get_file_base().'/sources_custom/stemmer_'.user_lang().'.php')) && (!in_safe_mode()))\n\t\t{\n\t\t\trequire_code('stemmer_'.user_lang());\n\t\t\t$stemmer=object_factory('Stemmer_'.user_lang());\n\t\t\tforeach ($keywords as $i=>$keyword_group)\n\t\t\t{\n\t\t\t\t$_keyword_group=$keyword_group;\n\t\t\t\tforeach ($keyword_group as $keyword)\n\t\t\t\t{\n\t\t\t\t\t// Special stemmer exceptions\n\t\t\t\t\tif ($keyword=='news') continue;\n\t\t\t\t\tif ($keyword=='defaultness') continue;\n\n\t\t\t\t\t$_keyword_group[]=$stemmer->stem($keyword);\n\t\t\t\t}\n\t\t\t\t$keywords[$i]=array_unique($_keyword_group);\n\t\t\t}\n\t\t} else\n\t\t{\n\t\t\tforeach ($keywords as $i=>$keyword_group)\n\t\t\t{\n\t\t\t\t$_keyword_group=$keyword_group;\n\t\t\t\tforeach ($keyword_group as $keyword) // Lame pluralisation fudge, if we don't have stemming\n\t\t\t\t{\n\t\t\t\t\tif ((strlen($keyword)>3) && (substr($keyword,-1)=='s'))\n\t\t\t\t\t\t$_keyword_group[]=substr($keyword,0,strlen($keyword)-1);\n\t\t\t\t\telse\n\t\t\t\t\t\t$_keyword_group[]=$keyword.'s';\n\t\t\t\t}\n\t\t\t\t$keywords[$i]=array_unique($_keyword_group);\n\t\t\t}\n\t\t}\n\n\t\t$this->keywords=$keywords;\n\n\t\t$content=array();\n\n\t\t// Admin/CMS menu icons\n\t\t$current_results_type=do_lang('ADMIN_MODULES');\n\t\tif ($this->_section_match($section_limitations,$current_results_type))\n\t\t{\n\t\t\t$content[$current_results_type]=new ocp_tempcode();\n\t\t\t$hooks=find_all_hooks('systems','do_next_menus');\n\t\t\tforeach (array_keys($hooks) as $hook)\n\t\t\t{\n\t\t\t\trequire_code('hooks/systems/do_next_menus/'.filter_naughty_harsh($hook));\n\t\t\t\t$object=object_factory('Hook_do_next_menus_'.filter_naughty_harsh($hook),true);\n\t\t\t\tif (is_null($object)) continue;\n\t\t\t\t$info=$object->run(true);\n\t\t\t\tforeach ($info as $i)\n\t\t\t\t{\n\t\t\t\t\tif (is_null($i)) continue;\n\n\t\t\t\t\t$n=$i[3];\n\t\t\t\t\tif (($i[0]!='') && ($this->_keyword_match(is_object($n)?$n->evaluate():$n)) && (has_actual_page_access(get_member(),$i[2][0],$i[2][2])))\n\t\t\t\t\t{\n\t\t\t\t\t\t$_url=build_url(array('page'=>$i[2][0])+$i[2][1],$i[2][2]);\n\t\t\t\t\t\t$tree=new ocp_tempcode();\n\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin','type'=>$i[0]),'adminzone'),do_lang(strtoupper($i[0]))));\n\t\t\t\t\t\t$sup=do_lang_tempcode('LOCATED_IN',$tree);\n\t\t\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>$n,'URL'=>$_url,'TITLE'=>'','DESCRIPTION'=>'','SUP'=>$sup)));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Module entry points\n\t\t$current_results_type=do_lang('SCREENS');\n\t\tif ($this->_section_match($section_limitations,$current_results_type))\n\t\t{\n\t\t\t$content[$current_results_type]=new ocp_tempcode();\n\t\t\tforeach (find_all_zones(false,true) as $zone=>$zone_details)\n\t\t\t{\n\t\t\t\t$modules=find_all_modules($zone);\n\t\t\t\tforeach (array_keys($modules) as $page)\n\t\t\t\t{\n\t\t\t\t\t$_entrypoints=extract_module_functions_page($zone,$page,array('get_entry_points'));\n\t\t\t\t\tif (!is_null($_entrypoints[0]))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((is_array($_entrypoints[0])) || (strpos($_entrypoints[0],'::')===false))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$entry_points=is_array($_entrypoints[0])?call_user_func_array($_entrypoints[0][0],$_entrypoints[0][1]):eval($_entrypoints[0]);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$path=zone_black_magic_filterer(filter_naughty($zone).(($zone=='')?'':'/').'pages/modules_custom/'.filter_naughty($page).'.php',true);\n\t\t\t\t\t\t\tif (!file_exists(get_file_base().'/'.$path)) $path=zone_black_magic_filterer(filter_naughty($zone).'/pages/modules/'.filter_naughty($page).'.php',true);\n\t\t\t\t\t\t\tif ((!defined('HIPHOP_PHP')) && ((ini_get('memory_limit')!='-1') && (ini_get('memory_limit')!='0') || (get_option('has_low_memory_limit')==='1')) && (strpos(file_get_contents(get_file_base().'/'.$path),' extends standard_aed_module')!==false)) // Hackerish code when we have a memory limit. It's unfortunate, we'd rather execute in full\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$new_code=str_replace(',parent::get_entry_points()','',str_replace('parent::get_entry_points(),','',$_entrypoints[0]));\n\t\t\t\t\t\t\t\tif (strpos($new_code,'parent::')!==false) continue;\n\t\t\t\t\t\t\t\t$entry_points=eval($new_code);\n\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\trequire_code($path);\n\t\t\t\t\t\t\t\tif (class_exists('Mx_'.filter_naughty_harsh($page)))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$object=object_factory('Mx_'.filter_naughty_harsh($page));\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$object=object_factory('Module_'.filter_naughty_harsh($page));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$entry_points=$object->get_entry_points();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($page=='admin_themes')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$entry_points['!themes']='EDIT_CSS';\n\t\t\t\t\t\t\t$entry_points['!!themes']='EDIT_TEMPLATES';\n\t\t\t\t\t\t\t$entry_points['!!!themes']='MANAGE_THEME_IMAGES';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (is_null($entry_points)) $entry_points=array();\n\t\t\t\t\t\tforeach ($entry_points as $type=>$lang)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$type=str_replace('!','',$type); // The ! was a hackerish thing just to multiply-up possibilities for the single entry-point\n\t\t\t\t\t\t\t$n=do_lang_tempcode($lang);\n\t\t\t\t\t\t\tif (($this->_keyword_match($n->evaluate())) && (has_actual_page_access(get_member(),$page,$zone)))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$tree=new ocp_tempcode();\n\t\t\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>''),$zone),$zone_details[1]));\n\t\t\t\t\t\t\t\tif (($zone=='cms') || ($zone=='adminzone'))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (($page!='admin') && ($page!='cms'))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$hooks=find_all_hooks('systems','do_next_menus');\n\t\t\t\t\t\t\t\t\t\tforeach (array_keys($hooks) as $hook)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\trequire_code('hooks/systems/do_next_menus/'.filter_naughty_harsh($hook));\n\t\t\t\t\t\t\t\t\t\t\t$object=object_factory('Hook_do_next_menus_'.filter_naughty_harsh($hook),true);\n\t\t\t\t\t\t\t\t\t\t\tif (is_null($object)) continue;\n\t\t\t\t\t\t\t\t\t\t\t$info=$object->run();\n\t\t\t\t\t\t\t\t\t\t\tforeach ($info as $i)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif (is_null($i)) continue;\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (($page==$i[2][0]) && (((!array_key_exists('type',$i[2][1])) && ($type=='misc')) || ((array_key_exists('type',$i[2][1])) && ($type==$i[2][1]['type']))) && ($zone==$i[2][2]))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($i[0]=='cms')\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$_url=build_url(array('page'=>'cms','type'=>$i[0]),'cms');\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$_url=build_url(array('page'=>'admin','type'=>$i[0]),'adminzone');\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\trequire_lang('menus');\n\t\t\t\t\t\t\t\t\t\t\t\t\trequire_lang('security');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tree->attach(hyperlink($_url,do_lang_tempcode(strtoupper($i[0]))));\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($type!='misc')\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>$page,'type'=>'misc'),$zone),$i[3]));\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak 2;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>$page),$zone),$page));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$_url=build_url(array('page'=>$page,'type'=>$type),$zone);\n\t\t\t\t\t\t\t\t$sup=$tree->is_empty()?NULL:do_lang_tempcode('LOCATED_IN',$tree);\n\t\t\t\t\t\t\t\t$site_tree_editor_url=build_url(array('page'=>'admin_sitetree','type'=>'site_tree','id'=>$zone.':'.$page),'adminzone');\n\t\t\t\t\t\t\t\t$permission_tree_editor_url=build_url(array('page'=>'admin_permissions','id'=>$zone.':'.$page),'adminzone');\n\t\t\t\t\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>$n,'URL'=>$_url,'TITLE'=>'','DESCRIPTION'=>do_lang_tempcode('FIND_IN_SITE_TREE_EDITOR',escape_html($site_tree_editor_url->evaluate()),escape_html($permission_tree_editor_url->evaluate())),'SUP'=>$sup)));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$current_results_type=do_lang('IMPORT');\n\t\tif (($this->_section_match($section_limitations,$current_results_type)) && (has_actual_page_access(get_member(),'admin_import')))\n\t\t{\n\t\t\t// Importers\n\t\t\t$content[$current_results_type]=new ocp_tempcode();\n\t\t\t$hooks=find_all_hooks('modules','admin_import');\n\t\t\tforeach (array_keys($hooks) as $hook)\n\t\t\t{\n\t\t\t\tif ($this->_keyword_match($hook))\n\t\t\t\t{\n\t\t\t\t\trequire_code('hooks/modules/admin_import/'.filter_naughty_harsh($hook));\n\t\t\t\t\t$_hook=object_factory('Hook_'.filter_naughty_harsh($hook));\n\t\t\t\t\t$info=$_hook->info();\n\t\t\t\t\t$name=$info['product'];\n\t\t\t\t\t$_url=build_url(array('page'=>'admin_import','type'=>'session','importer'=>$hook),get_module_zone('admin_import'));\n\t\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>$name,'URL'=>$_url,'TITLE'=>'','DESCRIPTION'=>'','SUP'=>'')));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$current_results_type=do_lang('CONFIGURATION');\n\t\tif ((($this->_section_match($section_limitations,$current_results_type)) || ($this->_section_match($section_limitations,do_lang('OPTION_CATEGORIES'))) || ($this->_section_match($section_limitations,do_lang('OPTION_GROUPS')))) && (has_actual_page_access(get_member(),'admin_config')))\n\t\t{\n\t\t\t// Config options- names, descriptions, groups, categories\n\t\t\t$content[$current_results_type]=new ocp_tempcode();\n\t\t\t$map=array();\n\t\t\tif (!is_null($GLOBALS['CURRENT_SHARE_USER'])) $map['shared_hosting_restricted']=0;\n\t\t\t$all_options=$GLOBALS['SITE_DB']->query_select('config',array('the_name','human_name','the_page','section','explanation','eval'),$map);\n\t\t\t$all_options[]=array('the_name'=>'timezone','human_name'=>'TIME_ZONE','config_value'=>'','the_type'=>'special','eval'=>'','the_page'=>'SITE','section'=>'GENERAL','explanation'=>'','shared_hosting_restricted'=>0);\n\t\t\t$config_categories=array();\n\t\t\t$conf_found_count=0;\n\t\t\tforeach ($all_options as $p)\n\t\t\t{\n\t\t\t\tif (defined('HIPHOP_PHP'))\n\t\t\t\t{\n\t\t\t\t\trequire_code('hooks/systems/config_default/'.$p['the_name']);\n\t\t\t\t\t$hook=object_factory('Hook_config_default_'.$p['the_name']);\n\t\t\t\t\t$null_test=$hook->get_default();\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$GLOBALS['REQUIRE_LANG_LOOP']=10; // LEGACY Workaround for corrupt webhost installers\n\t\t\t\t\t$null_test=eval($p['eval']);\n\t\t\t\t\t$GLOBALS['REQUIRE_LANG_LOOP']=0; // LEGACY\n\t\t\t\t}\n\n\t\t\t\tif (!is_null($null_test))\n\t\t\t\t{\n\t\t\t\t\t$n=do_lang_tempcode($p['human_name']);\n\t\t\t\t\tswitch ($p['the_name'])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'timezone':\n\t\t\t\t\t\t\t$t=do_lang('DESCRIPTION_TIMEZONE_SITE');\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$t=do_lang($p['explanation'],NULL,NULL,NULL,NULL,false);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (is_null($n)) continue;\n\t\t\t\t\t$config_value=array_key_exists('config_value',$p)?$p['config_value']:get_option($p['the_name']);\n\t\t\t\t\tif ($config_value===false) continue;\n\t\t\t\t\tif ((($this->_keyword_match($p['the_name'])) || ($this->_keyword_match($n->evaluate())) || ($this->_keyword_match($t)) || ($this->_keyword_match($config_value))))\n\t\t\t\t\t{\n\t\t\t\t\t\t$_url=build_url(array('page'=>'admin_config','type'=>'category','id'=>$p['the_page']),'adminzone');\n\t\t\t\t\t\t$url=$_url->evaluate();\n\t\t\t\t\t\t$url.='#group_'.$p['section'];\n\t\t\t\t\t\tif (is_null($t)) $t='';\n\t\t\t\t\t\t$tree=new ocp_tempcode();\n\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin','type'=>'setup'),'adminzone'),do_lang_tempcode('SETUP')));\n\t\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_config','type'=>'misc'),'adminzone'),do_lang_tempcode('CONFIGURATION')));\n\t\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_config','type'=>'category','id'=>$p['the_page']),'adminzone'),do_lang('CONFIG_CATEGORY_'.$p['the_page'])));\n\t\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t\t$tree->attach(hyperlink($url,do_lang($p['section'])));\n\t\t\t\t\t\t$sup=do_lang_tempcode('LOCATED_IN',$tree);\n\t\t\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>$n,'URL'=>$url,'TITLE'=>'','DESCRIPTION'=>protect_from_escaping($t),'SUP'=>$sup)));\n\n\t\t\t\t\t\tif ($conf_found_count>100)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$content[$current_results_type]=do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>do_lang_tempcode('TOO_MANY_TO_CHOOSE_FROM'),'URL'=>'','TITLE'=>'','DESCRIPTION'=>'','SUP'=>''));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$conf_found_count++;\n\n\t\t\t\t\t\tif (!array_key_exists($p['the_page'],$config_categories)) $config_categories[$p['the_page']]=array();\n\t\t\t\t\t\t$config_categories[$p['the_page']][$p['section']]=1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$current_results_type=do_lang('OPTION_CATEGORIES');\n\t\t\t$content[$current_results_type]=new ocp_tempcode();\n\t\t\t$current_results_type_2=do_lang('OPTION_GROUPS');\n\t\t\t$content[$current_results_type_2]=new ocp_tempcode();\n\t\t\tforeach ($config_categories as $p=>$groups)\n\t\t\t{\n\t\t\t\t$_n=do_lang('CONFIG_CATEGORY_'.$p,NULL,NULL,NULL,NULL,false);\n\t\t\t\tif (is_null($_n)) continue;\n\t\t\t\t$n=do_lang_tempcode('CONFIG_CATEGORY_'.$p);\n\t\t\t\tif ($this->_keyword_match($n->evaluate()))\n\t\t\t\t{\n\t\t\t\t\t$_url=build_url(array('page'=>'admin_config','type'=>'category','id'=>$p),'adminzone');\n\t\t\t\t\t$description=do_lang_tempcode('CONFIG_CATEGORY_DESCRIPTION__'.$p);\n\t\t\t\t\t$tree=new ocp_tempcode();\n\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin','type'=>'setup'),'adminzone'),do_lang_tempcode('SETUP')));\n\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_config','type'=>'misc'),'adminzone'),do_lang_tempcode('CONFIGURATION')));\n\t\t\t\t\t$sup=do_lang_tempcode('LOCATED_IN',$tree);\n\t\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>$n,'URL'=>$_url,'TITLE'=>'','DESCRIPTION'=>$description,'SUP'=>$sup)));\n\t\t\t\t}\n\t\t\t\tforeach (array_keys($groups) as $group)\n\t\t\t\t{\n\t\t\t\t\t$n2=do_lang($group,NULL,NULL,NULL,NULL,false);\n\t\t\t\t\tif (is_null($n2)) continue;\n\n\t\t\t\t\tif ($this->_keyword_match($n2))\n\t\t\t\t\t{\n\t\t\t\t\t\t$upload_max_filesize=(ini_get('upload_max_filesize')=='0')?do_lang('NA'):clean_file_size(php_return_bytes(ini_get('upload_max_filesize')));\n\t\t\t\t\t\t$post_max_size=(ini_get('post_max_size')=='0')?do_lang('NA'):clean_file_size(php_return_bytes(ini_get('post_max_size')));\n\t\t\t\t\t\t$_group_description=do_lang('CONFIG_GROUP_DESCRIP_'.$group,escape_html($post_max_size),escape_html($upload_max_filesize),NULL,NULL,false);\n\t\t\t\t\t\tif (is_null($_group_description))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$group_description=new ocp_tempcode();\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$group_description=do_lang_tempcode('CONFIG_GROUP_DESCRIP_'.$group,escape_html($post_max_size),escape_html($upload_max_filesize),false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$_url=build_url(array('page'=>'admin_config','type'=>'category','id'=>$p),'adminzone');\n\t\t\t\t\t\t$url=$_url->evaluate();\n\t\t\t\t\t\t$url.='#group_'.$group;\n\t\t\t\t\t\t$tree=new ocp_tempcode();\n\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin','type'=>'setup'),'adminzone'),do_lang_tempcode('SETUP')));\n\t\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_config','type'=>'misc'),'adminzone'),do_lang_tempcode('CONFIGURATION')));\n\t\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_config','type'=>'category','id'=>$p),'adminzone'),do_lang('CONFIG_CATEGORY_'.$p)));\n\t\t\t\t\t\t$sup=do_lang_tempcode('LOCATED_IN',$tree);\n\t\t\t\t\t\t$content[$current_results_type_2]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>$n2,'URL'=>$url,'TITLE'=>'','DESCRIPTION'=>$group_description,'SUP'=>$sup)));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$current_results_type=do_lang('USERGROUPS');\n\t\tif (($this->_section_match($section_limitations,$current_results_type)) && (has_actual_page_access(get_member(),'admin_ocf_groups')) && (get_forum_type()=='ocf'))\n\t\t{\n\t\t\t// Usergroups\n\t\t\t$content[$current_results_type]=new ocp_tempcode();\n\t\t\t$map=array('g_is_private_club'=>0);\n\t\t\t$all_groups=$GLOBALS['FORUM_DB']->query_select('f_groups',array('id','g_name'),$map);\n\t\t\tforeach ($all_groups as $p)\n\t\t\t{\n\t\t\t\t$n=get_translated_text($p['g_name']);\n\t\t\t\tif ($this->_keyword_match($n))\n\t\t\t\t{\n\t\t\t\t\t$_url=build_url(array('page'=>'admin_ocf_groups','type'=>'_ed','id'=>$p['id']),'adminzone');\n\t\t\t\t\t$url=$_url->evaluate();\n\t\t\t\t\t$tree=new ocp_tempcode();\n\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin','type'=>'security'),'adminzone'),do_lang_tempcode('SECURITY')));\n\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_ocf_groups','type'=>'misc'),'adminzone'),do_lang_tempcode('USERGROUPS')));\n\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_ocf_groups','type'=>'ed'),'adminzone'),do_lang_tempcode('EDIT_GROUP')));\n\t\t\t\t\t$sup=do_lang_tempcode('LOCATED_IN',$tree);\n\t\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>$n,'URL'=>$url,'TITLE'=>'','DESCRIPTION'=>'','SUP'=>$sup)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$current_results_type=do_lang('THEMES');\n\t\tif (($this->_section_match($section_limitations,$current_results_type)) && has_actual_page_access(get_member(),'admin_themes'))\n\t\t{\n\t\t\t// Themes\n\t\t\t$content[$current_results_type]=new ocp_tempcode();\n\t\t\t$map=array();\n\t\t\tforeach (array(do_lang('SUPPORTS_WIDE'),do_lang('MOBILE_PAGES')) as $n)\n\t\t\t{\n\t\t\t\tif ($this->_keyword_match($n))\n\t\t\t\t{\n\t\t\t\t\t$_url=build_url(array('page'=>'admin_themes','type'=>'edit_theme','theme'=>$GLOBALS['FORUM_DRIVER']->get_theme('')),'adminzone');\n\t\t\t\t\t$url=$_url->evaluate();\n\t\t\t\t\t$tree=new ocp_tempcode();\n\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin','type'=>'style'),'adminzone'),do_lang_tempcode('STYLE')));\n\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_themes','type'=>'misc'),'adminzone'),do_lang_tempcode('THEMES')));\n\t\t\t\t\t$sup=do_lang_tempcode('LOCATED_IN',$tree);\n\t\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>$n,'URL'=>$url,'TITLE'=>'','DESCRIPTION'=>'','SUP'=>$sup)));\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$current_results_type=do_lang('ZONES');\n\t\tif (($this->_section_match($section_limitations,$current_results_type)) && has_actual_page_access(get_member(),'admin_zones'))\n\t\t{\n\t\t\t// Zones\n\t\t\t$content[$current_results_type]=new ocp_tempcode();\n\t\t\t$map=array();\n\t\t\t$all_groups=$GLOBALS['SITE_DB']->query_select('zones',array('zone_name','zone_title','zone_header_text'),$map,'ORDER BY zone_title',50/*reasonable limit; zone_title is sequential for default zones*/);\n\t\t\tforeach ($all_groups as $p)\n\t\t\t{\n\t\t\t\t$n=$p['zone_name'];\n\t\t\t\t$t=get_translated_text($p['zone_title']);\n\t\t\t\t$ht=get_translated_text($p['zone_header_text']);\n\t\t\t\tif (($this->_keyword_match($n)) || ($this->_keyword_match($t)) || ($this->_keyword_match($ht)))\n\t\t\t\t{\n\t\t\t\t\t$_url=build_url(array('page'=>'admin_zones','type'=>'_edit','id'=>$p['zone_name']),'adminzone');\n\t\t\t\t\t$url=$_url->evaluate();\n\t\t\t\t\t$tree=new ocp_tempcode();\n\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin','type'=>'setup'),'adminzone'),do_lang_tempcode('STRUCTURE')));\n\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_zones','type'=>'misc'),'adminzone'),do_lang_tempcode('ZONES')));\n\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_zones','type'=>'edit'),'adminzone'),do_lang_tempcode('EDIT_ZONE')));\n\t\t\t\t\t$sup=do_lang_tempcode('LOCATED_IN',$tree);\n\t\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>$n,'URL'=>$url,'TITLE'=>'','DESCRIPTION'=>escape_html($t),'SUP'=>$sup)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Blocks\n\t\t$current_results_type=do_lang('_BLOCKS');\n\t\tif ($this->_section_match($section_limitations,$current_results_type))\n\t\t{\n\t\t\t$content[$current_results_type]=new ocp_tempcode();\n\t\t\t$map=array();\n\t\t\trequire_code('zones2');\n\t\t\t$all_blocks=find_all_blocks();\n\t\t\tforeach (array_keys($all_blocks) as $p)\n\t\t\t{\n\t\t\t\t$t=do_lang('BLOCK_'.$p.'_DESCRIPTION');\n\t\t\t\tif (($this->_keyword_match($p)) || ($this->_keyword_match($t)))\n\t\t\t\t{\n\t\t\t\t\t$url='';\n\t\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>$p,'URL'=>$url,'TITLE'=>'','DESCRIPTION'=>escape_html($t))));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$current_results_type=do_lang('SPECIFIC_PERMISSIONS');\n\t\tif (($this->_section_match($section_limitations,$current_results_type)) && (has_actual_page_access(get_member(),'admin_permissions')))\n\t\t{\n\t\t\t// Privileges- sections/names/descriptions\n\t\t\t$content[$current_results_type]=new ocp_tempcode();\n\t\t\t$all_permissions=$GLOBALS['SITE_DB']->query_select('sp_list',array('the_name','p_section'));\n\t\t\t$pt_sections=array();\n\t\t\tforeach ($all_permissions as $p)\n\t\t\t{\n\t\t\t\t$n=do_lang('PT_'.$p['the_name'],NULL,NULL,NULL,NULL,false);\n\t\t\t\tif (is_null($n)) continue;\n\t\t\t\tif (($this->_keyword_match($n)) || ($this->_keyword_match($p['the_name'])))\n\t\t\t\t{\n\t\t\t\t\t$_url=build_url(array('page'=>'admin_permissions','type'=>'specific','id'=>$p['p_section']),'adminzone');\n\t\t\t\t\t$tree=new ocp_tempcode();\n\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin','type'=>'security'),'adminzone'),do_lang_tempcode('SECURITY')));\n\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_permissions','type'=>'specific'),'adminzone'),do_lang_tempcode('SPECIFIC_PERMISSIONS')));\n\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t$tree->attach(hyperlink($_url,do_lang($p['p_section'])));\n\t\t\t\t\t$sup=do_lang_tempcode('LOCATED_IN',$tree);\n\t\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>$n,'URL'=>$_url,'TITLE'=>'','DESCRIPTION'=>'','SUP'=>$sup)));\n\t\t\t\t}\n\t\t\t\t$pt_sections[$p['p_section']]=1;\n\t\t\t}\n\t\t\t$current_results_type=do_lang('SPECIFIC_PERMISSION_SECTIONS');\n\t\t\t$content[$current_results_type]=new ocp_tempcode();\n\t\t\tforeach (array_keys($pt_sections) as $p)\n\t\t\t{\n\t\t\t\t$n=do_lang($p,NULL,NULL,NULL,NULL,false);\n\t\t\t\tif (is_null($n)) continue;\n\t\t\t\tif (($this->_keyword_match($n)) || ($this->_keyword_match($p)))\n\t\t\t\t{\n\t\t\t\t\t$_url=build_url(array('page'=>'admin_permissions','type'=>'specific','id'=>$p),'adminzone');\n\t\t\t\t\t$tree=new ocp_tempcode();\n\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin','type'=>'security'),'adminzone'),do_lang_tempcode('SECURITY')));\n\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_permissions','type'=>'specific'),'adminzone'),do_lang_tempcode('SPECIFIC_PERMISSIONS')));\n\t\t\t\t\t$sup=do_lang_tempcode('LOCATED_IN',$tree);\n\t\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>$n,'URL'=>$_url,'TITLE'=>'','DESCRIPTION'=>'','SUP'=>$sup)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$current_results_type=do_lang('USERGROUP_SETTINGS');\n\t\tif (($this->_section_match($section_limitations,$current_results_type)) && (get_forum_type()=='ocf') && (has_actual_page_access(get_member(),'admin_ocf_groups','adminzone')))\n\t\t{\n\t\t\t// Usergroup settings\n\t\t\t$content[$current_results_type]=new ocp_tempcode();\n\t\t\t$applicable_langstrings=array(\n\t\t\t\tarray('ENQUIRE_ON_NEW_IPS','DESCRIPTION_ENQUIRE_ON_NEW_IPS'),\n\t\t\t\tarray('FLOOD_CONTROL_ACCESS_SECS','DESCRIPTION_FLOOD_CONTROL_ACCESS_SECS'),\n\t\t\t\tarray('FLOOD_CONTROL_SUBMIT_SECS','DESCRIPTION_FLOOD_CONTROL_SUBMIT_SECS'),\n\t\t\t\tarray('MAX_ATTACHMENTS_PER_POST','DESCRIPTION_MAX_ATTACHMENTS_PER_POST'),\n\t\t\t\tarray('MAX_DAILY_UPLOAD_MB','DESCRIPTION_MAX_DAILY_UPLOAD_MB'),\n\t\t\t\tarray('MAX_AVATAR_WIDTH','DESCRIPTION_MAX_AVATAR_WIDTH'),\n\t\t\t\tarray('MAX_AVATAR_HEIGHT','DESCRIPTION_MAX_AVATAR_HEIGHT'),\n\t\t\t\tarray('MAX_POST_LENGTH_COMCODE','DESCRIPTION_MAX_POST_LENGTH_COMCODE'),\n\t\t\t\tarray('MAX_SIG_LENGTH_COMCODE','DESCRIPTION_MAX_SIG_LENGTH_COMCODE'),\n\t\t\t);\n\t\t\tif (addon_installed('points'))\n\t\t\t{\n\t\t\t\t$applicable_langstrings=array_merge($applicable_langstrings,array(\n\t\t\t\t\tarray('GIFT_POINTS_BASE','DESCRIPTION_GIFT_POINTS_BASE'),\n\t\t\t\t\tarray('GIFT_POINTS_PER_DAY','DESCRIPTION_GIFT_POINTS_PER_DAY'),\n\t\t\t\t));\n\t\t\t}\n\t\t\tforeach ($applicable_langstrings as $_langstring)\n\t\t\t{\n\t\t\t\t$array=is_array($_langstring)?$_langstring:array($_langstring);\n\t\t\t\tforeach ($array as $langstring)\n\t\t\t\t{\n\t\t\t\t\t$n=do_lang($langstring);\n\t\t\t\t\tif ($this->_keyword_match($n))\n\t\t\t\t\t{\n\t\t\t\t\t\t$n=do_lang_tempcode($array[0]);\n\t\t\t\t\t\t$_url=build_url(array('page'=>'admin_ocf_groups','type'=>'ed'),'adminzone');\n\t\t\t\t\t\t$descrip=array_key_exists(1,$array)?do_lang_tempcode($array[1]):new ocp_tempcode();\n\t\t\t\t\t\t$tree=new ocp_tempcode();\n\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin','type'=>'security'),'adminzone'),do_lang_tempcode('SECURITY')));\n\t\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_ocf_groups','type'=>'misc'),'adminzone'),do_lang_tempcode('USERGROUPS')));\n\t\t\t\t\t\t$sup=do_lang_tempcode('LOCATED_IN',$tree);\n\t\t\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>$n,'URL'=>$_url,'TITLE'=>'','DESCRIPTION'=>$descrip,'SUP'=>$sup)));\n\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$current_results_type=do_lang('MEMBER_SETTINGS');\n\t\tif (($this->_section_match($section_limitations,$current_results_type)) && (get_forum_type()=='ocf') && (has_actual_page_access(get_member(),'members')))\n\t\t{\n\t\t\t// Member settings\n\t\t\t$content[$current_results_type]=new ocp_tempcode();\n\t\t\t$applicable_langstrings=array(\n\t\t\t\tarray('WIDE','DESCRIPTION_WIDE'),\n\t\t\t\tarray('REVEAL_AGE','DESCRIPTION_REVEAL_AGE'),\n\t\t\t\tarray('PREVIEW_POSTS','DESCRIPTION_PREVIEW_POSTS'),\n\t\t\t\tarray('AUTO_NOTIFICATION_CONTRIB_CONTENT','DESCRIPTION_AUTO_NOTIFICATION_CONTRIB_CONTENT'),\n\t\t\t\tarray('PT_RULES_TEXT','PT_RULES_TEXT_DESCRIPTION'),\n\t\t\t);\n\t\t\tforeach ($applicable_langstrings as $_langstring)\n\t\t\t{\n\t\t\t\t$array=is_array($_langstring)?$_langstring:array($_langstring);\n\t\t\t\tforeach ($array as $langstring)\n\t\t\t\t{\n\t\t\t\t\t$n=do_lang($langstring);\n\t\t\t\t\tif ($this->_keyword_match($n))\n\t\t\t\t\t{\n\t\t\t\t\t\t$n=do_lang_tempcode($array[0]);\n\t\t\t\t\t\t$descrip=array_key_exists(1,$array)?do_lang_tempcode($array[1]):new ocp_tempcode();\n\t\t\t\t\t\t$_url=build_url(array('page'=>'members','type'=>'view'),get_module_zone('members'),NULL,false,false,false,'tab__edit');\n\t\t\t\t\t\t$url=$_url->evaluate();\n\t\t\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>$n,'URL'=>$url,'TITLE'=>'','DESCRIPTION'=>$descrip)));\n\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Zone options\n\t\t$current_results_type=do_lang('ZONE_OPTIONS');\n\t\tif (($this->_section_match($section_limitations,$current_results_type)) && (has_actual_page_access(get_member(),'admin_zones','adminzone')))\n\t\t{\n\t\t\t$content[$current_results_type]=new ocp_tempcode();\n\t\t\t$applicable_langstrings=array(\n\t\t\t\tarray('DEFAULT_PAGE','DESCRIPTION_DEFAULT_PAGE'),\n\t\t\t\tarray('HEADER_TEXT','DESCRIPTION_HEADER_TEXT'),\n\t\t\t\tarray('WIDE','DESCRIPTION_WIDE'),\n\t\t\t\tarray('REQUIRE_SESSION','DESCRIPTION_REQUIRE_SESSION'),\n\t\t\t\tarray('DISPLAYED_IN_MENU','DESCRIPTION_DISPLAYED_IN_MENU'),\n\t\t\t\tarray('THEME',(get_forum_type()=='ocf')?'_DESCRIPTION_THEME_OCF':'_DESCRIPTION_THEME'),\n\t\t\t);\n\t\t\tforeach ($applicable_langstrings as $_langstring)\n\t\t\t{\n\t\t\t\t$array=is_array($_langstring)?$_langstring:array($_langstring);\n\t\t\t\tforeach ($array as $langstring)\n\t\t\t\t{\n\t\t\t\t\t$n=do_lang($langstring);\n\t\t\t\t\tif ($this->_keyword_match($n))\n\t\t\t\t\t{\n\t\t\t\t\t\t$n=do_lang_tempcode($array[0]);\n\t\t\t\t\t\t$_url=build_url(array('page'=>'admin_zones','type'=>'edit'),'adminzone');\n\t\t\t\t\t\t$descrip=array_key_exists(1,$array)?do_lang_tempcode($array[1]):new ocp_tempcode();\n\t\t\t\t\t\t$tree=new ocp_tempcode();\n\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin','type'=>'structure'),'adminzone'),do_lang_tempcode('STRUCTURE')));\n\t\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_zones','type'=>'misc'),'adminzone'),do_lang_tempcode('ZONES')));\n\t\t\t\t\t\t$sup=do_lang_tempcode('LOCATED_IN',$tree);\n\t\t\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>$n,'URL'=>$_url,'TITLE'=>'','DESCRIPTION'=>$descrip,'SUP'=>$sup)));\n\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Install options\n\t\t$current_results_type=do_lang('BASE_CONFIGURATION');\n\t\tif (($this->_section_match($section_limitations,$current_results_type)) && ($GLOBALS['FORUM_DRIVER']->is_super_admin(get_member())))\n\t\t{\n\t\t\t$content[$current_results_type]=new ocp_tempcode();\n\t\t\tif (file_exists(get_file_base().'/config_editor.php'))\n\t\t\t{\n\t\t\t\t$file_contents=file_get_contents(get_file_base().'/config_editor.php');\n\t\t\t\t$matches=array();\n\t\t\t\t$num_matches=preg_match_all('#case \\'([^\\']+)\\':\\n\\s*\\$notes=\\'([^\\']+)\\';#',$file_contents,$matches);\n\t\t\t\tfor ($i=0;$i<$num_matches;$i++)\n\t\t\t\t{\n\t\t\t\t\t$n=stripslashes($matches[2][$i]);\n\t\t\t\t\tif ($this->_keyword_match($n))\n\t\t\t\t\t{\n\t\t\t\t\t\t$url=get_base_url().'/config_editor.php';\n\t\t\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>stripslashes($matches[1][$i]),'URL'=>$url,'TITLE'=>'','DESCRIPTION'=>$n)));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Language string names and contents\n\t\t$current_results_type=do_lang('MODULE_TRANS_NAME_admin_lang');\n\t\tif (($this->_section_match($section_limitations,$current_results_type)) && (has_actual_page_access(get_member(),'admin_lang','adminzone')))\n\t\t{\n\t\t\t$content[$current_results_type]=new ocp_tempcode();\n\n\t\t\tif (user_lang()!=fallback_lang())\n\t\t\t\t$content[$current_results_type]->attach(paragraph(do_lang_tempcode('SEARCH_LAUNCHPAD',escape_html(urlencode($raw_search_string)),escape_html(urlencode(user_lang())))));\n\n\t\t\tglobal $LANGUAGE;\n\t\t\t$lang_file_contents=array();\n\t\t\t$lang_found=array();\n\t\t\tforeach ($LANGUAGE[user_lang()] as $n=>$n_value) // Search all lang strings (we loaded all earlier with require_all_lang)\n\t\t\t{\n\t\t\t\tif (($this->_keyword_match($n)) || ($this->_keyword_match($n_value)))\n\t\t\t\t{\n\t\t\t\t\t$lang_found[$n]=$n_value;\n\t\t\t\t\tif (count($lang_found)>100)\n\t\t\t\t\t{\n\t\t\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>do_lang_tempcode('TOO_MANY_TO_CHOOSE_FROM'),'URL'=>'','TITLE'=>'','DESCRIPTION'=>'','SUP'=>'')));\n\t\t\t\t\t\t$lang_found=array();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ($lang_found as $n=>$n_value)\n\t\t\t{\n\t\t\t\t// Try and find what lang file it came from\n\t\t\t\t$lang_file='global';\n\t\t\t\tforeach (array('lang','lang_custom') as $lang_dir)\n\t\t\t\t{\n\t\t\t\t\t$dh=@opendir(get_file_base().'/'.$lang_dir.'/'.fallback_lang().'/');\n\t\t\t\t\tif ($dh!==false)\n\t\t\t\t\t{\n\t\t\t\t\t\twhile (($file=readdir($dh))!==false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (substr(strtolower($file),-4)=='.ini')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (!array_key_exists($file,$lang_file_contents))\n\t\t\t\t\t\t\t\t\t$lang_file_contents[$file]=file_get_contents(get_file_base().'/'.$lang_dir.'/'.fallback_lang().'/'.$file);\n\t\t\t\t\t\t\t\tif ((preg_match('#^'.str_replace('#','\\#',preg_quote($n)).'=#m',$lang_file_contents[$file])!=0) || ((file_exists(get_custom_file_base().'/lang_custom/'.user_lang().'/'.$file)) && (preg_match('#^'.str_replace('#','\\#',preg_quote($n)).'=#m',file_get_contents(get_custom_file_base().'/lang_custom/'.user_lang().'/'.$file))!=0)))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$lang_file=basename($file,'.ini');\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$_url=build_url(array('page'=>'admin_lang','type'=>'misc','lang'=>user_lang(),'lang_file'=>$lang_file),'adminzone');\n\t\t\t\t$url=$_url->evaluate();\n\t\t\t\t$url.='#jmp_'.$n;\n\t\t\t\t$tree=new ocp_tempcode();\n\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin','type'=>'style'),'adminzone'),do_lang_tempcode('STYLE')));\n\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_lang','type'=>'misc'),'adminzone'),do_lang_tempcode('TRANSLATE_CONTENT')));\n\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_lang','type'=>'misc','lang'=>user_lang(),'lang_file'=>$lang_file),'adminzone'),$lang_file));\n\t\t\t\t$sup=do_lang_tempcode('LOCATED_IN',$tree);\n\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>$n,'URL'=>$url,'TITLE'=>'','DESCRIPTION'=>escape_html($n_value),'SUP'=>$sup)));\n\t\t\t}\n\t\t\t$lang_file_contents=array();\n\t\t}\n\n\t\t// Theme images\n\t\t$current_results_type=do_lang('MANAGE_THEME_IMAGES');\n\t\tif (($this->_section_match($section_limitations,$current_results_type)) && (has_actual_page_access(get_member(),'admin_themes','adminzone')))\n\t\t{\n\t\t\t$content[$current_results_type]=new ocp_tempcode();\n\t\t\t$images=$GLOBALS['SITE_DB']->query_select('theme_images',array('id','theme','lang'));\n\t\t\tforeach ($images as $image)\n\t\t\t{\n\t\t\t\t$n=$image['id'];\n\t\t\t\tif ($this->_keyword_match($n))\n\t\t\t\t{\n\t\t\t\t\t$_url=build_url(array('page'=>'admin_themes','type'=>'edit_image','theme'=>$image['theme'],'lang'=>$image['lang'],'id'=>$n),'adminzone');\n\t\t\t\t\t$tree=new ocp_tempcode();\n\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin','type'=>'style'),'adminzone'),do_lang_tempcode('STYLE')));\n\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_themes','type'=>'misc'),'adminzone'),do_lang_tempcode('THEMES')));\n\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_themes','type'=>'manage_images','theme'=>$image['theme']),'adminzone'),do_lang_tempcode('EDIT_THEME_IMAGE')));\n\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t$tree->attach(escape_html($image['theme']));\n\t\t\t\t\t$sup=do_lang_tempcode('LOCATED_IN',$tree);\n\t\t\t\t\t$lang=$image['lang'];\n\t\t\t\t\t$lang_map=better_parse_ini_file(file_exists(get_file_base().'/lang_custom/langs.ini')?(get_file_base().'/lang_custom/langs.ini'):(get_file_base().'/lang/langs.ini'));\n\t\t\t\t\t$lang=array_key_exists($lang,$lang_map)?$lang_map[$lang]:$lang;\n\t\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>$n,'URL'=>$_url,'TITLE'=>'','DESCRIPTION'=>$lang,'SUP'=>$sup)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Template names\n\t\t$current_results_type=do_lang('TEMPLATES');\n\t\tif (($this->_section_match($section_limitations,$current_results_type)) && (has_actual_page_access(get_member(),'admin_themes','adminzone')))\n\t\t{\n\t\t\t$content[$current_results_type]=new ocp_tempcode();\n\t\t\t$tpl_found=array();\n\t\t\tforeach (array('templates_custom','templates') as $template_dir)\n\t\t\t{\n\t\t\t\t$dh=opendir(get_file_base().'/themes/default/'.$template_dir.'/');\n\t\t\t\twhile (($file=readdir($dh))!==false)\n\t\t\t\t{\n\t\t\t\t\tif ((substr(strtolower($file),-4)=='.tpl') && (!array_key_exists($file,$tpl_found)))\n\t\t\t\t\t{\n\t\t\t\t\t\t$n=$file;\n\t\t\t\t\t\tif (($this->_keyword_match(basename($n,'.tpl'))) || ($this->_keyword_match($n)) || (($template_dir=='templates_custom') && ($this->_keyword_match(file_get_contents(get_file_base().'/themes/default/'.$template_dir.'/'.$n)))))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_url=build_url(array('page'=>'admin_themes','type'=>'_edit_templates','theme'=>$default_theme,'f0file'=>$file),'adminzone');\n\t\t\t\t\t\t\t$tree=new ocp_tempcode();\n\t\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin','type'=>'style'),'adminzone'),do_lang_tempcode('STYLE')));\n\t\t\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_themes','type'=>'misc'),'adminzone'),do_lang_tempcode('THEMES')));\n\t\t\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_themes','type'=>'edit_templates','theme'=>$default_theme),'adminzone'),do_lang_tempcode('EDIT_TEMPLATES')));\n\t\t\t\t\t\t\t$sup=do_lang_tempcode('LOCATED_IN',$tree);\n\t\t\t\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>$n,'URL'=>$_url,'TITLE'=>'','DESCRIPTION'=>'','SUP'=>$sup)));\n\t\t\t\t\t\t\t$tpl_found[$file]=1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// CSS file contents\n\t\t$current_results_type='CSS';\n\t\tif (($this->_section_match($section_limitations,$current_results_type)) && (has_actual_page_access(get_member(),'admin_themes','adminzone')))\n\t\t{\n\t\t\t$content[$current_results_type]=new ocp_tempcode();\n\t\t\t$dh=opendir(get_file_base().'/themes/default/css/');\n\t\t\twhile (($file=readdir($dh))!==false)\n\t\t\t{\n\t\t\t\tif (substr(strtolower($file),-4)=='.css')\n\t\t\t\t{\n\t\t\t\t\t$n=$file;\n\t\t\t\t\tif ($this->_keyword_match(file_get_contents(get_file_base().'/themes/default/css/'.$n)))\n\t\t\t\t\t{\n\t\t\t\t\t\t$_url=build_url(array('page'=>'admin_themes','type'=>'edit_css','theme'=>$default_theme,'file'=>$file),'adminzone');\n\t\t\t\t\t\t$url=$_url->evaluate();\n\t\t\t\t\t\tif (isset($keywords[0]))\n\t\t\t\t\t\t\t$url.='#'.$keywords[0][0];\n\t\t\t\t\t\t$tree=new ocp_tempcode();\n\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin','type'=>'style'),'adminzone'),do_lang_tempcode('STYLE')));\n\t\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_themes','type'=>'misc'),'adminzone'),do_lang_tempcode('THEMES')));\n\t\t\t\t\t\t$tree->attach(do_template('BREADCRUMB_ESCAPED'));\n\t\t\t\t\t\t$tree->attach(hyperlink(build_url(array('page'=>'admin_themes','type'=>'choose_css','theme'=>$default_theme),'adminzone'),do_lang_tempcode('EDIT_CSS')));\n\t\t\t\t\t\t$sup=do_lang_tempcode('LOCATED_IN',$tree);\n\t\t\t\t\t\t$content[$current_results_type]->attach(do_template('INDEX_SCREEN_FANCIER_ENTRY',array('NAME'=>$n,'URL'=>$url,'TITLE'=>'','DESCRIPTION'=>'','SUP'=>$sup)));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//ksort($content);\t\tDon't sort, we have an implicit good order in this code file\n\n\t\t// And show results...\n\t\tif (addon_installed('search'))\n\t\t{\n\t\t\t$_search_url=build_url(array('page'=>'search','type'=>'results','content'=>$raw_search_string,'days'=>'-1','search_comcode_pages'=>1,'all_defaults'=>1),get_module_zone('search'));\n\t\t\t$search_url=$_search_url->evaluate();\n\t\t\t$software_search_url=brand_base_url().'/site/index.php?page=search&type=results&search_under=docs&search_comcode_pages=1&days=-1&content='.urlencode($raw_search_string);\n\t\t\t$software_search_url_2=brand_base_url().'/site/index.php?page=search&type=results&search_ocf_posts=1&days=-1&content='.urlencode($raw_search_string);\n\t\t\t$pre=do_lang_tempcode('ADMINZONE_SEARCH_RESULTS',escape_html($raw_search_string),escape_html($search_url),array(escape_html($software_search_url),escape_html($software_search_url_2)));\n\t\t} else $pre=new ocp_tempcode();\n\t\t$found_some=false;\n\t\tforeach ($content as $c)\n\t\t{\n\t\t\tif (!$c->is_empty())\n\t\t\t{\n\t\t\t\t$found_some=true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$post=((strpos($raw_search_string,'\"')!==false) || (!$found_some))?new ocp_tempcode():do_lang_tempcode('ADMINZONE_SEARCH_TIP',escape_html(preg_replace('#\\s@\\w+#','',$raw_search_string)));\n\n\t\tif ((!$found_some) && ($this->and_query)) // Oh well, try as an OR query then\n\t\t{\n\t\t\t$this->and_query=false;\n\t\t\treturn $this->search();\n\t\t}\n\n\t\treturn do_template('INDEX_SCREEN_FANCIER_SCREEN',array('TITLE'=>get_page_title('ADMIN_ZONE_SEARCH_RESULTS'),'EMPTY'=>$found_some?NULL:true,'ARRAY'=>true,'CONTENT'=>$content,'PRE'=>$pre,'POST'=>$post));\n\t}", "private function getSearch() {\n\t\tif( $_SESSION['privilege'] != 'anon' ) {\n\n\t\t\t// If NOT anon then IS logged in so set userID to SESSION['id'] \n\t\t\t$userID = $_SESSION['id'];\n\n\t\t} else {\n\t\t\t\n\t\t\t// For this function default $userID to non-exitent user # 0 \n\t\t\t$userID = 0;\n\n\t\t}\n\n\t\t// Set search term per input OR blank\n\n\t\tif( !isset($_POST['search'])) {\n\t\t\t$_POST['search'] = \"\";\n\t\t}\n\t\t\n\t\tif(strlen($_POST['search']) === 0) {\n\t\t\t$searchTerm = \"\";\n\n\t\t} else {\n\t\t\t$result = $_POST['search'];\n\t\t\t$searchTerm = strtolower($result);\n\t\t}\n\n\t\t$this->data['searchTerm'] = $searchTerm;\n\n\t\t$sql = \"SELECT posts.id, title AS score_title, intro AS score_intro, article AS score_article\n\t\t\tFROM posts\n\t\t\tWHERE\n\t\t\t\t(title LIKE '%$searchTerm%' OR \n\t\t\t\tintro LIKE '%$searchTerm%' OR\n\t\t\t\tarticle LIKE '%$searchTerm%')\";\n\n\t\tif( $_SESSION['privilege'] != 'admin' ) {\n\n\t\t\t$sql .= \" AND (user_id = $userID\n\t\t\t\t\tOR status = 'Approved')\t\n\t\t\t\t\tORDER BY score_title ASC\";\n\t\t\n\t\t} else {\n\n\t\t\t$sql .= \" ORDER BY score_title ASC\";\t\n\n\t\t}\t\t\n\t\n\t\t$result = $this->dbc->query($sql);\n\n\t\tif( !$result || $result->num_rows == 0) {\n\t\t\t$this->data['searchResults'] = \"No results\";\n\t\t} else {\n\t\t\t$this->data['searchResults'] = $result->fetch_all(MYSQLI_ASSOC);\n\t\t}\n\t}", "public function GetSearch(){\n if($this->get_request_method()!= \"POST\"){\n $this->response('',406);\n }\n $user_id = $_POST['user_id'];\n $keyword = $_POST['keyword'];\n $type = $_POST['type'];\n $user_auth_key = $_POST['user_auth_key'];\n $latitude = $_POST['latitude'];\n $longitude = $_POST['longitude'];\n $page_no = $_POST['page_no'];\n $format = $_POST['format'];\n $db_access = $this->dbConnect();\n $conn = $this->db;\n $res = new getService();\n if(!empty($keyword) && !empty($type) && !empty($user_auth_key) && !empty($page_no)){\n $result = $res->CheckAuthentication($user_id, $user_auth_key, $conn);\n if($result != false){\n $res->get_search($user_id, $keyword, $type, $latitude, $longitude, $page_no, $conn);\n $this->dbClose();\n }\n else{\n $this->dbclose();\n $error = array('status' => \"0\", \"msg\" => \"Not Authorised To get detail\");\n ($_REQUEST['format']=='xml')?$this->response($this->xml($error), 200):$this->response($res->json($error), 200);\n }\n }\n else{\n $error = array('status' => \"0\", \"msg\" => \"Fill All Fields\");\n ($_REQUEST['format']=='xml')?$this->response($this->xml($error), 200):$this->response($res->json($error), 200);\n }\n }", "public function search($params) {\n\t\t$callUrl = \"https://en.wikipedia.org/w/api.php?action=query&list=search&utf8=&format=json&srlimit=5&srsearch=\".urlencode($params[\"q\"]);\n\n\t\t/**\n\t\t* Create curl request and send it\n\t\t*/\n\t\t$process = curl_init($callUrl);\n\t\tcurl_setopt($process, CURLOPT_HTTPHEADER, array('Accept: application/json'));\n\t\tcurl_setopt($process, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($process, CURLOPT_TIMEOUT, 5);\n\t\tcurl_setopt($process, CURLOPT_RETURNTRANSFER, TRUE);\n\t\t$text = curl_exec($process);\n\t\tcurl_close($process);\n\t\t$raw = json_decode($text);\n\n\t\t/**\n\t\t * return message, if we could not get any results\n\t\t */\n\t\tif( count($raw->query->search) <= 0 ) {\n\t\t\t$answer = new Answer();\n\t\t\t$answer->addText(\"Unfortunately I was not able to find anything for *\" . $params[\"q\"] . \"*.\");\n\t\t\treturn $answer;\n\t\t}\n\n\t\t/**\n\t\t * get results into list\n\t\t */\n\t\t$answer = new Answer();\n\t\t$answer->addText(\"Here are the top wikipedia articles for *\" . $params[\"q\"] . \"*: \");\n\n\t\tforeach($raw->query->search as $res) {\n\t\t\t$answer->addAttachment(\n\t\t\t\tnew Attachment(\n\t\t\t\t\t$res->title,\n\t\t\t\t\tstrip_tags($res->snippet),\n\t\t\t\t\t\"https://en.wikipedia.org/wiki/\" . rawurlencode($res->title)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn $answer;\n\t}" ]
[ "0.7596438", "0.74730897", "0.7405362", "0.7267051", "0.716777", "0.7147625", "0.6984506", "0.69432247", "0.6934082", "0.68978876", "0.6779909", "0.67794234", "0.6776836", "0.67475784", "0.67475784", "0.67432684", "0.67276835", "0.6668217", "0.6656132", "0.6567901", "0.6552493", "0.654868", "0.65439355", "0.65200305", "0.6518319", "0.650361", "0.64876413", "0.6471368", "0.6468047", "0.64542145", "0.64508605", "0.6427984", "0.6422664", "0.6387509", "0.6379469", "0.6371309", "0.63640285", "0.63612676", "0.63533485", "0.6349487", "0.6342279", "0.6341683", "0.6315286", "0.6309065", "0.6308239", "0.62899053", "0.6285551", "0.6263689", "0.62604773", "0.6230083", "0.62285525", "0.6223406", "0.62073225", "0.62016165", "0.61882174", "0.61813927", "0.61810976", "0.6172417", "0.6170106", "0.6162965", "0.616242", "0.61607504", "0.61565244", "0.6149606", "0.61472195", "0.61465406", "0.6139803", "0.6122848", "0.6116029", "0.61074865", "0.610232", "0.610173", "0.6100654", "0.60988146", "0.60762364", "0.60743445", "0.6061891", "0.6059276", "0.60548013", "0.60464835", "0.6036755", "0.60275257", "0.60243", "0.60225827", "0.6020721", "0.6011875", "0.6011875", "0.6007761", "0.6007618", "0.6006468", "0.5999809", "0.5990868", "0.59866637", "0.59852254", "0.5985141", "0.5983838", "0.5982957", "0.59817165", "0.59748966", "0.5973945" ]
0.7809321
0
Query the Business API by business_id
function get_business($business_id) { $business_path = $GLOBALS['BUSINESS_PATH'] . urlencode($business_id); return request($GLOBALS['API_HOST'], $business_path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_business($bearer_token, $business_id) {\n $business_path = $GLOBALS['BUSINESS_PATH'] . urlencode($business_id);\n \n return request($GLOBALS['API_HOST'], $business_path);\n}", "function GetBusiness($businessId)\n\t{\n\t\t$result = $this->sendRequest(\"GetBusiness\", array(\"BusinessId\"=>$businessId));\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "function get_business_details($business_id) {\n\n //converts into '/v3/businesses/{id}'\n $business_path = $GLOBALS['BUSINESS_PATH'] . urlencode($business_id);\n \n $response = request($GLOBALS['API_HOST'], $business_path);\n\n $pretty_response = json_encode(json_decode($response), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\n\n $data = json_decode($pretty_response, true);\n\n //var_dump($data);\n\n return $data;\n}", "function select_business_data($bus_id)\n\t{\n\t\tglobal $db;\n\n\t\t$sql = \"SELECT * FROM \" . GARAGE_BUSINESS_TABLE . \" WHERE id = '$bus_id' \";\n\n\t\tif( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could Not Select Model', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\t$row = $db->sql_fetchrow($result);\n\t\t$db->sql_freeresult($result);\n\n\t\treturn $row;\n\t}", "public function getBusinessId()\n {\n return $this->business_id;\n }", "public function getBusinessId()\n {\n return $this->business_id;\n }", "public function getBusinessId()\n {\n return $this->business_id;\n }", "public function getBusinessId()\n {\n return $this->business_id;\n }", "public function getBusinessId()\n {\n return $this->business_id;\n }", "public function getBusinessById($id) {\n\t\t$em = $this->getEntityManager();\n\t\t/** @var $business Business */\n\t\t$business = $em->getRepository('Business')->findOneByBusinessID($id);\n\t\tif (empty($business)) {\n\t\t\treturn $this->respondError(\"Invalid business ID\", 400);\n\t\t}\n\t\t\n\t\t$response = $business;\n\t\t\n\t\t// Is parent?\n\t\tif ($business->getParentBusinessID() == 0) {\n\t\t\t// Get the children\n\t\t\t$children = $em->getRepository('Business')->findBy(array(\n\t\t\t\t'parentBusinessID' => $business->getBusinessID()\n\t\t\t));\n\t\t\t$response->children = $children;\n\t\t}\n\t\telse {\n\t\t\t// Get the parent\n\t\t\tif ($business->getParentBusinessID() != $business->getBusinessID()) {\n\t\t\t\t$parent = $em->getRepository('Business')->findOneBy(array(\n\t\t\t\t\t'businessID' => $business->getParentBusinessID()\n\t\t\t\t));\n\t\t\t\t$response->parent = $parent;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Add meta data\n\t\t$metaData = $em->getRepository('MetaData')->findBy(array(\n\t\t\t'type' => 'business',\n\t\t\t'typeID' => $business->getBusinessID()\n\t\t), array(\n\t\t\t'valueOrder' => 'ASC'\n\t\t));\n\t\t$response->meta_data = $metaData;\n\t\t\n\t\treturn $this->respond($response);\n\t}", "public function show(Business $business)\n {\n //\n }", "public function getBusiness($businessId)\n {\n $businessPath = $this->businessPath . urlencode($businessId);\n\n return $this->request($businessPath);\n }", "public function getBusinessId()\n {\n return $this->id;\n }", "public function findById(string $id): BusinessResponse\n {\n return $this->mappedGet('empresa/id/' . $id, BusinessResponse::class);\n }", "function getAnswersByBusinessId($userId, $business_id, $conn) {\n $sql = \"SELECT * FROM tbl_business_answer WHERE u_id='\".$userId.\"' AND business_id = '\".$business_id.\"'\";\n $result = mysqli_query($conn, $sql);\n return mysqli_fetch_all($result, MYSQLI_ASSOC);\n }", "function get_chamber_business(){\r\n $sql = $this->db->prepare(\"SELECT businessID, businessname FROM BUSINESS WHERE chamberID = :chamberid;\");\r\n\r\n $result = $sql->execute(array(\r\n \"chamberid\" => $_SESSION['chamber'],\r\n ));\r\n\r\n if ($result)\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n else\r\n return false;\r\n }", "public function business() {\n return $this->belongsTo( 'App\\Http\\Models\\Business', 'business_id', 'id' );\n }", "public function setBusinessId($var)\n {\n GPBUtil::checkString($var, True);\n $this->business_id = $var;\n }", "public function setBusinessId($var)\n {\n GPBUtil::checkString($var, True);\n $this->business_id = $var;\n }", "public function setBusinessId($var)\n {\n GPBUtil::checkString($var, True);\n $this->business_id = $var;\n }", "public function setBusinessId($var)\n {\n GPBUtil::checkString($var, True);\n $this->business_id = $var;\n }", "public function setBusinessId($var)\n {\n GPBUtil::checkString($var, True);\n $this->business_id = $var;\n }", "public function business( ) {\n return $this->belongsTo( 'App\\Http\\Models\\Business', 'business_id', 'id' );\n }", "public function show($id)\n {\n $business = Business::with('offices', 'jobs')->find($id);\n return ['business' => $business];\n }", "function GetBusinessList($businessIds)\n\t{\n\t\t$result = $this->sendRequest(\"GetBusinessList\", array(\"BusinessIds\"=>$businessIds));\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function __construct($business_id)\r\n {\r\n $this->business_id = $business_id;\r\n }", "function query_api($term, $location) {\r\n $response = json_decode(search($term, $location));\r\n $business_id = $response->businesses[0]->id;\r\n /* \r\n print sprintf(\r\n \"%d local businesses found, querying business info for the top result \\\"%s\\\"\\n\\n <br>\",\r\n count($response->businesses),\r\n $business_id\r\n );\r\n */ \r\n $response = get_business($business_id);\r\n \r\n print sprintf(\"Result for business \\\"%s\\\" found:\\n\", $business_id);\r\n $pretty_response = json_encode(json_decode($response), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\r\n print \"$pretty_response\\n\";\r\n\r\n return json_decode($response, true);\r\n }", "function getBookingsByCustomerId($customerid) {\n $query = \"SELECT * FROM `bookings` WHERE CustomerId='\" . $customerid . \"'\";\n \n $result = Database::selectQuery($query);\n \n if($result == null) {\n return null;\n } else {\n return $result;\n }\n }", "public function setBusinessId($id)\n {\n $this->id = $id;\n }", "public function show($id)\n {\n $business = Business::findOrfail($id);\n\n return new BusinessResource($business);\n }", "public function getListing(){\n $BusInfo = $this->BusinessOwnerModel->getBusinessID();\n \n foreach($BusInfo as $row1){\n $busID = $row1->bid;\n }\n \n $query = $this->db->get_where('BusinessListing', array('bid' => $busID));\n \n if($query->num_rows() > 0){\n foreach($query->result() as $row){\n $data[] = $row;\n }\n return $data;\n }\n return false;\n }", "public function yelp_business_api($businesses_id = 'north-india-restaurant-san-francisco', $api_key = 'Q1f28T05IN-H1tvDtQ-IMf4TMd2nsgZ4mN2e03EuUgO-5bQSqBxkXpb_uTPeA98FGq-3vmz0BoFTV3cz6oeh2GnCq9BiNk4nG83nX73wBCclVU2y1rQ1OqrczSUxW3Yx')\n {\n \n $yelp_api_url = 'https://api.yelp.com/v3/businesses/'.$businesses_id;\n\n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_URL => $yelp_api_url,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => array(\n \"authorization: Bearer \".$api_key\n ),\n ));\n $response = curl_exec($curl);\n $err = curl_error($curl);\n curl_close($curl);\n\n if ($err) {\n \n dd($err);\n \n } else {\n\n return json_decode($response); dd();\n }\n }", "public function getBusinessIds()\n {\n return $this->business_ids;\n }", "public function getBusinessRequest();", "public function getAllBusinesses() {\n\t\t$em = $this->getEntityManager();\n\t\t$businesses = $em->createQueryBuilder()\n\t\t\t->select('b.businessID,b.costCenter,b.name')\n\t\t\t->from('Business', 'b')\n\t\t\t->orderBy('b.name')\n\t\t\t->getQuery()\n\t\t\t->getResult();\n\t\t\n\t\t$response = array(\n\t\t\t\"businesses\" => $businesses\n\t\t);\n\t\t\n\t\treturn $this->respond($response);\n\t}", "public function retrieveBusinessBookingProfile(): ApiResponse\n {\n //prepare query string for API call\n $_queryBuilder = '/v2/bookings/business-booking-profile';\n\n //validate and preprocess url\n $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder);\n\n //prepare headers\n $_headers = [\n 'user-agent' => BaseApi::USER_AGENT,\n 'Accept' => 'application/json',\n 'Square-Version' => $this->config->getSquareVersion()\n ];\n $_headers = ApiHelper::mergeHeaders($_headers, $this->config->getAdditionalHeaders());\n\n $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);\n\n // Apply authorization to request\n $this->getAuthManager('global')->apply($_httpRequest);\n\n //call on-before Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n // and invoke the API call request to fetch the response\n try {\n $response = Request::get($_httpRequest->getQueryUrl(), $_httpRequest->getHeaders());\n } catch (\\Unirest\\Exception $ex) {\n throw new ApiException($ex->getMessage(), $_httpRequest);\n }\n\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n if (!$this->isValidResponse($_httpResponse)) {\n return ApiResponse::createFromContext($response->body, null, $_httpContext);\n }\n\n $mapper = $this->getJsonMapper();\n $deserializedResponse = $mapper->mapClass(\n $response->body,\n 'Square\\\\Models\\\\RetrieveBusinessBookingProfileResponse'\n );\n return ApiResponse::createFromContext($response->body, $deserializedResponse, $_httpContext);\n }", "public function ListUserBusiness($Id){\n\t\t\ttry {\n\t\t\t\t$BusinessSqlUser = \"SELECT mb.id,mb.business_id,mb.user_id,business.name as business_name \n\t\t\t\t\t\t\t\t\tFROM `multyple_business` \n\t\t\t\t\t\t\t\t\tas mb LEFT JOIN business ON business.`id` = mb.`business_id` where user_id = '\".$Id.\"'\";\n\t\t\t\t$Res_UserBusiness = mysqli_query($this->Connect_db(), $BusinessSqlUser);\n\t\t\t\tif(!$Res_UserBusiness){\n\t\t\t\t\t$error = \"Error description: \" . mysqli_error($this->Connect_db());\n\t\t\t\t\tthrow new Exception($error);\n\t\t\t\t}\n\t\t\t\t// making associative array\n\t\t\t\twhile($Row_UserBusiness = mysqli_fetch_assoc($Res_UserBusiness)){\n\t\t\t\t $ArrUserBusiness[] = $Row_UserBusiness; // Inside while loop\n\t\t\t\t}\n\t\t\t\t// echo '<pre>'; \t\t\t\n\t\t\t\t// print_r($ArrUserBusiness); exit;\n\t\t\t\tif(!empty($ArrUserBusiness)){\n\t\t\t\t\treturn $ArrUserBusiness;\n\t\t\t\t}else{\n\t\t\t\t\treturn 0; \n\t \t\t\t}\t\n\t\t\t} catch (Exception $Exception_ListUserBusiness) {\n\t\t\t\techo 'Exception Caught ', $Exception_ListUserBusiness->getMessage();\n\t\t\t}\n\t\t\t\n\t\t}", "function getBOCAccount($accountid = 'a746637b91b19a261a67d8bd') {\n\t//bankid bda8eb884efcef7082792d45\n\t//accountid a746637b91b19a261a67d8bd\n\t//viewid 5710bba5d42604e4072d1e92\n\t//\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t\tCURLOPT_HTTPHEADER => array(\n\t\t\t\t\t\t\t 'Auth-Provider-Name: 01460900080600',\n\t\t\t\t\t\t\t 'Auth-ID: 123456789',\n\t\t\t\t\t\t\t 'Ocp-Apim-Subscription-Key: f1817e51b3fb4d2ca3fc279d0df3a061'\n\t\t\t\t\t\t\t ),\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_URL => \"http://api.bocapi.net/v1/api/banks/bda8eb884efcef7082792d45/accounts/$accountid/5710bba5d42604e4072d1e92/account\",\n\t // CURLOPT_URL => \"192.168.88.202:8080/customer/$custId/goals\",\n\t CURLOPT_USERAGENT => 'BankBase BOC Hackathon Request'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\n\t$resp_decode = json_decode($resp);\n\treturn $resp_decode;\n}", "public function getFindBusiness()\n\t{\n\t\t$this->_makeRequest(Wp_WhitePages_Model_Api::API_REQUEST_METHOD_FINDBUSINESS);\n\t\treturn $this->_result;\n\t}", "public function viewByBusinessIdForSelect($id = null) {\n\t\t$contacts = $this->Contact->findByBusinessId('list', $id);\n\t\t$this->set(compact('contacts'));\n\t}", "public function showByBanksoal($id)\n {\n $soal = Soal::where(['banksoal_id' => $id]);\n\n if (request()->q != '') {\n $soal = $soal->where('pertanyaan','LIKE', '%'.request()->q.'%');\n } \n\n $soal = $soal->paginate(10);\n return new SoalCollection($soal);\n }", "function getBusinessServiceDetail($id){\n $serviceDate = DB::table('servicing')\n ->where('showroomID', $id)\n ->get();\n return $serviceDate;\n }", "public function searchBusinessesByName($businessName) {\n $businesses = array();\n\n \n \n try {\n\n $statement = Configuration::openConnection()->prepare(\"SELECT * FROM businesses AS b JOIN states AS s ON b.state=s.stateId WHERE b.name LIKE :businessName\");\n $statement->bindValue(\":businessName\", '%'.$businessName.'%');\n $statement->execute();\n\n $results = $statement->fetchAll(PDO::FETCH_COLUMN);\n\n foreach ($results as $index => $id) {\n\n $business = new Business($id);\n\n array_push($businesses, json_decode($business));\n \n }\n\n Configuration::closeConnection();\n }\n catch (PDOException $e) {\n return \"Error: \" . $e->getMessage();\n }\n\n \n $businesses = json_encode($businesses, JSON_PRETTY_PRINT);\n\n return $businesses;\n\n }", "public function index_get(){\n $id = $this->get('id');\n if ($id == '') {\n $response = $this->BayiM->get_all();\n } else {\n $this->db->where('id', $id);\n $response = $this->BayiM->get_all();\n }\n $this->response($response);\n }", "function getBusinessAddresses($userId) {\r\n $sql = $this->db->prepare(\"SELECT addressid, postal FROM BUSINESS JOIN USER ON USER.businessID=BUSINESS.businessID WHERE UserID=:user_id\");\r\n $sql->execute(array('user_id' => $userId));\r\n $result = $sql->fetch(PDO::FETCH_ASSOC);\r\n return $result;\r\n }", "public function getWireTransferByBusiness(Business $business)\n {\n $data = array();\n $message = array();\n $hasError = true;\n $codeResponse = 200;\n\n try {\n\n $parameters = array(\n ['business_id','=',$business->id],\n ['payment_method_id','=',config('constant.paymentmethod.wire_transfer.id')],\n );\n\n $relationshipNames = array('accountNumbers');\n\n $businessPaymentMethod = $this->service->findWhere($parameters,$relationshipNames);\n\n $data['model'] = $businessPaymentMethod ? new BusinessPaymentMethodAdminResource($businessPaymentMethod) : null;\n array_push ( $message , trans('crud.show_success'));\n $hasError = false;\n\n } catch(\\Exception $e){\n report($e);\n array_push ( $message , $e->getMessage());\n array_push ( $message , trans('crud.show_error'));\n $codeResponse = $e->getCode();\n }\n\n $data['hasError'] = $hasError;\n $data['message'] = $message;\n return response()->json($data,$codeResponse);\n }", "public function business()\n {\n return $this->belongsTo('App\\Models\\Business');\n }", "public function business()\n {\n return $this->belongsTo('App\\Models\\Business');\n }", "public function business()\n {\n return $this->belongsTo(Business::class);\n }", "public function getBusinessKey();", "public function get_blast_by_id($id) {\n if(!$id) {\n throw new Exception('id should not be empty');\n }\n return $this->linkemperor_exec(null, null,\"/api/v2/customers/blasts/$id.json\");\n }", "public function getMercadoPagoByBusiness(Business $business)\n {\n $data = array();\n $message = array();\n $hasError = true;\n $codeResponse = 200;\n\n try {\n\n $parameters = array(\n ['business_id','=',$business->id],\n ['payment_method_id','=',config('constant.paymentmethod.mercadopago.id')],\n );\n\n $businessPaymentMethod = $this->service->findWhere($parameters);\n\n $data['model'] = $businessPaymentMethod ? new BusinessPaymentMethodAdminResource($businessPaymentMethod) : null;\n array_push ( $message , trans('crud.show_success'));\n $hasError = false;\n\n } catch(\\Exception $e){\n report($e);\n array_push ( $message , $e->getMessage());\n array_push ( $message , trans('crud.show_error'));\n $codeResponse = $e->getCode();\n }\n\n $data['hasError'] = $hasError;\n $data['message'] = $message;\n return response()->json($data,$codeResponse);\n }", "public function business()\n {\n return $this->belongsTo('App\\Business');\n }", "public function business()\n {\n return $this->belongsTo('App\\Business');\n }", "public function getBusByID($busID) {\n $sqlQuery = \"SELECT * FROM Bus WHERE busID = :busID\"; //sql for selecting a bus by a specific bus id\n\n $statement = $this->connection->prepare($sqlQuery); //prepares the sql statement\n $parameters = array(\"busID\" => $busID); //takes in the busID \n\n $exec = $statement->execute($parameters); //executes the statement \n\n if (!$exec) { //if there is no busid by that id\n die(\"Could not get Buses\");\n }\n\n return $statement; //return the bus by the id\n }", "function particularbranch($id)\n\t{\n\t\t$getParsubbrand=\"SELECT * from brand where brand_id = $id\";\n\t\t$subbrand_data=$this->get_results( $getParsubbrand );\n\t\treturn $subbrand_data;\n\t}", "public function get_business_data($add_id=null){\n\t\t$this->db->select('categories.name as category_name,cities.name as city_name,areas.name as area_name');\n\t\t$this->db->join('categories','categories.id=category_listing.category_id');\t\n\t\t$this->db->join('advertisements','advertisements.id=category_listing.listing_id');\n\t\t$this->db->join('areas','areas.id=category_listing.area_id');\n\t\t$this->db->join('cities','cities.id=category_listing.city_id');\n\t $this->db->where('category_listing.listing_id',$add_id);\n\t\t$this->db->where('categories.is_active', true);\n\t\t$this->db->from('category_listing');\n\t $query = $this->db->get();\t\n\t\t$results=$query->result_array();\n\t\treturn $results;\n\t}", "function getBookingsByBookingDetailsId($bookingDetailsId) {\n $query = \"SELECT * FROM `bookings` WHERE BookingId='\".$bookingDetailsId.\"'\";\n $result = Database::selectQuery($query);\n if($result == null) {\n return null;\n } else {\n return $result;\n }\n }", "public function get_business_information($partnerid) {\n $this->db->select('*');\n $this->db->from('vendors');\n $this->db->where('id', $partnerid);\n $query = $this->db->get();\n $query_result = $query->result();\n $partner_details = array();\n if (count($query_result) == 0) {\n $partner_details['partner'] = $query_result;\n } else {\n $partner_details['partner'] = $query_result[0];\n }\n\n $this->db->select('*');\n $this->db->from('business_details');\n $this->db->where('business_id', $partner_details['partner']->id);\n $query1 = $this->db->get();\n $query_result1 = $query1->result();\n if (count($query_result1) == 0) {\n $partner_details['business'] = $query_result1;\n } else {\n $partner_details['business'] = $query_result1[0];\n }\n $this->db->select('*');\n $this->db->from('services_business_mapping');\n $this->db->where('business_id', $partner_details['business']->id);\n $mapping_query = $this->db->get();\n $mapping_quer_result = $mapping_query->result();\n $partner_details['mapping'] = $mapping_quer_result;\n\n $this->db->select('*');\n $this->db->from('business_gallery');\n $this->db->where('business_id', $partner_details['business']->id);\n $query2 = $this->db->get();\n $query_result2 = $query2->result();\n $partner_details['gallery'] = $query_result2;\n\n return $partner_details;\n }", "public function getData(int $businessId)\n {\n $settings = Darksky::$plugin->getSettings();\n $api_key = '';\n $apiUrl = 'https://tools.brightlocal.com/seo-tools/api/v4/ld/fetch-reviews';\n $client = new \\GuzzleHttp\\Client();\n $data = array();\n\n try {\n $api_key = (string)$settings->apiKey;\n $apiUrl .= '?api-key=' . $api_key;\n $apiUrl .= '&businessId=' . $businessId;\n $response = $client->request('POST', $apiUrl);\n\n // echo $response->getStatusCode(); # 200\n // echo $response->getHeaderLine('content-type'); # 'application/json; charset=utf8'\n // echo $response->getBody(); # '{\"id\": 1420053, \"name\": \"guzzle\", ...}'\n\n $data = json_decode($response->getBody(), true);\n } catch (\\Exception $e) {\n return [\n 'success' => false,\n 'reason' => ''\n ];\n }\n\n return $data;\n }", "public function getByBaseId($baseId);", "public function getSoalByBanksoal($id)\n {\n $this->checkPermissions('soal');\n\n $soal = Soal::with('jawabans')->where('banksoal_id',$id);\n if (request()->q != '') {\n $soal = $soal->where('pertanyaan', 'LIKE', '%'. request()->q.'%');\n }\n\n if (request()->perPage != '') {\n $soal = $soal->paginate(request()->perPage);\n } else {\n $soal = $soal->get();\n }\n return [ 'data' => $soal ];\n }", "function getBusinessID($userID) {\r\n $sql = $this->db->prepare(\"SELECT businessID FROM USER WHERE UserID='$userID'\");\r\n if ($sql->execute()) {\r\n $result = $sql->fetch(PDO::FETCH_ASSOC);\r\n return $result['businessID'];\r\n }\r\n return false;\r\n }", "public function business( ) {\n return $this->hasMany('App\\Http\\Models\\Business', 'industry_id', 'id');\n }", "public function b_list($id)\n\t{\n\t\t$businesses_taken = $this->business->all();\n\n\n\t\t$businesses_minus = DB::table('businesses')\n ->join('members_businesses', function($join) use($id)\n {\n $join->on('businesses.id', '=', 'members_businesses.business_id')\n ->where('members_businesses.member_id', '=', $id);\n })\n ->get();\n\n $businesses = array();\n\n \techo \"<br>\";\n \t\n foreach ($businesses_taken as $b) {\n\t\t\t$found = false;\n\n\n\n \tforeach($businesses_minus as $bm){\n \t\t//echo \"Compare \" . $b->id . \" with \";\n \t\t//echo $bm->business_id;\n \t\t//found duplicate?\n \t\tif($b->id==$bm->business_id)\n \t\t\t$found=true;\n\n \t}\n \t//echo \"<br>\";\n \tif($found==false)\n \t\t$businesses[$b->id]=$b;\n \t//$businesses[$b->id]->id=$b->id;\n };\n\n \n\t\treturn View::make('businesses.list', compact('businesses'));\n\t}", "public function getBusinesses() {\n try {\n $statement = Configuration::openConnection()->prepare(\"SELECT * FROM businesses AS b JOIN states AS s ON b.state=s.stateId, businessTypes AS bt WHERE b.type=bt.typeId\");\n $statement->execute();\n\n $results = $statement->fetchAll(PDO::FETCH_COLUMN);\n\n $businesses = array();\n\n //echo ('test': 'test2');\n \n foreach ($results as $index => $id) {\n $business = new Business($id);\n array_push($businesses, json_decode($business));\n }\n\n Configuration::closeConnection();\n }\n catch (PDOException $e) {\n return \"Error: \" . $e->getMessage();\n }\n $businesses = json_encode($businesses, JSON_PRETTY_PRINT);\n\n return $businesses;\n }", "public function searchActiveBusinessByBusinessName( $business_name) {\n $result['data'] = [];\n foreach ( $this->where(['is_active'=>1, 'is_display'=>1])->where('business_name', 'like', \"%{$business_name}%\")->get() as $object ) {\n $result['data'][] = $object->getBeforeStandardArray();\n }\n return $result;\n }", "public static function getBusinessOrderForPaid($isPaidBusiness, $business_id = false, $start_date = false, $end_date = false) {\n $query = Order::select(DB::raw('orders.id, orders.conekta_order_id, orders.total as total_cost, businesses.name AS business, businesses.bank_name, businesses.clabe, TRUNCATE((total - (initialFee + kmFee + insuranceFee)), 2) AS total, orders.real_time AS created_at'))\n ->leftJoin('businesses', 'orders.business_id', '=', 'businesses.id')\n ->where('orders.status_id', 5)/*Que se hayan finalizado*/\n ->where('isPaidBusiness', $isPaidBusiness);\n\n $query = $business_id ? $query->where('orders.business_id', $business_id) : $query;\n\n $query = $start_date ? $query->where(DB::raw('TIMESTAMP(orders.real_time)'), '>=', $start_date.' 00:00:00') : $query;\n \n $query = $end_date ? $query->where(DB::raw('TIMESTAMP(orders.real_time)'), '<=', $end_date.' 23:59:59') : $query;\n\n $query = $query->get();\n \n foreach ($query as $key => $order) {\n //$order->subtotal = DB::table('order_details')->where('order_id', $order->id)->sum(DB::raw('subtotal'));\n $order->subtotal = DB::table('order_details')->where('order_id', $order->id)->sum(DB::raw('quantity * price'));\n $order->comision = round($order->subtotal * 0.03, 2, PHP_ROUND_HALF_DOWN);\n $order->total_to_pay = round($order->subtotal - $order->comision, 2, PHP_ROUND_HALF_DOWN);\n }\n\n return $query;\n }", "function getBookingDetailsByBookingId($bookingid) {\n $query = \"SELECT * FROM `bookingdetails` WHERE BookingId='\".$bookingid.\"'\";\n $result = Database::selectQuery($query);\n if($result == null) {\n return null;\n } else {\n return $result;\n }\n }", "public function getBusinessID(){\n $BusinessOwnerEmail = $this->session->userdata['BusinessOwner_logged_in']['username'];\n $query = $this->db->get_where('BusinessOwner', array('email' => $BusinessOwnerEmail));\n if($query->num_rows() > 0){\n foreach($query->result() as $row){\n $data[] = $row;\n }\n return $data;\n }\n return false;\n }", "function Fetch_API_Payments($application_id)\n{\n\tsettype($application_id, 'int');\n\n\t$db = ECash::getMasterDb();\n\t$query = '-- /* SQL LOCATED IN file=' . __FILE__ . ' line=' . __LINE__ . ' method=' . __METHOD__ . \" */\n\t\tSELECT\n\t\t\tapi_payment_id,\n\t\t\tname_short event_type,\n\t\t\tamount,\n\t\t\tdate_event\n\t\tFROM\n\t\t\tapi_payment\n\t\t\tJOIN event_type USING (event_type_id)\n\t\tWHERE\n\t\t\tapplication_id = {$application_id}\n\t\tAND\n\t\t\tapi_payment.active_status = 'active'\n\t\";\n\n\t$result = $db->query($query);\n\treturn $result->fetchAll(PDO::FETCH_OBJ);\n\n}", "public function getBrandById($brandeditid){\n\t\t\t \t$brandeditid = mysqli_real_escape_string($this->db->link,$brandeditid);\n\t\t\t \t$query = \"SELECT * FROM tbl_brand WHERE brandId = '$brandeditid' \";\n\t\t\t \t$result = $this->db->select($query);\n\t\t\t \treturn $result;\n\n\t\t\t }", "public function getBusinessUnitID(): string;", "public function show($id)\n {\n return response()->json(customer_point::where('id_business',Auth::user()->id_business)->where('id',$id)->get());\n }", "public function get_existing_packages($business_id) {\n $this->db->select('*');\n $this->db->from('business_programs');\n $this->db->where('business_id', $business_id);\n $query = $this->db->get();\n $query_result = $query->result();\n\n return $query_result;\n }", "public function show(string $businessId, string $paymentGatewayId)\n {\n $this->authorize('view', [PaymentGateway::class, $businessId, $paymentGatewayId]);\n return $this->service->findWithReference($paymentGatewayId, 'business_id', $businessId);\n }", "public function actionList()\n {\n $searchModel = new BusinessSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getBrandById($id);", "public function getBooking($id)\n {\n return $this->model->where('customer_id', $id)->orderBy('id', 'desc')->with('flight', 'passenger', 'outbound', 'cost')->get();\n }", "public function bankdetailGet($id)\n {\n $fullResult = $this->client->call(\n 'crm.requisite.bankdetail.get',\n array('id' => $id)\n );\n return $fullResult;\n }", "public function show(Business $business)\n {\n $business = Business::with('locations')->findOrFail($business->id);\n return view('businesses.show', ['business' => $business]);\n }", "function scrapeBusinessPage($AHSID){\n $url = ALL_BUSINESS_OPT_URL . $AHSID;\n //get simplehtmldom object\n $html = $this->getPage($url);\n //get a Business object form the page\n $business = $this->parseBusinessPage($html, $AHSID);\n //get an Inspection object from business page\n $inspections = $this->parseInspections($html);\n //If there was more than one inspection we will add another query string to show all of the violations\n if(count($inspections) > 1){\n //clear $html to avoid memory leaks\n $html->clear();\n unset($html);\n $html = null;\n //get url that shows all violations\n $vURL = ALL_BUSINESS_OPT_URL . $AHSID . ALL_VIOL_END_QUERY;\n $html = $this->getPage($vURL);\n }\n //get Violation object from business page\n $violations = $this->parseViolations($html, count($inspections));\n // sync violations with inspections\n foreach ($inspections as $inspection) {\n $subViolArray = array();\n $iDate = $inspection->getDate();\n if(!empty($violations)){\n foreach ($violations as $violation) {\n //get violation date and strip any tags\n $vDate = strip_tags($violation->getDate());\n if($vDate == $iDate || $vDate == \"\"){\n array_push($subViolArray, $violation);\n }\n }\n //place violation array in the inspection object\n $inspection->setViolations($subViolArray);\n }\n }\n // update Business object's inspection array\n $business->setInspectionsArray($inspections);\n //clear $html to avoid memory leaks\n $html->clear();\n unset($html);\n $html = null;\n return $business;\n }", "public function phleboActiveDetails($id){\n /** We want...\n * Plebo details - assignment table, phlebo table\n * phlebo_id - assignmet table\n * first_name - phlebo table\n * sirname - phlebo table\n * lastname - phlebo table\n * gender - phlebo table\n * qualifications - phlebo table\n * phone - phlebo table\n * lat - phlebo_position_table\n * lon - phlebo_postitin_table\n */\n //phlebo_details\n //select phlebo_id from assignment table where booking_id is as given\n $phlebo_id = Assignment::select('phlebo_id')\n ->where('booking_id',$id)\n ->get()[0];\n $phlebo_details = Phlebo::select('first_name','sirname','last_name','gender','qualifications','phone')\n ->where('id',$phlebo_id['phlebo_id']+0)\n ->get();\n return response()->json($phlebo_details);\n }", "public function ViewUserBusImages($Business_id, $Id){\n\t\t\ttry {\t\n\t\t\t\t// this is example query\n\t\t\t\t//SELECT mb.*,u.*, b.name as business_name FROM multyple_business mb INNER JOIN user u ON u.id = mb.user_id INNER JOIN business b ON mb.business_id = b.id WHERE mb.user_id = 41\n\n\t\t\t\t// SELECT u.id,i.user_id, i.business_id, i.image FROM images i INNER JOIN user u ON u.id = i.user_id WHERE i.user_id = 41\n\n\t \t\t\t$SqlViewBusImage = \"SELECT u.id,i.user_id, i.business_id, i.image FROM images i INNER JOIN user u ON u.id = i.user_id WHERE i.user_id = '$Id' AND i.business_id = '$Business_id'\";\n\n\t \t\t\t// echo $SqlViewBusImage; exit();\n\n\t\t\t\t$Res_ViewBusImage = mysqli_query($this->Connect_db(), $SqlViewBusImage);\n\n\t\t\t\tif(!$Res_ViewBusImage){\n\t\t\t\t\t$error = \"Error description: \" . mysqli_error($this->Connect_db());\n\t\t\t\t\tthrow new Exception($error);\n\t\t\t\t}\t\t\t\t\t\n\t\t\t\t// makking arry\n\t\t\t\twhile ($Row_ViewBusImage = mysqli_fetch_assoc($Res_ViewBusImage)) {\n\t\t\t\t\t$ArrViewBusImage[] = $Row_ViewBusImage;\n\t\t\t\t}\n\t\t\t\t// echo '<pre>'; \t\n\t\t\t\t// print_r($ArrViewBusImage); exit;\n\t\t\t\tif(!empty($ArrViewBusImage)){\n\t\t\t\t\treturn $ArrViewBusImage;\n\t\t\t\t}\n\t\t\t} catch (Exception $Exception_ViewBusImage){\n\t\t\t\techo 'Exception Caught ', $Exception_ViewBusImage->getMessage();\n\t\t\t}\n\t\t}", "public function findBidBybidderID($id){\r\n $this->db->query( \"SELECT auctions.isActive, bids.bidderID\r\n FROM\r\n auctions as auctions\r\n LEFT OUTER JOIN\r\n (SELECT bidID, bidderID, auctionID\r\n FROM bids as bids\r\n WHERE bidderID= :id) as bids\r\n ON\r\n auctions.auctionID = bids.auctionID\r\n WHERE\r\n auctions.isActive = 1 and bids.bidderID= :id\");\r\n // bind values\r\n $this->db->bind(':id', $id);\r\n \r\n $bid = $this->db->resultSet();\r\n\r\n // check rows\r\n if($this->db->rowCount() > 0){\r\n return $bid;\r\n }\r\n else{\r\n return false;\r\n }\r\n }", "function get_user_booking_with_id($user_id){\n global $db;\n $sql = \"SELECT * FROM booking WHERE user_id = '$user_id'\";\n $result = $db->query($sql);\n return $result;\n}", "public function getDataByID($id){\n $query = $this->db->query('select from books where ID');\n }", "public function related() {\n\t\t$query = $this->request->params['named'];\n\t\tif (empty($query)) {\n\t\t\tthrow new NotFoundException('No Parameters');\n\t\t}\n\t\t$this->set('businesses', $this->Business->find('all', ['conditions' => $query]));\n\t}", "public function get_business_services() {\n $this->db->select('*');\n $this->db->from('services');\n $query = $this->db->get();\n $query_result = $query->result();\n\n return $query_result;\n }", "public function getByID($id)\n {\n $sql=\"CALL SP_APODERADOS_SELECT_BY_ID(?)\";\n return $this->mysqli->find($sql, $id);\n }", "function getBreeding($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from breeding_tbl where breeding_id='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['breeding_id'];\n\n\t}\n\t$crud->disconnect();\n}", "function getBuildingInfo() {\n return getOne(\"SELECT * FROM building WHERE id = ?\",[getLogin()['bid']]);\n}", "public function getserviceproviderBusinessTypeList($id)\r\n\t{\r\n\t\t$list = DB::table('mstr_serviceprovider_buss_type')->select(array('id', 'name'))->where('active', 1);\r\n\t\tif ($id > 0 && is_numeric($id)) {\r\n\t\t $list = $list->where('buss_cat_id', $id);\r\n\t\t}\r\n\t\t$list = $list->get();\r\n\t\treturn $list;\r\n\t}", "public function get($boletoID);", "public function __construct($id) {\n $statement = Configuration::openConnection()->prepare(\"SELECT * FROM businesses AS b JOIN states AS s ON b.state=s.stateId WHERE b.id=:id\");\n \n $statement->bindParam(\":id\", $id);\n\n $statement->execute();\n\n $results = $statement->fetch(PDO::FETCH_ASSOC);\n\n $this->setBusinessId($results['id']);\n $this->setName($results['name']);\n $this->setStation($results['station']);\n $this->setStreetAddress($results['streetAddress']);\n $this->setCity($results['city']);\n $this->setState(array('id' =>$results['stateId'], 'abbreviation' => $results['stateAbbreviation'], 'name' => $results['stateName']));\n $this->setZipcode($results['zipcode']);\n $this->setPhone($results['phone']);\n $this->setUrl($results['url']);\n $this->setServices($results['services']);\n //$this->setType(array('id' => $results['typeId'], 'type' => $results['typeName']));\n\n Configuration::closeConnection();\n }", "function recuperer_produit_bsm($id){\n global $db;\n $i = array(\n 'id' => $id\n );\n $sql = \"SELECT * FROM bsm WHERE id=:id\";\n $req = $db->prepare($sql);\n $req-> execute($i);\n $results = array();\n while($rows = $req->fetchObject()){\n $results[] = $rows;\n }\n return $results;\n}", "function verifyBusiness($name){\n //connect to your database. Type in your username, password and the DB path\n $conn = oci_connect('mcai', 'coen174', '//dbserver.engr.scu.edu/db11g');\n if(!$conn) {\n print \"<br> connection failed:\";\n exit;\n }\n\n $queryString = \"SELECT businessname FROM LISTERS WHERE businessname = :name and approved = 1\";\n $query = oci_parse($conn, $queryString);\n\n oci_bind_by_name($query, ':name', $name);\n\n // Execute the query\n $res = oci_execute($query);\n if (!$res) {\n $e = oci_error($query);\n echo $e['message'];\n }\n\n $nrows = oci_fetch_all($query, $res);\n\n if($nrows == 0) {\n $out = array('found' => 0);\n } else {\n $out = array('found' => 1);\n }\n\n echo json_encode($out);\n\n OCILogoff($conn);\n}", "function babies_data ($bgalb_id = 0)\n\t{\n\t\t$temp_return = array();\n\n\t\tif ($bgalb_id) {\n\t\t\t$sql = sprintf(\"SELECT * FROM %s \n\t\t\t\t\t\t\tWHERE bgalb_id='%d'\",\n\t\t\t\t$this->db_praefix.\"ecard_data\",\n\t\t\t\t$bgalb_id\n\t\t\t);\n\t\t\t$temp_return = $this->db->get_row($sql, ARRAY_A);\n\t\t}\n\n\t\treturn $temp_return;\n\t}", "private function api_query() {\n if ($this->trackId == null) {\n return false;\n }\n $class[] = 'includes/checkout-php-library/autoload';\n $class[] = 'includes/checkout-php-library/com/checkout/Apiclient';\n $class[] = 'includes/checkout-php-library/com/checkout/Apiservices/Reporting/Reportingservice';\n $class[] = 'includes/checkout-php-library/com/checkout/Apiservices/Reporting/Requestmodels/Transactionfilter';\n\n foreach ($class as $path) {\n module_load_include('php', 'uc_checkoutpayment', $path);\n }\n\n $apiClient = new com\\checkout\\Apiclient(variable_get('cko_private_key'),variable_get('cko_mode'));\n $service = $apiClient->Reportingservice();\n\n $request = new com\\checkout\\Apiservices\\Reporting\\Requestmodels\\Transactionfilter();\n $request->setPageSize('100');\n $request->setSortColumn('date');\n $request->setFilters(\n array(\n \"action\" => \"include\",\n \"field\" => \"TrackID\",\n \"operator\" => \"EQUALS\",\n \"value\" => $this->trackId,\n )\n );\n\n $response = $service->queryTransaction($request);\n\n if (!empty($response)) {\n foreach ($response as $value) {\n $this->id = $value->id;\n $this->created = $value->created;\n $this->trackId = $value->track_id;\n $this->currency = $value->currency;\n $this->responseMessage = $value->responseMessage;\n $this->responseCode = $value->responseCode;\n $this->status = $value->status;\n $this->value = $data->value;\n $this->email = $data->email;\n\n $this->db_add();\n }\n\n return $this->db_get();\n }\n\n return FALSE;\n }", "public static function getByBz_id($bz_id) {\n return self::getPeer()->doSelect(new Criteria(array('bz_id', $bz_id, EQUAL)));\n }" ]
[ "0.72874045", "0.68762845", "0.6643683", "0.6613496", "0.64544404", "0.64544404", "0.64544404", "0.64544404", "0.64544404", "0.64386517", "0.6426751", "0.63784474", "0.6187909", "0.61160827", "0.60744554", "0.60321623", "0.60273176", "0.602034", "0.602034", "0.602034", "0.602034", "0.602034", "0.5971741", "0.59451526", "0.5921251", "0.5893548", "0.5798308", "0.5775919", "0.57684815", "0.56807035", "0.5645439", "0.56281966", "0.55748314", "0.55583626", "0.5513669", "0.55002946", "0.55002755", "0.5493061", "0.54806346", "0.5478503", "0.5474696", "0.5446634", "0.54316914", "0.5417162", "0.5385427", "0.5378623", "0.5371043", "0.5371043", "0.53471696", "0.5345392", "0.533411", "0.5322544", "0.53223747", "0.53118473", "0.5308946", "0.5297726", "0.5296506", "0.5290286", "0.5289181", "0.52781147", "0.5273276", "0.52625155", "0.52575237", "0.52520883", "0.5242308", "0.52303517", "0.5222226", "0.52150446", "0.5208558", "0.5206906", "0.5199026", "0.51982975", "0.5185437", "0.518306", "0.51553637", "0.5153824", "0.5124405", "0.5121312", "0.5093589", "0.5077645", "0.5071276", "0.50630623", "0.50519925", "0.50433207", "0.5041558", "0.5037551", "0.5035267", "0.5011652", "0.5009958", "0.50055623", "0.50041115", "0.49939448", "0.49896294", "0.4975537", "0.49717742", "0.4970833", "0.49640733", "0.49618703", "0.49611706", "0.49606138" ]
0.7619095
0
Queries the API by the input values from the user
function query_api($term, $location) { $response = json_decode(search($term, $location)); $business_id = $response->businesses[0]->id; /* print sprintf( "%d local businesses found, querying business info for the top result \"%s\"\n\n <br>", count($response->businesses), $business_id ); */ $response = get_business($business_id); print sprintf("Result for business \"%s\" found:\n", $business_id); $pretty_response = json_encode(json_decode($response), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); print "$pretty_response\n"; return json_decode($response, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function query();", "public function query();", "public function query();", "function query() {}", "public static function query();", "public function api()\n {\n $input = request('q');\n $tags = Tag::where('name', 'like', $input.'%')\n ->orWhere('name', 'like', '% '.$input.'%')->get(\n ['name AS text', 'id']\n )->toArray();\n\n if ($input != '')\n {\n return response()->json([\n 'results' => $tags\n ]);\n }\n else\n {\n return response()->json([\n 'results' => ''\n ]);\n }\n }", "abstract public function query();", "function query_api($term, $location, $price, $radius, $categories, $sort) { \n $response = search($term, $location, $price, $radius, $categories, $sort);\n echo $response;\n}", "function query() {\n }", "public function Query() {\n \n }", "public static function query()\n {\n }", "public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}", "public function api_call($query) {\n $query = $this->sanitize_str($query); \n $url = \"https://superheroapi.com/api/1180364012471833/search/\" . $query;\n \n if (!file_get_contents($url)) {\n $err = array(\n \"response\" => \"error\",\n \"error\" => \"Couldn't connect to API\",\n );\n \n $res = json_encode($err);\n }\n else {\n $res = file_get_contents($url);\n }\n \n return $res;\n }", "public abstract function get_query();", "function gc_get_from_api() {\n $keyword = $_POST['keyword'];\n $hub = $_POST['hub'];\n $type = $_POST['type'];\n $url = 'https://graphcommons.com/api/v1/' . $type . 's/search?query='. urlencode($keyword) . '&limit=' . $this->api_limit;\n\n if ( $hub !== '' ) {\n $url = $url . '&hub=' . $hub;\n }\n\n $this->gc_get_url_and_print_json( $url );\n }", "public function query()\n {\n }", "public function query()\n {\n }", "public function query($params)\n { \n return $this->request(Resource::RESOURCE_QUERY, $params);\n }", "public function requestData() {\n\t\t// Set up cURL \n\t\t$curl = curl_init($this->query); \n\t\tcurl_setopt($curl, CURLOPT_POST, false); \n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\t$response = curl_exec($curl);\n\t\tcurl_close($curl);\n\t\t\t\n\t\treturn $this->parseAPIResponse($response);\n\t}", "function query() {\n // Don't filter if we're exposed and the checkbox isn't selected.\n\n if ((!empty($this->options['exposed'])) && empty($this->value)) {\n return;\n }\n if (!$this->options['exposed']) {\n $value = $this->options['uid'];\n }\n else {\n $value = $this->validated_exposed_input[0];\n }\n\n\n $this->ensure_my_table();\n\n\n $table = 'scheduling_appointments';\n //$field1 = $this->query->add_field($table, 'nid');\n //$field2 = $this->query->add_field($table, 'title');\n\n\n //$field1 = $table . '.nid';\n //$field2 = $table . '.title';\n if ($value != '') {\n $this->query->add_where(\n $this->options['group'],\n db_and()\n ->condition($table . '.uid', $value, '=')\n );\n }\n }", "public function query() {\n\n }", "public function query($type,$query){\n\t\t\tif(!is_array($query)) $query = array('Query'=>\"'{$query}'\");\n\t\t\ttry{\n\t\t\t\treturn self::getJSON(\"{$this->apiRoot}{$type}\",$query);\n\t\t\t}catch(Exception $e){\n\t\t\t\tdie(\"<pre>{$e}</pre>\");\n\t\t\t}\n\t\t}", "public function query_api ($mealname){\n\t\t// set HTTP header\n\t\t$headers = array('Content-Type: application/json');\n\n\t\t// query string\n\t\t$fields = array(\n\t\t 'results' => '0:1',\n\t\t 'fields' => 'nf_calories,nf_cholesterol,nf_total_fat,nf_serving_weight_grams',\n\t\t 'appId' => '65a327b9',\n\t\t 'appKey' => '7506bb427b7a5c989c48d64d68c27421',\n\t\t);\n\n\t\t// Build URL\n\t\t$mealname = rawurlencode($mealname);\n\t\t$url = 'https://api.nutritionix.com/v1_1/search/' . $mealname . '?' . http_build_query($fields);\n\n\t\t// Open connection\n\t\t$ch = curl_init();\n\n\t\t// Set the url, number of GET vars, GET data\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_POST, false);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true );\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\n\t\t// Execute request\n\t\t$result = curl_exec($ch);\n\n\t\t// Close connection\n\t\tcurl_close($ch);\n\n\t\treturn $result;\n\t}", "function query($param) {\n $curl = curl_init();\n $userName = $param;\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://develop.datacrm.la/datacrm/pruebatecnica/webservice.php?operation=query&sessionName=\" . $userName . \"&query=select%20%2A%20from%20Contacts;\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => array(\n \"Accept: */*\",\n \"Accept-Encoding: gzip, deflate\",\n \"Cache-Control: no-cache\",\n \"Connection: keep-alive\",\n \"Host: develop.datacrm.la\",\n \"Postman-Token: 438973a9-ec4c-4c01-bc55-71ad624b746d,206316aa-adaa-4963-b5c6-bdacd9e13eb0\",\n \"User-Agent: PostmanRuntime/7.19.0\",\n \"cache-control: no-cache\"\n ),\n ));\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n if ($err) {\n echo \"cURL Error #:\" . $err;\n } else {\n echo $response;\n }\n }", "function api_query($params) {\n\n $params['api_client_id'] = $this->CLIENT_ID;\n $params['api_password'] = $this->API_PASSWORD;\n $query = $this::API_URL . '?' . http_build_query($params);\n\n $result = @file_get_contents($query);\n //var_dump($result);\n return json_decode($result, true);\n }", "public function get($apiQuery, $options = array());", "function search() {\n\n /* Start building the query object. We hope to end up with something like:\n $reqeust = '{\n \"from\" : 0,\n \"size\": 10,\n \"query\" : {\n \"terms\" : {\n \"creator\" : [ \"card\" ]\n }\n },\n sort: {\n title: {\n order: \"desc\"\n }\n }\n }';\n */\n $request = array();\n\n // Users can query by specifying an url param like &filter=title:ender\n // TODO: We should allow for multiple filters.\n $key_and_val = explode(\":\", $this->get('GET.filter'));\n if (count($key_and_val) == 2 and !empty($key_and_val[0]) and !empty($key_and_val[1])) {\n $request['query']['query_string']['fields'] = array($key_and_val[0]);\n $request['query']['query_string']['query'] = '*' . $key_and_val[1] . '*';\n $request['query']['query_string']['default_operator'] = 'AND';\n } else {\n $request['query'] = array(\"match_all\" => new stdClass);\n }\n //$request['query']['query_string']['query'] = 'American FactFinder';\n // start parameter (elasticsearch calls this 'from')\n $incoming_start = $this->get('GET.start');\n if (!empty($incoming_start)) {\n $request['from'] = $this->get('GET.start');\n }\n \n // limit parameter (elasticsearch calls this 'size')\n $incoming_limit = $this->get('GET.limit');\n if (!empty($incoming_limit)) {\n $request['size'] = $this->get('GET.limit');\n }\n \n // sort parameter\n $incoming_sort = $this->get('GET.sort');\n $sort_field_and_dir = explode(\" \", $this->get('GET.sort'));\n if (count($sort_field_and_dir) == 2) {\n $request['sort'] = array($sort_field_and_dir[0] => array('order' => $sort_field_and_dir[1]));\n }\n \n // We now have our built request, let's jsonify it and send it to ES\n $jsoned_request = json_encode($request);\n \n $url = $this->get('ELASTICSEARCH_URL') . '_search';\n $ch = curl_init();\n $method = \"GET\";\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($method));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $jsoned_request);\n\n $results = curl_exec($ch);\n curl_close($ch);\n\n // We should have a response. Let's pull the docs out of it\n $cleaned_results = $this->get_docs_from_es_response(json_decode($results, True));\n // callback for jsonp requests\n $incoming_callback = $this->get('GET.callback');\n if (!empty($incoming_callback)) {\n $this->set('callback', $this->get('GET.callback'));\n }\n \n // We don't want dupes. Dedupe based on hollis_id\n //$deduped_docs = $this->dedupe_using_hollis_id($cleaned_results);\n \n // Hopefully we're deduping on intake\n $deduped_docs = $cleaned_results;\n \n $this->set('results', $deduped_docs);\n //$this->set('results', $cleaned_results);\n $path_to_template = 'api/templates/search_json.php';\n echo $this->render($path_to_template);\n }", "public function query() {\n if (isset($this->value, $this->definition['trovequery'])) {\n $this->query->args['method'] = $this->definition['trovequery']['method'];\n if (is_array($this->value)) {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], implode($this->value, ','));\n }\n else {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], $this->value);\n }\n }\n }", "public function Query(){\n\t}", "public function Query(){\n\t}", "public function Query(){\n\t}", "abstract function query( $p_filter_input );", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "function SearchFood($name)\n{\n $postData = array(\n 'query' => $name,\n \n );\n\n // Setup cURL\n $ch = curl_init('https://trackapi.nutritionix.com/v2/natural/nutrients');\n curl_setopt_array($ch, array(\n CURLOPT_POST => TRUE,\n CURLOPT_RETURNTRANSFER => TRUE,\n CURLOPT_HTTPHEADER => array(\n 'Content-Type:application/json',\n 'x-app-Id: 3f0a4b18',\n 'x-app-Key:7795b68adeba3faf9a870e02a444cb59'\n ),\n CURLOPT_POSTFIELDS => json_encode($postData)\n ));\n\n // Send the request\n $response = curl_exec($ch);\n\n // Check for errors\n if($response === FALSE){\n die(curl_error($ch));\n }\n\n // Decode the response\n //$responseData = json_decode($response, TRUE);\n\n // Print the date from the response\n return $response;\n}", "public function query()\n\t{\n\t\t\n\t}", "private function searchAPI($attribute, $value){\r\n\r\n if($attribute=='type'){\r\n\r\n $myUrl = $this->getMyNumber($attribute, $value);\r\n\r\n if($myUrl==null){\r\n return 'Are you sure about the existence of that type? \r\n <p>Check types <a href=\"#\" \r\n onclick=\"window.open(\\'https://bulbapedia.bulbagarden.net/wiki/Type\\'\r\n , \\'_blank\\')\">here</a>.</p>';\r\n }\r\n\r\n $this->getTypePokemons($myUrl);\r\n\r\n }else if($attribute=='region'){\r\n\r\n $myUrl = $this->getMyNumber($attribute, $value);\r\n\r\n if($myUrl==null){\r\n return 'Are you sure that it appears on the map? \r\n <p>You should take a look <a href=\"#\" \r\n onclick=\"window.open(\\'https://pokemon.fandom.com/wiki/Regions\\',\r\n \\'_blank\\')\">here</a>, dude.</p>';\r\n }\r\n\r\n $this->getRegionPokemons($myUrl);\r\n\r\n }else if($attribute=='id' or $attribute=='name'){\r\n\r\n $myPageName = $this->source . 'pokemon/'. $value;\r\n\r\n $myData = $this->getData($myPageName);\r\n\r\n if($myData!=null){\r\n array_push($this->pokemon_list, $myData);\r\n }else{\r\n\r\n return 'Are you sure that Pokémon exists? Remember Pokémons máx Ndex (National Pokédex id) right now is '.\r\n $this->max_id .'.<p>Check full Pókemon list <a href=\"#\" \r\n onclick=\"window.open(\\'https://bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_by_National_Pok%C3%A9dex_number\\',\r\n \\'_blank\\')\">here</a>.</p>';\r\n }\r\n\r\n }\r\n\r\n return $this->pokemon_list;\r\n\r\n }", "public function searchapi()\n {\n // dd($_GET);\n $name = $_GET['name']; //si no quiere buscar en name poner false en el query\n $nomenclature = $_GET['nomenclature']; //si no quiere buscar en nomenclature poner false en el query\n $planta = $_GET['planta']; //si no quiere buscar en planta poner false en el query, SINO planta=1\n $esqueje = $_GET['esqueje'];\n $semillas = $_GET['semillas'];\n $producto = $_GET['producto'];\n $servicio = $_GET['servicio'];\n\n $resultados = Article::where(function ($query) {\n $query->where('name', 'like', '%' . $_GET['name'] . '%')\n ->orWhere('nomenclature', 'like', '%' . $_GET['nomenclature'] . '%');\n })\n ->where(function ($query) {\n $query->where('category_id', '=', $_GET['planta'])\n ->orWhere('category_id', '=', $_GET['esqueje'])\n ->orWhere('category_id', '=', $_GET['semillas'])\n ->orWhere('category_id', '=', $_GET['producto'])\n ->orWhere('category_id', '=', $_GET['servicio']);\n })\n\n ->orderBy('name', 'ASC')\n ->get();\n // ->paginate(6);\n // $resultados->withPath(\"resultados?search=$param\");\n\n return $resultados;\n }", "public function get69response(Request $request)\n {\n $alldata = null;\n $alldata = $request->all();\n $parameters = [];\n $query = 'select id, rfc, contribuyente, oficio, tipo, fecha_sat, fecha_dof, url_oficio, url_anexo from `69` where ';\n\n\n if($alldata['by_rfc'] == 1)\n {\n if (array_key_exists('rfc_value',$alldata) && isset($alldata['rfc_value']))\n {\n $query = $query.'rfc = ?';\n array_push($parameters, strtoupper($alldata['rfc_value']));\n }\n }\n else\n {\n $num = 0;\n\n if (array_key_exists('nombre_value',$alldata) && isset($alldata['nombre_value'])){\n $query = $query.\"contribuyente like ?\";\n array_push($parameters, '%'.$alldata['nombre_value'].'%');\n $num += 1;\n }\n\n if (array_key_exists('oficio_value',$alldata) && isset($alldata['oficio_value'])){\n if ($num != 0)\n $query = $query.' AND oficio = ? ';\n else\n $query = $query.' oficio = ? ';\n array_push($parameters, $alldata['oficio_value']);\n $num += 1;\n }\n\n if (array_key_exists('estado_value',$alldata) && isset($alldata['estado_value'])){\n if ($num != 0)\n $query = $query.' AND tipo in (?';\n else\n $query = $query.' tipo in (?';\n\n array_push($parameters, $alldata['estado_value'][0]);\n for ($i = 1; $i < count($alldata['estado_value']); $i++ )\n {\n $query = $query.',?';\n array_push($parameters, $alldata['estado_value'][$i]);\n }\n $query = $query.') ';\n $num += 1;\n }\n\n //by sat\n if ($alldata['by_sat'] == 1){\n if ($alldata['by_sat_specific'] == 1){\n if (array_key_exists('fecha_esp_sat',$alldata) && isset($alldata['fecha_esp_sat']))\n {\n if ($num != 0)\n $query = $query.' AND fecha_sat = ? ';\n else\n $query = $query.' fecha_sat = ? ';\n array_push($parameters, $alldata['fecha_esp_sat']);\n $num += 1;\n }\n }\n else\n {\n if (array_key_exists('fecha_ini_sat',$alldata) && isset($alldata['fecha_ini_sat']) && array_key_exists('fecha_fin_sat',$alldata) && isset($alldata['fecha_fin_sat']))\n {\n if ($num != 0)\n $query = $query.' AND fecha_sat BETWEEN STR_TO_DATE(?,\"%Y-%m-%d\") AND STR_TO_DATE(?,\"%Y-%m-%d\") ';\n else\n $query = $query.' fecha_sat BETWEEN STR_TO_DATE(?,\"%Y-%m-%d\") AND STR_TO_DATE(?,\"%Y-%m-%d\") ';\n array_push($parameters, $alldata['fecha_ini_sat']);\n array_push($parameters, $alldata['fecha_fin_sat']);\n $num += 1;\n }\n }\n }\n\n //by dof\n if ($alldata['by_dof'] == 1){\n if ($alldata['by_dof_specific'] == 1){\n if (array_key_exists('fecha_esp_dof',$alldata) && isset($alldata['fecha_esp_dof']))\n {\n if ($num != 0)\n $query = $query.' AND fecha_dof = ? ';\n else\n $query = $query.' fecha_dof = ? ';\n array_push($parameters, $alldata['fecha_esp_dof']);\n $num += 1;\n }\n }\n else\n {\n if (array_key_exists('fecha_ini_dof',$alldata) && isset($alldata['fecha_ini_dof']) && array_key_exists('fecha_fin_dof',$alldata) && isset($alldata['fecha_fin_dof']))\n {\n if ($num != 0)\n $query = $query.' AND fecha_dof BETWEEN ? AND ? ';\n else\n $query = $query.' fecha_dof BETWEEN STR_TO_DATE(?,\"%Y-%m-%d\") AND STR_TO_DATE(?,\"%Y-%m-%d\") ';\n array_push($parameters, $alldata['fecha_ini_dof']);\n array_push($parameters, $alldata['fecha_fin_dof']);\n $num += 1;\n }\n }\n }\n }\n\n Log::info($query);\n Log::info($parameters);\n\n $query_result = \\DB::select($query,$parameters);\n\n Log::info($query_result);\n\n $registros69 = array(\n array('rfc'=>'rrrrr', 'contribuyente'=>'rrrrr','tipo'=>'rrrr', 'oficio'=>'rrrr','fecha_sat'=>'rrrr','fecha_dof'=>'rrr','url_oficio'=>'rrrr','url_anexo'=>'rrrr'),\n array('rfc'=>'aaaaa', 'nombre'=>'aaaa','estado'=>'aaaa','fecha_sat'=>'aaaa','fecha_dof'=>'aaaa','url_oficio'=>'aaaa','url_anexo'=>'aaaaa'),\n array('rfc'=>'bbbbb', 'nombre'=>'bbbb','estado'=>'bbbb','fecha_sat'=>'bbbbb','fecha_dof'=>'bbbb','url_oficio'=>'bbbb','url_anexo'=>'bbbb'),\n );\n\n $response = array(\n 'status' => 'Success',\n 'msg' => 'Registers returned',\n 'response69' => $query_result);\n\n return \\Response::json($response);\n }", "public abstract function getQuery();", "public static function apiQuery($params)\n\t\t{\n\t\t\t$class = get_called_class();\n\t\t\t$metaSelectReflect = new ReflectionMethod($class, 'MetaSelect');\n\t\t\tif($metaSelectReflect->class != $class)\n\t\t\t\tthrow new SERIA_Exception('The \"'.$class.'::MetaSelect\"-method has not been overridden. You must apply security restrictions before this api can be made available. The method must return a where clause or NULL if you wish to make everything available to everybody.');\n\t\t\ttry {\n\t\t\t\t$metaFieldsReflect = new ReflectionMethod($class, 'MetaFields');\n\t\t\t} catch (ReflectionException $e) {\n\t\t\t\tthrow new SERIA_Exception('The \"'.$class.'::MetaFields\"-method has not been declared. You must apply security restrictions before this api can be made available. The method must return an array containing the field names the user is allowed to read or NULL if all fields should be available.');\n\t\t\t}\n\t\t\tif($metaFieldsReflect->class != $class)\n\t\t\t\tthrow new SERIA_Exception('The \"'.$class.'::MetaFields\"-method has not been declared. You must apply security restrictions before this api can be made available. The method must return an array containing the field names the user is allowed to read or NULL if all fields should be available.');\n\n\t\t\t$fields = call_user_func(array($class, 'MetaFields'), $options);\n\n\t\t\t$query = SERIA_Meta::all($class);\n\n\t\t\tif (isset($params['order'])) {\n\t\t\t\tif (substr($params['order'], 0, 1) == '-') {\n\t\t\t\t\tif (in_array(substr($params['order'], 1), $fields))\n\t\t\t\t\t\t$query->order(substr($params['order'], 1).' DESC');\n\t\t\t\t} else {\n\t\t\t\t\tif (in_array($params['order'], $fields))\n\t\t\t\t\t\t$query->order($params['order'].' ASC');\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset($params['length'])) {\n\t\t\t\tif (isset($params['start']))\n\t\t\t\t\t$query->limit(intval($params['start']), intval($params['length']));\n\t\t\t\telse\n\t\t\t\t\t$query->limit(intval($params['length']));\n\t\t\t}\n\n\t\t\tforeach ($params as $name => $value) {\n\t\t\t\tif (in_array($name, $fields))\n\t\t\t\t\t$query->where($name.' = :'.$name, array($name => $value));\n\t\t\t}\n\t\t\t$res = array();\n\t\t\tforeach ($query as $obj) {\n\t\t\t\t$arr = array();\n\t\t\t\tforeach ($fields as $field) {\n\t\t\t\t\t$value = $obj->get($field);\n\t\t\t\t\tif ($value instanceof SERIA_MetaObject)\n\t\t\t\t\t\t$value = SERIA_Meta::getReference($value);\n\t\t\t\t\t$arr[$field] = $value;\n\t\t\t\t}\n\t\t\t\t$res[] = $arr;\n\t\t\t}\n\t\t\treturn $res;\n\t\t}", "public function adv_data_search_get()\n {\n $sutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n\n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n $data = file_get_contents('php://input', 'r');\n \n $json = $sutil->adv_data_search($data, $from, $size);\n $this->response($json);\n }", "abstract protected function getQuery();", "public function search($args){\n\t\t//Sets defaults where input doesn't exist.\n\t\t//This will only add if the index doesn't exist?\n\t\t$args += [\n\t\t\t\"page\" => 0,\n\t\t\t\"index\" => null,\n\t\t\t\"type\" => \"books\"\n\t\t];\n\t\textract($args);\n\t\t//Now check we have a query\n\t\tif(!isset($query)){\n\t\t\techo \"NEED TO HAVE A QUERY IN SEARCH\";\n\t\t\texit(1);\n\t\t}\n\t\t//Create url for search\n\t\t$url = \"$this->apiRoot/$type?q=$query&p=$page\" . ($index === null ? \"\" : \"&i=$index\") . $this->apiTail;\n\n\t\t//Run search, return json as array\n\t\t//return file_get_contents($url);\n\t\treturn apiSampleSearch();\n\t}", "function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }", "public function testQuery()\n {\n // Test with correct field name\n $this->visit('/cube/1')\n ->type('1', 'x1')\n ->type('1', 'y1')\n ->type('1', 'z1')\n ->type('2', 'x2')\n ->type('2', 'y2')\n ->type('2', 'z2')\n ->press('submit-query')\n ->see('the sum of: 27');\n\n /*\n * Tests with incorrect fields\n */\n // Field required\n $this->visit('/cube/1')\n ->press('submit-query')\n ->see('is required');\n\n // Field must be integer\n $this->visit('/cube/1')\n ->type('1a', 'z1')\n ->press('submit-query')\n ->see('integer');\n\n // Field value very great\n $this->visit('/cube/1')\n ->type('10000000', 'z2')\n ->press('submit-query')\n ->see('greater');\n }", "public function _query()\n {\n }", "abstract public function query($q, $params = []);", "public function query(): string;", "function getQuery() ;", "function get_terapis_list(){\r\n\t\t$query = isset($_POST['query']) ? $_POST['query'] : \"\";\r\n\t\t$tgl_app = isset($_POST['tgl_app']) ? $_POST['tgl_app'] : \"\";\r\n\t\t$result=$this->m_waiting_list->get_terapis_list($query,$tgl_app,\"Therapist\");\r\n\t\techo $result;\r\n\t}", "public function query(Request $request)\n {\n $type = $request->input('q');\n\n switch ($type) {\n case 'this-week':\n $data = $this->renderThisWeekSchedule($request);\n break;\n case 'week':\n $data = $this->renderWeekSchedule($request);\n break;\n case 'now':\n $data = $this->isOpenNow($request);\n break;\n case 'day':\n try {\n $day = new Carbon($request->input('date'));\n\n $data = $this->isOpenOnDay($day, $request);\n } catch (\\Exception $ex) {\n \\Log::error($ex->getMessage());\n \\Log::error($ex->getTraceAsString());\n return response()->json(['message' => 'Something went wrong, are you sure the date is in the expected YYYY-mm-dd format?'], 400);\n }\n break;\n default:\n abort(400, 'The endpoint did not find a handler for your query.');\n break;\n }\n\n // Check if the format paramater is passed and supported\n $format = $request->input('format');\n\n // The default format is JSON\n switch ($format) {\n case 'html':\n $data = $this->makeHtmlForSchedule($data);\n return response()->make($data);\n break;\n case 'text':\n $data = $this->makeTextForSchedule($data);\n return response()->make($data);\n break;\n case 'json-ld':\n $data = $this->makeJsonLdForSchedule($data, $request->input('serviceUri'));\n return response()->make($data);\n break;\n default:\n return response()->json($data);\n break;\n }\n }", "function query($arg_str) // call this function from other units and configs\n\t\t{\n\t\t\t$query_segments = explode(';',$arg_str);\n\n\t\t\t\n\t\t\t$response = [];\n\t\t\tforeach($query_segments as $q_str) \n\t\t\t{\t\t\t\t\n\t\t\t\t$matches=[];\n\t\t\t\tif(preg_match_all( \"#^(.+)\\:\\:([[:alnum:]]+)$#Uis\",$q_str,$matches))\n\t\t\t\t{\n\t\t\t\t\t$q_str = $matches[1][0];\n\t\t\t\t\t$_q_id = $matches[2][0];\n\t\t\t\t}\n\n\t\t\t\t$_res_obj = $this->get_obj_by_route($q_str);\n\t\t\t\t\n\t\t\t\t$_new_query_obj=[\n\t\t\t\t\t'query'=>$q_str,\n\t\t\t\t\t'response'=>$_res_obj,\n\t\t\t\t];\n\t\t\t\tif(isset($_q_id))\n\t\t\t\t{\n\t\t\t\t\t$_new_query_obj['key']=$_q_id;\n\t\t\t\t\tunset($_q_id);\n\t\t\t\t}\n\n\t\t\t\t$response[]=$_new_query_obj;\n\t\t\t}\n\t\t\treturn $response;\n\t\t}", "function search($conn)\n{\n $includedValue = getIncludedValues(); //Get user included values\n $excludedValue = getExcludedValues(); //Get user excluded values\n if ($includedValue != \"\" && $excludedValue != \"\") {\n changeText(\"ShowSearchString\", \"Include: \" . $includedValue . \"</br>Exclude: \" . $excludedValue);\n } elseif ($includedValue != \"\") {\n changeText(\"ShowSearchString\", \"Include: \" . $includedValue);\n } elseif ($excludedValue != \"\") {\n changeText(\"ShowSearchString\", \"Exclude: \" . $excludedValue);\n } else {\n changeText(\"DefaultString\", \"Show All by Default Search\");\n }\n $searchString = getSearchString();\n $sql = \"SELECT * FROM contribution\" . $searchString;\n $inputObject = new searchObject();\n $inputObject->set_attributes();\n return getData($conn, $sql, $inputObject);\n}", "public function search($params = []);", "public function index()\n {\n $pn = Input::get('pn');\n $cnt = Input::get('cnt');\n $selectItem = Input::get('selectItem');\n $status = Input::get('zhuangtai');\n if(!$pn){\n $pn = 1;\n }\n $client = new Client ([\n 'base_uri' => $this->base_url,\n\n ]);\n $response = $client->request('GET', '/api/contract/sf/list',[\n 'query'=>[\n 'pn'=>$pn,\n 'cnt'=>$cnt,\n 'selectItem'=>$selectItem,\n 'status'=>$status,\n ]\n ]);\n echo $response->getBody();\n }", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function query() {\n if (!$this->servicesHealthStatus->getFetcherState()) {\n $this->messenger->addError(t('The fetcher services does not responding'));\n return [];\n }\n\n $query = <<<'GRAPHQL'\n query {\n systemField {\n Id\n Label\n }\n reportsType {\n Id\n Label\n }\n fromYearRange {\n Years\n Quarters {\n Id\n Label\n }\n }\n toYearRange {\n Years\n Quarters {\n Id\n Label\n }\n }\n }\n GRAPHQL;\n\n $response = $this->sendQuery($query);\n return json_decode($response, true)['data'];\n }", "public function searchUsersByQueryString($request)\n {\n return $this->start()->uri(\"/api/user/search\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function queryAction()\n {\n $this->logger = Zend_Registry::get('logger');\n $this->getHelper('ViewRenderer')->setNoRender('false');\n $this->_helper->layout()->disableLayout();\n try {\n if ($this->getRequest()->isPost()) {\n $this->logger->log('Post Parameters Received', Zend_Log::INFO,\n 'PASS');\n $data = $this->getRequest()->getPost();\n if (! $data['complain_type'] || ! $data['district_id'] || ! $data['date']) {\n throw new Exception('Bad Parameters', '400');\n }\n $model = new Model_DbTable_Complain();\n $response = $model->getComplainsByCondition($data);\n if ($response) {\n $this->getResponse()->setHttpResponseCode(200);\n $this->logger->log('Succesful QueryPerformed', Zend_Log::INFO,\n 'SUCCESS');\n $xml = $model->xmlConverter($response);\n print $xml;\n } else {\n throw new Exception('Service Unavailable', '503');\n }\n } else {\n throw new Exception('Bad Parameters', '400');\n }\n } catch (Exception $e) {\n $this->getResponse()->setHttpResponseCode($e->getCode());\n if ($e->getCode() == 503) {\n $this->logger->log($e->getMessage(), Zend_Log::WARN,\n 'SYSTEM ERROR');\n } else {\n $this->logger->log($e->getMessage(), Zend_Log::ERR, 'QUERY: ERROR');\n }\n $this->_response->setHttpResponseCode($e->getCode()); \n print 0;\n }\n }", "public function showAllFlights($query){\n $result=request($query) or die(\"request ne pas valid tester request\");\n return $result;\n }", "public function search()\n\t{\n\t\tif(isset($_GET['term']))\n\t\t{\n\t\t\t$result = $this->Busca_Model->pesquisar($_GET['term']);\n\t\t\tif(count($result) > 0) {\n\t\t\tforeach ($result as $pr)$arr_result[] = $pr->nome;\n\t\t\t\techo json_encode($arr_result);\n\t\t\t}\n\t\t}\n\t}", "public function querySearch(Request $request)\n\t{\n\t\t// /catalog/products?gender=female&page=1&page_size=10&sort=popularity\n\t\t//$page = request('page'); // or\n\t\t//$page = $request->page; // or\n\t\t//$page = $request->input('page'); // or\n\t\t//$page = $request->query('page');\n\t\t\n\t\t$page = request('page');\n\t\t$gender = request('gender');\n\t\t$page_size = request('page_size');\n\t\t$sort = request('sort');\n\n\t\t//dd($request); // latest\n\t\treturn $this->product->searchProductWithQueries($gender, $page, $page_size, $sort);\n\t}", "public function search() {\n\t\tif(isset($_GET['query'])) $this->query_str = $_GET['query'];\n\t\telse return;\n\n\t\t$raw = null;\n\n\t\t$cache = new Cache($this->query_str);\n\t\t//check if the result is cached\n\t\t\n\t\tif($cache->allow_cache()) {\n\t\t\t$raw = $cache->load_cache();\n\t\t\tif($raw === false) $raw = null;\n\t\t}\n\n\t\tif($raw === null) {\n\t\t\t//check if jar exists\n\t\t\tif(file_exists('../executable/app.jar')) $raw = shell_exec('cd ../executable/ && java -jar app.jar search ' . escapeshellarg($this->query_str));\n\t\t\telse return;\n\n\t\t\t//only save into cached when the escaped string equal to input string\n\t\t\tif($raw !== null && count($raw) > 0 && $cache->allow_cache()) \n\t\t\t\t$cache->save_cache($raw);\n\t\t}\n\n\t\t$this->results = json_decode($raw);\n\n\t\t$this->end_time = microtime(true);\n\t}", "public function execute(Request $request)\n {\n\n $keyword = $request->input('keyword', '');\n $alipay = $request->input('alipay', '');\n $page = $request->input('page', 1);\n $page_size = $request->input('page_size', 10);\n\n $query = DB::table('game_user');\n\n if ($keyword) {\n //$query->where('');\n }\n if ($alipay) {\n $query->where('bind_alipay', '=', $alipay);\n }\n\n $infos = $query->orderByDesc('updated_at')->forPage($page, $page_size)->get();\n\n $data = [\n 'total' => $query->count(),\n 'rows' => $infos,\n 'search' => [\n 'page' => $page,\n 'page_size' => $page_size,\n ]\n ];\n\n return $this->ajax_return(0, 'success', $data);\n }", "protected function search($request,$query)\n {\n\n\n foreach (array_except($request->all(),['_token','page']) as $key => $value)\n {\n if($key == 'min' || $key == 'max')\n {\n $this->price[$key] = ($value== '') ? 0 : (int)$value ;\n continue;\n }\n if($request->$key == '')\n continue;\n if( $key != 'name' && $key != 'price' )\n {\n $query->where($key,$value);\n }\n elseif ($key== 'price')\n {\n $this->priceSearch($value,$query);\n }\n elseif ($key == 'name' )\n {\n $query->where(function ($q) use ($key,$value){\n $q->where($key,'like','%'.$value.'%')->orWhere('description','like','%'.$value.'%');\n });\n }\n\n }\n $this->priceRange($query);\n\n }", "public function queryAll($campos=\"*\",$criterio=\"\");", "function doAPISearch($params) {\n global $searchUrl;\n\n $ch = curl_init(); // initialize curl handle\n curl_setopt($ch, CURLOPT_URL,$searchUrl . $params);\n curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable\n curl_setopt($ch, CURLOPT_TIMEOUT, 8); // times out after 4s\n curl_setopt($ch, CURLOPT_POST, 0); // set GET method\n // curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n // Retrieve result\n $result = curl_exec($ch);\n // TODO return error if error\n // $cerror = curl_error($ch);\n\n return $result;\n}", "function handleGETRequest() {\n if (connectToDB()) {\n if (array_key_exists('countTuples', $_GET)) {\n handleCountRequest();\n } else if (array_key_exists('displayTuples', $_GET)) {\n\t\t handleDisplayRequest();\n\t\t} else if (array_key_exists('deleteTuple', $_GET)) {\n\t\t handleDeleteRequest();\n\t\t}\n\n disconnectFromDB();\n }\n }", "function searchContactList($type, $query) {\n\tglobal $apiBaseURL; // bad practice in production - fine for this example\n\n\t// the URL expects the type to have a capital first letter - lets force this\n\t$type = ucfirst($type);\n\n\t// lets lowercase and strip white space (really you should do more cleaning up of user input)\n\t$query = trim(strtolower($query));\n\n\t//\n\t// To do a search we are using the $filter from the oData specification\n\t// http://www.odata.org/documentation/uri-conventions#FilterSystemQueryOption\n\t// We search only the CoLastName and FirstName for this example\n\t//\n\n\t$filter = \"filter=substringof('\".$query.\"',%20CoLastName)%20or%20substringof('\".$query.\"',%20FirstName)%20eq%20true\";\n\n\n\t// use the getURL function to call the URL - remember we are calling the vars we need from the session vars\n\t$response = getURL($apiBaseURL.$_SESSION['companyFileGUID'].'/Contact/'.$type.'/?$'.$filter, $_SESSION['username'], $_SESSION['password']);\n\n\t// it returned as JSON so lets decode it\n\t$response = json_decode($response);\n\t// return the response\n\treturn($response);\n\n}", "public function search(){}", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();" ]
[ "0.64938456", "0.64938456", "0.64938456", "0.64637804", "0.640242", "0.63288033", "0.62497175", "0.6249559", "0.6157252", "0.6130731", "0.61106855", "0.605952", "0.6013136", "0.5933537", "0.5907476", "0.5890098", "0.5890098", "0.5888156", "0.5880076", "0.5814138", "0.58113563", "0.57996064", "0.579702", "0.5787598", "0.57867754", "0.57858545", "0.57809687", "0.5763696", "0.57622856", "0.57622856", "0.57622856", "0.5738096", "0.5735923", "0.5735923", "0.5735923", "0.5735923", "0.5735923", "0.5735923", "0.5735923", "0.5735923", "0.5735923", "0.5730447", "0.5725157", "0.5720051", "0.57070076", "0.5676394", "0.5667565", "0.5649843", "0.5641773", "0.562043", "0.5607212", "0.5597855", "0.55904967", "0.55782", "0.55615664", "0.55576223", "0.555752", "0.55488974", "0.5547313", "0.55422115", "0.55409837", "0.55304396", "0.552962", "0.55233455", "0.55233455", "0.55233455", "0.55233455", "0.55233455", "0.55233455", "0.55233455", "0.55233455", "0.55233455", "0.55189806", "0.5512362", "0.5495513", "0.54940623", "0.54890716", "0.54789823", "0.5471921", "0.54652125", "0.54632", "0.5460099", "0.54594654", "0.5457948", "0.54543686", "0.54433775", "0.54417396", "0.54417396", "0.54417396", "0.54417396", "0.54417396", "0.54417396", "0.54417396", "0.54417396", "0.54417396", "0.54417396", "0.54417396", "0.54417396", "0.54417396", "0.54417396" ]
0.55975163
52
Display a listing of the resource.
public function index() { $tickets = Ticket::all(); return view('bookTicket.index', compact('tickets')); }
{ "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 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 actionRestList() {\n\t $this->doRestList();\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 CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\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 index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "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 index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\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 return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "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}", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n {\n $this->booklist();\n }", "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 $items = Item::all();\n return view('items::list_items',compact('items'));\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 // 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 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 showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\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 actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\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 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 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 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 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 $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\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.7447426", "0.73628515", "0.73007894", "0.7249563", "0.7164474", "0.7148467", "0.71320325", "0.7104678", "0.7103152", "0.7100512", "0.7048493", "0.6994995", "0.69899315", "0.6935843", "0.6899995", "0.68999326", "0.6892163", "0.6887924", "0.6867505", "0.6851258", "0.6831236", "0.68033123", "0.6797587", "0.6795274", "0.67868614", "0.67610204", "0.67426085", "0.67303514", "0.6727031", "0.67257243", "0.67257243", "0.67257243", "0.67195046", "0.67067856", "0.67063624", "0.67045796", "0.66655326", "0.666383", "0.66611767", "0.66604036", "0.66582054", "0.6654805", "0.6649084", "0.6620993", "0.66197145", "0.6616024", "0.66077465", "0.6602853", "0.6601494", "0.6593894", "0.65878326", "0.6586189", "0.6584675", "0.65813804", "0.65766823", "0.65754175", "0.657203", "0.657202", "0.65713936", "0.65642136", "0.6563951", "0.6553249", "0.6552584", "0.6546312", "0.6536654", "0.6534106", "0.6532539", "0.6527516", "0.6526785", "0.6526042", "0.65191233", "0.6518727", "0.6517732", "0.6517689", "0.65155584", "0.6507816", "0.65048593", "0.6503226", "0.6495243", "0.6492096", "0.6486592", "0.64862204", "0.6485348", "0.6483991", "0.64789015", "0.6478804", "0.64708763", "0.6470304", "0.64699143", "0.6467142", "0.646402", "0.6463102", "0.6460929", "0.6458856", "0.6454334", "0.6453653", "0.645357", "0.6450551", "0.64498454", "0.64480853", "0.64453584" ]
0.0
-1
Show the form for booking Ticket.
public function bookTicket() { $data = Session::get('key'); $data1 = Session::get('key2'); $date2 = Session::get('key3'); $vehicleTypeS = Session::get('key4'); $destination = DB::table('destinations')->where('name','=',$data1)->value('image'); $routes = Route::where([ ['start_point', '=', $data], ['end_point', '=', $data1], ])->get(); $vehicleType = VehicleType::where([ ['id', '=', $vehicleTypeS], ])->get(); $vehicle = Vehicle::all(); return view('bookTicket.bookTicket', compact('routes', 'vehicleType','vehicle','date2','destination')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return view('web::ticket.create');\n }", "public function show(Ticket $ticket)\n {\n //\n }", "public function show(Ticket $ticket)\n {\n //\n }", "public function show(Ticket $ticket)\n {\n //\n }", "public function actionTicket()\n {\n $model = new MonitoringVoucherForm();\n\n $rawdata = array();\n $option = array();\n $option[] = array('VoucherID' => 1, 'VoucherName' => 'Ticket');\n //Provide list data\n $vouchers = CHtml::listData($option, 'VoucherID', 'VoucherName');\n if (isset($_POST['MonitoringVoucherForm']))\n {\n $rawdata = $this->monitorVouchers($_POST['MonitoringVoucherForm']);\n Yii::app()->session['rawData'] = $rawdata;\n }\n if (count($rawdata) > 0)\n {\n $this->hasResult = true;\n }\n else\n {\n $this->hasResult = false;\n }\n $headertitle = \"Monitoring of Tickets\";\n $this->render('index', array('model' => $model, 'vouchers' => $vouchers, 'rawdata' => $rawdata, 'title' => $headertitle));\n }", "public function ticketAction()\n {\n try {\n return $this->loadLayout()\n ->_setActiveMenu('freshdesk/ticket')\n ->_title($this->__('Freshdesk'))\n ->_title($this->__('Manage Tickets'))\n ->_addContent($this->getLayout()->createBlock('freshdesk/adminhtml_ticket'))\n ->renderLayout();\n } catch (Mageplace_Freshdesk_Exception $mfe) {\n $this->_getSession()->addError($mfe->getMessage());\n $this->_getSession()->addError($this->__('Please check Freshdesk configuration options'));\n if ($mfe->isWrongConfig()) {\n $this->_redirect('*/system_config/edit/section/freshdesk');\n } else {\n $this->_redirect('*');\n }\n } catch (Exception $e) {\n $this->_getSession()->addError($e->getMessage());\n $this->_redirect('*');\n }\n }", "private function ticketToevoegenAction()\n {\n //controlleert of er een formulier is ingevuld\n if (isset($_POST) && !empty($_POST))\n {\n $ticket_id = $this->model->maakTicket();\n $this->model->voegAgendaEventToe($ticket_id);\n $_SESSION['ticket_id'] = $ticket_id;\n\n $this->forward('getBeschikbareExpert', 'admin');\n } else\n {\n $this->view->set('gebruikers', $this->model->geefExperts());\n $this->view->set('klant_id', $_REQUEST['klant_id']);\n }\n }", "public function booking()\n {\n return view('templates.them8.booking');\n }", "public function booking()\n {\n $booking_active = true;\n $branchs = $this->branch_services->all('asc');\n $type_services = $this->type_services->all('asc');\n\n return view('client.booking', compact('branchs', 'type_services', 'booking_active'));\n }", "public function create()\n {\n return view('ticket.create');\n }", "public function actionBooking() {\n $model = new Reservation();\n $check_in_date = Yii::$app->request->post('check_in');\n $check_out_date = Yii::$app->request->post('check_out');\n $rate_plan = Yii::$app->request->post('rate_plan_id');\n $total_amount = Yii::$app->request->post('total_amount');\n\n return $this->render('create', [\n 'check_in_date'=>$check_in_date,\n 'check_out_date'=>$check_out_date,\n 'rate_plan'=>$rate_plan,\n 'total_amount'=>$total_amount,\n 'model'=>$model,\n ]);\n\n }", "public function create()\n {\n return view('module.tickets.create');\n }", "public function create()\n {\n return view('tickets.ticket_create');\n }", "private function ticketbzkAction()\n {\n $ticket = $this->model->geefTicket();\n $this->view->set('ticket', $ticket);\n\n $klant = $this->model->geefKlant();\n $this->view->set('klant', $klant);\n\n $this->view->set('gebruikers', $this->model->geefGebruikers());\n\n if (!empty($_POST['ticket_id']) && isset($_POST['ticket_id']) && !empty($_POST['escalatie']) && isset($_POST['escalatie']))\n {\n $this->model->wijzigEscalatie();\n $this->model->foutGoedMelding('success', 'Uw escalatie is verzonden.');\n $this->model->setLog('Escalatie toevoegen', 1);\n $this->forward('tickets', 'admin');\n }\n if (!empty($_POST['ticket_id']) && isset($_POST['ticket_id']) && !empty($_POST['antwoord_escalatie']) && isset($_POST['antwoord_escalatie']))\n {\n $this->model->wijzigEscalatieAntwoord();\n $this->model->foutGoedMelding('success', 'Uw antwoord escalatie is verzonden');\n $this->model->setLog('Escalatie antwoord toevoegen', 1);\n $this->forward('tickets', 'admin');\n }\n }", "public function booking()\n {\n //dd('tets');\n return view('booking');\n }", "public function create()\n {\n return view('support_tickets.create');\n }", "public function create()\n\t{\n\t\treturn view('tickets.create');\n\t}", "public function show(Booking $booking)\n {\n //\n }", "public function show(Booking $booking)\n {\n //\n }", "public function show(Booking $booking)\n {\n //\n }", "public function show(Booking $booking)\n {\n //\n }", "public function show(Booking $booking)\n {\n //\n }", "public function showForm()\n {\n $parent= $this->parentAccountList();\n $people= $this->getBusinessPartners();\n $code= $this->getAccountCode();\n return view('setup.accounts.accounts')->with(\"parent\",$parent)->with(\"people\",$people)->with(\"code\", $code);\n }", "private function ticketAction()\n {\n //controlleert of de post naam is gevuld voor de zoek functie\n if (isset($_POST['waarde']) && !empty($_POST['waarde']))\n {\n //haalt alle klanten op die voldoen aan de zoek woord\n $tickets = $this->model->zoekTickets();\n } else\n {\n //haalt alle klanten op\n $tickets = $this->model->geefTickets();\n }\n if ($tickets === \"ticketBestaatNiet\")\n {\n $this->forward('ticket', 'admin');\n $this->model->foutGoedMelding('danger', '<strong> Foutmelding: </strong> Ticket bestaat niet!');\n } else\n {\n //plaats de klanten in de view\n $this->view->set('tickets', $tickets);\n //eind\n $this->view->set('ticket', $this->model->geefTicket());\n $this->view->set('klant', $this->model->geefKlant());\n $this->view->set('gebruikers', $this->model->geefGebruikers());\n }\n }", "public function create()\n {\n return view('tickets.create');\n }", "public function create()\n {\n return view('tickets.create');\n }", "public function show(CaretakerForm $caretakerForm)\n {\n //\n }", "public function showNew()\n {\n $customers = Customers::select(['id', 'name', 'designation'])->get();\n $rooms = Room::getBookingRooms();\n return view('backend.bookings.new')\n ->withCustomers($customers)\n ->withRooms($rooms);\n }", "public function create()\n {\n return view('tickets/create');\n }", "public function create()\n {\n return view('laravel-tickets::tickets.create');\n }", "function show_ticket()\n\t{\n\t\t# Gets the result that matches the ticket\n\t\tglobal $ticketID, $techID;\n\t\t$query = \"SELECT * FROM tickets WHERE ticket=$ticketID\";\n\t\t$result = mysql_query($query) or die(\"<b>Error: </b>\" . mysql_error());\n\t\t$row = mysql_fetch_array($result);\n\n\t\t# Get the information\n\t\t$ticket = $row['ticket']; $date = $row['date']; $name = $row['name']; $email = $row['email']; $subject = $row['subject']; $desc = $row['description']; $status = $row['status'];\n\t\t$tableRow = array($ticket,$date,$name,$email,$subject,$desc);\n\n\t\t# Gets the name of the tech\n\t\t$result2 = mysql_query(\"SELECT * FROM users,assign WHERE assign.ticket=$ticketID AND users.id=assign.id\") or die(\"<b>Error: </b>\" . mysql_error());\n\t\t$row2 = mysql_fetch_array($result2);\n\t\t$techName = $row2['name'];\n\n\t\t# If there is no tech\n\t\tif( !$techName ) $techName = \"<i>Unassigned</i>\";\n\n\t\t$tableRow[] = \"$techName\";\n\t\t$tableRow[] = \"$status\";\n\n\t\techo \"<table><tr align = 'center'><th>Ticket #</th><th>Received</th><th>Sender Name</th><th>Sender Email</th><th>Subject</th><th>Description</th><th>Tech</th><th>Status</th></tr>\";\n\n\t\t# Put the data in the table\n\t\techo \"<tr>\";\n\t\tforeach($tableRow as $value):\n\t\t\techo \"<td>$value</td>\";\n\t\tendforeach;\n\t\techo \"</tr>\";\n\n\t\t# Show the buttons for the ticket\n\t\techo \"</table><br /><form id = 'form2' onsubmit=\\\"return submitInfo(document.getElementById('form2'),'ticket.php');\\\" ><input type = 'submit' name = 'leave' value = 'GoBackToAdminPage' onclick='document.pressed=this.value' ><input type = 'submit' name = 'close' value = 'CloseTicket' onclick='document.pressed=this.value' ><input type = 'submit' name = 'self' value = 'AssignSelfToTicket' onclick='document.pressed=this.value' ><input type = 'submit' name = 'remove' value = 'RemoveSelfFromTicket' onclick='document.pressed=this.value' ><input type = 'submit' name = 'query' value = 'QueryTheSubmitter' onclick='document.pressed=this.value' ><br /><input type = 'submit' name = 'delete' value = 'DeleteTheTicket' onclick='document.pressed=this.value' ><input type = 'submit' name = 'same' value = 'FindAllTicketsFromSameSubmitter' onclick='document.pressed=this.value' ><input type = 'submit' name = 'all' value = 'FindAllSimilarTickets' onclick='document.pressed=this.value' ></form>\";\n\t}", "protected function form()\n {\n $form = new Form(new Ticket);\n\n\n $form->text('ticket_article', 'Номер заявки')->default(mt_rand(100000, 999999))->placeholder(' ');\n $form->text('fio', 'ФІО')->placeholder(' ');\n $form->mobile('phone', 'Телефон')->options(['mask' => '+38(999) 999 99 99'])->placeholder(' ');\n $form->text('city', 'Місто')->placeholder(' ');\n $form->text('adress', 'Адреса')->placeholder(' ');\n $form->email('email', 'Email')->placeholder(' ');\n $form->select('type', 'Тип')->options([\n 'Ремонт' => 'Ремонт',\n 'Запчастини' => 'Запчастини',\n 'Дефект' => 'Дефект'\n ])->placeholder(' ');\n $form->text('brand', 'Бренд')->placeholder(' ');\n $form->text('model', 'Модель')->placeholder(' ');\n $form->text('serial_number', 'С/Н')->placeholder(' ');\n\n $form->date('date_sale', 'Дата продажу')->format('DD.MM.YYYY')->placeholder(' ');\n $form->textarea('description', 'Додатково')->placeholder(' ');\n $form->multipleFile('files', 'Файли')->placeholder(' ');\n $form->textarea('answer', 'Відповідь клієнту')->placeholder(' ');\n $form->select('status', 'Статус')->options([\n 'Відкрита' => 'Відкрита',\n 'В обробці' => 'В обробці',\n 'Закрита' => 'Закрита'\n ])->placeholder(' ');\n\n return $form;\n }", "public function create()\n {\n if ( ! Auth::user()->es_admin() ) {\n flash('Puede reducir el tiempo de espera para la respuesta de su ticket adquiriendo el servicio de <a href=\"#\">Alerta Inmediata</a>','info');\n }\n return view('resources.comun.tickets.create');\n }", "public function create()\n {\n\n return view('/tickets.create');\n\n }", "public function showForm()\n\t{\n\n return ['view'=>'customer/orderForm.php', 'ajax' => true ];\n }", "public function index()\n {\n return view('ticket.ticket');\n }", "private function ticketsAction()\n {\n if (isset($_POST['zoek']) && !empty($_POST['zoek']))\n {\n $tickets = $this->model->zoekTickets();\n if ($tickets === \"ticketBestaatNiet\")\n {\n $this->model->foutGoedMelding('danger', 'Ticket bestaat niet!');\n }\n }\n if (!isset($tickets) && empty($tickets) || $tickets === \"ticketBestaatNiet\")\n {\n $tickets = $this->model->geefTickets();\n }\n $this->view->set('tickets', $tickets);\n\n $klanten = $this->model->geefKlanten();\n $this->view->set('klanten', $klanten);\n\n $gebruikers = $this->model->geefGebruikers();\n $this->view->set('gebruikers', $gebruikers);\n }", "public function create() {\n\n $category_options[''] = '-';\n $category_options += renderLists($this->category->getTermsByPostType('booking'));\n return view('backend.booking.create', compact('category_options'));\n }", "public function show()\n {\n return view('reservationok');\n }", "public function index() \n\t{\n\t\t//\n\t\treturn View::make('booking');\n\t}", "public function index()\n {\n return view('nuevoTicket');\n }", "public function form()\n {\n return view('buffet.form');\n }", "public function index()\n {\n return view('bookings.create');\n }", "public function showForm(){\n return view('marketItem.itemCreateForm');\n }", "public function create()\n {\n return view('bookings.create');\n }", "public function create()\n {\n return view('bookings.create');\n }", "public function create()\n {\n return view('bookings.create');\n }", "public function show(Ticket $ticketid)\n {\n }", "public function create()\n {\n return view('panel.ticket.create')->with('p', self::priority());\n }", "public function ticketsAction() {\n $this->view->grid = Yourdelivery_Model_Crm_Ticket::getGrid();\n }", "public function book(){\n\t\t$res_id = $this->TicketModel->RandomString('5');\n\t\t$res = array(\n\t\t\t'reservation_id' => $res_id\n\t\t);\n\t\t$this->session->set_userdata($res);\n\t\t$this->TicketModel->postbooking();\n\t\t$this->load->view('layout/header');\n\t\t$this->load->view('layout/nav');\n\t\t$this->load->view('seatbooking/print_ticket');\n\t\t$this->load->view('layout/footer');\n\t}", "public function actionCreate()\n {\n $model = new Tickets();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "function listTicket() {\n\t\t$query = \"SELECT t.t_id, t.name, t.price, t.quantity_available \n\t\tFROM yam14.F_ticket t, yam14.F_event e\n\t\tWHERE e.e_id = t.e_id\n\t\tAND t.e_id = \" . $this->eid . \";\";\n\t\t\n\t\t$result = mysql_query($query);\n\t\tif (!$result) {\n\t\t\t$message='Invalid Query' .mysql_errno().\" \\n\";\n\t\t $message .= 'Whole Query' . $query;\n\t\t die($message);\n\t\t}//end if\n\t\t\n\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t$this->ticketid = $row['t_id'];\n\t\t\t$this->ticketname = $row['name'];\n\t\t\t$this->ticketprice = $row['price'];\n\t\t\t$this->ticketavailable = $row['quantity_available'];\n\t\t\t\n\t\t\techo \"<table class=\\\"table\\\">\";\n\t\t\techo \t\"<form method=\\\"post\\\" action=\\\"event.php?eid=$this->eid\\\">\";\n\t\t\techo \t\"<tr><th colspan=\\\"4\\\">Ticket Information</th></tr>\";\n\t\t\techo \t\"<tr><td>TYPE</td><td>REMAINING</td><td>PRICE</td><td>QUANTITY</td></tr>\";\n\t\t\techo \t\"<tr>\";\n\t\t\techo \"<td>$this->ticketname</td>\";\n\t\t\techo \"<td>\";\n\t\t\tif ($this->ticketavailable==0) {\n\t\t\t\techo \"<p class='error'>Sold Out</p>\";\n\t\t\t}else {\n\t\t\t\techo $this->ticketavailable;\n\t\t\t}\n\t\t\techo \t\"</td>\";\n\t\t\techo \t\"<td>\";\n\t\t\tif ($this->ticketprice==0) {\n\t\t\t\techo \"FREE\";\n\t\t\t}else {\n\t\t\t\techo \"$\" . $this->ticketprice;\n\t\t\t}\n\t\t\techo \"</td>\";\n\t\t\techo \t\"<td><input type=\\\"number\\\" name=\\\"quantity\\\" value=\\\"\\\" step='1' placeholder=\\\"1\\\" min=\\\"1\\\" max=\\\"$this->ticketavailable\\\" \";\n\t\t\tif ($this->ticketavailable==0) {\n\t\t\t\techo \"disabled\";\n\t\t\t}\n\t\t\techo \"/></td>\";\n\t\t\techo \t\"</tr>\";\n\t\t\techo \t\"<tr><td>\";\n\t\t\techo \t\"</td><td></td><td></td><td><input type=\\\"submit\\\" name=\\\"register\\\" value=\\\"Register\\\" class=\\\"btn btn-lg btn-success\\\" \";\n\t\t\tif ($this->ticketavailable==0) {\n\t\t\t\techo \"disabled\";\n\t\t\t}\n\t\t\techo \" /></td></tr>\";\n\t\t\techo \t\"</form>\";\n\t\t\techo \t\"</table>\";\n\t\t}\t\n\t\t\n\t\tmysql_free_result($result);\n\t\t\n\t\t\t\n\t\t\t\n\t}", "public function briefingForm($game_id = 0)\n {\n // check if ticket is present\n $data = DB::table('game AS g')\n ->join('ticket_template AS tt', 'tt.game_id', '=', 'g.id')\n ->join('ticket AS t', 't.ticket_template_id', '=', 'tt.id')\n ->select(array\n (\n 'g.id AS game_id',\n 't.id AS ticket_id',\n 't.status AS status',\n 'tt.price AS price',\n 'g.settings AS settings'\n ))\n ->where('g.id', '=', $game_id)\n ->where('t.user_id', '=', Auth::user()->getId())\n ->where('t.status', '|', Ticket::STATUS_BOOKED | Ticket::STATUS_PAID)\n ->first();\n\n $data->ticket_code = strtoupper(Bit::base36_encode(Bit::swap15($data->ticket_id)));\n\n if (empty ($data))\n {\n return View::make('game.not-booked', array());\n }\n\n $settings = json_decode($data->settings, true);\n if (isset ($settings['map']['source']) && strlen ($settings['map']['source']) && $settings['map']['type'] == 1)\n {\n $mapSrc = 'https://mapsengine.google.com/map/embed?mid=' . $settings['map']['source'];\n }\n else\n {\n $mapSrc = null;\n }\n\n // check if there's a factor\n $tickets = Ticket::where('host_ticket_id', '=', $data->ticket_id)->get();\n $factor = 1 + count($tickets);\n\n $data->price = $data->price * $factor;\n $data->factor = $factor;\n\n return View::make('game.briefing', array\n (\n 'data' => $data,\n 'map' => $mapSrc,\n ));\n }", "public function form()\n {\n // 设置隐藏表单,传递用户id\n $check_status = [\n 'verify' => '已审核',\n 'overrule' => '驳回',\n ];\n $this->hidden('id')->value($this->id);\n $this->hidden('num')->value(0);\n $this->hidden('status')->value('verify');\n\n $this->radio('status', '审批')->options($check_status)->default('verify');\n $this->text('num', '准购数量')->default($this->wait_num)->rules('required');\n $this->textarea('reason', '审核意见');\n }", "public function showVerifyBusinessForm(){\n return view('businesses/forms/verify');\n }", "public function showOrderForm()\n {\n try {\n\n // get all users for select\n $users = User::all()->pluck('name', 'id');\n\n // get all products for select which has stock\n $product = new Product();\n $products = $product->getAllProducts()->pluck('product_name', 'product_id');\n\n // show job post form\n return View::make('orders.orders', compact('users', 'products'));\n } catch (Exception $e) {\n Flash::message('Something went wrong ' . $e->getMessage());\n }\n }", "public function actionCreate()\n {\n $model = new ArsBooking();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function show()\n {\n\n return View::make(\"purchasingForm.list\");\n }", "public function show($ticket)\n {\n\n $ticket = Ticket::find($ticket);\n if ($ticket == null) {\n return redirect()->back()->with('flash_error', 'Entered Ticket ID not found');\n } else if ($ticket->paid == 0) {\n return redirect()->back()->with('flash_error', 'Entered Ticket ID not yet paid');\n }\n $schedule = Schedule::find($ticket->schedule_id);\n\n $route = Route::find($schedule->route_id);\n //print_r($route->title); exit;\n return view('admin.ticket.print', compact('ticket', 'route', 'schedule'));\n }", "public function show($id)\n\t{\n return View::make('tickets.show');\n\t}", "public function create()\n\t{\n\t\t$tiendas_list = Tienda::orderBy('clave', 'asc')->lists('clave', 'id_tienda');\n\t\t$combo = array(0 => \"Seleccione ... \") + $tiendas_list;\n\t\t$selected = array(Session::get('id_tienda'));\n\t\treturn View::make('tickets.create', compact('combo', 'selected'));\n\t}", "function display_ticket($readonly=false) {\n global $CFG;\n\n $hd = helpdesk::get_helpdesk();\n\n $this->fetch();\n\n $isanswerer = helpdesk_is_capable(HELPDESK_CAP_ANSWER);\n\n $udata = $this->get_updates($isanswerer);\n $tags = $this->get_tags();\n\n $showfirstcontact = get_config(null, 'block_helpdesk_show_firstcontact');\n\n $user = get_record('user', 'id', $this->get_userid());\n $url = new moodle_url(\"$CFG->wwwroot/user/view.php\");\n $url->param('id', $user->id);\n $url = $url->out();\n\n echo \"<div class=\\\"ticketinfo\\\">\";\n $overviewstr = get_string('ticketinfo', 'block_helpdesk');\n $overviewhelp = helpdesk_simple_helpbutton($overviewstr, 'overview');\n $editurl = new moodle_url(\"$CFG->wwwroot/blocks/helpdesk/edit.php\");\n $editurl->param('id', $this->get_idstring());\n $editurl = $editurl->out();\n $editstr = get_string('editoverview', 'block_helpdesk');\n $headstr = \"$overviewstr $overviewhelp\";\n if (helpdesk_is_capable(HELPDESK_CAP_ANSWER) and !$readonly) {\n $headstr .= \"<br /><a href=\\\"$editurl\\\">$editstr</a>\";\n }\n print_table_head($headstr);\n\n $table = new stdClass;\n $table->size = array('30%');\n $table->width = '95%';\n\n $table->head = null;\n $table->align = array('left', 'left');\n\n $row = array();\n $row[] = get_string('ticketid', 'block_helpdesk');\n $row[] = $this->get_idstring();\n $table->data[] = $row;\n\n $row = array();\n $str = get_string('submittedby', 'block_helpdesk');\n if ($isanswerer and !$readonly) {\n $newuserurl = new moodle_url(\"$CFG->wwwroot/blocks/helpdesk/userlist.php\");\n $newuserurl->param('returnurl', $editurl);\n $newuserurl->param('paramname', 'newuser');\n $newuserurl->param('tid', $this->get_idstring());\n $str .=\"<br /><small><a href=\\\"\" . $newuserurl->out() . \"\\\">\" .\n get_string('changeuser', 'block_helpdesk') . '</a></small>';\n }\n $row[] = $str;\n $row[] = \"<a href=\\\"$url\\\">\" . fullname($user) . '</a>';\n $table->data[] = $row;\n \n if ($this->firstcontact != null and $showfirstcontact != false) {\n $url = new moodle_url(\"$CFG->wwwroot/user/view.php\");\n $url->param('id', $this->firstcontact->id);\n $url = $url->out();\n\n $help = helpdesk_simple_helpbutton(get_string('firstcontact', 'block_helpdesk'),\n 'firstcontact');\n\n $row = array();\n $row[] = get_string('firstcontactuser', 'block_helpdesk') . $help;\n $row[] = \"<a href=\\\"$url\\\">\" . fullname($this->firstcontact) . '</a>';\n $table->data[] = $row;\n }\n\n $row = array();\n $row[] = get_string('timecreated', 'block_helpdesk');\n $row[] = helpdesk_get_date_string($this->get_timecreated());\n $table->data[] = $row;\n\n $row = array();\n $row[] = get_string('timemodified', 'block_helpdesk');\n $row[] = helpdesk_get_date_string($this->get_timemodified());\n $table->data[] = $row;\n\n $row = array();\n $row[] = get_string('status', 'block_helpdesk');\n $status = $this->get_status();\n if ($status->core == true and empty($status->displayname)) {\n $row[] = get_string($status->name, 'block_helpdesk');\n } else {\n $row[] = $status->displayname;\n }\n $table->data[] = $row;\n\n $row = array();\n $row[] = get_string('summary', 'block_helpdesk');\n $row[] = $this->get_summary();\n $table->data[] = $row;\n\n $row = array();\n $row[] = get_string('detail', 'block_helpdesk');\n $row[] = $this->get_detail();\n $table->data[] = $row;\n\n print_table($table, false);\n echo '<br />';\n\n // Assignments start here.\n $assignedstr = get_string('assignedusers', 'block_helpdesk');\n $assignedhelp = helpdesk_simple_helpbutton($assignedstr, 'assigned');\n $thead = $assignedstr . $assignedhelp;\n\n // If the user is a answerer, he can assign people to the ticket.\n if($isanswerer and !$readonly) {\n $url = new moodle_url(\"$CFG->wwwroot/blocks/helpdesk/assign.php\");\n $url->param('tid', $this->get_idstring());\n $url = $url->out();\n $string = get_string(\"assignuser\", 'block_helpdesk');\n $thead .= \"<br /><a href=\\\"$url\\\">$string</a>\";\n }\n print_table_head($thead);\n\n $assigned = $this->get_assigned();\n\n if ($assigned === false) {\n $table->data = array(array(get_string('noneassigned', 'block_helpdesk')));\n } else {\n $table->data = array();\n\n foreach($assigned as $user) {\n $userurl = new moodle_url(\"$CFG->wwwroot/user/view.php\");\n $userurl->param('id', $user->id);\n $userurl = $userurl->out();\n\n $removeurl = new moodle_url(\"$CFG->wwwroot/blocks/helpdesk/assign.php\");\n $removeurl->param('remove', 'true');\n $removeurl->param('uid', $user->id);\n $removeurl->param('tid', $this->get_idstring());\n $removeurl = $removeurl->out();\n $user_string = fullname($user);\n\n $row = array();\n $row[] = \"<a href=\\\"$userurl\\\">$user_string</a>\";\n if ($isanswerer and !$readonly) {\n $row[] = \"<a href=\\\"$removeurl\\\">\" . get_string('remove') . \"</a>\";\n }\n $table->data[] = $row;\n }\n }\n $table->size = array('70%');\n print_table($table, false);\n echo '<br />';\n $table->size = array('30%');\n\n // Assignments end here.\n // START TAGS DISPLAY\n\n $tagstr = get_string('extradetailtags', 'block_helpdesk');\n $taghelp = helpdesk_simple_helpbutton($tagstr, 'tag');\n $thead = $tagstr . $taghelp;\n\n // If answerer, show link for adding tags.\n if ($isanswerer and !$readonly) {\n $url = new moodle_url(\"$CFG->wwwroot/blocks/helpdesk/tag.php\");\n $url->param('tid', $this->get_idstring());\n $url = $url->out();\n $addtagstr = get_string('addtag', 'block_helpdesk');\n\n $thead .= \"<br /><a href=\\\"$url\\\">$addtagstr</a>\";\n }\n print_table_head($thead);\n\n $table->data = array();\n if (!$tags == null) {\n foreach($tags as $tag) {\n $url = new moodle_url(\"$CFG->wwwroot/blocks/helpdesk/tag.php\");\n $url->param('remove', $tag->id);\n $url->param('tid', $this->get_idstring());\n $url = $url->out();\n $removestr = get_string('remove');\n\n $row = array();\n if ($isanswerer and !$readonly) {\n $remove = \"<br />\n <small>\n <a href=\\\"$url\\\">$removestr</a>\n </small>\";\n } else {\n $remove = '';\n }\n $table->data[] = array(\n $tag->name . $remove,\n $tag->value\n );\n }\n } else {\n $table->data = array(array(get_string('notags', 'block_helpdesk')));\n }\n print_table($table);\n\n // END TAGS DISPLAY\n\n echo '</div>';\n\n // Updates start here.\n $updatestr = get_string('updates', 'block_helpdesk');\n $updatehelp = helpdesk_simple_helpbutton($updatestr, 'update');\n echo \"<div class=\\\"ticketupdates\\\">\";\n\n $url = new moodle_url(\"$CFG->wwwroot/blocks/helpdesk/update.php\");\n $url->param('id', $this->get_idstring());\n $url = $url->out();\n $translated = get_string('updateticket', 'block_helpdesk');\n\n $thead = \"$updatestr $updatehelp\";\n if(!$readonly) {\n $thead .= \"<br /><a href=\\\"$url\\\">$translated</a>\";\n }\n print_table_head($thead);\n\n // We're going to find out now if we are displaying these updates.\n $table->data = array();\n $updateprinted = false;\n if (is_array($udata) or is_object($udata)) {\n // If we have system or detailed updates, display them.\n $showdetailed = helpdesk_get_session_var('showdetailedupdates');\n $showsystem = helpdesk_get_session_var('showsystemupdates');\n foreach($udata as $update) {\n $table->data = array();\n if ($update->type == HELPDESK_UPDATE_TYPE_DETAILED and !$showdetailed) {\n continue;\n }\n if ($update->type == HELPDESK_UPDATE_TYPE_SYSTEM and !$showsystem) {\n continue;\n }\n\n $updateprinted = true;\n\n if ($update->type !== false and\n $update->type !== null) {\n\n $row = array();\n $str = get_string($update->type, 'block_helpdesk');\n $row[] = $str;\n if ($hd->is_update_hidden($update)) {\n $row[] = get_string('thisupdateishidden', 'block_helpdesk');\n } else {\n $row[] = '';\n }\n $table->head = $row;\n }\n\n $user = get_record('user', 'id', $update->userid);\n if (!$user) {\n error(getstring('unabletopulluser', 'block_helpdesk'));\n }\n\n // Who submitted the update?\n $row = array();\n $user_url = new moodle_url(\"$CFG->wwwroot/user/view.php\");\n $user_url->param('id', $user->id);\n $user_url = $user_url->out();\n $user_name = fullname($user);\n $row[] = get_string('user', 'block_helpdesk');\n $row[] = \"<a href=\\\"$user_url\\\">$user_name</a>\";\n $table->data[] = $row;\n\n // Status\n $row = array();\n $row[] = get_string('status', 'block_helpdesk');\n $row[] = get_string($update->status, 'block_helpdesk');\n $table->data[] = $row;\n\n // New ticket status if status changed.\n if ($update->newticketstatus != null) {\n $row = array();\n $tstat = get_record('helpdesk_status', 'id', $update->newticketstatus);\n $row[] = get_string('newquestionstatus', 'block_helpdesk');\n $row[] = $this->get_status_string($tstat);\n $table->data[] = $row;\n }\n\n // \"Created On\" date.\n $row = array();\n $creation_date = helpdesk_get_date_string($update->timecreated);\n\n // Time Created date.\n $row[] = get_string('timecreated', 'block_helpdesk');\n $row[] = $creation_date;\n $table->data[] = $row;\n\n // Update Note.\n $row = array();\n $row[] = get_string('note', 'block_helpdesk');\n $row[] = $update->notes;\n $table->data[] = $row;\n print_table($table);\n echo '<br />';\n }\n }\n if ($updateprinted === false) {\n $row = array();\n $row[] = get_string('noupdatestoview', 'block_helpdesk');\n $table->data[] = $row;\n print_table($table);\n }\n\n echo '</div>';\n return true;\n }", "public function submission_form()\n\t{\n\t\t$this->load->library('submission_library');\n\t\t$this->load->model('timecard_submission_model', '', TRUE);\n\n\t\t$this->load->view('timecard_submission', array('is_admin_timecard' => TRUE));\n\t}", "public function viewAddScheduleForm()\n {\n $movieRepository = $this->getRepository('movie');\n $data = ['movies' => array(), 'rooms' => array()];\n try {\n $data['movies'] = $movieRepository->loadAll();\n } catch (\\Exception $ex) {\n $errorResponse['message']\n = 'We\\'re sorry, something went terribly wrong while trying to schedule movie. Please try again later.';\n\n return $this->render('schedule', $data);\n }\n\n $data['last_date'] = $this->request->get('date');\n $data['last_time'] = $this->request->get('time');\n $data['last_price'] = $this->request->get('price');\n $data['last_movie'] = $this->request->get('movie');\n $data['last_room'] = $this->request->get('room');\n\n return $this->render('schedule', $data);\n }", "public function show(enquiryForm $enquiryForm)\n {\n //\n }", "function showForm($ID, $options = []) {\n\n $this->initForm($ID, $options);\n $this->showFormHeader($options);\n\n $canedit = $this->canEdit($ID);\n\n echo \"<tr class='tab_bg_1'>\";\n echo \"<td>\" . __('Name') . \"</td>\";\n echo \"<td>\";\n Html::autocompletionTextField($this, \"name\");\n echo \"</td>\";\n echo \"<td>\" . __('Publisher').\"</td><td>\";\n Manufacturer::dropdown(['value' => $this->fields[\"manufacturers_id\"]]);\n echo \"</td></tr>\\n\";\n\n echo \"<tr class='tab_bg_1'>\";\n echo \"<td>\" . __('Location') . \"</td><td>\";\n Location::dropdown(['value' => $this->fields[\"locations_id\"],\n 'entity' => $this->fields[\"entities_id\"]]);\n echo \"</td>\";\n echo \"<td>\" . __('Category') . \"</td><td>\";\n SoftwareCategory::dropdown(['value' => $this->fields[\"softwarecategories_id\"]]);\n echo \"</td></tr>\\n\";\n\n echo \"<tr class='tab_bg_1'>\";\n echo \"<td>\" . __('Technician in charge of the software') . \"</td><td>\";\n User::dropdown(['name' => 'users_id_tech',\n 'value' => $this->fields[\"users_id_tech\"],\n 'right' => 'own_ticket',\n 'entity' => $this->fields[\"entities_id\"]]);\n echo \"</td>\";\n echo \"<td>\" . __('Associable to a ticket') . \"</td><td>\";\n Dropdown::showYesNo('is_helpdesk_visible', $this->fields['is_helpdesk_visible']);\n echo \"</td></tr>\\n\";\n\n echo \"<tr class='tab_bg_1'>\";\n echo \"<td>\".__('Group in charge of the software').\"</td>\";\n echo \"<td>\";\n Group::dropdown([\n 'name' => 'groups_id_tech',\n 'value' => $this->fields['groups_id_tech'],\n 'entity' => $this->fields['entities_id'],\n 'condition' => ['is_assign' => 1]\n ]);\n echo \"</td>\";\n echo \"<td rowspan='4' class='middle'>\".__('Comments') . \"</td>\";\n echo \"<td class='center middle' rowspan='4'>\";\n echo \"<textarea cols='45' rows='8' name='comment' >\".$this->fields[\"comment\"].\"</textarea>\";\n echo \"</td></tr>\\n\";\n\n echo \"<tr class='tab_bg_1'>\";\n echo \"<td >\" . __('User') . \"</td>\";\n echo \"<td >\";\n User::dropdown(['value' => $this->fields[\"users_id\"],\n 'entity' => $this->fields[\"entities_id\"],\n 'right' => 'all']);\n echo \"</td></tr>\\n\";\n\n echo \"<tr class='tab_bg_1'>\";\n echo \"<td>\" . __('Group') . \"</td><td>\";\n Group::dropdown([\n 'value' => $this->fields[\"groups_id\"],\n 'entity' => $this->fields[\"entities_id\"],\n 'condition' => ['is_itemgroup' => 1]\n ]);\n echo \"</td></tr>\\n\";\n\n // UPDATE\n echo \"<tr class='tab_bg_1'>\";\n //TRANS: a noun, (ex : this software is an upgrade of..)\n echo \"<td>\" . __('Upgrade') . \"</td><td>\";\n Dropdown::showYesNo(\"is_update\", $this->fields['is_update']);\n echo \"&nbsp;\" . __('from') . \"&nbsp;\";\n Software::dropdown(['value' => $this->fields[\"softwares_id\"]]);\n echo \"</td></tr>\\n\";\n\n $this->showFormButtons($options);\n\n return true;\n }", "public function show($id) {\n\n $booking = $this->booking->find($id);\n return view('backend.booking.show', compact('booking'));\n }", "public function create()\n {\n return view('pages.checkout.formcheckout');\n }", "public function create()\n {\n $booking = Booking::with('pelanggan','kamar','typekamar')->select('nama','nama_kamar','lantai');\n $kamar=Kamar::all();\n $pelanggan=Pelanggan::all();\n $typekamar=Type_kamar::all();\n return view('booking.create',compact('booking','kamar','pelanggan','typekamar'));\n }", "public function create()\n {\n return view('admin.carpetbookingView.create');\n }", "public function create()\n {\n return abort(404);\n // $events = \\App\\Event::get()->pluck('title', 'id')->prepend('Please select', '');\n\n // return view('admin.tickets.create', compact('events'));\n }", "public function create()\n {\n return view('workouts.form');\n }", "public function index()\n {\n return view('frontend.ticket.index');\n }", "public function index()\n {\n $tickets = Ticket::all();\n return view('bookTicket.index', compact('tickets'));\n }", "public function displayAddVehicleForm(){\n // make sure to pass in empty vehicle\n $vehicle = new Vehicle();\n\n return View('vehicle.displayAddVehicleForm')->with('vehicle', $vehicle);\n }", "public function create()\n {\n\n\n return view('booking_status.create');\n }", "public function show(Tickets $tickets)\n {\n \n }", "function ci_theme_show_booking_form_widget($atts)\n{\n\textract(shortcode_atts( array(\n\t\t'title' => '',\n\t\t'note' => '',\n\t\t'button_text' => __('Check Availability', 'ci_theme')\n\t), $atts ));\n\n\t$book_page = ci_setting('booking_form_page');\n\tif ( !empty($book_page) )\n\t\t$form_action = get_permalink( $book_page );\n\telse\n\t\t$form_action = ci_setting('booking_form_url');\n\n\n\tob_start();\n\t?>\n\t<div class=\"b-form widget bg bs\">\n\t\t<form class=\"booking-form\" action=\"<?php echo esc_url($form_action); ?>\" method=\"post\">\n\t\t\t<?php if( !empty($title) ): ?>\n\t\t\t\t<h3><?php echo $title; ?></h3>\n\t\t\t<?php endif; ?>\n\t\t\t\n\t\t\t<fieldset class=\"group\">\n\t\t\t\t<p>\n\t\t\t\t\t<label for=\"arrive\"><?php _e('Check In', 'ci_theme'); ?></label>\n\t\t\t\t\t<input readonly type=\"text\" id=\"arrive\" class=\"datepicker\" name=\"arrive\">\n\t\t\t\t</p>\n\t\n\t\t\t\t<p>\n\t\t\t\t\t<label for=\"depart\"><?php _e('Check Out', 'ci_theme'); ?></label>\n\t\t\t\t\t<input readonly id=\"depart\" class=\"datepicker\" type=\"text\" name=\"depart\">\n\t\t\t\t</p>\n\t\t\t</fieldset>\n\t\n\t\t\t<fieldset class=\"group\">\n\t\t\t\t<p>\n\t\t\t\t\t<label for=\"adults\"><?php _e('Guests', 'ci_theme'); ?></label>\n\t\t\t\t\t<input type=\"number\" min=\"1\" max=\"6\" id=\"adults\" name=\"guests\" value=\"1\">\n\t\t\t\t</p>\n\t\n\t\t\t\t<p>\n\t\t\t\t\t<label for=\"b-room\"><?php _e('Room', 'ci_theme'); ?></label>\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$selected = is_singular('room') ? get_the_ID() : '';\n\t\t\n\t\t\t\t\t\twp_dropdown_posts(array(\n\t\t\t\t\t\t\t'post_type' => 'room',\n\t\t\t\t\t\t\t'id' => 'b-room',\n\t\t\t\t\t\t\t'selected' => $selected\n\t\t\t\t\t\t), 'room_select');\n\t\t\t\t\t?>\n\t\t\t\t</p>\n\t\t\t</fieldset>\n\t\n\t\t\t<fieldset>\n\t\t\t\t<button class=\"btn b-book\" type=\"submit\"><?php echo $button_text; ?></button>\n\t\t\t\t<?php if( !empty($note) ): ?>\n\t\t\t\t\t<small class=\"booking-note\"><?php echo $note; ?></small>\n\t\t\t\t<?php endif; ?>\n\t\t\t</fieldset>\n\t\t</form>\n\t</div>\n\t<?php\n\t$output = ob_get_clean();\n\treturn $output;\n\n}", "public function showAppointmentForm(Request $request)\n {\n ## get specialties\n $specialties = Specialty::all();\n ## current date\n $today = Carbon::now()->format('Y-m-d');\n return view('user.appointments', compact('specialties', 'today'));\n }", "public function index()\n {\n $companies=Company::orderBy('name')->get();\n $ticket_types=DB::table('ticket_type')->orderBy('name')->get();\n $devices=DB::table('devices')->orderBy('name')->get();\n $tsac=DB::table('support_technicians')->orderBy('name')->get();\n return view('tickets.add')\n ->with('ticket_types',$ticket_types)\n ->with('devices',$devices)\n ->with('tsac',$tsac)\n ->with('companies',$companies);\n }", "public function show( int $id )\n {\n $ticket = Ticket::ownerOrAdmin( Auth::user() )->find( $id );\n return view('resources.comun.tickets.show')->with('ticket',$ticket);\n }", "public function showBookings()\n {\n return $this->render('account/bookings.html.twig');\n }", "public function create()\n {\n return view ('/appointmentBook');\n }", "public function index()\n {\n $this->ticket = $this->ticket->where('user_id', Auth::user()->id)->get();\n return view('panel.ticket.index')\n ->with('ticket', $this->ticket);\n }", "public function create()\n {\n return view('forms.create_candidate');\n }", "public function summmaryticketsAction(){\n\n\t $this->view->session_data = $this->ModelObj->Useconfig;\n\n\t $this->view->ticketdetails = $this->ModelObj->ticketinformation();\n\n\t $this->view->helpdeskstatus = $this->ModelObj->getstatuslist();\n\n\t}", "public function bookingList()\n {\n $user = User::find(Auth::user()->id);\n return view('booking.booking_list', compact('user'));\n }", "public function show(ticket $ticket)\n {\n if(Auth::user()->type=='customer' && Auth::id() != $ticket->report_by){\n return redirect()->back();\n }\n\n $customers = DB::table('users')->where('type','=','customer')->get();\n $agents = DB::table('users')->where('type','=','agent')->get();\n\n return view('ticket_detail',compact('ticket','customers','agents'));\n }", "public function show(Ticket $ticket)\n {\n $user = Auth::user()->id;\n $ticket_go = daily_ticket::where([['user',$user],['date_add',Carbon::now()->format('Y/m/d')],['statue',1]])->get();\n $ticket_back = daily_ticket::where([['user',$user],['date_add',Carbon::now()->format('Y/m/d')],['statue',2]])->get();\n return view('ticket.ticket_list',compact(['ticket_go','ticket_back']));\n }", "function showApprentice() {\n\t\t\t\t\t$apprentice = Apprentice::find_by_name(params(0));\n\t\t\t\t\t\n\t\t\t\t\t$editForm = new h2o('views/editApprentice.html');\n\t\t\t\t\techo $editForm->render(compact('apprentice'));\n\t\t\t\t}", "public function getEventForm(){\n $sports = Sports::all();\n return view('admin.add_event')->with('sports', $sports);\n }", "public function create()\n {\n $list_kategori_pengunjung = KategoriPengunjung::all();\n return view('booking.create', compact('list_kategori_pengunjung'));\n }", "public function indexAction() {\n $this->_title($this->__(\"Supportticket\"));\n $this->_title($this->__(\"Manager Support Ticket\"));\n\n $this->_initAction();\n $this->renderLayout();\n }", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "function show_form()\n\t\t{\n\t\t\t//set a global template for interactive activities\n\t\t\t$this->t->set_file('run_activity','run_activity.tpl');\n\t\t\t\n\t\t\t//set the css style files links\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'run_activity_css_link'\t=> $this->get_css_link('run_activity', $this->print_mode),\n\t\t\t\t'run_activity_print_css_link'\t=> $this->get_css_link('run_activity', true),\n\t\t\t));\n\t\t\t\n\t\t\t\n\t\t\t// draw the activity's title zone\n\t\t\t$this->parse_title($this->activity_name);\n\n\t\t\t//draw the instance_name input or label\n\t\t\t// init wf_name to the requested one or the stored name\n\t\t\t// the requested one handle the looping in activity form\n\n\t\t\t$wf_name = get_var('wf_name','post',$this->instance->getName());\n\t\t\t$this->parse_instance_name($wf_name);\n\n\t\t\t//draw the instance_name input or label\n\t\t\t// init wf_set_owner to the requested one or the stored owner\n\t\t\t// the requested one handle the looping in activity form\n\t\t\t$wf_set_owner = get_var('wf_set_owner','post',$this->instance->getOwner());\n\t\t\t$this->parse_instance_owner($wf_set_owner);\n\t\t\t\n\t\t\t// draw the activity central user form\n\t\t\t$this->t->set_var(array('activity_template' => $this->wf_template->parse('output', 'template')));\n\t\t\t\n\t\t\t//draw the select priority box\n\t\t\t// init priority to the requested one or the stored priority\n\t\t\t// the requested one handle the looping in activity form\n\t\t\t$priority = get_var('wf_priority','post',$this->instance->getPriority());\n\t\t\t$this->parse_priority($priority);\n\t\t\t\n\t\t\t//draw the select next_user box\n\t\t\t// init next_user to the requested one or the stored one\n\t\t\t// the requested one handle the looping in activity form\n\t\t\t$next_user = get_var('wf_next_user','POST',$this->instance->getNextUser());\n\t\t\t$this->parse_next_user($next_user);\n\t\t\t\n\t\t\t//draw print_mode buttons\n\t\t\t$this->parse_print_mode_buttons();\n\t\t\t\n\t\t\t//draw the activity submit buttons\t\n\t\t\t$this->parse_submit();\n\t\t\t\n\t\t\t//draw the info zone\n\t\t\t$this->parse_info_zone();\n\t\t\t\n\t\t\t//draw the history zone if user wanted it\n\t\t\t$this->parse_history_zone();\n\t\t\t\n\t\t\t$this->translate_template('run_activity');\n\t\t\t$this->t->pparse('output', 'run_activity');\n\t\t\t$GLOBALS['egw']->common->egw_footer();\n\t\t}", "public function bookForm($game_id = 0)\n {\n $game = Game::find($game_id);\n\n if (empty ($game))\n {\n return Redirect::route('games')->with('flash_error', 'Game does not exist');\n }\n\n if (!Auth::user()->getIsEmailValidated())\n {\n return View::make('user.email-validation-required');\n }\n\n $game->parties = GameParty::where('game_id', '=', $game_id)->get();\n $game->ticket_templates = TicketTemplate::where('game_id', '=', $game_id)->get();\n\n $org = DB::table('user AS u')\n ->leftJoin('team AS t', 't.id', '=', 'u.team_id')\n ->select(array('t.name AS team_name', 'u.nick AS user_nick'))\n ->where('u.id', '=', $game->getOwnerId())\n ->first();\n $game->organizer = isset ($org->user_nick) ? $org->user_nick : '&mdash;';\n\n if ($game->ticket_templates->isEmpty())\n {\n return Redirect::route('games')->with('flash_error', 'Organizer has not issued any tickets yet');\n }\n\n // enrich ticket templates with names\n foreach ($game->ticket_templates as $k => $v)\n {\n // remove outdated tickets\n if (strtotime($v->getPriceDateStart()) > time() || strtotime($v->getPriceDateEnd()) < time())\n {\n unset ($game->ticket_templates[$k]);\n continue;\n }\n\n $x = GameParty::find($v->getGamePartyId());\n\n $game->ticket_templates[$k]->name = date('M d', strtotime($v->getPriceDateStart())) . ' – ' . date('M d', strtotime($v->getPriceDateEnd())) . ', ' . ($x?($x->name):'all parties');\n }\n\n $profile = Auth::user()->getProfileArray();\n\n $requirements = [];\n $requirementsOk = true;\n\n if ($game->getSetting('req.nick') == 1)\n {\n if (!strlen(Auth::user()->getNick()))\n {\n $requirementsOk = false;\n }\n $requirements[] = array('Nickname', strlen(Auth::user()->getNick()) > 0);\n }\n if ($game->getSetting('req.phone') == 1)\n {\n if (!@strlen($profile['phone'][0]))\n {\n $requirementsOk = false;\n }\n $requirements[] = array('Phone', isset ($profile['phone'][0]) && strlen($profile['phone'][0]) > 0);\n }\n if ($game->getSetting('req.age') == 1)\n {\n if (!strlen(Auth::user()->getBirthDate()))\n {\n $requirementsOk = false;\n }\n $requirements[] = array('Age', strlen(Auth::user()->getBirthDate()) > 0);\n }\n\n return View::make('game.book', array\n (\n 'game' => $game,\n 'is_organizer' => $game->getOwnerId() == Auth::user()->getId(),\n 'requirements' => $requirements,\n 'requirements_ok' => $requirementsOk,\n ));\n }", "public function form()\n {\n return view('SolicitacaoDependente.solicitacaoDependente');\n }", "public function _report_form()\n\t{\n\t\t// Load the View\n\t\t$form = View::factory('actionable_form');\n\t\t// Get the ID of the Incident (Report)\n\t\t$id = Event::$data;\n\n\t\tif ($id)\n\t\t{\n\t\t\t// Do We have an Existing Actionable Item for this Report?\n\t\t\t$action_item = ORM::factory('actionable')\n\t\t\t\t->where('incident_id', $id)\n\t\t\t\t->find();\n\t\t\tif ($action_item->loaded)\n\t\t\t{\n\t\t\t\t$this->actionable = $action_item->actionable;\n\t\t\t\t$this->action_taken = $action_item->action_taken;\n\t\t\t\t$this->action_summary = $action_item->action_summary;\n\t\t\t}\n\t\t}\n\n\t\t$form->actionable = $this->actionable;\n\t\t$form->action_taken = $this->action_taken;\n\t\t$form->action_summary = $this->action_summary;\n\t\t$form->render(TRUE);\n\t}", "public function booktrip()\n {\n return view('FrontEnd.booktrip');\n }" ]
[ "0.6544749", "0.651681", "0.651681", "0.651681", "0.64884603", "0.6481216", "0.6451668", "0.64319694", "0.6431062", "0.6410291", "0.64017427", "0.63991034", "0.6385517", "0.63621414", "0.63358593", "0.63241243", "0.6256744", "0.62531203", "0.62531203", "0.62531203", "0.62531203", "0.62531203", "0.6249337", "0.6208057", "0.6198755", "0.6198755", "0.6196653", "0.6169339", "0.61536133", "0.61418104", "0.61254114", "0.61089736", "0.61057734", "0.61020875", "0.6078608", "0.6078477", "0.6069667", "0.6058559", "0.60426366", "0.6042162", "0.602423", "0.60173523", "0.60139257", "0.59996545", "0.59837043", "0.59837043", "0.59837043", "0.5971123", "0.5963163", "0.59605", "0.5933192", "0.5925763", "0.59126496", "0.59026563", "0.59025544", "0.58933175", "0.5888944", "0.58759654", "0.58725923", "0.5863254", "0.58540696", "0.5852761", "0.5848725", "0.58418584", "0.5834051", "0.58255386", "0.58106554", "0.58100444", "0.5810039", "0.58096147", "0.57839274", "0.5782", "0.57818687", "0.578075", "0.57722837", "0.5761905", "0.57564527", "0.575469", "0.5753431", "0.5749381", "0.5736446", "0.57315385", "0.5729142", "0.57229114", "0.5720648", "0.57198656", "0.57176685", "0.5716994", "0.5714747", "0.57059866", "0.5697798", "0.56948304", "0.56814975", "0.5676493", "0.56754833", "0.5666559", "0.5665388", "0.56640106", "0.5663318", "0.5662533" ]
0.5887283
57
Checks for the trips.
public function checkTicket(Request $request) { $booking = $request->input('booking_date'); $route = +$request->input('route'); $vehicleType = +$request->input('vehicleType'); $trips = Trip::where([ ['departure_date', '=', $booking], ['route_id', '=', $route], ])->get(); $listTickets = []; foreach ($trips as $trip) { if ($trip->vehicle->vehicleType_id == $vehicleType && $trip->available_seats>0) { $trip['row'] = $trip->vehicle->vehicleType->row; $trip['column'] = $trip->vehicle->vehicleType->column; array_push($listTickets, $trip); } } $data = [ 'listTickets' => $listTickets ]; return response()->json($data, 200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkTrips($numbers) {\n\t//TODO: Tjek om der er \"trips\"\n}", "function validToppings($toppings)\n {\n $validToppings = array(\"pepperoni\", \"sausage\",\n \"olives\", \"artichokes\", \"anchovies\");\n\n\t\t// heck each selected topping, and return false\n\t\t// f it's not valid\n \t\tforeach ($toppings as $topping)\n {\n\t\t\tif (!in_array($topping, $validToppings))\n {\n \t\t\treturn false;\n\t\t\t}\n\t\t}\n \n \n\t\t// If we made it this far, all our toppings are valid\n\t\treturn true;\n }", "public function hasTrip(): bool\n {\n return $this->trips()->first() !== null;\n }", "abstract function is_trial();", "abstract function is_trial_utilized();", "function checkBookings() {\n\t\t// Load Transitions Pool\n\t\t$this->initTransitions();\n\t\t\n\t\t$sim = false;\n\t\twhile(!$sim) {\n\t\t\t$ts = clone $this->transitions;\n\t\t\t$ts->reverse();\n\t\t\t\n\t\t\t// New Simulation\n\t\t\t$rs = new ReservationSimulator();\n\t\t\twhile($_res = $ts->pop())\n\t\t\t\t$rs->addTransition($_res);\n\t\t\t$sim = $rs->simulate();\n\t\t\t\n\t\t\t// pop the last transition on failure recheck bookings\n\t\t\tif(!$sim) $this->dismissedTrans->push($this->transitions->pop());\n\t\t}\n\t\t\n\t\treturn $this->finish();\n\t\t\n\n\t\twhile($o = $this->dismissedTrans->pop())\n\t\t\t_debug($o->getId());\n\t\t\t\n\t}", "function sanityCheck() {\n $_app = new ITechTable(SyncCompare::getDesktopConnectionParams('location',$this->desktopFilePath));\n $tiers = $_app->getAdapter()->query('SELECT COUNT(DISTINCT tier) as \"cnt\" FROM location');\n $rows = $tiers->fetchAll();\n $settings = System::getAll();\n $city_tier = 2 + $settings['display_region_i'] + $settings['display_region_h'] + $settings['display_region_g'] + $settings['display_region_f'] + $settings['display_region_e'] + $settings['display_region_d'] + $settings['display_region_c'] + $settings['display_region_b'];\n if ( $rows[0]['cnt'] != $city_tier) {\n //return 'Could not import data: Offline database contains '.$rows[0]['cnt'].' regional levels, while the web database contains '.$city_tier.'.';\n }\n \n return false;\n }", "public function performChecks(){\n\t\t\n\t}", "function isTripletTriangular($P, $Q, $R): bool\n{\n if ($P + $Q > $R && $P + $R > $Q && $Q + $R > $P) {\n return true;\n }\n\n return false;\n}", "public function checkCoordinates() : void\n {\n $this->checkLatitudes();\n $this->checkLongitudes();\n }", "public function validateEntries() \n {\n //verify if first entry is a START entry\n $this->firstItemIsStartEntry();\n\n //Detect the right order of entries\n $this->detectRightEntryOrder();\n\n //check if last entry is pause or end when the record is not current\n $this->obligePauseWhenNotCurrent();\n }", "private function check_jumps()\n {\n static $seen_loop_info = false;\n \n assert(is_array($this->gotos));\n \n foreach ($this->gotos as $lid => $gotos) { \n foreach ($gotos as $goto) {\n if ($goto->resolved === true)\n continue;\n \n if (!isset ($this->labels[$lid]))\n Logger::error_at($goto->loc, 'goto to undefined label `%s`', $goto->id);\n else {\n Logger::error_at($goto->loc, 'goto to unreachable label `%s`', $goto->id);\n Logger::info_at($this->labels[$lid]->loc, 'label was defined here');\n \n if (!$seen_loop_info) {\n $seen_loop_info = true;\n Logger::info_at($goto->loc, 'it is not possible to jump into a loop or switch statement');\n }\n }\n }\n }\n }", "private function seeIfPossible()\n {\n $correct = true;\n if(Parser::onlyNumbersString($_GET['o'])){\n if($_GET['o'] == User::get_currentCityId()){\n $this->cityTroopsInfo = DataBaseManager::fetchArray(DataBaseManager::query(\"SELECT * FROM {troops_movements} WHERE\n reciver_id = $_GET[o] and movement_type = 0\"));\n }else{\n $this->cityTroopsInfo = DataBaseManager::fetchArray(DataBaseManager::query(\"SELECT * FROM {troops_movements} WHERE\n reciver_city_id = $_GET[o] and owner_city_id = \".User::get_currentCityId().\" and movement_type = 10\"));\n }\n $correct = $correct && (!(Parser::onlyNumbersString($_GET['t']) && $_GET['t'] >= 0 && $_GET['t'] <= 6));\n $i = 1;\n $ttrops = 0;\n while($correct && $i<12){\n if(!(isset($_GET['tr'.$i]) && Parser::onlyNumbersString($_GET['tr'.$i]) && $_GET['tr'.$i] >= 0 && $this->cityTroopsInfo['tr'.$i] >= $_GET['tr'.$i] )){\n $correct = false;\n }else{\n $ttrops += $_GET['tr'.$i];\n }\n $i++;\n }\n $correct = $correct && ($ttrops > 0) && Parser::onlyNumbersString($_GET['d'] && $_GET['d'] > 0);\n if($correct){\n $exsistsd = DataBaseManager::query(\"SELECT owner_user_id FROM {map} WHERE box_id = $_GET[d]\");\n $this->calculateDistance();\n $oil = DataBaseManager::fetchArray(DataBaseManager::query(\"SELECT oil FROM {materials} WHERE city_id = \".User::get_currentCityId()));\n $oil = $oil[0];\n $this->finalOil = $oil - $this->calculateOil();\n $correct = ($this->finalOil >= 0 && DataBaseManager::numRows($exsistsd));\n $reciverUserId = DataBaseManager::fetchArray($exsistsd);\n $this->reciverUserId = $reciverUserId[0];\n }\n }else{\n $correct = false;\n }\n return $correct;\n\n }", "public function canContinue()\n {\n return $this->number_of_rounds >= $this->getRoundsCount();\n }", "function assert_is_workflow_net($petrinet) {\n if (count($petrinet[\"source_places\"]) == 0) {\n terminate(\"The petri net has no source places and therefore is no workflow net\");\n }\n if (count($petrinet[\"source_places\"]) > 1) {\n terminate(\"The petri net has more than one source place and therefore is no workflow net\");\n }\n if (count($petrinet[\"sink_places\"]) == 0) {\n terminate(\"The petri net has no sink places and therefore is no workflow net\");\n }\n if (count($petrinet[\"sink_places\"]) > 1) {\n terminate(\"The petri net has more than one sink place and therefore is no workflow net\");\n }\n if (count($petrinet[\"markings\"]) == 0) {\n terminate(\"The petri net has zero initial markings and therefore is no workflow net\");\n }\n if (count($petrinet[\"markings\"]) > 1) {\n terminate(\"The petri net has more than one initial marking and therefore is no workflow net\");\n }\n }", "public function checkLatitudes() : void\n {\n if ($this->DataService->getALatitude() < -90 || $this->DataService->getALatitude() > 90) {\n $this->errorMessage .= \"The latitude coordinate of A point is invalid\\r\\n\";\n }\n \n if ($this->DataService->getBLatitude() < -90 || $this->DataService->getBLatitude() > 90) {\n $this->errorMessage .= \"The latitude coordinate of B point is invalid\\r\\n\";\n }\n }", "private static function rerouteCheck()\n {\n if ( ! Session::isValid()) {\n if (Session::hasTrainer()) {\n // we have a trainer but not a student\n self::computeImpliedRoute();\n } else {\n (new LoginTemplate())->display();\n }\n }\n }", "public function updateTrips($trips)\n {\n $this->trips = $trips;\n $this->resetCheckAnswersAndDeclaration();\n }", "function _erpal_projects_helper_timetracking_finalise_action_validate($timetrackings) {\n $errors = false;\n\n foreach ($timetrackings as $timetracking) {\n //error if timetracking has no subject\n $timetracking_link = l($timetracking->defaultLabel(), 'timetracking/'.$timetracking->timetracking_id.'/edit', array('query' => array('destination' => $_GET['q'])));\n if (!$timetracking->subject_id) {\n $errors[$timetracking->timetracking_id]['entity'] = $timetracking;\n $errors[$timetracking->timetracking_id]['errors'][] = t('To finalise a timetracking, ensure that a subject task is set for !timetracking_link', array('!timetracking_link' => $timetracking_link));\n } elseif (!$timetracking->time_end) {\n //if we dont have a duration the timetracking is still running and cannot be finalised!\n $errors[$timetracking->timetracking_id]['entity'] = $timetracking;\n $errors[$timetracking->timetracking_id]['errors'][] = t('To finalise the timetracking !timetracking_link, ensure that it is not still tracking the time!', array('!timetracking_link' => $timetracking_link));\n }\n }\n\n return $errors;\n}", "public function hasSteps()\n {\n return 0 < count($this->outlineSteps);\n }", "abstract public function check();", "private function movement_check($data) {\n if ($this->SQL->GetPlayerData(Session::get('PlayerGUID'))->AP == 0){\n $data['location_err'] = true;\n }\n // Get Player Gameboard location\n $location = $this->SQL->GetPlayerLocation(Session::get('PlayerGUID'));\n // Look up Gameboard data\n $MapData = $this->SQL->GetMap($location->ID);\n // Check if desired destination is in GetMap (stop teleportation)\n $isTooFar = true;\n foreach ($MapData as $value) {\n if ($value->ID == $data['location']){$isTooFar = false;}\n }\n // Set error flag if an error was found\n $data['HAS_ERRORS'] = true;\n if (\n empty($data['location_err']) &&\n $isTooFar == false\n ) {\n $data['HAS_ERRORS'] = false;\n }\n // Return to the controller\n return($data);\n }", "public function passes();", "protected function checkStartConditions(): void\n {\n if (!$this->exists) {\n throw new WorkerException('Worker must be properly created before start.');\n }\n\n if ($this->getAttribute('pid') !== null) {\n throw new WorkerException('Worker is running already.');\n }\n }", "private function checkTimeValidity()\n {\n $inThirtyMinutes = Carbon::createFromFormat('H:i:s', Carbon::now()->toTimeString())->addMinutes(30);\n $pickup_time = Carbon::createFromFormat('H:i', request('pickup_time'));\n $minTime = Carbon::createFromFormat('H:i', \"11:00\");\n $maxTime = Carbon::createFromFormat('H:i', \"22:00\");\n\n $error = false;\n $error_message = '';\n\n if ($pickup_time < $minTime) {\n $error = true;\n $error_message = 'Sorry, this is too early';\n }\n\n if ($pickup_time < $inThirtyMinutes) {\n $error = true;\n $error_message = 'Sorry but You can\\'t pick up earlier than ' . $inThirtyMinutes->toTimeString();\n }\n\n if ($pickup_time > $maxTime) {\n $error = true;\n $error_message = 'Sorry but You can\\'t pick up later than ' . $maxTime->toTimeString();\n }\n\n return ['error' => $error, 'error_message' => $error_message];\n }", "public function _check()\n {\n }", "function should_send($trip_type)\n{\n\n // --------------------------------------------------------------------\n\t// Is the sign not enabled?\n // --------------------------------------------------------------------\n if ( $this->predictionParameters->disabled == \"X\" ) \n {\n $this->text = $this->text. \"DIS\";\n\t\treturn false;\n }\n\n // --------------------------------------------------------------------\n // Surtronic communications protocol displays (TCP)\n // --------------------------------------------------------------------\n if ( $this->display_type == \"S\" ) \n {\n // Is the Surtronic sign registered && $ready?\n $sql = \n \"SELECT update_status, channel_number\n INTO l_update_status, l_channel\n FROM unit_status_sign\n WHERE build_id = \". $this->predictionParameters->build_id; \n $row = $this->connector->fetch1($sql);\n if ( $this->connector->errorCode != 0 || $row[\"channel_number\"] || $row[\"update_status\"] != \"T\" )\n {\n $this->text = $this->text. \"NOT_REGISTERED\";\n return false;\n }\n }\n\n // --------------------------------------------------------------------\n\t// Is the arrival unsuitable for the delivery mode\n // --------------------------------------------------------------------\n\tif ( $this->predictionParameters->delivery_mode && $this->predictionParameters->delivery_mode != \"RCA\" ) {\n\t\t$l_delivery_code = substr($trip_type, 0, 1);\n\t\tif ( !strstr($this->predictionParameters->delivery_mode, $l_delivery_code) ) {\n $this->text = $this->text. \"DIS\";\n return false;\n\t\t}\n\t}\n\n $currtime = new Datetime();\n $eta_last_sent = DateTime::createFromFormat(\"Y-m-d H:i:s\", $this->eta_last_sent);\n $etd_last_sent = DateTime::createFromFormat(\"Y-m-d H:i:s\", $this->etd_last_sent);\n\n // --------------------------------------------------------------------\n\t// Is arrival time is within echo window || $has passed\n // --------------------------------_------------------------------------\n if ( $this->predictionParameters->countdown_dep_arr == \"A\" ) {\n\t $l_comp_secs = $eta_last_sent->getTimestamp() - $currtime->getTimestamp();\n } else {\n\t $l_comp_secs = $etd_last_sent->getTimestamp() - $currtime->getTimestamp();\n }\n\n //echo \"HC WIN \";\n $this->predictionParameters->display_window = 7200;\n\tif ( $l_comp_secs > $this->predictionParameters->display_window || $l_comp_secs < -60 ) {\n if ( $l_comp_secs < -60 ) \n {\n $this->text = $this->text. \" ASSUME COUNTED_DOWN\";\n $w_display_line = true;\n return false;\n } else {\n if ( $l_comp_secs < -60 ) {\n $w_display_line = false;\n }\n\t\t $this->text = $this->text. \"WIN\". $l_comp_secs . \"/\". $this->predictionParameters->display_window;\n\t\t return false;\n }\n\t}\n\n // --------------------------------------------------------------------\n\t// Has vehicle already arrived/departed, if ( $so clear it down\n // --------------------------------------------------------------------\n if ( \n ( $this->predictionParameters->countdown_dep_arr == \"A\" && $this->arrival_status == \"A\" ) ||\n ( $this->predictionParameters->countdown_dep_arr == \"D\" && $this->departure_status == \"A\" ) \n ) {\n $this->text = $this->text. \" Already there Force Clear\";\n return false;\n }\n\n $this->prediction_stop_info->vehicle_id = $this->vehicle_id;\n $this->prediction_stop_info->dest_id = $this->dest_id;\n $this->prediction_stop_info->route_id = $this->route_id;\n $this->prediction_stop_info->build_id = $this->stopBuild->build_id;\n\n // --------------------------------------------------------------------\n\t// Does sign already have enough arrivals\n // --------------------------------------------------------------------\n if ( $this->prediction_stop_info->checkPrediction (\"NUMARRS\", $this->predictionParameters, $this->initialValues, $this ) != \"OK\" ) {\n if ( $this->time_last_sent ) {\n $this->text = $this->text. \" AA MA\";\n } else {\n $this->text = $this->text. \"TOO_MANY_ARRS\";\n return false;\n }\n }\n\n\t// ------------------------------------------------------------------------\n\t// Does sign already have enough arrivals for this destination\n\t// ------------------------------------------------------------------------\n if ( $this->prediction_stop_info->checkPrediction (\"NUMARRSPERDEST\", $this->predictionParameters, $this->initialValues, $this ) != \"OK\" ) {\n if ( $this->time_last_sent ) {\n $this->text = $this->text. \" AA MAD\";\n } else {\n $this->text = $this->text. \"TOO_MANY_ARRS_FOR_RT_DEST\";\n $w_display_line = false;\n return false;\n }\n }\n\n\t// ------------------------------------------------------------------------\n\t// As the bus stop is only able to handle one set of RTPI info \n\t// if ( $this arrival is the second || $more arrival of this vehicle at the\n // sign ) convert it to show published time\n\t// ------------------------------------------------------------------------\n if ( $this->prediction_stop_info->checkPrediction(\"DUPVEH\", $this->predictionParameters, $this->initialValues, $this ) != \"OK\" ) {\n $this->text = $this->text. \" DUPV->P\";\n $this->vehicle->vehicle_code = \"AUT\";\n $this->vehicle->vehicle_id = 0;\n }\n\n\t// ------------------------------------------------------------------------\n // Ensure arrival \n\t// For sequence/autoroute countdowns ensure resent every 5 minutes\n\t// ------------------------------------------------------------------------\n\tif ( $this->time_last_sent ) {\n if ( $this->sch_rtpi_last_sent != $this->initialValues->sch_rtpi_last_sent ) {\n $this->text = $this->text. \" \". $this->initialValues->sch_rtpi_last_sent. \"->\". $this->sch_rtpi_last_sent;\n } else {\n\t if ( $trip_type == \"AUT\" ) {\n $curr = new DateTime();\n $tls = DateTime::createFromFormat(\"Y-m-d H:i:s\", $this->time_last_sent);\n\t\t $l_sincelast_int = $curr->getTimestamp() - $tls->getTimestamp();\n\t\t $l_at_least_every = 180;\n if ( $l_sincelast_int > $l_at_least_every ) {\n $this->text = $this->text. \" $l_sincelast_int $l_at_least_every PFRC\";\n } else {\n $stat = $this->prediction_stop_info->checkPrediction(\"DELIVER\", $this->predictionParameters, $this->initialValues, $this );\n\n $this->prediction_stop_info->arr_no = 0;\n $this->prediction_stop_info->add();\n\t\t $this->text = $this->text. \" AUTlast \". $this->time_last_sent;\n $w_display_line = false;\n return false;\n\t\t }\n } else {\n // --------------------------------------------------------------------\n\t // Does prediction deviate enough from previous prediction\n // --------------------------------------------------------------------\n if ( $this->prediction_stop_info->checkPrediction (\"HASCHANGEDENOUGH\", $this->predictionParameters, $this->initialValues, $this ) != \"OK\" ) {\n // Force every x seconds\n $curr = new DateTime();\n $tls = DateTime::createFromFormat(\"Y-m-d H:i:s\", $this->time_last_sent);\n\t\t $l_sincelast_int = $curr->getTimestamp() - $tls->getTimestamp();\n\t\t $l_at_least_every = 120;\n if ($this->display_type == \"S\" ) {\n $this->text = $this->text. \" SNO_CHANGE\";;\n return false;;\n } else {\n\t\t if ( $l_sincelast_int > $l_at_least_every ) {\n $this->text = $this->text. \" FRC\";\n } else {\n $this->text = $this->text. \" NO_CHANGE\";\n return false;\n }\n }\n } else {\n $this->text = $this->text. \" \";\n }\n \n //this->prediction_stop_info->checkPrediction(\"DELIVER\", $this->predictionParameters, $this->initialValues, $this ) != \"OK\" ) \n\t\t //$this->text = $this->text. \" RTPlast \", UtilityDateTime::dateExtract($this->time_last_sent, \"hour to second\")\n //return false\n\t }\n }\n\t}\n $this->prediction_stop_info->vehicle_id = $this->vehicle_id;\n $this->prediction_stop_info->build_id = $this->build_id;\n $this->prediction_stop_info->route_id = $this->route_id;\n $this->prediction_stop_info->dest_id = $this->dest_id;\n\n $stat = $this->prediction_stop_info->checkPrediction(\"DELIVER\", $this->predictionParameters, $this->initialValues, $this );\n\n $this->prediction_stop_info->arr_no = 0;\n $this->prediction_stop_info->add();\n\n\treturn 1;\n}", "public function isTriangular(): bool\n {\n return $this->isLowerTriangular() || $this->isUpperTriangular();\n }", "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 }", "function hasTriplet($pass)\n{\n\n\t// count sequence of incrementing letters\n\t$seq = 1;\n\t$lastChar = null;\n\t\n\t// run through string\n\tfor($i = 0; $i < strlen($pass); $i++)\n\t{\n\t\t\n\t\t// check for sequence\n\t\t$char = ord(substr($pass, $i, 1));\n\t\tif(($char - 1) == $lastChar) $seq++;\n\t\telse $seq = 1;\n\t\t\n\t\t// if we've got a sequence of 3, break\n\t\tif($seq >= 3) break;\n\t\t\n\t\t// update last char\n\t\t$lastChar = $char;\n\t\t\n\t}\n\t\n\tif($seq >= 3) return true;\n\treturn false;\n\n}", "public function __construct($trips)\n {\n $this->compTrips = $trips;\n }", "private function check()\n {\n foreach ($this->scheduler->getQueuedJobs() as $job) {\n if ($job->isDue(new DateTime()) === true) {\n\n $this->executeIfNotOverlapped($job);\n }\n }\n }", "public function testAllOneSectionNoRepeat() {\n\n $this->setFinished($this->section, 8);\n\n $practices = Practice::getTrainings($this->section, $this->user);\n\n $this->assertEquals($practices[0]->section_id, $this->section->id);\n $this->assertEquals($practices[1]->section_id, $this->section->id);\n $this->assertTrue(!isset($practices[2]));\n }", "abstract function check();", "function checkWTP($parts){\n $is64 = false;\n list($chipid, $crc, $accno) = $parts;\n $wtpsi = $this->getAWTPSI();\n $r1 = $wtpsi->doCheckWTPCRC(array('checkdata'=>array($chipid, $crc)));\n if (!$r1 && $this->wtp64bits){\n $r3 = $wtpsi->doCheckWTP64Bit(array('checkdata'=>array($chipid, $crc, $accno)));\n if ($r3){\n\t$r1 = true;\n\t$is64 = true;\n\t$r2 = true;\n\t$wtp32 = $wtpsi->doGet32BitWTPNo(array($chipid.'-'.$crc.'-'.$accno));\n\t//SZACCEPTANCENO\"]=> string(3) \"380\" [\"SZCHIPID\"]=> string(8) \"A2D66104\" [\"SZCHIPIDCRC\n\t$messages[] = 'WTP 64 BITS -> '.$wtp32->SZCHIPID.' '.$wtp32->SZCHIPIDCRC.'-'.$wtp32->SZACCEPTANCENO;\n\t$chipid32 = $wtp32->SZCHIPID;\n\t$crc32 = $wtp32->SZCHIPIDCRC;\n\t$accno32 = $wtp32->SZACCEPTANCENO;\n }\n }\n if (!$is64){\n if ($this->wtpvalidationallproj)\n\t$r2 = $wtpsi->doCheckWTPACCAllProj(array('checkdata'=>array($chipid, $accno)));\n else\n\t$r2 = $wtpsi->doCheckWTPACC(array('checkdata'=>array($chipid, $accno)));\n } else {\n // ...\n if ($this->wtpvalidationallproj)\n\t$r2 = $wtpsi->doCheckWTPACCAllProj(array('checkdata'=>array($chipid32, $accno32)));\n else\n\t$r2 = $wtpsi->doCheckWTPACC(array('checkdata'=>array($chipid32, $accno32)));\n }\n if (!$r1 || !$r2)\n return false;\n else\n return true;\n }", "public function hasTips(){\n return $this->_has(19);\n }", "public function should_run()\n\t{\n\t\treturn (time() - (int) $this->config['titania_last_cleanup']) > (3600 * 6);\n\t}", "function is_reattempted_reattempt($parameters)\n { //Uh-oh!\n foreach ($parameters->status->fail_set as $f)\n {\n //Reattempts have an origin_id (because they originated from another transaction\n //Reattempts also have a context of reattempt!\n if ($f->origin_id != null && $f->context == 'reattempt')\n {\n foreach ($parameters->status->posted_schedule as $e)\n {\n if ($e->transaction_register_id == $f->origin_id && $e->origin_id != null && $e->context == 'reattempt')\n {\n\t\t\t\t\t\t$parameters->reattempted_reattempt_failure = true;\n return 0;\n }\n }\n }\n }\n\n\t\t$parameters->reattempted_reattempt_failure = false;\n return 0;\n }", "function validateSetup()\n\t{\n\t\tforeach ($this->setup->getClient()->status as $key => $val)\n\t\t{\n\t\t\tif ($key != \"finish\" and $key != \"access\")\n\t\t\t{\n\t\t\t\tif ($val[\"status\"] != true)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n//$this->setup->getClient()->setSetting(\"zzz\", \"V\");\n\t\t$clientlist = new ilClientList($this->setup->db_connections);\n//$this->setup->getClient()->setSetting(\"zzz\", \"W\");\n\t\t$list = $clientlist->getClients();\n//$this->setup->getClient()->setSetting(\"zzz\", \"X\");\n\t\tif (count($list) == 1)\n\t\t{\n\t\t\t$this->setup->ini->setVariable(\"clients\",\"default\",$this->setup->getClient()->getId());\n\t\t\t$this->setup->ini->write();\n\n\t\t\t$this->setup->getClient()->ini->setVariable(\"client\",\"access\",1);\n\t\t\t$this->setup->getClient()->ini->write();\n\t\t}\n//$this->setup->getClient()->setSetting(\"zzz\", \"Y\");\n\t\treturn true;\n\t}", "private function checkError() : void\n {\n $this->isNotPost();\n $this->notExist();\n $this->notAdmin();\n }", "public function valid()\n {\n\n if ($this->container['task_uid'] === null) {\n return false;\n }\n if ($this->container['resource_uid'] === null) {\n return false;\n }\n if ($this->container['uid'] === null) {\n return false;\n }\n if ($this->container['percent_work_complete'] === null) {\n return false;\n }\n if ($this->container['actual_cost'] === null) {\n return false;\n }\n if ($this->container['actual_finish'] === null) {\n return false;\n }\n if ($this->container['actual_overtime_cost'] === null) {\n return false;\n }\n if ($this->container['actual_overtime_work'] === null) {\n return false;\n }\n if ($this->container['actual_start'] === null) {\n return false;\n }\n if ($this->container['actual_work'] === null) {\n return false;\n }\n if ($this->container['acwp'] === null) {\n return false;\n }\n if ($this->container['confirmed'] === null) {\n return false;\n }\n if ($this->container['cost'] === null) {\n return false;\n }\n if ($this->container['cost_rate_table_type'] === null) {\n return false;\n }\n if ($this->container['cost_variance'] === null) {\n return false;\n }\n if ($this->container['cv'] === null) {\n return false;\n }\n if ($this->container['delay'] === null) {\n return false;\n }\n if ($this->container['finish'] === null) {\n return false;\n }\n if ($this->container['finish_variance'] === null) {\n return false;\n }\n if ($this->container['work_variance'] === null) {\n return false;\n }\n if ($this->container['has_fixed_rate_units'] === null) {\n return false;\n }\n if ($this->container['fixed_material'] === null) {\n return false;\n }\n if ($this->container['leveling_delay'] === null) {\n return false;\n }\n if ($this->container['leveling_delay_format'] === null) {\n return false;\n }\n if ($this->container['linked_fields'] === null) {\n return false;\n }\n if ($this->container['milestone'] === null) {\n return false;\n }\n if ($this->container['overallocated'] === null) {\n return false;\n }\n if ($this->container['overtime_cost'] === null) {\n return false;\n }\n if ($this->container['overtime_work'] === null) {\n return false;\n }\n if ($this->container['peak_units'] === null) {\n return false;\n }\n if ($this->container['regular_work'] === null) {\n return false;\n }\n if ($this->container['remaining_cost'] === null) {\n return false;\n }\n if ($this->container['remaining_overtime_cost'] === null) {\n return false;\n }\n if ($this->container['remaining_overtime_work'] === null) {\n return false;\n }\n if ($this->container['remaining_work'] === null) {\n return false;\n }\n if ($this->container['response_pending'] === null) {\n return false;\n }\n if ($this->container['start'] === null) {\n return false;\n }\n if ($this->container['stop'] === null) {\n return false;\n }\n if ($this->container['resume'] === null) {\n return false;\n }\n if ($this->container['start_variance'] === null) {\n return false;\n }\n if ($this->container['summary'] === null) {\n return false;\n }\n if ($this->container['sv'] === null) {\n return false;\n }\n if ($this->container['units'] === null) {\n return false;\n }\n if ($this->container['update_needed'] === null) {\n return false;\n }\n if ($this->container['vac'] === null) {\n return false;\n }\n if ($this->container['work'] === null) {\n return false;\n }\n if ($this->container['work_contour'] === null) {\n return false;\n }\n if ($this->container['bcws'] === null) {\n return false;\n }\n if ($this->container['bcwp'] === null) {\n return false;\n }\n if ($this->container['booking_type'] === null) {\n return false;\n }\n if ($this->container['actual_work_protected'] === null) {\n return false;\n }\n if ($this->container['actual_overtime_work_protected'] === null) {\n return false;\n }\n if ($this->container['creation_date'] === null) {\n return false;\n }\n if ($this->container['budget_cost'] === null) {\n return false;\n }\n if ($this->container['budget_work'] === null) {\n return false;\n }\n if ($this->container['rate_scale'] === null) {\n return false;\n }\n return true;\n }", "public function hasTrophies(): bool\n {\n $value = $this->pluck('definedTrophies');\n\n return isset($value) && !empty($value);\n }", "public static function checkForSiteTimings() {\n $addressModel = new StoreAddress();\n $open_close = $addressModel->checkSiteTimings();\n if (!empty($open_close)) {\n return false;\n }\n return true;\n }", "public function testValidOnBoundariesData()\n {\n $this->breweriesDataFetchingMock->shouldReceive('setUpBreweriesData')->once()\n ->andReturn(dataFactory(10, 0));\n $this->routeCalculationServiceMock->shouldReceive('calculateRoute')->once()\n ->andReturn([\n 'usedIndexes' => [],\n 'distanceLeft' => 0,\n 'breweriesData' => dataFactory(10, 0)]);\n $this->validateCoordinatesServiceMock->shouldReceive('isLatitudeValid')->andReturn(true);\n $this->validateCoordinatesServiceMock->shouldReceive('isLongitudeValid')->andReturn(true);\n $startLongitude = 180.000;//-180\n $startLatitude = -85.000;//85\n $tripDistance = 0;\n $result = $this->tripMakingService->calculateWholeTrip($startLongitude, $startLatitude, $tripDistance);\n\n $this->assertEquals($tripDistance, $result['tripDistance']);\n }", "private function check()\n {\n return (\n ! empty($this->from) &&\n ! empty($this->to) &&\n ! empty($this->subject) &&\n ! empty($this->body)\n );\n }", "public function checkWin() {\n\n $data = $this->getDeathRecord();\n $data = array_map(function($d) {\n return $d[key($d)];\n }, $data);\n\n if ($data) {\n if (in_array(\"FARMER\", $data)) {\n return FALSE;\n }\n if (in_array(\"COW_1\", $data) && in_array(\"COW_2\", $data)) {\n return FALSE;\n }\n if (in_array(\"BUNNY_1\", $data) && in_array(\"BUNNY_2\", $data) && in_array(\"BUNNY_4\", $data) && in_array(\"BUNNY_4\", $data)) {\n return FALSE;\n }\n }\n return true;\n }", "public function check() : bool\n { \n foreach($this->caller->numbersCalled as $key => $number)\n {\n \n foreach ($this->card->numbers as $key => $cardLine) \n {\n \n if(in_array($number, $cardLine)){\n $this->confirmations++;\n continue 2;\n }\n\n }\n }\n\n if($this->confirmations<24)\n {\n return false;\n }\n\n return true;\n }", "function check_transfers() {\r\n\tglobal $option;\r\n\t$timestamp = mktime();\r\n\t/* Holt alle Auktionen, bei denen die Endzeit vorbei ist */\r\n\t$cond[] = array(\"col\" => \"end\", \"value\" => ($timestamp - 30), \"func\" => \"<\");\r\n\t$cond[] = array(\"col\" => \"end\", \"value\" => \"\", \"func\" => \"IS NOT NULL\");\r\n\t$cond[] = array(\"col\" => \"end\", \"value\" => 0, \"func\" => \"!=\");\r\n\t$cond[] = array(\"col\" => \"history\", \"value\" => 0);\r\n\t$result = uli_get_results('auctions', $cond);\r\n\tif ($result){\r\n\t\tforeach ($result as $auction){\r\n\t\t\t/* Transfer vorbereiten */\r\n\t\t\tif (trade_player($auction['playerID'], $auction['leagueID'], $auction)){\r\n\t\t\t\tarchive_auctions($auction['playerID'], $auction['leagueID']);\r\n\t\t\t}\r\n\t\t}}\r\n}", "public function hasTiers()\n {\n return (\\count($this->arrTiers) > 1);\n }", "public function should_run() {\n\t\treturn (\n\t\t\tdefined( 'WP_DEBUG' )\n\t\t\t&&\n\t\t\tWP_DEBUG\n\t\t\t&&\n\t\t\tisset( $_GET['origination'] ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.NoNonceVerification\n\t\t);\n\t}", "function check_room_valid($target_lecture, $room_alloc)\n{\n\n // check which room is available\n // return Room-1, Room-2, Room-3, Room-4 etc.\n // or return false\n// $empty_timeslots = [];\n// for ($i = 9; $i <= 17; $i++) {\n// $empty_timeslots[$i] = false;\n// }\n $targetStartTime = $target_lecture->getStartTime();\n $targetDuration = $target_lecture->getDuration();\n $targetEndTime = $targetStartTime + $targetDuration;\n foreach ($room_alloc as $one_room_id => $list_of_lectures) {\n //check which time has been taken\n $timeslots_taken = [\n// 9 => false\n// 10\n// 11...\n ];\n for ($i = 9; $i <= 17; $i++) {\n $timeslots_taken[$i] = false;\n }\n foreach ($list_of_lectures as $oneLecture) {\n $startTime = $oneLecture->getStartTime();\n// $level = $oneLecture->getId();\n $duration = $oneLecture->getDuration();\n for ($s = $startTime; $s < ($startTime + $duration); $s++) {\n $timeslots_taken[$s] = true;\n }\n }\n\n // check if $one_lecture can be assigned to this $one_room_id\n $valid = true; // assume u can\n // find any slot that is taken\n for ($t = $targetStartTime; $t < $targetEndTime; $t++) {\n if ($timeslots_taken[$t] == true) {\n $valid = false;\n break;\n }\n }\n if ($valid == true) {\n return $one_room_id;\n }\n }\n\n return false;\n}", "public function valid() {\n return $this->pointer < count($this->items);\n }", "public function checkSlotWriting() {\n $writeSlot = 1;\n foreach($this->decission as $item) {\n if($item === 0) {\n $writeSlot = 0;\n }\n }\n if($writeSlot == 1 AND $this->nextStation->sendToAllAtOnce == 0) {\n $this->checkForNewSlot($this->nextStation->workflow_slot_id);\n }\n else {\n $this->nextStation->checkSendToAllAtOnce();\n }\n }", "public function isValid(): bool\n {\n $epsilon = pow(1, -15);\n\n return !(abs($this->p1->y - $this->p2->y) < $epsilon && abs($this->p2->y - $this->p3->y) < $epsilon);\n }", "public abstract function preTrip();", "public function isValidPairing(){\n return $this->validPairing;\n }", "public function check()\n {\n return ! $this->guest();\n }", "function checkWeeks() {\n\t\tglobal $weeklyhours; \n\t\t\n\t\tforeach ( $this->weeklyAnalysis as &$week ) {\n\t\t\tif ( $week['total'] < $weeklyhours ) {\n\t\t\t\t$week['complete'] = 0; \t\t\t\t\t\t\t// set this week incomplete\n\t\t\t\t$this->complete = 0; \t\t\t\t\t\t\t// set entire analysis to incomplete\n\t\t\t}\n\t\t\telse $week['complete'] = 1;\n\t\t\t\t\n\t\t}\n\t}", "public function check() {}", "function _check($from_lines, $to_lines)\n {\n }", "abstract protected function safetyCheck() : self;", "private function sanityChecksPass()\n {\n // Make sure our storage path exists.\n if ( ! is_dir($this->taskStatusStoragePath))\n {\n // No? Create it.\n mkdir($this->taskStatusStoragePath);\n }\n\n // Make sure we can write to our directory.\n $testFilename = rand(1, 1000);\n $testFilepath = $this->taskStatusStoragePath . $testFilename;\n try\n {\n file_put_contents($testFilepath, 'Testing');\n } catch (Exception $e)\n {\n return false;\n }\n\n // Ok, we're good. Delete the dummy lock file (if we can write, there's no reason to suspect we can't unlink also).\n unlink($testFilepath);\n\n // Announce sanity checks passed.\n return true;\n }", "protected function isWizardDone() {}", "public function gameWon()\n {\n return $this->countStones() === 1;\n }", "function Check()\n {\n if (file_exists($this->save)) {\n $jsondecode = file_get_contents($this->save);\n }\n\n $decoded = json_decode($jsondecode, true);\n if ($decoded == NULL) {\n $this->register_start();\n } else {\n for ($i = 0; $i < count($decoded) + 1; $i++) {\n\n if (($decoded)[$i][0]['Starttime'] == NULL && ($decoded)[$i][0]['Endtime'] == NULL) {\n $this->register_start();\n }\n if (($decoded)[$i][0]['Endtime'] == \"\" && ($decoded)[$i][0]['Starttime'] != NULL) {\n $this->register_end();\n break;\n }\n }\n }\n }", "public function checkOperationality()\n {\n }", "public function progressValidation (): bool\n {\n // for secure: Check if the step of the answer are identical with current step which is set in the result object\n // (someone could step back via browser and send answers again. In this case the answer-step and the result-step\n // would be different)\n if (!$this->result) {\n throw new Exception('No result set.', 1638189967);\n }\n\n /** @var \\RKW\\RkwCheckup\\Domain\\Model\\ResultAnswer $resultAnswer */\n foreach ($this->result->getNewResultAnswer() as $resultAnswer) {\n if ($resultAnswer->getStep() !== $this->result->getCurrentStep()) {\n // do absolutely nothing (if this condition failed once, because the whole request then is garbage)\n return false;\n }\n }\n\n return true;\n }", "function qode_tours_check_tour_sections() {\n\n\t\t$sections_array = array(\n\t\t\t'qode_tours_show_info_section',\n\t\t\t'qode_tours_show_tour_plan_section',\n\t\t\t'qode_tours_show_location_section',\n\t\t\t'qode_tours_show_gallery_section',\n\t\t\t'qode_tours_show_review_section',\n\t\t\t'qode_tours_show_custom_section_1',\n\t\t\t'qode_tours_show_custom_section_2',\n\t\t);\n\t\t$return_array = array();\n\n\t\tforeach($sections_array as $section) {\n\t\t\t$section_key = str_replace('qode_tours_', '', $section);\n\t\t\t$return_array[$section_key]['value'] = get_post_meta(get_the_ID(), $section, true);\n\n\t\t\tswitch($section_key) {\n\t\t\t\tcase 'show_info_section' :\n\t\t\t\t\t$return_array[$section_key]['icon'] = 'dripicons-preview';\n\t\t\t\t\t$return_array[$section_key]['title'] = esc_html__('Information','qode-tours');\n\t\t\t\t\t$return_array[$section_key]['id'] = 'tour-item-info-id';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'show_tour_plan_section' :\n\t\t\t\t\t$return_array[$section_key]['icon'] = 'dripicons-map';\n\t\t\t\t\t$return_array[$section_key]['title'] = esc_html__('Tour Plan','qode-tours');\n\t\t\t\t\t$return_array[$section_key]['id'] = 'tour-item-plan-id';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'show_location_section' :\n\t\t\t\t\t$return_array[$section_key]['icon'] = 'dripicons-location';\n\t\t\t\t\t$return_array[$section_key]['title'] = esc_html__('Location','qode-tours');\n\t\t\t\t\t$return_array[$section_key]['id'] = 'tour-item-location-id';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'show_gallery_section' :\n\t\t\t\t\t$return_array[$section_key]['icon'] = 'dripicons-photo-group';\n\t\t\t\t\t$return_array[$section_key]['title'] = esc_html__('Gallery','qode-tours');\n\t\t\t\t\t$return_array[$section_key]['id'] = 'tour-item-gallery-id';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'show_review_section' :\n\t\t\t\t\t$return_array[$section_key]['icon'] = 'dripicons-message';\n\t\t\t\t\t$return_array[$section_key]['title'] = esc_html__('Reviews','qode-tours');\n\t\t\t\t\t$return_array[$section_key]['id'] = 'tour-item-review-id';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'show_custom_section_1' :\n\n\t\t\t\t\t$custom_section1_title = (get_post_meta(get_the_ID(), 'qode_tours_custom_section1_title', true) != '') ? get_post_meta(get_the_ID(), 'qode_tours_custom_section1_title', true) : esc_html__('Custom Section 1', 'qode-tours');\n\t\t\t\t\t$return_array[$section_key]['icon'] = 'icon_book';\n\t\t\t\t\t$return_array[$section_key]['title'] = $custom_section1_title;\n\t\t\t\t\t$return_array[$section_key]['id'] = 'tour-item-custom1-id';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'show_custom_section_2' :\n\t\t\t\t\t$custom_section2_title = (get_post_meta(get_the_ID(), 'qode_tours_custom_section2_title', true) != '') ? get_post_meta(get_the_ID(), 'qode_tours_custom_section2_title', true) : esc_html__('Custom Section 2', 'qode-tours');\n\t\t\t\t\t$return_array[$section_key]['icon'] = 'icon_book';\n\t\t\t\t\t$return_array[$section_key]['title'] = $custom_section2_title;\n\t\t\t\t\t$return_array[$section_key]['id'] = 'tour-item-custom2-id';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $return_array;\n\t}", "public function check_wipers() {\r\n echo PHP_EOL;\r\n $this->action(\"checking wipers\");\r\n $this->action($this->wipers_on ? \"windshield wipers are on\" : \"windshield wipers are off\");\r\n }", "public function canProceed(): bool\n {\n if (!$this->isAllCompleted()) {\n throw new \\RuntimeException('Please fill all the necessary data');\n }\n\n if ($this->allInEurope()) {\n return true;\n }\n\n if ($this->allSameCountry() && !$this->isRussia() && !$this->someInHighRisk()) {\n return true;\n }\n\n if ($this->allSameCountry() && $this->isRussia()) {\n if ($this->nameFound()) {\n return false;\n }\n return true;\n }\n\n return false;\n }", "public function hasTiers()\n {\n return (count($this->arrTiers) > 1);\n }", "public function check();", "public function check();", "public function check();", "public function check();", "public function check();", "private static function canAllParticipate($exercise) {\n\t\treturn \tempty($exercise['limited_space'])\n\t\t\t\t&& empty($exercise['expert']);\n\t}", "public function needsBuckets() {\n return $this->propertyNames === null\n || $this->propertyValues === null\n || $this->properties === null\n || $this->treeLefts === null;\n }", "protected function getTemplateMarkersCheck() {}", "public function hasRide(){\r\n return $this->_has(3);\r\n }", "protected function check() {\n if (empty($this->method_map)\n || empty($this->param)\n || empty($this->service_url)\n ) {\n throw new Exception('Param or method map is empty');\n }\n }", "protected function checkValidity(array $params)\n\t{\n $this->count($params, 1);\n $this->isDirect($params[0], 0);\n }", "public function testParkHours()\n\t{\n\t\t$parkHours = $this->get(route('park-hours'));\n\t\t\n\t\tif (!empty($parkHours))\n\t\t{\n\t\t\t$this->assertTrue(TRUE);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->assertTrue(FALSE);\n\t\t}\n\t}", "public function testOtherSectionsCorrectAnswer() {\n\n $this->section->setFinished($this->user);\n\n $this->setFinished($this->section, 1);\n $this->setFinishedTo($this->section2, 0);\n $this->setCorrectnessTo($this->section2, 0, false);\n $this->setFinishedTo($this->section3, 0);\n $this->setCorrectnessTo($this->section3, 0, true);\n\n $practices = Practice::getTrainings($this->section, $this->user);\n\n $this->assertEquals($practices[0]->section_id, $this->section->id);\n $this->assertEquals($practices[1]->section_id, $this->section->id);\n $this->assertEquals($practices[2]->section_id, $this->section->id);\n $this->assertEquals($practices[3]->section_id, $this->section2->id);\n $this->assertEquals($practices[4]->section_id, $this->section3->id);\n $this->assertTrue(!isset($practices[5]));\n\n // Add sleep to add correctness mark on the next second\n sleep(1);\n\n $this->setFinishedTo($this->section3, 1);\n $this->setCorrectnessTo($this->section3, 1, true);\n\n $practices = Practice::getTrainings($this->section, $this->user);\n\n $this->assertEquals($practices[4]->subtype_id, $this->section3->practices[1]->subtype_id);\n\n sleep(1);\n\n $this->setCorrectnessTo($this->section3, 0, true);\n\n $practices = Practice::getTrainings($this->section, $this->user);\n\n $this->assertEquals($practices[4]->subtype_id, $this->section3->practices[0]->subtype_id);\n }", "public function isValid() {\n return ($this->_parent !== null && $this->_parent instanceof Scenario_Experiment\n && is_string($this->_treatment_name) && !empty($this->_treatment_name));\n }", "function Step1_IntegrityHard() { return( $this->stepTest( 'integ_') ); }", "private function validate() {\n $this->valid = (1 === count($this->marriages));\n }", "public function is_valid() {\n\t\tif ( empty( $this->active ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( empty( $this->type_def['valid'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $this->trials <= 0 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "protected function check() {\n if (empty($this->method_map)\n || empty($this->service_url)\n ) {\n throw new Exception('Param or method map is empty');\n }\n }", "function checkInput()\n\t{\n\t\tglobal $lng;\n\t\t\n\t\t$_POST[$this->getPostVar()][\"latitude\"] = \n\t\t\tilUtil::stripSlashes($_POST[$this->getPostVar()][\"latitude\"]);\n\t\t$_POST[$this->getPostVar()][\"longitude\"] = \n\t\t\tilUtil::stripSlashes($_POST[$this->getPostVar()][\"longitude\"]);\n\t\tif ($this->getRequired() &&\n\t\t\t(trim($_POST[$this->getPostVar()][\"latitude\"]) == \"\" || trim($_POST[$this->getPostVar()][\"longitude\"]) == \"\"))\n\t\t{\n\t\t\t$this->setAlert($lng->txt(\"msg_input_is_required\"));\n\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function passed(){\n \n //Loop through all the fields in the ruleset\n foreach($this->rules as $fieldName => $ruleCollection){\n foreach($ruleCollection as $rule => $rule_value){\n $this->validateField($fieldName, $rule, $rule_value); \n }\n }\n \n if($this->useValidationToken){\n if( Input::get(\"form_token\") != Session::get(\"form_token\") ){\n $this->addError(\"form_token\", \"token\", \"Could not process form form at this time. Please try again.\");\n }\n }\n \n //If we're using session flash, add a formatted list of errors to the session flash system\n if($this->useSessionFlash){\n Session::addFlash($this->formattedErrors(\"list\"), \"danger\", \"Please correct the following errors\");\n }\n \n return $this->hasPassed;\n }", "public function validate()\n\t{\n\t\t$result = true;\n\t\tforeach ($this->slices as &$slice) {\n\t\t\t//debug($slice['name'] . ' ('.$slice['from'].'-'.$slice['till'].': '.sizeof($slice['desc']).')');\n\t\t\t$f2 = new HTMLFormTable($slice['desc']);\n\t\t\t$v = new HTMLFormValidate($f2);\n\t\t\t$result = $v->validate() && $result; // recursive inside // this order to force execution\n\t\t\t$slice['desc'] = $v->getDesc();\n\t\t}\n\t\t//debug($this->slices);\n\t\treturn $result;\n\t}", "function _Fchecktimestchrgrpcnstr($_Mteacher1,$_Mgroup1,$_Mcourse1,&$_Mpossibletimes)\n{\n\t$_Mdayslots=$GLOBALS['_Mdayslots'];$_Mtotslots=$GLOBALS['_Mtotslots'];\n\t$_Mcourseunits=$_Mcourse1->getcourseunits();\n\t$_Mcoursepartunits=$_Mcourse1->getcoursepartunits();\n\t//if($_Mcourseunits==3) $_Mcourseunits++;//3 units needs 4 free slot\n\t$_Mteachertime=$_Mteacher1->getteachertimes();\n\t$_Mgroupstatus=$_Mgroup1->getgroupstatus();\n\t$_Mfreetimecount=0;\n\tfor($i=0 ; $i<$_Mtotslots ; $i++)\n\t{\n\t\t//checkconstraint4course();\n\t\t$_Mttime=$_Mteachertime[$i];$_Mgtime=$_Mgroupstatus[$i];\n\t\t//will correct ; p is assumed f\n\t\tif($_Mttime=='p') $_Mttime='f';\n\t\t//*********************\n\t\t\n\t\tif(($_Mttime=='f')&($_Mgroupstatus[$i]=='f'))\n\t\t $_Mfreetimecount++;\n\t\tif((($_Mttime=='e')&($_Mgtime=='e'))||\n\t\t (($_Mttime=='o')&($_Mgtime=='o'))||\n\t\t (($_Mttime=='f')&($_Mgtime=='o'))||\n\t\t (($_Mttime=='f')&($_Mgtime=='e'))||\n\t\t (($_Mttime=='o')&($_Mgtime=='f'))||\n\t\t (($_Mttime=='e')&($_Mgtime=='f'))//||\n\t\t //(($_Mttime=='p')&($_Mgtime!='s'))//will check other statuses\n\t\t )\n\t\t\t $_Mfreetimecount+=.5;\n\t \t$_Mpossibletimes[$i]=_Fsmaller($_Mttime,$_Mgtime);\n\t\t\n\t}\n\t$_Mcourseremainedtimes=$_Mcourse1->getcourseremainedunits();\n\tif(($_Mfreetimecount>0)&($_Mfreetimecount<$_Mcourseremainedtimes))//if teacher has free slot but not >= courseunits,act according to a total constraint parameter\n\t{\n\t\tglobal $_Mpartialteacherschedule;\n\t\tif($_Mpartialteacherschedule)\n\t\t{ \n\t\t\tarray_push($GLOBALS['_Mteachershavenocmpletefreeslots'],array($GLOBALS['_Mgroup1']->getgroupid(),$_Mcourse1->getcourseid(),$_Mcourse1->getcoursecaption(),$_Mteacher1->teacherid,$_Mteacher1->teacherfamily));\n\t\t\tif(($_Mfreetimecount>=$_Mcoursepartunits)&(($_Mcourse1->getcoursepart()=='c1')||($_Mcourse1->getcoursepart()=='a1')))return true;\n\t\t\telse if(($_Mfreetimecount>=$_Mcoursepartunits)&($_Mcourse1->getotherparttid()==$_Mteacher1->getteacherid()))return true;\n\t\t\telse return false;\n\t\t}\n\t\telse return false;\n\t}\n\n\telse if (($_Mfreetimecount>=$_Mcourseremainedtimes)&&($_Mfreetimecount>0))\n\t return true;\n\telse return false;\n}", "private function check_for_excessive_dropped_users() {\n $is_validated = true;\n $invalid_courses = array(); // intentional local array\n $ratio = 0;\n $diff = 0;\n foreach($this->data as $course => $rows) {\n if (!validate::check_for_excessive_dropped_users($rows, $this->semester, $course, $diff, $ratio)) {\n $invalid_courses[] = array('course' => $course, 'diff' => $diff, 'ratio' => round(abs($ratio), 3));\n $is_validated = false;\n }\n }\n\n if (!empty($invalid_courses)) {\n usort($invalid_courses, function($a, $b) { return $a['course'] <=> $b['course']; });\n $msg = \"The following course(s) have an excessive ratio of dropped students.\\n Stats show mapped courses combined in base courses.\\n\";\n array_unshift($invalid_courses, array('course' => \"COURSE\", 'diff' => \"DIFF\", 'ratio' => \"RATIO\")); // Header\n foreach ($invalid_courses as $invalid_course) {\n $msg .= \" \" .\n str_pad($invalid_course['course'], 18, \" \", STR_PAD_RIGHT) .\n str_pad($invalid_course['diff'], 6, \" \", STR_PAD_LEFT) .\n str_pad($invalid_course['ratio'], 8, \" \", STR_PAD_LEFT) .\n PHP_EOL;\n }\n $msg .= \" No upsert performed on any/all courses in Submitty due to suspicious data sheet.\";\n\n $this->log_it($msg);\n return false;\n }\n\n return true;\n }", "public function hasTasks()\n {\n return $this->count() > 0;\n }", "protected function checkBooking(Trip $trip, Station $pickup, Station $arrival, int $seat_number)\n {\n $ride = ['start' => $pickup->id, 'end' => $arrival->id];\n\n $trips_i_will_see = collect([]);\n $trips_i_wont_see = collect([]);\n\n $stations = $trip->stations()->orderBy('station_trip.stop_order')->pluck('stations.id')->toArray();\n\n $stations_count = count($stations);\n\n for ($i = 0; $i < $stations_count; $i++) {\n for ($x = $i; $x < $stations_count; $x++) {\n if ($i == $x) {\n continue;\n }\n\n if (\n ($stations[$i] <= $ride['start'] && $stations[$x] <= $ride['start']) ||\n ($stations[$i] >= $ride['end'] && $stations[$x] >= $ride['end'])\n ) {\n // $trips_i_wont_see->push(['start' => $stations[$i], 'end' => $stations[$x]]);\n continue;\n }\n\n $trips_i_will_see->push(['start' => $stations[$i], 'end' => $stations[$x]]);\n }\n }\n\n $booked_trips_i_will_see = $trip->users()\n ->wherePivotIn('pickup_station_id', array_unique($trips_i_will_see->pluck('start')->toArray()))\n ->wherePivotIn('arrival_station_id', array_unique($trips_i_will_see->pluck('end')->toArray()))\n ->get();\n\n $booked_seats_numbers = array_unique($booked_trips_i_will_see->pluck('pivot.seat_number')->toArray());\n\n $available_seats_numbers = array_diff(range(1, 12), $booked_seats_numbers);\n\n // Number of booked seats based on my booking trip.\n $booked_seats = $booked_trips_i_will_see->count();\n\n // Number of available seats based on my booking trip.\n $available_seats = 12 - $booked_seats;\n\n // Check if there's available seats and the target seat number not booked\n $can_book_a_seat = $available_seats > 0 && array_search($seat_number, $available_seats_numbers) !== false;\n\n return compact('booked_seats', 'booked_seats_numbers', 'available_seats', 'available_seats_numbers', 'can_book_a_seat');\n }", "protected function assertPostConditions() {\n\t\tprint \"---------------------------------------------------------------- \\n\";\n\t}", "public function validatePerms(){ \n\t\treturn TRUE;\n\t}", "public function hasTrial()\n {\n return (is_numeric($this->trial_period_days) and $this->trial_period_days > 0);\n }", "protected function doCheck()\n {\n foreach ($this->controlTokens as $id) {\n while ($this->file->seekTokenId($id)) {\n $controlToken = $this->file->current();\n $name = $controlToken->getText();\n\n if ($this->file->seekTokenId(T_OPEN_CURLY)) {\n $curlyToken = $this->file->current();\n\n if (!$this->file->valid() || $controlToken->getLine() != $curlyToken->getLine()) {\n if ($controlToken->getLine() == $curlyToken->getLine() - 1) {\n $this->addViolation(\"Brace for `{$name}` statement on wrong line\", $curlyToken);\n } else {\n $this->addViolation(\"No brace for `{$name}` statement\", $controlToken);\n $this->file->seekToken($controlToken);\n }\n }\n } else {\n $this->addViolation(\"No brace for `{$name}` statement\", $controlToken);\n $this->file->seekToken($controlToken);\n }\n\n $this->file->next();\n }\n $this->file->rewind();\n }\n }", "public static function handle_tasks()\n {\n\t $granularity = (int)get_site_preference('pseudocron_granularity',60);\n\t $last_check = get_site_preference('pseudocron_lastrun',0);\n\t if( (time() - $granularity * 60) >= $last_check )\n\t\t {\n\t\t\t // 1. Get Task objects.\n\t\t\t self::get_tasks();\n\t\n\t\t\t // 2. Evaluate Tasks\n\t\t\t self::execute();\n\t\n\t\t\t // 3. Cleanup to minimize memory usage\n\t\t\t self::cleanup();\n\n\t\t\t // 4. Say we've done a check\n\t\t\t set_site_preference('pseudocron_lastrun',time());\n\t\t }\n }" ]
[ "0.698763", "0.58463544", "0.5815626", "0.56375796", "0.56302553", "0.55192226", "0.54502255", "0.53759956", "0.5370381", "0.5329895", "0.53021336", "0.52788687", "0.52520674", "0.52488613", "0.5236402", "0.5209407", "0.5209046", "0.51787055", "0.51304865", "0.51292115", "0.5114075", "0.5107926", "0.50992876", "0.5087918", "0.5082938", "0.5081537", "0.50806326", "0.507077", "0.5058064", "0.50387084", "0.50375724", "0.5033701", "0.5017569", "0.50061804", "0.4997404", "0.49811777", "0.49701875", "0.49633646", "0.4959902", "0.49543533", "0.4951567", "0.49496618", "0.4947434", "0.49462226", "0.4942497", "0.49389258", "0.49054158", "0.49003386", "0.48997274", "0.4893441", "0.48905653", "0.4885803", "0.4885739", "0.4884913", "0.48820052", "0.48771343", "0.48740333", "0.48719373", "0.487096", "0.4870621", "0.48700976", "0.48666382", "0.48602313", "0.48579726", "0.48560783", "0.48557317", "0.48434955", "0.48421416", "0.48414373", "0.48287988", "0.48248684", "0.48246282", "0.48246282", "0.48246282", "0.48246282", "0.48246282", "0.48185784", "0.4811831", "0.4808999", "0.4800343", "0.48003137", "0.47951755", "0.4793157", "0.47901663", "0.47873992", "0.47865927", "0.47826445", "0.47801775", "0.47770333", "0.47766945", "0.47648078", "0.47609743", "0.47577342", "0.4752247", "0.47510815", "0.4750899", "0.47459453", "0.4739938", "0.47336414", "0.473154", "0.47284928" ]
0.0
-1
Checks for the available destination.
public function store(Request $request) { $trip = Trip::find($request->input('trip')); $new_allocated_seat = array_sum($request->input('new_allocated_seats')); $this->validate($request, [ 'trip' => 'required', ]); $request->validate([ 'name' => 'required', 'phoneNumber' => 'required' ]); $ticket = new Ticket(); $ticket->trip_id = $request->input('trip'); $ticket->trip_type = Session::get('key5'); $ticket->return_date = Session::get('key6'); $ticket->no_of_passenger = $new_allocated_seat; if($ticket->trip_type === 'Round Trip') { $ticket->amount = 2 * ($trip->price * $new_allocated_seat); }else{ $ticket->amount = $trip->price * $new_allocated_seat; } $ticket->allocated_seats = $request->input('new_allocated_seats'); $trip->allocated_seats = $request->input('all_allocated_seats'); $trip->available_seats = $trip->available_seats - $new_allocated_seat; if (Auth::check()) { $id = Auth::user()->id; $userDetails = DB::table('users') ->select('email','firstName','lastName', 'phoneNumber') ->where('id','=', $id)->first(); $ticket->user_id = $id; $ticket->email = $userDetails->email; $trip->save(); $count = count((is_countable($request->name)?$request->name:[])); for ($i=0; $i < $count; $i++) { $ticket->name = json_encode($request->name); $ticket->phoneNumber = json_encode($request->phoneNumber); $ticket->save(); } $bookMessage = [ 'title' => 'Booking Confirmation', 'body' => 'Your ticket has been booked.' ]; $pdf = PDF::loadView('ticket',['ticket'=>$ticket]); $message = new SendMail($bookMessage); $message->attachData($pdf->output(), "ticket.pdf"); Mail::to($userDetails->email)->send($message); return redirect()->back()->withSuccessMessage("Your ticket has been booked. Please check your mail."); }else{ Session::put('book', $ticket); return redirect()->route('login'); } Session::forget('book'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destinationNotGiven()\n {\n return empty($this->destination);\n }", "function custom_rules_is_destination_set(){\n\treturn isset( $_GET['destination'] );\n}", "protected function _hasDestinationAddress()\n {\n $hasDestinationAddress = false;\n if ($this->_request->getHeader() && $this->_request->getHeader()->getDefaultLocations()) {\n $locations = $this->_request->getHeader()->getDefaultLocations();\n\n if (isset($locations[self::TAX_LOCATION_PURPOSE_SHIP_TO])) {\n $shipToLocation = $locations[self::TAX_LOCATION_PURPOSE_SHIP_TO];\n $address = $shipToLocation->getAddress();\n $city = (string)$address->getCity();\n $zip = $address->getZipcode();\n $state = $address->getState();\n $hasDestinationAddress = (($city && $state) || $zip) ? true : false;\n }\n }\n\n return $hasDestinationAddress;\n }", "protected function checkDownloadsPossible() {}", "public function fetchDestinations()\n {\n if (! array_key_exists('MarketplaceId', $this->options)) {\n $this->log('Marketplace ID must be set in order to fetch subscription destinations!', 'Warning');\n\n return false;\n }\n\n $this->options['Action'] = 'ListRegisteredDestinations';\n\n $url = $this->urlbase.$this->urlbranch;\n\n $query = $this->genQuery();\n\n $path = $this->options['Action'].'Result';\n if ($this->mockMode) {\n $xml = $this->fetchMockFile()->$path;\n } else {\n $response = $this->sendRequest($url, ['Post' => $query]);\n\n if (! $this->checkResponse($response)) {\n return false;\n }\n\n $xml = simplexml_load_string($response['body'])->$path;\n }\n\n $this->parseXML($xml);\n }", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "abstract public function hasAvailableMoves(): bool;", "public static function is_available()\n {\n }", "public static function isDestinationUsed($destination) {\n\n // find pricebands that specify this destination\n $pricebands = ORM::forTable('priceband')->where('destinationid', $destination->id)->findMany();\n\n // if there are non then not used\n if (!$pricebands) {\n return false;\n }\n\n // otherwise, all prices MUST be 0\n foreach ($pricebands as $priceband) {\n if (($priceband->first > 0) || ($priceband->standard > 0) && ($priceband->child > 0)) {\n return true;\n }\n }\n\n return false;\n }", "abstract public function isAvailable() ;", "public function isAvailable() {\n $path = $this->path();\n return file_exists($path);\n }", "function isAvailable()\n {\n }", "public function isAvailable(): bool\n {\n return isset(\n $this->paymentToken,\n $this->shippingAddress,\n $this->billingAddress,\n $this->shippingMethod\n ) && $this->shippingMethod->getAvailable();\n }", "function isAvailable() ;", "function isAvailable() ;", "function _CheckEndPoint()\n\t{\n\t\t$this->client->__setLocation($this->Url);\n\t}", "public function available();", "public function available();", "public function is_available( $package = array() ) {\n global $woocommerce; \n\n if ( $this->enabled == \"no\" ) \n return false;\n \n if ( isset( $woocommerce->cart->cart_contents_total ) && isset( $this->min_amount ) && $this->min_amount && $this->min_amount > $woocommerce->cart->cart_contents_total ) \n return false;\n\n // Make sure method is available for shipping destination\n $country = isset( $package['destination']['country'] ) ? $package['destination']['country'] : $woocommerce->customer->get_shipping_country();\n $state = $woocommerce->customer->get_shipping_state();\n\n $ship_to_countries = '';\n\n if ( $this->availability == 'specific' ) {\n $ship_to_countries = $this->countries;\n } \n else {\n if ( get_option( 'woocommerce_allowed_countries' ) == 'specific' ) {\n $ship_to_countries = get_option( 'woocommerce_specific_allowed_countries' );\n }\n } \n \n if ( is_array( $ship_to_countries ) ) {\n if ( ! in_array( $country, $ship_to_countries ) ) {\n return false; \n } \n }\n \n $applicable_configurations = $this->get_destination_configurations( $country, $state ); \n\n // If there is no configuration that can be applied to this shipping destination, \n // this method is not available\n if ( count( $applicable_configurations ) == 0 ) {\n return false;\n }\n\n // Check whether each item in the cart has an applicable configuration\n $has_physical_products = false;\n\n foreach ($woocommerce->cart->get_cart() as $item ) {\n\n if ( $item['data']->needs_shipping() ) {\n\n $has_physical_products = true;\n\n $item_configurations = $this->get_item_configurations( $item, $applicable_configurations );\n\n if ( count( $item_configurations ) == 0 ) {\n return false;\n } \n } \n }\n\n return $has_physical_products;\n }", "public static function isAvailable()\n\t{\n\t\treturn true;\n\t}", "public function hasDestinationLicenceId(): bool\n {\n return $this->offsetExists(static::TRANSFER_TO_LICENSE_ID);\n }", "public function isAvailable(): bool;", "public function isAvailable()\n {\n if (empty($this->_url)) {\n return false;\n } // if\n\n try {\n $this->sendrequest('status', null);\n } catch (Exception $e) {\n return false;\n }\n\n return true;\n }", "public function isAvailable(){\n\t\treturn is_dir($this->path);\n\t}", "public function isAvailable(): bool\n {\n return true;\n }", "protected function setDestination() {}", "public function check_afford_banner()\n {\n $after_deduction = available_points(get_member()) - intval(get_option('banner_setup'));\n\n if (($after_deduction < 0) && (!has_privilege(get_member(), 'give_points_self'))) {\n warn_exit(do_lang_tempcode('CANT_AFFORD'));\n }\n }", "public function checkisOnCurrentHostInvalidHosts() {}", "public function is_accessible() {\n $available = $this->properties->available;\n $deadline = $this->properties->deadline;\n return (($available == 0 || time() >= $available) && ($deadline == 0 || time() < $deadline));\n }", "private function test_availability() {\r\n\r\n $this->add_log('test_availability: Testing ws availability...', 'DEBUG');\r\n\r\n $params = new stdClass();\r\n $params->from = @new SoapVar($this->sender, XSD_STRING, \"string\", \"http://www.w3.org/2001/XMLSchema\");\r\n $this->call_function('disponibilitat', $params);\r\n $this->add_log('test_availability: Server avalaible', 'DEBUG');\r\n }", "private function checkDestinationWritable()\n {\n $destination = $this->getDestination();\n $dirName = dirname($destination);\n\n if (@is_writable($dirName) && @is_executable($dirName)) {\n // all is well\n return;\n }\n\n // The above might fail on Windows, even though dir is writable\n // So, to be absolute sure that we cannot write, we make an actual write test (writing a dummy file)\n // No harm in doing that for non-Windows systems either.\n if (file_put_contents($destination, 'dummy') !== false) {\n // all is well, after all\n unlink($destination);\n return;\n }\n\n throw new CreateDestinationFileException(\n 'Cannot create file: ' . basename($destination) . ' in dir:' . dirname($destination)\n );\n }", "private function check_the_router(){\n \n if(isset($_SESSION['routerVariables'])){\n \n $this->router_connection = $_SESSION['routerVariables'];\n $this->router_connected = true;\n \n }else{\n unset($this->router_connection);\n $this->router_connected = false;\n }\n \n }", "public function check()\n {\n if ($this->headers('location') === null) {\n throw new Exception('A \\'location\\' must be specified for a redirect');\n }\n\n return true;\n }", "public function routeUrlDestinationAutodetect()\n {\n\n }", "function getIsAvailable() ;", "public function checkDirectoryExistance()\n {\n if (!file_exists($this->event->getConfig()->router->global_router)) {\n return false;\n }\n if (!is_readable($this->event->getConfig()->router->global_router)) {\n return false;\n }\n\n return true;\n }", "function wpmu_checkAvailableSpace()\n {\n }", "public function hasSourceUri(){\n return $this->_has(7);\n }", "protected function checkRoute()\n {\n if (Router::current() === null) {\n return $this->error(404);\n }\n }", "private function movement_check($data) {\n if ($this->SQL->GetPlayerData(Session::get('PlayerGUID'))->AP == 0){\n $data['location_err'] = true;\n }\n // Get Player Gameboard location\n $location = $this->SQL->GetPlayerLocation(Session::get('PlayerGUID'));\n // Look up Gameboard data\n $MapData = $this->SQL->GetMap($location->ID);\n // Check if desired destination is in GetMap (stop teleportation)\n $isTooFar = true;\n foreach ($MapData as $value) {\n if ($value->ID == $data['location']){$isTooFar = false;}\n }\n // Set error flag if an error was found\n $data['HAS_ERRORS'] = true;\n if (\n empty($data['location_err']) &&\n $isTooFar == false\n ) {\n $data['HAS_ERRORS'] = false;\n }\n // Return to the controller\n return($data);\n }", "public function isAvailable()\n {\n if ($this->archived) {\n return false;\n }\n\n $result = self::$db->fetchOne('select count(*) AS valid\n from jukebox.playlists\n inner join jukebox.playlist_availability on playlists.playlistid = playlist_availability.playlistid\n inner join jukebox.playlist_timeslot\n on playlist_availability.playlist_availability_id = playlist_timeslot.playlist_availability_id\n where playlists.playlistid = $1\n and playlist_availability.effective_from <= NOW()\n and (playlist_availability.effective_to is null or playlist_availability.effective_to >= NOW())\n and (\n day=EXTRACT(DOW FROM NOW())\n or (EXTRACT(DOW FROM NOW())=0 and day=7)\n )\n and start_time <= \"time\"(NOW())\n and end_time >= \"time\"(NOW())', [$this->getID()]);\n\n return $result['valid'] > 0;\n }", "public function getAvailable() : bool\n {\n return $this->available;\n }", "private function checkURI()\n {\n // init vars\n $result = false;\n $uri = $this->getURI();\n $routesArray = $this->routes;\n\n // get existed rule for user requested uri\n foreach ($routesArray as $rulePattern => $path) {\n if (preg_match(\"~$rulePattern~i\", $uri)) {\n $result = [$rulePattern, $path];\n return $result;\n }\n }\n }", "public function getIsAvailable() {}", "function drush_policy_core_rsync_validate($source, $destination, $additional_options = array()) {\n $result = true;\n $destination = _drush_policy_parse_alias($destination);\n\n if ($destination == '@prod') {\n $result = _drush_policy_override_validate($destination, 'files and/or code');\n }\n\n return $result;\n}", "public function is_available() {\n\t\t$country = $this->get_transaction_address( 'country' );\n\n\t\treturn parent::is_available() && $this->ebanx_gateway->isAvailableForCountry( Country::fromIso( $country ) );\n\t}", "public function is_available() {\n\t\t$country = $this->get_transaction_address( 'country' );\n\n\t\treturn parent::is_available() && $this->ebanx_gateway->isAvailableForCountry( Country::fromIso( $country ) );\n\t}", "function sanitizedDest($varname='dest') {\n\tif ($dest = Input::get($varname)) {\n\t\t// if it exists in the database then it is a legitimate destination\n\t\t$db = DB::getInstance();\n\t\t$query = $db->query(\"SELECT id, page, private FROM pages WHERE page = ?\",[$dest]);\n\t\t$count = $query->count();\n\t\tif ($count>0){\n\t\t\treturn $dest;\n\t\t}\n\t\t// if the administrator has intentionally whitelisted a destination it is legitimate\n\t\tif ($whitelist = Config::get('whitelisted_destinations')) {\n\t\t\tif (in_array($dest, (array)$whitelist)) {\n\t\t\t\treturn $dest;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}", "public function readyToShip()\n {\n $shipment = $this->getShipment(1);\n\n return $shipment && $shipment->address && $shipment->method;\n }", "public function hasSourceUri(){\n return $this->_has(5);\n }", "public static function require_remote_access() {\n $addresslist = get_config('local_ousearch', 'remote');\n if (!preg_match('/^[0-9.]+(,\\s*[0-9.]+)*$/', $addresslist)) {\n throw new moodle_exception('remotewrong', 'local_ousearch');\n }\n $addresses = preg_split('/,\\s*/', $addresslist);\n foreach ($addresses as $address) {\n if (getremoteaddr() === $address) {\n return;\n }\n }\n throw new moodle_exception('remotenoaccess', 'local_ousearch');\n }", "public function getIsAvailable();", "function check_transfers() {\r\n\tglobal $option;\r\n\t$timestamp = mktime();\r\n\t/* Holt alle Auktionen, bei denen die Endzeit vorbei ist */\r\n\t$cond[] = array(\"col\" => \"end\", \"value\" => ($timestamp - 30), \"func\" => \"<\");\r\n\t$cond[] = array(\"col\" => \"end\", \"value\" => \"\", \"func\" => \"IS NOT NULL\");\r\n\t$cond[] = array(\"col\" => \"end\", \"value\" => 0, \"func\" => \"!=\");\r\n\t$cond[] = array(\"col\" => \"history\", \"value\" => 0);\r\n\t$result = uli_get_results('auctions', $cond);\r\n\tif ($result){\r\n\t\tforeach ($result as $auction){\r\n\t\t\t/* Transfer vorbereiten */\r\n\t\t\tif (trade_player($auction['playerID'], $auction['leagueID'], $auction)){\r\n\t\t\t\tarchive_auctions($auction['playerID'], $auction['leagueID']);\r\n\t\t\t}\r\n\t\t}}\r\n}", "public function checkSlotWriting() {\n $writeSlot = 1;\n foreach($this->decission as $item) {\n if($item === 0) {\n $writeSlot = 0;\n }\n }\n if($writeSlot == 1 AND $this->nextStation->sendToAllAtOnce == 0) {\n $this->checkForNewSlot($this->nextStation->workflow_slot_id);\n }\n else {\n $this->nextStation->checkSendToAllAtOnce();\n }\n }", "public function isDataDumpAvailable()\n {\n $result = self::checkFileAccess(Registry::get('config.dir.install') . App::DB_DATA);\n\n if (!$result) {\n $app = App::instance();\n $app->setNotification('E', $app->t('error'), $app->t('data_dump_is_not_available'), true);\n }\n\n return $result;\n }", "public function validateSource(): bool\n {\n return ($this->source and $this->source->isOpen());\n }", "public function checkRoute()\n\t{\n\t\tif(!self::$load):\n\t\t\thttp_response_code(404);\n\t\t\tdie('No route found');\n\t\tendif;\n\t}", "private function _checkExist()\n {\n if (!($validation = IO::required($this->data, ['videoLink']))['valid']) {\n throw new InvalidParameterException($validation['message']);\n }\n\n $resource = new Resource($this->data);\n\n $sql = \"SELECT COUNT(*) FROM `resource` WHERE `video_link` = :video_link\";\n\n $stmt = $this->pdo->prepare($sql);\n\n $stmt->execute(['video_link' => $resource->getVideoLink()]);\n\n return $stmt->fetchColumn() != 0;\n }", "public function checkConnection(){\r\n\t\treturn false;\r\n\t}", "public function hasAvailablePlace($place)\n {\n\t\treturn $this->avalaible_place >= $place;\n }", "public function is_available()\n\t\t{\n\t\t\t$is_available = true;\n\t\t\t$iute_params = WC_Gateway_Iute_CRUD::get(IUTE_TABLE_PARAMS);\n\t\t\t$total = $this->get_order_total();\n\n\t\t\tforeach ($iute_params as $param) {\n\n\t\t\t\tif ($param->minAmount > $total or $param->maxAmount < $total) {\n\t\t\t\t\t$is_available = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $is_available;\n\t\t}", "public function hasRoute(): bool;", "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 }", "public function exists()\n {\n if (file_exists($this->getDestination()))\n {\n try\n {\n // Do a redirect to the file on filesystem - don't load contents in - that costs memory\n $url = str_replace(sfImagePoolPluginConfiguration::getBaseDir(), sfImagePoolPluginConfiguration::getBaseUrl(), $this->getDestination());\n \n sfContext::getInstance()->getController()->redirect($url, 0, 301);\n \n return $url;\n }\n catch (Exception $e)\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n }", "function getDestIsUnique() {\n return $this->destIsUnique;\n }", "public function resourceExists(): bool\n {\n $location = $this->route()->parameter('location');\n\n return $location instanceof Location && $location->exists;\n }", "private function checkRoute()\n\t{\n\t $route = GlobalSystem::routeType();\n\t\tif(key_exists($route, RequestRoute::$routes)){\n\t\t\t$this->trigger = RequestRoute::$routes[$route][GlobalSystem::ExpRouteKeyTrigger];\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function check_avail(){ \n\t\tif(!empty($this->data['HrPermission']['per_from']) && !empty($this->data['HrPermission']['per_to']) && !empty($this->data['HrPermission']['per_date'])){\n\t\t\t// get used leave\n\t\t\t$date_str = $this->get_search_date($this->data['HrPermission']['per_date']);\n\t\t\t$this->unBindModel(array('hasOne' => array('HrPerStatus', 'HrPerUser')));\t\t\t\n\t\t\t$data = $this->find('all', array('fields' => array(\"TIME_FORMAT(SEC_TO_TIME( SUM( TIME_TO_SEC(no_hrs))), '%k:%i') as count\", 'HrPermission.id'), \n\t\t\t'conditions' => array('HrPermission.app_users_id' => $this->data['HrPermission']['user_id'], 'HrPermission.is_deleted' => 'N', 'is_approve !=' => 'R', \n\t\t\t'per_date like' => $date_str.'%')));\t\t\t\n\t\t\t$used = $data[0][0]['count'];\n\t\t\t\n\t\t\tif(empty($used)){\t\n\t\t\t\t$total_hrs = $this->data['HrPermission']['no_hrs'];\n\t\t\t}else{\n\t\t\t\t$total_hrs = $this->add_time($used, $this->data['HrPermission']['no_hrs']);\t\n\t\t\t}\n\t\t\t// find total usable hours\t\t\t\t\t\n\t\t\t$total_hrs = explode(':', $total_hrs);\t\t\t\n\t\t\t$avail = 2;\t\t\t\t\n\t\t\tif(($total_hrs[0] >= $avail && $total_hrs[1] > 0) || ($total_hrs[0] > 2)){ \n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private function checkReadable() {\n\t\tif ( !$this->isReadable() ) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Current user doesn't have permissions to view this pathway\"\n\t\t\t);\n\t\t}\n\t}", "public function available() {\r\n\t\t// All streams were read\r\n\t\tif($this->_streamsCount===0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// The current stream has more data\r\n\t\tif(reset($this->_streams)->available()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t// Check the other streams, if they have data\r\n\t\tforeach($this->_streams as $stream) {\r\n\t\t\tif($stream->available()) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "function wpmu_checkAvailableSpace() {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'is_upload_space_available()' );\n\n\tif ( ! is_upload_space_available() ) {\n\t\twp_die( sprintf(\n\t\t\t/* translators: %s: Allowed space allocation. */\n\t\t\t__( 'Sorry, you have used your space allocation of %s. Please delete some files to upload more files.' ),\n\t\t\tsize_format( get_space_allowed() * MB_IN_BYTES )\n\t\t) );\n\t}\n}", "public function isAvailable($quote = null) {\n $available = parent::isAvailable($quote);\n if(!$available) return false;\n\n //T: Email checking will now be done before LIST request.\n return true;\n\n\n $email = $quote->getBillingAddress()->getEmail();\n\n if (strlen($email) == 0) {\n $email = $quote->getCustomerEmail();\n }\n\n if(strlen($email) == 0) return false;\n\n return true;\n }", "public function isDirectionValid()\n {\n if ($this->_direction == 'up' || $this->_direction == 'down') {\n return true;\n }\n return false;\n }", "public function adaptersAvailable()\n {\n return count($this->getAdapters()) > 0;\n }", "public function checkPageForMountpointRedirect() {}", "public function isAvailable()\n\t{\n\t\ttry {\n\t\t\t$output = $this->execute('x = 3;');\n\t\t} catch (ExternalRuntimeException $e) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function validaSelect($selectDestino)\n{\n\t// Se valida que el select enviado via GET exista\n\tglobal $listadoSelects;\n\tif(isset($listadoSelects[$selectDestino])) return true;\n\telse return false;\n}", "public function isAvailableUrl($object)\n {\n $connection = Mage::getSingleton('core/resource')->getConnection(\n Mage_Core_Model_Resource::DEFAULT_READ_RESOURCE\n );\n $select = $connection->select()\n ->from($this->getAttribute()->getBackendTable(), array('count' => new Zend_Db_Expr('COUNT(\\'value_id\\')')))\n ->where($connection->quoteInto('value = ?', $object->getUrlKey()));\n\n if ($object->getId()) {\n $select->where($connection->quoteInto('entity_id <> ?', $object->getId()));\n }\n\n $result = $connection->fetchOne($select);\n return !(int)$result;\n }", "public function originIsValid(): bool;", "private function _verifyPaymentOptionAvailability(){\n \n $authorized = false;\n foreach (Module::getPaymentModules() as $module)\n if ($module['name'] == 'pagseguro') {\n $authorized = true;\n break;\n }\n\n if (!$authorized)\n die($this->module->l('Este método de pagamento não está disponível', 'validation'));\n }", "public static function has_valid_delivery_method(): bool {\n return Simply_Static\\Options::instance()->get('delivery_method') === 'local';\n }", "public function present(): bool\n {\n return ! is_null($this->route);\n }", "private function isFree(): bool {\n\t\treturn $this->memberIsEmpty('pid') && $this->memberIsEmpty('server');\n\t}", "public function checkConvertionComplete()\r\n\t{\r\n\t\treturn (!file_exists($this->referenceFile) || @filesize($this->referenceFile) == 0);\r\n\t}", "public function hasAvailableHotels()\n {\n return ($this->hotelCount > 0);\n }" ]
[ "0.7306294", "0.6593073", "0.617597", "0.60095084", "0.5955571", "0.59461564", "0.59461564", "0.59461564", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5898362", "0.5841701", "0.58046913", "0.57629865", "0.5702298", "0.56987584", "0.569454", "0.5641908", "0.5641908", "0.5620991", "0.55849856", "0.55849856", "0.55749816", "0.5562299", "0.5518231", "0.5486604", "0.5482505", "0.546451", "0.5412025", "0.5405271", "0.5402897", "0.5334178", "0.5330696", "0.52946305", "0.52902794", "0.5277688", "0.5248939", "0.5247519", "0.5240908", "0.52278936", "0.5223743", "0.52212834", "0.52087736", "0.5207858", "0.52063453", "0.5202889", "0.51703256", "0.5166668", "0.51624495", "0.5156993", "0.5156993", "0.51416963", "0.5140037", "0.5130544", "0.5129611", "0.51283985", "0.5127476", "0.5114186", "0.509313", "0.5090004", "0.5086144", "0.5083815", "0.5079703", "0.5073333", "0.5070213", "0.50637394", "0.5059864", "0.50458264", "0.5033432", "0.50331986", "0.5032522", "0.5025045", "0.5023645", "0.50200033", "0.5013741", "0.50117457", "0.50032246", "0.5001455", "0.49998417", "0.49996975", "0.49972206", "0.4996207", "0.499339", "0.49743304", "0.49519923", "0.4951411", "0.49510926", "0.49362424", "0.49351615" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $ticket = Ticket::find($id)->delete(); return redirect('/tickets')->with('status','Deleted Successfully'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Define the different element to load when user is located on correctiv action
function includes_recommandation_category_boxes($idElement, $chargement = 'tout'){ if($chargement == 'tout'){ require_once(EVA_METABOXES_PLUGIN_DIR . 'recommandation/recommandation_category/category_edition.php'); if(((int)$idElement) != 0){ require_once(EVA_METABOXES_PLUGIN_DIR . 'galeriePhotos/galeriePhotos.php'); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function load_login_box(){\n\t\t$element = Element::type('elementLogin');\n\t\t$element->build('login');\n\t\tRender::Singleton()->render_html(Content::Singleton()->build());\n\t}", "function form_init_elements()\r\n {\r\n $this->add_hidden_element(\"swimmeetid\") ;\r\n\r\n // This is used to remember the action\r\n // which originated from the GUIDataList.\r\n \r\n $this->add_hidden_element(\"_action\") ;\r\n }", "public function init() {\n $menu = \"<li><a href=\\\" /eu-type-acteur/new \\\">Nouveau</a></li>\";\n $this->view->placeholder(\"menu\")->set($menu);\n $this->view->jQuery()->enable();\n $this->view->jQuery()->uiEnable(); \n }", "public function init() {\n $this->view->jQuery()->enable();\n $this->view->jQuery()->uiEnable();\n $auth = Zend_Auth::getInstance()->setStorage(new Zend_Auth_Storage_Session('admin'));\n $user = $auth->getIdentity();\n $menu = '';\n if ($user->code_groupe == 'nn_tegcp_pbf') {\n $menu = '<li><a href=\"/eu-echange/escompte\">Escompte</a></li>';\n $this->view->placeholder(\"menu\")->set($menu);\n }\n }", "public function init() {\n $auth = Zend_Auth::getInstance()->setStorage(new Zend_Auth_Storage_Session('admin'));\n $user = $auth->getIdentity();\n if ($user->code_groupe == 'admin' || $user->code_groupe == 'acteur') {\n $menu = '<li><a id=\"new\" href=\"/eu-acteur/new\">Nouveau</a></li>\n <li><a id=\"detail\" href=\"/eu-acteur/index\">Listes des acteurs</a></li>';\n }\n $this->view->placeholder(\"menu\")->set($menu);\n $this->view->jQuery()->enable();\n $this->view->jQuery()->uiEnable();\n }", "public function ee_breakouts_page_load() {}", "public function onRun()\n {\n $this->page['visible'] = $this->property('visible');\n $this->page['button'] = $this->property('button');\n }", "protected function OnCreateElements() {}", "protected function OnCreateElements() {}", "public function init() {\n $this->view->jQuery()->enable();\n $this->view->jQuery()->uiEnable();\n $auth = Zend_Auth::getInstance()->setStorage(new Zend_Auth_Storage_Session('admin'));\n $user = $auth->getIdentity();\n $group = $user->code_groupe;\n if ($group == 'mf' || $group == 'mf_bank') {\n $menu = \"<li><a href=\\\"/eu-reglement-mf11000/reglement\\\">Règlement</a></li>\" .\n \"<li><a href=\\\"/eu-reglement-mf11000/listreglt\\\">Liste des règlements</a></li>\" .\n \"<li><a href=\\\"/eu-reglement-mf11000/detail\\\">Détails</a></li>\";\n }\n $this->view->placeholder(\"menu\")->set($menu);\n }", "public function load() {\n\t\t$this -> template = TemplateManager::load(\"ForumPreference\");\n\t\t$this -> template -> insert(\"profileImage\", $this -> user -> getProfileImage());\n\t\t$this -> template -> insert(\"signature\", $this -> user -> getSignature());\n\t\t$this -> display();\n\t}", "public function execute(){\n $this->html( 'headelement' );\n ?>\n <!-- jQuery -->\n <script type=\"text/javascript\" src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js\"></script>\n \n <!-- Bootstrap -->\n <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\" integrity=\"sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u\" crossorigin=\"anonymous\">\n <script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js\" integrity=\"sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa\" crossorigin=\"anonymous\"></script>\n <!-- Optional theme <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css\" integrity=\"sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp\" crossorigin=\"anonymous\"> -->\n\n <!-- Web Fonts -->\n <link href=\"https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css\" rel=\"stylesheet\">\n <link href=\"https://fonts.googleapis.com/css?family=Oxygen|Ubuntu:300\" rel=\"stylesheet\">\n\n <!-- OpenEI Skin Header -->\n <nav class=\"navbar navbar-default navbar-static-top\">\n <div class=\"container-fluid\">\n <!-- Brand and toggle grouped for better mobile display -->\n <div class=\"navbar-header\">\n <a class=\"navbar-brand\" href=\"<?php echo $this->data['nav_urls']['mainpage']['href']; ?>\" aria-label=\"Main Page Link\">\n <!--<img class=\"have2x\" src=\"<?php echo $this->get('logopath'); ?>\" alt=\"OpenEI: Energy Information\">-->\n <object alt=\"OpenEI: Energy Information\" height=\"52\" width=\"165\" type=\"image/svg+xml\" data=\"/w/skins/OpenEI/images/openei_logo.svg\" style=\"pointer-events: none;\"></object>\n </a>\n <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#oeiNavbarCollpase\" aria-expanded=\"false\">\n <span class=\"sr-only\">Toggle navigation</span>\n <!--<i id=\"menu-open\" class=\"fa fa-bars\" aria-hidden=\"true\"></i>\n <i id=\"menu-close\" class=\"fa fa-times\" aria-hidden=\"true\"></i>-->\n <span class=\"icon-bar top-bar\"></span>\n <span class=\"icon-bar middle-bar\"></span>\n <span class=\"icon-bar bottom-bar\"></span>\n </button>\n </div>\n <!-- Collect the nav links, forms, and other content for toggling -->\n <div class=\"collapse navbar-collapse\" id=\"oeiNavbarCollpase\">\n <ul class=\"nav navbar-nav primary-nav\">\n <li><a href=\"/wiki/Information\">Information</a></li>\n <li><a href=\"/wiki/Data\">Data</a></li>\n <li><a href=\"/wiki/Apps\">Apps</a></li>\n <!-- concept for apps dropdown menu\n <li class=\"dropdown\">\n <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">Apps <span class=\"caret\"></span></a>\n <ul class=\"dropdown-menu\">\n <li><a href=\"/wiki/RAPID/\">RAPID</a></li>\n <li role=\"separator\" class=\"divider\"></li>\n <li><a href=\"<?php echo $this->openEIUrl('gdr'); ?>\">GDR</a></li>\n <li><a href=\"<?php echo $this->openEIUrl('mhkdr'); ?>\">MHKDR</a></li>\n <li><a href=\"<?php echo $this->openEIUrl().'/apps/URDB/'; ?>\">URDB</a></li>\n </ul>\n </li>-->\n </ul>\n\n <!-- User Menu -->\n <ul class=\"nav navbar-nav navbar-right openei-user\">\n <li class=\"dropdown user-menu\">\n <a href=\"my user page\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">\n <?php echo $this->userIconType(); ?>\n </a>\n <ul class=\"dropdown-menu\">\n <?php echo $this->userDisplay(); ?>\n <?php echo $this->getUserLinks(); ?>\n </ul>\n </li>\n </ul>\n\n <!-- Print PDF Button -->\n <div id=\"printPDFButton\" style=\"display:none;\">\n <div class=\"print\">\n <i class=\"fa fa-print\"></i>\n </div>\n </div>\n\n <!-- OpenEI Search form -->\n <form class=\"navbar-form navbar-right openei-search\" action=\"/search/\" method=\"get\" name=\"openei-search\">\n <div class=\"form-group\">\n <label class=\"sr-only\" for=\"oeiSearchQuery\">Search open E I</label>\n <input type=\"text\" name=\"q\" id=\"oeiSearchQuery\" class=\"form-control\" placeholder=\"Search\">\n <button type=\"submit\" class=\"btn btn-default btn-search\" value=\"Search\" aria-label=\"Search\"><i class=\"fa fa-search\" aria-hidden=\"true\"></i></button>\n </div>\n </form>\n\n <?php\n if ($this->data['notspecialpage']){\n ?>\n\n <!-- Wiki Actions Menu -->\n <div id=\"pageLinks\" class=\"btn-group <?php echo $this->noAction(); ?>\">\n <button type=\"button\" class=\"btn btn-default dropdown-toggle wiki-actions-menu\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" aria-label=\"Menu\">\n <i class=\"fa fa-ellipsis-v\" aria-hidden=\"true\"></i>\n </button>\n <div class=\"shadow\"></div>\n <ul class=\"dropdown-menu dropdown-menu-right\" role=\"navigation\">\n <?php echo $this->getPageLinks(); ?>\n </ul>\n </div>\n <?php\n } //endif notspecialpage\n ?>\n\n </div><!-- end .navbar-collapse -->\n </div><!-- end .container-fluid -->\n </nav><!-- end .navbar -->\n \n <!-- Build images -->\n <div id=\"background-canvas\">\n <?php\n $schema = (@$_SERVER[\"HTTPS\"] == \"on\") ? \"https://\" : \"http://\";\n $host = $_SERVER['SERVER_NAME'];\n $unsplash = glob('/var/www/wiki/skins/OpenEI/images/unsplash/backgrounds/*');\n $randomImage = substr($unsplash[rand(0, count($unsplash) - 1)], 43);\n echo '<div id=\"background-image\" class=\"fade-in\" alt=\"background images sourced from unsplash.com\" style=\"background-image: url('. $schema .''. $host .'/w/skins/OpenEI/images/unsplash/'. $randomImage . '); opacity: 0;\"></div>';\n ?>\n </div>\n \n <!-- Begin mediawiki body -->\n <div id=\"mw-wrapper\">\n <?php \n if ($this->data['notspecialpage']){\n ?>\n <!-- Wiki Actions Menu -->\n <!--<div id=\"pageLinks\" class=\"btn-group\">\n <button type=\"button\" class=\"btn btn-default dropdown-toggle wiki-actions-menu\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\" aria-label=\"Menu\">\n <i class=\"fa fa-ellipsis-v\" aria-hidden=\"true\"></i>\n </button>\n <div class=\"shadow\"></div>\n <ul class=\"dropdown-menu dropdown-menu-right\" role=\"navigation\">\n <?php echo $this->getPageLinks(); ?>\n </ul>\n </div>-->\n <?php \n } //endif notspecialpage\n ?>\n \n <div class=\"mw-body\" role=\"main\">\n <a name=\"top\" id=\"top\"></a>\n <div id=\"siteNotice\"><?php echo $this->get('sitenotice'); ?></div>\n <div id=\"wikiIndicators\"><?php echo $this->getIndicators(); ?></div>\n \n <h1 class=\"firstHeading\" lang=\"<?php echo $this->get('pageLanguage'); ?>\"><?php echo $this->get('title'); ?></h1>\n \n <div id=\"siteSub\"><?php echo $this->getMsg( 'tagline' )->parse(); ?></div>\n\n <div class=\"mw-body-content\">\n <div id=\"contentSub\">\n <?php \n if ($this->data['subtitle']){\n echo '<p class=\"wiki-subtitle\">' . $this->get('subtitle') . '</p>'.\"\\n\";\n }\n ?>\n <p><?php echo $this->get('undelete'); ?></p>\n </div>\n <?php\n //body content\n $this->html('bodycontent');\n // include $this->getSkin()->skinname.'/templates/feedback_form.html'; //ported from old skin\n $this->clear();\n ?>\n <div class=\"printfooter\">\n <?php echo $this->get('printfooter'); ?>\n </div>\n <div class=\"noprintpdf\">\n <?php\n $this->html( 'catlinks' );\n $this->html( 'dataAfterContent' );\n ?> \n </div>\n \n </div>\n </div>\n\n <div id=\"mw-footer\">\n <!-- //Add feedback mechanism -->\n <div id=\"feedbackBtn\">\n <span class=\"glyphicon glyphicon-comment\" aria-hidden=\"true\"></span>\n </div>\n <div class=\"special-links noprintpdf\">\n <?php \n /*deprecated??\n $this->footerSpecialBox();*/\n ?>\n </div>\n \n <!-- Contents configured by MediaWiki:SideBar -->\n <div class=\"footers-nav-links\"><?php echo $this->getFooterNavLinks(); ?></div>\n \n <!-- ESI code to pull the footer in from Varnish -->\n <esi:include src=\"/esi/footer.php?v=latest\" />\n \n <?php \n /* Google Translate\n echo \"<script>\n function googleTranslateElementInit() {\n new google.translate.TranslateElement({\n pageLanguage: 'en',\n multilanguagePage: true,\n gaTrack: true,\n gaId: '\" . $this->googleAnalyticsAccount() . \"'\n });\n }\n </script>\n <script src=\\\"//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit\\\"></script>\";\n */\n $this->googleAnalyticsCode();\n ?>\n \n <?php\n \n foreach ( $this->getFooterLinks() as $category => $links ) {\n echo Html::openElement(\n 'ul',\n array(\n 'id' => 'footer-' . Sanitizer::escapeId( $category ),\n 'role' => 'contentinfo'\n )\n );\n foreach ( $links as $key ) {\n echo Html::rawElement(\n 'li',\n array(\n 'id' => 'footer-' . Sanitizer::escapeId( $category . '-' . $key )\n ),\n $this->get( $key )\n );\n }\n echo Html::closeElement( 'ul' );\n }\n $this->clear();\n \n ?>\n \n </div> <!-- end footer -->\n \n </div><!-- end mw-wrapper -->\n\n <?php $this->printTrail(); ?>\n </body>\n </html>\n\n <?php\n }", "public function productcompareaddAction() {\n // neu chua khoi tao\n // neu roi add them 1 phan tu vao sesion voi id va uenc da duoc tao\n $this->layout('layout/bags');\n $getuser = $this->forward()->dispatch('Admin\\Controller\\Index', array(\n 'action' => 'getuser'\n ));\n // var_dump($getuser);\n $this->layout()->getuser = $getuser;\n\n $id = $this->params()->fromRoute('id');\n $uenc = $this->params()->fromRoute('uenc');\n\n echo \"id :\";\n var_dump($id);\n echo \"</br>\";\n echo \"uenc :\";\n var_dump($uenc);\n }", "public function event()\n\t{\n\t\tif (defined('ADMIN_THEME'))\n\t\t{\n\t\t\t$this->CI->type->add_misc($this->CI->type->load_view('codemirror', 'codemirror_admin', null));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->CI->type->add_misc($this->CI->type->load_view('codemirror', 'codemirror_entry_form', null));\n\t\t}\n\t}", "public function uwaAction()\n {\n $this->load();\n }", "public function init() {\n $menu = \"<li><a href=\\\" /eu-zone/new \\\">Ajouter zone</a></li>\";\n $this->view->placeholder(\"menu\")->set($menu);\n $this->view->jQuery()->enable();\n $this->view->jQuery()->uiEnable();\n }", "protected function action()\n {\n switch($this->action)\n {\n case 'load':\n $this->load();\n break;\n }\n }", "public function init(){\r\n\t\t$this->_data = $this->_request->getParams();\r\n $controller = $this->_data['controller']; //Get controller\r\n $action = $this->_data['action']; //Get action\r\n \r\n $loadfunction = new Default_Model_Common();\r\n foreach($loadfunction->loadFunction($controller) as $value){\r\n if($action == $value['action']){\r\n $load = new $value['model_load']();\r\n $this->view->$value['varname'] = $load->$value['function_load']();\r\n }\r\n }\r\n\r\n $this->view->lang = Zend_Registry::get(\"lang\"); //load language\r\n \r\n //List menu\r\n $listmenu = Zend_Registry::get(\"listmenu\");\r\n $this->view->listmenu = $listmenu;\r\n \r\n $this->view->selectaccount = ' class=\"selected\"';\r\n }", "public function selectAction()\n {\n $this->loadLayout();\n $this->renderLayout();\n }", "public function getShowElement() {}", "public function loadForView();", "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}", "public function myaction()\n {\n $this->viewBuilder()->disableAutoLayout();\n $this->viewBuilder()->setTemplate('take_action');\n }", "function form_init_data()\r\n {\r\n $this->set_element_value(\"Swimmers\", FT_CREATE) ;\r\n $this->set_element_value(\"Swim Meets\", FT_CREATE) ;\r\n $this->set_element_value(\"Swim Teams\", FT_CREATE) ;\r\n }", "public function showUserEvent()\n {\n switch($this->logo){\n case 'default':\n $logo = '<img src=\"public/img/default/event.png\" alt=\"WorldEsport logo\">';\n break;\n default:\n $logo = '<img src=\"inc/img/imgempevents.php?imgname='. $this->logo .'&u='. $this->userToDisplay->pk_iduser .'\" alt=\"WorldEsport employee events logo\">';\n }\n\n //test de la presence de description ou non\n switch($this->description){\n case true:\n $description = '<div class=\"info-line collapse\" id=\"collapse'. substr(str_replace($this->unauthorizedChar,'',$this->name),0,15) . str_replace($this->unauthorizedChar,'',$this->startdate) .'\">\n <p class=\"info-decription\">' . $this->description . '</p>\n </div>';\n $btcollapse = '<div class=\"bt-more-container\">\n <button class=\"share-button bt\" data-toggle=\"collapse\" href=\"#collapse'. substr(str_replace($this->unauthorizedChar,'',$this->name),0,15) . str_replace($this->unauthorizedChar,'',$this->startdate) .'\">\n '. $this->langFile[$this->pageName]->bt_myprofile_gamer_moredetails .'\n </button>\n </div>';\n break;\n default:\n $description = '<div class=\"info-line collapse\">\n <p class=\"info-decription\">' . $this->description . '</p>\n </div>';\n $btcollapse = '';\n }\n\n $content = ' <div class=\"profile-elem profil-event-container col-md-12\" data-elem=\"'.$this->id.'\">\n <div class=\"profile-aside-container\"> \n <div class=\"profile-bloc-elem-left col-md-9\">\n <div class=\"infos-container col-md-12\">\n <div class=\"info-line\">\n <p class=\"info\">'. $this->name .'</p>\n </div>\n <div class=\"info-line\">\n <p class=\"info\">'. $this->jobtitle .' '. $this->langGenerals->word_at .' </p><p class=\"info\">'. $this->company .'</p>\n </div> \n <div class=\"info-line\">\n <p class=\"info\">' . $this->dayStart . ' ' . $this->monthStart . ' ' . $this->yearStart . ' - </p><p class=\"info\">' . $this->dayEnd . ' ' . $this->monthEnd . ' ' . $this->yearEnd . '</p>\n </div>\n '. $description .' \n </div> \n '. $btcollapse .' \n </div> \n <div class=\"profile-bloc-elem-right col-md-3\">\n <div class=\"pic\">\n '. $logo .'\n </div>\n </div>\n </div> \n </div>';\n\n return $content;\n }", "public function load_edit() {\n\t\t$screen = get_current_screen();\n\n\t\tif ( !empty( $screen->post_type ) && 'knowledgebase_item' === $screen->post_type ) {\n\t\t\tadd_filter( 'request', array( $this, 'request' ) );\n\t\t\tadd_action( 'restrict_manage_posts', array( $this, 'tags_dropdown' ) );\n\t\t\tadd_action( 'admin_head', array( $this, 'print_styles' ) );\n\t\t}\n\t}", "public function actionGiftLoading()\n {\n //exit;\n $this->render(\"giftloading\",array('id_user_gift'=>$_REQUEST['id_user_gift']));\n\n }", "protected function loadView()\n {\n }", "protected function loadView()\n {\n }", "function form_init_elements() \r\n {\r\n //we want an confirmation page for this form.\r\n //$this->set_confirm();\r\n\r\n //Crea una caja de texto llamada nombre y longitud 50\r\n $elemT = new FEText(\"Asunto\", FALSE, 50);\r\n //$elemT->set_style_attribute('align', 'right');\r\n //Le asignamos el id nombre y la tecla de acceso n (ctrl+n)\r\n $elemT->set_attribute(\"id\",\"asunto\");\r\n $elemT->set_attribute(\"accesskey\",\"n\"); \r\n //Añade en el contenedor formulario el elemento creado e inicializado\r\n $this->add_element($elemT);\r\n\t\r\n //Creamos un Area de Texto llamada comentario\r\n $elemTA = new FETextArea(\"Comentario\", FALSE, 10, 60,\"500px\", \"100px\");\r\n $elemTA->set_attribute('wrap', 'physical');\r\n //Le asignamos el id email y la tecla de acceso c (ctrl+c) \r\n $elemTA->set_attribute(\"id\",\"comentario\");\r\n $elemTA->set_attribute(\"accesskey\",\"d\");\r\n //Añade en el contenedor formulario el elemento creado e inicializado\r\n $this->add_element($elemTA);\r\n\r\n //Añade un campo oculto llamado id. En ocasiones este campo se utiliza para indicar ciertas operaciones.\r\n //OJO!! es un punto sensible porque el usuario podría cambiar su valor de forma inexperada para el código.\r\n// $this->add_hidden_element(\"id\");\r\n\r\n //Añade un boton con la acción submit\r\n $submit = $this->_formatElem(\"base_SubmitButton\", \"Aceptar\", \"submit\", agt(\"miguel_Enter\"));\r\n //$submit->set_attribute('id',''); \r\n $submit->set_attribute('accesskey','e'); \r\n $this->add_element($submit); \r\n\t\t\t\t\r\n\t\t\t\t$this->add_hidden_element('status');\r\n \t\t$this->set_hidden_element_value('status', 'new');\r\n }", "public function html_menu_opciones($o_filtro){\n switch ($o_filtro) {\n case '1':\n $mod=$this->model_configuracion->get_modulos(1);\n $enlace = '\n <div class=\"col-xs-12 col-sm-6 col-md-6 col-lg-3\">\n <a href=\"'.base_url().'index.php/me/mis_ogestion\" id=\"myBtn\" onclick=\"pei()\" class=\"jarvismetro-tile big-cubes bg-color-greenLight\">\n <div class=\"well1\" align=\"center\">\n <img class=\"img-circle\" src=\"'.base_url().'assets/img/proyectos.png\" style=\"margin-left:0px; width: 95px\"/>\n <h1 style=\"font-size: 11px;\">'.$mod[0]['mod_descripcion'].'</h1>\n </div>\n </a>\n </div>';\n ?>\n <script>\n function pei(){\n document.getElementById(\"load\").style.display = \"block\";\n }\n </script>\n <?php\n break;\n case '2':\n $mod=$this->model_configuracion->get_modulos(2);\n $enlace = '\n <div class=\"col-xs-12 col-sm-6 col-md-6 col-lg-3\">\n <a href=\"'.base_url().'index.php/admin/proy/list_proy\" id=\"myBtn2\" onclick=\"programacion()\" class=\"jarvismetro-tile big-cubes bg-color-greenLight\">\n <div class=\"well1\" align=\"center\">\n <img class=\"img-circle\" src=\"'.base_url().'assets/img/programacion.png\" style=\"margin-left:0px; width: 95px\"/>\n <h1 style=\"font-size: 11px;\">'.$mod[0]['mod_descripcion'].'</h1>\n </div>\n </a>\n </div>';\n ?>\n <script>\n function programacion(){\n document.getElementById(\"load\").style.display = \"block\";\n }\n </script>\n <?php\n break;\n case '3':\n $mod=$this->model_configuracion->get_modulos(3);\n $enlace = '\n <div class=\"col-xs-12 col-sm-6 col-md-6 col-lg-3\">\n <a href=\"'.base_url().'index.php/mod/list_top\" id=\"myBtn3\" onclick=\"modificacion()\" class=\"jarvismetro-tile big-cubes bg-color-greenLight\">\n <div class=\"well1\" align=\"center\">\n <img class=\"img-circle\" src=\"'.base_url().'assets/img/registro1.png\" style=\"margin-left:0px; width: 95px\"/>\n <h1 style=\"font-size: 11px;\">'.$mod[0]['mod_descripcion'].'</h1>\n </div>\n </a>\n </div>';\n ?>\n <script>\n function modificacion(){\n document.getElementById(\"load\").style.display = \"block\";\n }\n </script>\n <?php\n break;\n case '4':\n $mod=$this->model_configuracion->get_modulos(4);\n $enlace = '\n <div class=\"col-xs-12 col-sm-6 col-md-6 col-lg-3\">\n <a href=\"'.base_url().'index.php/eval/mis_operaciones\" id=\"myBtn3\" onclick=\"evaluacion()\" class=\"jarvismetro-tile big-cubes bg-color-greenLight\">\n <div class=\"well1\" align=\"center\">\n <img class=\"img-circle\" src=\"'.base_url().'assets/img/trabajo_social.png\" style=\"margin-left:0px; width: 95px\"/>\n <h1 style=\"font-size: 11px;\">'.$mod[0]['mod_descripcion'].'</h1>\n </div>\n </a>\n </div>';\n ?>\n <script>\n function evaluacion(){\n document.getElementById(\"load\").style.display = \"block\";\n }\n </script>\n <?php\n break;\n case '7':\n $mod=$this->model_configuracion->get_modulos(7);\n $enlace = '\n <div class=\"col-xs-12 col-sm-6 col-md-6 col-lg-3\">\n <a href=\"'.base_url().'index.php/rep/list_operaciones_req\" id=\"myBtn6\" onclick=\"reporte()\" class=\"jarvismetro-tile big-cubes bg-color-greenLight\">\n <div class=\"well1\" align=\"center\">\n <img class=\"img-circle\" src=\"'.base_url().'assets/img/impresora.png\" style=\"margin-left:0px; width: 95px\"/>\n <h1 style=\"font-size: 11px;\">'.$mod[0]['mod_descripcion'].'</h1>\n </div>\n </a>\n </div>';\n ?>\n <script>\n function reporte(){\n document.getElementById(\"load\").style.display = \"block\";\n }\n </script>\n <?php\n break;\n case '10':\n $enlace = '\n <div class=\"col-xs-12 col-sm-6 col-md-6 col-lg-3\">\n <a href=\"'.base_url().'index.php/admin/dm/8/\" onclick=\"reporte_internos()\" class=\"jarvismetro-tile big-cubes bg-color-greenLight\">\n <div class=\"well1\" align=\"center\">\n <img class=\"img-circle\" src=\"'.base_url().'assets/img/calidad.png\" style=\"margin-left:0px; width: 95px\"/>\n <h1 style=\"font-size: 11px;\">CONTROL DE CALIDAD</h1>\n </div>\n </a>\n </div>';\n ?>\n <script>\n function reporte_internos(){\n document.getElementById(\"load\").style.display = \"block\";\n }\n </script>\n <?php\n break;\n case '9':\n $mod=$this->model_configuracion->get_modulos(9);\n $enlace = '\n <div class=\"col-xs-12 col-sm-6 col-md-6 col-lg-3\">\n <a href=\"'.base_url().'index.php/admin/dm/9/\" onclick=\"mantenimiento()\" class=\"jarvismetro-tile big-cubes bg-color-greenLight\">\n <div class=\"well1\" align=\"center\">\n <img class=\"img-circle\" src=\"'.base_url().'assets/img/mantenimiento1.png\" style=\"margin-left:0px; width: 95px\"/>\n <h1 style=\"font-size: 11px;\">'.$mod[0]['mod_descripcion'].'</h1>\n </div>\n </a>\n </div>';\n ?>\n <script>\n function mantenimiento(){\n document.getElementById(\"load\").style.display = \"block\";\n }\n </script>\n <?php\n break;\n default:\n $enlace = '';\n break;\n }\n return $enlace;\n }", "public function loadElements()\n {\n $objName = $this->addTextField(ItemDB::COL_NAME, _ITEM_NAME);\n $objName->setPlaceholder( _ITEM_NAME);\n $objName->setRequired(true);\n\n $objDesc = $this->addTextArea(ItemDB::COL_DESC, _ITEM_DESCRIPTION, 255);\n $objDesc->setPlaceholder(_ITEM_DESCRIPTION);\n\n $this->addHiddenField(ItemDB::COL_FEST_ID);\n\n $this->addButtonSubmit();\n $this->addButtonReset();\n $this->addButtonCancel();\n }", "function popup_elements()\n\t\t{\n\t\t\t\n\t\t}", "private function init_menu()\n {\n // it's a sample code you can init some other part of your page\n }", "public function load() {\n\t\t$this->init();\n\t\t$action = $this->action;\n\t\t$view = $this->$action();\n\n\t\tif ($view instanceof View && !$this->app->isErrorPage()):\n\t\t\t$this->app->view = $view;\n\t\tendif;\n\n\t\t$this->app->view->mergeData($this->data);\n\t\t$this->app->view->validate();\n\t}", "function before_render_tealium_html() {\r\n \r\n }", "public function show()\n {\n $title= 'Gestion De Usuarios';\n $moduloJs = '<script src=\"assets/js/modulos/users/users.js\" type=\"module\"></script>';\n require_once 'views/administrador/usuarios.php';\n \n }", "public function opcion(){\n\t\t$data = new stdClass();\n\t\t$data->title = \"MANNA - La Provisión que cambiará tu vida\";\n\t\t$data->contenido = \"apl/auth/opcion\"; //aqui es la dirección física del controlador\n\t\t$data->panel_title = \"Afiliación de aliados comerciales - Página 1 de 3\";\n\t\t$data->active = \"registro\";\n\t\t$this->load->view('menu',$data);\n\t}", "function account_panel()\n {\n // Tai cac file thanh phan\n $this->load->helper('user');\n $this->load->model('user_model');\n\n // Bien luu thong tin user da dang nhap hay chua\n $is_login = user_is_login();\n $this->data['is_login'] = $is_login;\n\n // Tao cac lien ket\n $user = user_get_account_info();\n $user = user_add_info($user);\n $user = site_create_url('account', $user);\n $user = UserFactory::auth()->user($user);\n // Luu cac bien gui den view\n $this->data['user'] = $user;\n $this->data['action_login'] = site_url('user/login') . '?fast=true';\n\n // Hien thi view\n $this->load->view('tpl::_widget/user/panel', $this->data);\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}", "function load_sailthru_admin_display() {\n\n\t\t$active_tab = empty( $this->views[ current_filter() ] ) ? '' : $this->views[ current_filter() ];\n\t\t// display html\n\t\tinclude SAILTHRU_PLUGIN_PATH . 'views/admin.php';\n\n\t}", "public function default($name_of_page,$action){\r\n\r\n self::get_view($name_of_page,$action);// this function (get_view) talk this parameter and using it to call it in the browser to get main_view page\r\n }", "public function showEvent()\n {\n switch($this->logo){\n case 'default':\n $logo = '<img src=\"public/img/default/event.png\" alt=\"WorldEsport logo\">';\n break;\n default:\n $logo = '<img src=\"inc/img/imgempevents.php?imgname='. $this->logo .'&u='. $this->currentUser->pk_iduser .'\" alt=\"WorldEsport employee events logo\">';\n }\n\n //test de la presence de description ou non\n switch($this->description){\n case true:\n $description = '<div class=\"info-line collapse\" id=\"collapse'. substr(str_replace($this->unauthorizedChar,'',$this->name),0,15) . str_replace($this->unauthorizedChar,'',$this->startdate) .'\">\n <p class=\"info-decription\">' . $this->description . '</p>\n </div>';\n $btcollapse = '<div class=\"bt-more-container\">\n <button class=\"share-button bt\" data-toggle=\"collapse\" href=\"#collapse'. substr(str_replace($this->unauthorizedChar,'',$this->name),0,15) . str_replace($this->unauthorizedChar,'',$this->startdate) .'\">\n '. $this->langFile[$this->pageName]->bt_myprofile_gamer_moredetails .'\n </button>\n </div>';\n break;\n default:\n $description = '<div class=\"info-line collapse\">\n <p class=\"info-decription\">' . $this->description . '</p>\n </div>';\n $btcollapse = '';\n }\n\n $content = ' <div class=\"profile-elem profil-event-container col-md-12\" data-elem=\"'.$this->id.'\">\n <div class=\"profile-aside-container\">\n <div class=\"loader-container loader-elem-bloc loader-profile-elem\">\n <div class=\"loader-double-container\">\n <span class=\"loader loader-double\">\n </span>\n </div>\n </div>\n <div class=\"edit-container\">\n <div class=\"edit-ico-container\">\n <div class=\"edit-gear edit-profile-bloc-elem ico-gear\"></div> \n </div>\n <div class=\"edit-options\">\n \n </div>\n </div>\n <div class=\"profile-bloc-elem-left col-md-9\">\n <div class=\"infos-container col-md-12\">\n <div class=\"info-line\">\n <p class=\"info\">'. $this->name .'</p>\n </div>\n <div class=\"info-line\">\n <p class=\"info\">'. $this->jobtitle .' '. $this->langGenerals->word_at .' </p><p class=\"info\">'. $this->company .'</p>\n </div> \n <div class=\"info-line\">\n <p class=\"info\">' . $this->dayStart . ' ' . $this->monthStart . ' ' . $this->yearStart . ' - </p><p class=\"info\">' . $this->dayEnd . ' ' . $this->monthEnd . ' ' . $this->yearEnd . '</p>\n </div>\n '. $description .' \n </div> \n '. $btcollapse .' \n </div> \n <div class=\"profile-bloc-elem-right col-md-3\">\n <div class=\"pic\">\n '. $logo .'\n </div>\n </div>\n </div> \n </div>';\n\n return $content;\n }", "function beforeRender(){\n\t\t $this->set('currentAdmin', $this->Auth->user());\n\t\t\t$this->set('cssName',$this->Cookie->read('css_name'));\n\t\t\t$this->set('groupDetail',$this->common->adminDetails());\n\t\t\t$this->set('common',$this->common);\n\t\t\t$this->set('offerhtml',$this->offerhtml);\n\t }", "public function homePage() {\n #$this->view->loadTemplate( 'elements_example');\n $this->view->loadTemplate( LNG . '/centercontent');\n $this->commitReplace($this->view->render(), '#two', true);\n }", "public function action_init()\n\t{\n\t\t$this->add_template( 'menus_admin', dirname( __FILE__ ) . '/menus_admin.php' );\n\t\t$this->add_template( 'menu_iframe', dirname( __FILE__ ) . '/menu_iframe.php' );\n\t\t$this->add_template( 'block.menu', dirname( __FILE__ ) . '/block.menu.php' );\n\n\t\t// formcontrol for tokens\n\t\t$this->add_template( 'text_tokens', dirname( __FILE__ ) . '/formcontrol_tokens.php' );\n\t}", "function titel_show()\n{\n global $tpl;\n global $db;\n $sFormTitle = \"Gebruiker beheer\";\n\n//-------------------------------\n// titel Open Event begin\n// titel Open Event end\n//-------------------------------\n\n//-------------------------------\n// Set URLs\n//-------------------------------\n//-------------------------------\n// titel Show begin\n//-------------------------------\n\n $tpl->set_var(\"FormTitle\", $sFormTitle);\n\n//-------------------------------\n// titel BeforeShow Event begin\n// titel BeforeShow Event end\n//-------------------------------\n\n//-------------------------------\n// Show fields\n//-------------------------------\n $tpl->parse(\"Formtitel\", false);\n\n//-------------------------------\n// titel Show end\n//-------------------------------\n}", "public function onLoad() {\n \n }", "public function pagePresentation()\r\n\t{\r\n\t\t// Donnees\r\n\t\t$eventId = Bn::getValue('event_id');\r\n\t\t$oEvent = new Oevent($eventId);\r\n\t\t$oEventmeta = new Oeventmeta($eventId);\r\n\r\n\t\t// Controle de l'autorisation\r\n\t\tif ( $oEvent->getVal('ownerid') != Bn::getValue('user_id') && !Oaccount::isLoginAdmin() ) return false;\r\n\r\n\t\t// Preparer les champs de saisie\r\n\t\t$body = new Body();\r\n\r\n\t\t// Titres\r\n\t\t$t = $body->addP('', '', 'bn-title-2');\r\n\t\t$t->addBalise('span', '', LOC_ITEM_PRESENTATION);\r\n\r\n\t\t// Infos generales\r\n\t\t$form = $body->addForm('frmPresentation', BPREF_UPDATE_PRESENTATION, 'divPreferences_content');\r\n\t\t//$form->getForm()->addMetadata('success', \"updated\");\r\n\t\t//$form->getForm()->addMetadata('dataType', \"'json'\");\r\n\r\n\r\n\t\t$dl = $form->addDiv('', 'bn-div-left');\r\n\t\t$edt = $dl->addEditFile('poster', LOC_LABEL_EVENT_POSTER, '');\r\n\t\t$edt->noMandatory();\r\n\t\t$poster = $oEvent->getVal('poster');\r\n\t\tif (!empty($poster) )\r\n\t\t{\r\n\t\t\t$poster = '../img/poster/'.$poster;\r\n\t\t\t$form->addImage('poster', $poster, 'poster', array('height'=>70, 'width'=>155));\r\n\t\t}\r\n\r\n\t\t$d = $form->addDiv('', 'bn-div-line bn-div-clear');\r\n\t\t$handle=opendir('../skins');\r\n\t\twhile ($file = readdir($handle))\r\n\t\t{\r\n\t\t\tif ($file != \".\" && $file != \"..\" && $file != \"CVS\")\r\n\t\t\t$skins[$file] = $file;\r\n\t\t}\r\n\t\tclosedir($handle);\r\n\t\t$cbo = $form->addSelect('skin', LOC_LABEL_EVENT_SKIN);\r\n\t\t$cbo->addOptions($skins, $oEventmeta->getVal('skin'));\r\n\t\t$d->addBreak();\r\n\r\n\t\t$d = $form->addDiv('', 'bn-div-btn');\r\n\t\tif (!empty($poster) )\r\n\t\t{\r\n\t\t\t$d->addButton('btnDelposter', LOC_BTN_DELETE_POSTER, BPREF_DELETE_POSTER, 'trash', 'divPreferences_content');\r\n\t\t}\r\n\t\t$d->addButtonValid('btnValid', LOC_BTN_UPDATE);\r\n\r\n\t\t// Envoi au navigateur\r\n\t\t$body->display();\r\n\t\treturn false;\r\n\t}", "public function showAction() {}", "protected function after_load(){\n\n\n }", "public function afterFind() {\n // Icon, if patient didn't showed by doctor\n $this->print = '<a href=\"#\" title=\"Напечатать назначение\"><span class=\"glyphicon glyphicon-print\"></span></a>';\n $this->cancel = '<a href=\"#\" title=\"Отменить назначение\"><span class=\"glyphicon glyphicon-remove\"></span></a>';\n }", "public function setup_wizard_content() {\n\t\t\tisset( $this->steps[ $this->step ] ) ? call_user_func( $this->steps[ $this->step ]['view'] ) : false;\n\t\t}", "function titel_show()\n{\n global $tpl;\n global $db;\n $sFormTitle = \"Voorraadsysteem beheer\";\n\n//-------------------------------\n// titel Open Event begin\n// titel Open Event end\n//-------------------------------\n\n//-------------------------------\n// Set URLs\n//-------------------------------\n//-------------------------------\n// titel Show begin\n//-------------------------------\n\n $tpl->set_var(\"FormTitle\", $sFormTitle);\n\n//-------------------------------\n// titel BeforeShow Event begin\n// titel BeforeShow Event end\n//-------------------------------\n\n//-------------------------------\n// Show fields\n//-------------------------------\n $tpl->parse(\"Formtitel\", false);\n\n//-------------------------------\n// titel Show end\n//-------------------------------\n}", "function titel_show()\n{\n global $tpl;\n global $db;\n $sFormTitle = \"Nieuws beheer\";\n\n//-------------------------------\n// titel Open Event begin\n// titel Open Event end\n//-------------------------------\n\n//-------------------------------\n// Set URLs\n//-------------------------------\n//-------------------------------\n// titel Show begin\n//-------------------------------\n\n $tpl->set_var(\"FormTitle\", $sFormTitle);\n\n//-------------------------------\n// titel BeforeShow Event begin\n// titel BeforeShow Event end\n//-------------------------------\n\n//-------------------------------\n// Show fields\n//-------------------------------\n $tpl->parse(\"Formtitel\", false);\n\n//-------------------------------\n// titel Show end\n//-------------------------------\n}", "public function atmf_html_backend(){\n\n $template_loader = new Uou_Atmf_Load_Template();\n ob_start();\n $template = $template_loader->locate_template( 'popup.php' );\n\n if(is_user_logged_in() ){\n include( $template );\n }\n echo ob_get_clean();\n\n }", "function go()\n {\n $this->session->layout == 'gallery' ? \n $this->data['pagebody'] = 'Roster/rosterGal' : \n $this->data['pagebody'] = 'Roster/rosterTab'; \n $this->render();\n }", "function mepr_add_some_tabs($user)\n{\n $support_active = (isset($_GET['action']) && $_GET['action'] == 'membership-cards')?'mepr-active-nav-tab':''; ?>\n<span\n class=\"mepr-nav-item membership-cards <?php echo $support_active; ?>\">\n <a\n href=\"<?php echo MeprOptions::fetch()->account_page_url(); ?>?action=membership-cards\">Membership\n cards</a>\n</span>\n<?php\n}", "public function init_panel() {\n\t\t\tif ( ! empty( $this->omise_customer_id ) ) {\n\t\t\t\ttry {\n\t\t\t\t\t$viewData['existingCards'] = $this->customerCard->get($this->omise_customer_id);\n\t\t\t\t\t$viewData['cardFormTheme'] = $this->omiseCardGateway->get_option('card_form_theme');\n\t\t\t\t\t$viewData['secure_form_enabled'] = (boolean)$this->omiseCardGateway->get_option('secure_form_enabled');\n\t\t\t\t\t$viewData['formDesign'] = Omise_Page_Card_From_Customization::get_instance()->get_design_setting();\n\t\t\t\t\t$viewData['cardIcons'] = $this->omiseCardGateway->get_card_icons();\n\t\t\t\t\t$this->register_omise_my_account_scripts();\n\n\t\t\t\t\tOmise_Util::render_view( 'templates/myaccount/my-card.php', $viewData );\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t// nothing.\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function titel_show()\n{\n global $tpl;\n global $db;\n $sFormTitle = \"Brochure aanvraag beheer\";\n\n//-------------------------------\n// titel Open Event begin\n// titel Open Event end\n//-------------------------------\n\n//-------------------------------\n// Set URLs\n//-------------------------------\n//-------------------------------\n// titel Show begin\n//-------------------------------\n\n $tpl->set_var(\"FormTitle\", $sFormTitle);\n\n//-------------------------------\n// titel BeforeShow Event begin\n// titel BeforeShow Event end\n//-------------------------------\n\n//-------------------------------\n// Show fields\n//-------------------------------\n $tpl->parse(\"Formtitel\", false);\n\n//-------------------------------\n// titel Show end\n//-------------------------------\n}", "public function actionElements() {\n\t\t\\Yii::$app->view->title = 'ACA Reporting Service | Elements';\n\t\t$this->layout = 'main';\n\t\t\t$session = \\Yii::$app->session;\n\t\t$admin_permissions = $session ['admin_permissions'];\n\t\tif (\\Yii::$app->SessionCheck->isLogged () == true && in_array(\"9\", $admin_permissions)) \t\t// checking logged session\n\t\t{\n\t\t\t/*if(\\Yii::$app->Permission->CheckAdminactionpermission ( '9' ) == true)\n {*/\n\t\t\t\n\t\t\t$model_lookupoptions = new TblAcaLookupOptions ();\n\t\t\t\n\t\t\t$limit = $url = '';\n\t\t\t$filter ['filter_keyword'] = ''; // initialising filter for search\n\t\t\t\n\t\t\t$get = \\Yii::$app->request->get ();\n\t\t\t\n\t\t\tif (isset ( $get ['keyword'] ) && $get ['keyword'] != '') {\n\t\t\t\t$encrypt_component = new EncryptDecryptComponent (); // decrypting the id\n\t\t\t\t$id = $encrypt_component->decryptUser ( $get ['keyword'] );\n\t\t\t\t$get ['keyword'] = $id;\n\t\t\t\t$filter ['filter_keyword'] = $get ['keyword'];\n\t\t\t\t\n\t\t\t\t$filter_elements = $get ['keyword'];\n\t\t\t\t$url .= '&keyword=' . $get ['keyword'];\n\t\t\t} else {\n\t\t\t\t$filter_elements = '';\n\t\t\t\t$url .= '&keyword=' . '';\n\t\t\t}\n\t\t\t\n\t\t\t$model_acaelements = TblAcaElementMaster::Elementalldetails ( $filter_elements ); // retriving values for grid\n\t\t\t\n\t\t\treturn $this->render ( 'element', [ // render values to element view page\n\t\t\t\t\t'model' => $model_acaelements,\n\t\t\t\t\t'model_lookupoptions' => $model_lookupoptions \n\t\t\t] );\n\t\t\t\n\t\t/*\t}else{\n\t\t\t\t\t\\Yii::$app->session->setFlash ( 'error', 'Permission denied' );\n\t\t\t\t\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t\t\t'/admin' \n\t\t\t\t\t\t\t) ); \n\t\t\t\t }*/\n\t\t} else {\n\t\t\t\\Yii::$app->SessionCheck->adminlogout (); // Redirecting to login page if session destroyed\n\t\t\t\n\t\t\treturn $this->goHome ();\n\t\t}\n\t}", "public function executeIndex()\n {\n sfConfig::set('config_menu','active');\n if (!$this->getUser()->hasAttribute('page', 'tv_admin/role'))\n $this->getUser()->setAttribute('page', 1, 'tv_admin/role');\n }", "public function initializeAction() {\n parent::initializeAction();\n $this->umDiv = new Tx_Magenerator_Domain_UserManagement_Div();\n }", "function vc_before_init_actions() {\n \t require_once( get_template_directory().'/vc-elements/my-first-custom-element.php' );\n require_once( get_template_directory().'/vc-elements/progressbar0.php' );\n\t require_once( get_template_directory().'/vc-elements/card-counter-card.php' );\t \n\t require_once( get_template_directory().'/vc-elements/Services.php' );\t\n require_once( get_template_directory().'/vc-elements/Carousel-Side-Caption.php' );\n\t require_once( get_template_directory().'/vc-elements/InteractiveSVG.php' );\n\t require_once( get_template_directory().'/vc-elements/piechart.php' );\n\t require_once( get_template_directory().'/vc-elements/OurServices.php' );\n\t require_once( get_template_directory().'/vc-elements/Timeline66.php' );\n\t require_once( get_template_directory().'/vc-elements/ServiceBox76.php' );\n\t require_once( get_template_directory().'/vc-elements/project.php' );\n\t require_once( get_template_directory().'/vc-elements/project1.php' );\n\t }", "function popup_elements()\n {\n $this->elements = [\n [\n \"type\" => \"tab_container\",\n 'nodescription' => true,\n ],\n\n [\n \"type\" => \"tab\",\n \"name\" => __(\"Content\", 'avia_framework'),\n 'nodescription' => true,\n ],\n\n [\n \"name\" => __(\"Button Label\", 'avia_framework'),\n \"desc\" => __(\"This is the text that appears on your button.\", 'avia_framework'),\n \"id\" => \"label\",\n \"type\" => \"input\",\n \"std\" => __(\"Download\", 'avia_framework'),\n ],\n [\n \"name\" => __(\"Button Link?\", 'avia_framework'),\n \"desc\" => __(\"Where should your button link to?\", 'avia_framework'),\n \"id\" => \"link\",\n \"type\" => \"linkpicker\",\n \"fetchTMPL\" => true,\n \"subtype\" => [\n __('Set Manually', 'avia_framework') => 'manually',\n __('Single Entry', 'avia_framework') => 'single',\n __('Taxonomy Overview Page', 'avia_framework') => 'taxonomy',\n ],\n \"std\" => \"\",\n ],\n [\n \"type\" => \"close_div\",\n 'nodescription' => true,\n ],\n [\n \"type\" => \"tab\",\n \"name\" => __(\"Colors\", 'avia_framework'),\n 'nodescription' => true,\n ],\n [\n \"name\" => __(\"Button Color\", 'avia_framework'),\n \"desc\" => __(\"Choose a color for your button here\", 'avia_framework'),\n \"id\" => \"color\",\n \"type\" => \"select\",\n \"std\" => \"theme-color\",\n \"subtype\" => [\n __('Translucent Buttons', 'avia_framework') => [\n __('Light Transparent', 'avia_framework') => 'light',\n __('Dark Transparent', 'avia_framework') => 'dark',\n ],\n __('Colored Buttons', 'avia_framework') => [\n __('Theme Color', 'avia_framework') => 'theme-color',\n __('Theme Color Highlight', 'avia_framework') => 'theme-color-highlight',\n __('Theme Color Subtle', 'avia_framework') => 'theme-color-subtle',\n __('Blue', 'avia_framework') => 'blue',\n __('Red', 'avia_framework') => 'red',\n __('Green', 'avia_framework') => 'green',\n __('Orange', 'avia_framework') => 'orange',\n __('Aqua', 'avia_framework') => 'aqua',\n __('Teal', 'avia_framework') => 'teal',\n __('Purple', 'avia_framework') => 'purple',\n __('Pink', 'avia_framework') => 'pink',\n __('Silver', 'avia_framework') => 'silver',\n __('Grey', 'avia_framework') => 'grey',\n __('Black', 'avia_framework') => 'black',\n __('Custom Color', 'avia_framework') => 'custom',\n\n ],\n ],\n ],\n [\n \"name\" => __(\"Custom Background Color\", 'avia_framework'),\n \"desc\" => __(\"Select a custom background color for your Button here\", 'avia_framework'),\n \"id\" => \"custom_color\",\n \"type\" => \"colorpicker\",\n \"std\" => \"#444444\",\n \"required\" => ['color', 'equals', 'custom'],\n ],\n [\n \"type\" => \"close_div\",\n 'nodescription' => true,\n ],\n [\n \"type\" => \"tab\",\n \"name\" => __(\"Screen Options\", 'avia_framework'),\n 'nodescription' => true,\n ],\n [\n \"name\" => __(\"Element Visibility\", 'avia_framework'),\n \"desc\" => __(\"Set the visibility for this element, based on the device screensize.\",\n 'avia_framework'),\n \"type\" => \"heading\",\n \"description_class\" => \"av-builder-note av-neutral\",\n ],\n [\n \"desc\" => __(\"Hide on large screens (wider than 990px - eg: Desktop)\", 'avia_framework'),\n \"id\" => \"av-desktop-hide\",\n \"std\" => \"\",\n \"container_class\" => 'av-multi-checkbox',\n \"type\" => \"checkbox\",\n ],\n [\n\n \"desc\" => __(\"Hide on medium sized screens (between 768px and 989px - eg: Tablet Landscape)\",\n 'avia_framework'),\n \"id\" => \"av-medium-hide\",\n \"std\" => \"\",\n \"container_class\" => 'av-multi-checkbox',\n \"type\" => \"checkbox\",\n ],\n [\n\n \"desc\" => __(\"Hide on small screens (between 480px and 767px - eg: Tablet Portrait)\",\n 'avia_framework'),\n \"id\" => \"av-small-hide\",\n \"std\" => \"\",\n \"container_class\" => 'av-multi-checkbox',\n \"type\" => \"checkbox\",\n ],\n [\n\n \"desc\" => __(\"Hide on very small screens (smaller than 479px - eg: Smartphone Portrait)\",\n 'avia_framework'),\n \"id\" => \"av-mini-hide\",\n \"std\" => \"\",\n \"container_class\" => 'av-multi-checkbox',\n \"type\" => \"checkbox\",\n ],\n [\n \"type\" => \"close_div\",\n 'nodescription' => true,\n ],\n [\n \"type\" => \"close_div\",\n 'nodescription' => true,\n ],\n\n ];\n\n }", "function activation()\n {\t\n\t\t$data['fal'] = $this->fal_front->activation();\n\t\t$this->load->view($this->_container, $data); \n }", "public function initChangeStateContent()\n {\n }", "function showContent()\n {\n $this->elementStart('form', array('method' => 'post',\n 'id' => 'form_openidtrust',\n 'class' => 'form_settings',\n 'action' => common_local_url('openidtrust')));\n $this->elementStart('fieldset');\n // TRANS: Button text to continue OpenID identity verification.\n $this->submit('allow', _m('BUTTON','Continue'));\n // TRANS: Button text to cancel OpenID identity verification.\n $this->submit('deny', _m('BUTTON','Cancel'));\n\n $this->elementEnd('fieldset');\n $this->elementEnd('form');\n }", "function loadInHeader() {\n $this->metaData();\n//\t\t$this->loadAddOns();\n $this->onHead(\"onHead\"); // call back to onHead in extensions things js, etc in head\n $this->onEditor(\"onHead\"); // only when login to admin, for fck to work??\n //If not in admin, blank initEditor\n if (!isset($_SESSION['name'])) { // not sure what this does??\n print \"<script type=\\\"text/javascript\\\">function initeditor(){}</script>\\n\";\n }\n }", "function mainMenu() \r\n\t\t{\r\n\t\t\tif($this->RequestAction('/external_functions/verifiedAccess/'.$this->Auth->user('id').\"/1/mainMenu\") == true)\r\n\t\t\t{\r\n\t\t\t\t$this->set('title_for_layout', 'Fondos por rendir :: Menu Principal');\r\n\t\t\t\t$this->set('userAdmin', $this->Auth->user('admin'));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->Session->setFlash('No tienes permisos para ver esta pagina, consulta con el administrador del sistema.', 'flash_alert');\r\n\t\t\t\t$this->redirect(array('controller' => 'dashboard', 'action' => 'index'));\r\n\t\t\t}\r\n\t\t}", "function user()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\tJRequest::setVar( 'view', 'auteur' );\n\t\tJRequest::setVar( 'layout', 'default' );\n\t\tJRequest::setVar('hidemainmenu', 1);\n\n\t\tparent::display();\n\t}", "function Show()\r\n {\r\n $block = new JBlock($this->Core, $this->Name);\r\n $block->Frame = false;\r\n $block->Table = true;\r\n \r\n //Action Ajax\r\n $action = new AjaxAction($this->App, $this->Action);\r\n $action->AddArgument(\"App\", $this->App);\r\n \r\n //Ajout des arguments\r\n foreach($this->Arguments as $argument => $value)\r\n {\r\n $action->AddArgument($argument, $value);\r\n }\r\n \r\n $action->ChangedControl = $this->Name;\r\n \r\n foreach($this->Controls as $control)\r\n {\r\n switch($control[\"Type\"])\r\n {\r\n case \"EntityListBox\" : \r\n $ctr = new EntityListBox($control[\"Name\"], $this->Core);\r\n $ctr->Entity = $control[\"Entity\"] ;\r\n $ctr->ListBox->Libelle = $control[\"Libelle\"];\r\n $ctr->Libelle = $control[\"Libelle\"];\r\n $ctr->ListBox->Selected = $control[\"Value\"];\r\n \r\n if($control[\"Field\"])\r\n {\r\n $ctr->AddField($control[\"Field\"]);\r\n }\r\n \r\n if(isset($control[\"Argument\"]))\r\n {\r\n $ctr->AddArgument($control[\"Argument\"]); \r\n }\r\n \r\n break;\r\n case \"ListBox\" :\r\n $ctr = new ListBox($control[\"Name\"]);\r\n $ctr->Libelle = $control[\"Libelle\"];\r\n \r\n foreach($control[\"Value\"] as $key => $value)\r\n {\r\n $ctr->Add($key, $value);\r\n }\r\n \r\n \r\n break;\r\n case \"AutoCompleteBox\" : \r\n $ctr = new AutoCompleteBox($control[\"Name\"], $this->Core);\r\n $ctr->Entity = $control[\"Entity\"] ;\r\n $ctr->Methode = $control[\"Methode\"];\r\n $ctr->Libelle = $control[\"Libelle\"];\r\n \r\n \r\n break;\r\n case \"BsTextBox\" :\r\n $ctr = new BsTextBox($control[\"Name\"], $this->Core);\r\n $ctr->Title = $control[\"Title\"];\r\n break;\r\n case \"BsEmailBox\" :\r\n $ctr = new BsEmailBox($control[\"Name\"], $this->Core);\r\n $ctr->Title = $control[\"Title\"];\r\n break;\r\n case \"BsPassword\" :\r\n $ctr = new BsPassword($control[\"Name\"], $this->Core);\r\n $ctr->Title = $control[\"Title\"];\r\n break;\r\n \r\n case \"CheckBox\" :\r\n $ctr = new CheckBox($control[\"Name\"]);\r\n $ctr->Value = $control[\"Value\"];\r\n $ctr->Libelle = $control[\"Libelle\"];\r\n $ctr->CssClass = $control[\"CssClass\"];\r\n $ctr->Checked = $control[\"Value\"];\r\n break;\r\n case \"Button\" : \r\n $ctr = new Button(BUTTON);\r\n $ctr->Value = $control[\"Value\"];\r\n $ctr->Libelle = $control[\"Libelle\"];\r\n $ctr->CssClass = $control[\"CssClass\"];\r\n \r\n $ctr->OnClick = $action;\r\n \r\n break;\r\n case \"UploadAjaxFile\" : \r\n $app = $control[\"App\"];\r\n $idEntite = $control[\"IdEntite\"];\r\n $callBack = $control[\"CallBack\"];\r\n $UploadAction = $control[\"Action\"];\r\n \r\n $ctr = new UploadAjaxFile($app, $idEntite, $callBack, $UploadAction);\r\n \r\n break;\r\n case \"Libelle\":\r\n \r\n $ctr = new Libelle($control[\"Value\"]);\r\n \r\n break;\r\n default :\r\n $type = $control[\"Type\"];\r\n \r\n $ctr = new $type($control[\"Name\"]);\r\n $ctr->Libelle = $control[\"Libelle\"];\r\n $ctr->Value = $control[\"Value\"];\r\n \r\n break;\r\n }\r\n \r\n $action->AddControl($ctr->Id);\r\n \r\n if($control[\"Type\"] == \"Button\" || $control[\"Type\"] == \"UploadAjaxFile\" )\r\n {\r\n $block->AddNew($ctr, 2, ALIGNRIGHT);\r\n }\r\n else\r\n {\r\n $block->AddNew($ctr);\r\n }\r\n }\r\n \r\n return $block->Show();\r\n }", "function burialInput() {\n retrieveUser();\n echo \"<input id=\\\"searchType\\\" type=\\\"hidden\\\" value=\\\"burrialList\\\"/>\n <div style=\\\"width:100%;text-align:center\\\">\n <div style=\\\"width:50%;display:inline-block\\\"> \n <section id=personInfoSection style=\\\"width:100%\\\">\";\n personBurialSection(\"Second\");\n echo\"</section>\"; \n echo\"</section><section id=otherInfoSection style=\\\"width:100%;display:none;\\\">\"; \n otherBurialSection();\n echo\"</section>\";\n echo\"<div id=\\\"submitDiv\\\" style=\\\"text-align:right;width:100%;display:none\\\"><input type=\\\"button\\\" id=\\\"SubmitBurrial\\\" value=\\\"Submit Form\\\" >\n </div></div></div>\"; \n \n }", "function onView () {\n\n switch (parent::getAction()) {\n \n case \"edit\":\n $this->printEditView();\n break;\n default:\n $userId = $this->getModeUserId();\n $user = UsersModel::getUser($userId);\n if (RolesModel::hasModuleRole($userId,\"user.files.owner\")) {\n if (empty($user->directoryid)) {\n $user->directoryid = UsersModel::setupUserDirectory($userId);\n }\n parent::onView($user->directoryid);\n }\n }\n }", "static function iniPage($username, $menu ){\r\n\t\t\t?>\r\n\t\t\t\r\n\t\t\t<div class=\"header navbar navbar-inverse navbar-fixed-top\">\r\n\t\t\t\t<!-- BEGIN TOP NAVIGATION BAR -->\r\n\t\t\t\t<div class=\"navbar-inner\">\r\n\t\t\t\t\t<div class=\"container-fluid\">\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t<?php echo GuiHeaderHelper::logo(); ?>\r\n\t\t\t\t\t\t<?php echo GuiHeaderHelper::menuToggler(); ?>\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t<!-- BEGIN TOP NAVIGATION MENU -->\t\t\t\t\t\r\n\t\t\t\t\t\t<?php echo GuiHeaderHelper::topNavegationMenu(); ?>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<!-- BEGIN NOTIFICATION DROPDOWN -->\t\r\n\t\t\t\t\t\t\t<?php //echo GuiNotificationBarHelper::show(); ?>\r\n\t\t\t\t\t\t\t<!-- END NOTIFICATION DROPDOWN -->\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<!-- BEGIN INBOX DROPDOWN -->\r\n\t\t\t\t\t\t\t<?php //echo GuiInboxBarHelper::show(); ?>\r\n\t\t\t\t\t\t\t<!-- END INBOX DROPDOWN -->\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<!-- BEGIN TODO DROPDOWN -->\r\n\t\t\t\t\t\t\t<?php //echo GuiTaskBarHelper::show(); ?>\r\n\t\t\t\t\t\t\t<!-- END TODO DROPDOWN -->\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<!-- Display user dropdown -->\r\n\t\t\t\t\t\t\t<?php \r\n\t\t\t\t\t\t\t\techo GuiUserDropdownHelper::show($username); \r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t<?php echo GuiHeaderHelper::endTopNavegationMenu(); ?>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<!-- END TOP NAVIGATION BAR -->\r\n\t\t\t</div>\r\n\t\t\t<!-- END HEADER -->\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t<!-- BEGIN CONTAINER -->\r\n\t\t\t<div class=\"page-container row-fluid\">\r\n\t\t\t\t<!-- BEGIN SIDEBAR -->\r\n\t\t\t\t<?php GuiLeftHelper::initLeftPanel(); ?>\r\n\t\t\t\t\t<?php GuiLeftHelper::showSearchForm(); ?>\t\r\n\t\t\t\t\t<?php echo $menu; ?>\t\r\n\t\t\t\t<?php GuiLeftHelper::endLeftPanel(); ?>\r\n\t\t\t\t\r\n\t\t\t\t<!-- END SIDEBAR -->\r\n\t\t<?php\r\n\t}", "public function documentCheckContentPage() {\n $user = User::load(\\Drupal::currentUser()->id());\n bhge_user_registration_user_login($user);\n\n }", "function editInfo()\n {\n $this->view->load('frontend/user/editInfo');\n }", "public function RegistrationUnderApproval() {\n $this->Render();\n }", "public function render() {\n \t\tif (isset($_GET['eventId']) )\n\t\t\t$this->allElements[$_GET['eventId']]->callOnClickPreRenderFn();\n\n\t\tparent::render();\n \t\t\n\t\tif (isset($_GET['eventId']) )\n\t\t\t$this->allElements[$_GET['eventId']]->callOnClickPostRenderFn();\n\n\t}", "function main()\t{\n\t\tglobal $LANG;\n\t\t$this->searchitem = (string)t3lib_div::_GP('searchitem');\n\t\t\t// Draw the body.\n\t\t$this->content.='\n\t\t\t<body scroll=\"auto\" id=\"typo3-browse-links-php\">\n\t\t\t<form name=\"organisationform\" action=\"\" method=\"post\">\n\n\t\t\t<h3 class=\"bgColor5\">'.$LANG->getLL('tx_civserv_wizard_organisation_supervisor.select_letter_text').':</h3>\n\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" id=\"typo3-tree\">\n\t\t\t\t<tr class=\"bgColor\">\n\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t';\n\n\t\t$script=basename(PATH_thisScript);\n\t\t\n\t\t\n\t\t//render A-Z list\n\t\tforeach($this->arrAlphabet as $char){\n\t\t\tif($this->getEmployeeByLetter($char)){\n\t\t\t\t$this->content .= '<a href=\"#\" onclick=\"add_options_refresh(\\''.$char.'\\',\\''.(string)t3lib_div::_GP('selected_uid').'\\',\\''.(string)t3lib_div::_GP('selected_name').'\\',\\''.$script.'\\',\\''.$this->PItemName.'\\',\\'&organisation_pid='.htmlspecialchars($this->organisation_pid).'\\')\">'.$char.'</a>';\n\t\t\t}else{\n\t\t\t\t$this->content .= '<span style=\"color:#066\">'.$char.'</span>';\n\t\t\t}\n\t\t\t$this->content .= ' ';\n\t\t}\n\t\t\t\n\t\tif($this->getEmployeeByLetter('other')){\n\t\t\t$this->content .= '<a href=\"#\" onclick=\"add_options_refresh(\\'other\\',\\''.(string)t3lib_div::_GP('selected_uid').'\\',\\''.(string)t3lib_div::_GP('selected_name').'\\',\\''.$script.'\\',\\''.$this->PItemName.'\\',\\'&organisation_pid='.htmlspecialchars($this->organisation_pid).'\\')\">'.$LANG->getLL('all_abc_wizards.other').'</a>';\n\t\t}else{\n\t\t\t$this->content .= '<span style=\"color:#066\">'.$LANG->getLL('all_abc_wizards.other').'</span>';\n\t\t}\n\t\t\t\n\n\t\t$this->content.='\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=\"text\" size=\"20\" name=\"searchitem\" id=\"searchitem\" value=\"'.$this->searchitem.'\"> <br />\n\t\t\t\t\t\t<a href=\"#\" onclick=\"add_options_refresh(\\'searchitem\\',\\''.(string)t3lib_div::_GP('selected_uid').'\\',\\''.(string)t3lib_div::_GP('selected_name').'\\',\\''.$script.'\\',\\''.$this->PItemName.'\\',\\'&organisation_pid='.htmlspecialchars($this->organisation_pid).'\\')\">'.$LANG->getLL('all_abc_wizards.search').'</a>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t';\n\n\t\t\t// Stores selected letter in variable.\n\t\t$letter = (string)t3lib_div::_GP('letter');\n\n\t\t\t// Only display second selectorbox if a letter is selected.\n\t\tif ($letter=='') {\n\t\t\t// do nothing\n\t\t} else {\n\t\t\tif ($letter != \"other\" and $letter != \"searchitem\") {\n\t\t\t\t$this->content.='<h3 class=\"bgColor5\">'.$LANG->getLL('tx_civserv_wizard_organisation_supervisor.select_supervisor_text').''.$letter.':</h3>';\n\t\t\t} else {\n\t\t\t\t$this->content.='<h3 class=\"bgColor5\">'.$LANG->getLL('tx_civserv_wizard_organisation_supervisor.select_supervisor_text_no_abc').':</h3>';\n\t\t\t}\n\t\t\t$this->content.='<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" id=\"typo3-tree\">\n\t\t\t\t<tr class=\"bgColor\">\n\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t';\n\n\t\t\t\t// Gets all employees beginning with the chosen letter.\n\t\t\t$this->content.=$this->getSupervisors($letter);\n\n\t\t\t\t// Displays a OK-Button to save the selected supervisor.\n\t\t\t$this->content.='\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\n\t\t\t<input type=\"button\" name=\"Return\" value=\"'.$LANG->getLL('tx_civserv_wizard_organisation_supervisor.OK_Button').'\" onclick=\"return save_and_quit();\">\n\t\t';\n\t\t}\n\n\t\t\t// Displays a Cancel-Button at the end of the Page to exit the wizard without changing anything.\n\t\t$this->content.='\n\t\t<input type=\"button\" name=\"cancel\" value=\"'.$LANG->getLL('tx_civserv_wizard_organisation_supervisor.Cancel_Button').'\" onclick=\"parent.close();\">\n\t\t</form>\n\t\t</body>\n\t\t</html>\n\t\t';\n\t}", "public function screen() {\n\t\tGFireMAutoComplete::getFreemius()->get_logger()->entrance();\n\t\tGFireMAutoComplete::getFreemius()->_account_page_load();\n\t\tGFireMAutoComplete::getFreemius()->_account_page_render();\n\t}", "function onView () {\n\n switch (parent::getAction()) {\n case \"edit\":\n if (Context::hasRole(\"user.image.edit\")) {\n $this->printEditView();\n }\n break;\n case \"crop\":\n if (Context::hasRole(\"user.image.view\")) {\n $this->printCropImageView();\n }\n break;\n case \"upload\":\n if (Context::hasRole(\"user.image.view\")) {\n $this->printUploadImage();\n }\n break;\n default:\n if (Context::hasRole(\"user.image.view\")) {\n $this->printSelectImageView();\n }\n break;\n }\n }", "function lb_show_edit_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'edit',\n\t\t\t'this_cafe' => lb_get_this_cafe_from_cafe( $_GET['edit-id'] ),\n\t\t)\n\t);\n}", "public function agreementPage()\n\t{\n $currentUser = $this->getCurrentUser(true);\n\n $this->putComponent(\"validation\", \"icheck\", \"select2\");\n $this->putScript(\"scripts/pages/agreement\");\n\n $user_language = $currentUser->getLanguage()->code;\n\n //if (!parent::template_exists(\"pages/agreement/{$user_language}.tpl\")) {\n $user_language = $this->translate->getSystemLanguageCode();\n //} else {\n //parent::display('pages/agreement/default.tpl');\n //}\n parent::display(\"pages/agreement/{$user_language}.tpl\");\n \n\t}", "function main($action) {\n\t\t\t\n\t\t\t// da wir keine seite brauchen, setzen wir den start-view auf uns\n\t\t\t$this->set_start_view('admin_list');\n\t\t\t\n\t\t\t$this->action = $action;\n\t\t\t$this->vid = UTIL::get_post('vid');\n\t\t\t\n\t\t\tswitch(strtolower($action['event'])) \n\t\t\t{\n\t\t\t\tcase 'admin_list':\t$this->set_start_view('admin_list');\tbreak;\n\t\t\t\tcase 'open':\t\t$this->action_open();\t\t\t\t\tbreak;\n\t\t\t\tcase 'close':\t\t$this->action_close();\t\t\t\t\tbreak;\n\t\t\t\tcase 'add':\t\t\t$this->action_add();\t\t\t\t\tbreak;\n\t\t\t\tcase 'remove':\t\t$this->action_remove();\t\t\t\t\tbreak;\n\t\t\t\tcase 'clear':\t\t$this->action_clear();\t\t\t\t\tbreak;\n\t\t\t\tcase 'finish':\t\t$this->action_finish();\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}", "function getUserAction($type)\n{\n\t$rep = \"\";\n\n\t$question;\n\n\tswitch ($type)\n\t{\n\t\tcase 'index':\n\t\t$question = I18(\"Que voulez-vous faire?\");\n\tbreak;\n\n\t\tcase 'detail':\n\t\t$question = I18(\"Que voulez-vous faire?\");\n\tbreak;\n\t}\n\n\t$rep .= PHP_EOL . \"<div class='userAction'>\n\t<p style='margin:0'>$question</p>\" . PHP_EOL;\n\n\t$rep .= \"<select name='actionChoice' id='actionChoice'\nonchange='changedSelect(\\\"actionChoice\\\", \\\"ITupload\\\", \\\"upload\\\", \\\"update\\\")'>\" . PHP_EOL;\n\n\tforeach (ACTIONS as $key => $elem)\n\t{\n\t\t$rep .= \" <option value='$key'>$elem</option>\" . PHP_EOL;\n\t}\n\n\t$rep .= \"</select>\n\t<div id='ITupload'>\n\t\t<input type='hidden' name='MAX_FILE_SIZE' value='\" . MAXFSIZE . \"'/>\n\t\t<input type='file' name='newIT' id='newIT'/>\n\t</div>\" . PHP_EOL;\n\n\tif ($type==='detail' AND isset($_GET['choix']))\n\t{\n\t\t$rep .= \"<input type='hidden' name='IT[]' value='\" . withoutTag($_GET['choix']) . \"'>\";\n\t}\n\n\t$rep .= \"<input type='submit' value='\" . I18(\"Valider\") . \"'/>\n</div>\";\n\n\treturn $rep;\n}", "protected function action() {\n\t\tif($this->isPost() ) {\n\t\t\t$student_node=$this->template->getElementByID(\"student\");\n\t\t\tif($this->pers_id!=\"\")\n\t\t\t$this->template->appendFileByID(\"display_student.html\",\"li\",\"student\",false,$student_node);\n\t\t\telse\n\t\t\t$this->template->appendFileByID(\"no_student.html\",\"span\",\"student\",false,$student_node);\n\t\t\t}\n\t\t}", "protected function setupPage() {}", "function loadChangePass()\n {\n $this->global['pageTitle'] = 'Garuda Informatics : Change Password';\n \n $this->loadViews($this->view.\"changePassword\", $this->global, NULL, NULL);\n }", "public function become_owner(){\n\t\t//成为房东\n\t\t$this->load->view('become_owner');\n\t}", "public function initContent()\n {\n $aps_params = Tools::getAllValues();\n if (isset($aps_params['content_only'])) {\n if (1 == $aps_params['content_only']) {\n $this->context->smarty->assign('nobots', true);\n $this->setTemplate('module:amazonpaymentservices/views/templates/hook/payment_valu_term.tpl');\n }\n }\n parent::initContent();\n }", "function html()\n\t{\n /**\n * @global string $_REQUEST['opcion'] variable que contiene la opcion para ser dirijido a una funcion especifica\n */\n\t\tif(!isset($_REQUEST['opcion']))\n\t\t{\n\t\t\t$_REQUEST['opcion']=\"consultar\";\n\t\t}\n\n\t\tswitch($_REQUEST['opcion'])\n\t\t{\n \n default:\n $this->funcion->verificarTipoPago();\n break;\n\n\t\t}\n\t}", "function show()\n {\n if (!$this->loaded)\n {\n $this->onReload( func_get_arg(0) );\n }\n parent::show();\n }", "public function init() {\n\t\t\t$auth = Zend_Auth::getInstance()->setStorage(new Zend_Auth_Storage_Session('admin'));\n $user = $auth->getIdentity();\n $group = $user->code_groupe;\n\t\t\tif ($group == 'cm') {\n $menu = \"<li><a id=\\\"new\\\" href=\\\"/eu-preinscription/new\\\" style=\\\"font-size:9px\\\">Nouveau</a></li>\".\n\t\t\t \"<li><a id=\\\"new\\\" href=\\\"/eu-preinscription/index\\\" style=\\\"font-size:11px\\\">Inscriptions activees</a></li>\";\n $this->view->placeholder(\"menu\")->set($menu);\n } elseif($group == 'filiere' or $group == 'scmacnev' or $group == 'technopole') {\n\t\t $menu = \"<li><a id=\\\"new\\\" href=\\\"/eu-preinscription/newm\\\" style=\\\"font-size:9px\\\">Nouveau</a></li>\".\n\t\t\t \"<li><a id=\\\"new\\\" href=\\\"/eu-preinscription/morale\\\" style=\\\"font-size:11px\\\">Inscriptions activees</a></li>\";\n $this->view->placeholder(\"menu\")->set($menu); \n\t\t } elseif($group == 'productiong' or $group == 'productionsg' or $group == 'productiond' or $group == 'transformationg' or $group == 'transformationsg' or $group == 'transformationd' or $group == 'distributiong' or $group == 'distributionsg' or $group == 'distributiond') {\n\t\t $menu = \"<li><a id=\\\"new\\\" href=\\\"/eu-preinscription/newmcreneau\\\" style=\\\"font-size:9px\\\">Nouveau</a></li>\".\n\t\t\t \"<li><a id=\\\"new\\\" href=\\\"/eu-preinscription/morale\\\" style=\\\"font-size:11px\\\">Inscriptions activees</a></li>\";\n $this->view->placeholder(\"menu\")->set($menu); \n\t\t } elseif($group == 'scmg' or $group == 'scmsg' or $group == 'scmd') {\n\t\t $menu = \"<li><a id=\\\"new\\\" href=\\\"/eu-preinscription/newmose\\\" style=\\\"font-size:9px\\\">Nouveau</a></li>\".\n\t\t\t \"<li><a id=\\\"new\\\" href=\\\"/eu-preinscription/morale\\\" style=\\\"font-size:11px\\\">Inscriptions activees</a></li>\";\n $this->view->placeholder(\"menu\")->set($menu); \n\t\t } elseif($group == 'scmgpbf' or $group == 'scmsgpbf' or $group == 'scmdpbf') {\n\t\t $menu = \"<li><a id=\\\"new\\\" href=\\\"/eu-preinscription/newmpbf\\\" style=\\\"font-size:9px\\\">Nouveau</a></li>\".\n\t\t\t \"<li><a id=\\\"new\\\" href=\\\"/eu-preinscription/morale\\\" style=\\\"font-size:11px\\\">Inscriptions activees</a></li>\";\n $this->view->placeholder(\"menu\")->set($menu); \n\t\t } elseif($group == 'scmgkr' or $group == 'scmsgkr' or $group == 'scmdkr') {\n\t\t $menu = \"<li><a id=\\\"new\\\" href=\\\"/eu-preinscription/newmkr\\\" style=\\\"font-size:9px\\\">Nouveau</a></li>\".\n\t\t\t \"<li><a id=\\\"new\\\" href=\\\"/eu-preinscription/morale\\\" style=\\\"font-size:11px\\\">Inscriptions activees</a></li>\";\n $this->view->placeholder(\"menu\")->set($menu); \n\t\t }\n\t\t\t$this->view->jQuery()->enable();\n $this->view->jQuery()->uiEnable();\n\t\t\n\t\t //$liste = \"abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n $liste = \"abcdefghjkmnpqrstuvwxyz23456789ABCDEFGHJKLMNPQRSTUVWXYZ\";\n $codesecret = \"\";\n while(strlen($codesecret) != 8) {\n $codesecret .= $liste[rand(0,strlen($liste)-1)];\n\t\t\t}\n\t\t $this->view->codesecret = $codesecret;\n\t\t}", "function load_view($template){$this->hold_template = APPPATH . '/views/' . $template . EXT;}", "public function userbyLocationsAction() {\n $this->_helper->content->setEnabled();\n }", "public function onAlternativePage();", "function show_panel()\n\t{\n\t\tglobal $errors, $template;\n\t\t\n\t\t// get the mode\n\t\t$s = ( isset( $_GET[ 's' ] ) ) ? strval( $_GET[ 's' ] ) : '';\n\t\t\n\t\t// fire the template\n\t\t$template->assign_files( array(\n\t\t\t'ACP_advance' => 'ACP/advance' . tplEx\n\t\t) );\n\t\t\n\t\t// act upon it\n\t\tswitch( $s )\n\t\t{\n\t\t\tcase 'settings':\n\t\t\t\t$this->settings();\n\t\t\t\tbreak;\n\t\t\tcase 'settings_real':\n\t\t\t\t$this->settings_real();\n\t\t\t\tbreak;\n\t\t\tcase 'browser':\n\t\t\t\t$this->browser();\n\t\t\t\tbreak;\n\t\t\tcase 'clearcache':\n\t\t\t\t$this->clearcache();\n\t\t\t\tbreak;\n\t\t\tcase 'console':\n\t\t\t\t$this->console();\n\t\t\t\tbreak;\n\t\t\tcase 'key':\n\t\t\t\t$this->key();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$errors->report_error( $this->lang[ 'Wrong_mode' ], CRITICAL_ERROR );\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function loadAction() {\n\t\t$this->load($this->settings);\n\t\treturn '';\n\t}", "public function setLoadControllerMenu()\r\n {\r\n add_menu_page(\r\n $_SESSION['controller_data_current']['page_title'], // Title of the page\r\n $_SESSION['controller_data_current']['page_menu_text'], // Text to show on the menu link\r\n $_SESSION['controller_data_current']['page_capability'], // Capability requirement to see the link\r\n $_SESSION['controller_data_current']['page_slug'],\r\n $_SESSION['controller_data_current']['page_render'],\r\n $_SESSION['controller_data_current']['page_menu_icon'],\r\n $_SESSION['controller_data_current']['page_menu_position']\r\n );\r\n }", "private function openAdvancedSearch() {\n // AND its content loads dynamically\n $this->click('class=civi-advanced-search-link');\n $this->waitForElementPresent('_qf_Advanced_refresh');\n }" ]
[ "0.5787616", "0.5640093", "0.56260103", "0.5572934", "0.55317736", "0.540771", "0.540543", "0.538836", "0.538836", "0.53857136", "0.53759474", "0.53724676", "0.536726", "0.53662145", "0.5327044", "0.5326408", "0.53218216", "0.52974224", "0.52845395", "0.5280867", "0.52798104", "0.52577025", "0.5255941", "0.52493656", "0.5246202", "0.5244293", "0.52389896", "0.52257806", "0.52257806", "0.5219585", "0.5207613", "0.52032113", "0.52025443", "0.5186435", "0.51843387", "0.5177727", "0.5167985", "0.51620775", "0.5160187", "0.515846", "0.5152763", "0.51357144", "0.5131644", "0.5127735", "0.5122889", "0.5119677", "0.51105344", "0.510961", "0.5108536", "0.50911504", "0.5087406", "0.50752896", "0.5069328", "0.5068382", "0.50683564", "0.5067545", "0.50649434", "0.506398", "0.5061311", "0.5048245", "0.50455785", "0.50390124", "0.5037829", "0.5032781", "0.5032254", "0.50307006", "0.5027161", "0.5025395", "0.5024118", "0.5016322", "0.50144756", "0.50126106", "0.50076705", "0.5006632", "0.5005899", "0.5003119", "0.50025636", "0.50010747", "0.4994264", "0.4992015", "0.4990238", "0.49901414", "0.49892816", "0.49862024", "0.49839848", "0.49782404", "0.49778444", "0.49732873", "0.49712497", "0.4965086", "0.4964376", "0.49621454", "0.49608487", "0.4960013", "0.49597806", "0.49518502", "0.49494848", "0.4944688", "0.4943114", "0.49408352", "0.49390784" ]
0.0
-1
Get the existing recommandation category list
function getCategoryRecommandationList(){ global $wpdb; $query = $wpdb->prepare( "SELECT RECOMMANDATION_CAT.*, PIC.photo FROM " . TABLE_CATEGORIE_PRECONISATION . " AS RECOMMANDATION_CAT LEFT JOIN " . TABLE_PHOTO_LIAISON . " AS LINK_ELT_PIC ON ((LINK_ELT_PIC.idElement = RECOMMANDATION_CAT.id) AND (tableElement = '" . TABLE_CATEGORIE_PRECONISATION . "') AND (LINK_ELT_PIC.isMainPicture = 'yes')) LEFT JOIN " . TABLE_PHOTO . " AS PIC ON ((PIC.id = LINK_ELT_PIC.idPhoto)) WHERE RECOMMANDATION_CAT.status = 'valid' GROUP BY RECOMMANDATION_CAT.id", ""); $CategoryRecommandationList = $wpdb->get_results($query); return $CategoryRecommandationList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCategories();", "public function getCategories();", "public function getCategories(){\n\t\t$query = \"SELECT * FROM final_categoria\";\n\t\treturn $this->con->action($query);\n\t}", "public function getCategoryList()\n {\n// return $this->categoryList = DB::table('categories')->get();\n return $this->categoryList = Categories::all();\n }", "public function getRewardCategories()\r\n {\r\n return Controllers\\RewardCategories::getInstance();\r\n }", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")\n\t\t->where(array(\"category_status\" => 1,\"main_category_id\"=>0))->orderby(\"category_name\",\"ASC\")->get();\n\t\treturn $result;\n\t}", "function category_list() {\n $query = $this->db->get(\"categories\");\n return $query->result_array();\n }", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")->where(array(\"category_status\" => 1,\"main_category_id\"=>0))->orderby(\"category_name\",\"ASC\")->get();\n\t\treturn $result;\n\t}", "public function getCategoriesList() {\n return $this->_get(16);\n }", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")\n\t\t\t\t\t\t->where(array(\"category_status\" => 1,\"main_category_id\"=>0))\n\t\t\t\t\t\t->orderby(\"category_name\", \"ASC\")\n\t\t\t\t\t\t->get();\n\t\treturn $result;\n\t}", "public function getCategory() {}", "public function getAllCategories(){\r\n\t\treturn $this->query(\"SELECT * FROM category\");\r\n\t}", "public function getCategoryList()\n {\n $this->db->select(\"tc_category\");\n $this->db->from(\"ims_hris.training_category\");\n $this->db->where(\"COALESCE(tc_status,'N') = 'Y'\");\n $this->db->order_by(\"1\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "public function getCategory();", "public function getCategory();", "public function getCategoriesForListView(): Collection;", "public function getCategory()\n {\n }", "public function getAllCategories();", "public function getCategories() : array;", "public function getCategoryList()\r\n\t{\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->from('tbl_category');\r\n\t\t$this->db->where(\"(category_parent_id = '' OR category_parent_id = '0')\");\r\n\t\t$this->db->where('category_status', '1');\r\n\t\t$this->db->where('category_type', 'Product');\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->result() ;\r\n\t}", "public function getCategoryList() {\n $categories = $this->couponServices_model->fetchCategories();\n\n $category_options = array();\n $category_options[\"\"] = \"-- Select category --\";\n foreach ($categories as $item) {\n $category_options[$item['categoryId']] = $item['categoryName'];\n }\n return $category_options;\n }", "function getCategorias(){\r\n $conector = new Conector();\r\n $banco = new BancoCategoria();\r\n return $banco->getCategorias($conector->getConexao());\r\n }", "function afficherCategories()\n\t{\n\t\t$sql=\"SElECT * From categorie\";\n\t\t$db = config::getConnexion();\n\t\ttry\n\t\t{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e)\n {\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "public function getList()\n {\n $categories = array();\n\n $q = $this->_db->query('SELECT * FROM categorie ORDER BY idCategorie');\n\n while ($donnees = $q->fetch(PDO::FETCH_ASSOC))\n {\n $categories[] = ($donnees);\n \n }\n }", "public function categories() {\n\t\treturn $this->terms('category');\n\t}", "public static function getCategories() {\n $top_level_cats = array();\n//Select all top level categories\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=0\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n foreach ($result as $cat) {\n $top_level_cats[] = array('id' => $cat->category_id,\n 'cat_name' => $cat->category,\n 'company_id' => $cat->company_id,\n 'status' => $cat->status,\n 'product_count' => $cat->product_count,\n 'is_op' => $cat->is_op,\n 'usergroup_ids' => $cat->usergroup_ids);\n }\n }\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }", "public function findCategories();", "public static function getActiveCategories(){}", "function getCategories(){\n\treturn dbSelect('categories');\n}", "function getDocumentCategories()\n\t{\n\t\tif(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');\n\t\t$module_srl = Context::get('module_srl');\n\t\t$categories= $this->getCategoryList($module_srl);\n\t\t$lang = Context::get('lang');\n\t\t// No additional category\n\t\t$output = \"0,0,{$lang->none_category}\\n\";\n\t\tif($categories)\n\t\t{\n\t\t\tforeach($categories as $category_srl => $category)\n\t\t\t{\n\t\t\t\t$output .= sprintf(\"%d,%d,%s\\n\",$category_srl, $category->depth,$category->title);\n\t\t\t}\n\t\t}\n\t\t$this->add('categories', $output);\n\t}", "public static function getCategories()\n {\n \t$query = \"SELECT * FROM categories\";\n \t$result = DB::select($query);\n\n \treturn $result;\n }", "function getAllCategories()\n {\n return $this->data->getAllCategories();\n }", "public function getCategories()\r\n {\r\n $this->db->query(\"SELECT * FROM categories\");\r\n\r\n $row = $this->db->resultset();\r\n\r\n //Check Rows\r\n return $row;\r\n }", "function categories(){\n return $this->db->get($this->categorie)->result();\n }", "function getCategories() {\n $this->db->select(\"*\");\n $query = $this->db->get('post_category');\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return array();\n }", "function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }", "public function category(){\n\t\t$query = $this->db->query(\"select * from `category` where status='enable'\");\n\t\treturn $query->result_array();\n\t}", "public function getCategorias() {\n $categorias=$this->db->query('SELECT * FROM categorias ORDER BY id DESC;');\n return $categorias;\n }", "function recharge_category() {\n\n\t\t$category = $this -> conn -> get_table_row_byidvalue('recharge_category', 'category_status', 1);\n\t\tforeach ($category as $key => $value) {\n\n\t\t\t$name = $value['category_name'];\n\t\t\t$category_id = $value['recharge_category_id'];\n\n\t\t\t$response[] = array('recharge_category_id' => $category_id, 'category_name' => $name);\n\t\t}\n\t\tif (!empty($response)) {\n\t\t\t$post = array(\"status\" => \"true\", \"message\" => $response);\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"No Record Found\");\n\t\t}\n\n\t\techo $this -> json($post);\n\t}", "function afficherCategories2(){\n\t\t$sql=\"SElECT nom From categorie\";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "public static function categories() {\n $db = Db::getInstance();\n $req = $db->query('SELECT * FROM category');\n return $req->fetchAll(PDO::FETCH_ASSOC);\n }", "public function get_categories()\n {\n return ['careerfy'];\n }", "public function get_categories()\n {\n return ['careerfy'];\n }", "public function listCategories(){\n\t\t$lab = new lelabDB();\n\t\t$query = \"select * from $this->tableName order by id\";\n\t\t$result = $lab->getArray($query);\n\t\treturn $result;\n\t}", "function affichercategories(){\r\n\t\t$sql=\"SElECT * From categorie\";\r\n\t\t$db = config::getConnexion();\r\n\t\ttry{\r\n\t\t$liste=$db->query($sql);\r\n\t\treturn $liste;\r\n\t\t}\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n }\t\r\n\t}", "public function getCategories()\n\t{\n\t\treturn BlogCategory::all();\t\n\t}", "public function categories()\n {\n return $this->apiResponse(Items::$categories, 2678400);\n }", "public function get(){\n\n $tabla = \"categorias\";\n \n $respuesta = ModeloCategorias::get($tabla);\n \n return $respuesta; \n }", "function faq_build_get_categories() { //retrieve all categories\n\tglobal $wpdb;\n\t$res = $wpdb->get_results(\"SELECT * FROM \".FAQBUILDDBCATEGORY.\" ORDER BY name ASC;\",ARRAY_A);\n\t$categories = array();\n\tif(is_array($res)) {\n\t\tforeach($res as $row) {\n\t\t\t$c = new FAQ_Build_Category();\n\t\t\tif($c->fromArray($row))\n\t\t\t\t$categories[] = $c;\n\t\t\telse\n\t\t\t\tunset($c);\n\t\t}\n\t}\n\treturn $categories;\n}", "public function getCategories()\n {\n return [ 'categories' => self::CATEGORIES ];\n }", "public function getCategories(){\n return Category::get();\n }", "public function getCategories()\n {\n return Category::all();\n }", "public function get_categories() {\n\t\treturn $this->terms('category');\n\t}", "function GetCategories()\n\t{\n\t\t$result = $this->sendRequest(\"GetCategories\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function getCategories(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_categories WHERE clientId = '{$this->clientId}'\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "public function get_categories()\n {\n return ['general'];\n }", "public function get_categories()\n {\n return ['general'];\n }", "public function getCategories()\n {\n return $this->request(\"core_course_get_categories\");\n }", "public function getCategories()\n {\n $request = \"SELECT * FROM category\";\n $request = $this->connexion->query($request);\n $categories = $request->fetchAll(PDO::FETCH_ASSOC);\n return $categories;\n }", "function recharge_category() {\n\n\t\t$category = $this -> conn -> get_table_row_byidvalue('recharge_category', 'category_status', 1);\n\t\tforeach ($category as $key => $value) {\n\n\t\t\t$name = $value['category_name'];\n\t\t\t$category_id = $value['recharge_category_id'];\n\t\t\t\n\t\t\t$response[] = array('recharge_category_id' => $category_id, 'category_name' => $name);\n\t\t}\n\t\tif(!empty($response)){\n\t\t\t$post = array(\"status\" => \"true\",\"message\" => $response);\n\t\t}else{\n\t\t\t$post = array('status' => \"false\",\"message\" => \"No Record Found\");\n\t\t}\n\t\t\n\t\techo $this -> json($post);\n\t}", "public function ListarCategorias()\n{\n\tself::SetNames();\n\t$sql = \" select * from categorias\";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}", "function getCategories() {\r\n\t\t$categories = $this->find('all');\r\n\t\t$result = array();\r\n\t\tforeach ($categories as $category) {\r\n\t\t\t$result[$category['NbCategory']['id']] = array(\r\n\t\t\t\t'probability' => $category['NbCategory']['probability'],\r\n\t\t\t\t'word_count' => $category['NbCategory']['word_count']\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "public function getCategoryList()\n {\n global $user;\n\n $returned=array();\n\n if($this->options['galleryRoot'])\n {\n $startLevel=1;\n }\n else\n {\n $startLevel=0;\n }\n\n $sql=\"SELECT DISTINCT pct.id, pct.name, pct.global_rank AS `rank`, pct.status\n FROM \".CATEGORIES_TABLE.\" pct \";\n\n switch($this->options['filter'])\n {\n case self::FILTER_PUBLIC :\n $sql.=\" WHERE pct.status = 'public' \";\n break;\n case self::FILTER_ACCESSIBLE :\n if(!is_admin())\n {\n $sql.=\" JOIN \".USER_CACHE_CATEGORIES_TABLE.\" pucc\n ON (pucc.cat_id = pct.id) AND pucc.user_id='\".$user['id'].\"' \";\n }\n else\n {\n $sql.=\" JOIN (\n SELECT DISTINCT pgat.cat_id AS catId FROM \".GROUP_ACCESS_TABLE.\" pgat\n UNION DISTINCT\n SELECT DISTINCT puat.cat_id AS catId FROM \".USER_ACCESS_TABLE.\" puat\n UNION DISTINCT\n SELECT DISTINCT pct2.id AS catId FROM \".CATEGORIES_TABLE.\" pct2 WHERE pct2.status='public'\n ) pat\n ON pat.catId = pct.id \";\n }\n\n break;\n }\n $sql.=\"ORDER BY global_rank;\";\n\n $result=pwg_query($sql);\n if($result)\n {\n while($row=pwg_db_fetch_assoc($result))\n {\n $row['level']=$startLevel+substr_count($row['rank'], '.');\n\n /* rank is in formated without leading zero, giving bad order\n * 1\n * 1.10\n * 1.11\n * 1.2\n * 1.3\n * ....\n *\n * this loop cp,vert all sub rank in four 0 format, allowing to order\n * categories easily\n * 0001\n * 0001.0010\n * 0001.0011\n * 0001.0002\n * 0001.0003\n */\n $row['rank']=explode('.', $row['rank']);\n foreach($row['rank'] as $key=>$rank)\n {\n $row['rank'][$key]=str_pad($rank, 4, '0', STR_PAD_LEFT);\n }\n $row['rank']=implode('.', $row['rank']);\n\n $row['name']=GPCCore::getUserLanguageDesc($row['name']);\n\n $returned[]=$row;\n }\n }\n\n if($this->options['galleryRoot'])\n {\n $returned[]=array(\n 'id' => 0,\n 'name' => l10n('All the gallery'),\n 'rank' => '0000',\n 'level' => 0,\n 'status' => 'public',\n 'childs' => null\n );\n }\n\n usort($returned, array(&$this, 'compareCat'));\n\n if($this->options['tree'])\n {\n $index=0;\n $returned=$this->buildSubLevel($returned, $index);\n }\n else\n {\n //check if cats have childs & remove rank (enlight the response)\n $prevLevel=-1;\n for($i=count($returned)-1;$i>=0;$i--)\n {\n unset($returned[$i]['rank']);\n if($returned[$i]['status']=='private')\n {\n $returned[$i]['status']='0';\n }\n else\n {\n $returned[$i]['status']='1';\n }\n\n if($returned[$i]['level']>=$prevLevel)\n {\n $returned[$i]['childs']=false;\n }\n else\n {\n $returned[$i]['childs']=true;\n }\n $prevLevel=$returned[$i]['level'];\n }\n }\n\n return($returned);\n }", "public function get_categories () {\n\t\treturn Category::all();\n\t}", "function Categories() {\n\t\treturn DataObject::get('categoryobject', '', 'Title');\n\t}", "function get_cat() {\r\n \r\n $query = $this->db->get('categories');\r\n return $query->result_array();\r\n }", "public function getallCategories(){\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->select = '*';\n\t \treturn $terms = NeCategory::model()->findAll($criteria);\n\t}", "public static function getCategoriaLista() {\n $dni=Yii::$app->user->identity->id;\n $droptions = Categoria::find()->where(['id_profesor_titular'=>$dni])->orWhere(['id_profesor_titular'=>$dni])->asArray()->all();\n return ArrayHelper::map($droptions, 'id_categoria', 'nombre_categoria');\n }", "public function get_categories() {\n\t\treturn [ 'happyden' ];\n\t}", "public function getAllCategoriesPro()\n {\n // $this->db->from('category');\n // $query=$this->db->get();\n // return $query->result();\n return $this->db->get('category')->result();\n }", "public function getCategories() {\n $sql = \"SELECT * FROM categories\";\n //Commit the query\n $result = $this->connection->query($sql);\n //Parse result to JSON list\n $answer = '{\"categories\": [';\n if ($result->num_rows > 0) {\n // output data of each row\n while($row = $result->fetch_assoc()) {\n $answer = $answer . '{\"ID\":\"' . $row[\"category_ID\"] . '\",' .\n '\"Name\": \"' . $row[\"category_Name\"] .'\"},' ;\n }\n //Trim the last comma\n $answer=rtrim($answer,\", \");\n //Finish parsing\n $answer=$answer . \"]}\";\n //Retrun the list as a string\n return $answer;\n } else {\n echo \"0 results\";\n }\n\n\n }", "function getCategoryList($module_srl, $columnList = array())\n\t{\n\t\t// Category of the target module file swollen\n\t\t$filename = sprintf(\"%sfiles/cache/document_category/%s.php\", _XE_PATH_, $module_srl);\n\t\t// If the target file to the cache file regeneration category\n\t\tif(!file_exists($filename))\n\t\t{\n\t\t\t$oDocumentController = getController('document');\n\t\t\tif(!$oDocumentController->makeCategoryFile($module_srl)) return array();\n\t\t}\n\n\t\tinclude($filename);\n\n\t\t// Cleanup of category\n\t\t$document_category = array();\n\t\t$this->_arrangeCategory($document_category, $menu->list, 0);\n\t\treturn $document_category;\n\t}", "function getAllCategories() {\n\t\t$url = $this->apiURL . \"categories/\" . $this->yourID . \"/\" . $this->yourAPIKey;\n\t\treturn $this->_curl_get($url);\n\t}", "public function getCategory(){\n\t\t$stmt = $this->bdd->prepare('SELECT * FROM categorie');\n\t\t$stmt->execute();\n\t\treturn $stmt->fetchAll();\n\t}", "function getCategory(){\n\t\t\t$data = array(); \n\t\t\t$query = \"select * from packages_category\";\n\t\t\t$result = mysql_query($query);\n\t\t \n\t\t\tif($result){\n\t\t\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t\t\tarray_push($data,$row);\n\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t\t}else{\n\t\t\t\tdie(\"error in mysql query \" . mysql_error());\n\t\t\t}\n\t\t}", "public function get_categories() {\n\t\treturn array( 'listeo' );\n\t}", "public static function getCategoryOptions()\n {\n return self::get('category') ?: [];\n }", "public function getCategoryList()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t// sql\n\t\t\t$category = D('Category');\n\t\t\t$sql = \"SELECT * FROM lib_category;\";\n\t\t\t$return = $category->query($sql);\n\t\t\t$result = array();\n\t\t\tfor ($k = 0; $k < count($return); $k++) {\n\t\t\t\tarray_push($result, $return[$k]['category']);\n\t\t\t}\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'data' => json_encode($return),\n\t\t\t\t\t'cat' => json_encode($result)\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function get_new_list_category($category){\t\n\t $results=array();\n\t if($category!='')\n\t\t{\n\t\t\t$category=explode(',',$category);\n\t\t\t$category=array_filter($category);\n\t\t $category=array_unique($category);\n\t\t\t$category=implode(',',$category);\n\t\t\t$this->db->select('categories.id,categories.name');\n\t\t\t$this->db->where('categories.is_active','1');\n\t\t\t$this->db->where('categories.id IN('.$category.')');\n\t\t\t$this->db->limit('10');\n\t\t\t$this->db->order_by('categories.name','ASC');\n\t\t\t$this->db->from('categories');\n\t\t\t$query = $this->db->get();\t\t\t\n\t\t\t$results=$query->result_array();\t\t\n\t\t}\n\t\treturn $results;\n\t}", "public function categoryList()\n {\n return view(\"Category::list\");\n }", "public function GetCategories() {\n // Setup the Query\n $this->sql = \"SELECT *\n FROM categories\";\n \n // Run the query \n $this->RunBasicQuery();\n }", "public function listattr_cat()\n {\n $this->db->where('descripcion_atributo', 'Catalogo');\n $resultados = $this->db->get('atributos_b');\n\n return $resultados->result();\n }", "public function getCat()\n {\n $query = $this->db->get('categories');\n\n return $query->result();\n }", "public function category()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from($this->pro->prifix.$this->pro->category);\n\t\t$this->db->order_by($this->pro->category.'_id','desc');\n\t\t$this->db->where($this->pro->category.'_status','1');\n\t\t$this->db->where($this->pro->category.'_parent',0);\n\t\t$rs = $this->db->get();\n\t\t//echo $this->db->last_query();\n\t\treturn $rs->result_array();\n\t\t\n\t}", "public function getCategories(){\n\t\t// preapres the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/category/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$categories = json_decode($output, true);\n\n\t\treturn $categories;\n\t}", "public function categories()\n {\n // Cache results\n static $categories;\n\n if ($categories) {\n return $categories;\n }\n\n $app = \\Slim\\Slim::getInstance();\n $dataMapper = $app->dataMapper;\n $CategoryMapper = $dataMapper('CategoryMapper');\n\n return $categories = $CategoryMapper->getAllCategories();\n }", "public static function getCategoriesListAdmin(){\n\n //Подключаемся к БД:\n $db = DB::getConnection();\n\n $categoruList = array();\n\n $sql = 'SELECT id, name, sort_order, status FROM category '\n . 'ORDER BY sort_order ASC';\n\n //dd($sql);\n\n $result = $db->query($sql);\n\n $i = 0;\n\n while($row = $result->fetch()){\n $categoruList[$i]['id'] = $row['id'];\n $categoruList[$i]['name'] = $row['name'];\n $categoruList[$i]['sort_order'] = $row['sort_order'];\n $categoruList[$i]['status'] = $row['status'];\n $i++;\n }\n\n return $categoruList;\n\n }", "public function get_category()\n\t{\n\t\tglobal $module_name, $nv_Cache;\n\n\t\t$category = array();\n\n\t\t$sql = \"SELECT * FROM \" . $this->table_prefix . \"_category ORDER BY weight ASC\";\n\t\t$result = $this->db_cache( $sql, 'id', $module_name );\n\n\t\t$category[0] = array(\n\t\t\t'id' => 0,\n\t\t\t'title' => $this->lang('unknow'),\n\t\t\t'keywords' => '',\n\t\t\t'description' => ''\n\t\t);\n\n\t\tif( ! empty( $result ) )\n\t\t{\n\t\t\tforeach( $result as $row )\n\t\t\t{\n\t\t\t\t$category[$row['id']] = array(\n\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t'title' => $row['title'],\n\t\t\t\t\t'keywords' => $row['keywords'],\n\t\t\t\t\t'description' => $row['description']\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $category;\n\t}", "function all_category() {\n\n $query = $this->db->get('tbl_category');\n return $query->result_array();\n }", "public function getCategoryList(){\n\t\t$recordLimit = Input::get('limit');\n\t\t$recordLimit = (!empty($recordLimit) && in_array($recordLimit, parent::$pagination_limits)) ? \n\t\t\t$recordLimit : parent::recordLimit;\n\t\t\t\n\t\t$colors = $this->shift->getCategoryColors();\n\t\t$categories = $this->shift->getCategories(null, $recordLimit == 'all' ? null : $recordLimit);\n\t\t\n\t\treturn View::make('admin.shifts.list_category')\n\t\t\t->withColors($colors)\n\t\t\t->withCategories($categories)\n\t\t\t//->withRecordlimit(parent::recordLimit);\n\t\t\t->withRecordlimit($recordLimit);\n\t}", "public function get_categories() {\n return array ( 'general' );\n }", "public static function getCategoriesList(){\n\n //Подключаемся к БД:\n $db = DB::getConnection();\n\n $categoruList = array();\n\n $sql = 'SELECT id, name FROM category '\n . ' WHERE status = \"1\" '\n . 'ORDER BY sort_order ASC';\n\n //dd($sql);\n\n $result = $db->query($sql);\n\n\n $i = 0;\n\n while($row = $result->fetch()){\n $categoruList[$i]['id'] = $row['id'];\n $categoruList[$i]['name'] = $row['name'];\n $i++;\n }\n\n return $categoruList;\n\n }", "public function getAllWithCategory();", "public function listCategories()\n {\n $categories = Category::all();\n\n return $categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }" ]
[ "0.7073164", "0.7073164", "0.70191187", "0.6952801", "0.6952469", "0.6925243", "0.69237745", "0.691156", "0.6873652", "0.68731844", "0.68014926", "0.6720509", "0.67117107", "0.6695676", "0.6695676", "0.6617632", "0.66162014", "0.66094625", "0.65975153", "0.65836245", "0.65781736", "0.65739214", "0.65715456", "0.6570649", "0.65603954", "0.65437615", "0.6540404", "0.652218", "0.6517411", "0.6512365", "0.65090275", "0.64879286", "0.64870566", "0.6484202", "0.64722395", "0.646807", "0.64662343", "0.64629596", "0.64615875", "0.64607406", "0.64531666", "0.6450142", "0.6450142", "0.64497733", "0.6448279", "0.6446789", "0.6443452", "0.6425729", "0.64235824", "0.6402178", "0.6399511", "0.63858235", "0.6383369", "0.63802606", "0.6379734", "0.63681084", "0.63681084", "0.636647", "0.6365907", "0.6362731", "0.63606584", "0.63454807", "0.6345458", "0.6343169", "0.6342941", "0.633816", "0.6332997", "0.6331582", "0.6330499", "0.6320007", "0.6319909", "0.63143796", "0.63123286", "0.6306217", "0.6306106", "0.63043743", "0.63027996", "0.6302731", "0.6300868", "0.63002497", "0.62933105", "0.6278301", "0.6275621", "0.62746125", "0.62670875", "0.6263473", "0.6262954", "0.62623906", "0.6257896", "0.62529296", "0.6250875", "0.6245763", "0.62438804", "0.6235187", "0.6230927", "0.6230927", "0.6230927", "0.6230927", "0.6230927", "0.6230927" ]
0.76744723
0
Get a specific recommandation category
function getCategoryRecommandation($categoryRecommandationId) { global $wpdb; $query = $wpdb->prepare( "SELECT * FROM " . TABLE_CATEGORIE_PRECONISATION . " WHERE id = %d ", $categoryRecommandationId); return $wpdb->get_row($query); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCategory() {}", "public function getCategory();", "public function getCategory();", "public function category() {\n\t\treturn $this->get_category();\n\t}", "function the_category() {\n\tglobal $discussion;\n\treturn $discussion['category'];\n}", "function get_Category()\n {\n try {\n return $this->mCategory;\n }catch(Exception $e){\n $this->error->throwException('303', 'No s`ha pogut retornar la informació', $e);\n }\n }", "public function get_category(){\n\t\treturn $this->category;\n\t}", "public function getCategory()\n {\n }", "public function getCategory()\n {\n\t\treturn self::$categories[ $this->category ];\n }", "function category(){\n\t\trequire('quizrooDB.php');\n\t\t$query = sprintf(\"SELECT cat_name FROM q_quiz_cat WHERE cat_id = %d\", GetSQLValueString($this->fk_quiz_cat, \"int\"));\n\t\t$getQuery = mysql_query($query, $quizroo) or die(mysql_error());\n\t\t$row_getQuery = mysql_fetch_assoc($getQuery);\n\t\treturn $row_getQuery['cat_name'];\n\t}", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public static function getCategory()\n {\n return self::$category;\n }", "public function getCategory() {\r\n return $this->catList->find('id', $this->categoryId)[0];\r\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory() {\n return $this->category;\n }", "public function getCategory(): string;", "function getCategory()\r\n\t\t{\r\n\t\t\treturn $this->category;\r\n\t\t\t\r\n\t\t}", "private function retrieve_category() {\n\t\t$replacement = null;\n\n\t\tif ( ! empty( $this->args->ID ) ) {\n\t\t\t$cat = $this->get_terms( $this->args->ID, 'category' );\n\t\t\tif ( $cat !== '' ) {\n\t\t\t\t$replacement = $cat;\n\t\t\t}\n\t\t}\n\n\t\tif ( ( ! isset( $replacement ) || $replacement === '' ) && ( isset( $this->args->cat_name ) && ! empty( $this->args->cat_name ) ) ) {\n\t\t\t$replacement = $this->args->cat_name;\n\t\t}\n\n\t\treturn $replacement;\n\t}", "public function getCategory()\n\t{\n\t\treturn $this->data['category'];\n\t}", "public function getCategory()\n {\n return $this->_category;\n }", "public function getCategory()\n\t{\n\t\treturn $this->category;\n\t}", "public function getCategory()\n {\n return $this->readOneof(2);\n }", "function getCategory() \n {\n return $this->instance->getCategory();\n }", "public function getCategory(){\n return $this->category;\n }", "public function get_category(){\n\t\t$this->load->model('seller/product_model');\n\t\t$category = $this->product_model->get_category();\n\t\treturn $category;\n\t}", "public function getCategory() {\n return $this->category;\n }", "public function getCategory()\n {\n\n return $this->category;\n }", "public function getCategory() {\n\t\treturn $this->category;\n\t}", "public function get_catR()\n {\n return $this->_catR;\n }", "function getCategory() {\n\t\t$categoryId = JRequest::getInt('category_id', 0) ;\n\t\t$sql = 'SELECT * FROM #__eb_categories WHERE id='.$categoryId;\n\t\t$this->_db->setQuery($sql) ;\n\t\treturn $this->_db->loadObject();\t\t\t\n\t}", "public function getCategory($name);", "public function getCategory()\n {\n return $this->category;\n }", "public function get_category() {\n $data['get_category'] = $this->Category_model->get_category();\n return $data['get_category'];\n }", "public function getCat()\n {\n $query = $this->db->get('categories');\n\n return $query->result();\n }", "function getCategory() {\n\t\treturn $this->node->firstChild->toString();\n\t}", "public function category() {\n\t\treturn static::get_thrive_advanced_label();\n\t}", "public function getCategory(): ?string;", "public function getProduct_category () {\n\t$preValue = $this->preGetValue(\"product_category\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"product_category\")->preGetData($this);\n\treturn $data;\n}", "public function get_category()\n {\n return $this->primary_category();\n }", "public function getCategory() {\n return $this->randomQuote->category_name;\n }", "public function getCategorie()\n {\n return $this->categorie;\n }", "public function getCategory(): string|null;", "public function GetCategory()\r\n {\r\n return AppHelper::GetCategory($this->Core);\r\n }", "function getCategory() {\n // Load categories.\n $categories = userpoints_get_categories();\n return isset($categories[$this->getTid()]) ? $categories[$this->getTid()] : $categories[userpoints_get_default_tid()];\n }", "public function getCategory(){\r\n return Mage::registry('current_category');\r\n }", "public function get_categorie(){\n\t\treturn $this->search_categorie;\n\t}", "public function category() {\n\t\treturn static::get_thrive_basic_label();\n\t}", "public function getCategoria()\n {\n return $this->categoria;\n }", "public function getCategoria()\n {\n return $this->categoria;\n }", "public function getCategory()\n {\n return \"Injection Flaws\"; //See category.php for list of all the categories\n }", "public function get_category()\n {\n return 'Graphical';\n }", "public function get_category()\n {\n return 'Graphical';\n }", "public function getCat()\n {\n return $this->cat = get_the_category($this->id);\n }", "public function getCategoria()\n {\n return \"Cliente com Risco\";\n }", "public function get_category($key = 0)\n {\n }", "public function get_category($key = 0)\n {\n }", "public function get_category($key = 0)\n {\n }", "function get_category_by_id($cate_id) {\n App::import(\"Model\", \"Category\");\n $model = new Category();\n $categoryInfo = $model->findById($cate_id);\n return (!empty($categoryInfo['Category']['title']))?$categoryInfo['Category']['title']:\"\";\n }", "public function get_category()\n {\n return C__CATG__INVOICE;\n }", "private function getCategory() {\n return '';\n }", "function get_category_by_id($cate_id) {\n App::import(\"Model\", \"Category\");\n $model = new Category();\n $categoryInfo = $model->findById($cate_id);\n return $categoryInfo['Category']['title'];\n }", "public function getRateCategory()\n {\n return $this->rateCategory;\n }", "public function getCategory() {\r\n return \\models\\Database::validateData($this->_category, 'string|specialchars|strip_tags');\r\n }", "public function getCategoria()\n {\n return $this->categoria;\n }", "private function retrieve_category_description() {\n\t\treturn $this->retrieve_term_description();\n\t}", "public function getCategory(){\n\n\t\t $this->db->where('delete_status',0);\n\t $query=$this->db->get('category'); \n\t return $query->result();\n\n\t}", "public function getViewedCategory();", "public function get_category()\n {\n return 'Information Display';\n }", "public function getCategory()\n {\n return $this->hasOne(MgfSelectionCategory::className(), ['id' => 'category_id']);\n }", "public function get_category()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$result\t=\t$this->db->get('category')->result();\n\t\t\tif(empty($result))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}catch(ErrorGetCategory $e){\n\t\t\tlog_message('debug','Error tratando de obtener informaci�n del usuario');\n\t\t\treturn FALSE;\n\t\t}\n\t}", "private function getCategory() {\n\n $category = Category::with('records');\n /**\n * Filter slug\n */\n $category = Category::where('slug', $this->property('categorySlug'));\n\n /**\n * Filter active only\n */\n if( $this->property('activeOnly') ) {\n $category->isActive();\n }\n\n $categoryDetail = $category->first();\n\n return $categoryDetail;\n\n }", "public function category(){\n\t\t$_error = \"Select Category\";\n\t\treturn $_error;\n\t}", "function article_category() {\n $category = Registry::get('category');\n return $category->title;\n}", "public function get_cat_one()\n {\n $select = $this->db->get('category_one');\n $cat_one = $select->result();\n return $cat_one;\n }", "public function getCategory()\n {\n if (!$this->_category) {\n $this->_category = Mage::registry('current_category');\n }\n return $this->_category;\n }", "public function getCurrentCategory()\n {\n return $this->category;\n }", "function getCategoryNameById($cat_id) {\n $ci = & get_instance();\n $category = $ci->crud->get(ES_PRODUCT_CATEGORIES, array('id' => $cat_id));\n if (count($category) > 0) {\n return $category['name'];\n } else {\n return \"Not available\";\n }\n}", "function getRatingCategoryById($categoryId) {\n global $RATING_CATEGORY_BY_ID_SQL;\n \n $SQL = sprintf($RATING_CATEGORY_BY_ID_SQL, $categoryId); \n $result = mysql_query($SQL);\n\n $category = array();\n if (mysql_num_rows($result) == 0) {\n return $category;\n }\n \n $row = mysql_fetch_array($result);\n \n $category['id'] = $row['srcid'];\n $category['title'] = $row['title'];\n $category['description'] = $row['description'];\n $category['start'] = $row['start'];\n $category['end'] = $row['end'];\n $category['specialOrder'] = $row['specialOrder'];\n \n return $category;\n}", "public function category()\n {\n // check if user is already loaded, if not, we fetch it from database\n if (!$this->_category) {\n $categories = new Application_Model_DbTable_Categories();\n try {\n $this->_category = $categories->findById($this->_category_id);\n } catch (Exception $e) {\n $this->_category = null;\n }\n }\n return $this->_category;\n }", "private function getCategory()\n {\n $catobj = (object)Array();\n $catobj->preview = $this->getFilePath('preview');\n $catobj->category = $this->category_number;\n $catobj->html = $this->getContent();\n $catobj->googleFonts = [];\n $catobj->contentCss = $this->getFilePath('relative_css');\n $catobj->contentClass = $this->getCSSClass($this->getFilePath('css'));\n return $catobj;\n }", "function setup_cat()\n {\n $this->ipsclass->DB->simple_construct( array( \"select\" => 'perms_view, def_view, id, name', 'from' => 'gallery_categories', 'where' => \"id={$this->ipsclass->input['cat']}\" ) );\n $this->ipsclass->DB->simple_exec(); \n $cat = $this->ipsclass->DB->fetch_row();\n\n // Are we allowed to view this category?\n if( ! $this->ipsclass->check_perms( $cat['perms_view'] ) )\n {\n $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) ); \n }\n\n return $cat;\n }" ]
[ "0.72546226", "0.72053415", "0.72053415", "0.7106401", "0.7034859", "0.69191504", "0.68381095", "0.68334365", "0.6826384", "0.679256", "0.67592597", "0.67592597", "0.6756792", "0.67390704", "0.66927695", "0.66927695", "0.66927695", "0.6691882", "0.6691882", "0.6691882", "0.6691882", "0.6691882", "0.6691882", "0.6691882", "0.6691882", "0.6691882", "0.6691882", "0.6691882", "0.6691882", "0.6691882", "0.6691882", "0.6691882", "0.6691882", "0.6684046", "0.66705984", "0.6665641", "0.6658133", "0.66496885", "0.66124284", "0.66084015", "0.66003346", "0.65925", "0.657788", "0.65544945", "0.6551104", "0.6536952", "0.6534965", "0.6530606", "0.6507083", "0.6501076", "0.6490812", "0.6488334", "0.6440402", "0.64402914", "0.6439039", "0.639706", "0.63957274", "0.6376932", "0.63407356", "0.6337954", "0.6320412", "0.6299123", "0.6293409", "0.6293019", "0.62828064", "0.6281711", "0.6275258", "0.6275258", "0.6260298", "0.6241352", "0.6241352", "0.6240539", "0.6236162", "0.6234808", "0.62347895", "0.62347895", "0.62307966", "0.6227402", "0.62154746", "0.621133", "0.6208141", "0.6191802", "0.6172293", "0.6162879", "0.6154576", "0.6128233", "0.6115047", "0.6106515", "0.6100519", "0.60992146", "0.60812545", "0.60680324", "0.60637784", "0.6058849", "0.6046276", "0.6041517", "0.603518", "0.60248244", "0.60237944", "0.60151803" ]
0.6591083
42
Save a new recommandation category in database
function saveRecommandationCategory($categoryRecommandationInformations) { global $wpdb; foreach($categoryRecommandationInformations as $field => $value) { if ($field != 'id') { $category_recommandation_query_args[ $field ] = $value; } } $category_recommandation_query = $wpdb->insert( TABLE_CATEGORIE_PRECONISATION, $category_recommandation_query_args ); if ( false !== $category_recommandation_query ) { $reponseRequete = 'done'; } else { $reponseRequete = 'error'; } return $reponseRequete; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpdb->insert_id;\n\t\t} else\n\t\t\t$wpdb->update(FAQBUILDDBCATEGORY,$this->toArray(true),array(\"category_id\"=>$this->category_id),$types,array(\"%d\"));\n\t}", "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 }", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "public function actionCategorySave()\n {\n $this->_assertCanManageCategories();\n\n $category_id = $this->_input->filterSingle('faq_id', XenForo_Input::UINT);\n $saveAction = new XenForo_Phrase('iversia_faq_category_added');\n\n $dw = XenForo_DataWriter::create('Iversia_FAQ_DataWriter_Category');\n if ($category_id) {\n $dw->setExistingData($category_id);\n $saveAction = new XenForo_Phrase('iversia_faq_category_edited');\n }\n $dw->bulkSet(\n array(\n 'title' => $this->_input->filterSingle('title', XenForo_Input::STRING),\n 'display_order' => $this->_input->filterSingle('display_order', XenForo_Input::UINT),\n )\n );\n $dw->save();\n\n return $this->responseRedirect(\n XenForo_ControllerResponse_Redirect::SUCCESS,\n XenForo_Link::buildPublicLink('faq'),\n $saveAction\n );\n }", "public function save(){\n\t\t$sql = new Sql();\n\n\t\t$results = $sql->select(\"CALL sp_categories_save(:idcategory, :descategory)\", array(\n\t\t\t\":idcategory\"=>$this->getidcategory(),\n\t\t\t\":descategory\"=>$this->getdescategory()\n\t\t));\n\n\t\t$this->setData($results[0]);\n\n\n\t\tCategory::updateFile();\n\n\t}", "public function save_category_info($data) {\n $this->db->insert('tbl_category', $data);\n }", "public function addcompanycategory(){\n $data = ['name'=> post('categoryname')];\n $this->Database->insert_data('companycategories',$data);\n flash('green','check',\"Kategoriya uğurla əlavə edildi.\");\n back();\n }", "function addCategory() {\n var_dump($this->request->data);\n if ($this->request->is('post') || $this->request->is('put')) {\n $ci = $this->CategoryItem->create();\n var_dump($ci);\n if ($this->CategoryItem->save($this->request->data)) {\n $this->Session->setFlash(__('The %s has been saved', __('link')), 'flash/success');\n } else {\n $this->Session->setFlash(__('The %s could not be saved. Please, try again.', __('link')), 'flash/failure');\n }\n// $this->redirect(array('action' => 'edit', $this->Item->id));\n } else {\n $this->redirect(array('action' => 'index'));\n }\n }", "public function category_add() {\n $this->autoRender = false;\n $params = $this->request->data;\n //echo \"<pre>\";print_r($params);echo \"</pre>\"; exit;\n $categoryTable = TableRegistry::get('SkillCategory');\n $getCategory = $categoryTable->find()->select(['id'])->where(['category_name' => $params['category_name']])->toArray();\n if(empty($getCategory)){\n $category = $categoryTable->newEntity($params);\n if ($categoryTable->save($category)) {\n echo json_encode(\n [\n 'status' => 1,\n 'message' => \"Skill Category Added!\",\n ]\n );\n exit;\n }\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"Skill Category Already Exists!\",\n ]\n );\n exit;\n }\n \n }", "public function add_category()\n {\n \n if(isset($_POST['category_name']) && isset($_POST['category_desc'])){\n\t\t \n\t\t \n\t\t $query = $this->Product_model->add_category();\n\t\t\t if($query){\n\t\t\t\t \n\t\t\t\t echo 'added';\n\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t echo 'error';\n\t\t\t\t\t }\n\t\t \n\t\t }\n \n }", "public function store()\n\t{\n\t\t$description = Input::get('description'); \n\t\t$acronym = substr($description, 0, 1);\n\t\t$category = new Category(); \n\t\t$category->language_id = Input::get('language_id'); \n\t\t$category->description = $description;\n\t\t$category->acronym = $acronym;\n\t\t$category->save(); \n\t\treturn Response::json(array('success'=>'Categoria registrada exitosamente')); \n\t}", "public function modifyCategory(){\n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t\t$id = $_REQUEST['id'];\t\t\n\t\t$name = $_REQUEST['name'];\n\t $remark = $_REQUEST['remark'];\n $father = $_REQUEST['father'];\n\t\t$form = M('categoryinfo');\n \t//$key = 2;\n \t$condition['id'] = $id;\n \t$data = $form->where($condition)->find();\n \t//var_dump($data); \n $data['id'] = $id;\n \t$data['name'] = $name;\n\t\t$data['remark'] = $remark;\n $data['father'] = $father;\n \t//echo $data;\n\t\t$result = $form->save($data);\n\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t\t\t//\telse {$this->error('修改失败');}\n\t\t}", "public function save()\n {\n $error = true;\n\n // Save the not language specific part\n $pre_save_category = new self($this->category_id, $this->clang_id);\n\n if (0 === $this->category_id || $pre_save_category !== $this) {\n $query = rex::getTablePrefix() .'d2u_linkbox_categories SET '\n .\"name = '\". addslashes($this->name) .\"' \";\n\n if (0 === $this->category_id) {\n $query = 'INSERT INTO '. $query;\n } else {\n $query = 'UPDATE '. $query .' WHERE category_id = '. $this->category_id;\n }\n $result = rex_sql::factory();\n $result->setQuery($query);\n if (0 === $this->category_id) {\n $this->category_id = (int) $result->getLastId();\n $error = !$result->hasError();\n }\n }\n\n return $error;\n }", "public function category_add() {\n\t\t// Setup validation\n\t\t$this->data['validation'] = \"\";\n\t\t$this->data['category']\t= array('name' => '', 'url_name' => '');\n\t\t\n\t\t// Handle POST\n\t\tif ($this->mojo->input->post('category')) {\n\t\t\t// Get the category data\n\t\t\t$this->data['category']\t= $this->mojo->input->post('category');\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert_category($this->data['category'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/categories_all');\n\t\t\t\t$response['message'] = 'Successfully created category';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Show the view\n\t\t$this->_view('category_add');\n\t}", "public function add_new_category_post(){\n $data = $this->security->xss_clean($_POST);\n $data = $this->DeviceCategory_model->add_new_category($data);\n if (isset($data['status']) == 'FALSE')\n {\n $this->response($data, REST_Controller::HTTP_SEE_OTHER);\n }\n $this->set_response($data, REST_Controller::HTTP_CREATED);\n }", "public function add_post()\n {\n $input = $this->input->post();\n $user=$this->session->userdata('uid');\n $data=$this->Category_model->insertData($input,$user);\n if($data==1)\n $this->response('Category information added.', REST_Controller::HTTP_CREATED);\n else\n $this->response('Category already present!', REST_Controller::HTTP_OK);\n }", "public function insert_category() {\n\n $this->load->model('Categories');\n\n $category_id = $this->auth->generator(15);\n\n\n\n //Customer basic information adding.\n\n $data = array(\n\n 'category_id' => $category_id,\n\n 'category_name' => $this->input->post('category_name'),\n\n 'status' => 1\n\n );\n\n\n\n $result = $this->Categories->category_entry($data);\n\n\n\n if ($result == TRUE) {\n\n $this->session->set_userdata(array('message' => display('successfully_added')));\n\n echo TRUE;\n\n } else {\n\n $this->session->set_userdata(array('error_message' => display('already_exists')));\n\n echo FALSE;\n\n }\n\n }", "public function store(MicategoryRequest $request)\n {\n //\n M_i_category::create($request->all());\n \\Session::flash('flash_message','M Item Category 情報を追加しました');\n return redirect('micategories');\n }", "public function category_save(){\n\n if (!has_role($this->session->userdata('user_id'), 'CATEGORY_CREATE')) {\n redirect(base_url('page_not_found'));\n }\n\n $data['name'] = html_escape($this->input->post('name'));\n\n if(html_escape($this->input->post('parent')) == ''){\n $data['parent'] = 0;\n }else{\n $data['parent'] = html_escape($this->input->post('parent'));\n }\n \n\n \n if($data['parent'] != 0 && !$this->category_model->is_parent_category($data['parent'])){\n \n $this->session->set_flashdata('category_save_failed', \"Failed to save sub category!!\");\n }else{\n \n $data['created_at'] = date(\"Y-m-d H:i:s\");\n \n $base_slug = string_to_slug($data['name']);\n $data['slug'] = $base_slug;\n $category_id = $this->category_model->add_category($data);\n \n // debug($data);\n // exit;\n if ($category_id){\n\n $this->logger\n ->user($this->session->userdata('user_id')) //Set UserID, who created this Action\n ->user_details($this->user_model->getUserInfoByIpAddress())\n ->type('category_save') //Entry type like, Post, Page, Entry\n ->id($category_id) //Entry ID\n ->token('CREATE') //Token identify Action\n ->comment($this->session->userdata('name'). ' create new category.')\n ->log(); //Add Database Entry\n\n\n\n $this->session->set_flashdata('category_save_success', \"New Category Create Successfully!!\");\n } else {\n $this->session->set_flashdata('category_save_failed', \"Failed to save category!!\");\n }\n\n\n }\n\n redirect(base_url('categories')); \n\n \n }", "public function store()\n\t{\n\t\t$category \t\t= \tInput::get('category');\n\t\t$categoryList \t=\tInput::get('categoryList');\n\t\tif ($category \t== \tnull) : \n\t\t\treturn Redirect::route('admin.categories.index')->with('message-error','همه گزینه ها اجباری است.')->withInput();\n\t\tendif;\n\t\tCategory::setCategory($category,$categoryList);\n\t\treturn Redirect::route('admin.categories.index')->with('message-success','دسته ایجاد شد.');\n\t}", "public function save() {\n\t\t$date = date('Y-m-d H:i:s');\n\t\t$this->setLast_modified($date);\n\t\t\n\t\tif (!is_null($this->getId())) {\n\t\t\t$sql = 'update cart_categories set ';\n\t\t} else {\n\t\t\t$sql = 'insert into cart_categories set ';\n\t\t\t$this->setDate_added($date);\n\t\t}\n\t\tif (!is_null($this->getImage())) {\n\t\t\t$sql .= '`categories_image`=\"' . e($this->getImage()->getId()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getParent_id())) {\n\t\t\t$sql .= '`parent_id`=\"' . e($this->getParent_id()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getSort_order())) {\n\t\t\t$sql .= '`sort_order`=\"' . e($this->getSort_order()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getDate_added())) {\n\t\t\t$sql .= '`date_added`=\"' . e($this->getDate_added()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getLast_modified())) {\n\t\t\t$sql .= '`last_modified`=\"' . e($this->getLast_modified()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getStatus())) {\n\t\t\t$sql .= '`categories_status`=\"' . e($this->getStatus()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getId())) {\n\t\t\t$sql .= 'categories_id=\"' . e($this->getId()) . '\" where categories_id=\"' . e($this->getId()) . '\"';\n\t\t} else {\n\t\t\t$sql = trim($sql, ', ');\n\t\t}\n\t\tDatabase::singleton()->query($sql);\n\t\t$catId = Database::singleton()->lastInsertedID();\n\t\t$new = false;\n\t\tif (is_null($this->getId())) {\n\t\t\t$this->setId($catId);\n\t\t\t$new = true;\n\t\t\t$sql = 'insert into cart_categories_description set ';\n\t\t} else {\n\t\t\t$sql = 'update cart_categories_description set ';\n\t\t}\n\t\t$sql .= '`language_id`=\"' . 1 . '\", ';\n\t\t$sql .= '`categories_name`=\"' . e($this->getName()) . '\", ';\n\t\t$sql .= '`categories_description`=\"' . e($this->getDescription()) . '\"';\n\t\t\n\t\tif ($new) {\n\t\t\t$sql .= ', `categories_id`=\"' . e($this->getId()) . '\"';\n\t\t} else {\n\t\t\t$sql .= ' where `categories_id`=\"' . e($this->getId()) . '\"';\n\t\t}\n\t\tDatabase::singleton()->query($sql);\n\t\t\n\t\tself::__construct($this->getId());\n\t}", "public function addCategory(){\n if (isset($_POST[\"add_category\"])) {\n $categories = $this->model('Categories');\n $system = $this->model('System');\n $cat_name = $_POST[\"cat_name\"];\n $cat_sef_url = $system->seflink($cat_name);\n\n $categories->addCat($cat_name,$cat_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/categories');\n }", "public function createCategory();", "public function store(){\n $query = require 'core/bootstrap.php';\n \n $category = $_POST['category'];\n if(empty($category)){\n Validate::errorValidation('Category\\'s name is required!');\n return back();\n }elseif(strlen($category) < 3){\n Validate::errorValidation('Category\\'s name must have up to 3 characters');\n return back();\n }else{\n\n $query->insert('categories',[\n 'name' => $category\n ]);\n \n Validate::successValidation('Category stored successfully!!!');\n return redirect('categories');\n }\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"index\"\n ));\n }\n\n $id = $this->request->getPost(\"id\");\n\n $category = ArticleCategories::findFirstByid($id);\n if (!$category) {\n $this->flash->error(\"category does not exist \" . $id);\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"index\"\n ));\n }\n\n $category->id = $this->request->getPost(\"id\");\n $category->name = $this->request->getPost(\"name\");\n $category->description = $this->request->getPost(\"description\");\n \n\n if (!$category->save()) {\n\n foreach ($category->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"edit\",\n \"params\" => array($category->id)\n ));\n }\n\n $this->flash->success(\"category was updated successfully\");\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"index\"\n ));\n\n }", "public function addPost(){\n\n if ($this->input->post(\"category_create\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n $categoryName = $this->input->post(\"category_name\");\n\n $this->validate->setRule(\"minlength\",$categoryName,3, \"Category name length must be more then 3 symbols!\");\n\n if ($this->validate->validate() === false){\n $error = $this->validate->getErrors();\n $this->view->redirect(\"/categories/manage\",$error);\n }\n\n $categoryModel = new CategoriesModel();\n try{\n if ($categoryModel->hasCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"This categories already exist!\");\n }\n\n if($categoryModel->addNewCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"Category created successfully!\",\"success\");\n }\n }catch (\\Exception $exception){\n $this->view->redirect(\"/categories/manage\",$exception);\n }\n }", "public function add()\n {\n $category = $this->Category->newEntity();\n if ($this->request->is('post')) {\n $category = $this->Category->patchEntity($category, $this->request->getData());\n if ($this->Category->save($category)) {\n $this->Flash->success(__('The category has been saved.'));\n\n return $this->redirect(['action' => 'index']);\n }\n $this->Flash->error(__('The category could not be saved. Please, try again.'));\n }\n $this->set(compact('category'));\n }", "public function category()\n { \n if($this->access_role->is_Admin() == false) show_404();\n $this->load->model('Category_Model');\n \n if($_SERVER['REQUEST_METHOD'] == 'POST')\n {\n if($this->form_validation->run('category_insert') ){\n $this->Category_Model->add_category(); \n } else {\n $error = ['class'=>'warning','text'=> validation_errors()];\n $this->session->set_flashdata('sms_flash', $error); \n redirect('Dashboard/category');\n }\n } \n else{\n $data = $this->Category_Model->view_category();\n }\n \n $this->load->view('admin/category_content',$data);\n }", "public function store(Request $request){\n $category = new category();\n $category->nom = $request->input('nom');\n $category->save();\n $message='Categorie bien ajouté';\n return redirect('/admin/listecat')->withMessage($message);\n\n }", "public function save_category ($data) {\n\t\t$slug = \\Illuminate\\Support\\Str::slug($data->category, '-');\n\t\t$category = new Category();\n\t\t$category->category = $data->category;\n\t\t$category->slug = $slug;\n\t\t$category->description = $data->description;\n\n\t\t$category->save();\n\t\treturn true;\n\t}", "public function add_category() {\n\t $this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(substr($_POST[\"id\"], 4));\n\t\t$this->model->categories = $category;\n\t\tif(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\n\t}", "public function addCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t \t$name = $_REQUEST['name'];\n $father = $_REQUEST['father'];\n\t\t\t$form = M(\"categoryinfo\");\n\t\t\t$addnew['name'] = $name;\n $addnew['father'] = $father;\n\t\t\t$result = $form->add($addnew);\n\t\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t//else {$this->error('添加失败');}\n }", "function addChoiceCategory($data){\n\n\t\t$this->db->insert('tbl_choice_category',$data);\n\t\treturn $this->db->insert_id();\n\t\t\n\t}", "public function store($categoria)\n {\n $this->db->insert('categorias', $categoria);\n }", "function save(){\n\t\t// $insert_query = 'INSERT INTO tb_categories';\n\t\t// $insert_query .= ' SET ';\n\t\t// $insert_query .= ' name = \"'.$this->name.'\"';\n\n\t\t// $this->db->query($insert_query);\n\t\t\tif($this->page_id){\n\t\t\t\t$this->update();\n\t\t\t}else{\n\t\t\t\t$this->page_id = $this->db->insert(\n\t\t\t\t\t'tb_pages',\n\t\t\t\t\tarray(\t\t\t\t\t\n\t\t\t\t\t'title' => $this->title,\n\t\t\t\t\t'content' => $this->content)\n\t\t\t\t);\n\t\t\t}\n\t\t}", "public function categoryStore(Request $request){\n $category = new ProductCategory();\n $category->category_name = $request->category_name;\n $category->company_id = company_id();\n $category->save();\n return redirect()->back();\n }", "public function storeCategory()\n {\n $this->validate([\n 'name' =>'required',\n 'slug' =>'required|unique:categories'\n ]);\n $category = new Category();\n $category->name = $this->name; \n $category->slug = $this->slug;\n $category->save();\n $this->dispatchBrowserEvent('success');\n //$this->emit('alert', ['type' =>'success', 'message' => 'Operation Successful']);\n //session()->flash('message', 'Category has been saved successfully');\n //$this->dispatchBrowserEvent('hide-form', ['message' => 'Category Added Successfully']);\n }", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "function savecat(){\n\n $data =[\n\n 'reservation_category' => $_POST['reservation_category'],\n 'category_description' => $_POST['category_description'],\n 'reservation_duration' => $_POST['reservation_duration']\n\n ];\n\n insert( 'reservation_categories', $data );\n\n redirect( route('dashboard/reservation/categories') );\n}", "public function store(SaveProvisionCategoryRequest $request) {\n DB::insert(\"INSERT INTO provision_categories VALUES(NULL,:category_name)\",[\n 'category_name' => $request->input('category_name')\n ]);\n\n return redirect()->back()->with('message','Provision Category added successfully');\n }", "public function add_attr_cat()\n\t{\n\t\t$rest_id=$this->session->userdata('user_rest_uns');\n\t\t$cat_name=$this->input->post('cat_name');\n\t\t$query=$this->db->insert(\"food_attribute\",array(\"f_att_name\"=>$cat_name,\"rest_id\"=>$rest_id));\n\t\t\n\t\tif($query)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function submit(){\n\t$parent_category = $this->uri->segment(4);\n\tif (!is_numeric($parent_category)){\n\t\t$parent_category = 0;\n\t}\n\n\t$this->form_validation->set_rules('category_name', 'Category Name', 'required');\n\n\tif ($this->form_validation->run() == FALSE){\n\t\t$this->create();\n\t} else {\n\n\t\t$update_id = $this->uri->segment(3);\n\n\t\tif ($update_id > 0){\n\t\t\t//This is an update\n\t\t\t$data = $this->get_data_from_post();\n\t\t\t$data['category_url'] = url_title($data['category_name']);\n\t\t\t$this->update($update_id, $data);\n\t\t\t$value = \"<p style = 'color: green;'>The category was successfully updated.</p>\";\n\t\t\t$parent_category = $update_id;\n\t\t} else {\n\t\t\t//Create new record\n\t\t\t$data = $this->get_data_from_post();\n\t\t\t$data['category_url'] = url_title($data['category_name']);\n\t\t\t$data['parent_category'] = $parent_category;\n\t\t\t$this->insert($data);\n\t\t\t$value = \"<p style = 'color: green;'>The category was successfully created.</p>\";\n\t\t\t$update_id = $this->get_max();\n\n\t\t\t$this->session->set_flashdata('category', $value);\n\t\t\t\n\t\t}\n\t\t//add flashdata\n\t\t$this->session->set_flashdata('category', $value);\t\n\n\t\tredirect ('store_categories/manage/'.$parent_category);\n\t\t\n\t}\n}", "function EnregistrerNouvelleCategorie($nom) {\n global $mysql;\n $nom = $mysql->quote($nom);\n $requete = \"INSERT INTO \" . DB_PREFIX . \"CATEGORIES (NOM) values($nom)\";\n requete ( $requete );\n}", "public function store(CategoryRequest $request)\n {\n $cate = new Category;\n $cate->name = $request->txtCateName;\n $cate->alias = changeTitle($request->txtCateName);\n $cate->order = $request->txtOrder;\n $cate->parent_id = $request->sltParent;\n $cate->keywords = $request->txtKeywords;\n $cate->description = $request->txtDesc;\n $cate ->save();\n return redirect()->route('categorys.create')->with('add','Thêm danh mục mới thành công');\n\n }", "protected function saveCategoryFromCategory($form){\n $data = $this->getRequest()->getPost();\n //@todo: validate the data\n $form->setData($data);\n if ($form->isValid()) {\n \n $this->category->exchangeArray($form->getData());\n $categoryTable = $this->getServiceLocator()->get(\"Category\\Model\\CategoryTable\");\n $this->category = $categoryTable->saveCategory($this->category);\n \n if($id = $this->category->getId()){\n $this->redirect()->toRoute('category_home');\n }\n }else{\n \n }\n }", "public function store()\n {\n $this->validate(request(),[\n 'categoryname' => 'required',\n 'description' => 'max:200'\n ]);\n\n $cateName=strtolower(trim(request('categoryname')));\n $testCate=Category::where('name','=',$cateName)->first();\n $categorydes=request('description');\n //if there is no category create new one\n if($testCate==null){\n\n $newcategory=Category::create([\n 'teacher_id' => auth('teacher')->id(),\n 'name' => request('categoryname'),\n 'description' => $categorydes\n ]);\n\n $newcategory->description=$categorydes;\n $newcategory->save();\n session()->flash('message','categoty successfully created');\n return redirect(route('teacher.dashboard'));\n\n }\n else {\n\n session()->flash('message','duplicate category name');\n return redirect()->back();\n\n }\n\n }", "function InsertCategory_board()\n {\n $this->model->InsertCategory();\n }", "public function new_category() {\n\t\t$this->use_layout=false;\n\t\t$cat = new CmsCategory;\n\t\t$cat->name = Request::get(\"cat\");\n\t\t$cat->save();\n\t\tif(!$this->all_categories = $cat->clear()->all()) $this->all_categories=array();\t\t\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\t\n\t}", "public function saveCategory(Request $request){\n if (Category::where('name', $request->get('category'))->exists()){\n // found\n }\n else{\n $level = $request->get('parent') == ''? 1 : 2;\n if ($level == 1){\n $parent = null;\n }\n else{\n $parent = Category::where('name', $request->get('parent'))->first()->id;\n }\n Category::insert([\n 'name' => $request->get('category'),\n 'level' => $level,\n 'parent_id' => $parent,\n 'created_at' => new \\DateTime(),\n 'updated_at' => new \\DateTime()\n ]);\n }\n return redirect()->route('all-categories');\n }", "public function add()\n {\n $category = new stdClass();\n $category->category_id = null;\n $category->name = null;\n $data = [\n 'page' => 'add',\n 'row' => $category\n ];\n $this->template->load('template', 'product/category/category_add', $data);\n }", "public function SaveGroupCategory() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->lstGroup) $this->objGroupCategory->GroupId = $this->lstGroup->SelectedValue;\n\t\t\t\tif ($this->calDateRefreshed) $this->objGroupCategory->DateRefreshed = $this->calDateRefreshed->DateTime;\n\t\t\t\tif ($this->txtProcessTimeMs) $this->objGroupCategory->ProcessTimeMs = $this->txtProcessTimeMs->Text;\n\n\t\t\t\t// Update any UniqueReverseReferences (if any) for controls that have been created for it\n\n\t\t\t\t// Save the GroupCategory object\n\t\t\t\t$this->objGroupCategory->Save();\n\n\t\t\t\t// Finally, update any ManyToManyReferences (if any)\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}", "public function storeNutrationCategory(Request $request)\n {\n $this->validate($request,array(\n 'nutrationCategoryName' => 'required',\n //'tips' => 'required',\n ));\n\n $nutrationCategory = new NutrationCategory;\n\n $nutrationCategory->nutration_category_name = $request->nutrationCategoryName;\n //$nutrationCategory->tips = $request->tips;\n\n $nutrationCategory->save();\n\n if($nutrationCategory->save()){\n return redirect()->back()->with('success','Nutration category Saved successfully.');\n }\n else{\n return redirect()->back()->with('denger-success','Nutration category is not saved.');\n }\n \n }", "public function store(CategoryCreateRequest $request)\n {\n $datoscategoria = request()->all();\n categoria::create($datoscategoria);\n /* Envia mensaje */\n toast('¡Categoria guardada!','success');\n return redirect()->action('productoscrud@create');\n }", "public function addCategory($category_name){\n\n //write the query to insert into taable\n $query = \"INSERT INTO category(category_name) \n VALUES ('$category_name')\";\n\n //check if the query() runs // data is insert into users table\n if ($this->dbobj->dbcon->query($query)===true){\n\n\n \n echo \" Category was successfully added\";\n \n }\n else{\n echo \"Error\".$this->dbobj->dbcon->error;\n }\n }", "public function add_acct_category(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\nif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['ledger1'] = $this->db->get_where('acct_categories', ['category_type' => 'Main']);\n\t\t\t\n\t\t}\n\t\tif($this->input->post())\n\t\t{\n\t\t\tif($this->input->post('submit') != 'add_acct_category') die('Error! sorry');\n\n\t\t\t$this->form_validation->set_rules('category_name', 'Category Name', 'required|trim');\n\t\t\t$this->form_validation->set_rules('visible', 'Access To Payspecifications', 'required|trim');\n\n\t\t\tif($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t$insert = $this->ledger_model->add_acct_category();\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('successMsg', 'Accounts Category Created Successfully...!!!');\n\t\t\t\t\tredirect(base_url('ledger'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\ntheme('add_acct_category');\n\t}", "public function categories_add($param = null)\r\n {\r\n if (isset($_POST[\"cat_descr\"]) && !empty($_POST[\"cat_descr\"])) {\r\n $action = $_POST[\"cat_descr\"];\r\n $datas = Category::updateOrCreate([\r\n 'cat_descr' => $action,\r\n ]);\r\n // Return last insert row:\r\n echo $datas;\r\n } else {\r\n echo json_encode([\"message\" => \"ERROR!\"]);\r\n }\r\n }", "public function store(CategoryRequest $request)\n {\n $user = Auth::user();\n $category = new Category;\n if($request->category_id==0)\n {\n $category->category_id =0;\n $category->name = $request->input('name');\n $category->descripation = $request->input('descripation');\n $category->status = $request->input('published');\n $category->created_by = $user->id;\n $category->save();\n }\n else{\n $category->category_id = $request->input('category_id');\n $category->name = $request->input('name');\n $category->descripation = $request->input('descripation');\n $category->status = $request->input('published');\n $category->created_by = $user->id;\n $category->save(); \n }\n session()->flash('message', 'Category Create Successfully');\n session()->flash('type', 'success');\n return redirect('admin/category');\n }", "function saveCat()\n {\n //update stuff\n }", "public function store(CategoryCreateRequest $request)\n {\n //v1:\n //$request->validate(['name'=>'required']); // поле обязательно к заполнению , v2: валидация в папке \\request\\CategoryCreateRequest\n\n //dd($request->all());\n //dd($request->input('name'));\n //dd($request->only('name','desc'));\n //dd($request->except('name','desc'));\n //dd($request->has('name')); //=true\n //dd($request->path());\n //dd($request->url());\n //dd($request->fullurl());\n //dd($request->query('гет парам'));\n //dd($request->get('гет парам'));\n //$newsKat[] = ['id'=>intval(array_key_last( $this->newsKat))+2,'nameKat'=>$request->input('name')];\n //print_r($this->newsKat);\n\n //v1:\n //$id = DB::table('categ')->insertGetId(['name' => $request->input('name'), 'desc' => $request->input('desc')] );\n\n /*v2:\n $id = Categ::query()->insertGetId(['name' => $request->input('name'), 'desc' => $request->input('desc')] );\n\n if (!empty($id)) {$o='сохранено ';}\n else {$o='не сохранено';}\n $o .='<br><br> <a href=\"/adminc\">Управление Категориями</a><br>' ;\n //return redirect()->route('admin');\n return response($o);\n //return response->view('view.any');\n //return response->download('file.any');\n */\n\n //v3:\n $ctg= new Categ();\n\n if($request->isMethod('post')){\n $ctg->fill($request->all());\n $ctg->save();\n return redirect()->route('adminCateg');\n }\n return view('news.admin.categ.add');\n\n }", "public function save_category() {\n\t\t// If no form submission, bail!\n\t\tif ( empty( $_POST ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! isset( $_POST['set_redirection_category'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tcheck_admin_referer( 'rank-math-save-redirections', 'security' );\n\t\tif ( ! Helper::has_cap( 'redirections' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$cmb = cmb2_get_metabox( 'rank-math-redirections' );\n\t\t$values = $cmb->get_sanitized_values( $_POST );\n\n\t\t$values['redirection_category'] = isset( $values['redirection_category'] ) && is_array( $values['redirection_category'] ) ? $values['redirection_category'] : [];\n\t\tunset( $_POST['redirection_category'], $_POST['set_redirection_category'] );\n\n\t\tif ( empty( $values['id'] ) ) {\n\t\t\t$this->save_categories = $values['redirection_category'];\n\t\t\t$this->action( 'rank_math/redirection/saved', 'save_category_after_add' );\n\t\t\treturn true;\n\t\t}\n\n\t\twp_set_object_terms( $values['id'], array_map( 'absint', $values['redirection_category'] ), 'rank_math_redirection_category' );\n\t\treturn true;\n\t}", "function add_utility_bill_category()\n\t{\n\t\t$data['name']\t\t\t\t\t=\t$this->input->post('name');\n\t\t$data['created_on']\t\t\t\t=\ttime();\n\t\t$data['created_by']\t\t\t\t=\t$this->session->userdata('user_id');\n\t\t$data['timestamp']\t\t\t\t=\ttime();\n\t\t$data['updated_by']\t\t\t\t=\t$this->session->userdata('user_id');\n\n\t\t$this->db->insert('utility_bill_category', $data);\n\n\t\t$this->session->set_flashdata('success', 'New utility bill category has been added successfully.');\n\n\t\tredirect(base_url() . 'utility_bill_categories', 'refresh');\n\t}", "function insertCategory($data){\n\treturn dbInsert('categories', $data);\n}", "function addPostCategory(){\n\t\t$this->check_permission();\n\t \t\n\t\t\n\t \t$this->load->library('form_validation');\n\t\t$this->form_validation->set_rules('category_parent_id','Category','is_unique[tbl_category.category_title]|required');\n\t\t$this->form_validation->set_rules('category_title','Category Title','is_unique[tbl_category.category_title]|required');\n\t\t\n\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t'display_in_menu' => $this->input->post('display_in_menu'),\n\t\t\t\t'category_parent_id' => $this->input->post('category_parent_id'),\n\t\t\t\t'category_title' => $this->input->post('category_title'),\n\t\t\t\t'status' => $this->input->post('status'),\n\t\t\t\t'createdby' => $this->session->userdata('id'),\n\t\t\t\t'createdon' => date_timestamp_get(date_create()),\n );\n \n $category_id = $this->Post_model->insert_data('tbl_post_category',$params);\n if($category_id){\n\t\t\t$this->session->set_flashdata('msg', '<div class=\"alert alert-success\">record Added!</div>');\n\t\t\tredirect('secure/post/addpostcategory');\n\t\t\t}\n }\n else\n {\t\t\t$data['all_categorylist'] = $this->Post_model->get_post_categorylist();\n \n \n\t\t\t$this->render_template('secure/post/addPostCategory',$data);\n }\n\t}", "public function addCategory(Request $request){\n \t$this->validate($request, [\n \t\t'category' => 'required'\n \t]);\n\n \t$category = new Category;\n \t$category->category = $request->input('category');// this 'category' inside input is same as name='category' in form\n \t$category->save(); //save this category in database\n \treturn redirect('/category')->with('response','Category added successfully');\n }", "public function do_add(Request $request){\n\t\t$cat = new category();\n\t\t$c_name = $request->get(\"c_name\");\n\t\t$cat->insert(array(\"c_name\"=>$c_name));\n\t\treturn redirect(url('admin/category-news'));\n\t}", "public function save()\n {\n $error = false;\n\n // Save the not language specific part\n $pre_save_object = new self($this->category_id, $this->clang_id);\n\n // save priority, but only if new or changed\n if ($this->priority !== $pre_save_object->priority || 0 === $this->category_id) {\n $this->setPriority();\n }\n\n if (0 === $this->category_id || $pre_save_object !== $this) {\n $query = \\rex::getTablePrefix() .'d2u_machinery_categories SET '\n .\"parent_category_id = '\". ($this->parent_category instanceof self ? $this->parent_category->category_id : 0) .\"', \"\n .\"priority = '\". $this->priority .\"', \"\n .\"pic = '\". $this->pic .\"', \"\n .\"pic_usage = '\". $this->pic_usage .\"' \";\n if (rex_plugin::get('d2u_machinery', 'export')->isAvailable()) {\n $query .= \", export_europemachinery_category_id = '\". $this->export_europemachinery_category_id .\"', \"\n .\"export_europemachinery_category_name = '\". $this->export_europemachinery_category_name .\"', \"\n .\"export_machinerypark_category_id = '\". $this->export_machinerypark_category_id .\"', \"\n .\"export_mascus_category_name = '\". $this->export_mascus_category_name .\"' \";\n }\n if (rex_plugin::get('d2u_machinery', 'machine_agitator_extension')->isAvailable()) {\n $query .= \", show_agitators = '\". $this->show_agitators .\"' \";\n }\n\n if (\\rex_addon::get('d2u_videos') instanceof rex_addon && \\rex_addon::get('d2u_videos')->isAvailable() && count($this->videos) > 0) {\n $query .= \", video_ids = '|\". implode('|', array_keys($this->videos)) .\"|' \";\n } else {\n $query .= \", video_ids = '' \";\n }\n\n if (0 === $this->category_id) {\n $query = 'INSERT INTO '. $query;\n } else {\n $query = 'UPDATE '. $query .' WHERE category_id = '. $this->category_id;\n }\n\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n if (0 === $this->category_id) {\n $this->category_id = (int) $result->getLastId();\n $error = $result->hasError();\n }\n }\n\n $regenerate_urls = false;\n if (false === $error) {\n // Save the language specific part\n $pre_save_object = new self($this->category_id, $this->clang_id);\n if ($pre_save_object !== $this) {\n $query = 'REPLACE INTO '. \\rex::getTablePrefix() .'d2u_machinery_categories_lang SET '\n .\"category_id = '\". $this->category_id .\"', \"\n .\"clang_id = '\". $this->clang_id .\"', \"\n .\"name = '\". addslashes(htmlspecialchars($this->name)) .\"', \"\n .\"description = '\". addslashes(htmlspecialchars($this->description)) .\"', \"\n .\"teaser = '\". addslashes(htmlspecialchars($this->teaser)) .\"', \"\n .\"usage_area = '\". addslashes(htmlspecialchars($this->usage_area)) .\"', \"\n .\"pic_lang = '\". $this->pic_lang .\"', \"\n .\"pdfs = '\". implode(',', $this->pdfs) .\"', \"\n .\"translation_needs_update = '\". $this->translation_needs_update .\"', \"\n .'updatedate = CURRENT_TIMESTAMP, '\n .\"updateuser = '\". (\\rex::getUser() instanceof rex_user ? \\rex::getUser()->getLogin() : '') .\"' \";\n\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n $error = $result->hasError();\n\n if (!$error && $pre_save_object->name !== $this->name) {\n $regenerate_urls = true;\n }\n }\n }\n\n // Update URLs\n if ($regenerate_urls) {\n \\d2u_addon_backend_helper::generateUrlCache('category_id');\n \\d2u_addon_backend_helper::generateUrlCache('machine_id');\n if (rex_plugin::get('d2u_machinery', 'used_machines')->isAvailable()) {\n \\d2u_addon_backend_helper::generateUrlCache('used_rent_category_id');\n \\d2u_addon_backend_helper::generateUrlCache('used_rent_machine_id');\n \\d2u_addon_backend_helper::generateUrlCache('used_sale_category_id');\n \\d2u_addon_backend_helper::generateUrlCache('used_sale_machine_id');\n }\n }\n\n return !$error;\n }", "public function createNewCategory()\r\n{\r\n $query_string = \"INSERT INTO categories \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"categoryname = :categoryname, \";\r\n $query_string .= \"categorydescription = :categorydescription\";\r\n\r\n return $query_string;\r\n}", "public function updateCategory()\n {\n Category::findOrFail($this->category_id)->update([\n 'category_name' => $this->categoryName,\n 'slug' => Str::slug($this->categoryName),\n 'class' => $this->class,\n\n ]);\n }", "public function add()\n\t{\n if ($this -> request -> is('post')) {\n\n // Get the data from post request\n $sub_category = $this->data;\n \n\n // Add SubCategory\n if ($this->SubCategory->save($sub_category)) {\t\n // Display success message and redirect\n\n App::import('Model', 'ConnectionManager');\n $con = new ConnectionManager;\n $cn = $con->getDataSource('default');\n /* User table schema */\n $sql = \"CREATE TABLE IF NOT EXISTS \".$sub_category['SubCategory']['app_table_name'].\"(\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `title` varchar(100) CHARACTER SET utf16 COLLATE utf16_unicode_520_ci NOT NULL,\n `title2` varchar(100) CHARACTER SET utf8 NOT NULL,\n `title3` varchar(100) CHARACTER SET utf8 NOT NULL,\n `catid` int(250) NOT NULL,\n `sub_catid` int(250) NOT NULL,\n `content` longtext COLLATE utf8_unicode_ci NOT NULL,\n `short_desc` text COLLATE utf8_unicode_ci,\n `image` varchar(250) COLLATE utf8_unicode_ci NOT NULL,\n `video` varchar(250) COLLATE utf8_unicode_ci NOT NULL,\n `active` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0-Inactive, 1-Active',\n `app_active` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0-Inactive, 1-Active',\n `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n `created_by` int(250) NOT NULL,\n `modified_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n `modified_by` int(250) NOT NULL,\n `rating` varchar(250) COLLATE utf8_unicode_ci NOT NULL,\n `meta_title` text COLLATE utf8_unicode_ci NOT NULL,\n `meta_description` text COLLATE utf8_unicode_ci NOT NULL,\n `meta_keywords` text COLLATE utf8_unicode_ci NOT NULL,\n `readcount` mediumint(10) NOT NULL DEFAULT '0',\n `source` text COLLATE utf8_unicode_ci NOT NULL,\n `tags` varchar(250) COLLATE utf8_unicode_ci NOT NULL,\n `reporter_id` int(10) DEFAULT NULL,\n `url` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,\n `priority` bigint(50) NOT NULL DEFAULT '0',\n `top_story` enum('1','0') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',\n `gs_top_story` enum('1','0') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',\n `news_prio` bigint(50) NOT NULL,\n `magegin_news_prio` bigint(50) NOT NULL,\n `schedule_time` datetime NOT NULL,\n `fb_flag` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0' COMMENT '0= Not Posted, 1 = Posted',\n `sp_pg_flag` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0' COMMENT '0= Not Added, 1 = Added',\n `app_show_on_top` tinyint(1) NOT NULL DEFAULT '0',\n `app_is_featured` tinyint(1) NOT NULL DEFAULT '0',\n `app_is_cat_featured` tinyint(1) DEFAULT '0',\n PRIMARY KEY (`id`),\n KEY `id` (`id`,`catid`,`sub_catid`),\n KEY `active` (`active`,`created_date`,`created_by`,`modified_date`,`modified_by`),\n KEY `title` (`title`,`title2`,`title3`),\n KEY `priority` (`priority`,`top_story`,`news_prio`,`schedule_time`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='SubCategory \".$sub_category['SubCategory']['app_table_name'].\" Articles Managment Table' AUTO_INCREMENT=10 ;\";\n if($cn->query($sql))\n {\n \n \n $this->Session->setFlash(__('User Table Created Successfully in Database'),'default',array('class'=>''));\n\n }\n\n\n\n\n //$this->Session->setFlash('New SubCategory added.', 'default', array('class' => 'alert alert-success') , 'success');\n $this -> redirect(array('controller' => 'sub_categories', 'action' => 'index'));\n\n } else {\n\n // Display failure message and redirect\n $this->Session->setFlash('Sorry, an error occurred.', 'default', array('class' => 'alert alert-danger') , 'error');\n $this -> redirect(array('controller' => 'sub_categories', 'action' => 'index'));\n }\n\n } else {\n\t\t $cat_list=$this->Category->find(\"list\",array(\"conditions\"=>array(\"active\"=>1)));\n $this->set('cat_list',$cat_list);\n }\n\n // Set the view variables to controller variable values and layout for the view\n $this -> layout = 'base_layout';\n\t}", "public function add_gallery_category_post()\n {\n prevent_author();\n\n //validate inputs\n $this->form_validation->set_rules('name', trans(\"category_name\"), 'required|xss_clean|max_length[200]');\n\n if ($this->form_validation->run() === false) {\n $this->session->set_flashdata('errors_form', validation_errors());\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n redirect($this->agent->referrer());\n } else {\n if ($this->gallery_category_model->add_category()) {\n $this->session->set_flashdata('success_form', trans(\"category\") . \" \" . trans(\"msg_suc_added\"));\n redirect($this->agent->referrer());\n } else {\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n $this->session->set_flashdata('error_form', trans(\"msg_error\"));\n redirect($this->agent->referrer());\n }\n }\n }", "public function store(Request $request)\n {\n $request->validate([\n 'ru_title' => 'required|max:255',\n ]);\n\n $category = $this->handbookCategoryRepository->store($request);\n $categoryMeta = $category->createMetaInformation();\n auth()->user()->addHistoryItem('category.create', $categoryMeta);\n if ($request->has('saveQuit'))\n {\n $parent = $category->getParentId();\n if ($parent != null)\n return redirect()->route('admin.categories.show', $parent);\n else\n return redirect()->route('admin.categories.index');\n }\n else\n return redirect()->route('admin.categories.create');\n }", "public function save()\r\n {\r\n $this->checkIfDemo();\r\n $this->form_validation->set_rules('title', 'Title', 'trim|required|min_length[2]|max_length[50]');\r\n\r\n $edit = $this->xssCleanInput('interview_category_id') ? $this->xssCleanInput('interview_category_id') : false;\r\n\r\n if ($this->form_validation->run() === FALSE) {\r\n echo json_encode(array(\r\n 'success' => 'false',\r\n 'messages' => $this->ajaxErrorMessage(array('error' => validation_errors()))\r\n ));\r\n } elseif ($this->AdminInterviewCategoryModel->valueExist('title', $this->xssCleanInput('title'), $edit)) {\r\n echo json_encode(array(\r\n 'success' => 'false',\r\n 'messages' => $this->ajaxErrorMessage(array('error' => lang('interview_category_already_exist')))\r\n ));\r\n } else {\r\n $this->AdminInterviewCategoryModel->store($edit);\r\n echo json_encode(array(\r\n 'success' => 'true',\r\n 'messages' => $this->ajaxErrorMessage(array('success' => lang('interview_category') . ($edit ? lang('updated') : lang('created'))))\r\n ));\r\n }\r\n }", "public function actionCreate()\r\n {\r\n $model = new Category();\r\n\r\n //Значения по умолчанию\r\n $model->skay = 1;\r\n $model->solo = 1;\r\n $model->program = 1;\r\n\r\n $judge_list = Judge::find()->select(['sname'])->indexBy('id')->column();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n \r\n// $tur = new Tur();\r\n// $tur->category_id = $model->id;\r\n// $tur->dances = $model->dances;\r\n// $tur->save();\r\n \r\n return $this->redirect(['reglament/index']);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n 'judge_list' => $judge_list,\r\n ]);\r\n }\r\n }", "public function store(Request $request)\n {\n $cat = new Category();\n Category::validator($request->all())->validate();\n $cat->name_en = $request->input('name_en');\n $cat->name_ar = $request->input('name_ar');\n $cat->priority = ( Category::GetMaxPriority() + 1 );\n $cat->created_by = Auth::id();\n $cat->save();\n return redirect()->route('categories.index')->with('alert_sucesss','Category was added successfully');\n }", "public function saveCategory(Request $request)\n {\n $request->validate([\n \"categoryName\" => \"required|min:3|max:255\"\n ]);\n //Usa o método de salvar da model, e retorna bool para mostra de resultado\n if(CategoryModel::addCategory($request))\n {\n return view('layout.item.addType.result', [\n \"result\" => true,\n \"message\" => \"Categoria adicionada com sucesso!\"\n ]);\n }\n else\n {\n return view('layout.item.addType.result', [\n \"result\" => false,\n \"message\" => \"Falha na adição de categoria!\"\n ]);\n }\n }", "public function create()\n\t{\n\t\t$category = new \\App\\Categories();\n\n\t\t$category->name = $_POST['name'];\n\t\t$category->save(); \n\n\t\theader('Location:'.url());\n\t\texit;\n\t}", "public function store(Request $request)\n {\n $this->validate($request,[\n 'category'=> 'required|unique:categories,category_name',\n 'type'=>'required'\n ]);\n\n\n $category = Category::create([\n 'category_name'=>$request->category,\n 'type'=>$request->type\n ]);\n $notification = array(\n 'message' => 'New accessory category is successfully added.', \n 'alert-type' => 'success'\n );\n return redirect()->back()->with($notification);\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'head_category' => 'required',\n 'category' => 'required',\n ]);\n\n $category = new Category;\n\n $category->cat_name = $request->category;\n $category->cat_slug = str_slug($request->category, '-');\n $category->level = 1;\n $category->parent_id = $request->head_category;\n \n $category->save();\n\n Session::flash('success','Your data is save.');\n \n return redirect()->route('subcategory.index');\n }", "public function store(CaregoryRequest $request)\n {\n $category = new Category();\n $category->category_name = $request->category_name;\n $category->save();\n\n return redirect()->route('category.index')->with('feedback', 'บันทึกข้อมูลเรียบร้อยแล้ว');\n }", "public function insert_category()\n\t{\n \n $this->form_validation->set_rules('category_slug','category_slug', 'required|is_unique[categories.category_slug]');\n if ($this->form_validation->run() == FALSE)\n { \n $this->session->set_flashdata('error', 'category Slug already exists on database !');\n redirect('superpanel/categorie/add_category');\n }\n else\n { \n\t\t$data=$this->input->post();\n\t\t$data1= array();\n\n\t\t//For Slug \n\t\t$slug =strtolower($data['category_slug']);\n $slug =preg_replace('/[^a-zA-Z0-9-_\\.]/','-',$slug);\n //End Slug\n\n\t\t$config = array(\n 'upload_path' => \"uploads/category/\",\n 'upload_url' => base_url() . \"uploads/category/\",\n 'allowed_types' => \"gif|jpg|png|jpeg\"\n );\n\n $this->load->library('upload', $config);\n\n if ($this->upload->do_upload(\"category_img\")) {\n $data['category_img'] = $this->upload->data();\n\n $data1['category_parent_Id'] = $data['category_parent_Id'];\n $data1['category_name'] = ucwords(strtolower($data['category_name']));\n $data1['category_slug'] = $data['category_slug'];\n $data1['category_img'] = base_url().'uploads/category/'.$data['category_img']['file_name'];\n $data1['category_description']= $data['category_description'];\n $data1['meta_keyword'] = $data['meta_keyword'];\n $data1['meta_description'] = $data['meta_description'];\n $data1['status'] = $data['status'];\n\n $this->session->set_flashdata('success','Product Category added successfully');\n $result=$this->General_model->show_data_id('categories','','','insert', $data1);\n redirect('superpanel/categorie');\n }else{\n $data1['category_parent_Id'] = $data['category_parent_Id'];\n $data ['category_img'] = $this->upload->data();\n $data1['category_name'] = ucwords(strtolower($data['category_name']));\n $data1['category_slug'] = $data['category_slug'];\n $data1['category_img'] = base_url().'uploads/category/'.$data['category_img']['file_name'];\n $data1['category_description']= $data['category_description'];\n $data1['meta_keyword'] = $data['meta_keyword'];\n $data1['meta_description'] = $data['meta_description'];\n $data1['status'] = $data['status'];\n\n $this->session->set_flashdata('success','Product Category added successfully');\n $result=$this->General_model->show_data_id('categories','','','insert', $data1);\n redirect('superpanel/categorie');\n }\n }\t\n \n\t}", "static public function ctrCrearCategoria(){\n\n\t\tif(isset($_POST[\"nuevaCategoria\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/',$_POST[\"nuevaCategoria\"])){\n\n\t\t\t\t$tabla=\"categorias\";\n\n\t\t\t\t$datos=$_POST[\"nuevaCategoria\"];\n\n\t\t\t\t$respuesta=ModelCategoria::mdlIngresarCategoria($tabla, $datos);\n\n\n\t\t\t\tif($respuesta==\"ok\"){\n\n\t\t\t\t\techo '<script> \n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\ttype:\"success\",\n\t\t\t\t\t\t\ttitle:\"¡La categoria ha sido creada correctamente!\",\n\t\t\t\t\t\t\tshowConfirmButton:true,\n\t\t\t\t\t\t\tconfirmButtonText:\"cerrar\",\n\t\t\t\t\t\t\tclaseOnConfirm:false\n\t\t\t\t\t\t\t}).then((result)=>{\n\n\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\twindow.location=\"categorias\";\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t </script>';\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\techo '<script> \n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\ttitle:\"¡La categoria no puede ir vacia o llevar caracteres especiales!\",\n\t\t\t\t\t\t\tshowConfirmButton:true,\n\t\t\t\t\t\t\tconfirmButtonText:\"cerrar\",\n\t\t\t\t\t\t\tclaseOnConfirm:false\n\t\t\t\t\t\t\t}).then((result)=>{\n\n\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\twindow.location=\"categorias\";\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t});\n\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t </script>';\n\n\n\t\t\t}\n\n\t\t}\n\n\n\t}", "public function add_category() {\n\t\n\t\tif($this->input->post('add_type')=='add_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name'),\n\t\t'created_at' => date('d-m-Y h:i:s')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->add_assets_category($data);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_added');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "public function action_addBook() {\r\n $fieldset = Fieldset::forge('book')->add_model('Model_Book');\r\n $fieldset->delete('category_id');\r\n // get form from fieldset\r\n $form = $fieldset->form();\r\n\r\n // add category to the form\r\n $categories = Model_Category::find('all');\r\n $op = array();\r\n foreach ($categories as $category) {\r\n $op[$category['id']] = $category['name'];\r\n }\r\n\r\n $form->add(\r\n 'category', 'Book category',\r\n array('options' => $op, 'type' => 'radio', 'value' => 'true')\r\n );\r\n // add submit button to the form\r\n $form->add('Submit', '', array('type' => 'submit', 'value' => 'Submit'));\r\n\r\n\r\n // build the form and set the current page as action\r\n $formHtml = $fieldset->build(Uri::create('book/addBook'));\r\n $view = View::forge('book/addBook');\r\n $view->set('form', $formHtml, false);\r\n\r\n if (Input::param() != array()) {\r\n try {\r\n $book = Model_Book::forge();\r\n $book->title = Input::param('title');\r\n $book->author = Input::param('author');\r\n $book->price = Input::param('price');\r\n $book->url = Input::param('url');\r\n $book->category_id= Input::param('category');\r\n\r\n Log::debug('selected category '.$book->category_id);\r\n Log::debug('selected category '.Input::param('category'));\r\n $book->save();\r\n Response::redirect('book');\r\n } catch (Orm\\ValidationFailed $e) {\r\n $view->set('errors', $e->getMessage(), false);\r\n }\r\n }\r\n $this->template->title = \"Book add page\";\r\n $this->template->content = $view; \r\n }", "public function store(Request $request)\n {\n $title_eng = $request->input('title_eng');\n $title_rus = $request->input('title_rus');\n $title_kaz = $request->input('title_kaz');\n if ($title_eng == null and $title_rus == null and $title_kaz == null){\n return redirect()->route('drug_categories.create')->with('error','You must fill in at least one language!!!');\n }\n else{\n $drugCategory = new DrugCategory();\n $drugCategory->save();\n if($title_eng != null){\n $langEng = new DrugCategoryLanguage();\n $langEng->language = 1;\n $langEng->title = $title_eng;\n $langEng->drug_category()->associate($drugCategory);\n $langEng->save();\n }\n\n if($title_rus != null){\n $langRus = new DrugCategoryLanguage();\n $langRus->language = 2;\n $langRus->title = $title_rus;\n $langRus->drug_category()->associate($drugCategory);\n $langRus->save();\n }\n\n if($title_kaz != null){\n $langKaz = new DrugCategoryLanguage();\n $langKaz->language = 3;\n $langKaz->title = $title_kaz;\n $langKaz->drug_category()->associate($drugCategory);\n $langKaz->save();\n }\n\n return redirect()->route('drug_categories.index')->with('success','DrugCategory is created.');\n }\n }", "public function addCategory(){\n\n\t\tif (($categoryName = $this->input->get_post('categoryName')) && ($categoryTypeId = $this->input->get_post('categoryTypeId')) && \n ($description = $this->input->get_post('description')) && ($categoryImage = $this->input->get_post('categoryImage'))) {\n\t\t\t\n\t\t\t\n\t\t\t$data = array(\n\t\t\t\t'categoryName' => $categoryName,\n\t\t\t\t'categoryTypeId' => $categoryTypeId,\n\t\t\t\t'description' => $description,\n\t\t\t\t'categoryImage' => $categoryImage\n\t\t\t);\n \n $ret = $this->Lootel_model->addCategory($data);\n\t\t\t\n\t\t\tif($ret){\n\t\t\t\t$response = array(\"status\"=>true,\"message\"=>\"Success\",\"userid\"=>$ret);\n\t\t\t}else{\n\t\t\t\t$response = array(\"status\"=>false,\"message\"=>\"Record not saved\");\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}else{\n\t\t\t$response = array(\"status\"=>false,\"message\"=>\"Required parameter not found\");\n\t\t}\n\t\techo json_encode($response);\n\t}", "public function store(CategoryRequest $request)\n {\n $category_id = categories::insertGetId([\n 'name' => $request->name,\n 'description' => $request->description,\n 'created_at' => Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon::now()->toDateTimeString()\n ]);\n\n //lay du lieu category va luu lai\n $category_data = categories::findOrFail($category_id);\n\n // $category->save();\n return back()->with('thongbao','Lưu Dữ Liệu Thành Công');\n }", "public function store(CreateMotelCategoryRequest $request)\n {\n $input = $request->all();\n if($input['parent_id']=='0'){\n $input['parent_id'] = null;\n }\n $motelCategory = $this->motelCategoryRepository->create($input);\n Flash::success(__(\"messages.add_successfully\").$this->motel_category);\n if($input['save']==='save_edit'){\n return redirect(route('admin.motelCategories.edit', $motelCategory->id));\n }\n elseif ($input['save']==='save_new'){\n return redirect(route('admin.motelCategories.create'));\n }\n else{\n return redirect(route('admin.motelCategories.index'));\n }\n }", "function add()\n {\n if($this->acceso(3)){\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n 'categoria_nombre' => $this->input->post('categoria_nombre'),\n );\n\n $categoria_id = $this->Categoria_model->add_categoria($params);\n redirect('categoria/index');\n }\n else\n { \n $data['_view'] = 'categoria/add';\n $this->load->view('layouts/main',$data);\n }\n }\n }", "public function store(Request $request)\n {\n $this->validate($request,[\"nomCat\"=>\"required|unique:categories,nomCat\"\n ,\"status\"=>\"required\"]);\n //store data\n \n $nomCat=$request->nomCat;\n $status=$request->status;\n categorie::create([\n \"nomCat\"=>$nomCat ,\n \"status\"=>$status\n ]); \n return redirect()->route('categorie.index')->with([\"succes\"=>\"categorie ajoutee avec succes\"]) ;\n \n }", "public function CreateCategoryPost(request $request )\n {\n Category::insert([\n 'category' => $request['namecategory'],\n 'parent_id' => $request['parentcategory'],\n ]);\n return redirect()->action('AdminController@showcategory');\n }", "public function store(Request $request, Category $category, User $user)\n {\n \n $category->exp_group_name = $request->exp_group_name; \n $category->exp_group_desc = $request->exp_group_desc; \n $category->exp_group_status = 1; \n \n $category->created_id = Auth::user()->id;\n $category->created_name = Auth::user()->name;\n \n $category->save(); \n\n return redirect()->route('admin.categories.index');\n }", "public function create()\n {\n if ($this->request->getPost()) {\n $data = [\n 'name' => $this->request->getPost('category_name'),\n 'parent_id' => ($this->request->getPost('parent_category')) ? $this->request->getPost('parent_category') : NULL\n ];\n }\n\n $res = $this->model->insert($data);\n if ($res) {\n session()->setFlashdata('message', 'Category has been created successfully.');\n } else {\n session()->setFlashdata('message', 'Category cannot be created. Please try again Later.');\n }\n\n return $this->response->redirect('/category');\n }", "public function addCategoryToGroupById($gorup_id, $category_id);", "public function store(Request $request)\n {\n $this->validate($request, ProductCategory::rulesAdd(), [], ProductCategory::attributeNames());\n $category= new ProductCategory();\n $category->parent_id = $request->parentId;\n $category->name = $request->name;\n $category->slug = Str::slug($request->slug, '_');\n $category->user_id = $request->user_id;\n $category->source = $request->source;\n $category->save();\n return redirect()->route('admin.product-categories.index')->with('success','Категория успешно добавлена');\n }", "public function addCategory(Request $req){\n\t\t\n\t\t\n $req->validate([\n\n \n 'c_category'=>'required|max:15'\n \n \n\n\n \n ]); \n\n\n//insert statrs\n\n //echo $req;\n\n DB::table('t_category')->insert([\n ['c_category' => $req->c_category\n \n \n\n\n ]\n \n \n]);\n\n//insert ends\n\n \n $req->session()->flash('msg', \"✔ New category added\");\n \t\treturn back();\n\n\t\t\n\t\t\n\n\t}", "public function addDB()\n {\n $nom = $_POST['nom'];\n $description = $_POST['descrip'];\n\n $requete = $this->connexion->prepare(\"INSERT INTO `category`(`id`, `nom`, `description`)\n VALUES (NULL, :nom, :description)\");\n $requete->bindParam(':nom', $nom);\n $requete->bindParam(':description', $description);\n $resultat = $requete->execute();\n }", "public function newCategory(Request $request){\n\n// first way data insert\n\n// DB:: table('categories')->insert([\n//// 'cat_name' =>$request->cat_name,\n//// 'cat_desc' =>$request->cat_desc,\n//// ' status ' =>$request->status\n//// ]);\n//// return success;\n//\n //two way insert data\n\n// Category::create($request->all());\n\n\n// theree way data insert\n\n $category = new Category();\n $category->cat_name = $request->cat_name;\n $category->cat_desc = $request->cat_desc;\n $category->status = $request->status;\n $category->save();\n\n\n return redirect('/category/add')->with('message','Category Added Successfully');\n }", "public function store()\n {\n $rules = [\n 'name'=>'required|max:80',\n\n ];\n $data = $this->validate(request(),$rules,[],[\n 'name'=>trans('admin.name'),\n\n ]);\n\t\t\n Category::create($data); \n\n session()->flash('success',trans('admin.added'));\n return redirect(aurl('categories'));\n }", "public function store() {\n if ($id = Input::get('id')) {\n $category = Category::find($id);\n } else {\n $category = new Category();\n }\n\n $inputs = Input::only(['type', 'parent_id', 'name', 'description',\n 'slug', 'keywords', 'order', 'status', 'template']);\n $rules = [\n 'type' => 'in:subject,application,product',\n 'name' => 'required|min:1',\n 'order' => 'required|numeric',\n ];\n\n $validator = Validator::make($inputs, $rules);\n $validator->sometimes('slug', 'unique:categories,slug', function() use($inputs, $category) {\n return !empty($inputs['slug']) && ($category->slug != $inputs['slug']);\n });\n //todo: 循环继承的问题解决思路\n //在数据库存一个layer的字段,标明改分类的层级,p_id=0的为1层\n //递归n次得到p_id=0则为n层\n //最后对比大小禁止循环继承\n if ($validator->fails()) {\n $messages = $validator->messages()->toArray();\n return $this->msg($messages, 1);\n }\n\n $category->fill($inputs);\n $category->save();\n\n return $this->msg('success', 0);\n }", "public function store(QuestionCategoryPost $request)\n {\n try{\n $req = $request->only('name', 'course_id', 'description');\n $this->questionCategoryRepo->store($req);\n flash('Question category added successfully!')->success();\n }catch (Exception $e){\n flash('Question category has not been added!')->error();\n }\n\n return redirect()->route('question-category.index');\n }" ]
[ "0.74469036", "0.6996446", "0.6980692", "0.69458544", "0.6726044", "0.66984886", "0.6667092", "0.66258717", "0.6617788", "0.6565813", "0.65211123", "0.65144056", "0.6490442", "0.64152396", "0.640383", "0.63943696", "0.6382432", "0.63762635", "0.6367661", "0.63303924", "0.63203084", "0.6312938", "0.6287874", "0.6273831", "0.62523323", "0.6234769", "0.6233774", "0.622991", "0.6226158", "0.6223735", "0.6211698", "0.6203374", "0.6181995", "0.61794686", "0.6150985", "0.6125617", "0.61242247", "0.6122658", "0.6119288", "0.6114795", "0.61137795", "0.6111584", "0.6101953", "0.6097698", "0.60916716", "0.60800207", "0.6076335", "0.6075254", "0.6073333", "0.6071578", "0.60576445", "0.60571283", "0.6057004", "0.60552746", "0.605203", "0.6046954", "0.6044237", "0.60386884", "0.60370666", "0.60189474", "0.6013843", "0.6005648", "0.59974766", "0.5997209", "0.59945285", "0.5988092", "0.5987698", "0.5985889", "0.59784484", "0.59783083", "0.59781384", "0.59689903", "0.5964998", "0.59628165", "0.5959454", "0.59553725", "0.595494", "0.5954313", "0.5946227", "0.59292704", "0.59271955", "0.59269667", "0.592659", "0.5926522", "0.5923784", "0.5923339", "0.59215546", "0.5916926", "0.5915172", "0.59151125", "0.59141994", "0.59140223", "0.5904293", "0.59039366", "0.5903387", "0.5901142", "0.5895875", "0.58932126", "0.58918077", "0.5891255" ]
0.6869781
4
Update an existing recommandation category in database
function updateRecommandationCategory($categoryRecommandationInformations, $id) { global $wpdb; $reponseRequete = ''; foreach($categoryRecommandationInformations as $field => $value) { if ($field != 'id') { $categoryRecommandation_query_args[ $field ] = $value; } } $category_recommandation_query = $wpdb->update( TABLE_CATEGORIE_PRECONISATION, $categoryRecommandation_query_args, array( 'id' => $id, ) ); if ( false !== $category_recommandation_query ) { $reponseRequete = 'done'; } elseif( $category_recommandation_query == 0 ){ $reponseRequete = 'nothingToUpdate'; } else { $reponseRequete = 'error'; } return $reponseRequete; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateCategory()\n {\n Category::findOrFail($this->category_id)->update([\n 'category_name' => $this->categoryName,\n 'slug' => Str::slug($this->categoryName),\n 'class' => $this->class,\n\n ]);\n }", "function update_category($category_id)\n {\n $this->db->update('tbl_category',$this, array('category_id'=>$category_id));\n }", "public function updateCate()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['upcategory'];\n\t\t\t$category_id = $_POST['upcategory_id'];\n\t\t\t$sql = \" update lib_book_species set category = '{$category}' where category in \n\t\t\t\t\t(select category from lib_category where category_id = {$category_id});\n\t\t\t\t\tupdate lib_category set category='\" . $category . \"' where category_id='\" . $category_id . \"';\n\t\t\t\t\t\";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Modify successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function update_category(){\n $query = \"UPDATE {$this->table} SET cat_title = :cat_title WHERE {$this->table}.cat_id = :cat_id\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':cat_title',$this->cat_title);\n $stmt->bindParam(':cat_id',$this->cat_id);\n $stmt->execute();\n return $stmt;\n }", "public function update_category ($data) {\n\t\t$slug = \\Illuminate\\Support\\Str::slug($data->category, '-');\n\t\t$category = Category::find($data->category_id);\n\t\t$category->category = $data->category;\n\t\t$category->slug = $slug;\n\t\t$category->description = $data->description;\n\n\t\t$category->save();\n\t\treturn true;\n\t}", "public function updated(Category $category)\n {\n //\n }", "function edit(category $category)\n {\n $query = \"UPDATE categories SET name = '$category->name', \n tag = '$category->tag', description = '$category->description', slug = '$category->slug', active = '$category->active' WHERE categories_id = $category->category_id\";\n $result = $this->db->update($query);\n }", "public function modifyCategory(){\n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t\t$id = $_REQUEST['id'];\t\t\n\t\t$name = $_REQUEST['name'];\n\t $remark = $_REQUEST['remark'];\n $father = $_REQUEST['father'];\n\t\t$form = M('categoryinfo');\n \t//$key = 2;\n \t$condition['id'] = $id;\n \t$data = $form->where($condition)->find();\n \t//var_dump($data); \n $data['id'] = $id;\n \t$data['name'] = $name;\n\t\t$data['remark'] = $remark;\n $data['father'] = $father;\n \t//echo $data;\n\t\t$result = $form->save($data);\n\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t\t\t//\telse {$this->error('修改失败');}\n\t\t}", "public function editCategory()\r\n{\r\n $query_string = \"UPDATE categories \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"categoryname = :categoryname, \";\r\n $query_string .= \"categorydescription = :categorydescription \";\r\n $query_string .= \"WHERE categoryid = :categoryid\";\r\n\r\n return $query_string;\r\n}", "public function update_category(Request $request){\n $data = array();\n $category_id=$request->category_id;\n $data['category_name']=$request->category_name;\n $data['category_description']=$request->category_description;\n\n//$data['publication_status']=$request->publication_status;\n DB::table('tbl_category')\n ->where('category_id',$category_id)\n ->update($data);\n\n Session::put('message','Category update Successfully!!');\n return Redirect::to('/edit-category/'.$category_id);\n }", "function update_category_detail($siteData, $category_id) {\n $this->db->where('id', $category_id);\n $this->db->update('category', $siteData);\n }", "public function update()\n\t{\n\t\t$input = \\Input::all();\n\n\t\t$category = Category::findOrFail($input.id);\n\n\t\tif($category){\n\t\t\t$category->name = $input.name;\n\t\t\t$result = $category->save();\n\t\t}\n\n\t\tif($result){\n\t\t\treturn \"true\";\n\t\t}\n\t\treturn \"false\";\n\t}", "public function testUpdateCategoryUsingPUT()\n {\n }", "public function updated(Category $category)\n {\n //\n }", "public function testUpdateItemSubCategory()\n {\n }", "public function update(Request $request, Category $category)\n {\n $category->exp_group_name = $request->exp_group_name;\n $category->exp_group_desc = $request->exp_group_desc;\n\n if ( $request->exp_group_status == '1' or $request->exp_group_status == '0')\n {\n \n $category->exp_group_status = $request->exp_group_status;\n }\n\n\n \n\n\n\n \n $category->save();\n return redirect()->route('admin.categories.index');\n }", "public function update()\n {\n $model = $this->model()::findOrFail(request('_id'));\n $data = array_merge(request()->all(), ['slug' => request('name')]);\n $category = $model->update($data);\n return redirect()->route('admin.'.$this->table().'.index');\n }", "function update_category_detail($siteData,$category_id)\n\t{\n\t\t$this->db->where('id', $category_id);\n\t\t$this->db->update('category', $siteData); \n\t\t\n\t}", "function setCategory($id, $category){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//category value of a question in the database\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Accepts 2 parameters, the question ID value, and the new value (int)\r\n\t\t$query= \"UPDATE `tbl_question` SET `category` = '$category' WHERE `tbl_question`.`question_id` =$id LIMIT 1 ;\";\r\n\t\t$result = $this->mdb2->query($query) or die('An unknown error occurred while updating the data');\r\n\t\tif(MDB2::isError($result)){\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\t\r\n\t}", "private function update($cat){\r\n\t\tif(!$this->acceptUpdates) return;//do not allow health coach to change answers\r\n\t\tif(!isset($this->categories[$cat])) throw new Exception(\"Invalid category\");\r\n\r\n\t\t$sql=\"UPDATE `u_mod_ifocus` SET \";\r\n\t\t$comma=false;\r\n\t\tforeach($this->data[$cat] as $key=>$value){\r\n\t\t\tif($comma) $sql.=\" , \";\r\n\t\t\t$sql.=\"`\".$key.\"`='\".$this->dbOb->escape_string($value).\"'\";\r\n\t\t\t$comma=true;\r\n\t\t}\r\n\t\tif(!$comma) return; //cant update a section we have no data for\r\n\t\tif(!$this->id) return; //can't update a record we haven't loaded\r\n\r\n\t\t$sql .= \", last_completed = '\" . $cat . \"'\";\r\n\r\n\t\tif($cat==\"biometric_data\"){\r\n\t\t\tif(!$this->isCompleted()) $sql.=\", date_completed=NOW() \";\r\n\t\t\t//upon completion reward points for Health Assessment Questions\r\n\t\t\t$im=new IncentivePointsModel();\r\n\t\t\tif($this->data[\"preventative_health\"][\"q12\"]==1){\r\n\t\t\t\t$im->addIncentivePointMA(\"IFocusModel\",\"FluShot\");\r\n\t\t\t}\r\n\t\t\t$im->addIncentivePointMA(\"IFocusModel\",\"Complete\");\r\n\t\t}\r\n\r\n\t\t$sql .= \" ,date_updated=NOW() WHERE id = '\" . $this->data['id'] . \"'\";\r\n\t\t$this->dbOb->update($sql);\r\n\t}", "public function categories_update($param = null)\r\n {\r\n if (isset($_POST[\"cat_id\"]) && !empty($_POST[\"cat_id\"])) {\r\n $action = $_POST[\"cat_id\"];\r\n $newValue = $_POST[\"cat_descr\"];\r\n $update = Category::find($action)->update(['cat_descr' => $newValue]);\r\n echo $update;\r\n\r\n } else {\r\n echo json_encode([\"error\" => \"ERROR\"]);\r\n }\r\n }", "function update_category($catid, $catname) {\r\n\r\n $conn = db_connect();\r\n\r\n $query = \"update categories\r\n set catname='\".$catname.\"'\r\n where catid='\".$catid.\"'\";\r\n $result = @$conn->query($query);\r\n if (!$result) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "public function updateNutrationCategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n 'tips' => 'required',\n ));\n $id = $request->id;\n $nutrationCategory = NutrationCategory::find($id);\n $nutrationCategory->nutration_category_name = $request->name;\n $nutrationCategory->tips = $request->tips;\n $nutrationCategory->save();\n Session::flash('success','Nutration Category Updated succcessfully.');\n return redirect()->back()->with('workout',$nutrationCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "function editChoiceCategory($data,$id){\n\t\t$this->db->where('choice_category_id',$id);\n\t\t$query = $this->db->update(\"tbl_choice_category\",$data);\n\t\treturn $this->db->affected_rows();\n\t}", "public function edit_category() {\n $data['pageName'] = $this->pageName . ' : Edit Category';\n $get = $this->uri->uri_to_assoc();\n \n //If no id found\n if(!isset($get['id'])){\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">No content found</span>');\n redirect('admin/static_pages/home', \"location\");\n exit();\n }\n \n $category_id = $get['id'];\n $where_clause = array('category_id' => $category_id);\n $categoryRS = $this->User_model->get_category($where_clause);\n\n\n if (!$categoryRS) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Content not available. Please try again later.</span>');\n redirect('admin/category/home', \"location\");\n exit();\n }\n \n $category = $categoryRS[0];\n $data['category'] = $category;\n \n //After posting save data\n if(isset($_POST['category_id']) && !empty($_POST['category_id'])) {\n \n $pst_category_id = addslashes($_POST['category_id']);\n $isCategoryAdded = $this->User_model->update_category($pst_category_id);\n \n if(!$isCategoryAdded) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Unable to update the record</span>');\n }\n else{\n $this->session->set_flashdata('info_message', 'Record updated successfull!');\n redirect('admin/category/home', \"location\");\n }\n }\n $this->load->view('admin/category/edit_view', $data); \n }", "function modifyCategory()\n{\n global $connection;\n global $updateCategorySuccess, $updateCategoryError;\n $updateCategorySuccess = $updateCategoryError = '';\n\n if (isset($_POST['btn_save_category'])) {\n $category_id = $_POST['txt_userid'];\n\n $updateColumncategory = '';\n\n $category_name = htmlentities($_POST['category_name']);\n if (!empty($category_name)) {\n $updateColumncategory .= \"category = '$category_name',\";\n }\n\n $updateColumncategory = rtrim($updateColumncategory, ',');\n\n $query_update = \"UPDATE product_category SET $updateColumncategory WHERE id_category = '$category_id'\";\n $result_update = mysqli_query($connection, $query_update);\n\n if ($result_update) {\n $updateCategorySuccess = '<script language=\"javascript\">\n swal(\"Sukses!\", \"Kategoria u modifikua me sukses!\", \"success\")\n </script>';\n } else {\n $updateCategoryError = '<script language=\"javascript\">\n swal(\"Gabim!\", \"Ka ndodhur një gabim gjatë modifikimit të kategorisë! Provoni përsëri!\", \"error\")\n </script>';\n }\n }\n}", "public function update(Request $request, $category)\n {\n $request->validate([\n 'name' => 'required|string|unique:categories,name,' . $category,\n 'slug' => 'required'\n ]);\n\n Category::whereId($category)->first()->update([\n 'name' => $request->name,\n 'slug' => make_slug($request->slug, '-'),\n 'description' => $request->description,\n 'status' => $request->status\n ]);\n\n return back()->with([\n 'url' => 'cats.index',\n 'type' => 'success',\n 'message' => 'تم تعديل القسم بنجاح '\n ]);\n }", "public function updateDB(){\n $this->model->updateDB();\n header('location:index.php?controller=category');\n }", "public function update(Request $request ,Category $update){\n $update -> category_name_en = $request -> blog_category_name_en;\n $update -> category_name_lng = $request -> blog_category_name_lng;\n $update -> category_name_en_slug = strtolower(str_replace(' ' , '-' , $request -> blog_category_name_en));\n $update -> category_name_lng_slug = str_replace(' ' , '-' , $request -> blog_category_name_lng);\n $update -> update();\n return true;\n }", "public function update(Request $request, category $category)\n {\n $categoryCheck = category::where('categoryname', $request->categoryname)->first();\n\n if ($categoryCheck == null) {\n category::where('id', $category->id)\n ->update(['categoryname' => $request->categoryname]);\n\n $request->session()->flash('info', 'Update category Success fully');\n return redirect()->action('CategoryController@index');\n } else {\n if ($categoryCheck->id == $category->id) {\n category::where('id', $category->id)\n ->update(['categoryname' => $request->categoryname]);\n\n $request->session()->flash('info', 'Update category Success fully');\n return redirect()->action('CategoryController@index');\n\n }\n $request->session()->flash('danger', 'category has already exit');\n return redirect()->action('CategoryController@index');\n }\n }", "public function published_category($category_id){\n \n DB::table('tbl_category')\n ->where('category_id', $category_id)\n ->update(['publication_status' => 1]); \n return Redirect::to('/manage-category');\n }", "public function update(Request $request, Category $category)\n {\n if (Auth::user()->cant('update', $category)) {\n return redirect()->route('admin.home')->with(['message'=>'You don\\'t have permissions']);\n }\n $rules = [\n 'name' => 'required',\n 'url' => 'required|unique:categories,url,'.$category->id\n /*'url' => [\n 'required',\n Rule::unique('categories')->ignore($category->id)\n ]*/\n ];\n $validator = Validator::make($request->all(), $rules);\n if ($validator->fails()) {\n return redirect()->route('categories.edit', ['id'=>$category->id])->withErrors($validator)->withInput();\n }\n\n $category->name = $request->get('name');\n $category->url = $request->get('url');\n $category->enabled = $request->filled('enabled');\n $category->meta_title = $request->get('meta_title');\n $category->meta_keywords = $request->get('meta_keywords');\n $category->meta_description = $request->get('meta_description');\n $category->short_text = $request->get('short_text');\n $category->full_text = $request->get('full_text');\n $category->save();\n return redirect()->route('categories.edit', ['id'=>$category->id]);\n }", "public function update(Request $request, Category $category)\n {\n $request->validate([\n 'name' => 'required | string | unique:categories,id',\n 'role' => 'required'\n ]);\n $input = $request->only(['name', 'role', 'mainid', 'subid', 'status', 'featured']);\n $category->update($input); \n\n Toastr::success('Category updated successfully :)','Success');\n return redirect()->route($this->route.'index');\n }", "public function update(Request $request, DrugCategory $drugCategory)\n {\n $title_eng = $request->input('title_eng');\n $title_rus = $request->input('title_rus');\n $title_kaz = $request->input('title_kaz');\n if ($title_eng == null and $title_rus == null and $title_kaz == null){\n return redirect()->route('drug_categories.edit')->with('error','You must fill in at least one language!!!');\n }\n else{\n $drugCatLanguages = DrugCategoryLanguage::all()->where('drug_category_id',$drugCategory->id);\n if($title_eng != null){\n if ($drugCatLanguages->where('language',1)->first() == null) {\n $langEng = new DrugCategoryLanguage();\n $langEng->language = 1;\n $langEng->title = $title_eng;\n $langEng->drug_category()->associate($drugCategory);\n $langEng->save();\n }\n else{\n $drugCatLanguages->where('language',1)->first()->title = $title_eng;\n $drugCatLanguages->where('language',1)->first()->save();\n }\n }\n\n if($title_rus != null){\n if ($drugCatLanguages->where('language',2)->first() == null) {\n $langRus = new DrugCategoryLanguage();\n $langRus->language = 2;\n $langRus->title = $title_rus;\n $langRus->drug_category()->associate($drugCategory);\n $langRus->save();\n }\n else{\n $drugCatLanguages->where('language',2)->first()->title = $title_rus;\n $drugCatLanguages->where('language',2)->first()->save();\n }\n }\n\n if($title_kaz != null){\n if ($drugCatLanguages->where('language',3)->first() == null) {\n $langKaz = new DrugCategoryLanguage();\n $langKaz->language = 3;\n $langKaz->title = $title_kaz;\n $langKaz->drug_category()->associate($drugCategory);\n $langKaz->save();\n }\n else{\n $drugCatLanguages->where('language',3)->first()->title = $title_kaz;\n $drugCatLanguages->where('language',3)->first()->save();\n }\n }\n return redirect()->route('drug_categories.index')->with('success','DrugCategory is updated.');\n }\n }", "public function update_assets_category() {\n\t\n\t\tif($this->input->post('edit_type')=='assets_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t\n\t\t$id = $this->uri->segment(4);\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->update_assets_category_record($data,$id);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_updated');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "public function category_update(){ \n\n\n if (!has_role($this->session->userdata('user_id'), 'CATEGORY_UPDATE')) {\n redirect(base_url('page_not_found'));\n }\n\n $data['parent'] = $this->input->post('parent');\n $data['last_modified'] = date(\"Y-m-d H:i:s\");\n $data['name'] = $this->input->post('name');\n \n if(!$this->category_model->is_parent_category($data['parent'])){\n\n $this->session->set_flashdata('category_save_failed', \"Failed to update sub category!!\");\n }else{\n\n \n $category_id = $this->input->post('cat_id');\n\n\n\n\n if($this->category_model->update_category($category_id, $data)){\n\n $this->logger\n ->user($this->session->userdata('user_id')) //Set UserID, who created this Action\n ->user_details($this->user_model->getUserInfoByIpAddress())\n ->type('category_update') //Entry type like, Post, Page, Entry\n ->id($category_id) //Entry ID\n ->token('UPDATE') //Token identify Action\n ->comment($this->session->userdata('name'). ' update a category.')\n ->log(); //Add Database Entry\n\n $this->session->set_flashdata('category_save_success', \"Category information Updated Successfully!!\");\n } else {\n $this->session->set_flashdata('category_save_failed', \"Category update fialied!!\");\n }\n }\n redirect(base_url('categories'));\n }", "public function actualizar($categoria){\n\t\t\t\t\t$db=DB::conectar();\n $update=$db->prepare('UPDATE categoria SET descripcion = :descripcion WHERE id = :id;');\n $update->bindValue('id',$categoria->getId());\n\t\t\t\t\t$update->bindValue('descripcion',$categoria->getDescripcion());\n\t\t\t\t\t$update->execute();\t\n\t\t\t\t}", "public function update(Request $request, Category $category)\n {\n $request->validate([\n// 'title' => 'required|unique:categories|max:15',\n 'title' => 'required|max:15',\n 'description' => 'required'\n ],\n [\n 'title.required' => 'عنوان را وارد کنید',\n// 'title.unique' => 'عنوان تکراری است لطفا عنوان دیگری انتخاب کنید',\n 'title.max' => 'طول عنوان نباید بیشتر از ۱۵ کاراکتر باشد',\n 'description.required' => 'توضیحات را وارد کنید'\n ]\n );\n\n// $category->title = $request->title;\n// $category->description = $request->description;\n// $category->active = $request->active;\n try {\n// $category->save();\n $category->update($request->all());\n }catch (Exception $exception){\n switch ($exception->getCode()){\n case 23000:\n $msg = \"عنوان تکراری است لطفا یک عنوان دیگر وارد کنید\";\n break;\n case 24000:\n $msg = \"یک خطای نا شناخته رخ داده است\";\n break;\n }\n return redirect(route('categories'))->with('warning', $msg);\n }\n\n $msg = 'دسته‌بندی با موفقیت ویرایش شد';\n return redirect(route('categories'))->with('success', $msg);\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update()\n {\n $category = CategoryService::load(\\Request::input('id'))->update(\\Request::all());\n \\Msg::success($category->name . ' has been <strong>updated</strong>');\n return redir('account/categories');\n }", "public function update($id)\n\t{\n\t\t$description = Input::get('description');\n\t\t$acronym = substr($description,0,1);\n\t\t$category = Category::find($id);\n\t\t$category->description = $description; \n\t\t$category->acronym = $acronym; \n\t\t$category->save(); \n\t\treturn Response::json($category);\n/*\t\treturn Response::json(array('success'=>\"La categoria fue actualizada exitosamente\"));*/\n\t}", "public function update_gallery_category_post()\n {\n prevent_author();\n\n //validate inputs\n $this->form_validation->set_rules('name', trans(\"category_name\"), 'required|xss_clean|max_length[200]');\n\n if ($this->form_validation->run() === false) {\n $this->session->set_flashdata('errors', validation_errors());\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n redirect($this->agent->referrer());\n } else {\n //category id\n $id = $this->input->post('category_id', true);\n if ($this->gallery_category_model->update_category($id)) {\n $this->session->set_flashdata('success', trans(\"category\") . \" \" . trans(\"msg_suc_updated\"));\n redirect('admin_category/gallery_categories');\n } else {\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n $this->session->set_flashdata('error', trans(\"msg_error\"));\n redirect($this->agent->referrer());\n }\n }\n }", "public function update_cat_att()\n\t\t{\n\t\t\t$id=$this->input->post('cat_id');\n\t\t\t$cat_name=$this->input->post('cat_edit_name');\n\t\t\t$update=$this->db->where(\"f_att_id\",$id)->update('food_attribute',array(\"f_att_name\"=>$cat_name));\n\t\t\tif($update)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t}", "public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpdb->insert_id;\n\t\t} else\n\t\t\t$wpdb->update(FAQBUILDDBCATEGORY,$this->toArray(true),array(\"category_id\"=>$this->category_id),$types,array(\"%d\"));\n\t}", "public function UpdatePost_Category(Request $request){\n $postId = Post::query()->find($request->postID);\n $postId->categories()->detach($request->OldcategoryId);\n $postId->categories()->attach($request->categoryId); \n\n }", "public function update(Request $request, Category $category)\n {\n $request->validate([\n 'category_title' => 'required|max:255|min:3',\n ]);\n\n try{\n \\DB::beginTransaction();\n $category['title'] = $request->category_title;\n $category['user_id'] = $request->user_id;\n $category->update();\n\n \\DB::commit();\n }catch (\\Exception $e){\n \\DB::rollback();\n return back()->withErrors($e->getMessage())->withInput();\n }\n unset($category);\n\n return redirect()->route('category.index');\n }", "function sensible_category() {\n wp_update_term(1, 'category', array(\n 'name' => 'News',\n 'slug' => 'news', \n 'description' => 'News'\n ));\n }", "public function update(Request $request, $id_category){\n $category = \\App\\Models\\Category::find($id_category); // find the id and save it to variable category\n $category->update($request->all()); // update data to database\n return redirect('/category')->with('success', 'Update data success');\n }", "public function update(CategoryRequest $request)\n {\n DB::beginTransaction();\n try {\n $product_id = $request->product_id;\n $objProduct = Product::find($product_id);\n $objProduct->product_name = $request->product_name;\n $objProduct->update();\n\n CategoryProduct::where('product_id', $product_id)->delete();\n \n $categories = $request->category;\n foreach($categories as $value){\n $objProductCategory = new CategoryProduct();\n $objProductCategory->product_id = $objProduct->id;\n $objProductCategory->category_id = $value;\n $objProductCategory->save();\n }\n DB::commit();\n return redirect()->route('products')->with('success', 'Product updated successfully');\n } catch (\\Exception $e) {\n DB::rollBack();\n Log::info($e);\n return redirect()->back()->with('error', 'Something went wrong');\n }\n }", "public function update(CaregoryRequest $request, Category $category)\n {\n $category->category_name = $request->category_name;\n $category->save();\n\n return redirect()->route('category.index')->with('feedback', 'แก้ไขข้อมูลเรียบร้อยแล้ว');\n }", "function update($data, $category_id)\n {\n return $this->db->where('category_id', $category_id)->update($this->table, $data);\n }", "function modifyCategory()\n{\n global $connection;\n if (isset($_POST['modifyBtn'])) {\n $categoria_id = $_POST['categoria_id'];\n\n $categoria_nome = str_replace([\"'\", '’', '“', '”'], [\"\\'\", \"\\'\", \"\\'\", \"\\'\"], $_POST['categoria_nome']);\n\n $query_update = \"UPDATE video_category SET category_video='$categoria_nome' WHERE id_category='$categoria_id'\";\n $result_update = mysqli_query($connection, $query_update);\n if ($result_update) {\n return header('Location: video_categorie.php?modify=true');\n } else {\n return header('Location: video_categorie.php?modify=false');\n }\n }\n}", "public function update(Request $request, Postcategory $postcategory)\n {\n //\n }", "public function update($dados_categoria) {\n\n $sql = \"UPDATE categoria SET descricao = ? WHERE id = ? \";\n \n $stmt = $this->conexao->prepare($sql);\n $stmt->bindValue(1, $dados_categoria['descricao']);\n $stmt->bindValue(2, $dados_categoria['id']);\n $stmt->execute();\n }", "public function update(Request $request){\n $validators=Validator::make($request->all(),[\n 'title'=>['required',Rule::unique('categories')->ignore($request->id)],\n 'description'=>['required',Rule::unique('categories')->ignore($request->id)]\n ]);\n if($validators->fails()){\n return Response::json(['errors'=>$validators->getMessageBag()->toArray()]);\n }else{\n $category=Category::findOrFail($request->id);\n $category->title=$request->title;\n $category->description=strtolower(implode('-',explode(' ',$request->description)));\n $category->save();\n return Response::json(['success'=>'Category updated successfully !']);\n }\n }", "public function update(Request $request, categorie $categorie)\n {\n $this->validate($request,[\"nomCat\"=>\"required\"\n ,\"status\"=>\"required\"]);\n //store data\n \n $nomCat=$request->nomCat;\n $status=$request->status;\n $categorie->update([\n \"nomCat\"=>$nomCat ,\n \"status\"=>$status\n ]); \n return redirect()->route('categorie.index')->with([\"succes\"=>\"categorie modifie avec succes\"]) ;\n }", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "function modificar_Categoria(){\n $conexion = Conexion();\n $sql = \"UPDATE tbl_categoria SET id_categoria = '$this->id_categoria', nombre = '$this->nombre' WHERE id_categoria = '$this->id';\";\n $conexion->query($sql);\n echo\"<script type=\\\"text/javascript\\\">alert('Modificacion Exitosa'); window.location='../Vista/Categoria.php';</script>\";\n }", "public function edit_category($category) {\n $this->category();\n $categories_sql_string = \"SELECT * FROM category WHERE id = \" . $category . \" limit 1\";\n $connection = new Database(\"sbrettsc_db\");\n $menu_array = $connection->get_array_from_query($categories_sql_string);\n $data = array(\"menu_array\" => array_shift($menu_array));\n\n $this->loadView(\"editors/category_editor\", $data);\n }", "public function update(Request $request, Category $category)\n {\n $this->validate(\n $request,\n [\n 'name' => 'required|unique:categories,name,' . $category->id,\n 'description' => 'required'\n ],\n [\n 'name.required' => 'Kolom Nama wajib diisi',\n 'nama.unique' => 'Nama kategori sudah digunakan',\n 'description.required' => 'Kolom Deskripsi wajib diisi',\n ]\n );\n\n //check jika image kosong\n if ($request->file('image') == '') {\n\n //update data tanpa image\n $category = Category::findOrFail($category->id);\n $category->update([\n 'name' => $request->name,\n 'slug' => Str::slug($request->name, '-'),\n 'description' => $request->description,\n ]);\n } else {\n //hapus image lama\n Storage::disk('local')->delete('public/categories/' . basename($category->image));\n\n //upload image baru\n $image = $request->file('image');\n $image->storeAs('public/categories', $image->hashName());\n\n //update dengan image baru\n $category = Category::findOrFail($category->id);\n $category->update([\n 'name' => $request->name,\n 'slug' => Str::slug($request->name, '-'),\n 'image' => $image->hashName(),\n 'description' => $request->description,\n ]);\n }\n\n if ($category) {\n //redirect dengan pesan sukses\n return redirect()->route('admin.category.index')->with(['success' => 'Data Berhasil Diupdate!']);\n } else {\n //redirect dengan pesan error\n return redirect()->route('admin.category.index')->with(['error' => 'Data Gagal Diupdate!']);\n }\n }", "public function update(Request $request)\n {\n //\n $this->validate($request, [\n 'slug' => 'required|alpha_dash|max:80|unique:categories,slug,' . $request->id,\n 'name' => 'required|string|max:60',\n 'description' => 'string|nullable',\n ]);\n\n $category = Category::find($request->id);\n $category->slug = $request->slug;\n $category->name = $request->name;\n \n if($category->update()){\n return redirect()->route('edit.category', ['id' => $category->id])->with(['success' => 'edited']);\n } else {\n return redirect()->route('index.category')->with(['error' => 'error']);\n }\n }", "public function update(Request $request, Category $category)\n {\n $data = $request->validate([\n 'category_name' => 'required|max:200',\n 'category_description' => 'required'\n \n ]);\n \n if($category->update($data)){\n return json_encode(['success' => true, 'message' => 'ลบข้อมูล ' . $category->category_name . ' เรียบร้อย']);\n }\n return json_encode(['success' => false, 'message' => 'มีข้อผิดพลาดไม่คาดคิด']);\n }", "public function update(Request $request, Catalogue $catalogue, Category $category)\n {\n $this->validate($request, [\n 'title' => 'required|max:100|unique:catalogues,title,' . $category->id,\n 'description' => 'required|max:1000',\n 'status' => 'required|max:10',\n 'image' => 'image'\n ],[\n 'title.required' => 'El título es requerido.',\n 'title.unique' => 'El título que has introducido ya existe.',\n 'title.max' => 'El titulo solo acepta un máximo de 250 caracteres.',\n 'description.required' => 'La descripción es requerida.',\n 'image.image' => 'Es necesario introducir una imagen.'\n ]);\n\n $this->verificaCatalogue($catalogue, $category);\n\n $category->fill($request->intersect(['title', 'description', 'image', 'status']));\n\n if ($request->hasFile('image')){\n\n $img = $request->file('image');\n $file_route = time() . '_' . $img->getClientOriginalName();\n\n Storage::disk('imgCategories')->put($file_route, file_get_contents($img->getRealPath()));\n\n $category->image = $file_route;\n }\n\n if ($category->isClean()) {\n return Redirect::back()->with('message', 'Debe especificar al menos un valor diferente para actualizar.');\n }\n\n $category->user_id = Auth::user()->id;\n\n if ($category->save()) {\n return Redirect::back()->with('message', 'Categoría editada correctamente.');\n }\n }", "public function update(UpdateCategoryRequest $request)\n {\n $category = Apiato::call('Category@UpdateCategoryAction', [$request]);\n\n // ..\n }", "public function updateCategory(){\n\t\t \n\t\t$file_id = $this->category_model->updateCategory($_POST['id'],$_POST['name']);\n\t\t echo $file_id;\n\t\t\t\t\n }", "function edit_category($tbl_name){\n\t\t//print_r($_POST); die;\n\t\tunset($_POST['submitLog']);\n\t\t$this->db->where('id', $_POST['id']);\n\t\tunset($_POST['id']);\n\t\t$this->db->update($tbl_name,$_POST);\n\t\t// print_r($this->db->last_query());\n\t // die();\n\t}", "public function update(Request $request, $category)\n {\n $categories = Category::findOrFail($category);\n $categories->update($request->all());\n }", "public function update(Request $request, Category $category)\n {\n $category = Category::findOrfail($category);\n // $category->update([\n // 'name' => $request->name,\n // 'description' => $request->description,\n // 'entity_id' => $request->entity,\n // ]);\n }", "public function update(Request $request)\n {\n // if ($request->categoryName == $category->categoryName) {\n // $this->validate($request, [\n // 'categoryName' => 'required',\n // 'categoryImage' => 'required'\n // ]);\n // } else {\n // $this->validate($request, [\n // 'categoryName' => 'required | unique:categories',\n // 'categoryImage' => 'required'\n // ]);\n // }\n\n $this->validate($request, [\n 'categoryName' => 'required',\n 'categoryImage' => 'required'\n ]);\n\n return Category::where('id', $request->id)->update([\n 'categoryName' => $request->categoryName,\n 'categoryImage' => $request->categoryImage\n ]);\n\n // $category->categoryName = $request->categoryName;\n // $category->categoryImage = $request->categoryImage;\n // $category->save();\n }", "public static function modifyCategory($categoryId,$categoryName)\n\t{\n\t\t\t$category = Category::find($categoryId);\n\t\t\t$category->categoryName = $categoryName;\n\t\t\t$category->save();\n\t}", "public function update($category, $categoryId, array $data)\n {\n try {\n $cat = $this->category->find($categoryId);\n\n $file = isset($data['file']) ? $data['file'] : '';\n\n if(!empty($file)){\n $this->uploadPath = 'uploads/product-category';\n $fileName = $this->upload($file);\n\n $data['image'] = $fileName;\n\n $this->__deleteImages($cat);\n }else{\n unset($data['image']);\n }\n\n $data['category_id'] = $category->id;\n\n $category = $cat->update($data);\n //$this->logger->info(' created successfully', $data);\n\n return $category;\n } catch (Exception $e) {\n //$this->logger->error($e->getMessage());\n return false;\n }\n }", "function edit_category() {\r\n\r\n\tif(isset($_POST['editcategory'])){\r\n\r\n\t\t$cat_id\t\t\t\t= clean_input($_GET['cat_id']);\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\r\n\r\n\t\t$xyquery = \"UPDATE categories SET \";\r\n\t\t$xyquery .= \"cat_name = '$cat_name',\";\r\n\t\t$xyquery .= \"cat_desc_short = '$cat_desc_short'\";\r\n\t\t$xyquery .= \",cat_desc_long = '$cat_desc_long'\";\r\n\t\t$xyquery .= \",cat_parent_id = '$cat_parent_id'\";\r\n\t\t$xyquery .= \",cat_url = '$cat_url'\";\r\n\t\t$xyquery .= \",cat_mod = '$cat_mod'\";\r\n\t\t$xyquery .= \",cat_mod_by = '$cat_mod_by'\";\r\n\t\t$xyquery .= \",page_template = '$page_template'\";\r\n\t\t$xyquery .= \",cat_meta_title = '$cat_meta_title'\";\r\n\t\t$xyquery .= \",cat_meta_keywords = '$cat_meta_keywords'\";\r\n\t\t$xyquery .= \",cat_meta_description = '$cat_meta_description'\";\r\n\t\t$xyquery .= \",insert_keywords = '$insert_keywords'\";\t\t\t\t\r\n\t\t$xyquery .= \"WHERE cat_id = '$cat_id'\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" been edited!</h4></center>\";\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been modified.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "function update(){\n\t\t// $update_query .= ' SET ';\n\t\t// $update_query .= ' name = \"'.$this->name.'\"';\n\t\t// $update_query .= ' WHERE category_id = '.$this->id;\n\n\t\t// $this->db->query($update_query);\n\t\t$this->db->update(\n\t\t\t'tb_pages',\n\t\t\tarray(\t\t\t\t\t\n\t\t\t'title' => $this->title,\n\t\t\t'content' => $this->content),\n\t\t\tarray('page_id' => $this->page_id)\n\t\t);\n\t}", "function update_categoria($idcategoria,$params)\n {\n $this->db->where('idcategoria',$idcategoria);\n return $this->db->update('categoria',$params);\n }", "public function update(Request $request, drugGroup $drugGroup)\n {\n $category= drugGroup::find($drugGroup->id);\n \n $category->id =$request->e_code;\n $category->group_name =$request->e_group_name;\n $category->subcat_code =$request->e_subcat_id; \n $category->save();\n return redirect(\"admin/drugGroup\")->with('success', 'Drup Group '. $category->e_group_name .' Updated Sucessfully');\n }", "function editCategory($category, $id) {\n $data = [\n 'name' => $_POST['name'],\n 'description' => $_POST['description']\n ];\n\n $stmt = $category->update($id, $data);\n header('location: confirm.php?action=Category&type=update&query='.$stmt);\n}", "public function update($id)\n\t{\n\t\t\n\t\tthrow new \\Exception(\"Couldnot save the category\");\n\t}", "public function update(Request $request, booksCategory $booksCategory)\n {\n //\n }", "public function update(Request $request, booksCategory $booksCategory)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n $this->validate($request, [\n 'name' => 'unique:categories,name,' . $category->id,\n 'image' => 'image|mimes:jpeg,jpg,img,gif,png,webp|max:1000,'\n ]);\n // check jika image kosong\n if ($request->file('image') == '') {\n // update data tanpa image\n $category = Category::findOrFail($category->id);\n $category->update([\n 'name' => $request->name,\n 'slug' => Str::slug($request->name),\n ]);\n } else {\n // hapus image lama\n $category_image_delete = basename($category->image) . PHP_EOL;\n Storage::disk('local')->delete('public/category-images/' . $category_image_delete);\n\n // upload image baru\n $image = $request->file('image')->store('category-images', 'public');\n // save db\n $category = Category::findOrFail($category->id);\n $category->update([\n 'image' => $image,\n 'name' => $request->name,\n 'slug' => Str::slug($request->name),\n ]);\n }\n\n if ($category) {\n // redirect dengan pesan success\n return redirect()->route('admin.category.index')->with([\n 'success' => 'Data Berhasil Di Update'\n ]);\n } else {\n // redirect dengan pesan error\n return redirect()->route('admin.category.index')->with([\n 'error' => 'Data Gagal Di Update'\n ]);\n }\n }", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",comments=\\\"$this->comments\\\",price=\\\"$this->price\\\",brand=\\\"$this->brand\\\",model=\\\"$this->model\\\",y=\\\"$this->y\\\",link=\\\"$this->link\\\",in_existence=\\\"$this->in_existence\\\",is_public=\\\"$this->is_public\\\",is_featured=\\\"$this->is_featured\\\",category_id=\\\"$this->category_id\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "function wp_update_category($catarr)\n {\n }", "public function updated(Category $category)\n {\n //\n // 1. Update Status\n Product::where('category_id', $category->id)->update([\n 'status' => $category->status\n ]); \n }", "public function update(){\n $service_category = new OsServiceCategoryModel($this->params['service_category']['id']);\n $service_category->set_data($this->params['service_category']);\n if($service_category->save()){\n $response_html = __('Service Category Updated. ID: ', 'latepoint') . $service_category->id;\n $status = LATEPOINT_STATUS_SUCCESS;\n }else{\n $response_html = $service_category->get_error_messages();\n $status = LATEPOINT_STATUS_ERROR;\n }\n if($this->get_return_format() == 'json'){\n $this->send_json(array('status' => $status, 'message' => $response_html));\n }\n }", "public function update(Request $request, Category $category)\n {\n $this->validate($request, [\n 'name' => 'required|max:191',\n // 'parent_id' => 'required|not_in:0',\n 'image' => 'mimes:jpg,jpeg,png|max:1000'\n ]);\n\n $params = $request->except('_token');\n $collection = collect($params);\n\n if ($collection->has('image') && ($params['image'] instanceof UploadedFile)) {\n if ($category->image != null) {\n $this->deleteOne($category->image);\n }\n $image = $this->uploadOne($params['image'], 'categories');\n } else {\n $image = null;\n }\n\n $featured = $collection->has('featured') ? 1 : 0;\n $menu = $collection->has('menu') ? 1 : 0;\n $merge = $collection->merge(compact('menu', 'image', 'featured'));\n $category->update($merge->all());\n\n return redirect(route('admin.categories.index'))->with('success', 'Category Updated Successfully!');\n }", "public function update(UpdateCategoryRequest $request, Category $category)\n {\n // $this->validate($request,[\n // 'name' =>['required',\n // Rule::unique('categories')->ignore($category->id)\n // ]\n // ]);\n \n // $data = request()->all();\n\n // $category->name = $data['name'];\n // $category->save();\n \n $category->update($request->all());\n session()->flash('success','Category updated Successfully');\n return redirect(route('categories.index'));\n }", "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 update(Request $request, Category $category)\n {\n if(Auth::user()->cannot('updateCategory',$category)) abort(403);\n $request->validate([\n 'category' => 'required'\n ]);\n\n try {\n $category->update($request->all());\n } catch (\\Exception $th) {\n return redirect()->route('categories.index')->with('failed','Failed to update, that category already created');\n }\n\n return redirect()->route('categories.index')->with('success','Category updated successfully');\n }", "public function update()\n {\n $category = ProductCategory::find( Input::get('id') );\n $category->name = Input::get('name');\n if( $category->save() ){\n return Redirect::to( route('Products::index') )->withFlash_message([\n \"msg\" => \"Product category has been updated successfully.\",\n \"type\" => \"info\"\n ]);\n }\n return false;\n }", "public function update(Request $request, Category $category)\n {\n /* VALIDATE DATA COMING IN FROM FORM */\n $data = $request->validate([\n 'name' => 'required',\n 'is_active' => 'required'\n ]);\n /* SAVE VALIDATED DATA TO DATABASE */\n $category->fill($data);\n $category->save();\n /* CONFIRM UPDATE AND REDIRECT USER */\n if(!$category->save()) {\n session()->flash('message', 'Contact Manager. ERROR: Category did not update');\n } else {\n session()->flash('message', 'Category Updated Successfully');\n }\n return redirect()->route('categories.index');\n }", "public function update(Request $request, Category $category)\n {\n $category->name = $request->name;\n $category->slug = Str::slug($request->slug);\n $category->save();\n\n return $this->apiResponse(ResultTypeController::Success, $category,\"Kategori Güncellendi\",200 );\n }" ]
[ "0.7380183", "0.67156273", "0.6685532", "0.664608", "0.6553447", "0.6522696", "0.65121937", "0.6486996", "0.6466222", "0.63781554", "0.6358192", "0.6355614", "0.6352818", "0.6349003", "0.631522", "0.6309351", "0.63021076", "0.6298562", "0.62837034", "0.6257291", "0.6237301", "0.6190927", "0.6186731", "0.6184683", "0.6184512", "0.618006", "0.6155878", "0.61465687", "0.61442155", "0.61331075", "0.6128076", "0.6122804", "0.6096818", "0.6084263", "0.60727215", "0.6072581", "0.6070784", "0.6066933", "0.6066071", "0.6066071", "0.6066071", "0.6066071", "0.6066071", "0.6066071", "0.6066071", "0.6066071", "0.6066071", "0.6066071", "0.6065753", "0.6054845", "0.6052345", "0.6052223", "0.6052192", "0.605088", "0.6050233", "0.6045248", "0.60369724", "0.60124236", "0.601152", "0.6003956", "0.60013527", "0.5994668", "0.5994438", "0.5993727", "0.5985946", "0.5984359", "0.5978494", "0.59763813", "0.59724057", "0.59704655", "0.5954191", "0.5940072", "0.591583", "0.59133124", "0.5911048", "0.5909408", "0.5907565", "0.59046185", "0.5904231", "0.5896714", "0.5896607", "0.5892995", "0.5891481", "0.58914584", "0.58906084", "0.58885866", "0.5886721", "0.5886721", "0.5879367", "0.5878613", "0.58700866", "0.5867976", "0.5867903", "0.5866557", "0.58662885", "0.58651423", "0.58626986", "0.5857882", "0.5856634", "0.584824" ]
0.593654
72