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
Store a newly created resource in storage.
public function store(Request $request) { $file[] = $request->file('images'); foreach ( $request->file('images') as $file) { $postImage = new Images; $name = Str::random(10); $url = \Storage::putFileAs('images',$file,$name . '.' . $file->extension()); $postImage->project_id = $request->project_id; $postImage->url = $url; $postImage->save(); } $Project = Project::create([ 'project_id' => $request->project_id, 'project_name' => $request->project_name, 'project_description' => $request->project_description, ]); return response($Project, Response::HTTP_CREATED); // $Project = Project::create($request->only('project_id','project_name','images','project_description')); // return response($Project, Response::HTTP_CREATED); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n { \n return view('admin.control.edit');\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($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($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(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()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\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($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($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit()\n {\n return view('initializer::edit');\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 edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.7855416", "0.769519", "0.72748375", "0.724256", "0.7173659", "0.7064689", "0.70549816", "0.6985127", "0.6949479", "0.69474626", "0.694228", "0.6929372", "0.6903047", "0.6899655", "0.6899655", "0.688039", "0.68649715", "0.68618995", "0.68586665", "0.68477386", "0.68366665", "0.6812782", "0.6807947", "0.68078786", "0.6803727", "0.6796845", "0.67935634", "0.67935634", "0.67894953", "0.67862976", "0.67815566", "0.6777874", "0.67700446", "0.6764179", "0.6747784", "0.6747784", "0.67476946", "0.6746584", "0.67417157", "0.67370653", "0.6727131", "0.6714694", "0.66953164", "0.6693583", "0.6690321", "0.66898996", "0.6689058", "0.66865313", "0.6684526", "0.66717213", "0.6670211", "0.6666833", "0.6666833", "0.66633433", "0.6663041", "0.6661699", "0.6658396", "0.6657984", "0.665473", "0.6644314", "0.66343915", "0.6633082", "0.6629606", "0.6629606", "0.6620677", "0.6620635", "0.66180485", "0.66171867", "0.6612161", "0.6610249", "0.660762", "0.6597593", "0.6596027", "0.6595597", "0.65925545", "0.65920216", "0.65896076", "0.65822965", "0.6581996", "0.65817595", "0.65770084", "0.65768373", "0.6575926", "0.65713066", "0.6569505", "0.656938", "0.65680295", "0.65636957", "0.65636957", "0.65624565", "0.65597314", "0.6559697", "0.65576696", "0.65573514", "0.65564495", "0.6556307", "0.655628", "0.65558994", "0.6549784", "0.6549675", "0.65461886" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $Project = Project::find($id); $Project->Project($request->all()); return response( new ProjectResource($Project), 202); }
{ "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 }", "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(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 }", "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 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 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 static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public abstract function update($object);", "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(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($id);", "public function update($id);", "public function put($path, $data = null);", "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 }", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\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 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 $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 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.7423347", "0.70622426", "0.70568657", "0.6896551", "0.65835553", "0.64519453", "0.6348333", "0.6212436", "0.61450946", "0.6122591", "0.6114199", "0.6101911", "0.60876113", "0.60528636", "0.60177964", "0.6006609", "0.59725446", "0.594558", "0.59395295", "0.5938792", "0.5893703", "0.5862337", "0.58523124", "0.58523124", "0.5851579", "0.5815571", "0.58067423", "0.5750728", "0.5750728", "0.5736541", "0.5723664", "0.5715135", "0.56949675", "0.5691129", "0.56882757", "0.5669375", "0.5655524", "0.56517446", "0.5647158", "0.5636521", "0.563466", "0.5632965", "0.56322825", "0.56291395", "0.56202215", "0.56087196", "0.56020856", "0.5591966", "0.5581127", "0.5581055", "0.558085", "0.5575458", "0.55706805", "0.55670804", "0.55629116", "0.5562565", "0.5558853", "0.5558505", "0.5558505", "0.5558505", "0.5558505", "0.5558505", "0.555572", "0.5555007", "0.5553948", "0.5553837", "0.5553147", "0.55429846", "0.5541925", "0.5540208", "0.5539145", "0.5536157", "0.55350804", "0.5534241", "0.5523782", "0.5518406", "0.55147856", "0.5513397", "0.550961", "0.55072165", "0.55067354", "0.5503418", "0.5501671", "0.55010796", "0.54998124", "0.5497327", "0.54942787", "0.54942036", "0.54942036", "0.54935455", "0.549267", "0.5491964", "0.5489983", "0.54833627", "0.54794145", "0.5478835", "0.5478348", "0.5465178", "0.54648995", "0.54607797", "0.54571307" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $Project = Project::destroy($id); return response(new ProjectResource($Project), 204); }
{ "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
Show the detail news
public function show($id){ DB::table('ab_news')->where('id', $id)->increment('visit'); $news = News::where('id', '=', $id)->first(); \Log::debug(request()->url(). ':'.$news->visit); // $news = DB::table('ab_news')->where('id', $id)->first(); return view('news.show', ['news' => $news]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(){\r\r\n $news = $this->New->find($_GET['id']);\r\r\n $this->render('news.show', compact('news'));\r\r\n }", "public function show(news $news)\n {\n //\n }", "public function show(News $news)\n {\n //\n }", "public function show(News $news)\n {\n //\n }", "public function show(News $news)\n {\n //\n }", "public function show(News $news)\n {\n //\n }", "public function show(NewsReplie $newsReplie)\n {\n //\n }", "public function details($id) {\n // load mete data\n $metaData = array();\n $metaData['title'] = \"News\";\n $metaData['description'] = \"News\";\n $this->view->meta = $metaData;\n //$this->view->left_layout = \"left_view\";\n $this->view->newsDetails = $this->model->getNewsDetails($id); \n $this->view->Loadview('news_details', 'news');\n }", "public function showAction() {\n $news = $this->newsRepository->findByUid($GLOBALS['TSFE']->id);\n $this->view->assign('news', $news)\n ->assign('settings', $this->settings);\n }", "public function show()\n {\n return view('news::show');\n }", "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 news_details($id)\n {\n $news = Posts::find($id);\n\n return view('news_details', ['item' => $news]);\n }", "public function show(News $news){\n //inserting the number of views on the articles\n $popular_news = new Popular_news;\n $popular_news->owner_id = auth()->id();\n $popular_news->news_id = $news->id;\n $popular_news->save();\n \treturn view('news.show', compact('news'));\n }", "public function newsAction() {\n\t\t\t$db = Zend_Registry::get('db');\n\t\t\t$id = (int)$this->getRequest()->getParam('id');\n\t\t\t$this->view->news = $db->fetchAll($db->select()->from('inwestycje_news')->order('data DESC')->where('id_inwest = ?', $id));\n\t\t\t$this->view->inwestycja = $db->fetchRow($db->select()->from('inwestycje')->where('id = ?', $id));\n\t\t}", "public function show($id)\n {\n $news = News::find($id);\n // $news = News::with('categories')->where('id', $id)->first();\n return view('web.detail', compact('news'));\n }", "public function detail(){\n\t\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t\t$record = $this->modelGetRecord($id);\n\t\t\t//load view\n\t\t\tinclude \"Views/BlogsDetailView.php\";\n\t\t}", "public function actionDetails()\n\t{\n\t\t$this->render('details',array('model'=>$this->loadarticles()));\n\t}", "public function show($id)\n {\n //dd($new);\n $new = News::find($id);\n return view('news.show', compact('new'));\n }", "public function show($id)\r\n {\r\n if(!$this->checkAccess(self::MODULE_NAME, 'S'))\r\n abort(401, 'Unauthorized action.');\r\n\r\n $id = base64_decode($id);\r\n\r\n $news = MstNews::findOrFail($id);\r\n /*\r\n * Detail\r\n */\r\n $model = DB::table('mst_news as p')\r\n ->join('mst_news_lang as pl','p.id','pl.news_id')\r\n ->where('p.id', $id)\r\n ->where('pl.code', 'IND')\r\n ->select(\r\n 'pl.id as news_lang_id',\r\n 'pl.title',\r\n 'pl.sub_title',\r\n 'pl.description',\r\n 'pl.image',\r\n 'pl.iframe',\r\n 'p.*'\r\n )\r\n ->first();\r\n\r\n $category = DB::table('mst_news_category_detail as a')\r\n ->join('mst_news_category as b','b.id','a.category_id')\r\n ->join('mst_news_category_lang as c','c.category_id','b.id')\r\n ->select('c.name')\r\n ->where('a.news_id',$id)\r\n ->where('c.code',\"IND\")\r\n ->get();\r\n\r\n $tag = DB::table('mst_news_tag_detail as a')\r\n ->join('mst_news_tag as b','b.id','a.tag_id')\r\n ->join('mst_news_tag_lang as c','c.tag_id','b.id')\r\n ->select('c.description as name')\r\n ->where('a.news_id',$id)\r\n ->where('c.code',\"IND\")\r\n ->get();\r\n /*\r\n * Comment\r\n */\r\n $comment = new MstNewsComment;\r\n $commentList = DB::table('mst_news_comment as nc')\r\n ->join('mst_investor as i','nc.investor_id','i.id')\r\n ->select('i.full_name as investor','i.photo','nc.comment','nc.created_at','nc.id','nc.is_visible')\r\n ->where('nc.is_deleted',0)\r\n ->where('nc.parent',null)\r\n ->orderBy('nc.created_at','desc')\r\n ->get();\r\n\r\n $language = MstLanguage::whereNotIn('code',['IND'])->get();\r\n\r\n $uti = new Utility();\r\n return view('master.news.detail', compact([\r\n 'news', \r\n 'model', \r\n 'language', \r\n 'category', \r\n 'tag', \r\n 'comment', \r\n 'commentList', \r\n 'uti'\r\n ]));\r\n }", "public function newsDetail($news_id)\n\t{\n\t\t$this->sidebar_template = 'pdetaillegend';\n\t\t$news = R::load('news', $news_id);\n\t\t$this->page = R::dispense('page');\n\t\t$this->page->name = htmlspecialchars(strip_tags($news->name));\n\t\tob_start();\n\t\tFlight::render('mtg/newsdetail', array(\n\t\t\t'news' => $news\n\t\t));\n\t\t$this->content = ob_get_contents();\n\t\tob_end_clean();\n\t\t$this->render();\n\t}", "public function detail() {\n $url = explode('/', $_GET['url']);\n $id = $url[2];\n $this->loadView('detail', 'content');\n $client = $this->em->selectById('client', $id);\n $village = $this->em->selectById('village', $client->getIdVillage());\n $this->loadHtml($client->getId(), 'id');\n $this->loadHtml($client->getNomFamille(), 'nomFamille');\n $this->loadHtml($village->getNom(), 'village');\n $this->loadHtml($client->getTelephone(), 'telephone');\n $this->dom->getElementById('lien_client')->href .= $id;\n }", "public function news()\n {\n $result = $this->dtbs->list('news');\n $data['info'] = $result;\n $this->load->view('back/news/anasehife',$data);\n }", "public function show()\n {\n $offset = Input::get('offset');\n $news = App\\News::latest('created_at')->skip($offset)->take(6)->get();\n \\DB::table('news')->count() > 7 + $offset ? $hide = false : $hide = true;\n foreach ($news as $item){\n $item['url'] = IndexController::translitURL($item['title']);\n $item['created'] = IndexController::restyleDate($item['created_at']);\n }\n return ['news' => $news, 'hide' => $hide];\n }", "public function index(){\r\r\n $news =$this->New->last();\r\r\n $this->render('news.index', compact('news'));\r\r\n }", "public function show($newsid)\n {\n //\n $new=News::findOrFail($newsid); \n return view('News.show',compact('new'));\n }", "public function show(NewsFeed $newsFeed)\n {\n //\n }", "public function show($id){\n\n $culturalNews = DB::table('BA_CULTURAL_NEWS')\n ->select('*')\n ->where('CULTURAL_NEWS_ID', $id)\n ->get();\n\n return view('admin.culturalNews.culturalNews_single')->with('culturalNews',$culturalNews)\n ->with('page','culturalNews'); // in order to get active class;\n\n }", "public function detailAction() {\n\n //GET THE LIST ITEM\n $this->view->listDetail = Engine_Api::_()->getItem('list_listing',(int) $this->_getParam('id'));\n }", "public function show($id)\n {\n $news=NewEvent::find($id);\n return view('news.show',compact('news'));\n }", "public function show($id)\n {\n $data = News::findOrFail($id);\n return view('backend.news_detail',compact('data'));\n }", "public function action_detail()\n\t{\n\t\t$this->template = View::forge('template-admin');\n\n $get = Input::get();\n\t\t$id = $get[\"id\"];\n\t\t$data[\"details\"] = Model_Event::find_by('id',$id);\n\t\t//return Response::forge(View::forge('event/detail',$data));\n\t\t$this->template->title = \"イベント詳細\";\n\t\t$this->template->content = View::forge('event/detail', $data);\n\t}", "public function show($id)\n {\n return view('news.single', [\"news\" => News::find($id)->first(), \"comments\" => Comments::where('news_id', '=', $id)->get()]);\n }", "public function sinfo()\n {\n $sinfo = DB::table('news')->where('section','=','sinfo')->get();\n return view('mladenovac.sinfo');\n }", "public function show(News $news)\n {\n dd(__METHOD__);\n }", "public function detailAction($id){\n $article = Article::findFirst($id);\n $this->view->setVar('article', $article);\n\n }", "public function news()\n {\n $news = Posts::where('status', '=', 'on')\n ->orderBy('date', 'desc')\n ->get();\n\n return view('news', ['news' => $news]);\n }", "public function detail(Request $request)\n {\n //lay chi tiet bai viet\n $articleModel = new ArticleModel();\n $params['id']=$request->id;\n $item = $articleModel->getItem($params, ['task' => 'get-item']);\n\n //get breadcrumbs\n $cat=new CategoryArticleModel();\n $params['category_article_id']=$item->category_article_id;\n $breadItems = $cat->getItem($params,['task'=>'breadcrumbs']);\n\n //get all category with number article\n $cats=$cat->listItems(null,['task'=>'news-list-items-for-count']);\n\n\n //get all article same category recently\n $itemsRecent=$articleModel->getItem($params,['task'=>'news-get-item-recent']);\n\n //get archive\n $itemsArchive=$articleModel->getItem($params,['task'=>'news-get-item-archive']);\n\n //lay share button facebook,twitter\n $setting=new SettingModel();\n $share_setting=$setting->getItem(null,['task'=>'share']);\n\n //lay list comment\n $comment=new CommentModel();\n $itemsComment=$comment->listItems($params,['task'=>'news-list-items']);\n\n\n /*================================= increase view ==========================*/\n if($_SERVER['REMOTE_ADDR']!=session('ip_view') || strtotime(now())>session('time_view')+120 || $request->url()!= session('url_view')){\n session(['ip_view'=>$_SERVER['REMOTE_ADDR']]);\n session(['time_view'=>strtotime(now())]);\n session(['url_view'=>$request->url()]);\n $params['view']=$item->view+1;\n $articleModel->increaseView($params);\n }\n\n\n return view($this->pathViewController . 'detail', compact(\n 'item','breadItems','cats','itemsRecent',\n 'itemsArchive','share_setting','itemsComment'\n\n ));\n }", "public function show($id)\n {\n //\n $News = Newc::find($id);\n $cate = Category::pluck('category','id');\n $categories = CategoryNew::pluck('category_name','id');\n return view('news.show', compact(['News','categories','cate']));\n }", "public function detailAction()\n {\n $movieId = $this->dispatcher->getParam('id');\n\n $content = $this->api->get(self::API_ROUTE_MOVIE_CRUD . '/' . $movieId);\n\n if($content instanceof AppError) {\n $this->view->setVar('errors', $content->getMessage());\n } else {\n $this->view->setVar('movie', $content->movie);\n $this->view->setVar('genres', $content->genres);\n $this->view->setVar('videos', $content->videos);\n $this->view->setVar('isFavorite', $content->isFavorite);\n }\n }", "public function show(newsAstron $newsAstron)\n {\n return \"Hello-1\";\n }", "public function show_detail($i_id=0)\r\n {}", "public function show_detail($i_id=0)\r\n {}", "public function show($id)\n {\n //\n\n $news = News::find($id);\n return view('news.show', compact('news'));\n }", "public function list_news(){\n\t\t\t$recordPerPage = 15;\n\t\t\t//----\n\t\t\t//phan trang\t\n\t\t\t//tinh tong so ban ghi\n\t\t\t$total = $this->model_total();\t\t\t\n\t\t\t//tinh tong so trang\n\t\t\t$numPage = ceil($total/$recordPerPage);//ham ceil de lay tran\n\t\t\t//lay bien p truyen tu url -> bien nay the hien la dang o may\n\t\t\t$p = isset($_GET[\"p\"])&&is_numeric($_GET[\"p\"])? $_GET[\"p\"]-1:0;\n\t\t\t$fromRecord = $p*$recordPerPage;\t\t\t\n\t\t\t//----\n\t\t\t//goi ham model_get() trong class newsModel de lay du lieu\n\t\t\t$data = $this->model_get($fromRecord,$recordPerPage);\n\t\t\t$this->renderHTML(\"views/backend/list_news.php\", array(\"data\"=>$data,\"numPage\"=>$numPage));\n\t\t}", "public function show(\\App\\News $news)\n {\n return view('newshub.show', compact('news'));\n }", "public function show($id)\n {\n //$this->_DetailItem();\n }", "public function index()\n {\n //\n $list_news = News::orderBy('id', 'desc')\n ->select('id','title','abstract','date_end','state')\n ->get();\n \n return view('news_admin',['list_news' => $list_news,'news_id' => 0]);\n }", "public function show($id)\n {\n $news = news::find($id);\n\n $title = 'Info';\n\n return view('admin.news.show', compact('news', 'title'));\n }", "public function show($id)\n {\n $newsposts = NewsPost::find($id);\n return view('newsposts.show')->with('newspost',$newsposts);\n }", "public function show(News $news)\n {\n $id = $news->id;\n $new=News::findOrFail($id);\n return response()->json(['noticia' => $new], 200);\n \n }", "public function show($id)\n {\n $newspost = NewsPost::find($id);\n return view('newsposts.show')->with('newspost',$newspost);\n }", "public function index()\n {\n $news = App\\News::latest('created_at')->take(6)->get();\n $count = \\DB::table('news')->count();\n $count > 7 ? $show = true : $show = false;\n foreach ($news as $item){\n $item['url'] = IndexController::translitURL($item['title']);\n $item['created'] = IndexController::restyleDate($item['created_at']);\n }\n return view('index', ['news' => $news, 'showmore' => $show]);\n\n }", "public function index()\n\t{\n\t\t$page = 1;\n\t\t$breadcrumb = false;\n\t\t$heading = 'ข่าวและกิจกรรม';\n\t\t$records = News::all()->count();\n\t\t$news \t = [];\n//\t\tdd(News::all());\n\n\t\tforeach(News::all()->sortByDesc('id')->take(10) as $item => $value){\n\t\t\t$news[] = $value;\n\t\t}\n\t\treturn view('backend.news.read', compact('heading', 'records', 'news', 'page', 'breadcrumb'));\n\n//\t\treturn view('backend.news.read')->with('heading', $heading);\n//\t\treturn view('errors.503');\n\t}", "public function index()\n {\n // yang semula News:all, diubah menjadi with() yang menyatakan relasi\n // $news = News::with('category')->get();\n $news = News::all();\n $paginate = News::orderBy('id', 'asc')->paginate(2);\n return view('admin.news', ['news' => $news, 'paginate' => $paginate]);\n }", "public function detailsblog()\n {\n $publicites = $this->listespubs;\n $id_blog = \\Request::get('blog_id');\n $collection = $this->blog->modelDetailArticle($id_blog);\n $this->incrementationlecture($id_blog);\n return view('front.detailblog',compact('collection','publicites'));\n }", "public function show()\n {\n $articles = $this->getArticles();\n $selectedTitle=$_GET['title'];\n\n foreach ($articles as $article)\n if ($selectedTitle== $article->title){\n $articleDescription = $article->description;\n } \n\n require 'View/articles/show.php';\n\n }", "protected function detail($id)\n {\n $show = new Show(News::findOrFail($id));\n\n $show->id('Id');\n $show->title('题目');\n $show->category_id('新闻分类');\n $show->content('内容');\n $show->thumbnail('缩略图');\n $show->status('状态');\n $show->read_count('阅读数量');\n $show->created_at('创建日期');\n $show->updated_at('更新日期');\n\n return $show;\n }", "public function show(Noticia $noticia)\n {\n // $noticia = Noticia::where('slug','=' ,$slug)->firstOrFail();\n //$noticia = Noticia::find($id);\n\n return view('admin.news.show', compact('noticia'));\n }", "public function show($id)\n {\n $data['news'] = News::findOrFail($id);\n return view('users.news.show', $data);\n }", "public function show(){\n return view('details');\n }", "public function actionIndex()\n {\n $query = News::find()->select('id, date, captiopn, preview');\n $pagination = new Pagination([\n 'defaultPageSize' => 5,\n 'totalCount' => $query->count()\n ]);\n $news = $query->orderBy(['date'=> SORT_DESC])\n ->offset($pagination->offset)\n ->limit($pagination->limit)\n ->all();\n return $this->render('index',[\n 'news' => $news,\n 'pagination' => $pagination,\n ]);\n }", "public function details()\n\t{\n\t\t$this->load->view('landtour_details');\n\t}", "public function index()\n {\n $news = News::latest()->get();\n return view('farmer.news.index', compact('news'));\n }", "public function index() {\n // load mete data\n $metaData = array();\n $metaData['title'] = \"News\";\n $metaData['description'] = \"News\";\n $this->view->meta = $metaData;\n //$this->view->left_layout = \"left_view\";\n $this->view->newsList = $this->model->getNewsList();\n $this->view->Loadview('news', 'news');\n }", "public function show($link)\n\t{\n\t\t$newss = new News;\n $new = DB::table('news')->where('link',$link)->first();\n return view('fontend.pages.tin-tuc.trang-tin',compact('new','newss'));\n\t}", "function ViewDetail_Item_news( $tbl_news, $id ){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE id = '$id'\");\n\t\t$result = mysql_fetch_object($sql);\n\t\treturn $result;\n\t}", "public function index()\n {\n //\n $new=News::all();\n return view('News.index',compact('new'));\n }", "public function read($id)\n {\n $id = preg_replace(\"/[^0-9]/\", '', $id);\n $item = App\\News::where('id','=', $id)->get();\n return view('showarticle',['item' => $item]);\n }", "public function show($id)\n\t{\n\t\t$news = $this->news->findOrFail($id);\n\n\t\treturn View::make('admin.news.show', compact('news'));\n\t}", "public function newslist()\n {\n $this -> load -> model('news_model');\n $news_result = $this -> news_model -> get_all_news();\n $data = array(\n 'list' => $news_result,\n );\n $this->load->view('home/newslist', $data);\n }", "public function singlePage() {\n if(isset($_GET['idNews'])){\n $idNews = $_GET['idNews'];\n $modelNews = new News(Database::instance());\n $modelComments = new Comments(Database::instance());\n\n $singleData = $modelNews->GetPrintSingleData($idNews);\n $allComments = $modelComments->GetAllComments($idNews);\n if($singleData == null) {\n $this->redirect(\"index.php?page=404\");\n }\n\n $this->data['singleData'] = $singleData;\n $this->data['allComments'] = $allComments;\n\n $this->loadView(\"single\", $this->data);\n $this->getLogInfo();\n\n }\n }", "public function show($id)\n {\n return News::findOrFail($id);\n }", "public function index()\n\t{\n\t\t$news = $this->news->all();\n\n\t\treturn View::make('admin.news.index', compact('news'));\n\t}", "public function show($id)\n {\n $news = $this->newsService->showNewsByID($id);\n return view('admin.Site.news.show', [\n 'news' => $news\n ]);\n }", "public function show($id)\n {\n $news = News::find($id);\n if ($news)\n return view('backend.admin.news.show', compact('news'));\n else\n return redirect()->route('home');\n }", "public function show($id)\n {\n $article = News::find($id);\n if ($article == null)\n return abort(404);\n $article->Views++;\n $article->save();\n\n $article = News::where('id', $id)->with('User')->get()->toArray()[0];\n $xml = simplexml_load_file(\"../public/news_data/$id/index.xml\");\n $comments = News_Comment::where('Article', $id)->orderByDesc('created_at')->with('User')->get()->toArray();\n return view(\"Article\", ['article' => $article, 'xml' => $xml, 'comments' => $comments]);\n }", "public function index()\n {\n $this->data['rows'] = DB::table('news')\n ->leftJoin('categories', 'news.category_id', 'categories.id')\n ->leftJoin('subcategories', 'news.subcategory_id', 'subcategories.id')\n ->select(\n 'news.*',\n 'categories.name as category',\n 'subcategories.name as subcategory'\n )\n ->where([\n 'news.status'=>1\n ])\n ->orderby('news.id', 'desc')\n ->get();\n\n return view('backend.pages.news.all')->with($this->data);\n }", "public function index()\n {\n $news = GetNew::toDisplay()->paginate(25);\n\n return view('portal')->with([\"news\" => $news]);\n }", "public function show($id)\n {\n $news = News::findorfail($id);\n return view('farmer.news.show', compact('news'));\n }", "public function actionNews()\n {\n $title = '微站设置/图文设置';\n //title of webpage,you can find title in /web/pub/top.php eg:wechat demo\n $keywords = 'wechat demo';\n //title of webpage,you can find title in /web/pub/top.php eg:''\n $description = '';\n return $this -> render('news',[\n 'title' => $title,//title of webpage,you can find title in the head of /web/pub/top.php\n 'keywords' => $keywords,//keywords of webpage,you can find keywords in the head of /web/pub/top.php\n 'description' => $description//description of webpage,you can find description in the head of /web/pub/top.php\n ]);\n }", "protected function _show_news()\n {\n $this->load->model('news_model', 'news');\n\n // fetch the last 5 news items\n $news = $this->news->get_news_items(5, $this->session->userdata('userid'));\n\n if ($news->num_rows() > 0) {\n $i = 1;\n $datestring = $this->options['date_format'];\n\n foreach ($news->result() as $row) {\n $date = gmt_to_local($row->news_date, $this->timezone, $this->dst);\n\n $items[$i]['id'] = $row->news_id;\n $items[$i]['title'] = $row->news_title;\n $items[$i]['content'] = $row->news_content;\n $items[$i]['date'] = mdate($datestring, $date);\n $items[$i]['category'] = $row->newscat_name;\n $items[$i]['author'] = $this->char->get_character_name($row->news_author_character, true, false, true);\n\n ++$i;\n }\n\n return $items;\n }\n\n return false;\n }", "public function show()\n {\n\t\t//$_SESSION['p_id_actual'] = $_GET['id'];\n\n\t\t//If we are on index view posts and want to see one of them, we've got 'id'\n\t\t/* if(isset($_GET['id']))\n\t\t{\n\t\t\t$idToGo = $_GET['id'];\n\t\t}\n\t\t//If\n\t\telseif(!isset($_GET['id']))\n\t\t{\n\t\t\t$idToGo = $_SESSION['p_id_actual'];\n\t\t} */\n\t\t//Montrer un article\n\t\t$post = $this->model->findWithHisAuthor($_GET['id']);\n\t\t//$comments = $this->modelJoinded->findWithHisAuthor($_GET['id']);\n\t\t$totalComments = count($this->modelJoinded->findWithHisAuthor($_GET['id']));\n\t\t$itemPerpage = 5;\n\t\t$totalPages = ceil($totalComments/$itemPerpage); //ceil around superior number\n\t\t\n\t\tif(isset($_GET['page']) AND !empty($_GET['page']) AND $_GET['page'] > 0)\n {\n $_GET['page'] = intval($_GET['page']); //return an entier value\n $currentPage = $_GET['page'];\n }\n else\n {\n $currentPage = 1;\n\t\t}\n\t\t$start = ($currentPage - 1)*$itemPerpage;\n $comments = $this->modelJoinded->countItems($start, $itemPerpage, $_GET['id']);\n\n\t\t//TODO refactoriser la jointure dans le parent\n\t\t$_SESSION['p_id'] = $post->p_id;\n\n\t\t//utilisateur actuellement connecté, pour comparaison utlérieur\n\t\t//$loggedUser = $_SESSION['u_nickname'];\t\t\n\t\t$pageTitle = $post->p_title; //head page (SEO)\n\t\t\n\t\t\n\t\t$description = $post->p_extract; //head page (SEO)\n\n\t\t$author = $post->p_author_name;\n\n\t\t//Enregistré en session l'auteur ça me servira plus tard pour le droit de modification de l'article, même chose pour les commentaires\n\t\t$_SESSION['p_author'] = $post->p_author_name;\n\t\t\t\t\n\t\t//Utiliser compact comme un array\n \\Renderer::render('post/post', compact('pageTitle', 'description', 'post', 'comments', 'author', 'totalPages'));\n\t}", "public function news($url='page',$page=0){\n\t\t$data \t\t\t\t\t\t= $this->data;\n\t\t$data['menu'] \t\t\t\t= 'news';\n\t\t$data['category'] \t\t\t= CategoryBlogModel::desc()->get();\n\t\t$data['tag'] \t\t\t\t= TagModel::desc()->get();\n\t\t$data['popular_news'] \t\t= BlogModel::notDraft()->take(4)->orderBy('view','desc')->get();\n\t\t$data['events']\t\t\t\t= EventPromoModel::notDraft()->take(4)->desc()->get();\n\t\tif($url==\"detail\" && $page!=0){\n\n\t\t\t$news \t\t\t\t= BlogModel::notDraft()->find($page);\n\n\t\t\tif(!$news){\n\t\t\t\tredirect('error');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$data['tag_txt'] \t= '';\n\n\t\t\tforeach ($news->tags as $result) {\n\t\t\t\t$data['tag_txt'] .= $result->tag->name.',';\n\t\t\t}\n\n\n\t\t\t$data['news'] \t\t= $news;\n\t\t\t$data['related'] \t= BlogModel::notDraft()->where('id_category',$news->id_category)\n\t\t\t\t\t\t\t\t\t\t->where('id','!=',$news->id)->take(3)->desc()->get();\n\t\t\techo $this->blade->nggambar('website.news.content',$data);\n\t\t}\n\t\telse {\n\t\t\tif(!is_numeric($page)){\n\t\t\t\t$page \t= 0;\n\t\t\t}\n\n\t\t\t$name \t\t\t\t\t\t= (null != $this->input->get('q')) ? $this->input->get('q') : '';\n\t\t\t\n\t\t\t$paginate\t\t\t\t\t= new Aksa_pagination;\n\t\t\t$data['page']\t\t\t\t= $page;\n\t\t\t\n\t\t\t$data['total']\t\t\t\t= BlogModel::notDraft()->where('name', 'LIKE', '%'.$name.'%');\n\t\t\t$data['news']\t\t\t\t= BlogModel::notDraft()->where('name', 'LIKE', '%'.$name.'%');\n\n\t\t\t$data['total'] \t\t\t\t= $data['total']->get();\n\t\t\t$data['news'] \t\t\t\t= $data['news']->take(6)->skip($page*6)->desc()->get();\n\n\t\t\t$data['pagination'] \t\t= $paginate->paginate(base_url('main/news/page/'),5,6,count($data['total']),$page);\n\t\t\techo $this->blade->nggambar('website.news.index',$data);\n\t\t\treturn;\n\t\t}\n\t}", "public function show($id)\n {\n //\n $newsfeed = Newsfeed::findOrFail($id);\n if ( count($newsfeed) > 0){\n return view('newsfeed.show',compact('newsfeed'));\n }else {\n return \"Error :: Data not found\";\n }\n \n }", "function onShowDetail(&$pr, &$ds) {\n\t$hotel = $this->dTable->detailed($this->entryId)->execute()->getFirst();\n\n\t$this->dsDb->add(\"Hotel\",$hotel->toArray(true));\n\n\t$fn = $this->name() . \"/show.xml\";\n\t$pr->loadPage( $fn );\n }", "public function show(DetailPelamar $detailPelamar)\n {\n //\n }", "public function index()\n {\n $newsList = News::orderBy('created_at', 'desc')->paginate(10);\n $title = $this->title;\n\n return view('admin.news.index', compact('newsList', 'title'));\n }", "public function index()\n {\n $detail = Detaill::all();\n return view('detail.index',compact('detail','mobil'));\n }", "public function main($news_id = NULL) {\n //Instanciate the view to create a nice view\n $newsview = new View_model('news');\n\n //we are going to watch al newsitems\n if (userLoggedIn()){\n $newsview->assign('unseen', $this->countUnseenNewsItems());\n }\n $newsview->assign('content', $this->showAllNews($news_id));\n\n return $newsview->render(FALSE);\n }", "function show($id) {\n // switch($id) {\n // case 1:\n // echo \"NUMBER ONE\";\n // break;\n // case 2:\n // echo \"NUMBER TWO\";\n // break;\n // default: \n // echo \"sample\";\n // }\n $article = Article::find($id);\n $tags = Tag::all();\n // dd($article);\n // dd($article->comments);\n // dd($article->comments()->get());\n // $comment = Comment::find($id);\n return view('articles.single_article', compact('article', 'tags'));\n }", "public function index()\n {\n \n $news=News::leftjoin('newstype','news.news_id','=','newstype.n_id')->paginate(2);\n //dd($news);\n //ajax分页\n if (request()->ajax()) {\n return view('news.ajaxpage',['news'=>$news]);\n }\n return view('news.index',['news'=>$news]);\n }", "public function showChangePageAction(){\n $need = array(\"newsid\" => \"文章ID不能为空\");\n $row = hasRequired($_GET, $need);\n if ($row !== true) {\n $this->error($row);\n } else {\n $want = array(\"newsid\" => \"news_id\");\n $other = \"\";\n $data = getdata(I(\"get.\",\"\",\"htmlspecialchars\"),$want,$other);\n }\n $result = D('News') -> findById($data);\n if($result!=0 && $result) {\n // dump($result);\n $menulist = D('Menu') -> getList();\n $this -> assign(\"menulist\",$menulist);\n $this -> assign(\"articleinfo\",$result);\n $this->display();\n }else{\n $this->error(\"获取数据失败\");\n }\n }", "public function show($newsId,$sort = null)\n {\n\t $news = News::find($newsId);\n\t\t\treturn $news;\n\n }", "public function index()\n\t{\n\t\t$navActive = 'news';\n\n\t\t$category = Category::whereName('news')->first();\n\t\t$articles = $category->articles()->orderBy('created_at', 'desc')->paginate(2);\n\t\t$welcomeArticle = Article::whereSlug('news')->first();\n\t\t$sponsors = Sponsor::all();\n\t\t$socialNetworks = SocialNetwork::all();\n\n\t\treturn View::make('news.index')->with(['navActive' => $navActive, 'articles' => $articles, 'welcomeArticle' => $welcomeArticle, 'sponsors' => $sponsors, 'socialNetworks' => $socialNetworks]);\n\t}", "public function displayOneArticle()\n {\n $this->articleId = $_GET['id'];\n $query = $this->articleModel->displayOneArticle($this->articleId);\n $this->showArticleDetails = $query->fetch();\n\n // Change the author by the nickname corresponding to the id given\n $model = $this->userModel->displayOneUser($this->showArticleDetails['author']);\n $this->showArticleDetails['author'] = $model['nickname'];\n\n // Change the category by the name corresponding to the id given\n if ($this->showArticleDetails['category'] !== null) {\n $model = $this->categoryModel->displayOneCategory((int)$this->showArticleDetails['category']);\n $this->showArticleDetails['category'] = $model['name'];\n }\n\n $query = $this->commentModel->displayCommentsFromArticle($this->articleId);\n $this->showComments = $query->fetchAll();\n }", "public function getIndex()\n\t{\n\t\t$news = News::orderBy('created_at', 'desc')->paginate(10);;\n\t\t$pinnedNews = News::where('pinned',true)->first();\n\t\treturn view('admin.news.index', compact('news','pinnedNews'));\n\t}", "public function index()\n {\n $news = News::where('status', 'Active')\n ->orderBy('created_at', 'desc')\n ->take(10)\n ->get();\n\n return view('frontend.home',[\n \"news\"=>$news\n ]);\n }", "public function show($id)\n {\n\n $newOne = Newst::findOrFail($id);\n if (View::exists('pages.manager.94_form_show_news')) {\n return view('pages.manager.94_form_show_news', compact('newOne'));\n } else {\n abort('404');\n }\n }", "protected function detail($id)\n {\n $show = new Show(Community::findOrFail($id));\n\n\n $show->field('id', __('Id'));\n $show->field('permalink', __('Permalink'));\n $show->field('eyecatch_path', __('Eyecatch path'));\n $show->field('name', __('Name'));\n $show->field('pref', __('Pref'));\n $show->field('information', __('Information'));\n $show->field('image1_path', __('Image1 path'));\n $show->field('image2_path', __('Image2 path'));\n $show->field('image3_path', __('Image3 path'));\n $show->field('video1_link', __('Video1 link'));\n $show->field('video2_link', __('Video2 link'));\n $show->field('video3_link', __('Video3 link'));\n $show->field('calendar', __('calendar'));\n $show->field('message_image_path', __('Message image path'));\n $show->field('message', __('Message'));\n $show->field('contact', __('Contact'));\n $show->field('facebook_link', __('Facebook link'));\n $show->field('instagram_link', __('Instagram link'));\n $show->field('website_link', __('Website link'));\n $show->field('created_at', __('Created at'));\n $show->field('updated_at', __('Updated at'));\n\n\n return $show;\n }", "public function index()\n {\n //\n $news = News::latest()->where('published', 1)->paginate(9);\n return view('news.index', compact('news'));\n }" ]
[ "0.8381032", "0.7961891", "0.7846172", "0.7846172", "0.7846172", "0.7846172", "0.7838067", "0.78235257", "0.7773279", "0.76337266", "0.7628666", "0.7550014", "0.7452697", "0.7413637", "0.73826534", "0.7358465", "0.7344281", "0.7318524", "0.731642", "0.73020774", "0.7255603", "0.7171877", "0.71669114", "0.7157333", "0.71569705", "0.71019214", "0.70865107", "0.707248", "0.70670265", "0.7062169", "0.70506537", "0.70241517", "0.7020928", "0.70095736", "0.69960177", "0.69952434", "0.6951193", "0.69207597", "0.6917139", "0.6913142", "0.6902622", "0.6902622", "0.6892113", "0.68895817", "0.6887624", "0.6885454", "0.6881986", "0.6880791", "0.68752635", "0.68653256", "0.684724", "0.6843231", "0.6831289", "0.68258536", "0.6819073", "0.68163586", "0.6815647", "0.68066484", "0.6787507", "0.678056", "0.6766844", "0.6744487", "0.6742921", "0.6740266", "0.673225", "0.6730986", "0.6730288", "0.6726283", "0.6725041", "0.67228967", "0.67203784", "0.6718061", "0.6708692", "0.67070115", "0.6698306", "0.66965646", "0.66889435", "0.66870296", "0.6680137", "0.6679779", "0.6677982", "0.6676152", "0.6676148", "0.6675556", "0.6669363", "0.6666263", "0.6665466", "0.66625834", "0.6659299", "0.66589314", "0.66576385", "0.66562873", "0.66419476", "0.66354716", "0.6625567", "0.6621886", "0.6620164", "0.66198385", "0.6615367", "0.66139334" ]
0.7328753
17
Populate the backend with a given object
public function loadFromContainer(AssetContainer $assetContainer) { return $this->setAssetContainer($assetContainer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function populate($object)\n {\n }", "public function loadFromObject($object){\n foreach ($object as $property => $value) {\n //we must ignore this fields\n if(\\in_array($property,['_type','_primary_key','id'])){\n continue;\n }\n $this->{$property}=$value;\n }\n # we set the real short class name\n if(property_exists($model,'_type')){\n $this->setTableName($model->_type);\n }else{\n $modelObj->setTableName(RedBeanEngine::classNameToTableName($model)); \n }\n }", "public function load_from_object ($obj)\n {\n parent::load_from_object ($obj);\n $this->set_value ('name', $obj->title);\n $this->set_value ('orig_email', $obj->email);\n $this->set_value ('email', $obj->email);\n $this->set_value ('real_first_name', $obj->real_first_name);\n $this->set_value ('real_last_name', $obj->real_last_name);\n $this->set_value ('home_page_url', $obj->home_page_url);\n $this->set_value ('picture_url', $obj->picture_url);\n $this->set_value ('icon_url', $obj->icon_url);\n $this->set_value ('signature', $obj->signature);\n $this->set_value ('publication_state', History_item_silent);\n $this->set_value ('email_visibility', $obj->email_visibility);\n \n $this->set_visible ('title', $this->app->user_options->users_can_change_name);\n $this->set_visible ('password1', false);\n $this->set_visible ('password2', false);\n\n $icon_url = read_var ('icon_url');\n if ($icon_url)\n {\n $this->set_value ('icon_url', $icon_url);\n }\n else\n {\n $this->set_value ('icon_url', $obj->icon_url);\n }\n }", "private function fillObj($obj) {\n\t\t\n\t\t$obj->publisher = $_POST['publisher'];\n\t\t\n\t\t$obj->theme = $_POST['theme'];\n\t\t$obj->other = $_POST['other'];\n\n\t\t$obj->end \t= $_POST['date'];\n\n\t\t$obj->title = $_POST['title'];\n\t\t$obj->text \t= $_POST['text'];\r\n\t}", "function setObject($object);", "public function populate($object)\n {\n $this->_settable = $this->_settable || $this->isAccessor($object, 'set');\n $this->_gettable = $this->_gettable || $this->isAccessor($object, 'get');\n $this->setTypeAndComment($object);\n\n if (method_exists($object, 'behaviors'))\n {\n foreach ($object->behaviors() as $id => $data)\n {\n $this->populate($object->asa($id));\n }\n }\n }", "public function initializeObject() {\n\t\t$this->defaultQuerySettings = $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\Typo3QuerySettings');\n\t\t$this->defaultQuerySettings->setRespectStoragePage(FALSE);\n\t}", "protected function setApiData($object) {\n return $this->get('os2display.api_data')->setApiData($object);\n }", "public function setObject(object $object): self;", "public function hydrate($object, array $data);", "protected function initializeObject() {}", "public function initializeObject($obj)\n {\n if ($obj instanceof Proxy) {\n $obj->__load();\n } else if ($obj instanceof PersistentCollection) {\n $obj->initialize();\n }\n }", "public function init()\n {\n $this->_helper->layout->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n $this->getResponse()->setHeader('Content-Type', 'application/json');\n $this->_adapterBackendRole = new Application_Model_DBTable_BackendRole();\n $this->_adapterBackendAcl = new Application_Model_DBTable_BackendAcl();\n $this->_adapterBackendRoleAcl = new Application_Model_DBTable_BackendRoleAcl();\n $this->_adapterBackendUser= new Application_Model_DBTable_BackendUser();\n }", "protected function initStorageObjects() {}", "protected function initStorageObjects() {}", "protected function initStorageObjects() {}", "protected function _store_to_object ($obj)\n {\n parent::_store_to_object ($obj);\n \n switch ($this->value_for ('state'))\n {\n case Testing:\n $obj->test (Defer_database_update);\n break;\n case Shipped:\n $obj->ship (Defer_database_update);\n break;\n case Locked:\n $obj->lock (Defer_database_update);\n break;\n }\n }", "public function initializeObject()\n {\n $this->defaultQuerySettings = $this->objectManager->get(Typo3QuerySettings::class);\n $this->defaultQuerySettings->setRespectStoragePage(false);\n }", "public function setObject($object) {\n $this->object = $object;\n }", "public function initializeBackendTemplate() {}", "private static function init() \n {\n $object = Item::getObjectById($this->id);\n\n $this->name = $object['name'];\n $this->status = $object['status'];\n }", "function __construct($obj){\n parent::__construct($obj);\n $this->parseJSON($obj);\n }", "function __construct($obj)\t{\n\t\t\t$this->obj = (array)$obj;\n\t\t\t// New database connection\n\t\t\t$this->db = new dbConnection;\n\t\t\t// Default response\n\t\t\t$this->responseVar = array('success' => 'false', 'info' => '');\n\t\t\t// If we create an error handler class we can use it here\n\t\t\t$this->errors = array();\n\t\t}", "public function initializeObject()\n {\n /** @var $defaultQuerySettings \\TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface */\n $defaultQuerySettings = $this->objectManager->get(\\TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface::class);\n $defaultQuerySettings->setRespectStoragePage(false);\n $this->setDefaultQuerySettings($defaultQuerySettings);\n }", "function load($obj=null,$is_frontend=false){ \n\t\tif($obj && is_numeric($obj)){ $obj=query2obj(\"select * from category_tbl where cat_id=\".$obj); }\n\t\tif($obj){\n\t\t\tforeach($obj as $k=>$v){\n\t\t\t\tswitch($k){\n\t\t\t\t\tcase 'name':\n\t\t\t\t\tcase 'description':\n\t\t\t\t\t\t//if($is_frontend){ $v=$this->txt2html($v); }\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$obj->$k=$v;\n\t\t\t}\n\t\t\t$obj->url_name=$this->make_clean_url($obj->name);\n\t\t}\n\t\treturn $obj;\n\t}", "public function setObject(object $object): void;", "protected function initializeStorageObjects() {}", "public function initialize()\n {\n $this->data = new stdClass();\n }", "public function create($obj)\n {\n }", "public function __construct(Object $object, $queryURL, $prePopulate = null) {\n $this->object = $object;\n if($object->ID != null) {\n $this->ID = $object->ID;\n } else {\n $this->ID = uniqid();\n }\n \n $this->queryURL = $queryURL;\n \n if(is_array($prePopulate)) {\n $this->prePopulate = Convert::array2json($prePopulate);\n } else {\n $this->prePopulate = null;\n }\n \n $this->initialize();\n parent::__construct();\n }", "protected final function Teadaze_DBInterface($obj) {\n\t\t\n\t\tif(!$this->db)\n\t\t\t$this->db = DBO::init();\n\n\t\t$obj->setDatabase($this->db);\n\t}", "protected function _store_to_object ($obj)\n {\n if (! $obj->exists ())\n {\n $obj->set_password ($this->value_as_text ('password1'));\n }\n\n if ($this->visible ('title'))\n {\n $obj->title = $this->value_as_text ('title');\n }\n\n $obj->real_first_name = $this->value_as_text ('real_first_name');\n $obj->real_last_name = $this->value_as_text ('real_last_name');\n $obj->email = $this->value_as_text ('email');\n $obj->home_page_url = $this->value_as_text ('home_page_url');\n $obj->picture_url = $this->value_as_text ('picture_url');\n $obj->icon_url = $this->value_as_text ('icon_url');\n $obj->description = $this->value_as_text ('description');\n $obj->signature = $this->value_as_text ('signature');\n $obj->email_visibility = $this->value_for ('email_visibility');\n }", "protected function initStorageObjects() {\n\t\t$this->category = new ObjectStorage();\n\t}", "public function __construct(Object $object)\n\t{\n\t\t$this->_object = $object;\n\t\t$this->_table = $object->getConfigData('table');\n\t\t$this->_fields = $object->getConfigData('fields');\n\t}", "abstract protected function setUpBackend();", "protected function initializeObject() {\n\t\tif (!$this->objectManager) {\n\t\t\t$this->objectManager = GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n\t\t}\n\t\tif (!$this->configurationService) {\n\t\t\t$this->configurationService = $this->objectManager->get('LarsPeipmann\\\\LpAccess\\\\Service\\\\ConfigurationService');\n\t\t}\n\t\tif (!$this->pageRenderer) {\n\t\t\t$this->pageRenderer = $this->objectManager->get('TYPO3\\\\CMS\\\\Core\\\\Page\\\\PageRenderer');\n\t\t}\n\t}", "public function fromObject($update)\n {\n if ($update instanceof stdClass) {\n foreach ($update as $key => $value) {\n $this->{$key} = $value;\n }\n }\n }", "public function __construct() {\n\n $this->datastore = new Model\\PluginDatastore();\n try {\n $id = $this->datastore->getType() . '-' . $this->getName();\n $this->datastore->fetchById($id);\n } catch (\\phpillowResponseNotFoundErrorException $e) {\n\n $this->datastore->name = $this->getName();\n $this->datastore->created = date('r');\n\n $this->datastore->save();\n }\n }", "public abstract function create($object);", "private function setObject($object) {\n $this->object = $object;\n }", "private function init() {\n $apiParts = $this->request->getApiParts();\n $this->requestedId = array_shift($apiParts);\n $this->apiParts = $apiParts;\n \n $this->siteDriver = Datastore::getSiteDriver();\n }", "public abstract function update($object);", "protected function initStorageObjects()\n {\n $this->posts = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n }", "protected function initStorageObjects()\n {\n $this->sellerDetail = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n }", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "function registerFromDatabase($arr) {\n $this->DATA[$arr['property']] = $arr['value'];\n $this->DESC[$arr['property']] = $arr['description'];\n $this->TYPE[$arr['property']] = $arr['type'];\n }", "protected function setUpBackend() {}", "private function setUpBackend() {}", "protected function initStorageObjects()\n {\n \t$this->language = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n \t$this->travel = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n \t$this->col = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n \t$this->categories = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n }", "protected final function Teadaze_ModelLoadingInterface($obj) {\n\t\t$obj->setModelLoader($this->modelLoader);\n\t}", "public function injectObject() {\n\n // load the map\n $this->loadMap();\n $this->_injectMethods();\n $this->_injectProperties();\n\n }", "public function update($object): void;", "public function __construct(stdClass $data_obj) {\n\t\t$this->init_from_data($data_obj);\n\t}", "public function setObject($obj)\n {\n $this->service = $obj;\n }", "abstract public function prepare_new_object(array $args);", "public function __construct()\n {\n $this->initStorageObjects();\n }", "protected function initStorageObjects()\n {\n $this->posts = new ObjectStorage();\n $this->subscribers = new ObjectStorage();\n $this->readers = new ObjectStorage();\n }", "protected function initStorageObjects()\n {\n $this->item = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n }", "protected function initStorageObjects()\n {\n \n }", "public function populate();", "abstract public function populate();", "public function initializeObject() {\r\r\n\t\t$this->connectDatabase();\r\r\n\t}", "protected function setupObject()\n {\n try {\n $dom = $this->getAttribute(\"domain\");\n if ($dom) {\n $this->getDomain()->copy($this->getTable()->getDatabase()->getDomain($dom));\n } else {\n $type = strtoupper($this->getAttribute(\"type\"));\n if ($type) {\n if ($platform = $this->getPlatform()) {\n $this->getDomain()->copy($this->getPlatform()->getDomainForType($type));\n } else {\n // no platform - probably during tests\n $this->setDomain(new Domain($type));\n }\n } else {\n if ($platform = $this->getPlatform()) {\n $this->getDomain()->copy($this->getPlatform()->getDomainForType(self::DEFAULT_TYPE));\n } else {\n // no platform - probably during tests\n $this->setDomain(new Domain(self::DEFAULT_TYPE));\n }\n }\n }\n\n $this->name = $this->getAttribute(\"name\");\n $this->phpName = $this->getAttribute(\"phpName\");\n $this->phpType = $this->getAttribute(\"phpType\");\n\n if ($this->getAttribute(\"prefix\", null) !== null) {\n $this->namePrefix = $this->getAttribute(\"prefix\");\n } elseif ($this->getTable()->getAttribute('columnPrefix', null) !== null) {\n $this->namePrefix = $this->getTable()->getAttribute('columnPrefix');\n } else {\n $this->namePrefix = '';\n }\n\n // Accessor visibility\n if ($this->getAttribute('accessorVisibility', null) !== null) {\n $this->setAccessorVisibility($this->getAttribute('accessorVisibility'));\n } elseif ($this->getTable()->getAttribute('defaultAccessorVisibility', null) !== null) {\n $this->setAccessorVisibility($this->getTable()->getAttribute('defaultAccessorVisibility'));\n } elseif ($this->getTable()->getDatabase()->getAttribute('defaultAccessorVisibility', null) !== null) {\n $this->setAccessorVisibility($this->getTable()->getDatabase()->getAttribute('defaultAccessorVisibility'));\n } else {\n $this->setAccessorVisibility(self::DEFAULT_VISIBILITY);\n }\n\n // Mutator visibility\n if ($this->getAttribute('mutatorVisibility', null) !== null) {\n $this->setMutatorVisibility($this->getAttribute('mutatorVisibility'));\n } elseif ($this->getTable()->getAttribute('defaultMutatorVisibility', null) !== null) {\n $this->setMutatorVisibility($this->getTable()->getAttribute('defaultMutatorVisibility'));\n } elseif ($this->getTable()->getDatabase()->getAttribute('defaultMutatorVisibility', null) !== null) {\n $this->setMutatorVisibility($this->getTable()->getDatabase()->getAttribute('defaultMutatorVisibility'));\n } else {\n $this->setMutatorVisibility(self::DEFAULT_VISIBILITY);\n }\n\n $this->peerName = $this->getAttribute(\"peerName\");\n\n // retrieves the method for converting from specified name to a PHP name, defaulting to parent tables default method\n $this->phpNamingMethod = $this->getAttribute(\"phpNamingMethod\", $this->parentTable->getDatabase()->getDefaultPhpNamingMethod());\n\n $this->isPrimaryString = $this->booleanValue($this->getAttribute(\"primaryString\"));\n\n $this->isPrimaryKey = $this->booleanValue($this->getAttribute(\"primaryKey\"));\n\n $this->isNodeKey = $this->booleanValue($this->getAttribute(\"nodeKey\"));\n $this->nodeKeySep = $this->getAttribute(\"nodeKeySep\", \".\");\n\n $this->isNestedSetLeftKey = $this->booleanValue($this->getAttribute(\"nestedSetLeftKey\"));\n $this->isNestedSetRightKey = $this->booleanValue($this->getAttribute(\"nestedSetRightKey\"));\n $this->isTreeScopeKey = $this->booleanValue($this->getAttribute(\"treeScopeKey\"));\n\n $this->isNotNull = ($this->booleanValue($this->getAttribute(\"required\")) || $this->isPrimaryKey); // primary keys are required\n\n //AutoIncrement/Sequences\n $this->isAutoIncrement = $this->booleanValue($this->getAttribute(\"autoIncrement\"));\n $this->isLazyLoad = $this->booleanValue($this->getAttribute(\"lazyLoad\"));\n\n // Add type, size information to associated Domain object\n $this->getDomain()->replaceSqlType($this->getAttribute(\"sqlType\"));\n if (!$this->getAttribute(\"size\") && $this->getDomain()->getType() == 'VARCHAR' && $this->hasPlatform() && !$this->getAttribute(\"sqlType\") && !$this->getPlatform()->supportsVarcharWithoutSize()) {\n $size = 255;\n } else {\n $size = $this->getAttribute(\"size\");\n }\n $this->getDomain()->replaceSize($size);\n $this->getDomain()->replaceScale($this->getAttribute(\"scale\"));\n\n $defval = $this->getAttribute(\"defaultValue\", $this->getAttribute(\"default\"));\n if ($defval !== null && strtolower($defval) !== 'null') {\n $this->getDomain()->setDefaultValue(new ColumnDefaultValue($defval, ColumnDefaultValue::TYPE_VALUE));\n } elseif ($this->getAttribute(\"defaultExpr\") !== null) {\n $this->getDomain()->setDefaultValue(new ColumnDefaultValue($this->getAttribute(\"defaultExpr\"), ColumnDefaultValue::TYPE_EXPR));\n }\n\n if ($this->getAttribute('valueSet', null) !== null) {\n if (version_compare(PHP_VERSION, '5.3.0', '>=')) {\n $valueSet = str_getcsv($this->getAttribute(\"valueSet\"));\n } else {\n // unfortunately, no good fallback for PHP 5.2\n $valueSet = explode(',', $this->getAttribute(\"valueSet\"));\n }\n $valueSet = array_map('trim', $valueSet);\n $this->valueSet = $valueSet;\n } elseif (preg_match('/enum\\((.*?)\\)/i', $this->getAttribute('sqlType', ''), $matches)) {\n if (version_compare(PHP_VERSION, '5.3.0', '>=')) {\n $valueSet = str_getcsv($matches['1'], ',', '\\'');\n } else {\n // unfortunately, no good fallback for PHP 5.2\n $valueSet = array();\n foreach (explode(',', $matches['1']) as $value) {\n $valueSet[] = trim($value, \" '\");\n }\n }\n $this->valueSet = $valueSet;\n }\n\n $this->inheritanceType = $this->getAttribute(\"inheritance\");\n // here we are only checking for 'false', so don't use booleanValue()\n $this->isInheritance = ($this->inheritanceType !== null && $this->inheritanceType !== \"false\");\n\n $this->description = $this->getAttribute(\"description\");\n } catch (Exception $e) {\n throw new EngineException(\"Error setting up column \" . var_export($this->getAttribute(\"name\"), true) . \": \" . $e->getMessage());\n }\n }", "public function initialize()\n\t{\n\t\t$this->data = new stdClass();\n\t}", "public function fromAPI($data);", "public function __construct($object)\n {\n $this->object = $object;\n }", "public function __construct($object)\n {\n $this->object = $object;\n }", "protected function initStorageObjects() {\n\t\t/**\n\t\t * Do not modify this method!\n\t\t * It will be rewritten on each save in the extension builder\n\t\t * You may modify the constructor of this class instead\n\t\t */\n\t\t$this->artist = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n\t\t$this->media = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n\t}", "protected function initStorageObjects()\n {\n $this->images = new ObjectStorage();\n $this->categories = new ObjectStorage();\n $this->details = new ObjectStorage();\n }", "public function initializeObject()\n {\n $this->setDefaultOrderings(\n [\n 'sorting' => \\TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface::ORDER_ASCENDING,\n ]\n );\n }", "protected function initStorageObjects()\n {\n $this->category = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n }", "protected function initStorageObjects()\n {\n }", "public function init_objects() {\n $this->controller_oai = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Expose();\n $this->list_sets = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Sets();\n $this->list_metadata_formats = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Metadata_Formats();\n $this->list_records = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Records();\n $this->get_record = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Get_Record();\n $this->identify = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Identify();\n $this->identifiers = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Identifiers();\n }", "public function __construct($obj = null)\n {\n if( !is_null($obj) && $obj instanceof Zend_Db_Table_Row ) {\n $this->id = $obj->ID;\n $this->name = $obj->NAME;\n }\n \n if(is_array($obj)){\n //echo $obj['TOUR_TYPE_ID'];die;\n $this->id = $obj['ID'];\n if(isset($obj['name'])) $this->name = $obj['NAME'];\n }\n }", "protected function initStorageObjects() {\n\t\t\n\t}", "protected function initStorageObjects() {\n\t\t\n\t}", "private function init() {\r\n settype($this->id, \"int\");\r\n settype($this->name, \"string\");\r\n settype($this->max_players, \"int\");\r\n settype($this->is_over_yet, \"boolean\");\r\n settype($this->players, \"array\");\r\n }", "public function init()\n {\n $this->_helper->layout->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n $this->getResponse()->setHeader('Content-Type', 'application/json');\n $this->_adapterBackendLog = new Application_Model_DBTable_BackendLog();\n $this->_adapterBackendUser = new Application_Model_DBTable_BackendUser();\n }", "public function create($obj, $request)\n {\n }", "public function create( &$object );", "protected function initStorageObjects() {\n\t\t/**\n\t\t * Do not modify this method!\n\t\t * It will be rewritten on each save in the extension builder\n\t\t * You may modify the constructor of this class instead\n\t\t */\n\t\t$this->teacher = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n\t\t\n\t\t$this->students = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n\t\t\n\t\t$this->media = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n\t}", "protected function initStorageObjects()\n {\n /**\n * Do not modify this method!\n * It will be rewritten on each save in the extension builder\n * You may modify the constructor of this class instead\n */\n $this->metaVotingProposals = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n }", "function populate_from_request();", "protected function initStorageObjects()\n {\n /**\n * Do not modify this method!\n * It will be rewritten on each save in the extension builder\n * You may modify the constructor of this class instead\n */\n $this->attributeSets = new ObjectStorage();\n $this->subCategories = new ObjectStorage();\n }", "protected function initializeObject() {\n\t\t$this->votes = t3lib_div::makeInstance('Tx_Extbase_Persistence_ObjectStorage');\n\t}", "protected function setUp()\n\t{\n\t\t$module = new stdClass;\n\t\t$this->object = $module;\n\t}", "protected function setUp()\n\t{\n\t\t$module = new stdClass;\n\t\t$this->object = $module;\n\t}", "protected function initStorageObjects()\n {\n $this->eventCategories = new ObjectStorage();\n //$this->images = new ObjectStorage();\n //$this->documents = new ObjectStorage();\n }", "public function _setProps() {\n $dataController = get_called_class();\n $dataController::_getMapper();\n $dataController::_getModel();\n }", "public function setMetaFrom($object);" ]
[ "0.6495365", "0.59811455", "0.5955187", "0.5865298", "0.5849499", "0.569184", "0.5690149", "0.56476426", "0.5627689", "0.56019646", "0.5582479", "0.55808735", "0.557279", "0.55501485", "0.55498064", "0.55498064", "0.55300677", "0.5499112", "0.5498392", "0.5497256", "0.54930305", "0.54848015", "0.54741645", "0.54702586", "0.54386204", "0.54376304", "0.5403269", "0.5400719", "0.5385963", "0.5385405", "0.53842306", "0.53820515", "0.5375878", "0.53743416", "0.536788", "0.53656656", "0.53625685", "0.5359087", "0.53438747", "0.5343525", "0.53295445", "0.5321461", "0.53160495", "0.5315173", "0.5307275", "0.5307275", "0.5307275", "0.5307275", "0.5307275", "0.5307275", "0.5307275", "0.5307275", "0.5307275", "0.5307221", "0.5307221", "0.5307221", "0.5303983", "0.52867746", "0.52837807", "0.52820414", "0.5279377", "0.5261264", "0.52604234", "0.525201", "0.52466947", "0.5239023", "0.5237867", "0.5233842", "0.5232896", "0.5231044", "0.52278703", "0.5218142", "0.5218095", "0.52152354", "0.51984847", "0.51944077", "0.5193902", "0.5193902", "0.51937693", "0.51877016", "0.51778865", "0.5172781", "0.5172103", "0.51687044", "0.51542217", "0.5144007", "0.5144007", "0.5143049", "0.5126952", "0.5119917", "0.5103804", "0.51014036", "0.50964266", "0.5095675", "0.50932187", "0.50897413", "0.50850624", "0.50850624", "0.50845057", "0.50830233", "0.5082721" ]
0.0
-1
Get the currently assigned image resource, or generates one if not yet assigned. Note: This method may return null if error
public function getImageResource() { // Get existing resource if ($this->image) { return $this->image; } // Load container $assetContainer = $this->getAssetContainer(); if (!$assetContainer) { return null; } // Avoid repeat load of broken images $hash = $assetContainer->getHash(); $variant = $assetContainer->getVariant(); if ($this->hasFailed($hash, $variant)) { return null; } // Validate stream is readable // Note: Mark failed regardless of whether a failed stream is exceptional or not $error = self::FAILED_MISSING; try { $stream = $assetContainer->getStream(); if ($this->isStreamReadable($stream)) { $error = null; } else { return null; } } finally { if ($error) { $this->markFailed($hash, $variant, $error); } } // Handle resource $error = self::FAILED_UNKNOWN; try { // write the file to a local path so we can extract exif data if it exists. // Currently exif data can only be read from file paths and not streams $tempPath = $this->config()->get('local_temp_path') ?? TEMP_PATH; $path = tempnam($tempPath ?? '', 'interventionimage_'); if ($extension = pathinfo($assetContainer->getFilename() ?? '', PATHINFO_EXTENSION)) { //tmpnam creates a file, we should clean it up if we are changing the path name unlink($path ?? ''); $path .= "." . $extension; } $bytesWritten = file_put_contents($path ?? '', $stream); // if we fail to write, then load from stream if ($bytesWritten === false) { $resource = $this->getImageManager()->make($stream); } else { $this->setTempPath($path); $resource = $this->getImageManager()->make($path); } // Fix image orientation try { $resource->orientate(); } catch (NotSupportedException $e) { // noop - we can't orientate, don't worry about it } $this->setImageResource($resource); $this->markSuccess($hash, $variant); $this->warmCache($hash, $variant); $error = null; return $resource; } catch (NotReadableException $ex) { // Handle unsupported image encoding on load (will be marked as failed) // Unsupported exceptions are handled without being raised as exceptions $error = self::FAILED_INVALID; } finally { if ($error) { $this->markFailed($hash, $variant, $error); } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getImageResource()\n {\n return $this->image;\n }", "protected function getImageResource () {\n $extension = strtolower( strrchr ( $this->source, '.' ) );\n\n // Convert image to resource object according to its type.\n switch ( $extension ) {\n case '.jpg':\n case '.jpeg':\n $img = @imagecreatefromjpeg( $this->source );\n break;\n case '.gif':\n $img = @imagecreatefromgif( $this->source );\n break;\n case '.png':\n $img = @imagecreatefrompng( $this->source );\n break;\n default:\n $img = false;\n break;\n }\n return $img;\n }", "public function getCurrentImage()\n {\n return $this->image;\n }", "public function get_image() {\n\n return $this->image_id !== null ? $this->image->full_src() : null;\n }", "function &getImage() \n { \n return $this->_isImageResource?$this->_image:false; \n }", "public function getImageResource()\n {\n if (is_null($this->image) && !is_null($this->full_path)) {\n $this->image = self::createResource($this->full_path);\n }\n\n if (is_resource($this->image) && get_resource_type($this->image) === 'gd') {\n imagesavealpha($this->image, true);\n } else {\n throw new \\InvalidArgumentException('Image is not valid.');\n }\n\n return $this->image;\n }", "public function getImage()\n {\n if (empty($this->image)) {\n $this->image = $this->generateImage();\n }\n return $this->image;\n }", "public function get_image() {\r\n return $this->image;\r\n }", "public function getImageResource()\n {\n return imagecreatefromstring($this->getRaw());\n }", "public function getResource()\n {\n return $this->resource ?: parent::getResource();\n }", "public function getImage()\n\t{\n\t\treturn $this->image;\n\t}", "public function getImage()\n\t{\n\t\treturn $this->image;\n\t}", "public function getImage() {\n\t\treturn $this->image;\n\t}", "public function getImage() {\n\t\treturn $this->image;\n\t}", "public function getImage() {\n\t\treturn $this->image;\n\t}", "function getImage() {\n\t\treturn $this->_image;\n\t}", "public function getImage() {\n\t\t\treturn $this->image;\n\t\t}", "function getImage()\r\n\t\t{\r\n\t\t\treturn $this->image;\r\n\t\t\t\r\n\t\t}", "public function getImage()\r\n {\r\n return $this->image;\r\n }", "public function getImage()\r\n {\r\n return $this->image;\r\n }", "public function &image()\n {\n return $this->_image;\n }", "public function getImage()\n {\n return $this->_image;\n }", "public function getImageFile()\n {\n return isset($this->filetask) ? $this->filetask : null;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage() : ?string\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->get('image');\n }", "function getImage()\n {\n return $this->_image;\n }", "public function getImage()\n {\n return $this->Image;\n }", "protected function fetchImage() {\n return null;\n }", "public function getImage() {\n return $this->image;\n }", "public function getResource()\n\t{\n\t\tif($this->resource === null) {\n\t\t\t$this->connect();\n\t\t}\n\n\t\treturn $this->resource;\n\t}", "function &image( )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $ret = false;\n if ( $this->ImageID != 0 )\n {\n $ret = new eZImage( $this->ImageID );\n }\n\n return $ret;\n }", "public function getResource() {\n $resource = false;\n if (isset($this->_resource)) {\n $resource = $this->_resource;\n }\n\n return $resource;\n }", "public function getResource()\n\t{\n\t\t$this->connectInternal();\n\t\treturn $this->resource;\n\t}", "public function Image() {\n\t\treturn $this()->{self::RelationshipName}();\n\t}", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n if (empty($this->data)) {\n // failure in processing the image. nothing much we can do\n return null;\n } else {\n $path = $this->data->basePath();\n\n // get path to image\n return $this->processImagePath($path);\n }\n }", "public function current()\n {\n return new Image($this->getRealPath(), $this->dir, $this->prefix);\n }", "protected function getProfileImage()\n {\n $path = $this->_getImageBasePath() . $this->_getImageName();\n\n if(!file_exists($this->_getFullImagePath($path))) {\n //reszise and return path to new resized image\n //@todo resize\n $originImage = $this->_getImageName(false);\n if(file_exists($this->_getFullImagePath($originImage))) {\n //resize it and return path to resized image\n //if it can't resized, return default image\n } else {\n return $this->_getDefaultImage();\n }\n } else {\n return $path;\n }\n\n\n }", "public function image($filename = null) {\n if(is_null($filename)) return $this->images()->first();\n return $this->images()->find($filename);\n }", "function ImageSRC()\n\t{\treturn $this->imagelocation . (int)$this->id . \".jpg\";\n\t}", "private function createImageResource()\n {\n // In case of failure, image will be false\n\n $mimeType = $this->getMimeTypeOfSource();\n\n if ($mimeType == 'image/png') {\n $image = imagecreatefrompng($this->source);\n if ($image === false) {\n throw new ConversionFailedException(\n 'Gd failed when trying to load/create image (imagecreatefrompng() failed)'\n );\n }\n return $image;\n }\n\n if ($mimeType == 'image/jpeg') {\n $image = imagecreatefromjpeg($this->source);\n if ($image === false) {\n throw new ConversionFailedException(\n 'Gd failed when trying to load/create image (imagecreatefromjpeg() failed)'\n );\n }\n return $image;\n }\n\n /*\n throw new InvalidInputException(\n 'Unsupported mime type:' . $mimeType\n );*/\n }", "public function getImage(): ?Image\n {\n return $this->oImage;\n }", "public function getResource()\n {\n return $this->resource;\n }", "public function getResource()\n {\n return $this->resource;\n }", "public function getResource()\n {\n return $this->resource;\n }", "public function getResource()\n {\n return $this->resource;\n }", "public function getImage()\n {\n if($this->image == null){\n return \"https://place-hold.it/50x50\";\n }\n else return IMG_PATH.\"/\".$this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function get_game_one_image () {\n\t\treturn get_field('field_5b476fbb1dd99', $this->get_id());\n\t}", "private function createImageResource()\n {\n // We are currently using vips_image_new_from_file(), but we could consider\n // calling vips_jpegload / vips_pngload instead\n $result = /** @scrutinizer ignore-call */ vips_image_new_from_file($this->source, []);\n if ($result === -1) {\n /*throw new ConversionFailedException(\n 'Failed creating new vips image from file: ' . $this->source\n );*/\n $message = /** @scrutinizer ignore-call */ vips_error_buffer();\n throw new ConversionFailedException($message);\n }\n\n if (!is_array($result)) {\n throw new ConversionFailedException(\n 'vips_image_new_from_file did not return an array, which we expected'\n );\n }\n\n if (count($result) != 1) {\n throw new ConversionFailedException(\n 'vips_image_new_from_file did not return an array of length 1 as we expected ' .\n '- length was: ' . count($result)\n );\n }\n\n $im = array_shift($result);\n return $im;\n }", "public function getResource()\n {\n return $this->_resource;\n }", "public function getImg()\n {\n return $this->imgLink;\n }", "protected function _getResource()\n {\n return parent::_getResource();\n }", "protected function _getResource()\n {\n return parent::_getResource();\n }", "protected function _getResource()\n {\n return parent::_getResource();\n }", "public function getImage()\n {\n if ($this->isEmpty()) {\n return null;\n }\n\n $filePath = $this->getFile()->getPath()->__toString();\n\n switch ($this->imageType) {\n case ImageType::JPEG:\n return imagecreatefromjpeg($filePath) ?: null;\n case ImageType::PNG:\n return imagecreatefrompng($filePath) ?: null;\n case ImageType::GIF:\n return imagecreatefromgif($filePath) ?: null;\n }\n\n return null;\n }", "function getResource()\n {\n return $this->resource;\n }", "public function getImageAttribute()\n {\n if (isset($this->attributes['image'])) {\n return \"/uploads/{$this->attributes['image']}\";\n }\n return null;\n }", "public function getImage() {\n if ($this->item_image == null) {\n return Yii::app()->request->baseUrl . \"/images/box/default.jpg\";\n } else {\n return Yii::app()->request->baseUrl . \"/images/box/\" . $this->item_image;\n }\n }", "public function get_resource();", "public function getImageTemplate() { return $this->imageTemplate; }", "public function getImageFile()\n {\n $link = $this->link;\n return empty( $this->owner->$link ) ? null : \\Yii::getAlias(\n '@storage/' . $this->directory . '/' . $this->owner->$link\n );\n }", "public function getImg()\n {\n return $this->img;\n }", "public function getImg()\n {\n return $this->img;\n }", "public function getImg()\n {\n return $this->img;\n }", "public function getImageSrc()\n {\n return $this->imageSrc;\n }", "public function Image()\n {\n if ($this->Buyable()) {\n return $this->Buyable()->Image();\n }\n }", "public function getBaseImageAttribute()\n {\n return $this->files->where('pivot.zone', 'base_image')->first() ?: new File;\n }", "public function getResource(){\n return $this->resource;\n }", "public function getImage() : string\n {\n return $this->image;\n }", "public function getProfileImage()\n {\n if ($this instanceof \\humhub\\modules\\space\\models\\Space) {\n return new \\humhub\\libs\\ProfileImage($this->guid, 'default_space');\n }\n return new \\humhub\\libs\\ProfileImage($this->guid);\n }", "public function get_image_id() {\r\n return $this->image_id;\r\n }", "function getImageSource() {return $this->_imagesource;}" ]
[ "0.7010775", "0.6907486", "0.6688713", "0.662025", "0.65964097", "0.65314513", "0.6418584", "0.6211641", "0.6211423", "0.6195503", "0.6170121", "0.6170121", "0.6156974", "0.6156974", "0.6156974", "0.61560833", "0.6118317", "0.6080568", "0.6028364", "0.6028364", "0.60184735", "0.6014532", "0.5991969", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5991225", "0.5986426", "0.5981933", "0.59730035", "0.5936016", "0.5928058", "0.59257", "0.5916779", "0.59127665", "0.5893703", "0.58856684", "0.5880485", "0.58661276", "0.58636075", "0.5862431", "0.58546436", "0.58336824", "0.5824513", "0.5815097", "0.5795742", "0.57833135", "0.57833135", "0.57833135", "0.57833135", "0.5776824", "0.57661784", "0.575938", "0.57391375", "0.573246", "0.57039106", "0.5697815", "0.5697815", "0.5697815", "0.56969494", "0.56960094", "0.56732106", "0.5652744", "0.5620685", "0.5591735", "0.55891854", "0.5569943", "0.5569943", "0.5569943", "0.5565821", "0.5565673", "0.55627567", "0.55450344", "0.5544514", "0.5542898", "0.5524718", "0.5522721" ]
0.6193577
10
Populate the backend from a local path
public function loadFrom($path) { // Avoid repeat load of broken images $hash = sha1($path ?? ''); if ($this->hasFailed($hash, null)) { return $this; } // Handle resource $error = self::FAILED_UNKNOWN; try { $this->setImageResource($this->getImageManager()->make($path)); $this->markSuccess($hash, null); $error = null; } catch (NotReadableException $ex) { // Handle unsupported image encoding on load (will be marked as failed) // Unsupported exceptions are handled without being raised as exceptions $error = self::FAILED_INVALID; } finally { if ($error) { $this->markFailed($hash, null, $error); } } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function init($path);", "public function load($path);", "public function load($path);", "public function load($path);", "public function getLocalPath($path);", "private function setUpBackend() {}", "public function setPath($path){ }", "public function getLocalPath();", "public static function init($params = [])\n\t{\n\t\t$path = rtrim($params['path'], '/') . '/' . (isset($params['subdir']) ? trim($params['subdir'], '/') : '');\n\t\treturn new LocalAdapter($path);\n\t}", "public function loadByRequestPath($path)\n {\n\n }", "public function setPath( $path );", "abstract protected function setUpBackend();", "protected function setUpBackend() {}", "public function getBackend() {}", "public function getBackend() {}", "public function __construct($path, $backend = null)\n\t{\n\t\t// Set the rootpath\n\t\t$this->rootpath = $path;\n\t\t// Do we have a custom backend\n\t\tif ($backend == null)\n\t\t{\n\t\t\t// Lets just provide a default backend\n\t\t\t$this->backend = new Backends\\Json();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Okay so they gave us their own backend, lets check we can use it.\n\t\t\tif ($backend instanceof Backends\\Driver)\n\t\t\t{\n\t\t\t\t// Cool lets just use the one that has been given to us.\n\t\t\t\t$this->backend = $backend;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The one that was given is not of the correct type.\n\t\t\t\tthrow new \\Exception('Backend class does not extend \\Netesy\\Gringotts\\Backends\\Driver');\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Okay we have a backend, lets set the path to the data.\n\t\t$this->backend->setPath($this->rootpath);\n\t\tvar_dump($this->backend);\n\t}", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "function getBackend() ;", "public function initializeBackendTemplate() {}", "function load_plugin_backend(){\n include_once 'backend/index.php';\n }", "public function setPath(string $path): self;", "public function setPath(string $path): self;", "protected function setInitialRelativePath() {}", "public abstract function getBackend();", "protected abstract function _getBackend();", "public function setSourceLocalPath($path) {\n $this->sourceLocalPath = $path;\n return $this;\n }", "public static function setSourceFilePath( $path ) {\n\n update_option( 'geb_gfe_uploaded_template', $path );\n }", "public function setInitialPaths() {}", "public function load() {\n\t\t$this->copyFromTemplateIfNeeded();\n\t\trequire $this->filePath;\n\t\t$this->vars = $vars;\n\t}", "public function initStorage() {}", "public function getBackend();", "public function setDirectory(string $path) : ConfigLoader;", "protected function setInitialRootPath() {}", "function __construct()\n {\n parent::__construct();\n //$this->fmvc_array->add(\"NAME_fmvc\", \"Kidswork\\Backend\");\n //$this->path->set(__DIR__);\n \n }", "public function setStorageData(string $storage_path): Uploadable;", "public function __construct()\n {\n //\n $this->storage_path = base_path().'/../../appservice';\n // $this->storage_path = base_path().'/public';\n }", "public function setPath($path = '');", "function __construct($path = \"\") {\n\t\tif ($path) $this->load($path);\n\t}", "public function populateLocalConfiguration() {}", "private function loadPath() {\n $this->_system_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'System'.DIRECTORY_SEPARATOR;\n $this->_application_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'Application'.DIRECTORY_SEPARATOR;\n $this->_configuration_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'configuration'.DIRECTORY_SEPARATOR;\n $this->_libraries_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'Libraries'.DIRECTORY_SEPARATOR;\n $this->_logs_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'logs'.DIRECTORY_SEPARATOR;\n }", "public function __construct($path)\n {\n $this->path = $path;\n\n $this->localFilesystem($path);\n }", "protected static function loadSingleExtLocalconfFiles() {}", "public function set( $path ) {\n\t\t$this->path = $path;\n\n\t\t$path_info = pathinfo( $this->path );\n\n\t\t$this->file = $path_info['basename'];\n\t\t$this->extension = $path_info['extension'] == 'jpg' ? 'jpeg' : $path_info['extension'];\n\t\t$this->filename = $path_info['filename'];\n\n\t\t$this->server = 'http' . ($_SERVER['HTTPS'] == 'on' ? 's' : '') . '://' . $_SERVER['HTTP_HOST'];\n\n\t\t$this->url = $this->server.str_replace( $this->base_dir, '', $this->path );\n\t}", "public function load(){\n\t\tif (is_file($this->_filename) && is_readable($this->_filename)){\n\t\t\t$this->_storage = require($this->_filename);\n\t\t\t$this->_dataAvailable = true;\n\t\t}\n\t}", "public function loadTemplate($path);", "private function init()\n {\n if(!file_exists($this->tempDB))\n {\n $data = @file_get_contents($this->remoteLink);\n\n if($data !== FALSE)\n {\n file_put_contents($this->tempDB, $data);\n }\n }\n }", "public function run()\n {\n $json_string = file_get_contents('./storage/clients.json'); // replace path with a real path\n\t\t$data = json_decode($json_string); // decode the string into data\n\n\t\n\t\t\n }", "public function __construct($path){\n $this->path = $path;\n }", "public function load() { }", "public function load() {\n if ($this->cat === \"url\" && !file_exists($this->sourcepath)) Path::download($this->originalName, $this->sourcepath);\n }", "private function __construct()\n {\n \t$this->storage_dir = $_SERVER[\"DOCUMENT_ROOT\"] . '/storage';\n }", "public function __construct($path);", "public function setBasePath($path);", "function __construct ($path)\n {\n $this->basepath = $path ;\n // pull the module and package names out of the path\n $this->moduleName = basename ( $path, \"/\" ) ; // just in case there are any trailing /\n $this->packageName = basename ( dirname ( dirname ( $path ) ) ) ; // simpler than explode :)\n require_once 'modules/ModuleBuilder/MB/ModuleBuilder.php' ;\n $mb = new ModuleBuilder ( ) ;\n $this->packageKey = $mb->getPackageKey ( $this->packageName ) ;\n \n $this->load () ;\n \n }", "function set_path($path) \n {\n $this->path = \"/\" . trim($path, \"/\");\n }", "public function initStorage()\n {\n $this->open();\n }", "public function __construct($path)\n {\n $file = $path . '/composer.json';\n\n $this->path = (string) $path;\n\n $this->data = $this->parse($this->data);\n\n $json = file_get_contents($file);\n\n $json = json_decode($json, true);\n\n if (isset($json['staticka']))\n {\n $config = (array) $json['staticka'];\n\n $data = array_merge($this->data, $config);\n\n $this->data = $this->parse($data);\n }\n }", "public function __construct($path)\n {\n $this->setValue((string)$path);\n }", "public function setDataFileFromPath($path)\n {\n $this->dataFile = FileReference::fromFile($path);\n }", "public function __construct( $path ) \n\t{\n\t\t$this->_root_path = $path;\n\t\t$this->_index_path = $this->_root_path . \n\t\t\t\t\t\t\t(substr($this->_root_path, -1) == '/' ? '' : '/') .\n\t\t\t\t\t\t\t'zsl.db';\n\t}", "private function setPath($path) {\n return;\n }", "public abstract function load();", "public function buildBackendUri() {}", "protected function local() : void\n {\n File::ensureDirectoryExists(Path::storage('framework/dusk/console'));\n File::ensureDirectoryExists(Path::storage('framework/dusk/screenshots'));\n\n File::ensureDirectoryExists(Path::storage('testing/downloads'));\n File::ensureDirectoryExists(Path::storage('testing/public'));\n File::ensureDirectoryExists(Path::storage('testing/private'));\n }", "public function setPathAttribute($path){ //modificaremos el atributo path, estamos recibiendo path de la BD\n\n if(! empty($path)){ //El campo path no debe estar vacio para que ejecute toda esa accion\n $name = Carbon::now()->second.$path->getClientOriginalName();//CON CARBON LE ESPECIFICAMOS LA FECHA DE HOY, TOMAMOS EL SEGUNDOEN QUE ES SUBIDO Y LO CONCATENAMOS AL NOMBRE ORIGINAL DEL ARCHIVO, creamos una variable que contatenara el nombre con los segundos\n $this->attributes['path'] = $name; //hacemos referencia a path y vamos a cambiarlo el nombre\n \\Storage::disk('local')->put($name, \\File::get($path)); //ACA SE HACE LA SUBIDA DEL ARCHIVO, especificamos el local y mediante el metodo put vamos a almacenar nuestro archivo, recibe el nombre y el archivo que vamos a subir que es el path\n }\n }", "function LocalDir($path) {\n parent::FileList($path);\n $this->handle = opendir($this->path);\n }", "public function source() {\n\t\tif (count($this->passedArgs) == 1 && $this->passedArgs[0] == 'index') {\n\t\t\tarray_shift($this->passedArgs);\n\t\t}\n\t\t$currentPath = implode('/', $this->passedArgs);\n\t\t$previousPath = implode('/', array_slice($this->passedArgs, 0, count($this->passedArgs) -1));\n\t\tlist($dirs, $files) = $this->ApiFile->read($this->path . $currentPath);\n\t\t$this->set(compact('dirs', 'files', 'currentPath', 'previousPath'));\n\t}", "function __construct($path) {\n\t\t$this->path = $path;\t\t\n\t}", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function withPath($path)\n {\n }", "public function __construct( $path )\n {\n $this->setPath( $path );\n }", "public function load(): void;", "public function load(): void;", "public function useStoragePath($path)\n {\n $this->storagePath = $path;\n\n return $this;\n }", "function setPath($path) {\r\n\t\tif($this->configured) {\r\n\t\t\treturn 'Configuration is frozen';\r\n\t\t}\r\n\t\t$URLDecodedPath = '';\r\n\t\t$URLDecodedPath = urldecode($path);\r\n\t\t$this->path = $URLDecodedPath;\r\n\t}", "public function set_base_path( $path ) {\n\t\t$this->base_path = $path;\n\t}", "public function setBackend($backend) {}", "protected function setUpInstancePath() {\n\t\t$this->instancePath = BEHAT_ROOT;\n\t}", "public function setLocalFile($localFilePath) {\n\t\t$this->localFilePath = $localFilePath;\n\t}", "public function prependPath(string $path) : EngineInterface;", "public static function useStoragePath($path){\n return \\Illuminate\\Foundation\\Application::useStoragePath($path);\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 function setStoragePath($path)\r\n {\r\n $this->storagePath = $path;\r\n }", "public function setPath($path) {\n $this->path = $path . \".html\";\n $this->twigEngine->setLoader(new \\Twig_Loader_Filesystem(dirname($this->path)));\n }", "public function __construct($path){\n\t\t$this->paths = $this->getValidPath($path);\n\t\t$this->data = array();\n\t}", "function init() {\n require config('template_path') . '/template.php';\n}" ]
[ "0.6020126", "0.5828016", "0.5828016", "0.5828016", "0.5734319", "0.5692236", "0.56519675", "0.5638863", "0.55679893", "0.55672985", "0.55594873", "0.55368894", "0.5517783", "0.54752153", "0.54752153", "0.54739505", "0.5462235", "0.5462235", "0.5462235", "0.5462235", "0.5455835", "0.54499155", "0.54287565", "0.5417783", "0.5417783", "0.54084295", "0.540828", "0.53745055", "0.5350099", "0.5308491", "0.5290086", "0.52871704", "0.5259418", "0.52406436", "0.5240053", "0.5232636", "0.52312225", "0.51879853", "0.51649123", "0.516195", "0.51598924", "0.51379657", "0.5132426", "0.5110144", "0.51058745", "0.51041037", "0.5096064", "0.5092469", "0.50913095", "0.5088056", "0.50746924", "0.5048721", "0.5045308", "0.504351", "0.5041367", "0.50381905", "0.5032639", "0.50172734", "0.50148743", "0.50123334", "0.50060046", "0.5004568", "0.5002197", "0.4999125", "0.4990616", "0.4987081", "0.49866503", "0.49718922", "0.4967443", "0.49612194", "0.4959717", "0.49579266", "0.49579266", "0.49579266", "0.49579266", "0.49579266", "0.49579266", "0.49579266", "0.49579266", "0.49579266", "0.49579266", "0.49579266", "0.49579266", "0.49579266", "0.49535373", "0.49514666", "0.49488002", "0.49488002", "0.49404106", "0.4932583", "0.4915656", "0.49123672", "0.4905017", "0.49030033", "0.49006647", "0.48973438", "0.48950684", "0.4892202", "0.48793143", "0.4878791", "0.48713052" ]
0.0
-1
Write the backend to a local path
public function writeTo($path) { try { $resource = $this->getImageResource(); if (!$resource) { throw new BadMethodCallException("Cannot write corrupt file to store"); } $resource->save($path, $this->getQuality()); } catch (NotWritableException $e) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saveTo(string $path);", "public function getWritePath();", "public function storeTo($path = './') {\n\t\tfile_put_contents($path . $this->filename, $this->content);\t\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 }", "public function save($path);", "public function write($path, $data);", "public function setWritePath( $target );", "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}", "public function setSavePath(string $path);", "public function write();", "public function write();", "public function saveAs(string $path): void;", "function mdl_write_component_to_disk($component)\n{\n // TODO: Validate component structure\n $path = mdl_resolve_path($component['path'] ?? './');\n if ('.php' !== substr($path, strlen($path) - 4)) {\n $path = $path . '.php';\n }\n // TODO : Create directory if not exits\n mdl_create_directory_if_not_exists(dirname($path));\n mdl_io_create_writer($path, 'w')->write($component['source']);\n}", "public function saveToDisk($data, $localFilePath)\n {\n $folderPath = dirname($localFilePath);\n if (!file_exists($folderPath)) {\n mkdir($folderPath, 0777, true);\n }\n $file = fopen($localFilePath, \"w\");\n fputs($file, $data);\n fclose($file);\n }", "public function save()\n {\n if ($this->createDirectoryStructure($this->getPath())) {\n $content = $this->generateContents();\n file_put_contents($this->getPathname(), $content);\n }\n }", "protected function write()\n {\n $this->writeString($this->database);\n $this->writeString($this->type);\n $this->writeString($this->storage);\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 setSavePath($local, $path)\n {\n $this->save_local = $local;\n $this->save_path = $path;\n }", "protected function _write() {}", "public function write()\n\t{\n\t\t$source = $this->compile();\n\n\t\t// file location\n\t\t$file = $this->template->getEnvironment()->getCache() . '/';\n\t\t$file .= $this->template->getEnvironment()->getCacheFilename($this->filename);\n\n\t\t// attempt to create the directory if needed\n\t\tif(!is_dir(dirname($file)))\n\t\t{\n\t\t\tmkdir(dirname($file), 0777, true);\n\t\t}\n\n\t\t// write to tempfile and rename\n\t\t$tmpFile = tempnam(dirname($file), basename($file));\n\t\tif(@file_put_contents($tmpFile, $source) !== false)\n\t\t{\n\t\t\tif(@rename($tmpFile, $file))\n\t\t\t{\n\t\t\t\tchmod($file, 0644);\n\t\t\t}\n\t\t}\n\t}", "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}", "function save($filePath);", "function writeUrl() {\n\n }", "function write($path, $text) {\n $file = fopen($path, 'wb');\n fwrite($file, $text);\n fclose($file);\n}", "public function write()\n {\n }", "public function saveLocalFile()\n {\n if (!Storage::disk('local')->exists(self::NAME_FILE_LOCAL) && $this->verificUrl()) {\n Storage::disk('local')->put(self::NAME_FILE_LOCAL, file(self::URL_UMASS_COUNTRYS));\n }\n }", "private function getSessionSavePath() {}", "public function save($file, $path);", "private function writeTextToFile() {\n\t\t$text = $this -> pm -> getText($this -> padid);\n\t\t$path = sprintf('%s/%s.tex', $this -> directory, $this -> name);\n\t\tfile_put_contents($path, $text);\n\t}", "function storage_path($path = '')\n {\n return phanda()->storagePath() . ($path ? DIRECTORY_SEPARATOR . $path : $path);\n }", "public function testWriteFile() {\n\t\t$filename = 'test.json';\n\t\t$filestream = 'maryhad';\n\t\ttextus_put_file($filename, $filestream);\n\t}", "public function save()\n {\n App::cliLog(\"Saving to $this->format file\", false);\n\n try {\n call_user_func([$this, 'export' . ucfirst($this->format)]);\n } catch (Exception $e) {\n App::cliLog($e->getMessage());\n }\n }", "abstract protected function _write();", "public function save()\n {\n $this->readCache();\n\n file_put_contents($this->filePath, json_encode($this->cacheContents));\n }", "protected function writeFileToDisk(): void\n {\n $this->getFile()->move($this->getUploadRootDir(), $this->fileName);\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 FrontendOutputPostGenerate() {\n\t\t\tfile_put_contents($this->location, $this->template);\n\t\t}", "public function write() {\n\n try {\n $this->open();\n $sessionData = session_encode(); // Returns an encoded string containing the session data.\n $fileHandle = fopen(self::FILEPATH, \"w+\"); // Open the file\n fwrite($fileHandle, $sessionData); // Write the session data to file\n fclose($fileHandle);\n }\n catch(SessionException $e) {\n echo \"Error writing session to file: \" . $e->getMessage();\n }\n }", "protected function writeSysFileStorageRecords() {}", "private function write($path, $content)\n {\n file_put_contents($path, $content);\n }", "public function writeFile($path, $data);", "public function getSavePath(): string;", "public function saveDataToFile()\n {\n\n }", "public function saveToTemporaryDirectory($name, $content);", "public function save(){\n return parent::writeFile( $this->outputFile, $this->template);\n }", "abstract protected function write();", "public function setPath(?string $value): void {\n $this->getBackingStore()->set('path', $value);\n }", "protected function save()\n {\n return file_put_contents($this->outputPath() . '/' . $this->outputFile(), $this->stub); \n }", "public function store(): void\r\n {\r\n echo \"\\nStoring in cloud...\";\r\n }", "private function _saveZoetropeModelToFile()\n {\n file_put_contents(\n $this->fileDir . $this->jsonFile,\n json_encode($this->zModel)\n );\n }", "protected function initStorageFile()\n {\n $storageFilePath = $this->getStoragePath();\n if(!file_exists($storageFilePath)) {\n touch($storageFilePath);\n fwrite(fopen($storageFilePath, \"w\"), static::HEADER . \"\\n\");\n }\n }", "public function saveToFile()\n {\n $emails = $this->getEmailTemplatesFromRepository()->toJson();\n\n $this->filesystem->put($this->storagePath, $emails);\n }", "public function write($path, callable $callback) // TODO: add return type\n {\n $pathstr = $path;\n if (is_array($path))\n {\n $pathstr = $path['path'] ?? '';\n }\n\n if (strlen(trim($pathstr)) == 0)\n throw new \\Flexio\\Base\\Exception(\\Flexio\\Base\\Error::UNAVAILABLE);\n\n $arr = $this->splitPath($pathstr);\n\n $connection_identifier = '';\n $rpath = '';\n $service = $this->getServiceFromPath($pathstr, $connection_identifier, $rpath);\n\n $arr = [ 'path' => $rpath ];\n if (is_array($path))\n {\n unset($path['path']);\n $arr = array_merge($arr, $path);\n }\n\n return $service->write($arr, $callback);\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 }", "public function save(): void\n {\n foreach ($this->getChunks() as $chunk) {\n $this->getFile()->seek(0, SeekType::SEEK_END);\n $chunk->setOffset($this->getFile()->tell() / 4096);\n $chunkData = $chunk->getChunkData();\n $this->getFile()->write($chunkData);\n $this->getFile()->seek($this->calcOffset($chunk->getCoordinates()),\n SeekType::SEEK_SET\n );\n $chunkLocation = $chunk->getLocation();\n $this->getFile()->write($chunkLocation);\n }\n }", "function storage_path()\n {\n return base_path() . '/storage';\n }", "public function write($localPath, $handlerObj = NULL, $handlerMethod = NULL) {\n return $this->fileService->writeFile( $localPath, $this->path, $handlerObj, $handlerMethod );\n }", "protected function _writeLocale()\n {\n $text = $this->_tpl['locale'];\n \n $file = $this->_class_dir . DIRECTORY_SEPARATOR . \"/Locale/en_US.php\";\n if (file_exists($file)) {\n $this->_outln('Locale file exists.');\n } else {\n $this->_outln('Writing locale file.');\n file_put_contents($file, $text);\n }\n }", "public function write($filename);", "public function write($filename);", "public function writeAndClose();", "protected function save()\n {\n $css = setcooki_path('plugin') . '/var/app.min.css';\n $json = setcooki_path('plugin'). '/var/options.json';\n $options = Option::get('wunderlist_todo_options', array());\n\n if(is_file($css))\n {\n @unlink($css);\n }\n if(is_file($json))\n {\n @chmod($json, 0755);\n }\n @file_put_contents($json, json_encode($options));\n }", "public function toFile($path, $text = null)\n {\n if (!is_writeable(dirname($path))) {\n throw new Zend_Environment_Exception('Cannot write file to ' . $path);\n }\n \n if ($text === null) {\n $text = $this->toText();\n }\n\n return file_put_contents($path, $text);\n }", "public function save()\r\n {\r\n $module = Yii::$app->controller->module;\r\n if ($this->operation === self::OP_OVERWRITE) {\r\n $dir = dirname($this->path);\r\n if (!is_dir($dir)) {\r\n $mask = @umask(0);\r\n $result = @mkdir($dir, $module->newDirMode, true);\r\n @umask($mask);\r\n if (!$result) {\r\n return \"Unable to create the directory '$dir'.\";\r\n }\r\n }\r\n }\r\n if (@file_put_contents($this->path, $this->content) === false) {\r\n return \"Unable to write the file '{$this->path}'.\";\r\n }\r\n\r\n return true;\r\n }", "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 getStoragePath(): string;", "public function writeFile($data);", "public function save(){\n\n // Save the name of migration in prop (0000_00_00_000000_prefix.php)\n $this->migrationName = date('Y_m_d_'.Carbon::now()->format('His'),time()) . \"_\". $this->prefixFileName .\".php\";\n\n $this->document = $this->header;\n\n $this->document.= $this->up;\n $this->document.= $this->endUp;\n $this->document.= $this->down;\n $this->document.= $this->footer;\n\n return Storage::disk('migration')->put($this->migrationName, $this->document);\n\n }", "public function write(){\n\n\t\t$ACHFile = fopen($this->getFileLocation(), \"w\");\n\t\tfwrite($ACHFile, $this->getData());\n\t\tfclose($ACHFile);\n\n\t\treturn $this->getFileLocation();\t\n\t}", "public function write($data, $filename = '', $uploadDir = '');", "private function save() \n {\n $content = \"<?php\\n\\nreturn\\n[\\n\";\n\n foreach ($this->arrayLang as $this->key => $this->value) \n {\n $content .= \"\\t'\".$this->key.\"' => '\".$this->value.\"',\\n\";\n }\n\n $content .= \"];\";\n\n file_put_contents($this->path, $content);\n\n }", "public function write_file ( $content ) {\r\n\r\n\t}", "private function writeFile($stub)\n {\n $this->files->put($this->path, $stub);\n }", "public function setPath($path){ }", "public function writeToFile(): bool;", "function transfer()\n\t{\n\t\tglobal $phpbb_root_path;\n\n\t\t$this->file_perms\t= 0644;\n\t\t$this->dir_perms\t= 0777;\n\n\t\t// We use the store directory as temporary path to circumvent open basedir restrictions\n\t\t$this->tmp_path = $phpbb_root_path . 'store/';\n\t}", "public function onAfterWrite() {\n if (!$this->URLPath) {\n $this->URLPath = Utils::generateURLPath($this->Title, $this->ID);\n $this->write();\n }\n\n parent::onAfterWrite();\n }", "public function set($name,$value) {\r\n\t\t//$temp_path = '/tmp/'; // for Unix server\r\n\t\t$temp_path = dirname(Prado::getApplication()->Request->ApplicationFilePath).DIRECTORY_SEPARATOR.\"assets\".DIRECTORY_SEPARATOR;\r\n\t\t$strvalue = serialize($value);\r\n\t\t// generate a storeable representation of\r\n\t\t// the value, with it's type and structure\r\n\t\t$file_pointer = fopen($temp_path . $name, 'w');\r\n\t\tif(!(fwrite($file_pointer,$strvalue))) {\r\n\t\t\treturn false; //success\r\n\t\t} else {\r\n\t\t\treturn true; //not able to write file\r\n\t\t}\r\n\t}", "protected function outPutTmpFile() {\r\n\t\t$dir = XOOPS_TRUST_PATH.'/tmp';\r\n\t\t$path = $dir.'/'.mt_rand().\"_\".time().'_collabtrans.xml';\r\n\t\t$fp = fopen($path, \"w\");\r\n\t\tfwrite($fp, $this -> toXML());\r\n\t\tfclose($fp);\r\n\r\n\t\treturn $path;\r\n\t}", "public function storeFileFromLocalPath($type, $path, $newFilename = null, $unlinkAfterStore = false);", "public function write($path, $data) {\n $basepath = dirname($path);\n if (!is_dir($basepath)) {\n if (mkdir($basepath, 0777, true) === FALSE) {\n throw new \\Exception(\"Failed to create base directory [{$basepath}] for file write.\");\n }\n }\n return file_put_contents($path, $data);\n }", "public function storagePath()\n {\n return $this->basePath . DIRECTORY_SEPARATOR . 'storage';\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 save($path,$content,$lock = false) ;", "public function setPath( $path );", "public function save()\n {\n return file_put_contents($this->getFilepath(), $this->read());\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 }", "public function writeRevision()\n {\n $locRev = $this->git->localRevision();\n $temp = tempnam(sys_get_temp_dir(), 'gitRevision');\n\n file_put_contents($temp, $locRev);\n ftp_put($this->connection, $this->revisionFile, $temp, FTP_BINARY);\n unlink($temp);\n }", "public function storeFile()\n\t{\n\t\tif (!$this->blnIsModified)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$strFile = trim($this->strTop) . \"\\n\\n\";\n\t\t$strFile .= \"-- LESSON SEGMENT START --\\nCREATE TABLE `tl_cb_lessonsegment` (\\n\";\n\n\t\tforeach ($this->arrData as $k=>$v)\n\t\t{\n\t\t\t$strFile .= \" `$k` $v,\\n\";\n\t\t}\n\n\t\t$strFile .= \") ENGINE=MyISAM DEFAULT CHARSET=utf8;\\n-- LESSON SEGMENT STOP --\\n\\n\";\n\n\t\tif ($this->strBottom != '')\n\t\t{\n\t\t\t$strFile .= trim($this->strBottom) . \"\\n\\n\";\n\t\t}\n\n\t\t$objFile = new File('system/modules/course_builder/config/database.sql');\n\t\t$objFile->write($strFile);\n\t\t$objFile->close();\n\t}", "public function save(IO\\File $file) {\n\t\t\tfile_put_contents($file, $this->render());\n\t\t\t$this->file = $file;\n\t\t}", "public function saveFile($file, $path)\n\t\t{\n\t\t\treturn Storage::disk('public')->put($path, $file);\n\t\t}", "function write()\n {\n }", "public function store(string|array $path, string $rename = null): bool\n {\n $space = null;\n if (is_array($path)) {\n $space = $path['space'] ?? null;\n $path = $path['path'];\n }\n $name = $rename ?? $this->getClientFilename();\n $location = trim($path, '\\/') . DIRECTORY_SEPARATOR . $name;\n if ($space) {\n \\MkyCore\\Facades\\FileManager::use($space)->write($location, $this->getStream());\n } else {\n \\MkyCore\\Facades\\FileManager::write($location, $this->getStream());\n }\n return true;\n }", "#[\\ReturnTypeWillChange]\n public function save($path, $format = Document::XML)\n {\n switch ($format) {\n case Document::XML:\n $format = 'saveXML';\n break;\n case Document::HTML:\n $format = 'saveHTML';\n break;\n case Document::JSON:\n $format = 'toJson';\n break;\n default:\n throw new DomException('Invalid format', 2);\n }\n\n if (Storage::createFolder('tmp/dom')) {\n $tmp = Storage::temp($this->$format(), 'tmp/dom');\n } else {\n $tmp = false;\n }\n\n if ($tmp === false) {\n throw new DomException('Can\\'t create tmp file', 2);\n } elseif (copy($tmp, $path) === false) {\n throw new DomException('Can\\'t copy tmp file to ' . $path, 2);\n } else {\n unlink($tmp);\n }\n }", "public function getSavePath(): string\n {\n return session_save_path();\n }", "public function save($path)\n {\n $curl_options = array (\n CURLOPT_HEADER => 0,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_BINARYTRANSFER => 1,\n );\n\n $file = $this->curl_query($curl_options);\n\n if (!$file) \n return false;\n\n if (($handle = fopen($path, 'w')) === false)\n return false;\n\n if ((fwrite($handle, $file)) === false)\n return false;\n\n fclose($handle);\n return true;\n }", "function saved_to_database(string $path) {\n\t\t$_SESSION['errors'] = '';\n\t\tredirect($path);\n }", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);" ]
[ "0.6304256", "0.6120411", "0.60172886", "0.59497416", "0.59109455", "0.5791783", "0.57749224", "0.57536596", "0.5736895", "0.5613975", "0.5613975", "0.55904967", "0.55020666", "0.5496044", "0.54399943", "0.54069716", "0.54058266", "0.54022664", "0.5383037", "0.5376265", "0.5333005", "0.53288376", "0.5309838", "0.530907", "0.52776045", "0.52730304", "0.52649766", "0.52387077", "0.5227067", "0.52137935", "0.5197086", "0.5178037", "0.5170165", "0.5158277", "0.51565564", "0.51523983", "0.51413745", "0.5139118", "0.5133743", "0.5106127", "0.51050806", "0.50729656", "0.50471425", "0.50416523", "0.5036458", "0.50357145", "0.5028916", "0.50256824", "0.5007346", "0.50049984", "0.50024927", "0.49909782", "0.49880254", "0.49837252", "0.49655887", "0.49514765", "0.4950644", "0.49479604", "0.494666", "0.494666", "0.4941391", "0.49301746", "0.49246433", "0.49132112", "0.4910293", "0.4903445", "0.4896412", "0.48710695", "0.48597756", "0.48395684", "0.48390323", "0.48357588", "0.4832372", "0.483208", "0.48320204", "0.4829156", "0.48287642", "0.4828693", "0.48240456", "0.48239347", "0.48233932", "0.48141265", "0.48135507", "0.48129886", "0.4810832", "0.48004574", "0.4798365", "0.47943524", "0.47803733", "0.47771215", "0.47729287", "0.47728282", "0.47707996", "0.477008", "0.47693503", "0.47647867", "0.47637925", "0.47629952", "0.47629952", "0.47629952", "0.47629952" ]
0.0
-1
Return dimensions as array with cache enabled
protected function getDimensions() { // Default result $result = [0, 0]; // If we have a resource already loaded, this means we have modified the resource since the // original image was loaded. This means the "Variant" tuple key is out of date, and we don't // have a reliable cache key to load from, or save to. If we use the original tuple as a key, // we would run the risk of overwriting the original dimensions in the cache, with the values // of the resized instead. // Instead, we use the immediately available dimensions attached to this resource, and we will // rely on cache warming in writeToStore to save these values, where the "Variant" becomes available, // before the next time this variant is loaded into memory. $resource = $this->image; if ($resource) { return $this->getResourceDimensions($resource); } // Check if we have a container $container = $this->getAssetContainer(); if (!$container) { return $result; } // Check cache for unloaded image $cache = $this->getCache(); $key = $this->getDimensionCacheKey($container->getHash(), $container->getVariant()); if ($cache->has($key)) { return $cache->get($key); } // Cache-miss $resource = $this->getImageResource(); if ($resource) { $result = $this->getResourceDimensions($resource); $cache->set($key, $result); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDimensions() {\n\t\treturn $this->dimensions->toArray();\n\t}", "public function getDimensions() {}", "public function getDimensions();", "public function getDimensions();", "public function getDimensions(): array\n\t{\n\t\treturn $this->processor->getDimensions();\n\t}", "public function getDimensions(){\n\t\treturn array('width' => $this->_width, 'height' => $this->_height);\n\t}", "protected function getDimensions(): array\n {\n $args = $this->fit;\n $res = [];\n\n if (empty($args) || sizeof($args) < 2) {\n return [];\n }\n\n foreach ($args as $arg) {\n $res[] = (int) $arg;\n }\n\n return $res;\n }", "public function getDimensions() {\n return array(\n array(20, 10, 14, 10),\n array(100, 1000, 100, 70),\n array(1000, 1000, 665, 463),\n );\n }", "public function dimensions() {\n\t\treturn $this->_cache(__FUNCTION__, function($file) {\n\t\t\t$dims = null;\n\n\t\t\tif (!$file->isImage()) {\n\t\t\t\treturn $dims;\n\t\t\t}\n\n\t\t\t$data = @getimagesize($file->path());\n\n\t\t\tif ($data && is_array($data)) {\n\t\t\t\t$dims = array(\n\t\t\t\t\t'width' => $data[0],\n\t\t\t\t\t'height' => $data[1]\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (!$data) {\n\t\t\t\t$image = @imagecreatefromstring(file_get_contents($file->path()));\n\t\t\t\t$dims = array(\n\t\t\t\t\t'width' => @imagesx($image),\n\t\t\t\t\t'height' => @imagesy($image)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $dims;\n\t\t});\n\t}", "public function getDimensions() {\n\t\treturn array('width' => $this->getImageWidth(),'height' =>$this->getImageHeight());\t\n\t}", "public function getDimensions()\n {\n return $this->dimensions;\n }", "public function getSizes(): array\n {\n }", "public function getDimensions()\n\t{\n\t\treturn $this->dimensions;\n\t}", "protected function _getWidthArray() {}", "public static function getAllDimensions()\n {\n $cacheId = CacheId::pluginAware('VisitDimensions');\n $cache = PiwikCache::getTransientCache();\n\n if (!$cache->contains($cacheId)) {\n $plugins = PluginManager::getInstance()->getPluginsLoadedAndActivated();\n $instances = array();\n\n foreach ($plugins as $plugin) {\n foreach (self::getDimensions($plugin) as $instance) {\n $instances[] = $instance;\n }\n }\n\n $instances = self::sortDimensions($instances);\n\n $cache->save($cacheId, $instances);\n }\n\n return $cache->fetch($cacheId);\n }", "public function findAllAvailableDimensions()\n {\n $query = $this->getEntityManager()->createQuery('SELECT c.width, c.height FROM AppBundle\\Entity\\Contentunit c');\n\n return $query->getArrayResult();\n }", "public function getDimensions()\n {\n if(!$this->getData('dimensions')) {\n $this->setData('dimensions', $this->_getResource()->getDimensions($this));\n }\n return $this->getData('dimensions');\n }", "public function getDimensionValues() {\n\t\treturn $this->dimensionValues;\n\t}", "public function sizesArray():array\n {\n $sizes = [];\n if (!empty($this->sizes)) {\n $sizes = json_decode($this->sizes, true);\n }\n return $sizes;\n }", "public function getDimensions()\n {\n return array_keys($this->compositeDatabaseFields());\n }", "public function getDimensionsHash() {\n\t\treturn $this->dimensionsHash;\n\t}", "public function getParcelDimensions()\n {\n $height = \\Configuration::get(self::SIZE_TYPE_FIXED_SIZE_X);\n $length = \\Configuration::get(self::SIZE_TYPE_FIXED_SIZE_Y);\n $width = \\Configuration::get(self::SIZE_TYPE_FIXED_SIZE_Z);\n $weight = \\Configuration::get(self::SIZE_TYPE_FIXED_SIZE_WEIGHT);\n\n $dimensions = array(\n \"height\" => $height,\n \"length\" => $length,\n \"width\" => $width,\n \"weight\" => $weight\n );\n\n return $dimensions;\n }", "public function dim()\n {\n return $this->dim;\n }", "function getDimensiones() {\n return $this->dimensiones;\n }", "public function getSizes(){\n return (array) $this->getAttr('size');\n }", "public function get_dim()\n {\n return $this->dim;\n }", "private function getImagesInfoArray(): array\n {\n //====================================================================//\n // Get Images Infos From Cache\n if (!is_null($this->imagesCache)) {\n return $this->imagesCache;\n }\n //====================================================================//\n // Load Complete Product Images List\n $productImages = Image::getImages(\n SLM::getDefaultLangId(),\n (int) $this->object->id,\n null,\n Shop::getContextShopID(true)\n );\n //====================================================================//\n // Images List is Empty\n $this->imagesCache = array();\n if (!count($productImages)) {\n return $this->imagesCache;\n }\n //====================================================================//\n // Create Images List\n foreach ($productImages as $imgArray) {\n //====================================================================//\n // Add Image t o Cache\n $this->imagesCache[] = $this->buildInfo($imgArray[\"id_image\"]);\n }\n\n return $this->imagesCache;\n }", "public function toArray(): array\n {\n return array_map(fn(DimensionInterface $item) => $item->toArray(), $this->items);\n }", "public function cache_info() : array\n\t{\n\t\t$info = [];\n\n\t\tforeach ($this->cache as $key=>$value) {\n\t\t\t$info[$key] = [\n\t\t\t\t'value'=>$value,\n\t\t\t\t'size'=>strlen($value),\n\t\t\t\t'ttl'=>0,\n\t\t\t];\n\t\t}\n\n\t\treturn $info;\n\t}", "public function getMetrics(): array;", "public function toArray() {\n\t\t$data\t= array(\n\t\t\t'hash'\t\t=> $this->getHash(),\n\t\t\t'dims'\t\t=> $this->dims,\n\t\t\t'measures'\t=> $this->measures\n\t\t);\n\n\t\tif (!is_null($this->time)){\n\t\t\t$data['time']\t= $this->time;\n\t\t}\n\n\t\treturn $data;\n\t}", "public static function size ()\n {\n return ['x' => static::$_map_width, 'y' => static::$_map_height];\n }", "public function getCacheData(): array\n\t{\n\t\treturn $this->cacheData;\n\t}", "public function getDimensions()\n {\n $imageDimension = getimagesize($this->image);\n\n $width = $imageDimension[0];\n $height = $imageDimension[1];\n\n foreach($this->effect as $effect)\n {\n if($effect instanceof PictureEffect)\n {\n $modified = $effect->getNewDimensions($width, $height);\n\n $width = $modified['w'];\n $height = $modified['h'];\n }\n }\n\n return array(\n 'w' => $width,\n 'h' => $height,\n );\n }", "public function shape() : array\n {\n return [$this->numRows(), $this->numColumns()];\n }", "public static function getAllSizes() : array {\n return array_keys( self::$all_sizes );\n }", "public function get_dimensions( $args ) {\n\t\t\tif (\n\t\t\t\tempty( $args['height'] )\n\t\t\t\t&& empty( $args['width'] )\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// We are only going to use the size if none are defined in the transform, which shouldn't happen.\n\t\t\tif ( isset( $args['crop'] ) && false === $args['crop'] ) {\n\t\t\t\t$h = 100;\n\t\t\t} else {\n\t\t\t\t$h = $args['height'] . 'px';\n\t\t\t}\n\n\t\t\treturn array(\n\t\t\t\t'width' => $args['width'],\n\t\t\t\t'height' => $h,\n\t\t\t);\n\t\t}", "public function getDim() {\n\t\treturn $this->dim;\n\t}", "function getImageSize() \n { \n return array($this->_width,$this->_height); \n }", "public function getArraySampleSize(): UnsignedInteger;", "private function buildCache(): array\n {\n $dispatchData = $this->routeCollector->getData();\n\n file_put_contents($this->cacheFile, '<?php return ' . var_export($dispatchData, true) . ';');\n\n return $dispatchData;\n }", "abstract public function getArray();", "public function dimensions(): int\n {\n return -1;\n }", "public function getData() {\n\t\treturn [\n\t\t\t16 => [\"type\" => 0, \"value\" => $this->size]\n\t\t];\n\t}", "public function getImageSizesNames(): array\n {\n return get_intermediate_image_sizes();\n }", "public function getSize() {\n return array(\"x\" => imagesx($this->current), \"y\" => imagesy($this->current));\n }", "public static function getSizes()\n {\n $db = DataBase::connect();\n\n $sortOrder = SIZE_SORT_ORDER ? \"ASC\" : \"DESC\" ;\n $result = $db->query(\"SELECT * FROM `size` ORDER BY `id` {$sortOrder}\");\n\n $sizes = [];\n\n $i = 1;\n\n while($row = $result->fetch()) {\n $sizes[$i]['size'] = $row['size'];\n $sizes[$i]['leonardo_prices'] = $row['leonardo_prices'];\n $sizes[$i]['frodo_prices'] = $row['frodo_prices'];\n $sizes[$i]['back_leg'] = $row['back_leg'];\n $sizes[$i]['image_size'] = $row['image_size'];\n\n $i++;\n }\n return $sizes;\n }", "function getDimensions()\n {\n $dimensions = array();\n foreach($this->m_childs as $abstractFrame)\n {\n $dimensions[] = $abstractFrame->getDimension();\n }\n return implode(\", \", $dimensions);\n }", "private function getImagesInfoArray()\n {\n //====================================================================//\n // Get Images Infos From Cache\n if (!is_null($this->imagesCache)) {\n return $this->imagesCache;\n }\n //====================================================================//\n // Load Complete Product Images List\n $productImages = Image::getImages(\n SLM::getDefaultLangId(),\n $this->object->id,\n null\n );\n //====================================================================//\n // Images List is Empty\n if (!count($productImages)) {\n return $this->imagesCache;\n }\n //====================================================================//\n // Create Images List\n foreach ($productImages as $imgArray) {\n //====================================================================//\n // Add Image t o Cache\n $this->imagesCache[] = $this->buildInfo($imgArray[\"id_image\"]);\n }\n\n return $this->imagesCache;\n }", "public function getPackageDimensions()\n {\n return $this->packageDimensions;\n }", "public function getImageSizes(): array\n {\n $additionalSizes = wp_get_additional_image_sizes();\n $names = $this->getImageSizesNames();\n\n return array_map(function (string $name) use ($additionalSizes) {\n if (isset($additionalSizes[$name])) {\n return [\n \"name\" => $name,\n \"width\" => $additionalSizes[$name][\"width\"],\n \"height\" => $additionalSizes[$name][\"height\"],\n \"crop\" => $additionalSizes[$name][\"crop\"],\n ];\n }\n \n return [\n \"name\" => $name,\n \"width\" => get_option(\"{$name}_size_w\"),\n \"height\" => get_option(\"{$name}_size_h\"),\n \"crop\" => !!get_option(\"{$name}_crop\"),\n ];\n }, $names);\n }", "private function getAllThumbnailSizes(): array\n {\n $connection = $this->container->get('dbal_connection');\n $joinedSizes = $connection\n ->query('SELECT DISTINCT thumbnail_size FROM s_media_album_settings WHERE thumbnail_size != \"\"')\n ->fetchAll(\\PDO::FETCH_COLUMN);\n\n $sizes = [];\n foreach ($joinedSizes as $sizeItem) {\n $explodedSizes = explode(';', $sizeItem);\n if (empty($explodedSizes)) {\n continue;\n }\n\n $sizes = array_merge($sizes, array_flip($explodedSizes));\n }\n\n return array_keys($sizes);\n }", "public function arrDimensiones($datos){\n $dimensiones = $datos['dimensiones'];\n $arr = [];\n \n foreach ($dimensiones as $n => $dimension) {\n $descripcion = DescripcionProducto::create(['n_orden' => $n+1, 'dimension' => $dimension]);\n array_push($arr, $descripcion->id);\n }\n\n return $arr;\n }", "public function getWindowSize()\n {\n return [\n 'width' => self::$windowWidth,\n 'height' => self::$windowHeight,\n ];\n }", "function get_dimension_info($dim,$dimension_unit)\n {\n return array(\n 'length'=> array('cm'=>length_convert($dim[0],$dimension_unit,'cm'), \n 'in'=>length_convert($dim[0],$dimension_unit,'in'),\n 'ft'=>length_convert($dim[0],$dimension_unit,'ft') ), \n 'width'=> array('cm'=>length_convert($dim[1],$dimension_unit,'cm'), \n 'in'=>length_convert($dim[1],$dimension_unit,'in'),\n 'ft'=>length_convert($dim[1],$dimension_unit,'ft') ), \n 'height'=> array('cm'=>length_convert($dim[2],$dimension_unit,'cm'), \n 'in'=>length_convert($dim[2],$dimension_unit,'in'),\n 'ft'=>length_convert($dim[2],$dimension_unit,'ft') ) \n ); \n }", "public function getAsArray();", "public function getData()\n {\n return array(\n 'time' => bcsub(self::getMicroTime() , $this->startTime, 4),\n 'memory' => round(memory_get_usage() / 1024 / 1024, 4),\n 'files' => count(get_included_files()),\n 'classes' => count(get_declared_classes())\n );\n }", "public function memoryUsage() : array\n {\n return $this->memoryUsage;\n }", "public function jsonSerialize()\n {\n $json = array();\n $json['width'] = $this->width;\n $json['height'] = $this->height;\n $json['length'] = $this->length;\n\n return $json;\n }", "public function getDataToResize()\n {\n return [\n [\n GifImageResizer::PROPORTIONAL,\n [GifImageResizer::RATIO => 50],\n [GifImageResizer::OPT_INTERLACE => true],\n [360, 81]\n ],\n [\n GifImageResizer::FIXED,\n [GifImageResizer::WIDTH => 50, GifImageResizer::HEIGHT => 50],\n [GifImageResizer::OPT_INTERLACE => false],\n [50, 50]\n ],\n [\n GifImageResizer::FIXED_WIDTH,\n [GifImageResizer::WIDTH => 180],\n [GifImageResizer::OPT_INTERLACE => true],\n [180, 41]\n ],\n [\n GifImageResizer::FIXED_HEIGHT,\n [GifImageResizer::HEIGHT => 20],\n [],\n [89, 20]\n ]\n ];\n }", "function getArray();", "public function getImageSizes(): array\n {\n /** @var BackendUser $user */\n $user = $this->tokenStorage->getToken()->getUser();\n\n return $this->imageSizes->getOptionsForUser($user);\n }", "public static function loadFromCache():array {\n\n # Result\n $result = [];\n\n # Cache Instance\n $cacheInstance = new Cache();\n\n # Prepare key\n $key = Cache::getKeyWithCacheName(__CLASS__, \"routerCollection\");\n\n # Get data from cache\n $result = $cacheInstance->get($key);\n\n # Return result\n return $result;\n\n }", "public function toArray()\n {\n $array = parent::toArray();\n\n foreach ($array as $k => &$v) {\n $v['_count'] = $k;\n }\n\n return $array;\n }", "function getDimension()\n {\n return $this->m_dimension;\n }", "public function get_all_size() {\n\t\t$this->db->select('*');\n\t\t$this->db->from('tbl_size');\n\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "protected function getWidthAndHeightLocal(string $filepath): array\n {\n $result = getimagesize($filepath);\n if (!$result) {\n return $this->emptySize;\n }\n list($width, $height) = $result;\n return [\n 'width' => $width,\n 'height' => $height,\n ];\n }", "public function getProcessedElements(): array;", "function image_dimensions ( $image_path ) {\r\n\t\t$image = image_read($image_path,false);\r\n\t\tif ( !$image ) return $image;\r\n\t\t$width = imagesx($image);\r\n\t\t$height = imagesy($image);\r\n\t\t$dimensions = compact('width','height');\r\n\t\treturn $dimensions;\r\n\t}", "public function getArray() {\n\t\treturn $this->entries;\n\t}", "public function getInternalArray() {}", "public static function buildDataCache()\n {\n return new ArrayCache;\n }", "public function values(): array\n {\n return array_values($this->storage);\n }", "public function getObjectArray()\n {\n $this->_cache->load($this->_cache_key, $this->_data_version);\n\n return $this->_cache->objects;\n }", "public static function stats(): array;", "public function getImageDimension(): ImageDimensionInterface;", "private static function getFromCache()\n\t{\n\t\t$return = null;\n\n\t\t$aeDebug = \\MarkNotes\\Debug::getInstance();\n\n\n\t\treturn $arr;\n\t}", "public function get_image_sizes() {\n\t\tif ( ! is_array( $this->image_sizes ) || empty( $this->image_sizes ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\treturn $this->image_sizes;\n\t}", "public function getDIM()\n {\n return $this->DIM;\n }", "public function getImageData() {\n return array(\n array(\n json_encode(array(\n array(\n 'size' => 54249,\n 'publicKey' => '20033e31f182661dafa332b423ecce5f',\n 'imageIdentifier' => '9c966f89db794417d474a87793ea4af8',\n 'extension' => 'jpg',\n 'mime' => 'image/jpeg',\n 'added' => 1328530242,\n 'updated' => 1328530242,\n 'width' => 480,\n 'height' => 360,\n 'checksum' => '9c966f89db794417d474a87793ea4af8',\n ),\n array(\n 'size' => 152972,\n 'publicKey' => '20033e31f182661dafa332b423ecce5f',\n 'imageIdentifier' => '9adc6809eae536f98b9559cb1f1aeed3',\n 'extension' => 'jpg',\n 'mime' => 'image/jpeg',\n 'added' => 1328514845,\n 'updated' => 1328514845,\n 'width' => 800,\n 'height' => 600,\n 'checksum' => '9adc6809eae536f98b9559cb1f1aeed3',\n )\n ))\n )\n );\n }", "private static function buildTestArray(int $width, int $height)\n\t{\n\t\t$val = 1;\n\t\t$array = [];\n\t\tfor ($y = 0; $y < $height; $y++) {\n\t\t\t$array[$y] = [];\n\t\t\tfor ($x = 0; $x < $width; $x++) {\n\t\t\t\t$array[$y][$x] = $val++;\n\t\t\t}\n\t\t}\n\t\treturn $array;\n\t}", "public function arr()\n {\n return $this->array;\n }", "public function getArray()\n {\n return $this->arrayPeaks;\n }", "public function getArray(): array\n {\n return $this->array;\n }", "public function getArray(): array\n {\n return $this->array;\n }", "public function getLinkImageDimensions()\n {\n // Initialise:\n \n $data = [];\n \n // Obtain Dimensions:\n \n $widths = $this->dbObject('LinkImageWidth');\n $heights = $this->dbObject('LinkImageHeight');\n \n // Iterate Width Viewports:\n \n foreach ($widths->getViewports() as $viewport) {\n \n if ($value = $widths->getField($viewport)) {\n $data[$viewport]['Width'] = $value;\n $data[$viewport]['Breakpoint'] = $widths->getBreakpoint($viewport);\n }\n \n }\n \n // Iterate Height Viewports:\n \n foreach ($heights->getViewports() as $viewport) {\n \n if ($value = $heights->getField($viewport)) {\n $data[$viewport]['Height'] = $value;\n $data[$viewport]['Breakpoint'] = $heights->getBreakpoint($viewport);\n }\n \n }\n \n // Create Items List:\n \n $items = ArrayList::create();\n \n // Create Data Items:\n \n foreach ($data as $item) {\n $items->push(ArrayData::create($item));\n }\n \n // Answer Items List:\n \n return $items;\n }", "public function grid() : array\r\n {\r\n return [];\r\n }", "public function getArray()\n {\n return $this->get(self::_ARRAY);\n }", "public function getAllocations();", "public static function grabAllMemory()\n {\n \n $Memory = Memory::all();\n\n $data = array();\n\n foreach ($Memory as $key => $value) {\n $data[$value->server_id] = $value->to_array();\n\n unset($data[$value->server_id]['created_at']);\n unset($data[$value->server_id]['updated_at']);\n unset($data[$value->server_id]['mem_date']);\n }\n\n\n\n return $data;\n }", "public function toArray(): array\n {\n return [\n 'type' => 'quantilesDoublesSketchToQuantile',\n 'name' => $this->outputName,\n 'field' => $this->dimension->toArray(),\n 'fraction' => $this->fraction,\n ];\n }", "private function getThumbnailsArray(): array {\n $connection = new Connection();\n $link = $connection->connect();\n $result = $link->query(\"SELECT filename, id FROM image WHERE id <> '1' AND id <> '2' ORDER BY RAND() LIMIT \" . $this->rowsCount * 2);\n $thumbnails = array();\n while ($record = $result->fetch()){\n $thumbnails[] = $record;\n }\n $connection = null;\n return $thumbnails;\n }", "public function getCustomDimensions()\r\n\t{\r\n\t\t$dimensions = array\r\n\t\t(\r\n\t\t\t'pageType' => $this->getPageType()\r\n\t\t);\r\n\t\t\r\n\t\t/**\r\n\t\t * Array of callbacks adding dimensions\r\n\t\t */\r\n\t\tforeach (array\r\n\t\t(\r\n\t\t\tfunction ($dimensions)\r\n\t\t\t{\r\n\t\t\t\t$dimensions['pageName'] = Mage::helper('ec')->getSanitized\r\n\t\t\t\t(\r\n\t\t\t\t\tMage::app()->getLayout()->getBlock('head')->getTitle()\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\treturn $dimensions;\r\n\t\t\t},\r\n\t\t\tfunction ($dimensions)\r\n\t\t\t{\r\n\t\t\t\tif(Mage::app()->getRequest()->getControllerName() == 'result' || Mage::app()->getRequest()->getControllerName() == 'advanced')\r\n\t\t\t\t{\r\n\t\t\t\t\tif (Mage::app()->getLayout()->getBlock('search_result_list'))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$dimensions['resultsCount'] = Mage::app()->getLayout()->getBlock('search_result_list')->getLoadedProductCollection()->getSize();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn $dimensions;\r\n\t\t\t},\r\n\t\t\tfunction ($dimensions)\r\n\t\t\t{\r\n\t\t\t\t/**\r\n\t\t\t\t * Check if category page\r\n\t\t\t\t */\r\n\t\t\t\tif('catalog' == Mage::app()->getRequest()->getModuleName() && 'category' == Mage::app()->getRequest()->getControllerName())\r\n\t\t\t\t{\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * Get applied layer filter(s)\r\n\t\t\t\t\t */\r\n\t\t\t\t\t$filters = array();\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach ((array) Mage::getSingleton('catalog/layer')->getState()->getFilters() as $filter)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$filters[] = array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t'label' => Mage::helper('ec')->getSanitized($filter->getName()),\r\n\t\t\t\t\t\t\t'value' => Mage::helper('ec')->getSanitized($filter->getLabel())\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$dimensions['filters'] = $filters;\r\n\t\t\t\t\t\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * Count visible products\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (Mage::app()->getLayout()->getBlock('product_list') && $filters)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$dimensions['resultsCount'] = Mage::helper('ec/datalayer')->getLoadedProductCollection()->getSize();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn $dimensions;\t\r\n\t\t\t}, \r\n\t\t\tfunction ($dimensions)\r\n\t\t\t{\r\n\t\t\t\tif (Mage::getSingleton(\"customer/session\")->isLoggedIn())\r\n\t\t\t\t{\r\n\t\t\t\t\t$dimensions['avgTransVal'] = Mage::helper('ec')->getVisitorAvgTransValue();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn $dimensions;\r\n\t\t\t}\r\n\t\t) as $dimension)\r\n\t\t{\r\n\t\t\t$dimensions = (array) call_user_func($dimension, $dimensions);\r\n\t\t}\r\n\r\n\t\treturn json_encode($dimensions);\r\n\t}", "public function getPackageDimensions()\n {\n if (isset($this->data['PackageDimensions'])) {\n return $this->data['PackageDimensions'];\n } else {\n return false;\n }\n }", "public function getArray() : array {\n return $this->getArrayCopy();\n }", "public function scalarArray()\n {\n if($this->result_array) {\n $arr = array();\n $keys = array_keys($this->result_array[0]);\n foreach($this->result_array as $v) {\n $arr[] = $v[$keys[0]];\n }\n return $arr;\n }\n return [];\n }", "protected function getWidthAndHeightUrl(string $url): array\n {\n $width = null;\n $height = null;\n\n $tempFile = $this->tempFileFactory->build();\n $tempPath = $tempFile->getTempPath();\n $tempFile->delete();\n $handle = @fopen($url, 'rb');\n if ($handle) {\n $result = file_put_contents($tempPath, $handle);\n @fclose($handle);\n if ($result) {\n $result = getimagesize($tempPath);\n if ($result) {\n list($width, $height) = $result;\n }\n }\n unlink($tempPath);\n }\n\n return [\n 'width' => $width,\n 'height' => $height,\n ];\n }", "public function chunkSizeDataProvider(): array\n {\n return [\n 'chunkHasSize' => [['size' => 5000], 5000],\n 'chunkHasNoSize' => [['size' => null], 0]\n ];\n }", "public function getSizes()\n {\n return $this->sizes;\n }", "public function getArray()\n {\n return $this->array;\n }" ]
[ "0.72013", "0.70207644", "0.7018129", "0.7018129", "0.7014032", "0.6944247", "0.6850004", "0.6826895", "0.673235", "0.6443212", "0.6355589", "0.6317518", "0.6316493", "0.6158237", "0.61134976", "0.60630894", "0.6056573", "0.5971882", "0.5961361", "0.59124047", "0.5824726", "0.5789264", "0.578382", "0.5771689", "0.56795245", "0.56715554", "0.5640144", "0.56247056", "0.5622948", "0.5618942", "0.55916923", "0.5566587", "0.5518897", "0.55074483", "0.54990745", "0.5484452", "0.5478406", "0.5443934", "0.5436619", "0.54094964", "0.5397774", "0.5387849", "0.53705627", "0.5362623", "0.53609514", "0.53541195", "0.5335016", "0.53256863", "0.5323761", "0.5316685", "0.53156453", "0.52838904", "0.52790993", "0.5275366", "0.52638525", "0.52593356", "0.5258155", "0.524562", "0.52301365", "0.52202934", "0.521347", "0.52126044", "0.5209227", "0.5207926", "0.51901984", "0.5182473", "0.517982", "0.51339316", "0.5120969", "0.5119015", "0.5118644", "0.51130974", "0.51101947", "0.5106445", "0.5093848", "0.50924605", "0.5090332", "0.5089814", "0.5072746", "0.50699854", "0.5069477", "0.50693554", "0.5068553", "0.5066234", "0.5066234", "0.50651366", "0.50575215", "0.5055314", "0.50523466", "0.50520647", "0.50331175", "0.50134254", "0.50046706", "0.50043833", "0.5000352", "0.49973115", "0.49950305", "0.49931103", "0.49908268", "0.4989283" ]
0.6508993
9
Get dimensions from the given resource
protected function getResourceDimensions(InterventionImage $resource) { /** @var Size $size */ $size = $resource->getSize(); return [ $size->getWidth(), $size->getHeight() ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getDimensions()\n {\n // Default result\n $result = [0, 0];\n\n // If we have a resource already loaded, this means we have modified the resource since the\n // original image was loaded. This means the \"Variant\" tuple key is out of date, and we don't\n // have a reliable cache key to load from, or save to. If we use the original tuple as a key,\n // we would run the risk of overwriting the original dimensions in the cache, with the values\n // of the resized instead.\n // Instead, we use the immediately available dimensions attached to this resource, and we will\n // rely on cache warming in writeToStore to save these values, where the \"Variant\" becomes available,\n // before the next time this variant is loaded into memory.\n $resource = $this->image;\n if ($resource) {\n return $this->getResourceDimensions($resource);\n }\n\n // Check if we have a container\n $container = $this->getAssetContainer();\n if (!$container) {\n return $result;\n }\n\n // Check cache for unloaded image\n $cache = $this->getCache();\n $key = $this->getDimensionCacheKey($container->getHash(), $container->getVariant());\n if ($cache->has($key)) {\n return $cache->get($key);\n }\n\n // Cache-miss\n $resource = $this->getImageResource();\n if ($resource) {\n $result = $this->getResourceDimensions($resource);\n $cache->set($key, $result);\n }\n return $result;\n }", "public function getDimensions()\n {\n if(!$this->getData('dimensions')) {\n $this->setData('dimensions', $this->_getResource()->getDimensions($this));\n }\n return $this->getData('dimensions');\n }", "public function getDimensions() {}", "public function getDimensions();", "public function getDimensions();", "public function dimensions() {\n\t\treturn $this->_cache(__FUNCTION__, function($file) {\n\t\t\t$dims = null;\n\n\t\t\tif (!$file->isImage()) {\n\t\t\t\treturn $dims;\n\t\t\t}\n\n\t\t\t$data = @getimagesize($file->path());\n\n\t\t\tif ($data && is_array($data)) {\n\t\t\t\t$dims = array(\n\t\t\t\t\t'width' => $data[0],\n\t\t\t\t\t'height' => $data[1]\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (!$data) {\n\t\t\t\t$image = @imagecreatefromstring(file_get_contents($file->path()));\n\t\t\t\t$dims = array(\n\t\t\t\t\t'width' => @imagesx($image),\n\t\t\t\t\t'height' => @imagesy($image)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $dims;\n\t\t});\n\t}", "public function getDimensions() {\n\t\treturn array('width' => $this->getImageWidth(),'height' =>$this->getImageHeight());\t\n\t}", "public function getDimensions()\n {\n return $this->dimensions;\n }", "public function getDimensions(){\n\t\treturn array('width' => $this->_width, 'height' => $this->_height);\n\t}", "public function getImageDimension(): ImageDimensionInterface\n {\n if (! $this->hasImage()) {\n throw new Exception('调用的资源并非图片或者是不支持的图片资源');\n } elseif ($this->dimension instanceof ImageDimensionInterface) {\n return $this->dimension;\n }\n\n $realPath = $this->filesystem->path(\n $this->resource->getPath()\n );\n [$width, $height] = getimagesize($realPath);\n\n return $this->dimension = new ImageDimension((float) $width, (float) $height);\n }", "public function getImageDimension(): ImageDimensionInterface;", "public function getDimensions()\n\t{\n\t\treturn $this->dimensions;\n\t}", "public function getDimensions() {\n\t\treturn $this->dimensions->toArray();\n\t}", "public function getImageDimensions()\n {\n $dimension = $this->_getSetting('dimension');\n if ($this->getRow()->use_crop) {\n $parentDimension = $this->_getImageEnlargeComponent()->getImageDimensions();\n $dimension['crop'] = $parentDimension['crop'];\n }\n $data = $this->getImageData();\n return Kwf_Media_Image::calculateScaleDimensions($data['file'], $dimension);\n }", "public function findAllAvailableDimensions()\n {\n $query = $this->getEntityManager()->createQuery('SELECT c.width, c.height FROM AppBundle\\Entity\\Contentunit c');\n\n return $query->getArrayResult();\n }", "function image_dimensions ( $image_path ) {\r\n\t\t$image = image_read($image_path,false);\r\n\t\tif ( !$image ) return $image;\r\n\t\t$width = imagesx($image);\r\n\t\t$height = imagesy($image);\r\n\t\t$dimensions = compact('width','height');\r\n\t\treturn $dimensions;\r\n\t}", "function wp_image_src_get_dimensions($image_src, $image_meta, $attachment_id = 0)\n {\n }", "public function getDimensionsString()\n {\n $size = $this->getImageSize();\n\n return $size[3];\n }", "public function get_dimensions( $project_id ) {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects/' . abs( intval( $project_id ) ) . '/dimensions/',\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function getDimensions(): array\n\t{\n\t\treturn $this->processor->getDimensions();\n\t}", "public function getImageSize(FlowResource $resource) {\n\t\t$cacheIdentifier = $resource->getCacheEntryIdentifier();\n\n\t\t$imageSize = $this->imageSizeCache->get($cacheIdentifier);\n\t\tif ($imageSize !== FALSE) {\n\t\t\treturn $imageSize;\n\t\t}\n\n\t\t// TODO: Special handling for SVG should be refactored at a later point.\n\t\tif ($resource->getMediaType() === 'image/svg+xml') {\n\t\t\t$imageSize = ['width' => NULL, 'height' => NULL];\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t$imagineImage = $this->imagineService->read($resource->getStream());\n\t\t\t\t$sizeBox = $imagineImage->getSize();\n\t\t\t\t$imageSize = array('width' => $sizeBox->getWidth(), 'height' => $sizeBox->getHeight());\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\tthrow new ImageFileException(sprintf('The given resource was not an image file your choosen driver can open. The original error was: %s', $e->getMessage()), 1336662898);\n\t\t\t}\n\t\t}\n\n\t\t$this->imageSizeCache->set($cacheIdentifier, $imageSize);\n\t\treturn $imageSize;\n\t}", "public function getImageSize()\n\t{\n\t\tlist($width, $height) = getimagesize($this->getFullpath());\n\n\t\treturn compact('width', 'height');\n\t}", "public function getDimensions() {\n return array(\n array(20, 10, 14, 10),\n array(100, 1000, 100, 70),\n array(1000, 1000, 665, 463),\n );\n }", "public function getDimensions()\n {\n $imageDimension = getimagesize($this->image);\n\n $width = $imageDimension[0];\n $height = $imageDimension[1];\n\n foreach($this->effect as $effect)\n {\n if($effect instanceof PictureEffect)\n {\n $modified = $effect->getNewDimensions($width, $height);\n\n $width = $modified['w'];\n $height = $modified['h'];\n }\n }\n\n return array(\n 'w' => $width,\n 'h' => $height,\n );\n }", "function gttn_tpps_xlsx_get_dimension($location) {\n $reader = new XMLReader();\n $reader->open($location);\n while ($reader->read()) {\n if ($reader->nodeType == XMLReader::ELEMENT and $reader->name == 'dimension') {\n $dim = $reader->getAttribute('ref');\n $reader->close();\n return $dim;\n }\n }\n return NULL;\n}", "function calculateThumbnailDimensions($dimensions, $arguments) {\r\n if (array_key_exists('thumbnail_dimensions', $arguments))\r\n return [\r\n 'height' => intval($arguments['thumbnail_dimensions']['height']),\r\n 'width' => intval($arguments['thumbnail_dimensions']['width']),\r\n 'crop' => '1'\r\n ];\r\n \r\n return null;\r\n }", "function legion_get_dimensions( $svg ) {\n\t// If that happens, we will just go back to not knowing the dimensions,\n\t// rather than breaking the site.\n\t$fail = (object) array( 'width' => 0, 'height' => 0 );\n\n\t// Welp, nothing we can do here...\n\tif ( ! function_exists( 'simplexml_load_file' ) ) {\n\t\treturn $fail;\n\t}\n\n\t$svg = simplexml_load_file( $svg );\n\t$attributes = $svg ? $svg->attributes() : false;\n\n\t// Probably an invalid XML file?\n\tif( ! $attributes ) {\n\t\treturn $fail;\n\t}\n\n\t$width = (string) $attributes->width;\n\t$height = (string) $attributes->height;\n\n\treturn (object) array( 'width' => $width, 'height' => $height );\n}", "function getDimension()\n {\n return $this->m_dimension;\n }", "public function getParcelDimensions()\n {\n $height = \\Configuration::get(self::SIZE_TYPE_FIXED_SIZE_X);\n $length = \\Configuration::get(self::SIZE_TYPE_FIXED_SIZE_Y);\n $width = \\Configuration::get(self::SIZE_TYPE_FIXED_SIZE_Z);\n $weight = \\Configuration::get(self::SIZE_TYPE_FIXED_SIZE_WEIGHT);\n\n $dimensions = array(\n \"height\" => $height,\n \"length\" => $length,\n \"width\" => $width,\n \"weight\" => $weight\n );\n\n return $dimensions;\n }", "function get_dimension_info($dim,$dimension_unit)\n {\n return array(\n 'length'=> array('cm'=>length_convert($dim[0],$dimension_unit,'cm'), \n 'in'=>length_convert($dim[0],$dimension_unit,'in'),\n 'ft'=>length_convert($dim[0],$dimension_unit,'ft') ), \n 'width'=> array('cm'=>length_convert($dim[1],$dimension_unit,'cm'), \n 'in'=>length_convert($dim[1],$dimension_unit,'in'),\n 'ft'=>length_convert($dim[1],$dimension_unit,'ft') ), \n 'height'=> array('cm'=>length_convert($dim[2],$dimension_unit,'cm'), \n 'in'=>length_convert($dim[2],$dimension_unit,'in'),\n 'ft'=>length_convert($dim[2],$dimension_unit,'ft') ) \n ); \n }", "protected function getDimensions(): array\n {\n $args = $this->fit;\n $res = [];\n\n if (empty($args) || sizeof($args) < 2) {\n return [];\n }\n\n foreach ($args as $arg) {\n $res[] = (int) $arg;\n }\n\n return $res;\n }", "protected function sizeAsset(AssetRepresentation $asset): array\n {\n // The storage adapter should be checked for external storage.\n $storagePath = $this->getStoragePath('asset', $asset->filename());\n $filepath = $this->basePath . DIRECTORY_SEPARATOR . $storagePath;\n return file_exists($filepath)\n ? $this->getWidthAndHeightLocal($filepath)\n : $this->getWidthAndHeightUrl($asset->assetUrl());\n }", "function guy_imagedims($src) {\n\tif (substr($src,0,1)=='/') $src = \nsubstr_replace($src,$_SERVER['DOCUMENT_ROOT'].'/',0,1);\n\tif (is_file($src)) {\n\t\t$wh = @GetImageSize($src);\n\t\treturn $wh[3];\n\t}\n\treturn '';\n}", "protected function getDimensions($type, $size)\n {\n $size = $this->getSize($type, $size);\n\n return $size['size'];\n }", "function get_image_size_dimensions($size) {\n\t\tglobal $_wp_additional_image_sizes;\n\t\tif (isset($_wp_additional_image_sizes[$size])) {\n\t\t\t$width = intval($_wp_additional_image_sizes[$size]['width']);\n\t\t\t$height = intval($_wp_additional_image_sizes[$size]['height']);\n\t\t} else {\n\t\t\t$width = get_option($size.'_size_w');\n\t\t\t$height = get_option($size.'_size_h');\n\t\t}\n\n\t\tif ( $width && $height ) {\n\t\t\treturn array(\n\t\t\t\t'width' => $width,\n\t\t\t\t'height' => $height\n\t\t\t);\n\t\t} else return false;\n\t}", "function yz_attachments_get_cover_image_dimensions( $wh ) {\n return array( 'width' => 1350, 'height' => 350 );\n}", "public function getDim() {\n\t\treturn $this->dim;\n\t}", "public function getResolution();", "public static function get_sizes()\n {\n }", "protected function getResources()\n\t{\n\t\treturn $this->arguments->getArgument(static::$RESOURCES_ARGUMENT_NAME)->getValue();\n\t}", "public function size()\n { \n $props = $this->uri->ruri_to_assoc();\n\n if (!isset($props['o'])) exit(0);\n $w = -1;\n $h = -1;\n $m = 0;\n if (isset($props['w'])) $w = $props['w'];\n if (isset($props['h'])) $h = $props['h'];\n if (isset($props['m'])) $m = $props['m'];\n\n $this->img->set_img($props['o']);\n $this->img->set_size($w, $h, $m);\n $this->img->set_square($m);\n $this->img->get_img();\n }", "public function get_dim()\n {\n return $this->dim;\n }", "public static function get_image_dimensions($size)\n {\n global $_wp_additional_image_sizes;\n $sizes = [];\n foreach (get_intermediate_image_sizes() as $_size) {\n if (in_array($_size, ['thumbnail', 'medium', 'medium_large', 'large'])) {\n $sizes[$_size]['width'] = get_option(\"{$_size}_size_w\");\n $sizes[$_size]['height'] = get_option(\"{$_size}_size_h\");\n $sizes[$_size]['crop'] = get_option(\"{$_size}_crop\");\n } elseif (isset($_wp_additional_image_sizes[$_size])) {\n $sizes[$_size] = [\n 'width' => $_wp_additional_image_sizes[$_size]['width'],\n 'height' => $_wp_additional_image_sizes[$_size]['height'],\n 'crop' => $_wp_additional_image_sizes[$_size]['crop'],\n ];\n }\n }\n if (isset($sizes[$size])) {\n return $sizes[$size];\n }\n return null;\n }", "function acf_get_image_sizes()\n{\n}", "public function getFrom($resource);", "function rest_get_avatar_sizes()\n {\n }", "protected static function get_dimensions($svg_path)\n {\n $width = $height = 0;\n $svg = simplexml_load_file($svg_path, 'SimpleXMLElement', LIBXML_NOWARNING);\n if ($svg) {\n $attributes = $svg->attributes();\n $width = (string)$attributes->width;\n $height = (string)$attributes->height;\n }\n return (object)compact('width', 'height');\n }", "function getpropsize($width, $height, $max)\n{\n\tif ($width <= $max and $height <= $max)\n\t\treturn array($width, $height);\n\t\t\n\t$lager = ($width > $height) ? $width : $height; // сторона, которая длиннее\n\t\n\t$k = $lager / $max; // во сколько раз уменьшить\n\n\t$w = @round($width / $k); // 1%\n\t$h = @round($height / $k); // 1%\n\n\treturn array($w, $h);\n}", "public function getResource($resourceId);", "public static function getResolutions(){\n\t\t\t$result = ScreenResolution::select('screen_size_id', DB::raw('CONCAT( width, \"x\", height ) AS resolution') )\n\t\t\t\t\t\t\t\t\t ->where('status', '=', 1)\n\t\t\t\t\t\t\t\t\t ->get();\n\t\t\treturn $result;\n\t\t}", "public function getSize() {\n return array(\"x\" => imagesx($this->current), \"y\" => imagesy($this->current));\n }", "private function getDimensions($newWidth, $newHeight, $option)\n\t{\n\t\t// Default: auto\n\t\tswitch ($option) {\n\t\t\tcase 'exact':\n\t\t\t\t$optimalWidth = $newWidth;\n\t\t\t\t$optimalHeight = $newHeight;\n\t\t\t\tbreak;\n\t\t\tcase 'portrait':\n\t\t\t\t$optimalWidth = $this->getSizeByFixedHeight($newHeight);\n\t\t\t\t$optimalHeight = $newHeight;\n\t\t\t\tbreak;\n\t\t\tcase 'landscape':\n\t\t\t\t$optimalWidth = $newWidth;\n\t\t\t\t$optimalHeight = $this->getSizeByFixedWidth($newWidth);\n\t\t\t\tbreak;\n\t\t\tcase 'crop':\n\t\t\t\t$optionArray = $this->getOptimalCrop($newWidth, $newHeight);\n\t\t\t\t$optimalWidth = $optionArray['optimalWidth'];\n\t\t\t\t$optimalHeight = $optionArray['optimalHeight'];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$optionArray = $this->getSizeByAuto($newWidth, $newHeight);\n\t\t\t\t$optimalWidth = $optionArray['optimalWidth'];\n\t\t\t\t$optimalHeight = $optionArray['optimalHeight'];\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight);\n\t}", "public function get_dimension( $dimension_id ) {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'dimensions/' . abs( intval( $dimension_id ) ),\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function get_resource();", "public function testDimensionsValidation(): void\n {\n $builder = new ValidationBuilder();\n $builder->validate(\"avatar\", function (Field $field): void {\n $field->dimensions(function(Dimensions $dimensions): void {\n $dimensions->ratio(3/2)->width(100);\n });\n });\n\n $rules = $builder->getRules();\n\n $this->assertCount(1, $rules);\n $this->assertEquals([\"dimensions:ratio=1.5,width=100\"], $rules[\"avatar\"]);\n }", "public final function get_header_dimensions($dimensions)\n {\n }", "function get_pdf_dimensions($path, $box=\"TrimBox\") {\n\n $stream = new SplFileObject($path); \n \n $result = false;\n\n while (!$stream->eof()) {\n \n if (preg_match(\"/\".$box.\"\\[[0-9]{1,}.[0-9]{1,} [0-9]{1,}.[0-9]{1,} ([0-9]{1,}.[0-9]{1,}) ([0-9]{1,}.[0-9]{1,})\\]/\", $stream->fgets(), $matches)) {\n $result[\"width\"] = $matches[1];\n $result[\"height\"] = $matches[2]; \n break;\n }\n }\n\n $stream = null;\n\n return $result;\n}", "public function get_dimensions( $args ) {\n\t\t\tif (\n\t\t\t\tempty( $args['height'] )\n\t\t\t\t&& empty( $args['width'] )\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// We are only going to use the size if none are defined in the transform, which shouldn't happen.\n\t\t\tif ( isset( $args['crop'] ) && false === $args['crop'] ) {\n\t\t\t\t$h = 100;\n\t\t\t} else {\n\t\t\t\t$h = $args['height'] . 'px';\n\t\t\t}\n\n\t\t\treturn array(\n\t\t\t\t'width' => $args['width'],\n\t\t\t\t'height' => $h,\n\t\t\t);\n\t\t}", "function getDimensions()\n {\n $dimensions = array();\n foreach($this->m_childs as $abstractFrame)\n {\n $dimensions[] = $abstractFrame->getDimension();\n }\n return implode(\", \", $dimensions);\n }", "public function dim()\n {\n return $this->dim;\n }", "function elk_getimagesize($file, $error = 'array')\n{\n\t$sizes = @getimagesize($file);\n\n\t// Can't get it, what shall we return\n\tif (empty($sizes))\n\t{\n\t\t$sizes = $error === 'array' ? array(-1, -1, -1) : false;\n\t}\n\n\treturn $sizes;\n}", "function width_height($imgurl){\n\n $data = getimagesize( $imgurl );\n $width = $data[0];\n $height = $data[1];\n\n echo 'width=\"'.$width.'\" height=\"'.$height.'\"';\n}", "public function getLinkImageDimensions()\n {\n // Initialise:\n \n $data = [];\n \n // Obtain Dimensions:\n \n $widths = $this->dbObject('LinkImageWidth');\n $heights = $this->dbObject('LinkImageHeight');\n \n // Iterate Width Viewports:\n \n foreach ($widths->getViewports() as $viewport) {\n \n if ($value = $widths->getField($viewport)) {\n $data[$viewport]['Width'] = $value;\n $data[$viewport]['Breakpoint'] = $widths->getBreakpoint($viewport);\n }\n \n }\n \n // Iterate Height Viewports:\n \n foreach ($heights->getViewports() as $viewport) {\n \n if ($value = $heights->getField($viewport)) {\n $data[$viewport]['Height'] = $value;\n $data[$viewport]['Breakpoint'] = $heights->getBreakpoint($viewport);\n }\n \n }\n \n // Create Items List:\n \n $items = ArrayList::create();\n \n // Create Data Items:\n \n foreach ($data as $item) {\n $items->push(ArrayData::create($item));\n }\n \n // Answer Items List:\n \n return $items;\n }", "protected function svgs_get_dimensions( $svg ) {\n\t\t$svg = simplexml_load_file( $svg );\n\t\t$width = '0';\n\t\t$height = '0';\n\n\t\tif ( false !== $svg ) {\n\t\t\t$attributes = $svg->attributes();\n\t\t\tif ( isset( $attributes->viewBox ) ) {\n\t\t\t\t$viewbox = explode( ' ', $attributes->viewBox );\n\t\t\t\t$width = $viewbox[2];\n\t\t\t\t$height = $viewbox[3];\n\t\t\t} elseif ( $attributes->width && $attributes->height ) {\n\t\t\t\t$width = (string) $attributes->width;\n\t\t\t\t$height = (string) $attributes->height;\n\t\t\t}\n\t\t}\n\n\t\treturn (object) array(\n\t\t\t'width' => $width,\n\t\t\t'height' => $height,\n\t\t);\n\t}", "public function dimensions(): int\n {\n return -1;\n }", "function getImageSize() \n { \n return array($this->_width,$this->_height); \n }", "private function retrieveImageInfo() {\n $prepare = $this->database->prepare(\"\n SELECT image_height, image_width\n FROM manuscripts\n WHERE collection = :collection\n AND pointer = :pointer\n LIMIT 1\n \");\n\n $prepare->execute(array(\n \":collection\" => $this->collection,\n \":pointer\" => $this->pointer\n ));\n\n return $prepare->fetch(PDO::FETCH_ASSOC);\n }", "private function get_image_sizes() {\n\n\t\treturn array(\n\t\t\t'square_medium' => array( 200, 200 ),\n\t\t\t'full' => array( 1200, 1200 ),\n\t\t);\n\n\t}", "public function resize(array $dimensions) {\n// is there an image resource to work with?\n if (isset($this->_resource)) {\n// does the dimensions array have the appropriate values to work with?\n if (isset($dimensions[\"width\"]) || isset($dimensions[\"height\"])) {\n// has the width value been omitted, while the height value given?\n if (!isset($dimensions[\"width\"]) && isset($dimensions[\"height\"])) {\n// is the height an integer?\n// -> if so, assign the height variable and assign the width variable scaled similarly to the height\n if (is_int($dimensions[\"height\"])) {\n $width = (int) floor($this->_width * ($dimensions[\"height\"] / $this->_height));\n $height = $dimensions[\"height\"];\n }\n }\n// or has the height value been omitted, and the width value given?\n else if (isset($dimensions[\"width\"]) && !isset($dimensions[\"height\"])) {\n// is the width an integer?\n// -> if so, assign the width variable and assign the height variable scaled similarly to the width\n if (is_int($dimensions[\"width\"])) {\n $width = $dimensions[\"width\"];\n $height = (int) floor($this->_height * ($dimensions[\"width\"] / $this->_width));\n }\n }\n// or both values were provided\n else {\n// are both width and height values integers?\n// -> if so, assign the width and height variables\n if (is_int($dimensions[\"width\"]) && is_int($dimensions[\"height\"])) {\n $width = $dimensions[\"width\"];\n $height = $dimensions[\"height\"];\n }\n }\n\n// have the width and height variables been assigned?\n// -> if so, proceed with cropping\n if (isset($width, $height)) {\n// generating the placeholder resource\n $resized_image = $this->newImageResource($width, $height);\n\n// copying the original image's resource into the placeholder and resizing it accordingly\n imagecopyresampled($resized_image, $this->_resource, 0, 0, 0, 0, $width, $height, $this->_width, $this->_height);\n\n// assigning the new image attributes\n $this->_resource = $resized_image;\n $this->_width = $width;\n $this->_height = $height;\n }\n } else {\n trigger_error(\"CAMEMISResizeImage::resize() was not provided the apporpriate arguments (given array must contain \\\"width\\\" and \\\"height\\\" elements)\", E_USER_WARNING);\n }\n } else {\n trigger_error(\"CAMEMISResizeImage::resize() attempting to access a non-existent resource (check if the image was loaded by Image2::__construct())\", E_USER_WARNING);\n }\n\n return $this;\n }", "private function _getResizeSize() {\n\t\t$width = $height = 0;\n\n\t\tif (Configure::check('GalleryOptions.Pictures.resize_to.0')) {\n\t\t\t$width = Configure::read('GalleryOptions.Pictures.resize_to.0');\n\t\t}\n\n\t\tif (Configure::check('GalleryOptions.Pictures.resize_to.1')) {\n\t\t\t$height = Configure::read('GalleryOptions.Pictures.resize_to.1');\n\t\t}\n\n\t\t$crop = Configure::read('GalleryOptions.Pictures.resize_to.2');\n\t\t$action = $crop ? \"crop\" : \"\";\n\n\t\treturn array(\n\t\t\t'width' => $width,\n\t\t\t'height' => $height,\n\t\t\t'action' => $action\n\t\t);\n\t}", "public function getPackageDimensions()\n {\n return $this->packageDimensions;\n }", "public function getDimensionsHash() {\n\t\treturn $this->dimensionsHash;\n\t}", "public function getSize(): int\n {\n return $this->filesystem->getSize(\n $this->resource->getPath()\n );\n }", "public function getScaling() {}", "protected function getResourceEntity()\n\t{\n\t\treturn $this->arguments->getArgument(static::$RESOURCE_ARGUMENT_NAME)->getValue();\n\t}", "public function get_dimensions($video) {\n $ffmpeg_output = $this->get_video_info($video);\n $res = array('width' => 0, 'height' => 0);\n // Get dimensions\n $regex = ereg('[0-9]?[0-9][0-9][0-9]x[0-9][0-9][0-9][0-9]?', $ffmpeg_output, $regs);\n if (isset($regs[0])) {\n $dimensions = explode(\"x\", $regs[0]);\n $res['width'] = $dimensions[0] ? $dimensions[0] : NULL;\n $res['height'] = $dimensions[1] ? $dimensions[1] : NULL;\n }\n return $res;\n }", "public function getCustomDimensions()\r\n\t{\r\n\t\t$dimensions = array\r\n\t\t(\r\n\t\t\t'pageType' => $this->getPageType()\r\n\t\t);\r\n\t\t\r\n\t\t/**\r\n\t\t * Array of callbacks adding dimensions\r\n\t\t */\r\n\t\tforeach (array\r\n\t\t(\r\n\t\t\tfunction ($dimensions)\r\n\t\t\t{\r\n\t\t\t\t$dimensions['pageName'] = Mage::helper('ec')->getSanitized\r\n\t\t\t\t(\r\n\t\t\t\t\tMage::app()->getLayout()->getBlock('head')->getTitle()\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\treturn $dimensions;\r\n\t\t\t},\r\n\t\t\tfunction ($dimensions)\r\n\t\t\t{\r\n\t\t\t\tif(Mage::app()->getRequest()->getControllerName() == 'result' || Mage::app()->getRequest()->getControllerName() == 'advanced')\r\n\t\t\t\t{\r\n\t\t\t\t\tif (Mage::app()->getLayout()->getBlock('search_result_list'))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$dimensions['resultsCount'] = Mage::app()->getLayout()->getBlock('search_result_list')->getLoadedProductCollection()->getSize();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn $dimensions;\r\n\t\t\t},\r\n\t\t\tfunction ($dimensions)\r\n\t\t\t{\r\n\t\t\t\t/**\r\n\t\t\t\t * Check if category page\r\n\t\t\t\t */\r\n\t\t\t\tif('catalog' == Mage::app()->getRequest()->getModuleName() && 'category' == Mage::app()->getRequest()->getControllerName())\r\n\t\t\t\t{\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * Get applied layer filter(s)\r\n\t\t\t\t\t */\r\n\t\t\t\t\t$filters = array();\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach ((array) Mage::getSingleton('catalog/layer')->getState()->getFilters() as $filter)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$filters[] = array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t'label' => Mage::helper('ec')->getSanitized($filter->getName()),\r\n\t\t\t\t\t\t\t'value' => Mage::helper('ec')->getSanitized($filter->getLabel())\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$dimensions['filters'] = $filters;\r\n\t\t\t\t\t\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * Count visible products\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (Mage::app()->getLayout()->getBlock('product_list') && $filters)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$dimensions['resultsCount'] = Mage::helper('ec/datalayer')->getLoadedProductCollection()->getSize();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn $dimensions;\t\r\n\t\t\t}, \r\n\t\t\tfunction ($dimensions)\r\n\t\t\t{\r\n\t\t\t\tif (Mage::getSingleton(\"customer/session\")->isLoggedIn())\r\n\t\t\t\t{\r\n\t\t\t\t\t$dimensions['avgTransVal'] = Mage::helper('ec')->getVisitorAvgTransValue();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn $dimensions;\r\n\t\t\t}\r\n\t\t) as $dimension)\r\n\t\t{\r\n\t\t\t$dimensions = (array) call_user_func($dimension, $dimensions);\r\n\t\t}\r\n\r\n\t\treturn json_encode($dimensions);\r\n\t}", "protected function getPricingDimensions()\n {\n return $this->pricingDimensions;\n }", "function photos_getSizes ($photo_id) {\n\t\t$response = $this->execute(array('method' => 'flickr.photos.getSizes', 'photo_id' => $photo_id));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['sizes']['size'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function size( $axis = NULL )\n\t{\n\t\tif( !strcasecmp( $axis, 'W' ) )\n\t\t\treturn imageSX( $this->im );\n\t\telseif( !strcasecmp( $axis, 'H' ) )\n\t\t\treturn imageSY( $this->im );\n\t\telse\n\t\t\treturn (object)array( 'w' => imageSX( $this->im ), 'h' => imageSY( $this->im ) );\n\t}", "function getDimensiones() {\n return $this->dimensiones;\n }", "public function getDimensions()\n {\n return array_keys($this->compositeDatabaseFields());\n }", "public static function parse_dimensions_from_filename( $src ) {\n\t\t$width_height_string = [];\n\n\t\tif ( preg_match( '#-(\\d+)x(\\d+)\\.(?:' . implode( '|', self::$extensions ) . '){1}$#i', $src, $width_height_string ) ) {\n\t\t\t$width = (int) $width_height_string[1];\n\t\t\t$height = (int) $width_height_string[2];\n\n\t\t\tif ( $width && $height ) {\n\t\t\t\treturn [ $width, $height ];\n\t\t\t}\n\t\t}\n\n\t\treturn [ false, false ];\n\t}", "public function refreshDimensions()\n {\n if ('\\\\' === DIRECTORY_SEPARATOR) {\n if (preg_match('/^(\\d+)x(\\d+)(?: \\((\\d+)x(\\d+)\\))?$/', trim(getenv('ANSICON')), $matches)) {\n // extract [w, H] from \"wxh (WxH)\"\n // or [w, h] from \"wxh\"\n $this->width = (int) $matches[1];\n $this->height = isset($matches[4]) ? (int) $matches[4] : (int) $matches[2];\n } elseif (null !== $dimensions = $this->getConsoleMode()) {\n // extract [w, h] from \"wxh\"\n $this->width = (int) $dimensions[0];\n $this->height = (int) $dimensions[1];\n }\n } elseif ($sttyString = $this->getSttyColumns()) {\n if (preg_match('/rows.(\\d+);.columns.(\\d+);/i', $sttyString, $matches)) {\n // extract [w, h] from \"rows h; columns w;\"\n $this->width = (int) $matches[2];\n $this->height = (int) $matches[1];\n } elseif (preg_match('/;.(\\d+).rows;.(\\d+).columns/i', $sttyString, $matches)) {\n // extract [w, h] from \"; h rows; w columns\"\n $this->width = (int) $matches[2];\n $this->height = (int) $matches[1];\n }\n }\n $this->initialised = true;\n }", "public function getSizes()\n {\n return $this->sizes;\n }", "function getimagesize($filename){\n\t\treturn we_thumbnail::getimagesize($filename);\n\t}", "function getSize() ;", "protected function _dimensions($path, $mime) {\r\n\t\t$ret = false;\r\n\t\tif ($imgsize = $this->getImageSize($path, $mime)) {\r\n\t\t\t$ret = $imgsize['dimensions'];\r\n\t\t}\r\n\t\treturn $ret;\r\n\t}", "function getPhotoSizes($photo_id){ // No Secret Required\n\n\t\t/* Get Photo Size */\n\t\t$photoSizes = $this->askFlickr('photos.getSizes','&photo_id='.$photo_id);\n\n\t\t/* Return Photo Sizes */\n\t\treturn $photoSizes;\n\t}", "public function calculateMediaWidthsAndHeightsDataProvider() {}", "public function getSizes(){\n return (array) $this->getAttr('size');\n }", "private function getWorkingImageWidth()\n {\n return imagesx($this->workingImageResource);\n }", "protected function getResourceLength(): int\n {\n if (null === $this->fileName) {\n return parent::getResourceLength();\n }\n\n if (substr($this->fileName, 0, 16) === 'compress.zlib://') {\n return filesize(substr($this->fileName, 16));\n } elseif (substr($this->fileName, 0, 17) === 'compress.bzip2://') {\n return filesize(substr($this->fileName, 17));\n }\n\n return parent::getResourceLength();\n }", "public static function width($res)\n {\n return imagesx($res);\n }", "public function getDestanationDimensions()\n {\n if(!$this->getData('destanation_dimensions')) {\n $this->setData('destanation_dimensions', clone $this->getDimensions());\n }\n\n return $this->getData('destanation_dimensions');\n }", "public function getThumbnailSize() {\n\t\treturn $this->getQueryParam ( self::THUMB_SIZE_PARAM );\n\t}", "public function width() {\n\t\treturn $this->_cache(__FUNCTION__, function($file) {\n\t\t\tif (!$file->isImage()) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t$width = 0;\n\n\t\t\tif ($dims = $file->dimensions()) {\n\t\t\t\t$width = $dims['width'];\n\t\t\t}\n\n\t\t\treturn $width;\n\t\t});\n\t}", "public static function dimension_from_string($size)\n\t{\n\t\tif (strpos($size, 'x'))\n\t\t{\n\t\t\t$tmp = explode('x', $size);\n\t\t\t$width = $tmp[0];\n\t\t\t$height = $tmp[1];\n\t\t}\n\t\telse\n\t\t\t$width = $height = $size;\n\n\t\treturn array('width'=>trim($width), 'height'=>trim($height));\n\t}", "public function getWidth()\n {\n if (!isset($this->width)) {\n $this->width = ps_get_value($this->document->resource, \"imagewidth\", $this->id);\n }\n\n return $this->width;\n }", "function get_udims($width, $height)\n {\n }" ]
[ "0.7257647", "0.6941101", "0.6867788", "0.6799203", "0.6799203", "0.65367496", "0.6470272", "0.637269", "0.6363442", "0.63431126", "0.63061464", "0.62931883", "0.6199035", "0.61546206", "0.61029106", "0.6037696", "0.6032481", "0.59951085", "0.5990251", "0.596798", "0.5874682", "0.58681923", "0.5817921", "0.57762706", "0.57277423", "0.5703505", "0.56761026", "0.56094956", "0.55354637", "0.5523948", "0.55232334", "0.5496927", "0.54655105", "0.5459004", "0.5433424", "0.5414999", "0.541369", "0.5395662", "0.53582275", "0.53537244", "0.5342012", "0.53369737", "0.53303933", "0.5310457", "0.530976", "0.5305997", "0.5287016", "0.5280989", "0.52712786", "0.52607304", "0.5259128", "0.5244086", "0.5241221", "0.5230943", "0.52291954", "0.5223969", "0.5223394", "0.52208513", "0.5219832", "0.5219349", "0.5215182", "0.5199186", "0.5195572", "0.5189279", "0.51781553", "0.51765853", "0.5173336", "0.51579934", "0.51573616", "0.5143917", "0.51431626", "0.51307195", "0.5111904", "0.5099786", "0.5097821", "0.50931853", "0.50897425", "0.5084767", "0.5074628", "0.5070658", "0.50645775", "0.5056668", "0.5055596", "0.50545985", "0.5032575", "0.50273514", "0.5022648", "0.5015736", "0.499831", "0.49982837", "0.4985892", "0.4977733", "0.49768603", "0.49758533", "0.49754125", "0.4971345", "0.49686423", "0.49667642", "0.49605596", "0.49590486" ]
0.6570042
5
Cache key for recording errors
protected function getErrorCacheKey($hash, $variant = null) { return self::CACHE_MARK . sha1($hash . '-' . $variant); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function errorCacheKey()\n {\n // Returns a new number every x minutes\n return (int)(time() / 60 / 3);\n }", "private function cacheKey()\n {\n return sprintf('contact-permissons-%s', $this->client->patientContactId);\n }", "public function getCacheKey()\n {\n return $this->cacheKey;\n }", "public function getCacheKey() {\n return $this->_cacheKey;\n }", "private function getCacheKey(): string\n {\n return $this->webserviceId.$this->cacheKey;\n }", "public function getCacheKey()\n {\n return $this->CacheKey;\n }", "public function cacheKey(): string {\n return self::CACHE_PREFIX . $this->id\n . ($this->revisionId ? '_r' . $this->revisionId : '');\n }", "protected function clearCacheOnError() {}", "protected function cacheKey() : string\n {\n return $this->cacheKey ?? $this->cacheKeyHash();\n }", "function acf_cache_key($key = '')\n{\n}", "public function setCacheKey(string $key): void;", "public function setErrorKey($name)\n\t{\n\t\treturn $this->setKey('errors', $name);\n\t}", "public function getCacheInvalidator();", "public function getCacheKey()\n {\n return md5($this->formId . ':' . implode(',', $this->fieldIds));\n }", "protected static function getCacheIdentifier() {}", "public function cacheKey() {\n $params = $this->getParameters();\n $ret = '';\n $this->make_cache_key($params, $ret);\n\n return md5($ret);\n }", "function apc_cache_get_logindex($key) {\n\treturn APC_CACHE_LOG_INDEX . \"-\" . $key;\n}", "public function makeCacheHash() {}", "public function failures($key)\n {\n return $this->cache->get($key, 0);\n }", "protected function defaultCacheKey() : string\n {\n throw new LogicException('The class ' . static::class . ' has no default cache key.');\n }", "protected function cacheKey()\n {\n return json_encode($this);\n }", "public function load_for_cache($key) {\n return $key.' has no value really.';\n }", "protected function getCacheKey()\r\n {\r\n if (null == $this->cacheKey) {\r\n $this->cacheKey = get_class($this)\r\n . $this->getParent()->getEnvironment()\r\n . $this->getHttpHost();\r\n }\r\n return $this->cacheKey;\r\n }", "protected function create_cache_key()\n\t{\n\t\treturn hash($this->config['hash'], serialize($this->options));\n\t}", "protected function regenerateKeyCache()\n {\n if(is_array($this->__data))\n {\n $i=0;\n $this->__keycache = array();\n $this->__keycacheindex = array();\n foreach($this->__data as $key => $value)\n {\n $this->__keycache[$key] = $i;\n $this->__keycacheindex[$i] = $key;\n $i++;\n }\n }\n else\n {\n $this->__keycache = null;\n $this->__keycacheindex = null;\n }\n\n $this->__keycacheinvalid = false;\n }", "protected function cacheKey()\n {\n return md5($this->gridField->Link());\n }", "public function incrementError() {\n\t\tapc_add($this->prefix.'error', 0);\n\t\tapc_inc($this->prefix.'error', 1);\n\t}", "function checkKeys()\n{\n $cache = Cache::get()->first();\n\n if (!$cache) {\n $cache = new Cache();\n refreshKeys($cache);\n }\n else { \n if (time() > $cache->timeout){\n refreshKeys($cache);\n }\n }\n}", "protected function getModelconfigCacheKey(): string {\r\n if($this->schema && $this->table) {\r\n return get_class($this).'-'.$this->schema.'_'.$this->table;\r\n } else {\r\n throw new exception('EXCEPTION_MODELCONFIG_CACHE_KEY_MISSING_DATA', exception::$ERRORLEVEL_FATAL);\r\n }\r\n }", "function cacheKey( $key )\n\t{\n\t\treturn $key.\"_\".MANUFACTURER_ID.getFirstSubDomain();\n\t}", "public function getSessionKeyCache(){\n\t\tlog_message('error', 'library getSessionKeyCache');\n\t\t$redis_get = new CI_Redis();\n\t\t$value = $redis_get->get('SESSION_KEY');\n\t\tif(!empty($value))\n\t\t\treturn $value;\n\t\telse\n\t\t\treturn false;\n\t}", "function createKey(){\n\t$strKey = md5(microtime());\n\t\n\t//check to make sure this key isnt already in use\n\t$resCheck = mysql_query(\"SELECT count(*) FROM downloads WHERE downloadkey = '{$strKey}' LIMIT 1\");\n\t$arrCheck = mysql_fetch_assoc($resCheck);\n\tif($arrCheck['count(*)']){\n\t\t//key already in use\n\t\treturn createKey();\n\t}else{\n\t\t//key is OK\n\t\treturn $strKey;\n\t}\n}", "private function getCacheKey($url) {\n\t\treturn 'amo_api_' . md5($url);\n\t}", "function sitemap_cache_key() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n\n\treturn '';\n}", "public function key ()\n {\n return $this->valid() ? $this->cache[ $this->offset ][ 0 ] : NULL;\n }", "function saveCacheKey( $c_key, $c_key_group='' )\n\t{\n\t\t$CI =& get_instance();\n\t\n\t\t$CI->db->insert( \"pr_cache\", array( 'c_key'=>$c_key, 'c_key_group'=>$c_key_group));\n\t}", "private function genErrID()\n {\n return uniqid();\n }", "public function setCacheKey($var)\n {\n GPBUtil::checkString($var, True);\n $this->CacheKey = $var;\n\n return $this;\n }", "public function key() { return $this->_m_key; }", "function apc_cache_key_zero($key) {\n\t$old = 0;\n\t$n = 1;\n\t$old = apc_fetch($key);\n\tif($old == 0) {\n\t\treturn $old;\n\t}\n\twhile(!apc_cas($key, $old, 0)) {\n\t\tusleep(500);\n\t\t$n++;\n\t\t$old = apc_fetch($key);\n\t\tif($old == 0) {\n\t\t\tapc_cache_debug(\"key_zero: Key zeroed by someone else. Try $n. Key $key\");\n\t\t\treturn $old;\n\t\t}\n\t}\n\tif($n > 1) apc_cache_debug(\"key_zero: Key $key zeroed from $old after $n tries\");\n\treturn $old;\n}", "private function set_error( $key )\n\t{\n\t\tglobal $path;\n\t\tif( isset($this->err_code[$key]) && isset($this->err_code[$key]) )\n\t\t{\t\n\t\t\t$this->arr_error[].= $this->err_label[$key]; // => array_push\n\t\t\t// DEV -->\n\t\t\t$this->num_error += $this->err_code[$key];\n\t\t\t// <-- DEV\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttrigger_error( $key . ' undefined');\n\t\t\texit;\n\t\t}\n\t}", "public function getCacheValidityTag(): string;", "public function getCacheKeyInfo();", "private function addError($key, $err_message){\n $this->errors[$key] = $err_message;\n }", "public function cacheKeyHash() : string\n {\n return 'query|' .\n base64_encode(md5($this->builder->toSql() . implode('', $this->builder->getBindings()), true));\n }", "abstract public function cachedTime(string $key): ?int;", "public function visitedThreadCacheKey($thread)\n\t{\n\t\treturn sprintf(\"users.%s.visits.%s\", Auth::user()->id, $thread->id);\n\t}", "public function getValFromCache($key);", "protected function saveToCache() {}", "public function resetFailures($key)\n {\n return $this->cache->forget($key);\n }", "public function testIsValidKeyWithInvalidKey() \n {\n $result = $this->fileCache->isValidKey('');\n $expected = FALSE;\n\n $this->assertEquals($expected, $result);\n }", "public function resetAttemptsMade(string $key): void \n {\n $this->cache->deleteCacheFile($this->cleanKeyFromUnicodeCharacters($key));\n }", "public function it_should_correctly_handle_long_keys() {\n\t\t$components = [ __FILE__, [ 23, 89 ], [ 'foo' => 'bar', 'bar' => 'baz' ] ];\n\n\t\t$cache = $this->make_instance();\n\n\t\t$long_prefix = 'some very long prefix that should trigger some kind of minification on the key creation or so I hope';\n\t\t$key = $cache->make_key( $components, $long_prefix );\n\t\t$cache[ $key ] = 'bar';\n\n\t\t$this->assertTrue( isset( $cache[ $key ] ) );\n\t\t$this->assertEquals('bar',$cache[$key]);\n\t}", "public function isExistInCache($key);", "function _CacheFileName($key) {\n\t\t$FileName = $this->CacheDir . '/' . $this->_CleanKey($key);\n\n\t\treturn $FileName;\n\t}", "protected function GetCacheKey()\n\t{\n\t\treturn (isset($this->params['hashbase']) ? $this->params['hashbase'] : '') . '|' . (isset($this->params['hash']) ? $this->params['hash'] : '') . '|' . (isset($this->params['file']) ? sha1($this->params['file']) : '');\n\t}", "private function build_cache_key_for_url( $url ) {\n\t\treturn 'g_url_details_response_' . md5( $url );\n\t}", "private function addError( $key, $val ) {\r\n $this->errors[$key] = $val;\r\n }", "function cache_key(Repository $repo) {\n return \"ms_\" . md5($repo->user . $repo->name);\n}", "public function getConfigCacheKey() \n {\n return (string) $this->configCacheKey;\n }", "public function getCacheKey(Request $request): string;", "public function testCacheGet() \n\t{\n\t\t$key = uniqid('key_');\n\t\t$value = uniqid('value_');\n\t\t$this->assertFalse(\\Cache\\Cache::get($key));\n\n\t\t\\Cache\\Cache::set($key, $value);\n\t\t$this->assertEquals(\\Cache\\Cache::get($key), $value);\n\t}", "function invalidate_cache($key) {\n\tglobal $SYSTEM_SHOW_CACHE_METRICS, $TAG;\n\n\t$key = \"$TAG:$key\";\n\n\tif ( function_exists('apc_delete') ) {\n\t\tapc_delete($key);\n\t} else {\n\t\t$redis = conn_redis();\n\t\t$redis->del($key);\n\t}\n}", "public function getNewEntriesKey(): string;", "protected function calculateKey($id)\n\t{\n\t return self::CACHE_KEY_PREFIX.$id;\n\t}", "public function saveToCacheForever();", "public function setex($key, $value)\n\t{\n\t\treturn $this->memcache->add($key, $value);\n\t}", "function GetKey() { return( $this->key ); }", "protected static function cacheExsits($key)\n {\n \t$class = get_called_class();\n \treturn isset(BaseEntityAbstract::$_entityCache[$class]) && isset(BaseEntityAbstract::$_entityCache[$class][$key]);\n }", "protected function getCacheKey() {\n $plugin_id = hash('sha256', $this->getPluginId());\n $uri = $this->config('uri');\n\n return $plugin_id . ':' . $uri;\n }", "protected function _getRecordByKey($key)\n {\n }", "function SaeMemCache_set($openid,$data){\n\t$smc = memcache_init();\n\tif($smc == true){\n\t\tmemcache_set($smc,$openid,$data,60);\n\t\treturn \"Please enter Recording UserID:\";\n\t}else{\n\t\treturn \"MemCache is not ready!\";\n\t}\n}", "public function key($key) {\n $key = $this->_key($key);\n if (!$key) {\n throw new \\InvalidArgumentException('An empty value is not valid as a cache key');\n }\n return $this->prefix . $key;\n\n }", "public function set($key, $value) {\n if (@apc_store($key, array('time' => time(), 'data' => serialize($value)), Shindig_ConfigGet('cache_time')) == false) {\n throw new CacheException(\"Couldn't store data in cache\");\n }\n }", "private function get_cache( $key ) {\n\t\treturn get_site_transient( $key );\n\t}", "public function &cacheKey($function, $args = [], $___prop = 'cache')\n {\n $function = (string) $function;\n $args = (array) $args;\n\n if (!isset($this->{$___prop}[$function])) {\n $this->{$___prop}[$function] = null;\n }\n $cache_key = &$this->{$___prop}[$function];\n\n foreach ($args as $_arg) {\n // Use each arg as a key.\n\n switch (gettype($_arg)) {\n case 'integer':\n $_key = (int) $_arg;\n break; // Break switch handler.\n\n case 'double':\n case 'float':\n $_key = (string) $_arg;\n break; // Break switch handler.\n\n case 'boolean':\n $_key = (int) $_arg;\n break; // Break switch handler.\n\n case 'array':\n case 'object':\n $_key = sha1(serialize($_arg));\n break; // Break switch handler.\n\n case 'NULL':\n case 'resource':\n case 'unknown type':\n default:\n $_key = \"\\0\".(string) $_arg;\n }\n if (!isset($cache_key[$_key])) {\n $cache_key[$_key] = null;\n }\n $cache_key = &$cache_key[$_key];\n }\n\n return $cache_key;\n }", "function __get($key){\n if($this->_get($key)==TRUE) return $key; \n return $this->_err(array(1,$key));\n }", "function mgd_cache_invalidate()\n{\n}", "public function cache() {\n if(!array_key_exists($this->steamId64, self::$steamIds)) {\n self::$steamIds[$this->steamId64] = $this;\n if(!empty($this->customUrl) &&\n !array_key_exists($this->customUrl, self::$steamIds)) {\n self::$steamIds[$this->customUrl] = $this;\n }\n }\n }", "public function key()\n {\n return key($this->requests);\n }", "public static function pushError($key, $value) {\n $_SESSION['errors'][$key] = $value;\n }", "protected function calculateCacheKey()\n {\n if ($this->_cacheKey === null) {\n $key = [__CLASS__, Yii::$app->requestedRoute];\n if (is_array($this->variations)) {\n foreach ($this->variations as $value) {\n $key[] = $value;\n }\n }\n $this->_cacheKey = $key;\n }\n \n return $this->_cacheKey;\n }", "public function error($key, $value = null)\n {\n if (list($controller, $method) = self::origin(2)) {\n if (isset($key)) {\n if (isset($value)) {\n $_SESSION[$controller][$method]['failed'][$key] = $value;\n } else {\n $_SESSION[$controller][$method]['failed'] = $key;\n }\n }\n }\n }", "private function getCacheKey($storage_name){\n return $storage_name.'_'.$this->media_type.'_'.$this->media_id;\n }", "public static function getNewTrackingKey() {\n\t\n\t\t$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n\t\t\n\t\t// try up to 100 times to guess a unique key\n\t\tfor($i=0; $i<100; $i++) {\n\t\t\t$key = '';\n\t\t\tfor($j=0; $j<32; $j++)\t// generate a random 32 char alphanumeric string\n\t\t\t\t$key .= substr($chars,rand(0,strlen($chars)-1), 1);\n\t\t\n\t\t\tif(X2Model::model('Contacts')->exists('trackingKey=\"'.$key.'\"'))\t// check if this key is already used\n\t\t\t\tcontinue;\n\t\t\telse\n\t\t\t\treturn $key;\n\t\t}\n\t\treturn null;\n\t}", "abstract public function delete_cached( $key );", "private static function get ($key) {\n\t\t// Throw an exceptio if the vlaue hasn't been set\n\t\tif (isset(self::$_cache[$key]) && (empty(self::$_cache[$key]))) {\n\t\t\tthrow new Exception ($key.' needs to be set');\n\t\t}\n\t\tif (array_key_exists($key, self::$_cache)) {\n\t\t\treturn self::$_cache[$key];\n\t\t}\n\t\t// Return null by default to prevent __set from overloading\n\t\treturn null;\n\t}", "protected function get_cache_id() {\n\t\treturn wponion_hash_string( $this->module() . '_' . $this->unique() );\n\t}", "function internalError() {\n\t\t$this->status = $this->STATUS_INTERNAL_ERROR;\n\t\t$this->noCache();\n\t}", "function get($key) {\n\t\t\tglobal $__cachemem;\n\t\t\t$file = CACHE_DIR.md5($key).\".cache\";\n\t\t\tif($__cachemem[$key] != \"\") {\n\t\t\t\treturn $__cachemem[$key];\n\t\t\t}\n\t\t\tif(@file_exists($file)) {\n\t\t\t\t$dump = file_get_contents($file);\n\t\t\t\tdebugLog(\"Cache file gelesen\", \"Cache File wurde erfolgreich gelesen - KEY: '\".$key.\"'\",$file);\n\t\t\t\t$res = @unserialize($dump);\n\t\t\t\t$__cachemem[$key] = $res;\n\t\t\t\treturn $res;\n\t\t\t} else {\n\t\t\t\t//debugLog(\"Cache File fehler\",\"Cache file konnte nicht gefunden werden, expired?\",$file,UNKWN,DBUG_WARNING);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function getCacheKey($key)\r\n {\r\n\t\treturn self::CACHE_KEY_PREFIX .\r\n\t\t\tstrtolower($this->getName()) . '_' . $key;\r\n }", "private function setRateLimiterKey()\n {\n $this->rateLimiterKey = sha1($this->formRequestClass . request()->ip());\n }", "public static function getNewTrackingKey() {\n\n $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n\n // try up to 100 times to guess a unique key\n for ($i = 0; $i < 100; $i++) {\n $key = '';\n for ($j = 0; $j < 32; $j++) {// generate a random 32 char alphanumeric string\n $key .= substr($chars, rand(0, strlen($chars) - 1), 1);\n }\n\n // check if this key is already used\n if (X2Model::model('Contacts')->exists('trackingKey=\"' . $key . '\"')) {\n continue;\n } else {\n return $key;\n }\n }\n return null;\n }", "function get_cache($key) {\n return $this->get_cache_dir() . $key . '.cache';\n }", "abstract protected function cacheData();", "public function getCacheKeyInfo()\n {\n $cacheKeyInfo = parent::getCacheKeyInfo();\n $cacheKeyInfo['item_renders'] = $this->_serializeRenders();\n return $cacheKeyInfo;\n }", "function apc_cache_get_keyword_key($keyword) {\n\treturn APC_CACHE_KEYWORD_PREFIX . $keyword;\n}", "private function get_cache_id() {\n $handlername = get_class($this);\n if($this->id)\n $cache_id = '_cache_' . $handlername . '_' . $this->id;\n else \n $cache_id = '_cache_' . $handlername . '_all'; \n return $cache_id;\n\t}", "public function testIsValidKeyWithValidKey() \n {\n $key = 'key1';\n $result = $this->fileCache->isValidKey($key);\n $expected = TRUE;\n\n $this->assertEquals($expected, $result);\n }", "function key()\n\t{\n\t\tthrow new Exception('Accessing the key of an EmptyIterator');\n\t}" ]
[ "0.76409405", "0.647879", "0.63879037", "0.6336151", "0.6257586", "0.62017477", "0.61370665", "0.59960765", "0.5915032", "0.5831583", "0.57889944", "0.5785367", "0.5775781", "0.5760549", "0.57366824", "0.5709728", "0.5704724", "0.570445", "0.5675897", "0.5669169", "0.5641255", "0.56231105", "0.56118953", "0.5601103", "0.55981845", "0.55929065", "0.5585774", "0.55420375", "0.55237293", "0.5493717", "0.5479121", "0.5475922", "0.5474732", "0.5459661", "0.5457092", "0.54252344", "0.5420601", "0.54172957", "0.54116523", "0.53925115", "0.5390519", "0.53866714", "0.53773457", "0.5376143", "0.53608", "0.5355885", "0.535338", "0.5353184", "0.5326435", "0.5323783", "0.5309124", "0.5303412", "0.5300611", "0.52978534", "0.52941495", "0.528373", "0.52829224", "0.52710074", "0.5270906", "0.5264806", "0.52522516", "0.52451", "0.5242749", "0.5231386", "0.5228174", "0.52263534", "0.5225498", "0.52185076", "0.52045226", "0.5199996", "0.51966745", "0.5177968", "0.5174813", "0.51681894", "0.5165243", "0.51598734", "0.51506525", "0.5143484", "0.5143227", "0.5138317", "0.51356065", "0.51342654", "0.5130763", "0.51291305", "0.5127437", "0.5121283", "0.51202506", "0.51201963", "0.51130253", "0.5112252", "0.51079977", "0.5099431", "0.5098886", "0.5098589", "0.5096277", "0.50915855", "0.50825936", "0.50811356", "0.5077196", "0.5075058" ]
0.5835539
9
Cache key for dimensions for given container
protected function getDimensionCacheKey($hash, $variant = null) { return self::CACHE_DIMENSIONS . sha1($hash . '-' . $variant); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function calculateCacheKey()\n {\n if ($this->_cacheKey === null) {\n $key = [__CLASS__, Yii::$app->requestedRoute];\n if (is_array($this->variations)) {\n foreach ($this->variations as $value) {\n $key[] = $value;\n }\n }\n $this->_cacheKey = $key;\n }\n \n return $this->_cacheKey;\n }", "public function getCacheKey()\n {\n return $this->cacheKey;\n }", "public function getCacheKey()\n {\n return md5($this->formId . ':' . implode(',', $this->fieldIds));\n }", "private function getCacheKey($storage_name){\n return $storage_name.'_'.$this->media_type.'_'.$this->media_id;\n }", "public function getCacheKey() {\n return $this->_cacheKey;\n }", "public function getCacheKeyInfo();", "public function cacheKey(): string {\n return self::CACHE_PREFIX . $this->id\n . ($this->revisionId ? '_r' . $this->revisionId : '');\n }", "private function getCacheKey(): string\n {\n return $this->webserviceId.$this->cacheKey;\n }", "public function getKey($container, $key) {\n\t\treturn $this->_memcached->get('@@'.$container.'.'.$key);\n\t}", "public function cacheKey() {\n $params = $this->getParameters();\n $ret = '';\n $this->make_cache_key($params, $ret);\n\n return md5($ret);\n }", "protected function getCacheKey()\r\n {\r\n if (null == $this->cacheKey) {\r\n $this->cacheKey = get_class($this)\r\n . $this->getParent()->getEnvironment()\r\n . $this->getHttpHost();\r\n }\r\n return $this->cacheKey;\r\n }", "public function getCacheKey(Request $request): string;", "public function generateCacheKey() {\n $key = array(\n 'connection' => $this->connection->getName(),\n 'collection' => $this->collection->getName(),\n 'wheres' => $this->wheres,\n 'columns' => $this->columns,\n 'groups' => $this->groups,\n 'orders' => $this->orders,\n 'offset' => $this->offset,\n 'aggregate' => $this->aggregate,\n );\n\n return md5(serialize(array_values($key)));\n }", "public function getCacheKey()\n {\n return $this->CacheKey;\n }", "public function getCalculationsCacheKeyAttribute()\n {\n return 'shop_' . $this->table . '_' . $this->attributes['id'] . '_calculations';\n }", "protected function _getAdditionalCacheId()\n\t{\n\t\treturn md5('CONTAINER_ORDERS_' . $this->_placeholder->getAttribute('cache_id'));\n\t}", "function cache_key(Repository $repo) {\n return \"ms_\" . md5($repo->user . $repo->name);\n}", "public function getConfigCacheKey() \n {\n return (string) $this->configCacheKey;\n }", "public function getCacheKey(): string\n {\n $customerGroupId = 0;\n\n if ($this->hasCustomerGroupId()) {\n $customerGroupId = $this->getCustomerGroupId();\n }\n\n return sprintf('%d-%d-%d', $this->getWebsiteId(), $customerGroupId, $this->getStoreId());\n }", "protected function getCacheKey() {\n $plugin_id = hash('sha256', $this->getPluginId());\n $uri = $this->config('uri');\n\n return $plugin_id . ':' . $uri;\n }", "public function key ()\n {\n return $this->valid() ? $this->cache[ $this->offset ][ 0 ] : NULL;\n }", "private function getCacheKey(Client $client, string $resource, array $query): string\n {\n $params = array_merge_recursive(\n array(\n $client->getShop(),\n $resource,\n ),\n $query\n );\n //====================================================================//\n // Build Image Cache Key\n return implode(\n \".\",\n array(\n \"splash.shopify.connector.list\",\n md5(serialize($params)),\n )\n );\n }", "protected function calculateKey($id)\n\t{\n\t return self::CACHE_KEY_PREFIX.$id;\n\t}", "public function generateCacheKey()\n {\n $key = array(\n 'connection' => $this->connection->info()['name'],\n 'wheres' => $this->wheres,\n 'columns' => $this->columns,\n 'groups' => $this->groups,\n 'orders' => $this->orders,\n 'offset' => $this->offset,\n 'limit' => $this->limit,\n 'aggregate' => $this->aggregate,\n );\n\n return md5(serialize(array_values($key)));\n }", "function getCacheId() {\n return get_class($this).\"_\".$this->id;\n }", "public function getCacheId()\n {\n return md5(serialize($this->params));\n }", "public function getCacheKey()\n {\n return md5('SprainCurrencyConverter_' . $this->getName() . $this->baseCurrency . $this->targetCurrency);\n }", "protected function cacheKey() : string\n {\n return $this->cacheKey ?? $this->cacheKeyHash();\n }", "private function cacheKey()\n {\n return sprintf('contact-permissons-%s', $this->client->patientContactId);\n }", "protected function cacheKey()\n {\n return md5($this->gridField->Link());\n }", "public function getCacheKeyInfo()\n {\n $cacheKeyInfo = parent::getCacheKeyInfo();\n $cacheKeyInfo['item_renders'] = $this->_serializeRenders();\n return $cacheKeyInfo;\n }", "public function ElementCacheKey()\n {\n $fragments = [\n 'elemental_block',\n $this->owner->ID,\n $this->owner->LastEdited\n ];\n return implode('-_-', $fragments);\n }", "public function getCacheKeyInfo()\n {\n $baseCacheKeyInfo = parent::getCacheKeyInfo();\n\n array_push($baseCacheKeyInfo, self::WIDGET_TYPE, $this->_getWidgetParams(true));\n\n return $baseCacheKeyInfo;\n }", "public function key()\n {\n return key($this->container);\n }", "protected static function getCacheIdentifier() {}", "public function setCacheKey($var)\n {\n GPBUtil::checkString($var, True);\n $this->CacheKey = $var;\n\n return $this;\n }", "public function getCacheKeyInfo()\n {\n\t\t$httpContext = ObjectManager::getInstance()->get(\\Magento\\Framework\\App\\Http\\Context::class);\n\t\t$priceCurrency = ObjectManager::getInstance()->get(\\Magento\\Framework\\Pricing\\PriceCurrencyInterface::class);\n return [\n\t\t\t'MAGEZONBUILDERS_ELEMENT',\n\t\t\t$priceCurrency->getCurrencySymbol(),\n\t\t\t$this->_storeManager->getStore()->getId(),\n\t\t\t$this->_design->getDesignTheme()->getId(),\n\t\t\t$httpContext->getValue(\\Magento\\Customer\\Model\\Context::CONTEXT_GROUP),\n\t\t\t$this->getElementType(),\n\t\t\t$this->getElementId(),\n\t\t\t$this->getTemplate()\n ];\n }", "public function generateCacheKey()\n {\n $key = [\n 'bucket' => $this->from,\n 'type' => $this->type,\n 'wheres' => $this->wheres,\n 'columns' => $this->columns,\n 'groups' => $this->groups,\n 'orders' => $this->orders,\n 'offset' => $this->offset,\n 'limit' => $this->limit,\n 'aggregate' => $this->aggregate,\n ];\n\n return md5(serialize(array_values($key)));\n }", "private function getCacheKey($url) {\n\t\treturn 'amo_api_' . md5($url);\n\t}", "public function getCacheKeyInfo()\n {\n return [\n 'REWARDS_NOTIFICATION_RULE_LIST_WIDGET',\n $this->_storeManager->getStore()->getId(),\n $this->_design->getDesignTheme()->getId(),\n $this->httpContext->getValue(\\Magento\\Customer\\Model\\Context::CONTEXT_GROUP),\n serialize($this->getRequest()->getParams())\n ];\n }", "public function getCacheKey($method, $args = null);", "public function getDimensionsHash() {\n\t\treturn $this->dimensionsHash;\n\t}", "public function cacheKeyHash() : string\n {\n return 'query|' .\n base64_encode(md5($this->builder->toSql() . implode('', $this->builder->getBindings()), true));\n }", "public function key () {\n return key ($this->varContainer);\n }", "public function getPathsCacheKey()\n {\n return 'halcyon-datastore-auto';\n }", "protected function create_cache_key()\n\t{\n\t\treturn hash($this->config['hash'], serialize($this->options));\n\t}", "private function getRequestCacheKey(Request $request)\n {\n $p = $request->attributes->all();\n $parameters = array();\n foreach ($p as $k => $v) {\n\n // On ne prend pas ces clefs\n if (in_array($k, $this->excludeKey)) {\n continue;\n }\n\n if ($this->validateRequestParameter($v)) {\n $parameters[$k] = $v;\n } else {\n throw new CacheException(sprintf('Request parameter \"%s\" is not valid', $k));\n }\n }\n ksort($parameters);\n\n if (count($parameters) < 1) {\n throw new \\Exception(\"Can't generate cache key from request without attributes\");\n }\n\n return $this->env.'-'.md5(json_encode($parameters));\n }", "private function getCacheId()\n\t{\n\t\treturn self::CACHE_ID_PREFIX . '_' . $this->exportId . '_' . $this->type;\n\t}", "private function getCacheKey(RequestInterface $request)\n {\n return $request->getMethod().md5((string) $request->getUri());\n }", "private function get_cache_id() {\n $handlername = get_class($this);\n if($this->id)\n $cache_id = '_cache_' . $handlername . '_' . $this->id;\n else \n $cache_id = '_cache_' . $handlername . '_all'; \n return $cache_id;\n\t}", "protected function getCacheKey($mapId, $filter, $elementId, $template, $style)\n {\n $cacheKey = 'map_' . $mapId;\n\n if ($filter) {\n $cacheKey .= '.filter_' . md5($filter->toRequest());\n }\n\n if ($elementId) {\n $cacheKey .= '.element_' . $elementId;\n }\n\n $cacheKey .= '.template_' . $template;\n\n if ($style) {\n $cacheKey .= '.style_' . md5($style);\n\n return $cacheKey;\n }\n\n return $cacheKey;\n }", "protected function cacheKey()\n {\n return json_encode($this);\n }", "protected function GetCacheKey()\n\t{\n\t\treturn (isset($this->params['hashbase']) ? $this->params['hashbase'] : '') . '|' . (isset($this->params['hash']) ? $this->params['hash'] : '') . '|' . (isset($this->params['file']) ? sha1($this->params['file']) : '');\n\t}", "function cacheKey( $key )\n\t{\n\t\treturn $key.\"_\".MANUFACTURER_ID.getFirstSubDomain();\n\t}", "protected function GetCacheKey()\n\t{\n\t\treturn $this->params['page'];\n\t}", "public function getCacheKeyInfo()\n {\n return array(\n 'VES_PRODUCTCAROUSEL4_BLOCK_WIDGET_TAB',\n $this->getNameInLayout(),\n Mage::app()->getStore()->getId(),\n Mage::getDesign()->getPackageName(),\n Mage::getDesign()->getTheme('template'),\n Mage::getSingleton('customer/session')->getCustomerGroupId(),\n 'template' => $this->getTemplate(),\n );\n }", "public function getCacheKeyInfo()\n\t{\n\t\t$conditions = $this->getData('conditions')\n\t\t\t? $this->getData('conditions')\n\t\t\t: $this->getData('conditions_encoded');\n\n\t\treturn [\n\t\t\t'CATALOG_PRODUCTS_LIST_WIDGET',\n\t\t\t$this->_storeManager->getStore()->getId(),\n\t\t\t$this->_design->getDesignTheme()->getId(),\n\t\t\t$this->httpContext->getValue(\\Magento\\Customer\\Model\\Context::CONTEXT_GROUP),\n\t\t\tintval($this->getRequest()->getParam(self::PAGE_VAR_NAME, 1)),\n\t\t\t$this->getProductsPerPage(),\n\t\t\t$conditions\n\t\t];\n\t}", "public function getCacheId() {\n\t\treturn parent::getCacheId();\n\t}", "final protected function getCacheKey($cacheId = array())\n\t{\n\t\tif(!is_array($cacheId))\n\t\t\t$cacheId = array((string) $cacheId);\n\n\t\t$cacheId['SITE_ID'] = SITE_ID;\n\t\t$cacheId['LANGUAGE_ID'] = LANGUAGE_ID;\n\t\t// if there are two or more caches with the same id, but with different cache_time, make them separate\n\t\t$cacheId['CACHE_TIME'] = intval($this->arResult['CACHE_TIME']);\n\n\t\tif(defined(\"SITE_TEMPLATE_ID\"))\n\t\t\t$cacheId['SITE_TEMPLATE_ID'] = SITE_TEMPLATE_ID;\n\n\t\treturn implode('|', $cacheId);\n\t}", "public function errorCacheKey()\n {\n // Returns a new number every x minutes\n return (int)(time() / 60 / 3);\n }", "function acf_cache_key($key = '')\n{\n}", "protected function getCacheKey($query){\n $bindings = array_map(function ($binding) {\n return (string)$binding;\n }, $query->getBindings());\n\n $name = $query->getConnection()->getName();\n $md5 = md5($name . $query->toSql() . serialize($bindings));\n return $md5;\n }", "protected function getCacheKey()\n {\n return json_encode([\n $this->toSql() => $this->getBindings()\n ]);\n }", "public function makeCacheHash() {}", "public function getCacheKey($id = null)\n\t{\n\t\tif ($id === null)\n\t\t\t$id = $this->id;\n\n\t\treturn \"BaseJumper:object:\" . get_class($this) . \":\" . $id;\n\t}", "public function getCacheKey() {\n $key = $this->getUrl ();\n\n if (isset ( $this->accessKey )) {\n $key .= $this->accessKey;\n }\n\n if (isset ( $this->requestHeaders ['authorization'] )) {\n $key .= $this->requestHeaders ['authorization'];\n }\n\n return md5 ( $key );\n }", "abstract function get_cache_prefix(): string;", "public function getValFromCache($key);", "public function key($item);", "public function getCacheId()\n {\n return 'wsdl_config_global_' . md5($this->getServiceUrl('*/*/*'));\n }", "public static function getCacheKey($scope, $name)\n {\n if (empty(self::$cacheStorage)) {\n return;\n }\n\n if (empty($scope) || empty($name)) {\n return;\n }\n\n // Check if this variable is suitable for caching\n if (!(self::checkCachingRules($scope, $name))) {\n return;\n }\n\n // CHECKME: use cacheCode and/or namespace instead ?\n // Answer: unlike for output caching, no external factors should influence this (user, theme, locale, url params, ...)\n //self::$cacheCode = md5($factors);\n //self::$cacheStorage->setCode(self::$cacheCode);\n // CHECKME: what about variable scope and/or name that isn't OS compliant ?\n // Answer: this must be handled by the cacheStorage if necessary\n // cache storage typically only works with a single cache namespace, so we add our own scope prefix here\n // Note: the cacheStorage may add its own namespace internally to take into account the host, site, ...\n return $scope.':'.$name;\n }", "protected function _getRequestCacheKey(array $request)\n {\n $key = serialize($request);\n return md5($key);\n }", "public function visitedThreadCacheKey($thread)\n\t{\n\t\treturn sprintf(\"users.%s.visits.%s\", Auth::user()->id, $thread->id);\n\t}", "function generateCacheId() {\r\n $viewId = \"\";\r\n foreach ($this->_data as $key => $value) $viewId.= \"$key=$value\";\r\n $viewId = md5($viewId);\r\n return $viewId;\r\n }", "private static function getCacheKeyName($key = null, $options = array())\n\t{\n\t\t$cacheKey = $key;\n\n\t\t//If no key was passed in\n\t\tif(is_null($cacheKey))\n\t\t{\n\t\t\t$cacheKey = strtolower(get_called_class());\n\t\t}\n\n\t\t//If a user id was passed in the options, add it to the key name\n\t\tif(isset($options['user_id']))\n\t\t{\n\t\t\t$options['user_id'] = $options['user_id']*1;\n\t\t\t$cacheKey = $cacheKey.'-'.hash(Config::get('constants.default_hash_algorithm'), json_encode($options));\n\t\t}\n\n\t\treturn $cacheKey;\n\t}", "public function getCacheId()\n {\n return sha1($_SERVER['QUERY_STRING'] . ':' . (int) $this->acceptsGzip());\n }", "protected static function _cacheKey($class = null)\n {\n static $_key = null;\n\n return $_key ?: sha1(static::neutralize($class ?: \\get_called_class()));\n }", "public function getCacheKeyInfo()\r\n {\r\n return array(\r\n 'ZOPIM_CHAT',\r\n $this->getNameInLayout(),\r\n Mage::app()->getStore()->getId(),\r\n Mage::helper('customer')->getCurrentCustomer()->getId()\r\n );\r\n }", "public function setCacheKey(string $key): void;", "public function key()\n {\n return key($this->bricks[$this->position]);\n }", "protected function getModelconfigCacheKey(): string {\r\n if($this->schema && $this->table) {\r\n return get_class($this).'-'.$this->schema.'_'.$this->table;\r\n } else {\r\n throw new exception('EXCEPTION_MODELCONFIG_CACHE_KEY_MISSING_DATA', exception::$ERRORLEVEL_FATAL);\r\n }\r\n }", "public function key($key) {\n $key = $this->_key($key);\n if (!$key) {\n throw new \\InvalidArgumentException('An empty value is not valid as a cache key');\n }\n return $this->prefix . $key;\n\n }", "private function make_cache_key($params, &$ret) {\n foreach ($params as $key => $value) {\n if (is_array($value)) {\n // recursive\n $ret.=$key;\n $this->make_cache_key($value, $ret);\n }\n else {\n $ret.=$value;\n }\n }\n }", "public function getCacheKey($key)\r\n {\r\n\t\treturn self::CACHE_KEY_PREFIX .\r\n\t\t\tstrtolower($this->getName()) . '_' . $key;\r\n }", "private function build_cache_key_for_url( $url ) {\n\t\treturn 'g_url_details_response_' . md5( $url );\n\t}", "public function createCacheIdentifier($params) {\n\t\t$cacheIdentifierModifiers = array(\n\t\t\t'params' => $params,\n\t\t\t'domain' => (isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']),\n\t\t);\n\n\t\t$cacheIdentifier = md5(join('_', $this->createCacheTagsInternal($cacheIdentifierModifiers)));\n\t\treturn $cacheIdentifier;\n\t}", "protected function getBatchCacheKey(ObjectIdentityInterface $oid)\n {\n return $oid->getType() . '_' . $this->getBatchNumber($oid);\n }", "public function getCachePathString()\n\t{\n\t\treturn \"rs-\".$this->_maxWidth.\"-\".$this->_maxHeight.\"-\".$this->_maintainAspectRatio.\"-\".$this->_scaleUp;\n\t}", "public function &cacheKey($function, $args = [], $___prop = 'cache')\n {\n $function = (string) $function;\n $args = (array) $args;\n\n if (!isset($this->{$___prop}[$function])) {\n $this->{$___prop}[$function] = null;\n }\n $cache_key = &$this->{$___prop}[$function];\n\n foreach ($args as $_arg) {\n // Use each arg as a key.\n\n switch (gettype($_arg)) {\n case 'integer':\n $_key = (int) $_arg;\n break; // Break switch handler.\n\n case 'double':\n case 'float':\n $_key = (string) $_arg;\n break; // Break switch handler.\n\n case 'boolean':\n $_key = (int) $_arg;\n break; // Break switch handler.\n\n case 'array':\n case 'object':\n $_key = sha1(serialize($_arg));\n break; // Break switch handler.\n\n case 'NULL':\n case 'resource':\n case 'unknown type':\n default:\n $_key = \"\\0\".(string) $_arg;\n }\n if (!isset($cache_key[$_key])) {\n $cache_key[$_key] = null;\n }\n $cache_key = &$cache_key[$_key];\n }\n\n return $cache_key;\n }", "public function getCacheKey($name)\n {\n return $this->findTemplate($name) . '_' . $this->scope;\n }", "public function cacheKey($type, $token='')\n {\n $type = strtolower($type);\n\n switch ($type) {\n case 'token':\n return $this->cacheToken . \":\" . $token;\n case 'refresh':\n return $this->cacheTokenRefresh . \":\" . $token;\n case 'initial':\n return $this->cacheTokenInitial . \":\" . $token;\n }\n }", "protected function getSystemGraphCacheKey(int $systemId): string {\n return sprintf(self::CACHE_KEY_GRAPH, 'SYSTEM_' . $systemId);\n }", "protected function _getActualKey($cacheName, $key = NULL)\n\t{\n\t\t$return = $this->_prefix . '_' . $cacheName;\n\n\t\t!is_null($key) && $return .= '_' . md5($key);\n\n\t\treturn $return;\n\t}", "private function getCacheKey(array $input): string\n {\n return json_encode($input);\n }", "protected function get_cache_id() {\n\t\treturn wponion_hash_string( $this->module() . '_' . $this->unique() );\n\t}", "public function isExistInCache($key);", "protected function getCacheKey(RequestInterface $request): string\n {\n if ($this->key === null) {\n $this->key = $request->getMethod() . md5((string)$request->getUri());\n }\n return (string)$this->key;\n }", "public function makeCacheKey($configKey, $parts = []);", "function apc_cache_get_keyword_key($keyword) {\n\treturn APC_CACHE_KEYWORD_PREFIX . $keyword;\n}", "public function getContainerId($autoGenerate=true)\n\t{\n\t\tif ($this->_containerId !== null)\n\t\t\treturn $this->_containerId;\n\t\telse if ($autoGenerate)\n\t\t\treturn $this->_containerId = 'EGMapContainer' . parent::$_counter++;\n\t}" ]
[ "0.64946055", "0.618433", "0.6171773", "0.61240554", "0.6103964", "0.6052702", "0.6049449", "0.5994975", "0.594321", "0.58983666", "0.5892559", "0.5881405", "0.5847667", "0.58197445", "0.5740596", "0.570528", "0.5694504", "0.56800574", "0.56666285", "0.56533295", "0.5652369", "0.5638711", "0.5630889", "0.5624044", "0.5622689", "0.559791", "0.5595425", "0.5587886", "0.55769265", "0.55660963", "0.55385816", "0.5534373", "0.551158", "0.5497566", "0.5494612", "0.5489407", "0.5484932", "0.5461839", "0.5433605", "0.5429788", "0.54177135", "0.536074", "0.5360271", "0.5346159", "0.53306925", "0.53298205", "0.5327706", "0.5309316", "0.5298202", "0.529449", "0.5288181", "0.52855", "0.528545", "0.52662456", "0.5261602", "0.5239248", "0.52390176", "0.5228245", "0.52246654", "0.5212284", "0.51962703", "0.51826274", "0.51786655", "0.5178554", "0.51597196", "0.5149485", "0.51487976", "0.5132446", "0.5127951", "0.50970924", "0.508436", "0.5083241", "0.5081966", "0.50664425", "0.5065714", "0.50513715", "0.50453717", "0.50346446", "0.50302356", "0.5014695", "0.50088507", "0.5001641", "0.49986348", "0.4994735", "0.49941015", "0.49934754", "0.49911135", "0.49900144", "0.49833187", "0.4982328", "0.49792117", "0.49762616", "0.49757335", "0.49721962", "0.4968615", "0.4967715", "0.49657008", "0.4951068", "0.49473", "0.49345186" ]
0.6314004
1
Warm dimension cache for the given asset
protected function warmCache($hash, $variant = null) { // Warm dimension cache $key = $this->getDimensionCacheKey($hash, $variant); $resource = $this->getImageResource(); if ($resource) { $result = $this->getResourceDimensions($resource); $this->getCache()->set($key, $result); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function buildSpriteDataAndCreateCacheEntry() {}", "public function getCache();", "protected function getCacheModule() {}", "private static function getAssetCache($asset)\n\t{\n\t\treturn new AssetCache\n\t\t(\t$asset\n\t\t,\tnew FilesystemCache(self::cachePath())\n\t\t);\n\t}", "protected function getMemoryCache() {}", "public function getCacheAdapter();", "function cacheThisImage($img)\n{\n\trequire_once 'externalLibraries/ImageCache.php';\n\t$baseurl=base_url();\n\t$imagecache = new ImageCache();\n\t//$imagecache->cached_image_directory = $baseurl. 'entreprenity/api/cachedImages/';\n\t$imagecache->cached_image_directory = dirname(__FILE__) . '/cachedImages';\n\n\t$cached_src_one = $imagecache->cache($img);\n\t//return $imagecache->cached_image_directory;\n\treturn $cached_src_one;\n\n}", "abstract protected function cacheData();", "public function getCachePathString()\n\t{\n\t\treturn \"rs-\".$this->_maxWidth.\"-\".$this->_maxHeight.\"-\".$this->_maintainAspectRatio.\"-\".$this->_scaleUp;\n\t}", "public static function getCache() {}", "protected function getRuntimeCache() {}", "function ag_create_wm_cache() {\n\trequire_once(AG_DIR .'/functions.php');\n\t\n\t// force PHP debug mode\n\tini_set('display_errors', 1);\n\tini_set('display_startup_errors', 1);\n\terror_reporting(E_ALL);\t\n\t\n\t\n\t// specific gallery or any gallery?\n\t$gid = (isset($_POST['gid'])) ? addslashes($_POST['gid']) : false;\n\t\n\tif(!$gid) {\n\t\t$args = array(\n\t\t\t'post_type' => 'ag_galleries',\n\t\t\t'numberposts' => -1,\n\t\t\t'post_status' => 'publish'\n\t\t);\n\t\t$galleries = get_posts($args);\n\t}\n\telse {\n\t\t$galleries = array( get_post($gid));\t\n\t}\n\t\n\t\n\t// perform\n\tforeach($galleries as $gallery) {\n\t\t$gid = $gallery->ID;\n\t\t$type = get_post_meta($gid, 'ag_type', true);\n\t\t$images = ag_gall_data_get($gid);\n\t\n\t\tif(is_array($images)) {\n\t\t\tforeach($images as $img) { \n\t\t\t\t$full_src = ag_img_src_on_type($img['img_src'], $type);\n\t\t\t\tag_watermark($full_src);\n\t\t\t}\n\t\t}\t\n\t}\n\n\tdie('success');\n}", "function build_image_size_rule($mod_name, $device=null) {\n\t\t\t$element = json_decode($this->get_cached_mod($mod_name),true);\n\t\t\t$element_props = '';\n\t\t\tif ($device && isset($element[$device])) {\n\t\t\t\t$element = $element[$device];\n\t\t\t}\n\t\t\t// if (isset($element->mode) && $element->mode == 'image') {\n\t\t\t\tif (!empty($element['imgwidth'])) {\n\t\t\t\t\t$element_props = \"\\twidth: {$element['imgwidth']}px;\";\n\t\t\t\t}\n\t\t\t\tif (!empty($element['imgheight'])) {\n\t\t\t\t\t$element_props .= \"\\n\\theight: {$element['imgheight']}px;\";\n\t\t\t\t}\n\t\t\t// }\n\t\t\treturn $element_props;\n\t\t}", "function asset($asset)\n{\n return ASSET_PREFIX . '/'. $asset;\n}", "public function get($cache_name);", "protected function getDimensions()\n {\n // Default result\n $result = [0, 0];\n\n // If we have a resource already loaded, this means we have modified the resource since the\n // original image was loaded. This means the \"Variant\" tuple key is out of date, and we don't\n // have a reliable cache key to load from, or save to. If we use the original tuple as a key,\n // we would run the risk of overwriting the original dimensions in the cache, with the values\n // of the resized instead.\n // Instead, we use the immediately available dimensions attached to this resource, and we will\n // rely on cache warming in writeToStore to save these values, where the \"Variant\" becomes available,\n // before the next time this variant is loaded into memory.\n $resource = $this->image;\n if ($resource) {\n return $this->getResourceDimensions($resource);\n }\n\n // Check if we have a container\n $container = $this->getAssetContainer();\n if (!$container) {\n return $result;\n }\n\n // Check cache for unloaded image\n $cache = $this->getCache();\n $key = $this->getDimensionCacheKey($container->getHash(), $container->getVariant());\n if ($cache->has($key)) {\n return $cache->get($key);\n }\n\n // Cache-miss\n $resource = $this->getImageResource();\n if ($resource) {\n $result = $this->getResourceDimensions($resource);\n $cache->set($key, $result);\n }\n return $result;\n }", "function load_theme_image_cache($db, $site, $true_theme, $true_lang)\n{\n global $THEME_IMAGES_CACHE, $THEME_IMAGES_SMART_CACHE_LOAD, $SMART_CACHE;\n\n if ($THEME_IMAGES_SMART_CACHE_LOAD == 0) {\n $THEME_IMAGES_CACHE[$site] = $SMART_CACHE->get('theme_images_' . $true_theme . '_' . $true_lang);\n if (is_null($THEME_IMAGES_CACHE[$site])) {\n $THEME_IMAGES_CACHE[$site] = array();\n }\n } elseif ($THEME_IMAGES_SMART_CACHE_LOAD == 1) {\n $test = $db->query_select('theme_images', array('id', 'path'), array('theme' => $true_theme, 'lang' => $true_lang));\n $THEME_IMAGES_CACHE[$site] = collapse_2d_complexity('id', 'path', $test);\n }\n\n $THEME_IMAGES_SMART_CACHE_LOAD++;\n}", "function get_cached_json($widget) {\n global $cachedb;\n\n if ( isset($cachedb) ) {\n $result=mysqli_query($cachedb, \"SELECT json FROM cache_table WHERE widget = '$widget'\");\n if ( $result ) {\n return mysqli_fetch_row($result)[0];\n } else {\n return false;\n }\n } else {\n return false;\n }\n}", "private function _cache($image, $remote){\n $this->cacheData = $this->cacheType == 'json' ? $this->_jsonCache() : $this->_apcCache();\n }", "function cache();", "protected function _create_cached()\n {\n if($this->url_params['c'])\n {\n // Resize to highest width or height with overflow on the larger side\n $this->image->resize($this->url_params['w'], $this->url_params['h'], Image::INVERSE);\n\n // Crop any overflow from the larger side\n $this->image->crop($this->url_params['w'], $this->url_params['h']);\n }\n else\n {\n // Just Resize\n $this->image->resize($this->url_params['w'], $this->url_params['h']);\n }\n\n // Apply any valid watermark params\n $watermarks = Arr::get($this->config, 'watermarks');\n if ( ! empty($watermarks))\n {\n foreach ($watermarks as $key => $watermark)\n {\n if (key_exists($key, $this->url_params))\n {\n $image = Image::factory($watermark['image']);\n $this->image->watermark($image, $watermark['offset_x'], $watermark['offset_y'], $watermark['opacity']);\n }\n }\n }\n\n // Save\n if($this->url_params['q'])\n {\n //Save image with quality param\n $this->image->save($this->cached_file, $this->url_params['q']);\n }\n else\n {\n //Save image with default quality\n $this->image->save($this->cached_file, Arr::get($this->config, 'quality', 80));\n }\n }", "function wp_using_ext_object_cache($using = \\null)\n {\n }", "function roots_embed_wrap($cache, $url, $attr = '', $post_ID = '') {\n return '<div class=\"entry-content-asset\">' . $cache . '</div>';\n}", "function &createCache() {}", "function fabric_embed_wrap($cache, $url, $attr = '', $post_ID = '') {\n return '<div class=\"entry-content-asset\">' . $cache . '</div>';\n}", "public function cache() {\r\n\t\t$this->resource->cache();\r\n\t}", "public function cacheFor(): DateTimeInterface|DateInterval|float|int|null;", "function cacheing_environment()\n\t{\n\t\t$info=array();\n\t\t$info['cache_on']='array(((array_key_exists(\\'root\\',$map)) && ($map[\\'root\\']!=\\'\\'))?intval($map[\\'root\\']):get_param_integer(\\'root\\',NULL),array_key_exists(\\'search\\',$map)?$map[\\'search\\']:\\'\\',array_key_exists(\\'sort\\',$map)?$map[\\'sort\\']:\\'\\',array_key_exists(\\'display_type\\',$map)?$map[\\'display_type\\']:NULL,array_key_exists(\\'template_set\\',$map)?$map[\\'template_set\\']:\\'\\',array_key_exists(\\'select\\',$map)?$map[\\'select\\']:\\'\\',array_key_exists(\\'param\\',$map)?$map[\\'param\\']:db_get_first_id(),get_param_integer(\\'max\\',array_key_exists(\\'max\\',$map)?intval($map[\\'max\\']):30),get_param_integer(\\'start\\',0))';\n\t\t$info['ttl']=60*2;\n\t\treturn $info;\n\t}", "public function cacheBin() {\n return 'cache_forsrights_webservice';\n }", "public function cache() {\n if(!array_key_exists($this->steamId64, self::$steamIds)) {\n self::$steamIds[$this->steamId64] = $this;\n if(!empty($this->customUrl) &&\n !array_key_exists($this->customUrl, self::$steamIds)) {\n self::$steamIds[$this->customUrl] = $this;\n }\n }\n }", "protected static function getRuntimeCache() {}", "protected function getDimensionCacheKey($hash, $variant = null)\n {\n return self::CACHE_DIMENSIONS . sha1($hash . '-' . $variant);\n }", "public function cache(): object\n {\n return $this->baseApp($this)->loadCache();\n }", "public function testComDayCqDamCommonsUtilImplAssetCacheImpl()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.dam.commons.util.impl.AssetCacheImpl';\n\n $crawler = $client->request('POST', $path);\n }", "abstract protected function getCacheClass();", "public static function getCacheControl() {}", "private function getAllGoodStoragesForMediaFromCache(){\n \n $cache = array();\n \n foreach ($this->getAllCacheKeys() as $key){\n \n $storage_cache = $this->db->from('storage_cache')\n ->where(array(\n 'cache_key' => $key,\n 'status' => 1,\n 'changed>' => date(Mysql::DATETIME_FORMAT, time() - $this->cache_expire_h*3600)\n ))\n ->get()\n ->all();\n \n if(!empty($storage_cache)){\n $storage_cache = $storage_cache[0];\n $storage_data = unserialize($storage_cache['storage_data']);\n if (is_array($storage_data) && !empty($storage_data) && !empty($this->stb_storages[$storage_cache['storage_name']])){\n $cache[$storage_cache['storage_name']] = $storage_data;\n $cache[$storage_cache['storage_name']]['load'] = $this->getStorageLoad($this->storages[$storage_cache['storage_name']]);\n }\n }\n \n }\n return $cache;\n }", "function get_asset_size($asset, $folder = NULL) {\n if($folder != NULL) $asset = $folder.'/'.$asset;\n $assetpath = assets_path($asset);\n $file_info = get_file_info($_SERVER['DOCUMENT_ROOT'].\"/\".$assetpath, array('size'));\n $filesize = $file_info[\"size\"] / 1024;\n \n return number_format($filesize, 1).\" KB\";\n}", "protected function initCaches() {}", "function embed_wrap( $cache ) {\n\treturn '<div class=\"entry-content-asset\">' . $cache . '</div>';\n}", "public static function getCacheType();", "protected function getCacheManager() {}", "protected function getCacheManager() {}", "public function prewarmCache()\n {\n //Now that installation is complete, we need to set this to false to have the caches build correctly\n $GLOBALS['installing'] = false;\n $this->log(\"Populating metadata cache\");\n $GLOBALS['app_list_strings'] = return_app_list_strings_language('en_us');\n require_once 'include/MetaDataManager/MetaDataManager.php';\n MetaDataManager::setupMetadata(array('base'), array('en_us'));\n $this->log(\"Metadata cache populated\");\n }", "function get_the_image_delete_cache_by_meta( $meta_id, $post_id ) {\n\twp_cache_delete( $post_id, 'get_the_image' );\n}", "public function cacheSetup()\n\t{\n\t\t// Generate the name\n\t\t$time = $this->modified;\n\t\t$extension = $this->type;\n\t\t$fileName = pathinfo($this->name, PATHINFO_FILENAME) . \".\" . md5($this->name . '.' . $time);\n\t\t$name = $fileName . \".\" . $extension;\n\n\t\t// Generate the cache file path\n\t\t$this->cacheFilePath = realpath(public_path() . '/' . $this->app['assets::config']['cache_path']) . '/' . $name;\n\n\t\t// Generate the cache file URL\n\t\t$this->cacheFileUrl = $this->app['assets::config']['cache_url'] . $name;\n\n\t\treturn $this->cacheFile = $name;\n\t}", "public function cacheGet() {\n }", "public function getCacheExp();", "public function getCacheName($name){\n if($this->is_mobile)\n $name .= '_mobile';\n return $name;\n }", "public function getCacheDirectory() {}", "public function isStaticCacheble() {}", "public function setCaching($cache);", "protected static function getCacheIdentifier() {}", "public function cache_oembed($post_id)\n {\n }", "public function getCacheDir();", "protected function calculateCacheKey()\n {\n if ($this->_cacheKey === null) {\n $key = [__CLASS__, Yii::$app->requestedRoute];\n if (is_array($this->variations)) {\n foreach ($this->variations as $value) {\n $key[] = $value;\n }\n }\n $this->_cacheKey = $key;\n }\n \n return $this->_cacheKey;\n }", "private function _getCachePath() {\n return DIR_PUBLIC_CACHE_SEARCHES . $this->_id . '.json';\n }", "private function get_size_object ( $atts ) {\n // $transient = get_transient( $transient_key );\n\n // if ( $transient !== false ) {\n // return $transient;\n // }\n\n // we want to ignore thumbnails if they all have the same aspect ratio\n $images = array();\n $widths = array();\n $heights = array();\n $width_count = 0;\n $height_count = 0;\n $width_val = 0;\n $height_val = 0;\n $output = array();\n\n if ( empty($atts['nggid']) && empty($atts['ngaid']) ) {\n // it's a WP gallery\n if ( empty($atts['category']) ) {\n $images = $this->gallery_from_wordpress( $atts['id'], $atts['link_behavior'], $atts['include'], $atts['exclude'], $atts['ids'], true );\n } else {\n if ( $atts['category'] == 'recent' || $atts['category'] == 'latest' ) {\n $recent_images = $this->recent_posts_images( $atts['limit'] );\n } else {\n $recent_images = $this->recent_posts_images( $atts['limit'], $atts['category'] );\n }\n\n $ids = array_keys( $recent_images );\n $images = $this->gallery_from_wordpress( $atts['id'], $recent_images, $atts['include'], $atts['exclude'], $ids, true );\n }\n\n foreach ( $images as $_post ) {\n $image_thumbnail = wp_get_attachment_image_src($_post->ID , 'thumbnail');\n if ( !empty( $image_thumbnail[1] ) ) {\n array_push( $widths, $image_thumbnail[1] );\n }\n if ( !empty( $image_thumbnail[2] ) ) {\n array_push( $heights, $image_thumbnail[2] );\n }\n }\n\n } else {\n // it's a NextGen gallery\n if ( !empty($atts['nggid']) ) {\n $images = array_merge( $images, nggdb::get_gallery($atts['nggid']) );\n\n } else if ( !empty($atts['ngaid']) ) {\n $album = nggdb::find_album( $atts['ngaid'] );\n $galleryIDs = $album->gallery_ids;\n foreach ($galleryIDs as $key => $galleryID) {\n $images = array_merge( $images, nggdb::get_gallery($galleryID) );\n }\n }\n\n foreach ($images as $key => $image) {\n array_push( $widths, $image->meta_data['thumbnail']['width'] );\n array_push( $heights, $image->meta_data['thumbnail']['height'] );\n }\n }\n\n if ( !empty($images) ) {\n $val = '0';\n\n // People modify things to wp_get_attachment_image_src doesn't return width/height data.\n // There's nothing we can do to protect these people from themselves.\n if ( !empty($widths) && !empty($heights) ) {\n $width_count = array_count_values($widths);\n $width_val = array_search( max($width_count), $width_count );\n\n $height_count = array_count_values($heights);\n $height_val = array_search( max($height_count), $height_count );\n\n if ( count($width_count) === 1 && count($height_count) === 1 ) {\n // fixed dimensions\n $val = '1';\n } else {\n // proportional\n $val = (count($width_count) === 1 ? $width_val : $height_val);\n }\n }\n\n if ( empty($atts['nggid']) && empty($atts['ngaid']) ) {\n $output = array(\n 'thumbnail' => ($val === '1' ? $val : get_option(\"thumbnail_size_w\") ),\n 'medium' => get_option(\"medium_size_w\"),\n 'large' => get_option(\"large_size_w\")\n );\n } else {\n $output = array(\n 'thumbnail' => $val\n );\n }\n }\n\n // set_transient( $transient_key, $output, $this->transient_expiry );\n return $output;\n }", "public function warm(RenderingContextInterface $renderingContext)\n {\n $renderingContext->getTemplateCompiler()->enterWarmupMode();\n $result = new FluidCacheWarmupResult();\n $result->merge(\n $this->warmupTemplateRootPaths($renderingContext),\n $this->warmupPartialRootPaths($renderingContext),\n $this->warmupLayoutRootPaths($renderingContext)\n );\n return $result;\n }", "function mgd_cache_invalidate()\n{\n}", "function getCacheId() {\n return get_class($this).\"_\".$this->id;\n }", "function cache($field, $type, $id,$delta, $item) {\n $cid = \"{$field}_{$type}_{$id}_{$delta}:\" . \\Drupal::languageManager()\n ->getCurrentLanguage()\n ->getId();\n $camData = NULL;\n\n if ($cache = \\Drupal::cache()\n ->get($cid)) {\n // It's in cache\n $camData = $cache->data;\n\n if($this->currentTimeMillis() >= $camData['time'] ) {\n // Cache expired\n $info = pathinfo($item->link);\n $data = WebcamHelper::requesturl( $item->link, $item->refresh_rate/1000);\n\n if ($data != false) {\n $imageSrc = 'data:image/' . $info['extension'] . ';base64,' . base64_encode($data);\n }elseif($camData['src'] != false){\n // Failed to retrieve the image, but there is an old one in the cache\n $imageSrc = $camData['src'];\n }else{\n // Failed to retrieve the image, and there isn't one in the cache\n $imageSrc = false;\n }\n \\Drupal::cache()\n ->set($cid, ['src' => $imageSrc, 'time' => $this->currentTimeMillis() + $item->refresh_rate]);\n }\n return isset($imageSrc) ? $imageSrc : $camData['src'];\n }\n else {\n // We don't have it in cache\n $info = pathinfo($item->link);\n $data = WebcamHelper::requesturl( $item->link, $item->refresh_rate/1000);\n\n if ($data != false) {\n $imageSrc = 'data:image/' . $info['extension'] . ';base64,' . base64_encode($data);\n }else{\n $imageSrc = false;\n }\n\n \\Drupal::cache()\n ->set($cid, ['src' => $imageSrc, 'time' => $this->currentTimeMillis() + $item->refresh_rate]);\n }\n return $imageSrc;\n }", "public function getAsset(Component $component, $asset) {}", "public function getCacheName();", "public function testCacheIntegrity() {\n\t\t$fullPath = realpath(dirname(__FILE__) . '/gdtest/test_jpg.jpg');\n\n\t\ttry {\n\t\t\t$gdFailure = new GDBackend_Failure($fullPath, array('ScaleWidth', 123));\n\t\t\t$this->fail('GDBackend_Failure should throw an exception when setting image resource');\n\t\t} catch (GDBackend_Failure_Exception $e) {\n\t\t\t$cache = SS_Cache::factory('GDBackend_Manipulations');\n\t\t\t$key = md5(implode('_', array($fullPath, filemtime($fullPath))));\n\n\t\t\t$data = unserialize($cache->load($key));\n\n\t\t\t$this->assertArrayHasKey('ScaleWidth|123', $data);\n\t\t\t$this->assertTrue($data['ScaleWidth|123']);\n\t\t}\n\t}", "private function getCacheKey(): string\n {\n return $this->webserviceId.$this->cacheKey;\n }", "public function get()\n\t{\n\t\tif($this->has())\n\t\t{\n\t\t\t$assets = Cache::get($name = $this->name());\n\n\t\t\treturn $assets;\n\t\t}\n\n\t\treturn false;\n\t}", "public function getLayoutCache(){\n\t\tif(isset(self::$_cacheLayout[get_class($this)])){\n\t\t\treturn self::$_cacheLayout[get_class($this)];\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public function startCache() {}", "function wp_cache_flush_runtime()\n {\n }", "public function getCacheLifetime(): int;", "function cache($name, $set = null)\n{\n $file = '/tmp/cache/'.$name.'.tmp';\n\n if (!is_dir('/tmp/cache'))\n {\n mkdir('/tmp/cache');\n }\n\n if ($set)\n {\n $GLOBALS['cache'][$file] = $set;\n $set = var_export($set, true);\n $tmp = '/tmp/cache/'.$name.uniqid('', true).'.tmp';\n file_put_contents($tmp, '<?php $val = '.$set.';', LOCK_EX);\n rename($tmp, $file);\n return file_exists($tmp);\n }\n elseif (isset($GLOBALS['cache'][$file]))\n {\n return $GLOBALS['cache'][$file];\n }\n else\n {\n if (file_exists($file))\n {\n include $file;\n $GLOBALS['cache'][$file] = $val;\n return $val;\n }\n }\n}", "function get_the_image_delete_cache_by_post( $post_id ) {\n\twp_cache_delete( $post_id, 'get_the_image' );\n}", "function asu_brand_get_cached_content($cache_id, $file_path, $reset = FALSE) {\n\n if($output = cache_get($cache_id)) {\n $output = $output->data;\n }\n\n if ($reset || $output==NULL || !isset($output)) {\n\n // set timeout to 1.5 seconds. if it takes too long, fall back\n // to long term caching\n $options = array(\n 'timeout' => 1.5\n );\n\n $output = drupal_http_request($file_path, $options);\n\n //if ($output = drupal_http_request($file_path)) {//$output = file_get_contents($file_path)) {\n if ($output->code == 200) {\n $output = $output->data;\n\n cache_set($cache_id, $output, 'cache', time() + ASU_BRAND_CACHE_LIFETIME);\n variable_set($cache_id, $output);\n } else {\n // File resource is not available; use long term cache and cache it for 1 hour.\n $output = variable_get($cache_id, NULL);\n cache_set($cache_id, $output, 'cache', time() + 3600);\n watchdog('asu_brand', 'Unable to load @path to the cache; using long term cache.', array('@path' => $file_path), WATCHDOG_ERROR);\n }\n }\n \n return $output;\n}", "private function getCacheKey($storage_name){\n return $storage_name.'_'.$this->media_type.'_'.$this->media_id;\n }", "protected static function getCacheManager() {}", "public function getCacheInstance($cacheName = null);", "function getMkMediaCost($game_id, $media_number, $region_number, $intensity){\r\n\t\t\t$mkMediaCosts=new Model_DbTable_Games_Param_Mk_MediaCosts();\r\n\t\t\t$result=$mkMediaCosts->fetchRow('game_id = '.$game_id.' AND media_number = '.$media_number.' AND region_number = '.$region_number);\r\n\t\t\t$costs=explode(\";\",$result['costs']);\r\n\t\t\treturn $costs[$intensity-1];\r\n\t\t}", "public function isCacheEnabled(Widget $widget)\n {\n $widgets = $this->container->getParameter('victoire_core.widgets');\n foreach ($widgets as $widgetParams) {\n if ($widgetParams['class'] === ClassUtils::getClass($widget)) {\n if (array_key_exists('cache', $widgetParams)) {\n return $widgetParams['cache'];\n } else {\n return true;\n }\n }\n }\n\n throw new \\Exception('Widget config not found for widget '.ClassUtils::getClass($widget).'. Is this widget right declared in AppKernel ?');\n }", "public function getCache()\r\n {\r\n if ($this->exists('cache')) {\r\n return ROOT . $this->get('cache');\r\n }\r\n else\r\n return ROOT . '/cache';\r\n }", "function cacheing_environment()\n\t{\n\t\t$info=array();\n\t\t$info['cache_on']=array('block_youtube_channel__cache_on');\n\t\t$info['ttl']=intval(get_option('channel_update_time'));\n\t\treturn $info;\n\t}", "public function makeCacheHash() {}", "private function getCacheId()\n\t{\n\t\treturn self::CACHE_ID_PREFIX . '_' . $this->exportId . '_' . $this->type;\n\t}", "public function updateCache();", "function wp_start_object_cache()\n {\n }", "function tilemmetry_clear_cache()\n{\n theme_reset_all_caches();\n}", "public function memCached() { return true; }", "public function getFromCache() {}", "public function generateStats()\n {\n $this->cache = json_decode (file_get_contents ($this->cfg_cache_file), true);\n if (!is_array ($this->cache)) $this->cache = array();\n if (!isset ($this->cache['index'])) $this->cache['index'] = array();\n if (!isset ($this->cache['total'])) $this->cache['total'] = 0;\n if (!isset ($this->cache['size'])) $this->cache['size'] = 0;\n $edited = false;\n if (!isset ($this->cache['timecache']))\n {\n //print \"No cache\";\n $this->generateTimeInterval();\n $this->cache['timecache'] = array (\n \"generated\" => date (\"d-m-Y\"),\n \"day\" => $this->stats->screenshots_per_day,\n \"month\" => $this->stats->screenshots_per_month\n );\n }\n else\n {\n $today = date (\"d-m-Y\");\n $gen_month = false; $gen_day = false;\n if (substr ($today, 3) != substr ($this->cache['timecache']['generated'], 3))\n $gen_month = true;\n if ($today != $this->cache['timecache']['generated'])\n $gen_day = true;\n if ($gen_day || $gen_month)\n {\n $this->generateTimeInterval ($gen_month, $gen_day);\n //print \"Generating timecache: [{$gen_month} / {$gen_day}]\";\n $this->cache['timecache']['generated'] = $today;\n if ($gen_day)\n $this->cache['timecache']['day'] = $this->stats->screenshots_per_day;\n else\n $this->stats->screenshots_per_day = $this->cache['timecache']['day'];\n if ($gen_month)\n $this->cache['timecache']['month'] = $this->stats->screenshots_per_month;\n else\n $this->stats->screenshots_per_month = $this->cache['timecache']['month'];\n $edited = true;\n }\n else\n {\n $this->stats->screenshots_per_day = $this->cache['timecache']['day'];\n $this->stats->screenshots_per_month = $this->cache['timecache']['month'];\n }\n }\n // $this->cache = array ( 'total' => n, 'size' => n, 'index' => array ('name' => date)) )\n $flist = glob (\"{$this->cfg_img_path}/*.{{$this->cfg_extensions}}\", GLOB_BRACE);\n foreach ($flist as $file)\n {\n if (!isset ($this->cache['index'][$file]))\n {\n $edited = true;\n $_stat = stat ($file);\n $this->cache['index'][$file] = date ('d-m-Y', $_stat['mtime']) . '/' . $_stat['size'];\n $this->cache['size'] += $_stat['size'];\n $this->cache['total'] += 1;\n }\n $_date = substr ($this->cache['index'][$file], 0, strpos ($this->cache['index'][$file], '/'));\n $month = substr ($_date, 3);\n if (isset ($this->stats->screenshots_per_day[$_date]))\n $this->stats->screenshots_per_day[$_date]++;\n if (isset ($this->stats->screenshots_per_month[$month]))\n $this->stats->screenshots_per_month[$month]++;\n }\n if ($this->cfg_check_deleted)\n {\n foreach (array_diff (array_keys ($this->cache['index']), $flist) as $deleted)\n {\n $edited = true;\n $this->cache['size'] -= intval (substr ($this->cache['index'][$deleted], strpos ($this->cache['index'][$deleted], '/') + 1));\n $this->cache['total'] -= 1;\n unset ($this->cache['index'][$deleted]);\n }\n }\n $this->stats->total_files = $this->cache['total'];\n $this->stats->used_space = $this->cache['size'];\n //print_r ($this->stats->screenshots_per_day);\n //print($edited);\n if ($edited)\n file_put_contents ($this->cfg_cache_file, json_encode ($this->cache));\n return $this;\n }", "public function filterLoad($asset) {}", "private function isCacheable($width, $height)\n {\n if (!$this->cacheEnabled) {\n return false;\n }\n return !($width * $height) <= !65536;\n }", "protected function google_cache_limit() {\n\t\treturn (int) apply_filters( 'taro_geo_taxonomy_geocode_cache_time', 60 * 60 * 24 * 30 );\n\t}", "public function getDimensions() {}", "protected function getCache() {\n\t\t$factory = $this->policy('rate_factoryname');\n\t\t$lifetime = $this->policy('rate_lock_timeout') + 60; // As long as it's longer than the actual timeout\n\t\t$cache = SS_Cache::factory($factory);\n\t\t$cache->setOption('automatic_serialization', true);\n\t\t$cache->setOption('lifetime', $lifetime);\n\t\treturn $cache;\n\t}", "function getCachedFname( $xtile, $ytile, $zoom ) {\n $remoteImageFilename = \n \"http://a.tile.opencyclemap.org/cycle/$zoom/$xtile/$ytile.png\";\n // strip away everything except for /14/4944/6053\n $localImageFilename = preg_replace(\n \"/(http:\\/\\/)(.*?)(cycle\\/)(.*?)(.png)/\",\"\\\\4\", \n $remoteImageFilename);\n // replace the forward slash '/' with underscore '_'\n $localImageFilename = preg_replace(\"/\\//\",\"_\",\n $localImageFilename);\n $localImageDirectory = \"images\";\n $cacheName = \n $localImageDirectory . \"/\" . $localImageFilename . \".png\";\n // go get the remote image only if it's not in the cache\n // check to make sure it is strictly equal to false (===)\n if(file_exists($cacheName)===false){\n $image = file_get_contents($remoteImageFilename); \n file_put_contents($cacheName, $image);\n } \n return $cacheName;\n}", "public function run($assets)\n\t{\n\t\tif(!$this->has())\n\t\t{\n\t\t\tCache::put($this->name(), $assets, $this->time);\n\t\t}\n\t}", "abstract public function getCache( $cacheID = '', $unserialize = true );", "function wp_cache_init()\n{\n $autoloadFile = WP_CONTENT_DIR.'/mu-plugins/wp-stash/vendor/autoload.php';\n if (file_exists($autoloadFile)) {\n require_once $autoloadFile;\n }\n $GLOBALS['wp_object_cache'] = \\Inpsyde\\WpStash\\WpStash::instance()->objectCacheProxy();\n}", "private function generateCache()\n {\n $schmaTabls = [];\n foreach (self::$allSchema as $Schema) {\n $schmaTabls[] = Tools::parse_object_TO_array($Schema);\n }\n self::setgenerateCACHE_SELECT($schmaTabls);\n }", "public function getUseDiskCaching()\n {\n return $this->isUseDiskCaching();\n }" ]
[ "0.5057346", "0.50521183", "0.49822682", "0.4969355", "0.4966165", "0.49424198", "0.4926269", "0.48793554", "0.4820696", "0.4813766", "0.48108497", "0.48038468", "0.48013285", "0.47988585", "0.47981292", "0.47946182", "0.47656912", "0.47438052", "0.4728983", "0.47258827", "0.47207615", "0.47160298", "0.47022295", "0.4700416", "0.46965504", "0.46799913", "0.46566153", "0.4655325", "0.4647925", "0.46315473", "0.46085206", "0.46079868", "0.46020925", "0.45953274", "0.45934716", "0.4588061", "0.4578042", "0.45738876", "0.45610633", "0.45598418", "0.45536974", "0.45505327", "0.45487413", "0.4525514", "0.45170614", "0.45083886", "0.4505369", "0.4497892", "0.44798538", "0.44771817", "0.4467527", "0.44609854", "0.44401097", "0.44162643", "0.44142312", "0.44133067", "0.44076654", "0.44076246", "0.44073173", "0.44066536", "0.44045666", "0.4399592", "0.4398452", "0.43946135", "0.43931836", "0.4393151", "0.43899184", "0.4389639", "0.43807742", "0.43792492", "0.43666238", "0.43650296", "0.436466", "0.435807", "0.43549025", "0.43516782", "0.43461105", "0.43447736", "0.4343813", "0.43422005", "0.4337685", "0.4325241", "0.43249658", "0.4320369", "0.43163934", "0.4312989", "0.4310007", "0.43067634", "0.4302491", "0.43015563", "0.43014276", "0.42963472", "0.42940307", "0.42860714", "0.42826495", "0.42809284", "0.42806637", "0.42782155", "0.42774335", "0.42731512" ]
0.54231393
0
Set the quality to a value between 0 and 100
public function setQuality($quality) { $this->quality = $quality; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setQuality($value) {\n\t\t$this->_quality = $value;\n\t}", "public function setQuality($quality);", "public function setQuality($quality);", "public function setQuality($quality);", "public function quality($quality = 100)\n {\n if(is_numeric($quality))\n {\n $this->quality = $quality;\n }\n else\n {\n trigger_error('Picture quality must be numeric', E_USER_WARNING);\n }\n }", "function setThumbQuality( $iThumbQuality = 80 ){\n $this->iQuality = $iThumbQuality;\n }", "public function setQuality($value)\n {\n return $this->set(self::quality, $value);\n }", "public function updateQuality(): void\n {\n $this->getItem()->quality = $this->getNewQuality();\n\n if ($this->isQualityOverHighestValue()) {\n $this->setToHighestQuality();\n }\n if ($this->isQualityUnderLowestValue()) {\n $this->setToLowestQuality();\n }\n }", "public function ImageQuality($file_quality){\r\n $this->proc_filequality=$file_quality;\r\n }", "public function setQuality($intQuality = 75) {\r\n\t\t \t$this->objParent->jpeg_quality = (int) $intQuality;\r\n\t\t }", "public function setQuality($var)\n {\n GPBUtil::checkInt32($var);\n $this->quality = $var;\n\n return $this;\n }", "function setImageQuality($quality)\n {\n $this->imageQuality = $quality;\n }", "public function setQuality($quality)\n {\n $quality = abs((int)$quality);\n if (0 < $quality) {\n $this->_quality = $quality;\n }\n return $this;\n }", "public function customJpegQuality() {\n\t\treturn 80;\n\t}", "public function getQuality();", "public function getQuality();", "function getQuality() {return $this->_quality;}", "protected function setToLowestQuality(): void\n {\n $this->getItem()->quality = $this->getLowestQuality();\n }", "public function updateQuality() {\n\n if ($this->sellIn <= 0) {\n //Quality drops to 0 after the concert\n $this->quality = 0;\n }\n elseif ($this->sellIn <= 5) {\n //Quality increases by 3 when there are 5 days or less left\n $this->quality += 3;\n }\n elseif ($this->sellIn <= 10) {\n //Quality increases by 2 when there are 10 days or less left\n $this->quality += 2;\n } else {\n //Quality increases by 1 when there more than 10 days left\n $this->quality += 1;\n }\n\n //Limit quality to 50\n if ($this->quality > 50) {\n $this->quality = 50;\n }\n }", "public function quality($quality)\n\t{\n\t\t$this->quality = $quality;\n\t\treturn $this;\n\t}", "public function getQuality()\n {\n return $this->quality;\n }", "public function getQuality()\n {\n return $this->quality;\n }", "public function setQuality($var)\n {\n GPBUtil::checkString($var, True);\n $this->Quality = $var;\n\n return $this;\n }", "public function getQuality()\n {\n return $this->Quality;\n }", "protected function set_quality($quality) {\n\t\t\n\t\t$default\t= $this->get_quality_default();\n\t\t$ar_valid \t= $this->get_ar_quality();\n\t\t\n\t\tif(empty($quality)) {\n\t\t\t$this->quality = $default;\n\t\t\treturn $this->quality;\n\t\t}\n\t\t#dump($quality,\"QUALITY HERE\");\n\t\t#$quality \t= strtolower($quality);\t\t\t\n\t\t\n\t\tif(!is_array($ar_valid)) {\n\t\t\tthrow new Exception(\"config ar_valid is not defined!\", 1);\n\t\t}\n\t\t\n\t\tif(!in_array($quality,$ar_valid)) {\n\t\t\t$quality = $default ;\t\t#dump($ar_valid,\"$quality NO IS IN ARRAY !!!!!\");\n\t\t}\n\n\t\t$this->quality = $quality;\n\t\t\n\t\treturn $this->quality;\n\t}", "public function updateQuality() {\n\n if ($this->sellIn > 0) {\n //Not reached sellby date\n $this->quality -= 2;\n } else {\n //Passed sellby date, so decrease in quality twice as fast\n $this->quality -= 4;\n }\n\n //Quality cannot be less than zero\n if ($this->quality < 0){\n $this->quality = 0;\n }\n }", "public function getQuality()\n {\n return $this->_quality;\n }", "function jpeg_quality_callback($arg)\n{\n\treturn (int)100;\n}", "public function setJPGQuality( $quality ) {\n\t\t$this->jpg_quality = $quality;\n\t}", "public function get_quality()\n {\n }", "public function jpeg($param, $value)\n\t{\n\t\t$property = 'jpeg_' . $param;\t\n\t\t$this->handle->jpeg_quality = (int)$value;\n\t}", "public function getQuality() {\n\t\treturn $this->_quality;\n\t}", "public function updateQuality(): void\n {\n foreach ($this->items as $item) {\n $this->updateItemQuality($item);\n }\n }", "private function processQualityOption()\n {\n $options = $this->options;\n $source = $this->source;\n\n $q = $options['quality'];\n if ($q == 'auto') {\n if (($this->/** @scrutinizer ignore-call */getMimeTypeOfSource() == 'image/jpeg')) {\n $q = JpegQualityDetector::detectQualityOfJpg($source);\n if (is_null($q)) {\n $q = $options['default-quality'];\n $this->/** @scrutinizer ignore-call */logLn(\n 'Quality of source could not be established (Imagick or GraphicsMagick is required)' .\n ' - Using default instead (' . $options['default-quality'] . ').'\n );\n\n $this->qualityCouldNotBeDetected = true;\n } else {\n if ($q > $options['max-quality']) {\n $this->logLn(\n 'Quality of source is ' . $q . '. ' .\n 'This is higher than max-quality, so using max-quality instead (' .\n $options['max-quality'] . ')'\n );\n } else {\n $this->logLn('Quality set to same as source: ' . $q);\n }\n }\n $q = min($q, $options['max-quality']);\n } else {\n //$q = $options['default-quality'];\n $q = min($options['default-quality'], $options['max-quality']);\n $this->logLn('Quality: ' . $q . '. ');\n }\n } else {\n $this->logLn(\n 'Quality: ' . $q . '. '\n );\n if (($this->getMimeTypeOfSource() == 'image/jpeg')) {\n $this->logLn(\n 'Consider setting quality to \"auto\" instead. It is generally a better idea'\n );\n }\n }\n $this->calculatedQuality = $q;\n }", "public function handler_wp_editor_set_quality( $quality, $mime_type = '' )\n\t\t{\n\t\t\treturn apply_filters( 'avf_wp_editor_set_quality', $this->config['default_jpeg_quality'], $quality, $mime_type );\n\t\t}", "function getQuality() {\n $quality = 0;\n $randNum = mt_rand(0, 100);\n\n if ($randNum < 30) { // 30%\n $quality = 0;\n }\n else if ($randNum < 55) { // 25%\n $quality = 1;\n }\n else if ($randNum < 75) { // 20%\n $quality = 2;\n }\n else if ($randNum < 90) { // 15%\n $quality = 3;\n }\n else if ($randNum < 97) { // 7%\n $quality = 4;\n }\n else if ($randNum <= 100) { // 3%\n $quality = 5;\n }\n\n return $quality;\n}", "public function update(): void\n {\n // Update quality\n $this->item->quality = self::QUALITY_MAX;\n }", "public function setQuality($quality = null)\n {\n if ($quality !== null && ($quality < 1 || $quality > 100)) {\n throw new \\InvalidArgumentException('$quality has to be between 1 and 100, ' . $quality . ' given.');\n }\n\n $this->quality = $quality;\n\n return $this;\n }", "public function getQuality()\n {\n $value = $this->get(self::quality);\n return $value === null ? (double)$value : $value;\n }", "public function quality() {\n\t\tif (!$bitRate = $this->get('bitRate')) {\n\t\t\treturn;\n\t\t}\n\t\tif (!$bitRateMax = $this->get('bitRateMax')) { // i.e. mpeg has max = 500000\n\t\t\t$bitRateMax = 320000;\n\t\t}\n\t\t$bitRateMin = 32000;\n\n\t\t$qualityMax = 5;\n\t\t$qualityMin = 1;\n\n\t\t/* Normalize between 1 and 5 where min = 32000 and max = see above */\n\t\tif ($bitRate >= $bitRateMax) {\n\t\t\t$quality = $qualityMax;\n\t\t} elseif ($bitRate <= $bitRateMin) {\n\t\t\t$quality = $qualityMin;\n\t\t} else {\n\t\t\t$quality =\n\t\t\t\t(($bitRate - $bitRateMin) / ($bitRateMax - $bitRateMin))\n\t\t\t\t* ($qualityMax - $qualityMin)\n\t\t\t\t+ $qualityMin;\n\t\t}\n\t\treturn (integer) round($quality);\n\t}", "public function quality(int $quality): static\n {\n if ($quality < 0 || $quality > 100) {\n throw new Exception('The quality must ranges from 0 to 100.');\n }\n\n $this->quality = $quality;\n\n return $this;\n }", "public function updateQuality()\n {\n foreach ($this->items as $item) {\n if ($item->name != 'Aged Brie' and $item->name != 'Backstage passes to a TAFKAL80ETC concert') {\n if ($item->quality > 0) {\n if ($item->name != 'Sulfuras, Hand of Ragnaros') {\n $item->quality = $item->quality - 1;\n }\n }\n } else {\n if ($item->quality < 50) {\n $item->quality = $item->quality + 1;\n if ($item->name == 'Backstage passes to a TAFKAL80ETC concert') {\n if ($item->sellIn < 11) {\n if ($item->quality < 50) {\n $item->quality = $item->quality + 1;\n }\n }\n if ($item->sellIn < 6) {\n if ($item->quality < 50) {\n $item->quality = $item->quality + 1;\n }\n }\n }\n }\n }\n \n if ($item->name != 'Sulfuras, Hand of Ragnaros') {\n $item->sellIn = $item->sellIn - 1;\n }\n \n if ($item->sellIn < 0) {\n if ($item->name != 'Aged Brie') {\n if ($item->name != 'Backstage passes to a TAFKAL80ETC concert') {\n if ($item->quality > 0) {\n if ($item->name != 'Sulfuras, Hand of Ragnaros') {\n $item->quality = $item->quality - 1;\n }\n }\n } else {\n $item->quality = $item->quality - $item->quality;\n }\n } else {\n if ($item->quality < 50) {\n $item->quality = $item->quality + 1;\n }\n }\n }\n }\n }", "private function increaseQuality(Item $item): void\n {\n $this->itemManipulator->increaseQuality($item, $this->itemKnowledge->getQualityIncrement($item));\n }", "public function getNewQuality(): int\n {\n return $this->item->quality + $this->getQualityStep();\n }", "protected function normalizeImageQuality(int $quality): int\n\t{\n\t\treturn max(min((int) $quality, 100), 1);\n\t}", "public function handler_wp_jpeg_quality( $quality, $context = '' )\n\t\t{\n\t\t\treturn apply_filters( 'avf_jpeg_quality', $this->config['default_jpeg_quality'], $quality, $context );\n\t\t}", "public function getQualityIndex()\r\n {\r\n return $this->quality;\r\n }", "public function setQualityIndex(int $quality)\r\n {\r\n if($quality <= 9 && $quality >= 0)\r\n {\r\n $this->quality = $quality;\r\n }\r\n\r\n return $this;\r\n }", "private function setQuality($sks = 0, $final = 0)\r\n\t{\r\n\t\tif($this->setGrade($final) == 'A')\r\n\t\t\treturn ($sks * 4);\r\n\t\telseif ($this->setGrade($final) == 'B')\r\n\t\t\treturn ($sks * 3);\r\n\t\telseif ($this->setGrade($final) == 'C')\r\n\t\t\treturn ($sks * 2);\r\n\t\telseif ($this->setGrade($final) == 'D')\r\n\t\t\treturn ($sks * 1);\r\n\t\telse\r\n\t\t\treturn ($sks * 0);\r\n\t}", "public function filter_jpeg_quality(){\n\t return self::jpeg_quality;\n }", "public function getQuality()\r\n\t{\r\n\t\tif($this->getGrade() == 'A')\r\n\t\t\treturn ($this->sks * 4);\r\n\t\telseif ($this->getGrade() == 'B')\r\n\t\t\treturn ($this->sks * 3);\r\n\t\telseif ($this->getGrade() == 'C')\r\n\t\t\treturn ($this->sks * 2);\r\n\t\telseif ($this->getGrade() == 'D')\r\n\t\t\treturn ($this->sks * 1);\r\n\t\telse\r\n\t\t\treturn ($this->sks * 0);\r\n\t}", "public function setJPEGQuality($quality = 100) {\r\n\t\t$this->tcpdf->setJPEGQuality($quality);\r\n\t\treturn $this;\r\n\t}", "public function testSaveWithQuality(): void\n {\n $this->assertThumbPath($this->getThumbCreatorInstance()->resize(200)->save(['quality' => 10]));\n\n //With an invalid value\n $this->expectException(InvalidArgumentException::class);\n $this->getThumbCreatorInstanceWithSave('', ['quality' => 101]);\n }", "protected function get_default_quality($mime_type)\n {\n }", "public static function getHighestQuality(): int\n {\n return static::$highestQuality;\n }", "function setRatio( $fRatio = 0.65 ){\n $this->fRatio = $fRatio;\n }", "public function testSaveWithQualityImageEquals(): void\n {\n $thumb = $this->getThumbCreatorInstance()->resize(200)->save(['quality' => 10]);\n $this->assertImageFileEquals('resize_w200_h200_quality_10.jpg', $thumb);\n }", "public function save($file=null, $quality=null);", "function chooseQuality($qualities, $bandwidths, $resolutions, $resp_times, $source_file){\n // 1. Check if the original quality is requested\n $force_quality = (isset($_GET['force_res']) && $_GET['force_res'] == 1);\n if($force_quality)\n {\n return DEFAULT_JPG_QUALITY;\n }\n\t\n // 2. Check if client is known as mobile\n $is_mobile = is_mobile();\n\n // 3. Get Client Width\n $client_width = 1; // Some low value to trigger the mobile-first behavior if the cookie is nok\n if (isset($_COOKIE['yarii_resolution'])) {\n $cookie_value = $_COOKIE['yarii_resolution'];\n\n // does the cookie look valid? [whole number, comma, potential floating number]\n if (! preg_match(\"/^[0-9]+$/\", \"$cookie_value\")) { // no it doesn't look valid\n setcookie(\"yarii_resolution\", \"$cookie_value\", time()-100); // delete the mangled cookie\n }\n else { // the cookie is valid, do stuff with it\n $client_width = (int) $cookie_value; // the base resolution (CSS pixels)\n }\n } else {\n if((MOBILE_FIRST && !$force_quality) || $is_mobile)\n {\n return min($qualities);\n } else {\n return DEFAULT_JPG_QUALITY;\n }\n }\n\n // 4. Get Client PixelRatio\n $client_pixelratio = 1;\n if (isset($_COOKIE['yarii_pixelratio'])) {\n $cookie_value = $_COOKIE['yarii_pixelratio'];\n\n // does the cookie look valid? [whole number, comma, potential floating number]\n if (! preg_match(\"/^[0-9\\.]+$/\", \"$cookie_value\")) { // no it doesn't look valid\n setcookie(\"yarii_pixelratio\", \"$cookie_value\", time()-100); // delete the mangled cookie\n }\n else { // the cookie is valid, do stuff with it\n $client_pixelratio = (int) $cookie_value; //\n }\n }\n\n // 5. Get Client Bandwidth\n $client_bandwidth = 0.0001; // Some low value to trigger the mobile-first behavior if the cookie is nok\n if (isset($_COOKIE['yarii_bandwidth'])) {\n $cookie_value = $_COOKIE['yarii_bandwidth'];\n\n // does the cookie look valid? [whole number, comma, potential floating number]\n if (! preg_match(\"/^[0-9]+$/\", \"$cookie_value\")) { // no it doesn't look valid\n setcookie(\"yarii_pixelratio\", \"$cookie_value\", time()-100); // delete the mangled cookie\n }\n else { // the cookie is valid, do stuff with it\n $client_bandwidth = (int) $cookie_value; // the base resolution (CSS pixels)\n }\n } else {\n if((MOBILE_FIRST && !$force_quality) || $is_mobile)\n {\n return min($qualities);\n } else {\n return DEFAULT_JPG_QUALITY;\n }\n }\n $source_size_kb = round(filesize($source_file) / 1024, 2);\n $dl_time = round($source_size_kb / $client_bandwidth * 100, 2);\n\n\t// 6. If client is mobile and low-bandwidh, stop now & give minimal quality\n if($is_mobile && $client_bandwidth < 100)\n {\n return min($qualities);\n }\n\n // 7. Sorting of the break-points\n rsort($qualities);\n sort($bandwidths);\n rsort($resp_times);\n\n $requested_width = $client_width * $client_pixelratio;\n\n\t//8. Evaluate Quality\n $quality = getCalcQual($qualities, $resolutions, $requested_width);\n\n\t//9. Evaluate Download Time\n\t$time = getCalcDlTime($resp_times, $dl_time);\n\n\t//10. Get total score\n $score = $quality['score'] + $time['score'];\n\n\t//11. Calculate target score\n $target_score = count($qualities) - 1;\n\n // 12. PixelRatio impact\n if(!$force_quality && $score < $target_score && $client_pixelratio > 1)\n {\n $quality = getCalcQual($qualities, $resolutions, $client_width);\n $time = getCalcDlTime($resp_times, $dl_time);\n\n $score = $quality['score'] + $time['score'];\n }\n\n // 13. Quality adjustment along bandwidth score\n if(!$force_quality && $score < $target_score)\n {\n $res_points_to_gain = $target_score - $score;\n $res_index = min($quality['score'] + $res_points_to_gain, count($qualities) - 1);\n\n $quality['quality'] = $qualities[$res_index];\n }\n\n return $quality['quality'];\n}", "public static function getLowestQuality(): int\n {\n return static::$lowestQuality;\n }", "public static function get_ar_quality() {\t\t\t\n\t\treturn unserialize(DEDALO_PDF_AR_QUALITY);\t\t\n\t}", "public function setScaling($scaling = 100) {}", "public function getQuality()\r\n\t{\r\n\t\t$quality = 0;\r\n\r\n\t\tforeach ($this->_sum('quality')->result() as $row) \r\n\t\t\t$quality = $row->quality;\r\n\r\n\t\treturn $quality;\r\n\t}", "public function set_questions_quality($questions_quality)\n\t{\n\t\tif (is_null($questions_quality)) {\n\t\t\tthrow new InvalidArgumentException(\"Project Questions Quality Invalid!\");\n\t\t}\n\t\t$this->questions_quality = $questions_quality;\n\t}", "public function getCalculatedQuality()\n {\n $this->processQualityOptionIfNotAlready();\n return $this->calculatedQuality;\n }", "public static function generateQualityValue(): int\n {\n return rand(self::getLowestQuality(), self::getHighestQuality());\n }", "public function set_quality_scores($quality_scores)\n\t{\n\t\tif (is_null($quality_scores)) {\n\t\t\tthrow new InvalidArgumentException(\"Quality Scores Invalid!\");\n\t\t}\n\t\t$this->quality_scores = $quality_scores;\n\t}", "public static function BEST()\n {\n return new Vp9Quality(self::BEST);\n }", "public function getQualityStep(): int\n {\n return static::$qualityStep * $this->getMultiplier();\n }", "private function decreaseQuality(Item $item): void\n {\n $this->itemManipulator->decreaseQuality($item, $this->itemKnowledge->getQualityDecrement($item));\n }", "public function getQualityID()\n {\n return $this->qualityID;\n }", "public function setResolution($value)\n {\n $this->setItemValue('resolution', (string)$value);\n }", "private function updateItemQuality(Item $item): void\n {\n if ($this->itemKnowledge->isLegendary($item)) {\n return;\n }\n\n if ($this->itemKnowledge->qualityIncreasesWithAge($item)) {\n $this->increaseQuality($item);\n } else {\n $this->decreaseQuality($item);\n }\n\n $this->itemManipulator->decreaseSellIn($item);\n\n if ($this->itemKnowledge->isExpired($item)) {\n if ($this->itemKnowledge->qualityIncreasesAfterExpiration($item)) {\n $this->increaseQuality($item);\n } elseif ($this->itemKnowledge->qualityResetsAfterExpiration($item)) {\n $this->itemManipulator->resetQuality($item);\n } else {\n $this->decreaseQuality($item);\n }\n }\n }", "public static function GOOD()\n {\n return new Vp9Quality(self::GOOD);\n }", "public function videoQuality($videoQuality)\n {\n return $this->setProperty('videoQuality', $videoQuality);\n }", "public function setProgress($p)\r\n {\r\n // 0.0 <= $p <= 1.0\r\n $this->progress = intval( $p * 100 );\r\n }", "public function fit()\n\t{\n\t\t// Load image\n\t\tif( $this->im == NULL) $this->im = imagecreatefromstring( file_get_contents( $this->imageFilePath ) );\n\n\t\tif($this->resizeFlag)\n\t\t{\n\t\t\t$newWidth=$this->width;\n\t\t\t$newHeight=$this->height;\n\t\n\t\t\t$t=imagecreatetruecolor($newWidth,$newHeight);\n\t\t\timagecopyresampled($t,$this->im,0,0,0,0,$newWidth,$newHeight,imagesx($this->im),imagesy($this->im));\n\t\t\timagedestroy($this->im);\n\t\t\t$this->im=$t;\n\t\t\t//imagedestroy($t);\t\n\t\t\t$this->debug[]=\"[RESIZE] TRUE -> $newWidth $newHeight\";\n\t\t}\n\n\t\t// Counter to keep track of iterations\n\t\t$cc = 0;\n\n\t\t// Use the buffer NOT the filesystem to compute intermediate image size\n\t\tob_start();\n\n\t\t// Loop forever\n\t\twhile( true )\n\t\t{\n\t\t\t// Empty buffer\n\t\t\tob_clean();\n\n\t\t\t// Keep track of previous quality setting\n\t\t\t$this->cq = $this->q;\n\n\t\t\t// Create and fill buffer with image with current quality setting\n\t\t\timagejpeg( $this->im, NULL, $this->cq );\n\n\t\t\t// Compute current image size from size of buffer\n\t\t\t$currentSize = strlen( ob_get_contents() );\n\n\t\t\t// Some debug\n\t\t\t$this->debug[] = \" \" . $this->low . \" >>> \" . $this->cq . \" <<< \" . $this->high . \" [ $currentSize / \" . $this->targetSize . \" ]\";\n\n\t\t\t// Break loop if target size is reached - very rare!\n\t\t\tif ( $currentSize == $this->targetSize )\n\t\t\t\tbreak;\n\n\t\t\t// If size > target then change quality range\n\t\t\tif ( $currentSize > $this->targetSize )\n\t\t\t{\n\t\t\t\t$this->high = $this->q;\n\t\t\t\t$this->q = ( $this->q + $this->low ) / 2;\n\t\t\t}\n\n\t\t\t// If size < target then change quality range\n\t\t\tif ( $currentSize < $this->targetSize )\n\t\t\t{\n\t\t\t\t$this->low = $this->q;\n\t\t\t\t$this->q = ( $this->q + $this->high ) / 2;\n\t\t\t}\n\n\t\t\t// Break loop if high/low gap below precision AND size is < target size\n\t\t\tif ( ( ( $this->high - $this->low ) < $this->precision ) && ( $currentSize <= $this->targetSize ) )\n\t\t\t\tbreak;\n\n\t\t\t// Break loop of counter has reached maximum iterations - target size either to low/high\n\t\t\tif ( $cc == $this->maxIterations )\n\t\t\t\tbreak;\n\n\t\t\t// Continue loop incrementing counter\n\t\t\t$cc++;\n\t\t}\n\n\t\t// Final debug\n\t\t$this->debug[] = \"Final Quality Setting = \" . $this->cq;\n\n\t\t// Disable buffer\n\t\tob_end_clean();\n\t}", "public function setMaxRatioOfConcealedSamples($val)\n {\n $this->_propDict[\"maxRatioOfConcealedSamples\"] = $val;\n return $this;\n }", "public function setResolution()\n\t{\n\t\t$args=func_get_args();\n\n\t\tif(count($args)==0 or count($args)>2) return;\n\n\t\t$this->resizeFlag=true;\n\n\t\t$this->width=$args[0];\n\t\t$this->height=$args[1];\n\n\t}", "public function setLowFrameRateRatio($val)\n {\n $this->_propDict[\"lowFrameRateRatio\"] = $val;\n return $this;\n }", "public function qualityOf($type, $precision= 3) {\n if (isset($this->list[$type])) {\n $q= $this->list[$type];\n } else {\n $q= 0.0;\n foreach ($this->list as $preference => $q) {\n if (preg_match('#('.strtr(preg_quote($preference, '#'), array('\\*' => '[^ ]+')).')#', $type, $matches)) break;\n }\n }\n return round($q, $precision);\n }", "protected function getPercentageToMaxQuality($currQuality, $threshold){\n if($currQuality>$threshold){\n return 100 - (int)((($currQuality-$threshold)/$currQuality)*100);\n }\n return 89;\n }", "public function setMag($mag_)\n\t{\n\t\t$s = $mag_ / $this->mag();\n\t\t$this->scale($s);\n\t}", "private function determineQuality($accuracy = 0, $quality_calibration = 0){\n\n if ($quality_calibration == 0)\n return 'unknown';\n\n if ($accuracy <= $quality_calibration * 0.5)\n return 'excellent';\n else if ($accuracy <= $quality_calibration * 1.5)\n return 'good';\n else if ($accuracy <= $quality_calibration * 4)\n return 'mediocre';\n else\n return 'total crap';\n\n }", "public function getPhoneNumberQualityAllowableValues()\n {\n return [\n self::PHONE_NUMBER_QUALITY_GREEN,\n self::PHONE_NUMBER_QUALITY_YELLOW,\n self::PHONE_NUMBER_QUALITY_RED,\n ];\n }", "public function getAudioQualityAllowableValues()\n {\n return [\n self::AUDIO_QUALITY_EMPTY,\n self::AUDIO_QUALITY_GOOD,\n self::AUDIO_QUALITY_FAIR,\n self::AUDIO_QUALITY_POOR,\n self::AUDIO_QUALITY_BAD,\n ];\n }", "public function setUpQuality(GildedRose $gildedRose, int $times): void\n {\n for ($x = 0; $x < $times; $x++) {\n $gildedRose->updateQuality();\n }\n }", "function pixelgrade_aspect_ratio_cb( $value, $selector, $property, $unit ) {\n\t\t$min = 0;\n\t\t$max = 200;\n\n\t\t$value = intval( $value );\n\t\t$center = ( $max - $min ) / 2;\n\t\t$offset = $value / $center - 1;\n\n\t\tif ( $offset >= 0 ) {\n\t\t\t$padding = 100 + $offset * 100 . '%';\n\t\t} else {\n\t\t\t$padding = 100 + $offset * 50 . '%';\n\t\t}\n\n\t\t$output = '';\n\n\t\t$output .= $selector . ' {\n\t\t\tpadding-top: ' . $padding . ';\n\t\t}\n\t\t';\n\n\t\treturn $output;\n\t}", "public function get_questions_quality()\n\t{\n\t\treturn $this->questions_quality;\n\t}", "function pixelgrade_aspect_ratio_cb_customizer_preview() {\n\n\t\t$js = \"\nfunction pixelgrade_aspect_ratio_cb( value, selector, property, unit ) {\n\n var css = '',\n style = document.getElementById('pixelgrade_aspect_ratio_cb_style_tag'),\n head = document.head || document.getElementsByTagName('head')[0];\n\n var min = 0,\n max = 200,\n center = (max - min) / 2,\n offset = value / center - 1,\n padding;\n\n if ( offset >= 0 ) {\n padding = 100 + offset * 100 + '%';\n } else {\n padding = 100 + offset * 50 + '%';\n }\n\n css += selector + ' {' +\n 'padding-top: ' + padding +\n '}';\n\n if ( style !== null ) {\n style.innerHTML = css;\n } else {\n style = document.createElement('style');\n style.setAttribute('id', 'pixelgrade_aspect_ratio_cb_style_tag');\n\n style.type = 'text/css';\n if ( style.styleSheet ) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n\n head.appendChild(style);\n }\n}\n\";\n\n\t\twp_add_inline_script( 'customify-previewer-scripts', $js );\n\t}", "public function get_quality_scores()\n\t{\n\t\treturn $this->quality_scores;\n\t}", "public function setSensitivity($val)\n {\n $this->_propDict[\"sensitivity\"] = intval($val);\n return $this;\n }", "function scale($scale) {\r\n\t\t$width = $this->getWidth() * $scale/100;\r\n\t\t$height = $this->getheight() * $scale/100;\r\n\t\t$this->resize($width,$height);\r\n\t}", "public function update(): void\n {\n // Update quality\n if ($this->item->sell_in > 10) {\n $this->item->quality++;\n }\n\n if ($this->item->sell_in <= 10 && $this->item->sell_in > 5) {\n $this->item->quality += 2;\n }\n\n if ($this->item->sell_in <= 5 && $this->item->sell_in > 0) {\n $this->item->quality += 3;\n }\n\n // Update Sell in\n $this->updateSellIn();\n\n if ($this->item->sell_in < 0) {\n $this->item->quality = 0;\n }\n\n $this->checkAndUpdateQualityByRange();\n }", "function percentage_rate_class($value, $base = 50)\n {\n if(!is_numeric($value)) {\n $value = 0;\n }\n\n $percentage = (float)$value;\n\n if($percentage == 100) {\n return 'excelent';\n }\n\n if($percentage == 0) {\n return 'neutral';\n }\n\n if($percentage < $base) {\n return 'poor';\n }\n\n return 'ok';\n }", "public function setMaxHeartRate($val){\n $this->maxHeartRate = $val;\n return $this;\n }", "public function getVideoQualityAllowableValues()\n {\n return [\n self::VIDEO_QUALITY_EMPTY,\n self::VIDEO_QUALITY_GOOD,\n self::VIDEO_QUALITY_FAIR,\n self::VIDEO_QUALITY_POOR,\n self::VIDEO_QUALITY_BAD,\n ];\n }", "function setMaxForThumbSize( $iMaxForThumbSize = 2000 ){\n $this->iMaxForThumbSize = $iMaxForThumbSize;\n }", "public function background($color, $quality=null);", "protected function setProductivity()\n {\n $this->productivity = random_int(8, 12);\n }" ]
[ "0.8168144", "0.78837025", "0.78837025", "0.78837025", "0.7682368", "0.76328367", "0.75868124", "0.7327609", "0.7066521", "0.7057268", "0.7054614", "0.7013433", "0.69637066", "0.69614404", "0.6952476", "0.6952476", "0.6913004", "0.6871415", "0.6861292", "0.6856504", "0.6779842", "0.6779842", "0.6744047", "0.6704513", "0.66951174", "0.667168", "0.6653426", "0.66345584", "0.6625059", "0.66131836", "0.6584146", "0.65491587", "0.64967847", "0.63699347", "0.6365135", "0.63379407", "0.6334896", "0.6326576", "0.63230234", "0.6316837", "0.6251148", "0.6202507", "0.6123383", "0.6122675", "0.6115099", "0.60979533", "0.60891795", "0.5886465", "0.5885251", "0.5841412", "0.58286256", "0.5820947", "0.5816581", "0.57930356", "0.57594776", "0.56917894", "0.56826335", "0.5635432", "0.56192255", "0.5606871", "0.55819577", "0.55688846", "0.5533635", "0.55277693", "0.5496089", "0.54776365", "0.54742837", "0.54570615", "0.54245967", "0.54051816", "0.54032046", "0.54022056", "0.53872025", "0.5339595", "0.5331725", "0.52869385", "0.5286694", "0.5243075", "0.52183014", "0.5213854", "0.5176748", "0.5169093", "0.5164195", "0.51280284", "0.512458", "0.51244646", "0.5105228", "0.5102675", "0.5019418", "0.5009606", "0.5003888", "0.4971163", "0.49432465", "0.49198326", "0.49160758", "0.49109364", "0.48943242", "0.48845887", "0.4873116", "0.48556784" ]
0.6641235
27
Resize an image, skewing it as necessary.
public function resize($width, $height) { return $this->createCloneWithResource( function (InterventionImage $resource) use ($width, $height) { return $resource->resize($width, $height); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function sharpenImage()\n\t{\n\t\t$this->checkImage();\n\n\t\tif (!$this->saveState && $this->sharpen == true) {\n\t\t\t$sharpness = $this->findSharp($this->width, $this->optimalWidth);\n\t\t\t$sharpenMatrix = array(\n\t\t\t\tarray(-1, -2, -1),\n\t\t\t\tarray(-2, $sharpness + 12, -2),\n\t\t\t\tarray(-1, -2, -1)\n\t\t\t);\n\t\t\t$divisor = $sharpness;\n\t\t\t$offset = 0;\n\t\t\tif (function_exists('imageconvolution')) {\n\t\t\t\timageconvolution($this->imageResized, $sharpenMatrix, $divisor, $offset);\n\t\t\t} else {\n\t\t\t\t$this->imageconvolution($this->imageResized, $sharpenMatrix, $divisor, $offset);\n\t\t\t}\n\t\t}\n\t}", "function image_scale($src_abspath, $dest_abspath, $aspect, $width, $strategy)\n{\n $im = new \\Imagick($src_abspath);\n $im = image_scale_im_obj($im, $aspect, $width, $strategy);\n return image_return_write($im, $dest_abspath);\n}", "function resize_image($src, $width, $height){\n // initializing\n $save_path = Wordless::theme_temp_path();\n $img_filename = Wordless::join_paths($save_path, md5($width . 'x' . $height . '_' . basename($src)) . '.jpg');\n\n // if file doesn't exists, create it\n if (!file_exists($img_filename)) {\n $to_scale = 0;\n $to_crop = 0;\n\n // Get orig dimensions\n list ($width_orig, $height_orig, $type_orig) = getimagesize($src);\n\n // get original image ... to improve!\n switch($type_orig){\n case IMAGETYPE_JPEG: $image = imagecreatefromjpeg($src);\n break;\n case IMAGETYPE_PNG: $image = imagecreatefrompng($src);\n break;\n case IMAGETYPE_GIF: $image = imagecreatefromgif($src);\n break;\n default:\n return;\n }\n\n // which is the new smallest?\n if ($width < $height)\n $min_dim = $width;\n else\n $min_dim = $height;\n\n // which is the orig smallest?\n if ($width_orig < $height_orig)\n $min_orig = $width_orig;\n else\n $min_orig = $height_orig;\n\n // image of the right size\n if ($height_orig == $height && $width_orig == $width) ; // nothing to do\n // if something smaller => scale\n else if ($width_orig < $width) {\n $to_scale = 1;\n $ratio = $width / $width_orig;\n }\n else if ($height_orig < $height) {\n $to_scale = 1;\n $ratio = $height / $height_orig;\n }\n // if both bigger => scale\n else if ($height_orig > $height && $width_orig > $width) {\n $to_scale = 1;\n $ratio_dest = $width / $height;\n $ratio_orig = $width_orig / $height_orig;\n if ($ratio_dest > $ratio_orig)\n $ratio = $width / $width_orig;\n else\n $ratio = $height / $height_orig;\n }\n // one equal one bigger\n else if ( ($width == $width_orig && $height_orig > $height) || ($height == $height_orig && $width_orig > $width) )\n $to_crop = 1;\n // some problem...\n else\n echo \"ALARM\";\n\n // we need to zoom to get the right size\n if ($to_scale == 1) {\n $new_width = $width_orig * $ratio;\n $new_height = $height_orig * $ratio;\n $image_scaled = imagecreatetruecolor($new_width, $new_height);\n // scaling!\n imagecopyresampled($image_scaled, $image, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);\n $image = $image_scaled;\n\n if($new_width > $width || $new_height > $height)\n $to_crop = 1;\n }\n else {\n $new_width = $width_orig;\n $new_height = $height_orig;\n }\n\n // we need to crop the image\n if ($to_crop == 1) {\n $image_cropped = imagecreatetruecolor($width, $height);\n\n // find margins for images\n $margin_x = ($new_width - $width) / 2;\n $margin_y = ($new_height - $height) / 2;\n\n // cropping!\n imagecopy($image_cropped, $image, 0, 0, $margin_x, $margin_y, $width, $height);\n $image = $image_cropped;\n }\n\n // Save image\n imagejpeg($image, $img_filename, 95);\n }\n\n // Return image URL\n return Wordless::join_paths(Wordless::theme_temp_path(), basename($img_filename));\n }", "protected function widenResizeMagic(): void\n {\n $this->image->widen($this->widenResize, function ($constraint) {\n $constraint->upsize();\n });\n }", "private function doImageResize($img)\n\t{\n\t\t// Determine the new dimensions:\n\t\t$d = $this->getNewDims($img);\n\n\t\t// Determine what functions to use:\n\t\t$funcs = $this->getImageFunctions($img);\n\n\t\t// Create the image resources for resampling:\n\t\t$src_img = $funcs[0]($img);\n\t\t$new_img = $this->imageCreateTransparent($d[0], $d[1]);\n\n\t\tif(imagecopyresampled(\n\t\t\t$new_img, $src_img, 0, 0, 0, 0, $d[0], $d[1], $d[2], $d[3]\n\t\t\t))\n\t\t\t{\n\t\t\t\timagedestroy($src_img);\n\t\t\t\tif($new_img && $funcs[1]($new_img, $img))\n\t\t\t\t{\n\t\t\t\t\timagedestroy($new_img);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception('Failed to save the new image!');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Exception('Could not resample the image!');\n\t\t\t}\n\t}", "function image_scale_im_obj(\\Imagick $im, $aspect, $width, $strategy)\n{\n\n $height = round(($width/$aspect['width'])*$aspect['height']);\n\n $source_w = $im->getImageWidth();\n $source_h = $im->getImageHeight();\n $source_a = $source_h / $source_w;\n $target_a = $aspect['height'] / $aspect['width'];\n\n switch ($strategy) {\n case 'resize':\n $im->scaleImage($width, $height);\n break;\n case 'crop-top':\n if ($target_a < $source_a) {\n $im->scaleImage($width, 0);\n $im->cropImage($width, $height, 0, 0);\n } else {\n $im->scaleImage(0, $height);\n $im->cropImage($width, $height, 0, 0);\n }\n break;\n case 'crop-bottom':\n if ($target_a < $source_a) {\n $im->scaleImage($width, 0);\n $im->cropImage($width, $height, 0, $im->getImageHeight() - $height);\n } else {\n $im->scaleImage(0, $height);\n $im->cropImage($width, $height, $im->getImageWidth() - $width, 0);\n }\n break; \n case 'crop':\n default:\n $im->cropThumbnailImage($width, $height);\n break; \n }\n $im->setImageFormat('jpeg');\n $im->gaussianBlurImage(0.05, 0.5);\n $im->setImageCompressionQuality(75);\n $im->setInterlaceScheme(\\Imagick::INTERLACE_PLANE);\n $im->stripImage();\n return $im;\n}", "private static function resize_image($source, $width, $height){\n\t\t$source_width = imagesx($source);\n\t\t$source_height = imagesy($source);\n\t\t$source_aspect = round($source_width / $source_height, 1);\n\t\t$target_aspect = round($width / $height, 1);\n\t\n\t\t$resized = imagecreatetruecolor($width, $height);\n\t\n\t\tif ($source_aspect < $target_aspect){\n\t\t\t// higher\n\t\t\t$new_size = array($width, ($width / $source_width) * $source_height);\n\t\t\t$source_pos = array(0, (($new_size[1] - $height) * ($source_height / $new_size[1])) / 2);\n\t\t}else if ($source_aspect > $target_aspect){\n\t\t\t// wider\n\t\t\t$new_size = array(($height / $source_height) * $source_width, $height);\n\t\t\t$source_pos = array((($new_size[0] - $width) * ($source_width / $new_size[0])) / 2, 0);\n\t\t}else{\n\t\t\t// same shape\n\t\t\t$new_size = array($width, $height);\n\t\t\t$source_pos = array(0, 0);\n\t\t}\n\t\n\t\tif ($new_size[0] < 1) $new_size[0] = 1;\n\t\tif ($new_size[1] < 1) $new_size[1] = 1;\n\t\n\t\timagecopyresampled($resized, $source, 0, 0, $source_pos[0], $source_pos[1], $new_size[0], $new_size[1], $source_width, $source_height);\n\t\n\t\treturn $resized;\n\t}", "public function runStretchResize(Image $image, int $width, int $height) : Image\n\t{\n\t\treturn $image->resize($width, $height);\n\t}", "private function _scale()\n\t{\n\t\t//scale down the image by 55%\n\t\t$weaponImageSize = $this->weapon->getImageGeometry();\n\t\t$this->weaponScale['w'] = $weaponImageSize['width'] * 0.55;\n\t\t$this->weaponScale['h'] = $weaponImageSize['height'] * 0.55;\n\n\t\t$this->weapon->scaleImage($this->weaponScale['w'], $this->weaponScale['h']);\n\n\t\t//scale down the image by 30%\n\t\t$emblemImageSize = $this->emblem->getImageGeometry();\n\t\t$this->emblemScale['w'] = $emblemImageSize['width'] * 0.30;\n\t\t$this->emblemScale['h'] = $emblemImageSize['height'] * 0.30;\n\n\t\t$this->emblem->scaleImage($this->emblemScale['w'], $this->emblemScale['h']);\n\n\t\t//scale down the image by 70%\n\t\t$profileImageSize = $this->profile->getImageGeometry();\n\t\t$this->profileScale['w'] = $profileImageSize['width'] * 0.70;\n\t\t$this->profileScale['h'] = $profileImageSize['height'] * 0.70;\n\n\t\t$this->profile->scaleImage($this->profileScale['w'], $this->profileScale['h']);\n\t}", "function resize_square($size){\n\n //container for new image\n $new_image = imagecreatetruecolor($size, $size);\n\n\n if($this->width > $this->height){\n $this->resize_by_height($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, ($this->get_width() - $size) / 2, 0, $size, $size);\n }else{\n $this->resize_by_width($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, 0, ($this->get_height() - $size) / 2, $size, $size);\n }\n\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $size;\n $this->height = $size;\n\n return true;\n }", "function sharpen_resized_jpeg_images($resized_file) {\r\n $image = wp_load_image($resized_file); \r\n if(!is_resource($image))\r\n return new WP_Error('error_loading_image', $image, $file); \r\n $size = @getimagesize($resized_file);\r\n if(!$size)\r\n return new WP_Error('invalid_image', __('Could not read image size'), $file); \r\n list($orig_w, $orig_h, $orig_type) = $size; \r\n switch($orig_type) {\r\n case IMAGETYPE_JPEG:\r\n $matrix = array(\r\n array(-1, -1, -1),\r\n array(-1, 16, -1),\r\n array(-1, -1, -1),\r\n ); \r\n $divisor = array_sum(array_map('array_sum', $matrix));\r\n $offset = 0; \r\n imageconvolution($image, $matrix, $divisor, $offset);\r\n imagejpeg($image, $resized_file,apply_filters('jpeg_quality', 90, 'edit_image'));\r\n break;\r\n case IMAGETYPE_PNG:\r\n return $resized_file;\r\n case IMAGETYPE_GIF:\r\n return $resized_file;\r\n } \r\n return $resized_file;\r\n}", "protected function resize()\n {\n $width = $this->width;\n $height = $this->height;\n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n // Determine new image dimensions\n if($this->mode === \"crop\"){ // Crop image\n \n $max_width = $crop_width = $width;\n $max_height = $crop_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if($orig_width > $orig_height){ // Original is wide\n $height = $max_height;\n $width = ceil($y_ratio * $orig_width);\n \n } elseif($orig_height > $orig_width){ // Original is tall\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n \n } else { // Original is square\n $this->mode = \"fit\";\n \n return $this->resize();\n }\n \n // Adjust if the crop width is less than the requested width to avoid black lines\n if($width < $crop_width){\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n }\n \n } elseif($this->mode === \"fit\"){ // Fits the image according to aspect ratio to within max height and width\n $max_width = $width;\n $max_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if( ($orig_width <= $max_width) && ($orig_height <= $max_height) ){ // Image is smaller than max height and width so don't resize\n $tn_width = $orig_width;\n $tn_height = $orig_height;\n \n } elseif(($x_ratio * $orig_height) < $max_height){ // Wider rather than taller\n $tn_height = ceil($x_ratio * $orig_height);\n $tn_width = $max_width;\n \n } else { // Taller rather than wider\n $tn_width = ceil($y_ratio * $orig_width);\n $tn_height = $max_height;\n }\n \n $width = $tn_width;\n $height = $tn_height;\n \n } elseif($this->mode === \"fit-x\"){ // Sets the width to the max width and the height according to aspect ratio (will stretch if too small)\n $height = @round($orig_height * $width / $orig_width);\n \n if($orig_height <= $height){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n \n } elseif($this->mode === \"fit-y\"){ // Sets the height to the max height and the width according to aspect ratio (will stretch if too small)\n $width = @round($orig_width * $height / $orig_height);\n \n if($orig_width <= $width){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n } else {\n throw new \\Exception('Invalid mode: ' . $this->mode);\n }\n \n\n // Resize\n $this->temp = imagecreatetruecolor($width, $height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n \n imagecopyresampled($this->temp, $this->image, 0, 0, 0, 0, $width, $height, $orig_width, $orig_height);\n $this->sync();\n \n \n // Cropping?\n if($this->mode === \"crop\"){ \n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n $x_mid = $orig_width/2; // horizontal middle\n $y_mid = $orig_height/2; // vertical middle\n \n $this->temp = imagecreatetruecolor($crop_width, $crop_height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n\n imagecopyresampled($this->temp, $this->image, 0, 0, ($x_mid-($crop_width/2)), ($y_mid-($crop_height/2)), $crop_width, $crop_height, $crop_width, $crop_height);\n $this->sync();\n }\n }", "private function doImageResize($img){\n\t\t//Determine the new dimensions\n\t\t$d=$this->getNewDims($img);\n\t\t\n\t\t//Determine which function to use\n\t\t$funcs=$this->getImageFunctions($img);\n\t\t\n\t\t//Determine the image type\n\t\t$src_img=$funcs[0]($img);\n\t\t\n\t\t//Determine the new image size\n\t\t$new_img=imagecreatetruecolor($d[0], $d[1]);\n\t\t\n\t\tif(imagecopyresampled\n\t\t\t\t($new_img, $src_img, 0, 0, 0, 0, $d[0],$d[1] , $d[2], $d[3])){\n\t\t\timagedestroy($src_img);\n\t\t\t//check if the new image has the same file type as the original one\n\t\t\tif($new_img && $funcs[1]($new_img,$img)){\n\t\t\t\timagedestroy($new_img);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthrow new Exception('Failed to save the new image!');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception(\"Could not resample the image!\");\n\t\t}\n\t\t\n\t}", "function resizeImage($image,$width,$height,$scale) {\n\t\t\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\t\t$newImageWidth = ceil($width * $scale);\n\t\t\t\t$newImageHeight = ceil($height * $scale);\n\t\t\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\t$source=imagecreatefromgif($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\t$source=imagecreatefromjpeg($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\t$source=imagecreatefrompng($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\t\t\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\timagegif($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\timagejpeg($newImage,$image,90);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\timagepng($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tchmod($image, 0777);\n\t\t\t\treturn $image;\n\t\t\t}", "function resizeImage($image,$width,$height) {\n\t$newImageWidth = $width;\n\t$newImageHeight = $height;\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t$source = imagecreatefromjpeg($image);\n\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\timagejpeg($newImage,$image,90);\n\tchmod($image, 0777);\n\treturn $image;\n}", "private function sharpenImage($image) {\n $matrix = array(\n array(-1,-1,-1,),\n array(-1,16,-1,),\n array(-1,-1,-1,)\n );\n $divisor = 8;\n $offset = 0;\n imageconvolution($image, $matrix, $divisor, $offset);\n if($this->verbose) {\n $this->createVerbose('Applying filter: Sharpen');\n }\n return $image;\n }", "protected function scaleImages() {}", "function resize($width, $height){\n\n $new_image = imagecreatetruecolor($width, $height);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->get_width(), $this->get_height());\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $width;\n $this->height = $height;\n\n return true;\n }", "function resize($width,$height)\n {\n $new_image = imagecreatetruecolor($width, $height);\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $new_image; \n }", "function scaleByFactor($size)\r\n {\r\n $new_x = round($size * $this->img_x, 0);\r\n $new_y = round($size * $this->img_y, 0);\r\n return $this->_resize($new_x, $new_y);\r\n }", "public function resizeTo($width, $height, $resizeOption = 'default') {\n switch (strtolower($resizeOption)) {\n case 'exact':\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n break;\n case 'maxwidth':\n $this->resizeWidth = $width;\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n break;\n case 'maxheight':\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n break;\n case 'proportionally':\n $ratio_orig = $this->origWidth / $this->origHeight;\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n if ($width / $height > $ratio_orig)\n $this->resizeWidth = $height * $ratio_orig;\n else\n $this->resizeHeight = $width / $ratio_orig;\n break;\n default:\n if ($this->origWidth > $width || $this->origHeight > $height) {\n if ($this->origWidth > $this->origHeight) {\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n $this->resizeWidth = $width;\n } else if ($this->origWidth < $this->origHeight) {\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n break;\n }\n\n $this->newImage = imagecreatetruecolor($this->resizeWidth, $this->resizeHeight);\n if ($this->ext == \"image/gif\" || $this->ext == \"image/png\") {\n imagealphablending($this->newImage, false);\n imagesavealpha($this->newImage, true);\n $transparent = imagecolorallocatealpha($this->newImage, 255, 255, 255, 127);\n imagefilledrectangle($this->newImage, 0, 0, $this->resizeWidth, $this->resizeHeight, $transparent);\n }\n imagecopyresampled($this->newImage, $this->image, 0, 0, 0, 0, $this->resizeWidth, $this->resizeHeight, $this->origWidth, $this->origHeight);\n }", "public function resize($width, $height, $crop_top = 0, $crop_bottom = 0, $crop_left = 0, $crop_right = 0) {}", "function resize( $w = 0, $h = 0 )\n\t{\n\t\tif( $w == 0 || $h == 0 )\n\t\t\treturn FALSE;\n\t\t\n\t\t//get the size of the current image\n\t\t$oldsize = $this->size();\n\t\t\n\t\t//create a target canvas\n\t\t$new_im = imagecreatetruecolor ( $w, $h );\n\t\n\t\t//copy and resize image to new canvas\n\t\timagecopyresampled( $new_im, $this->im, 0, 0, 0, 0, $w, $h, $oldsize->w, $oldsize->h );\n\t\t\n\t\t//delete the old image handle\n\t\timagedestroy( $this->im );\n\t\t\n\t\t//set the new image as the current handle\n\t\t$this->im = $new_im;\n\t}", "function image_scale_blob($blob, $aspect, $width, $strategy)\n{\n $im = new \\Imagick();\n $im->readImageBlob($blob);\n $im = image_scale_im_obj($im, $aspect, $width, $strategy);\n return image_return_blob($im);\n}", "protected function _do_resize($width, $height)\n {\n $pre_width = $this->width;\n $pre_height = $this->height;\n\n // Loads image if not yet loaded\n $this->_load_image();\n\n // Test if we can do a resize without resampling to speed up the final resize\n if ($width > ($this->width / 2) AND $height > ($this->height / 2))\n {\n // The maximum reduction is 10% greater than the final size\n $reduction_width = round($width * 1.1);\n $reduction_height = round($height * 1.1);\n\n while ($pre_width / 2 > $reduction_width AND $pre_height / 2 > $reduction_height)\n {\n // Reduce the size using an O(2n) algorithm, until it reaches the maximum reduction\n $pre_width /= 2;\n $pre_height /= 2;\n }\n\n // Create the temporary image to copy to\n $image = $this->_create($pre_width, $pre_height);\n\n if (imagecopyresized($image, $this->_image, 0, 0, 0, 0, $pre_width, $pre_height, $this->width, $this->height))\n {\n // Swap the new image for the old one\n imagedestroy($this->_image);\n $this->_image = $image;\n }\n }\n\n // Create the temporary image to copy to\n $image = $this->_create($width, $height);\n\n // Execute the resize\n if (imagecopyresampled($image, $this->_image, 0, 0, 0, 0, $width, $height, $pre_width, $pre_height))\n {\n // Swap the new image for the old one\n imagedestroy($this->_image);\n $this->_image = $image;\n\n // Reset the width and height\n $this->width = imagesx($image);\n $this->height = imagesy($image);\n }\n }", "function resizeImage($image,$width,$height,$scale) {\n\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t$imageType = image_type_to_mime_type($imageType);\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t\t\t$source=imagecreatefromgif($image); \n\t\t\tbreak;\n\t case \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\tbreak;\n\t case \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\t$source=imagecreatefrompng($image); \n\t\t\tbreak;\n \t}\n\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t \t\timagegif($newImage,$image); \n\t\t\tbreak;\n \tcase \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t \t\timagejpeg($newImage,$image,90); \n\t\t\tbreak;\n\t\tcase \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\timagepng($newImage,$image); \n\t\t\tbreak;\n }\n\t\n\tchmod($image, 0777);\n\treturn $image;\n}", "public function resize($newWidth, $newHeight, $option='auto')\n\t{\n\t\t// Reset\n\t\tif ($this->imageResized) {\n\t\t\timagedestroy($this->imageResized);\n\t\t}\n\t\t$this->saveState = false;\n\n\t\t// Get optimal width and height based on $option\n\t\t$optionArray = $this->getDimensions((int)$newWidth, (int)$newHeight, $option);\n\t\t$this->optimalWidth = round($optionArray['optimalWidth']);\n\t\t$this->optimalHeight = round($optionArray['optimalHeight']);\n\n\t\t// Resample - create image canvas of x, y size\n\t\t$this->imageResized = imagecreatetruecolor($this->optimalWidth, $this->optimalHeight);\n\t\tif (imagetypes() & IMG_PNG) {\n\t\t\timagesavealpha($this->imageResized, true);\n\t\t\timagealphablending($this->imageResized, false);\n\t\t}\n\t\timagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $this->optimalWidth, $this->optimalHeight, $this->width, $this->height);\n\n\t\t// If option is 'crop', then crop too\n\t\tif ($option == 'crop') {\n\t\t\t$this->cropImage($this->optimalWidth, $this->optimalHeight, $newWidth, $newHeight);\n\t\t}\n\n\t\treturn $this;\n\t}", "private function resize($width,$height) {\n $newImage = imagecreatetruecolor($width, $height);\n imagealphablending($newImage, false);\n imagesavealpha($newImage, true);\n imagecopyresampled($newImage, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $newImage;\n }", "public function resize_fit(IImageInformation $src, $width, $height);", "function resizeImage($image,$width,$height,$scale,$stype) {\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($stype) {\n case 'gif':\n $source = imagecreatefromgif($image);\n break;\n case 'jpg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'jpeg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'png':\n $source = imagecreatefrompng($image);\n break;\n }\n\timagecopyresampled($newImage, $source,0,0,0,0, $newImageWidth, $newImageHeight, $width, $height);\n\timagejpeg($newImage,$image,90);\n\tchmod($image, 0777);\n\treturn $image;\n}", "function imgResize($filename, $newWidth, $newHeight, $dir_out){\n\t\n\t// изменение размера изображения\n\n\t// 1 создадим новое изображение из файла\n\t$scr = imagecreatefromjpeg($filename); // или $imagePath\n\t\n\t// 2 создадим новое полноцветное изображение нужного размера\n\t$newImg = imagecreatetruecolor($newWidth, $newHeight);\n\n\t// 3 определим размер исходного изображения для 4 пункта\n\t$size = getimagesize($filename);\n\n\t// 4 копирует прямоугольную часть одного изображения на другое изображение, интерполируя значения пикселов таким образом, чтобы уменьшение размера изображения не уменьшало его чёткости\n\timagecopyresampled($newImg, $scr, 0, 0, 0, 0, $newWidth, $newHeight, $size[0], $size[1]);\n\n\t// 5 запишем изображение в файл по нужному пути\n\timagejpeg($newImg, $dir_out);\n\n\timagedestroy($scr);\n\timagedestroy($newImg);\t\t\n\t\n}", "function imageResize($imageResourceId=null,$width=null,$height=null, $targetWidth=null, $targetHeight=null) {\n\n// $targetWidth =300;\n// $targetHeight =260;\n// dd($imageResourceId,$width,$height, $targetWidth, $targetHeight);\n\n $targetLayer=imagecreatetruecolor($targetWidth,$targetHeight);\n imagecopyresampled($targetLayer,$imageResourceId,0,0,0,0,$targetWidth,$targetHeight, $width,$height );\n// imagecopyresized($targetLayer,$imageResourceId,0,0,0,0, $width,$height,$targetWidth,$targetHeight);\n\n return $targetLayer;\n }", "function scaleByLength($size)\r\n {\r\n if ($this->img_x >= $this->img_y) {\r\n $new_x = $size;\r\n $new_y = round(($new_x / $this->img_x) * $this->img_y, 0);\r\n } else {\r\n $new_y = $size;\r\n $new_x = round(($new_y / $this->img_y) * $this->img_x, 0);\r\n }\r\n return $this->_resize($new_x, $new_y);\r\n }", "function resize_image($file, $w, $h, $crop=FALSE) {\n list($width, $height) = getimagesize($file);\n $r = $w / $h;\n $rate = $width / $height;\n // if we want it cropped\n if ($crop) {\n if ($rate < $r) {\n $src_w = $width;\n $src_h = ceil($width / $r);\n $src_x = 0;\n $src_y = ceil(($height - $src_h) / 2);\n $dst_w = $w;\n $dst_h = $h;\n $dst_x = 0;\n $dst_y = 0;\n }\n else {\n $src_w = ceil($r * $height);\n $src_h = $height;\n $src_x = ceil(($width - $src_w) / 2);\n $src_y = 0;\n $dst_w = $w;\n $dst_h = $h;\n $dst_x = 0;\n $dst_y = 0;\n }\n $newwidth = $w;\n $newheight = $h;\n }\n // if we don't want it cropped\n else {\n if ($rate < $r) {\n $src_w = $width;\n $src_h = $height;\n $src_x = 0;\n $src_y = 0;\n $dst_w = $h * $rate;\n $dst_h = $h;\n $dst_x = 0;\n $dst_y = 0;\n }\n else {\n $src_w = $width;\n $src_h = $height;\n $src_x = 0;\n $src_y = 0;\n $dst_w = $w;\n $dst_h = $w / $rate;\n $dst_x = 0;\n $dst_y = 0;\n }\n $newwidth = $dst_w;\n $newheight = $dst_h;\n }\n \n $type = strtolower(substr(strrchr($file,\".\"),1));\n if($type == 'jpeg') $type = 'jpg';\n switch($type){\n case 'bmp': $src_image = @imagecreatefromwbmp($file); break;\n case 'gif': $src_image = @imagecreatefromgif($file); break;\n case 'jpg': $src_image = @imagecreatefromjpeg($file); break;\n case 'png': $src_image = @imagecreatefrompng($file); break;\n default : return \"Unsupported picture type!\";\n } \n \n if ($src_image) {\n $dst_image = imagecreatetruecolor($newwidth, $newheight);\n imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);\n return $dst_image;\n } else {\n return null;\n }\n }", "public function resize(IImageInformation $src, $width, $height);", "private function resizeWithScaleExact($width, $height, $scale) {\n\t\t//$new_height = (int)($this->info['height'] * $scale);\n\t\t$new_width = $width * $scale;\n\t\t$new_height = $height * $scale;\n\t\t$xpos = 0;//(int)(($width - $new_width) / 2);\n\t\t$ypos = 0;//(int)(($height - $new_height) / 2);\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/gif' && $this->isAnimated) {\n $this->imagick = new Imagick($this->file);\n $this->imagick = $this->imagick->coalesceImages();\n foreach ($this->imagick as $frame) {\n $frame->thumbnailImage($new_width, $new_height);\n $frame->setImagePage($new_width, $new_height, 0, 0);\n }\n } else {\n $image_old = $this->image;\n $this->image = imagecreatetruecolor($width, $height);\n $bcg = $this->backgroundColor;\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/png') {\n imagealphablending($this->image, false);\n imagesavealpha($this->image, true);\n $background = imagecolorallocatealpha($this->image, $bcg[0], $bcg[1], $bcg[2], 127);\n imagecolortransparent($this->image, $background);\n } else {\n $background = imagecolorallocate($this->image, $bcg[0], $bcg[1], $bcg[2]);\n }\n\n imagefilledrectangle($this->image, 0, 0, $width, $height, $background);\n imagecopyresampled($this->image, $image_old, $xpos, $ypos, 0, 0, $new_width, $new_height, $this->info['width'], $this->info['height']);\n imagedestroy($image_old);\n }\n\n\t\t$this->info['width'] = $width;\n\t\t$this->info['height'] = $height;\n }", "public function createThumbnail($imageName,$newWidth,$newHeight) {\n $path = $this->img_dir . '/' . $imageName;\n $mime_info = getimagesize($path);\n $mime = $mime_info['mime'];\n\n $src_img = $this->image_data($path, $mime);\n if($src_img===false) return false;\n\n $old_w = imageSX($src_img);\n $old_h = imageSY($src_img);\n\n $source_aspect_ratio = $old_w / $old_h;\n $desired_aspect_ratio = $newWidth / $newHeight;\n\n if ($source_aspect_ratio > $desired_aspect_ratio) {\n /*\n * Triggered when source image is wider\n */\n $thumb_h = $newHeight;\n $thumb_w = ( int ) ($newHeight * $source_aspect_ratio);\n } else {\n /*\n * Triggered otherwise (i.e. source image is similar or taller)\n */\n $thumb_w = $newWidth;\n $thumb_h = ( int ) ($newWidth / $source_aspect_ratio);\n }\n\n $dst_img = ImageCreateTrueColor($thumb_w,$thumb_h);\n\n $color = imagecolorallocatealpha($dst_img, 0, 0, 0, 127);\n imagefill($dst_img,0,0,$color);\n imagesavealpha($dst_img, true);\n\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_w, $old_h);\n\n if($this->is_crop_hard) {\n $x = ($thumb_w - $newWidth) / 2;\n $y = ($thumb_h - $newHeight) / 2;\n\n $tmp_img = imagecreatetruecolor($newWidth, $newHeight);\n $color = imagecolorallocatealpha($tmp_img, 0, 0, 0, 127);\n imagefill($tmp_img,0,0,$color);\n imagesavealpha($tmp_img, true);\n\n imagecopy($tmp_img, $dst_img, 0, 0, $x, $y, $newWidth, $newHeight);\n $dst_img = $tmp_img;\n }\n\n $new_thumb_loc = $this->thumb_dir . $imageName;\n $result = $this->save($dst_img, $new_thumb_loc, $mime);\n\n imagedestroy($dst_img);\n imagedestroy($src_img);\n return $result;\n }", "public function resize($width, $height)\n\t{\n\t\t$wScale = $this->width / $width;\n\t\t$hScale = $this->height / $height;\n\t\t$maxScale = max($wScale, $hScale);\n\t\t// Decrease image dimensions\n\t\tif($maxScale > 1)\n\t\t{\n\t\t\t$width = $this->width / $maxScale;\n\t\t\t$height = $this->height / $maxScale;\n\t\t}\n\t\t// Increase image dimensions\n\t\telse\n\t\t{\n\t\t\t$minScale = min($wScale, $hScale);\n\t\t\t$width = $this->width / $minScale;\n\t\t\t$height = $this->height / $minScale;\n\t\t}\n\t\t$image = imagecreatetruecolor($this->width, $this->height);\n\t\timagecopyresampled($image, $this->image, 0, 0, 0, 0, $width, $height, $this->width, $this->height);\n\n\t\t$this->image = $image;\n\t\t$this->width = $width;\n\t\t$this->height = $height;\n\t}", "public static function resize($image, $width, $height, $keepAspectRatio = true, $allowUpscaling = false)\n {\n $img = self::ensureImageInterfaceInstance($image)->copy();\n\n /** @var BoxInterface $sourceBox */\n $sourceBox = $img->getSize();\n $destinationBox = static::getBox($sourceBox, $width, $height, $keepAspectRatio);\n\n if ($allowUpscaling === false && self::isUpscaling($sourceBox, $destinationBox)) {\n return $img;\n }\n\n return $img->resize($destinationBox);\n }", "public function sizeImg($width, $height, $crop = true);", "function funcs_imageResize(&$width, &$height, $target, $bywidth = null) {\n\tif ($width<=$target && $height<=$target){\n\t\treturn;\n\t}\n\t//takes the larger size of the width and height and applies the \n\t//formula accordingly...this is so this script will work \n\t//dynamically with any size image \n\tif (is_null($bywidth)){\n\t\tif ($width > $height) { \n\t\t\t$percentage = ($target / $width); \n\t\t} else { \n\t\t\t$percentage = ($target / $height); \n\t\t}\n\t}else{\n\t\tif ($bywidth){\n\t\t\t$percentage = ($target / $width);\n\t\t\t//if height would increase as a result\n\t\t\tif ($height < round($height * $percentage)){\n\t\t\t\treturn;\n\t\t\t} \n\t\t}else{\n\t\t\t$percentage = ($target / $height); \n\t\t\t//if width would increase as a result\n\t\t\tif ($width < round($width * $percentage)){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t} \n\t//gets the new value and applies the percentage, then rounds the value \n\t$width = round($width * $percentage); \n\t$height = round($height * $percentage); \n}", "function resize($image_name, $size, $folder_name) {\n $file_extension = getFileExtension($image_name);\n switch ($file_extension) {\n case 'jpg':\n case 'jpeg':\n $image_src = imagecreatefromjpeg($folder_name . '/' . $image_name);\n break;\n case 'png':\n $image_src = imagecreatefrompng($folder_name . '/' . $image_name);\n break;\n case 'gif':\n $image_src = imagecreatefromgif($folder_name . '/' . $image_name);\n break;\n }\n $true_width = imagesx($image_src);\n $true_height = imagesy($image_src);\n\n $width = $size;\n $height = ($width / $true_width) * $true_height;\n\n $image_des = imagecreatetruecolor($width, $height);\n\n imagecopyresampled($image_des, $image_src, 0, 0, 0, 0, $width, $height, $true_width, $true_height);\n\n switch ($file_extension) {\n case 'jpg':\n case 'jpeg':\n imagejpeg($image_des, $folder_name . '/' . $image_name, 100);\n break;\n case 'png':\n imagepng($image_des, $folder_name . '/' . $image_name, 8);\n break;\n case 'gif':\n imagegif($image_des, $folder_name . '/' . $image_name, 100);\n break;\n }\n return $image_des;\n}", "function resize_image($filename)\n {\n $img_source = 'assets/images/products/'. $filename;\n $img_target = 'assets/images/thumb/';\n\n // image lib settings\n $config = array(\n 'image_library' => 'gd2',\n 'source_image' => $img_source,\n 'new_image' => $img_target,\n 'maintain_ratio' => FALSE,\n 'width' => 128,\n 'height' => 128\n );\n // load image library\n $this->load->library('image_lib', $config);\n\n // resize image\n if(!$this->image_lib->resize())\n echo $this->image_lib->display_errors();\n $this->image_lib->clear();\n }", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t$source = imagecreatefromjpeg($image);\n\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\timagejpeg($newImage,$thumb_image_name,90);\n\tchmod($thumb_image_name, 0777);\n\treturn $thumb_image_name;\n}", "public function sharpenAction()\n {\n $image = __DIR__ . '/../../../data/media/test.jpg';\n $sharpen = $this->thumbnailer->createSharpen();\n $thumb = $this->thumbnailer->create($image, [], [$sharpen]);\n\n $thumb\n ->resize(200, 200)\n ->show()\n ->save('public/sharpen_test.jpg');\n\n return false;\n }", "public function autoScale($img, $size) {\n\t// NOT YET IMPLEMENTED.\n}", "function resizeImage($src_file, $dest_file, $new_size=100, $resize_aspect=\"sq\", $quality=\"80\")\n\t{\n\t\t$imginfo = getimagesize($src_file);\n\t\t\n\t\tif ($imginfo == null) {\n\t\treturn false;\n\t\t}\t \n\t\t\n\t\t// GD2 can only handle JPG, PNG & GIF images\n\t\tif (!$imginfo[2] > 0 && $imginfo[2] <= 3 ) {\n\t\t return false;\n\t\t}\n\t\t\n\t\t// height/width\n\t\t$srcWidth = $imginfo[0];\n\t\t$srcHeight = $imginfo[1];\n\t\t//$resize_aspect = \"sq\";\n\t\tif ($resize_aspect == 'ht') {\n\t\t $ratio = $srcHeight / $new_size;\n\t\t} elseif ($resize_aspect == 'wd') {\n\t\t $ratio = $srcWidth / $new_size;\n\t\t} elseif ($resize_aspect == 'sq') {\n\t\t $ratio = min($srcWidth, $srcHeight) / $new_size;\n\t\t} else {\n\t\t $ratio = max($srcWidth, $srcHeight) / $new_size;\n\t\t}\n\t\t\n\t\t/**\n\t\t* Initialize variables\n\t\t*/\n\t\t$clipX = 0;\n\t\t$clipY = 0;\n\t\t\n\t\t$ratio = max($ratio, 1.0);\n\t\tif ($resize_aspect == 'sq'){\n\t\t$destWidth = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\t$destHeight = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\tif($srcHeight > $srcWidth){\n\t\t$clipX = 0;\n\t\t$clipY = ((int)($srcHeight - $srcWidth)/2);\n\t\t$srcHeight = $srcWidth;\n\t\t}elseif($srcWidth > $srcHeight){\n\t\t$clipX = ((int)($srcWidth - $srcHeight)/2);\n\t\t$clipY = 0;\n\t\t$srcWidth = $srcHeight;\n\t\t}\n\t\t}else{\n\t\t$destWidth = (int)($srcWidth / $ratio);\n\t\t$destHeight = (int)($srcHeight / $ratio);\n\t\t}\n\t\t\n\t\tif (!function_exists('imagecreatefromjpeg')) {\n\t\t echo 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed';\n\t\t exit;\n\t\t}\n\t\tif (!function_exists('imagecreatetruecolor')) {\n\t\t echo 'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the admin page';\n\t\t exit;\n\t\t}\n\t\t\n\t\tif ($imginfo[2] == 1 )\n\t\t $src_img = imagecreatefromgif($src_file);\n\t\telseif ($imginfo[2] == 2)\n\t\t $src_img = imagecreatefromjpeg($src_file);\n\t\telse\n\t\t $src_img = imagecreatefrompng($src_file);\n\t\tif (!$src_img){\n\t\t return false;\n\t\t}\n\t\tif ($imginfo[2] == 1 ) {\n\t\t$dst_img = imagecreate($destWidth, $destHeight);\n\t\t} else {\n\t\t$dst_img = imagecreatetruecolor($destWidth, $destHeight);\n\t\t}\n\t\t\n\t\timagecopyresampled($dst_img, $src_img, 0, 0, $clipX, $clipY, (int)$destWidth, (int)$destHeight, $srcWidth, $srcHeight);\n\t\timagejpeg($dst_img, $dest_file, $quality);\n\t\timagedestroy($src_img);\n\t\timagedestroy($dst_img);\n\t\t\n\t\t// We check that the image is valid\n\t\t$imginfo = getimagesize($dest_file);\n\t\tif ($imginfo == null) {\n\t\t\t@unlink($dest_file);\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "private function intern_resize($newWidth, $newHeight, $keepRatio = true)\n\t{\n\t\t$this->newOrientation = ($newWidth > $newHeight) ? EImageProcessor::LANDSCAPE : EImageProcessor::PORTRAIT;\n\t\tif ($keepRatio !== true)\n\t\t\t$this->newImage = imagescale($this->srcImage, $newWidth, $newHeight);\n\t\telse {\n\t\t\t/*\n\t\t * Crop-to-fit PHP-GD\n\t\t * http://salman-w.blogspot.com/2009/04/crop-to-fit-image-using-aspphp.html\n\t\t *\n\t\t * Resize and center crop an arbitrary size image to fixed width and height\n\t\t * e.g. convert a large portrait/landscape image to a small square thumbnail\n\t\t *\n\t\t * Modified by Fry\n\t\t\t */\n\t\t\t$desired_aspect_ratio = $newWidth / $newHeight;\n\n\t\t\tif ($this->srcAspectRatio < $desired_aspect_ratio) {\n\t\t\t\t/*\n\t\t\t\t * Triggered when source image is taller\n\t\t\t\t */\n\t\t\t\t$temp_height = $newHeight;\n\t\t\t\t$temp_width = ( int )($newHeight * $this->srcAspectRatio);\n\t\t\t} else {\n\t\t\t\t/*\n\t\t\t\t * Triggered otherwise (i.e. source image is similar or wider)\n\t\t\t\t */\n\t\t\t\t$temp_width = $newWidth;\n\t\t\t\t$temp_height = ( int )($newWidth / $this->srcAspectRatio);\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Resize the image into a temporary GD image\n\t\t\t */\n\n\t\t\t$tempImage = imagecreatetruecolor($temp_width, $temp_height);\n\t\t\t$transparent = imagecolortransparent($tempImage, imagecolortransparent ($this->srcImage));\n\t\t\timagefill($tempImage, 0, 0, $transparent);\n\t\t\timagecopyresampled(\n\t\t\t\t$tempImage,\n\t\t\t\t$this->srcImage,\n\t\t\t\t0, 0,\n\t\t\t\t0, 0,\n\t\t\t\t$temp_width, $temp_height,\n\t\t\t\t$this->srcWidth, $this->srcHeight\n\t\t\t);\n\n\t\t\t$x0 = ($newWidth - $temp_width ) / 2;\n\t\t\t$y0 = ($newHeight - $temp_height) / 2;\n\n\t\t\t$this->newImage = imagecreatetruecolor($newWidth, $newHeight);\n\t\t\t$transparent = imagecolortransparent($this->newImage, imagecolorallocatealpha($this->newImage, 255, 235, 215, 127));\n\t\t\timagefill($this->newImage, 0, 0, $transparent);\n\t\t\timagecopyresampled(\n\t\t\t\t$this->newImage,\t\t\t$tempImage,\n\t\t\t\t$x0, $y0,\t\t\t\t\t0, 0,\n\t\t\t\t$temp_width, $temp_height, \t$temp_width, $temp_height\n\t\t\t);\n\t\t\timagedestroy($tempImage);\n\t\t}\n\t}", "public function image_fixed_resize($width, $height, $crop = true){\n $ratio = $this->width / $this->height;\n $original_ratio = $width / $height;\n\n $crop_width = $this->width;\n $crop_height = $this->height;\n\n if($ratio > $original_ratio)\n {\n $crop_width = round($original_ratio * $crop_height);\n }\n else\n {\n $crop_height = round($crop_width / $original_ratio);\n }\n if($crop)\n $this->crop($crop_width, $crop_height);\n $this->resize($width, $height);\n }", "function ImageResize($w, $h, $from, $to, $upsample = false) {\n\t$im_infos = getimagesize($from);\n\t\n\tif ($im_infos)\n\t{\n\t\t//$mts[\"total\"][\"start\"] = microtime(true);\n\t\t$data = file_get_contents($from);\n\t\t//$mts[\"imagecreatefromjpeg\"][\"start\"] = microtime(true);\n\t\t$im = @imagecreatefromstring($data);\n\t\t\n\t\t/*switch ($im_infos[2])\n\t\t{\n\t\t\tcase IMAGETYPE_GIF :\t$im = @imagecreatefromgif($from); break;\n\t\t\tcase IMAGETYPE_JPEG :\t$im = @imagecreatefromjpeg($from); break;\n\t\t\tcase IMAGETYPE_PNG :\t$im = @imagecreatefrompng($from); break;\n\t\t\tdefault :\t\t\t\t$im = false; break;\n\t\t}*/\n\t\t//$mts[\"imagecreatefromjpeg\"][\"end\"] = microtime(true);\n\t\t\n\t\t$w_ratio = $im_infos[0] / $w;\t// Width Ratio\n\t\t$h_ratio = $im_infos[1] / $h;\t// Height Ratio\n\t\t\n\t\tif ($w_ratio > 1 || $h_ratio > 1)\n\t\t{\n\t\t\t// Image > max size -> resizing keeping the ratio\n\t\t\t$ratio = max($w_ratio, $h_ratio);\n\t\t\t\n\t\t\t$wd = floor($im_infos[0] / $ratio);\t// Width Destination\n\t\t\t$hd = floor($im_infos[1] / $ratio);\t// Height Destination\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($upsample)\n\t\t\t{\n\t\t\t\t// Upsampling the image\n\t\t\t\t$ratio = max($w_ratio, $h_ratio);\n\t\t\t\t\n\t\t\t\t$wd = floor($im_infos[0] / $ratio);\t// Width Destination\n\t\t\t\t$hd = floor($im_infos[1] / $ratio);\t// Height Destination\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// No upsample\n\t\t\t\t$wd = $im_infos[0];\n\t\t\t\t$hd = $im_infos[1];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//$mts[\"imagecreatetruecolor\"][\"start\"] = microtime(true);\n\t\t$imd = imagecreatetruecolor($wd, $hd);\t// Image Destination\n\t\t//$mts[\"imagecreatetruecolor\"][\"end\"] = microtime(true);\n\t\t\n\t\t//$mts[\"imagecopyresampled\"][\"start\"] = microtime(true);\n\t\timagecopyresampled($imd, $im, 0, 0, 0, 0, $wd, $hd, $im_infos[0], $im_infos[1]);\n\t\t//$mts[\"imagecopyresampled\"][\"end\"] = microtime(true);\n\t\t\n\t\t//$mts[\"imagejpeg\"][\"start\"] = microtime(true);\n\t\timagejpeg($imd, $to);\n\t\t//$mts[\"imagejpeg\"][\"end\"] = microtime(true);\n\t\t\n\t\t//$mts[\"total\"][\"end\"] = microtime(true);\n\t\t\n\t\t//return $mts;\n\t\t/*\n\t\tswitch ($im_infos[2])\n\t\t{\n\t\t\tcase IMAGETYPE_GIF :\timagegif($imd, $to); break;\n\t\t\tcase IMAGETYPE_JPEG :\timagejpeg($imd, $to); break;\n\t\t\tcase IMAGETYPE_PNG :\timagepng($imd, $to); break;\n\t\t\tdefault : break;\n\t\t}\n\t\t*/\n\t}\n}", "protected function transform(sfImage $image)\n {\n $resource_w = $image->getWidth();\n $resource_h = $image->getHeight();\n\n $scale_w = $this->getWidth()/$resource_w;\n $scale_h = $this->getHeight()/$resource_h;\n switch ($this->getMethod())\n {\n case 'deflate':\n case 'inflate':\n\n return $image->resize($this->getWidth(), $this->getHeight());\n\n case 'left':\n $image->scale(max($scale_w, $scale_h));\n\n return $image->crop(0, (int)round(($image->getHeight() - $this->getHeight()) / 2), $this->getWidth(), $this->getHeight());\n\n case 'right':\n $image->scale(max($scale_w, $scale_h));\n\n return $image->crop(($image->getWidth() - $this->getWidth()), (int)round(($image->getHeight() - $this->getHeight()) / 2),$this->getWidth(), $this->getHeight());\n\n case 'top':\n $image->scale(max($scale_w, $scale_h));\n\n return $image->crop((int)round(($image->getWidth() - $this->getWidth()) / 2), 0, $this->getWidth(), $this->getHeight());\n\n case 'bottom':\n $image->scale(max($scale_w, $scale_h));\n\n return $image->crop((int)round(($image->getWidth() - $this->getWidth()) / 2), ($image->getHeight() - $this->getHeight()), $this->getWidth(), $this->getHeight());\n \n case 'center':\n $image->scale(max($scale_w, $scale_h));\n \n $left = (int)round(($image->getWidth() - $this->getWidth()) / 2);\n $top = (int)round(($image->getHeight() - $this->getHeight()) / 2);\n\n return $image->crop($left, $top, $this->getWidth(), $this->getHeight());\n case 'scale':\n return $image->scale(min($scale_w, $scale_h));\n\n case 'fit': \n default:\n $img = clone $image;\n\n $image->create($this->getWidth(), $this->getHeight());\n \n // Set a background color if specified\n if(!is_null($this->getBackground()) && $this->getBackground() != '')\n {\n $image->fill(0,0, $this->getBackground());\n }\n\n $img->scale(min($this->getWidth() / $img->getWidth(), $this->getHeight() / $img->getHeight()));\n \n $image->overlay($img, 'center');\n\n return $image;\n \n }\n }", "function normal_resize_image($source, $destination, $image_type, $max_size, $image_width, $image_height, $quality){\n\n if($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n //do not resize if image is smaller than max size\n if($image_width <= $max_size && $image_height <= $max_size){\n if(save_image($source, $destination, $image_type, $quality)){\n return true;\n }\n }\n\n //Construct a proportional size of new image\n $image_scale\t= min($max_size/$image_width, $max_size/$image_height);\n $new_width\t\t= ceil($image_scale * $image_width);\n $new_height\t\t= ceil($image_scale * $image_height);\n\n $new_canvas\t\t= imagecreatetruecolor( $new_width, $new_height ); //Create a new true color image\n\n //Copy and resize part of an image with resampling\n if(imagecopyresampled($new_canvas, $source, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height)){\n save_image($new_canvas, $destination, $image_type, $quality); //save resized image\n }\n\n return true;\n}", "static function resize($sourcePath, $newWidth = 100, $newHeight = 100)\n {\n switch (exif_imagetype($sourcePath)) {\n case IMAGETYPE_JPEG :\n $sourceImage = imagecreatefromjpeg($sourcePath);\n break;\n case IMAGETYPE_PNG :\n $sourceImage = imagecreatefrompng($sourcePath);\n break;\n case IMAGETYPE_GIF :\n $sourceImage = imagecreatefromgif($sourcePath);\n break;\n default:\n return;\n }\n\n // Create the new image (still blank/empty)\n $newImage = imagecreatetruecolor($newWidth, $newHeight);\n imagesetinterpolation($newImage, IMG_SINC);\n\n // Determine the source image Dimensions\n $sourceImageWidth = imagesx($sourceImage);\n $sourceImageHeight = imagesy($sourceImage);\n $sourceImageAspectRatio = $sourceImageWidth / $sourceImageHeight;\n $newImageAspectRatio = $newWidth / $newHeight;\n\n // Determine parameters and copy part of the source image into the new image\n if ($newImageAspectRatio >= $sourceImageAspectRatio) { // width is the limiting factor for the source image\n $src_x = 0;\n $src_w = $sourceImageWidth;\n $src_h = $src_w / $newImageAspectRatio;\n $src_y = ($sourceImageHeight - $src_h) / 2;\n } else { // height of source image is limiting factor\n $src_y = 0;\n $src_h = $sourceImageHeight;\n $src_w = $src_h * $newImageAspectRatio;\n $src_x = ($sourceImageWidth - $src_w) / 2;\n }\n\n imagecopyresampled($newImage, $sourceImage, 0, 0, $src_x, $src_y, $newWidth, $newHeight, $src_w, $src_h);\n\n // Save new image to destination path\n switch (exif_imagetype($sourcePath)) {\n case IMAGETYPE_JPEG :\n imagejpeg($newImage, $sourcePath, 100);\n break;\n case IMAGETYPE_PNG :\n imagepng($newImage, $sourcePath);\n break;\n case IMAGETYPE_GIF :\n imagegif($newImage, $sourcePath);\n break;\n }\n\n // Remove image resources to reallocate space\n imagedestroy($sourceImage);\n imagedestroy($newImage);\n }", "function logonscreener_image_scale_and_crop($image, $source_width, $source_height) {\n global $screen_width, $screen_height;\n\n // Phase 1: Scale.\n $scale = max($screen_width / $source_width, $screen_height / $source_height);\n $scaled_width = (int) round($source_width * $scale);\n $scaled_height = (int) round($source_height * $scale);\n\n if ($scale != 1) {\n logonscreener_log(\"Scale = $scale. Scaled width = $scaled_width. Scaled height = $scaled_height.\");\n\n $res2 = imagecreatetruecolor($scaled_width, $scaled_height);\n imagefill($res2, 0, 0, imagecolorallocate($res2, 255, 255, 255));\n if (!imagecopyresampled($res2, $image, 0, 0, 0, 0, $scaled_width, $scaled_height, $source_width, $source_height)) {\n logonscreener_log('Scale did not worked out. HZ.');\n return FALSE;\n }\n\n // Destroy the original image and update image object.\n imagedestroy($image);\n $image = $res2;\n }\n\n // Phase 2: Crop.\n if ($scaled_width != $screen_width || $scaled_height != $screen_height) {\n $screen_width = (int) $screen_width;\n $screen_height = (int) $screen_height;\n\n $x = ($scaled_width - $screen_width) / 2;\n $y = ($scaled_height - $screen_height) / 2;\n logonscreener_log(\"Crop source X = $x. Crop source Y = $y.\");\n\n $res = imagecreatetruecolor($screen_width, $screen_height);\n imagefill($res, 0, 0, imagecolorallocate($res, 255, 255, 255));\n if (!imagecopyresampled($res, $image, 0, 0, $x, $y, $screen_width, $screen_height, $screen_width, $screen_height)) {\n logonscreener_log('Crop did not worked out. HZ.');\n return FALSE;\n }\n\n // Destroy the original image and update image object.\n imagedestroy($image);\n $image = $res;\n }\n\n return $image;\n}", "private function resize() {\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$originalImage = imagecreatefromjpeg($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t$originalImage = imagecreatefrompng($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$originalImage = imagecreatefromgif($this->tempName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// Determine new height\n\t\t$this->newHeight = ($this->height / $this->width) * $this->newWidth;\n\n\t\t// Create new image\n\t\t$this->newImage = imagecreatetruecolor($this->newWidth, $this->newHeight);\n\n\t\t// Resample original image into new image\n\t\timagecopyresampled($this->newImage, $originalImage, 0, 0, 0, 0, $this->newWidth, $this->newHeight, $this->width, $this->height);\n\n\t\t// Switch based on image being resized\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t// Source, Dest, Quality 0 to 100\n\t\t\t\timagejpeg($this->newImage, $this->destinationFolder.'/'.$this->newName, 80);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t// Source, Dest, Quality 0 (no compression) to 9\n\t\t\t\timagepng($this->newImage, $this->destinationFolder.'/'.$this->newName, 0);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($this->newImage, $this->destinationFolder.'/'.$this->newName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('YOUR FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// DESTROY NEW IMAGE TO SAVE SERVER SPACE\n\t\timagedestroy($this->newImage);\n\t\timagedestroy($originalImage);\n\n\t\t// SUCCESSFULLY UPLOADED\n\t\t$this->result = true;\n\t\t$this->message = 'Image uploaded and resized successfully';\n\t}", "public function resize($image, $width, $height)\n {\n $origWidth = imagesx($image);\n $origHeight = imagesy($image);\n \n $ratio = min(array($origWidth, $origHeight)) / max($width, $height);\n \n $w = $origWidth * $ratio;\n $h = $origHeight * $ratio;\n \n $cropped = imagecreatetruecolor($width, $height);\n imagecopyresampled($cropped, $image, 0, 0, 0, 0, $origWidth, $origHeight, $w, $h);\n return $cropped;\n }", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\n\t\t$newImageWidth = ceil($width * $scale);\n\t\t$newImageHeight = ceil($height * $scale);\n\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\tswitch($imageType) {\n\t\t\tcase \"image/gif\":\n\t\t\t\t$source=imagecreatefromgif($image); \n\t\t\t\tbreak;\n\t\t\tcase \"image/pjpeg\":\n\t\t\tcase \"image/jpeg\":\n\t\t\tcase \"image/jpg\":\n\t\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\t\tbreak;\n\t\t\tcase \"image/png\":\n\t\t\tcase \"image/x-png\":\n\t\t\t\t$source=imagecreatefrompng($image); \n\t\t\t\tbreak;\n\t\t}\n\t\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\t\tswitch($imageType) {\n\t\t\tcase \"image/gif\":\n\t\t\t\timagegif($newImage,$thumb_image_name); \n\t\t\t\tbreak;\n\t\t\tcase \"image/pjpeg\":\n\t\t\tcase \"image/jpeg\":\n\t\t\tcase \"image/jpg\":\n\t\t\t\timagejpeg($newImage,$thumb_image_name,90); \n\t\t\t\tbreak;\n\t\t\tcase \"image/png\":\n\t\t\tcase \"image/x-png\":\n\t\t\t\timagepng($newImage,$thumb_image_name); \n\t\t\t\tbreak;\n\t\t}\n\t\tchmod($thumb_image_name, 0777);\n\t\treturn $thumb_image_name;\n\t}", "function resizeToWidth($width)\n {\n //obtine ratio dividiendo ancho dada entre el ancho actual de la imagen.\n $ratio = $width / $this->getWidth();\n //obtiene altura con la altura actual de la imagen por el ratio.\n $height = $this->getheight() * $ratio;\n //redimensiona imagen.\n $this->resize($width,$height);\n }", "function imageResize($file, $dest, $height, $width, $thumb = FALSE) {\n\tglobal $ighMaxHeight, $ighMaxWidth, $ighThumbHeight, $ighThumbWidth;\n\n\tif (strstr(@mime_content_type($file), \"png\"))\n\t\t$oldImage = imagecreatefrompng($file);\n\telseif (strstr(@mime_content_type($file), \"jpeg\"))\n\t\t$oldImage = imagecreatefromjpeg($file);\n\telseif (strstr(@mime_content_type($file), \"gif\"))\n\t\t$oldImage = imagecreatefromgif($file);\n\telse\n\t\tdie (\"oh shit\");\n\n\t$base_img = $oldImage;\n $img_width = imagesx($base_img);\n $img_height = imagesy($base_img);\n\n $thumb_height = $height;\n $thumb_width = $width;\n\n // Work out which way it needs to be resized\n $img_width_per = $thumb_width / $img_width;\n $img_height_per = $thumb_height / $img_height;\n \n if ($img_width_per <= $img_height_per) {\n $thumb_height = intval($img_height * $img_width_per); \n }\n else {\n $thumb_width = intval($img_width * $img_height_per);\n }\n\n\tif ($thumb) {\n\t\t$thumb_width = $width;\t\t// 120\n\t\t$thumb_height = $height*3/4;\t// 120 * 3 / 4 = 90\n\t}\n\n // Create the new thumbnail image\n $thumb_img = ImageCreateTrueColor($thumb_width, $thumb_height); \n\n\tif ($thumb) {\t// Do the Square from the Centre thing.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, \n\t\t\t\t($img_width/2)-($thumb_width/2), ($img_height/2)-($thumb_height/2), \n\t\t\t\t$thumb_width, $thumb_height, $thumb_width, $thumb_height);\t\t\t\n\t} else {\t// standard image to image resize.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, 0, 0, \n\t\t\t\t$thumb_width, $thumb_height, $img_width, $img_height);\n\t}\n\n\t// using jpegs!\n\timagejpeg($thumb_img, $dest);\n\timagedestroy($base_img);\n\timagedestroy($thumb_img);\n}", "private function intern_resize_crop($newWidth, $newHeight)\n\t{\n\t\t/*\n\t\t * Crop-to-fit PHP-GD\n\t\t * http://salman-w.blogspot.com/2009/04/crop-to-fit-image-using-aspphp.html\n\t\t *\n\t\t * Resize and center crop an arbitrary size image to fixed width and height\n\t\t * e.g. convert a large portrait/landscape image to a small square thumbnail\n\t\t *\n\t\t * Modified by Fry\n\t\t */\n\t\t$desired_aspect_ratio = $newWidth / $newHeight;\n\n\t\tif ($this->srcAspectRatio > $desired_aspect_ratio) {\n\t\t\t/*\n\t\t\t * Triggered when source image is wider\n\t\t\t */\n\t\t\t$temp_height = $newHeight;\n\t\t\t$temp_width = ( int ) ($newHeight * $this->srcAspectRatio);\n\t\t} else {\n\t\t\t/*\n\t\t\t * Triggered otherwise (i.e. source image is similar or taller)\n\t\t\t */\n\t\t\t$temp_width = $newWidth;\n\t\t\t$temp_height = ( int ) ($newWidth / $this->srcAspectRatio);\n\t\t}\n\n\t\t/*\n\t\t * Resize the image into a temporary GD image\n\t\t */\n\n\t\t$tempImage = imagecreatetruecolor($temp_width, $temp_height);\n\t\timagecopyresampled(\n\t\t\t$tempImage,\t\t\t\t\t$this->srcImage,\n\t\t\t0, 0,\t\t\t0, 0,\n\t\t\t$temp_width, $temp_height,\t$this->srcWidth, $this->srcHeight\n\t\t);\n\n\t\t/*\n\t\t * Copy cropped region from temporary image into the desired GD image\n\t\t */\n\n\t\t$x0 = ($temp_width - $newWidth) / 2;\n\t\t$y0 = ($temp_height - $newHeight) / 2;\n\t\t$this->newImage = imagecreatetruecolor($newWidth, $newHeight);\n\t\timagecopy(\n\t\t\t$this->newImage,\t$tempImage,\n\t\t\t0, 0,\t$x0, $y0,\n\t\t\t$newWidth, $newHeight\n\t\t);\n\t\timagedestroy($tempImage);\n\t}", "private function _resizeThumbnailImage($thumb_image_name, $image, $width, $height, $src_width, $src_height, $scale){\n\t\t$newImageWidth = ceil($width * $scale);\n\t\t$newImageHeight = ceil($height * $scale);\n\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t$source = imagecreatefromjpeg($image);\n\t\timagecopyresampled($newImage,$source,0,0,0,0,$width,$height,$src_width,$src_height);\n\t\timagejpeg($newImage,$thumb_image_name,90);\n\t\tchmod($thumb_image_name, 0777);\n\t\t//return $thumb_image_name;\n\t}", "public function shrink($width = 0, $height = 0, $enlarge=false) {\n\n //if ($scale > 1) {\n // $scale = 1;\n //}\n\n //$this->resizeWithScale($this->info['width'] * $scale, $this->info['height'] * $scale, $scale);\n //$this->resizeWithScaleExact($width, $height, 1);\n\n //$this->resizeWithScale($width, $height, $scale);\n\n\t\t//$scale=$width/$height;\n //$this->resizeWithScale($this->info['width'] * $scale, $this->info['height'] * $scale, $scale);\n\n\t\t$s_ratio = $this->info['width']/$this->info['height'];\n\t\t$d_ratio = $width/$height;\n\n if ( $s_ratio > $d_ratio )\n {\n $cwidth = $this->info['width'];\n $cheight = round($this->info['width']*(1/$d_ratio));\n }\n elseif( $s_ratio < $d_ratio )\n {\n $cwidth = round($this->info['height']*$d_ratio);\n $cheight = $this->info['height'];\n }\n else\n {\n $cwidth = $this->info['width'];\n $cheight = $this->info['height'];\n }\n\n\t\tif ( ($this->info['width']<=$width) && ($this->info['height']<=$height) && !$enlarge )\n\t\t{\n\t\t\t$this->resizeWithScaleExact($cwidth, $cheight, 1);\n\t\t}\n\t\telse\n\t\t{\n\t $this->resizeWithScaleExact($width, $height, 1);\n\t\t}\n }", "public function resize()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('resize');\n\t}", "function resize_image($image, $max_width, $max_height) {\n\t$width = imagesx($image);\n\t$height = imagesy($image);\n\t\n\tif ($width <= $max_width && $height <= $max_height) {\n\t\t// Don't bother if the image is already under the limits\n\t\treturn true;\n\t} else {\n\t\t// Set immediately transparency mode on the source image\n\t\timagealphablending($image, true);\n\t\n\t\t$ratio = $width / $height;\n\t\tif ($ratio > 1) { // width > height\n\t\t\t$n_width = $max_width;\n\t\t\t$n_height = round($height * $max_width / $width);\n\t\t} else {\n\t\t\t$n_width = round($width * $max_height / $height);\n\t\t\t$n_height = $max_height;\n\t\t}\n\t\t$dst_image = imagecreatetruecolor($n_width, $n_height);\n\t\timagealphablending($dst_image, false); \n\t\timagesavealpha($dst_image, true);\n\t\timagecopyresampled($dst_image, $image, 0, 0, 0, 0, $n_width, $n_height, $width, $height);\n\t}\n\treturn $dst_image;\n}", "private function resizeImage($filename, $width, $height)\n {\n $config['image_library'] = 'gd2';\n $config['create_thumb'] = TRUE;\n $config['maintain_ratio'] = TRUE;\n $config['width'] = $width;\n $config['height'] = $height;\n $config['source_image'] = $filename;\n $this->load->library('image_lib', $config);\n $this->image_lib->resize();\n }", "function smart_resize_image($file, $string = null, $width = 0, $height = 0, $proportional = false, $output = 'file', $delete_original = true, $use_linux_commands = false, $quality = 100, $grayscale = false\n) {\n\n if ($height <= 0 && $width <= 0)\n return false;\n if ($file === null && $string === null)\n return false;\n\n # Setting defaults and meta\n $info = $file !== null ? getimagesize($file) : getimagesizefromstring($string);\n $image = '';\n $final_width = 0;\n $final_height = 0;\n list($width_old, $height_old) = $info;\n $cropHeight = $cropWidth = 0;\n\n # Calculating proportionality\n if ($proportional) {\n if ($width == 0)\n $factor = $height / $height_old;\n elseif ($height == 0)\n $factor = $width / $width_old;\n else\n $factor = min($width / $width_old, $height / $height_old);\n\n $final_width = round($width_old * $factor);\n $final_height = round($height_old * $factor);\n }\n else {\n $final_width = ( $width <= 0 ) ? $width_old : $width;\n $final_height = ( $height <= 0 ) ? $height_old : $height;\n $widthX = $width_old / $width;\n $heightX = $height_old / $height;\n\n $x = min($widthX, $heightX);\n $cropWidth = ($width_old - $width * $x) / 2;\n $cropHeight = ($height_old - $height * $x) / 2;\n }\n\n # Loading image to memory according to type\n switch ($info[2]) {\n case IMAGETYPE_JPEG: $file !== null ? $image = imagecreatefromjpeg($file) : $image = imagecreatefromstring($string);\n break;\n case IMAGETYPE_GIF: $file !== null ? $image = imagecreatefromgif($file) : $image = imagecreatefromstring($string);\n break;\n case IMAGETYPE_PNG: $file !== null ? $image = imagecreatefrompng($file) : $image = imagecreatefromstring($string);\n break;\n default: return false;\n }\n\n # Making the image grayscale, if needed\n if ($grayscale) {\n imagefilter($image, IMG_FILTER_GRAYSCALE);\n }\n\n # This is the resizing/resampling/transparency-preserving magic\n $image_resized = imagecreatetruecolor($final_width, $final_height);\n if (($info[2] == IMAGETYPE_GIF) || ($info[2] == IMAGETYPE_PNG)) {\n $transparency = imagecolortransparent($image);\n $palletsize = imagecolorstotal($image);\n\n if ($transparency >= 0 && $transparency < $palletsize) {\n $transparent_color = imagecolorsforindex($image, $transparency);\n $transparency = imagecolorallocate($image_resized, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);\n imagefill($image_resized, 0, 0, $transparency);\n imagecolortransparent($image_resized, $transparency);\n } elseif ($info[2] == IMAGETYPE_PNG) {\n imagealphablending($image_resized, false);\n $color = imagecolorallocatealpha($image_resized, 0, 0, 0, 127);\n imagefill($image_resized, 0, 0, $color);\n imagesavealpha($image_resized, true);\n }\n }\n imagecopyresampled($image_resized, $image, 0, 0, $cropWidth, $cropHeight, $final_width, $final_height, $width_old - 2 * $cropWidth, $height_old - 2 * $cropHeight);\n\n\n # Taking care of original, if needed\n if ($delete_original) {\n if ($use_linux_commands)\n exec('rm ' . $file);\n else\n @unlink($file);\n }\n\n # Preparing a method of providing result\n switch (strtolower($output)) {\n case 'browser':\n $mime = image_type_to_mime_type($info[2]);\n header(\"Content-type: $mime\");\n $output = NULL;\n break;\n case 'file':\n $output = $file;\n break;\n case 'return':\n return $image_resized;\n break;\n default:\n break;\n }\n\n # Writing image according to type to the output destination and image quality\n switch ($info[2]) {\n case IMAGETYPE_GIF: imagegif($image_resized, $output);\n break;\n case IMAGETYPE_JPEG: imagejpeg($image_resized, $output, $quality);\n break;\n case IMAGETYPE_PNG:\n $quality = 9 - (int) ((0.9 * $quality) / 10.0);\n imagepng($image_resized, $output, $quality);\n break;\n default: return false;\n }\n\n return true;\n}", "public function resize($width)\n {\n // Validation\n if ($width > $this->_maxWidth)\n {\n throw new PHPMapper_Exception_Image(\n 'Image width too large. Maximum width for map is ' . $this->_maxWidth . ' pixels.'\n );\n }\n else if ($width < PHPMapper::MIN_WIDTH)\n {\n throw new PHPMapper_Exception_Image(\n 'Image width should be at least ' . PHPMapper::MIN_WIDTH . ' pixels wide.'\n );\n }\n\n // Resize the image while maintaining ratio\n $ratio = $this->_maxHeight / $this->_maxWidth;\n $height = floor($width * $ratio);\n $out = imagecreate($width, $height);\n\n imagealphablending($out, false);\n imagesavealpha($out, false);\n imagecopyresampled($out, $this->_image, 0, 0, 0, 0, $width, $height,\n $this->_maxWidth, $this->_maxHeight\n );\n\n imagedestroy($this->_image);\n $this->_image = $out;\n\n return $this;\n }", "private function resizeImage($i,$source)\n\t{\n\t\t$mime = $this->mimeType($source);\n \n\t\t$t = imagecreatetruecolor(8, 8);\n\t\t\n\t\t$source = $this->createImage($source);\n\t\t\n\t\timagecopyresized($t, $source, 0, 0, 0, 0, 8, 8, $mime[0], $mime[1]);\n\t\t\n\t\treturn $t;\n\t}", "function image_resize($filename){\n\t\t$width = 1000;\n\t\t$height = 500;\n\t\t$save_file_location = $filename;\n\t\t// File type\n\t\t//header('Content-Type: image/jpg');\n\t\t$source_properties = getimagesize($filename);\n\t\t$image_type = $source_properties[2];\n\n\t\t// Get new dimensions\n\t\tlist($width_orig, $height_orig) = getimagesize($filename);\n\n\t\t$ratio_orig = $width_orig/$height_orig;\n\t\tif ($width/$height > $ratio_orig) {\n\t\t\t$width = $height*$ratio_orig;\n\t\t} else {\n\t\t\t$height = $width/$ratio_orig;\n\t\t}\n\t\t// Resampling the image \n\t\t$image_p = imagecreatetruecolor($width, $height);\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\t$image = imagecreatefromjpeg($filename);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\t$image = imagecreatefromgif($filename);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$image = imagecreatefrompng($filename);\n\t\t}\n\t\t$finalIMG = imagecopyresampled($image_p, $image, 0, 0, 0, 0,\n\t\t$width, $height, $width_orig, $height_orig);\n\t\t// Display of output image\n\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\timagejpeg($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\timagegif($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$imagepng = imagepng($image_p, $save_file_location);\n\t\t}\n\t}", "public function test_resize_and_crop() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->resize( 100, 50, true );\n\n\t\t$this->assertEquals( array( 'width' => 100, 'height' => 50 ), $imagick_image_editor->get_size() );\n\t}", "function resize( $jpg ) {\n\t$im = @imagecreatefromjpeg( $jpg );\n\t$filename = $jpg;\n\t$percent = 0.5;\n\tlist( $width, $height ) = getimagesize( $filename );\n\tif ( $uploader_name == \"c_master_imgs\" ):\n\t\t$new_width = $width;\n\t$new_height = $height;\n\telse :\n\t\tif ( $width > 699 ): $new_width = 699;\n\t$percent = 699 / $width;\n\t$new_height = $height * $percent;\n\telse :\n\t\t$new_width = $width;\n\t$new_height = $height;\n\tendif;\n\tendif; // end if measter images do not resize\n\t//if ( $new_height>600){ $new_height = 600; }\n\t$im = imagecreatetruecolor( $new_width, $new_height );\n\t$image = imagecreatefromjpeg( $filename );\n\timagecopyresampled( $im, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height );\n\t@imagejpeg( $im, $jpg, 80 );\n\t@imagedestroy( $im );\n}", "protected static function GDResize($in_file, $out_file, $format, $switch)\n {\n $source = self::imageCreateFrom($in_file);\n\n $src_width = imagesx($source);\n $src_height = imagesy($source);\n\n $f = explode('x', $format);\n if ($src_width > $src_height) {\n $new_width = $f[0];\n $new_height = $f[1];\n } else {\n $new_width = $f[1];\n $new_height = $f[0];\n }\n\n $destination = imagecreatetruecolor($new_width, $new_height);\n\n $new_dwh = $new_width / $new_height; // stosunek dł/wys.\n $src_dwh = $src_width / $src_height;\n\n if ($src_dwh == $new_dwh)\n { // proporcjonalne\n $fin_x = 0;\n $fin_y = 0;\n $fin_width = $src_width;\n $fin_height = $src_height;\n } elseif ($src_dwh > $new_dwh) { // src bardziej horyzontalny, new bardziej wertykalny\n $fin_height = $src_height;\n $fin_width = ceil($src_height * $new_width / $new_height);\n $fin_x = ($src_width - $fin_width) / 2;\n $fin_y = 0;\n } elseif ($src_dwh < $new_dwh) { // src bardziej wertykalny, new bardziej horyzontalny\n $fin_height = ceil($src_width * $new_height / $new_width);\n $fin_width = $src_width;\n $fin_x = 0;\n $fin_y = ($src_height - $fin_height) / 2;\n }\n\n imagecopyresampled(\n $destination, $source,\n 0, 0, // odkąd smarować na wyniku\n $fin_x, $fin_y, // skąd pobierać źródło\n $new_width, $new_height,\n $fin_width, $fin_height\n );\n\n self::imagePut($destination, $out_file);\n\n imagedestroy($source);\n }", "protected function resizeImage($path)\n\t{\n\t\t$iP = &$this->uploader->imageProcessor;\n\t\t$iP->load($this->uploader->mediaService->getItem($path));\n\t\t$iP->resize_square(500);\n\t\t$iP->saveImage();\n }", "public function scaleImage($scale)\n {\n if ($scale == 1) {\n return;\n }\n\n $scaledSize = $this->getScaledImageSize($scale);\n\n $image = $this->createNewTransparentImage($scaledSize->width, $scaledSize->height);\n\n imagecopyresampled(\n $image,\n $this->image,\n 0,\n 0,\n 0,\n 0,\n $scaledSize->width,\n $scaledSize->height,\n $this->width,\n $this->height\n );\n\n imagedestroy($this->image);\n $this->image = $image;\n $this->width = $scaledSize->width;\n $this->height = $scaledSize->height;\n }", "function make_thumb($img_name, $filename, $new_w, $new_h) {\n //get image extension.\n $ext = getExtension($img_name);\n //creates the new image using the appropriate function from gd library\n if (!strcmp(\"jpg\", $ext) || !strcmp(\"jpeg\", $ext))\n $src_img = imagecreatefromjpeg($img_name);\n\n if (!strcmp(\"png\", $ext))\n $src_img = imagecreatefrompng($img_name);\n\n //gets the dimmensions of the image\n $old_x = imageSX($src_img);\n $old_y = imageSY($src_img);\n\n // next we will calculate the new dimmensions for the thumbnail image\n // the next steps will be taken: \n // 1. calculate the ratio by dividing the old dimmensions with the new ones\n // 2. if the ratio for the width is higher, the width will remain the one define in WIDTH variable\n // and the height will be calculated so the image ratio will not change\n // 3. otherwise we will use the height ratio for the image\n // as a result, only one of the dimmensions will be from the fixed ones\n $ratio1 = $old_x / $new_w;\n $ratio2 = $old_y / $new_h;\n if ($ratio1 > $ratio2) {\n $thumb_w = $new_w;\n $thumb_h = $old_y / $ratio1;\n } else {\n $thumb_h = $new_h;\n $thumb_w = $old_x / $ratio2;\n }\n\n // we create a new image with the new dimmensions\n $dst_img = ImageCreateTrueColor($thumb_w, $thumb_h);\n\n // resize the big image to the new created one\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_x, $old_y);\n\n // output the created image to the file. Now we will have the thumbnail into the file named by $filename\n if (!strcmp(\"png\", $ext))\n imagepng($dst_img, $filename);\n else\n imagejpeg($dst_img, $filename);\n\n //destroys source and destination images. \n imagedestroy($dst_img);\n imagedestroy($src_img);\n}", "function resize($iNewWidth, $iNewHeight)\n\t{\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\tif (function_exists(\"imagecopyresampled\")) {\n\t\t\t$ResizedImageStream = imagecreatetruecolor($iNewWidth, $iNewHeight);\n\t\t\timagecopyresampled($ResizedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t} else {\n\t\t\t$ResizedImageStream = imagecreate($iNewWidth, $iNewHeight);\n\t\t\timagecopyresized($ResizedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t}\n\n\t\t$this->ImageStream = $ResizedImageStream;\n\t\t$this->width = $iNewWidth;\n\t\t$this->height = $iNewHeight;\n\t\t$this->setImageOrientation();\n\t}", "public function scale_image($x, $y)\n\t{\n $newimage = imagecreatetruecolor($x, $y); // defaults to filled with black\n $image_size = $this->image_size();\n if ($image_size[0] > $image_size[1]) {\n // Wide image, we want to resize the image with a letterbox\n $width = $x;\n $height = ($image_size[1] * $x) / $image_size[0];\n $oldimage = $this->load_image();\n $y = ($y - $height) / 2;\n $x = 0;\n } else {\n // Tall image, we want to resize the image with a pillarbox\n $height = $y;\n $width = ($image_size[0] * $y) / $image_size[1];\n $oldimage = $this->load_image();\n $y = 0;\n $x = ($x - $width) / 2;\n }\n imagecopyresampled($newimage, $oldimage, $x, $y, 0, 0, $width, $height, $image_size[0], $image_size[1]);\n $filename = tempnam(sys_get_temp_dir(), 'img');\n if (preg_match('/jpeg/', $image_size['mime'])) {\n imagejpeg($newimage, $filename, 100);\n } elseif (preg_match('/gif/', $image_size['mime'])) {\n imagegif($newimage, $filename);\n } elseif (preg_match('/png/', $image_size['mime'])) {\n imagepng($newimage, $filename);\n }\n $this->delete_local_file();\n $this->local_file = $filename;\n\t}", "public function crop_image($w, $h)\n\t{\n // This function resizes this image to fit in the box $w x $h, cropping to fill the entire image\n $image_size = $this->image_size();\n if ($image_size[0] == $w && $image_size[1] == $h) {\n // No need to crop\n return;\n }\n $ratio = $image_size[0] / $image_size[1];\n $goal_ratio = $w / $h;\n\n // Calculate the new image size\n if ($ratio < $goal_ratio) {\n // Tall image, crop top and bottom\n $l = 0;\n $r = $image_size[0];\n $height = $image_size[0] / $goal_ratio;\n $t = ($image_size[1] / 2) - ($height / 2);\n $b = ($image_size[1] / 2) + ($height / 2);\n } else {\n // Wide image, crop top and bottom\n $t = 0;\n $b = $image_size[1];\n $width = $image_size[1] * $goal_ratio;\n $l = ($image_size[0] / 2) - ($width / 2);\n $r = ($image_size[0] / 2) + ($width / 2);\n }\n\n // Create a new image for the resized image\n $oldimage = $this->load_image();\n $newimage = imagecreatetruecolor($w, $h);\n imagecopyresampled($newimage, $oldimage, 0, 0, $l, $t, $w, $h, $r - $l, $b - $t);\n $filename = tempnam(sys_get_temp_dir(), 'img');\n if (preg_match('/jpeg/', $image_size['mime'])) {\n imagejpeg($newimage, $filename, 100);\n } elseif (preg_match('/gif/', $image_size['mime'])) {\n imagegif($newimage, $filename);\n } elseif (preg_match('/png/', $image_size['mime'])) {\n imagepng($newimage, $filename);\n }\n $this->delete_local_file();\n $this->local_file = $filename;\n\t}", "public function smartResizeImage($file, $width = 0, $height = 0, $proportional = false, $output = 'file') {\n //echo $file;\n if ($height <= 0 && $width <= 0) {\n return false;\n }\n $info = getimagesize($file);\n $image = '';\n $final_width = 0;\n $final_height = 0;\n list($width_old, $height_old) = $info;\n if (\n $proportional) {\n if ($width == 0)\n $factor = $height / $height_old;\n elseif ($height == 0)\n $factor = $width / $width_old;\n else\n $factor = min($width / $width_old, $height / $height_old);\n $final_width = round($width_old * $factor);\n $final_height = round($height_old * $factor);\n } else {\n $final_width = ( $width <= 0 ) ? $width_old : $width;\n $final_height = ( $height <= 0 ) ? $height_old : $height;\n }\n switch (\n $info[2]) {\n case IMAGETYPE_GIF:\n $image = imagecreatefromgif($file);\n break;\n case IMAGETYPE_JPEG:\n $image = imagecreatefromjpeg($file);\n break;\n case IMAGETYPE_PNG:\n $image = imagecreatefrompng($file);\n break;\n default:\n return false;\n }\n $image_resized = imagecreatetruecolor($final_width, $final_height);\n if (($info[2] == IMAGETYPE_GIF) || ($info[2] == IMAGETYPE_PNG)) {\n $trnprt_indx = imagecolortransparent($image);\n // If we have a specific transparent color\n if ($trnprt_indx >= 0) {\n // Get the original image's transparent color's RGB values\n $trnprt_color = imagecolorsforindex($image, $trnprt_indx);\n // Allocate the same color in the new image resource\n $trnprt_indx = imagecolorallocate($image_resized, $trnprt_color['red'], $trnprt_color['green'], $trnprt_color['blue']);\n // Completely fill the background of the new image with allocated color.\n imagefill($image_resized, 0, 0, $trnprt_indx);\n // Set the background color for new image to transparent\n imagecolortransparent($image_resized, $trnprt_indx);\n }\n // Always make a transparent background color for PNGs that don't have one allocated already\n elseif ($info[2] == IMAGETYPE_PNG) {\n // Turn off transparency blending (temporarily)\n imagealphablending($image_resized, false);\n // Create a new transparent color for image\n $color = imagecolorallocatealpha($image_resized, 0, 0, 0, 127);\n // Completely fill the background of the new image with allocated color.\n imagefill($image_resized, 0, 0, $color);\n // Restore transparency blending\n imagesavealpha($image_resized, true);\n }\n }\n //echo $image_resized.' AND '.$image;\n imagecopyresampled($image_resized, $image, 0, 0, 0, 0, $final_width, $final_height, $width_old, $height_old);\n /* if ( $delete_original ) {\n if ( $use_linux_commands )\n exec('rm '.$file);\n else\n @unlink($file);\n } */\n switch (strtolower($output)) {\n case 'browser':\n $mime = image_type_to_mime_type($info[2]);\n header(\"Content-type: $mime\");\n $output = NULL;\n break;\n case 'file':\n $output = $file;\n break;\n case 'return':\n return $image_resized;\n break;\n default:\n break;\n }\n switch (\n $info[2]) {\n case IMAGETYPE_GIF:\n imagegif($image_resized, $output);\n break;\n case IMAGETYPE_JPEG:\n imagejpeg($image_resized, $output);\n break;\n case IMAGETYPE_PNG:\n imagepng($image_resized, $output);\n break;\n default:\n return false;\n }\n return\n true;\n }", "function resize( $width, $height ) \r\n\t{\r\n //\t\t$new_image = imagecreatetruecolor($width, $height);\r\n //\t\t\r\n //\t\t imagesavealpha($new_image, true);\r\n //\t\t $trans_colour = imagecolorallocatealpha($new_image, 255, 255, 255, 256);\r\n //\t\t imagefill($new_image, 0, 0, $trans_colour);\r\n //\t\t header(\"Content-type: image/png\");\r\n //\t\t imagepng($new_image);\r\n //\t\t\t\t\r\n //\t\timagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\r\n //\t\t\r\n //\t\timagefill($new_image, 0, 0, $trans_colour);\r\n //\t\t\r\n //\t\t$this->image = $new_image;\r\n\t\t\r\n\t\t/****************/\r\n\t\t\r\n \t$image_resized = imagecreatetruecolor( $width, $height );\r\n \r\n if ( ($this->type == IMAGETYPE_GIF) || ($this->type == IMAGETYPE_PNG) ) \r\n {\r\n $transparency_index = imagecolortransparent($this->image);\r\n \r\n // If we have a specific transparent color\r\n if ($transparency_index >= 0) \r\n {\r\n // Get the original image's transparent color's RGB values\r\n $transparent_color = imagecolorsforindex($this->image, $transparency_index);\r\n \r\n // Allocate the same color in the new image resource\r\n $transparency_index = imagecolorallocate($image_resized, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);\r\n \r\n // Completely fill the background of the new image with allocated color.\r\n imagefill($image_resized, 0, 0, $transparency_index);\r\n \r\n // Set the background color for new image to transparent\r\n imagecolortransparent($image_resized, $transparency_index);\r\n }\r\n elseif ($this->type == IMAGETYPE_PNG) \r\n {\r\n // Always make a transparent background color for PNGs that don't have one allocated already\r\n\r\n // Turn off transparency blending (temporarily)\r\n imagealphablending($image_resized, false);\r\n \r\n // Create a new transparent color for image\r\n $color = imagecolorallocatealpha($image_resized, 0, 0, 0, 127);\r\n \r\n // Completely fill the background of the new image with allocated color.\r\n imagefill($image_resized, 0, 0, $color);\r\n \r\n // Restore transparency blending\r\n imagesavealpha($image_resized, true);\r\n }\r\n }\r\n\r\n imagecopyresampled( $image_resized, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight() );\r\n \r\n $this->image = $image_resized;\r\n\t}", "function resizeImage($input,$output,$wid,$hei,$auto=false,$quality=80) {\n\n\t// File and new size\n\t//the original image has 800x600\n\t$filename = $input;\n\t//the resize will be a percent of the original size\n\t$percent = 0.5;\n\n\t// Get new sizes\n\tlist($width, $height) = getimagesize($filename);\n\t$newwidth = $wid;//$width * $percent;\n\t$newheight = $hei;//$height * $percent;\n\tif($auto) {\n\t\tif($width>$height) {\n\t\t\t$newheight=$wid*0.75;\n\t\t} else if($height>$width) {\n\t\t\t$newwidth=$hei*0.75;\n\t\t}\n\t}\n\n\t// Load\n\t$thumb = imagecreatetruecolor($newwidth, $newheight);\n\t$source = imagecreatefromjpeg($filename);\n\n\t// Resize\n\timagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n\n\t// Output and free memory\n\t//the resized image will be 400x300\n\timagejpeg($thumb,$output,$quality);\n\timagedestroy($thumb);\n}", "function do_scaled() {\n $this->layout = FALSE;\n\n $status = $this->show_scaled_image(IMAGE_RESOLUTION, 'photos');\n if (TRUE !== $status) {\n $this->message($status);\n $this->redirect('/photo/index');\n }\n }", "public function test_resize_and_crop() {\n\t\t$file = DIR_TESTDATA . '/images/waffles.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->resize( 100, 50, true );\n\n\t\t$this->assertSame(\n\t\t\tarray(\n\t\t\t\t'width' => 100,\n\t\t\t\t'height' => 50,\n\t\t\t),\n\t\t\t$imagick_image_editor->get_size()\n\t\t);\n\t}", "function createThumbnail($image, $newMaxWidth, $newMaxHeight) {\n $width_orig = imagesx($image);\n $height_orig = imagesy($image);\n\n $ratio_orig = $width_orig/$height_orig;\n\n if ($newMaxWidth/$newMaxHeight > $ratio_orig) {\n $newMaxWidth = $newMaxHeight * $ratio_orig;\n } else {\n $newMaxHeight = $newMaxWidth / $ratio_orig;\n }\n\n $dst_img = imagecreatetruecolor( $newMaxWidth, $newMaxHeight );\n imagealphablending( $dst_img, false );\n imagesavealpha( $dst_img, true );\n\n imagecopyresampled($dst_img, $image,0,0,0,0,$newMaxWidth,$newMaxHeight,$width_orig,$height_orig);\n\n return $dst_img;\n}", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t\t\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\t\n\t\t\t\t$newImageWidth = ceil($width * $scale);\n\t\t\t\t$newImageHeight = ceil($height * $scale);\n\t\t\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\t$source=imagecreatefromgif($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\t$source=imagecreatefromjpeg($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\t$source=imagecreatefrompng($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\timagegif($newImage,$thumb_image_name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\timagejpeg($newImage,$thumb_image_name,90);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\timagepng($newImage,$thumb_image_name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tchmod($thumb_image_name, 0777);\n\t\t\t\treturn $thumb_image_name;\n\t\t\t}", "public function resize()\n {\n foreach ($this->getList() as $image) {\n if (!$image instanceof mtmdImage) {\n continue;\n }\n\n mtmdUtils::output(\n sprintf(\n '\"%s\": Resizing to %dx%d (was %dx%d)...',\n $image->getFileName(),\n $this->getThumbWidth(),\n $this->getThumbHeight(),\n $image->getWidth(),\n $image->getHeight()\n )\n );\n\n $targetPath = $this->getCachedFilePath(dirname($image->getFileName()));\n\n // Prepare target dirs.\n mtmdUtils::mkDir($targetPath, 0755, true);\n // Resize image.\n $image->resizeImage($targetPath, $this->thumbWidth, $this->thumbHeight);\n\n }\n\n }", "function resize( $width, $height ) {\n $new_image = imagecreatetruecolor( $width, $height );\n if ( $this->mimetype == 'image/gif' || $this->mimetype == 'image/png' ) {\n $current_transparent = imagecolortransparent( $this->image );\n if ( $current_transparent != -1 ) {\n $transparent_color = imagecolorsforindex( $this->image, $current_transparent );\n $current_transparent = imagecolorallocate( $new_image, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue'] );\n imagefill( $new_image, 0, 0, $current_transparent );\n imagecolortransparent( $new_image, $current_transparent );\n } elseif ( $this->mimetype == 'image/png' ) {\n imagealphablending( $new_image, false );\n $color = imagecolorallocatealpha( $new_image, 0, 0, 0, 127 );\n imagefill( $new_image, 0, 0, $color );\n imagesavealpha( $new_image, true );\n }\n }\n imagecopyresampled( $new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->width, $this->height );\n $this->image = $new_image;\n return $this;\n }", "function smart_resize_image($file, $width = 0, $height = 0, $proportional = false, $output = \"file\", $delete_original = true, $use_linux_commands = false){\n\t\tif(($height <= 0) && ($width <= 0)){\n\t\t\treturn(false);\n\t\t}\n\t\t$info = getimagesize($file); // Paramètres par défaut de l'image\n\t\t$image = \"\";\n\t\t$final_width = 0;\n\t\t$final_height = 0;\n\t\tlist($width_old,$height_old) = $info;\n\t\t$trop_petite = false;\n\t\tif(($height > 0) && ($height > $height_old)){\n\t\t\t$trop_petite = true;\n\t\t}\n\t\tif(($width > 0) && ( $width > $width_old)){\n\t\t\t$trop_petite = true;\n\t\t}else{\n\t\t\t$trop_petite = false;\n\t\t}\n\t\tif($trop_petite){\n\t\t\treturn(false);\n\t\t}\n\t\tif($proportional){ // Calculer la proportionnalité\n\t\t\tif($width == 0){\n\t\t\t\t$factor = $height / $height_old;\n\t\t\t}elseif($height == 0){\n\t\t\t\t$factor = $width / $width_old;\n\t\t\t}else{\n\t\t\t\t$factor = min($width / $width_old,$height / $height_old);\n\t\t\t}\n\t\t\t$final_width = round($width_old * $factor);\n\t\t\t$final_height = round($height_old * $factor);\n\t\t}else{\n\t\t\t$final_width = ($width <= 0) ? $width_old : $width;\n\t\t\t$final_height = ($height <= 0) ? $height_old : $height;\n\t\t}\n\t\tswitch($info[2]){ // Charger l'image en mémoire en fonction du format\n\t\t\tcase IMAGETYPE_GIF:\n\t\t\t\t$image = imagecreatefromgif($file); break;\n\t\t\tcase IMAGETYPE_JPEG:\n\t\t\t\t$image = imagecreatefromjpeg($file); break;\n\t\t\tcase IMAGETYPE_PNG:\n\t\t\t\t$image = imagecreatefrompng($file); break;\n\t\t\tdefault:\n\t\t\t\treturn(false);\n\t\t}\n\t\t$image_resized = imagecreatetruecolor($final_width, $final_height); // Transparence pour les gif et les png\n\t\tif(($info[2] == IMAGETYPE_GIF) || ($info[2] == IMAGETYPE_PNG)){\n\t\t\t$transparency = imagecolortransparent($image);\n\t\t\tif($transparency >= 0){\n\t\t\t\t$transparent_color = imagecolorsforindex($image,$trnprt_indx);\n\t\t\t\t$transparency = imagecolorallocate($image_resized,$trnprt_color[\"red\"],$trnprt_color[\"green\"],$trnprt_color[\"blue\"]);\n\t\t\t\timagefill($image_resized,0,0,$transparency);\n\t\t\t\timagecolortransparent($image_resized,$transparency);\n\t\t\t}elseif($info[2] == IMAGETYPE_PNG){\n\t\t\t\timagealphablending($image_resized,false);\n\t\t\t\t$color = imagecolorallocatealpha($image_resized,0,0,0,127);\n\t\t\t\timagefill($image_resized,0,0,$color);\n\t\t\t\timagesavealpha($image_resized,true);\n\t\t\t}\n\t\t}\n\t\timagecopyresampled($image_resized,$image,0,0,0,0,$final_width,$final_height,$width_old,$height_old);\n\t\tif($delete_original){ // Suppression de l'image d'origine éventuelle\n\t\t\tif($use_linux_commands){\n\t\t\t\texec(\"rm \".$file);\n\t\t\t}else{\n\t\t\t\t@unlink($file);\n\t\t\t}\n\t\t}\n\t\tswitch(strtolower($output)){\n\t\t\tcase \"browser\": // Envoyer l'image par http avec son type MIME\n\t\t\t\t$mime = image_type_to_mime_type($info[2]); header(\"Content-type: $mime\"); $output = NULL; break;\n\t\t\tcase \"file\": // Ecraser l'image donnée (cas défaut)\n\t\t\t\t$output = $file; break;\n\t\t\tcase \"return\": // Retourner les infos de l'image redimensionnée en conservant celles de l'image d'origine\n\t\t\t\treturn($image_resized); break;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t\tswitch($info[2]){ // Retourner l'image redimensionnée en fonction de son format\n\t\t\tcase IMAGETYPE_GIF:\n\t\t\t\timagegif($image_resized,$output); break;\n\t\t\tcase IMAGETYPE_JPEG:\n\t\t\t\timagejpeg($image_resized,$output); break;\n\t\t\tcase IMAGETYPE_PNG:\n\t\t\t\timagepng($image_resized,$output); break;\n\t\t\tdefault:\n\t\t\t\treturn(false);\n\t\t}\n\t\treturn(true);\n\t}", "public function runMaxResize(Image $image, $width, $height) : Image\n\t{\n\t return $image->resize($width, $height, function ($constraint) {\n\t $constraint->aspectRatio();\n\t $constraint->upsize();\n\t });\n\t}", "public function reseize($path, $source, $width, $height, $nama_ori){\n \t//$source = sumber gambar yang akan di reseize\n $config['image_library'] = 'gd2';\n $config['source_image'] = $source;\n $config['new_image'] = $path.$width.'_'.$nama_ori;\n $config['overwrite'] = TRUE;\n $config['create_thumb'] = false;\n $config['width'] = $width;\n if($height>0){\n \t$config['maintain_ratio'] = false;\n \t$config['height'] = $height;\n }else{\n \t$config['maintain_ratio'] = true;\n }\n\n $this->image_lib->initialize($config);\n\n $this->image_lib->resize();\n $this->image_lib->clear();\n }", "function spc_resizeImage( $file, $thumbpath, $max_side , $fixfor = NULL ) {\n\n\tif ( file_exists( $file ) ) {\n\t\t$type = getimagesize( $file );\n\n\t\tif (!function_exists( 'imagegif' ) && $type[2] == 1 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagejpeg' ) && $type[2] == 2 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagepng' ) && $type[2] == 3 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t} else {\n\n\t\t\t// create the initial copy from the original file\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\t$image = imagecreatefromgif( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\t$image = imagecreatefromjpeg( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\t$image = imagecreatefrompng( $file );\n\t\t\t}\n\n\t\t\tif ( function_exists( 'imageantialias' ))\n\t\t\t\timageantialias( $image, TRUE );\n\n\t\t\t$image_attr = getimagesize( $file );\n\n\t\t\t// figure out the longest side\n if($fixfor){\n \t if($fixfor == 'width'){\n \t \t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n \t }elseif($fixfor == 'height'){\n \t $image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\t\n \t }\n }else{\n\t\t\tif ( $image_attr[0] > $image_attr[1] ) {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n\t\t\t\t//width is > height\n\t\t\t} else {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\n\t\t\t\t//height > width\n\t\t\t}\n }\t\n\n\t\t\t$thumbnail = imagecreatetruecolor( $image_new_width, $image_new_height);\n\t\t\t@ imagecopyresampled( $thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $image_attr[0], $image_attr[1] );\n\n\t\t\t// move the thumbnail to its final destination\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\tif (!imagegif( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\tif (!imagejpeg( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\tif (!imagepng( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$error = 0;\n\t}\n\n\tif (!empty ( $error ) ) {\n\t\treturn $error;\n\t} else {\n\t\treturn $thumbpath;\n\t}\n}", "function image_resize ( $args ) { /*\r\n\t\t * Changelog\r\n\t\t *\r\n\t\t * Version 3, July 20, 2007\r\n\t\t * - Cleaned\r\n\t\t *\r\n\t\t * Version 2, August 12, 2006\r\n\t\t * - Changed it to use $args\r\n\t\t */\r\n\t\t\r\n\t\t// Set default variables\r\n\t\t$image = $width_old = $height_old = $width_new = $height_new = $canvas_width = $canvas_height = $canvas_size = null;\r\n\t\t\r\n\t\t$x_old = $y_old = $x_new = $y_new = 0;\r\n\t\t\r\n\t\t// Exract user\r\n\t\textract($args);\r\n\t\t\r\n\t\t// Read image\r\n\t\t$image = image_read($image,false);\r\n\t\tif ( empty($image) ) { // error\r\n\t\t\ttrigger_error('no image was specified', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Check new dimensions\r\n\t\tif ( empty($width_new) || empty($height_new) ) { // error\r\n\t\t\ttrigger_error('Desired/new dimensions not found', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Do old dimensions\r\n\t\tif ( empty($width_old) && empty($height_old) ) { // Get the old dimensions from the image\r\n\t\t\t$width_old = imagesx($image);\r\n\t\t\t$height_old = imagesy($image);\r\n\t\t}\r\n\t\t\r\n\t\t// Do canvas dimensions\r\n\t\tif ( empty($canvas_width) && empty($canvas_height) ) { // Set default\r\n\t\t\t$canvas_width = $width_new;\r\n\t\t\t$canvas_height = $height_new;\r\n\t\t}\r\n\t\t\r\n\t\t// Let's force integer values\r\n\t\t$width_old = intval($width_old);\r\n\t\t$height_old = intval($height_old);\r\n\t\t$width_new = intval($width_new);\r\n\t\t$height_new = intval($height_new);\r\n\t\t$canvas_width = intval($canvas_width);\r\n\t\t$canvas_height = intval($canvas_height);\r\n\t\t\r\n\t\t// Create the new image\r\n\t\t$image_new = imagecreatetruecolor($canvas_width, $canvas_height);\r\n\t\t\r\n\t\t// Resample the image\r\n\t\t$image_result = imagecopyresampled(\r\n\t\t\t/* the new image */\r\n\t\t\t$image_new,\r\n\t\t\t/* the old image to update */\r\n\t\t\t$image,\r\n\t\t\t/* the new positions */\r\n\t\t\t$x_new, $y_new,\r\n\t\t\t/* the old positions */\r\n\t\t\t$x_old, $y_old,\r\n\t\t\t/* the new dimensions */\r\n\t\t\t$width_new, $height_new,\r\n\t\t\t/* the old dimensions */\r\n\t\t\t$width_old, $height_old);\r\n\t\t\r\n\t\t// Check\r\n\t\tif ( !$image_result ) { // ERROR\r\n\t\t\ttrigger_error('the image failed to resample', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// return\r\n\t\treturn $image_new;\r\n\t}", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t$imageType = image_type_to_mime_type($imageType);\n\t\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t\t\t$source=imagecreatefromgif($image); \n\t\t\tbreak;\n\t case \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\tbreak;\n\t case \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\t$source=imagecreatefrompng($image); \n\t\t\tbreak;\n \t}\n\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t \t\timagegif($newImage,$thumb_image_name); \n\t\t\tbreak;\n \tcase \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t \t\timagejpeg($newImage,$thumb_image_name,90); \n\t\t\tbreak;\n\t\tcase \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\timagepng($newImage,$thumb_image_name); \n\t\t\tbreak;\n }\n\tchmod($thumb_image_name, 0777);\n\treturn $thumb_image_name;\n}", "public function ResizeImageThumbnail($image_path, $height, $width,$image){\n\t $img_name_only = explode('.', $image);\n\t $img_name_only = $img_name_only[0];\n\t $image = new \\Imagick($image_path.'/'.$image);\n\t $image->thumbnailImage($width, $height);\n\t $store_image_with_new_name=$image_path.'/'.$img_name_only.'_'.$width.'X'.$height.'.jpeg';\n\t $image->writeImage($store_image_with_new_name);\n\t $image->destroy();\n\t return $img_name_only.'.jpeg';\n \t}", "function resize_crop_image($max_width, $max_height, $source_file, $dst_dir, $quality=80){\r\n $imgsize = getimagesize($source_file);\r\n $width = $imgsize[0];\r\n $height = $imgsize[1];\r\n $mime = $imgsize['mime'];\r\n\r\n switch($mime){\r\n case 'image/gif':\r\n $image_create = \"imagecreatefromgif\";\r\n $image = \"imagegif\";\r\n break;\r\n\r\n case 'image/png':\r\n $image_create = \"imagecreatefrompng\";\r\n $image = \"imagepng\";\r\n //$quality = 7;\r\n break;\r\n\r\n case 'image/jpeg':\r\n $image_create = \"imagecreatefromjpeg\";\r\n $image = \"imagejpeg\";\r\n break;\r\n\r\n default:\r\n return false;\r\n break;\r\n }\r\n\r\n $dst_img = imagecreatetruecolor($max_width, $max_height);\r\n $src_img = $image_create($source_file);\r\n\r\n $width_new = $height * $max_width / $max_height;\r\n $height_new = $width * $max_height / $max_width;\r\n //if the new width is greater than the actual width of the image, then the height is too large and the rest cut off, or vice versa\r\n if($width_new > $width){\r\n //cut point by height\r\n $h_point = (($height - $height_new) / 2);\r\n //copy image\r\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, $h_point, $max_width, $max_height, $width, $height_new);\r\n }else{\r\n //cut point by width\r\n $w_point = (($width - $width_new) / 2);\r\n imagecopyresampled($dst_img, $src_img, 0, 0, $w_point, 0, $max_width, $max_height, $width_new, $height);\r\n }\r\n\r\n //$image($dst_img, $dst_dir, $quality);\r\n imagejpeg($dst_img, $dst_dir, $quality);\r\n\r\n if($dst_img)imagedestroy($dst_img);\r\n if($src_img)imagedestroy($src_img);\r\n}", "function imageresize($img,$target=\"\",$width=0,$height=0,$percent=0)\n{\n if (strpos($img,\".jpg\") !== false or strpos($img,\".jpeg\") !== false){\n\t $image = ImageCreateFromJpeg($img);\n\t $extension = \".jpg\";\n } elseif (strpos($img,\".png\") !== false) {\n\t $image = ImageCreateFromPng($img);\n\t $extension = \".png\";\n } elseif (strpos($img,\".gif\") !== false) {\n\t $image = ImageCreateFromGif($img);\n\t $extension = \".gif\";\n }elseif(getfiletype($img)=='bmp'){\n\t\t$image = ImageCreateFromwbmp($img);\n\t\t$extension = '.bmp';\n }\n\n $size = getimagesize ($img);\n\n // calculate missing values\n if ($width and !$height) {\n\t $height = ($size[1] / $size[0]) * $width;\n } elseif (!$width and $height) {\n\t $width = ($size[0] / $size[1]) * $height;\n } elseif ($percent) {\n\t $width = $size[0] / 100 * $percent;\n\t $height = $size[1] / 100 * $percent;\n } elseif (!$width and !$height and !$percent) {\n\t $width = 100; // here you can enter a standard value for actions where no arguments are given\n\t $height = ($size[1] / $size[0]) * $width;\n }\n\n $thumb = imagecreatetruecolor ($width, $height);\n\n if (function_exists(\"imageCopyResampled\"))\n {\n\t if (!@ImageCopyResampled($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1])) {\n\t\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t }\n\t} else {\n\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t}\n\n //ImageCopyResampleBicubic ($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\n if (!$target) {\n\t $target = \"temp\".$extension;\n }\n\n $return = true;\n\n switch ($extension) {\n\t case \".jpeg\":\n\t case \".jpg\": {\n\t\t imagejpeg($thumb, $target, 100);\n\t break;\n\t }\n\t case \".gif\": {\n\t\t imagegif($thumb, $target);\n\t break;\n\t }\n\t case \".png\": {\n\t\t imagepng($thumb, $target);\n\t break;\n\t }\n\t case \".bmp\": {\n\t\t imagewbmp($thumb,$target);\n\t }\n\t default: {\n\t\t $return = false;\n\t }\n }\n\n // report the success (or fail) of the action\n return $return;\n}", "public function resize($width, $height, $aspect = true)\n {\n $imgW = $this->width;\n $imgH = $this->height;\n\n // Keep aspect\n if( $aspect )\n {\n list($width, $height) = self::_fitImage($imgW, $imgH, $width, $height);\n }\n\n // Create new temporary image\n self::_isSafeToOpen($width, $height);\n $dst = imagecreatetruecolor($width, $height);\n\n // Try to preserve transparency\n //self::_allocateTransparency($this->_resource, $dst, $this->_info->type);\n\n // Resize\n if( !imagecopyresampled($dst, $this->_resource, 0, 0, 0, 0, $width, $height, $imgW, $imgH) )\n {\n imagedestroy($dst);\n throw new Engine_Image_Adapter_Exception('Unable to resize image');\n }\n\n // Now destroy old image and overwrite with new\n imagedestroy($this->_resource);\n $this->_resource = $dst;\n $this->_info->width = $width;\n $this->_info->height = $height;\n \n return $this;\n }", "function imageresize($im, $width, $height) {\n list($w, $h) = [imagesx($im), imagesy($im)];\n $res = newTransparentImage($w + $width, $h + $height);\n imagecopy($res, $im, 0, 0, 0, 0, $w, $h);\n imagedestroy($im);\n return $res;\n}", "function aurum_woocommerce_3_3_transfer_image_sizes() {\n\t\t$do_resize = false;\n\t\t\n\t\t// WooCommerce Thumbnail\n\t\tif ( ( $shop_catalog_image_size = get_theme_mod( 'shop_catalog_image_size' ) ) ) {\n\t\t\t\n\t\t\t// {width}x{height} format\n\t\t\tif ( preg_match( '#^(?<width>[0-9]+)x(?<height>[0-9]+)(x(?<cropped>0|1))?$#', $shop_catalog_image_size, $shop_catalog_image_size_matches ) ) {\n\t\t\t\t$width = $shop_catalog_image_size_matches['width'];\n\t\t\t\t$height = $shop_catalog_image_size_matches['height'];\n\t\t\t\t$cropping = ! isset( $shop_catalog_image_size_matches['cropped'] ) || $shop_catalog_image_size_matches['cropped'];\n\t\t\t\t\n\t\t\t\t$ratio = _get_aspect_ratio( $width, $height );\n\t\t\t\t\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping', $cropping ? 'custom' : 'uncropped' );\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping_custom_width', $ratio[0] );\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping_custom_height', $ratio[1] );\n\t\t\t\t\n\t\t\t\t$do_resize = true;\n\t\t\t}\n\t\t\t// Crop width only\n\t\t\telse if( is_numeric( $shop_catalog_image_size ) ) {\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping', 'uncropped' );\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping_custom_width', $shop_catalog_image_size );\n\t\t\t\t\n\t\t\t\t$do_resize = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Single image\n\t\tif ( ( $shop_single_image_size = get_theme_mod( 'shop_single_image_size' ) ) ) {\n\t\t\t\n\t\t\tif ( preg_match( '#^(?<width>[0-9]+)(x(?<height>[0-9]+))?(x(?<cropped>0|1))?$#', $shop_single_image_size, $shop_single_image_size_matches ) ) {\n\t\t\t\tupdate_option( 'woocommerce_single_image_width', $shop_single_image_size_matches['width'] );\n\t\t\t\t\n\t\t\t\t$do_resize = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Request image regeneration\n\t\tif ( $do_resize && class_exists( 'WC_Regenerate_Images' ) ) {\n\t\t\tWC_Regenerate_Images::queue_image_regeneration();\n\t\t}\n\t\t\n\t\t// Lightbox has moved\n\t\tset_theme_mod( 'shop_single_lightbox', ! get_theme_mod( 'shop_single_lightbox_disable', false ) );\n\t\t\n\t\t\n\t\t// WooCommerce columns\n\t\t$shop_product_columns = get_data( 'shop_product_columns' );\n\t\t\n\t\tupdate_option( 'woocommerce_catalog_columns', aurum_get_number_from_word( 'decide' == $shop_product_columns ? 4 : $shop_product_columns ) );\n\t\t\n\t\tif ( preg_match( '#[0-9]+#', get_data( 'shop_products_per_page' ), $matches ) ) {\n\t\t\tupdate_option( 'woocommerce_catalog_rows', $matches[0] );\n\t\t}\n\t\t\n\t\t// Run this once\n\t\tupdate_option( 'aurum_woocommerce_3_3_transfer_image_sizes', true );\n\t}", "public static function resize(){\n\n}", "function normal_resize_image($source, $destination, $image_type, $max_size, $image_width, $image_height, $quality){\n\n\tif($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n\t//do not resize if image is smaller than max size\n\tif($image_width <= $max_size && $image_height <= $max_size){\n\t\tif(save_image($source, $destination, $image_type, $quality)){\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t//Construct a proportional size of new image\n\t$image_scale\t= min($max_size/$image_width, $max_size/$image_height);\n\t$new_width\t\t= ceil($image_scale * $image_width);\n\t$new_height\t\t= ceil($image_scale * $image_height);\n\n\t$new_canvas\t\t= imagecreatetruecolor( $new_width, $new_height ); //Create a new true color image\n\n\t//Copy and resize part of an image with resampling\n\tif(imagecopyresampled($new_canvas, $source, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height)){\n\t\tsave_image($new_canvas, $destination, $image_type, $quality); //save resized image\n\t}\n\n\treturn true;\n}" ]
[ "0.62883055", "0.62711394", "0.62004495", "0.61790395", "0.605369", "0.60505104", "0.60281974", "0.5977015", "0.59388775", "0.59349555", "0.5901326", "0.58924353", "0.58707166", "0.5784166", "0.5764854", "0.5763827", "0.5746553", "0.5741907", "0.57404655", "0.57319355", "0.57180095", "0.57125586", "0.57057273", "0.5693685", "0.5660405", "0.5625389", "0.5623042", "0.562238", "0.56124425", "0.5607354", "0.5597117", "0.5596989", "0.5595459", "0.5570152", "0.55303466", "0.55038995", "0.5489757", "0.54828066", "0.5478598", "0.5449435", "0.5444807", "0.54416317", "0.5420122", "0.5401774", "0.5390837", "0.538922", "0.5377041", "0.5376708", "0.5376511", "0.53701967", "0.536801", "0.53571117", "0.5349156", "0.5344237", "0.5340381", "0.53327537", "0.5330698", "0.5307971", "0.52927136", "0.5291728", "0.52734166", "0.5273373", "0.5270214", "0.5267478", "0.5263772", "0.5262162", "0.52621394", "0.52621067", "0.5260852", "0.52513355", "0.52476305", "0.5246999", "0.5239983", "0.5238695", "0.523819", "0.5235235", "0.52292603", "0.52286327", "0.5226414", "0.52236366", "0.5221956", "0.52183336", "0.5217799", "0.5217135", "0.5210363", "0.52065605", "0.52038646", "0.5202503", "0.5184952", "0.51847094", "0.5179356", "0.51719743", "0.5171779", "0.5171611", "0.5159876", "0.5150042", "0.514966", "0.51494354", "0.5135601", "0.51339054", "0.5128443" ]
0.0
-1
Resize the image by preserving aspect ratio. By default, it will keep the image inside the maxWidth and maxHeight. Passing useAsMinimum will make the smaller dimension equal to the maximum corresponding dimension
public function resizeRatio($width, $height, $useAsMinimum = false) { return $this->createCloneWithResource( function (InterventionImage $resource) use ($width, $height, $useAsMinimum) { return $resource->resize( $width, $height, function (Constraint $constraint) use ($useAsMinimum) { $constraint->aspectRatio(); if (!$useAsMinimum) { $constraint->upsize(); } } ); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function resize()\n {\n $width = $this->width;\n $height = $this->height;\n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n // Determine new image dimensions\n if($this->mode === \"crop\"){ // Crop image\n \n $max_width = $crop_width = $width;\n $max_height = $crop_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if($orig_width > $orig_height){ // Original is wide\n $height = $max_height;\n $width = ceil($y_ratio * $orig_width);\n \n } elseif($orig_height > $orig_width){ // Original is tall\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n \n } else { // Original is square\n $this->mode = \"fit\";\n \n return $this->resize();\n }\n \n // Adjust if the crop width is less than the requested width to avoid black lines\n if($width < $crop_width){\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n }\n \n } elseif($this->mode === \"fit\"){ // Fits the image according to aspect ratio to within max height and width\n $max_width = $width;\n $max_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if( ($orig_width <= $max_width) && ($orig_height <= $max_height) ){ // Image is smaller than max height and width so don't resize\n $tn_width = $orig_width;\n $tn_height = $orig_height;\n \n } elseif(($x_ratio * $orig_height) < $max_height){ // Wider rather than taller\n $tn_height = ceil($x_ratio * $orig_height);\n $tn_width = $max_width;\n \n } else { // Taller rather than wider\n $tn_width = ceil($y_ratio * $orig_width);\n $tn_height = $max_height;\n }\n \n $width = $tn_width;\n $height = $tn_height;\n \n } elseif($this->mode === \"fit-x\"){ // Sets the width to the max width and the height according to aspect ratio (will stretch if too small)\n $height = @round($orig_height * $width / $orig_width);\n \n if($orig_height <= $height){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n \n } elseif($this->mode === \"fit-y\"){ // Sets the height to the max height and the width according to aspect ratio (will stretch if too small)\n $width = @round($orig_width * $height / $orig_height);\n \n if($orig_width <= $width){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n } else {\n throw new \\Exception('Invalid mode: ' . $this->mode);\n }\n \n\n // Resize\n $this->temp = imagecreatetruecolor($width, $height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n \n imagecopyresampled($this->temp, $this->image, 0, 0, 0, 0, $width, $height, $orig_width, $orig_height);\n $this->sync();\n \n \n // Cropping?\n if($this->mode === \"crop\"){ \n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n $x_mid = $orig_width/2; // horizontal middle\n $y_mid = $orig_height/2; // vertical middle\n \n $this->temp = imagecreatetruecolor($crop_width, $crop_height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n\n imagecopyresampled($this->temp, $this->image, 0, 0, ($x_mid-($crop_width/2)), ($y_mid-($crop_height/2)), $crop_width, $crop_height, $crop_width, $crop_height);\n $this->sync();\n }\n }", "function resize_image($src, $width, $height){\n // initializing\n $save_path = Wordless::theme_temp_path();\n $img_filename = Wordless::join_paths($save_path, md5($width . 'x' . $height . '_' . basename($src)) . '.jpg');\n\n // if file doesn't exists, create it\n if (!file_exists($img_filename)) {\n $to_scale = 0;\n $to_crop = 0;\n\n // Get orig dimensions\n list ($width_orig, $height_orig, $type_orig) = getimagesize($src);\n\n // get original image ... to improve!\n switch($type_orig){\n case IMAGETYPE_JPEG: $image = imagecreatefromjpeg($src);\n break;\n case IMAGETYPE_PNG: $image = imagecreatefrompng($src);\n break;\n case IMAGETYPE_GIF: $image = imagecreatefromgif($src);\n break;\n default:\n return;\n }\n\n // which is the new smallest?\n if ($width < $height)\n $min_dim = $width;\n else\n $min_dim = $height;\n\n // which is the orig smallest?\n if ($width_orig < $height_orig)\n $min_orig = $width_orig;\n else\n $min_orig = $height_orig;\n\n // image of the right size\n if ($height_orig == $height && $width_orig == $width) ; // nothing to do\n // if something smaller => scale\n else if ($width_orig < $width) {\n $to_scale = 1;\n $ratio = $width / $width_orig;\n }\n else if ($height_orig < $height) {\n $to_scale = 1;\n $ratio = $height / $height_orig;\n }\n // if both bigger => scale\n else if ($height_orig > $height && $width_orig > $width) {\n $to_scale = 1;\n $ratio_dest = $width / $height;\n $ratio_orig = $width_orig / $height_orig;\n if ($ratio_dest > $ratio_orig)\n $ratio = $width / $width_orig;\n else\n $ratio = $height / $height_orig;\n }\n // one equal one bigger\n else if ( ($width == $width_orig && $height_orig > $height) || ($height == $height_orig && $width_orig > $width) )\n $to_crop = 1;\n // some problem...\n else\n echo \"ALARM\";\n\n // we need to zoom to get the right size\n if ($to_scale == 1) {\n $new_width = $width_orig * $ratio;\n $new_height = $height_orig * $ratio;\n $image_scaled = imagecreatetruecolor($new_width, $new_height);\n // scaling!\n imagecopyresampled($image_scaled, $image, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);\n $image = $image_scaled;\n\n if($new_width > $width || $new_height > $height)\n $to_crop = 1;\n }\n else {\n $new_width = $width_orig;\n $new_height = $height_orig;\n }\n\n // we need to crop the image\n if ($to_crop == 1) {\n $image_cropped = imagecreatetruecolor($width, $height);\n\n // find margins for images\n $margin_x = ($new_width - $width) / 2;\n $margin_y = ($new_height - $height) / 2;\n\n // cropping!\n imagecopy($image_cropped, $image, 0, 0, $margin_x, $margin_y, $width, $height);\n $image = $image_cropped;\n }\n\n // Save image\n imagejpeg($image, $img_filename, 95);\n }\n\n // Return image URL\n return Wordless::join_paths(Wordless::theme_temp_path(), basename($img_filename));\n }", "public function setOriginalImageWidthHeight() {\n \n $checkError = $this->isError();\n if (!$checkError) {\n \n /*\n * get original width and height\n */\n $this->__originalImageWidth = imagesx($this->__image);\n $this->__originalImageHeight = imagesy($this->__image);\n \n }\n \n }", "public function setOptimalImageWidthHeight() {\n \n $checkError = $this->isError();\n if (!$checkError) {\n \n if (empty($this->__requestedHeight) || empty($this->__requestedWidth)) {\n $this->setError(__d('cloggy','Empty requested width and height.'));\n } else {\n\n /*\n * get optimal size width and height\n */\n switch ($this->__option) {\n\n case 'exact':\n $this->__optimalWidth = $this->__requestedWidth;\n $this->__optimalHeight = $this->__requestedHeight;\n break;\n\n case 'portrait':\n $this->__setOptimalSizeByPortrait();\n break;\n\n case 'landscape':\n $this->__setOptimalSizeByLandscape();\n break;\n\n case 'crop':\n $this->__setOptimalSizeByCrop();\n break;\n\n default:\n $this->__setOptimalSizeByAuto();\n break;\n }\n }\n \n }\n \n }", "public function resize($width = NULL, $height = NULL, $master = NULL)\n {\n if ($master === NULL)\n {\n // Choose the master dimension automatically\n $master = Image::AUTO;\n }\n // Image::WIDTH and Image::HEIGHT depricated. You can use it in old projects,\n // but in new you must pass empty value for non-master dimension\n elseif ($master == Image::WIDTH AND ! empty($width))\n {\n $master = Image::AUTO;\n\n // Set empty height for backvard compatibility\n $height = NULL;\n }\n elseif ($master == Image::HEIGHT AND ! empty($height))\n {\n $master = Image::AUTO;\n\n // Set empty width for backvard compatibility\n $width = NULL;\n }\n\n if (empty($width))\n {\n if ($master === Image::NONE)\n {\n // Use the current width\n $width = $this->width;\n }\n else\n {\n // If width not set, master will be height\n $master = Image::HEIGHT;\n }\n }\n\n if (empty($height))\n {\n if ($master === Image::NONE)\n {\n // Use the current height\n $height = $this->height;\n }\n else\n {\n // If height not set, master will be width\n $master = Image::WIDTH;\n }\n }\n\n switch ($master)\n {\n case Image::AUTO:\n // Choose direction with the greatest reduction ratio\n $master = ($this->width / $width) > ($this->height / $height) ? Image::WIDTH : Image::HEIGHT;\n break;\n case Image::INVERSE:\n // Choose direction with the minimum reduction ratio\n $master = ($this->width / $width) > ($this->height / $height) ? Image::HEIGHT : Image::WIDTH;\n break;\n }\n\n switch ($master)\n {\n case Image::WIDTH:\n // Recalculate the height based on the width proportions\n $height = $this->height * $width / $this->width;\n break;\n case Image::HEIGHT:\n // Recalculate the width based on the height proportions\n $width = $this->width * $height / $this->height;\n break;\n }\n\n // Convert the width and height to integers\n $width = round($width);\n $height = round($height);\n\n $this->_do_resize($width, $height);\n\n return $this;\n }", "public function resize_fit(IImageInformation $src, $width, $height);", "public function runMaxResize(Image $image, $width, $height) : Image\n\t{\n\t return $image->resize($width, $height, function ($constraint) {\n\t $constraint->aspectRatio();\n\t $constraint->upsize();\n\t });\n\t}", "public function resizeTo($width, $height, $resizeOption = 'default') {\n switch (strtolower($resizeOption)) {\n case 'exact':\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n break;\n case 'maxwidth':\n $this->resizeWidth = $width;\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n break;\n case 'maxheight':\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n break;\n case 'proportionally':\n $ratio_orig = $this->origWidth / $this->origHeight;\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n if ($width / $height > $ratio_orig)\n $this->resizeWidth = $height * $ratio_orig;\n else\n $this->resizeHeight = $width / $ratio_orig;\n break;\n default:\n if ($this->origWidth > $width || $this->origHeight > $height) {\n if ($this->origWidth > $this->origHeight) {\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n $this->resizeWidth = $width;\n } else if ($this->origWidth < $this->origHeight) {\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n break;\n }\n\n $this->newImage = imagecreatetruecolor($this->resizeWidth, $this->resizeHeight);\n if ($this->ext == \"image/gif\" || $this->ext == \"image/png\") {\n imagealphablending($this->newImage, false);\n imagesavealpha($this->newImage, true);\n $transparent = imagecolorallocatealpha($this->newImage, 255, 255, 255, 127);\n imagefilledrectangle($this->newImage, 0, 0, $this->resizeWidth, $this->resizeHeight, $transparent);\n }\n imagecopyresampled($this->newImage, $this->image, 0, 0, 0, 0, $this->resizeWidth, $this->resizeHeight, $this->origWidth, $this->origHeight);\n }", "function image_scale($src_abspath, $dest_abspath, $aspect, $width, $strategy)\n{\n $im = new \\Imagick($src_abspath);\n $im = image_scale_im_obj($im, $aspect, $width, $strategy);\n return image_return_write($im, $dest_abspath);\n}", "private function __setOptimalSizeByCrop() {\n \n $heightRatio = $this->__originalImageHeight / $this->__requestedHeight;\n $widthRatio = $this->__originalImageWidth / $this->__requestedWidth;\n \n if ($heightRatio < $widthRatio) {\n $optimalRatio = $heightRatio;\n } else {\n $optimalRatio = $widthRatio;\n }\n \n $this->__optimalHeight = $this->__originalImageHeight / $optimalRatio;\n $this->__optimalWidth = $this->__originalImageWidth / $optimalRatio;\n \n }", "function imageResize($imageResourceId=null,$width=null,$height=null, $targetWidth=null, $targetHeight=null) {\n\n// $targetWidth =300;\n// $targetHeight =260;\n// dd($imageResourceId,$width,$height, $targetWidth, $targetHeight);\n\n $targetLayer=imagecreatetruecolor($targetWidth,$targetHeight);\n imagecopyresampled($targetLayer,$imageResourceId,0,0,0,0,$targetWidth,$targetHeight, $width,$height );\n// imagecopyresized($targetLayer,$imageResourceId,0,0,0,0, $width,$height,$targetWidth,$targetHeight);\n\n return $targetLayer;\n }", "public function resize($newWidth, $newHeight, $option='auto')\n\t{\n\t\t// Reset\n\t\tif ($this->imageResized) {\n\t\t\timagedestroy($this->imageResized);\n\t\t}\n\t\t$this->saveState = false;\n\n\t\t// Get optimal width and height based on $option\n\t\t$optionArray = $this->getDimensions((int)$newWidth, (int)$newHeight, $option);\n\t\t$this->optimalWidth = round($optionArray['optimalWidth']);\n\t\t$this->optimalHeight = round($optionArray['optimalHeight']);\n\n\t\t// Resample - create image canvas of x, y size\n\t\t$this->imageResized = imagecreatetruecolor($this->optimalWidth, $this->optimalHeight);\n\t\tif (imagetypes() & IMG_PNG) {\n\t\t\timagesavealpha($this->imageResized, true);\n\t\t\timagealphablending($this->imageResized, false);\n\t\t}\n\t\timagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $this->optimalWidth, $this->optimalHeight, $this->width, $this->height);\n\n\t\t// If option is 'crop', then crop too\n\t\tif ($option == 'crop') {\n\t\t\t$this->cropImage($this->optimalWidth, $this->optimalHeight, $newWidth, $newHeight);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function resize($width)\n {\n // Validation\n if ($width > $this->_maxWidth)\n {\n throw new PHPMapper_Exception_Image(\n 'Image width too large. Maximum width for map is ' . $this->_maxWidth . ' pixels.'\n );\n }\n else if ($width < PHPMapper::MIN_WIDTH)\n {\n throw new PHPMapper_Exception_Image(\n 'Image width should be at least ' . PHPMapper::MIN_WIDTH . ' pixels wide.'\n );\n }\n\n // Resize the image while maintaining ratio\n $ratio = $this->_maxHeight / $this->_maxWidth;\n $height = floor($width * $ratio);\n $out = imagecreate($width, $height);\n\n imagealphablending($out, false);\n imagesavealpha($out, false);\n imagecopyresampled($out, $this->_image, 0, 0, 0, 0, $width, $height,\n $this->_maxWidth, $this->_maxHeight\n );\n\n imagedestroy($this->_image);\n $this->_image = $out;\n\n return $this;\n }", "public function resize(IImageInformation $src, $width, $height);", "public function resizeImage($imagePath, $maxWidth = '*', $maxHeight = '*', $allowScaleUp = false)\n {\n $imageSize = getimagesize($imagePath);\n\n // Check if the file exists and is an image\n if ($imageSize) {\n $oldWidth = $imageSize[0];\n $oldHeight = $imageSize[1];\n\n // Check if resize is needed\n if (($oldWidth > $maxWidth && '*' != $maxWidth)\n || ($oldHeight > $maxHeight && '*' != $maxHeight)\n || true === $allowScaleUp\n ) {\n if ($maxWidth && '*' == $maxHeight) {\n // Constrain by width\n $proportion = $oldHeight / $oldWidth;\n $width = $maxWidth;\n $height = $maxWidth * $proportion;\n } else if ($maxHeight && '*' == $maxWidth) {\n // Constrain by height\n $proportion = $oldWidth / $oldHeight;\n $height = $maxHeight;\n $width = $maxHeight * $proportion;\n } else if (!$maxWidth && $maxHeight) {\n // Constrain by smallest side\n if ($oldWidth > $oldHeight) {\n return $this->resizeImage($imagePath, '*', $maxHeight, $allowScaleUp);\n } else {\n return $this->resizeImage($imagePath, $maxWidth, '*', $allowScaleUp);\n }\n } else if ($maxWidth && !$maxHeight) {\n // Constrain by largest side\n if ($oldWidth > $oldHeight) {\n return $this->resizeImage($imagePath, $maxWidth, '*', $allowScaleUp);\n } else {\n return $this->resizeImage($imagePath, '*', $maxHeight, $allowScaleUp);\n }\n } else {\n if ($maxWidth > $maxHeight) {\n // Constrain by height\n return $this->resizeImage($imagePath, '*', $maxHeight, $allowScaleUp);\n } else {\n // Constrain by width\n return $this->resizeImage($imagePath, $maxWidth, '*', $allowScaleUp);\n }\n }\n } else {\n $width = $oldWidth;\n $height = $oldHeight;\n }\n\n $width = round($width);\n $height = round($height);\n\n return array('width' => $width, 'height' => $height);\n } else {\n return false;\n }\n }", "public static function ScaleThumbnailSizes($image, $maxwidth = -1, $maxheight = -1,\n $behaviour = 1, $upscale = false)\n {\n if(empty($image) ||\n (is_string($image) && !is_file($image)) ||\n !is_resource($image) )\n return false;\n\n if(is_string($image))\n {\n list($width, $height) = @getimagesize($image);\n $maxwidth = intval($maxwidth);\n $maxheight = intval($maxheight);\n }\n else\n {\n $maxwidth = $width = imagesx($image);\n $maxheight = $height = imagesy($image);\n }\n $maxwidth = Is_Valid_Number($maxwidth,0,1,SD_MEDIA_MAX_DIM);\n $maxheight = Is_Valid_Number($maxheight,0,1,SD_MEDIA_MAX_DIM);\n\n if(empty($maxwidth) || empty($maxheight))\n {\n return false;\n }\n\n //Calculate the width:height ratio\n $owidth = $width;\n $oheight = $height;\n $ratio = $height/$width;\n if($maxheight < 0 || $maxwidth < 0)\n {\n if($maxheight < 0 && $maxwidth < 0)\n {\n //Do nothing\n }\n elseif ($maxheight < 0)\n {\n $width = $maxwidth;\n $height = round($width*$ratio);\n }\n elseif ($maxwidth < 0)\n {\n $height = $maxheight;\n $width = round($height/$ratio);\n }\n }\n elseif ($ratio == 1)\n {\n //Same Height/Width\n if ($maxheight === $maxwidth)\n {\n $width = $maxwidth;\n $height = $maxheight;\n }\n else\n {\n $height = min($maxheight,$maxwidth);\n $width = min($maxheight,$maxwidth);\n }\n }\n else\n {\n $case1_width = $maxwidth;\n $case1_height = round($case1_width*$ratio);\n $case1_area = round($case1_width*$case1_height);\n\n $case2_height = $maxheight;\n $case2_width = round($case2_height/$ratio);\n $case2_area = round($case2_width*$case2_height);\n\n //Check if it is an ambiguous case\n if(($case1_width <= $maxwidth) && ($case1_height <= $maxheight) &&\n ($case2_width <= $maxwidth) && ($case2_height <= $maxheight))\n {\n //$behaviour Sometimes, 2 values are obtained. Set this to 1 to return the\n //one with the bigger pixel area or 2 to return the one with smaller pixel area.\n if($behaviour == 1)\n {\n if($case1_area >= $case2_area)\n {\n $height = $case1_height;\n $width = $case1_width;\n }\n else\n {\n $height = $case2_height;\n $width = $case2_width;\n }\n }\n else\n {\n if($case1_area <= $case2_area)\n {\n $height = $case1_height;\n $width = $case1_width;\n }\n else\n {\n $height = $case2_height;\n $width = $case2_width;\n }\n }\n }\n else\n {\n if ($case1_width <= $maxwidth && $case1_height <= $maxheight)\n {\n $height = $case1_height;\n $width = $case1_width;\n }\n else\n {\n $height = $case2_height;\n $width = $case2_width;\n }\n }\n }\n\n if(($height > $oheight) || ($width > $owidth))\n {\n $width = $owidth;\n $height = $oheight;\n }\n $array = array((int)$width,(int)$height);\n return $array;\n\n }", "public function _set_new_size_auto()\n {\n if (empty($this->source_width) || empty($this->source_height)) {\n if ( ! $this->SILENT_MODE) {\n trigger_error('Missing source image sizes!', E_USER_WARNING);\n }\n return false;\n }\n $k1 = $this->source_width / $this->limit_x;\n $k2 = $this->source_height / $this->limit_y;\n $k = $k1 >= $k2 ? $k1 : $k2;\n if ($this->reduce_only && $k1 <= 1 && $k2 <= 1) {\n $this->output_width = $this->source_width;\n $this->output_height = $this->source_height;\n } else {\n $this->output_width = round($this->source_width / $k, 0);\n $this->output_height = round($this->source_height / $k, 0);\n }\n return true;\n }", "public function thumbnail($image_path, $size_name, $maxWidth = 370, $maxHeight = 370)\n\t{\n\t\t$img = $this->intervention->make($image_path);\n\t\t$img->interlace();\n\t\t\n\t\tif($img->height()>$maxHeight){\n\n\t\t\t// method 1\n\t\t\t// add callback functionality to retain maximal original image size\n\t\t\t$img->fit($maxWidth, $maxHeight, function ($constraint) {\n\t\t\t $constraint->upsize();\n\t\t\t});\n\t\t\n\t\t}else{\n\t\t\t// method 2\n\t\t // resize image to 370x370 and keep the aspect ratio\n\t\t\t$img->resize($maxWidth, $maxHeight, function ($constraint) {\n\t\t\t\t$constraint->aspectRatio();\n\t\t\t});\n\t\t\t\n\t\t\t// Fill up the blank spaces with transparent color\n\t\t\t$img->resizeCanvas($maxWidth, $maxHeight, 'center', false, array(255, 255, 255, 0));\n\t\t}\n\t\t\n\t\t$new_image_path = str_replace(\"-source\", \"-$size_name\", $image_path);\n\t\t$img->save($new_image_path, 80);\n\t\t\n\t\treturn $new_image_path;\n\t}", "public function runFillMaxResize(Image $image, $width, $height) : Image\n {\n\t\treturn $this->runContainResize($image, $width, $height)->resizeCanvas($width, $height, 'center');\n }", "function scale_image($arg)\n\t{\n\t\t// max_width, max_height, cur_width, cur_height\n\t\t\n\t\t$ret = array(\n\t\t\t\t\t 'img_width' => $arg['cur_width'],\n\t\t\t\t\t 'img_height' => $arg['cur_height']\n\t\t\t\t\t);\n\t\t\n\t\tif ( $arg['cur_width'] > $arg['max_width'] )\n\t\t{\n\t\t\t$ret['img_width'] = $arg['max_width'];\n\t\t\t$ret['img_height'] = ceil( ( $arg['cur_height'] * ( ( $arg['max_width'] * 100 ) / $arg['cur_width'] ) ) / 100 );\n\t\t\t$arg['cur_height'] = $ret['img_height'];\n\t\t\t$arg['cur_width'] = $ret['img_width'];\n\t\t}\n\t\t\n\t\tif ( $arg['cur_height'] > $arg['max_height'] )\n\t\t{\n\t\t\t$ret['img_height'] = $arg['max_height'];\n\t\t\t$ret['img_width'] = ceil( ( $arg['cur_width'] * ( ( $arg['max_height'] * 100 ) / $arg['cur_height'] ) ) / 100 );\n\t\t}\n\t\t\n\t\treturn $ret;\n\t}", "private function __setOptimalSizeByLandscape() {\n \n $ratio = $this->__originalImageHeight / $this->__originalImageWidth;\n $newHeight = $this->__requestedWidth * $ratio;\n \n $this->__optimalWidth = $this->__requestedWidth;\n $this->__optimalHeight = $newHeight;\n \n }", "private function __setOptimalSizeByAuto() {\n \n if ($this->__originalImageHeight < $this->__originalImageWidth) {\n $this->__setOptimalSizeByLandscape();\n }\n \n if ($this->__originalImageHeight > $this->__originalImageWidth) {\n $this->__setOptimalSizeByPortrait();\n }\n \n if ($this->__requestedHeight < $this->__requestedWidth) {\n $this->__setOptimalSizeByLandscape();\n }\n \n if ($this->__requestedHeight > $this->__requestedWidth) {\n $this->__setOptimalSizeByPortrait();\n }\n \n if (empty($this->__optimalHeight) && empty($this->__optimalWidth)) {\n $this->__optimalWidth = $this->__requestedWidth;\n $this->__optimalHeight = $this->__requestedHeight;\n }\n \n }", "function resize_image($image, $max_width, $max_height) {\n\t$width = imagesx($image);\n\t$height = imagesy($image);\n\t\n\tif ($width <= $max_width && $height <= $max_height) {\n\t\t// Don't bother if the image is already under the limits\n\t\treturn true;\n\t} else {\n\t\t// Set immediately transparency mode on the source image\n\t\timagealphablending($image, true);\n\t\n\t\t$ratio = $width / $height;\n\t\tif ($ratio > 1) { // width > height\n\t\t\t$n_width = $max_width;\n\t\t\t$n_height = round($height * $max_width / $width);\n\t\t} else {\n\t\t\t$n_width = round($width * $max_height / $height);\n\t\t\t$n_height = $max_height;\n\t\t}\n\t\t$dst_image = imagecreatetruecolor($n_width, $n_height);\n\t\timagealphablending($dst_image, false); \n\t\timagesavealpha($dst_image, true);\n\t\timagecopyresampled($dst_image, $image, 0, 0, 0, 0, $n_width, $n_height, $width, $height);\n\t}\n\treturn $dst_image;\n}", "function minimize_image($image_url, $min_height='', $min_width='')\n{\n\t$img_settings = getimagesize($image_url);\n\tif($min_height != '' && $img_settings[1] > $min_height){\n\t\t$min_height = $min_height;\n\t\t$min_width = $img_settings[0]*($min_height/$img_settings[1]);\n\t}\n\telse if($min_width != '' && $img_settings[0] > $min_width){\n\t\t$min_height = $img_settings[1]*($min_width/$img_settings[0]);\n\t\t$min_width = $min_width; \n\t}\n\telse\n\t{\n\t\t$min_height = $img_settings[1];\n\t\t$min_width = $img_settings[0];\n\t}\n\t\n\treturn array('width'=>$min_width, 'height'=>$min_height, 'actualwidth'=>$img_settings[0], 'actualheight'=>$img_settings[1]);\n}", "function scaleMaxX($new_x)\r\n {\r\n $new_y = round(($new_x / $this->img_x) * $this->img_y, 0);\r\n return $this->_resize($new_x, $new_y);\r\n }", "protected function scaleImages() {}", "function normal_resize_image($source, $destination, $image_type, $max_size, $image_width, $image_height, $quality){\n\n if($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n //do not resize if image is smaller than max size\n if($image_width <= $max_size && $image_height <= $max_size){\n if(save_image($source, $destination, $image_type, $quality)){\n return true;\n }\n }\n\n //Construct a proportional size of new image\n $image_scale\t= min($max_size/$image_width, $max_size/$image_height);\n $new_width\t\t= ceil($image_scale * $image_width);\n $new_height\t\t= ceil($image_scale * $image_height);\n\n $new_canvas\t\t= imagecreatetruecolor( $new_width, $new_height ); //Create a new true color image\n\n //Copy and resize part of an image with resampling\n if(imagecopyresampled($new_canvas, $source, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height)){\n save_image($new_canvas, $destination, $image_type, $quality); //save resized image\n }\n\n return true;\n}", "public function resize($width=null, $height=null, $master=null);", "function resizeImageAndSave(&$imageData, $destinationFileName, $max_width, $max_height, $quality = 0.75, $mentainAspectRatio = false, $forceResize = false)\n\t{\n\t\t$srcImage = $imageData->image;\n\t\t$imageInfo = $imageData->imageInfo;\n\t\t\n\t\t// if only one size is specified\n\t\tif ($max_width == '*' || $max_height == '*')\n\t\t{\n\t\t\t$new_size = $this->calculateSize($imageInfo->width, $imageInfo->height, $max_width, $max_height);\n\t\t\t$max_width = $new_size['width'];\n\t\t\t$max_height = $new_size['height'];\n\t\t}\n\t\t\n\t\t// if no resize needed, save original file\n\t\tif ($imageInfo->height < $max_height && $imageInfo->width < $max_width && !$forceResize)\n\t\t\treturn $this->saveImageObjectToFile($srcImage, $imageInfo->type, $destinationFileName, $quality);\n\t\t\n\t\t$ratio = (($imageInfo->height/$imageInfo->width) - ($max_height/$max_width));\n\t\t\n\t\tif ($mentainAspectRatio)\n\t\t{\n\t\t\tif ($ratio < 0)\n\t\t\t{\n\t\t\t\t$new_width = $max_width;\n\t\t\t\t$new_height = ceil($imageInfo->height * $max_width / $imageInfo->width);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$new_height = $max_height;\n\t\t\t\t$new_width = ceil($imageInfo->width * $max_height / $imageInfo->height);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$new_width = $max_width;\n\t\t\t$new_height = $max_height;\n\t\t}\n\t\t\t\t\t\t\n\t\t$dstImage = $this->resizeImage($srcImage, $imageInfo->width, $imageInfo->height, $new_width, $new_height);\n\t\t\n\t\tif ($dstImage == false)\n\t\t\treturn false;\n\t\treturn $this->saveImageObjectToFile($dstImage, $imageInfo->type, $destinationFileName, $quality);\n\t}", "function funcs_imageResize(&$width, &$height, $target, $bywidth = null) {\n\tif ($width<=$target && $height<=$target){\n\t\treturn;\n\t}\n\t//takes the larger size of the width and height and applies the \n\t//formula accordingly...this is so this script will work \n\t//dynamically with any size image \n\tif (is_null($bywidth)){\n\t\tif ($width > $height) { \n\t\t\t$percentage = ($target / $width); \n\t\t} else { \n\t\t\t$percentage = ($target / $height); \n\t\t}\n\t}else{\n\t\tif ($bywidth){\n\t\t\t$percentage = ($target / $width);\n\t\t\t//if height would increase as a result\n\t\t\tif ($height < round($height * $percentage)){\n\t\t\t\treturn;\n\t\t\t} \n\t\t}else{\n\t\t\t$percentage = ($target / $height); \n\t\t\t//if width would increase as a result\n\t\t\tif ($width < round($width * $percentage)){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t} \n\t//gets the new value and applies the percentage, then rounds the value \n\t$width = round($width * $percentage); \n\t$height = round($height * $percentage); \n}", "function createThumbnail($image, $newMaxWidth, $newMaxHeight) {\n $width_orig = imagesx($image);\n $height_orig = imagesy($image);\n\n $ratio_orig = $width_orig/$height_orig;\n\n if ($newMaxWidth/$newMaxHeight > $ratio_orig) {\n $newMaxWidth = $newMaxHeight * $ratio_orig;\n } else {\n $newMaxHeight = $newMaxWidth / $ratio_orig;\n }\n\n $dst_img = imagecreatetruecolor( $newMaxWidth, $newMaxHeight );\n imagealphablending( $dst_img, false );\n imagesavealpha( $dst_img, true );\n\n imagecopyresampled($dst_img, $image,0,0,0,0,$newMaxWidth,$newMaxHeight,$width_orig,$height_orig);\n\n return $dst_img;\n}", "function normal_resize_image($source, $destination, $image_type, $max_size, $image_width, $image_height, $quality){\n\n\tif($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n\t//do not resize if image is smaller than max size\n\tif($image_width <= $max_size && $image_height <= $max_size){\n\t\tif(save_image($source, $destination, $image_type, $quality)){\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t//Construct a proportional size of new image\n\t$image_scale\t= min($max_size/$image_width, $max_size/$image_height);\n\t$new_width\t\t= ceil($image_scale * $image_width);\n\t$new_height\t\t= ceil($image_scale * $image_height);\n\n\t$new_canvas\t\t= imagecreatetruecolor( $new_width, $new_height ); //Create a new true color image\n\n\t//Copy and resize part of an image with resampling\n\tif(imagecopyresampled($new_canvas, $source, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height)){\n\t\tsave_image($new_canvas, $destination, $image_type, $quality); //save resized image\n\t}\n\n\treturn true;\n}", "function spc_resizeImage( $file, $thumbpath, $max_side , $fixfor = NULL ) {\n\n\tif ( file_exists( $file ) ) {\n\t\t$type = getimagesize( $file );\n\n\t\tif (!function_exists( 'imagegif' ) && $type[2] == 1 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagejpeg' ) && $type[2] == 2 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagepng' ) && $type[2] == 3 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t} else {\n\n\t\t\t// create the initial copy from the original file\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\t$image = imagecreatefromgif( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\t$image = imagecreatefromjpeg( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\t$image = imagecreatefrompng( $file );\n\t\t\t}\n\n\t\t\tif ( function_exists( 'imageantialias' ))\n\t\t\t\timageantialias( $image, TRUE );\n\n\t\t\t$image_attr = getimagesize( $file );\n\n\t\t\t// figure out the longest side\n if($fixfor){\n \t if($fixfor == 'width'){\n \t \t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n \t }elseif($fixfor == 'height'){\n \t $image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\t\n \t }\n }else{\n\t\t\tif ( $image_attr[0] > $image_attr[1] ) {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n\t\t\t\t//width is > height\n\t\t\t} else {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\n\t\t\t\t//height > width\n\t\t\t}\n }\t\n\n\t\t\t$thumbnail = imagecreatetruecolor( $image_new_width, $image_new_height);\n\t\t\t@ imagecopyresampled( $thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $image_attr[0], $image_attr[1] );\n\n\t\t\t// move the thumbnail to its final destination\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\tif (!imagegif( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\tif (!imagejpeg( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\tif (!imagepng( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$error = 0;\n\t}\n\n\tif (!empty ( $error ) ) {\n\t\treturn $error;\n\t} else {\n\t\treturn $thumbpath;\n\t}\n}", "function resizeImage ( $sourcePathFilename, $extension, $destinationPath, $maxWidth, $maxHeight ) {\n $result = '';\n debug_log ( __FILE__, __LINE__, $sourcePathFilename );\n debug_log ( __FILE__, __LINE__, $extension );\n\n if ( $sourcePathFilename != '' && $extension != '' ) {\n if ( in_array ( $extension, array ( 'jpg', 'jpeg', 'png', 'gif' ) ) ) {\n switch ( $extension ) {\n case 'jpg':\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n break;\n\n case 'jpeg':\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n break;\n\n case 'png':\n $imageOldData = imagecreatefrompng ( $sourcePathFilename );\n break;\n\n case 'gif':\n $imageOldData = imagecreatefromgif ( $sourcePathFilename );\n break;\n\n default:\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n }\n\n $imageOldWidth = imagesx ( $imageOldData );\n $imageOldHeight = imagesy ( $imageOldData );\n\n $imageScale = min ( $maxWidth / $imageOldWidth, $maxHeight / $imageOldHeight );\n\n $imageNewWidth = ceil ( $imageScale * $imageOldWidth );\n $imageNewHeight = ceil ( $imageScale * $imageOldHeight );\n\n $imageNewData = imagecreatetruecolor ( $imageNewWidth, $imageNewHeight );\n\n $colorWhite = imagecolorallocate ( $imageNewData, 255, 255, 255 );\n imagefill ( $imageNewData, 0, 0, $colorWhite );\n\n imagecopyresampled ( $imageNewData, $imageOldData, 0, 0, 0, 0, $imageNewWidth, $imageNewHeight, $imageOldWidth, $imageOldHeight );\n\n ob_start ();\n imagejpeg ( $imageNewData, NULL, 100 );\n $imageNewDataString = ob_get_clean ();\n\n $imageNewFilename = hash ( 'sha256', $imageNewDataString ) . uniqid () . '.jpg';\n\n $imageNewPathFilename = $destinationPath . $imageNewFilename;\n\n if ( file_put_contents ( $imageNewPathFilename, $imageNewDataString ) !== false )\n {\n $result = $imageNewFilename;\n }\n\n imagedestroy ( $imageNewData );\n imagedestroy ( $imageOldData );\n }\n }\n\n return $result;\n}", "function image_resize_dimensions ( $args ) {\r\n\t\t/*\r\n\t\t * Changelog\r\n\t\t *\r\n\t\t * v8.1, November 11, 2009\r\n\t\t * - Now uses trigger_error instead of outputting errors to screen\r\n\t\t *\r\n\t\t * v8, December 02, 2007\r\n\t\t * - Cleaned by using math instead of logic\r\n\t\t * - Restructured the code\r\n\t\t * - Re-organised variable names\r\n\t\t *\r\n\t\t * v7, 20/07/2007\r\n\t\t * - Cleaned\r\n\t\t *\r\n\t\t * v6,\r\n\t\t * - Added cropping\r\n\t\t *\r\n\t\t * v5, 12/08/2006\r\n\t\t * - Changed to use args\r\n\t\t */\r\n\t\t\r\n\t\t/*\r\n\t\tThe 'exact' resize mode, will resize things to the exact limit.\r\n\t\tIf a width or height is 0, the appropriate value will be calculated by ratio\r\n\t\tResults with a 800x600 limit:\r\n\t\t\t*x*\t\t\t->\t800x600\r\n\t\tResults with a 0x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\r\n\t\t\t96x48\t\t->\t1200x600\r\n\t\t\t1000x500\t->\t1200x600\r\n\t\tResults with a 800x0 limit:\r\n\t\t\t1280x1024\t->\t800x640\r\n\t\t\t1900x1200\t->\t800x505\r\n\t\t\t96x48\t\t->\t800x400\r\n\t\t\t1000x500\t->\t800x400\r\n\t\t*/\r\n\t\t\r\n\t\t/*\r\n\t\tThe 'area' resize mode, will resize things to fit within the area.\r\n\t\tIf a width or height is 0, the appropriate value will be calculated by ratio\r\n\t\tResults with a 800x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\t-> 800x505\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t800x400 = '800x'.(800/100)*500\r\n\t\tResults with a 0x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t1000x500\tno change\r\n\t\tResults with a 800x0 limit:\r\n\t\t\t1280x1024\t->\t800x640\r\n\t\t\t1900x1200\t->\t950x600\t->\t800x505\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t800x400\t= '800x'.(800/1000)*500\r\n\t\t*/\r\n\t\t\r\n\t\t// ---------\r\n\t\t$image = $x_original = $y_original = $x_old = $y_old = $resize_mode = $width_original = $width_old = $width_desired = $width_new = $height_original = $height_old = $height_desired = $height_new = null;\r\n\t\textract($args);\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($width_original) && !is_null($width_old) ) {\r\n\t\t\t$width_original = $width_old;\r\n\t\t\t$width_old = null;\r\n\t\t}\r\n\t\tif ( is_null($height_original) && !is_null($height_old) ) {\r\n\t\t\t$height_original = $height_old;\r\n\t\t\t$height_old = null;\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( is_null($width_original) && is_null($height_original) && !is_null($image) ) { // Get from image\r\n\t\t\t$image = image_read($image);\r\n\t\t\t$width_original = imagesx($image);\r\n\t\t\t$height_original = imagesy($image);\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( empty($width_original) || empty($height_original) ) { //\r\n\t\t\ttrigger_error('no original dimensions specified', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($width_desired) && !is_null($width_new) ) {\r\n\t\t\t$width_desired = $width_new;\r\n\t\t\t$width_new = null;\r\n\t\t}\r\n\t\tif ( is_null($height_desired) && !is_null($height_new) ) {\r\n\t\t\t$height_desired = $height_new;\r\n\t\t\t$height_new = null;\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( is_null($width_desired) || is_null($height_desired) ) { // Don't do any resizing\r\n\t\t\ttrigger_error('no desired dimensions specified', E_USER_NOTICE);\r\n\t\t\t// return array( 'width' => $width_original, 'height' => $height_original );\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($resize_mode) ) {\r\n\t\t\t$resize_mode = 'area';\r\n\t\t} elseif ( $resize_mode === 'none' ) { // Don't do any resizing\r\n\t\t\ttrigger_error('$resize_mode === \\'none\\'', E_USER_NOTICE);\r\n\t\t\t// return array( 'width' => $width_original, 'height' => $height_original );\r\n\t\t} elseif ( !in_array($resize_mode, array('area', 'crop', 'exact', true)) ) { //\r\n\t\t\ttrigger_error('Passed $resize_mode is not valid: ' . var_export(compact('resize_mode'), true), E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($x_original) && !is_null($x_old) ) {\r\n\t\t\t$x_original = $x_old;\r\n\t\t\tunset($x_old);\r\n\t\t}\r\n\t\tif ( is_null($y_original) && !is_null($y_old) ) {\r\n\t\t\t$y_original = $y_old;\r\n\t\t\tunset($y_old);\r\n\t\t}\r\n\t\tif ( is_null($x_original) )\r\n\t\t\t$x_original = 0;\r\n\t\tif ( is_null($y_original) )\r\n\t\t\t$y_original = 0;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Let's force integer values\r\n\t\t$width_original = intval($width_original);\r\n\t\t$height_original = intval($height_original);\r\n\t\t$width_desired = intval($width_desired);\r\n\t\t$height_desired = intval($height_desired);\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Set proportions\r\n\t\tif ( $height_original !== 0 )\r\n\t\t\t$proportion_wh = $width_original / $height_original;\r\n\t\tif ( $width_original !== 0 )\r\n\t\t\t$proportion_hw = $height_original / $width_original;\r\n\t\t\r\n\t\tif ( $height_desired !== 0 )\r\n\t\t\t$proportion_wh_desired = $width_desired / $height_desired;\r\n\t\tif ( $width_desired !== 0 )\r\n\t\t\t$proportion_hw_desired = $height_desired / $width_desired;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Set cutoms\r\n\t\t$x_new = $x_original;\r\n\t\t$y_new = $y_original;\r\n\t\t$canvas_width = $canvas_height = null;\r\n\t\t\r\n\t\t// ---------\r\n\t\t$width_new = $width_original;\r\n\t\t$height_new = $height_original;\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Do resize\r\n\t\tif ( $height_desired === 0 && $width_desired === 0 ) {\r\n\t\t\t// Nothing to do\r\n\t\t} elseif ( $height_desired === 0 && $width_desired !== 0 ) {\r\n\t\t\t// We don't care about the height\r\n\t\t\t$width_new = $width_desired;\r\n\t\t\tif ( $resize_mode !== 'exact' ) {\r\n\t\t\t\t// h = w*(h/w)\r\n\t\t\t\t$height_new = $width_desired * $proportion_hw;\r\n\t\t\t}\r\n\t\t} elseif ( $height_desired !== 0 && $width_desired === 0 ) {\r\n\t\t\t// We don't care about the width\r\n\t\t\tif ( $resize_mode !== 'exact' ) {\r\n\t\t\t\t // w = h*(w/h)\r\n\t\t\t\t$width_new = $height_desired * $proportion_wh;\r\n\t\t\t}\r\n\t\t\t$height_new = $height_desired;\r\n\t\t} else {\r\n\t\t\t// We care about both\r\n\r\n\t\t\tif ( $resize_mode === 'exact' || /* no upscaling */ ($width_original <= $width_desired && $height_original <= $height_desired) ) { // Nothing to do\r\n\t\t\t} elseif ( $resize_mode === 'area' ) { // Proportion to fit inside\r\n\t\t\t\t\r\n\r\n\t\t\t\t// Pick which option\r\n\t\t\t\tif ( $proportion_wh <= $proportion_wh_desired ) { // Option 1: wh\r\n\t\t\t\t\t// Height would of overflowed\r\n\t\t\t\t\t$width_new = $height_desired * $proportion_wh; // w = h*(w/h)\r\n\t\t\t\t\t$height_new = $height_desired;\r\n\t\t\t\t} else // if ( $proportion_hw <= $proportion_hw_desired )\r\n{ // Option 2: hw\r\n\t\t\t\t\t// Width would of overflowed\r\n\t\t\t\t\t$width_new = $width_desired;\r\n\t\t\t\t\t$height_new = $width_desired * $proportion_hw; // h = w*(h/w)\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t} elseif ( $resize_mode === 'crop' ) { // Proportion to occupy\r\n\t\t\t\t\r\n\r\n\t\t\t\t// Pick which option\r\n\t\t\t\tif ( $proportion_wh <= $proportion_wh_desired ) { // Option 2: hw\r\n\t\t\t\t\t// Height will overflow\r\n\t\t\t\t\t$width_new = $width_desired;\r\n\t\t\t\t\t$height_new = $width_desired * $proportion_hw; // h = w*(h/w)\r\n\t\t\t\t\t// Set custom\r\n\t\t\t\t\t$y_new = -($height_new - $height_desired) / 2;\r\n\t\t\t\t} else // if ( $proportion_hw <= $proportion_hw_desired )\r\n{ // Option 1: hw\r\n\t\t\t\t\t// Width will overflow\r\n\t\t\t\t\t$width_new = $height_desired * $proportion_wh; // w = h*(w/h)\r\n\t\t\t\t\t$height_new = $height_desired;\r\n\t\t\t\t\t// Set custom\r\n\t\t\t\t\t$x_new = -($width_new - $width_desired) / 2;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Set canvas\r\n\t\t\t\t$canvas_width = $width_desired;\r\n\t\t\t\t$canvas_height = $height_desired;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Set custom if they have not been set already\r\n\t\tif ( $canvas_width === null )\r\n\t\t\t$canvas_width = $width_new;\r\n\t\tif ( $canvas_height === null )\r\n\t\t\t$canvas_height = $height_new;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Compat\r\n\t\t$width_old = $width_original;\r\n\t\t$height_old = $height_original;\r\n\t\t$x_old = $x_original;\r\n\t\t$y_old = $y_original;\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Return\r\n\t\t$return = compact('width_original', 'height_original', 'width_old', 'height_old', 'width_desired', 'height_desired', 'width_new', 'height_new', 'canvas_width', 'canvas_height', 'x_original', 'y_original', 'x_old', 'y_old', 'x_new', 'y_new');\r\n\t\t// echo '<--'; var_dump($return); echo '-->';\r\n\t\treturn $return;\r\n\t}", "public static function setSize($path,$target_width=150,$target_height=100) {\n\t\t$img = imagecreatefromjpeg($path);\n\t\tif (!$img) {\n\t\t\techo \"ERROR:could not create image handle \".$path;\n\t\t\texit(0);\n\t\t}\n\t\t$width = imageSX($img);\n\t\t$height = imageSY($img);\n\t\t$size = getimagesize($path);\n\t\tif (!$width || !$height) {\n\t\t\techo \"ERROR:Invalid width or height\";\n\t\t\texit(0);\n\t\t}\n\t\tif ($width > $target_width) {\n\t\t\t$width_ratio = $target_width/$width;\n\t\t}\n\t\telse {\n\t\t\t$width_ratio = 1;\t\n\t\t}\n\t\tif ($height > $target_height) {\n\t\t\t$height_ratio = $target_height/$height;\n\t\t}\n\t\telse {\n\t\t\t$height_ratio = 1;\t\n\t\t}\n\t\tif ($width_ratio==1 && $height_ratio==1) return $img;\n\t\t$ratio = min($width_ratio,$height_ratio);\n\t\t$new_height = $ratio * $height;\n\t\t$new_width = $ratio * $width;\n\t\t//file_put_contents(\"1.log\",\"$new_height = $ratio m $height; $new_width = $ratio m $width;\\n\",FILE_APPEND);\n\t\t$new_img = ImageCreateTrueColor($new_width, $new_height);\n\t\tif (!@imagecopyresampled($new_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height)) {\n\t\t\techo \"ERROR:Could not resize image\";\n\t\t\texit(0);\n\t\t}\t\t\n\t\treturn $new_img;\n\t}", "public static function resize($image, $width, $height, $keepAspectRatio = true, $allowUpscaling = false)\n {\n $img = self::ensureImageInterfaceInstance($image)->copy();\n\n /** @var BoxInterface $sourceBox */\n $sourceBox = $img->getSize();\n $destinationBox = static::getBox($sourceBox, $width, $height, $keepAspectRatio);\n\n if ($allowUpscaling === false && self::isUpscaling($sourceBox, $destinationBox)) {\n return $img;\n }\n\n return $img->resize($destinationBox);\n }", "Function resizeMinSize ($minW, $minH=false, $constraint=true, $keepAlpha=false){\n\t\t$origSize = &$this->info['origSize'];\n\t\t\n\t\t$resizeByH = \n\t\t$resizeByW = false;\n\t\t\n\t\t\n\t\tif($origSize[0] < $minW && $minW) $resizeByW = true;\n\t\tif($origSize[1] < $minH && $minH) $resizeByH = true;\n\t\t\n\t\tif($resizeByH && $resizeByW){\n\t\t\t$resizeByH = ($origSize[0]/$minW>$origSize[1]/$minH);\n\t\t\t$resizeByW = !$resizeByH;\n\t\t}\n\t\tif ($resizeByW){\n\t\t\tif($constraint){\n\t\t\t\t$newW = $minW;\n\t\t\t\t$newH = ($origSize[1]*$minW)/$origSize[0];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$newW = $minW;\n\t\t\t\t$newH = $origSize[1];\n\t\t\t}\n\t\t}\n\t\telseif($resizeByH){\n\t\t\tif($constraint){\n\t\t\t\t$newW = ($origSize[0]*$minH)/$origSize[1];\n\t\t\t\t$newH = $minH;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$newW = $origSize[0];\n\t\t\t\t$newH = $minH;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$newW = $origSize[0];\n\t\t\t$newH = $origSize[1];\n\t\t}\n\t\t\n\t\treturn $this->resizeExactSize($newW, $newH, true, $keepAlpha);\n\t}", "public function createThumbnail($imageName,$newWidth,$newHeight) {\n $path = $this->img_dir . '/' . $imageName;\n $mime_info = getimagesize($path);\n $mime = $mime_info['mime'];\n\n $src_img = $this->image_data($path, $mime);\n if($src_img===false) return false;\n\n $old_w = imageSX($src_img);\n $old_h = imageSY($src_img);\n\n $source_aspect_ratio = $old_w / $old_h;\n $desired_aspect_ratio = $newWidth / $newHeight;\n\n if ($source_aspect_ratio > $desired_aspect_ratio) {\n /*\n * Triggered when source image is wider\n */\n $thumb_h = $newHeight;\n $thumb_w = ( int ) ($newHeight * $source_aspect_ratio);\n } else {\n /*\n * Triggered otherwise (i.e. source image is similar or taller)\n */\n $thumb_w = $newWidth;\n $thumb_h = ( int ) ($newWidth / $source_aspect_ratio);\n }\n\n $dst_img = ImageCreateTrueColor($thumb_w,$thumb_h);\n\n $color = imagecolorallocatealpha($dst_img, 0, 0, 0, 127);\n imagefill($dst_img,0,0,$color);\n imagesavealpha($dst_img, true);\n\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_w, $old_h);\n\n if($this->is_crop_hard) {\n $x = ($thumb_w - $newWidth) / 2;\n $y = ($thumb_h - $newHeight) / 2;\n\n $tmp_img = imagecreatetruecolor($newWidth, $newHeight);\n $color = imagecolorallocatealpha($tmp_img, 0, 0, 0, 127);\n imagefill($tmp_img,0,0,$color);\n imagesavealpha($tmp_img, true);\n\n imagecopy($tmp_img, $dst_img, 0, 0, $x, $y, $newWidth, $newHeight);\n $dst_img = $tmp_img;\n }\n\n $new_thumb_loc = $this->thumb_dir . $imageName;\n $result = $this->save($dst_img, $new_thumb_loc, $mime);\n\n imagedestroy($dst_img);\n imagedestroy($src_img);\n return $result;\n }", "private static function resize_image($source, $width, $height){\n\t\t$source_width = imagesx($source);\n\t\t$source_height = imagesy($source);\n\t\t$source_aspect = round($source_width / $source_height, 1);\n\t\t$target_aspect = round($width / $height, 1);\n\t\n\t\t$resized = imagecreatetruecolor($width, $height);\n\t\n\t\tif ($source_aspect < $target_aspect){\n\t\t\t// higher\n\t\t\t$new_size = array($width, ($width / $source_width) * $source_height);\n\t\t\t$source_pos = array(0, (($new_size[1] - $height) * ($source_height / $new_size[1])) / 2);\n\t\t}else if ($source_aspect > $target_aspect){\n\t\t\t// wider\n\t\t\t$new_size = array(($height / $source_height) * $source_width, $height);\n\t\t\t$source_pos = array((($new_size[0] - $width) * ($source_width / $new_size[0])) / 2, 0);\n\t\t}else{\n\t\t\t// same shape\n\t\t\t$new_size = array($width, $height);\n\t\t\t$source_pos = array(0, 0);\n\t\t}\n\t\n\t\tif ($new_size[0] < 1) $new_size[0] = 1;\n\t\tif ($new_size[1] < 1) $new_size[1] = 1;\n\t\n\t\timagecopyresampled($resized, $source, 0, 0, $source_pos[0], $source_pos[1], $new_size[0], $new_size[1], $source_width, $source_height);\n\t\n\t\treturn $resized;\n\t}", "private function determineImageScale($sourceWidth, $sourceHeight, $targetWidth, $targetHeight) {\n\t $scalex = $targetWidth / $sourceWidth;\n\t $scaley = $targetHeight / $sourceHeight;\n\t return min($scalex, $scaley);\n\t}", "public function testResizeRatioModePreservNoFillWidth()\n {\n $testImageRatio = $this->_testImageData['width'] / $this->_testImageData['height'];\n $dstWidth = 100;\n Tinebase_ImageHelper::resize($this->_testImage, $dstWidth, $dstWidth*100, Tinebase_ImageHelper::RATIOMODE_PRESERVNOFILL);\n $this->assertEquals($dstWidth, $this->_testImage->width);\n $this->assertEquals(floor($dstWidth / $testImageRatio), $this->_testImage->height);\n \n }", "public function ratioResize($file, $width=null, $height=null, $rename='') {\n\n $file = $this->uploadPath . $file;\n $imginfo = $this->getInfo($file);\n\n if ($rename == '')\n $newName = substr($imginfo['name'], 0, strrpos($imginfo['name'], '.')) . $this->thumbSuffix . '.' . $this->generatedType;\n else\n $newName = $rename . '.' . $this->generatedType;\n\n if ($width === null && $height === null) {\n return false;\n } elseif ($width !== null && $height === null) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } elseif ($width === null && $height !== null) {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n } else {\n\t\t\t\n\t\t\tif($imginfo['width'] < $width and $imginfo['height'] < $height) {\n\t\t\t\t$width = $imginfo['width'];\n\t\t\t\t$height = $imginfo['height'];\n\t\t\t}\n\t\t\t\n if ($imginfo['width'] > $imginfo['height']) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } else {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n }\n }\n\n //create image object based on the image file type, gif, jpeg or png\n $this->createImageObject($img, $imginfo['type'], $file);\n if (!$img)\n return false;\n\n if (function_exists('imagecreatetruecolor')) {\n $newImg = imagecreatetruecolor($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, 0, 0, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n } else {\n $newImg = imagecreate($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, ($width - $resizeWidth) / 2, ($height - $resizeHeight) / 2, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n }\n\n imagedestroy($img);\n\n if ($this->saveFile) {\n //delete if exist\n if (file_exists($this->processPath . $newName))\n unlink($this->processPath . $newName);\n $this->generateImage($newImg, $this->processPath . $newName);\n imagedestroy($newImg);\n return $this->processPath . $newName;\n }\n else {\n $this->generateImage($newImg);\n imagedestroy($newImg);\n }\n\n return true;\n }", "function my_awesome_image_resize_dimensions( $payload, $orig_w, $orig_h, $dest_w, $dest_h, $crop ){\n\t// want to override the defaults for this image or not.\n\tif( false )\n\t\treturn $payload;\n\n\tif ( $crop ) {\n\t\t// crop the largest possible portion of the original image that we can size to $dest_w x $dest_h\n\t\t$aspect_ratio = $orig_w / $orig_h;\n\t\t$new_w = min($dest_w, $orig_w);\n\t\t$new_h = min($dest_h, $orig_h);\n\n\t\tif ( !$new_w ) {\n\t\t\t$new_w = intval($new_h * $aspect_ratio);\n\t\t}\n\n\t\tif ( !$new_h ) {\n\t\t\t$new_h = intval($new_w / $aspect_ratio);\n\t\t}\n\n\t\t$size_ratio = max($new_w / $orig_w, $new_h / $orig_h);\n\n\t\t$crop_w = round($new_w / $size_ratio);\n\t\t$crop_h = round($new_h / $size_ratio);\n\n\t\t$s_x = 0; // [[ formerly ]] ==> floor( ($orig_w - $crop_w) / 2 );\n\t\t$s_y = 0; // [[ formerly ]] ==> floor( ($orig_h - $crop_h) / 2 );\n\t} else {\n\t\t// don't crop, just resize using $dest_w x $dest_h as a maximum bounding box\n\t\t$crop_w = $orig_w;\n\t\t$crop_h = $orig_h;\n\n\t\t$s_x = 0;\n\t\t$s_y = 0;\n\n\t\tlist( $new_w, $new_h ) = wp_constrain_dimensions( $orig_w, $orig_h, $dest_w, $dest_h );\n\t}\n\n\t// if the resulting image would be the same size or larger we don't want to resize it\n\tif ( $new_w >= $orig_w && $new_h >= $orig_h )\n\t\treturn false;\n\n\t// the return array matches the parameters to imagecopyresampled()\n\t// int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h\n\treturn array( 0, 0, (int) $s_x, (int) $s_y, (int) $new_w, (int) $new_h, (int) $crop_w, (int) $crop_h );\n\n}", "public function containMax($image_path, $size_name, $maxWidth = 360, $maxHeight = 240){\n\t\t$this->maxWidth = $maxWidth;\n\t\t$this->maxHeight = $maxHeight;\n\t\tlist($width, $height, $type, $attr) = getimagesize($image_path);\n\t\t\n\t\t$ratio = max($this->maxHeight / $height, $this->maxWidth / $width); \n\t\t$newHeight = ceil($height * $ratio); \n\t\t$newWidth = ceil($width * $ratio); \n\n\t\t$image = $this->intervention->make($image_path);\n\t\t$image->interlace();\n\t\t$image->resize($newWidth, $newHeight);\n\n\t\t$new_image_path = str_replace(\"-source\", \"-\".$size_name, $image_path);\n\t\t$image->save($new_image_path, 80);\n\n\t\treturn $new_image_path;\n\t}", "static function resize($sourcePath, $newWidth = 100, $newHeight = 100)\n {\n switch (exif_imagetype($sourcePath)) {\n case IMAGETYPE_JPEG :\n $sourceImage = imagecreatefromjpeg($sourcePath);\n break;\n case IMAGETYPE_PNG :\n $sourceImage = imagecreatefrompng($sourcePath);\n break;\n case IMAGETYPE_GIF :\n $sourceImage = imagecreatefromgif($sourcePath);\n break;\n default:\n return;\n }\n\n // Create the new image (still blank/empty)\n $newImage = imagecreatetruecolor($newWidth, $newHeight);\n imagesetinterpolation($newImage, IMG_SINC);\n\n // Determine the source image Dimensions\n $sourceImageWidth = imagesx($sourceImage);\n $sourceImageHeight = imagesy($sourceImage);\n $sourceImageAspectRatio = $sourceImageWidth / $sourceImageHeight;\n $newImageAspectRatio = $newWidth / $newHeight;\n\n // Determine parameters and copy part of the source image into the new image\n if ($newImageAspectRatio >= $sourceImageAspectRatio) { // width is the limiting factor for the source image\n $src_x = 0;\n $src_w = $sourceImageWidth;\n $src_h = $src_w / $newImageAspectRatio;\n $src_y = ($sourceImageHeight - $src_h) / 2;\n } else { // height of source image is limiting factor\n $src_y = 0;\n $src_h = $sourceImageHeight;\n $src_w = $src_h * $newImageAspectRatio;\n $src_x = ($sourceImageWidth - $src_w) / 2;\n }\n\n imagecopyresampled($newImage, $sourceImage, 0, 0, $src_x, $src_y, $newWidth, $newHeight, $src_w, $src_h);\n\n // Save new image to destination path\n switch (exif_imagetype($sourcePath)) {\n case IMAGETYPE_JPEG :\n imagejpeg($newImage, $sourcePath, 100);\n break;\n case IMAGETYPE_PNG :\n imagepng($newImage, $sourcePath);\n break;\n case IMAGETYPE_GIF :\n imagegif($newImage, $sourcePath);\n break;\n }\n\n // Remove image resources to reallocate space\n imagedestroy($sourceImage);\n imagedestroy($newImage);\n }", "function custom_image_resize_dimensions($payload, $orig_w, $orig_h, $dest_w, $dest_h, $crop)\n {\n // want to override the defaults for this image or not.\n if (false)\n return $payload;\n\n if ($crop) {\n // crop the largest possible portion of the original image that we can size to $dest_w x $dest_h\n $aspect_ratio = $orig_w / $orig_h;\n $new_w = min($dest_w, $orig_w);\n $new_h = min($dest_h, $orig_h);\n\n if (!$new_w) {\n $new_w = intval($new_h * $aspect_ratio);\n }\n\n if (!$new_h) {\n $new_h = intval($new_w / $aspect_ratio);\n }\n\n $size_ratio = max($new_w / $orig_w, $new_h / $orig_h);\n\n $crop_w = round($new_w / $size_ratio);\n $crop_h = round($new_h / $size_ratio);\n\n $s_x = floor(($orig_w - $crop_w) / 2);\n $s_y = 0; // [[ formerly ]] ==> floor( ($orig_h - $crop_h) / 2 );\n } else {\n // don't crop, just resize using $dest_w x $dest_h as a maximum bounding box\n $crop_w = $orig_w;\n $crop_h = $orig_h;\n\n $s_x = 0;\n $s_y = 0;\n\n list($new_w, $new_h) = wp_constrain_dimensions($orig_w, $orig_h, $dest_w, $dest_h);\n }\n\n // if the resulting image would be the same size or larger we don't want to resize it\n if ($new_w >= $orig_w && $new_h >= $orig_h)\n return false;\n\n // the return array matches the parameters to imagecopyresampled()\n // int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h\n return array(0, 0, (int)$s_x, (int)$s_y, (int)$new_w, (int)$new_h, (int)$crop_w, (int)$crop_h);\n\n }", "function resizeImage($filename, $max_width, $max_height)\n{\n list($orig_width, $orig_height) = getimagesize($filename);\n\n $width = $orig_width;\n $height = $orig_height;\n\n # taller\n if ($max_height != 0 && $max_width != 0)\n {\n\t if ($height > $max_height) {\n\t\t $width = ($max_height / $height) * $width;\n\t\t $height = $max_height;\n\t }\n\n\t # wider\n\t if ($width > $max_width) {\n\t\t $height = ($max_width / $width) * $height;\n\t\t $width = $max_width;\n\t }\n }\n\n $image_p = imagecreatetruecolor($width, $height);\n\n $image = imagecreatefromjpeg($filename);\n\n imagecopyresampled($image_p, $image, 0, 0, 0, 0,\n $width, $height, $orig_width, $orig_height);\n\n return $image_p;\n}", "function cropRatioImage(&$srcImage, $src_width, $src_height, $desiredWidth = 0, $desiredHeight = 0)\n\t{\n\t\t// if only one size is specified\n\t\tif ($desiredWidth == '*' || $desiredHeight == '*')\n\t\t{\n\t\t\t$new_size = $this->calculateSize($src_width, $src_height, $desiredWidth, $desiredHeight);\n\t\t\t$desiredWidth = $new_size['width'];\n\t\t\t$desiredHeight = $new_size['height'];\n\t\t}\n\t\t\n\t\t// get aspect ratio\n\t\t$ratioW = $src_width / $desiredWidth;\n\t\t$ratioH = $src_height / $desiredHeight;\n\t\t\n\t\t$ratio = ($ratioW < $ratioH)?$ratioW:$ratioH;\n\t\t\t\n\t\t// calculate new height and width based on the ratio\n\t\t$new_width = floor($desiredWidth * $ratio);\n\t\t$new_height = floor($desiredHeight * $ratio);\n\t\t\n\t\t// calculate crop start position\n\t\t$startX = floor(($src_width - $new_width) / 2);\n\t\t$startY = floor(($src_height - $new_height) / 2);\n\t\t\n\t\treturn $this->cropImage($srcImage, $startX, $startY, $new_width, $new_height);\n\t}", "public function resize()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('resize');\n\t}", "function themify_img_resize_dimensions( $default, $orig_w, $orig_h, $dest_w, $dest_h ) {\r\n\t// set portion of the original image that we can size to $dest_w x $dest_h\r\n\t$aspect_ratio = $orig_w / $orig_h;\r\n\t$new_w = $dest_w;\r\n\t$new_h = $dest_h;\r\n\r\n\tif ( !$new_w ) {\r\n\t\t$new_w = (int)( $new_h * $aspect_ratio );\r\n\t}\r\n\r\n\tif ( !$new_h ) {\r\n\t\t$new_h = (int)( $new_w / $aspect_ratio );\r\n\t}\r\n\r\n\t$size_ratio = max( $new_w / $orig_w, $new_h / $orig_h );\r\n\r\n\t$crop_w = round( $new_w / $size_ratio );\r\n\t$crop_h = round( $new_h / $size_ratio );\r\n\r\n\t$s_x = floor( ( $orig_w - $crop_w ) / 2 );\r\n\t$s_y = floor( ( $orig_h - $crop_h ) / 2 );\r\n\r\n\t// the return array matches the parameters to imagecopyresampled()\r\n\t// int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h\r\n\treturn array( 0, 0, (int) $s_x, (int) $s_y, (int) $new_w, (int) $new_h, (int) $crop_w, (int) $crop_h );\r\n}", "public function resizeAndScale($targetWidth, $targetHeight, $targetQuality)\n {\n $bestFit = ($targetWidth && $targetHeight);\n $this->originalImage->stripImage();\n $this->originalImage->setImageCompressionQuality($targetQuality);\n $this->originalImage->scaleImage($targetWidth, $targetHeight, $bestFit);\n \n return $this->originalImage;\n }", "public function ArticleImageSized($maxwidth = 250) {\n\t\t if($this->AttachedImage()->getWidth() < $maxwidth) {\n\t\t\t return $this->AttachedImage();\n\t\t } else {\n\t\t\t return $this->AttachedImage()->setWidth($maxwidth);\n\t\t }\n\t }", "function reduce_image(string $fileName, string $targetFile, int $maxWidth, int $maxHeight, string $outFormat = \"image/png\", string $img_string=\"\") : bool{\n\t\n\t//Check if we have to reduce physical image or an image contained in a variable\n\tif($fileName != \"string\"){\n\n\t\t//Check if image exists or not\n\t\tif(!file_exists($fileName))\n\t\t\treturn false;\n\t\t\n\t\t//Try to get image size\n\t\tif(!$imageInfos = getimagesize($fileName))\n\t\t\treturn false; //File doesn't seems to be an image\n\n\t}\n\telse {\n\t\t//Get informations about the image in the string\n\t\tif(!$imageInfos = getimagesizefromstring($img_string))\n\t\t\treturn false; //Couldn't create image\n\t}\n\n\t//Extract image width and height\n\t$width = $imageInfos[0];\n\t$height = $imageInfos[1];\n\n\t//Check image size\n\tif($width == 0 || $height == 0)\n\t\treturn false; //Can't process such image\n\n\t//Try to open image\n\tif($fileName === \"string\")\n\t\t$src = imagecreatefromstring($img_string);\n\telseif($imageInfos['mime'] === \"image/png\")\n\t\t$src = imagecreatefrompng($fileName);\n\telseif($imageInfos['mime'] === \"image/jpeg\")\n\t\t$src = imagecreatefromjpeg($fileName);\n\telseif($imageInfos['mime'] === \"image/gif\")\n\t\t$src = imagecreatefromgif($fileName);\n\t//elseif($imageInfos['mime'] === \"image/x-ms-bmp\")\n\t//\t$src = imagecreatefrombmp($fileName);\n\telse\n\t\treturn false; //Unrecognized image type\n\t\n\t//Check if image size can be kept as is\n\tif($width <= $maxWidth AND $height <= $maxHeight){\n\t\t//We keep the same dimensions\n\t\t$newWidth = $width;\n\t\t$newHeight = $height;\n\t}\n\telseif($width > $maxWidth){\n\t\t$newWidth = $maxWidth;\n\t\t$newHeight = floor(($height*$maxWidth)/$width);\n\t}\n\telse {\n\t\t$newHeight = $maxHeight;\n\t\t$newWidth = floor(($width*$maxHeight)/$height);\n\t}\n\n\t//Create reduced image\n\t$dest = imagecreatetruecolor($newWidth, $newHeight);\n\n\t//Copy image\n\timagecopyresized($dest, $src, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height);\n\n\t//Try to export image\n\t//PNG\n\tif($outFormat === \"image/png\"){\n\t\tif(!imagepng($dest, $targetFile, 2))\n\t\t\treturn false;\n\t}\n\n\t//JPEG\n\telseif($outFormat === \"image/jpeg\"){\n\t\tif(!imagejpeg($dest, $targetFile, 2))\n\t\t\treturn false;\n\t}\n\n\t//UNSUPPORTED\n\telse\n\t\treturn false; //Unkown export format\n\n\t//Success\n\treturn true;\n}", "public function resize(array $dimensions) {\n// is there an image resource to work with?\n if (isset($this->_resource)) {\n// does the dimensions array have the appropriate values to work with?\n if (isset($dimensions[\"width\"]) || isset($dimensions[\"height\"])) {\n// has the width value been omitted, while the height value given?\n if (!isset($dimensions[\"width\"]) && isset($dimensions[\"height\"])) {\n// is the height an integer?\n// -> if so, assign the height variable and assign the width variable scaled similarly to the height\n if (is_int($dimensions[\"height\"])) {\n $width = (int) floor($this->_width * ($dimensions[\"height\"] / $this->_height));\n $height = $dimensions[\"height\"];\n }\n }\n// or has the height value been omitted, and the width value given?\n else if (isset($dimensions[\"width\"]) && !isset($dimensions[\"height\"])) {\n// is the width an integer?\n// -> if so, assign the width variable and assign the height variable scaled similarly to the width\n if (is_int($dimensions[\"width\"])) {\n $width = $dimensions[\"width\"];\n $height = (int) floor($this->_height * ($dimensions[\"width\"] / $this->_width));\n }\n }\n// or both values were provided\n else {\n// are both width and height values integers?\n// -> if so, assign the width and height variables\n if (is_int($dimensions[\"width\"]) && is_int($dimensions[\"height\"])) {\n $width = $dimensions[\"width\"];\n $height = $dimensions[\"height\"];\n }\n }\n\n// have the width and height variables been assigned?\n// -> if so, proceed with cropping\n if (isset($width, $height)) {\n// generating the placeholder resource\n $resized_image = $this->newImageResource($width, $height);\n\n// copying the original image's resource into the placeholder and resizing it accordingly\n imagecopyresampled($resized_image, $this->_resource, 0, 0, 0, 0, $width, $height, $this->_width, $this->_height);\n\n// assigning the new image attributes\n $this->_resource = $resized_image;\n $this->_width = $width;\n $this->_height = $height;\n }\n } else {\n trigger_error(\"CAMEMISResizeImage::resize() was not provided the apporpriate arguments (given array must contain \\\"width\\\" and \\\"height\\\" elements)\", E_USER_WARNING);\n }\n } else {\n trigger_error(\"CAMEMISResizeImage::resize() attempting to access a non-existent resource (check if the image was loaded by Image2::__construct())\", E_USER_WARNING);\n }\n\n return $this;\n }", "public static function setMinSize(int $width, int $height) {}", "function createResizedImage($input, $max_width, $max_height, $grayscale) {\n\t\t// load the input image into a temp image\n\t\t$img_temp = imagecreatefromfile($input);\n\t\t\n\t\t// Gray scale the image?\n\t\tif ($grayscale) {\n\t\t\timagefilter($img_temp, IMG_FILTER_GRAYSCALE);\n\t\t}\n\t\t\n\t\t// get the desired thumbnail aspect ratio\n\t\t$dst_aspect_ratio = $max_width / $max_height;\n\t\t// get the source aspect ratio\n\t\t$src_aspect_ratio = imagesx($img_temp) / imagesy($img_temp);\n\t\t\n\t\tif ($src_aspect_ratio >= $dst_aspect_ratio) {\n\t\t\t// source wider than destination, use full height\n\t\t\t$source_height = imagesy($img_temp);\n\t\t\t$source_width = imagesy($img_temp) * $dst_aspect_ratio;\n\t\t\t$source_offset_x = (imagesx($img_temp) - $source_width) / 2;\n\t\t\t$source_offset_y = 0;\n\t\t} else {\n\t\t\t// source taller than destination, use full width\n\t\t\t$source_width = imagesx($img_temp);\n\t\t\t$source_height = imagesx($img_temp) / $dst_aspect_ratio;\n\t\t\t$source_offset_x = 0;\n\t\t\t$source_offset_y = (imagesy($img_temp) - $source_height) / 2;\n\t\t}\n\t\t\n\t\t// Create a new empty image of the right size\n\t\t$img_res = imagecreatetruecolor($max_width, $max_height);\n\t\t// Copy resampled version of the input image into the new image\n\t\timagecopyresampled($img_res, $img_temp,\n\t\t\t\t\t\t\t0, 0,\n\t\t\t\t\t\t\t$source_offset_x, $source_offset_y,\n\t\t\t\t\t\t\t$max_width, $max_height,\n\t\t\t\t\t\t\t$source_width, $source_height);\n\t\t\n\t\treturn $img_res;\n\t\t\n\t\t// Create the output image from the resampled image\n\t\t//imagejpeg($img_thumb, $output, 90);\n\t\t//imagedestroy($img_thumb);\n\t\t//imagedestroy($img_gray);\n\t}", "function resizeImage($src_file, $dest_file, $new_size=100, $resize_aspect=\"sq\", $quality=\"80\")\n\t{\n\t\t$imginfo = getimagesize($src_file);\n\t\t\n\t\tif ($imginfo == null) {\n\t\treturn false;\n\t\t}\t \n\t\t\n\t\t// GD2 can only handle JPG, PNG & GIF images\n\t\tif (!$imginfo[2] > 0 && $imginfo[2] <= 3 ) {\n\t\t return false;\n\t\t}\n\t\t\n\t\t// height/width\n\t\t$srcWidth = $imginfo[0];\n\t\t$srcHeight = $imginfo[1];\n\t\t//$resize_aspect = \"sq\";\n\t\tif ($resize_aspect == 'ht') {\n\t\t $ratio = $srcHeight / $new_size;\n\t\t} elseif ($resize_aspect == 'wd') {\n\t\t $ratio = $srcWidth / $new_size;\n\t\t} elseif ($resize_aspect == 'sq') {\n\t\t $ratio = min($srcWidth, $srcHeight) / $new_size;\n\t\t} else {\n\t\t $ratio = max($srcWidth, $srcHeight) / $new_size;\n\t\t}\n\t\t\n\t\t/**\n\t\t* Initialize variables\n\t\t*/\n\t\t$clipX = 0;\n\t\t$clipY = 0;\n\t\t\n\t\t$ratio = max($ratio, 1.0);\n\t\tif ($resize_aspect == 'sq'){\n\t\t$destWidth = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\t$destHeight = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\tif($srcHeight > $srcWidth){\n\t\t$clipX = 0;\n\t\t$clipY = ((int)($srcHeight - $srcWidth)/2);\n\t\t$srcHeight = $srcWidth;\n\t\t}elseif($srcWidth > $srcHeight){\n\t\t$clipX = ((int)($srcWidth - $srcHeight)/2);\n\t\t$clipY = 0;\n\t\t$srcWidth = $srcHeight;\n\t\t}\n\t\t}else{\n\t\t$destWidth = (int)($srcWidth / $ratio);\n\t\t$destHeight = (int)($srcHeight / $ratio);\n\t\t}\n\t\t\n\t\tif (!function_exists('imagecreatefromjpeg')) {\n\t\t echo 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed';\n\t\t exit;\n\t\t}\n\t\tif (!function_exists('imagecreatetruecolor')) {\n\t\t echo 'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the admin page';\n\t\t exit;\n\t\t}\n\t\t\n\t\tif ($imginfo[2] == 1 )\n\t\t $src_img = imagecreatefromgif($src_file);\n\t\telseif ($imginfo[2] == 2)\n\t\t $src_img = imagecreatefromjpeg($src_file);\n\t\telse\n\t\t $src_img = imagecreatefrompng($src_file);\n\t\tif (!$src_img){\n\t\t return false;\n\t\t}\n\t\tif ($imginfo[2] == 1 ) {\n\t\t$dst_img = imagecreate($destWidth, $destHeight);\n\t\t} else {\n\t\t$dst_img = imagecreatetruecolor($destWidth, $destHeight);\n\t\t}\n\t\t\n\t\timagecopyresampled($dst_img, $src_img, 0, 0, $clipX, $clipY, (int)$destWidth, (int)$destHeight, $srcWidth, $srcHeight);\n\t\timagejpeg($dst_img, $dest_file, $quality);\n\t\timagedestroy($src_img);\n\t\timagedestroy($dst_img);\n\t\t\n\t\t// We check that the image is valid\n\t\t$imginfo = getimagesize($dest_file);\n\t\tif ($imginfo == null) {\n\t\t\t@unlink($dest_file);\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function resizeImage($old_image_path, $new_image_path, $max_width, $max_height)\n{\n\n // Get image type\n $image_info = getimagesize($old_image_path);\n $image_type = $image_info[2];\n\n // Set up the function names\n switch ($image_type) {\n case IMAGETYPE_JPEG:\n $image_from_file = 'imagecreatefromjpeg';\n $image_to_file = 'imagejpeg';\n break;\n case IMAGETYPE_GIF:\n $image_from_file = 'imagecreatefromgif';\n $image_to_file = 'imagegif';\n break;\n case IMAGETYPE_PNG:\n $image_from_file = 'imagecreatefrompng';\n $image_to_file = 'imagepng';\n break;\n default:\n return;\n } // ends the swith\n\n // Get the old image and its height and width\n $old_image = $image_from_file($old_image_path);\n $old_width = imagesx($old_image);\n $old_height = imagesy($old_image);\n\n // Calculate height and width ratios\n $width_ratio = $old_width / $max_width;\n $height_ratio = $old_height / $max_height;\n\n // If image is larger than specified ratio, create the new image\n if ($width_ratio > 1 || $height_ratio > 1) {\n\n // Calculate height and width for the new image\n $ratio = max($width_ratio, $height_ratio);\n $new_height = round($old_height / $ratio);\n $new_width = round($old_width / $ratio);\n\n // Create the new image\n $new_image = imagecreatetruecolor($new_width, $new_height);\n\n // Set transparency according to image type\n if ($image_type == IMAGETYPE_GIF) {\n $alpha = imagecolorallocatealpha($new_image, 0, 0, 0, 127);\n imagecolortransparent($new_image, $alpha);\n }\n\n if ($image_type == IMAGETYPE_PNG || $image_type == IMAGETYPE_GIF) {\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n }\n\n // Copy old image to new image - this resizes the image\n $new_x = 0;\n $new_y = 0;\n $old_x = 0;\n $old_y = 0;\n imagecopyresampled($new_image, $old_image, $new_x, $new_y, $old_x, $old_y, $new_width, $new_height, $old_width, $old_height);\n\n // Write the new image to a new file\n $image_to_file($new_image, $new_image_path);\n // Free any memory associated with the new image\n imagedestroy($new_image);\n } else {\n // Write the old image to a new file\n $image_to_file($old_image, $new_image_path);\n }\n // Free any memory associated with the old image\n imagedestroy($old_image);\n}", "function resizeImage($fileName,$maxWidth,$maxHight,$originalFileSufix=\"\")\n{\n $limitedext = array(\".gif\",\".jpg\",\".png\",\".jpeg\");\n\n //check the file's extension\n $ext = strrchr($fileName,'.');\n $ext = strtolower($ext);\n\n //uh-oh! the file extension is not allowed!\n if (!in_array($ext,$limitedext)) {\n exit();\n }\n\n if($ext== \".jpeg\" || $ext == \".jpg\"){\n $new_img = imagecreatefromjpeg($fileName);\n }elseif($ext == \".png\" ){\n $new_img = imagecreatefrompng($fileName);\n }elseif($ext == \".gif\"){\n $new_img = imagecreatefromgif($fileName);\n }\n\n //list the width and height and keep the height ratio.\n list($width, $height) = getimagesize($fileName);\n\n //calculate the image ratio\n $imgratio=$width/$height;\n $newwidth = $width;\n $newheight = $height;\n\n //Image format -\n if ($imgratio>1){\n if ($width>$maxWidth) {\n $newwidth = $maxWidth;\n $newheight = $maxWidth/$imgratio;\n }\n //image format |\n }else{\n if ($height>$maxHight) {\n $newheight = $maxHight;\n $newwidth = $maxHight*$imgratio;\n }\n }\n\n //function for resize image.\n $resized_img = imagecreatetruecolor($newwidth,$newheight);\n\n //the resizing is going on here!\n imagecopyresized($resized_img, $new_img, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n\n //finally, save the image\n if ($originalFileSufix!=\"\") {\n $path_parts=pathinfo($fileName);\n rename($fileName,$path_parts[\"dirname\"].DIRECTORY_SEPARATOR.$path_parts[\"filename\"].\"_\".$originalFileSufix.\".\".$path_parts[\"extension\"]);\n }\n ImageJpeg ($resized_img,$fileName,80);\n\n ImageDestroy ($resized_img);\n ImageDestroy ($new_img);\n}", "function resizeImage($input,$output,$wid,$hei,$auto=false,$quality=80) {\n\n\t// File and new size\n\t//the original image has 800x600\n\t$filename = $input;\n\t//the resize will be a percent of the original size\n\t$percent = 0.5;\n\n\t// Get new sizes\n\tlist($width, $height) = getimagesize($filename);\n\t$newwidth = $wid;//$width * $percent;\n\t$newheight = $hei;//$height * $percent;\n\tif($auto) {\n\t\tif($width>$height) {\n\t\t\t$newheight=$wid*0.75;\n\t\t} else if($height>$width) {\n\t\t\t$newwidth=$hei*0.75;\n\t\t}\n\t}\n\n\t// Load\n\t$thumb = imagecreatetruecolor($newwidth, $newheight);\n\t$source = imagecreatefromjpeg($filename);\n\n\t// Resize\n\timagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n\n\t// Output and free memory\n\t//the resized image will be 400x300\n\timagejpeg($thumb,$output,$quality);\n\timagedestroy($thumb);\n}", "function resizeImage($sourceImage, $targetImage, $maxWidth, $maxHeight, $quality = 80) {\n echo 'sourceImage ';\n echo $sourceImage;\n echo ' targetImage ';\n echo $targetImage;\n // Obtain image from given source file.\n\tif (!$image = @imagecreatefromjpeg($sourceImage)) {\n\t\techo 'false';\n return false;\n }\n\techo ' pre list ';\n // Get dimensions of source image.\n list($origWidth, $origHeight) = getimagesize($sourceImage);\n\n if ($maxWidth == 0) {\n $maxWidth = $origWidth;\n }\n\n if ($maxHeight == 0) {\n $maxHeight = $origHeight;\n }\n\n // Calculate ratio of desired maximum sizes and original sizes.\n $widthRatio = $maxWidth / $origWidth;\n $heightRatio = $maxHeight / $origHeight;\n\n // Ratio used for calculating new image dimensions.\n $ratio = min($widthRatio, $heightRatio);\n\n // Calculate new image dimensions.\n $newWidth = (int)$origWidth * $ratio;\n $newHeight = (int)$origHeight * $ratio;\n\techo 'pre true color ';\n // Create final image with new dimensions.\n\t$newImage = imagecreatetruecolor($newWidth, $newHeight);\n\techo 'post true color ';\n\n // $image = str_replace(' ','_',$image);\n\n\timagecopyresampled($newImage, $image, 0, 0, 0, 0, $newWidth, $newHeight, $origWidth, $origHeight);\n\techo 'post resampled ';\n\n // CREATE PROGRESSIVE IMG INSTANCE\n // $imageProg = imagecreatefromjpeg($image);\n // imageinterlace($imageProg, true);\n // echo 'post progressive';\n\n\timagejpeg($newImage, $targetImage, $quality);\n // imagejpeg($imageProg, $targetImage, $quality);\n\techo 'post imagejpeg ';\n\n // FREE UP MEMORY\n imagedestroy($image);\n imagedestroy($newImage);\n // imagedestroy($imageProg);\n\n return true;\n}", "function image_reproportion()\n\t{\n\t\tif ( ! is_numeric($this->dst_width) OR ! is_numeric($this->dst_height) OR $this->dst_width == 0 OR $this->dst_height == 0)\n\t\t\treturn;\n\t\t\n\t\tif ( ! is_numeric($this->src_width) OR ! is_numeric($this->src_height) OR $this->src_width == 0 OR $this->src_height == 0)\n\t\t\treturn;\n\t\n\t\tif (($this->dst_width >= $this->src_width) AND ($this->dst_height >= $this->src_height))\n\t\t{\n\t\t\t$this->dst_width = $this->src_width;\n\t\t\t$this->dst_height = $this->src_height;\n\t\t}\n\t\t\n\t\t$new_width\t= ceil($this->src_width*$this->dst_height/$this->src_height);\t\t\n\t\t$new_height\t= ceil($this->dst_width*$this->src_height/$this->src_width);\n\t\t\n\t\t$ratio = (($this->src_height/$this->src_width) - ($this->dst_height/$this->dst_width));\n\n\t\tif ($this->master_dim != 'width' AND $this->master_dim != 'height')\n\t\t{\n\t\t\t$this->master_dim = ($ratio < 0) ? 'width' : 'height';\n\t\t}\n\t\t\n\t\tif (($this->dst_width != $new_width) AND ($this->dst_height != $new_height))\n\t\t{\n\t\t\tif ($this->master_dim == 'height')\n\t\t\t{\n\t\t\t\t$this->dst_width = $new_width;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->dst_height = $new_height;\n\t\t\t}\n\t\t}\n\t}", "function image_resize_to_folder($source_pic, $destination_folder, $filename, $max_width, $max_height)\n{\n $image_info = getimagesize($source_pic['tmp_name']);\n $source_pic_name = $source_pic['name'];\n $source_pic_tmpname = $source_pic['tmp_name'];\n $source_pic_size = $source_pic['size'];\n $source_pic_width = $image_info[0];\n $source_pic_height = $image_info[1];\n if (!is_dir($destination_folder)) {\n mkdir($destination_folder, 0755);\n }\n\n $x_ratio = $max_width / $source_pic_width;\n $y_ratio = $max_height / $source_pic_height;\n\n if (($source_pic_width <= $max_width) && ($source_pic_height <= $max_height)) {\n $tn_width = $source_pic_width;\n $tn_height = $source_pic_height;\n } elseif (($x_ratio * $source_pic_height) < $max_height) {\n $tn_height = ceil($x_ratio * $source_pic_height);\n $tn_width = $max_width;\n } else {\n $tn_width = ceil($y_ratio * $source_pic_width);\n $tn_height = $max_height;\n }\n\n switch ($image_info['mime']) {\n case 'image/gif':\n if (imagetypes() & IMG_GIF) {\n $src = imageCreateFromGIF($source_pic['tmp_name']);\n $destination_folder.=\"$filename.gif\";\n $namafile = \"$filename.gif\";\n }\n break;\n\n case 'image/jpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_pic['tmp_name']);\n $destination_folder.=\"$filename.jpg\";\n $namafile = \"$filename.jpg\";\n }\n break;\n\n case 'image/pjpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_pic['tmp_name']);\n $destination_folder.=\"$filename.jpg\";\n $namafile = \"$filename.jpg\";\n }\n break;\n\n case 'image/png':\n if (imagetypes() & IMG_PNG) {\n $src = imageCreateFromPNG($source_pic['tmp_name']);\n $destination_folder.=\"$filename.png\";\n $namafile = \"$filename.png\";\n }\n break;\n\n case 'image/wbmp':\n if (imagetypes() & IMG_WBMP) {\n $src = imageCreateFromWBMP($source_pic['tmp_name']);\n $destination_folder.=\"$filename.bmp\";\n $namafile = \"$filename.bmp\";\n }\n break;\n }\n\n //chmod($destination_pic,0777);\n $tmp = imagecreatetruecolor($tn_width, $tn_height);\n imagecopyresampled($tmp, $src, 0, 0, 0, 0, $tn_width, $tn_height, $source_pic_width, $source_pic_height);\n\n //**** 100 is the quality settings, values range from 0-100.\n switch ($image_info['mime']) {\n case 'image/jpeg':\n imagejpeg($tmp, $destination_folder, 100);\n break;\n\n case 'image/gif':\n imagegif($tmp, $destination_folder, 100);\n break;\n\n case 'image/png':\n imagepng($tmp, $destination_folder);\n break;\n\n default:\n imagejpeg($tmp, $destination_folder, 100);\n break;\n }\n\n return ($namafile);\n}", "function media_upload_max_image_resize()\n {\n }", "public function normal_resize_image($source, $destination, $image_type, $max_size, $image_width, $image_height, $quality){\n\n if($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n //do not resize if image is smaller than max size\n if($image_width <= $max_size && $image_height <= $max_size){\n if($this->save_image($source, $destination, $image_type, $quality)){\n return true;\n }\n }\n\n //Construct a proportional size of new image\n $image_scale\t= min($max_size/$image_width, $max_size/$image_height);\n $new_width\t\t= ceil($image_scale * $image_width);\n $new_height\t\t= ceil($image_scale * $image_height);\n\n $new_canvas\t\t= imagecreatetruecolor( $new_width, $new_height ); //Create a new true color image\n\n //Copy and resize part of an image with resampling\n if(imagecopyresampled($new_canvas, $source, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height)){\n $this->save_image($new_canvas, $destination, $image_type, $quality); //save resized image\n }\n\n return true;\n }", "function imgResize($filename, $newWidth, $newHeight, $dir_out){\n\t\n\t// изменение размера изображения\n\n\t// 1 создадим новое изображение из файла\n\t$scr = imagecreatefromjpeg($filename); // или $imagePath\n\t\n\t// 2 создадим новое полноцветное изображение нужного размера\n\t$newImg = imagecreatetruecolor($newWidth, $newHeight);\n\n\t// 3 определим размер исходного изображения для 4 пункта\n\t$size = getimagesize($filename);\n\n\t// 4 копирует прямоугольную часть одного изображения на другое изображение, интерполируя значения пикселов таким образом, чтобы уменьшение размера изображения не уменьшало его чёткости\n\timagecopyresampled($newImg, $scr, 0, 0, 0, 0, $newWidth, $newHeight, $size[0], $size[1]);\n\n\t// 5 запишем изображение в файл по нужному пути\n\timagejpeg($newImg, $dir_out);\n\n\timagedestroy($scr);\n\timagedestroy($newImg);\t\t\n\t\n}", "private function __setOptimalSizeByPortrait() {\n \n $ratio = $this->__originalImageWidth / $this->__originalImageHeight;\n $newWidth = $this->__requestedHeight * $ratio;\n \n $this->__optimalWidth = $newWidth; \n $this->__optimalHeight = $this->__requestedHeight;\n \n }", "public function image_resize($width = 0, $height = 0, $image_url, $filename, $upload_url)\n {\n $source_path = realpath($image_url);\n list($source_width, $source_height, $source_type) = getimagesize($source_path);\n switch ($source_type)\n {\n case IMAGETYPE_GIF:\n $source_gdim = imagecreatefromgif($source_path);\n break;\n case IMAGETYPE_JPEG:\n $source_gdim = imagecreatefromjpeg($source_path);\n break;\n case IMAGETYPE_PNG:\n $source_gdim = imagecreatefrompng($source_path);\n break;\n }\n\n $source_aspect_ratio = $source_width / $source_height;\n $desired_aspect_ratio = $width / $height;\n\n if ($source_aspect_ratio > $desired_aspect_ratio)\n {\n /*\n * Triggered when source image is wider\n */\n $temp_height = $height;\n $temp_width = (int)($height * $source_aspect_ratio);\n }\n else\n {\n /*\n * Triggered otherwise (i.e. source image is similar or taller)\n */\n $temp_width = $width;\n $temp_height = (int)($width / $source_aspect_ratio);\n }\n\n /*\n * Resize the image into a temporary GD image\n */\n\n $temp_gdim = imagecreatetruecolor($temp_width, $temp_height);\n imagecopyresampled($temp_gdim, $source_gdim, 0, 0, 0, 0, $temp_width, $temp_height, $source_width, $source_height);\n\n /*\n * Copy cropped region from temporary image into the desired GD image\n */\n\n $x0 = ($temp_width - $width) / 2;\n $y0 = ($temp_height - $height) / 2;\n $desired_gdim = imagecreatetruecolor($width, $height);\n imagecopy($desired_gdim, $temp_gdim, 0, 0, $x0, $y0, $width, $height);\n\n /*\n * Render the image\n * Alternatively, you can save the image in file-system or database\n */\n\n $image_url = $upload_url . $filename;\n\n imagepng($desired_gdim, $image_url);\n\n return $image_url;\n\n /*\n * Add clean-up code here\n */\n }", "public function testResizeRatioModePreservNoFillHeight()\n {\n $testImageRatio = $this->_testImageData['width'] / $this->_testImageData['height'];\n $dstHeight = 100;\n Tinebase_ImageHelper::resize($this->_testImage, $dstHeight*100, $dstHeight, Tinebase_ImageHelper::RATIOMODE_PRESERVNOFILL);\n $this->assertEquals($dstHeight, $this->_testImage->height);\n $this->assertEquals(floor($dstHeight * $testImageRatio), $this->_testImage->width);\n \n }", "function aurum_woocommerce_3_3_transfer_image_sizes() {\n\t\t$do_resize = false;\n\t\t\n\t\t// WooCommerce Thumbnail\n\t\tif ( ( $shop_catalog_image_size = get_theme_mod( 'shop_catalog_image_size' ) ) ) {\n\t\t\t\n\t\t\t// {width}x{height} format\n\t\t\tif ( preg_match( '#^(?<width>[0-9]+)x(?<height>[0-9]+)(x(?<cropped>0|1))?$#', $shop_catalog_image_size, $shop_catalog_image_size_matches ) ) {\n\t\t\t\t$width = $shop_catalog_image_size_matches['width'];\n\t\t\t\t$height = $shop_catalog_image_size_matches['height'];\n\t\t\t\t$cropping = ! isset( $shop_catalog_image_size_matches['cropped'] ) || $shop_catalog_image_size_matches['cropped'];\n\t\t\t\t\n\t\t\t\t$ratio = _get_aspect_ratio( $width, $height );\n\t\t\t\t\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping', $cropping ? 'custom' : 'uncropped' );\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping_custom_width', $ratio[0] );\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping_custom_height', $ratio[1] );\n\t\t\t\t\n\t\t\t\t$do_resize = true;\n\t\t\t}\n\t\t\t// Crop width only\n\t\t\telse if( is_numeric( $shop_catalog_image_size ) ) {\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping', 'uncropped' );\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping_custom_width', $shop_catalog_image_size );\n\t\t\t\t\n\t\t\t\t$do_resize = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Single image\n\t\tif ( ( $shop_single_image_size = get_theme_mod( 'shop_single_image_size' ) ) ) {\n\t\t\t\n\t\t\tif ( preg_match( '#^(?<width>[0-9]+)(x(?<height>[0-9]+))?(x(?<cropped>0|1))?$#', $shop_single_image_size, $shop_single_image_size_matches ) ) {\n\t\t\t\tupdate_option( 'woocommerce_single_image_width', $shop_single_image_size_matches['width'] );\n\t\t\t\t\n\t\t\t\t$do_resize = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Request image regeneration\n\t\tif ( $do_resize && class_exists( 'WC_Regenerate_Images' ) ) {\n\t\t\tWC_Regenerate_Images::queue_image_regeneration();\n\t\t}\n\t\t\n\t\t// Lightbox has moved\n\t\tset_theme_mod( 'shop_single_lightbox', ! get_theme_mod( 'shop_single_lightbox_disable', false ) );\n\t\t\n\t\t\n\t\t// WooCommerce columns\n\t\t$shop_product_columns = get_data( 'shop_product_columns' );\n\t\t\n\t\tupdate_option( 'woocommerce_catalog_columns', aurum_get_number_from_word( 'decide' == $shop_product_columns ? 4 : $shop_product_columns ) );\n\t\t\n\t\tif ( preg_match( '#[0-9]+#', get_data( 'shop_products_per_page' ), $matches ) ) {\n\t\t\tupdate_option( 'woocommerce_catalog_rows', $matches[0] );\n\t\t}\n\t\t\n\t\t// Run this once\n\t\tupdate_option( 'aurum_woocommerce_3_3_transfer_image_sizes', true );\n\t}", "function imageResize($file, $dest, $height, $width, $thumb = FALSE) {\n\tglobal $ighMaxHeight, $ighMaxWidth, $ighThumbHeight, $ighThumbWidth;\n\n\tif (strstr(@mime_content_type($file), \"png\"))\n\t\t$oldImage = imagecreatefrompng($file);\n\telseif (strstr(@mime_content_type($file), \"jpeg\"))\n\t\t$oldImage = imagecreatefromjpeg($file);\n\telseif (strstr(@mime_content_type($file), \"gif\"))\n\t\t$oldImage = imagecreatefromgif($file);\n\telse\n\t\tdie (\"oh shit\");\n\n\t$base_img = $oldImage;\n $img_width = imagesx($base_img);\n $img_height = imagesy($base_img);\n\n $thumb_height = $height;\n $thumb_width = $width;\n\n // Work out which way it needs to be resized\n $img_width_per = $thumb_width / $img_width;\n $img_height_per = $thumb_height / $img_height;\n \n if ($img_width_per <= $img_height_per) {\n $thumb_height = intval($img_height * $img_width_per); \n }\n else {\n $thumb_width = intval($img_width * $img_height_per);\n }\n\n\tif ($thumb) {\n\t\t$thumb_width = $width;\t\t// 120\n\t\t$thumb_height = $height*3/4;\t// 120 * 3 / 4 = 90\n\t}\n\n // Create the new thumbnail image\n $thumb_img = ImageCreateTrueColor($thumb_width, $thumb_height); \n\n\tif ($thumb) {\t// Do the Square from the Centre thing.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, \n\t\t\t\t($img_width/2)-($thumb_width/2), ($img_height/2)-($thumb_height/2), \n\t\t\t\t$thumb_width, $thumb_height, $thumb_width, $thumb_height);\t\t\t\n\t} else {\t// standard image to image resize.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, 0, 0, \n\t\t\t\t$thumb_width, $thumb_height, $img_width, $img_height);\n\t}\n\n\t// using jpegs!\n\timagejpeg($thumb_img, $dest);\n\timagedestroy($base_img);\n\timagedestroy($thumb_img);\n}", "public function resizeImage($product, $imageId, $width, $height = null)\n {\n $resizedImage = $this->_productImageHelper\n ->init($product, $imageId)\n ->constrainOnly(TRUE)\n ->keepAspectRatio(TRUE)\n ->keepTransparency(TRUE)\n ->keepFrame(FALSE)\n ->resize($width, $height);\n return $resizedImage;\n }", "public function autoScale($img, $size) {\n\t// NOT YET IMPLEMENTED.\n}", "function resizeImage($old_image_path, $new_image_path, $max_width, $max_height) {\r\n \r\n // Get image type\r\n $image_info = getimagesize($old_image_path);\r\n $image_type = $image_info[2];\r\n \r\n // Set up the function names\r\n switch ($image_type) {\r\n case IMAGETYPE_JPEG:\r\n $image_from_file = 'imagecreatefromjpeg';\r\n $image_to_file = 'imagejpeg';\r\n break;\r\n case IMAGETYPE_GIF:\r\n $image_from_file = 'imagecreatefromgif';\r\n $image_to_file = 'imagegif';\r\n break;\r\n case IMAGETYPE_PNG:\r\n $image_from_file = 'imagecreatefrompng';\r\n $image_to_file = 'imagepng';\r\n break;\r\n default:\r\n return;\r\n } // ends the swith\r\n \r\n // Get the old image and its height and width\r\n $old_image = $image_from_file($old_image_path);\r\n $old_width = imagesx($old_image);\r\n $old_height = imagesy($old_image);\r\n \r\n // Calculate height and width ratios\r\n $width_ratio = $old_width / $max_width;\r\n $height_ratio = $old_height / $max_height;\r\n \r\n // If image is larger than specified ratio, create the new image\r\n if ($width_ratio > 1 || $height_ratio > 1) {\r\n \r\n // Calculate height and width for the new image\r\n $ratio = max($width_ratio, $height_ratio);\r\n $new_height = round($old_height / $ratio);\r\n $new_width = round($old_width / $ratio);\r\n \r\n // Create the new image\r\n $new_image = imagecreatetruecolor($new_width, $new_height);\r\n \r\n // Set transparency according to image type\r\n if ($image_type == IMAGETYPE_GIF) {\r\n $alpha = imagecolorallocatealpha($new_image, 0, 0, 0, 127);\r\n imagecolortransparent($new_image, $alpha);\r\n }\r\n \r\n if ($image_type == IMAGETYPE_PNG || $image_type == IMAGETYPE_GIF) {\r\n imagealphablending($new_image, false);\r\n imagesavealpha($new_image, true);\r\n }\r\n \r\n // Copy old image to new image - this resizes the image\r\n $new_x = 0;\r\n $new_y = 0;\r\n $old_x = 0;\r\n $old_y = 0;\r\n imagecopyresampled($new_image, $old_image, $new_x, $new_y, $old_x, $old_y, $new_width, $new_height, $old_width, $old_height);\r\n \r\n // Write the new image to a new file\r\n $image_to_file($new_image, $new_image_path);\r\n // Free any memory associated with the new image\r\n imagedestroy($new_image);\r\n } else {\r\n // Write the old image to a new file\r\n $image_to_file($old_image, $new_image_path);\r\n }\r\n // Free any memory associated with the old image\r\n imagedestroy($old_image);\r\n }", "private function intern_resize($newWidth, $newHeight, $keepRatio = true)\n\t{\n\t\t$this->newOrientation = ($newWidth > $newHeight) ? EImageProcessor::LANDSCAPE : EImageProcessor::PORTRAIT;\n\t\tif ($keepRatio !== true)\n\t\t\t$this->newImage = imagescale($this->srcImage, $newWidth, $newHeight);\n\t\telse {\n\t\t\t/*\n\t\t * Crop-to-fit PHP-GD\n\t\t * http://salman-w.blogspot.com/2009/04/crop-to-fit-image-using-aspphp.html\n\t\t *\n\t\t * Resize and center crop an arbitrary size image to fixed width and height\n\t\t * e.g. convert a large portrait/landscape image to a small square thumbnail\n\t\t *\n\t\t * Modified by Fry\n\t\t\t */\n\t\t\t$desired_aspect_ratio = $newWidth / $newHeight;\n\n\t\t\tif ($this->srcAspectRatio < $desired_aspect_ratio) {\n\t\t\t\t/*\n\t\t\t\t * Triggered when source image is taller\n\t\t\t\t */\n\t\t\t\t$temp_height = $newHeight;\n\t\t\t\t$temp_width = ( int )($newHeight * $this->srcAspectRatio);\n\t\t\t} else {\n\t\t\t\t/*\n\t\t\t\t * Triggered otherwise (i.e. source image is similar or wider)\n\t\t\t\t */\n\t\t\t\t$temp_width = $newWidth;\n\t\t\t\t$temp_height = ( int )($newWidth / $this->srcAspectRatio);\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Resize the image into a temporary GD image\n\t\t\t */\n\n\t\t\t$tempImage = imagecreatetruecolor($temp_width, $temp_height);\n\t\t\t$transparent = imagecolortransparent($tempImage, imagecolortransparent ($this->srcImage));\n\t\t\timagefill($tempImage, 0, 0, $transparent);\n\t\t\timagecopyresampled(\n\t\t\t\t$tempImage,\n\t\t\t\t$this->srcImage,\n\t\t\t\t0, 0,\n\t\t\t\t0, 0,\n\t\t\t\t$temp_width, $temp_height,\n\t\t\t\t$this->srcWidth, $this->srcHeight\n\t\t\t);\n\n\t\t\t$x0 = ($newWidth - $temp_width ) / 2;\n\t\t\t$y0 = ($newHeight - $temp_height) / 2;\n\n\t\t\t$this->newImage = imagecreatetruecolor($newWidth, $newHeight);\n\t\t\t$transparent = imagecolortransparent($this->newImage, imagecolorallocatealpha($this->newImage, 255, 235, 215, 127));\n\t\t\timagefill($this->newImage, 0, 0, $transparent);\n\t\t\timagecopyresampled(\n\t\t\t\t$this->newImage,\t\t\t$tempImage,\n\t\t\t\t$x0, $y0,\t\t\t\t\t0, 0,\n\t\t\t\t$temp_width, $temp_height, \t$temp_width, $temp_height\n\t\t\t);\n\t\t\timagedestroy($tempImage);\n\t\t}\n\t}", "public function getImageResized()\n {\n return $this->performImageResize($this->Image());\n }", "public function create_thumbnail($max_width = false, $min_filesize = false)\n\t{\n\t\t$source = $this->get_filepath();\n\t\t$destination = $this->get_filepath(true);\n\t\t$min_filesize = ($min_filesize !== false) ? $min_filesize : (int) $this->config['img_min_thumb_filesize'];\n\t\t$img_filesize = (file_exists($source)) ? @filesize($source) : false;\n\n\t\tif (!$img_filesize || $img_filesize <= $min_filesize)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$dimension = @getimagesize($source);\n\n\t\tif ($dimension === false)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tlist($width, $height, $type, ) = $dimension;\n\n\t\tif (empty($width) || empty($height))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tlist($new_width, $new_height) = $this->get_img_size_format($width, $height, $max_width);\n\n\t\t// Do not create a thumbnail if the resulting width/height is bigger than the original one\n\t\tif ($new_width >= $width && $new_height >= $height)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$used_imagick = false;\n\n\t\t// Only use imagemagick if defined and the passthru function not disabled\n\t\tif ($this->config['img_imagick'] && function_exists('passthru'))\n\t\t{\n\t\t\tif (substr($this->config['img_imagick'], -1) !== '/')\n\t\t\t{\n\t\t\t\t$this->config['img_imagick'] .= '/';\n\t\t\t}\n\n\t\t\t@passthru(escapeshellcmd($this->config['img_imagick']) . 'convert' . ((defined('PHP_OS') && preg_match('#^win#i', PHP_OS)) ? '.exe' : '') . ' -quality 85 -geometry ' . $new_width . 'x' . $new_height . ' \"' . str_replace('\\\\', '/', $source) . '\" \"' . str_replace('\\\\', '/', $destination) . '\"');\n\n\t\t\tif (file_exists($destination))\n\t\t\t{\n\t\t\t\t$used_imagick = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!$used_imagick)\n\t\t{\n\t\t\tif (!function_exists('get_supported_image_types'))\n\t\t\t{\n\t\t\t\tinclude($this->phpbb_root_path . 'includes/functions_posting.' . $this->php_ext);\n\t\t\t}\n\t\t\t$type = get_supported_image_types($type);\n\n\t\t\tif ($type['gd'])\n\t\t\t{\n\t\t\t\t// If the type is not supported, we are not able to create a thumbnail\n\t\t\t\tif ($type['format'] === false)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tswitch ($type['format'])\n\t\t\t\t{\n\t\t\t\t\tcase IMG_GIF:\n\t\t\t\t\t\t$image = @imagecreatefromgif($source);\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase IMG_JPG:\n\t\t\t\t\t\t@ini_set('gd.jpeg_ignore_warning', 1);\n\t\t\t\t\t\t$image = @imagecreatefromjpeg($source);\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase IMG_PNG:\n\t\t\t\t\t\t$image = @imagecreatefrompng($source);\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase IMG_WBMP:\n\t\t\t\t\t\t$image = @imagecreatefromwbmp($source);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (empty($image))\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif ($type['version'] == 1)\n\t\t\t\t{\n\t\t\t\t\t$new_image = imagecreate($new_width, $new_height);\n\n\t\t\t\t\tif ($new_image === false)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\timagecopyresized($new_image, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$new_image = imagecreatetruecolor($new_width, $new_height);\n\n\t\t\t\t\tif ($new_image === false)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Preserve alpha transparency (png for example)\n\t\t\t\t\t@imagealphablending($new_image, false);\n\t\t\t\t\t@imagesavealpha($new_image, true);\n\n\t\t\t\t\timagecopyresampled($new_image, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\n\t\t\t\t}\n\n\t\t\t\tswitch ($type['format'])\n\t\t\t\t{\n\t\t\t\t\tcase IMG_GIF:\n\t\t\t\t\t\timagegif($new_image, $destination);\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase IMG_JPG:\n\t\t\t\t\t\timagejpeg($new_image, $destination, 90);\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase IMG_PNG:\n\t\t\t\t\t\timagepng($new_image, $destination);\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase IMG_WBMP:\n\t\t\t\t\t\timagewbmp($new_image, $destination);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\timagedestroy($new_image);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (!file_exists($destination))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tphpbb_chmod($destination, CHMOD_READ | CHMOD_WRITE);\n\n\t\treturn true;\n\t}", "protected function resize_crop_image($max_width, $max_height, $source_file, $dst_dir, $quality = 80)\n {\n $imgsize = getimagesize($source_file);\n $width = $imgsize[0];\n $height = $imgsize[1];\n $mime = $imgsize['mime'];\n \n switch($mime){\n case 'image/gif':\n $image_create = \"imagecreatefromgif\";\n $image = \"imagegif\";\n break;\n \n case 'image/png':\n $image_create = \"imagecreatefrompng\";\n $image = \"imagepng\";\n $quality = 7;\n break;\n \n case 'image/jpeg':\n $image_create = \"imagecreatefromjpeg\";\n $image = \"imagejpeg\";\n $quality = 80;\n break;\n \n default:\n return false;\n break;\n }\n \n $dst_img = imagecreatetruecolor($max_width, $max_height);\n $src_img = $image_create($source_file);\n \n $width_new = $height * $max_width / $max_height;\n $height_new = $width * $max_height / $max_width;\n //if the new width is greater than the actual width of the image, then the height is too large and the rest cut off, or vice versa\n if($width_new > $width){\n //cut point by height\n $h_point = (($height - $height_new) / 2);\n //copy image\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, $h_point, $max_width, $max_height, $width, $height_new);\n }else{\n //cut point by width\n $w_point = (($width - $width_new) / 2);\n imagecopyresampled($dst_img, $src_img, 0, 0, $w_point, 0, $max_width, $max_height, $width_new, $height);\n }\n \n $image($dst_img, $dst_dir, $quality);\n \n if($dst_img)imagedestroy($dst_img);\n if($src_img)imagedestroy($src_img);\n }", "public function resize_crop_image($max_width, $max_height, $source_file, $dst_dir, $quality = 80)\n {\n $imgsize = getimagesize($source_file);\n $width = $imgsize[0];\n $height = $imgsize[1];\n $mime = $imgsize['mime'];\n\n switch ($mime) {\n case 'image/gif':\n $image_create = 'imagecreatefromgif';\n $image = 'imagegif';\n break;\n\n case 'image/png':\n $image_create = 'imagecreatefrompng';\n $image = 'imagepng';\n $quality = 7;\n break;\n\n case 'image/jpeg':\n $image_create = 'imagecreatefromjpeg';\n $image = 'imagejpeg';\n $quality = 80;\n break;\n\n default:\n return false;\n }\n\n $dst_img = imagecreatetruecolor($max_width, $max_height);\n $src_img = $image_create($source_file);\n\n $width_new = $height * $max_width / $max_height;\n $height_new = $width * $max_height / $max_width;\n //if the new width is greater than the actual width of the image, then the height is too large and the rest cut off, or vice versa\n if ($width_new > $width) {\n //cut point by height\n $h_point = (($height - $height_new) / 2);\n //copy image\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, $h_point, $max_width, $max_height, $width, $height_new);\n } else {\n //cut point by width\n $w_point = (($width - $width_new) / 2);\n imagecopyresampled($dst_img, $src_img, 0, 0, $w_point, 0, $max_width, $max_height, $width_new, $height);\n }\n\n $image($dst_img, $dst_dir, $quality);\n\n if ($dst_img) {\n imagedestroy($dst_img);\n }\n if ($src_img) {\n imagedestroy($src_img);\n }\n }", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\n\t\t$newImageWidth = ceil($width * $scale);\n\t\t$newImageHeight = ceil($height * $scale);\n\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\tswitch($imageType) {\n\t\t\tcase \"image/gif\":\n\t\t\t\t$source=imagecreatefromgif($image); \n\t\t\t\tbreak;\n\t\t\tcase \"image/pjpeg\":\n\t\t\tcase \"image/jpeg\":\n\t\t\tcase \"image/jpg\":\n\t\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\t\tbreak;\n\t\t\tcase \"image/png\":\n\t\t\tcase \"image/x-png\":\n\t\t\t\t$source=imagecreatefrompng($image); \n\t\t\t\tbreak;\n\t\t}\n\t\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\t\tswitch($imageType) {\n\t\t\tcase \"image/gif\":\n\t\t\t\timagegif($newImage,$thumb_image_name); \n\t\t\t\tbreak;\n\t\t\tcase \"image/pjpeg\":\n\t\t\tcase \"image/jpeg\":\n\t\t\tcase \"image/jpg\":\n\t\t\t\timagejpeg($newImage,$thumb_image_name,90); \n\t\t\t\tbreak;\n\t\t\tcase \"image/png\":\n\t\t\tcase \"image/x-png\":\n\t\t\t\timagepng($newImage,$thumb_image_name); \n\t\t\t\tbreak;\n\t\t}\n\t\tchmod($thumb_image_name, 0777);\n\t\treturn $thumb_image_name;\n\t}", "public function runStretchResize(Image $image, int $width, int $height) : Image\n\t{\n\t\treturn $image->resize($width, $height);\n\t}", "function image_scale_im_obj(\\Imagick $im, $aspect, $width, $strategy)\n{\n\n $height = round(($width/$aspect['width'])*$aspect['height']);\n\n $source_w = $im->getImageWidth();\n $source_h = $im->getImageHeight();\n $source_a = $source_h / $source_w;\n $target_a = $aspect['height'] / $aspect['width'];\n\n switch ($strategy) {\n case 'resize':\n $im->scaleImage($width, $height);\n break;\n case 'crop-top':\n if ($target_a < $source_a) {\n $im->scaleImage($width, 0);\n $im->cropImage($width, $height, 0, 0);\n } else {\n $im->scaleImage(0, $height);\n $im->cropImage($width, $height, 0, 0);\n }\n break;\n case 'crop-bottom':\n if ($target_a < $source_a) {\n $im->scaleImage($width, 0);\n $im->cropImage($width, $height, 0, $im->getImageHeight() - $height);\n } else {\n $im->scaleImage(0, $height);\n $im->cropImage($width, $height, $im->getImageWidth() - $width, 0);\n }\n break; \n case 'crop':\n default:\n $im->cropThumbnailImage($width, $height);\n break; \n }\n $im->setImageFormat('jpeg');\n $im->gaussianBlurImage(0.05, 0.5);\n $im->setImageCompressionQuality(75);\n $im->setInterlaceScheme(\\Imagick::INTERLACE_PLANE);\n $im->stripImage();\n return $im;\n}", "protected function calcImageSizeStrict($width, $height)\n {\n // first, we need to determine what the longest resize dimension is..\n if ($this->maxWidth >= $this->maxHeight) {\n // and determine the longest original dimension\n if ($width > $height) {\n $newDimensions = $this->calcHeight($width, $height);\n\n if ($newDimensions['width'] < $this->maxWidth) {\n $newDimensions = $this->calcWidth($width, $height);\n }\n }\n elseif ($height >= $width) {\n $newDimensions = $this->calcWidth($width, $height);\n\n if ($newDimensions['height'] < $this->maxHeight) {\n $newDimensions = $this->calcHeight($width, $height);\n }\n }\n }\n elseif ($this->maxHeight > $this->maxWidth) {\n if ($width >= $height) {\n $newDimensions = $this->calcWidth($width, $height);\n\n if ($newDimensions['height'] < $this->maxHeight) {\n $newDimensions = $this->calcHeight($width, $height);\n }\n }\n elseif ($height > $width) {\n $newDimensions = $this->calcHeight($width, $height);\n\n if ($newDimensions['width'] < $this->maxWidth) {\n $newDimensions = $this->calcWidth($width, $height);\n }\n }\n }\n\n if (isset($newDimensions)) {\n $this->newDimensions = $newDimensions;\n }\n }", "function dt_get_resized_img( $img, $opts, $resize = true, $is_retina = false ) {\n\n\t$opts = apply_filters( 'dt_get_resized_img-options', $opts, $img );\n\n\tif ( !is_array( $img ) || !$img || (!$img[1] && !$img[2]) ) {\n\t\treturn false;\n\t}\n\n\tif ( !is_array( $opts ) || !$opts ) {\n\n\t\tif ( !isset( $img[3] ) ) {\n\n\t\t\t$img[3] = image_hwstring( $img[1], $img[2] );\n\t\t}\n\n\t\treturn $img;\n\t}\n\n\t$defaults = array( 'w' => 0, 'h' => 0, 'zc' => 1, 'z' => 1, 'hd_ratio' => 2, 'hd_convert' => true );\n\t$opts = wp_parse_args( $opts, $defaults );\n\n\t$w = absint( $opts['w'] );\n\t$h = absint( $opts['h'] );\n\n\t// Return original image if there is no proper dimensions.\n\tif ( !$w && !$h ) {\n\t\tif ( !isset( $img[3] ) ) {\n\t\t\t$img[3] = image_hwstring( $img[1], $img[2] );\n\t\t}\n\n\t\treturn $img;\n }\n\n\t// If zoomcropping off and image smaller then required square\n\tif ( 0 == $opts['zc'] && ( $img[1] <= $w && $img[2] <= $h ) ) {\n\n\t\treturn array( $img[0], $img[1], $img[2], image_hwstring( $img[1], $img[2] ) );\n\n\t} elseif ( 3 == $opts['zc'] || empty ( $w ) || empty ( $h ) ) {\n\n\t\tif ( 0 == $opts['z'] ) {\n\t\t\tdt_constrain_dim( $img[1], $img[2], $w, $h, true );\n\t\t} else {\n\t\t\t$p = absint( $img[1] ) / absint( $img[2] );\n\t\t\t$hx = absint( floor( $w / $p ) ); \n\t\t\t$wx = absint( floor( $h * $p ) );\n\t\t\t\n\t\t\tif ( empty( $w ) ) {\n\t\t\t\t$w = $wx;\n\t\t\t} else if ( empty( $h ) ) {\n\t\t\t\t$h = $hx;\n\t\t\t} else {\n\t\t\t\tif ( $hx < $h && $wx >= $w ) {\n\t\t\t\t\t$h = $hx;\n\t\t\t\t} elseif ( $wx < $w && $hx >= $h ) {\n\t\t\t\t\t$w = $wx;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( $img[1] == $w && $img[2] == $h ) {\n\t\t\treturn array( $img[0], $img[1], $img[2], image_hwstring( $img[1], $img[2] ) );\n\t\t}\n\n\t}\n\n\t$img_h = $h;\n\t$img_w = $w;\n\n\tif ( $opts['hd_convert'] && $is_retina ) {\n\t\t$img_h = round( $img_h * $opts['hd_ratio'] );\n\t\t$img_w = round( $img_w * $opts['hd_ratio'] );\n\t}\n\n\tif ( 1 == $opts['zc'] ) {\n\n\t\tif ( $img[1] >= $img_w && $img[2] >= $img_h ) {\n\n\t\t\t// do nothing\n\n\t\t} else if ( $img[1] <= $img[2] && $img_w >= $img_h ) { // img=portrait; c=landscape\n\n\t\t\t$cw_new = $img[1];\n\t\t\t$k = $cw_new/$img_w;\n\t\t\t$ch_new = $k * $img_h;\n\n\t\t} else if ( $img[1] >= $img[2] && $img_w <= $img_h ) { // img=landscape; c=portrait\n\n\t\t\t$ch_new = $img[2];\n\t\t\t$k = $ch_new/$img_h;\n\t\t\t$cw_new = $k * $img_w;\n\n\t\t} else {\n\n\t\t\t$kh = $img_h/$img[2];\n\t\t\t$kw = $img_w/$img[1];\n\t\t\t$kres = max( $kh, $kw );\n\t\t\t$ch_new = $img_h/$kres;\n\t\t\t$cw_new = $img_w/$kres;\n\n\t\t}\n\n\t\tif ( isset($ch_new, $cw_new) ) {\n\t\t\t$img_h = absint(floor($ch_new));\n\t\t\t$img_w = absint(floor($cw_new));\n\t\t}\n\n\t}\n\n\tif ( $resize ) {\n\t $img_width = $img_height = null;\n\t if ( ! empty( $opts['speed_resize'] ) ) {\n $img_width = $img[1];\n $img_height = $img[2];\n }\n\n\t\t$file_url = the7_aq_resize( $img[0], $img_width, $img_height, $img_w, $img_h, true, true, false );\n\t}\n\n\tif ( empty( $file_url ) ) {\n\t\t$file_url = $img[0];\n\t}\n\n\treturn array(\n\t\t$file_url,\n\t\t$img_w,\n\t\t$img_h,\n\t\timage_hwstring( $img_w, $img_h )\n\t);\n}", "public function fit($desiredWidth, $desiredHeight,$crop=true)\n {\n $cropX = 0;\n $cropY = 0;\n \n $imageWidth = $this->getWorkingImageWidth();\n $imageHeight = $this->getWorkingImageHeight();\n $currentRatio = $imageHeight / $imageWidth;\n $desiredRatio = $desiredHeight / $desiredWidth;\n\n // simple scale\n if($currentRatio == $desiredRatio)\n {\n $this->resize($desiredWidth, $desiredHeight);\n return true;\n }\n\n // width priority - maybe crop the height if needed\n if($currentRatio > $desiredRatio)\n {\n $destWidth = $desiredWidth;\n $destHeight = ceil($imageHeight * ($desiredWidth / $imageWidth));\n \n // set cropY so that the crop area occurs in the vertical centre\n $cropY = ceil(($destHeight - $desiredHeight) / 2);\n }\n\n // height priority - maybe crop the width if needed\n elseif($currentRatio < $desiredRatio)\n {\n $destHeight = $desiredHeight;\n $destWidth = floor($imageWidth * ($desiredHeight / $imageHeight));\n\n // set cropX so that the crop area occurs in the horizontal centre\n $cropX = ceil(($destWidth - $desiredWidth) / 2);\n }\n\n $this->resize($destWidth, $destHeight);\n if($crop)\n {\n $this->crop($desiredWidth, $desiredHeight, $cropX, $cropY);\n }\n }", "private function resize() {\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$originalImage = imagecreatefromjpeg($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t$originalImage = imagecreatefrompng($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$originalImage = imagecreatefromgif($this->tempName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// Determine new height\n\t\t$this->newHeight = ($this->height / $this->width) * $this->newWidth;\n\n\t\t// Create new image\n\t\t$this->newImage = imagecreatetruecolor($this->newWidth, $this->newHeight);\n\n\t\t// Resample original image into new image\n\t\timagecopyresampled($this->newImage, $originalImage, 0, 0, 0, 0, $this->newWidth, $this->newHeight, $this->width, $this->height);\n\n\t\t// Switch based on image being resized\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t// Source, Dest, Quality 0 to 100\n\t\t\t\timagejpeg($this->newImage, $this->destinationFolder.'/'.$this->newName, 80);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t// Source, Dest, Quality 0 (no compression) to 9\n\t\t\t\timagepng($this->newImage, $this->destinationFolder.'/'.$this->newName, 0);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($this->newImage, $this->destinationFolder.'/'.$this->newName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('YOUR FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// DESTROY NEW IMAGE TO SAVE SERVER SPACE\n\t\timagedestroy($this->newImage);\n\t\timagedestroy($originalImage);\n\n\t\t// SUCCESSFULLY UPLOADED\n\t\t$this->result = true;\n\t\t$this->message = 'Image uploaded and resized successfully';\n\t}", "function _resizeImageGD1($src_file, $dest_file, $new_size, $imgobj) {\r\n if ($imgobj->_size == null) {\r\n return false;\r\n }\r\n // GD1 can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\") {\r\n return false;\r\n }\r\n // height/width\r\n $ratio = max($imgobj->_size[0], $imgobj->_size[1]) / $new_size;\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($imgobj->_size[0] / $ratio);\r\n $destHeight = (int)($imgobj->_size[1] / $ratio);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = imagecreatefromjpeg($src_file);\r\n } else {\r\n $src_img = imagecreatefrompng($src_file);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n $dst_img = imagecreate($destWidth, $destHeight);\r\n imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $imgobj->_size[0], $imgobj->_size[1]);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $dest_file, $this->_JPEG_quality);\r\n } else {\r\n imagepng($dst_img, $dest_file);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true; \r\n }", "public function resizeVirtualImage(&$sourceImage, &$targetImage, $maxHeight, $maxWidth, $fullCanvas, $backgroundColor)\n {\n //calculate resize properties\n $currentWidth = imagesx($sourceImage);\n $currentHeight = imagesy($sourceImage);\n $currentAspect = $currentWidth / $currentHeight;\n\n $newWidth = $maxWidth;\n $newHeight = $maxHeight;\n $newAspect = $newWidth / $newHeight;\n\n if ($currentAspect >= $newAspect) {\n $newHeight = $currentHeight / ($currentWidth / $maxWidth); \n }\n else {\n $newWidth = $currentWidth / ($currentHeight / $maxHeight);\n }\n\n //prepare the canvas for drawing\n if ($fullCanvas) {\n $newLeft = ($maxWidth - $newWidth) / 2;\n $newTop = ($maxHeight - $newHeight) / 2;\n $targetImage = imagecreatetruecolor($maxWidth, $maxHeight);\n\n //fill the background color\n if (!empty($backgroundColor)) {\n $fillColor = imagecolorallocate($targetImage, $backgroundColor['red'], $backgroundColor['green'], $backgroundColor['blue']);\n imagefill($targetImage, 0, 0, $fillColor);\n }\n else {\n imagealphablending($targetImage, false);\n imagesavealpha($targetImage, true);\n }\n }\n else {\n $newLeft = 0;\n $newTop = 0;\n $targetImage = imagecreatetruecolor($newWidth, $newHeight);\n imagealphablending($targetImage, false);\n imagesavealpha($targetImage, true);\n }\n\n //draw the resize image onto canvas\n imagecopyresampled($targetImage, $sourceImage, $newLeft, $newTop, 0, 0, $newWidth, $newHeight, $currentWidth, $currentHeight);\n }", "private function resizeWithScaleExact($width, $height, $scale) {\n\t\t//$new_height = (int)($this->info['height'] * $scale);\n\t\t$new_width = $width * $scale;\n\t\t$new_height = $height * $scale;\n\t\t$xpos = 0;//(int)(($width - $new_width) / 2);\n\t\t$ypos = 0;//(int)(($height - $new_height) / 2);\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/gif' && $this->isAnimated) {\n $this->imagick = new Imagick($this->file);\n $this->imagick = $this->imagick->coalesceImages();\n foreach ($this->imagick as $frame) {\n $frame->thumbnailImage($new_width, $new_height);\n $frame->setImagePage($new_width, $new_height, 0, 0);\n }\n } else {\n $image_old = $this->image;\n $this->image = imagecreatetruecolor($width, $height);\n $bcg = $this->backgroundColor;\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/png') {\n imagealphablending($this->image, false);\n imagesavealpha($this->image, true);\n $background = imagecolorallocatealpha($this->image, $bcg[0], $bcg[1], $bcg[2], 127);\n imagecolortransparent($this->image, $background);\n } else {\n $background = imagecolorallocate($this->image, $bcg[0], $bcg[1], $bcg[2]);\n }\n\n imagefilledrectangle($this->image, 0, 0, $width, $height, $background);\n imagecopyresampled($this->image, $image_old, $xpos, $ypos, 0, 0, $new_width, $new_height, $this->info['width'], $this->info['height']);\n imagedestroy($image_old);\n }\n\n\t\t$this->info['width'] = $width;\n\t\t$this->info['height'] = $height;\n }", "function resizeToWidth($width)\n {\n //obtine ratio dividiendo ancho dada entre el ancho actual de la imagen.\n $ratio = $width / $this->getWidth();\n //obtiene altura con la altura actual de la imagen por el ratio.\n $height = $this->getheight() * $ratio;\n //redimensiona imagen.\n $this->resize($width,$height);\n }", "protected function generate_image_thumbnail($source_image_path, $thumbnail_image_path, $maxWidth, $maxHeight)\n {\n list( $source_image_width, $source_image_height, $source_image_type) = getimagesize($source_image_path);\n \n switch ($source_image_type)\n {\n case IMAGETYPE_GIF:\n $source_gd_image = imagecreatefromgif($source_image_path);\n break;\n case IMAGETYPE_JPEG:\n $source_gd_image = imagecreatefromjpeg($source_image_path);\n break;\n case IMAGETYPE_PNG:\n $source_gd_image = imagecreatefrompng($source_image_path);\n break;\n }\n \n if ($source_gd_image === false) {\n return false;\n }\n \n $source_aspect_ratio = $source_image_width / $source_image_height;\n $thumbnail_aspect_ratio = $maxWidth / $maxHeight;\n \n if ($source_image_width <= $maxWidth && $source_image_height <= $maxHeight)\n {\n $thumbnail_image_width = $source_image_width;\n $thumbnail_image_height = $source_image_height;\n }\n elseif ($thumbnail_aspect_ratio > $source_aspect_ratio) {\n $thumbnail_image_width = (int) ($maxHeight * $source_aspect_ratio);\n $thumbnail_image_height = $maxHeight;\n }\n else {\n $thumbnail_image_width = $maxWidth;\n $thumbnail_image_height = (int) ($maxWidth / $source_aspect_ratio);\n }\n \n $thumbnail_gd_image = imagecreatetruecolor($thumbnail_image_width, $thumbnail_image_height);\n imagecopyresampled($thumbnail_gd_image, $source_gd_image, 0, 0, 0, 0, $thumbnail_image_width, $thumbnail_image_height, $source_image_width, $source_image_height);\n \n switch ($source_image_type)\n {\n case IMAGETYPE_GIF:\n $newImage = imagegif($thumbnail_gd_image, $thumbnail_image_path);\n break;\n case IMAGETYPE_JPEG:\n $newImage = imagejpeg($thumbnail_gd_image, $thumbnail_image_path, 90);\n break;\n case IMAGETYPE_PNG:\n $newImage = imagepng($thumbnail_gd_image, $thumbnail_image_path, 9);\n break;\n }\n \n //$newImage = imagejpeg($thumbnail_gd_image, $thumbnail_image_path, 90);\n \n imagedestroy($source_gd_image);\n imagedestroy($thumbnail_gd_image);\n \n return $newImage;\n //return true;\n }", "function resizeImage($filename, $destinationFile, $max_width, $max_height) {\n\t\tif (!file_exists($filename)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (!preg_match('/\\.jpg$/i', $filename)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tlist($orig_width, $orig_height) = @getimagesize($filename);\n\t\tif (!$orig_width || !$orig_height) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$width = $orig_width;\n\t\t$height = $orig_height;\n\n\t\t# taller\n\t\tif ($height > $max_height) {\n\t\t\t$width = ($max_height / $height) * $width;\n\t\t\t$height = $max_height;\n\t\t}\n\n\t\t# wider\n\t\tif ($width > $max_width) {\n\t\t\t$height = ($max_width / $width) * $height;\n\t\t\t$width = $max_width;\n\t\t}\n\n\t\t$image_p = imagecreatetruecolor($width, $height);\n\n\t\t$image = imagecreatefromjpeg($filename);\n\n\t\timagecopyresampled($image_p, $image, 0, 0, 0, 0, \n\t\t\t\t\t\t\t\t\t\t $width, $height, $orig_width, $orig_height);\n\n\t\tif (!is_writable(dirname($destinationFile))) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\ttouch($destinationFile);\n\t\t}\n\t\t\n\t\treturn imagejpeg($image_p, $destinationFile);\n\t}", "function redimensionarImagen($origin,$destino,$newWidth,$newHeight,$jpgQuality=100)\n{\n // texto con el valor correcto height=\"yyy\" width=\"xxx\"\n $datos=getimagesize($origin);\n \n // comprobamos que la imagen sea superior a los tamaños de la nueva imagen\n if($datos[0]>$newWidth || $datos[1]>$newHeight)\n {\n \n // creamos una nueva imagen desde el original dependiendo del tipo\n if($datos[2]==1)\n $img=imagecreatefromgif($origin);\n if($datos[2]==2)\n $img=imagecreatefromjpeg($origin);\n if($datos[2]==3)\n $img=imagecreatefrompng($origin);\n \n // Redimensionamos proporcionalmente\n if(rad2deg(atan($datos[0]/$datos[1]))>rad2deg(atan($newWidth/$newHeight)))\n {\n $anchura=$newWidth;\n $altura=round(($datos[1]*$newWidth)/$datos[0]);\n }else{\n $altura=$newHeight;\n $anchura=round(($datos[0]*$newHeight)/$datos[1]);\n }\n \n // creamos la imagen nueva\n $newImage = imagecreatetruecolor($anchura,$altura);\n \n // redimensiona la imagen original copiandola en la imagen\n imagecopyresampled($newImage, $img, 0, 0, 0, 0, $anchura, $altura, $datos[0], $datos[1]);\n \n // guardar la nueva imagen redimensionada donde indicia $destino\n if($datos[2]==1)\n imagegif($newImage,$destino);\n if($datos[2]==2)\n imagejpeg($newImage,$destino,$jpgQuality);\n if($datos[2]==3)\n imagepng($newImage,$destino);\n \n // eliminamos la imagen temporal\n imagedestroy($newImage);\n \n return true;\n }\n return false;\n}", "function cropimage($source_url, $new_width=250, $quality=75){\n return false;\n \n if (!file_exists($source_url)){\n echo alertbuilder(\"File does not exist: $source_url\",'warning');\n return false;\n }\n \n //separate the file name and the extention\n $source_url_parts = pathinfo($source_url);\n $filename = $source_url_parts['filename'];\n $extension = strtolower($source_url_parts['extension']);\n \n //detect the width and the height of original image\n $info = getimagesize($source_url);\n \n if($info === false){\n echo alertbuilder('This file is not a valid image', 'warning');\n return false;\n }\n \n $type = $info[2];\n $width = $info[0];\n $height = $info[1];\n \n // resize only when the original image is larger than new width.\n // this helps you to avoid from unwanted resizing.\n if ($width > $new_width) {\n // cool to resize\n } else {\n echo alertbuilder('The image is already smaller than width', 'warning');\n return false;\n }\n \n //get the reduced width\n $reduced_width = ($width - $new_width);\n \n //now convert the reduced width to a percentage, round to 2 decimals\n $reduced_radio = round(($reduced_width / $width) * 100, 2);\n \n // reduce the same percentage from the height, round to 2 decimals\n $reduced_height = round(($height / 100) * $reduced_radio, 2);\n \n //reduce the calculated height from the original height\n $new_height = $height - $reduced_height;\n \n $img = null;\n $imgResized = null;\n \n switch($type) {\n case IMAGETYPE_JPEG:\n $img = imagecreatefromjpeg($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagejpeg($imgResized, $source_url); \n break;\n \n case IMAGETYPE_GIF:\n $img = imagecreatefromgif($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagegif($imgResized, $source_url); \n break;\n \n case IMAGETYPE_PNG:\n $img = imagecreatefrompng($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagepng($imgResized, $source_url); \n break;\n \n default:\n echo alertbuilder('This file is not in JPG, GIF, or PNG format!');\n return false;\n }\n\n //Finally frees any memory associated with image\n imagedestroy($img);\n imagedestroy($imgResized);\n \n return true;\n}", "function smart_resize_image($file, $width = 0, $height = 0, $proportional = false, $output = \"file\", $delete_original = true, $use_linux_commands = false){\n\t\tif(($height <= 0) && ($width <= 0)){\n\t\t\treturn(false);\n\t\t}\n\t\t$info = getimagesize($file); // Paramètres par défaut de l'image\n\t\t$image = \"\";\n\t\t$final_width = 0;\n\t\t$final_height = 0;\n\t\tlist($width_old,$height_old) = $info;\n\t\t$trop_petite = false;\n\t\tif(($height > 0) && ($height > $height_old)){\n\t\t\t$trop_petite = true;\n\t\t}\n\t\tif(($width > 0) && ( $width > $width_old)){\n\t\t\t$trop_petite = true;\n\t\t}else{\n\t\t\t$trop_petite = false;\n\t\t}\n\t\tif($trop_petite){\n\t\t\treturn(false);\n\t\t}\n\t\tif($proportional){ // Calculer la proportionnalité\n\t\t\tif($width == 0){\n\t\t\t\t$factor = $height / $height_old;\n\t\t\t}elseif($height == 0){\n\t\t\t\t$factor = $width / $width_old;\n\t\t\t}else{\n\t\t\t\t$factor = min($width / $width_old,$height / $height_old);\n\t\t\t}\n\t\t\t$final_width = round($width_old * $factor);\n\t\t\t$final_height = round($height_old * $factor);\n\t\t}else{\n\t\t\t$final_width = ($width <= 0) ? $width_old : $width;\n\t\t\t$final_height = ($height <= 0) ? $height_old : $height;\n\t\t}\n\t\tswitch($info[2]){ // Charger l'image en mémoire en fonction du format\n\t\t\tcase IMAGETYPE_GIF:\n\t\t\t\t$image = imagecreatefromgif($file); break;\n\t\t\tcase IMAGETYPE_JPEG:\n\t\t\t\t$image = imagecreatefromjpeg($file); break;\n\t\t\tcase IMAGETYPE_PNG:\n\t\t\t\t$image = imagecreatefrompng($file); break;\n\t\t\tdefault:\n\t\t\t\treturn(false);\n\t\t}\n\t\t$image_resized = imagecreatetruecolor($final_width, $final_height); // Transparence pour les gif et les png\n\t\tif(($info[2] == IMAGETYPE_GIF) || ($info[2] == IMAGETYPE_PNG)){\n\t\t\t$transparency = imagecolortransparent($image);\n\t\t\tif($transparency >= 0){\n\t\t\t\t$transparent_color = imagecolorsforindex($image,$trnprt_indx);\n\t\t\t\t$transparency = imagecolorallocate($image_resized,$trnprt_color[\"red\"],$trnprt_color[\"green\"],$trnprt_color[\"blue\"]);\n\t\t\t\timagefill($image_resized,0,0,$transparency);\n\t\t\t\timagecolortransparent($image_resized,$transparency);\n\t\t\t}elseif($info[2] == IMAGETYPE_PNG){\n\t\t\t\timagealphablending($image_resized,false);\n\t\t\t\t$color = imagecolorallocatealpha($image_resized,0,0,0,127);\n\t\t\t\timagefill($image_resized,0,0,$color);\n\t\t\t\timagesavealpha($image_resized,true);\n\t\t\t}\n\t\t}\n\t\timagecopyresampled($image_resized,$image,0,0,0,0,$final_width,$final_height,$width_old,$height_old);\n\t\tif($delete_original){ // Suppression de l'image d'origine éventuelle\n\t\t\tif($use_linux_commands){\n\t\t\t\texec(\"rm \".$file);\n\t\t\t}else{\n\t\t\t\t@unlink($file);\n\t\t\t}\n\t\t}\n\t\tswitch(strtolower($output)){\n\t\t\tcase \"browser\": // Envoyer l'image par http avec son type MIME\n\t\t\t\t$mime = image_type_to_mime_type($info[2]); header(\"Content-type: $mime\"); $output = NULL; break;\n\t\t\tcase \"file\": // Ecraser l'image donnée (cas défaut)\n\t\t\t\t$output = $file; break;\n\t\t\tcase \"return\": // Retourner les infos de l'image redimensionnée en conservant celles de l'image d'origine\n\t\t\t\treturn($image_resized); break;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t\tswitch($info[2]){ // Retourner l'image redimensionnée en fonction de son format\n\t\t\tcase IMAGETYPE_GIF:\n\t\t\t\timagegif($image_resized,$output); break;\n\t\t\tcase IMAGETYPE_JPEG:\n\t\t\t\timagejpeg($image_resized,$output); break;\n\t\t\tcase IMAGETYPE_PNG:\n\t\t\t\timagepng($image_resized,$output); break;\n\t\t\tdefault:\n\t\t\t\treturn(false);\n\t\t}\n\t\treturn(true);\n\t}", "function imageresize($img,$target=\"\",$width=0,$height=0,$percent=0)\n{\n if (strpos($img,\".jpg\") !== false or strpos($img,\".jpeg\") !== false){\n\t $image = ImageCreateFromJpeg($img);\n\t $extension = \".jpg\";\n } elseif (strpos($img,\".png\") !== false) {\n\t $image = ImageCreateFromPng($img);\n\t $extension = \".png\";\n } elseif (strpos($img,\".gif\") !== false) {\n\t $image = ImageCreateFromGif($img);\n\t $extension = \".gif\";\n }elseif(getfiletype($img)=='bmp'){\n\t\t$image = ImageCreateFromwbmp($img);\n\t\t$extension = '.bmp';\n }\n\n $size = getimagesize ($img);\n\n // calculate missing values\n if ($width and !$height) {\n\t $height = ($size[1] / $size[0]) * $width;\n } elseif (!$width and $height) {\n\t $width = ($size[0] / $size[1]) * $height;\n } elseif ($percent) {\n\t $width = $size[0] / 100 * $percent;\n\t $height = $size[1] / 100 * $percent;\n } elseif (!$width and !$height and !$percent) {\n\t $width = 100; // here you can enter a standard value for actions where no arguments are given\n\t $height = ($size[1] / $size[0]) * $width;\n }\n\n $thumb = imagecreatetruecolor ($width, $height);\n\n if (function_exists(\"imageCopyResampled\"))\n {\n\t if (!@ImageCopyResampled($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1])) {\n\t\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t }\n\t} else {\n\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t}\n\n //ImageCopyResampleBicubic ($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\n if (!$target) {\n\t $target = \"temp\".$extension;\n }\n\n $return = true;\n\n switch ($extension) {\n\t case \".jpeg\":\n\t case \".jpg\": {\n\t\t imagejpeg($thumb, $target, 100);\n\t break;\n\t }\n\t case \".gif\": {\n\t\t imagegif($thumb, $target);\n\t break;\n\t }\n\t case \".png\": {\n\t\t imagepng($thumb, $target);\n\t break;\n\t }\n\t case \".bmp\": {\n\t\t imagewbmp($thumb,$target);\n\t }\n\t default: {\n\t\t $return = false;\n\t }\n }\n\n // report the success (or fail) of the action\n return $return;\n}", "private function _resizeThumbnailImage($thumb_image_name, $image, $width, $height, $src_width, $src_height, $scale){\n\t\t$newImageWidth = ceil($width * $scale);\n\t\t$newImageHeight = ceil($height * $scale);\n\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t$source = imagecreatefromjpeg($image);\n\t\timagecopyresampled($newImage,$source,0,0,0,0,$width,$height,$src_width,$src_height);\n\t\timagejpeg($newImage,$thumb_image_name,90);\n\t\tchmod($thumb_image_name, 0777);\n\t\t//return $thumb_image_name;\n\t}", "function imageResize($width, $height, $target){\n //formula accordingly...this is so this script will work\n //dynamically with any size image\n\n if ($width > $height) {\n $percentage = ($target / $width);\n } else {\n $percentage = ($target / $height);\n }\n\n //gets the new value and applies the percentage, then rounds the value\n $width = round($width * $percentage);\n $height = round($height * $percentage);\n\n //returns the new sizes in html image tag format...this is so you\n //\tcan plug this function inside an image tag and just get the\n\n return \"width=\".$width.\" height=\".$height.\"\";\n\n }", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t\t\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\t\n\t\t\t\t$newImageWidth = ceil($width * $scale);\n\t\t\t\t$newImageHeight = ceil($height * $scale);\n\t\t\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\t$source=imagecreatefromgif($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\t$source=imagecreatefromjpeg($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\t$source=imagecreatefrompng($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\timagegif($newImage,$thumb_image_name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\timagejpeg($newImage,$thumb_image_name,90);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\timagepng($newImage,$thumb_image_name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tchmod($thumb_image_name, 0777);\n\t\t\t\treturn $thumb_image_name;\n\t\t\t}" ]
[ "0.64798206", "0.6374751", "0.62817496", "0.6263326", "0.6260494", "0.62429357", "0.61854905", "0.61782223", "0.610051", "0.6014141", "0.6002788", "0.5983225", "0.5946629", "0.59023577", "0.59015405", "0.58619773", "0.58607596", "0.5823537", "0.58031416", "0.5801501", "0.57971203", "0.5793585", "0.5783632", "0.5775434", "0.57733315", "0.5770378", "0.5761293", "0.5703793", "0.5695943", "0.56824803", "0.56774706", "0.567641", "0.567188", "0.5657856", "0.5645936", "0.5632612", "0.5625522", "0.56224686", "0.561886", "0.5617321", "0.56168354", "0.5612113", "0.55965006", "0.55894345", "0.55864304", "0.55840695", "0.5576335", "0.55754", "0.55703133", "0.5568762", "0.5565265", "0.5558859", "0.55508137", "0.55494434", "0.5547501", "0.5547486", "0.5540134", "0.55379856", "0.55271214", "0.5524764", "0.5518267", "0.55071044", "0.5503804", "0.55014145", "0.54989916", "0.5498", "0.5496819", "0.54897773", "0.5481807", "0.5479058", "0.54647595", "0.5450999", "0.5432578", "0.5430503", "0.54297024", "0.54290605", "0.5416309", "0.5415422", "0.54137725", "0.5412407", "0.5411998", "0.5408753", "0.5405346", "0.54028475", "0.53959155", "0.53954935", "0.53907245", "0.53809303", "0.537742", "0.53681356", "0.53681195", "0.53588676", "0.535098", "0.5348299", "0.5344161", "0.5343196", "0.5341467", "0.53305656", "0.5329768", "0.5328717" ]
0.7134943
0
Resize an image by width. Preserves aspect ratio.
public function resizeByWidth($width) { return $this->createCloneWithResource( function (InterventionImage $resource) use ($width) { return $resource->widen($width); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resizeToWidth($width)\n {\n //obtine ratio dividiendo ancho dada entre el ancho actual de la imagen.\n $ratio = $width / $this->getWidth();\n //obtiene altura con la altura actual de la imagen por el ratio.\n $height = $this->getheight() * $ratio;\n //redimensiona imagen.\n $this->resize($width,$height);\n }", "public function resize($width)\n {\n // Validation\n if ($width > $this->_maxWidth)\n {\n throw new PHPMapper_Exception_Image(\n 'Image width too large. Maximum width for map is ' . $this->_maxWidth . ' pixels.'\n );\n }\n else if ($width < PHPMapper::MIN_WIDTH)\n {\n throw new PHPMapper_Exception_Image(\n 'Image width should be at least ' . PHPMapper::MIN_WIDTH . ' pixels wide.'\n );\n }\n\n // Resize the image while maintaining ratio\n $ratio = $this->_maxHeight / $this->_maxWidth;\n $height = floor($width * $ratio);\n $out = imagecreate($width, $height);\n\n imagealphablending($out, false);\n imagesavealpha($out, false);\n imagecopyresampled($out, $this->_image, 0, 0, 0, 0, $width, $height,\n $this->_maxWidth, $this->_maxHeight\n );\n\n imagedestroy($this->_image);\n $this->_image = $out;\n\n return $this;\n }", "function resizeToWidth($width) {\r\n\t\t$ratio = $width / $this->getWidth();\r\n\t\t$height = $this->getheight() * $ratio;\r\n\t\t$this->resize($width,$height);\r\n\t}", "public function resizeToWidth($width) {\n $ratio = $width / $this->getWidth();\n $height = $this->getheight() * $ratio;\n $this->resize($width,$height);\n }", "public function resize(IImageInformation $src, $width, $height);", "public function resizeToWidth($w)\n {\n $scale = $w / $this->width;\n $this->width = $w;\n $this->height = round($this->height * $scale);\n\n return $this->resizeImage($this->width, $this->height, $this->imageFilter, $this->imageBlur);\n }", "function setImageWidth($width)\n {\n $this->imageWidth = $width;\n }", "public function resize_fit(IImageInformation $src, $width, $height);", "function resize_by_width($width){\n\n $ratio = $width / $this->width;\n $height = $this->height * $ratio;\n $this->resize($width, $height);\n\n return true;\n }", "public function setImageWidth($value)\n\t{\n\t\t$this->imageWidth = $value;\n\t\treturn $this;\n\t}", "public function resize($width, $height = null);", "function resize_image($src, $width, $height){\n // initializing\n $save_path = Wordless::theme_temp_path();\n $img_filename = Wordless::join_paths($save_path, md5($width . 'x' . $height . '_' . basename($src)) . '.jpg');\n\n // if file doesn't exists, create it\n if (!file_exists($img_filename)) {\n $to_scale = 0;\n $to_crop = 0;\n\n // Get orig dimensions\n list ($width_orig, $height_orig, $type_orig) = getimagesize($src);\n\n // get original image ... to improve!\n switch($type_orig){\n case IMAGETYPE_JPEG: $image = imagecreatefromjpeg($src);\n break;\n case IMAGETYPE_PNG: $image = imagecreatefrompng($src);\n break;\n case IMAGETYPE_GIF: $image = imagecreatefromgif($src);\n break;\n default:\n return;\n }\n\n // which is the new smallest?\n if ($width < $height)\n $min_dim = $width;\n else\n $min_dim = $height;\n\n // which is the orig smallest?\n if ($width_orig < $height_orig)\n $min_orig = $width_orig;\n else\n $min_orig = $height_orig;\n\n // image of the right size\n if ($height_orig == $height && $width_orig == $width) ; // nothing to do\n // if something smaller => scale\n else if ($width_orig < $width) {\n $to_scale = 1;\n $ratio = $width / $width_orig;\n }\n else if ($height_orig < $height) {\n $to_scale = 1;\n $ratio = $height / $height_orig;\n }\n // if both bigger => scale\n else if ($height_orig > $height && $width_orig > $width) {\n $to_scale = 1;\n $ratio_dest = $width / $height;\n $ratio_orig = $width_orig / $height_orig;\n if ($ratio_dest > $ratio_orig)\n $ratio = $width / $width_orig;\n else\n $ratio = $height / $height_orig;\n }\n // one equal one bigger\n else if ( ($width == $width_orig && $height_orig > $height) || ($height == $height_orig && $width_orig > $width) )\n $to_crop = 1;\n // some problem...\n else\n echo \"ALARM\";\n\n // we need to zoom to get the right size\n if ($to_scale == 1) {\n $new_width = $width_orig * $ratio;\n $new_height = $height_orig * $ratio;\n $image_scaled = imagecreatetruecolor($new_width, $new_height);\n // scaling!\n imagecopyresampled($image_scaled, $image, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);\n $image = $image_scaled;\n\n if($new_width > $width || $new_height > $height)\n $to_crop = 1;\n }\n else {\n $new_width = $width_orig;\n $new_height = $height_orig;\n }\n\n // we need to crop the image\n if ($to_crop == 1) {\n $image_cropped = imagecreatetruecolor($width, $height);\n\n // find margins for images\n $margin_x = ($new_width - $width) / 2;\n $margin_y = ($new_height - $height) / 2;\n\n // cropping!\n imagecopy($image_cropped, $image, 0, 0, $margin_x, $margin_y, $width, $height);\n $image = $image_cropped;\n }\n\n // Save image\n imagejpeg($image, $img_filename, 95);\n }\n\n // Return image URL\n return Wordless::join_paths(Wordless::theme_temp_path(), basename($img_filename));\n }", "public function scaleToWidth( $width ) {\n $factor = $this->width / $width;\n $height = (int) $this->height / $factor;\n $this->resize( $width, $height );\n return $this;\n }", "public function runStretchResize(Image $image, int $width, int $height) : Image\n\t{\n\t\treturn $image->resize($width, $height);\n\t}", "public function resize($width, $height)\n\t{\n\t\t$wScale = $this->width / $width;\n\t\t$hScale = $this->height / $height;\n\t\t$maxScale = max($wScale, $hScale);\n\t\t// Decrease image dimensions\n\t\tif($maxScale > 1)\n\t\t{\n\t\t\t$width = $this->width / $maxScale;\n\t\t\t$height = $this->height / $maxScale;\n\t\t}\n\t\t// Increase image dimensions\n\t\telse\n\t\t{\n\t\t\t$minScale = min($wScale, $hScale);\n\t\t\t$width = $this->width / $minScale;\n\t\t\t$height = $this->height / $minScale;\n\t\t}\n\t\t$image = imagecreatetruecolor($this->width, $this->height);\n\t\timagecopyresampled($image, $this->image, 0, 0, 0, 0, $width, $height, $this->width, $this->height);\n\n\t\t$this->image = $image;\n\t\t$this->width = $width;\n\t\t$this->height = $height;\n\t}", "protected function _do_resize($width, $height)\n {\n $pre_width = $this->width;\n $pre_height = $this->height;\n\n // Loads image if not yet loaded\n $this->_load_image();\n\n // Test if we can do a resize without resampling to speed up the final resize\n if ($width > ($this->width / 2) AND $height > ($this->height / 2))\n {\n // The maximum reduction is 10% greater than the final size\n $reduction_width = round($width * 1.1);\n $reduction_height = round($height * 1.1);\n\n while ($pre_width / 2 > $reduction_width AND $pre_height / 2 > $reduction_height)\n {\n // Reduce the size using an O(2n) algorithm, until it reaches the maximum reduction\n $pre_width /= 2;\n $pre_height /= 2;\n }\n\n // Create the temporary image to copy to\n $image = $this->_create($pre_width, $pre_height);\n\n if (imagecopyresized($image, $this->_image, 0, 0, 0, 0, $pre_width, $pre_height, $this->width, $this->height))\n {\n // Swap the new image for the old one\n imagedestroy($this->_image);\n $this->_image = $image;\n }\n }\n\n // Create the temporary image to copy to\n $image = $this->_create($width, $height);\n\n // Execute the resize\n if (imagecopyresampled($image, $this->_image, 0, 0, 0, 0, $width, $height, $pre_width, $pre_height))\n {\n // Swap the new image for the old one\n imagedestroy($this->_image);\n $this->_image = $image;\n\n // Reset the width and height\n $this->width = imagesx($image);\n $this->height = imagesy($image);\n }\n }", "private function intern_resize_width($newWidth, $newHeight = null, $keepRatio = true)\n\t{\n\t\tif ($newHeight == null)\n\t\t\t$this->newImage = imagescale($this->srcImage, $newWidth);\n\t\telse\n\t\t\t$this->intern_resize($newWidth, $newHeight, $keepRatio);\n\t}", "function image_scale($src_abspath, $dest_abspath, $aspect, $width, $strategy)\n{\n $im = new \\Imagick($src_abspath);\n $im = image_scale_im_obj($im, $aspect, $width, $strategy);\n return image_return_write($im, $dest_abspath);\n}", "protected function widenResizeMagic(): void\n {\n $this->image->widen($this->widenResize, function ($constraint) {\n $constraint->upsize();\n });\n }", "public function resizeTo($width, $height, $resizeOption = 'default') {\n switch (strtolower($resizeOption)) {\n case 'exact':\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n break;\n case 'maxwidth':\n $this->resizeWidth = $width;\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n break;\n case 'maxheight':\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n break;\n case 'proportionally':\n $ratio_orig = $this->origWidth / $this->origHeight;\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n if ($width / $height > $ratio_orig)\n $this->resizeWidth = $height * $ratio_orig;\n else\n $this->resizeHeight = $width / $ratio_orig;\n break;\n default:\n if ($this->origWidth > $width || $this->origHeight > $height) {\n if ($this->origWidth > $this->origHeight) {\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n $this->resizeWidth = $width;\n } else if ($this->origWidth < $this->origHeight) {\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n break;\n }\n\n $this->newImage = imagecreatetruecolor($this->resizeWidth, $this->resizeHeight);\n if ($this->ext == \"image/gif\" || $this->ext == \"image/png\") {\n imagealphablending($this->newImage, false);\n imagesavealpha($this->newImage, true);\n $transparent = imagecolorallocatealpha($this->newImage, 255, 255, 255, 127);\n imagefilledrectangle($this->newImage, 0, 0, $this->resizeWidth, $this->resizeHeight, $transparent);\n }\n imagecopyresampled($this->newImage, $this->image, 0, 0, 0, 0, $this->resizeWidth, $this->resizeHeight, $this->origWidth, $this->origHeight);\n }", "function resizeByWidth(array $payload): array\n{\n\n if (!canExecuteFunction(WIDTH, $payload)) {\n return $payload;\n }\n\n $newWidthAsString = $payload[WIDTH];\n $newWidth = (int)$newWidthAsString;\n\n /** @var Imagick $image */\n $image = $payload[IMAGE];\n $image->scaleImage($newWidth, 0);\n\n $payload[IMAGE] = $image;\n\n return $payload;\n\n}", "public function resize($width = NULL, $height = NULL, $master = NULL)\n {\n if ($master === NULL)\n {\n // Choose the master dimension automatically\n $master = Image::AUTO;\n }\n // Image::WIDTH and Image::HEIGHT depricated. You can use it in old projects,\n // but in new you must pass empty value for non-master dimension\n elseif ($master == Image::WIDTH AND ! empty($width))\n {\n $master = Image::AUTO;\n\n // Set empty height for backvard compatibility\n $height = NULL;\n }\n elseif ($master == Image::HEIGHT AND ! empty($height))\n {\n $master = Image::AUTO;\n\n // Set empty width for backvard compatibility\n $width = NULL;\n }\n\n if (empty($width))\n {\n if ($master === Image::NONE)\n {\n // Use the current width\n $width = $this->width;\n }\n else\n {\n // If width not set, master will be height\n $master = Image::HEIGHT;\n }\n }\n\n if (empty($height))\n {\n if ($master === Image::NONE)\n {\n // Use the current height\n $height = $this->height;\n }\n else\n {\n // If height not set, master will be width\n $master = Image::WIDTH;\n }\n }\n\n switch ($master)\n {\n case Image::AUTO:\n // Choose direction with the greatest reduction ratio\n $master = ($this->width / $width) > ($this->height / $height) ? Image::WIDTH : Image::HEIGHT;\n break;\n case Image::INVERSE:\n // Choose direction with the minimum reduction ratio\n $master = ($this->width / $width) > ($this->height / $height) ? Image::HEIGHT : Image::WIDTH;\n break;\n }\n\n switch ($master)\n {\n case Image::WIDTH:\n // Recalculate the height based on the width proportions\n $height = $this->height * $width / $this->width;\n break;\n case Image::HEIGHT:\n // Recalculate the width based on the height proportions\n $width = $this->width * $height / $this->height;\n break;\n }\n\n // Convert the width and height to integers\n $width = round($width);\n $height = round($height);\n\n $this->_do_resize($width, $height);\n\n return $this;\n }", "protected function resize()\n {\n $width = $this->width;\n $height = $this->height;\n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n // Determine new image dimensions\n if($this->mode === \"crop\"){ // Crop image\n \n $max_width = $crop_width = $width;\n $max_height = $crop_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if($orig_width > $orig_height){ // Original is wide\n $height = $max_height;\n $width = ceil($y_ratio * $orig_width);\n \n } elseif($orig_height > $orig_width){ // Original is tall\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n \n } else { // Original is square\n $this->mode = \"fit\";\n \n return $this->resize();\n }\n \n // Adjust if the crop width is less than the requested width to avoid black lines\n if($width < $crop_width){\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n }\n \n } elseif($this->mode === \"fit\"){ // Fits the image according to aspect ratio to within max height and width\n $max_width = $width;\n $max_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if( ($orig_width <= $max_width) && ($orig_height <= $max_height) ){ // Image is smaller than max height and width so don't resize\n $tn_width = $orig_width;\n $tn_height = $orig_height;\n \n } elseif(($x_ratio * $orig_height) < $max_height){ // Wider rather than taller\n $tn_height = ceil($x_ratio * $orig_height);\n $tn_width = $max_width;\n \n } else { // Taller rather than wider\n $tn_width = ceil($y_ratio * $orig_width);\n $tn_height = $max_height;\n }\n \n $width = $tn_width;\n $height = $tn_height;\n \n } elseif($this->mode === \"fit-x\"){ // Sets the width to the max width and the height according to aspect ratio (will stretch if too small)\n $height = @round($orig_height * $width / $orig_width);\n \n if($orig_height <= $height){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n \n } elseif($this->mode === \"fit-y\"){ // Sets the height to the max height and the width according to aspect ratio (will stretch if too small)\n $width = @round($orig_width * $height / $orig_height);\n \n if($orig_width <= $width){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n } else {\n throw new \\Exception('Invalid mode: ' . $this->mode);\n }\n \n\n // Resize\n $this->temp = imagecreatetruecolor($width, $height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n \n imagecopyresampled($this->temp, $this->image, 0, 0, 0, 0, $width, $height, $orig_width, $orig_height);\n $this->sync();\n \n \n // Cropping?\n if($this->mode === \"crop\"){ \n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n $x_mid = $orig_width/2; // horizontal middle\n $y_mid = $orig_height/2; // vertical middle\n \n $this->temp = imagecreatetruecolor($crop_width, $crop_height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n\n imagecopyresampled($this->temp, $this->image, 0, 0, ($x_mid-($crop_width/2)), ($y_mid-($crop_height/2)), $crop_width, $crop_height, $crop_width, $crop_height);\n $this->sync();\n }\n }", "function resize($width,$height)\n {\n $new_image = imagecreatetruecolor($width, $height);\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $new_image; \n }", "function funcs_imageResize(&$width, &$height, $target, $bywidth = null) {\n\tif ($width<=$target && $height<=$target){\n\t\treturn;\n\t}\n\t//takes the larger size of the width and height and applies the \n\t//formula accordingly...this is so this script will work \n\t//dynamically with any size image \n\tif (is_null($bywidth)){\n\t\tif ($width > $height) { \n\t\t\t$percentage = ($target / $width); \n\t\t} else { \n\t\t\t$percentage = ($target / $height); \n\t\t}\n\t}else{\n\t\tif ($bywidth){\n\t\t\t$percentage = ($target / $width);\n\t\t\t//if height would increase as a result\n\t\t\tif ($height < round($height * $percentage)){\n\t\t\t\treturn;\n\t\t\t} \n\t\t}else{\n\t\t\t$percentage = ($target / $height); \n\t\t\t//if width would increase as a result\n\t\t\tif ($width < round($width * $percentage)){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t} \n\t//gets the new value and applies the percentage, then rounds the value \n\t$width = round($width * $percentage); \n\t$height = round($height * $percentage); \n}", "public function resize($width, $height)\n {\n return $this->createCloneWithResource(\n function (InterventionImage $resource) use ($width, $height) {\n return $resource->resize($width, $height);\n }\n );\n }", "function resizeImage($image,$width,$height) {\n\t$newImageWidth = $width;\n\t$newImageHeight = $height;\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t$source = imagecreatefromjpeg($image);\n\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\timagejpeg($newImage,$image,90);\n\tchmod($image, 0777);\n\treturn $image;\n}", "public function ratioResize($file, $width=null, $height=null, $rename='') {\n\n $file = $this->uploadPath . $file;\n $imginfo = $this->getInfo($file);\n\n if ($rename == '')\n $newName = substr($imginfo['name'], 0, strrpos($imginfo['name'], '.')) . $this->thumbSuffix . '.' . $this->generatedType;\n else\n $newName = $rename . '.' . $this->generatedType;\n\n if ($width === null && $height === null) {\n return false;\n } elseif ($width !== null && $height === null) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } elseif ($width === null && $height !== null) {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n } else {\n\t\t\t\n\t\t\tif($imginfo['width'] < $width and $imginfo['height'] < $height) {\n\t\t\t\t$width = $imginfo['width'];\n\t\t\t\t$height = $imginfo['height'];\n\t\t\t}\n\t\t\t\n if ($imginfo['width'] > $imginfo['height']) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } else {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n }\n }\n\n //create image object based on the image file type, gif, jpeg or png\n $this->createImageObject($img, $imginfo['type'], $file);\n if (!$img)\n return false;\n\n if (function_exists('imagecreatetruecolor')) {\n $newImg = imagecreatetruecolor($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, 0, 0, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n } else {\n $newImg = imagecreate($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, ($width - $resizeWidth) / 2, ($height - $resizeHeight) / 2, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n }\n\n imagedestroy($img);\n\n if ($this->saveFile) {\n //delete if exist\n if (file_exists($this->processPath . $newName))\n unlink($this->processPath . $newName);\n $this->generateImage($newImg, $this->processPath . $newName);\n imagedestroy($newImg);\n return $this->processPath . $newName;\n }\n else {\n $this->generateImage($newImg);\n imagedestroy($newImg);\n }\n\n return true;\n }", "public function resizeRatio($width, $height, $useAsMinimum = false)\n {\n return $this->createCloneWithResource(\n function (InterventionImage $resource) use ($width, $height, $useAsMinimum) {\n return $resource->resize(\n $width,\n $height,\n function (Constraint $constraint) use ($useAsMinimum) {\n $constraint->aspectRatio();\n if (!$useAsMinimum) {\n $constraint->upsize();\n }\n }\n );\n }\n );\n }", "function resize($width, $height){\n\n $new_image = imagecreatetruecolor($width, $height);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->get_width(), $this->get_height());\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $width;\n $this->height = $height;\n\n return true;\n }", "function resize($iNewWidth, $iNewHeight)\n\t{\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\tif (function_exists(\"imagecopyresampled\")) {\n\t\t\t$ResizedImageStream = imagecreatetruecolor($iNewWidth, $iNewHeight);\n\t\t\timagecopyresampled($ResizedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t} else {\n\t\t\t$ResizedImageStream = imagecreate($iNewWidth, $iNewHeight);\n\t\t\timagecopyresized($ResizedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t}\n\n\t\t$this->ImageStream = $ResizedImageStream;\n\t\t$this->width = $iNewWidth;\n\t\t$this->height = $iNewHeight;\n\t\t$this->setImageOrientation();\n\t}", "private function resizeImage($filename, $width, $height)\n {\n $config['image_library'] = 'gd2';\n $config['create_thumb'] = TRUE;\n $config['maintain_ratio'] = TRUE;\n $config['width'] = $width;\n $config['height'] = $height;\n $config['source_image'] = $filename;\n $this->load->library('image_lib', $config);\n $this->image_lib->resize();\n }", "public function sizeImg($width, $height, $crop = true);", "function resize( $width, $height ) {\n $new_image = imagecreatetruecolor( $width, $height );\n if ( $this->mimetype == 'image/gif' || $this->mimetype == 'image/png' ) {\n $current_transparent = imagecolortransparent( $this->image );\n if ( $current_transparent != -1 ) {\n $transparent_color = imagecolorsforindex( $this->image, $current_transparent );\n $current_transparent = imagecolorallocate( $new_image, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue'] );\n imagefill( $new_image, 0, 0, $current_transparent );\n imagecolortransparent( $new_image, $current_transparent );\n } elseif ( $this->mimetype == 'image/png' ) {\n imagealphablending( $new_image, false );\n $color = imagecolorallocatealpha( $new_image, 0, 0, 0, 127 );\n imagefill( $new_image, 0, 0, $color );\n imagesavealpha( $new_image, true );\n }\n }\n imagecopyresampled( $new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->width, $this->height );\n $this->image = $new_image;\n return $this;\n }", "function imgResize($filename, $newWidth, $newHeight, $dir_out){\n\t\n\t// изменение размера изображения\n\n\t// 1 создадим новое изображение из файла\n\t$scr = imagecreatefromjpeg($filename); // или $imagePath\n\t\n\t// 2 создадим новое полноцветное изображение нужного размера\n\t$newImg = imagecreatetruecolor($newWidth, $newHeight);\n\n\t// 3 определим размер исходного изображения для 4 пункта\n\t$size = getimagesize($filename);\n\n\t// 4 копирует прямоугольную часть одного изображения на другое изображение, интерполируя значения пикселов таким образом, чтобы уменьшение размера изображения не уменьшало его чёткости\n\timagecopyresampled($newImg, $scr, 0, 0, 0, 0, $newWidth, $newHeight, $size[0], $size[1]);\n\n\t// 5 запишем изображение в файл по нужному пути\n\timagejpeg($newImg, $dir_out);\n\n\timagedestroy($scr);\n\timagedestroy($newImg);\t\t\n\t\n}", "public function resize()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('resize');\n\t}", "public function resize($newWidth, $newHeight, $option='auto')\n\t{\n\t\t// Reset\n\t\tif ($this->imageResized) {\n\t\t\timagedestroy($this->imageResized);\n\t\t}\n\t\t$this->saveState = false;\n\n\t\t// Get optimal width and height based on $option\n\t\t$optionArray = $this->getDimensions((int)$newWidth, (int)$newHeight, $option);\n\t\t$this->optimalWidth = round($optionArray['optimalWidth']);\n\t\t$this->optimalHeight = round($optionArray['optimalHeight']);\n\n\t\t// Resample - create image canvas of x, y size\n\t\t$this->imageResized = imagecreatetruecolor($this->optimalWidth, $this->optimalHeight);\n\t\tif (imagetypes() & IMG_PNG) {\n\t\t\timagesavealpha($this->imageResized, true);\n\t\t\timagealphablending($this->imageResized, false);\n\t\t}\n\t\timagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $this->optimalWidth, $this->optimalHeight, $this->width, $this->height);\n\n\t\t// If option is 'crop', then crop too\n\t\tif ($option == 'crop') {\n\t\t\t$this->cropImage($this->optimalWidth, $this->optimalHeight, $newWidth, $newHeight);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setImageWidth($value)\n\t{\n\t\t$this->setViewState('ImageWidth',$value,'');\n\t}", "private static function resize_image($source, $width, $height){\n\t\t$source_width = imagesx($source);\n\t\t$source_height = imagesy($source);\n\t\t$source_aspect = round($source_width / $source_height, 1);\n\t\t$target_aspect = round($width / $height, 1);\n\t\n\t\t$resized = imagecreatetruecolor($width, $height);\n\t\n\t\tif ($source_aspect < $target_aspect){\n\t\t\t// higher\n\t\t\t$new_size = array($width, ($width / $source_width) * $source_height);\n\t\t\t$source_pos = array(0, (($new_size[1] - $height) * ($source_height / $new_size[1])) / 2);\n\t\t}else if ($source_aspect > $target_aspect){\n\t\t\t// wider\n\t\t\t$new_size = array(($height / $source_height) * $source_width, $height);\n\t\t\t$source_pos = array((($new_size[0] - $width) * ($source_width / $new_size[0])) / 2, 0);\n\t\t}else{\n\t\t\t// same shape\n\t\t\t$new_size = array($width, $height);\n\t\t\t$source_pos = array(0, 0);\n\t\t}\n\t\n\t\tif ($new_size[0] < 1) $new_size[0] = 1;\n\t\tif ($new_size[1] < 1) $new_size[1] = 1;\n\t\n\t\timagecopyresampled($resized, $source, 0, 0, $source_pos[0], $source_pos[1], $new_size[0], $new_size[1], $source_width, $source_height);\n\t\n\t\treturn $resized;\n\t}", "public function resize(int $width, ?int $height = null, int $aspectRatio = Image::RESIZE_IGNORE): Image\n\t{\n\t\t$this->processor->resize($width, $height, $aspectRatio);\n\n\t\treturn $this;\n\t}", "public function resize_width($newWidth, $newHeight = null, $keepRatio = true)\n\t{\n\t\t$this->intern_resize_width($newWidth, $newHeight, $keepRatio);\n\t}", "public function resize($width,$height) {\n\t\t$this->scaleImage($width,$height);\n\t\treturn $this;\n\t}", "function resizetowidth($iNewWidth)\n\t{\n\t\t$iNewHeight = ($iNewWidth / $this->width) * $this->height;\n\n\t\t$this->resize($iNewWidth, $iNewHeight);\n\t}", "public function setOriginalImageWidthHeight() {\n \n $checkError = $this->isError();\n if (!$checkError) {\n \n /*\n * get original width and height\n */\n $this->__originalImageWidth = imagesx($this->__image);\n $this->__originalImageHeight = imagesy($this->__image);\n \n }\n \n }", "public function resize($width=null, $height=null, $master=null);", "private function resize($width,$height) {\n $newImage = imagecreatetruecolor($width, $height);\n imagealphablending($newImage, false);\n imagesavealpha($newImage, true);\n imagecopyresampled($newImage, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $newImage;\n }", "function resizeImage($image,$width,$height,$scale) {\n\t\t\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\t\t$newImageWidth = ceil($width * $scale);\n\t\t\t\t$newImageHeight = ceil($height * $scale);\n\t\t\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\t$source=imagecreatefromgif($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\t$source=imagecreatefromjpeg($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\t$source=imagecreatefrompng($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\t\t\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\timagegif($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\timagejpeg($newImage,$image,90);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\timagepng($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tchmod($image, 0777);\n\t\t\t\treturn $image;\n\t\t\t}", "static function resize($sourcePath, $newWidth = 100, $newHeight = 100)\n {\n switch (exif_imagetype($sourcePath)) {\n case IMAGETYPE_JPEG :\n $sourceImage = imagecreatefromjpeg($sourcePath);\n break;\n case IMAGETYPE_PNG :\n $sourceImage = imagecreatefrompng($sourcePath);\n break;\n case IMAGETYPE_GIF :\n $sourceImage = imagecreatefromgif($sourcePath);\n break;\n default:\n return;\n }\n\n // Create the new image (still blank/empty)\n $newImage = imagecreatetruecolor($newWidth, $newHeight);\n imagesetinterpolation($newImage, IMG_SINC);\n\n // Determine the source image Dimensions\n $sourceImageWidth = imagesx($sourceImage);\n $sourceImageHeight = imagesy($sourceImage);\n $sourceImageAspectRatio = $sourceImageWidth / $sourceImageHeight;\n $newImageAspectRatio = $newWidth / $newHeight;\n\n // Determine parameters and copy part of the source image into the new image\n if ($newImageAspectRatio >= $sourceImageAspectRatio) { // width is the limiting factor for the source image\n $src_x = 0;\n $src_w = $sourceImageWidth;\n $src_h = $src_w / $newImageAspectRatio;\n $src_y = ($sourceImageHeight - $src_h) / 2;\n } else { // height of source image is limiting factor\n $src_y = 0;\n $src_h = $sourceImageHeight;\n $src_w = $src_h * $newImageAspectRatio;\n $src_x = ($sourceImageWidth - $src_w) / 2;\n }\n\n imagecopyresampled($newImage, $sourceImage, 0, 0, $src_x, $src_y, $newWidth, $newHeight, $src_w, $src_h);\n\n // Save new image to destination path\n switch (exif_imagetype($sourcePath)) {\n case IMAGETYPE_JPEG :\n imagejpeg($newImage, $sourcePath, 100);\n break;\n case IMAGETYPE_PNG :\n imagepng($newImage, $sourcePath);\n break;\n case IMAGETYPE_GIF :\n imagegif($newImage, $sourcePath);\n break;\n }\n\n // Remove image resources to reallocate space\n imagedestroy($sourceImage);\n imagedestroy($newImage);\n }", "public function resizeImage($width, $height, $filter = null, $blur = null)\n {\n if (null === $filter) {\n $filter = $this->imageFilter;\n }\n if (null === $blur) {\n $blur = $this->imageBlur;\n }\n if ($this->resource->getNumberImages() > 0) {\n $frames = $this->resource->coalesceImages();\n foreach ($frames as $frame) {\n $frame->resizeImage($width, $height, $filter, $blur);\n }\n $this->resource = $frames->deconstructImages();\n } else {\n $this->resource->resizeImage($width, $height, $filter, $blur);\n }\n\n return $this;\n }", "public function resizeImage($image, $width = MEDIUM_IMAGE_MAX_WIDTH, $height = MEDIUM_IMAGE_MAX_HEIGHT, $subpath = IMG_SUBPATH_MEDIUM, $quality = JPEG_QUALITY) \n {\n // check if file is image\n if (!$this->isFileImage($image) ) {\n $this->throwException(FILE_IS_NOT_IMAGE, \"File is not an image\");\n }\n list($imgWidth, $imgHeight) = getimagesize($image);\n \n if ($imgWidth > $imgHeight) {\n $newWidth = $imgWidth / ($imgWidth / $width);\n $newHeight = $imgHeight / ($imgWidth / $width);\n } else {\n $newWidth = $imgWidth / ($imgHeight / $height);\n $newHeight = $imgHeight / ($imgHeight / $height);\n }\n\n $path = pathinfo($image);\n //print_r($path); // debug\n $src_img = imagecreatefromjpeg($image);\n $dest_img = imagecreatetruecolor($newWidth, $newHeight);\n imagecopyresampled($dest_img, $src_img, 0, 0, 0, 0, $newWidth, $newHeight, $imgWidth, $imgHeight);\n \n if (ADD_WATERMARK_TO_PHOTO) {\n //TODO: Add optional watermark to photo\n }\n \n imagejpeg($dest_img, IMAGE_STORAGE_PATH . $subpath . $path['filename'] . \".\" . $path['extension'], $quality);\n \n \n return IMAGE_STORAGE_PATH . $subpath . $path['filename'] . \".\" . $path['extension'];\n }", "public function resize($width, $height, $crop_top = 0, $crop_bottom = 0, $crop_left = 0, $crop_right = 0) {}", "public static function resize($image, $width, $height, $keepAspectRatio = true, $allowUpscaling = false)\n {\n $img = self::ensureImageInterfaceInstance($image)->copy();\n\n /** @var BoxInterface $sourceBox */\n $sourceBox = $img->getSize();\n $destinationBox = static::getBox($sourceBox, $width, $height, $keepAspectRatio);\n\n if ($allowUpscaling === false && self::isUpscaling($sourceBox, $destinationBox)) {\n return $img;\n }\n\n return $img->resize($destinationBox);\n }", "public function resize($newWidth, $newHeight)\n {\n $imageIn = $this->getWorkingImageResource();\n $imageOut = imagecreatetruecolor($newWidth, $newHeight);\n imagecopyresampled(\n $imageOut, // resource dst_im\n $imageIn, // resource src_im\n 0, // int dst_x\n 0, // int dst_y\n 0, // int src_x\n 0, // int src_y\n $newWidth, // int dst_w\n $newHeight, // int dst_h\n $this->getWorkingImageWidth(), // int src_w\n $this->getWorkingImageHeight() // int src_h\n );\n\n $this->setWorkingImageResource($imageOut);\n }", "public function image_resize($width = 0, $height = 0, $image_url, $filename, $upload_url)\n {\n $source_path = realpath($image_url);\n list($source_width, $source_height, $source_type) = getimagesize($source_path);\n switch ($source_type)\n {\n case IMAGETYPE_GIF:\n $source_gdim = imagecreatefromgif($source_path);\n break;\n case IMAGETYPE_JPEG:\n $source_gdim = imagecreatefromjpeg($source_path);\n break;\n case IMAGETYPE_PNG:\n $source_gdim = imagecreatefrompng($source_path);\n break;\n }\n\n $source_aspect_ratio = $source_width / $source_height;\n $desired_aspect_ratio = $width / $height;\n\n if ($source_aspect_ratio > $desired_aspect_ratio)\n {\n /*\n * Triggered when source image is wider\n */\n $temp_height = $height;\n $temp_width = (int)($height * $source_aspect_ratio);\n }\n else\n {\n /*\n * Triggered otherwise (i.e. source image is similar or taller)\n */\n $temp_width = $width;\n $temp_height = (int)($width / $source_aspect_ratio);\n }\n\n /*\n * Resize the image into a temporary GD image\n */\n\n $temp_gdim = imagecreatetruecolor($temp_width, $temp_height);\n imagecopyresampled($temp_gdim, $source_gdim, 0, 0, 0, 0, $temp_width, $temp_height, $source_width, $source_height);\n\n /*\n * Copy cropped region from temporary image into the desired GD image\n */\n\n $x0 = ($temp_width - $width) / 2;\n $y0 = ($temp_height - $height) / 2;\n $desired_gdim = imagecreatetruecolor($width, $height);\n imagecopy($desired_gdim, $temp_gdim, 0, 0, $x0, $y0, $width, $height);\n\n /*\n * Render the image\n * Alternatively, you can save the image in file-system or database\n */\n\n $image_url = $upload_url . $filename;\n\n imagepng($desired_gdim, $image_url);\n\n return $image_url;\n\n /*\n * Add clean-up code here\n */\n }", "public function ResizeImageThumbnail($image_path, $height, $width,$image){\n\t $img_name_only = explode('.', $image);\n\t $img_name_only = $img_name_only[0];\n\t $image = new \\Imagick($image_path.'/'.$image);\n\t $image->thumbnailImage($width, $height);\n\t $store_image_with_new_name=$image_path.'/'.$img_name_only.'_'.$width.'X'.$height.'.jpeg';\n\t $image->writeImage($store_image_with_new_name);\n\t $image->destroy();\n\t return $img_name_only.'.jpeg';\n \t}", "function resizeImage($width, $height, $quality = 8, $ratio = false) {\n\t\tif (!is_numeric($quality)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tif ($quality > 10) {\n\t\t\t\t$quality = 10;\n\t\t\t} else if ($quality < 0) {\n\t\t\t\t$quality = 0;\n\t\t\t}\n\n\t\t\t$quality = $quality * 10;\n\t\t\t$dataPath = TMP_DIR.\"/\".weFile::getUniqueId();\n\t\t\t$_resized_image = we_image_edit::edit_image($this->getElement(\"data\"), $this->getGDType(), $dataPath, $quality, $width, $height, $ratio);\n\n\t\t\t$this->setElement(\"data\", $dataPath);\n\n\t\t\t$this->setElement(\"width\", $_resized_image[1], \"attrib\");\n\t\t\t$this->setElement(\"origwidth\", $_resized_image[1], \"attrib\");\n\n\t\t\t$this->setElement(\"height\", $_resized_image[2],\"attrib\");\n\t\t\t$this->setElement(\"origheight\", $_resized_image[2], \"attrib\");\n\n\t\t\t$this->DocChanged = true;\n\t\t}\n\t}", "public function runMaxResize(Image $image, $width, $height) : Image\n\t{\n\t return $image->resize($width, $height, function ($constraint) {\n\t $constraint->aspectRatio();\n\t $constraint->upsize();\n\t });\n\t}", "public function setWidth($width);", "public function setWidth($width);", "public function resize($width = null, $height = null)\n {\n $width = isset($width) ? $width : $this->r_width;\n $height = isset($height) ? $height : $this->r_height;\n\n $src = Timber\\ImageHelper::resize($this->src, $width, $height);\n return $this->copySelf($src);\n }", "function resize_fit_or_smaller($width, $height) {\n\n\t\t$w = $this->getWidth();\n\t\t$h = $this->getHeight();\n\n\t\t$ratio = $width / $w;\n\t\tif (($h*$ratio)>$height)\n\t\t\t$ratio = $height / $h;\n\t\t\n\t\t$h *= $ratio;\n\t\t$w *= $ratio;\n\n\t\t$this->resize($w, $h);\n\t}", "function imageResize($imageResourceId=null,$width=null,$height=null, $targetWidth=null, $targetHeight=null) {\n\n// $targetWidth =300;\n// $targetHeight =260;\n// dd($imageResourceId,$width,$height, $targetWidth, $targetHeight);\n\n $targetLayer=imagecreatetruecolor($targetWidth,$targetHeight);\n imagecopyresampled($targetLayer,$imageResourceId,0,0,0,0,$targetWidth,$targetHeight, $width,$height );\n// imagecopyresized($targetLayer,$imageResourceId,0,0,0,0, $width,$height,$targetWidth,$targetHeight);\n\n return $targetLayer;\n }", "public static function resize($image = NULL, $width = NULL, $height = NULL)\n\t{\n\n\t\tif (!($image instanceof Default_Model_MediaImage)) {\n\t\t\tthrow new Default_Model_MediaImage_Exception('Image needs to be an instance of Default_Model_MediaImage.');\n\t\t}\n\n\t\tif ($width &&\n\t\t\t!is_int($width)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('Width needs to be an integer, if specified.');\n\t\t}\n\n\t\tif ($height &&\n\t\t\t!is_int($height)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('Height needs to be an integer, if specified.');\n\t\t}\n\n\t\treturn self::_resize($image, $width, $height);\n\t}", "protected function _resizeImage($imagePath, $height = 150, $width = 150)\n {\n Image::make(storage_path('app/public/' . $imagePath))->resize($width, $height)->save(storage_path('app/public/' . $imagePath));\n }", "function imageresize($im, $width, $height) {\n list($w, $h) = [imagesx($im), imagesy($im)];\n $res = newTransparentImage($w + $width, $h + $height);\n imagecopy($res, $im, 0, 0, 0, 0, $w, $h);\n imagedestroy($im);\n return $res;\n}", "public function image_fixed_resize($width, $height, $crop = true){\n $ratio = $this->width / $this->height;\n $original_ratio = $width / $height;\n\n $crop_width = $this->width;\n $crop_height = $this->height;\n\n if($ratio > $original_ratio)\n {\n $crop_width = round($original_ratio * $crop_height);\n }\n else\n {\n $crop_height = round($crop_width / $original_ratio);\n }\n if($crop)\n $this->crop($crop_width, $crop_height);\n $this->resize($width, $height);\n }", "function resize( $jpg ) {\n\t$im = @imagecreatefromjpeg( $jpg );\n\t$filename = $jpg;\n\t$percent = 0.5;\n\tlist( $width, $height ) = getimagesize( $filename );\n\tif ( $uploader_name == \"c_master_imgs\" ):\n\t\t$new_width = $width;\n\t$new_height = $height;\n\telse :\n\t\tif ( $width > 699 ): $new_width = 699;\n\t$percent = 699 / $width;\n\t$new_height = $height * $percent;\n\telse :\n\t\t$new_width = $width;\n\t$new_height = $height;\n\tendif;\n\tendif; // end if measter images do not resize\n\t//if ( $new_height>600){ $new_height = 600; }\n\t$im = imagecreatetruecolor( $new_width, $new_height );\n\t$image = imagecreatefromjpeg( $filename );\n\timagecopyresampled( $im, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height );\n\t@imagejpeg( $im, $jpg, 80 );\n\t@imagedestroy( $im );\n}", "public function resize($image, $width, $height)\n {\n $origWidth = imagesx($image);\n $origHeight = imagesy($image);\n \n $ratio = min(array($origWidth, $origHeight)) / max($width, $height);\n \n $w = $origWidth * $ratio;\n $h = $origHeight * $ratio;\n \n $cropped = imagecreatetruecolor($width, $height);\n imagecopyresampled($cropped, $image, 0, 0, 0, 0, $origWidth, $origHeight, $w, $h);\n return $cropped;\n }", "function image_resize($filename){\n\t\t$width = 1000;\n\t\t$height = 500;\n\t\t$save_file_location = $filename;\n\t\t// File type\n\t\t//header('Content-Type: image/jpg');\n\t\t$source_properties = getimagesize($filename);\n\t\t$image_type = $source_properties[2];\n\n\t\t// Get new dimensions\n\t\tlist($width_orig, $height_orig) = getimagesize($filename);\n\n\t\t$ratio_orig = $width_orig/$height_orig;\n\t\tif ($width/$height > $ratio_orig) {\n\t\t\t$width = $height*$ratio_orig;\n\t\t} else {\n\t\t\t$height = $width/$ratio_orig;\n\t\t}\n\t\t// Resampling the image \n\t\t$image_p = imagecreatetruecolor($width, $height);\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\t$image = imagecreatefromjpeg($filename);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\t$image = imagecreatefromgif($filename);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$image = imagecreatefrompng($filename);\n\t\t}\n\t\t$finalIMG = imagecopyresampled($image_p, $image, 0, 0, 0, 0,\n\t\t$width, $height, $width_orig, $height_orig);\n\t\t// Display of output image\n\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\timagejpeg($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\timagegif($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$imagepng = imagepng($image_p, $save_file_location);\n\t\t}\n\t}", "function resizeImage($image,$width,$height,$scale,$stype) {\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($stype) {\n case 'gif':\n $source = imagecreatefromgif($image);\n break;\n case 'jpg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'jpeg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'png':\n $source = imagecreatefrompng($image);\n break;\n }\n\timagecopyresampled($newImage, $source,0,0,0,0, $newImageWidth, $newImageHeight, $width, $height);\n\timagejpeg($newImage,$image,90);\n\tchmod($image, 0777);\n\treturn $image;\n}", "public function setWidth($width) {}", "public function setWidth($width) {}", "public function setWidth($width) {}", "public function resize ($image, $width, $height, $options = array (), $quality = 100) {\n\t\t$options['width'] = $width;\n\t\t$options['height'] = $height;\n\n\t\treturn $this->Html->image ($this->resizedUrl ($image, $width, $height, $quality), $options);\n\t}", "function imageResize($width, $height, $target){\n //formula accordingly...this is so this script will work\n //dynamically with any size image\n\n if ($width > $height) {\n $percentage = ($target / $width);\n } else {\n $percentage = ($target / $height);\n }\n\n //gets the new value and applies the percentage, then rounds the value\n $width = round($width * $percentage);\n $height = round($height * $percentage);\n\n //returns the new sizes in html image tag format...this is so you\n //\tcan plug this function inside an image tag and just get the\n\n return \"width=\".$width.\" height=\".$height.\"\";\n\n }", "function resizeSaveImage($filename, $destinationFile, $newWidth){\n\t\t \n\t\t list($width, $height) = getimagesize($filename);\n\t\t if($width > $newWidth){\n\t\t\t\t$percent = $newWidth / $width;\n\t\t\t\t$newHeight = $height * $percent;\n\t\t\t\t\n\t\t\t\t// Load\n\t\t\t\t$resizedImage = imagecreatetruecolor($newWidth, $newHeight);\n\t\t\t\t$source = imagecreatefromjpeg($filename);\n\t\t\t\t\n\t\t\t\t// Resize\n\t\t\t\timagecopyresized($resizedImage, $source, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height);\n\t\t\t\t\n\t\t\t\t// Output\n\t\t\t\timagejpeg($resizedImage, $destinationFile, 100 );\n\t\t\t\t\n\t\t\t\t//memory clean up.\n\t\t\t\timagedestroy($source);\n\t\t\t\timagedestroy($resizedImage);\n\t\t }\n\t }", "public function runContainResize(Image $image, $width, $height) : Image\n\t{\n\t\treturn $image->resize($width, $height, function ($constraint) {\n\t\t\t$constraint->aspectRatio();\n\t\t});\n\t}", "public function autoScale($img, $size) {\n\t// NOT YET IMPLEMENTED.\n}", "function resize( $w = 0, $h = 0 )\n\t{\n\t\tif( $w == 0 || $h == 0 )\n\t\t\treturn FALSE;\n\t\t\n\t\t//get the size of the current image\n\t\t$oldsize = $this->size();\n\t\t\n\t\t//create a target canvas\n\t\t$new_im = imagecreatetruecolor ( $w, $h );\n\t\n\t\t//copy and resize image to new canvas\n\t\timagecopyresampled( $new_im, $this->im, 0, 0, 0, 0, $w, $h, $oldsize->w, $oldsize->h );\n\t\t\n\t\t//delete the old image handle\n\t\timagedestroy( $this->im );\n\t\t\n\t\t//set the new image as the current handle\n\t\t$this->im = $new_im;\n\t}", "public function resize($width, $height, $aspect = true)\n {\n $imgW = $this->width;\n $imgH = $this->height;\n\n // Keep aspect\n if( $aspect )\n {\n list($width, $height) = self::_fitImage($imgW, $imgH, $width, $height);\n }\n\n // Create new temporary image\n self::_isSafeToOpen($width, $height);\n $dst = imagecreatetruecolor($width, $height);\n\n // Try to preserve transparency\n //self::_allocateTransparency($this->_resource, $dst, $this->_info->type);\n\n // Resize\n if( !imagecopyresampled($dst, $this->_resource, 0, 0, 0, 0, $width, $height, $imgW, $imgH) )\n {\n imagedestroy($dst);\n throw new Engine_Image_Adapter_Exception('Unable to resize image');\n }\n\n // Now destroy old image and overwrite with new\n imagedestroy($this->_resource);\n $this->_resource = $dst;\n $this->_info->width = $width;\n $this->_info->height = $height;\n \n return $this;\n }", "public function resizeImage($file, $width, $height)\n {\n Image::make($file)->orientate()\n ->resize($width, $height, function ($constraint) {\n $constraint->aspectRatio();\n $constraint->upsize();\n })\n ->save($file);\n }", "public function resize($width, $height, $type='regular')\n\t{\n\t\t$type = in_array($type, array('crop', 'regular') )?$type:'regular';\n\t\t\n\t\t// if both sizes are auto or the type is crop and either size is auto then do nothing\n\t\tif( (preg_match('/^(auto|nochange)$/', $width) && preg_match('/^(auto|nochange)$/', $height) ) || ( $type == 'crop' && ($width == 'auto' || $height == 'auto') ) )\n\t\t\treturn false;\n\t\t\n\t\t// if both sizes are not within constrained type limits then do nothing\n\t\t// they should be either 'auto', 'nochange', a % value, or an integer representing the pixel dimensions\n\t\tif(!preg_match('/^(auto|nochange|(\\d+)%?)$/', $width) && preg_match('/^(auto|nochange|(\\d+)%?)$/', $height) )\n\t\t\treturn false;\n\t\t\n\t\t// some types of resize also require a cropping action too so switch between them here\n\t\tswitch($type)\n\t\t{\n\t\t\tcase 'regular':\n\t\t\t{\n\t\t\t\t// determine the new width\n\t\t\t\tif($width == 'auto')\n\t\t\t\t{\n\t\t\t\t\tif(is_numeric($height))\n\t\t\t\t\t\t$width = (int)(intval($height) / $this->height * $this->width);\n\t\t\t\t\telse\n\t\t\t\t\t\t$width = $this->set_dimension($this->width, $height);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$width = $this->set_dimension($this->width, $width);\n\t\t\t\t\n\t\t\t\t// determine the new height\n\t\t\t\tif($height == 'auto')\n\t\t\t\t{\n\t\t\t\t\tif(is_numeric($width))\n\t\t\t\t\t\t$height = (int)(intval($width) / $this->width * $this->height);\n\t\t\t\t\telse\n\t\t\t\t\t\t$height = $this->set_dimension($this->height, $width);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$height = $this->set_dimension($this->height, $height);\n\n\t\t\t\t$image_p = imagecreatetruecolor($width, $height);\n\t\t\t\treturn (imagecopyresampled($image_p, $this->image, 0, 0, 0, 0, $width, $height, $this->width, $this->height) && $this->image = $image_p);\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}//end case\n\t\t\tcase 'crop':\n\t\t\t{\n\t\t\t\t$width = $this->set_dimension($this->width, $width);\n\t\t\t\t$height = $this->set_dimension($this->height, $height);\n\n\t\t\t\tif(($width / $height) < ($this->width / $this->height))\n\t\t\t\t{\n\t\t\t\t\t// landscape\n\t\t\t\t\t$ratio = $width / $height;\n\t\t\t\t\t$image_p = imagecreatetruecolor($width, $height);\n\t\t\t\t\t\n\t\t\t\t\timagecopyresampled(\n\t\t\t\t\t\t$image_p, // dst_im\n\t\t\t\t\t\t$this->image, // src_im\n\t\t\t\t\t\t0, // dst_x\n\t\t\t\t\t\t0, // dst_y\n\t\t\t\t\t\t($this->width / 2) - ($this->height * $ratio) / 2, // src_x\n\t\t\t\t\t\t0, // src_y\n\t\t\t\t\t\t$width, // dst_w\n\t\t\t\t\t\t$height, // dst_h\n\t\t\t\t\t\t$this->height * $ratio, // src_w\n\t\t\t\t\t\t$this->height // src_h\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// portrait\n\t\t\t\t\t$ratio = $height / $width;\n\t\t\t\t\t$image_p = imagecreatetruecolor($width, $height);\n\t\t\t\t\t\n\t\t\t\t\timagecopyresampled(\n\t\t\t\t\t\t$image_p, // dst_im\n\t\t\t\t\t\t$this->image, // src_im\n\t\t\t\t\t\t0, // dst_x\n\t\t\t\t\t\t0, // dst_y\n\t\t\t\t\t\t0, // src_x\n\t\t\t\t\t\t0, // src_y\n\t\t\t\t\t\t$width, // dst_w\n\t\t\t\t\t\t$height, // dst_h\n\t\t\t\t\t\t$this->width, // src_w\n\t\t\t\t\t\t$this->width * $ratio // src_h\n\t\t\t\t\t);\n\t\t\t\t}//end if\n\t\t\t\treturn ($this->image = $image_p);\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}//end case\n\t\t}//end switch\n\t}", "function resizeImage($image,$width,$height,$scale) {\n\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t$imageType = image_type_to_mime_type($imageType);\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t\t\t$source=imagecreatefromgif($image); \n\t\t\tbreak;\n\t case \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\tbreak;\n\t case \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\t$source=imagecreatefrompng($image); \n\t\t\tbreak;\n \t}\n\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t \t\timagegif($newImage,$image); \n\t\t\tbreak;\n \tcase \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t \t\timagejpeg($newImage,$image,90); \n\t\t\tbreak;\n\t\tcase \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\timagepng($newImage,$image); \n\t\t\tbreak;\n }\n\t\n\tchmod($image, 0777);\n\treturn $image;\n}", "private function resizeWithScaleExact($width, $height, $scale) {\n\t\t//$new_height = (int)($this->info['height'] * $scale);\n\t\t$new_width = $width * $scale;\n\t\t$new_height = $height * $scale;\n\t\t$xpos = 0;//(int)(($width - $new_width) / 2);\n\t\t$ypos = 0;//(int)(($height - $new_height) / 2);\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/gif' && $this->isAnimated) {\n $this->imagick = new Imagick($this->file);\n $this->imagick = $this->imagick->coalesceImages();\n foreach ($this->imagick as $frame) {\n $frame->thumbnailImage($new_width, $new_height);\n $frame->setImagePage($new_width, $new_height, 0, 0);\n }\n } else {\n $image_old = $this->image;\n $this->image = imagecreatetruecolor($width, $height);\n $bcg = $this->backgroundColor;\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/png') {\n imagealphablending($this->image, false);\n imagesavealpha($this->image, true);\n $background = imagecolorallocatealpha($this->image, $bcg[0], $bcg[1], $bcg[2], 127);\n imagecolortransparent($this->image, $background);\n } else {\n $background = imagecolorallocate($this->image, $bcg[0], $bcg[1], $bcg[2]);\n }\n\n imagefilledrectangle($this->image, 0, 0, $width, $height, $background);\n imagecopyresampled($this->image, $image_old, $xpos, $ypos, 0, 0, $new_width, $new_height, $this->info['width'], $this->info['height']);\n imagedestroy($image_old);\n }\n\n\t\t$this->info['width'] = $width;\n\t\t$this->info['height'] = $height;\n }", "function resizeImage($input,$output,$wid,$hei,$auto=false,$quality=80) {\n\n\t// File and new size\n\t//the original image has 800x600\n\t$filename = $input;\n\t//the resize will be a percent of the original size\n\t$percent = 0.5;\n\n\t// Get new sizes\n\tlist($width, $height) = getimagesize($filename);\n\t$newwidth = $wid;//$width * $percent;\n\t$newheight = $hei;//$height * $percent;\n\tif($auto) {\n\t\tif($width>$height) {\n\t\t\t$newheight=$wid*0.75;\n\t\t} else if($height>$width) {\n\t\t\t$newwidth=$hei*0.75;\n\t\t}\n\t}\n\n\t// Load\n\t$thumb = imagecreatetruecolor($newwidth, $newheight);\n\t$source = imagecreatefromjpeg($filename);\n\n\t// Resize\n\timagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n\n\t// Output and free memory\n\t//the resized image will be 400x300\n\timagejpeg($thumb,$output,$quality);\n\timagedestroy($thumb);\n}", "protected function scaleImages() {}", "public function ImageResize($file_resize_width, $file_resize_height){\r\n $this->proc_filewidth=$file_resize_width;\r\n $this->proc_fileheight=$file_resize_height;\r\n }", "private function resize() {\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$originalImage = imagecreatefromjpeg($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t$originalImage = imagecreatefrompng($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$originalImage = imagecreatefromgif($this->tempName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// Determine new height\n\t\t$this->newHeight = ($this->height / $this->width) * $this->newWidth;\n\n\t\t// Create new image\n\t\t$this->newImage = imagecreatetruecolor($this->newWidth, $this->newHeight);\n\n\t\t// Resample original image into new image\n\t\timagecopyresampled($this->newImage, $originalImage, 0, 0, 0, 0, $this->newWidth, $this->newHeight, $this->width, $this->height);\n\n\t\t// Switch based on image being resized\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t// Source, Dest, Quality 0 to 100\n\t\t\t\timagejpeg($this->newImage, $this->destinationFolder.'/'.$this->newName, 80);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t// Source, Dest, Quality 0 (no compression) to 9\n\t\t\t\timagepng($this->newImage, $this->destinationFolder.'/'.$this->newName, 0);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($this->newImage, $this->destinationFolder.'/'.$this->newName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('YOUR FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// DESTROY NEW IMAGE TO SAVE SERVER SPACE\n\t\timagedestroy($this->newImage);\n\t\timagedestroy($originalImage);\n\n\t\t// SUCCESSFULLY UPLOADED\n\t\t$this->result = true;\n\t\t$this->message = 'Image uploaded and resized successfully';\n\t}", "public function test_resize() {\n\t\t$file = DIR_TESTDATA . '/images/waffles.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->resize( 100, 50 );\n\n\t\t$this->assertSame(\n\t\t\tarray(\n\t\t\t\t'width' => 75,\n\t\t\t\t'height' => 50,\n\t\t\t),\n\t\t\t$imagick_image_editor->get_size()\n\t\t);\n\t}", "function cilikke($src, $dest, $new_width) {\r\n\t$info = getimagesize($src);\r\n\t$mime = $info[\"mime\"];\r\n\tif( $mime == 'image/jpeg' ) $source_image = imagecreatefromjpeg($src);\r\n\telseif( $mime == 'image/png' ) $source_image = imagecreatefrompng($src);\r\n\t$width = imagesx($source_image);\r\n\t$height = imagesy($source_image);\r\n\t$new_height = floor($height * ($new_width / $width));\r\n\tif($new_width < $width && $new_height < $height)\r\n\t{\r\n\t\t$virtual_image = imagecreatetruecolor($new_width, $new_height);\t\r\n\t\timagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\r\n\t\timagejpeg($virtual_image, $dest);\r\n\t}else\r\n\t\tcopy($src, $dest);\r\n}", "public function resize()\n {\n foreach ($this->getList() as $image) {\n if (!$image instanceof mtmdImage) {\n continue;\n }\n\n mtmdUtils::output(\n sprintf(\n '\"%s\": Resizing to %dx%d (was %dx%d)...',\n $image->getFileName(),\n $this->getThumbWidth(),\n $this->getThumbHeight(),\n $image->getWidth(),\n $image->getHeight()\n )\n );\n\n $targetPath = $this->getCachedFilePath(dirname($image->getFileName()));\n\n // Prepare target dirs.\n mtmdUtils::mkDir($targetPath, 0755, true);\n // Resize image.\n $image->resizeImage($targetPath, $this->thumbWidth, $this->thumbHeight);\n\n }\n\n }", "protected function resizeImage($path)\n\t{\n\t\t$iP = &$this->uploader->imageProcessor;\n\t\t$iP->load($this->uploader->mediaService->getItem($path));\n\t\t$iP->resize_square(500);\n\t\t$iP->saveImage();\n }", "function imageResize($width, $height, $target) {\t\n\tif ($width > $height) { \n\t\t$percentage = ($target / $width); \n\t} else { \n\t\t$percentage = ($target / $height); \n\t} \n\n\t//gets the new value and applies the percentage, then rounds the value \n\t$width = round($width * $percentage); \n\t$height = round($height * $percentage); \n\n\t//returns the new sizes in html image tag format...this is so you \n\t//can plug this function inside an image tag and just get the \n\treturn \"width=\\\"$width\\\" height=\\\"$height\\\"\"; \n\t}", "function resizeImage($width, $height, $quality = 8, $ratio = false){\n\t\tif(!is_numeric($quality)){\n\t\t\treturn false;\n\t\t}\n\t\t$quality = ($quality > 10 ? 10 : max($quality, 0)) * 10;\n\t\t$dataPath = TEMP_PATH . we_base_file::getUniqueId();\n\t\t$_resized_image = we_base_imageEdit::edit_image($this->getElement('data'), $this->getGDType(), $dataPath, $quality, $width, $height, $ratio);\n\t\tif(!$_resized_image[0]){\n\t\t\treturn false;\n\t\t}\n\t\t$this->setElement('data', $dataPath);\n\n\t\t$this->setElement('width', $_resized_image[1], 'attrib');\n\t\t$this->setElement('origwidth', $_resized_image[1], 'attrib');\n\n\t\t$this->setElement('height', $_resized_image[2], 'attrib');\n\t\t$this->setElement('origheight', $_resized_image[2], 'attrib');\n\n\t\t$this->DocChanged = true;\n\t\treturn true;\n\t}", "public function scale($width = null, $height = null, $aspectRatio = null)\n {\n return $this->resize(Scale::scale($width, $height, $aspectRatio));\n }", "private function doImageResize($img){\n\t\t//Determine the new dimensions\n\t\t$d=$this->getNewDims($img);\n\t\t\n\t\t//Determine which function to use\n\t\t$funcs=$this->getImageFunctions($img);\n\t\t\n\t\t//Determine the image type\n\t\t$src_img=$funcs[0]($img);\n\t\t\n\t\t//Determine the new image size\n\t\t$new_img=imagecreatetruecolor($d[0], $d[1]);\n\t\t\n\t\tif(imagecopyresampled\n\t\t\t\t($new_img, $src_img, 0, 0, 0, 0, $d[0],$d[1] , $d[2], $d[3])){\n\t\t\timagedestroy($src_img);\n\t\t\t//check if the new image has the same file type as the original one\n\t\t\tif($new_img && $funcs[1]($new_img,$img)){\n\t\t\t\timagedestroy($new_img);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthrow new Exception('Failed to save the new image!');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception(\"Could not resample the image!\");\n\t\t}\n\t\t\n\t}", "function sharpen_resized_jpeg_images($resized_file) {\r\n $image = wp_load_image($resized_file); \r\n if(!is_resource($image))\r\n return new WP_Error('error_loading_image', $image, $file); \r\n $size = @getimagesize($resized_file);\r\n if(!$size)\r\n return new WP_Error('invalid_image', __('Could not read image size'), $file); \r\n list($orig_w, $orig_h, $orig_type) = $size; \r\n switch($orig_type) {\r\n case IMAGETYPE_JPEG:\r\n $matrix = array(\r\n array(-1, -1, -1),\r\n array(-1, 16, -1),\r\n array(-1, -1, -1),\r\n ); \r\n $divisor = array_sum(array_map('array_sum', $matrix));\r\n $offset = 0; \r\n imageconvolution($image, $matrix, $divisor, $offset);\r\n imagejpeg($image, $resized_file,apply_filters('jpeg_quality', 90, 'edit_image'));\r\n break;\r\n case IMAGETYPE_PNG:\r\n return $resized_file;\r\n case IMAGETYPE_GIF:\r\n return $resized_file;\r\n } \r\n return $resized_file;\r\n}", "public function resizeImage($dimensions = array()) {\r\n $this->imageDimensions = $dimensions;\r\n return $this;\r\n }", "function image_resize_dimensions ( $args ) {\r\n\t\t/*\r\n\t\t * Changelog\r\n\t\t *\r\n\t\t * v8.1, November 11, 2009\r\n\t\t * - Now uses trigger_error instead of outputting errors to screen\r\n\t\t *\r\n\t\t * v8, December 02, 2007\r\n\t\t * - Cleaned by using math instead of logic\r\n\t\t * - Restructured the code\r\n\t\t * - Re-organised variable names\r\n\t\t *\r\n\t\t * v7, 20/07/2007\r\n\t\t * - Cleaned\r\n\t\t *\r\n\t\t * v6,\r\n\t\t * - Added cropping\r\n\t\t *\r\n\t\t * v5, 12/08/2006\r\n\t\t * - Changed to use args\r\n\t\t */\r\n\t\t\r\n\t\t/*\r\n\t\tThe 'exact' resize mode, will resize things to the exact limit.\r\n\t\tIf a width or height is 0, the appropriate value will be calculated by ratio\r\n\t\tResults with a 800x600 limit:\r\n\t\t\t*x*\t\t\t->\t800x600\r\n\t\tResults with a 0x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\r\n\t\t\t96x48\t\t->\t1200x600\r\n\t\t\t1000x500\t->\t1200x600\r\n\t\tResults with a 800x0 limit:\r\n\t\t\t1280x1024\t->\t800x640\r\n\t\t\t1900x1200\t->\t800x505\r\n\t\t\t96x48\t\t->\t800x400\r\n\t\t\t1000x500\t->\t800x400\r\n\t\t*/\r\n\t\t\r\n\t\t/*\r\n\t\tThe 'area' resize mode, will resize things to fit within the area.\r\n\t\tIf a width or height is 0, the appropriate value will be calculated by ratio\r\n\t\tResults with a 800x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\t-> 800x505\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t800x400 = '800x'.(800/100)*500\r\n\t\tResults with a 0x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t1000x500\tno change\r\n\t\tResults with a 800x0 limit:\r\n\t\t\t1280x1024\t->\t800x640\r\n\t\t\t1900x1200\t->\t950x600\t->\t800x505\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t800x400\t= '800x'.(800/1000)*500\r\n\t\t*/\r\n\t\t\r\n\t\t// ---------\r\n\t\t$image = $x_original = $y_original = $x_old = $y_old = $resize_mode = $width_original = $width_old = $width_desired = $width_new = $height_original = $height_old = $height_desired = $height_new = null;\r\n\t\textract($args);\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($width_original) && !is_null($width_old) ) {\r\n\t\t\t$width_original = $width_old;\r\n\t\t\t$width_old = null;\r\n\t\t}\r\n\t\tif ( is_null($height_original) && !is_null($height_old) ) {\r\n\t\t\t$height_original = $height_old;\r\n\t\t\t$height_old = null;\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( is_null($width_original) && is_null($height_original) && !is_null($image) ) { // Get from image\r\n\t\t\t$image = image_read($image);\r\n\t\t\t$width_original = imagesx($image);\r\n\t\t\t$height_original = imagesy($image);\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( empty($width_original) || empty($height_original) ) { //\r\n\t\t\ttrigger_error('no original dimensions specified', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($width_desired) && !is_null($width_new) ) {\r\n\t\t\t$width_desired = $width_new;\r\n\t\t\t$width_new = null;\r\n\t\t}\r\n\t\tif ( is_null($height_desired) && !is_null($height_new) ) {\r\n\t\t\t$height_desired = $height_new;\r\n\t\t\t$height_new = null;\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( is_null($width_desired) || is_null($height_desired) ) { // Don't do any resizing\r\n\t\t\ttrigger_error('no desired dimensions specified', E_USER_NOTICE);\r\n\t\t\t// return array( 'width' => $width_original, 'height' => $height_original );\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($resize_mode) ) {\r\n\t\t\t$resize_mode = 'area';\r\n\t\t} elseif ( $resize_mode === 'none' ) { // Don't do any resizing\r\n\t\t\ttrigger_error('$resize_mode === \\'none\\'', E_USER_NOTICE);\r\n\t\t\t// return array( 'width' => $width_original, 'height' => $height_original );\r\n\t\t} elseif ( !in_array($resize_mode, array('area', 'crop', 'exact', true)) ) { //\r\n\t\t\ttrigger_error('Passed $resize_mode is not valid: ' . var_export(compact('resize_mode'), true), E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($x_original) && !is_null($x_old) ) {\r\n\t\t\t$x_original = $x_old;\r\n\t\t\tunset($x_old);\r\n\t\t}\r\n\t\tif ( is_null($y_original) && !is_null($y_old) ) {\r\n\t\t\t$y_original = $y_old;\r\n\t\t\tunset($y_old);\r\n\t\t}\r\n\t\tif ( is_null($x_original) )\r\n\t\t\t$x_original = 0;\r\n\t\tif ( is_null($y_original) )\r\n\t\t\t$y_original = 0;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Let's force integer values\r\n\t\t$width_original = intval($width_original);\r\n\t\t$height_original = intval($height_original);\r\n\t\t$width_desired = intval($width_desired);\r\n\t\t$height_desired = intval($height_desired);\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Set proportions\r\n\t\tif ( $height_original !== 0 )\r\n\t\t\t$proportion_wh = $width_original / $height_original;\r\n\t\tif ( $width_original !== 0 )\r\n\t\t\t$proportion_hw = $height_original / $width_original;\r\n\t\t\r\n\t\tif ( $height_desired !== 0 )\r\n\t\t\t$proportion_wh_desired = $width_desired / $height_desired;\r\n\t\tif ( $width_desired !== 0 )\r\n\t\t\t$proportion_hw_desired = $height_desired / $width_desired;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Set cutoms\r\n\t\t$x_new = $x_original;\r\n\t\t$y_new = $y_original;\r\n\t\t$canvas_width = $canvas_height = null;\r\n\t\t\r\n\t\t// ---------\r\n\t\t$width_new = $width_original;\r\n\t\t$height_new = $height_original;\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Do resize\r\n\t\tif ( $height_desired === 0 && $width_desired === 0 ) {\r\n\t\t\t// Nothing to do\r\n\t\t} elseif ( $height_desired === 0 && $width_desired !== 0 ) {\r\n\t\t\t// We don't care about the height\r\n\t\t\t$width_new = $width_desired;\r\n\t\t\tif ( $resize_mode !== 'exact' ) {\r\n\t\t\t\t// h = w*(h/w)\r\n\t\t\t\t$height_new = $width_desired * $proportion_hw;\r\n\t\t\t}\r\n\t\t} elseif ( $height_desired !== 0 && $width_desired === 0 ) {\r\n\t\t\t// We don't care about the width\r\n\t\t\tif ( $resize_mode !== 'exact' ) {\r\n\t\t\t\t // w = h*(w/h)\r\n\t\t\t\t$width_new = $height_desired * $proportion_wh;\r\n\t\t\t}\r\n\t\t\t$height_new = $height_desired;\r\n\t\t} else {\r\n\t\t\t// We care about both\r\n\r\n\t\t\tif ( $resize_mode === 'exact' || /* no upscaling */ ($width_original <= $width_desired && $height_original <= $height_desired) ) { // Nothing to do\r\n\t\t\t} elseif ( $resize_mode === 'area' ) { // Proportion to fit inside\r\n\t\t\t\t\r\n\r\n\t\t\t\t// Pick which option\r\n\t\t\t\tif ( $proportion_wh <= $proportion_wh_desired ) { // Option 1: wh\r\n\t\t\t\t\t// Height would of overflowed\r\n\t\t\t\t\t$width_new = $height_desired * $proportion_wh; // w = h*(w/h)\r\n\t\t\t\t\t$height_new = $height_desired;\r\n\t\t\t\t} else // if ( $proportion_hw <= $proportion_hw_desired )\r\n{ // Option 2: hw\r\n\t\t\t\t\t// Width would of overflowed\r\n\t\t\t\t\t$width_new = $width_desired;\r\n\t\t\t\t\t$height_new = $width_desired * $proportion_hw; // h = w*(h/w)\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t} elseif ( $resize_mode === 'crop' ) { // Proportion to occupy\r\n\t\t\t\t\r\n\r\n\t\t\t\t// Pick which option\r\n\t\t\t\tif ( $proportion_wh <= $proportion_wh_desired ) { // Option 2: hw\r\n\t\t\t\t\t// Height will overflow\r\n\t\t\t\t\t$width_new = $width_desired;\r\n\t\t\t\t\t$height_new = $width_desired * $proportion_hw; // h = w*(h/w)\r\n\t\t\t\t\t// Set custom\r\n\t\t\t\t\t$y_new = -($height_new - $height_desired) / 2;\r\n\t\t\t\t} else // if ( $proportion_hw <= $proportion_hw_desired )\r\n{ // Option 1: hw\r\n\t\t\t\t\t// Width will overflow\r\n\t\t\t\t\t$width_new = $height_desired * $proportion_wh; // w = h*(w/h)\r\n\t\t\t\t\t$height_new = $height_desired;\r\n\t\t\t\t\t// Set custom\r\n\t\t\t\t\t$x_new = -($width_new - $width_desired) / 2;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Set canvas\r\n\t\t\t\t$canvas_width = $width_desired;\r\n\t\t\t\t$canvas_height = $height_desired;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Set custom if they have not been set already\r\n\t\tif ( $canvas_width === null )\r\n\t\t\t$canvas_width = $width_new;\r\n\t\tif ( $canvas_height === null )\r\n\t\t\t$canvas_height = $height_new;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Compat\r\n\t\t$width_old = $width_original;\r\n\t\t$height_old = $height_original;\r\n\t\t$x_old = $x_original;\r\n\t\t$y_old = $y_original;\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Return\r\n\t\t$return = compact('width_original', 'height_original', 'width_old', 'height_old', 'width_desired', 'height_desired', 'width_new', 'height_new', 'canvas_width', 'canvas_height', 'x_original', 'y_original', 'x_old', 'y_old', 'x_new', 'y_new');\r\n\t\t// echo '<--'; var_dump($return); echo '-->';\r\n\t\treturn $return;\r\n\t}", "function image_scale_blob($blob, $aspect, $width, $strategy)\n{\n $im = new \\Imagick();\n $im->readImageBlob($blob);\n $im = image_scale_im_obj($im, $aspect, $width, $strategy);\n return image_return_blob($im);\n}" ]
[ "0.75898075", "0.7455255", "0.71634877", "0.70652676", "0.6963934", "0.68762547", "0.687175", "0.6850629", "0.6800198", "0.6783009", "0.6516139", "0.64880043", "0.6432726", "0.64112836", "0.6378269", "0.6376734", "0.63554865", "0.63530046", "0.6346494", "0.6342696", "0.6308897", "0.6301436", "0.62596136", "0.62290007", "0.6217705", "0.61984694", "0.61868644", "0.6183009", "0.6179548", "0.6175659", "0.6142711", "0.61415505", "0.6135571", "0.6111438", "0.61074734", "0.6087035", "0.6081809", "0.6059369", "0.60533637", "0.6035663", "0.6033606", "0.60231036", "0.60175514", "0.6016223", "0.6005205", "0.59948355", "0.5989455", "0.5979222", "0.59464854", "0.59441966", "0.5935718", "0.593387", "0.5887521", "0.5869568", "0.58645445", "0.5860323", "0.5857603", "0.5852411", "0.5852411", "0.58467555", "0.5832602", "0.58324766", "0.5823453", "0.581646", "0.578645", "0.5780621", "0.5779514", "0.57758105", "0.5769436", "0.5767674", "0.5760489", "0.5760489", "0.5759625", "0.5755447", "0.57418", "0.5739082", "0.5737592", "0.5728008", "0.5725104", "0.5724858", "0.57245433", "0.5721263", "0.5720506", "0.5708104", "0.5704235", "0.56992185", "0.569758", "0.5691205", "0.56884843", "0.56862825", "0.5685023", "0.56837505", "0.5679338", "0.5679291", "0.5671468", "0.56647336", "0.56586754", "0.5649035", "0.563219", "0.56319964" ]
0.7392828
2
Resize an image by height. Preserves aspect ratio.
public function resizeByHeight($height) { return $this->createCloneWithResource( function (InterventionImage $resource) use ($height) { return $resource->heighten($height); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resizeToHeight($height)\n {\n //obtine ratio dividiendo altura dada entre la altura actual de la imagen.\n $ratio = $height / $this->getHeight();\n //obtiene ancho con el ancho actual de la imagen por el ratio.\n $width = $this->getWidth() * $ratio;\n //redimensiona la imagen.\n $this->resize($width,$height);\n }", "public function resize(IImageInformation $src, $width, $height);", "public function resize_fit(IImageInformation $src, $width, $height);", "public function runMaxResize(Image $image, $width, $height) : Image\n\t{\n\t return $image->resize($width, $height, function ($constraint) {\n\t $constraint->aspectRatio();\n\t $constraint->upsize();\n\t });\n\t}", "function resizeToHeight($height) {\r\n\t\t$ratio = $height / $this->getHeight();\r\n\t\t$width = $this->getWidth() * $ratio;\r\n\t\t$this->resize($width,$height);\r\n\t}", "public function setImageHeight($value)\n\t{\n\t\t$this->imageHeight = $value;\n\t\treturn $this;\n\t}", "function setImageHeight($height)\n {\n $this->imageHeight = $height;\n }", "public function resize($width, $height)\n\t{\n\t\t$wScale = $this->width / $width;\n\t\t$hScale = $this->height / $height;\n\t\t$maxScale = max($wScale, $hScale);\n\t\t// Decrease image dimensions\n\t\tif($maxScale > 1)\n\t\t{\n\t\t\t$width = $this->width / $maxScale;\n\t\t\t$height = $this->height / $maxScale;\n\t\t}\n\t\t// Increase image dimensions\n\t\telse\n\t\t{\n\t\t\t$minScale = min($wScale, $hScale);\n\t\t\t$width = $this->width / $minScale;\n\t\t\t$height = $this->height / $minScale;\n\t\t}\n\t\t$image = imagecreatetruecolor($this->width, $this->height);\n\t\timagecopyresampled($image, $this->image, 0, 0, 0, 0, $width, $height, $this->width, $this->height);\n\n\t\t$this->image = $image;\n\t\t$this->width = $width;\n\t\t$this->height = $height;\n\t}", "public function resizeToHeight($h)\n {\n $scale = $h / $this->height;\n $this->height = $h;\n $this->width = round($this->width * $scale);\n\n return $this->resizeImage($this->width, $this->height, $this->imageFilter, $this->imageBlur);\n }", "public function resizeToHeight($height) {\n $ratio = $height / $this->getHeight();\n $width = $this->getWidth() * $ratio;\n $this->resize($width,$height);\n }", "private function resizeImage($filename, $width, $height)\n {\n $config['image_library'] = 'gd2';\n $config['create_thumb'] = TRUE;\n $config['maintain_ratio'] = TRUE;\n $config['width'] = $width;\n $config['height'] = $height;\n $config['source_image'] = $filename;\n $this->load->library('image_lib', $config);\n $this->image_lib->resize();\n }", "public function resize($width, $height)\n {\n return $this->createCloneWithResource(\n function (InterventionImage $resource) use ($width, $height) {\n return $resource->resize($width, $height);\n }\n );\n }", "public function sizeImg($width, $height, $crop = true);", "public function resize_by_height($height){\n\n $ratio = $height / $this->height;\n $width = $this->width * $ratio;\n $this->resize($width, $height);\n\n return true;\n }", "public function setImageHeight($value)\n\t{\n\t\t$this->setViewSTate('ImageHeight',$value,'');\n\t}", "public function resize($width, $height = null);", "public function resizeImage($file, $width, $height)\n {\n Image::make($file)->orientate()\n ->resize($width, $height, function ($constraint) {\n $constraint->aspectRatio();\n $constraint->upsize();\n })\n ->save($file);\n }", "protected function calcImageSize($width, $height)\n {\n $newSize = array('width' => $width, 'height' => $height);\n\n if ($this->maxWidth > 0) {\n $newSize = $this->calcWidth($width, $height);\n\n if ($this->maxHeight > 0 && $newSize['height'] > $this->maxHeight) {\n $newSize = $this->calcHeight($newSize['width'], $newSize['height']);\n }\n }\n\n if ($this->maxHeight > 0) {\n $newSize = $this->calcHeight($width, $height);\n\n if ($this->maxWidth > 0 && $newSize['width'] > $this->maxWidth) {\n $newSize = $this->calcWidth($newSize['width'], $newSize['height']);\n }\n }\n\n $this->newDimensions = $newSize;\n }", "protected function _resizeImage($imagePath, $height = 150, $width = 150)\n {\n Image::make(storage_path('app/public/' . $imagePath))->resize($width, $height)->save(storage_path('app/public/' . $imagePath));\n }", "public function resizeTo($width, $height, $resizeOption = 'default') {\n switch (strtolower($resizeOption)) {\n case 'exact':\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n break;\n case 'maxwidth':\n $this->resizeWidth = $width;\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n break;\n case 'maxheight':\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n break;\n case 'proportionally':\n $ratio_orig = $this->origWidth / $this->origHeight;\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n if ($width / $height > $ratio_orig)\n $this->resizeWidth = $height * $ratio_orig;\n else\n $this->resizeHeight = $width / $ratio_orig;\n break;\n default:\n if ($this->origWidth > $width || $this->origHeight > $height) {\n if ($this->origWidth > $this->origHeight) {\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n $this->resizeWidth = $width;\n } else if ($this->origWidth < $this->origHeight) {\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n break;\n }\n\n $this->newImage = imagecreatetruecolor($this->resizeWidth, $this->resizeHeight);\n if ($this->ext == \"image/gif\" || $this->ext == \"image/png\") {\n imagealphablending($this->newImage, false);\n imagesavealpha($this->newImage, true);\n $transparent = imagecolorallocatealpha($this->newImage, 255, 255, 255, 127);\n imagefilledrectangle($this->newImage, 0, 0, $this->resizeWidth, $this->resizeHeight, $transparent);\n }\n imagecopyresampled($this->newImage, $this->image, 0, 0, 0, 0, $this->resizeWidth, $this->resizeHeight, $this->origWidth, $this->origHeight);\n }", "public function setImageHeight(int $iHeight) : void\n {\n $this->iImageHeight = $iHeight;\n }", "public function resize($width,$height) {\n\t\t$this->scaleImage($width,$height);\n\t\treturn $this;\n\t}", "function resize($width,$height)\n {\n $new_image = imagecreatetruecolor($width, $height);\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $new_image; \n }", "public function runStretchResize(Image $image, int $width, int $height) : Image\n\t{\n\t\treturn $image->resize($width, $height);\n\t}", "function resize_fit_or_bigger($width, $height) {\n\n\t\t$w = $this->getWidth();\n\t\t$h = $this->getHeight();\n\n\t\t$ratio = $width / $w;\n\t\tif (($h*$ratio)<$height)\n\t\t\t$ratio = $height / $h;\n\t\t\n\t\t$h *= $ratio;\n\t\t$w *= $ratio;\n\n\t\t$this->resize($w, $h);\n\t}", "function resize($iNewWidth, $iNewHeight)\n\t{\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\tif (function_exists(\"imagecopyresampled\")) {\n\t\t\t$ResizedImageStream = imagecreatetruecolor($iNewWidth, $iNewHeight);\n\t\t\timagecopyresampled($ResizedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t} else {\n\t\t\t$ResizedImageStream = imagecreate($iNewWidth, $iNewHeight);\n\t\t\timagecopyresized($ResizedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t}\n\n\t\t$this->ImageStream = $ResizedImageStream;\n\t\t$this->width = $iNewWidth;\n\t\t$this->height = $iNewHeight;\n\t\t$this->setImageOrientation();\n\t}", "public function resize($image, $width, $height)\n {\n $origWidth = imagesx($image);\n $origHeight = imagesy($image);\n \n $ratio = min(array($origWidth, $origHeight)) / max($width, $height);\n \n $w = $origWidth * $ratio;\n $h = $origHeight * $ratio;\n \n $cropped = imagecreatetruecolor($width, $height);\n imagecopyresampled($cropped, $image, 0, 0, 0, 0, $origWidth, $origHeight, $w, $h);\n return $cropped;\n }", "public function scaleToHeight( $height ) {\n $factor = $this->height / $height;\n $width = (int) $this->width / $factor;\n $this->resize( $width, $height );\n return $this;\n }", "function resizeImage($width, $height, $quality = 8, $ratio = false) {\n\t\tif (!is_numeric($quality)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tif ($quality > 10) {\n\t\t\t\t$quality = 10;\n\t\t\t} else if ($quality < 0) {\n\t\t\t\t$quality = 0;\n\t\t\t}\n\n\t\t\t$quality = $quality * 10;\n\t\t\t$dataPath = TMP_DIR.\"/\".weFile::getUniqueId();\n\t\t\t$_resized_image = we_image_edit::edit_image($this->getElement(\"data\"), $this->getGDType(), $dataPath, $quality, $width, $height, $ratio);\n\n\t\t\t$this->setElement(\"data\", $dataPath);\n\n\t\t\t$this->setElement(\"width\", $_resized_image[1], \"attrib\");\n\t\t\t$this->setElement(\"origwidth\", $_resized_image[1], \"attrib\");\n\n\t\t\t$this->setElement(\"height\", $_resized_image[2],\"attrib\");\n\t\t\t$this->setElement(\"origheight\", $_resized_image[2], \"attrib\");\n\n\t\t\t$this->DocChanged = true;\n\t\t}\n\t}", "function resize($width, $height){\n\n $new_image = imagecreatetruecolor($width, $height);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->get_width(), $this->get_height());\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $width;\n $this->height = $height;\n\n return true;\n }", "function funcs_imageResize(&$width, &$height, $target, $bywidth = null) {\n\tif ($width<=$target && $height<=$target){\n\t\treturn;\n\t}\n\t//takes the larger size of the width and height and applies the \n\t//formula accordingly...this is so this script will work \n\t//dynamically with any size image \n\tif (is_null($bywidth)){\n\t\tif ($width > $height) { \n\t\t\t$percentage = ($target / $width); \n\t\t} else { \n\t\t\t$percentage = ($target / $height); \n\t\t}\n\t}else{\n\t\tif ($bywidth){\n\t\t\t$percentage = ($target / $width);\n\t\t\t//if height would increase as a result\n\t\t\tif ($height < round($height * $percentage)){\n\t\t\t\treturn;\n\t\t\t} \n\t\t}else{\n\t\t\t$percentage = ($target / $height); \n\t\t\t//if width would increase as a result\n\t\t\tif ($width < round($width * $percentage)){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t} \n\t//gets the new value and applies the percentage, then rounds the value \n\t$width = round($width * $percentage); \n\t$height = round($height * $percentage); \n}", "public function setHeight($height);", "public function setHeight($height);", "public function ratioResize($file, $width=null, $height=null, $rename='') {\n\n $file = $this->uploadPath . $file;\n $imginfo = $this->getInfo($file);\n\n if ($rename == '')\n $newName = substr($imginfo['name'], 0, strrpos($imginfo['name'], '.')) . $this->thumbSuffix . '.' . $this->generatedType;\n else\n $newName = $rename . '.' . $this->generatedType;\n\n if ($width === null && $height === null) {\n return false;\n } elseif ($width !== null && $height === null) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } elseif ($width === null && $height !== null) {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n } else {\n\t\t\t\n\t\t\tif($imginfo['width'] < $width and $imginfo['height'] < $height) {\n\t\t\t\t$width = $imginfo['width'];\n\t\t\t\t$height = $imginfo['height'];\n\t\t\t}\n\t\t\t\n if ($imginfo['width'] > $imginfo['height']) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } else {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n }\n }\n\n //create image object based on the image file type, gif, jpeg or png\n $this->createImageObject($img, $imginfo['type'], $file);\n if (!$img)\n return false;\n\n if (function_exists('imagecreatetruecolor')) {\n $newImg = imagecreatetruecolor($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, 0, 0, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n } else {\n $newImg = imagecreate($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, ($width - $resizeWidth) / 2, ($height - $resizeHeight) / 2, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n }\n\n imagedestroy($img);\n\n if ($this->saveFile) {\n //delete if exist\n if (file_exists($this->processPath . $newName))\n unlink($this->processPath . $newName);\n $this->generateImage($newImg, $this->processPath . $newName);\n imagedestroy($newImg);\n return $this->processPath . $newName;\n }\n else {\n $this->generateImage($newImg);\n imagedestroy($newImg);\n }\n\n return true;\n }", "public function runContainResize(Image $image, $width, $height) : Image\n\t{\n\t\treturn $image->resize($width, $height, function ($constraint) {\n\t\t\t$constraint->aspectRatio();\n\t\t});\n\t}", "function resize( $width, $height ) {\n $new_image = imagecreatetruecolor( $width, $height );\n if ( $this->mimetype == 'image/gif' || $this->mimetype == 'image/png' ) {\n $current_transparent = imagecolortransparent( $this->image );\n if ( $current_transparent != -1 ) {\n $transparent_color = imagecolorsforindex( $this->image, $current_transparent );\n $current_transparent = imagecolorallocate( $new_image, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue'] );\n imagefill( $new_image, 0, 0, $current_transparent );\n imagecolortransparent( $new_image, $current_transparent );\n } elseif ( $this->mimetype == 'image/png' ) {\n imagealphablending( $new_image, false );\n $color = imagecolorallocatealpha( $new_image, 0, 0, 0, 127 );\n imagefill( $new_image, 0, 0, $color );\n imagesavealpha( $new_image, true );\n }\n }\n imagecopyresampled( $new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->width, $this->height );\n $this->image = $new_image;\n return $this;\n }", "public function resize($newWidth, $newHeight)\n {\n $imageIn = $this->getWorkingImageResource();\n $imageOut = imagecreatetruecolor($newWidth, $newHeight);\n imagecopyresampled(\n $imageOut, // resource dst_im\n $imageIn, // resource src_im\n 0, // int dst_x\n 0, // int dst_y\n 0, // int src_x\n 0, // int src_y\n $newWidth, // int dst_w\n $newHeight, // int dst_h\n $this->getWorkingImageWidth(), // int src_w\n $this->getWorkingImageHeight() // int src_h\n );\n\n $this->setWorkingImageResource($imageOut);\n }", "private function intern_resize_height($newHeight, $newWidth = null, $keepRatio = true)\n\t{\n\t\tif ($newWidth == null){\n\t\t\t$newWidth = $newHeight * $this->srcAspectRatio;\n\t\t\t$this->newImage = imagescale($this->srcImage, $newWidth);\n\t\t}\n\t\telse\n\t\t\t$this->intern_resize($newWidth, $newHeight, $keepRatio);\n\t}", "public function setHeight($height) {}", "private function resize($width,$height) {\n $newImage = imagecreatetruecolor($width, $height);\n imagealphablending($newImage, false);\n imagesavealpha($newImage, true);\n imagecopyresampled($newImage, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $newImage;\n }", "function resizeImage($width, $height, $quality = 8, $ratio = false){\n\t\tif(!is_numeric($quality)){\n\t\t\treturn false;\n\t\t}\n\t\t$quality = ($quality > 10 ? 10 : max($quality, 0)) * 10;\n\t\t$dataPath = TEMP_PATH . we_base_file::getUniqueId();\n\t\t$_resized_image = we_base_imageEdit::edit_image($this->getElement('data'), $this->getGDType(), $dataPath, $quality, $width, $height, $ratio);\n\t\tif(!$_resized_image[0]){\n\t\t\treturn false;\n\t\t}\n\t\t$this->setElement('data', $dataPath);\n\n\t\t$this->setElement('width', $_resized_image[1], 'attrib');\n\t\t$this->setElement('origwidth', $_resized_image[1], 'attrib');\n\n\t\t$this->setElement('height', $_resized_image[2], 'attrib');\n\t\t$this->setElement('origheight', $_resized_image[2], 'attrib');\n\n\t\t$this->DocChanged = true;\n\t\treturn true;\n\t}", "public function resize($width = NULL, $height = NULL, $master = NULL)\n {\n if ($master === NULL)\n {\n // Choose the master dimension automatically\n $master = Image::AUTO;\n }\n // Image::WIDTH and Image::HEIGHT depricated. You can use it in old projects,\n // but in new you must pass empty value for non-master dimension\n elseif ($master == Image::WIDTH AND ! empty($width))\n {\n $master = Image::AUTO;\n\n // Set empty height for backvard compatibility\n $height = NULL;\n }\n elseif ($master == Image::HEIGHT AND ! empty($height))\n {\n $master = Image::AUTO;\n\n // Set empty width for backvard compatibility\n $width = NULL;\n }\n\n if (empty($width))\n {\n if ($master === Image::NONE)\n {\n // Use the current width\n $width = $this->width;\n }\n else\n {\n // If width not set, master will be height\n $master = Image::HEIGHT;\n }\n }\n\n if (empty($height))\n {\n if ($master === Image::NONE)\n {\n // Use the current height\n $height = $this->height;\n }\n else\n {\n // If height not set, master will be width\n $master = Image::WIDTH;\n }\n }\n\n switch ($master)\n {\n case Image::AUTO:\n // Choose direction with the greatest reduction ratio\n $master = ($this->width / $width) > ($this->height / $height) ? Image::WIDTH : Image::HEIGHT;\n break;\n case Image::INVERSE:\n // Choose direction with the minimum reduction ratio\n $master = ($this->width / $width) > ($this->height / $height) ? Image::HEIGHT : Image::WIDTH;\n break;\n }\n\n switch ($master)\n {\n case Image::WIDTH:\n // Recalculate the height based on the width proportions\n $height = $this->height * $width / $this->width;\n break;\n case Image::HEIGHT:\n // Recalculate the width based on the height proportions\n $width = $this->width * $height / $this->height;\n break;\n }\n\n // Convert the width and height to integers\n $width = round($width);\n $height = round($height);\n\n $this->_do_resize($width, $height);\n\n return $this;\n }", "public static function setSize($path,$target_width=150,$target_height=100) {\n\t\t$img = imagecreatefromjpeg($path);\n\t\tif (!$img) {\n\t\t\techo \"ERROR:could not create image handle \".$path;\n\t\t\texit(0);\n\t\t}\n\t\t$width = imageSX($img);\n\t\t$height = imageSY($img);\n\t\t$size = getimagesize($path);\n\t\tif (!$width || !$height) {\n\t\t\techo \"ERROR:Invalid width or height\";\n\t\t\texit(0);\n\t\t}\n\t\tif ($width > $target_width) {\n\t\t\t$width_ratio = $target_width/$width;\n\t\t}\n\t\telse {\n\t\t\t$width_ratio = 1;\t\n\t\t}\n\t\tif ($height > $target_height) {\n\t\t\t$height_ratio = $target_height/$height;\n\t\t}\n\t\telse {\n\t\t\t$height_ratio = 1;\t\n\t\t}\n\t\tif ($width_ratio==1 && $height_ratio==1) return $img;\n\t\t$ratio = min($width_ratio,$height_ratio);\n\t\t$new_height = $ratio * $height;\n\t\t$new_width = $ratio * $width;\n\t\t//file_put_contents(\"1.log\",\"$new_height = $ratio m $height; $new_width = $ratio m $width;\\n\",FILE_APPEND);\n\t\t$new_img = ImageCreateTrueColor($new_width, $new_height);\n\t\tif (!@imagecopyresampled($new_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height)) {\n\t\t\techo \"ERROR:Could not resize image\";\n\t\t\texit(0);\n\t\t}\t\t\n\t\treturn $new_img;\n\t}", "function imageresize($im, $width, $height) {\n list($w, $h) = [imagesx($im), imagesy($im)];\n $res = newTransparentImage($w + $width, $h + $height);\n imagecopy($res, $im, 0, 0, 0, 0, $w, $h);\n imagedestroy($im);\n return $res;\n}", "function resizetoheight($iNewHeight)\n\t{\n\t\t$iNewWidth = ($iNewHeight / $this->height) * $this->width;\n\n\t\t$this->resize($iNewWidth, $iNewHeight);\n\t}", "public function runFillMaxResize(Image $image, $width, $height) : Image\n {\n\t\treturn $this->runContainResize($image, $width, $height)->resizeCanvas($width, $height, 'center');\n }", "public function imageResize($file, $path, $filename, $width, $height)\n\t{\n\n\t\t$img = Image::make($file);\n\t\t$img->resize($width, $height, function ($constraint) {\n $constraint->aspectRatio();\n });\n\n\t\t// if ($request->has('optimize')) {\n\t\t\t// ImageOptimizer::optimize($path);\n\t\t// }\n $img->resizeCanvas($width, $height, 'center', false, array(255, 255, 255, 0));\n\t\t$img->save($path);\n\t\t//dd($path);\n\t\tImageOptimizer::optimize($path);\n\t}", "function imageResize($width, $height, $target){\n //formula accordingly...this is so this script will work\n //dynamically with any size image\n\n if ($width > $height) {\n $percentage = ($target / $width);\n } else {\n $percentage = ($target / $height);\n }\n\n //gets the new value and applies the percentage, then rounds the value\n $width = round($width * $percentage);\n $height = round($height * $percentage);\n\n //returns the new sizes in html image tag format...this is so you\n //\tcan plug this function inside an image tag and just get the\n\n return \"width=\".$width.\" height=\".$height.\"\";\n\n }", "public function resizeRatio($width, $height, $useAsMinimum = false)\n {\n return $this->createCloneWithResource(\n function (InterventionImage $resource) use ($width, $height, $useAsMinimum) {\n return $resource->resize(\n $width,\n $height,\n function (Constraint $constraint) use ($useAsMinimum) {\n $constraint->aspectRatio();\n if (!$useAsMinimum) {\n $constraint->upsize();\n }\n }\n );\n }\n );\n }", "public function resize($width, $height, $crop_top = 0, $crop_bottom = 0, $crop_left = 0, $crop_right = 0) {}", "protected function resize()\n {\n $width = $this->width;\n $height = $this->height;\n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n // Determine new image dimensions\n if($this->mode === \"crop\"){ // Crop image\n \n $max_width = $crop_width = $width;\n $max_height = $crop_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if($orig_width > $orig_height){ // Original is wide\n $height = $max_height;\n $width = ceil($y_ratio * $orig_width);\n \n } elseif($orig_height > $orig_width){ // Original is tall\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n \n } else { // Original is square\n $this->mode = \"fit\";\n \n return $this->resize();\n }\n \n // Adjust if the crop width is less than the requested width to avoid black lines\n if($width < $crop_width){\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n }\n \n } elseif($this->mode === \"fit\"){ // Fits the image according to aspect ratio to within max height and width\n $max_width = $width;\n $max_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if( ($orig_width <= $max_width) && ($orig_height <= $max_height) ){ // Image is smaller than max height and width so don't resize\n $tn_width = $orig_width;\n $tn_height = $orig_height;\n \n } elseif(($x_ratio * $orig_height) < $max_height){ // Wider rather than taller\n $tn_height = ceil($x_ratio * $orig_height);\n $tn_width = $max_width;\n \n } else { // Taller rather than wider\n $tn_width = ceil($y_ratio * $orig_width);\n $tn_height = $max_height;\n }\n \n $width = $tn_width;\n $height = $tn_height;\n \n } elseif($this->mode === \"fit-x\"){ // Sets the width to the max width and the height according to aspect ratio (will stretch if too small)\n $height = @round($orig_height * $width / $orig_width);\n \n if($orig_height <= $height){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n \n } elseif($this->mode === \"fit-y\"){ // Sets the height to the max height and the width according to aspect ratio (will stretch if too small)\n $width = @round($orig_width * $height / $orig_height);\n \n if($orig_width <= $width){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n } else {\n throw new \\Exception('Invalid mode: ' . $this->mode);\n }\n \n\n // Resize\n $this->temp = imagecreatetruecolor($width, $height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n \n imagecopyresampled($this->temp, $this->image, 0, 0, 0, 0, $width, $height, $orig_width, $orig_height);\n $this->sync();\n \n \n // Cropping?\n if($this->mode === \"crop\"){ \n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n $x_mid = $orig_width/2; // horizontal middle\n $y_mid = $orig_height/2; // vertical middle\n \n $this->temp = imagecreatetruecolor($crop_width, $crop_height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n\n imagecopyresampled($this->temp, $this->image, 0, 0, ($x_mid-($crop_width/2)), ($y_mid-($crop_height/2)), $crop_width, $crop_height, $crop_width, $crop_height);\n $this->sync();\n }\n }", "public function setOriginalImageWidthHeight() {\n \n $checkError = $this->isError();\n if (!$checkError) {\n \n /*\n * get original width and height\n */\n $this->__originalImageWidth = imagesx($this->__image);\n $this->__originalImageHeight = imagesy($this->__image);\n \n }\n \n }", "public function croppedResize($width, $height)\n {\n return $this->createCloneWithResource(\n function (InterventionImage $resource) use ($width, $height) {\n return $resource->fit($width, $height);\n }\n );\n }", "public function resize_height ($newHeight, $newWidth = null, $keepRatio = true)\n\t{\n\t\t$this->intern_resize_height($newHeight, $newWidth, $keepRatio);\n\t}", "function imgResize($filename, $newWidth, $newHeight, $dir_out){\n\t\n\t// изменение размера изображения\n\n\t// 1 создадим новое изображение из файла\n\t$scr = imagecreatefromjpeg($filename); // или $imagePath\n\t\n\t// 2 создадим новое полноцветное изображение нужного размера\n\t$newImg = imagecreatetruecolor($newWidth, $newHeight);\n\n\t// 3 определим размер исходного изображения для 4 пункта\n\t$size = getimagesize($filename);\n\n\t// 4 копирует прямоугольную часть одного изображения на другое изображение, интерполируя значения пикселов таким образом, чтобы уменьшение размера изображения не уменьшало его чёткости\n\timagecopyresampled($newImg, $scr, 0, 0, 0, 0, $newWidth, $newHeight, $size[0], $size[1]);\n\n\t// 5 запишем изображение в файл по нужному пути\n\timagejpeg($newImg, $dir_out);\n\n\timagedestroy($scr);\n\timagedestroy($newImg);\t\t\n\t\n}", "protected function _do_resize($width, $height)\n {\n $pre_width = $this->width;\n $pre_height = $this->height;\n\n // Loads image if not yet loaded\n $this->_load_image();\n\n // Test if we can do a resize without resampling to speed up the final resize\n if ($width > ($this->width / 2) AND $height > ($this->height / 2))\n {\n // The maximum reduction is 10% greater than the final size\n $reduction_width = round($width * 1.1);\n $reduction_height = round($height * 1.1);\n\n while ($pre_width / 2 > $reduction_width AND $pre_height / 2 > $reduction_height)\n {\n // Reduce the size using an O(2n) algorithm, until it reaches the maximum reduction\n $pre_width /= 2;\n $pre_height /= 2;\n }\n\n // Create the temporary image to copy to\n $image = $this->_create($pre_width, $pre_height);\n\n if (imagecopyresized($image, $this->_image, 0, 0, 0, 0, $pre_width, $pre_height, $this->width, $this->height))\n {\n // Swap the new image for the old one\n imagedestroy($this->_image);\n $this->_image = $image;\n }\n }\n\n // Create the temporary image to copy to\n $image = $this->_create($width, $height);\n\n // Execute the resize\n if (imagecopyresampled($image, $this->_image, 0, 0, 0, 0, $width, $height, $pre_width, $pre_height))\n {\n // Swap the new image for the old one\n imagedestroy($this->_image);\n $this->_image = $image;\n\n // Reset the width and height\n $this->width = imagesx($image);\n $this->height = imagesy($image);\n }\n }", "public function resize($width, $height, $aspect = true)\n {\n $imgW = $this->width;\n $imgH = $this->height;\n\n // Keep aspect\n if( $aspect )\n {\n list($width, $height) = self::_fitImage($imgW, $imgH, $width, $height);\n }\n\n // Create new temporary image\n self::_isSafeToOpen($width, $height);\n $dst = imagecreatetruecolor($width, $height);\n\n // Try to preserve transparency\n //self::_allocateTransparency($this->_resource, $dst, $this->_info->type);\n\n // Resize\n if( !imagecopyresampled($dst, $this->_resource, 0, 0, 0, 0, $width, $height, $imgW, $imgH) )\n {\n imagedestroy($dst);\n throw new Engine_Image_Adapter_Exception('Unable to resize image');\n }\n\n // Now destroy old image and overwrite with new\n imagedestroy($this->_resource);\n $this->_resource = $dst;\n $this->_info->width = $width;\n $this->_info->height = $height;\n \n return $this;\n }", "public function getResizedImage($h=150, $w=150)\n {\n $ret = $this->img->getResizedImage($this->rootPath.$this->storeDir.$this->imageDir, \"_thumbs\", $this->image_file, $this->id, $h, $w );\n $this->resizeH = $this->img->resizeH;\n $this->resizeW = $this->img->resizeW;\n return $ret;\n }", "function getImageResize($image, $width, $height = 0, $adds)\r\n {\r\n $imageinfo = getimagesize($image);\r\n if (!$imageinfo[0] and !$imageinfo[1]) {\r\n // TO DO***** copy file to server, get size, than delete...\r\n }\r\n $out['w'] = $imageinfo[0];\r\n $out['h'] = $imageinfo[1]; \r\n if ($height == 0) {\r\n $input_ratio = $imageinfo[0] / $imageinfo[1];\r\n $height = $width / $input_ratio;\r\n if ($imageinfo[0] < $width) {\r\n $width = $imageinfo[0];\r\n $height = $imageinfo[1];\r\n }\r\n }\r\n else {\r\n $input_ratio = $imageinfo[0] / $imageinfo[1];\r\n $ratio = $width / $height;\r\n if ($ratio < $input_ratio) {\r\n $height = $width / $input_ratio;\r\n }\r\n else {\r\n $width = $height * $input_ratio;\r\n }\r\n if (($imageinfo[0] < $width) && ($imageinfo[1] < $height)) {\r\n $width = $imageinfo[0];\r\n $height = $imageinfo[1];\r\n }\r\n }\r\n $attr = ' height=\"' . floor($height) . '\" width=\"' . floor($width) . '\"';\r\n return $this->imageHtmlCode($image, $adds, $attr);\r\n }", "public function setOptimalImageWidthHeight() {\n \n $checkError = $this->isError();\n if (!$checkError) {\n \n if (empty($this->__requestedHeight) || empty($this->__requestedWidth)) {\n $this->setError(__d('cloggy','Empty requested width and height.'));\n } else {\n\n /*\n * get optimal size width and height\n */\n switch ($this->__option) {\n\n case 'exact':\n $this->__optimalWidth = $this->__requestedWidth;\n $this->__optimalHeight = $this->__requestedHeight;\n break;\n\n case 'portrait':\n $this->__setOptimalSizeByPortrait();\n break;\n\n case 'landscape':\n $this->__setOptimalSizeByLandscape();\n break;\n\n case 'crop':\n $this->__setOptimalSizeByCrop();\n break;\n\n default:\n $this->__setOptimalSizeByAuto();\n break;\n }\n }\n \n }\n \n }", "function resize_fit_or_smaller($width, $height) {\n\n\t\t$w = $this->getWidth();\n\t\t$h = $this->getHeight();\n\n\t\t$ratio = $width / $w;\n\t\tif (($h*$ratio)>$height)\n\t\t\t$ratio = $height / $h;\n\t\t\n\t\t$h *= $ratio;\n\t\t$w *= $ratio;\n\n\t\t$this->resize($w, $h);\n\t}", "public function get_image_height()\n {\n }", "public function resize($file, $size, $height, $name, $path)\n {\n\n if (!is_dir($path . '/'))\n if (!mkdir($path, 0777)) ;\n\n $array = explode('.', $name);\n $ext = strtolower(end($array));\n\n switch (strtolower($ext)) {\n\n case \"gif\":\n $out = imagecreatefromgif($file);\n break;\n\n case \"jpg\":\n $out = imagecreatefromjpeg($file);\n break;\n\n case \"jpeg\":\n $out = imagecreatefromjpeg($file);\n break;\n\n case \"png\":\n $out = imagecreatefrompng($file);\n break;\n }\n\n $src_w = imagesx($out);\n $src_h = imagesy($out);\n\n if ($src_w > $size || $src_h > $height) {\n\n if ($src_w > $size) {\n\n $dst_w = $size;\n $dst_h = floor($src_h / ($src_w / $size));\n\n\n $img_out = imagecreatetruecolor($dst_w, $dst_h);\n imagecopyresampled($img_out, $out, 0, 0, 0, 0, $dst_w, $dst_h, $src_w, $src_h);\n\n switch (strtolower($ext)) {\n case \"gif\":\n imagegif($img_out, $path . $name);\n break;\n case \"jpg\":\n imagejpeg($img_out, $path . $name, 100);\n break;\n case \"jpeg\":\n imagejpeg($img_out, $path . $name, 100);\n break;\n case \"png\":\n imagepng($img_out, $path . $name);\n break;\n }\n\n } else if ($src_h > $height) {\n\n $dst_h = $height;\n $dst_w = floor($src_w / ($src_h / $height));\n\n if ($dst_w > $size) {\n\n $dst_w = $size;\n $dst_h = floor($src_h / ($src_w / $size));\n\n }\n\n\n $img_out = imagecreatetruecolor($dst_w, $dst_h);\n imagecopyresampled($img_out, $out, 0, 0, 0, 0, $dst_w, $dst_h, $src_w, $src_h);\n\n switch (strtolower($ext)) {\n case \"gif\":\n imagegif($img_out, $path . $name);\n break;\n case \"jpg\":\n imagejpeg($img_out, $path . $name, 100);\n break;\n case \"jpeg\":\n imagejpeg($img_out, $path . $name, 100);\n break;\n case \"png\":\n imagepng($img_out, $path . $name);\n break;\n }\n\n }\n\n $array = explode('.', $name);\n $ext = strtolower(end($array));\n\n switch (strtolower($ext)) {\n\n case \"gif\":\n $out = imagecreatefromgif($path . $name);\n break;\n\n case \"jpg\":\n $out = imagecreatefromjpeg($path . $name);\n break;\n\n case \"jpeg\":\n $out = imagecreatefromjpeg($path . $name);\n break;\n\n case \"png\":\n $out = imagecreatefrompng($path . $name);\n break;\n }\n\n $src_w = imagesx($out);\n $src_h = imagesy($out);\n\n if ($src_h > $height) {\n\n $dst_h = $height;\n $dst_w = floor($src_w / ($src_h / $height));\n\n if ($dst_w > $size) {\n\n $dst_w = $size;\n $dst_h = floor($src_h / ($src_w / $size));\n\n }\n\n $img_out = imagecreatetruecolor($dst_w, $dst_h);\n imagecopyresampled($img_out, $out, 0, 0, 0, 0, $dst_w, $dst_h, $src_w, $src_h);\n\n switch (strtolower($ext)) {\n case \"gif\":\n imagegif($img_out, $path . $name);\n break;\n case \"jpg\":\n imagejpeg($img_out, $path . $name, 100);\n break;\n case \"jpeg\":\n imagejpeg($img_out, $path . $name, 100);\n break;\n case \"png\":\n imagepng($img_out, $path . $name);\n break;\n }\n\n }\n\n } else {\n\n copy($file, $path . $name);\n\n }\n\n\n }", "public function resizeTo($width, $height)\n {\n if ( ! $this->validateDimension($width, $height)) {\n return false;\n }\n\n try {\n $this->imagick->thumbnailImage($width, $height, true);\n } catch (Exception $e) {\n $this->errorMessage = sprintf('Failed to resize the image to \"%s\" x \"%s\". Error message is \"%s\"',\n $width,\n $height,\n $e->getMessage()\n );\n\n return false;\n }\n\n return true;\n }", "public function resizeImage($product, $imageId, $width, $height = null)\n {\n $resizedImage = $this->_productImageHelper\n ->init($product, $imageId)\n ->constrainOnly(TRUE)\n ->keepAspectRatio(TRUE)\n ->keepTransparency(TRUE)\n ->keepFrame(FALSE)\n ->resize($width, $height);\n return $resizedImage;\n }", "protected function calcImageSizeStrict($width, $height)\n {\n // first, we need to determine what the longest resize dimension is..\n if ($this->maxWidth >= $this->maxHeight) {\n // and determine the longest original dimension\n if ($width > $height) {\n $newDimensions = $this->calcHeight($width, $height);\n\n if ($newDimensions['width'] < $this->maxWidth) {\n $newDimensions = $this->calcWidth($width, $height);\n }\n }\n elseif ($height >= $width) {\n $newDimensions = $this->calcWidth($width, $height);\n\n if ($newDimensions['height'] < $this->maxHeight) {\n $newDimensions = $this->calcHeight($width, $height);\n }\n }\n }\n elseif ($this->maxHeight > $this->maxWidth) {\n if ($width >= $height) {\n $newDimensions = $this->calcWidth($width, $height);\n\n if ($newDimensions['height'] < $this->maxHeight) {\n $newDimensions = $this->calcHeight($width, $height);\n }\n }\n elseif ($height > $width) {\n $newDimensions = $this->calcHeight($width, $height);\n\n if ($newDimensions['width'] < $this->maxWidth) {\n $newDimensions = $this->calcWidth($width, $height);\n }\n }\n }\n\n if (isset($newDimensions)) {\n $this->newDimensions = $newDimensions;\n }\n }", "public function setDimensions($width, $height) {}", "function imageResize($width, $height, $target) {\t\n\tif ($width > $height) { \n\t\t$percentage = ($target / $width); \n\t} else { \n\t\t$percentage = ($target / $height); \n\t} \n\n\t//gets the new value and applies the percentage, then rounds the value \n\t$width = round($width * $percentage); \n\t$height = round($height * $percentage); \n\n\t//returns the new sizes in html image tag format...this is so you \n\t//can plug this function inside an image tag and just get the \n\treturn \"width=\\\"$width\\\" height=\\\"$height\\\"\"; \n\t}", "public function resizeImage($width, $height, $filter = null, $blur = null)\n {\n if (null === $filter) {\n $filter = $this->imageFilter;\n }\n if (null === $blur) {\n $blur = $this->imageBlur;\n }\n if ($this->resource->getNumberImages() > 0) {\n $frames = $this->resource->coalesceImages();\n foreach ($frames as $frame) {\n $frame->resizeImage($width, $height, $filter, $blur);\n }\n $this->resource = $frames->deconstructImages();\n } else {\n $this->resource->resizeImage($width, $height, $filter, $blur);\n }\n\n return $this;\n }", "function resize_image($src, $width, $height){\n // initializing\n $save_path = Wordless::theme_temp_path();\n $img_filename = Wordless::join_paths($save_path, md5($width . 'x' . $height . '_' . basename($src)) . '.jpg');\n\n // if file doesn't exists, create it\n if (!file_exists($img_filename)) {\n $to_scale = 0;\n $to_crop = 0;\n\n // Get orig dimensions\n list ($width_orig, $height_orig, $type_orig) = getimagesize($src);\n\n // get original image ... to improve!\n switch($type_orig){\n case IMAGETYPE_JPEG: $image = imagecreatefromjpeg($src);\n break;\n case IMAGETYPE_PNG: $image = imagecreatefrompng($src);\n break;\n case IMAGETYPE_GIF: $image = imagecreatefromgif($src);\n break;\n default:\n return;\n }\n\n // which is the new smallest?\n if ($width < $height)\n $min_dim = $width;\n else\n $min_dim = $height;\n\n // which is the orig smallest?\n if ($width_orig < $height_orig)\n $min_orig = $width_orig;\n else\n $min_orig = $height_orig;\n\n // image of the right size\n if ($height_orig == $height && $width_orig == $width) ; // nothing to do\n // if something smaller => scale\n else if ($width_orig < $width) {\n $to_scale = 1;\n $ratio = $width / $width_orig;\n }\n else if ($height_orig < $height) {\n $to_scale = 1;\n $ratio = $height / $height_orig;\n }\n // if both bigger => scale\n else if ($height_orig > $height && $width_orig > $width) {\n $to_scale = 1;\n $ratio_dest = $width / $height;\n $ratio_orig = $width_orig / $height_orig;\n if ($ratio_dest > $ratio_orig)\n $ratio = $width / $width_orig;\n else\n $ratio = $height / $height_orig;\n }\n // one equal one bigger\n else if ( ($width == $width_orig && $height_orig > $height) || ($height == $height_orig && $width_orig > $width) )\n $to_crop = 1;\n // some problem...\n else\n echo \"ALARM\";\n\n // we need to zoom to get the right size\n if ($to_scale == 1) {\n $new_width = $width_orig * $ratio;\n $new_height = $height_orig * $ratio;\n $image_scaled = imagecreatetruecolor($new_width, $new_height);\n // scaling!\n imagecopyresampled($image_scaled, $image, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);\n $image = $image_scaled;\n\n if($new_width > $width || $new_height > $height)\n $to_crop = 1;\n }\n else {\n $new_width = $width_orig;\n $new_height = $height_orig;\n }\n\n // we need to crop the image\n if ($to_crop == 1) {\n $image_cropped = imagecreatetruecolor($width, $height);\n\n // find margins for images\n $margin_x = ($new_width - $width) / 2;\n $margin_y = ($new_height - $height) / 2;\n\n // cropping!\n imagecopy($image_cropped, $image, 0, 0, $margin_x, $margin_y, $width, $height);\n $image = $image_cropped;\n }\n\n // Save image\n imagejpeg($image, $img_filename, 95);\n }\n\n // Return image URL\n return Wordless::join_paths(Wordless::theme_temp_path(), basename($img_filename));\n }", "function imgResizeHeight($file_ori,$UploadPath,$Resize=1,$imgx=130,$imgy=150,$clean=0) {\n\t\t$dest_filename='';\n\t\t$handle = new upload($file_ori);\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\t\n\t\tif ($handle->uploaded) {\n\t\t\t//$handle->image_x = $imgx;\n\t\t\t$handle->image_y = $imgy;\n\t\t\t$handle->image_resize = true;\n\t\t\t$handle->image_ratio_x = true;\n\t\t}\n\t\t$handle->process($UploadPath);\n\t\tif ($handle->processed) {\n\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\tif($clean==1)\n\t\t\t\t$handle->clean();\n\t\t} else\n\t\t\t$dest_filename='';\n\t\treturn $dest_filename;\n\t}", "public function resize($newWidth, $newHeight, $option='auto')\n\t{\n\t\t// Reset\n\t\tif ($this->imageResized) {\n\t\t\timagedestroy($this->imageResized);\n\t\t}\n\t\t$this->saveState = false;\n\n\t\t// Get optimal width and height based on $option\n\t\t$optionArray = $this->getDimensions((int)$newWidth, (int)$newHeight, $option);\n\t\t$this->optimalWidth = round($optionArray['optimalWidth']);\n\t\t$this->optimalHeight = round($optionArray['optimalHeight']);\n\n\t\t// Resample - create image canvas of x, y size\n\t\t$this->imageResized = imagecreatetruecolor($this->optimalWidth, $this->optimalHeight);\n\t\tif (imagetypes() & IMG_PNG) {\n\t\t\timagesavealpha($this->imageResized, true);\n\t\t\timagealphablending($this->imageResized, false);\n\t\t}\n\t\timagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $this->optimalWidth, $this->optimalHeight, $this->width, $this->height);\n\n\t\t// If option is 'crop', then crop too\n\t\tif ($option == 'crop') {\n\t\t\t$this->cropImage($this->optimalWidth, $this->optimalHeight, $newWidth, $newHeight);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function image_fixed_resize($width, $height, $crop = true){\n $ratio = $this->width / $this->height;\n $original_ratio = $width / $height;\n\n $crop_width = $this->width;\n $crop_height = $this->height;\n\n if($ratio > $original_ratio)\n {\n $crop_width = round($original_ratio * $crop_height);\n }\n else\n {\n $crop_height = round($crop_width / $original_ratio);\n }\n if($crop)\n $this->crop($crop_width, $crop_height);\n $this->resize($width, $height);\n }", "public function resize ($image, $width, $height, $options = array (), $quality = 100) {\n\t\t$options['width'] = $width;\n\t\t$options['height'] = $height;\n\n\t\treturn $this->Html->image ($this->resizedUrl ($image, $width, $height, $quality), $options);\n\t}", "public function ResizeImageThumbnail($image_path, $height, $width,$image){\n\t $img_name_only = explode('.', $image);\n\t $img_name_only = $img_name_only[0];\n\t $image = new \\Imagick($image_path.'/'.$image);\n\t $image->thumbnailImage($width, $height);\n\t $store_image_with_new_name=$image_path.'/'.$img_name_only.'_'.$width.'X'.$height.'.jpeg';\n\t $image->writeImage($store_image_with_new_name);\n\t $image->destroy();\n\t return $img_name_only.'.jpeg';\n \t}", "function resizeImage($image,$width,$height) {\n\t$newImageWidth = $width;\n\t$newImageHeight = $height;\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t$source = imagecreatefromjpeg($image);\n\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\timagejpeg($newImage,$image,90);\n\tchmod($image, 0777);\n\treturn $image;\n}", "function getHeight() \n {\n return imagesy($this->image);\n }", "protected function update_size( $width = false, $height = false ) {\n\t\tif ( ! $width )\n\t\t\t$width = imagesx( $this->image );\n\n\t\tif ( ! $height )\n\t\t\t$height = imagesy( $this->image );\n\n\t\treturn parent::update_size( $width, $height );\n\t}", "public function resize($width = null, $height = null)\n {\n $width = isset($width) ? $width : $this->r_width;\n $height = isset($height) ? $height : $this->r_height;\n\n $src = Timber\\ImageHelper::resize($this->src, $width, $height);\n return $this->copySelf($src);\n }", "public function getImageResized()\n {\n return $this->performImageResize($this->Image());\n }", "public function ImageResize($file_resize_width, $file_resize_height){\r\n $this->proc_filewidth=$file_resize_width;\r\n $this->proc_fileheight=$file_resize_height;\r\n }", "public function resize(array $dimensions) {\n// is there an image resource to work with?\n if (isset($this->_resource)) {\n// does the dimensions array have the appropriate values to work with?\n if (isset($dimensions[\"width\"]) || isset($dimensions[\"height\"])) {\n// has the width value been omitted, while the height value given?\n if (!isset($dimensions[\"width\"]) && isset($dimensions[\"height\"])) {\n// is the height an integer?\n// -> if so, assign the height variable and assign the width variable scaled similarly to the height\n if (is_int($dimensions[\"height\"])) {\n $width = (int) floor($this->_width * ($dimensions[\"height\"] / $this->_height));\n $height = $dimensions[\"height\"];\n }\n }\n// or has the height value been omitted, and the width value given?\n else if (isset($dimensions[\"width\"]) && !isset($dimensions[\"height\"])) {\n// is the width an integer?\n// -> if so, assign the width variable and assign the height variable scaled similarly to the width\n if (is_int($dimensions[\"width\"])) {\n $width = $dimensions[\"width\"];\n $height = (int) floor($this->_height * ($dimensions[\"width\"] / $this->_width));\n }\n }\n// or both values were provided\n else {\n// are both width and height values integers?\n// -> if so, assign the width and height variables\n if (is_int($dimensions[\"width\"]) && is_int($dimensions[\"height\"])) {\n $width = $dimensions[\"width\"];\n $height = $dimensions[\"height\"];\n }\n }\n\n// have the width and height variables been assigned?\n// -> if so, proceed with cropping\n if (isset($width, $height)) {\n// generating the placeholder resource\n $resized_image = $this->newImageResource($width, $height);\n\n// copying the original image's resource into the placeholder and resizing it accordingly\n imagecopyresampled($resized_image, $this->_resource, 0, 0, 0, 0, $width, $height, $this->_width, $this->_height);\n\n// assigning the new image attributes\n $this->_resource = $resized_image;\n $this->_width = $width;\n $this->_height = $height;\n }\n } else {\n trigger_error(\"CAMEMISResizeImage::resize() was not provided the apporpriate arguments (given array must contain \\\"width\\\" and \\\"height\\\" elements)\", E_USER_WARNING);\n }\n } else {\n trigger_error(\"CAMEMISResizeImage::resize() attempting to access a non-existent resource (check if the image was loaded by Image2::__construct())\", E_USER_WARNING);\n }\n\n return $this;\n }", "public function resizeImage($image, $width = MEDIUM_IMAGE_MAX_WIDTH, $height = MEDIUM_IMAGE_MAX_HEIGHT, $subpath = IMG_SUBPATH_MEDIUM, $quality = JPEG_QUALITY) \n {\n // check if file is image\n if (!$this->isFileImage($image) ) {\n $this->throwException(FILE_IS_NOT_IMAGE, \"File is not an image\");\n }\n list($imgWidth, $imgHeight) = getimagesize($image);\n \n if ($imgWidth > $imgHeight) {\n $newWidth = $imgWidth / ($imgWidth / $width);\n $newHeight = $imgHeight / ($imgWidth / $width);\n } else {\n $newWidth = $imgWidth / ($imgHeight / $height);\n $newHeight = $imgHeight / ($imgHeight / $height);\n }\n\n $path = pathinfo($image);\n //print_r($path); // debug\n $src_img = imagecreatefromjpeg($image);\n $dest_img = imagecreatetruecolor($newWidth, $newHeight);\n imagecopyresampled($dest_img, $src_img, 0, 0, 0, 0, $newWidth, $newHeight, $imgWidth, $imgHeight);\n \n if (ADD_WATERMARK_TO_PHOTO) {\n //TODO: Add optional watermark to photo\n }\n \n imagejpeg($dest_img, IMAGE_STORAGE_PATH . $subpath . $path['filename'] . \".\" . $path['extension'], $quality);\n \n \n return IMAGE_STORAGE_PATH . $subpath . $path['filename'] . \".\" . $path['extension'];\n }", "private static function resize_image($source, $width, $height){\n\t\t$source_width = imagesx($source);\n\t\t$source_height = imagesy($source);\n\t\t$source_aspect = round($source_width / $source_height, 1);\n\t\t$target_aspect = round($width / $height, 1);\n\t\n\t\t$resized = imagecreatetruecolor($width, $height);\n\t\n\t\tif ($source_aspect < $target_aspect){\n\t\t\t// higher\n\t\t\t$new_size = array($width, ($width / $source_width) * $source_height);\n\t\t\t$source_pos = array(0, (($new_size[1] - $height) * ($source_height / $new_size[1])) / 2);\n\t\t}else if ($source_aspect > $target_aspect){\n\t\t\t// wider\n\t\t\t$new_size = array(($height / $source_height) * $source_width, $height);\n\t\t\t$source_pos = array((($new_size[0] - $width) * ($source_width / $new_size[0])) / 2, 0);\n\t\t}else{\n\t\t\t// same shape\n\t\t\t$new_size = array($width, $height);\n\t\t\t$source_pos = array(0, 0);\n\t\t}\n\t\n\t\tif ($new_size[0] < 1) $new_size[0] = 1;\n\t\tif ($new_size[1] < 1) $new_size[1] = 1;\n\t\n\t\timagecopyresampled($resized, $source, 0, 0, $source_pos[0], $source_pos[1], $new_size[0], $new_size[1], $source_width, $source_height);\n\t\n\t\treturn $resized;\n\t}", "function getHeight($image) {\n\t$sizes = getimagesize($image);\n\t$height = $sizes[1];\n\treturn $height;\n}", "function getHeight($image) {\n\t$sizes = getimagesize($image);\n\t$height = $sizes[1];\n\treturn $height;\n}", "public function getHeight($image) {\n\t\t $sizes = getimagesize($image);\n\t\t $height = $sizes[1];\n\t\t return $height;\n\t\t }", "function getHeight($image) {\n\t$size = getimagesize($image);\n\t$height = $size[1];\n\treturn $height;\n}", "public function resizeImage($width, $height, $crop = true)\n\t{\n\t\t$iWidth = $this->getWidth();\n\t\t$iHeight = $this->getHeight();\n\n\t\tif (!$width) {\n\t\t\t$width = $iWidth;\n\t\t} else {\n\t\t\t$width = $width > $iWidth ? $iWidth : $width;\n\t\t}\n\n\t\tif (!$height) {\n\t\t\t$height = $iHeight;\n\t\t} else {\n\t\t\t$height = $height > $iHeight ? $iHeight : $height;\n\t\t}\n\n\t\tif ($crop) {\n\t\t\t$this->image->thumbnail($width, $height, 'center');\n\t\t} else {\n\t\t\t$this->image->resize($width, $height);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function getHeight() {\n return imagesy($this->image);\n }", "function getHeight($image) {\r\n\t\t\t$size = getimagesize($image);\r\n\t\t\t$height = $size[1];\r\n\t\t\treturn $height;\r\n\t\t}", "function getHeight() {\r\n\t\treturn imagesy($this->image);\r\n\t}", "public function getHeight()\n\t{\n\t\treturn $this->image->getHeight();\n\t}", "public function resize_image($width, $height)\n\t{\n $image_size = $this->image_size();\n if ($image_size[0] == $width && $image_size[1] == $height) {\n // Already correct size,\n return;\n }\n if (!$image_size[0]) {\n \tabort(500, \"Unable to load remote image\");\n }\n\n // Create a new image for the resized image\n $newimage = imagecreatetruecolor($width, $height);\n $oldimage = $this->load_image();\n imagecopyresampled($newimage, $oldimage, 0, 0, 0, 0, $width, $height, $image_size[0], $image_size[1]);\n\n $filename = $this->new_local_file_name();\n if (preg_match('/jpeg/', $image_size['mime'])) {\n imagejpeg($newimage, $filename, 100);\n } elseif (preg_match('/gif/', $image_size['mime'])) {\n imagegif($newimage, $filename);\n } elseif (preg_match('/png/', $image_size['mime'])) {\n imagepng($newimage, $filename);\n }\n $this->delete_local_file();\n $this->local_file = $filename;\n\t}", "public function imageBannerResize($file, $path, $filename, $width, $height)\n\t{\n\n\t\t$img = Image::make($file);\n\t\t$img->resize($width, $height, function ($constraint) {\n $constraint->aspectRatio();\n });\n\n $img->resizeCanvas($width, $height, 'center', false, array(255, 255, 255, 0));\n\t\t$img->save($path);\n\t\tImageOptimizer::optimize($path);\n\t}", "public function getHeight()\n {\n return imagesy($this->image);\n }", "public static function resize($image, $width, $height, $keepAspectRatio = true, $allowUpscaling = false)\n {\n $img = self::ensureImageInterfaceInstance($image)->copy();\n\n /** @var BoxInterface $sourceBox */\n $sourceBox = $img->getSize();\n $destinationBox = static::getBox($sourceBox, $width, $height, $keepAspectRatio);\n\n if ($allowUpscaling === false && self::isUpscaling($sourceBox, $destinationBox)) {\n return $img;\n }\n\n return $img->resize($destinationBox);\n }", "function getHeight($image) {\n\t\t\t\t$size = getimagesize($image);\n\t\t\t\t$height = $size[1];\n\t\t\t\treturn $height;\n\t\t\t}", "public function resize($width, $height) {\n if ($width && $height) $this->thumb->resize($width, $height);\n else if (!$width) $this->thumb->resize(99999, $height);\n else if (!$height) $this->thumb->resize($width, 99999);\n return $this;\n }", "function getHeight($image) {\r\n\t\t$size = getimagesize($image);\r\n\t\t$height = $size[1];\r\n\t\treturn $height;\r\n\t}" ]
[ "0.74732393", "0.7271189", "0.71495664", "0.7078089", "0.7023826", "0.70215297", "0.6987465", "0.6900425", "0.68663824", "0.6851944", "0.66551864", "0.66511315", "0.6648589", "0.6626812", "0.65997976", "0.6573563", "0.6556508", "0.65451425", "0.6469766", "0.6456662", "0.64444447", "0.64244366", "0.6411528", "0.6400609", "0.63575476", "0.6352412", "0.63369256", "0.6330124", "0.6328244", "0.631983", "0.62869346", "0.6284214", "0.6284214", "0.62742454", "0.6265696", "0.62548476", "0.6232232", "0.62188053", "0.61980027", "0.6185833", "0.6156528", "0.61267436", "0.6120349", "0.6112523", "0.6103387", "0.6102058", "0.6094147", "0.6086714", "0.6071125", "0.60647464", "0.6035561", "0.6034862", "0.60334206", "0.6032821", "0.60298103", "0.6029", "0.6011983", "0.6002163", "0.59882903", "0.59855545", "0.5966725", "0.5963093", "0.5957252", "0.5955338", "0.59500474", "0.5947106", "0.594078", "0.5937597", "0.5937567", "0.5937403", "0.5932621", "0.5922348", "0.5920125", "0.5903299", "0.5892205", "0.5889867", "0.5885252", "0.5882647", "0.58795756", "0.58735186", "0.58733875", "0.58730453", "0.58720607", "0.58705384", "0.5860147", "0.5860147", "0.5846758", "0.58419144", "0.5822144", "0.5815016", "0.58101344", "0.57967794", "0.5786074", "0.57778466", "0.5777742", "0.57747746", "0.57729983", "0.576804", "0.5765392", "0.5763495" ]
0.7065418
4
Return a clone of this image resized, with space filled in with the given colour
public function paddedResize($width, $height, $backgroundColor = "FFFFFF", $transparencyPercent = 0) { $resource = $this->getImageResource(); if (!$resource) { return null; } // caclulate the background colour $background = $resource->getDriver()->parseColor($backgroundColor)->format('array'); // convert transparancy % to alpha $background[3] = 1 - round(min(100, max(0, $transparencyPercent)) / 100, 2); // resize the image maintaining the aspect ratio and then pad out the canvas return $this->createCloneWithResource( function (InterventionImage $resource) use ($width, $height, $background) { return $resource ->resize( $width, $height, function (Constraint $constraint) { $constraint->aspectRatio(); } ) ->resizeCanvas( $width, $height, 'center', false, $background ); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function palettizeImage($newImage, $w, $h, $palette) {\n\n $pImage = imagecreate($w, $h);\n imagesavealpha($pImage, true);\n imagealphablending($pImage, false);\n\n // Convert histogram colors to palette\n foreach ($palette as $c) {\n list($r, $g, $b, $a) = explode(',', $c);\n imagecolorallocatealpha($pImage, $r, $g, $b, $a);\n }\n\n $empty = imagecolorclosestalpha($pImage, 0,0,0, 127);\n for ($x = 0; $x < $w; $x++) {\n for ($y = 0; $y < $h; $y++) {\n list($a, $r, $g, $b) = $this->readPixel($newImage, $x, $y);\n if ($a > 120) {\n $color = $empty;\n } else {\n $color = imagecolorclosestalpha($pImage, $r, $g, $b, $a);\n }\n imagesetpixel($pImage, $x, $y, $color);\n }\n }\n\n return $pImage;\n }", "function resize_square($size){\n\n //container for new image\n $new_image = imagecreatetruecolor($size, $size);\n\n\n if($this->width > $this->height){\n $this->resize_by_height($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, ($this->get_width() - $size) / 2, 0, $size, $size);\n }else{\n $this->resize_by_width($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, 0, ($this->get_height() - $size) / 2, $size, $size);\n }\n\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $size;\n $this->height = $size;\n\n return true;\n }", "public static function fromNew($width, $height, $color = 'transparent') {\n\t\t$image = imagecreatetruecolor($width, $height);\n\n\t\t// Use PNG for dynamically created images because it's lossless and supports transparency\n\t\t$mimeType = 'image/png';\n\n\t\t$color = ImageColorPalette::allocateColor($image, $color);\n\t\t// Fill the image with color\n\t\timagesetthickness($image, 1);\n \timagefilledrectangle($image, 0, 0, $width, $height, $color);\n\t imagefill($image, 0, 0, $color);\n\n\t\treturn array('image'=>$image, 'mimeType'=>$mimeType,'exif'=>null);\n\t}", "private function create_blank_image() {\r\n\t\t$image = imagecreatetruecolor( $this->diameter,$this->diameter );\r\n\r\n\t\t/* we also need a transparent background ... */\r\n\t\timagesavealpha($image, true);\r\n\r\n\t\t/* create a transparent color ... */\r\n\t\t$color = imagecolorallocatealpha($image, 0, 0, 0, 127);\r\n\r\n\t\t/* ... then fill the image with it ... */\r\n\t\timagefill($image, 0, 0, $color);\r\n\r\n\t\t/* nothing to do then ... just save the new image ... */\r\n\t\t$this->cutted_image = $image;\r\n\r\n\t\t/* go back and see what should we do next ..? */\r\n\t\treturn;\r\n\r\n\t}", "function resize( $width, $height ) {\n $new_image = imagecreatetruecolor( $width, $height );\n if ( $this->mimetype == 'image/gif' || $this->mimetype == 'image/png' ) {\n $current_transparent = imagecolortransparent( $this->image );\n if ( $current_transparent != -1 ) {\n $transparent_color = imagecolorsforindex( $this->image, $current_transparent );\n $current_transparent = imagecolorallocate( $new_image, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue'] );\n imagefill( $new_image, 0, 0, $current_transparent );\n imagecolortransparent( $new_image, $current_transparent );\n } elseif ( $this->mimetype == 'image/png' ) {\n imagealphablending( $new_image, false );\n $color = imagecolorallocatealpha( $new_image, 0, 0, 0, 127 );\n imagefill( $new_image, 0, 0, $color );\n imagesavealpha( $new_image, true );\n }\n }\n imagecopyresampled( $new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->width, $this->height );\n $this->image = $new_image;\n return $this;\n }", "public function colorImage() {}", "function produce_colorpicker() {\n\n $width = 384;\n $height = 128;\n $factor = 4;\n $colour = array(255, 0, 0);\n\n $matrices = array();//R, G, B\n $matrices[] = array( 0, 1, 0);\n $matrices[] = array( -1, 0, 0);\n $matrices[] = array( 0, 0, 1);\n $matrices[] = array( 0, -1, 0);\n $matrices[] = array( 1, 0, 0);\n $matrices[] = array( 0, 0, -1);\n \n $matrixcount = count($matrices);\n $limit = ceil($width/$matrixcount);\n $heightbreak = floor($height/2);\n\n header(\"Content-type: image/png\");\n $image = imagecreatetruecolor($width, $height);\n imagecolorallocate($image, 0, 0, 0);\n\n for ($x = 0; $x < $width; $x++) {\n\n $divisor = floor($x / $limit);\n $matrix = $matrices[$divisor];\n\n \n $colour[0] += $matrix[0]*$factor;\n $colour[1] += $matrix[1]*$factor;\n $colour[2] += $matrix[2]*$factor;\n\n for ($y=0;$y<$height;$y++) {\n $pixel = $colour;\n\n if ($y < $heightbreak) {\n $pixel[0] += ((255-$pixel[0])/$heightbreak)*($heightbreak-$y);\n $pixel[1] += ((255-$pixel[1])/$heightbreak)*($heightbreak-$y);\n $pixel[2] += ((255-$pixel[2])/$heightbreak)*($heightbreak-$y);\n } else if ($y > $heightbreak) {\n $pixel[0] = ($height-$y)*($pixel[0]/$heightbreak);\n $pixel[1] = ($height-$y)*($pixel[1]/$heightbreak);\n $pixel[2] = ($height-$y)*($pixel[2]/$heightbreak);\n }\n\n if ($pixel[0] < 0) $pixel[0] = 0;\n else if ($pixel[0] > 255) $pixel[0] = 255;\n if ($pixel[1] < 0) $pixel[1] = 0;\n else if ($pixel[1] > 255) $pixel[1] = 255;\n if ($pixel[2] < 0) $pixel[2] = 0;\n else if ($pixel[2] > 255) $pixel[2] = 255;\n\n imagesetpixel($image, $x, $y, imagecolorallocate($image, $pixel[0], $pixel[1], $pixel[2]));\n }\n\n }\n\n imagepng($image);\n imagedestroy($image);\n}", "function resize( $width, $height ) \r\n\t{\r\n //\t\t$new_image = imagecreatetruecolor($width, $height);\r\n //\t\t\r\n //\t\t imagesavealpha($new_image, true);\r\n //\t\t $trans_colour = imagecolorallocatealpha($new_image, 255, 255, 255, 256);\r\n //\t\t imagefill($new_image, 0, 0, $trans_colour);\r\n //\t\t header(\"Content-type: image/png\");\r\n //\t\t imagepng($new_image);\r\n //\t\t\t\t\r\n //\t\timagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\r\n //\t\t\r\n //\t\timagefill($new_image, 0, 0, $trans_colour);\r\n //\t\t\r\n //\t\t$this->image = $new_image;\r\n\t\t\r\n\t\t/****************/\r\n\t\t\r\n \t$image_resized = imagecreatetruecolor( $width, $height );\r\n \r\n if ( ($this->type == IMAGETYPE_GIF) || ($this->type == IMAGETYPE_PNG) ) \r\n {\r\n $transparency_index = imagecolortransparent($this->image);\r\n \r\n // If we have a specific transparent color\r\n if ($transparency_index >= 0) \r\n {\r\n // Get the original image's transparent color's RGB values\r\n $transparent_color = imagecolorsforindex($this->image, $transparency_index);\r\n \r\n // Allocate the same color in the new image resource\r\n $transparency_index = imagecolorallocate($image_resized, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);\r\n \r\n // Completely fill the background of the new image with allocated color.\r\n imagefill($image_resized, 0, 0, $transparency_index);\r\n \r\n // Set the background color for new image to transparent\r\n imagecolortransparent($image_resized, $transparency_index);\r\n }\r\n elseif ($this->type == IMAGETYPE_PNG) \r\n {\r\n // Always make a transparent background color for PNGs that don't have one allocated already\r\n\r\n // Turn off transparency blending (temporarily)\r\n imagealphablending($image_resized, false);\r\n \r\n // Create a new transparent color for image\r\n $color = imagecolorallocatealpha($image_resized, 0, 0, 0, 127);\r\n \r\n // Completely fill the background of the new image with allocated color.\r\n imagefill($image_resized, 0, 0, $color);\r\n \r\n // Restore transparency blending\r\n imagesavealpha($image_resized, true);\r\n }\r\n }\r\n\r\n imagecopyresampled( $image_resized, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight() );\r\n \r\n $this->image = $image_resized;\r\n\t}", "function fit($width, $height, $bgColor=array(255, 0, 0))\n\t\t{\n\t\t\t//TODO: set background color\n\t\t\tif (!$this->image) return;\n\t\t\t$ratio = $this->width / $this->height;\n\t\t \n\t\t\tif ($width / $height < $ratio) {\n\t\t\t\t $new_height = $width / $ratio;\n\t\t\t\t $new_width = $width;\n\t\t\t} else {\n\t\t\t\t $new_width = $height * $ratio;\n\t\t\t\t $new_height = $height;\n\t\t\t}\n\t\t \n\t\t\t$x_mid = $new_width / 2; //horizontal middle\n\t\t\t$y_mid = $new_height / 2; //vertical middle\n\t\t \n\t\t\t$process = imagecreatetruecolor(round($new_width), round($new_height));\n\t\t \n\t\t\timagecopyresampled($process, $this->image, 0, 0, 0, 0, $new_width, $new_height, $this->width, $this->height);\n\t\t\t$fit = imagecreatetruecolor($width, $height);\n\t\t\timagecopyresampled($fit, $process, 0, 0, ($x_mid-($width/2)), ($y_mid-($height/2)), $width, $height, $width, $height);\n\t\t\t\n\t\t\timagedestroy($process);\n\t\t\treturn $this->image = $fit;\n\t\t}", "function wp_imagecreatetruecolor($width, $height)\n {\n }", "protected function keepColor($image) {\n imagesavealpha($image, true);\n $color = imagecolorallocatealpha($image, 0, 0, 0, 127);\n imagefill($image, 0, 0, $color);\n return $image;\n }", "function redimage($img_src,$img_dest,$dst_w,$dst_h) {\n // Lit les dimensions de l'image\n $size = GetImageSize($img_src); \n $src_w = $size[0]; $src_h = $size[1]; \n // Teste les dimensions tenant dans la zone\n $test_h = round(($dst_w / $src_w) * $src_h);\n $test_w = round(($dst_h / $src_h) * $src_w);\n // Si Height final non précisé (0)\n if(!$dst_h) $dst_h = $test_h;\n // Sinon si Width final non précisé (0)\n elseif(!$dst_w) $dst_w = $test_w;\n // Sinon teste quel redimensionnement tient dans la zone\n elseif($test_h>$dst_h) $dst_w = $test_w;\n else $dst_h = $test_h;\n\n // La vignette existe ?\n $test = (file_exists($img_dest));\n // L'original a été modifié ?\n if($test)\n $test = (filemtime($img_dest)>filemtime($img_src));\n // Les dimensions de la vignette sont correctes ?\n if($test) {\n $size2 = GetImageSize($img_dest);\n $test = ($size2[0]==$dst_w);\n $test = ($size2[1]==$dst_h);\n }\n\n // Créer la vignette ?\n if(!$test) {\n // Crée une image vierge aux bonnes dimensions\t\n $dst_im = ImageCreateTrueColor($dst_w,$dst_h); \n // Copie dedans l'image initiale redimensionnée\n $src_im = ImageCreateFromJpeg($img_src);\n ImageCopyResampled($dst_im,$src_im,0,0,0,0,$dst_w,$dst_h,$src_w,$src_h);\n // Sauve la nouvelle image\n ImageJpeg($dst_im,$img_dest);\n // Détruis les tampons\n ImageDestroy($dst_im);\n ImageDestroy($src_im);\n }\n}", "private function create() {\n\n\t\t// Use cached version if we have one\n\t\tif ($this->cache && file_exists($this->fileName)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there is only one color, just create an image\n\t\tif (count($this->colors) == 1) {\n\t\t\t$command = sprintf(\"%s -size %dx%d xc:%s %s\", \n\t\t\t\t$this->convert, \n\t\t\t\t$this->width, \n\t\t\t\t$this->height, \n\t\t\t\t$this->colors[0], \n\t\t\t\t$this->fileName\n\t\t\t);\n\t\t}\n\t\t// If there is more than one color, compute sizes and locations of additional color boxes\n\t\telse {\n\t\t\t$command = sprintf(\"%s -size %dx%d xc:%s \",\n\t\t\t\t$this->convert,\n\t\t\t\t$this->width,\n\t\t\t\t$this->height,\n\t\t\t\t$this->colors[0]\n\t\t\t);\n\t\t\t$counter = 0;\n\t\t\t$marginX = $this->width / 20;\n\t\t\t$marginY = $this->height / 20;\n\t\t\t$positionX = $marginX;\n\n\t\t\tforeach ($this->colors as $color) {\n\t\t\t\tif ($counter == 0) {\n\t\t\t\t\t$counter++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Progressively smaller size for each box\n\t\t\t\t$width = (int) (($this->width / 3 / $counter) + ($this->width * 0.07));\n\t\t\t\t$height = (int) (($this->height / 3 / $counter) + ($this->width * 0.07));\n\n\t\t\t\t$command .= ' -draw \"';\n\t\t\t\t$command .= 'stroke ' . $color;\n\t\t\t\t$command .= ' fill ' . $color;\n\t\t\t\t$command .= ' rectangle ';\n\t\t\t\t$command .= $positionX . ',' . ($this->height - $height - $marginY); // starting coordinates\n\t\t\t\t$command .= ' ';\n\t\t\t\t$command .=\t($positionX + $width) . ',' . ($this->height - $marginY); // ending coordinates\n\t\t\t\t$command .=\t'\"';\n\n\t\t\t\t$counter++;\n\t\t\t\t$positionX += $marginX + $width;\n\t\t\t}\n\t\t\t$command .= ' ' . $this->fileName;\n\t\t}\n\t\texec($command);\n\t}", "public function imageBackgroundColor($color)\n {\n $this->imageBackgroundColor = $color;\n\n return $this;\n }", "function mc_shift_color( $color ) {\n\t$color = str_replace( '#', '', $color );\n\t$rgb = '';\n\t$percent = ( mc_inverse_color( $color ) == '#ffffff' ) ? - 20 : 20;\n\t$per = $percent / 100 * 255;\n\t// Percentage to work with. Change middle figure to control color temperature.\n\tif ( $per < 0 ) {\n\t\t// DARKER.\n\t\t$per = abs( $per ); // Turns Neg Number to Pos Number.\n\t\tfor ( $x = 0; $x < 3; $x ++ ) {\n\t\t\t$c = hexdec( substr( $color, ( 2 * $x ), 2 ) ) - $per;\n\t\t\t$c = ( $c < 0 ) ? 0 : dechex( $c );\n\t\t\t$rgb .= ( strlen( $c ) < 2 ) ? '0' . $c : $c;\n\t\t}\n\t} else {\n\t\t// LIGHTER.\n\t\tfor ( $x = 0; $x < 3; $x ++ ) {\n\t\t\t$c = hexdec( substr( $color, ( 2 * $x ), 2 ) ) + $per;\n\t\t\t$c = ( $c > 255 ) ? 'ff' : dechex( $c );\n\t\t\t$rgb .= ( strlen( $c ) < 2 ) ? '0' . $c : $c;\n\t\t}\n\t}\n\n\treturn '#' . $rgb;\n}", "function quantizeImage($newImage, $w, $h, $step=8) {\n\n $alphaStep = ceil($step / 2);\n for ($x = 0; $x < $w; $x++) {\n for ($y = 0; $y < $h; $y++) {\n\n list($a, $r, $g, $b) = $this->readPixel($newImage, $x, $y);\n\n $na = 0;\n if ($a > 120) {\n $na = 127;\n }\n else if ($a > 0) {\n // suitable-ish for gradients\n $na = $this->quantizeValue($a, $alphaStep, 127);\n }\n $nr = $this->quantizeValue($r, $step);\n $ng = $this->quantizeValue($g, $step);\n $nb = $this->quantizeValue($b, $step);\n\n $color = imagecolorallocatealpha($newImage, $nr, $ng, $nb, $na);\n imagesetpixel($newImage, $x, $y, $color);\n }\n }\n\n return $newImage;\n }", "function setTransparency($new_image,$image_source) { \n $transparencyIndex = imagecolortransparent($image_source); \n $transparencyColor = array('red' => 255, 'green' => 255, 'blue' => 255); \n \n if ($transparencyIndex >= 0) { \n $transparencyColor = imagecolorsforindex($image_source, $transparencyIndex); \n } \n \n $transparencyIndex = imagecolorallocate($new_image, $transparencyColor['red'], $transparencyColor['green'], $transparencyColor['blue']); \n imagefill($new_image, 0, 0, $transparencyIndex); \n imagecolortransparent($new_image, $transparencyIndex); \n }", "private function randomColor()\n {\n return imagecolorallocate($this->image, rand(150, 200), rand(150, 200), rand(150, 200));\n }", "public function sub(Color $rhs)\n\t{\n\t\treturn (new Color(array('red' => $this->red - $rhs->red, 'green' => $this->green - $rhs->green, 'blue' => $this->blue - $rhs->blue)));\n\t}", "public function dup() {\n return new Image($this);\n }", "function ImageCopyBicubic ($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) {\n\n global $CFG;\n\n if (function_exists('ImageCopyResampled') and $CFG->gdversion >= 2) { \n return ImageCopyResampled($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y,\n $dst_w, $dst_h, $src_w, $src_h);\n }\n\n $totalcolors = imagecolorstotal($src_img);\n for ($i=0; $i<$totalcolors; $i++) { \n if ($colors = ImageColorsForIndex($src_img, $i)) {\n ImageColorAllocate($dst_img, $colors['red'], $colors['green'], $colors['blue']);\n }\n }\n\n $scaleX = ($src_w - 1) / $dst_w; \n $scaleY = ($src_h - 1) / $dst_h; \n\n $scaleX2 = $scaleX / 2.0; \n $scaleY2 = $scaleY / 2.0; \n\n for ($j = 0; $j < $dst_h; $j++) { \n $sY = $j * $scaleY; \n\n for ($i = 0; $i < $dst_w; $i++) { \n $sX = $i * $scaleX; \n\n $c1 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX,(int)$sY+$scaleY2)); \n $c2 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX,(int)$sY)); \n $c3 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX+$scaleX2,(int)$sY+$scaleY2)); \n $c4 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX+$scaleX2,(int)$sY)); \n\n $red = (int) (($c1['red'] + $c2['red'] + $c3['red'] + $c4['red']) / 4); \n $green = (int) (($c1['green'] + $c2['green'] + $c3['green'] + $c4['green']) / 4); \n $blue = (int) (($c1['blue'] + $c2['blue'] + $c3['blue'] + $c4['blue']) / 4); \n\n $color = ImageColorClosest ($dst_img, $red, $green, $blue); \n ImageSetPixel ($dst_img, $i + $dst_x, $j + $dst_y, $color); \n } \n } \n}", "public function setBackgroundColor($color)\n {\n //create canvas\n $canvas = $this->generateCanvas($this->getWidth(), $this->getHeight(), $color);\n\n //merge the background canvas with the main picture\n $this->mergeImage($canvas);\n\n return $this;\n }", "function ImageCopyBicubic ($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) {\n\n global $CFG;\n\n if (function_exists(\"ImageCopyResampled\") and $CFG->gdversion >= 2) {\n return ImageCopyResampled($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y,\n $dst_w, $dst_h, $src_w, $src_h);\n }\n\n $totalcolors = imagecolorstotal($src_img);\n for ($i=0; $i<$totalcolors; $i++) {\n if ($colors = ImageColorsForIndex($src_img, $i)) {\n ImageColorAllocate($dst_img, $colors['red'], $colors['green'], $colors['blue']);\n }\n }\n\n $scaleX = ($src_w - 1) / $dst_w;\n $scaleY = ($src_h - 1) / $dst_h;\n\n $scaleX2 = $scaleX / 2.0;\n $scaleY2 = $scaleY / 2.0;\n\n for ($j = 0; $j < $dst_h; $j++) {\n $sY = $j * $scaleY;\n\n for ($i = 0; $i < $dst_w; $i++) {\n $sX = $i * $scaleX;\n\n $c1 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX,(int)$sY+$scaleY2));\n $c2 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX,(int)$sY));\n $c3 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX+$scaleX2,(int)$sY+$scaleY2));\n $c4 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX+$scaleX2,(int)$sY));\n\n $red = (int) (($c1['red'] + $c2['red'] + $c3['red'] + $c4['red']) / 4);\n $green = (int) (($c1['green'] + $c2['green'] + $c3['green'] + $c4['green']) / 4);\n $blue = (int) (($c1['blue'] + $c2['blue'] + $c3['blue'] + $c4['blue']) / 4);\n\n $color = ImageColorClosest ($dst_img, $red, $green, $blue);\n ImageSetPixel ($dst_img, $i + $dst_x, $j + $dst_y, $color);\n }\n }\n}", "function createNewImage($oldType, $oldFile, $newSizeX, $newSizeY, $oldSizeX, $oldSizeY) {\n\n // Load original image\n $fnCreateImage = 'imagecreatefrom' . $oldType;\n $oldImage = $fnCreateImage($oldFile);\n\n // Create new image\n $newImage = imagecreatetruecolor($newSizeX, $newSizeY);\n imagesavealpha($newImage, true);\n imagealphablending($newImage, false);\n imagecopyresampled($newImage, $oldImage, 0, 0, 0, 0, $newSizeX, $newSizeY, $oldSizeX, $oldSizeY);\n\n return $newImage;\n }", "function createCopy( $I )\n{\n\t// get width and height\n\t$width = imagesx( $I );\n\t$height = imagesy( $I );\n\t\t\n\t// clone image\n\t$Ires = imageCreateTrueColor($width,$height);\n\timageCopy($Ires,$I,0,0,0,0, $width, $height);\n\t\t\n\t// return image\n\treturn $Ires;\t\t\n}", "private function imageCreateTransparent($width, $height) \n\t{ \n\t\t// Create the blank image with black:\n\t $clearImage = imagecreatetruecolor($width, $height);\n\t imagesavealpha($clearImage, true);\n\n\t // Select the color black to replace as transparent:\n\t $transparent = imagecolorallocatealpha($clearImage, 0, 0, 0, 127);\n\t \n\t // Run the function to tranform black to clear:\n\t imagefill($clearImage, 0, 0, $transparent);\n\t return $clearImage;\n\t}", "public function delete() {\n\t\t$canvas = $this->original->getCanvas();\n\t\timagefilledrectangle($this->original->getImage(), $this->x, $this->y, $this->x+$this->getWidth()-1, $this->y+$this->getHeight()-1, imagecolorallocate($this->original->getImage(), $canvas['r'], $canvas['g'], $canvas['b']));\n\t}", "public function resize($newWidth, $newHeight, $option='auto')\n\t{\n\t\t// Reset\n\t\tif ($this->imageResized) {\n\t\t\timagedestroy($this->imageResized);\n\t\t}\n\t\t$this->saveState = false;\n\n\t\t// Get optimal width and height based on $option\n\t\t$optionArray = $this->getDimensions((int)$newWidth, (int)$newHeight, $option);\n\t\t$this->optimalWidth = round($optionArray['optimalWidth']);\n\t\t$this->optimalHeight = round($optionArray['optimalHeight']);\n\n\t\t// Resample - create image canvas of x, y size\n\t\t$this->imageResized = imagecreatetruecolor($this->optimalWidth, $this->optimalHeight);\n\t\tif (imagetypes() & IMG_PNG) {\n\t\t\timagesavealpha($this->imageResized, true);\n\t\t\timagealphablending($this->imageResized, false);\n\t\t}\n\t\timagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $this->optimalWidth, $this->optimalHeight, $this->width, $this->height);\n\n\t\t// If option is 'crop', then crop too\n\t\tif ($option == 'crop') {\n\t\t\t$this->cropImage($this->optimalWidth, $this->optimalHeight, $newWidth, $newHeight);\n\t\t}\n\n\t\treturn $this;\n\t}", "function shift($steps){\n\t\treturn new Color(\n\t\t\tself::contain($this->a + $steps), \n\t\t\tself::contain($this->b + $steps), \n\t\t\tself::contain($this->c + $steps)\n\t\t);\n\t}", "public function fit(IImageInformation $src, $width, $height, $backgroundcolor = 0xFFFFFF);", "public function greyscale(): Image\n\t{\n\t\t$this->processor->greyscale();\n\n\t\treturn $this;\n\t}", "function CropMnb($imgSrc,$newfilename,$new_width=100,$new_height=100,$quality=100){\n\n\t\t$extension = strtolower($this->getExtension($imgSrc,false)); // false - tells to get \"jpg\" NOT \".jpg\" GOT IT :P\n\t\t\n\t\t//saving the image into memory (for manipulation with GD Library)\n\t\tswitch($extension) {\n\t\t\tcase 'gif':\n\t\t\t$myImage = imagecreatefromgif($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t\tcase 'jpg':\n\t\t\t$myImage = imagecreatefromjpeg($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t$myImage = imagecreatefrompng($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$thumb = $this->ResizeSemiAbstractTop($myImage,$new_width,$new_height);\n\n\t\tif($extension==\"jpg\" ){\n\t\t\timagejpeg($thumb,$this->path.$newfilename,$quality);\n\t\t}elseif($extension==\"gif\" ){\n\t\t\timagegif($thumb,$this->path.$newfilename,$quality);\n\t\t}elseif($extension==\"png\" ){\n\t\t\timagepng($thumb,$this->path.$newfilename,9);\n\t\t}\n\t\n\t\timagedestroy($thumb); \n\t}", "private function handleTransparency( &$dst_img, $imgType, $newWidth, $newHeight ) {\n\t\t// handle transparency:\n\t\tif ( $imgType == IMAGETYPE_PNG || $imgType == IMAGETYPE_GIF ) {\n\t\t\timagealphablending( $dst_img, false );\n\t\t\timagesavealpha( $dst_img,true );\n\t\t\t$transparent = imagecolorallocatealpha( $dst_img, 255, 255, 255, 127 );\n\t\t\timagefilledrectangle( $dst_img, 0, 0, $newWidth, $newHeight, $transparent );\n\t\t}\n\t}", "function RectPattern($aColor,$aWeight=1) {\n\t$this->color = $aColor;\n\t$this->weight = $aWeight;\t\t\n }", "private function multiplyColor($multiplier)\n {\n $modColor = $this->color;\n $red = (int) round($modColor->red * $multiplier);\n $green = (int) round($modColor->green * $multiplier);\n $blue = (int) round($modColor->blue * $multiplier);\n\n $modColor->red = ($red > 255) ? 255 : $red;\n $modColor->green = ($green > 255) ? 255 : $green;\n $modColor->blue = ($blue > 255) ? 255 : $blue;\n return $modColor;\n }", "public function border(string $color = '#000', int $thickness = 5): Image\n\t{\n\t\t$this->processor->border($color, $thickness);\n\n\t\treturn $this;\n\t}", "function create($w,$h) {\n\n if ( $this->vertical ) {\n $this->width = $h;\n $this->height = $w;\n } else {\n $this->width = $w;\n $this->height = $h;\n }\n\n $this->img = imageCreate($this->width,$this->height);\n $this->colorIds = array();\n}", "public function colorMatrix() {}", "function cilikke($src, $dest, $new_width) {\r\n\t$info = getimagesize($src);\r\n\t$mime = $info[\"mime\"];\r\n\tif( $mime == 'image/jpeg' ) $source_image = imagecreatefromjpeg($src);\r\n\telseif( $mime == 'image/png' ) $source_image = imagecreatefrompng($src);\r\n\t$width = imagesx($source_image);\r\n\t$height = imagesy($source_image);\r\n\t$new_height = floor($height * ($new_width / $width));\r\n\tif($new_width < $width && $new_height < $height)\r\n\t{\r\n\t\t$virtual_image = imagecreatetruecolor($new_width, $new_height);\t\r\n\t\timagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\r\n\t\timagejpeg($virtual_image, $dest);\r\n\t}else\r\n\t\tcopy($src, $dest);\r\n}", "private function createImageKeepTransparency($width, $height) {\n $img = imagecreatetruecolor($width, $height);\n imagealphablending($img, false);\n imagesavealpha($img, true); \n return $img;\n }", "public function rasterbate($value=6)\n\t{\n\t\t$this->checkImage();\n\t\t$blockSize = (int)$value;\n\t\t$imageX = $this->optimalWidth;\n\t\t$imageY = $this->optimalHeight;\n\t\t$origImage = $this->imageResized;\n\n\t\t$this->imageResized = imagecreatetruecolor($imageX, $imageY);\n\t\t$background = imagecolorallocate($this->imageResized, 255, 255, 255);\n\t\timagefill($this->imageResized, 0, 0, $background);\n\n\t\tfor ($x = 0; $x < $imageX; $x += $blockSize) {\n\t\t\tfor ($y = 0; $y < $imageY; $y += $blockSize) {\n\t\t\t\t$thisCol = imagecolorat($origImage, $x, $y);\n\t\t\t\t$newR = 0;\n\t\t\t\t$newG = 0;\n\t\t\t\t$newB = 0;\n\t\t\t\t$colours = array();\n\t\t\t\tfor ($k = $x; $k < $x + $blockSize; ++$k) {\n\t\t\t\t\tfor ($l = $y; $l < $y + $blockSize; ++$l) {\n\t\t\t\t\t\tif ($k < 0) { $colours[] = $thisCol; continue; }\n\t\t\t\t\t\tif ($k >= $imageX) { $colours[] = $thisCol; continue; }\n\t\t\t\t\t\tif ($l < 0) { $colours[] = $thisCol; continue; }\n\t\t\t\t\t\tif ($l >= $imageY) { $colours[] = $thisCol; continue; }\n\t\t\t\t\t\t$colours[] = imagecolorat($origImage, $k, $l);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tforeach($colours as $colour) {\n\t\t\t\t\t$newR += ($colour >> 16) & 0xFF;\n\t\t\t\t\t$newG += ($colour >> 8) & 0xFF;\n\t\t\t\t\t$newB += $colour & 0xFF;\n\t\t\t\t}\n\t\t\t\t$numElems = count($colours);\n\t\t\t\t$newR = round($newR /= $numElems);\n\t\t\t\t$newG = round($newG /= $numElems);\n\t\t\t\t$newB = round($newB /= $numElems);\n\t\t\t\t$newCol = imagecolorallocate($this->imageResized, $newR, $newG, $newB);\n\t\t\t\t$newX = ($x+$blockSize)-($blockSize/2);\n\t\t\t\t$newY = ($y+$blockSize)-($blockSize/2);\n\t\t\t\t$newRgb = array($newR, $newG, $newB);\n\t\t\t\t$hsv = $this->rgb2hsv($newRgb);\n\t\t\t\t$newSize = round($blockSize * ((100 - $hsv[2]) / 100));\n\t\t\t\tif ($newSize > 0) {\n\t\t\t\t\timagefilledellipse($this->imageResized, $newX, $newY, $newSize, $newSize, $newCol);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\timagedestroy($origImage);\n\n\t\treturn $this;\n\t}", "function zbx_colormix($image, $bgColor, $fgColor, $alpha) {\n\t$r = $bgColor[0] + ($fgColor[0] - $bgColor[0]) * $alpha;\n\t$g = $bgColor[1] + ($fgColor[1] - $bgColor[1]) * $alpha;\n\t$b = $bgColor[2] + ($fgColor[2] - $bgColor[2]) * $alpha;\n\n\treturn imagecolorresolvealpha($image, $r, $g, $b, 0);\n}", "protected function _createImage()\n {\n $this->_height = $this->scale * 60;\n $this->_width = 1.8 * $this->_height;\n $this->_image = imagecreate($this->_width, $this->_height);\n ImageColorAllocate($this->_image, 0xFF, 0xFF, 0xFF);\n }", "public function background($color, $quality=null);", "function resize($width, $height){\n\n $new_image = imagecreatetruecolor($width, $height);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->get_width(), $this->get_height());\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $width;\n $this->height = $height;\n\n return true;\n }", "private function intern_resize_crop($newWidth, $newHeight)\n\t{\n\t\t/*\n\t\t * Crop-to-fit PHP-GD\n\t\t * http://salman-w.blogspot.com/2009/04/crop-to-fit-image-using-aspphp.html\n\t\t *\n\t\t * Resize and center crop an arbitrary size image to fixed width and height\n\t\t * e.g. convert a large portrait/landscape image to a small square thumbnail\n\t\t *\n\t\t * Modified by Fry\n\t\t */\n\t\t$desired_aspect_ratio = $newWidth / $newHeight;\n\n\t\tif ($this->srcAspectRatio > $desired_aspect_ratio) {\n\t\t\t/*\n\t\t\t * Triggered when source image is wider\n\t\t\t */\n\t\t\t$temp_height = $newHeight;\n\t\t\t$temp_width = ( int ) ($newHeight * $this->srcAspectRatio);\n\t\t} else {\n\t\t\t/*\n\t\t\t * Triggered otherwise (i.e. source image is similar or taller)\n\t\t\t */\n\t\t\t$temp_width = $newWidth;\n\t\t\t$temp_height = ( int ) ($newWidth / $this->srcAspectRatio);\n\t\t}\n\n\t\t/*\n\t\t * Resize the image into a temporary GD image\n\t\t */\n\n\t\t$tempImage = imagecreatetruecolor($temp_width, $temp_height);\n\t\timagecopyresampled(\n\t\t\t$tempImage,\t\t\t\t\t$this->srcImage,\n\t\t\t0, 0,\t\t\t0, 0,\n\t\t\t$temp_width, $temp_height,\t$this->srcWidth, $this->srcHeight\n\t\t);\n\n\t\t/*\n\t\t * Copy cropped region from temporary image into the desired GD image\n\t\t */\n\n\t\t$x0 = ($temp_width - $newWidth) / 2;\n\t\t$y0 = ($temp_height - $newHeight) / 2;\n\t\t$this->newImage = imagecreatetruecolor($newWidth, $newHeight);\n\t\timagecopy(\n\t\t\t$this->newImage,\t$tempImage,\n\t\t\t0, 0,\t$x0, $y0,\n\t\t\t$newWidth, $newHeight\n\t\t);\n\t\timagedestroy($tempImage);\n\t}", "public function apply() {\n\t\t$w = $this->getWidth();\n\t\t$h = $this->getHeight();\n\n\t\timagecopyresampled($this->original->getImage(), $this->getImage(), $this->x, $this->y, 0, 0, $w, $h, $w, $h);\n\t}", "function multiplyColour($colour, $greyscale = false)\n {\n if(function_exists('imagefilter'))\n {\n $inverse = self::invertColour($colour);\n $r = hexdec(substr($inverse,0,2));\n $g = hexdec(substr($inverse,2,2));\n $b = hexdec(substr($inverse,4,2));\n\n $gd = $this->getWorkingImageResource();\n imagefilter($gd,IMG_FILTER_NEGATE);\n if($greyscale)\n {\n $this->makeGreyscale();\n }\n imagefilter($gd,IMG_FILTER_COLORIZE,$r,$g,$b);\n imagefilter($gd,IMG_FILTER_NEGATE);\n $this->setWorkingImageResource($gd);\n }\n }", "public function setColor($color)\n{\n$this->color = $color;\n\nreturn $this;\n}", "public function makeDefault() {\n $this->update([\n 'color' => null,\n 'size' => null\n ]);\n }", "private function resize($width,$height) {\n $newImage = imagecreatetruecolor($width, $height);\n imagealphablending($newImage, false);\n imagesavealpha($newImage, true);\n imagecopyresampled($newImage, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $newImage;\n }", "private function createImageKeepTransparency($width, $height) {\n $img = imagecreatetruecolor($width, $height);\n imagealphablending($img, false);\n imagesavealpha($img, true);\n return $img;\n }", "public function resizeImage($image, $width, $height, $path, $quality, $color = '#ffffff')\n {\n $newImage = Image::make($image);\n\n if ($newImage->width() <= $newImage->height()) {\n $newImage->resize(null, $height, function ($constraint) {\n $constraint->aspectRatio();\n });\n }\n else {\n $newImage->resize($width, null, function ($constraint) {\n $constraint->aspectRatio();\n });\n }\n\n // $frame->insert($newImage, 'center');\n $newImage->save($path, $quality);\n }", "public function setColor(Color $color)\n {\n $this->color = $color;\n return $this;\n }", "public static function fill()\n {\n return new CropMode(CropMode::FILL);\n }", "public function paintImage($image, string $color)\r\n {\r\n $backgroundColor = $this->hexToRgb($color);\r\n $backgroundColor = imagecolorallocate(\r\n $image, \r\n $backgroundColor['red'], \r\n $backgroundColor['green'],\r\n $backgroundColor['blue']\r\n );\r\n\r\n imagefill($image, 0, 0, $backgroundColor);\r\n\r\n return $image;\r\n }", "private function createNewTransparentImage($width, $height)\n {\n $image = imagecreatetruecolor($width, $height);\n imagesavealpha($image, true);\n imagefill($image, 0, 0, imagecolorallocatealpha($image, 0, 0, 0, 127));\n\n return $image;\n }", "public function interlace()\n\t{\n\t\t$this->checkImage();\n\t\t$imageX = $this->optimalWidth;\n\t\t$imageY = $this->optimalHeight;\n\n\t\t$black = imagecolorallocate($this->imageResized, 0, 0, 0);\n\t\tfor ($y = 1; $y < $imageY; $y += 2) {\n\t\t\timageline($this->imageResized, 0, $y, $imageX, $y, $black);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function toRGB()\n {\n return $this;\n }", "public function mainColour() {\n\t\t$images = $this->ShopImage->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'ShopImage.colour_1 IS NULL'\n\t\t\t)\n\t\t));\n\n\t\t$count = count($images);\n\t\tforeach ($images as $k => $image) {\n\t\t\t$this->out(sprintf('%s of %d: %s', str_pad($k+1, strlen($count), ' ', STR_PAD_LEFT), $count, $image['ShopImage']['image_full']));\n\t\t\t$colours = $this->_colour(APP . 'webroot/' . $image['ShopImage']['image_full']);\n\t\t\t$image['ShopImage']['colour_1'] = $colours[0];\n\t\t\t$image['ShopImage']['colour_2'] = $colours[1];\n\t\t\t$this->ShopImage->save($image['ShopImage']);\n\t\t}\n\t}", "function make_thumb($img_name, $filename, $new_w, $new_h) {\n //get image extension.\n $ext = getExtension($img_name);\n //creates the new image using the appropriate function from gd library\n if (!strcmp(\"jpg\", $ext) || !strcmp(\"jpeg\", $ext))\n $src_img = imagecreatefromjpeg($img_name);\n\n if (!strcmp(\"png\", $ext))\n $src_img = imagecreatefrompng($img_name);\n\n //gets the dimmensions of the image\n $old_x = imageSX($src_img);\n $old_y = imageSY($src_img);\n\n // next we will calculate the new dimmensions for the thumbnail image\n // the next steps will be taken: \n // 1. calculate the ratio by dividing the old dimmensions with the new ones\n // 2. if the ratio for the width is higher, the width will remain the one define in WIDTH variable\n // and the height will be calculated so the image ratio will not change\n // 3. otherwise we will use the height ratio for the image\n // as a result, only one of the dimmensions will be from the fixed ones\n $ratio1 = $old_x / $new_w;\n $ratio2 = $old_y / $new_h;\n if ($ratio1 > $ratio2) {\n $thumb_w = $new_w;\n $thumb_h = $old_y / $ratio1;\n } else {\n $thumb_h = $new_h;\n $thumb_w = $old_x / $ratio2;\n }\n\n // we create a new image with the new dimmensions\n $dst_img = ImageCreateTrueColor($thumb_w, $thumb_h);\n\n // resize the big image to the new created one\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_x, $old_y);\n\n // output the created image to the file. Now we will have the thumbnail into the file named by $filename\n if (!strcmp(\"png\", $ext))\n imagepng($dst_img, $filename);\n else\n imagejpeg($dst_img, $filename);\n\n //destroys source and destination images. \n imagedestroy($dst_img);\n imagedestroy($src_img);\n}", "public function fromRGB(RGBColor $color)\n {\n $this->r = $color->r();\n\n $this->g = $color->g();\n\n $this->b = $color->b();\n \n return $this;\n }", "abstract protected function renderFill($image, $params, int $color): void;", "function redimensionarImagen($origin,$destino,$newWidth,$newHeight,$jpgQuality=100)\n{\n // texto con el valor correcto height=\"yyy\" width=\"xxx\"\n $datos=getimagesize($origin);\n \n // comprobamos que la imagen sea superior a los tamaños de la nueva imagen\n if($datos[0]>$newWidth || $datos[1]>$newHeight)\n {\n \n // creamos una nueva imagen desde el original dependiendo del tipo\n if($datos[2]==1)\n $img=imagecreatefromgif($origin);\n if($datos[2]==2)\n $img=imagecreatefromjpeg($origin);\n if($datos[2]==3)\n $img=imagecreatefrompng($origin);\n \n // Redimensionamos proporcionalmente\n if(rad2deg(atan($datos[0]/$datos[1]))>rad2deg(atan($newWidth/$newHeight)))\n {\n $anchura=$newWidth;\n $altura=round(($datos[1]*$newWidth)/$datos[0]);\n }else{\n $altura=$newHeight;\n $anchura=round(($datos[0]*$newHeight)/$datos[1]);\n }\n \n // creamos la imagen nueva\n $newImage = imagecreatetruecolor($anchura,$altura);\n \n // redimensiona la imagen original copiandola en la imagen\n imagecopyresampled($newImage, $img, 0, 0, 0, 0, $anchura, $altura, $datos[0], $datos[1]);\n \n // guardar la nueva imagen redimensionada donde indicia $destino\n if($datos[2]==1)\n imagegif($newImage,$destino);\n if($datos[2]==2)\n imagejpeg($newImage,$destino,$jpgQuality);\n if($datos[2]==3)\n imagepng($newImage,$destino);\n \n // eliminamos la imagen temporal\n imagedestroy($newImage);\n \n return true;\n }\n return false;\n}", "public function setColor($color)\n {\n $this->color = $color;\n\n return $this;\n }", "function scaleByFactor($size)\r\n {\r\n $new_x = round($size * $this->img_x, 0);\r\n $new_y = round($size * $this->img_y, 0);\r\n return $this->_resize($new_x, $new_y);\r\n }", "function getColorPallet($imageURL, $palletSize = [16, 8])\n{\n // SIMPLE CHECK INPUT VALUES\n if (!$imageURL) {\n return false;\n }\n\n // IN THIS EXEMPLE WE CREATE PALLET FROM JPG IMAGE\n $img = @imagecreatefromjpeg($imageURL);\n\n if (!$img) {\n return false;\n }\n\n // SCALE DOWN IMAGE\n $imgSizes = getimagesize($imageURL);\n\n $resizedImg = imagecreatetruecolor($palletSize[0], $palletSize[1]);\n\n imagecopyresized($resizedImg, $img, 0, 0, 0, 0, $palletSize[0], $palletSize[1], $imgSizes[0], $imgSizes[1]);\n\n imagedestroy($img);\n\n //GET COLORS IN ARRAY\n $colors = [];\n\n for ($i = 0; $i < $palletSize[1]; $i++) {\n for ($j = 0; $j < $palletSize[0]; $j++) {\n $colors[] = dechex(imagecolorat($resizedImg, $j, $i));\n }\n }\n\n imagedestroy($resizedImg);\n\n //REMOVE DUPLICATES\n $colors = array_unique($colors);\n\n return $colors;\n\n}", "function scaleByLength($size)\r\n {\r\n if ($this->img_x >= $this->img_y) {\r\n $new_x = $size;\r\n $new_y = round(($new_x / $this->img_x) * $this->img_y, 0);\r\n } else {\r\n $new_y = $size;\r\n $new_x = round(($new_y / $this->img_y) * $this->img_x, 0);\r\n }\r\n return $this->_resize($new_x, $new_y);\r\n }", "public function setColor(Color $color)\n {\n $this->color = $color;\n\n return $this;\n }", "public function setColor(Color $color)\n {\n $this->color = $color;\n\n return $this;\n }", "protected function make_rgb()\n {\n $hsl = $this->_hsl;\n $hue = $hsl['hue'];\n $saturation = max(min($hsl['saturation'], 1), 0);\n $luminance = max(min($hsl['luminance'], 1), 0);\n\n $max = ($luminance <= 0.5) ? $luminance * ($saturation + 1) : $luminance + $saturation - $luminance * $saturation;\n $min = $luminance * 2 - $max;\n\n $this->_rgb_dec = array(\n 'red' => (int) ($this->_hue_to_rgb($min, $max, $hue + 0.33333) * self::RGB_MAX),\n 'green' => (int) ($this->_hue_to_rgb($min, $max, $hue) * self::RGB_MAX),\n 'blue' => (int) ($this->_hue_to_rgb($min, $max, $hue - 0.33333) * self::RGB_MAX),\n );\n $this->_rgb_hex = $this->rgb_dec_to_hex($this->_rgb_dec);\n }", "public function add(Color $rhs)\n\t{\n\t\treturn (new Color(array('red' => $this->red + $rhs->red, 'green' => $this->green + $rhs->green, 'blue' => $this->blue + $rhs->blue)));\n\t}", "function getColors($imageURL){\n\n //create image in RAM from any uploaded picture ['jpg', 'jpeg', 'png', 'gif', 'bpm'];\n $img = imagecreatefromstring(file_get_contents($imageURL));\n\n //get original size from uploaded picture\n $size = getimagesize($imageURL);\n $size_x = $size[0];\n $size_y = $size[1];\n\n //set new with and height size\n $new_size_x = round($size_x/2);\n $new_size_y = round($size_y/2);\n\n //create empty picture with new size\n $new_size_img = imagecreatetruecolor($new_size_x,$new_size_y);\n\n //copy original picture to created picture wiz new size\n imagecopyresized($new_size_img, $img , 0, 0 , 0, 0, $new_size_x, $new_size_y, $size_x, $size_y);\n\n //delete original picture from RAM\n imagedestroy($img);\n\n //get color from every second pixel in picture and \n $colors = [];\n for ($x = 0; $x < $new_size_x; $x+=2) {\n for ($y = $x; $y < $new_size_y; $y+=2) {\n $colors[]=dechex(imagecolorat($new_size_img,$x,$y));\n }\n } \n\n //delete copied picture from RAM\n imagedestroy($new_size_img);\n\n //add '0`s' to colors which have less than 6 symbols\n $colors = array_map(function($colors){\n $color = $colors;\n $zeros = '';\n $max_len = 6;\n $len = strlen($color) ?? '0';\n if($len < $max_len){\n $count = $max_len - $len;\n for($x = 0; $x < $count; $x++){\n $zeros .= \"0\";\n }\n }\n return $zeros.$color;\n },$colors);\n\n return $colors;\n}", "function img_resize($src, $dest, $width, $height, $rgb=0xFFFFFF, $quality=100) {\n\t\t if (!file_exists($src)) \n\t\t\treturn false;\n\n\t\t $size = getimagesize($src);\n\n\t\t if ($size === false) \n\t\t\treturn false;\n\n\t\t $format = strtolower(substr($size['mime'], strpos($size['mime'], '/')+1));\n\t\t $icfunc = \"imagecreatefrom\" . $format;\n\t\t if (!function_exists($icfunc)) \n\t\t\treturn false;\n\n\t\t $x_ratio = $width / $size[0];\n\t\t $y_ratio = $height / $size[1];\n\n\t\t $ratio = min($x_ratio, $y_ratio);\n\t\t $use_x_ratio = ($x_ratio == $ratio);\n\n\t\t $new_width = $use_x_ratio ? $width : floor($size[0] * $ratio);\n\t\t $new_height = !$use_x_ratio ? $height : floor($size[1] * $ratio);\n\t\t $new_left = $use_x_ratio ? 0 : floor(($width - $new_width) / 2);\n\t\t $new_top = !$use_x_ratio ? 0 : floor(($height - $new_height) / 2);\n\n\t\t $isrc = $icfunc($src);\n\t\t $idest = imagecreatetruecolor($width, $height);\n\t\t if($idest === false) \n\t\t\treturn false;\n\n\t\t imagefill($idest, 0, 0, $rgb);\n\t\t imagecopyresampled($idest, $isrc, $new_left, $new_top, 0, 0,\n\t\t $new_width, $new_height, $size[0], $size[1]);\n\n\n\t\t if(!imagejpeg($idest, $dest, $quality)) \n\t\t\treturn false;\n\n\t\t imagedestroy($isrc);\n\t\t imagedestroy($idest);\n\n\t\t return true;\n\t}", "function fetch_colors($filename = '')\n\t{\n\t\tif (!empty($filename))\n\t\t{\n\t\t\t// resize to obtain most significant colors\n\t\t\t$preview_width = 150;\n\t\t\t$preview_height = 150;\n\t\t\t$size = GetImageSize($filename);\n\t\t\t$scale = 1;\n\t\t\tif ($size[0] > 0)\n\t\t\t{\n\t\t\t\t$scale = min($preview_width / $size[0], $preview_height / $size[1]);\n\t\t\t}\n\t\t\tif ($scale < 1)\n\t\t\t{\n\t\t\t\t$width = floor($scale*$size[0]);\n\t\t\t\t$height = floor($scale*$size[1]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$width = $size[0];\n\t\t\t\t$height = $size[1];\n\t\t\t}\n\t\t\t$image_resized = imagecreatetruecolor($width, $height);\n\t\t\tif ($size[2] == 1)\n\t\t\t{\n\t\t\t\t$image_orig = imagecreatefromgif($filename);\n\t\t\t}\n\t\t\tif ($size[2] == 2)\n\t\t\t{\n\t\t\t\t$image_orig = imagecreatefromjpeg($filename);\n\t\t\t}\n\t\t\tif ($size[2] == 3)\n\t\t\t{\n\t\t\t\t$image_orig = imagecreatefrompng($filename);\n\t\t\t}\n\t\t\t// we need the nearest neihbor resizing because it doesn't alter the colors\n\t\t\timagecopyresampled($image_resized, $image_orig, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t\t\t$im = $image_resized;\n\t\t\t$imgWidth = imagesx($im);\n\t\t\t$imgHeight = imagesy($im);\n\t\t\tfor ($y = 0; $y < $imgHeight; $y++)\n\t\t\t{\n\t\t\t\tfor ($x = 0; $x < $imgWidth; $x++)\n\t\t\t\t{\n\t\t\t\t\t$index = imagecolorat($im, $x, $y);\n\t\t\t\t\t$Colors = imagecolorsforindex($im, $index);\n\t\t\t\t\t// round off the colors to reduce the number of colors to prevent duplicates\n\t\t\t\t\t$Colors['red'] = intval((($Colors['red']) + 15) / 32) * 32;\n\t\t\t\t\t$Colors['green'] = intval((($Colors['green']) + 15) / 32) * 32;\n\t\t\t\t\t$Colors['blue'] = intval((($Colors['blue']) + 15) / 32) * 32;\n\t\t\t\t\tif ($Colors['red'] >= 256)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Colors['red'] = 240;\n\t\t\t\t\t}\n\t\t\t\t\tif ($Colors['green'] >= 256)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Colors['green'] = 240;\n\t\t\t\t\t}\n\t\t\t\t\tif ($Colors['blue'] >= 256)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Colors['blue'] = 240;\n\t\t\t\t\t}\n\t\t\t\t\t$hexarray[] = substr(\"0\" . dechex($Colors['red']), -2) . substr(\"0\" . dechex($Colors['green']), -2) . substr(\"0\" . dechex($Colors['blue']), -2);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$hexarray = array_count_values($hexarray);\n\t\t\tnatsort($hexarray);\n\t\t\t$hexarray = array_reverse($hexarray, true);\n\t\t\treturn $hexarray;\n\t\t}\n\t}", "public function colour();", "private function transparentImage($width, $height)\n {\n $img = imagecreatetruecolor($width, $height);\n imagealphablending($img, false);\n imagesavealpha($img, true);\n $backgr = imagecolorallocatealpha($img, 255, 255, 255, 127);\n imagefilledrectangle($img, 0, 0, $width, $height, $backgr);\n return $img;\n }", "public function frontImage()\r\n {\r\n $wrapper = imagecreatetruecolor(16 * $this->ratio(), 32 * $this->ratio());\r\n $background = imagecolorallocatealpha($wrapper, 255, 255, 255, 127);\r\n imagefill($wrapper, 0, 0, $background);\r\n\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 0 * $this->ratio(), 8 * $this->ratio(),\r\n 8 * $this->ratio(), 8 * $this->ratio(), 8 * $this->ratio());\r\n //arms\r\n imagecopy($wrapper, $this->image, 0 * $this->ratio(), 8 * $this->ratio(), 44 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n $this->imageflip($wrapper, $this->image, 12 * $this->ratio(), 8 * $this->ratio(), 44 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n //chest\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 8 * $this->ratio(), 20 * $this->ratio(),\r\n 20 * $this->ratio(), 8 * $this->ratio(), 12 * $this->ratio());\r\n //legs\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 20 * $this->ratio(), 4 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n $this->imageflip($wrapper, $this->image, 8 * $this->ratio(), 20 * $this->ratio(), 4 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n //hat\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 0 * $this->ratio(), 40 * $this->ratio(),\r\n 8 * $this->ratio(), 8 * $this->ratio(), 8 * $this->ratio());\r\n\r\n return $wrapper;\r\n }", "public function setColor($color)\n {\n $this->color = $color;\n return $this;\n }", "protected function _create($width, $height)\n {\n // Create an empty image\n $image = imagecreatetruecolor($width, $height);\n\n // Do not apply alpha blending\n imagealphablending($image, FALSE);\n\n // Save alpha levels\n imagesavealpha($image, TRUE);\n\n return $image;\n }", "public function makeImage()\n {\n $x_width = 200;\n $y_width = 125;\n\n $this->image = imagecreatetruecolor(200, 125);\n\n $this->white = imagecolorallocate($this->image, 255, 255, 255);\n $this->black = imagecolorallocate($this->image, 0, 0, 0);\n $this->red = imagecolorallocate($this->image, 255, 0, 0);\n $this->green = imagecolorallocate($this->image, 0, 255, 0);\n $this->grey = imagecolorallocate($this->image, 128, 128, 128);\n\n $this->red = imagecolorallocate($this->image, 231, 0, 0);\n\n $this->yellow = imagecolorallocate($this->image, 255, 239, 0);\n $this->green = imagecolorallocate($this->image, 0, 129, 31);\n\n $this->color_palette = [$this->red, $this->yellow, $this->green];\n\n imagefilledrectangle($this->image, 0, 0, 200, 125, $this->white);\n\n $border = 25;\n\n $lines = [\"e\", \"g\", \"b\", \"d\", \"f\"];\n $i = 0;\n foreach ($lines as $key => $line) {\n $x1 = 0;\n $x2 = $x_width;\n $y1 = $i * 15 + 25;\n $y2 = $y1;\n imageline(\n $this->image,\n $x1 + $border,\n $y1,\n $x2 - $border,\n $y2,\n $this->black\n );\n $i = $i + 1;\n }\n\n imageline(\n $this->image,\n 0 + $border,\n 25,\n 0 + $border,\n 4 * 15 + 25,\n $this->black\n );\n imageline(\n $this->image,\n 200 - $border,\n 25,\n 200 - $border,\n 4 * 15 + 25,\n $this->black\n );\n\n $textcolor = $this->black;\n\n $font = $this->default_font;\n\n $size = 10;\n $angle = 0;\n\n if (!isset($this->bar_count) or $this->bar_count == \"X\") {\n $this->bar_count = 0;\n }\n $count_notation = $this->bar_count + 1;\n\n if (file_exists($font)) {\n if (\n $count_notation != 1 or\n $count_notation == $this->max_bar_count\n ) {\n imagettftext(\n $this->image,\n $size,\n $angle,\n 0 + 10,\n 110,\n $this->black,\n $font,\n $count_notation\n );\n }\n\n if (\n $count_notation + 1 != 1 or\n $count_notation + 1 == $this->max_bar_count + 1\n ) {\n imagettftext(\n $this->image,\n $size,\n $angle,\n 200 - 25,\n 110,\n $this->black,\n $font,\n $count_notation + 1\n );\n }\n }\n }", "function imageresize($im, $width, $height) {\n list($w, $h) = [imagesx($im), imagesy($im)];\n $res = newTransparentImage($w + $width, $h + $height);\n imagecopy($res, $im, 0, 0, 0, 0, $w, $h);\n imagedestroy($im);\n return $res;\n}", "function resize($width,$height)\n {\n $new_image = imagecreatetruecolor($width, $height);\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $new_image; \n }", "public function createRectangle()\n {\n imagefilledrectangle($this->image, 0, 0, $this->width, $this->height, imagecolorallocate($this->image, 255, 255, 255));\n }", "function crop_image_square($source, $destination, $image_type, $square_size, $image_width, $image_height, $quality){\n if($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n if($image_width > $image_height)\n {\n $y_offset = 0;\n $x_offset = ($image_width - $image_height) / 2;\n $s_size \t= $image_width - ($x_offset * 2);\n }else{\n $x_offset = 0;\n $y_offset = ($image_height - $image_width) / 2;\n $s_size = $image_height - ($y_offset * 2);\n }\n $new_canvas\t= imagecreatetruecolor( $square_size, $square_size); //Create a new true color image\n\n //Copy and resize part of an image with resampling\n if(imagecopyresampled($new_canvas, $source, 0, 0, $x_offset, $y_offset, $square_size, $square_size, $s_size, $s_size)){\n save_image($new_canvas, $destination, $image_type, $quality);\n }\n\n return true;\n}", "public function setColor($color)\n\t{\n\t\t$this->color = $color;\n\t\treturn $this;\n\t}", "private function sharpenImage()\n\t{\n\t\t$this->checkImage();\n\n\t\tif (!$this->saveState && $this->sharpen == true) {\n\t\t\t$sharpness = $this->findSharp($this->width, $this->optimalWidth);\n\t\t\t$sharpenMatrix = array(\n\t\t\t\tarray(-1, -2, -1),\n\t\t\t\tarray(-2, $sharpness + 12, -2),\n\t\t\t\tarray(-1, -2, -1)\n\t\t\t);\n\t\t\t$divisor = $sharpness;\n\t\t\t$offset = 0;\n\t\t\tif (function_exists('imageconvolution')) {\n\t\t\t\timageconvolution($this->imageResized, $sharpenMatrix, $divisor, $offset);\n\t\t\t} else {\n\t\t\t\t$this->imageconvolution($this->imageResized, $sharpenMatrix, $divisor, $offset);\n\t\t\t}\n\t\t}\n\t}", "public function setColor($color)\n {\n $this->color = $color;\n\n return $this;\n }", "public function setColor($color)\n {\n $this->color = $color;\n\n return $this;\n }", "function crop_image_square($source, $destination, $image_type, $square_size, $image_width, $image_height, $quality){\n\tif($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n\tif( $image_width > $image_height )\n\t{\n\t\t$y_offset = 0;\n\t\t$x_offset = ($image_width - $image_height) / 2;\n\t\t$s_size \t= $image_width - ($x_offset * 2);\n\t}else{\n\t\t$x_offset = 0;\n\t\t$y_offset = ($image_height - $image_width) / 2;\n\t\t$s_size = $image_height - ($y_offset * 2);\n\t}\n\t$new_canvas\t= imagecreatetruecolor( $square_size, $square_size); //Create a new true color image\n\n\t//Copy and resize part of an image with resampling\n\tif(imagecopyresampled($new_canvas, $source, 0, 0, $x_offset, $y_offset, $square_size, $square_size, $s_size, $s_size)){\n\t\tsave_image($new_canvas, $destination, $image_type, $quality);\n\t}\n\n\treturn true;\n}", "function auto($psdata, $src_img, &$size_x, &$size_y, &$tcolor, &$image, &$mask) {\n if (imagecolortransparent($src_img) == -1) {\n $id = $this->solid($psdata, $src_img, $size_x, $size_y, $image, $mask);\n $tcolor = 0;\n return $id;\n } else {\n $id = $this->transparent($psdata, $src_img, $size_x, $size_y, $image, $mask);\n $tcolor = 1;\n return $id;\n };\n }", "public function __clone();", "public function __clone();", "function createThumbnail($image, $newMaxWidth, $newMaxHeight) {\n $width_orig = imagesx($image);\n $height_orig = imagesy($image);\n\n $ratio_orig = $width_orig/$height_orig;\n\n if ($newMaxWidth/$newMaxHeight > $ratio_orig) {\n $newMaxWidth = $newMaxHeight * $ratio_orig;\n } else {\n $newMaxHeight = $newMaxWidth / $ratio_orig;\n }\n\n $dst_img = imagecreatetruecolor( $newMaxWidth, $newMaxHeight );\n imagealphablending( $dst_img, false );\n imagesavealpha( $dst_img, true );\n\n imagecopyresampled($dst_img, $image,0,0,0,0,$newMaxWidth,$newMaxHeight,$width_orig,$height_orig);\n\n return $dst_img;\n}", "private function read_the_original_image_and_write() {\r\n\t\tfor ( $x = 0; $x <= $this->radius; $x += 0.01 ) {\r\n\r\n\t\t\t/* standard form for the equation of a circle ... don't tell me you never knew that ... */\r\n\t\t\t$y = sqrt( $this->diameter * $x - pow( $x , 2 ) ) + $this->radius;\r\n\r\n\t\t\t/* i think i should call this successive scans ... */\r\n\t\t\tfor ( $i = $x; $i < $this->diameter - $x; $i++ ) {\r\n\r\n\t\t\t\t/* half of the circle ... */\r\n\t\t\t\timagesetpixel (\r\n\t\t\t\t\t$this->cutted_image , $i, $y,\r\n\t\t\t\t\timagecolorat( $this->original_image, $i, $y )\r\n\t\t\t\t);\r\n\r\n\t\t\t\t/* the other half of course ... */\r\n\t\t\t\timagesetpixel (\r\n\t\t\t\t\t$this->cutted_image , $i, $this->diameter - $y,\r\n\t\t\t\t\timagecolorat( $this->original_image, $i, $this->diameter - $y )\r\n\t\t\t\t);\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t/* avoid the white line when the diameter is an even number ... */\r\n\t\tif ( ! is_float( $this->radius ) )\r\n\t\t\tfor ( $i = 0; $i < $this->diameter; $i++ )\r\n\r\n\t\t\t\timagesetpixel (\r\n\t\t\t\t\t$this->cutted_image , $i, $this->radius - 1,\r\n\t\t\t\t\timagecolorat( $this->original_image, $i, $this->radius - 1 )\r\n\t\t\t\t);\r\n\r\n\t\t/* woo ... not as difficult as you think ... that's all ... */\r\n\t\treturn;\r\n\r\n\t}", "function drawImage($imgHeight, $imgWidth)\n{\n\t# create blank img\n\t$image = imagecreatetruecolor($imgWidth, $imgHeight);\n\n\t# rainbow color scheme\n\t$rGray = imagecolorallocate($image, 119, 119, 119);\n\t$rPink = imagecolorallocate($image, 255, 17, 153);\n\t$rRed = imagecolorallocate($image, 255, 0, 0);\n\t$rOrange = imagecolorallocate($image, 255, 119, 0);\n\t$rYellow = imagecolorallocate($image, 255, 255, 0);\n\t$rGreen = imagecolorallocate($image, 0, 136, 0);\n\t$rBlue = imagecolorallocate($image, 0, 0, 255);\n\t$rIndigo = imagecolorallocate($image, 136, 0, 255);\n\t$rViolet = imagecolorallocate($image, 221, 0, 238);\n\t\n\t# jewel color scheme\n\t$jBrown = imagecolorallocate($image, 136, 68, 17);\n\t$jPink = imagecolorallocate($image, 221, 17, 68);\n\t$jRed = imagecolorallocate($image, 119, 0, 0);\n\t$jOrange = imagecolorallocate($image, 255, 68, 0);\n\t$jYellow = imagecolorallocate($image, 255, 187, 0);\n\t$jGreen = imagecolorallocate($image, 0, 153, 0);\n\t$jBlue = imagecolorallocate($image, 0, 0, 136);\n\t$jIndigo = imagecolorallocate($image, 68, 0, 136);\n\t$jViolet = imagecolorallocate($image, 153, 0, 153);\n\t\n\t# neon color scheme\n\t$nBlack = imagecolorallocate($image, 0, 0, 0);\n\t$nPink = imagecolorallocate($image, 255, 0, 204);\n\t$nRed = imagecolorallocate($image, 255, 0, 51);\n\t$nOrange = imagecolorallocate($image, 255, 51, 0);\n\t$nYellow = imagecolorallocate($image, 204, 255, 51);\n\t$nGreen = imagecolorallocate($image, 0, 255, 0);\n\t$nBlue = imagecolorallocate($image, 0, 85, 255);\n\t$nIndigo = imagecolorallocate($image, 129, 0, 255);\n\t$nViolet = imagecolorallocate($image, 204, 0, 255);\n\n\t# construct array of rainbow colors\n\t$rainbowColorsArray = array(\n\t\t$rGray, $rPink, $rRed, $rOrange, $rYellow, $rGreen, $rBlue, $rIndigo, $rViolet);\n\n\t# construct array of jewel colors\n\t$jewelColorsArray = array(\n\t\t$jBrown, $jPink, $jRed, $jOrange, $jYellow, $jGreen, $jBlue, $jIndigo, $jViolet);\n\n\t# construct array of neon colors\n\t$neonColorsArray = array(\n\t\t$nBlack, $nPink, $nRed, $nOrange, $nYellow, $nGreen, $nBlue, $nIndigo, $nViolet);\n\n\t# figure out which color scheme to use according to user input\n\t$imgColorChoice = $_POST['imgColorChoice'];\n\t\n\tif($imgColorChoice == 1)\n\t{\n\t\t$colorSchemeArray = $rainbowColorsArray;\n\t}\t\t\t\n\telse if($imgColorChoice == 2)\n\t{\n\t\t$colorSchemeArray = $jewelColorsArray;\n\t}\n\telse if($imgColorChoice == 3)\n\t{\n\t\t$colorSchemeArray = $neonColorsArray;\n\t}\n\t\n\t# fill in with background color\n\timagefill($image, 0, 0, $colorSchemeArray[0]);\n\n\t# DRAW GRAPHICS...\n\t# polygons(x2) in center of image\n\t# imagepolygon($image, array(coords of vertices in form x1,y1, x2,y2, etc.),\n\t# \tnumber of vertices, $color)\n\timagepolygon($image, array(\n\t\t100, 400, 600, 100, 700, 300, 150, 600, 100, 400), 4, $colorSchemeArray[1]);\n\timagepolygon($image, array(\n\t\t200, 300, 250, 450, 600, 500, 350, 300, 200, 250), 4, $colorSchemeArray[5]);\n\n\t# blue \"funnel\"\n\t# imageellipse($image, x-coord of ellipse center, y-coord of ellipse center,\n\t# \tellipse width, ellipse height, $color)\n\tfor($i = 0; $i < 100; $i++)\n\t{\n\t\timageellipse($image, ($i*5)+500, $i*10, $i, $i*5, $colorSchemeArray[6]);\n\t}\n\n\t# \"whirlwind\" at bottom\n\t# imagefilledellipse($image, x-coord of ellipse center, y-coord of ellipse center,\n\t# \tellipse width, ellipse height, $color, fill mode)\n\timagefilledellipse($image, 300, 730, 300, 100, $colorSchemeArray[8]);\n\t\n\t# imagefilledarc($image, x-coord of ellipse center, y-coord of ellipse center,\n\t# \tellipse width, ellipse height, start angle, end angle, $color, fill mode)\n\timagefilledarc($image, 300, 705, 250, 75, 90, 360, $colorSchemeArray[4], IMG_ARC_NOFILL);\n\timagefilledarc($image, 325, 705, 250, 75, 300, 45, $colorSchemeArray[2], IMG_ARC_NOFILL);\n\timagefilledarc($image, 330, 725, 225, 60, 0, 330, $colorSchemeArray[6], IMG_ARC_NOFILL);\n\timagefilledarc($image, 325, 680, 225, 55, 0, 300, $colorSchemeArray[1], IMG_ARC_NOFILL);\n\timagefilledarc($image, 320, 700, 225, 55, 50, 180, $colorSchemeArray[7], IMG_ARC_NOFILL);\n\timagefilledarc($image, 275, 730, 200, 70, 270, 180, $colorSchemeArray[5], IMG_ARC_NOFILL);\n\timagefilledarc($image, 335, 650, 175, 50, 0, 300, $colorSchemeArray[3], IMG_ARC_NOFILL);\n\timagefilledarc($image, 340, 670, 175, 55, 250, 60, $colorSchemeArray[4], IMG_ARC_NOFILL);\n\n\t# star polygon\n\t# imagepolygon($image, array(coords of vertices in form x1,y1, x2,y2, etc.),\n\t# \tnumber of vertices, $color)\n\tfor($i = 0; $i < 10; $i++)\n\t{\n\t\timagepolygon($image, array(\n\t\t\t0, 20, \n\t\t\t733-($i*3), ($i*3)+33, \n\t\t\t750-($i*3), ($i*3)+$i, \n\t\t\t766-($i*3), ($i*3)+33, \n\t\t\t800-($i*3), ($i*3)+33, \n\t\t\t775-($i*3), ($i*3)+66, \n\t\t\t800-($i*3), ($i*3)+100, \n\t\t\t755-($i*3), ($i*3)+85, \n\t\t\t780, 800, \n\t\t\t725, ($i*3)+66, \n\t\t\t0, 20), \n\t\t\t10, $colorSchemeArray[5]);\n\t}\n\n\t# interconnected loops\n\t# imagearc($image, x-coord of ellipse center, y-coord of ellipse center,\n\t# \tellipse width, ellipse height, start angle, end angle, $color)\n\tfor($i = 0; $i < 50; $i++)\n\t{\n\t\timagearc($image, 600, 700, ($i+100), ($i+100), 0, 360, $colorSchemeArray[1]);\n\t\timagearc($image, 600, 500, ($i+100), ($i+100), 0, 360, $colorSchemeArray[4]);\n\t\timagearc($image, 600, 600, ($i+100), ($i+100), 0, 360, $colorSchemeArray[5]);\n\t\timagearc($image, 700, 600, ($i+100), ($i+100), 0, 360, $colorSchemeArray[1]);\n\t\timagearc($image, 500, 600, ($i+100), ($i+100), 0, 360, $colorSchemeArray[4]);\t\n\t}\n\n\t# \"beach ball\"\t \n\t# imagefilledarc($image, x-coord of ellipse center, y-coord of ellipse center,\n\t# \tellipse width, ellipse height, start angle, end angle, $color, fill mode)\n\timagefilledarc($image, 110, 110, 200, 200, 0, 50, $colorSchemeArray[2], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 200, 200, 60, 110, $colorSchemeArray[6], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 200, 200, 120, 170, $colorSchemeArray[1], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 200, 200, 180, 230, $colorSchemeArray[5], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 200, 200, 240, 290, $colorSchemeArray[3], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 200, 200, 300, 350, $colorSchemeArray[4], IMG_ARC_CHORD);\n\t\n\t# give each segment of \"beach ball\" a \"cutout\"\n\t# imagefilledarc($image, x-coord of ellipse center, y-coord of ellipse center,\n\t# \tellipse width, ellipse height, start angle, end angle, $color, fill mode)\n\timagefilledarc($image, 110, 110, 150, 150, 2, 48, $colorSchemeArray[0], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 150, 150, 62, 108, $colorSchemeArray[0], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 150, 150, 122, 168, $colorSchemeArray[0], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 150, 150, 182, 228, $colorSchemeArray[0], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 150, 150, 242, 288, $colorSchemeArray[0], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 150, 150, 302, 348, $colorSchemeArray[0], IMG_ARC_CHORD);\n\n\t# lines fanning out\n\t# imageline($image, x1, y1, x2, y2, $color). \n\t# draws line from coords (x1,y1) to (x2,y2).\n\tfor($i = 0; $i < 70; $i++)\n\t{\n\t\timageline($image, 0, 800, $i*5, $i+500, $colorSchemeArray[7]);\n\t\timageline($image, 300, 500, $i*5, $i+500, $colorSchemeArray[3]);\n\t}\n\n\t# thick crossing lines\n\timagesetthickness($image, 25);\n\n\t# imageline($image, x1, y1, x2, y2, $color). \n\t# draws line from coords (x1,y1) to (x2,y2).\n\timageline($image, 350, 0, 0, 450, $colorSchemeArray[8]);\n\timageline($image, 360, 0, 0, 460, $colorSchemeArray[5]);\n\timageline($image, 380, 0, 0, 480, $colorSchemeArray[2]);\n\n\timageline($image, 0, 400, 450, 0, $colorSchemeArray[1]);\n\timageline($image, 0, 410, 460, 0, $colorSchemeArray[4]);\n\timageline($image, 0, 430, 480, 0, $colorSchemeArray[7]);\n\n\t# save img out to temp directory\n\timagepng($image, \"../temp/tempPNG.png\");\n\n\t# output img according to user-supplied dimensions\n\techo \"\t<img src='../temp/tempPNG.png' alt='artistic expression image' \".\n\t\"height='$imgHeight' width='$imgWidth' />\\n\";\n\n\t# clear buffer of image\n\timagedestroy($image);\n}", "function RectPattern3DPlane($aColor=\"black\",$aWeight=1) {\n\tparent::RectPattern($aColor,$aWeight);\n\t$this->SetDensity(10); // Slightly larger default\n }", "public function color($color)\n {\n $this->color = $color;\n\n return $this;\n }", "public function color($color)\n {\n $this->color = $color;\n\n return $this;\n }", "public function resizeInSquareFromFile($src_name,$dest_name,$newwidth,$newheight,$background,$ext)\n {\n //Check extension of file\n if(empty($ext))\n {\n $ext = $this->options[parent::IMAGE_ITEM_DEFAULT_TYPE];\n }\n\n //Create image source from file name\n $source_image = $this->createSourceImage($src_name,$ext);\n \n //Check source\n if(!$source_image)\n {\n return false;\n }\n\n //Check background\n if(empty($background))\n {\n $background = $this->options[self::IMAGE_ITEM_BACKGROUND];\n }\n\n //Check new height\n if(empty($newheight))\n {\n $newheight = $newwidth;\n }\n\n //Get old size\n $old_x = imagesx($source_image);\n $old_y = imagesy($source_image);\n\n //Check have correct site\n if($old_x <= $newwidth && $old_y <= $newheight)\n {\n //Destroy image source\n imagedestroy($source_image);\n\n //Return image file\n return copy($src_name,$dest_name);\n }\n\n //Resize keep width\n if($old_x < $newwidth)\n {\n //Check size\n $newwidth = $old_x;\n if($newwidth > $newheight)\n {\n $newwidth = $newheight;\n }\n\n //Crop image \n $dest_image = imagecreatetruecolor($newwidth, $newheight);\n imagecopyresampled($dest_image, $source_image, 0, 0, 0, 0, $newwidth , $newheight, $newwidth, $newheight);\n }\n else\n {\n $newheight = ceil((($newwidth*$old_y)/$old_x));\n $dest_image = imagecreatetruecolor($newwidth, $newwidth);\n list($r,$g,$b) = explode(\",\",$background);\n $color= imagecolorallocate($dest_image, $r, $g, $b);\n $move_space =0;\n if($old_x > $old_y )\n {\n $move_space = ceil(($newwidth - $newheight)/2);\n }\n\n //Check size\n if($old_y < $newwidth)\n {\n $newwidth = $old_y;\n $newheight = $newwidth;\n } \n\n //Crop image\n imagefill($dest_image,0,0,$color);\n imagecopyresampled($dest_image, $source_image, 0, -$move_space, 0, 0, $newwidth , $newheight, $old_x, $old_y);\n }\n\n //Put binary string\n imagejpeg($dest_image,$dest_name,$this->options[parent::IMAGE_ITEM_QUALITY]);\n\n //Destroy images\n imagedestroy($dest_image);\n imagedestroy($source_image);\n\n //Return boolean\n return true;\n }", "function new_image( $w = 0, $h = 0 )\n\t{\n\t\t$this->im = imagecreatetruecolor( $w, $h );\n\t\treturn TRUE;\n\t}" ]
[ "0.56789774", "0.5674645", "0.5539324", "0.5478769", "0.5323904", "0.530985", "0.52030927", "0.51074916", "0.5093699", "0.5056652", "0.50259376", "0.49967209", "0.49957815", "0.49675417", "0.49555638", "0.49253905", "0.49153274", "0.4911768", "0.49092442", "0.4903191", "0.48859966", "0.48819995", "0.4843914", "0.48421565", "0.48308414", "0.48168582", "0.47960585", "0.47957894", "0.4792384", "0.47848368", "0.47627577", "0.47597566", "0.47590023", "0.47552255", "0.4751564", "0.473244", "0.47307667", "0.4729674", "0.47212484", "0.47165123", "0.47105056", "0.47030297", "0.46980214", "0.46905696", "0.46816915", "0.46656165", "0.46621728", "0.46539444", "0.46452326", "0.4644889", "0.46396443", "0.46066454", "0.46009806", "0.4593707", "0.4592846", "0.45917207", "0.45812455", "0.45780337", "0.4577692", "0.45740655", "0.45736918", "0.45701954", "0.4565276", "0.45552075", "0.45355904", "0.45268837", "0.4499554", "0.44961926", "0.44930145", "0.44930145", "0.44896176", "0.44788578", "0.44722596", "0.44721696", "0.44703922", "0.4469157", "0.44658378", "0.4459937", "0.4459192", "0.44544363", "0.44529095", "0.44527167", "0.44500694", "0.44481787", "0.44472307", "0.44395477", "0.4432493", "0.44315633", "0.44315633", "0.44298056", "0.44241735", "0.44238415", "0.44238415", "0.44141376", "0.44096187", "0.44095793", "0.44066995", "0.4392038", "0.4392038", "0.43870184", "0.4382616" ]
0.0
-1
Resize an image to cover the given width/height completely, and crop off any overhanging edges.
public function croppedResize($width, $height) { return $this->createCloneWithResource( function (InterventionImage $resource) use ($width, $height) { return $resource->fit($width, $height); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function crop( $x = 0, $y = 0, $w = 0, $h = 0 )\n\t{\n\t\tif( $w == 0 || $h == 0 )\n\t\t\treturn FALSE;\n\t\t\n\t\t//create a target canvas\n\t\t$new_im = imagecreatetruecolor ( $w, $h );\n\t\n\t\t//copy and resize image to new canvas\n\t\timagecopyresampled( $new_im, $this->im, 0, 0, $x, $y, $w, $h, $w, $h );\n\t\t\n\t\t//delete the old image handle\n\t\timagedestroy( $this->im );\n\t\t\n\t\t//set the new image as the current handle\n\t\t$this->im = $new_im;\n\t}", "public function crop_image($w, $h)\n\t{\n // This function resizes this image to fit in the box $w x $h, cropping to fill the entire image\n $image_size = $this->image_size();\n if ($image_size[0] == $w && $image_size[1] == $h) {\n // No need to crop\n return;\n }\n $ratio = $image_size[0] / $image_size[1];\n $goal_ratio = $w / $h;\n\n // Calculate the new image size\n if ($ratio < $goal_ratio) {\n // Tall image, crop top and bottom\n $l = 0;\n $r = $image_size[0];\n $height = $image_size[0] / $goal_ratio;\n $t = ($image_size[1] / 2) - ($height / 2);\n $b = ($image_size[1] / 2) + ($height / 2);\n } else {\n // Wide image, crop top and bottom\n $t = 0;\n $b = $image_size[1];\n $width = $image_size[1] * $goal_ratio;\n $l = ($image_size[0] / 2) - ($width / 2);\n $r = ($image_size[0] / 2) + ($width / 2);\n }\n\n // Create a new image for the resized image\n $oldimage = $this->load_image();\n $newimage = imagecreatetruecolor($w, $h);\n imagecopyresampled($newimage, $oldimage, 0, 0, $l, $t, $w, $h, $r - $l, $b - $t);\n $filename = tempnam(sys_get_temp_dir(), 'img');\n if (preg_match('/jpeg/', $image_size['mime'])) {\n imagejpeg($newimage, $filename, 100);\n } elseif (preg_match('/gif/', $image_size['mime'])) {\n imagegif($newimage, $filename);\n } elseif (preg_match('/png/', $image_size['mime'])) {\n imagepng($newimage, $filename);\n }\n $this->delete_local_file();\n $this->local_file = $filename;\n\t}", "public function runCropResize(Image $image, int $width, int $height) : Image\n\t{\n\t\tlist($resize_width, $resize_height) = $this->resolveCropResizeDimensions($image, $width, $height);\n\t\t$zoom = $this->getCrop()[2];\n\t\t$image->resize($resize_width * $zoom, $resize_height * $zoom, function ($constraint) {\n\t\t\t$constraint->aspectRatio();\n\t\t});\n\t\t\t\n\t\tlist($offset_x, $offset_y) = $this->resolveCropOffset($image, $width, $height);\n\t\t\t\n\t\treturn $image->crop($width, $height, $offset_x, $offset_y);\n\t}", "function resize_crop_image($max_width, $max_height, $source_file, $dst_dir, $quality=80){\r\n $imgsize = getimagesize($source_file);\r\n $width = $imgsize[0];\r\n $height = $imgsize[1];\r\n $mime = $imgsize['mime'];\r\n\r\n switch($mime){\r\n case 'image/gif':\r\n $image_create = \"imagecreatefromgif\";\r\n $image = \"imagegif\";\r\n break;\r\n\r\n case 'image/png':\r\n $image_create = \"imagecreatefrompng\";\r\n $image = \"imagepng\";\r\n //$quality = 7;\r\n break;\r\n\r\n case 'image/jpeg':\r\n $image_create = \"imagecreatefromjpeg\";\r\n $image = \"imagejpeg\";\r\n break;\r\n\r\n default:\r\n return false;\r\n break;\r\n }\r\n\r\n $dst_img = imagecreatetruecolor($max_width, $max_height);\r\n $src_img = $image_create($source_file);\r\n\r\n $width_new = $height * $max_width / $max_height;\r\n $height_new = $width * $max_height / $max_width;\r\n //if the new width is greater than the actual width of the image, then the height is too large and the rest cut off, or vice versa\r\n if($width_new > $width){\r\n //cut point by height\r\n $h_point = (($height - $height_new) / 2);\r\n //copy image\r\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, $h_point, $max_width, $max_height, $width, $height_new);\r\n }else{\r\n //cut point by width\r\n $w_point = (($width - $width_new) / 2);\r\n imagecopyresampled($dst_img, $src_img, 0, 0, $w_point, 0, $max_width, $max_height, $width_new, $height);\r\n }\r\n\r\n //$image($dst_img, $dst_dir, $quality);\r\n imagejpeg($dst_img, $dst_dir, $quality);\r\n\r\n if($dst_img)imagedestroy($dst_img);\r\n if($src_img)imagedestroy($src_img);\r\n}", "public function crop($width, $height)\n\t{\n\t\t// Resize to minimum size\n\t\t$wScale = $this->width / $width; // 4\n\t\t$hScale = $this->height / $height; // 3\n\t\t$minScale = min($wScale, $hScale);\n\t\t// Decrease image dimensions\n\t\tif($minScale > 1)\n\t\t{\n\t\t\t$widthResize = $this->width / $minScale;\n\t\t\t$heightResize = $this->height / $minScale;\n\t\t}\n\t\t// Increase image dimensions\n\t\telse\n\t\t{\n\t\t\t$widthResize = $this->width / $minScale;\n\t\t\t$heightResize = $this->height / $minScale;\n\t\t}\n\t\t$image = imagecreatetruecolor($width, $height);\n\t\t$x = ($widthResize - $width) / 2;\n\t\t$y = ($heightResize - $height) / 2;\n\t\timagecopyresampled($image, $this->image, 0, 0, $x, $y, $width, $height, $widthResize, $heightResize);\n\n\t\t$this->image = $image;\n\t\t$this->width = $width;\n\t\t$this->height = $height;\n\t}", "public function resize($width, $height, $crop_top = 0, $crop_bottom = 0, $crop_left = 0, $crop_right = 0) {}", "function _crop_image_resource($img, $x, $y, $w, $h)\n {\n }", "public function crop(IImageInformation $src, $x, $y, $width, $height);", "public function crop($width, $height, $offset_x=null, $offset_y=null);", "public function resize_crop_image($max_width, $max_height, $source_file, $dst_dir, $quality = 80)\n {\n $imgsize = getimagesize($source_file);\n $width = $imgsize[0];\n $height = $imgsize[1];\n $mime = $imgsize['mime'];\n\n switch ($mime) {\n case 'image/gif':\n $image_create = 'imagecreatefromgif';\n $image = 'imagegif';\n break;\n\n case 'image/png':\n $image_create = 'imagecreatefrompng';\n $image = 'imagepng';\n $quality = 7;\n break;\n\n case 'image/jpeg':\n $image_create = 'imagecreatefromjpeg';\n $image = 'imagejpeg';\n $quality = 80;\n break;\n\n default:\n return false;\n }\n\n $dst_img = imagecreatetruecolor($max_width, $max_height);\n $src_img = $image_create($source_file);\n\n $width_new = $height * $max_width / $max_height;\n $height_new = $width * $max_height / $max_width;\n //if the new width is greater than the actual width of the image, then the height is too large and the rest cut off, or vice versa\n if ($width_new > $width) {\n //cut point by height\n $h_point = (($height - $height_new) / 2);\n //copy image\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, $h_point, $max_width, $max_height, $width, $height_new);\n } else {\n //cut point by width\n $w_point = (($width - $width_new) / 2);\n imagecopyresampled($dst_img, $src_img, 0, 0, $w_point, 0, $max_width, $max_height, $width_new, $height);\n }\n\n $image($dst_img, $dst_dir, $quality);\n\n if ($dst_img) {\n imagedestroy($dst_img);\n }\n if ($src_img) {\n imagedestroy($src_img);\n }\n }", "public function sizeImg($width, $height, $crop = true);", "protected function resize()\n {\n $width = $this->width;\n $height = $this->height;\n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n // Determine new image dimensions\n if($this->mode === \"crop\"){ // Crop image\n \n $max_width = $crop_width = $width;\n $max_height = $crop_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if($orig_width > $orig_height){ // Original is wide\n $height = $max_height;\n $width = ceil($y_ratio * $orig_width);\n \n } elseif($orig_height > $orig_width){ // Original is tall\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n \n } else { // Original is square\n $this->mode = \"fit\";\n \n return $this->resize();\n }\n \n // Adjust if the crop width is less than the requested width to avoid black lines\n if($width < $crop_width){\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n }\n \n } elseif($this->mode === \"fit\"){ // Fits the image according to aspect ratio to within max height and width\n $max_width = $width;\n $max_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if( ($orig_width <= $max_width) && ($orig_height <= $max_height) ){ // Image is smaller than max height and width so don't resize\n $tn_width = $orig_width;\n $tn_height = $orig_height;\n \n } elseif(($x_ratio * $orig_height) < $max_height){ // Wider rather than taller\n $tn_height = ceil($x_ratio * $orig_height);\n $tn_width = $max_width;\n \n } else { // Taller rather than wider\n $tn_width = ceil($y_ratio * $orig_width);\n $tn_height = $max_height;\n }\n \n $width = $tn_width;\n $height = $tn_height;\n \n } elseif($this->mode === \"fit-x\"){ // Sets the width to the max width and the height according to aspect ratio (will stretch if too small)\n $height = @round($orig_height * $width / $orig_width);\n \n if($orig_height <= $height){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n \n } elseif($this->mode === \"fit-y\"){ // Sets the height to the max height and the width according to aspect ratio (will stretch if too small)\n $width = @round($orig_width * $height / $orig_height);\n \n if($orig_width <= $width){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n } else {\n throw new \\Exception('Invalid mode: ' . $this->mode);\n }\n \n\n // Resize\n $this->temp = imagecreatetruecolor($width, $height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n \n imagecopyresampled($this->temp, $this->image, 0, 0, 0, 0, $width, $height, $orig_width, $orig_height);\n $this->sync();\n \n \n // Cropping?\n if($this->mode === \"crop\"){ \n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n $x_mid = $orig_width/2; // horizontal middle\n $y_mid = $orig_height/2; // vertical middle\n \n $this->temp = imagecreatetruecolor($crop_width, $crop_height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n\n imagecopyresampled($this->temp, $this->image, 0, 0, ($x_mid-($crop_width/2)), ($y_mid-($crop_height/2)), $crop_width, $crop_height, $crop_width, $crop_height);\n $this->sync();\n }\n }", "private function intern_resize_crop($newWidth, $newHeight)\n\t{\n\t\t/*\n\t\t * Crop-to-fit PHP-GD\n\t\t * http://salman-w.blogspot.com/2009/04/crop-to-fit-image-using-aspphp.html\n\t\t *\n\t\t * Resize and center crop an arbitrary size image to fixed width and height\n\t\t * e.g. convert a large portrait/landscape image to a small square thumbnail\n\t\t *\n\t\t * Modified by Fry\n\t\t */\n\t\t$desired_aspect_ratio = $newWidth / $newHeight;\n\n\t\tif ($this->srcAspectRatio > $desired_aspect_ratio) {\n\t\t\t/*\n\t\t\t * Triggered when source image is wider\n\t\t\t */\n\t\t\t$temp_height = $newHeight;\n\t\t\t$temp_width = ( int ) ($newHeight * $this->srcAspectRatio);\n\t\t} else {\n\t\t\t/*\n\t\t\t * Triggered otherwise (i.e. source image is similar or taller)\n\t\t\t */\n\t\t\t$temp_width = $newWidth;\n\t\t\t$temp_height = ( int ) ($newWidth / $this->srcAspectRatio);\n\t\t}\n\n\t\t/*\n\t\t * Resize the image into a temporary GD image\n\t\t */\n\n\t\t$tempImage = imagecreatetruecolor($temp_width, $temp_height);\n\t\timagecopyresampled(\n\t\t\t$tempImage,\t\t\t\t\t$this->srcImage,\n\t\t\t0, 0,\t\t\t0, 0,\n\t\t\t$temp_width, $temp_height,\t$this->srcWidth, $this->srcHeight\n\t\t);\n\n\t\t/*\n\t\t * Copy cropped region from temporary image into the desired GD image\n\t\t */\n\n\t\t$x0 = ($temp_width - $newWidth) / 2;\n\t\t$y0 = ($temp_height - $newHeight) / 2;\n\t\t$this->newImage = imagecreatetruecolor($newWidth, $newHeight);\n\t\timagecopy(\n\t\t\t$this->newImage,\t$tempImage,\n\t\t\t0, 0,\t$x0, $y0,\n\t\t\t$newWidth, $newHeight\n\t\t);\n\t\timagedestroy($tempImage);\n\t}", "protected function resize_crop_image($max_width, $max_height, $source_file, $dst_dir, $quality = 80)\n {\n $imgsize = getimagesize($source_file);\n $width = $imgsize[0];\n $height = $imgsize[1];\n $mime = $imgsize['mime'];\n \n switch($mime){\n case 'image/gif':\n $image_create = \"imagecreatefromgif\";\n $image = \"imagegif\";\n break;\n \n case 'image/png':\n $image_create = \"imagecreatefrompng\";\n $image = \"imagepng\";\n $quality = 7;\n break;\n \n case 'image/jpeg':\n $image_create = \"imagecreatefromjpeg\";\n $image = \"imagejpeg\";\n $quality = 80;\n break;\n \n default:\n return false;\n break;\n }\n \n $dst_img = imagecreatetruecolor($max_width, $max_height);\n $src_img = $image_create($source_file);\n \n $width_new = $height * $max_width / $max_height;\n $height_new = $width * $max_height / $max_width;\n //if the new width is greater than the actual width of the image, then the height is too large and the rest cut off, or vice versa\n if($width_new > $width){\n //cut point by height\n $h_point = (($height - $height_new) / 2);\n //copy image\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, $h_point, $max_width, $max_height, $width, $height_new);\n }else{\n //cut point by width\n $w_point = (($width - $width_new) / 2);\n imagecopyresampled($dst_img, $src_img, 0, 0, $w_point, 0, $max_width, $max_height, $width_new, $height);\n }\n \n $image($dst_img, $dst_dir, $quality);\n \n if($dst_img)imagedestroy($dst_img);\n if($src_img)imagedestroy($src_img);\n }", "function cropImage($param=array())\r\n {\r\n $ret = array(\r\n 'msg' => false,\r\n 'sts' => false,\r\n );\r\n\r\n $final_size = $param['final_size'];\r\n #$filename = $final_size.'-'.$param['img_newname'];\r\n $filename = $param['img_newname'];\r\n $target_dir = $param['dest_path'];\r\n $target_name = $target_dir.$filename;\r\n $source_name = $param['img_real'];\r\n \r\n //get size from real image \r\n $size = getimagesize($source_name);\r\n $targ_w = $param['w'];\r\n $targ_h = $param['h'];\r\n\r\n //get size from ratio\r\n $final_size = explode(\"x\", $final_size);\r\n $final_w = $final_size[0];\r\n $final_h = $final_size[1];\r\n \r\n if($final_w==='auto' && $final_h==='auto'){ //detect if width and height ratio is \"auto\" then readjust width and height size\r\n $final_w = $targ_w;\r\n $final_h = $targ_h;\r\n }elseif($final_w==='auto'){ //detect if width ratio is \"auto\" then readjust width size\r\n $final_w = intval(($final_size[1] * $targ_w) / $targ_h);\r\n }elseif($final_h==='auto'){ //detect if height ratio is \"auto\" then readjust height size\r\n $final_h = intval(($final_size[0] * $targ_h) / $targ_w);\r\n }\r\n //end\r\n \r\n \r\n $jpeg_quality = 90;\r\n $img_r = imagecreatefromjpeg($source_name);\r\n $dst_r = ImageCreateTrueColor( $final_w, $final_h );\r\n \r\n imagecopyresized(\r\n $dst_r, $img_r, \r\n 0,0, \r\n $param['x'],$param['y'], \r\n $final_w,$final_h,\r\n $param['w'],$param['h']\r\n );\r\n \r\n imagejpeg($dst_r,$target_name,$jpeg_quality);\r\n #$this->send_to_server( array($target_name) );\r\n $url_target_name = str_replace('/data/shopkl/_assets/', 'http://klimg.com/kapanlagi.com/klshop/', $target_name);\r\n \r\n\t\t\t\r\n //find image parent url and dir path from config\r\n //reset($this->imgsize['article']['size']);\r\n //$first_key = key($this->imgsize['article']['size']);\r\n //end find\r\n $ret['sts'] = true;\r\n $ret['filename'] = $filename;\r\n $ret['msg'] = '<div class=\"alert alert-success\">Image is cropped and saved in <a href=\"'. $url_target_name .'?'.date('his').'\" target=\"_blank\">'.$target_name.' !</a></div>';\r\n \r\n return $ret;\r\n }", "function resizeCropImage($src, $dst, $dstx, $dsty){\n\t\t//$dst = destination image location\n\t\t//$dstx = user defined width of image\n\t\t//$dsty = user defined height of image\n\t\t$allowedExtensions = 'jpg jpeg gif png';\n\t\t$name = explode(\".\", strtolower($src));\n\t\t$currentExtensions = $name[count($name)-1];\n\t\t$extensions = explode(\" \", $allowedExtensions);\n\n\t\tfor($i=0; count($extensions)>$i; $i=$i+1) {\n\t\t\tif($extensions[$i]==$currentExtensions)\n\t\t\t{ \n\t\t\t\t$extensionOK=1; \n\t\t\t\t$fileExtension=$extensions[$i]; \n\t\t\t\tbreak; \n\t\t\t}\n\t\t}\n\n\t\tif($extensionOK){\n\t\t\t$size = getImageSize($src);\n\t\t\t$width = $size[0];\n\t\t\t$height = $size[1];\n\t\t\tif($width >= $dstx AND $height >= $dsty){\n\t\t\t\t$proportion_X = $width / $dstx;\n\t\t\t\t$proportion_Y = $height / $dsty;\n\t\t\t\tif($proportion_X > $proportion_Y ){\n\t\t\t\t\t$proportion = $proportion_Y;\n\t\t\t\t}else{\n\t\t\t\t\t$proportion = $proportion_X ;\n\t\t\t\t}\n\t\t\t\t$target['width'] = $dstx * $proportion;\n\t\t\t\t$target['height'] = $dsty * $proportion;\n\t\t\t\t$original['diagonal_center'] = round(sqrt(($width*$width)+($height*$height))/2);\n\t\t\t\t$target['diagonal_center'] = round(sqrt(($target['width']*$target['width']) + ($target['height']*$target['height']))/2);\n\t\t\t\t$crop = round($original['diagonal_center'] - $target['diagonal_center']);\n\t\t\t\tif($proportion_X < $proportion_Y ){\n\t\t\t\t\t$target['x'] = 0;\n\t\t\t\t\t$target['y'] = round((($height/2)*$crop)/$target['diagonal_center']);\n\t\t\t\t}else{\n\t\t\t\t\t$target['x'] = round((($width/2)*$crop)/$target['diagonal_center']);\n\t\t\t\t\t$target['y'] = 0;\n\t\t\t\t}\n\t\t\t\tif($fileExtension == \"jpg\" OR $fileExtension=='jpeg'){ \n\t\t\t\t\t$from = ImageCreateFromJpeg($src); \n\t\t\t\t} elseif ($fileExtension == \"gif\"){ \n\t\t\t\t\t$from = ImageCreateFromGIF($src); \n\t\t\t\t} elseif ($fileExtension == 'png'){\n\t\t\t\t\t$from = imageCreateFromPNG($src);\n\t\t\t\t}\n\t\t\t\t$new = ImageCreateTrueColor ($dstx,$dsty);\n\t\t\t\timagecopyresampled ($new, $from, 0, 0, $target['x'], \n\t\t\t\t$target['y'], $dstx, $dsty, $target['width'], $target['height']);\n\t\t\t\tif($fileExtension == \"jpg\" OR $fileExtension == 'jpeg'){ \n\t\t\t\t\timagejpeg($new, $dst, 70); \n\t\t\t\t} elseif ($fileExtension == \"gif\"){ \n\t\t\t\t\timagegif($new, $dst); \n\t\t\t\t}elseif ($fileExtension == 'png'){\n\t\t\t\t\timagepng($new, $dst);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcopy($src, $dst);\n\t\t\t}\n\t\t}\n\t}", "public function runFillMaxResize(Image $image, $width, $height) : Image\n {\n\t\treturn $this->runContainResize($image, $width, $height)->resizeCanvas($width, $height, 'center');\n }", "public function resize($image, $width, $height)\n {\n $origWidth = imagesx($image);\n $origHeight = imagesy($image);\n \n $ratio = min(array($origWidth, $origHeight)) / max($width, $height);\n \n $w = $origWidth * $ratio;\n $h = $origHeight * $ratio;\n \n $cropped = imagecreatetruecolor($width, $height);\n imagecopyresampled($cropped, $image, 0, 0, 0, 0, $origWidth, $origHeight, $w, $h);\n return $cropped;\n }", "function crop_image_square($source, $destination, $image_type, $square_size, $image_width, $image_height, $quality){\n if($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n if($image_width > $image_height)\n {\n $y_offset = 0;\n $x_offset = ($image_width - $image_height) / 2;\n $s_size \t= $image_width - ($x_offset * 2);\n }else{\n $x_offset = 0;\n $y_offset = ($image_height - $image_width) / 2;\n $s_size = $image_height - ($y_offset * 2);\n }\n $new_canvas\t= imagecreatetruecolor( $square_size, $square_size); //Create a new true color image\n\n //Copy and resize part of an image with resampling\n if(imagecopyresampled($new_canvas, $source, 0, 0, $x_offset, $y_offset, $square_size, $square_size, $s_size, $s_size)){\n save_image($new_canvas, $destination, $image_type, $quality);\n }\n\n return true;\n}", "public function runStretchResize(Image $image, int $width, int $height) : Image\n\t{\n\t\treturn $image->resize($width, $height);\n\t}", "function cropRatioImage(&$srcImage, $src_width, $src_height, $desiredWidth = 0, $desiredHeight = 0)\n\t{\n\t\t// if only one size is specified\n\t\tif ($desiredWidth == '*' || $desiredHeight == '*')\n\t\t{\n\t\t\t$new_size = $this->calculateSize($src_width, $src_height, $desiredWidth, $desiredHeight);\n\t\t\t$desiredWidth = $new_size['width'];\n\t\t\t$desiredHeight = $new_size['height'];\n\t\t}\n\t\t\n\t\t// get aspect ratio\n\t\t$ratioW = $src_width / $desiredWidth;\n\t\t$ratioH = $src_height / $desiredHeight;\n\t\t\n\t\t$ratio = ($ratioW < $ratioH)?$ratioW:$ratioH;\n\t\t\t\n\t\t// calculate new height and width based on the ratio\n\t\t$new_width = floor($desiredWidth * $ratio);\n\t\t$new_height = floor($desiredHeight * $ratio);\n\t\t\n\t\t// calculate crop start position\n\t\t$startX = floor(($src_width - $new_width) / 2);\n\t\t$startY = floor(($src_height - $new_height) / 2);\n\t\t\n\t\treturn $this->cropImage($srcImage, $startX, $startY, $new_width, $new_height);\n\t}", "function crop_image_square($source, $destination, $image_type, $square_size, $image_width, $image_height, $quality){\n\tif($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n\tif( $image_width > $image_height )\n\t{\n\t\t$y_offset = 0;\n\t\t$x_offset = ($image_width - $image_height) / 2;\n\t\t$s_size \t= $image_width - ($x_offset * 2);\n\t}else{\n\t\t$x_offset = 0;\n\t\t$y_offset = ($image_height - $image_width) / 2;\n\t\t$s_size = $image_height - ($y_offset * 2);\n\t}\n\t$new_canvas\t= imagecreatetruecolor( $square_size, $square_size); //Create a new true color image\n\n\t//Copy and resize part of an image with resampling\n\tif(imagecopyresampled($new_canvas, $source, 0, 0, $x_offset, $y_offset, $square_size, $square_size, $s_size, $s_size)){\n\t\tsave_image($new_canvas, $destination, $image_type, $quality);\n\t}\n\n\treturn true;\n}", "protected function _image_resize($src, $dst, $width, $height, $crop=0) {\n\n\t\tif( ! list($w, $h) = getimagesize($src)) {\n\t\t\treturn \"Unsupported picture type!\";\n\t\t}\n\n\t\t$type = strtolower(pathinfo($src, PATHINFO_EXTENSION));\n\t\t\n\t\tif($type == 'jpeg') {\n\t\t\t$type = 'jpg';\n\t\t}\n\t\tswitch($type){\n\t\t\tcase 'bmp': $img = imagecreatefromwbmp($src); break;\n\t\t\tcase 'gif': $img = imagecreatefromgif($src); break;\n\t\t\tcase 'jpg': $img = imagecreatefromjpeg($src); break;\n\t\t\tcase 'png': $img = imagecreatefrompng($src); break;\n\t\t\tdefault : \n\t\t\t\treturn \"Unsupported picture type!\";\n\t\t}\n\n\t\t// resize\n\t\tif($crop){\n\t\t\tif($w < $width or $h < $height) {\n\t\t\t\treturn \"Picture is too small!\";\n\t\t\t}\n\t\t $ratio = max($width/$w, $height/$h);\n\t\t $h = $height / $ratio;\n\t\t $x = ($w - $width / $ratio) / 2;\n\t\t $w = $width / $ratio;\n\t\t }\n\t\t else{\n\t\t if($w < $width and $h < $height) {\n\t\t\t\treturn \"Picture is too small!\";\n\t\t\t}\n\t\t\t\n\t\t\tif( $h > $w ) {\n\t\t\t\t$width = ($height * $w) / $h;\n\t\t\t} else {\n\t\t\t\t$ratio = min($width/$w, $height/$h);\n\t\t\t\t$width = $w * $ratio;\n\t\t\t\t$height = $h * $ratio;\n\t\t\t}\n\t\t\t\n\t\t\t$x = 0;\n\t\t}\n \t\n\t\t$new = imagecreatetruecolor($width, $height);\n \t\n\t\t// preserve transparency\n\t\tif($type == \"gif\" or $type == \"png\") {\n\t\t\timagecolortransparent($new, imagecolorallocatealpha($new, 0, 0, 0, 127));\n\t\t\timagealphablending($new, false);\n\t\t\timagesavealpha($new, true);\n\t\t}\n \t\n\t\timagecopyresampled($new, $img, 0, 0, $x, 0, $width, $height, $w, $h);\n \t\n\t\tswitch($type){\n\t\t\tcase 'bmp': imagewbmp($new, $dst); break;\n\t\t\tcase 'gif': imagegif($new, $dst); break;\n\t\t\tcase 'jpg': imagejpeg($new, $dst, 92); break;\n\t\t\tcase 'png': imagepng($new, $dst, 2); break;\n\t\t}\n\t\treturn true;\n\t}", "function cropimage($source_url, $new_width=250, $quality=75){\n return false;\n \n if (!file_exists($source_url)){\n echo alertbuilder(\"File does not exist: $source_url\",'warning');\n return false;\n }\n \n //separate the file name and the extention\n $source_url_parts = pathinfo($source_url);\n $filename = $source_url_parts['filename'];\n $extension = strtolower($source_url_parts['extension']);\n \n //detect the width and the height of original image\n $info = getimagesize($source_url);\n \n if($info === false){\n echo alertbuilder('This file is not a valid image', 'warning');\n return false;\n }\n \n $type = $info[2];\n $width = $info[0];\n $height = $info[1];\n \n // resize only when the original image is larger than new width.\n // this helps you to avoid from unwanted resizing.\n if ($width > $new_width) {\n // cool to resize\n } else {\n echo alertbuilder('The image is already smaller than width', 'warning');\n return false;\n }\n \n //get the reduced width\n $reduced_width = ($width - $new_width);\n \n //now convert the reduced width to a percentage, round to 2 decimals\n $reduced_radio = round(($reduced_width / $width) * 100, 2);\n \n // reduce the same percentage from the height, round to 2 decimals\n $reduced_height = round(($height / 100) * $reduced_radio, 2);\n \n //reduce the calculated height from the original height\n $new_height = $height - $reduced_height;\n \n $img = null;\n $imgResized = null;\n \n switch($type) {\n case IMAGETYPE_JPEG:\n $img = imagecreatefromjpeg($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagejpeg($imgResized, $source_url); \n break;\n \n case IMAGETYPE_GIF:\n $img = imagecreatefromgif($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagegif($imgResized, $source_url); \n break;\n \n case IMAGETYPE_PNG:\n $img = imagecreatefrompng($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagepng($imgResized, $source_url); \n break;\n \n default:\n echo alertbuilder('This file is not in JPG, GIF, or PNG format!');\n return false;\n }\n\n //Finally frees any memory associated with image\n imagedestroy($img);\n imagedestroy($imgResized);\n \n return true;\n}", "function imgcrop(){\n\t\t$id = $this->session->userdata(SESSION_CONST_PRE.'userId');\n\t\t$dir_path = './assets/uploads/students/';\n\t\n\t\t$file_path = $dir_path . \"/Profile.small.jpg\";\n\t\t$src = $dir_path .'Profile.jpg';\n\t\tif(file_exists($file_path)){\n\t\t\t$src = $dir_path .'Profile.small.jpg';\n\t\t}\n\t\n\t\t$imgW = $_POST['w'];\n\t\t$imgH = $_POST['h'];\n\t\t$imgY1 = $_POST['y'];\n\t\t$imgX1 = $_POST['x'];\n\t\t$cropW = $_POST['w'];\n\t\t$cropH = $_POST['h'];\n\t\n\t\t$jpeg_quality = 100;\n\t\n\t\t//$img_r = imagecreatefromjpeg($src);\n\t\t$what = getimagesize($src);\n\t\t//list($imgInitW, $imgInitH, $type, $what) = getimagesize($src);\n\t\t$imgW = $imgInitW = $what[0];\n\t\t$imgH = $imgInitH = $what[1];\n\t\tswitch(strtolower($what['mime']))\n\t\t{\n\t\t\tcase 'image/png':\n\t\t\t\t$img_r = imagecreatefrompng($src);\n\t\t\t\t$source_image = imagecreatefrompng($src);\n\t\t\t\t$type = '.png';\n\t\t\t\tbreak;\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$img_r = imagecreatefromjpeg($src);\n\t\t\t\t$source_image = imagecreatefromjpeg($src);\n\t\t\t\t$type = '.jpeg';\n\t\t\t\tbreak;\n\t\t\tcase 'image/jpg':\n\t\t\t\t$img_r = imagecreatefromjpeg($src);\n\t\t\t\t$source_image = imagecreatefromjpeg($src);\n\t\t\t\t$type = '.jpg';\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$img_r = imagecreatefromgif($src);\n\t\t\t\t$source_image = imagecreatefromgif($src);\n\t\t\t\t$type = '.gif';\n\t\t\t\tbreak;\n\t\t\tdefault: die('image type not supported');\n\t\t}\n\t\n\t\t$resizedImage = imagecreatetruecolor($imgW, $imgH);\n\t\timagecopyresampled($resizedImage, $source_image, 0, 0, 0, 0, $imgW,\n\t\t$imgH, $imgInitW, $imgInitH);\n\t\n\t\n\t\t$dest_image = imagecreatetruecolor($cropW, $cropH);\n\t\timagecopyresampled($dest_image, $source_image, 0, 0, $imgX1, $imgY1, $cropW,\n\t\t$cropH, $cropW, $cropH);\n\t\n\t\n\t\timagejpeg($dest_image, $dir_path.'Profile.small.jpg', $jpeg_quality);\n\t\n\t}", "function resize_image($file, $w, $h, $crop=FALSE) {\n list($width, $height) = getimagesize($file);\n $r = $w / $h;\n $rate = $width / $height;\n // if we want it cropped\n if ($crop) {\n if ($rate < $r) {\n $src_w = $width;\n $src_h = ceil($width / $r);\n $src_x = 0;\n $src_y = ceil(($height - $src_h) / 2);\n $dst_w = $w;\n $dst_h = $h;\n $dst_x = 0;\n $dst_y = 0;\n }\n else {\n $src_w = ceil($r * $height);\n $src_h = $height;\n $src_x = ceil(($width - $src_w) / 2);\n $src_y = 0;\n $dst_w = $w;\n $dst_h = $h;\n $dst_x = 0;\n $dst_y = 0;\n }\n $newwidth = $w;\n $newheight = $h;\n }\n // if we don't want it cropped\n else {\n if ($rate < $r) {\n $src_w = $width;\n $src_h = $height;\n $src_x = 0;\n $src_y = 0;\n $dst_w = $h * $rate;\n $dst_h = $h;\n $dst_x = 0;\n $dst_y = 0;\n }\n else {\n $src_w = $width;\n $src_h = $height;\n $src_x = 0;\n $src_y = 0;\n $dst_w = $w;\n $dst_h = $w / $rate;\n $dst_x = 0;\n $dst_y = 0;\n }\n $newwidth = $dst_w;\n $newheight = $dst_h;\n }\n \n $type = strtolower(substr(strrchr($file,\".\"),1));\n if($type == 'jpeg') $type = 'jpg';\n switch($type){\n case 'bmp': $src_image = @imagecreatefromwbmp($file); break;\n case 'gif': $src_image = @imagecreatefromgif($file); break;\n case 'jpg': $src_image = @imagecreatefromjpeg($file); break;\n case 'png': $src_image = @imagecreatefrompng($file); break;\n default : return \"Unsupported picture type!\";\n } \n \n if ($src_image) {\n $dst_image = imagecreatetruecolor($newwidth, $newheight);\n imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);\n return $dst_image;\n } else {\n return null;\n }\n }", "function myImageCrop($imgSrc,$newfilename,$thumbWidth=100,$output=false,$thumbHeight=0){\n \t\n\t\tif($thumbHeight == 0) $thumbHeight = $thumbWidth;\n\t\t\n\t\t//getting the image dimensions\n\t\tlist($width, $height) = getimagesize($this->path.$imgSrc); \n\t\t\n\t\t\n\t\t$extension = strtolower($this->getExtension($imgSrc,false)); // false - tells to get \"jpg\" NOT \".jpg\" GOT IT :P\n\t\t\n\t\t//saving the image into memory (for manipulation with GD Library)\n\t\tswitch($extension) {\n\t\t\tcase 'gif':\n\t\t\t$myImage = imagecreatefromgif($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t\tcase 'jpg':\n\t\t\t$myImage = imagecreatefromjpeg($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t$myImage = imagecreatefrompng($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t}\n\t\t\n\n\n\t\t ///-------------------------------------------------------- \n\t\t //setting the crop size \n\t\t //-------------------------------------------------------- \n\t\t if($width > $height){ \n\t\t\t $biggestSide = $width; \n\t\t\t $cropPercent = .6; \n\t\t\t $cropWidth = $biggestSide*$cropPercent; \n\t\t\t $cropHeight = $biggestSide*$cropPercent; \n\t\t\t $c1 = array(\"x\"=>($width-$cropWidth)/2, \"y\"=>($height-$cropHeight)/2); \n\t\t }else{ \n\t\t\t $biggestSide = $height; \n\t\t\t $cropPercent = .6; \n\t\t\t $cropWidth = $biggestSide*$cropPercent; \n\t\t\t $cropHeight = $biggestSide*$cropPercent; \n\t\t\t $c1 = array(\"x\"=>($width-$cropWidth)/2, \"y\"=>($height-$cropHeight)/7); \n\t\t } \n\t\t \n\t\t //--------------------------------------------------------\n\t\t// Creating the thumbnail\n\t\t//--------------------------------------------------------\n\t\t$thumb = imagecreatetruecolor($thumbWidth, $thumbHeight); \n\t\timagecopyresampled($thumb, $myImage, 0, 0, $c1['x'], $c1['y'], $thumbWidth, $thumbHeight, $cropWidth, $cropHeight); \n\n\t\tif($output == false){\n\t\t\tif($extension==\"jpg\" ){\n\t\t\t\timagejpeg($thumb,$this->path.$newfilename,100);\n\t\t\t}elseif($extension==\"gif\" ){\n\t\t\t\timagegif($thumb,$this->path.$newfilename,100);\n\t\t\t}elseif($extension==\"png\" ){\n\t\t\t\timagepng($thumb,$this->path.$newfilename,9);\n\t\t\t}\n\t\t}else{\n\t\t\t//final output \n\t\t\t//imagejpeg($thumb);\n\t\t\tif($extension==\"jpg\" ){\n\t\t\t\theader('Content-type: image/jpeg');\n\t\t\t\timagejpeg($thumb);\n\t\t\t}elseif($extension==\"gif\" ){\n\t\t\t\theader('Content-type: image/gif');\n\t\t\t\timagegif($thumb);\n\t\t\t}elseif($extension==\"png\" ){\n\t\t\t\theader('Content-type: image/png');\n\t\t\t\timagepng($thumb);\n\t\t\t}\n\t\t} \n\t\timagedestroy($thumb); \n\t}", "function crop($x, $y, $width, $height){\n\n $new_image = imagecreatetruecolor($width, $height);\n imagecopy($new_image, $this->image, 0, 0, $x, $y, $width, $height);\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $width;\n $this->height = $height;\n\n return true;\n }", "function cropImage($CurWidth, $CurHeight, $iSize, $DestFolder, $SrcImage, $Quality, $ImageType)\n{\t \n\t//Check Image size is not 0\n\tif($CurWidth <= 0 || $CurHeight <= 0) \n\t{\n\t\treturn false;\n\t}\n\t//abeautifulsite.net has excellent article about \"Cropping an Image to Make Square\"\n\t//http://www.abeautifulsite.net/blog/2009/08/cropping-an-image-to-make-square-thumbnails-in-php/\n\tif($CurWidth>$CurHeight)\n\t{\n\t\t$y_offset = 0;\n\t\t$x_offset = ($CurWidth - $CurHeight) / 2;\n\t\t$square_size \t= $CurWidth - ($x_offset * 2);\n\t}\n\telse\n\t{\n\t\t$x_offset = 0;\n\t\t$y_offset = ($CurHeight - $CurWidth) / 2;\n\t\t$square_size = $CurHeight - ($y_offset * 2);\n\t}\n\t\n\t$NewCanves \t= imagecreatetruecolor($iSize, $iSize);\t\n\tif(imagecopyresampled($NewCanves, $SrcImage, 0, 0, $x_offset, $y_offset, $iSize, $iSize, $square_size, $square_size))\n\t{\n\t\tswitch(strtolower($ImageType))\n\t\t{\n\t\t\tcase 'image/png':\n\t\t\t\timagepng($NewCanves, $DestFolder);\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($NewCanves, $DestFolder);\n\t\t\t\tbreak;\t\t\t\n\t\t\tcase 'image/jpeg':\n\t\t\tcase 'image/pjpeg':\n\t\t\t\timagejpeg($NewCanves, $DestFolder, $Quality);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\tif(is_resource($NewCanves))\n\t\t{ \n\t\t\timagedestroy($NewCanves); \n\t } \n\t\treturn true;\n\t}\n}", "private function __setOptimalSizeByCrop() {\n \n $heightRatio = $this->__originalImageHeight / $this->__requestedHeight;\n $widthRatio = $this->__originalImageWidth / $this->__requestedWidth;\n \n if ($heightRatio < $widthRatio) {\n $optimalRatio = $heightRatio;\n } else {\n $optimalRatio = $widthRatio;\n }\n \n $this->__optimalHeight = $this->__originalImageHeight / $optimalRatio;\n $this->__optimalWidth = $this->__originalImageWidth / $optimalRatio;\n \n }", "public function image_fixed_resize($width, $height, $crop = true){\n $ratio = $this->width / $this->height;\n $original_ratio = $width / $height;\n\n $crop_width = $this->width;\n $crop_height = $this->height;\n\n if($ratio > $original_ratio)\n {\n $crop_width = round($original_ratio * $crop_height);\n }\n else\n {\n $crop_height = round($crop_width / $original_ratio);\n }\n if($crop)\n $this->crop($crop_width, $crop_height);\n $this->resize($width, $height);\n }", "function crop($iNewWidth, $iNewHeight, $iResize = 0)\n\t{\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\t/* resize imageobject in memory if resize percentage is set */\n\t\tif ($iResize > 0) {\n\t\t\t$this->resizetopercentage($iResize);\n\t\t}\n\n\t\t/* constrain width and height values */\n\t\tif (($iNewWidth > $this->width) || ($iNewWidth < 0)) {\n\t\t\t$this->printError('width out of range');\n\t\t}\n\t\tif (($iNewHeight > $this->height) || ($iNewHeight < 0)) {\n\t\t\t$this->printError('height out of range');\n\t\t}\n\n\t\t/* create blank image with new sizes */\n\t\t$CroppedImageStream = ImageCreateTrueColor($iNewWidth, $iNewHeight);\n\n\t\t/* calculate size-ratio */\n\t\t$iWidthRatio = $this->width / $iNewWidth;\n\t\t$iHeightRatio = $this->height / $iNewHeight;\n\t\t$iHalfNewHeight = $iNewHeight / 2;\n\t\t$iHalfNewWidth = $iNewWidth / 2;\n\n\t\t/* if the image orientation is landscape */\n\t\tif ($this->orientation == 'landscape') {\n\t\t\t/* calculate resize width parameters */\n\t\t\t$iResizeWidth = $this->width / $iHeightRatio;\n\t\t\t$iHalfWidth = $iResizeWidth / 2;\n\t\t\t$iDiffWidth = $iHalfWidth - $iHalfNewWidth;\n\n\t\t\tif (function_exists(\"imagecopyresampled\")) {\n\t\t\t\timagecopyresampled($CroppedImageStream, $this->ImageStream, - $iDiffWidth, 0, 0, 0, $iResizeWidth, $iNewHeight, $this->width, $this->height);\n\t\t\t} else {\n\t\t\t\timagecopyresized($CroppedImageStream, $this->ImageStream, - $iDiffWidth, 0, 0, 0, $iResizeWidth, $iNewHeight, $this->width, $this->height);\n\t\t\t}\n\t\t}\n\t\t/* if the image orientation is portrait or square */\n\t\telseif (($this->orientation == 'portrait') || ($this->orientation == 'square')) {\n\t\t\t/* calculate resize height parameters */\n\t\t\t$iResizeHeight = $this->height / $iWidthRatio;\n\t\t\t$iHalfHeight = $iResizeHeight / 2;\n\t\t\t$iDiffHeight = $iHalfHeight - $iHalfNewHeight;\n\n\t\t\tif (function_exists(\"imagecopyresampled\")) {\n\t\t\t\timagecopyresampled($CroppedImageStream, $this->ImageStream, 0, - $iDiffHeight, 0, 0, $iNewWidth, $iResizeHeight, $this->width, $this->height);\n\t\t\t} else {\n\t\t\t\timagecopyresized($CroppedImageStream, $this->ImageStream, 0, - $iDiffHeight, 0, 0, $iNewWidth, $iResizeHeight, $this->width, $this->height);\n\t\t\t}\n\t\t} else {\n\t\t\tif (function_exists(\"imagecopyresampled\")) {\n\t\t\t\timagecopyresampled($CroppedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t\t} else {\n\t\t\t\timagecopyresized($CroppedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t\t}\n\t\t}\n\n\t\t$this->ImageStream = $CroppedImageStream;\n\t\t$this->width = $iNewWidth;\n\t\t$this->height = $iNewHeight;\n\t\t$this->setImageOrientation();\n\t}", "public function fit($desiredWidth, $desiredHeight,$crop=true)\n {\n $cropX = 0;\n $cropY = 0;\n \n $imageWidth = $this->getWorkingImageWidth();\n $imageHeight = $this->getWorkingImageHeight();\n $currentRatio = $imageHeight / $imageWidth;\n $desiredRatio = $desiredHeight / $desiredWidth;\n\n // simple scale\n if($currentRatio == $desiredRatio)\n {\n $this->resize($desiredWidth, $desiredHeight);\n return true;\n }\n\n // width priority - maybe crop the height if needed\n if($currentRatio > $desiredRatio)\n {\n $destWidth = $desiredWidth;\n $destHeight = ceil($imageHeight * ($desiredWidth / $imageWidth));\n \n // set cropY so that the crop area occurs in the vertical centre\n $cropY = ceil(($destHeight - $desiredHeight) / 2);\n }\n\n // height priority - maybe crop the width if needed\n elseif($currentRatio < $desiredRatio)\n {\n $destHeight = $desiredHeight;\n $destWidth = floor($imageWidth * ($desiredHeight / $imageHeight));\n\n // set cropX so that the crop area occurs in the horizontal centre\n $cropX = ceil(($destWidth - $desiredWidth) / 2);\n }\n\n $this->resize($destWidth, $destHeight);\n if($crop)\n {\n $this->crop($desiredWidth, $desiredHeight, $cropX, $cropY);\n }\n }", "public function cropImage($width, $height , $target) {\r\n // load an image\r\n $i = new Imagick($this->src);\r\n // get the current image dimensions\r\n $geo = $i -> getImageGeometry();\r\n\r\n // crop the image\r\n if (($geo['width'] / $width) < ($geo['height'] / $height)) {\r\n $i -> cropImage($geo['width'], floor($height * $geo['width'] / $width), 0, (($geo['height'] - ($height * $geo['width'] / $width)) / 2));\r\n } else {\r\n $i -> cropImage(ceil($width * $geo['height'] / $height), $geo['height'], (($geo['width'] - ($width * $geo['height'] / $height)) / 2), 0);\r\n }\r\n\r\n // save or show or whatever the image\r\n $i -> setImageFormat(\"jpeg\");\r\n $i -> writeImage($target);\r\n\r\n\r\n $wrapper2 = new ImagickWrapper($target);\r\n $wrapper2 -> generateThumbnail($target,$width.\"x\".$height);\r\n }", "function cropImage($CurWidth,$CurHeight,$iSize,$DestFolder,$SrcImage,$Quality,$ImageType)\r\n{\t \r\n\t//Check Image size is not 0\r\n\tif($CurWidth <= 0 || $CurHeight <= 0) \r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t//abeautifulsite.net has excellent article about \"Cropping an Image to Make Square\"\r\n\t//http://www.abeautifulsite.net/blog/2009/08/cropping-an-image-to-make-square-thumbnails-in-php/\r\n\tif($CurWidth>$CurHeight)\r\n\t{\r\n\t\t$y_offset = 0;\r\n\t\t$x_offset = ($CurWidth - $CurHeight) / 2;\r\n\t\t$square_size \t= $CurWidth - ($x_offset * 2);\r\n\t}else{\r\n\t\t$x_offset = 0;\r\n\t\t$y_offset = ($CurHeight - $CurWidth) / 2;\r\n\t\t$square_size = $CurHeight - ($y_offset * 2);\r\n\t}\r\n\t\r\n\t$NewCanves \t= imagecreatetruecolor($iSize, $iSize);\t\r\n\tif(imagecopyresampled($NewCanves, $SrcImage,0, 0, $x_offset, $y_offset, $iSize, $iSize, $square_size, $square_size))\r\n\t{\r\n\t\tswitch(strtolower($ImageType))\r\n\t\t{\r\n\t\t\tcase 'image/png':\r\n\t\t\t\timagepng($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'image/gif':\r\n\t\t\t\timagegif($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\t\t\t\r\n\t\t\tcase 'image/jpeg':\r\n\t\t\tcase 'image/pjpeg':\r\n\t\t\t\timagejpeg($NewCanves,$DestFolder,$Quality);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t//Destroy image, frees memory\t\r\n\tif(is_resource($NewCanves)) {imagedestroy($NewCanves);} \r\n\treturn true;\r\n\r\n\t}\r\n\t \r\n}", "function image_crop()\n\t{\n\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\tif (substr($protocol, -3) == 'gd2')\n\t\t{\n\t\t\t$protocol = 'image_process_gd';\n\t\t}\n\t\t\n\t\treturn $this->$protocol('crop');\n\t}", "public function runFillResize(Image $image, int $width, int $height) : Image\n\t{\n\t\t\n\t\treturn $this->runMaxResize($image, $width, $height)->resizeCanvas($width, $height, 'center');\n\t}", "public function cropImage($width, $height, $x, $y)\n {\n if ($this->resource->getNumberImages() > 0) {\n $frames = $this->resource->coalesceImages();\n foreach ($frames as $frame) {\n $frame->setImageBackgroundColor('none');\n $frame->cropImage($width, $height, $x, $y);\n $frame->thumbnailImage($width, $height);\n $frame->setImagePage($width, $height, 0, 0);\n }\n $this->resource = $frames->deconstructImages();\n $this->resource->resizeImage($width, $height, $this->imageFilter, $this->imageBlur);\n } else {\n $this->resource->cropImage($width, $height, $x, $y);\n }\n\n return $this;\n }", "public static function crop($image, $width, $height, array $start = [0, 0])\n {\n if (!isset($start[0], $start[1])) {\n throw new InvalidParamException('$start must be an array of two elements.');\n }\n\n return static::ensureImageInterfaceInstance($image)\n ->copy()\n ->crop(new Point($start[0], $start[1]), new Box($width, $height));\n }", "function resize_image($src, $width, $height){\n // initializing\n $save_path = Wordless::theme_temp_path();\n $img_filename = Wordless::join_paths($save_path, md5($width . 'x' . $height . '_' . basename($src)) . '.jpg');\n\n // if file doesn't exists, create it\n if (!file_exists($img_filename)) {\n $to_scale = 0;\n $to_crop = 0;\n\n // Get orig dimensions\n list ($width_orig, $height_orig, $type_orig) = getimagesize($src);\n\n // get original image ... to improve!\n switch($type_orig){\n case IMAGETYPE_JPEG: $image = imagecreatefromjpeg($src);\n break;\n case IMAGETYPE_PNG: $image = imagecreatefrompng($src);\n break;\n case IMAGETYPE_GIF: $image = imagecreatefromgif($src);\n break;\n default:\n return;\n }\n\n // which is the new smallest?\n if ($width < $height)\n $min_dim = $width;\n else\n $min_dim = $height;\n\n // which is the orig smallest?\n if ($width_orig < $height_orig)\n $min_orig = $width_orig;\n else\n $min_orig = $height_orig;\n\n // image of the right size\n if ($height_orig == $height && $width_orig == $width) ; // nothing to do\n // if something smaller => scale\n else if ($width_orig < $width) {\n $to_scale = 1;\n $ratio = $width / $width_orig;\n }\n else if ($height_orig < $height) {\n $to_scale = 1;\n $ratio = $height / $height_orig;\n }\n // if both bigger => scale\n else if ($height_orig > $height && $width_orig > $width) {\n $to_scale = 1;\n $ratio_dest = $width / $height;\n $ratio_orig = $width_orig / $height_orig;\n if ($ratio_dest > $ratio_orig)\n $ratio = $width / $width_orig;\n else\n $ratio = $height / $height_orig;\n }\n // one equal one bigger\n else if ( ($width == $width_orig && $height_orig > $height) || ($height == $height_orig && $width_orig > $width) )\n $to_crop = 1;\n // some problem...\n else\n echo \"ALARM\";\n\n // we need to zoom to get the right size\n if ($to_scale == 1) {\n $new_width = $width_orig * $ratio;\n $new_height = $height_orig * $ratio;\n $image_scaled = imagecreatetruecolor($new_width, $new_height);\n // scaling!\n imagecopyresampled($image_scaled, $image, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);\n $image = $image_scaled;\n\n if($new_width > $width || $new_height > $height)\n $to_crop = 1;\n }\n else {\n $new_width = $width_orig;\n $new_height = $height_orig;\n }\n\n // we need to crop the image\n if ($to_crop == 1) {\n $image_cropped = imagecreatetruecolor($width, $height);\n\n // find margins for images\n $margin_x = ($new_width - $width) / 2;\n $margin_y = ($new_height - $height) / 2;\n\n // cropping!\n imagecopy($image_cropped, $image, 0, 0, $margin_x, $margin_y, $width, $height);\n $image = $image_cropped;\n }\n\n // Save image\n imagejpeg($image, $img_filename, 95);\n }\n\n // Return image URL\n return Wordless::join_paths(Wordless::theme_temp_path(), basename($img_filename));\n }", "protected function imageThumbcrop($width, $height)\n {\n $width = (int)$width;\n $height = (int)$height;\n if ($width <= 0) {\n throw new BadMethodCallException('Invalid parameter width for command \"thumb\"');\n }\n if ($height <= 0) {\n throw new BadMethodCallException('Invalid parameter height for command \"thumb\"');\n }\n $this->image = $this->image->thumbnail(new Box($width, $height), ImageInterface::THUMBNAIL_OUTBOUND);\n }", "public function resize_crop($newWidth, $newHeight)\n\t{\n\t\t$this->intern_resize_crop($newWidth, $newHeight);\n\t}", "public function resize_fit(IImageInformation $src, $width, $height);", "function resize_image($image, $max_width, $max_height) {\n\t$width = imagesx($image);\n\t$height = imagesy($image);\n\t\n\tif ($width <= $max_width && $height <= $max_height) {\n\t\t// Don't bother if the image is already under the limits\n\t\treturn true;\n\t} else {\n\t\t// Set immediately transparency mode on the source image\n\t\timagealphablending($image, true);\n\t\n\t\t$ratio = $width / $height;\n\t\tif ($ratio > 1) { // width > height\n\t\t\t$n_width = $max_width;\n\t\t\t$n_height = round($height * $max_width / $width);\n\t\t} else {\n\t\t\t$n_width = round($width * $max_height / $height);\n\t\t\t$n_height = $max_height;\n\t\t}\n\t\t$dst_image = imagecreatetruecolor($n_width, $n_height);\n\t\timagealphablending($dst_image, false); \n\t\timagesavealpha($dst_image, true);\n\t\timagecopyresampled($dst_image, $image, 0, 0, 0, 0, $n_width, $n_height, $width, $height);\n\t}\n\treturn $dst_image;\n}", "function cropImage($CurWidth, $CurHeight, $iSize, $DestFolder, $SrcImage, $Quality, $ImageType) { \n\t//Check Image size is not 0\n\tif($CurWidth <= 0 || $CurHeight <= 0) \n\t{\n\t\treturn false;\n\t}\n\t\n\t//abeautifulsite.net has excellent article about \"Cropping an Image to Make Square bit.ly/1gTwXW9\n\tif($CurWidth>$CurHeight)\n\t{\n\t\t$y_offset = 0;\n\t\t$x_offset = ($CurWidth - $CurHeight) / 2;\n\t\t$square_size \t= $CurWidth - ($x_offset * 2);\n\t}else{\n\t\t$x_offset = 0;\n\t\t$y_offset = ($CurHeight - $CurWidth) / 2;\n\t\t$square_size = $CurHeight - ($y_offset * 2);\n\t}\n\t\n\t$NewCanvas \t= imagecreatetruecolor($iSize, $iSize);\t\n\t\n\tif(strtolower($ImageType) == 'image/png') {\n\t\t// Saves Alpha\n\t\timagealphablending($NewCanvas, false);\n\t\timagesavealpha($NewCanvas,true);\n\t\t$transparent = imagecolorallocatealpha($NewCanvas, 255, 255, 255, 127);\n\t\timagefilledrectangle($NewCanvas, 0, 0, $square_size, $square_size, $transparent);\n\t}\n\t\n\tif(imagecopyresampled($NewCanvas, $SrcImage, 0, 0, $x_offset, $y_offset, $iSize, $iSize, $square_size, $square_size))\n\t{\n\t\tswitch(strtolower($ImageType))\n\t\t{\n\t\t\tcase 'image/png':\n\t\t\t\timagepng($NewCanvas,$DestFolder);\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($NewCanvas,$DestFolder);\n\t\t\t\tbreak;\t\t\t\n\t\t\tcase 'image/jpeg':\n\t\t\tcase 'image/pjpeg':\n\t\t\t\timagejpeg($NewCanvas,$DestFolder,$Quality);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//Destroy image, frees memory\t\n\t\tif(is_resource($NewCanvas)) {imagedestroy($NewCanvas);} \n\t\treturn true;\n\t} \n}", "public function cropImage($targetWidth, $targetHeight)\n {\n $croppedSize = $this->getCroppedIamgeSize($targetWidth, $targetHeight);\n\n // Do nothing if the target size is >= the original size\n if ($croppedSize->width >= $this->width && $croppedSize->height >= $this->height) {\n return;\n }\n\n $croppedSize->width = min($croppedSize->width, $targetWidth);\n $croppedSize->height = min($croppedSize->height, $targetHeight);\n\n $image = $this->createNewTransparentImage($croppedSize->width, $croppedSize->height);\n\n imagecopyresampled(\n $image,\n $this->image,\n 0,\n 0,\n 0,\n 0,\n $croppedSize->width,\n $croppedSize->height,\n $croppedSize->width,\n $croppedSize->height\n );\n\n imagedestroy($this->image);\n $this->image = $image;\n $this->width = $croppedSize->width;\n $this->height = $croppedSize->height;\n }", "function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop = \\false)\n {\n }", "function resizeImage($src_file, $dest_file, $new_size=100, $resize_aspect=\"sq\", $quality=\"80\")\n\t{\n\t\t$imginfo = getimagesize($src_file);\n\t\t\n\t\tif ($imginfo == null) {\n\t\treturn false;\n\t\t}\t \n\t\t\n\t\t// GD2 can only handle JPG, PNG & GIF images\n\t\tif (!$imginfo[2] > 0 && $imginfo[2] <= 3 ) {\n\t\t return false;\n\t\t}\n\t\t\n\t\t// height/width\n\t\t$srcWidth = $imginfo[0];\n\t\t$srcHeight = $imginfo[1];\n\t\t//$resize_aspect = \"sq\";\n\t\tif ($resize_aspect == 'ht') {\n\t\t $ratio = $srcHeight / $new_size;\n\t\t} elseif ($resize_aspect == 'wd') {\n\t\t $ratio = $srcWidth / $new_size;\n\t\t} elseif ($resize_aspect == 'sq') {\n\t\t $ratio = min($srcWidth, $srcHeight) / $new_size;\n\t\t} else {\n\t\t $ratio = max($srcWidth, $srcHeight) / $new_size;\n\t\t}\n\t\t\n\t\t/**\n\t\t* Initialize variables\n\t\t*/\n\t\t$clipX = 0;\n\t\t$clipY = 0;\n\t\t\n\t\t$ratio = max($ratio, 1.0);\n\t\tif ($resize_aspect == 'sq'){\n\t\t$destWidth = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\t$destHeight = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\tif($srcHeight > $srcWidth){\n\t\t$clipX = 0;\n\t\t$clipY = ((int)($srcHeight - $srcWidth)/2);\n\t\t$srcHeight = $srcWidth;\n\t\t}elseif($srcWidth > $srcHeight){\n\t\t$clipX = ((int)($srcWidth - $srcHeight)/2);\n\t\t$clipY = 0;\n\t\t$srcWidth = $srcHeight;\n\t\t}\n\t\t}else{\n\t\t$destWidth = (int)($srcWidth / $ratio);\n\t\t$destHeight = (int)($srcHeight / $ratio);\n\t\t}\n\t\t\n\t\tif (!function_exists('imagecreatefromjpeg')) {\n\t\t echo 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed';\n\t\t exit;\n\t\t}\n\t\tif (!function_exists('imagecreatetruecolor')) {\n\t\t echo 'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the admin page';\n\t\t exit;\n\t\t}\n\t\t\n\t\tif ($imginfo[2] == 1 )\n\t\t $src_img = imagecreatefromgif($src_file);\n\t\telseif ($imginfo[2] == 2)\n\t\t $src_img = imagecreatefromjpeg($src_file);\n\t\telse\n\t\t $src_img = imagecreatefrompng($src_file);\n\t\tif (!$src_img){\n\t\t return false;\n\t\t}\n\t\tif ($imginfo[2] == 1 ) {\n\t\t$dst_img = imagecreate($destWidth, $destHeight);\n\t\t} else {\n\t\t$dst_img = imagecreatetruecolor($destWidth, $destHeight);\n\t\t}\n\t\t\n\t\timagecopyresampled($dst_img, $src_img, 0, 0, $clipX, $clipY, (int)$destWidth, (int)$destHeight, $srcWidth, $srcHeight);\n\t\timagejpeg($dst_img, $dest_file, $quality);\n\t\timagedestroy($src_img);\n\t\timagedestroy($dst_img);\n\t\t\n\t\t// We check that the image is valid\n\t\t$imginfo = getimagesize($dest_file);\n\t\tif ($imginfo == null) {\n\t\t\t@unlink($dest_file);\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "protected function cropMagic(): void\n {\n $this->image->crop($this->cropWidth, $this->cropHeight, $this->cropLeft, $this->cropTop);\n }", "public function image_resize($width = 0, $height = 0, $image_url, $filename, $upload_url)\n {\n $source_path = realpath($image_url);\n list($source_width, $source_height, $source_type) = getimagesize($source_path);\n switch ($source_type)\n {\n case IMAGETYPE_GIF:\n $source_gdim = imagecreatefromgif($source_path);\n break;\n case IMAGETYPE_JPEG:\n $source_gdim = imagecreatefromjpeg($source_path);\n break;\n case IMAGETYPE_PNG:\n $source_gdim = imagecreatefrompng($source_path);\n break;\n }\n\n $source_aspect_ratio = $source_width / $source_height;\n $desired_aspect_ratio = $width / $height;\n\n if ($source_aspect_ratio > $desired_aspect_ratio)\n {\n /*\n * Triggered when source image is wider\n */\n $temp_height = $height;\n $temp_width = (int)($height * $source_aspect_ratio);\n }\n else\n {\n /*\n * Triggered otherwise (i.e. source image is similar or taller)\n */\n $temp_width = $width;\n $temp_height = (int)($width / $source_aspect_ratio);\n }\n\n /*\n * Resize the image into a temporary GD image\n */\n\n $temp_gdim = imagecreatetruecolor($temp_width, $temp_height);\n imagecopyresampled($temp_gdim, $source_gdim, 0, 0, 0, 0, $temp_width, $temp_height, $source_width, $source_height);\n\n /*\n * Copy cropped region from temporary image into the desired GD image\n */\n\n $x0 = ($temp_width - $width) / 2;\n $y0 = ($temp_height - $height) / 2;\n $desired_gdim = imagecreatetruecolor($width, $height);\n imagecopy($desired_gdim, $temp_gdim, 0, 0, $x0, $y0, $width, $height);\n\n /*\n * Render the image\n * Alternatively, you can save the image in file-system or database\n */\n\n $image_url = $upload_url . $filename;\n\n imagepng($desired_gdim, $image_url);\n\n return $image_url;\n\n /*\n * Add clean-up code here\n */\n }", "function custom_image_resize_dimensions($payload, $orig_w, $orig_h, $dest_w, $dest_h, $crop)\n {\n // want to override the defaults for this image or not.\n if (false)\n return $payload;\n\n if ($crop) {\n // crop the largest possible portion of the original image that we can size to $dest_w x $dest_h\n $aspect_ratio = $orig_w / $orig_h;\n $new_w = min($dest_w, $orig_w);\n $new_h = min($dest_h, $orig_h);\n\n if (!$new_w) {\n $new_w = intval($new_h * $aspect_ratio);\n }\n\n if (!$new_h) {\n $new_h = intval($new_w / $aspect_ratio);\n }\n\n $size_ratio = max($new_w / $orig_w, $new_h / $orig_h);\n\n $crop_w = round($new_w / $size_ratio);\n $crop_h = round($new_h / $size_ratio);\n\n $s_x = floor(($orig_w - $crop_w) / 2);\n $s_y = 0; // [[ formerly ]] ==> floor( ($orig_h - $crop_h) / 2 );\n } else {\n // don't crop, just resize using $dest_w x $dest_h as a maximum bounding box\n $crop_w = $orig_w;\n $crop_h = $orig_h;\n\n $s_x = 0;\n $s_y = 0;\n\n list($new_w, $new_h) = wp_constrain_dimensions($orig_w, $orig_h, $dest_w, $dest_h);\n }\n\n // if the resulting image would be the same size or larger we don't want to resize it\n if ($new_w >= $orig_w && $new_h >= $orig_h)\n return false;\n\n // the return array matches the parameters to imagecopyresampled()\n // int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h\n return array(0, 0, (int)$s_x, (int)$s_y, (int)$new_w, (int)$new_h, (int)$crop_w, (int)$crop_h);\n\n }", "public function cropImage($width, $height, $x, $y) {\n return $this->im->cropImage($width, $height, $x, $y);\n }", "function my_awesome_image_resize_dimensions( $payload, $orig_w, $orig_h, $dest_w, $dest_h, $crop ){\n\t// want to override the defaults for this image or not.\n\tif( false )\n\t\treturn $payload;\n\n\tif ( $crop ) {\n\t\t// crop the largest possible portion of the original image that we can size to $dest_w x $dest_h\n\t\t$aspect_ratio = $orig_w / $orig_h;\n\t\t$new_w = min($dest_w, $orig_w);\n\t\t$new_h = min($dest_h, $orig_h);\n\n\t\tif ( !$new_w ) {\n\t\t\t$new_w = intval($new_h * $aspect_ratio);\n\t\t}\n\n\t\tif ( !$new_h ) {\n\t\t\t$new_h = intval($new_w / $aspect_ratio);\n\t\t}\n\n\t\t$size_ratio = max($new_w / $orig_w, $new_h / $orig_h);\n\n\t\t$crop_w = round($new_w / $size_ratio);\n\t\t$crop_h = round($new_h / $size_ratio);\n\n\t\t$s_x = 0; // [[ formerly ]] ==> floor( ($orig_w - $crop_w) / 2 );\n\t\t$s_y = 0; // [[ formerly ]] ==> floor( ($orig_h - $crop_h) / 2 );\n\t} else {\n\t\t// don't crop, just resize using $dest_w x $dest_h as a maximum bounding box\n\t\t$crop_w = $orig_w;\n\t\t$crop_h = $orig_h;\n\n\t\t$s_x = 0;\n\t\t$s_y = 0;\n\n\t\tlist( $new_w, $new_h ) = wp_constrain_dimensions( $orig_w, $orig_h, $dest_w, $dest_h );\n\t}\n\n\t// if the resulting image would be the same size or larger we don't want to resize it\n\tif ( $new_w >= $orig_w && $new_h >= $orig_h )\n\t\treturn false;\n\n\t// the return array matches the parameters to imagecopyresampled()\n\t// int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h\n\treturn array( 0, 0, (int) $s_x, (int) $s_y, (int) $new_w, (int) $new_h, (int) $crop_w, (int) $crop_h );\n\n}", "function FE_CropImage($img, $w=0, $h=0, $a=''){\t\t\r\n\t\t$q=80; /* calitate 0-100 */\t\t\r\n\t\t$src =__URL__.'app/tt/tt.php?src='.$img.($w>0 ? \"&w=$w\" : \"\").($h>0 ? \"&h=$h\" : \"\").\"&q=$q\".(!empty($a) ? \"&a=$a\" : \"\");\r\n\t\treturn $src;\r\n\t\t\r\n }", "function crop($resource, $width, $height)\n{\n\n // resource dimensions\n $size = array(\n 0 => imagesx($resource),\n 1 => imagesy($resource),\n );\n // sides\n $longer = (int)($size[0]/$width > $size[1]/$height);\n $shorter = (int)(!$longer);\n // ugly hack to avoid condition for imagecopyresampled()\n $src = array(\n $longer => 0,\n $shorter => ($size[$shorter]-$size[$longer])/2,\n );\n // new image resource\n $new = imagecreatetruecolor($width, $height);\n // do the magic\n imagecopyresampled($new, $resource,\n 0, 0,\n $src[0], $src[1],\n $width, $height,\n $size[$longer], $size[$longer]\n );\n\n return $new;\n}", "function imagecropper($source_path, $max_width, $max_height, $bili) {\n $source_info = getimagesize($source_path); //获取原始图片信息\n $source_width = $source_info[0]; //获取原始图片的宽度\n $source_height = $source_info[1]; //获取原始图片的高度\n $source_mime = $source_info['mime']; //获取原始图片的文件类型\n\n //先计算出要裁剪后的图片尺寸是多大\n if($source_width<=$max_width) { //1、如果原始图片的宽,小于最大允许的宽\n $newwidth = $source_width;\n $newheight = $source_width*$bili;\n }elseif($source_height<=$max_height) {//2、如果原始图片的高,小于最大允许的高\n $newheight = $source_height;\n $newwidth = $newheight/$bili;\n }else {\n $b1 = $max_width/$source_width;\n $b2 = $max_height/$source_height;\n $b3 = $b1<$b2 ? $b1 : $b2;\n $newwidth = ceil($source_width*$b3);\n $newheight = ceil($source_height*$b3);\n }\n\n $target_width = $newwidth>$newheight ? $newwidth : $newheight;\n $target_height = $newwidth<$newheight ? $newwidth : $newheight;\n\n if($target_width*$bili>$target_height) {\n $target_width = $target_height/$bili;\n }\n if($target_height*$bili>$target_width) {\n $target_height = $target_width/$bili;\n }\n\n $source_ratio = $source_height / $source_width;\n $target_ratio = $target_height / $target_width;\n\n if ($source_ratio > $target_ratio) {\n $cropped_width = $source_width;\n $cropped_height = $source_width * $target_ratio;\n $source_x = 0;\n $source_y = ($source_height - $cropped_height) / 2;\n }elseif ($source_ratio < $target_ratio) {\n $cropped_width = $source_height / $target_ratio;\n $cropped_height = $source_height;\n $source_x = ($source_width - $cropped_width) / 2;\n $source_y = 0;\n }else {\n $cropped_width = $source_width;\n $cropped_height = $source_height;\n $source_x = 0;\n $source_y = 0;\n }\n\n switch ($source_mime) {\n case 'image/gif':\n $source_image = imagecreatefromgif($source_path);\n break;\n case 'image/jpeg':\n $source_image = imagecreatefromjpeg($source_path);\n break;\n case 'image/png':\n $source_image = imagecreatefrompng($source_path);\n break;\n default:\n return false;\n break;\n }\n\n $target_image = imagecreatetruecolor($target_width, $target_height);\n $cropped_image = imagecreatetruecolor($cropped_width, $cropped_height);\n\n // 裁剪\n imagecopy($cropped_image, $source_image, 0, 0, $source_x, $source_y, $cropped_width, $cropped_height);\n // 缩放\n imagecopyresampled($target_image, $cropped_image, 0, 0, 0, 0, $target_width, $target_height, $cropped_width, $cropped_height);\n\n imagejpeg($target_image,$source_path);\n imagedestroy($source_image);\n imagedestroy($target_image);\n imagedestroy($cropped_image);\n}", "public function resizeImage($width, $height, $crop = true)\n\t{\n\t\t$iWidth = $this->getWidth();\n\t\t$iHeight = $this->getHeight();\n\n\t\tif (!$width) {\n\t\t\t$width = $iWidth;\n\t\t} else {\n\t\t\t$width = $width > $iWidth ? $iWidth : $width;\n\t\t}\n\n\t\tif (!$height) {\n\t\t\t$height = $iHeight;\n\t\t} else {\n\t\t\t$height = $height > $iHeight ? $iHeight : $height;\n\t\t}\n\n\t\tif ($crop) {\n\t\t\t$this->image->thumbnail($width, $height, 'center');\n\t\t} else {\n\t\t\t$this->image->resize($width, $height);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function crop($w, $h, $x = 0, $y = 0)\n {\n if(!is_numeric($x) || !is_numeric($y) || !is_numeric($w) || !is_numeric($h))\n {\n throw new Exception('One of the parameters was not numeric');\n }\n\n $imageIn = $this->getWorkingImageResource();\n $imageOut = imagecreatetruecolor($w, $h);\n\n imagecopyresampled($imageOut, $imageIn, 0, 0, $x, $y, $w, $h, $w, $h);\n\n $this->setWorkingImageResource($imageOut);\n }", "function crop($rect=array(),&$autosave=null) \n { \n //invalid rectangle defintion \n if(empty($rect)) \n { \n return $this; \n } \n \n if(count($rect)==2) \n { \n $_rect=$rect; \n $rect=array(0,0,$_rect[0],$_rect[1]); \n unset($_rect); \n } \n \n if(count($rect)==3) \n { \n $_rect=array($rect[0],$rect[1],$rect[2]); \n $rect=array(0,0,$_rect[1],$_rect[2]); \n \n switch(trim(strtolower($_rect[0]))) \n { \n case 'lt': \n $rect[0]=0; \n $rect[1]=0; \n break; \n case 'rt': \n $rect[0]=$this->_width-$rect[2]; \n $rect[1]=0; \n break; \n case 'lb': \n $rect[0]=0; \n $rect[1]=$this->_height-$rect[3]; \n break; \n case 'rb': \n $rect[0]=$this->_width-$rect[2]; \n $rect[1]=$this->_height-$rect[3]; \n break; \n case 'center': \n $rect[0]=($this->_width-$rect[2])*0.5; \n $rect[1]=($this->_height-$rect[3])*0.5; \n break; \n } \n unset($_rect); \n } \n \n if(count($rect)!=4 || $rect[0]<0 || $rect[1]<0 || $rect[2]<=0 || $rect[3]<0) \n { \n return $this; \n } \n \n //overflow \n if($rect[0]+$rect[2]>$this->_width || $rect[1]+$rect[3]>$this->_height) \n { \n return $this; \n } \n \n $_tmpImage=imagecreatetruecolor($rect[2],$rect[3]); \n imagecopy($_tmpImage,$this->_image,0,0,$rect[0],$rect[1],$rect[2],$rect[3]); \n imagedestroy($this->_image); \n $this->_image=&$_tmpImage; \n \n $this->_width=$rect[2]; \n $this->_height=$rect[3]; \n \n if(isset($autosave)) \n { \n $_file=sprintf('%s%s_%sx%s.%s', \n $this->_imagePathInfo['dirname'].DS, \n $this->_imagePathInfo['filename'], \n $this->_width,$this->_height, \n $this->_imagePathInfo['extension'] \n ); \n \n if($this->saveAs($_file,$this->default_qulity,$this->default_smooth,$this->auto_dispose)) \n { \n $autosave=$_file; \n } \n } \n \n return $this; \n }", "function cropImage($nw, $nh, $source,$newfileName,$case='top') {\n\t\t$thumb_croped = false;\n\t\t\n\t\t$size = getimagesize($this->path.$source);\n\t\t$w = $size[0];\n\t\t$h = $size[1];\n\t\t\n\t\t$extension = strtolower($this->getExtension($source,false)); // false - tells to get \"jpg\" NOT \".jpg\" GOT IT :P\n\t\t\n\t\tswitch($extension) {\n\t\t\tcase 'gif':\n\t\t\t$simg = imagecreatefromgif($this->path.$source);\n\t\t\tbreak;\n\t\t\tcase 'jpg':\n\t\t\t$simg = imagecreatefromjpeg($this->path.$source);\n\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t$simg = imagecreatefrompng($this->path.$source);\n\t\t\tbreak;\n\t\t}\n\t\t\n\n\t\t$dimg = imagecreatetruecolor($nw, $nh);\n\t\t$wm = $w/$nw;\n\t\t$hm = $h/$nh;\n\t\t$h_height = $nh/2;\n\t\t$w_height = $nw/2;\n\t\tif($w> $h) {\n\t\t\t$adjusted_width = $w / $hm;\n\t\t\t$half_width = $adjusted_width / 2;\n\t\t\t$int_width = $half_width - $w_height;\n\t\t\timagecopyresampled($dimg,$simg,-$int_width,0,0,0,$adjusted_width,$nh,$w,$h);\n\t\t} elseif(($w <$h) || ($w == $h)) {\n\t\t\t$adjusted_height = $h / $wm;\n\t\t\t$half_height = $adjusted_height / 2;\n\t\t\t$int_height = $half_height - $h_height;\n\t\t\timagecopyresampled($dimg,$simg,0,-$int_height,0,0,$nw,$adjusted_height,$w,$h);\n\t\t} else {\n\t\t\timagecopyresampled($dimg,$simg,0,0,0,0,$nw,$nh,$w,$h);\n\t\t}\n\t\t\n\t\tif($extension==\"jpg\" ){\n\t\t\timagejpeg($dimg,$this->path.$newfileName,100);\n\t\t\t$thumb_croped = true;\n\t\t}elseif($extension==\"gif\" ){\n\t\t\timagegif($dimg,$this->path.$newfileName,100);\n\t\t\t$thumb_croped = true;\n\t\t}elseif($extension==\"png\" ){\n\t\t\timagepng($dimg,$this->path.$newfileName,100);\n\t\t\t$thumb_croped = true;\n\t\t}\n\t\t\n\t\treturn $thumb_croped;\n\t\t\n\t\t//imagejpeg($dimg,$dest,100);\n\t}", "function normal_resize_image($source, $destination, $image_type, $max_size, $image_width, $image_height, $quality){\n\n if($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n //do not resize if image is smaller than max size\n if($image_width <= $max_size && $image_height <= $max_size){\n if(save_image($source, $destination, $image_type, $quality)){\n return true;\n }\n }\n\n //Construct a proportional size of new image\n $image_scale\t= min($max_size/$image_width, $max_size/$image_height);\n $new_width\t\t= ceil($image_scale * $image_width);\n $new_height\t\t= ceil($image_scale * $image_height);\n\n $new_canvas\t\t= imagecreatetruecolor( $new_width, $new_height ); //Create a new true color image\n\n //Copy and resize part of an image with resampling\n if(imagecopyresampled($new_canvas, $source, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height)){\n save_image($new_canvas, $destination, $image_type, $quality); //save resized image\n }\n\n return true;\n}", "function imagecropauto($image, $mode = -1, $threshold = 0.5, $color = -1)\n{\n}", "public function crop()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('crop');\n\t}", "function image_scale_im_obj(\\Imagick $im, $aspect, $width, $strategy)\n{\n\n $height = round(($width/$aspect['width'])*$aspect['height']);\n\n $source_w = $im->getImageWidth();\n $source_h = $im->getImageHeight();\n $source_a = $source_h / $source_w;\n $target_a = $aspect['height'] / $aspect['width'];\n\n switch ($strategy) {\n case 'resize':\n $im->scaleImage($width, $height);\n break;\n case 'crop-top':\n if ($target_a < $source_a) {\n $im->scaleImage($width, 0);\n $im->cropImage($width, $height, 0, 0);\n } else {\n $im->scaleImage(0, $height);\n $im->cropImage($width, $height, 0, 0);\n }\n break;\n case 'crop-bottom':\n if ($target_a < $source_a) {\n $im->scaleImage($width, 0);\n $im->cropImage($width, $height, 0, $im->getImageHeight() - $height);\n } else {\n $im->scaleImage(0, $height);\n $im->cropImage($width, $height, $im->getImageWidth() - $width, 0);\n }\n break; \n case 'crop':\n default:\n $im->cropThumbnailImage($width, $height);\n break; \n }\n $im->setImageFormat('jpeg');\n $im->gaussianBlurImage(0.05, 0.5);\n $im->setImageCompressionQuality(75);\n $im->setInterlaceScheme(\\Imagick::INTERLACE_PLANE);\n $im->stripImage();\n return $im;\n}", "public static function resize_Crop_Image($max_width, $max_height, $source_file, $dst_dir, $quality = 80) {\n $imgsize = @getimagesize($source_file);\n $width = $imgsize[0];\n $height = $imgsize[1];\n $mime = $imgsize['mime'];\n switch ($mime) {\n case 'image/gif':\n $image_create = \"imagecreatefromgif\";\n $image = \"imagegif\";\n break;\n case 'image/png':\n $image_create = \"imagecreatefrompng\";\n $image = \"imagepng\";\n break;\n case 'image/jpeg':\n $image_create = \"imagecreatefromjpeg\";\n $image = \"imagejpeg\";\n break;\n default:\n return false;\n break;\n }\n $dst_img = @imagecreatetruecolor($max_width, $max_height);\n $src_img = $image_create($source_file);\n $width_new = $height * $max_width / $max_height;\n $height_new = $width * $max_height / $max_width;\n if ($width_new > $width) {\n $h_point = (($height - $height_new) / 2);\n @imagecopyresampled($dst_img, $src_img, 0, 0, 0, $h_point, $max_width, $max_height, $width, $height_new);\n } else {\n $w_point = (($width - $width_new) / 2);\n @imagecopyresampled($dst_img, $src_img, 0, 0, $w_point, 0, $max_width, $max_height, $width_new, $height);\n }\n @imagejpeg($dst_img, $dst_dir, $quality);\n if ($dst_img) {\n @imagedestroy($dst_img);\n }\n if ($src_img) {\n @imagedestroy($src_img);\n }\n }", "function resizeImage($image,$width,$height) {\n\t$newImageWidth = $width;\n\t$newImageHeight = $height;\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t$source = imagecreatefromjpeg($image);\n\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\timagejpeg($newImage,$image,90);\n\tchmod($image, 0777);\n\treturn $image;\n}", "public static function crop($image = NULL, $coordinateX = NULL, $coordinateY = NULL, $width = NULL, $height = NULL)\n\t{\n\n\t\tif (!($image instanceof Default_Model_MediaImage)) {\n\t\t\tthrow new Default_Model_MediaImage_Exception('Image needs to be an instance of Default_Model_MediaImage.');\n\t\t}\n\n\t\tif ($coordinateX &&\n\t\t\t!is_int($coordinateX)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('Coordinate X needs to be an integer, if specified.');\n\t\t}\n\n\t\tif ($coordinateY &&\n\t\t\t!is_int($coordinateY)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('Coordinate Y needs to be an integer, if specified.');\n\t\t}\n\n\t\tif ($width &&\n\t\t\t!is_int($width)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('Width needs to be an integer, if specified.');\n\t\t}\n\n\t\tif ($height &&\n\t\t\t!is_int($height)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('Height needs to be an integer, if specified.');\n\t\t}\n\n\t\t$cropedImage = Default_Service_MediaImage::fromMediaImage($image);\n\t\t$cropedImage->width = 0;\n\t\t$cropedImage->height = 0;\n\t\t$cropedImage->file_size = 0;\n\t\t$cropedImage->role_id = $image->role_id;\n\t\tif (isset($image['entity_id'])) {\n\t\t\t$cropedImage->entity_id = $image->entity_id;\n\t\t} else\n\t\tif (Zend_Auth::getInstance()->hasIdentity()) {\n\t\t\t$cropedImage->entity_id = Zend_Auth::getInstance()->getIdentity()->id;\n\t\t}\n\t\t$cropedImage->short = Default_Service_Media::getShort($image->short, $cropedImage->width, $cropedImage->height, $cropedImage->file_size);\n\t\t$cropedImage->save();\n\n\n\t\t/**\n\t\t * imageinstance file does not exist yet and needs to be created\n\t\t */\n\t\tif (!file_exists($cropedImage->getStoredFilePath())) {\n\n\t\t\t/**\n\t\t\t * use Imagick for croping the image ?\n\t\t\t */\n\t\t\tif (Zend_Registry::get('Imagick')) {\n\n\t\t\t\t/**\n\t\t\t\t * Imagick\n\t\t\t\t */\n\t\t\t\t$imagickError = NULL;\n\t\t\t\ttry {\n\t\t\t\t\t$imagickObj = new Imagick($image->getStoredFilePath());\n\t\t\t\t\t$imagickCropResult = $imagickObj->cropImage($width, $height, $coordinateX, $coordinateY);\n\t\t\t\t\tif ($imagickCropResult) {\n\t\t\t\t\t\t$imagickObj->writeimage($cropedImage->getStoredFilePath());\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * retrieve image infos\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$cropedImage->file_size = $imagickObj->getImageLength();\n\t\t\t\t\t\t$imagickDimensions = $imagickObj->getImageGeometry();\n\t\t\t\t\t\t$cropedImage->width = $imagickDimensions['width'];\n\t\t\t\t\t\t$cropedImage->height = $imagickDimensions['height'];\n\t\t\t\t\t\t$cropedImage->short = Default_Service_Media::getShort($image->short, $cropedImage->width, $cropedImage->height, $cropedImage->file_size);\n\t\t\t\t\t\t$cropedImage->save();\n\t\t\t\t\t}\n\t\t\t\t} catch (ImagickException $imagickError) {\n\n\t\t\t\t}\n\n\t\t\t\tif ($imagickError ||\n\t\t\t\t\t!$imagickCropResult) {\n\n\t\t\t\t\t$cropedImage->hardDelete();\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t$imageFile = L8M_Image::fromFile($image->getStoredFilePath());\n\n\t\t\t\tif ($imageFile instanceof L8M_Image_Abstract) {\n\n\t\t\t\t\t$imageFile\n\t\t\t\t\t\t->crop($coordinateX, $coordinateY, $width, $height)\n\t\t\t\t\t\t->save($cropedImage->getStoredFilePath(), TRUE)\n\t\t\t\t\t;\n\n\t\t\t\t\t/**\n\t\t\t\t\t * retrieve image infos\n\t\t\t\t\t */\n\t\t\t\t\t$cropedImage->file_size = $imageFile->getFilesize();\n\t\t\t\t\t$cropedImage->width = $imageFile->getWidth();\n\t\t\t\t\t$cropedImage->height = $imageFile->getHeight();\n\t\t\t\t\t$cropedImage->short = Default_Service_Media::getShort($image->short, $cropedImage->width, $cropedImage->height, $cropedImage->file_size);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * save\n\t\t\t\t\t */\n\t\t\t\t\tif (!$imageFile->isErrorOccured()) {\n\t\t\t\t\t\t$cropedImage->save();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$cropedImage->hardDelete();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn $cropedImage;\n\t}", "public function crop_image_square($source, $destination, $image_type, $square_size, $image_width, $image_height, $quality){\n if($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n if( $image_width > $image_height )\n {\n $y_offset = 0;\n $x_offset = ($image_width - $image_height) / 2;\n $s_size \t= $image_width - ($x_offset * 2);\n }else{\n $x_offset = 0;\n $y_offset = ($image_height - $image_width) / 2;\n $s_size = $image_height - ($y_offset * 2);\n }\n $new_canvas\t= imagecreatetruecolor( $square_size, $square_size); //Create a new true color image\n\n //Copy and resize part of an image with resampling\n if(imagecopyresampled($new_canvas, $source, 0, 0, $x_offset, $y_offset, $square_size, $square_size, $s_size, $s_size)){\n $this->save_image($new_canvas, $destination, $image_type, $quality);\n }\n\n return true;\n }", "public function crop($width, $height, $offset_x = NULL, $offset_y = NULL)\n {\n if ($width > $this->width)\n {\n // Use the current width\n $width = $this->width;\n }\n\n if ($height > $this->height)\n {\n // Use the current height\n $height = $this->height;\n }\n\n if ($offset_x === NULL)\n {\n // Center the X offset\n $offset_x = round(($this->width - $width) / 2);\n }\n elseif ($offset_x === TRUE)\n {\n // Bottom the X offset\n $offset_x = $this->width - $width;\n }\n elseif ($offset_x < 0)\n {\n // Set the X offset from the right\n $offset_x = $this->width - $width + $offset_x;\n }\n\n if ($offset_y === NULL)\n {\n // Center the Y offset\n $offset_y = round(($this->height - $height) / 2);\n }\n elseif ($offset_y === TRUE)\n {\n // Bottom the Y offset\n $offset_y = $this->height - $height;\n }\n elseif ($offset_y < 0)\n {\n // Set the Y offset from the bottom\n $offset_y = $this->height - $height + $offset_y;\n }\n\n // Determine the maximum possible width and height\n $max_width = $this->width - $offset_x;\n $max_height = $this->height - $offset_y;\n\n if ($width > $max_width)\n {\n // Use the maximum available width\n $width = $max_width;\n }\n\n if ($height > $max_height)\n {\n // Use the maximum available height\n $height = $max_height;\n }\n\n $this->_do_crop($width, $height, $offset_x, $offset_y);\n\n return $this;\n }", "public function cropThumbnailImage($width, $height)\n {\n if ($this->resource->getNumberImages() > 0) {\n $frames = $this->resource->coalesceImages();\n foreach ($frames as $frame) {\n $frame->setImageBackgroundColor('none');\n $frame->cropThumbnailImage($width, $height);\n $frame->thumbnailImage($width, $height);\n $frame->setImagePage($width, $height, 0, 0);\n }\n $this->resource = $frames->deconstructImages();\n } else {\n $this->resource->cropThumbnailImage($width, $height);\n }\n\n return $this;\n }", "public function runMaxResize(Image $image, $width, $height) : Image\n\t{\n\t return $image->resize($width, $height, function ($constraint) {\n\t $constraint->aspectRatio();\n\t $constraint->upsize();\n\t });\n\t}", "public function crop()\n {\n }", "protected function _do_crop($width, $height, $offset_x, $offset_y)\n {\n $image = $this->_create($width, $height);\n\n // Loads image if not yet loaded\n $this->_load_image();\n\n // Execute the crop\n if (imagecopyresampled($image, $this->_image, 0, 0, $offset_x, $offset_y, $width, $height, $width, $height))\n {\n // Swap the new image for the old one\n imagedestroy($this->_image);\n $this->_image = $image;\n\n // Reset the width and height\n $this->width = imagesx($image);\n $this->height = imagesy($image);\n }\n }", "public function resize($newWidth, $newHeight, $option='auto')\n\t{\n\t\t// Reset\n\t\tif ($this->imageResized) {\n\t\t\timagedestroy($this->imageResized);\n\t\t}\n\t\t$this->saveState = false;\n\n\t\t// Get optimal width and height based on $option\n\t\t$optionArray = $this->getDimensions((int)$newWidth, (int)$newHeight, $option);\n\t\t$this->optimalWidth = round($optionArray['optimalWidth']);\n\t\t$this->optimalHeight = round($optionArray['optimalHeight']);\n\n\t\t// Resample - create image canvas of x, y size\n\t\t$this->imageResized = imagecreatetruecolor($this->optimalWidth, $this->optimalHeight);\n\t\tif (imagetypes() & IMG_PNG) {\n\t\t\timagesavealpha($this->imageResized, true);\n\t\t\timagealphablending($this->imageResized, false);\n\t\t}\n\t\timagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $this->optimalWidth, $this->optimalHeight, $this->width, $this->height);\n\n\t\t// If option is 'crop', then crop too\n\t\tif ($option == 'crop') {\n\t\t\t$this->cropImage($this->optimalWidth, $this->optimalHeight, $newWidth, $newHeight);\n\t\t}\n\n\t\treturn $this;\n\t}", "function resize( $w = 0, $h = 0 )\n\t{\n\t\tif( $w == 0 || $h == 0 )\n\t\t\treturn FALSE;\n\t\t\n\t\t//get the size of the current image\n\t\t$oldsize = $this->size();\n\t\t\n\t\t//create a target canvas\n\t\t$new_im = imagecreatetruecolor ( $w, $h );\n\t\n\t\t//copy and resize image to new canvas\n\t\timagecopyresampled( $new_im, $this->im, 0, 0, 0, 0, $w, $h, $oldsize->w, $oldsize->h );\n\t\t\n\t\t//delete the old image handle\n\t\timagedestroy( $this->im );\n\t\t\n\t\t//set the new image as the current handle\n\t\t$this->im = $new_im;\n\t}", "protected function _do_resize($width, $height)\n {\n $pre_width = $this->width;\n $pre_height = $this->height;\n\n // Loads image if not yet loaded\n $this->_load_image();\n\n // Test if we can do a resize without resampling to speed up the final resize\n if ($width > ($this->width / 2) AND $height > ($this->height / 2))\n {\n // The maximum reduction is 10% greater than the final size\n $reduction_width = round($width * 1.1);\n $reduction_height = round($height * 1.1);\n\n while ($pre_width / 2 > $reduction_width AND $pre_height / 2 > $reduction_height)\n {\n // Reduce the size using an O(2n) algorithm, until it reaches the maximum reduction\n $pre_width /= 2;\n $pre_height /= 2;\n }\n\n // Create the temporary image to copy to\n $image = $this->_create($pre_width, $pre_height);\n\n if (imagecopyresized($image, $this->_image, 0, 0, 0, 0, $pre_width, $pre_height, $this->width, $this->height))\n {\n // Swap the new image for the old one\n imagedestroy($this->_image);\n $this->_image = $image;\n }\n }\n\n // Create the temporary image to copy to\n $image = $this->_create($width, $height);\n\n // Execute the resize\n if (imagecopyresampled($image, $this->_image, 0, 0, 0, 0, $width, $height, $pre_width, $pre_height))\n {\n // Swap the new image for the old one\n imagedestroy($this->_image);\n $this->_image = $image;\n\n // Reset the width and height\n $this->width = imagesx($image);\n $this->height = imagesy($image);\n }\n }", "public static function fitToImage(&$dst_image, &$src_image, bool $overflow = false): void\n\t{\n\t\t$src_w = imagesx($src_image);\n\t\t$src_h = imagesy($src_image);\n\n\t\t$dst_w = imagesx($dst_image);\n\t\t$dst_h = imagesy($dst_image);\n\n\t\t$dims = self::calculateFitDimensions($src_w, $src_h, $dst_w, $dst_h, $overflow);\n\n\t\timagecopyresampled($dst_image, $src_image, (int)$dims['dst_x'], (int)$dims['dst_y'], (int)$dims['src_x'], (int)$dims['src_y'], (int)$dims['dst_w'], (int)$dims['dst_h'], (int)$dims['src_w'], (int)$dims['src_h']);\n\t}", "function logonscreener_image_scale_and_crop($image, $source_width, $source_height) {\n global $screen_width, $screen_height;\n\n // Phase 1: Scale.\n $scale = max($screen_width / $source_width, $screen_height / $source_height);\n $scaled_width = (int) round($source_width * $scale);\n $scaled_height = (int) round($source_height * $scale);\n\n if ($scale != 1) {\n logonscreener_log(\"Scale = $scale. Scaled width = $scaled_width. Scaled height = $scaled_height.\");\n\n $res2 = imagecreatetruecolor($scaled_width, $scaled_height);\n imagefill($res2, 0, 0, imagecolorallocate($res2, 255, 255, 255));\n if (!imagecopyresampled($res2, $image, 0, 0, 0, 0, $scaled_width, $scaled_height, $source_width, $source_height)) {\n logonscreener_log('Scale did not worked out. HZ.');\n return FALSE;\n }\n\n // Destroy the original image and update image object.\n imagedestroy($image);\n $image = $res2;\n }\n\n // Phase 2: Crop.\n if ($scaled_width != $screen_width || $scaled_height != $screen_height) {\n $screen_width = (int) $screen_width;\n $screen_height = (int) $screen_height;\n\n $x = ($scaled_width - $screen_width) / 2;\n $y = ($scaled_height - $screen_height) / 2;\n logonscreener_log(\"Crop source X = $x. Crop source Y = $y.\");\n\n $res = imagecreatetruecolor($screen_width, $screen_height);\n imagefill($res, 0, 0, imagecolorallocate($res, 255, 255, 255));\n if (!imagecopyresampled($res, $image, 0, 0, $x, $y, $screen_width, $screen_height, $screen_width, $screen_height)) {\n logonscreener_log('Crop did not worked out. HZ.');\n return FALSE;\n }\n\n // Destroy the original image and update image object.\n imagedestroy($image);\n $image = $res;\n }\n\n return $image;\n}", "public function crop($startX,$startY,$width,$height){\n\t\t$this->cropimage($width,$height,$startX,$startY);\n\t\treturn $this;\t\n\t}", "public function crop($width = null, $height = null, $gravity = null, $x = null, $y = null)\n {\n return $this->resize(Crop::crop($width, $height, $gravity, $x, $y));\n }", "function normal_resize_image($source, $destination, $image_type, $max_size, $image_width, $image_height, $quality){\n\n\tif($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n\t//do not resize if image is smaller than max size\n\tif($image_width <= $max_size && $image_height <= $max_size){\n\t\tif(save_image($source, $destination, $image_type, $quality)){\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t//Construct a proportional size of new image\n\t$image_scale\t= min($max_size/$image_width, $max_size/$image_height);\n\t$new_width\t\t= ceil($image_scale * $image_width);\n\t$new_height\t\t= ceil($image_scale * $image_height);\n\n\t$new_canvas\t\t= imagecreatetruecolor( $new_width, $new_height ); //Create a new true color image\n\n\t//Copy and resize part of an image with resampling\n\tif(imagecopyresampled($new_canvas, $source, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height)){\n\t\tsave_image($new_canvas, $destination, $image_type, $quality); //save resized image\n\t}\n\n\treturn true;\n}", "function imageResize($imageResourceId=null,$width=null,$height=null, $targetWidth=null, $targetHeight=null) {\n\n// $targetWidth =300;\n// $targetHeight =260;\n// dd($imageResourceId,$width,$height, $targetWidth, $targetHeight);\n\n $targetLayer=imagecreatetruecolor($targetWidth,$targetHeight);\n imagecopyresampled($targetLayer,$imageResourceId,0,0,0,0,$targetWidth,$targetHeight, $width,$height );\n// imagecopyresized($targetLayer,$imageResourceId,0,0,0,0, $width,$height,$targetWidth,$targetHeight);\n\n return $targetLayer;\n }", "protected function imageResizeCrop($source, $destination, $resize = [], $crop = [])\n {\n $params = [];\n // Clean the canvas.\n $params[] = '+repage';\n $params[] = '-flatten';\n if ($resize) {\n $params[] = '-thumbnail ' . escapeshellarg(sprintf('%sx%s!', $resize['width'], $resize['height']));\n }\n if ($crop) {\n $params[] = '-crop ' . escapeshellarg(sprintf('%dx%d+%d+%d', $crop['width'], $crop['height'], $crop['x'], $crop['y']));\n }\n $params[] = '-quality ' . $this->tileQuality;\n\n $result = $this->convert($source, $destination, $params);\n return $result;\n }", "function imagetrim($im) {\n // imagecropauto() doesn't work reliably. For example, it doesn't crop SGRMTW2C.png.\n //$im2 = imagecropauto($im);\n\n $tbox = null;\n $w = imagesx($im);\n $h = imagesy($im);\n for ($x = $w; $x--; ) {\n for ($y = $h; $y--; ) {\n if (imagecolorat($im, $x, $y) >> 24 !== 127) {\n $tbox = combineRect([$x, $y, $x + 1, $y + 1], $tbox);\n }\n }\n }\n\n $im2 = imagecrop($im, ['x' => $tbox[0], 'y' => $tbox[1], 'width' => $tbox[2] - $tbox[0], 'height' => $tbox[3] - $tbox[1]]);\n imagedestroy($im);\n return $im2;\n}", "public function crop($w, $h, $x = 0, $y = 0)\n {\n $this->width = $w;\n $this->height = $h;\n return $this->cropImage($this->width, $this->height, $x, $y);\n }", "function imgResize($filename, $newWidth, $newHeight, $dir_out){\n\t\n\t// изменение размера изображения\n\n\t// 1 создадим новое изображение из файла\n\t$scr = imagecreatefromjpeg($filename); // или $imagePath\n\t\n\t// 2 создадим новое полноцветное изображение нужного размера\n\t$newImg = imagecreatetruecolor($newWidth, $newHeight);\n\n\t// 3 определим размер исходного изображения для 4 пункта\n\t$size = getimagesize($filename);\n\n\t// 4 копирует прямоугольную часть одного изображения на другое изображение, интерполируя значения пикселов таким образом, чтобы уменьшение размера изображения не уменьшало его чёткости\n\timagecopyresampled($newImg, $scr, 0, 0, 0, 0, $newWidth, $newHeight, $size[0], $size[1]);\n\n\t// 5 запишем изображение в файл по нужному пути\n\timagejpeg($newImg, $dir_out);\n\n\timagedestroy($scr);\n\timagedestroy($newImg);\t\t\n\t\n}", "public function resizeImage($image, $width = MEDIUM_IMAGE_MAX_WIDTH, $height = MEDIUM_IMAGE_MAX_HEIGHT, $subpath = IMG_SUBPATH_MEDIUM, $quality = JPEG_QUALITY) \n {\n // check if file is image\n if (!$this->isFileImage($image) ) {\n $this->throwException(FILE_IS_NOT_IMAGE, \"File is not an image\");\n }\n list($imgWidth, $imgHeight) = getimagesize($image);\n \n if ($imgWidth > $imgHeight) {\n $newWidth = $imgWidth / ($imgWidth / $width);\n $newHeight = $imgHeight / ($imgWidth / $width);\n } else {\n $newWidth = $imgWidth / ($imgHeight / $height);\n $newHeight = $imgHeight / ($imgHeight / $height);\n }\n\n $path = pathinfo($image);\n //print_r($path); // debug\n $src_img = imagecreatefromjpeg($image);\n $dest_img = imagecreatetruecolor($newWidth, $newHeight);\n imagecopyresampled($dest_img, $src_img, 0, 0, 0, 0, $newWidth, $newHeight, $imgWidth, $imgHeight);\n \n if (ADD_WATERMARK_TO_PHOTO) {\n //TODO: Add optional watermark to photo\n }\n \n imagejpeg($dest_img, IMAGE_STORAGE_PATH . $subpath . $path['filename'] . \".\" . $path['extension'], $quality);\n \n \n return IMAGE_STORAGE_PATH . $subpath . $path['filename'] . \".\" . $path['extension'];\n }", "public function createThumbnail($imageName,$newWidth,$newHeight) {\n $path = $this->img_dir . '/' . $imageName;\n $mime_info = getimagesize($path);\n $mime = $mime_info['mime'];\n\n $src_img = $this->image_data($path, $mime);\n if($src_img===false) return false;\n\n $old_w = imageSX($src_img);\n $old_h = imageSY($src_img);\n\n $source_aspect_ratio = $old_w / $old_h;\n $desired_aspect_ratio = $newWidth / $newHeight;\n\n if ($source_aspect_ratio > $desired_aspect_ratio) {\n /*\n * Triggered when source image is wider\n */\n $thumb_h = $newHeight;\n $thumb_w = ( int ) ($newHeight * $source_aspect_ratio);\n } else {\n /*\n * Triggered otherwise (i.e. source image is similar or taller)\n */\n $thumb_w = $newWidth;\n $thumb_h = ( int ) ($newWidth / $source_aspect_ratio);\n }\n\n $dst_img = ImageCreateTrueColor($thumb_w,$thumb_h);\n\n $color = imagecolorallocatealpha($dst_img, 0, 0, 0, 127);\n imagefill($dst_img,0,0,$color);\n imagesavealpha($dst_img, true);\n\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_w, $old_h);\n\n if($this->is_crop_hard) {\n $x = ($thumb_w - $newWidth) / 2;\n $y = ($thumb_h - $newHeight) / 2;\n\n $tmp_img = imagecreatetruecolor($newWidth, $newHeight);\n $color = imagecolorallocatealpha($tmp_img, 0, 0, 0, 127);\n imagefill($tmp_img,0,0,$color);\n imagesavealpha($tmp_img, true);\n\n imagecopy($tmp_img, $dst_img, 0, 0, $x, $y, $newWidth, $newHeight);\n $dst_img = $tmp_img;\n }\n\n $new_thumb_loc = $this->thumb_dir . $imageName;\n $result = $this->save($dst_img, $new_thumb_loc, $mime);\n\n imagedestroy($dst_img);\n imagedestroy($src_img);\n return $result;\n }", "function resizeImage($filename, $max_width, $max_height)\n{\n list($orig_width, $orig_height) = getimagesize($filename);\n\n $width = $orig_width;\n $height = $orig_height;\n\n # taller\n if ($max_height != 0 && $max_width != 0)\n {\n\t if ($height > $max_height) {\n\t\t $width = ($max_height / $height) * $width;\n\t\t $height = $max_height;\n\t }\n\n\t # wider\n\t if ($width > $max_width) {\n\t\t $height = ($max_width / $width) * $height;\n\t\t $width = $max_width;\n\t }\n }\n\n $image_p = imagecreatetruecolor($width, $height);\n\n $image = imagecreatefromjpeg($filename);\n\n imagecopyresampled($image_p, $image, 0, 0, 0, 0,\n $width, $height, $orig_width, $orig_height);\n\n return $image_p;\n}", "public function run() {\n\n // make enough memory available to scale bigger images\n ini_set('memory_limit', $this->thumb->options['memory']);\n \n // create the gd lib image object\n switch($this->thumb->image->mime()) {\n case 'image/jpeg':\n $image = @imagecreatefromjpeg($this->thumb->image->root()); \n break;\n case 'image/png':\n $image = @imagecreatefrompng($this->thumb->image->root()); \n break;\n case 'image/gif':\n $image = @imagecreatefromgif($this->thumb->image->root()); \n break;\n default:\n raise('The image mime type is invalid');\n break;\n } \n\n // check for a valid created image object\n if(!$image) raise('The image could not be created');\n\n // cropping stuff needs a couple more steps \n if($this->thumb->options['crop'] == true) {\n\n // Starting point of crop\n $startX = floor($this->thumb->tmp->width() / 2) - floor($this->thumb->result->width() / 2);\n $startY = floor($this->thumb->tmp->height() / 2) - floor($this->thumb->result->height() / 2);\n \n // Adjust crop size if the image is too small\n if($startX < 0) $startX = 0;\n if($startY < 0) $startY = 0;\n \n // create a temporary resized version of the image first\n $thumb = imagecreatetruecolor($this->thumb->tmp->width(), $this->thumb->tmp->height()); \n $thumb = $this->keepColor($thumb);\n imagecopyresampled($thumb, $image, 0, 0, 0, 0, $this->thumb->tmp->width(), $this->thumb->tmp->height(), $this->thumb->source->width(), $this->thumb->source->height()); \n \n // crop that image afterwards \n $cropped = imagecreatetruecolor($this->thumb->result->width(), $this->thumb->result->height()); \n $cropped = $this->keepColor($cropped);\n imagecopyresampled($cropped, $thumb, 0, 0, $startX, $startY, $this->thumb->tmp->width(), $this->thumb->tmp->height(), $this->thumb->tmp->width(), $this->thumb->tmp->height()); \n imagedestroy($thumb);\n \n // reasign the variable\n $thumb = $cropped;\n\n } else {\n $thumb = imagecreatetruecolor($this->thumb->result->width(), $this->thumb->result->height()); \n $thumb = $this->keepColor($thumb);\n imagecopyresampled($thumb, $image, 0, 0, 0, 0, $this->thumb->result->width(), $this->thumb->result->height(), $this->thumb->source->width(), $this->thumb->source->height()); \n } \n \n // convert the thumbnail to grayscale \n if($this->thumb->options['grayscale']) {\n imagefilter($thumb, IMG_FILTER_GRAYSCALE);\n }\n\n // convert the image to a different format\n if($this->thumb->options['to']) {\n\n switch($this->thumb->options['to']) {\n case 'jpg': \n imagejpeg($thumb, $this->thumb->root(), $this->thumb->options['quality']); \n break;\n case 'png': \n imagepng($thumb, $this->thumb->root(), 0); \n break; \n case 'gif': \n imagegif($thumb, $this->thumb->root()); \n break; \n }\n\n // keep the original file's format\n } else {\n\n switch($this->thumb->image->mime()) {\n case 'image/jpeg': \n imagejpeg($thumb, $this->thumb->root(), $this->thumb->options['quality']); \n break;\n case 'image/png': \n imagepng($thumb, $this->thumb->root(), 0); \n break; \n case 'image/gif': \n imagegif($thumb, $this->thumb->root()); \n break;\n }\n\n }\n\n imagedestroy($thumb);\n \n }", "public static function resize($image, $width, $height, $keepAspectRatio = true, $allowUpscaling = false)\n {\n $img = self::ensureImageInterfaceInstance($image)->copy();\n\n /** @var BoxInterface $sourceBox */\n $sourceBox = $img->getSize();\n $destinationBox = static::getBox($sourceBox, $width, $height, $keepAspectRatio);\n\n if ($allowUpscaling === false && self::isUpscaling($sourceBox, $destinationBox)) {\n return $img;\n }\n\n return $img->resize($destinationBox);\n }", "function crop_algorithm($location, $save_to, $set_width, $set_height){\n\t// Algoritam developed by Mirza Ohranovic | [email protected]\n\t// Coded by Mirza Ohranovic\n\t// October 2014.\n\n\t$image = new Imagick;\n\t$image->readImage($location);\n\n\t// Get size\n\tlist($width, $height) = getimagesize($location);\n\n\t\t$hratio \t= $set_height / $height;\n\t\t$wratio\t\t= $set_width / $width;\n\n\t\tif($wratio < 1 && $hratio < 1){\n\t\t\t$odabran = min($hratio, $wratio);\n\n\t\t\tif($odabran == $hratio){\n\t\t\t\t$nova = $width * $wratio;\n\t\t\t\t$image->scaleImage($nova, 0);\n\t\t\t}elseif($odabran == $wratio){\n\t\t\t\t$nova = $height * $hratio;\n\t\t\t\t$image->scaleImage(0, $nova);\n\t\t\t}\n\t\t}elseif($wratio < 1 && $hratio >= 1){\n\t\t\t$nova = $height * $hratio;\n\t\t\t$image->scaleImage(0, $nova);\n\t\t}elseif($wratio >= 1 && $hratio < 1){\n\t\t\t$nova = $width * $wratio;\n\t\t\t$image->scaleImage($nova, 0);\n\t\t}else{\n\t\t\t$image->scaleImage($set_width, 0);\n\t\t}\n\n\t\t$v = $image->getImageGeometry();\n\t\t\t$w = $v['width'];\n\t\t\t$h = $v['height'];\n\n\t\t$x = floor(($w - $set_width) / 2);\n\t\t$y = floor(($h - $set_height) / 2);\n\n\t\tif($x <= 1) $x = 0;\n\t\tif($y <= 1) $y = 0;\n\n\t\t$image->cropImage($set_width, $set_height, $x, $y);\n\t\t$image->writeImage($save_to);\n\t\t$image->clear();\n\t\t$image->destroy();\n\t}", "function reduce_image_size($dest_folder,$image_name,$files)\n{\n //REDUCE IMAGE RESOLUTION\n if($files)\n {\n //echo 123;exit;\n $dest = $dest_folder.$image_name;\n $width = 300;\n $height = 300;\n list($width_orig, $height_orig) = getimagesize($files);\n $ratio_orig = $width_orig/$height_orig;\n if ($width/$height > $ratio_orig)\n {\n $width = $height*$ratio_orig;\n }\n else\n {\n $height = $width/$ratio_orig;\n }\n $image_p = imagecreatetruecolor($width, $height);\n $image = imagecreatefromjpeg($files);\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);\n imagejpeg($image_p,$dest, 100);\n ImageDestroy ($image_p);\n }\n //END OF REDUCING IMAGE RESOLUTION\n}", "public function runContainResize(Image $image, $width, $height) : Image\n\t{\n\t\treturn $image->resize($width, $height, function ($constraint) {\n\t\t\t$constraint->aspectRatio();\n\t\t});\n\t}", "public function getCroppedImage($image, $w, $h, $x=false, $y=false) {\n\t\t$source = $image->getSource();\n\t\tif ($source->type != 'Local') {\n\t\t\t// ignore crop for remote sources at the moment\n\t\t\treturn $image->url;\n\t\t}\n\n\t\t$sourcePath = $source->settings['path'];\n\t\t$folderPath = $image->getFolder()->path;\n\n\t\t$imagePath = $sourcePath . $folderPath . $image->filename;\n\n\t\tif (!file_exists($imagePath)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tlist($imgW, $imgH) = getimagesize($imagePath);\n\n\t\tif ($w == $imgW && $h == $imgH) {\n\t\t\treturn $image->url;\n\t\t}\n\n\t\t$x = false;\n\t\t$y = false;\n\n\t\tif (isset($image->focalPoint)) {\n\t\t\tif (isset($image->focalPoint['x'])) {\n\t\t\t\t$x = $image->focalPoint['x'];\n\t\t\t}\n\t\t\tif (isset($image->focalPoint['y'])) {\n\t\t\t\t$y = $image->focalPoint['y'];\n\t\t\t}\t\t\t\n\t\t}\n\n\t\tif ($x === false) {\n\t\t\t$x = round($imgW / 2);\n\t\t}\n\t\tif ($y === false) {\n\t\t\t$y = round($imgH / 2);\n\t\t}\t\t\n\n\t\t$wOut = $w;\n\t\t$hOut = $h;\n\n\t\t$imgRatio = $imgW / $imgH;\n\t\t$cropRatio = $w / $h;\n\n\t\tif ($w > $h && $imgRatio < $cropRatio) { // crop as portrait\n\t\t\t$cropScale = $imgW / $w;\n\n\t\t\t$w *= $cropScale;\n\t\t\t$h *= $cropScale;\n\n\t\t\t$cropX = 0;\n\t\t\t$cropY = $y - $h/2;\n\n\t\t\t// focus point bounds checking\n\t\t\tif ($cropY < 0) {\n\t\t\t\t$cropY = 0;\n\t\t\t}\n\t\t\tif ($cropY + $h > $imgH) {\n\t\t\t\t$cropY = $imgH - $h;\n\t\t\t}\n\t\t}\n\t\telse { // crop as landscape\n\t\t\t$cropScale = $imgH / $h;\n\n\t\t\t$w *= $cropScale;\n\t\t\t$h *= $cropScale;\n\n\t\t\t$cropY = 0;\n\t\t\t$cropX = $x - $w/2;\n\n\t\t\t// focus point bounds checking\n\t\t\tif ($cropX < 0) {\n\t\t\t\t$cropX = 0;\n\t\t\t}\n\t\t\tif ($cropX + $w > $imgW) {\n\t\t\t\t$cropX = $imgW - $w;\n\t\t\t}\n\t\t}\n\t\treturn $this->cropImage($imagePath, $cropX, $cropY, $w, $h, $wOut, $hOut);\t\n\t}", "public function resize(IImageInformation $src, $width, $height);", "function resize($width,$height)\n {\n $new_image = imagecreatetruecolor($width, $height);\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $new_image; \n }", "public function crop($startX,$startY,$width,$height){\n\t\t// do some calculations\n\t\t$cropWidth\t= ($this->_width < $width) ? $this->_width : $width;\n\t\t$cropHeight = ($this->_height < $height) ? $this->_height : $height;\n\t\t\n\t\t$this->_width = $cropWidth;\n\t\t$this->_height = $cropHeight;\n\t\treturn $this;\n\t}", "private static function resize_image($source, $width, $height){\n\t\t$source_width = imagesx($source);\n\t\t$source_height = imagesy($source);\n\t\t$source_aspect = round($source_width / $source_height, 1);\n\t\t$target_aspect = round($width / $height, 1);\n\t\n\t\t$resized = imagecreatetruecolor($width, $height);\n\t\n\t\tif ($source_aspect < $target_aspect){\n\t\t\t// higher\n\t\t\t$new_size = array($width, ($width / $source_width) * $source_height);\n\t\t\t$source_pos = array(0, (($new_size[1] - $height) * ($source_height / $new_size[1])) / 2);\n\t\t}else if ($source_aspect > $target_aspect){\n\t\t\t// wider\n\t\t\t$new_size = array(($height / $source_height) * $source_width, $height);\n\t\t\t$source_pos = array((($new_size[0] - $width) * ($source_width / $new_size[0])) / 2, 0);\n\t\t}else{\n\t\t\t// same shape\n\t\t\t$new_size = array($width, $height);\n\t\t\t$source_pos = array(0, 0);\n\t\t}\n\t\n\t\tif ($new_size[0] < 1) $new_size[0] = 1;\n\t\tif ($new_size[1] < 1) $new_size[1] = 1;\n\t\n\t\timagecopyresampled($resized, $source, 0, 0, $source_pos[0], $source_pos[1], $new_size[0], $new_size[1], $source_width, $source_height);\n\t\n\t\treturn $resized;\n\t}", "public function applyFilter(Image $image)\n {\n // return $image->resize(80, null, function ($constraint) {\n // $constraint->aspectRatio();\n // });\n\n\n\n // resize image to fixed size\n\t\t// return $image->resize(60, 40); // 600 / 400\n\t\treturn $image->fit(60, 40);\n\n\n }" ]
[ "0.6801627", "0.67763376", "0.6725753", "0.66238195", "0.6589467", "0.65783393", "0.6551591", "0.6524436", "0.64539176", "0.643251", "0.63902557", "0.63791174", "0.63740593", "0.63693756", "0.6321373", "0.6316384", "0.6189324", "0.6165461", "0.61213005", "0.6112218", "0.6112216", "0.61024284", "0.6091166", "0.607918", "0.6067223", "0.60642684", "0.6030416", "0.6028418", "0.6017512", "0.60170895", "0.6016002", "0.6015488", "0.6004376", "0.6000225", "0.59815496", "0.5974045", "0.59482634", "0.5936971", "0.5893016", "0.58738595", "0.58731383", "0.58666575", "0.5834768", "0.5787066", "0.5782133", "0.5766921", "0.5765937", "0.57572037", "0.57571536", "0.5751698", "0.5748272", "0.57445234", "0.5737896", "0.5733532", "0.57311815", "0.5703445", "0.57020605", "0.57016546", "0.56887907", "0.5685182", "0.56825125", "0.56789845", "0.5677187", "0.5666787", "0.56629425", "0.5656496", "0.5649196", "0.56399226", "0.56398386", "0.5637748", "0.5634866", "0.56253475", "0.56210756", "0.55938935", "0.5586195", "0.5582656", "0.5581814", "0.5575242", "0.5570896", "0.55676156", "0.5564605", "0.55625486", "0.55542547", "0.5549211", "0.55400103", "0.55260205", "0.55088896", "0.55020005", "0.5498178", "0.54973567", "0.5492025", "0.5486602", "0.54743344", "0.54731065", "0.5463319", "0.5458267", "0.5457037", "0.544497", "0.5428251", "0.5422004" ]
0.5893267
38
Crop's part of image.
public function crop($top, $left, $width, $height) { return $this->createCloneWithResource( function (InterventionImage $resource) use ($top, $left, $height, $width) { return $resource->crop($width, $height, $left, $top); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function crop()\n {\n }", "public function crop()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('crop');\n\t}", "function image_crop()\n\t{\n\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\tif (substr($protocol, -3) == 'gd2')\n\t\t{\n\t\t\t$protocol = 'image_process_gd';\n\t\t}\n\t\t\n\t\treturn $this->$protocol('crop');\n\t}", "public static function crop(){\n\n}", "protected function cropMagic(): void\n {\n $this->image->crop($this->cropWidth, $this->cropHeight, $this->cropLeft, $this->cropTop);\n }", "function crop( $x = 0, $y = 0, $w = 0, $h = 0 )\n\t{\n\t\tif( $w == 0 || $h == 0 )\n\t\t\treturn FALSE;\n\t\t\n\t\t//create a target canvas\n\t\t$new_im = imagecreatetruecolor ( $w, $h );\n\t\n\t\t//copy and resize image to new canvas\n\t\timagecopyresampled( $new_im, $this->im, 0, 0, $x, $y, $w, $h, $w, $h );\n\t\t\n\t\t//delete the old image handle\n\t\timagedestroy( $this->im );\n\t\t\n\t\t//set the new image as the current handle\n\t\t$this->im = $new_im;\n\t}", "public function crop(IImageInformation $src, $x, $y, $width, $height);", "public function crop()\n {\n $this->_pid = $this->_request->getInput('pid');\n $imgUrl = $this->_request->getInput('imgUrl');\n $imgInfo = new SplFileInfo($imgUrl);\n $cropParams = $this->_request->getAllPostInput();\n $cropParams['img_final_dir'] = '/images/properties/';\n $cropParams['image_out'] = $this->_pid . '-' . uniqid() . '.' . $imgInfo->getExtension();\n\n $this->_imageOut = $cropParams['img_final_dir'] . $cropParams['image_out'];\n\n if($this->_cropper->crop($cropParams))\n {\n return true;\n }\n return false;\n }", "public function crop($width, $height, $offset_x=null, $offset_y=null);", "public function crop($value) {\n return $this->setProperty('crop', $value);\n }", "public function crop($value = null)\n {\n $this->crop = $value;\n }", "abstract function crop($properties);", "function _crop_image_resource($img, $x, $y, $w, $h)\n {\n }", "function crop($rect=array(),&$autosave=null) \n { \n //invalid rectangle defintion \n if(empty($rect)) \n { \n return $this; \n } \n \n if(count($rect)==2) \n { \n $_rect=$rect; \n $rect=array(0,0,$_rect[0],$_rect[1]); \n unset($_rect); \n } \n \n if(count($rect)==3) \n { \n $_rect=array($rect[0],$rect[1],$rect[2]); \n $rect=array(0,0,$_rect[1],$_rect[2]); \n \n switch(trim(strtolower($_rect[0]))) \n { \n case 'lt': \n $rect[0]=0; \n $rect[1]=0; \n break; \n case 'rt': \n $rect[0]=$this->_width-$rect[2]; \n $rect[1]=0; \n break; \n case 'lb': \n $rect[0]=0; \n $rect[1]=$this->_height-$rect[3]; \n break; \n case 'rb': \n $rect[0]=$this->_width-$rect[2]; \n $rect[1]=$this->_height-$rect[3]; \n break; \n case 'center': \n $rect[0]=($this->_width-$rect[2])*0.5; \n $rect[1]=($this->_height-$rect[3])*0.5; \n break; \n } \n unset($_rect); \n } \n \n if(count($rect)!=4 || $rect[0]<0 || $rect[1]<0 || $rect[2]<=0 || $rect[3]<0) \n { \n return $this; \n } \n \n //overflow \n if($rect[0]+$rect[2]>$this->_width || $rect[1]+$rect[3]>$this->_height) \n { \n return $this; \n } \n \n $_tmpImage=imagecreatetruecolor($rect[2],$rect[3]); \n imagecopy($_tmpImage,$this->_image,0,0,$rect[0],$rect[1],$rect[2],$rect[3]); \n imagedestroy($this->_image); \n $this->_image=&$_tmpImage; \n \n $this->_width=$rect[2]; \n $this->_height=$rect[3]; \n \n if(isset($autosave)) \n { \n $_file=sprintf('%s%s_%sx%s.%s', \n $this->_imagePathInfo['dirname'].DS, \n $this->_imagePathInfo['filename'], \n $this->_width,$this->_height, \n $this->_imagePathInfo['extension'] \n ); \n \n if($this->saveAs($_file,$this->default_qulity,$this->default_smooth,$this->auto_dispose)) \n { \n $autosave=$_file; \n } \n } \n \n return $this; \n }", "private function _setCrop()\n {\n if (isset($this->crop) && $this->crop && $this->bbox_rubberband && $this->_isResize()) {\n\n $bbox_rubberband = explode(',', $this->bbox_rubberband);\n\n //lower-left coordinate\n $ll_point = new \\stdClass();\n $ll_point->x = $bbox_rubberband[0];\n $ll_point->y = $bbox_rubberband[3];\n $ll_coord = $this->pix2Geo($ll_point);\n\n //upper-right coordinate\n $ur_point = new \\stdClass();\n $ur_point->x = $bbox_rubberband[2];\n $ur_point->y = $bbox_rubberband[1];\n $ur_coord = $this->pix2Geo($ur_point);\n\n //set the size as selected\n $width = abs($bbox_rubberband[2]-$bbox_rubberband[0]);\n $height = abs($bbox_rubberband[3]-$bbox_rubberband[1]);\n\n $this->map_obj->setSize($width, $height);\n if ($this->_isResize() && $this->_download_factor > 1) {\n $this->map_obj->setSize($this->_download_factor*$width, $this->_download_factor*$height);\n }\n\n //set the extent to match that of the crop\n $this->map_obj->setExtent($ll_coord->x, $ll_coord->y, $ur_coord->x, $ur_coord->y);\n }\n }", "function crop($x, $y, $width, $height){\n\n $new_image = imagecreatetruecolor($width, $height);\n imagecopy($new_image, $this->image, 0, 0, $x, $y, $width, $height);\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $width;\n $this->height = $height;\n\n return true;\n }", "public function crop($value)\n {\n $this->args = array_merge($this->args, ['crop' => $value]);\n\n return $this;\n }", "function FE_CropImage($img, $w=0, $h=0, $a=''){\t\t\r\n\t\t$q=80; /* calitate 0-100 */\t\t\r\n\t\t$src =__URL__.'app/tt/tt.php?src='.$img.($w>0 ? \"&w=$w\" : \"\").($h>0 ? \"&h=$h\" : \"\").\"&q=$q\".(!empty($a) ? \"&a=$a\" : \"\");\r\n\t\treturn $src;\r\n\t\t\r\n }", "public function test_crop() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->crop( 0, 0, 50, 50 );\n\n\t\t$this->assertEquals( array( 'width' => 50, 'height' => 50 ), $imagick_image_editor->get_size() );\n\n\t}", "public function imageCrop()\n {\n return view('ImageCrop');\n }", "public function crop($width, $height)\n\t{\n\t\t// Resize to minimum size\n\t\t$wScale = $this->width / $width; // 4\n\t\t$hScale = $this->height / $height; // 3\n\t\t$minScale = min($wScale, $hScale);\n\t\t// Decrease image dimensions\n\t\tif($minScale > 1)\n\t\t{\n\t\t\t$widthResize = $this->width / $minScale;\n\t\t\t$heightResize = $this->height / $minScale;\n\t\t}\n\t\t// Increase image dimensions\n\t\telse\n\t\t{\n\t\t\t$widthResize = $this->width / $minScale;\n\t\t\t$heightResize = $this->height / $minScale;\n\t\t}\n\t\t$image = imagecreatetruecolor($width, $height);\n\t\t$x = ($widthResize - $width) / 2;\n\t\t$y = ($heightResize - $height) / 2;\n\t\timagecopyresampled($image, $this->image, 0, 0, $x, $y, $width, $height, $widthResize, $heightResize);\n\n\t\t$this->image = $image;\n\t\t$this->width = $width;\n\t\t$this->height = $height;\n\t}", "public function test_crop() {\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->crop( 0, 0, 50, 50 );\n\n\t\t$this->assertSame(\n\t\t\tarray(\n\t\t\t\t'width' => 50,\n\t\t\t\t'height' => 50,\n\t\t\t),\n\t\t\t$imagick_image_editor->get_size()\n\t\t);\n\t}", "public function saveCroppedAsset()\n {\n if(!empty($this->uploadedFile))\n {\n // If file is exist -> remove him\n if(file_exists($this->getFilePath()))\n {\n unlink($this->getFilePath());\n }\n\n $this->genFilename();\n $imagine = Image::getImagine()->open($this->uploadedFile->tempName);\n }\n else\n {\n if(file_exists($this->getFilePath())) {\n $imagine = Image::getImagine()->open($this->getFilePath());\n } else return false;\n }\n\n $size = $imagine->getSize();\n $width = $size->getWidth();\n $height = $size->getHeight();\n\n $cropData = explode(';', $this->cropData);\n\n if(count($cropData) == 4)\n {\n $point = new Point($cropData[0]*$width, $cropData[1]*$height);\n $box = new Box($cropData[2]*$width, $cropData[3]*$height);\n $imagine->crop($point, $box);\n // $imageBox = $this->getImageBox($size);\n // $imagine->resize($imageBox);\n }\n $imagine->save($this->getFilePath());\n\n return $this->save(false);\n }", "public function crop($startX,$startY,$width,$height){\n\t\t$this->cropimage($width,$height,$startX,$startY);\n\t\treturn $this;\t\n\t}", "function imgcrop(){\n\t\t$id = $this->session->userdata(SESSION_CONST_PRE.'userId');\n\t\t$dir_path = './assets/uploads/students/';\n\t\n\t\t$file_path = $dir_path . \"/Profile.small.jpg\";\n\t\t$src = $dir_path .'Profile.jpg';\n\t\tif(file_exists($file_path)){\n\t\t\t$src = $dir_path .'Profile.small.jpg';\n\t\t}\n\t\n\t\t$imgW = $_POST['w'];\n\t\t$imgH = $_POST['h'];\n\t\t$imgY1 = $_POST['y'];\n\t\t$imgX1 = $_POST['x'];\n\t\t$cropW = $_POST['w'];\n\t\t$cropH = $_POST['h'];\n\t\n\t\t$jpeg_quality = 100;\n\t\n\t\t//$img_r = imagecreatefromjpeg($src);\n\t\t$what = getimagesize($src);\n\t\t//list($imgInitW, $imgInitH, $type, $what) = getimagesize($src);\n\t\t$imgW = $imgInitW = $what[0];\n\t\t$imgH = $imgInitH = $what[1];\n\t\tswitch(strtolower($what['mime']))\n\t\t{\n\t\t\tcase 'image/png':\n\t\t\t\t$img_r = imagecreatefrompng($src);\n\t\t\t\t$source_image = imagecreatefrompng($src);\n\t\t\t\t$type = '.png';\n\t\t\t\tbreak;\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$img_r = imagecreatefromjpeg($src);\n\t\t\t\t$source_image = imagecreatefromjpeg($src);\n\t\t\t\t$type = '.jpeg';\n\t\t\t\tbreak;\n\t\t\tcase 'image/jpg':\n\t\t\t\t$img_r = imagecreatefromjpeg($src);\n\t\t\t\t$source_image = imagecreatefromjpeg($src);\n\t\t\t\t$type = '.jpg';\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$img_r = imagecreatefromgif($src);\n\t\t\t\t$source_image = imagecreatefromgif($src);\n\t\t\t\t$type = '.gif';\n\t\t\t\tbreak;\n\t\t\tdefault: die('image type not supported');\n\t\t}\n\t\n\t\t$resizedImage = imagecreatetruecolor($imgW, $imgH);\n\t\timagecopyresampled($resizedImage, $source_image, 0, 0, 0, 0, $imgW,\n\t\t$imgH, $imgInitW, $imgInitH);\n\t\n\t\n\t\t$dest_image = imagecreatetruecolor($cropW, $cropH);\n\t\timagecopyresampled($dest_image, $source_image, 0, 0, $imgX1, $imgY1, $cropW,\n\t\t$cropH, $cropW, $cropH);\n\t\n\t\n\t\timagejpeg($dest_image, $dir_path.'Profile.small.jpg', $jpeg_quality);\n\t\n\t}", "function myImageCrop($imgSrc,$newfilename,$thumbWidth=100,$output=false,$thumbHeight=0){\n \t\n\t\tif($thumbHeight == 0) $thumbHeight = $thumbWidth;\n\t\t\n\t\t//getting the image dimensions\n\t\tlist($width, $height) = getimagesize($this->path.$imgSrc); \n\t\t\n\t\t\n\t\t$extension = strtolower($this->getExtension($imgSrc,false)); // false - tells to get \"jpg\" NOT \".jpg\" GOT IT :P\n\t\t\n\t\t//saving the image into memory (for manipulation with GD Library)\n\t\tswitch($extension) {\n\t\t\tcase 'gif':\n\t\t\t$myImage = imagecreatefromgif($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t\tcase 'jpg':\n\t\t\t$myImage = imagecreatefromjpeg($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t$myImage = imagecreatefrompng($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t}\n\t\t\n\n\n\t\t ///-------------------------------------------------------- \n\t\t //setting the crop size \n\t\t //-------------------------------------------------------- \n\t\t if($width > $height){ \n\t\t\t $biggestSide = $width; \n\t\t\t $cropPercent = .6; \n\t\t\t $cropWidth = $biggestSide*$cropPercent; \n\t\t\t $cropHeight = $biggestSide*$cropPercent; \n\t\t\t $c1 = array(\"x\"=>($width-$cropWidth)/2, \"y\"=>($height-$cropHeight)/2); \n\t\t }else{ \n\t\t\t $biggestSide = $height; \n\t\t\t $cropPercent = .6; \n\t\t\t $cropWidth = $biggestSide*$cropPercent; \n\t\t\t $cropHeight = $biggestSide*$cropPercent; \n\t\t\t $c1 = array(\"x\"=>($width-$cropWidth)/2, \"y\"=>($height-$cropHeight)/7); \n\t\t } \n\t\t \n\t\t //--------------------------------------------------------\n\t\t// Creating the thumbnail\n\t\t//--------------------------------------------------------\n\t\t$thumb = imagecreatetruecolor($thumbWidth, $thumbHeight); \n\t\timagecopyresampled($thumb, $myImage, 0, 0, $c1['x'], $c1['y'], $thumbWidth, $thumbHeight, $cropWidth, $cropHeight); \n\n\t\tif($output == false){\n\t\t\tif($extension==\"jpg\" ){\n\t\t\t\timagejpeg($thumb,$this->path.$newfilename,100);\n\t\t\t}elseif($extension==\"gif\" ){\n\t\t\t\timagegif($thumb,$this->path.$newfilename,100);\n\t\t\t}elseif($extension==\"png\" ){\n\t\t\t\timagepng($thumb,$this->path.$newfilename,9);\n\t\t\t}\n\t\t}else{\n\t\t\t//final output \n\t\t\t//imagejpeg($thumb);\n\t\t\tif($extension==\"jpg\" ){\n\t\t\t\theader('Content-type: image/jpeg');\n\t\t\t\timagejpeg($thumb);\n\t\t\t}elseif($extension==\"gif\" ){\n\t\t\t\theader('Content-type: image/gif');\n\t\t\t\timagegif($thumb);\n\t\t\t}elseif($extension==\"png\" ){\n\t\t\t\theader('Content-type: image/png');\n\t\t\t\timagepng($thumb);\n\t\t\t}\n\t\t} \n\t\timagedestroy($thumb); \n\t}", "public static function crop()\n {\n return new CropMode(CropMode::CROP);\n }", "public function initCropBox() {\n $this->setImage($this->configuration['image']);\n $this->setCropBoxProperties();\n $this->setOriginalSize();\n $this->setAspectRatio();\n $this->setDelta();\n\n return $this;\n }", "function imagecropauto($image, $mode = -1, $threshold = 0.5, $color = -1)\n{\n}", "function _crop(){\n echo_array($_POST);\n\n if (!empty($_POST['x'])) { $x=$_POST['x'];}else{$x=100;}\n if (!empty($_POST['y'])) { $y=$_POST['y'];}else{$y=100;}\n if (!empty($_POST['w'])) { $w=$_POST['w'];}else{$w=100;}\n if (!empty($_POST['h'])) { $h=$_POST['h'];}else{$h=100;}\n $data['raw_name']=$_POST['raw_name'];\n $data['file_ext']=$_POST['file_ext'];\n $targ_w =$w; $targ_h = $h;\n $jpeg_quality = 90;\n $src = './uploads/'.trim($_POST['image']);\n $img_r = imagecreatefromjpeg($src);\n $dst_r = ImageCreateTrueColor( $targ_w, $targ_h );\n imagecopyresampled($dst_r,$img_r,0,0,$x,$y,\n $targ_w,$targ_h,$w,$h);\n $dst=imagefilter($dst_r, IMG_FILTER_GRAYSCALE);\n imagefilter($dst_r,IMG_FILTER_COLORIZE,80,60,40); //sepia\n imagejpeg($dst_r, './uploads/'.'crop_'.trim($_POST['image']), 80);\n //echo_array($data);\n $this->load->library('tcontrol');\n $this->load->library('tpanel');\n $class=\"tpanel\";\n $s=$this->tpanel->get('date',$data);\n $s.=$this->tpanel->get('navigation_menu',$data);\n $s.=$this->tpanel->get('ajax_menu',$data);\n $s.=$this->tpanel->get('spacer',$data);\n\n $s.=$this->load->view('image_lab_view',$data,TRUE);\n $data['title']='The Tlist Class';\n $data['content']=$s;\n $data['panel']='';\n\n $this->template($data) ;\n //$this->load->view('image_crop_view', $data);\n\n ;}", "function imagetrim($im) {\n // imagecropauto() doesn't work reliably. For example, it doesn't crop SGRMTW2C.png.\n //$im2 = imagecropauto($im);\n\n $tbox = null;\n $w = imagesx($im);\n $h = imagesy($im);\n for ($x = $w; $x--; ) {\n for ($y = $h; $y--; ) {\n if (imagecolorat($im, $x, $y) >> 24 !== 127) {\n $tbox = combineRect([$x, $y, $x + 1, $y + 1], $tbox);\n }\n }\n }\n\n $im2 = imagecrop($im, ['x' => $tbox[0], 'y' => $tbox[1], 'width' => $tbox[2] - $tbox[0], 'height' => $tbox[3] - $tbox[1]]);\n imagedestroy($im);\n return $im2;\n}", "public function crop(){\n return $this->zajlib->json(['status'=>'ok']);\n }", "public function makeCrop() : Crop\n {\n if($this->makeCrop) {\n return $this->makeCrop;\n }\n return $this->makeCrop = factory(Crop::class)->make();\n }", "public function cropImage($width, $height, $x, $y)\n {\n if ($this->resource->getNumberImages() > 0) {\n $frames = $this->resource->coalesceImages();\n foreach ($frames as $frame) {\n $frame->setImageBackgroundColor('none');\n $frame->cropImage($width, $height, $x, $y);\n $frame->thumbnailImage($width, $height);\n $frame->setImagePage($width, $height, 0, 0);\n }\n $this->resource = $frames->deconstructImages();\n $this->resource->resizeImage($width, $height, $this->imageFilter, $this->imageBlur);\n } else {\n $this->resource->cropImage($width, $height, $x, $y);\n }\n\n return $this;\n }", "public function crop_image($w, $h)\n\t{\n // This function resizes this image to fit in the box $w x $h, cropping to fill the entire image\n $image_size = $this->image_size();\n if ($image_size[0] == $w && $image_size[1] == $h) {\n // No need to crop\n return;\n }\n $ratio = $image_size[0] / $image_size[1];\n $goal_ratio = $w / $h;\n\n // Calculate the new image size\n if ($ratio < $goal_ratio) {\n // Tall image, crop top and bottom\n $l = 0;\n $r = $image_size[0];\n $height = $image_size[0] / $goal_ratio;\n $t = ($image_size[1] / 2) - ($height / 2);\n $b = ($image_size[1] / 2) + ($height / 2);\n } else {\n // Wide image, crop top and bottom\n $t = 0;\n $b = $image_size[1];\n $width = $image_size[1] * $goal_ratio;\n $l = ($image_size[0] / 2) - ($width / 2);\n $r = ($image_size[0] / 2) + ($width / 2);\n }\n\n // Create a new image for the resized image\n $oldimage = $this->load_image();\n $newimage = imagecreatetruecolor($w, $h);\n imagecopyresampled($newimage, $oldimage, 0, 0, $l, $t, $w, $h, $r - $l, $b - $t);\n $filename = tempnam(sys_get_temp_dir(), 'img');\n if (preg_match('/jpeg/', $image_size['mime'])) {\n imagejpeg($newimage, $filename, 100);\n } elseif (preg_match('/gif/', $image_size['mime'])) {\n imagegif($newimage, $filename);\n } elseif (preg_match('/png/', $image_size['mime'])) {\n imagepng($newimage, $filename);\n }\n $this->delete_local_file();\n $this->local_file = $filename;\n\t}", "public function user_crop()\r\n\t{\r\n\t\t// Get uploaded photo\r\n\t\t$uploaded_photo = $this->input->post('uploaded_photo');\r\n\r\n\t\t// Get image width, height\r\n\t\tlist($width, $height) = @getimagesize('./assets/uploads/' . $uploaded_photo);\r\n\r\n\t\t// Calculate ratio\r\n\t\t$ratio = $width / 536;\r\n\r\n\t\t// Get chosen crop coordinates\r\n\t\t$coords_x1 = round($ratio * $this->input->post('coords-x1'));\r\n\t\t$coords_y1 = round($ratio * $this->input->post('coords-y1'));\r\n\t\t$coords_x2 = round($ratio * $this->input->post('coords-x2'));\r\n\t\t$coords_y2 = round($ratio * $this->input->post('coords-y2'));\r\n\t\t$coords_w = round($ratio * $this->input->post('coords-w'));\r\n\t\t$coords_h = round($ratio * $this->input->post('coords-h'));\r\n\r\n\t\t// Profile thumbnail crop config\r\n\t\t$config['source_image'] = './assets/uploads/' . $uploaded_photo;\r\n\t\t$config['new_image'] = './assets/uploads/tall-' . strtolower($uploaded_photo);\r\n\t\t$config['width'] = $coords_w;\r\n\t\t$config['height'] = $coords_h;\r\n\t\t$config['maintain_ratio'] = FALSE;\r\n\t\t$config['x_axis'] = $coords_x1;\r\n\t\t$config['y_axis'] = $coords_y1;\r\n\r\n\t\t// Initialize the image library with config\r\n\t\t$this->image_lib->initialize($config);\r\n\r\n\t\t// Crop the image\r\n\t\tif (!$this->image_lib->crop())\r\n\t\t{\r\n\t\t\t$errors[] = $this->image_lib->display_errors('', '');\r\n\t\t}\r\n\r\n\t\t// Clear the config to start next thumbnail\r\n\t\t$config = array();\r\n\t\t$this->image_lib->clear();\r\n\r\n\t\t// Profile thumbnail resize config\r\n\t\t$config['source_image'] = './assets/uploads/tall-' . strtolower($uploaded_photo);\r\n\t\t$config['width'] = 385;\r\n\t\t$config['height'] = 465;\r\n\t\t$config['maintain_ratio'] = FALSE;\r\n\r\n\t\t// Initialize the image library with config\r\n\t\t$this->image_lib->initialize($config);\r\n\r\n\t\t// Resize the image\r\n\t\tif (!$this->image_lib->resize())\r\n\t\t{\r\n\t\t\t$errors[] = $this->image_lib->display_errors('', '');\r\n\t\t}\r\n\t}", "public function cropAvatarAction()\n {\n // TODO: swap web dir to product path\n //$imgRealPath = '/Users/leonqiu/www/choumei.me/Symfony/web/' . $_POST['imageSource'];\n $imgRealPath = dirname(__FILE__) . '/../../../../web/' . $_POST['imageSource'];\n list($width, $height) = getimagesize($imgRealPath);\n \n $viewPortW = $_POST[\"viewPortW\"];\n\t $viewPortH = $_POST[\"viewPortH\"];\n $pWidth = $_POST[\"imageW\"];\n $pHeight = $_POST[\"imageH\"];\n $tmp = explode(\".\",$_POST[\"imageSource\"]);\n $ext = end(&$tmp);\n $function = $this->returnCorrectFunction($ext);\n //$image = $function($_POST[\"imageSource\"]);\n $image = $function($imgRealPath);\n $width = imagesx($image);\n $height = imagesy($image);\n \n // Resample\n $image_p = imagecreatetruecolor($pWidth, $pHeight);\n $this->setTransparency($image,$image_p,$ext);\n\t\timagecopyresampled($image_p, $image, 0, 0, 0, 0, $pWidth, $pHeight, $width, $height);\n\t\timagedestroy($image);\n\t\t$widthR = imagesx($image_p);\n\t\t$hegihtR = imagesy($image_p);\n\t\t\n\t\t$selectorX = $_POST[\"selectorX\"];\n\t\t$selectorY = $_POST[\"selectorY\"];\n\t\t\n\t\tif($_POST[\"imageRotate\"]){\n\t\t $angle = 360 - $_POST[\"imageRotate\"];\n\t\t $image_p = imagerotate($image_p,$angle,0);\n\t\t \n\t\t $pWidth = imagesx($image_p);\n\t\t $pHeight = imagesy($image_p);\n\t\t \n\t\t //print $pWidth.\"---\".$pHeight;\n\t\t\n\t\t $diffW = abs($pWidth - $widthR) / 2;\n\t\t $diffH = abs($pHeight - $hegihtR) / 2;\n\t\t \n\t\t $_POST[\"imageX\"] = ($pWidth > $widthR ? $_POST[\"imageX\"] - $diffW : $_POST[\"imageX\"] + $diffW);\n\t\t $_POST[\"imageY\"] = ($pHeight > $hegihtR ? $_POST[\"imageY\"] - $diffH : $_POST[\"imageY\"] + $diffH);\n\t\t\n\t\t \n\t\t}\n\t\t\n\t\t$dst_x = $src_x = $dst_y = $dst_x = 0;\n\t\t\n\t\tif($_POST[\"imageX\"] > 0){\n\t\t $dst_x = abs($_POST[\"imageX\"]);\n\t\t}else{\n\t\t $src_x = abs($_POST[\"imageX\"]);\n\t\t}\n\t\tif($_POST[\"imageY\"] > 0){\n\t\t $dst_y = abs($_POST[\"imageY\"]);\n\t\t}else{\n\t\t $src_y = abs($_POST[\"imageY\"]);\n\t\t}\n\t\t\n\t\t\n\t\t$viewport = imagecreatetruecolor($_POST[\"viewPortW\"],$_POST[\"viewPortH\"]);\n\t\t$this->setTransparency($image_p,$viewport,$ext);\n\t\t\n\t\timagecopy($viewport, $image_p, $dst_x, $dst_y, $src_x, $src_y, $pWidth, $pHeight);\n\t\timagedestroy($image_p);\n\t\t\n\t\t\n\t\t$selector = imagecreatetruecolor($_POST[\"selectorW\"],$_POST[\"selectorH\"]);\n\t\t$this->setTransparency($viewport,$selector,$ext);\n\t\timagecopy($selector, $viewport, 0, 0, $selectorX, $selectorY,$_POST[\"viewPortW\"],$_POST[\"viewPortH\"]);\n\t\t\n\t\t//$file = \"tmp/test\".time().\".\".$ext;\n\t\t// TODO: generate file name\n\t\t$fileName = uniqid() . \".\" . $ext;\n\t\t$user = $this->get('security.context')->getToken()->getUser();\n\t\t$avatarFile = dirname(__FILE__).'/../../../../web/uploads/avatar/'.$user->getId(). '/' .$fileName;\n\t\t$avatarUrl = '/uploads/avatar/'. $user->getId() . '/' . $fileName;\n\t\t$this->parseImage($ext,$selector,$avatarFile);\n\t\timagedestroy($viewport);\n\t\t//Return value\n\t\t//update avatar\n $em = $this->getDoctrine()->getEntityManager();\n $user->setAvatar($avatarUrl);\n $em->persist($user);\n $em->flush();\n\t\techo $avatarUrl;\n\t\texit;\n }", "public function cropAction()\n {\n $candidate = $this->getRequest()->server->get('HTTP_REFERER');\n\n // make sure we get back to product page (fallback to admin home)\n if (strpos($candidate, '/product/product/') !== false) {\n $return_path = $candidate;\n $this->getRequest()->getSession()->set('crop_return_path', $return_path);\n } else {\n $return_path = $this->getRequest()->getSession()->get('crop_return_path');\n if (empty($return_path)) {\n $return_path = '/admin/dashboard';\n }\n }\n\n $path = $this->getRequest()->get('path');\n\n $source_path = $this->container->getParameter('kernel.root_dir') . \"/../web\" . $this->getRequest()->get('src');\n list( $source_width, $source_height, $source_type ) = getimagesize($source_path);\n\n if ($this->getRequest()->isMethod('post')) {\n\n $vector = $this->getRequest()->get('v');\n\n switch ( $source_type )\n {\n case IMAGETYPE_GIF:\n $source_gdim = imagecreatefromgif($source_path);\n break;\n\n case IMAGETYPE_JPEG:\n $source_gdim = imagecreatefromjpeg($source_path);\n break;\n\n case IMAGETYPE_PNG:\n $source_gdim = imagecreatefrompng($source_path);\n break;\n }\n\n $width = $vector[2] - $vector[0];\n $height = $vector[3] - $vector[1];\n\n // if crop makes sense\n if ($width < $source_width) {\n $dest = imagecreatetruecolor($width, $height);\n imagecopy($dest, $source_gdim, 0, 0, $vector[0], $vector[1], $width, $height);\n\n switch ( $source_type )\n {\n case IMAGETYPE_GIF:\n imagegif($dest, $source_path);\n break;\n\n case IMAGETYPE_JPEG:\n imagejpeg($dest, $source_path);\n break;\n\n case IMAGETYPE_PNG:\n imagepng($dest, $source_path);\n break;\n }\n\n // use new width for rendering\n list( $source_width, $source_height, $source_type ) = getimagesize($source_path);\n\n $this->addFlash('sonata_flash_success', 'Image cropped');\n } else {\n $this->addFlash('sonata_flash_error', 'Image not cropped: wrong dimensions');\n }\n }\n\n return $this->render('TeoProductBundle:Admin:crop_image.html.twig', array(\n 'path' => $path,\n 'action' => 'crop',\n 'teo_product_aspect_ratio' => $this->container->getParameter('teo_product_aspect_ratio'),\n 'actual_width' => $source_width,\n 'return_path' => $return_path,\n 'random' => md5(mt_rand()) . md5(mt_rand())\n ));\n }", "public function crop($startX,$startY,$width,$height){\n\t\t// do some calculations\n\t\t$cropWidth\t= ($this->_width < $width) ? $this->_width : $width;\n\t\t$cropHeight = ($this->_height < $height) ? $this->_height : $height;\n\t\t\n\t\t$this->_width = $cropWidth;\n\t\t$this->_height = $cropHeight;\n\t\treturn $this;\n\t}", "public static function crop($img_name, $x, $y, $type = 'fit')\n {\n $full_path = storage_path('app/public/'.$img_name);\n $full_thumb_path = storage_path('app/public/thumbs/'.$img_name);\n $thumb = Image::make($full_path);\n\n if ($type == 'fit')\n self::fit($thumb, $x, $y, $full_thumb_path);\n else\n self::resize($thumb, $x, $y, $full_thumb_path);\n }", "function getImageCropWindow() {\n printf(\n '<html><head><title>%s</title></head><body>'.\n '<object type=\"application/x-shockwave-flash\" width=\"640\" height=\"540\"\n data=\"flash/imagecrop.swf?lzproxied=false&imageid=%s\">\n <param name=\"movie\" value=\"flash/imagecrop.swf?lzproxied=false&imageid=%s\">\n <param name=\"quality\" value=\"high\">\n <param name=\"scale\" value=\"noscale\">\n <param name=\"salign\" value=\"LT\">\n <param name=\"menu\" value=\"false\"></object></body></html>',\n papaya_strings::escapeHTMLChars($this->_gt('Crop image')),\n papaya_strings::escapeHTMLChars($this->params['file_id']),\n papaya_strings::escapeHTMLChars($this->params['file_id'])\n );\n exit;\n }", "function wp_ajax_crop_image()\n {\n }", "public function crop($width = null, $height = null, $gravity = null, $x = null, $y = null)\n {\n return $this->resize(Crop::crop($width, $height, $gravity, $x, $y));\n }", "function resizeCropImage($src, $dst, $dstx, $dsty){\n\t\t//$dst = destination image location\n\t\t//$dstx = user defined width of image\n\t\t//$dsty = user defined height of image\n\t\t$allowedExtensions = 'jpg jpeg gif png';\n\t\t$name = explode(\".\", strtolower($src));\n\t\t$currentExtensions = $name[count($name)-1];\n\t\t$extensions = explode(\" \", $allowedExtensions);\n\n\t\tfor($i=0; count($extensions)>$i; $i=$i+1) {\n\t\t\tif($extensions[$i]==$currentExtensions)\n\t\t\t{ \n\t\t\t\t$extensionOK=1; \n\t\t\t\t$fileExtension=$extensions[$i]; \n\t\t\t\tbreak; \n\t\t\t}\n\t\t}\n\n\t\tif($extensionOK){\n\t\t\t$size = getImageSize($src);\n\t\t\t$width = $size[0];\n\t\t\t$height = $size[1];\n\t\t\tif($width >= $dstx AND $height >= $dsty){\n\t\t\t\t$proportion_X = $width / $dstx;\n\t\t\t\t$proportion_Y = $height / $dsty;\n\t\t\t\tif($proportion_X > $proportion_Y ){\n\t\t\t\t\t$proportion = $proportion_Y;\n\t\t\t\t}else{\n\t\t\t\t\t$proportion = $proportion_X ;\n\t\t\t\t}\n\t\t\t\t$target['width'] = $dstx * $proportion;\n\t\t\t\t$target['height'] = $dsty * $proportion;\n\t\t\t\t$original['diagonal_center'] = round(sqrt(($width*$width)+($height*$height))/2);\n\t\t\t\t$target['diagonal_center'] = round(sqrt(($target['width']*$target['width']) + ($target['height']*$target['height']))/2);\n\t\t\t\t$crop = round($original['diagonal_center'] - $target['diagonal_center']);\n\t\t\t\tif($proportion_X < $proportion_Y ){\n\t\t\t\t\t$target['x'] = 0;\n\t\t\t\t\t$target['y'] = round((($height/2)*$crop)/$target['diagonal_center']);\n\t\t\t\t}else{\n\t\t\t\t\t$target['x'] = round((($width/2)*$crop)/$target['diagonal_center']);\n\t\t\t\t\t$target['y'] = 0;\n\t\t\t\t}\n\t\t\t\tif($fileExtension == \"jpg\" OR $fileExtension=='jpeg'){ \n\t\t\t\t\t$from = ImageCreateFromJpeg($src); \n\t\t\t\t} elseif ($fileExtension == \"gif\"){ \n\t\t\t\t\t$from = ImageCreateFromGIF($src); \n\t\t\t\t} elseif ($fileExtension == 'png'){\n\t\t\t\t\t$from = imageCreateFromPNG($src);\n\t\t\t\t}\n\t\t\t\t$new = ImageCreateTrueColor ($dstx,$dsty);\n\t\t\t\timagecopyresampled ($new, $from, 0, 0, $target['x'], \n\t\t\t\t$target['y'], $dstx, $dsty, $target['width'], $target['height']);\n\t\t\t\tif($fileExtension == \"jpg\" OR $fileExtension == 'jpeg'){ \n\t\t\t\t\timagejpeg($new, $dst, 70); \n\t\t\t\t} elseif ($fileExtension == \"gif\"){ \n\t\t\t\t\timagegif($new, $dst); \n\t\t\t\t}elseif ($fileExtension == 'png'){\n\t\t\t\t\timagepng($new, $dst);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcopy($src, $dst);\n\t\t\t}\n\t\t}\n\t}", "function image_crop(){\n\n\t\t\t$imgUrl = $_POST['imgUrl'];\n\t\t\t/*explored image URL and get image name*/\n\t\t\t$expImgUrl=explode(\"/\", $imgUrl);\n\t\t\t$LengthOfArray = sizeof($expImgUrl);\n\t\t\t$imageName = $LengthOfArray-1;\n\t\t\t$imgName = $expImgUrl[$imageName];\n\t\t\t$imgInitW = $_POST['imgInitW'];\n\t\t\t$imgInitH = $_POST['imgInitH'];\n\t\t\t$imgW = $_POST['imgW'];\n\t\t\t$imgH = $_POST['imgH'];\n\t\t\t$imgY1 = $_POST['imgY1'];\n\t\t\t$imgX1 = $_POST['imgX1'];\n\t\t\t$cropW = $_POST['cropW'];\n\t\t\t$cropH = $_POST['cropH'];\n\n\t\t\t$jpeg_quality = 100;\n\t\t\t$rand = rand();\n\t\t\t$output_filename = \"../webroot/img/uploads/croppedImg_\".$rand;\n\t\t\t$oname = \"img/uploads/croppedImg_\".$rand;\n\t\t\t$Pname = \"img/uploads/\";\n\t\t\t$path = BASE_PATH;\n\n\t\t\t$what = getimagesize($Pname.\"/\".$imgName);\n\t\t\t\n\t\t\tswitch(strtolower($what['mime']))\n\t\t\t{\n\t\t\t\tcase 'image/png':\n\t\t\t\t\t$img_r = imagecreatefrompng($Pname.\"/\".$imgName);\n\t\t\t\t\t$source_image = imagecreatefrompng($Pname.\"/\".$imgName);\n\t\t\t\t\t$type = '.png';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/jpeg':\n\t\t\t\t\t$img_r = imagecreatefromjpeg($Pname.\"/\".$imgName);\n\t\t\t\t\t$source_image = imagecreatefromjpeg($Pname.\"/\".$imgName);\n\t\t\t\t\t$type = '.jpeg';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/gif':\n\t\t\t\t\t$img_r = imagecreatefromgif($Pname.\"/\".$imgName);\n\t\t\t\t\t$source_image = imagecreatefromgif($Pname.\"/\".$imgName);\n\t\t\t\t\t$type = '.gif';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: die('image type not supported');\n\t\t\t}\n\t\t\t\t\n\t\t\t$resizedImage = imagecreatetruecolor($imgW, $imgH);\n\t\t\timagecopyresampled($resizedImage, $source_image, 0, 0, 0, 0, $imgW, \n\t\t\t\t\t\t$imgH, $imgInitW, $imgInitH);\t\n\t\t\t\n\t\t\t\n\t\t\t$dest_image = imagecreatetruecolor($cropW, $cropH);\n\t\t\timagecopyresampled($dest_image, $resizedImage, 0, 0, $imgX1, $imgY1, $cropW, \n\t\t\t\t\t\t$cropH, $cropW, $cropH);\t\n\n\n\t\t\timagejpeg($dest_image, $output_filename.$type, $jpeg_quality);\n\t\t\t\n\t\t\t$response = array(\n\t\t\t\t\t\"status\" => 'success',\n\t\t\t\t\t\"url\" => $oname.$type, \n\t\t\t\t\t\"base\" => $path \n\t\t\t\t );\n\t\t\t print json_encode($response);\n\t\t\t exit;\n\t}", "public function setCrop($x, $y)\n\t{\n\t\tif ($x === null || $y === null)\n\t\t{\n\t\t\t$this->cropX = $x;\n\t\t\t$this->cropY = $y;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->cropX = intval($x);\n\t\t\t$this->cropY = intval($y);\n\t\t}\n\t}", "public function crop($target_width, $target_height, $crop_X, $crop_Y, $crop_width, $crop_height, $save_to_file, $output_mimetype=NULL) {\n\t\t// create a blank image of the target dimensions\n\t\t$cropped_image = imagecreatetruecolor($target_width, $target_height);\n\t\t// resample the image to the cropped constraints\n\t\timagecopyresampled(\n\t\t\t\t$cropped_image,\n\t\t\t\t$this->source_image,\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\t$crop_X,\n\t\t\t\t$crop_Y,\n\t\t\t\t$target_width,\n\t\t\t\t$target_height,\n\t\t\t\t$crop_width,\n\t\t\t\t$crop_height\n\t\t);\n\t\t// save the cropped image and create a new Image \n\t\t$output_image_mimetype = $output_mimetype ? $output_mimetype : $this->source_image_mimetype;\n\t\tImageLib::save($cropped_image, $save_to_file, $output_image_mimetype);\n\t\treturn new static($save_to_file);\n\t}", "abstract public function calculateCropBoxCoordinates();", "public function maybeCropImage($data)\n {\n if (!$data['mod_image_crop']) {\n return $data['mod_image_image']['sizes'][$data['mod_image_size']];\n }\n\n $imageSrc = wp_get_attachment_image_src(\n $data['mod_image_image']['ID'],\n apply_filters('Modularity/image/image',\n municipio_to_aspect_ratio('16:9', array($data['mod_image_crop_width'], $data['mod_image_crop_height']))\n )\n );\n\n return $imageSrc[0];\n }", "public function cropImage($width, $height, $x, $y) {\n return $this->im->cropImage($width, $height, $x, $y);\n }", "public static function crop($image, $width, $height, array $start = [0, 0])\n {\n if (!isset($start[0], $start[1])) {\n throw new InvalidParamException('$start must be an array of two elements.');\n }\n\n return static::ensureImageInterfaceInstance($image)\n ->copy()\n ->crop(new Point($start[0], $start[1]), new Box($width, $height));\n }", "public function clip() {}", "function crop_algorithm($location, $save_to, $set_width, $set_height){\n\t// Algoritam developed by Mirza Ohranovic | [email protected]\n\t// Coded by Mirza Ohranovic\n\t// October 2014.\n\n\t$image = new Imagick;\n\t$image->readImage($location);\n\n\t// Get size\n\tlist($width, $height) = getimagesize($location);\n\n\t\t$hratio \t= $set_height / $height;\n\t\t$wratio\t\t= $set_width / $width;\n\n\t\tif($wratio < 1 && $hratio < 1){\n\t\t\t$odabran = min($hratio, $wratio);\n\n\t\t\tif($odabran == $hratio){\n\t\t\t\t$nova = $width * $wratio;\n\t\t\t\t$image->scaleImage($nova, 0);\n\t\t\t}elseif($odabran == $wratio){\n\t\t\t\t$nova = $height * $hratio;\n\t\t\t\t$image->scaleImage(0, $nova);\n\t\t\t}\n\t\t}elseif($wratio < 1 && $hratio >= 1){\n\t\t\t$nova = $height * $hratio;\n\t\t\t$image->scaleImage(0, $nova);\n\t\t}elseif($wratio >= 1 && $hratio < 1){\n\t\t\t$nova = $width * $wratio;\n\t\t\t$image->scaleImage($nova, 0);\n\t\t}else{\n\t\t\t$image->scaleImage($set_width, 0);\n\t\t}\n\n\t\t$v = $image->getImageGeometry();\n\t\t\t$w = $v['width'];\n\t\t\t$h = $v['height'];\n\n\t\t$x = floor(($w - $set_width) / 2);\n\t\t$y = floor(($h - $set_height) / 2);\n\n\t\tif($x <= 1) $x = 0;\n\t\tif($y <= 1) $y = 0;\n\n\t\t$image->cropImage($set_width, $set_height, $x, $y);\n\t\t$image->writeImage($save_to);\n\t\t$image->clear();\n\t\t$image->destroy();\n\t}", "public static function crop($path = null, $width = null, $height = null, $x = null, $y = null) {\n\n if(isset($path)) {\n\n $img = Image::make(public_path('storage/'.$path));\n $img->crop($width, $height, $x, $y);\n\n $mix = explode('.', $path);\n $extension = $mix[1];\n $raw = explode('/', $mix[0]);\n $name = end($raw);\n\n $file = $name.'- Cropped - '.\"$width\".'x'.\"$height\".'.'.$extension;\n\n unset($raw[(sizeof($raw)-1)]);\n\n\t\t $file_path = implode('/', $raw).'/'.$file;\n\n $img->save(public_path('storage/'.$file_path));\n\n return $file_path;\n\n } else {\n throw new ImageUploaderException(\n \"Path is empty\"\n );\n }\n\n }", "public function testManualCornerCrop() {\n\t\t$image = $this->getSampleImage();\n\t\t$this->assertTrue( !empty($image->ID) && $image->exists() );\n\n\t\t$original_url = $image->getAbsoluteURL();\n\n\t\t$in_from_left = 20;\n\t\t$in_from_top = 20;\n\t\t$in_from_right = 40;\n\t\t$in_from_bottom = 40;\n\n\t\t$width_original = $image->getWidth();\n\t\t$height_original = $image->getHeight();\n\n\t\t$bottom_right_x = $width_original - $in_from_right;\n\t\t$bottom_right_y = $height_original - $in_from_bottom;\n\n\t\t$width_thumb = $width_original - $in_from_left - $in_from_right;\n\t\t$height_thumb = $height_original - $in_from_top - $in_from_bottom;\n\n\t\t$thumb = $image->ManualCropFromCorners($in_from_left,$in_from_top,$in_from_right,$in_from_bottom)->Original();\n\n\t\t// Get its URL\n\t\t$url = $thumb->getAbsoluteURL();\n\n\t\t// should end with this command/path\n\t\t$this->assertStringEndsWith(\"=/{$in_from_left}x{$in_from_top}:{$bottom_right_x}x{$bottom_right_y}/{$original_url}\", $url);\n\n\t\t$this->getRemoteImageDimensions($url, $returned_width_thumb, $returned_height_thumb);\n\n\t\t$this->assertEquals( $returned_width_thumb, $width_thumb );// width\n\t\t$this->assertEquals( $returned_height_thumb, $height_thumb );// height\n\n\t}", "public function executeCrop(sfWebRequest $request)\n {\n $this->hasPermissionsForSelect();\n \n $selection = aMediaTools::getSelection();\n $id = $request->getParameter('id');\n $index = array_search($id, $selection);\n if ($index === false)\n {\n $this->forward404();\n }\n $cropLeft = floor($request->getParameter('cropLeft'));\n $cropTop = floor($request->getParameter('cropTop'));\n $cropWidth = floor($request->getParameter('cropWidth'));\n $cropHeight = floor($request->getParameter('cropHeight'));\n $width = floor($request->getParameter('width'));\n $height = floor($request->getParameter('height'));\n $imageInfo = aMediaTools::getAttribute('imageInfo');\n $imageInfo[$id]['cropLeft'] = $cropLeft;\n $imageInfo[$id]['cropTop'] = $cropTop;\n $imageInfo[$id]['cropWidth'] = $cropWidth;\n $imageInfo[$id]['cropHeight'] = $cropHeight;\n $imageInfo[$id]['width'] = $width;\n $imageInfo[$id]['height'] = $height;\n aMediaTools::setAttribute('imageInfo', $imageInfo);\n return $this->renderTemplate();\n }", "protected function _do_crop($width, $height, $offset_x, $offset_y)\n {\n $image = $this->_create($width, $height);\n\n // Loads image if not yet loaded\n $this->_load_image();\n\n // Execute the crop\n if (imagecopyresampled($image, $this->_image, 0, 0, $offset_x, $offset_y, $width, $height, $width, $height))\n {\n // Swap the new image for the old one\n imagedestroy($this->_image);\n $this->_image = $image;\n\n // Reset the width and height\n $this->width = imagesx($image);\n $this->height = imagesy($image);\n }\n }", "function flexibleCropper($source_location, $desc_location=null,$crop_size_w=null,$crop_size_h=null)\n\t{\n\t list($src_w, $src_h) = getimagesize($source_location);\n\n\t $image_source = imagecreatefromjpeg($source_location);\n\t $image_desc = imagecreatetruecolor($crop_size_w,$crop_size_h);\n\n\t/*\n\t if ($crop_size_w>$crop_size_h) {$my_crop_size_w=null;}\n\t elseif ($crop_size_h>$crop_size_w)\n\t {$my_crop_size_h=null;\n\n\t if (is_null($my_crop_size_h) and !is_null($my_crop_size_w))\n\t { $my_crop_size_h=$src_h*$my_crop_size_w/$src_w; }\n\t elseif (!is_null($my_crop_size_h))\n\t { $my_crop_size_w=$src_w*$my_crop_size_h/$src_h; }\n\t*/\n\n\t if ($src_w<$src_h) {$my_crop_size_h=$src_h*$crop_size_w/$src_w;} else {$my_crop_size_h=$crop_size_h;}\n\t if ($src_h<$src_w) {$my_crop_size_w=$src_w*$crop_size_h/$src_h;} else {$my_crop_size_w=$crop_size_w;}\n\t// echo \"($my_crop_size_w-$my_crop_size_h)\";\n\t if ($my_crop_size_w>$crop_size_w) {$additional_x=round(($crop_size_w-$my_crop_size_w)/2);} else {$additional_x=0;}\n\t if ($my_crop_size_h>$crop_size_h) {$additional_y=round(($crop_size_h-$my_crop_size_h)/2);} else {$additional_y=0;}\n\n\t $off_x=round($src_w/2)-round($my_crop_size_w/2);\n\t $off_y=round($src_h/2)-round($my_crop_size_h/2)+$additional_y;\n\t $off_w=(round($src_w/2)+round($my_crop_size_w/2))-$off_x;\n\t $off_h=(round($src_h/2)+round($my_crop_size_h/2))-$off_y;\n\n\t imagecopyresampled($image_desc, $image_source,$additional_x, $additional_y, $off_x, $off_y, $my_crop_size_w, $my_crop_size_h, $off_w, $off_h);\n\n\t if (!is_null($desc_location))\n\t imagejpeg($image_desc, $desc_location,100);\n\t else\n\t imagejpeg($image_desc);\n\t}", "public static function imaggaCrop()\n {\n return new CropMode(CropMode::IMAGGA_CROP);\n }", "function cropImage($param=array())\r\n {\r\n $ret = array(\r\n 'msg' => false,\r\n 'sts' => false,\r\n );\r\n\r\n $final_size = $param['final_size'];\r\n #$filename = $final_size.'-'.$param['img_newname'];\r\n $filename = $param['img_newname'];\r\n $target_dir = $param['dest_path'];\r\n $target_name = $target_dir.$filename;\r\n $source_name = $param['img_real'];\r\n \r\n //get size from real image \r\n $size = getimagesize($source_name);\r\n $targ_w = $param['w'];\r\n $targ_h = $param['h'];\r\n\r\n //get size from ratio\r\n $final_size = explode(\"x\", $final_size);\r\n $final_w = $final_size[0];\r\n $final_h = $final_size[1];\r\n \r\n if($final_w==='auto' && $final_h==='auto'){ //detect if width and height ratio is \"auto\" then readjust width and height size\r\n $final_w = $targ_w;\r\n $final_h = $targ_h;\r\n }elseif($final_w==='auto'){ //detect if width ratio is \"auto\" then readjust width size\r\n $final_w = intval(($final_size[1] * $targ_w) / $targ_h);\r\n }elseif($final_h==='auto'){ //detect if height ratio is \"auto\" then readjust height size\r\n $final_h = intval(($final_size[0] * $targ_h) / $targ_w);\r\n }\r\n //end\r\n \r\n \r\n $jpeg_quality = 90;\r\n $img_r = imagecreatefromjpeg($source_name);\r\n $dst_r = ImageCreateTrueColor( $final_w, $final_h );\r\n \r\n imagecopyresized(\r\n $dst_r, $img_r, \r\n 0,0, \r\n $param['x'],$param['y'], \r\n $final_w,$final_h,\r\n $param['w'],$param['h']\r\n );\r\n \r\n imagejpeg($dst_r,$target_name,$jpeg_quality);\r\n #$this->send_to_server( array($target_name) );\r\n $url_target_name = str_replace('/data/shopkl/_assets/', 'http://klimg.com/kapanlagi.com/klshop/', $target_name);\r\n \r\n\t\t\t\r\n //find image parent url and dir path from config\r\n //reset($this->imgsize['article']['size']);\r\n //$first_key = key($this->imgsize['article']['size']);\r\n //end find\r\n $ret['sts'] = true;\r\n $ret['filename'] = $filename;\r\n $ret['msg'] = '<div class=\"alert alert-success\">Image is cropped and saved in <a href=\"'. $url_target_name .'?'.date('his').'\" target=\"_blank\">'.$target_name.' !</a></div>';\r\n \r\n return $ret;\r\n }", "function crop($inFile, $outFile, $top, $right, $bottom, $left) {\n if ($inFile == $outFile) {\n // cannot write to source file\n return FALSE;\n }\n $cmd = sprintf(\n '%s -i %s -sameq -croptop %d -cropright %d -cropbottom %d -cropleft %d %s',\n escapeshellcmd($this->encoder),\n escapeshellarg($inFile),\n escapeshellcmd($top),\n escapeshellcmd($right),\n escapeshellcmd($bottom),\n escapeshellcmd($left),\n escapeshellcmd($outFile)\n );\n $this->execCmd($cmd, $null, $info);\n // base_object::debug($cmd, $null, $info);\n }", "public function crop($w, $h, $x = 0, $y = 0)\n {\n if(!is_numeric($x) || !is_numeric($y) || !is_numeric($w) || !is_numeric($h))\n {\n throw new Exception('One of the parameters was not numeric');\n }\n\n $imageIn = $this->getWorkingImageResource();\n $imageOut = imagecreatetruecolor($w, $h);\n\n imagecopyresampled($imageOut, $imageIn, 0, 0, $x, $y, $w, $h, $w, $h);\n\n $this->setWorkingImageResource($imageOut);\n }", "public function crop($w, $h, $x = 0, $y = 0)\n {\n $this->width = $w;\n $this->height = $h;\n return $this->cropImage($this->width, $this->height, $x, $y);\n }", "public function crop(array $dimensions, array $coordinates) {\n// is there an image resource to work with?\n if (isset($this->_resource)) {\n// do the dimensions have and coordinates have the appropriate values to work with (checking the keys)? \n if (array_keys($dimensions) == array(\"width\", \"height\") && array_keys($coordinates) == array(\"x1\", \"x2\", \"y1\", \"y2\")) {\n $is_all_int = true;\n foreach (array_merge($dimensions, $coordinates) as $value) {\n if (is_int($value) == false) {\n $is_all_int = false;\n }\n }\n if ($is_all_int == true) {\n $width = $dimensions[\"width\"];\n $height = $dimensions[\"height\"];\n $x1 = $coordinates[\"x1\"];\n $x2 = $coordinates[\"x2\"];\n $y1 = $coordinates[\"y1\"];\n $y2 = $coordinates[\"y2\"];\n\n// generating the placeholder resource\n $cropped_image = $this->newImageResource($width, $height);\n\n// copying the original image's resource into the placeholder and cropping it accordingly\n imagecopyresampled($cropped_image, $this->_resource, 0, 0, $x1, $y1, $width, $height, ($x2 - $x1), ($y2 - $y1));\n\n// assigning the new image attributes\n $this->_resource = $cropped_image;\n $this->_width = $width;\n $this->_height = $height;\n } else {\n trigger_error(\"CAMEMISResizeImage::crop() was provided values that were not integers (check the dimensions or coordinates for strings or floats)\", E_USER_WARNING);\n }\n } else {\n trigger_error(\"CAMEMISResizeImage::crop() was not provided the appropriate arguments (first given parameter must be an array and must contain \\\"width\\\" and \\\"height\\\" elements, and the second given parameter must be an array and contain \\\"x1\\\", \\\"x2\\\", \\\"y2\\\", and \\\"y2\\\" elements)\", E_USER_WARNING);\n }\n } else {\n trigger_error(\"CAMEMISResizeImage::crop() attempting to access a non-existent resource (check if the image was loaded by CAMEMISResizeImage::__construct())\", E_USER_WARNING);\n }\n\n return $this;\n }", "public function getCroppedImage($image, $w, $h, $x=false, $y=false) {\n\t\t$source = $image->getSource();\n\t\tif ($source->type != 'Local') {\n\t\t\t// ignore crop for remote sources at the moment\n\t\t\treturn $image->url;\n\t\t}\n\n\t\t$sourcePath = $source->settings['path'];\n\t\t$folderPath = $image->getFolder()->path;\n\n\t\t$imagePath = $sourcePath . $folderPath . $image->filename;\n\n\t\tif (!file_exists($imagePath)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tlist($imgW, $imgH) = getimagesize($imagePath);\n\n\t\tif ($w == $imgW && $h == $imgH) {\n\t\t\treturn $image->url;\n\t\t}\n\n\t\t$x = false;\n\t\t$y = false;\n\n\t\tif (isset($image->focalPoint)) {\n\t\t\tif (isset($image->focalPoint['x'])) {\n\t\t\t\t$x = $image->focalPoint['x'];\n\t\t\t}\n\t\t\tif (isset($image->focalPoint['y'])) {\n\t\t\t\t$y = $image->focalPoint['y'];\n\t\t\t}\t\t\t\n\t\t}\n\n\t\tif ($x === false) {\n\t\t\t$x = round($imgW / 2);\n\t\t}\n\t\tif ($y === false) {\n\t\t\t$y = round($imgH / 2);\n\t\t}\t\t\n\n\t\t$wOut = $w;\n\t\t$hOut = $h;\n\n\t\t$imgRatio = $imgW / $imgH;\n\t\t$cropRatio = $w / $h;\n\n\t\tif ($w > $h && $imgRatio < $cropRatio) { // crop as portrait\n\t\t\t$cropScale = $imgW / $w;\n\n\t\t\t$w *= $cropScale;\n\t\t\t$h *= $cropScale;\n\n\t\t\t$cropX = 0;\n\t\t\t$cropY = $y - $h/2;\n\n\t\t\t// focus point bounds checking\n\t\t\tif ($cropY < 0) {\n\t\t\t\t$cropY = 0;\n\t\t\t}\n\t\t\tif ($cropY + $h > $imgH) {\n\t\t\t\t$cropY = $imgH - $h;\n\t\t\t}\n\t\t}\n\t\telse { // crop as landscape\n\t\t\t$cropScale = $imgH / $h;\n\n\t\t\t$w *= $cropScale;\n\t\t\t$h *= $cropScale;\n\n\t\t\t$cropY = 0;\n\t\t\t$cropX = $x - $w/2;\n\n\t\t\t// focus point bounds checking\n\t\t\tif ($cropX < 0) {\n\t\t\t\t$cropX = 0;\n\t\t\t}\n\t\t\tif ($cropX + $w > $imgW) {\n\t\t\t\t$cropX = $imgW - $w;\n\t\t\t}\n\t\t}\n\t\treturn $this->cropImage($imagePath, $cropX, $cropY, $w, $h, $wOut, $hOut);\t\n\t}", "function cropImage($nw, $nh, $source,$newfileName,$case='top') {\n\t\t$thumb_croped = false;\n\t\t\n\t\t$size = getimagesize($this->path.$source);\n\t\t$w = $size[0];\n\t\t$h = $size[1];\n\t\t\n\t\t$extension = strtolower($this->getExtension($source,false)); // false - tells to get \"jpg\" NOT \".jpg\" GOT IT :P\n\t\t\n\t\tswitch($extension) {\n\t\t\tcase 'gif':\n\t\t\t$simg = imagecreatefromgif($this->path.$source);\n\t\t\tbreak;\n\t\t\tcase 'jpg':\n\t\t\t$simg = imagecreatefromjpeg($this->path.$source);\n\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t$simg = imagecreatefrompng($this->path.$source);\n\t\t\tbreak;\n\t\t}\n\t\t\n\n\t\t$dimg = imagecreatetruecolor($nw, $nh);\n\t\t$wm = $w/$nw;\n\t\t$hm = $h/$nh;\n\t\t$h_height = $nh/2;\n\t\t$w_height = $nw/2;\n\t\tif($w> $h) {\n\t\t\t$adjusted_width = $w / $hm;\n\t\t\t$half_width = $adjusted_width / 2;\n\t\t\t$int_width = $half_width - $w_height;\n\t\t\timagecopyresampled($dimg,$simg,-$int_width,0,0,0,$adjusted_width,$nh,$w,$h);\n\t\t} elseif(($w <$h) || ($w == $h)) {\n\t\t\t$adjusted_height = $h / $wm;\n\t\t\t$half_height = $adjusted_height / 2;\n\t\t\t$int_height = $half_height - $h_height;\n\t\t\timagecopyresampled($dimg,$simg,0,-$int_height,0,0,$nw,$adjusted_height,$w,$h);\n\t\t} else {\n\t\t\timagecopyresampled($dimg,$simg,0,0,0,0,$nw,$nh,$w,$h);\n\t\t}\n\t\t\n\t\tif($extension==\"jpg\" ){\n\t\t\timagejpeg($dimg,$this->path.$newfileName,100);\n\t\t\t$thumb_croped = true;\n\t\t}elseif($extension==\"gif\" ){\n\t\t\timagegif($dimg,$this->path.$newfileName,100);\n\t\t\t$thumb_croped = true;\n\t\t}elseif($extension==\"png\" ){\n\t\t\timagepng($dimg,$this->path.$newfileName,100);\n\t\t\t$thumb_croped = true;\n\t\t}\n\t\t\n\t\treturn $thumb_croped;\n\t\t\n\t\t//imagejpeg($dimg,$dest,100);\n\t}", "public function getCropBox($fallback = true, $asRect = true) {}", "public static function crop($image = NULL, $coordinateX = NULL, $coordinateY = NULL, $width = NULL, $height = NULL)\n\t{\n\n\t\tif (!($image instanceof Default_Model_MediaImage)) {\n\t\t\tthrow new Default_Model_MediaImage_Exception('Image needs to be an instance of Default_Model_MediaImage.');\n\t\t}\n\n\t\tif ($coordinateX &&\n\t\t\t!is_int($coordinateX)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('Coordinate X needs to be an integer, if specified.');\n\t\t}\n\n\t\tif ($coordinateY &&\n\t\t\t!is_int($coordinateY)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('Coordinate Y needs to be an integer, if specified.');\n\t\t}\n\n\t\tif ($width &&\n\t\t\t!is_int($width)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('Width needs to be an integer, if specified.');\n\t\t}\n\n\t\tif ($height &&\n\t\t\t!is_int($height)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('Height needs to be an integer, if specified.');\n\t\t}\n\n\t\t$cropedImage = Default_Service_MediaImage::fromMediaImage($image);\n\t\t$cropedImage->width = 0;\n\t\t$cropedImage->height = 0;\n\t\t$cropedImage->file_size = 0;\n\t\t$cropedImage->role_id = $image->role_id;\n\t\tif (isset($image['entity_id'])) {\n\t\t\t$cropedImage->entity_id = $image->entity_id;\n\t\t} else\n\t\tif (Zend_Auth::getInstance()->hasIdentity()) {\n\t\t\t$cropedImage->entity_id = Zend_Auth::getInstance()->getIdentity()->id;\n\t\t}\n\t\t$cropedImage->short = Default_Service_Media::getShort($image->short, $cropedImage->width, $cropedImage->height, $cropedImage->file_size);\n\t\t$cropedImage->save();\n\n\n\t\t/**\n\t\t * imageinstance file does not exist yet and needs to be created\n\t\t */\n\t\tif (!file_exists($cropedImage->getStoredFilePath())) {\n\n\t\t\t/**\n\t\t\t * use Imagick for croping the image ?\n\t\t\t */\n\t\t\tif (Zend_Registry::get('Imagick')) {\n\n\t\t\t\t/**\n\t\t\t\t * Imagick\n\t\t\t\t */\n\t\t\t\t$imagickError = NULL;\n\t\t\t\ttry {\n\t\t\t\t\t$imagickObj = new Imagick($image->getStoredFilePath());\n\t\t\t\t\t$imagickCropResult = $imagickObj->cropImage($width, $height, $coordinateX, $coordinateY);\n\t\t\t\t\tif ($imagickCropResult) {\n\t\t\t\t\t\t$imagickObj->writeimage($cropedImage->getStoredFilePath());\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * retrieve image infos\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$cropedImage->file_size = $imagickObj->getImageLength();\n\t\t\t\t\t\t$imagickDimensions = $imagickObj->getImageGeometry();\n\t\t\t\t\t\t$cropedImage->width = $imagickDimensions['width'];\n\t\t\t\t\t\t$cropedImage->height = $imagickDimensions['height'];\n\t\t\t\t\t\t$cropedImage->short = Default_Service_Media::getShort($image->short, $cropedImage->width, $cropedImage->height, $cropedImage->file_size);\n\t\t\t\t\t\t$cropedImage->save();\n\t\t\t\t\t}\n\t\t\t\t} catch (ImagickException $imagickError) {\n\n\t\t\t\t}\n\n\t\t\t\tif ($imagickError ||\n\t\t\t\t\t!$imagickCropResult) {\n\n\t\t\t\t\t$cropedImage->hardDelete();\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t$imageFile = L8M_Image::fromFile($image->getStoredFilePath());\n\n\t\t\t\tif ($imageFile instanceof L8M_Image_Abstract) {\n\n\t\t\t\t\t$imageFile\n\t\t\t\t\t\t->crop($coordinateX, $coordinateY, $width, $height)\n\t\t\t\t\t\t->save($cropedImage->getStoredFilePath(), TRUE)\n\t\t\t\t\t;\n\n\t\t\t\t\t/**\n\t\t\t\t\t * retrieve image infos\n\t\t\t\t\t */\n\t\t\t\t\t$cropedImage->file_size = $imageFile->getFilesize();\n\t\t\t\t\t$cropedImage->width = $imageFile->getWidth();\n\t\t\t\t\t$cropedImage->height = $imageFile->getHeight();\n\t\t\t\t\t$cropedImage->short = Default_Service_Media::getShort($image->short, $cropedImage->width, $cropedImage->height, $cropedImage->file_size);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * save\n\t\t\t\t\t */\n\t\t\t\t\tif (!$imageFile->isErrorOccured()) {\n\t\t\t\t\t\t$cropedImage->save();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$cropedImage->hardDelete();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn $cropedImage;\n\t}", "public function firstCrop() : Crop\n {\n if($this->firstCrop) {\n return $this->firstCrop;\n }\n return $this->firstCrop = Crop::find(1);\n }", "public function cutPictures($path, $data) {\n if ($data['ww'] == '') return true;\n// 比例\n $b = round($data['yw'] / $data['aw'], 8);\n $manager = new ImageManager();\n $image = $manager->make(public_path() . '/' . $path);\n $image->crop(round($data['ww'] * $b), round($data['hh'] * $b), round($data['x1'] * $b), round($data['y1'] * $b))\n ->save(public_path() . '/' . $path);\n }", "function cropImage($CurWidth,$CurHeight,$iSize,$DestFolder,$SrcImage,$Quality,$ImageType)\r\n{\t \r\n\t//Check Image size is not 0\r\n\tif($CurWidth <= 0 || $CurHeight <= 0) \r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t//abeautifulsite.net has excellent article about \"Cropping an Image to Make Square\"\r\n\t//http://www.abeautifulsite.net/blog/2009/08/cropping-an-image-to-make-square-thumbnails-in-php/\r\n\tif($CurWidth>$CurHeight)\r\n\t{\r\n\t\t$y_offset = 0;\r\n\t\t$x_offset = ($CurWidth - $CurHeight) / 2;\r\n\t\t$square_size \t= $CurWidth - ($x_offset * 2);\r\n\t}else{\r\n\t\t$x_offset = 0;\r\n\t\t$y_offset = ($CurHeight - $CurWidth) / 2;\r\n\t\t$square_size = $CurHeight - ($y_offset * 2);\r\n\t}\r\n\t\r\n\t$NewCanves \t= imagecreatetruecolor($iSize, $iSize);\t\r\n\tif(imagecopyresampled($NewCanves, $SrcImage,0, 0, $x_offset, $y_offset, $iSize, $iSize, $square_size, $square_size))\r\n\t{\r\n\t\tswitch(strtolower($ImageType))\r\n\t\t{\r\n\t\t\tcase 'image/png':\r\n\t\t\t\timagepng($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'image/gif':\r\n\t\t\t\timagegif($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\t\t\t\r\n\t\t\tcase 'image/jpeg':\r\n\t\t\tcase 'image/pjpeg':\r\n\t\t\t\timagejpeg($NewCanves,$DestFolder,$Quality);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t//Destroy image, frees memory\t\r\n\tif(is_resource($NewCanves)) {imagedestroy($NewCanves);} \r\n\treturn true;\r\n\r\n\t}\r\n\t \r\n}", "public function actionCropTemp()\n {\n $error = \"\";\n $msg = \"\";\n if(!empty($_FILES['crop_image']['error']))\n {\n switch($_FILES['crop_image']['error'])\n {\n\n case '1':\n $error = 'The uploaded file exceeds the upload_max_filesize directive in php.ini';\n break;\n case '2':\n $error = 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form';\n break;\n case '3':\n $error = 'The uploaded file was only partially uploaded';\n break;\n case '4':\n $error = 'No file was uploaded.';\n break;\n case '6':\n $error = 'Missing a temporary folder';\n break;\n case '7':\n $error = 'Failed to write file to disk';\n break;\n case '8':\n $error = 'File upload stopped by extension';\n break;\n case '999':\n default:\n $error = 'No error code available';\n }\n }elseif(empty($_FILES['crop_image']['tmp_name']) || $_FILES['crop_image']['tmp_name'] == 'none')\n {\n $error = 'No file was uploaded..';\n }else\n { \n if($_FILES['crop_image']['type']===\"image/jpeg\" || $_FILES['crop_image']['type']===\"image/gif\" || $_FILES['crop_image']['type']===\"image/png\" )\n {\n $newName = preg_replace('/[\\s\\/%*:|\"<>?]+/', '_', $_FILES['crop_image']['name']);\n $uploadRoot = Yii::getPathOfAlias('webroot').DIRECTORY_SEPARATOR.'upload';\n if(!is_dir($uploadRoot))\n {\n mkdir($uploadRoot);\n }\n\n $uploadDirectory = Yii::getPathOfAlias('webroot').DIRECTORY_SEPARATOR.'upload'.DIRECTORY_SEPARATOR.'tempCrop';\n if(!is_dir($uploadDirectory))\n {\n mkdir($uploadDirectory);\n }\n $uploadDirectory .= DIRECTORY_SEPARATOR;\n $tempName=$newName;\n $i=1;\n while(file_exists($uploadDirectory.$newName))\n {\n $newName = $i.\"_\".$tempName;\n $i++;\n }\n $uploadResult = move_uploaded_file($_FILES['crop_image']['tmp_name'], $uploadDirectory.$newName);\n if($uploadResult)\n $msg.= Yii::app()->baseUrl.'/upload/tempCrop/'.$newName;\n else\n $msg.= '1';\n\n @unlink($_FILES['crop_image']);//for security reason, we force to remove all uploaded file\n }\n else\n {\n @unlink($_FILES['crop_image']);\n $msg .= '1';\n }\n }\n echo json_encode(array(\"error\"=>$error,\"msg\"=>$msg));\n }", "function crop_image_square($source, $destination, $image_type, $square_size, $image_width, $image_height, $quality){\n if($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n if($image_width > $image_height)\n {\n $y_offset = 0;\n $x_offset = ($image_width - $image_height) / 2;\n $s_size \t= $image_width - ($x_offset * 2);\n }else{\n $x_offset = 0;\n $y_offset = ($image_height - $image_width) / 2;\n $s_size = $image_height - ($y_offset * 2);\n }\n $new_canvas\t= imagecreatetruecolor( $square_size, $square_size); //Create a new true color image\n\n //Copy and resize part of an image with resampling\n if(imagecopyresampled($new_canvas, $source, 0, 0, $x_offset, $y_offset, $square_size, $square_size, $s_size, $s_size)){\n save_image($new_canvas, $destination, $image_type, $quality);\n }\n\n return true;\n}", "public function crop($thumb_size = 250, $crop_percent = .5, $image_type = 'image/jpeg')\n {\n $width = $this->getWidth();\n $height = $this->getHeight();\n //set the biggest dimension\n if($width > $height)\n {\n $biggest = $width;\n }else{\n $biggest = $height;\n }\n //init the crop dimension based on crop_percent\n $cropSize = $biggest * $crop_percent;\n //get the crop cordinates\n $x = ($width - $cropSize) / 2;\n $y = ($height - $cropSize) / 2;\n\n //create the final thumnail\n $this->thumbImage = imagecreatetruecolor($thumb_size, $thumb_size);\n //fill background with white\n $bgc = imagecolorallocate($this->thumbImage, 255, 255, 255);\n imagefilledrectangle($this->thumbImage, 0, 0, $thumb_size, $thumb_size, $bgc);\n \n imagecopyresampled($this->thumbImage, $this->image, 0, 0, $x, $y, $thumb_size, $thumb_size, $cropSize, $cropSize );\n }", "public function actionSaveCroppedImage() {\n\n if ($_REQUEST['output_filename'] == '') {\n $output_filename = \"media/croppic/croppedimg/croppedImg_\" . time();\n } else {\n $output_filename = $_REQUEST['output_filename'] . time();\n }\n $output_filename2 = Yii::app()->request->baseUrl . '/' . $output_filename;\n\n $imgUrl = Yii::app()->basePath.'/..'.str_replace(Yii::app()->request->baseUrl,'',$_POST['imgUrl']);\n $imgInitW = $_POST['imgInitW'];\n $imgInitH = $_POST['imgInitH'];\n $imgW = $_POST['imgW'];\n $imgH = $_POST['imgH'];\n $imgY1 = $_POST['imgY1'];\n $imgX1 = $_POST['imgX1'];\n $cropW = $_POST['cropW'];\n $cropH = $_POST['cropH'];\n\n $jpeg_quality = 100;\n\n $what = getimagesize($imgUrl);\n \n switch (strtolower($what['mime'])) {\n case 'image/png':\n $img_r = imagecreatefrompng($imgUrl);\n $source_image = imagecreatefrompng($imgUrl);\n $type = '.png';\n break;\n case 'image/jpeg':\n $img_r = imagecreatefromjpeg($imgUrl);\n $source_image = imagecreatefromjpeg($imgUrl);\n $type = '.jpeg';\n break;\n case 'image/gif':\n $img_r = imagecreatefromgif($imgUrl);\n $source_image = imagecreatefromgif($imgUrl);\n $type = '.gif';\n break;\n default: die('image type not supported');\n }\n\n $resizedImage = imagecreatetruecolor($imgW, $imgH);\n imagecopyresampled($resizedImage, $source_image, 0, 0, 0, 0, $imgW, $imgH, $imgInitW, $imgInitH);\n\n\n $dest_image = imagecreatetruecolor($cropW, $cropH);\n imagecopyresampled($dest_image, $resizedImage, 0, 0, $imgX1, $imgY1, $cropW, $cropH, $cropW, $cropH);\n\n\n imagejpeg($dest_image, $output_filename . $type, $jpeg_quality);\n\n $response = array(\n \"status\" => 'success',\n \"url\" => $output_filename2 . $type\n );\n print json_encode($response);\n }", "public function crop(int $width = null, int $height = null, int $left = 0, int $top = 0): static\n {\n $this->cropWidth = $width;\n $this->cropHeight = $height;\n $this->cropLeft = $left;\n $this->cropTop = $top;\n\n return $this;\n }", "function cropImage($CurWidth, $CurHeight, $iSize, $DestFolder, $SrcImage, $Quality, $ImageType) { \n\t//Check Image size is not 0\n\tif($CurWidth <= 0 || $CurHeight <= 0) \n\t{\n\t\treturn false;\n\t}\n\t\n\t//abeautifulsite.net has excellent article about \"Cropping an Image to Make Square bit.ly/1gTwXW9\n\tif($CurWidth>$CurHeight)\n\t{\n\t\t$y_offset = 0;\n\t\t$x_offset = ($CurWidth - $CurHeight) / 2;\n\t\t$square_size \t= $CurWidth - ($x_offset * 2);\n\t}else{\n\t\t$x_offset = 0;\n\t\t$y_offset = ($CurHeight - $CurWidth) / 2;\n\t\t$square_size = $CurHeight - ($y_offset * 2);\n\t}\n\t\n\t$NewCanvas \t= imagecreatetruecolor($iSize, $iSize);\t\n\t\n\tif(strtolower($ImageType) == 'image/png') {\n\t\t// Saves Alpha\n\t\timagealphablending($NewCanvas, false);\n\t\timagesavealpha($NewCanvas,true);\n\t\t$transparent = imagecolorallocatealpha($NewCanvas, 255, 255, 255, 127);\n\t\timagefilledrectangle($NewCanvas, 0, 0, $square_size, $square_size, $transparent);\n\t}\n\t\n\tif(imagecopyresampled($NewCanvas, $SrcImage, 0, 0, $x_offset, $y_offset, $iSize, $iSize, $square_size, $square_size))\n\t{\n\t\tswitch(strtolower($ImageType))\n\t\t{\n\t\t\tcase 'image/png':\n\t\t\t\timagepng($NewCanvas,$DestFolder);\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($NewCanvas,$DestFolder);\n\t\t\t\tbreak;\t\t\t\n\t\t\tcase 'image/jpeg':\n\t\t\tcase 'image/pjpeg':\n\t\t\t\timagejpeg($NewCanvas,$DestFolder,$Quality);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//Destroy image, frees memory\t\n\t\tif(is_resource($NewCanvas)) {imagedestroy($NewCanvas);} \n\t\treturn true;\n\t} \n}", "public function getCropX()\n {\n return $this->_daImage->getCropX( $this->getId() );\n }", "public function crop($width, $height, $offset_x = NULL, $offset_y = NULL)\n {\n if ($width > $this->width)\n {\n // Use the current width\n $width = $this->width;\n }\n\n if ($height > $this->height)\n {\n // Use the current height\n $height = $this->height;\n }\n\n if ($offset_x === NULL)\n {\n // Center the X offset\n $offset_x = round(($this->width - $width) / 2);\n }\n elseif ($offset_x === TRUE)\n {\n // Bottom the X offset\n $offset_x = $this->width - $width;\n }\n elseif ($offset_x < 0)\n {\n // Set the X offset from the right\n $offset_x = $this->width - $width + $offset_x;\n }\n\n if ($offset_y === NULL)\n {\n // Center the Y offset\n $offset_y = round(($this->height - $height) / 2);\n }\n elseif ($offset_y === TRUE)\n {\n // Bottom the Y offset\n $offset_y = $this->height - $height;\n }\n elseif ($offset_y < 0)\n {\n // Set the Y offset from the bottom\n $offset_y = $this->height - $height + $offset_y;\n }\n\n // Determine the maximum possible width and height\n $max_width = $this->width - $offset_x;\n $max_height = $this->height - $offset_y;\n\n if ($width > $max_width)\n {\n // Use the maximum available width\n $width = $max_width;\n }\n\n if ($height > $max_height)\n {\n // Use the maximum available height\n $height = $max_height;\n }\n\n $this->_do_crop($width, $height, $offset_x, $offset_y);\n\n return $this;\n }", "function admin_cropImage()\r\n {\r\n // setting the layout for admin\r\n $this->layout = 'admin';\r\n \r\n // Setting the page title\r\n $this->set(\"title_for_layout\",\"Image Crop\");\r\n \r\n }", "public function cropImage($left, $top, $width, $height)\n\t{\n\t\t$this->image = $this->image->crop($left, $top, $width, $height);\n\n\t\treturn $this;\n\t}", "public function cropImage($width, $height , $target) {\r\n // load an image\r\n $i = new Imagick($this->src);\r\n // get the current image dimensions\r\n $geo = $i -> getImageGeometry();\r\n\r\n // crop the image\r\n if (($geo['width'] / $width) < ($geo['height'] / $height)) {\r\n $i -> cropImage($geo['width'], floor($height * $geo['width'] / $width), 0, (($geo['height'] - ($height * $geo['width'] / $width)) / 2));\r\n } else {\r\n $i -> cropImage(ceil($width * $geo['height'] / $height), $geo['height'], (($geo['width'] - ($width * $geo['height'] / $height)) / 2), 0);\r\n }\r\n\r\n // save or show or whatever the image\r\n $i -> setImageFormat(\"jpeg\");\r\n $i -> writeImage($target);\r\n\r\n\r\n $wrapper2 = new ImagickWrapper($target);\r\n $wrapper2 -> generateThumbnail($target,$width.\"x\".$height);\r\n }", "public function actionCropper()\r\n {\r\n if (!$this->service->init()) {\r\n // TODO можно возвращать ошибки или сделать метод как в validate()\r\n throw new HttpException(400, 'Data invalid.');\r\n }\r\n\r\n return $this->service->cropper();\r\n }", "abstract public function calculateCropBoxSize();", "public function setCropBox($boundary, $checkBoundary = true) {}", "public function crop($top, $left, $width, $height, $same_location = false)\n\t{\n if (!$this->local_file) {\n $this->get_local_file();\n }\n $url = $this->local_file;\n $image_size = $this->image_size();\n if ($url) {\n $oldimage = $this->load_image();\n $newimage = imagecreatetruecolor($width, $height);\n imagecopyresampled($newimage, $oldimage, 0, 0, $top, $left, $width, $height, $width, $height);\n // Delete the existing image\n if (!$same_location) {\n upload_aws2::$client->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n // Create a new filename\n $this->location = $this->new_filename($this->location);\n $this->location = $this->dir . '/' . $this->location;\n }\n $filename = $this->new_local_file_name();\n if (preg_match('/jpeg/', $image_size['mime'])) {\n imagejpeg($newimage, $filename, 100);\n } elseif (preg_match('/gif/', $image_size['mime'])) {\n imagegif($newimage, $filename);\n } elseif (preg_match('/png/', $image_size['mime'])) {\n imagepng($newimage, $filename);\n }\n $this->delete_local_file();\n $this->local_file = $filename;\n }\n\t}", "public function cropProfile(Request $request, $id)\n {\n $user = User::find($id);\n $targ_w = $targ_h = 300;\n $jpeg_quality = 90;\n\n $src = $user->profile_photo;\n $img_r = imagecreatefromjpeg($src);\n $dst_r = ImageCreateTrueColor( $targ_w, $targ_h );\n\n imagecopyresampled($dst_r,$img_r,0,0,$request->x,$request->y,\n $targ_w,$targ_h,$request->w,$request->h);\n $filename = $id.'.jpg';\n $path2= 'https://s3.amazonaws.com/'. env('S3_BUCKET') .'/'. $filename;\n \n ob_start();\n imagejpeg($dst_r);\n $jpeg_file_contents = ob_get_contents();\n ob_end_clean();\n Storage::disk('s3')->put( $id.'.jpg', $jpeg_file_contents, 'public');\n \n $path = Storage::cloud()->url($filename);\n\n Session(['val' => 'false']);\n \n $user->profile_photo = $path2; \n Storage::disk('s3')->delete('https://s3.amazonaws.com/'. env('S3_BUCKET') .'/'.$user->id.'temporal.jpg');\n if($user->save())\n return redirect('/user/edit/complete');\n }", "protected function crop_image($source_url='', $crop_width = 225, $crop_height = 225, $destination_url = '')\n {\n ini_set('memory_limit', '-1');\n $image = Image::make($source_url);\n $image_width = $image->width();\n $image_height = $image->height();\n\n if($image_width < $crop_width && $crop_width < $crop_height){\n $image = $image->fit($crop_width, $image_height);\n }if($image_height < $crop_height && $crop_width > $crop_height){\n $image = $image->fit($crop_width, $crop_height);\n }\n\n \t\t$primary_cropped_image = $image;\n\n $croped_image = $primary_cropped_image->fit($crop_width, $crop_height);\n\n\t\tif($destination_url == ''){\n\t\t\t$source_url_details = pathinfo($source_url); \n\t\t\t$destination_url = @$source_url_details['dirname'].'/'.@$source_url_details['filename'].'_'.$crop_width.'x'.$crop_height.'.'.@$source_url_details['extension']; \n\t\t}\n\n\t\t$croped_image->save($destination_url); \n\t\treturn $destination_url; \n }", "function cropImage($CurWidth, $CurHeight, $iSize, $DestFolder, $SrcImage, $Quality, $ImageType)\n{\t \n\t//Check Image size is not 0\n\tif($CurWidth <= 0 || $CurHeight <= 0) \n\t{\n\t\treturn false;\n\t}\n\t//abeautifulsite.net has excellent article about \"Cropping an Image to Make Square\"\n\t//http://www.abeautifulsite.net/blog/2009/08/cropping-an-image-to-make-square-thumbnails-in-php/\n\tif($CurWidth>$CurHeight)\n\t{\n\t\t$y_offset = 0;\n\t\t$x_offset = ($CurWidth - $CurHeight) / 2;\n\t\t$square_size \t= $CurWidth - ($x_offset * 2);\n\t}\n\telse\n\t{\n\t\t$x_offset = 0;\n\t\t$y_offset = ($CurHeight - $CurWidth) / 2;\n\t\t$square_size = $CurHeight - ($y_offset * 2);\n\t}\n\t\n\t$NewCanves \t= imagecreatetruecolor($iSize, $iSize);\t\n\tif(imagecopyresampled($NewCanves, $SrcImage, 0, 0, $x_offset, $y_offset, $iSize, $iSize, $square_size, $square_size))\n\t{\n\t\tswitch(strtolower($ImageType))\n\t\t{\n\t\t\tcase 'image/png':\n\t\t\t\timagepng($NewCanves, $DestFolder);\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($NewCanves, $DestFolder);\n\t\t\t\tbreak;\t\t\t\n\t\t\tcase 'image/jpeg':\n\t\t\tcase 'image/pjpeg':\n\t\t\t\timagejpeg($NewCanves, $DestFolder, $Quality);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\tif(is_resource($NewCanves))\n\t\t{ \n\t\t\timagedestroy($NewCanves); \n\t } \n\t\treturn true;\n\t}\n}", "function crop_image_square($source, $destination, $image_type, $square_size, $image_width, $image_height, $quality){\n\tif($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n\tif( $image_width > $image_height )\n\t{\n\t\t$y_offset = 0;\n\t\t$x_offset = ($image_width - $image_height) / 2;\n\t\t$s_size \t= $image_width - ($x_offset * 2);\n\t}else{\n\t\t$x_offset = 0;\n\t\t$y_offset = ($image_height - $image_width) / 2;\n\t\t$s_size = $image_height - ($y_offset * 2);\n\t}\n\t$new_canvas\t= imagecreatetruecolor( $square_size, $square_size); //Create a new true color image\n\n\t//Copy and resize part of an image with resampling\n\tif(imagecopyresampled($new_canvas, $source, 0, 0, $x_offset, $y_offset, $square_size, $square_size, $s_size, $s_size)){\n\t\tsave_image($new_canvas, $destination, $image_type, $quality);\n\t}\n\n\treturn true;\n}", "private function intern_resize_crop($newWidth, $newHeight)\n\t{\n\t\t/*\n\t\t * Crop-to-fit PHP-GD\n\t\t * http://salman-w.blogspot.com/2009/04/crop-to-fit-image-using-aspphp.html\n\t\t *\n\t\t * Resize and center crop an arbitrary size image to fixed width and height\n\t\t * e.g. convert a large portrait/landscape image to a small square thumbnail\n\t\t *\n\t\t * Modified by Fry\n\t\t */\n\t\t$desired_aspect_ratio = $newWidth / $newHeight;\n\n\t\tif ($this->srcAspectRatio > $desired_aspect_ratio) {\n\t\t\t/*\n\t\t\t * Triggered when source image is wider\n\t\t\t */\n\t\t\t$temp_height = $newHeight;\n\t\t\t$temp_width = ( int ) ($newHeight * $this->srcAspectRatio);\n\t\t} else {\n\t\t\t/*\n\t\t\t * Triggered otherwise (i.e. source image is similar or taller)\n\t\t\t */\n\t\t\t$temp_width = $newWidth;\n\t\t\t$temp_height = ( int ) ($newWidth / $this->srcAspectRatio);\n\t\t}\n\n\t\t/*\n\t\t * Resize the image into a temporary GD image\n\t\t */\n\n\t\t$tempImage = imagecreatetruecolor($temp_width, $temp_height);\n\t\timagecopyresampled(\n\t\t\t$tempImage,\t\t\t\t\t$this->srcImage,\n\t\t\t0, 0,\t\t\t0, 0,\n\t\t\t$temp_width, $temp_height,\t$this->srcWidth, $this->srcHeight\n\t\t);\n\n\t\t/*\n\t\t * Copy cropped region from temporary image into the desired GD image\n\t\t */\n\n\t\t$x0 = ($temp_width - $newWidth) / 2;\n\t\t$y0 = ($temp_height - $newHeight) / 2;\n\t\t$this->newImage = imagecreatetruecolor($newWidth, $newHeight);\n\t\timagecopy(\n\t\t\t$this->newImage,\t$tempImage,\n\t\t\t0, 0,\t$x0, $y0,\n\t\t\t$newWidth, $newHeight\n\t\t);\n\t\timagedestroy($tempImage);\n\t}", "function imagecropper($source_path, $max_width, $max_height, $bili) {\n $source_info = getimagesize($source_path); //获取原始图片信息\n $source_width = $source_info[0]; //获取原始图片的宽度\n $source_height = $source_info[1]; //获取原始图片的高度\n $source_mime = $source_info['mime']; //获取原始图片的文件类型\n\n //先计算出要裁剪后的图片尺寸是多大\n if($source_width<=$max_width) { //1、如果原始图片的宽,小于最大允许的宽\n $newwidth = $source_width;\n $newheight = $source_width*$bili;\n }elseif($source_height<=$max_height) {//2、如果原始图片的高,小于最大允许的高\n $newheight = $source_height;\n $newwidth = $newheight/$bili;\n }else {\n $b1 = $max_width/$source_width;\n $b2 = $max_height/$source_height;\n $b3 = $b1<$b2 ? $b1 : $b2;\n $newwidth = ceil($source_width*$b3);\n $newheight = ceil($source_height*$b3);\n }\n\n $target_width = $newwidth>$newheight ? $newwidth : $newheight;\n $target_height = $newwidth<$newheight ? $newwidth : $newheight;\n\n if($target_width*$bili>$target_height) {\n $target_width = $target_height/$bili;\n }\n if($target_height*$bili>$target_width) {\n $target_height = $target_width/$bili;\n }\n\n $source_ratio = $source_height / $source_width;\n $target_ratio = $target_height / $target_width;\n\n if ($source_ratio > $target_ratio) {\n $cropped_width = $source_width;\n $cropped_height = $source_width * $target_ratio;\n $source_x = 0;\n $source_y = ($source_height - $cropped_height) / 2;\n }elseif ($source_ratio < $target_ratio) {\n $cropped_width = $source_height / $target_ratio;\n $cropped_height = $source_height;\n $source_x = ($source_width - $cropped_width) / 2;\n $source_y = 0;\n }else {\n $cropped_width = $source_width;\n $cropped_height = $source_height;\n $source_x = 0;\n $source_y = 0;\n }\n\n switch ($source_mime) {\n case 'image/gif':\n $source_image = imagecreatefromgif($source_path);\n break;\n case 'image/jpeg':\n $source_image = imagecreatefromjpeg($source_path);\n break;\n case 'image/png':\n $source_image = imagecreatefrompng($source_path);\n break;\n default:\n return false;\n break;\n }\n\n $target_image = imagecreatetruecolor($target_width, $target_height);\n $cropped_image = imagecreatetruecolor($cropped_width, $cropped_height);\n\n // 裁剪\n imagecopy($cropped_image, $source_image, 0, 0, $source_x, $source_y, $cropped_width, $cropped_height);\n // 缩放\n imagecopyresampled($target_image, $cropped_image, 0, 0, 0, 0, $target_width, $target_height, $cropped_width, $cropped_height);\n\n imagejpeg($target_image,$source_path);\n imagedestroy($source_image);\n imagedestroy($target_image);\n imagedestroy($cropped_image);\n}", "public function cropImage($request)\n {\n $returnType = '\\SplFileObject';\n $isBinary = true;\n $hasReturnType = true;\n $request = $this->getHttpRequest($request, 'GET');\n $options = $this->createHttpClientOptions();\n \n try {\n $response = $this->client->send($request, $options);\n return $this->processResponse($request, $response, $hasReturnType, $returnType, $isBinary);\n } catch (RequestException $e) {\n $this->processException($e);\n }\n }", "public function ieditor_crop ($sImagePath){\n\n\t\t\tclearstatcache();\n\t\t\t$iSelectionLeft = intval(getRequest('x1')) ? intval(getRequest('x1')) : 0;\n\t\t\t$iSelectionTop = intval(getRequest('y1')) ? intval(getRequest('y1')) : 0;\n\t\t\t$iSelectionWidth = intval(getRequest('width'));\n\t\t\t$iSelectionHeight = intval(getRequest('height'));\n\t\t\t$iScale = floatval(getRequest('scale')) ? floatval(getRequest('scale')) : 1;\n\n\t\t\tif ($iScale < 1) {\n\t\t\t\t$iSelectionLeft = round($iSelectionLeft / $iScale);\n\t\t\t\t$iSelectionTop = round($iSelectionTop / $iScale);\n\t\t\t\t$iSelectionWidth = round($iSelectionWidth / $iScale);\n\t\t\t\t$iSelectionHeight = round($iSelectionHeight / $iScale);\n\t\t\t}\n\n\t\t\t$sNewOriginalImagePath = $this->generateOriginalImagePath(pathinfo($sImagePath), array($iSelectionWidth, $iSelectionHeight, $iSelectionLeft, $iSelectionTop));\n\n\t\t\t$arOriginalImages = $this->findOriginalImages($sImagePath);\n\n\t\t\tif (empty($arOriginalImages)) {\n\t\t\t\t$bCopyResult = @copy($sImagePath, $sNewOriginalImagePath);\n\t\t\t\tif (!$bCopyResult || !file_exists($sNewOriginalImagePath)) {\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$bRenameResult = @rename($arOriginalImages[0], $sNewOriginalImagePath);\n\t\t\t\tif (!$bRenameResult || !file_exists($sNewOriginalImagePath)) {\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$sTmpImagePath = $this->getIeditorImagesPath(true) . '/__ieditor_tmp';\n\t\t\tif (file_exists($sTmpImagePath)) {\n\t\t\t\t@unlink($sTmpImagePath);\n\t\t\t}\n\n\t\t\t@copy($sNewOriginalImagePath, $sTmpImagePath);\n\t\t\tif (!file_exists($sTmpImagePath)) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * UMIRU CUSTOM - START\n\t\t\t */\n\t\t\ttry {\n\t\t\t\t$oImagemagic = $this->getImageMagic();\n\t\t\t\tif (!$oImagemagic->crop($sNewOriginalImagePath, $iSelectionLeft, $iSelectionWidth, $iSelectionTop, $iSelectionHeight)) {\n\t\t\t\t\tthrow new Exception('Failed to crop image by ImageMagic');\n\t\t\t\t}\n\t\t\t} catch (Exception $e) {\n\t\t\t/**\n\t\t\t * UMIRU CUSTOM - END\n\t\t\t */\n\n\t\t\t$oImage = new umiImageFile($sNewOriginalImagePath);\n\t\t\ttry {\n\t\t\t\t$oImage->crop($iSelectionLeft, $iSelectionWidth, $iSelectionTop, $iSelectionHeight);\n\t\t\t} catch (coreException $e) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * UMIRU CUSTOM - START\n\t\t\t */\n\t\t\t}\n\t\t\t/**\n\t\t\t * UMIRU CUSTOM - END\n\t\t\t */\n\n\t\t\t@unlink($sImagePath);\n\t\t\t@copy($sNewOriginalImagePath, $sImagePath);\n\t\t\t@unlink($sNewOriginalImagePath);\n\t\t\t@rename($sTmpImagePath, $sNewOriginalImagePath);\n\n\t\t\treturn str_replace(CURRENT_WORKING_DIR, '', $sImagePath);\n\n\t\t}", "public function trimPixels($coords) {\n list($x1, $y1, $x2, $y2) = $coords;\n $this->thumb->crop($x1, $y1, $x2 - $x1, $y2 - $y1);\n return $this;\n }", "public static function CROP()\n {\n return new ThumbnailAspectMode(self::CROP);\n }", "public function crop_preset($show_image = false)\n {\n $crop = $_POST[\"crop\"];\n $crop[\"file\"] = $this->source;\n if (!is_file($crop[\"file\"])) {\n # Particularly on the double-form submissions, this can happen.\n # By resetting the session cropper to null.\n return false;\n }\n\n # Whatever was the crop size selected, what is the size to load?\n $new = array(\n # also known as the aspect ratio\n \"width\" => $this->width,\n \"height\" => $this->height,\n );\n\n # Good for as selected by the user\n $thumb = imagecreatetruecolor($new[\"width\"], $new[\"height\"]);\n $source = imagecreatefromjpeg($crop[\"file\"]);\n $x = $crop[\"x1\"];\n $y = $crop[\"y1\"];\n $w = $new[\"width\"]; # 550;\n $h = $new[\"height\"]; #600;\n imagecopyresampled($thumb, $source, 0, 0, $x, $y, $w, $h, $crop[\"width\"], $crop[\"height\"]);\n\n if ($show_image === true) {\n header(\"Content-type: image/jpeg\");\n $success = imagejpeg($thumb, null, $this->quality);\n } else {\n $success = imagejpeg($thumb, $this->destination, $this->quality);\n }\n imagedestroy($thumb);\n\n $_SESSION[\"cropper\"] = array();\n\n return $success;\n }", "public function apply() {\n\t\t$w = $this->getWidth();\n\t\t$h = $this->getHeight();\n\n\t\timagecopyresampled($this->original->getImage(), $this->getImage(), $this->x, $this->y, 0, 0, $w, $h, $w, $h);\n\t}", "private function __setOptimalSizeByCrop() {\n \n $heightRatio = $this->__originalImageHeight / $this->__requestedHeight;\n $widthRatio = $this->__originalImageWidth / $this->__requestedWidth;\n \n if ($heightRatio < $widthRatio) {\n $optimalRatio = $heightRatio;\n } else {\n $optimalRatio = $widthRatio;\n }\n \n $this->__optimalHeight = $this->__originalImageHeight / $optimalRatio;\n $this->__optimalWidth = $this->__originalImageWidth / $optimalRatio;\n \n }", "private function cropImageSaveNew( $filepath, $filepathNew ) {\n\n\t\t$imgInfo = getimagesize( $filepath );\n\t\t$imgType = $imgInfo[2];\n\n\t\t$src_img = $this->getGdSrcImage( $filepath,$imgType );\n\n\t\t$width = imageSX( $src_img );\n\t\t$height = imageSY( $src_img );\n\n\t\t// crop the image from the top\n\t\t$startx = 0;\n\t\t$starty = 0;\n\n\t\t// find precrop width and height:\n\t\t$percent = $this->maxWidth / $width;\n\t\t$newWidth = $this->maxWidth;\n\t\t$newHeight = ceil( $percent * $height );\n\n\t\tif ( $this->type == 'exact' ) { \t// crop the image from the middle\n\t\t\t$startx = 0;\n\t\t\t$starty = ($newHeight -$this->maxHeight) / 2 / $percent;\n\t\t}\n\n\t\tif ( $newHeight < $this->maxHeight ) {\t// by width\n\t\t\t$percent = $this->maxHeight / $height;\n\t\t\t$newHeight = $this->maxHeight;\n\t\t\t$newWidth = ceil( $percent * $width );\n\n\t\t\tif ( $this->type == 'exact' ) { \t// crop the image from the middle\n\t\t\t\t$startx = ($newWidth - $this->maxWidth) / 2 / $percent;\t// the startx is related to big image\n\t\t\t\t$starty = 0;\n\t\t\t}\n\t\t}\n\n\t\t// resize the picture:\n\t\t$tmp_img = ImageCreateTrueColor( $newWidth,$newHeight );\n\n\t\t$this->handleTransparency( $tmp_img,$imgType,$newWidth,$newHeight );\n\n\t\timagecopyresampled( $tmp_img,$src_img,0,0,$startx,$starty,$newWidth,$newHeight,$width,$height );\n\n\t\t$this->handleImageEffects( $tmp_img );\n\n\t\t// crop the picture:\n\t\t$dst_img = ImageCreateTrueColor( $this->maxWidth,$this->maxHeight );\n\n\t\t$this->handleTransparency( $dst_img,$imgType,$this->maxWidth,$this->maxHeight );\n\n\t\timagecopy( $dst_img, $tmp_img, 0, 0, 0, 0, $newWidth, $newHeight );\n\n\t\t// save the picture\n\t\t$is_saved = $this->saveGdImage( $dst_img,$filepathNew,$imgType );\n\n\t\timagedestroy( $dst_img );\n\t\timagedestroy( $src_img );\n\t\timagedestroy( $tmp_img );\n\n\t\treturn($is_saved);\n\t}" ]
[ "0.80794173", "0.7953355", "0.76265067", "0.7534818", "0.7509675", "0.73519826", "0.7330338", "0.7281966", "0.72596693", "0.712091", "0.70829874", "0.70485884", "0.69685996", "0.6954911", "0.69505244", "0.69221693", "0.6827314", "0.67656493", "0.6737879", "0.66659284", "0.6634964", "0.6630652", "0.65716", "0.65517235", "0.6550824", "0.6514107", "0.64918214", "0.644939", "0.6414698", "0.6396339", "0.638871", "0.6381158", "0.638011", "0.6355856", "0.63533556", "0.6342764", "0.6330975", "0.6330542", "0.6303108", "0.6251847", "0.6242032", "0.62291276", "0.6212655", "0.62090254", "0.62081575", "0.6198155", "0.618757", "0.6183529", "0.61766976", "0.617117", "0.61623263", "0.6152775", "0.6127975", "0.6121393", "0.61052907", "0.6092929", "0.6083887", "0.6082186", "0.60820216", "0.6068527", "0.6065237", "0.6031984", "0.60296583", "0.60235786", "0.59989995", "0.59845185", "0.5984297", "0.5974772", "0.5959662", "0.59288335", "0.59280664", "0.59248954", "0.59089154", "0.59063333", "0.5905252", "0.58953226", "0.5887474", "0.5877848", "0.58762807", "0.58721495", "0.5870044", "0.585451", "0.5847553", "0.5841339", "0.58377695", "0.5833886", "0.5831813", "0.5831338", "0.58263993", "0.5820693", "0.5817195", "0.58046067", "0.57957315", "0.5790167", "0.57865757", "0.57775533", "0.576273", "0.57532436", "0.57295454", "0.5704155" ]
0.58647734
81
Modify this image backend with either a provided resource, or transformation
protected function createCloneWithResource($resourceOrTransformation) { // No clone with no argument if (!$resourceOrTransformation) { return null; } // Handle transformation function if (is_callable($resourceOrTransformation)) { // Fail if resource not available $resource = $this->getImageResource(); if (!$resource) { return null; } // Note: Closure may simply modify the resource rather than return a new one $resource = clone $resource; $resource = call_user_func($resourceOrTransformation, $resource) ?: $resource; // Clone with updated resource return $this->createCloneWithResource($resource); } // Ensure result is of a valid type if (!$resourceOrTransformation instanceof InterventionImage) { throw new InvalidArgumentException("Invalid resource type"); } // Create clone $clone = clone $this; $clone->setImageResource($resourceOrTransformation); return $clone; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function transformResource($resource);", "protected function renderResource()\n {\n $processedImageInfo = $this->imageService->processImage($this->originalAsset->getResource(), $this->adjustments->toArray());\n $this->resource = $processedImageInfo['resource'];\n $this->width = $processedImageInfo['width'];\n $this->height = $processedImageInfo['height'];\n $this->persistenceManager->whiteListObject($this->resource);\n }", "public function setResource($resource)\n {\n if($this->getWorker($resource) === $this->getWorker($this->resource))\n {\n $this->resource = $resource;\n }\n\n $this->tmpImage[] = $tmpImage = tempnam(sys_get_temp_dir(), 'picture');\n\n if($this->getWorker($resource) === $this::WORKER_GD)\n {\n imagepng($resource, $tmpImage, 0);\n }\n else\n {\n $resource->writeImage($tmpImage);\n }\n\n if($this->isGd())\n {\n $this->resource = $this->getGdResource($tmpImage);\n }\n else\n {\n $this->resource = $this->createImagick($tmpImage);\n }\n }", "public function apply() {\n\t\t$w = $this->getWidth();\n\t\t$h = $this->getHeight();\n\n\t\timagecopyresampled($this->original->getImage(), $this->getImage(), $this->x, $this->y, 0, 0, $w, $h, $w, $h);\n\t}", "public function setResource($resource);", "abstract protected function setResource(): String;", "public function updateOriginal()\n {\n // @todo Bug#1101: shouldn't just serialise this object\n // because some things change for the original\n // loaded_width\n // loaded_height\n $this->write($this->getOriginalSourceFilename());\n }", "public function save() {\n// is there an image resource and file location to work with?\n if (isset($this->_resource, $this->_file_location)) {\n switch ($this->_mimetype) {\n case \"image/jpeg\":\n imagejpeg($this->_resource, $this->_file_location);\n break;\n case \"image/png\":\n imagepng($this->_resource, $this->_file_location);\n break;\n case \"image/gif\":\n imagegif($this->_resource, $this->_file_location);\n break;\n }\n } else {\n trigger_error(\"CAMEMISResizeImage::save() attempting to access a non-existent resource (check if the image was loaded by CAMEMISResizeImage::__construct())\", E_USER_WARNING);\n }\n\n return $this;\n }", "function setTransformation($transformation){\n\t\tif($transformation){\n\t\t\t$transformation = clone $transformation;\n\t\t}\n\t\t$this->transformation = $transformation;\n\t}", "public function Execute($imageResource)\n {\n $originalWidth = imagesx($imageResource);\n $originalHeight = imagesy($imageResource);\n\n // Define the ratio and adjust the width and height\n if ($this->_preserveAspectRatio) {\n $ratio = min($this->_width / $originalWidth, $this->_height / $originalHeight);\n $this->_width = $originalWidth * $ratio;\n $this->_height = $originalHeight * $ratio;\n }\n\n // Create the new image\n $new = imagecreatetruecolor($this->_width, $this->_height);\n\n // Preserve transparency\n imagecolortransparent($new, imagecolorallocatealpha($new, 0, 0, 0, 127));\n imagealphablending($new, false);\n imagesavealpha($new, true);\n\n // Do the actual resizing\n imagecopyresampled($new, $imageResource, 0, 0, 0, 0, $this->_width, $this->_height, $originalWidth,\n $originalHeight);\n\n return $new;\n }", "function applyFilterOnResource( &$resource, $filter_name='', $options=array())\n {\n if (Image_Filter::loadFilter($filter_name)){\n $class = 'Image_Filter_'.$filter_name;\n call_user_func(array($class,'applyFilterOnResource'), $resource, $options);\n }\n }", "protected function transform(sfImage $image)\n {\n $resource_w = $image->getWidth();\n $resource_h = $image->getHeight();\n\n $scale_w = $this->getWidth()/$resource_w;\n $scale_h = $this->getHeight()/$resource_h;\n switch ($this->getMethod())\n {\n case 'deflate':\n case 'inflate':\n\n return $image->resize($this->getWidth(), $this->getHeight());\n\n case 'left':\n $image->scale(max($scale_w, $scale_h));\n\n return $image->crop(0, (int)round(($image->getHeight() - $this->getHeight()) / 2), $this->getWidth(), $this->getHeight());\n\n case 'right':\n $image->scale(max($scale_w, $scale_h));\n\n return $image->crop(($image->getWidth() - $this->getWidth()), (int)round(($image->getHeight() - $this->getHeight()) / 2),$this->getWidth(), $this->getHeight());\n\n case 'top':\n $image->scale(max($scale_w, $scale_h));\n\n return $image->crop((int)round(($image->getWidth() - $this->getWidth()) / 2), 0, $this->getWidth(), $this->getHeight());\n\n case 'bottom':\n $image->scale(max($scale_w, $scale_h));\n\n return $image->crop((int)round(($image->getWidth() - $this->getWidth()) / 2), ($image->getHeight() - $this->getHeight()), $this->getWidth(), $this->getHeight());\n \n case 'center':\n $image->scale(max($scale_w, $scale_h));\n \n $left = (int)round(($image->getWidth() - $this->getWidth()) / 2);\n $top = (int)round(($image->getHeight() - $this->getHeight()) / 2);\n\n return $image->crop($left, $top, $this->getWidth(), $this->getHeight());\n case 'scale':\n return $image->scale(min($scale_w, $scale_h));\n\n case 'fit': \n default:\n $img = clone $image;\n\n $image->create($this->getWidth(), $this->getHeight());\n \n // Set a background color if specified\n if(!is_null($this->getBackground()) && $this->getBackground() != '')\n {\n $image->fill(0,0, $this->getBackground());\n }\n\n $img->scale(min($this->getWidth() / $img->getWidth(), $this->getHeight() / $img->getHeight()));\n \n $image->overlay($img, 'center');\n\n return $image;\n \n }\n }", "public function setResource(PersistentResource $resource)\n {\n throw new \\RuntimeException('Setting the resource on an ImageVariant is not supported.', 1366627480);\n }", "public function apply($resource){\n\t\t// Verify channels\n\t\t@list(,$r,$g,$b)=func_get_args();\n\t\t$channels=array($r,$g,$b);\n\t\tforeach($channels as $channel){\n\t\t\tif(\n\t\t\t\t$channel!=self::NONE and\n\t\t\t\t$channel!=self::RED and\n\t\t\t\t$channel!=self::GREEN and\n\t\t\t\t$channel!=self::BLUE and\n\t\t\t\t$channel!=self::MINIMIZE and\n\t\t\t\t$channel!=self::MAXIMIZE\n\t\t\t){\n\t\t\t\tthrow new Exception(\"Undefined constant provided\");\n\t\t\t}\n\t\t}\n\t\t// Get resolution\n\t\t$width=imagesx($resource);\n\t\t$height=imagesy($resource);\n\t\tif(!$width || !$height){\n\t\t\tthrow new Exception(\"An error was encountered while getting image resolution\");\n\t\t}\n\t\t// Apply effect\n\t\t$x=0;\n\t\tdo{\n\t\t\t$y=0;\n\t\t\tdo{\n\t\t\t\t// Get current pixel color\n\t\t\t\tlist($r,$g,$b,$a)=$this->_getColorAt($resource,$x,$y);\n\t\t\t\t// Convert channels\n\t\t\t\t$new_channels=array();\n\t\t\t\tswitch($channels[0]){\n\t\t\t\t\tcase self::RED:\t\t\t$new_channels['r']=$r; break;\n\t\t\t\t\tcase self::GREEN:\t\t$new_channels['r']=$g; break;\n\t\t\t\t\tcase self::BLUE:\t\t$new_channels['r']=$b; break;\n\t\t\t\t\tcase self::MINIMIZE:\t$new_channels['r']=0; break;\n\t\t\t\t\tcase self::MAXIMIZE:\t$new_channels['r']=255; break;\n\t\t\t\t\tcase self::NONE:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$new_channels['r']=$r;\n\t\t\t\t}\n\t\t\t\tswitch($channels[1]){\n\t\t\t\t\tcase self::RED:\t\t\t$new_channels['g']=$r; break;\n\t\t\t\t\tcase self::GREEN:\t\t$new_channels['g']=$g; break;\n\t\t\t\t\tcase self::BLUE:\t\t$new_channels['g']=$b; break;\n\t\t\t\t\tcase self::MINIMIZE:\t$new_channels['g']=0; break;\n\t\t\t\t\tcase self::MAXIMIZE:\t$new_channels['g']=255; break;\n\t\t\t\t\tcase self::NONE:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$new_channels['g']=$g;\n\t\t\t\t}\n\t\t\t\tswitch($channels[2]){\n\t\t\t\t\tcase self::RED:\t\t\t$new_channels['b']=$r; break;\n\t\t\t\t\tcase self::GREEN:\t\t$new_channels['b']=$g; break;\n\t\t\t\t\tcase self::BLUE:\t\t$new_channels['b']=$b; break;\n\t\t\t\t\tcase self::MINIMIZE:\t$new_channels['b']=0; break;\n\t\t\t\t\tcase self::MAXIMIZE:\t$new_channels['b']=255; break;\n\t\t\t\t\tcase self::NONE:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$new_channels['b']=$b;\n\t\t\t\t}\n\t\t\t\t// Define new pixel\n\t\t\t\timagesetpixel($resource,$x,$y,imagecolorallocatealpha($resource,$new_channels['r'],$new_channels['g'],$new_channels['b'],$a));\n\t\t\t}\n\t\t\twhile(++$y<$height);\n\t\t}\n\t\twhile(++$x<$width);\n\t\treturn $resource;\n\t}", "public function apply($resource){\n\t\t// Verify support\n\t\tif(!function_exists('imagefilter')){\n\t\t\tthrow new Exception(\"It seems your PHP version is not compiled with the bundled version of the GD library\");\n\t\t}\n\t\t// Extract arguments\n\t\t@list(,$color,$opacity)=func_get_args();\n\t\t$rgb=html2rgb($color);\n\t\t// Normalize\n\t\tif($opacity===null)\t\t$opacity=100;\n\t\telseif($opacity<0)\t\t$opacity=0;\n\t\telseif($opacity>100)\t$opacity=100;\n\t\t$a=(100-$opacity)*1.27;\n\t\t// Apply effect\n\t\tif(!imagefilter($resource,IMG_FILTER_COLORIZE,$rgb[0],$rgb[1],$rgb[2],$a)){\n\t\t\tthrow new Exception(\"COLORIZE filter failed\");\n\t\t}\n\t\treturn $resource;\n\t}", "abstract public function resource($resource);", "function image_edit_apply_changes($image, $changes)\n {\n }", "public static function edit_image()\n{\n\n\n\t/*\n\t* Change Background\n\t*/\n\n\t/*\n\t* Change other setting\n\t*/\n}", "public function setResource($resource) {\n\n $this->resource = $resource;\n }", "abstract public function transform();", "public function reassignFeaturedImage()\n {\n\n }", "public static function change_image_type(){\n/**\n*\n*This function change the image type like convert png to jpg or bmp or gif\n*\n*/\npublic static function rotate()\n}", "public function setOriginalResource($originalResource) {\n\t\t$this->originalResource = $originalResource;\n\t}", "public function testTransform()\n {\n $img = new P4Cms_Image();\n $data = file_get_contents(TEST_ASSETS_PATH . '/images/luigi.png');\n $img->setData($data);\n\n // test the behavior of scale with width and height\n $img->transform('scale', array(258, 355));\n $this->assertSame(\n $img->getImageSize(),\n array('width' => 258, 'height' => 355),\n 'Expected image to be scaled to 258x355 pixels.'\n );\n\n // test the behavior of scale with width only\n // 516/710 = 400/h => h = 550\n $img->transform('scale', array(400));\n $this->assertSame(\n $img->getImageSize(),\n array('width' => 400, 'height' => 550),\n 'Expected image to be scaled to 300x300 pixels.'\n );\n\n // test the behavior of crop\n $img->transform('crop', array(100, 100, 50, 50));\n $this->assertSame(\n $img->getImageSize(),\n array('width' => 100, 'height' => 100),\n 'Expected image to be cropped to 100x100 pixels.'\n );\n\n // test the behavior of unsupported transform\n try {\n $img->transform('foo');\n $this->fail('Expected failure with an unsupported transform.');\n } catch (P4Cms_Image_Exception $e) {\n $this->assertSame($e->getMessage(), \"Transform \\\"foo\\\" is not supported.\");\n } catch (Exception $e) {\n $this->fail('Unexpected exception: '. $e->getMessage());\n }\n }", "public function createResource()\n {\n $this->resource = new \\Imagick();\n }", "public function updateStream($resource);", "function Utilities_Image(){\n\t\t// $this->$imageAsset = $img;\t\t\n\t}", "function image_scale($src_abspath, $dest_abspath, $aspect, $width, $strategy)\n{\n $im = new \\Imagick($src_abspath);\n $im = image_scale_im_obj($im, $aspect, $width, $strategy);\n return image_return_write($im, $dest_abspath);\n}", "function _wp_image_meta_replace_original($saved_data, $original_file, $image_meta, $attachment_id)\n {\n }", "public function applyToImage($image_uri);", "protected function transform(\\ImageTransform\\Image $image)\r\n {\r\n $resource = $image->getAdapter()->getHolder();\r\n\r\n // Use GD's built in filter\r\n if (function_exists('imagefilter'))\r\n {\r\n // we have to check for the php version as alpha support was added to imagefilter/IMG_FILTER_COLORIZE in 5.2.5\r\n if (strnatcmp(phpversion(), '5.2.5') >= 0)\r\n {\r\n imagefilter($resource, IMG_FILTER_COLORIZE, $this->red_tint, $this->green_tint, $this->blue_tint, $this->alpha);\r\n }\r\n else\r\n {\r\n imagefilter($resource, IMG_FILTER_COLORIZE, $this->red_tint, $this->green_tint, $this->blue_tint);\r\n }\r\n }\r\n\r\n // Throw Exception....\r\n // Alpha not supported\r\n else\r\n {\r\n throw new \\ImageTransform\\Exception(\"Transformation not supported\");\r\n }\r\n\r\n return $image;\r\n }", "public function withResource($resource) {\n $this->resource = $resource;\n \n if (is_a($this->resource, 'Illuminate\\Http\\UploadedFile')) {\n $this->resource_type = 'uploaded';\n }\n \n if (filter_var($this->resource, FILTER_VALIDATE_URL)) {\n $this->resource_type = 'url';\n }\n \n if (is_string($this->resource) && file_exists($this->resource)) {\n $this->resource_type = 'path';\n }\n \n if (empty($this->resource_type)) {\n throw new \\Exception('Resource type unsupported.');\n }\n \n return $this;\n }", "function update_image($image_id, $new_image)\n\t{\n\t\t// TODO: Write me.\n\t}", "function _flip_image_resource($img, $horz, $vert)\n {\n }", "protected function image_render()\r\n {\r\n // Send the correct HTTP header\r\n \\header(\"Cache-Control:no-cache,must-revalidate\");\r\n \\header(\"Pragma:no-cache\");\r\n \\header('Content-Type: image/'.static::$image_type);\r\n \\header(\"Connection:close\");\r\n\r\n // Pick the correct output function\r\n $function = '\\\\image'.static::$image_type;\r\n $function(static::$image);\r\n\r\n // Free up resources\r\n \\imagedestroy(static::$image);\r\n }", "function _rotate_image_resource($img, $angle)\n {\n }", "protected function processImage() {}", "public function setToResource()\n {\n $this->type = \"resource\";\n }", "public function edit(Resource $resource)\n {\n //\n }", "function imageResize($imageResourceId=null,$width=null,$height=null, $targetWidth=null, $targetHeight=null) {\n\n// $targetWidth =300;\n// $targetHeight =260;\n// dd($imageResourceId,$width,$height, $targetWidth, $targetHeight);\n\n $targetLayer=imagecreatetruecolor($targetWidth,$targetHeight);\n imagecopyresampled($targetLayer,$imageResourceId,0,0,0,0,$targetWidth,$targetHeight, $width,$height );\n// imagecopyresized($targetLayer,$imageResourceId,0,0,0,0, $width,$height,$targetWidth,$targetHeight);\n\n return $targetLayer;\n }", "public function setImageResource($image)\n {\n $this->image = $image;\n }", "public function reseize($path, $source, $width, $height, $nama_ori){\n \t//$source = sumber gambar yang akan di reseize\n $config['image_library'] = 'gd2';\n $config['source_image'] = $source;\n $config['new_image'] = $path.$width.'_'.$nama_ori;\n $config['overwrite'] = TRUE;\n $config['create_thumb'] = false;\n $config['width'] = $width;\n if($height>0){\n \t$config['maintain_ratio'] = false;\n \t$config['height'] = $height;\n }else{\n \t$config['maintain_ratio'] = true;\n }\n\n $this->image_lib->initialize($config);\n\n $this->image_lib->resize();\n $this->image_lib->clear();\n }", "protected function __render($dest, $quality = Image::DEFAULT_QUALITY, $interlacing = Image::DEFAULT_INTERLACE, $output = null)\n {\n if (!is_resource($this->_resource)) {\n throw new JIT\\JITException('Invalid image resource supplied');\n }\n\n // Turn interlacing on for JPEG or PNG only\n if ($interlacing && ($output === IMAGETYPE_JPEG || $output === IMAGETYPE_PNG)) {\n imageinterlace($this->_resource);\n }\n\n switch ($output) {\n case IMAGETYPE_GIF:\n return imagegif($this->_resource, $dest);\n break;\n\n case IMAGETYPE_PNG:\n return imagepng($this->_resource, $dest, round(9 * ($quality * 0.01)));\n break;\n\n case IMAGETYPE_JPEG:\n case null:\n return imagejpeg($this->_resource, $dest, $quality);\n break;\n }\n\n throw new JIT\\JITException('Invalid image resource output supplied: '. $output);\n }", "public function setImage($image)\n{\n$this->image = $image;\n\nreturn $this;\n}", "function applyFilter( &$resource, $filter_name='', $options=array())\n {\n if (Image_Filter::loadFilter($filter_name)){\n $class = 'Image_Filter_'.$filter_name;\n call_user_func(array($class,'applyFilter'), $resource, $options);\n return true;\n }\n return false;\n }", "public function replace_icon() {\r\n\t\tglobal $wpdb;\r\n\t\t$db = Maps_Marker_Pro::get_instance('MMP\\DB');\r\n\r\n\t\tif (!isset($_POST['nonce']) || wp_verify_nonce($_POST['nonce'], 'mmp-tools-replace-icon') === false) {\r\n\t\t\twp_send_json(array(\r\n\t\t\t\t'success' => false,\r\n\t\t\t\t'message' => esc_html__('Security check failed', 'mmp')\r\n\t\t\t));\r\n\t\t}\r\n\t\tif (!isset($_POST['source']) || !isset($_POST['target'])) {\r\n\t\t\twp_send_json(array(\r\n\t\t\t\t'success' => false,\r\n\t\t\t\t'message' => esc_html__('Source or target missing', 'mmp')\r\n\t\t\t));\r\n\t\t}\r\n\t\t$source = ($_POST['source'] === plugins_url('images/leaflet/marker.png', __DIR__)) ? '' : basename($_POST['source']);\r\n\t\t$target = ($_POST['target'] === plugins_url('images/leaflet/marker.png', __DIR__)) ? '' : basename($_POST['target']);\r\n\r\n\t\t$wpdb->update(\r\n\t\t\t$db->markers,\r\n\t\t\tarray('icon' => $target),\r\n\t\t\tarray('icon' => $source),\r\n\t\t\tarray('%s'),\r\n\t\t\tarray('%s')\r\n\t\t);\r\n\r\n\t\twp_send_json(array(\r\n\t\t\t'success' => true,\r\n\t\t\t'message' => esc_html__('Icon replaced successfully', 'mmp')\r\n\t\t));\r\n\t}", "protected function applyTransformation() {\n // no transformation for index\n }", "private function resizeWithScaleExact($width, $height, $scale) {\n\t\t//$new_height = (int)($this->info['height'] * $scale);\n\t\t$new_width = $width * $scale;\n\t\t$new_height = $height * $scale;\n\t\t$xpos = 0;//(int)(($width - $new_width) / 2);\n\t\t$ypos = 0;//(int)(($height - $new_height) / 2);\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/gif' && $this->isAnimated) {\n $this->imagick = new Imagick($this->file);\n $this->imagick = $this->imagick->coalesceImages();\n foreach ($this->imagick as $frame) {\n $frame->thumbnailImage($new_width, $new_height);\n $frame->setImagePage($new_width, $new_height, 0, 0);\n }\n } else {\n $image_old = $this->image;\n $this->image = imagecreatetruecolor($width, $height);\n $bcg = $this->backgroundColor;\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/png') {\n imagealphablending($this->image, false);\n imagesavealpha($this->image, true);\n $background = imagecolorallocatealpha($this->image, $bcg[0], $bcg[1], $bcg[2], 127);\n imagecolortransparent($this->image, $background);\n } else {\n $background = imagecolorallocate($this->image, $bcg[0], $bcg[1], $bcg[2]);\n }\n\n imagefilledrectangle($this->image, 0, 0, $width, $height, $background);\n imagecopyresampled($this->image, $image_old, $xpos, $ypos, 0, 0, $new_width, $new_height, $this->info['width'], $this->info['height']);\n imagedestroy($image_old);\n }\n\n\t\t$this->info['width'] = $width;\n\t\t$this->info['height'] = $height;\n }", "public function modify();", "function apiEditLabPicture($lab, $p) {\n // Edit picture\n\t$rc = $lab -> editPicture($p);\n\n\tif ($rc === 0) {\n\t\t$output['code'] = 201;\n\t\t$output['status'] = 'success';\n\t\t$output['message'] = $GLOBALS['messages'][60023];\n\t} else {\n\t\t$output['code'] = 400;\n\t\t$output['status'] = 'fail';\n\t\t$output['message'] = $GLOBALS['messages'][$rc];\n\t}\n\treturn $output;\n}", "public function render()\n {\n header('Content-Type: image/png');\n\n imagepng($this->imageResource);\n imagedestroy($this->imageResource);\n }", "function setImage( &$value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n \n if ( get_class( $value ) == \"ezimage\" )\n {\n $this->ImageID = $value->id();\n }\n elseif( is_numeric( $value ) )\n {\n $this->ImageID = $value;\n }\n }", "public function replace( $buffer, $values=array())\r\n {\r\n \r\n \tif (empty($buffer))\r\n \t{\r\n \t\tthrow new \\Exception('Buffer is required');\r\n \t}\r\n \t\r\n \t//store the data from the original asset\r\n \t$oldData = $this->cast();\r\n \tunset($oldData['_id']);\r\n \t//override original values with sent values\r\n \t$values = array_merge($oldData, $values);\r\n \t//MD5 needs to change \r\n \t$values['md5'] = md5($values['title'] . uniqid());\r\n \t//save grid data\r\n \t$grid = $this->getDb()->getGridFS( $this->collectionNameGridFS() );\r\n \t \r\n \tif ($storedfile = $grid->storeBytes( $buffer, $values))\r\n \t{\t\r\n \r\n \t\t$model = new static;\r\n \t\t$model->load(array('_id'=>$storedfile));\r\n \t\t$model->bind( $values );\r\n \t\t\r\n \t\tif($model->save()) {\r\n \t\t\t\r\n \t\t\t//make thumb\r\n \t\t\t$model->rebuildThumb();\r\n \t\t\t//remove the original asset\r\n \t\t\t$this->remove();\r\n \t\t}\r\n \t\t \r\n \t}\r\n \t \r\n \treturn $model;\r\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 setResource($type, $name, $object, ?\\SetaPDF_Core_Document $document = null) {}", "public function apply($resource){\n\t\t// Extract arguments\n\t\t@list(,$level)=func_get_args();\n\t\t$level=abs((int)$level);\n\t\tif(!$level){\n\t\t $level=5;\n\t\t}\n\t\t// Get resolution\n\t\t$width=imagesx($resource);\n\t\t$height=imagesy($resource);\n\t\tif(!$width || !$height){\n\t\t\tthrow new Exception(\"An error was encountered while getting image resolution\");\n\t\t}\n\t\t// Apply effect\n\t\t$x=0;\n\t\tdo{\n\t\t\t$y=0;\n\t\t\tdo{\n\t\t\t\t// Get current pixel color\n\t\t\t\tlist($r,$g,$b,$a)=$this->_getColorAt($resource,$x,$y);\n\t\t\t\t// Generate noise\n\t\t\t\t$z=rand(-$level,$level);\n\t\t\t\t// Define color\n\t\t\t\t$r+=$z;\n\t\t\t\t$g+=$z;\n\t\t\t\t$b+=$z;\n\t\t\t\tif($r<0)\t\t$r=0;\n\t\t\t\telseif($r>255)\t$r=255;\n\t\t\t\tif($g<0)\t\t$g=0;\n\t\t\t\telseif($g>255)\t$g=255;\n\t\t\t\tif($b<0)\t\t$b=0;\n\t\t\t\telseif($b>255)\t$b=255;\n\t\t\t\t// Define new pixel\n\t\t\t\timagesetpixel($resource,$x,$y,imagecolorallocatealpha($resource,$r,$g,$b,$a));\n\t\t\t}\n\t\t\twhile(++$y<$height);\n\t\t}\n\t\twhile(++$x<$width);\n\t\treturn $resource;\n\t}", "public function replaceThumbnailResource(Thumbnail $thumbnail, array $krakenIoResult);", "public function action_image()\n\t{\n\t\t//Image::load(DOCROOT.'/files/04_2021/79199dcc06baf4cc230262fcbb4d1094.jpg')->preset('mypreset', DOCROOT.'/files/04_2021/ea7e8ed4bc9d6f7c03f5f374e30b183b.png');\n\t\t$image = Image::forge();\n\n\t\t// Or with optional config\n\t\t$image = Image::forge(array(\n\t\t\t\t'quality' => 80\n\t\t));\n\t\t$image->load(DOCROOT.'/files/04_2021/79199dcc06baf4cc230262fcbb4d1094.jpg')\n\t\t\t\t\t->crop_resize(200, 200)\n\t\t\t\t\t->rounded(100)\n\t\t\t\t\t->output();\n\t\t// Upload an image and pass it directly into the Image::load method.\n\t\tUpload::process(array(\n\t\t\t'path' => DOCROOT.DS.'files'\n\t\t));\n\n\t\tif (Upload::is_valid())\n\t\t{\n\t\t\t$data = Upload::get_files(0);\n\n\t\t\t// Using the file upload data, we can force the image's extension\n\t\t\t// via $force_extension\n\t\t\tImage::load($data['file'], false, $data['extension'])\n\t\t\t\t\t->crop_resize(200, 200)\n\t\t\t\t\t->save('image');\n\t\t} \n\t}", "public function imageUpdateAction()\n {\n $imageId = $this->params()->fromRoute('id');\n $offerId = $this->galleryTable->getOfferIdByImage($imageId)->toArray();\n $oldImage = $this->galleryTable->getImage($imageId);\n\n $changeImageForm = new ChangeImageForm($offerId);\n $request = $this->getRequest();\n if ($request->isPost()) {\n\n $post = array_merge_recursive($this->getRequest()->getPost()->toArray(), $this->getRequest()->getFiles()->toArray());\n $changeImageForm->setData($post);\n\n if ($changeImageForm->isValid()) {\n $changeImageFormData = $changeImageForm->getData();\n $image = $changeImageFormData['image'];\n\n $pathParts = pathinfo($image['tmp_name']);\n $newFilePath = $pathParts['dirname'] . '/' . $offerId['offer_id'] . '/front-' . $pathParts['filename'] . '.' . $pathParts['extension'];\n\n $this->galleryTable->updateImage($imageId, $pathParts['filename'] . '.' . $pathParts['extension']);\n ImageManager::resizeImage($image['tmp_name'], $newFilePath);\n rename(PUBLIC_PATH . '/media/offers/' . $pathParts['filename'] . '.' . $pathParts['extension'], PUBLIC_PATH . '/media/offers/' . $offerId['offer_id'] . '/' . $pathParts['filename'] . '.' . $pathParts['extension']);\n unlink($pathParts['dirname'] . '/' . $offerId['offer_id'] . '/' . $oldImage->getField('image'));\n unlink($pathParts['dirname'] . '/' . $offerId['offer_id'] . '/front-' . $oldImage->getField('image'));\n\n return $this->redirect()->toRoute('languageRoute/adminOffersGallery', array('offerId' => $offerId['offer_id']));\n }\n }\n return $this->redirect()->toRoute('languageRoute/adminOffersGallery', array('offerId' => $offerId['offer_id']));\n }", "public function edit(ImgProduct $imgProduct)\n {\n //\n }", "public function run() {\r\nif(!($new_image = @imagecreatetruecolor($this->new_width, $this->new_height)))\r\nthrow new Exception(\"Error while the new image was initialized\");\r\n\r\nswitch($this->type) {\r\ncase 1:\r\n$image = imagecreatefromgif($this->src);\r\n$transparent_index = imagecolortransparent($image);\r\n$transparent_color = imagecolorsforindex($image, $transparent_index);\r\n$transparent_index = imagecolorallocate($new_image, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);\r\nimagefill($new_image, 0, 0, $transparent_index);\r\nimagecolortransparent($new_image, $transparent_index);\r\nbreak;\r\ncase 2:\r\n$image = imagecreatefromjpeg($this->src);\r\nbreak;\r\ncase 3:\r\n$image = imagecreatefrompng($this->src);\r\nimagealphablending($new_image, false);\r\nimagesavealpha($new_image, true);\r\nbreak;\r\ndefault:\r\nthrow new Exception('<b>Error:</b> The image type was not recognized');\r\nbreak;\r\n}\r\n\r\ntry {\r\nimagecopyresampled($new_image, $image, 0, 0, 0, 0, $this->new_width, $this->new_height, $this->width, $this->height);\r\n}\r\ncatch(Exception $e) {\r\nthrow new Exception(\"<b>Error:</b> The image couldn't be resized\");\r\n}\r\n\r\nswitch($this->type) {\r\ncase 1:\r\nimagegif($new_image, $this->dest);\r\nbreak;\r\ncase 2:\r\nimagejpeg($new_image, $this->dest);\r\nbreak;\r\ncase 3:\r\nimagepng($new_image, $this->dest);\r\nbreak;\r\ndefault:\r\nthrow new Exception('Error while the image was created');\r\nbreak;\r\n}\r\n\r\n$this->releaseMemory($image, $new_image);\r\n}", "private function createImageResource()\n {\n // We are currently using vips_image_new_from_file(), but we could consider\n // calling vips_jpegload / vips_pngload instead\n $result = /** @scrutinizer ignore-call */ vips_image_new_from_file($this->source, []);\n if ($result === -1) {\n /*throw new ConversionFailedException(\n 'Failed creating new vips image from file: ' . $this->source\n );*/\n $message = /** @scrutinizer ignore-call */ vips_error_buffer();\n throw new ConversionFailedException($message);\n }\n\n if (!is_array($result)) {\n throw new ConversionFailedException(\n 'vips_image_new_from_file did not return an array, which we expected'\n );\n }\n\n if (count($result) != 1) {\n throw new ConversionFailedException(\n 'vips_image_new_from_file did not return an array of length 1 as we expected ' .\n '- length was: ' . count($result)\n );\n }\n\n $im = array_shift($result);\n return $im;\n }", "function image_scale_blob($blob, $aspect, $width, $strategy)\n{\n $im = new \\Imagick();\n $im->readImageBlob($blob);\n $im = image_scale_im_obj($im, $aspect, $width, $strategy);\n return image_return_blob($im);\n}", "protected function doActualConvert()\n {\n\n $this->logLn('GD Version: ' . gd_info()[\"GD Version\"]);\n\n // Btw: Check out processWebp here:\n // https://github.com/Intervention/image/blob/master/src/Intervention/Image/Gd/Encoder.php\n\n // Create image resource\n $image = $this->createImageResource();\n\n // Try to convert color palette if it is not true color\n $this->tryToMakeTrueColorIfNot($image);\n\n\n if ($this->getMimeTypeOfSource() == 'image/png') {\n // Try to set alpha blending\n $this->trySettingAlphaBlending($image);\n }\n\n // Try to convert it to webp\n $this->tryConverting($image);\n\n // End of story\n imagedestroy($image);\n }", "public function putStream($resource);", "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 operateImage($src=null)\n {\n $this->image_thumb=imagecreatetruecolor($this->imageX/2,$this->imageY/2);\n imagecopyresampled($this->image_thumb,$this->image,0,0,0,0,$this->imageX/2,$this->imageY/2,$this->imageX,$this->imageY);\n }", "public function setImageResource($value)\n {\n return $this->set('ImageResource', $value);\n }", "function _putimages() {\n parent::_putimages();\n $this->_putformxobjects();\n }", "public function applyToImage(Image $image, $x = 0, $y = 0)\n {\n return parent::applyToImage($image, $x, $y);\n }", "function img_op( $task = Array() ){\n\t\t\n\t\tif(isset($task[0])){\n\t\t\t\n\t\t\tif($task[0] == \"resize\"){\n\t\t\t\t\n\t\t\t\t$src \t\t= $task[1];\n\t\t\t\t$dest \t\t= $task[2];\n\t\t\t\t$img_geo \t= $task[3];\n\t\t\t\t\n\t\t\t\t$new_dim \t= explode(\"x\", $img_geo);\n\t\t\t\t$max_width \t= intval($new_dim[0]);\n\t\t\t\t$max_height = intval($new_dim[1]);\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\t$img = new Imagick();\n\t\t\t\t\t$img->readImageBlob(file_get_contents($src));\n\t\t\t\t}\n\t\t\t\tcatch(Exception $e) {\n\t\t\t\t\tdie('Error: ' . $e->getMessage());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$new_dim = img_op_max_dimensions($src, $max_width, $max_height);\n\t\t\t\t\n\t\t\t\tif($new_dim){\n\t\t\t\t\t$img->resizeImage($new_dim[0], $new_dim[1], 1, 1, 0);\n\t\t\t\t\t$img = $img->writeImage($dest);\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\tif(isset($task[4]))\n\t\t\t\t\t$extra = \" \".$task[4];\n\t\t\t\telse\n\t\t\t\t\t$extra = \"\";\n\t\t\t\t\n\t\t\t\texec(\"convert \".$src.\" -resize \".$img_geo.$extra.\" \".$dest);*/\n\t\t\t}\n\t\t\tif($task[0] == \"crop\"){\n\t\t\t\t\n\t\t\t\t$src \t\t= $task[1];\n\t\t\t\t$dest \t\t= $task[2];\n\t\t\t\t$dimensions\t= $task[3];\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\t$img = new Imagick();\n\t\t\t\t\t$img->readImageBlob(file_get_contents($src));\n\t\t\t\t}\n\t\t\t\tcatch(Exception $e) {\n\t\t\t\t\tdie('Error: ' . $e->getMessage());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$new_dim \t= explode(\"x\", $dimensions);\n\t\t\t\t$new_width \t= intval($new_dim[0]);\n\t\t\t\t$new_height = intval($new_dim[1]);\n\t\t\t\t\n\t\t\t\t$img->cropThumbnailImage($new_width, $new_height);\n\t\t\t\t$img = $img->writeImage($dest);\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\tif(isset($task[4]))\n\t\t\t\t\t$gravity = $task[4];\n\t\t\t\telse\n\t\t\t\t\t$gravity = \"center\";\n\t\t\t\t\n\t\t\t\tif(isset($task[5]))\n\t\t\t\t\t$extra = \" \".$task[5];\n\t\t\t\telse\n\t\t\t\t\t$extra = \"\";\n\t\t\t\t\n\t\t\t\t//get min_width/height\n\t\t\t\t$dimensions_old = img_op( [\"dimensions\", $src] );\n\t\t\t\t$dimensions_new = explode(\"x\", $dimensions);\n\t\t\t\t$aspect_ratio\t= $dimensions_old[0]/$dimensions_old[1];\n\t\t\t\t\n\t\t\t\tif($dimensions_new[1]*$aspect_ratio >= $dimensions_new[0])\n\t\t\t\t\t$dimensions_resize = \"x\".$dimensions_new[1];\n\t\t\t\telse\n\t\t\t\t\t$dimensions_resize = $dimensions_new[0].\"x\";\n\t\t\t\t\n\t\t\t\texec(\"convert \".$src.\" -gravity \".$gravity.\" -resize \".$dimensions_resize.\"^\".$extra.\" -crop \".$dimensions.\"+0+0 \".$dest);*/\n\t\t\t}\n\t\t\tif($task[0] == \"dimensions\"){\n\t\t\t\t\n\t\t\t\t$src \t\t= $task[1];\n\t\t\t\t\n\t\t\t\t$result = Array();\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\t$img = new Imagick();\n\t\t\t\t\t$img->readImageBlob(file_get_contents($src));\n\t\t\t\t}\n\t\t\t\tcatch(Exception $e) {\n\t\t\t\t\tdie('Error: ' . $e->getMessage());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$result[0] = $img->getImageWidth();\n\t\t\t\t$result[1] = $img->getImageHeight();\n\t\t\t\t\n\t\t\t\t//$result[0] = intval(exec(\"magick identify -ping -format %w \".$src));\n\t\t\t\t//$result[1] = intval(exec(\"magick identify -ping -format %h \".$src));\n\t\t\t\t\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\treturn \"missing value\";\n\t}", "abstract public function resource();", "function applyFilter($filter)\n {\n if (count($this->error) == 0)\n {\n // split up filter name and filter configuration\n $filterInfos = explode('-',$filter);\n eval(\"\\$temp = new \".$filterInfos[0].\" (\\$this->imgSrc,\\$filterInfos);\");\n if ($temp->dest !== false)\n {\n // filter was applied\n // $filterUsed[] = $filterItem['value'];\n $this->imgSrc = $temp->dest;\n return true;\n }\n else\n {\n // filter was not applied, save filter errors\n foreach($temp->error as $error)\n {\n $this->error[] = $filterInfos[0].': '.$error;\n }\n return false;\n }\n }\n }", "function modify( &$tpl, &$operatorName, &$operatorParameters, &$rootNamespace,\r\n &$currentNamespace, &$operatorValue, &$namedParameters )\r\n {\r\n switch ( $operatorName )\r\n {\r\n case 'qrcode':\r\n {\r\n $operatorValue = all2eQRCodeClass::encode( $namedParameters['type'], $namedParameters['text'], $namedParameters['width'], $namedParameters['height'] );\r\n } break;\r\n }\r\n }", "public function transcodeFile($file) : void{\n\t\t\n\t\t$file = $this -> fixOrientation($file);\n\t\t\n\t\tif($file) {\n\t\t\t\n\t\t\t$storageProdiver = $this -> _storageService;\n\t\t\t$storage_service = new $storageProdiver;\n\t\t\t$mime_type = \\FileManager::getFileMimeType($file);\n\t\t\t$extension = $this -> getExtension($mime_type);\n\t\t\t$save_location = '';\n\t\t\t\n\t\t\tif($this -> _localStorage) {\n\t\t\t\t$save_location = SITE_PATH.'/public_html/img/uploads/'.$this -> image_id.$extension;\n\t\t\t} else {\n\t\t\t\t$save_location = $this -> image_id.$extension;\n\t\t\t}\n\t\t\t\n\t\t\t$uploaded_file = $storage_service ->upload( $save_location , file_get_contents($file) , $mime_type);\n\t\t\t\n\t\t\tif($uploaded_file) {\n\t\t\t\t\n\t\t\t\t$this -> update(array(\n\t\t\t\t\t'image_original_url' => $uploaded_file\n\t\t\t\t));\t\n\t\t\t\t\n\t\t\t\t$this -> scaleImage(800, 600, $file, 'image_large_url', 'image_large_square_url');\n\t\t\t\t$this -> scaleImage(500, 334, $file, 'image_medium_url', 'image_medium_square_url');\n\t\t\t\t$this -> scaleImage(240, 160, $file, 'image_small_url', 'image_small_square_url');\n\t\t\t\t$this -> scaleImage(100, 100, $file, 'image_thumbnail_url', 'image_thumbnail_square_url');\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(file_exists($file)) {\n\t\t\t\t\tunlink($file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function setImage($rImage = false) {\n\n\t\tif (is_resource($this->rImage)) imageDestroy($this->rImage);\n\t\t$this->rImage = $rImage;\n\n\t}", "public function updateImage($class, $file = null, $newFilename = null)\n {\n if (is_null($file)) {\n $file = request()->file($class);\n }\n \n if (is_string($file)) {\n $file = request()->file($file);\n }\n\n if (empty($file)) {\n return;\n }\n \n if (! $file instanceof UploadedFile) {\n throw new \\InvalidArgumentException;\n }\n \n // Delete previous image and its children\n $this->deleteImage($class, true);\n \n $imgRecepiesStack = $this->getImgRecepiesStack();\n\n $imgObj = new Image();\n $imgObj->storeImageWithActions(\n $this,\n $file,\n $class,\n $imgRecepiesStack,\n $newFilename\n );\n \n return true;\n }", "public function flip()\n {\n $this->resource->flipImage();\n return $this;\n }", "public function getImageResource()\n {\n if (is_null($this->image) && !is_null($this->full_path)) {\n $this->image = self::createResource($this->full_path);\n }\n\n if (is_resource($this->image) && get_resource_type($this->image) === 'gd') {\n imagesavealpha($this->image, true);\n } else {\n throw new \\InvalidArgumentException('Image is not valid.');\n }\n\n return $this->image;\n }", "public function transform(sfImage $image)\r\n {\r\n\r\n // Get the actual image resource\r\n $resource = $image->getAdapter()->getHolder();\r\n\r\n //get the resource dimentions\r\n $width = $image->getWidth();\r\n $height = $image->getHeight();\r\n\r\n $reflection = $image->copy();\r\n\r\n $reflection->flip()->resize($width, $this->reflection_height);\r\n\r\n $r_resource = $reflection->getAdapter()->getHolder();\r\n\r\n $dest_resource = $reflection->getAdapter()->getTransparentImage($width, $height + $this->reflection_height);\r\n\r\n imagecopymerge($dest_resource, $resource, 0, 0, 0 ,0, $width, $height, 100);\r\n\r\n imagecopymerge($dest_resource, $r_resource, 0, $height, 0 ,0, $width, $this->reflection_height, 100);\r\n\r\n // Increments we are going to increase the transparency\r\n $increment = 100 / $this->reflection_height;\r\n\r\n // Overlay line we use to apply the transparency\r\n $line = imagecreatetruecolor($width, 1);\r\n\r\n // Use white as our overlay color\r\n imagefilledrectangle($line, 0, 0, $width, 1, imagecolorallocate($line, 255, 255, 255));\r\n\r\n $tr = $this->start_transparency;\r\n\r\n // Start at the bottom of the original image\r\n for ($i = $height; $i <= $height + $this->reflection_height; $i++)\r\n {\r\n\r\n if ($tr > 100)\r\n {\r\n $tr = 100;\r\n }\r\n\r\n imagecopymerge($dest_resource, $line, 0, $i, 0, 0, $width, 1, $tr);\r\n\r\n $tr += $increment;\r\n\r\n }\r\n\r\n // To set a new resource for the image object\r\n $image->getAdapter()->setHolder($dest_resource);\r\n\r\n return $image;\r\n }", "protected function doActualConvert()\n {\n/*\n $im = \\Jcupitt\\Vips\\Image::newFromFile($this->source);\n //$im->writeToFile(__DIR__ . '/images/small-vips.webp', [\"Q\" => 10]);\n\n $im->webpsave($this->destination, [\n \"Q\" => 80,\n //'near_lossless' => true\n ]);\n return;*/\n\n $im = $this->createImageResource();\n $options = $this->createParamsForVipsWebPSave();\n $this->webpsave($im, $options);\n }", "function changeUserImage($pdo, $id, $image)\n{\n executeUpdate($pdo, \n \"UPDATE User SET image = ? WHERE id = ?\", array(\n $image, $id\n )\n );\n}", "public function setResource($resource)\n {\n $this->resource = $resource;\n\n return $this;\n }", "public function update(){\n if ($this->postId != null){\n $this->validate();\n\n /**\n * if change image\n * try to upload image and resize by ImageSaverController config\n * delete old images from upload directory\n */\n if (isset($this->image) && $this->image != null){\n $this->validate(['image' => 'required|image']);\n try {\n $imageSaver = new ImageSaverController();\n $newImagePath = $imageSaver->loadImage($this->image->getRealPath())->saveAllSizes();\n ImageSaverController::DeleteAllPhotos($this->imagePath);\n $this->imagePath = $newImagePath;\n }catch (\\RuntimeException $exception){\n dd($exception);\n }\n }\n\n $this->PostSaver();\n $this->resetAll();\n $this->ChangeUpdateMode();\n $this->swAlert([\n 'title' => 'Good job',\n 'text' => 'successfully updated',\n 'icon' => 'success'\n ]);\n $this->render();\n\n }\n }", "public function replaceImage()\n {\n $args = func_get_args();\n\n $domDocument = new DomDocument();\n $domDocument->loadXML(self::$_document);\n\n $domImages = $domDocument->getElementsByTagNameNS('http://schemas.openxmlformats.org/drawingml/2006/' .\n 'wordprocessingDrawing', 'docPr');\n $domImagesId = $domDocument->getElementsByTagNameNS(\n 'http://schemas.openxmlformats.org/drawingml/2006/main',\n 'blip'\n );\n\n for ($i = 0; $i < $domImages->length; $i++) {\n if ($domImages->item($i)->getAttribute('descr') ==\n self::$_templateSymbol . $args[0] . self::$_templateSymbol) {\n $ind = $domImagesId->item($i)->getAttribute('r:embed');\n self::$placeholderImages[$ind] = $args[1];\n }\n }\n }", "protected function processImage()\n {\n // Start from the last scale (bigger image).\n $tier = (count($this->_scaleInfo) - 1);\n $row = 0;\n $ul_y = 0;\n $lr_y = 0;\n\n list($root, $ext) = $this->getRootAndDotExtension($this->_imageFilename);\n\n // Create a row from the original image and process it.\n while ($row * $this->tileSize < $this->_originalHeight) {\n $ul_y = $row * $this->tileSize;\n $lr_y = ($ul_y + $this->tileSize < $this->_originalHeight)\n ? $ul_y + $this->tileSize\n : $this->_originalHeight;\n $saveFilename = $root . '-' . $tier . '-' . $row . '.' . $ext;\n $width = $this->_originalWidth;\n $height = abs($lr_y - $ul_y);\n $crop = [];\n $crop['width'] = $width;\n $crop['height'] = $height;\n $crop['x'] = 0;\n $crop['y'] = $ul_y;\n $this->imageResizeCrop($this->_imageFilename, $saveFilename, [], $crop);\n\n $this->processRowImage($tier, $row);\n ++$row;\n }\n }", "public function setResource(Resource $res)\n {\n $this->setResourceId($res->getResourceId());\n $this->setResourceClass($res->getResourceClass());\n }", "protected function scaleImages() {}", "public function transform($transformationType, $value);", "private function newImageResource($width, $height) {\n $new_image = imagecreatetruecolor($width, $height);\n\n// handling images with alpha channel information\n switch ($this->_mimetype) {\n case \"image/png\":\n// integer representation of the color black (rgb: 0,0,0)\n $background = imagecolorallocate($new_image, 0, 0, 0);\n// removing the black from the placeholder\n imagecolortransparent($new_image, $background);\n\n// turning off alpha blending (to ensure alpha channel information is preserved, rather than removed (blending with the rest of the image in the form of black))\n imagealphablending($new_image, false);\n\n// turning on alpha channel information saving (to ensure the full range of transparency is preserved)\n imagesavealpha($new_image, true);\n\n break;\n case \"image/gif\":\n// integer representation of the color black (rgb: 0,0,0)\n $background = imagecolorallocate($new_image, 0, 0, 0);\n// removing the black from the placeholder\n imagecolortransparent($new_image, $background);\n\n break;\n }\n\n return $new_image;\n }", "protected function _load_image()\n {\n if ( ! is_resource($this->_image))\n {\n // Gets create function\n $create = $this->_create_function;\n\n // Open the temporary image\n $this->_image = $create($this->file);\n\n // Preserve transparency when saving\n imagesavealpha($this->_image, TRUE);\n }\n }", "function alt_from_resource($source,$target,$name='',$delete=false){\n\t// alt is the source resource, $ref is the target resource that will get the new alternate\n\tglobal $view_title_field;\n\t$srcdata=get_resource_data($source);\n\t$srcext = $srcdata['file_extension'];\n\t$srcpath = get_resource_path($source,true,\"\",false,$srcext);\n\tif ($name == ''){\n\t\t$name = sql_value(\"select value from resource_data where resource_type_field = '$view_title_field' and resource = '$source'\",'Untitled');\n\t}\n\n\t$description = '';\n\tif (!file_exists($srcpath)){\n\t\techo \"ERROR: File not found.\";\n\t\treturn false;\n\t} else {\n\n\t\t$file_size = filesize_unlimited($srcpath);\n\t\t$altid = add_alternative_file($target,$name,$description=\"\",$file_name=\"\",$file_extension=\"\",$file_size,$alt_type='');\n\t\t$newpath = get_resource_path($target,true,\"\",true,$srcext,-1,1,false,'',$altid);\n\t\tcopy($srcpath,$newpath);\n\t\t# Preview creation for alternative files (enabled via config)\n global $alternative_file_previews;\n if ($alternative_file_previews){\n\t\t\tcreate_previews($target,false,$srcext,false,false,$altid);\n \t}\n\t\tif ($delete){\n\t\t\t// we are supposed to delete the original resource when we're done\n\t\t\t# Not allowed to edit this resource? They shouldn't have been able to get here.\n\t\t\tif ((!get_edit_access($source,$srcdata[\"archive\"],false,$srcdata))||checkperm('D')) {\n\t\t\t\texit (\"Permission denied.\");\n\t\t\t} else {\n\t\t\t\tdelete_resource($source);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\n\t}\n}", "function resize($iNewWidth, $iNewHeight)\n\t{\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\tif (function_exists(\"imagecopyresampled\")) {\n\t\t\t$ResizedImageStream = imagecreatetruecolor($iNewWidth, $iNewHeight);\n\t\t\timagecopyresampled($ResizedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t} else {\n\t\t\t$ResizedImageStream = imagecreate($iNewWidth, $iNewHeight);\n\t\t\timagecopyresized($ResizedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t}\n\n\t\t$this->ImageStream = $ResizedImageStream;\n\t\t$this->width = $iNewWidth;\n\t\t$this->height = $iNewHeight;\n\t\t$this->setImageOrientation();\n\t}", "public function action_editImage() \n {\n $fieldid = $_POST[\"fieldid\"];\n $field = Wi3::inst()->model->factory(\"site_field\")->set(\"id\", $fieldid)->load();\n \n // Update e-mailaddress\n $email = Wi3::inst()->model->factory(\"site_data\")->setref($field)->setname(\"emailaddress\")->load();\n // If data does not exist, create it\n if (!$email->loaded())\n {\n $email->create();\n }\n // Update data field with image-id\n $emailaddress = $_POST[\"emailaddress\"];\n $email->data = $emailaddress;\n $email->update();\n \n echo Kohana::debug($email); exit;\n \n // Update folder\n $data = Wi3::inst()->model->factory(\"site_data\")->setref($field)->setname(\"folder\")->load();\n // If data does not exist, create it\n if (!$data->loaded())\n {\n $data->create();\n }\n // Update data field with image-id\n $fileid = $_POST[\"image\"];\n $data->data = $fileid;\n $data->update();\n \n //$file = Wi3::inst()->model->factory(\"site_file\")->set(\"id\", $fileid)->load();\n \n echo json_encode(\n Array(\n \"scriptsbefore\" => Array(\n \"0\" => \"$('[type=field][fieldid=\" . $fieldid . \"] [type=fieldcontent]').html('\" . $field->render() . \"');\"\n )\n )\n );\n }", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n{\n $this->Rotate($angle,$x,$y);\n $this->Image($file,$x,$y,$w,$h);\n $this->Rotate(0);\n}", "function resize( $width, $height ) {\n $new_image = imagecreatetruecolor( $width, $height );\n if ( $this->mimetype == 'image/gif' || $this->mimetype == 'image/png' ) {\n $current_transparent = imagecolortransparent( $this->image );\n if ( $current_transparent != -1 ) {\n $transparent_color = imagecolorsforindex( $this->image, $current_transparent );\n $current_transparent = imagecolorallocate( $new_image, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue'] );\n imagefill( $new_image, 0, 0, $current_transparent );\n imagecolortransparent( $new_image, $current_transparent );\n } elseif ( $this->mimetype == 'image/png' ) {\n imagealphablending( $new_image, false );\n $color = imagecolorallocatealpha( $new_image, 0, 0, 0, 127 );\n imagefill( $new_image, 0, 0, $color );\n imagesavealpha( $new_image, true );\n }\n }\n imagecopyresampled( $new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->width, $this->height );\n $this->image = $new_image;\n return $this;\n }", "public function setResourcePath($resourcePath);", "public function updateProductImage($request) {\n\n $json = array('success' => false);\n\n $this->load->model('catalog/product');\n $this->load->model('rest/restadmin');\n\n if (ctype_digit($request->get['id'])) {\n $product = $this->model_catalog_product->getProduct($request->get['id']);\n //check product exists\n if(!empty($product)) {\n if(isset($request->files['file'])){\n $uploadResult = $this->upload($request->files['file'], \"products\");\n if(!isset($uploadResult['error'])){\n $json['success'] = true;\n $this->model_rest_restadmin->setProductImage($request->get['id'], $uploadResult['file_path']);\n }else{\n $json['error']\t= $uploadResult['error'];\n }\n } else {\n $json['error']\t= \"File is required!\";\n }\n }else {\n $json['success']\t= false;\n $json['error'] = \"The specified product does not exist.\";\n }\n } else {\n $json['success'] = false;\n }\n\n $this->sendResponse($json);\n }", "function updateRowInG($data) {\n\t\n\t//include 'products/rescrop.php?filename='.$data[\"params\"][\"img\"].'&secret=12345678';///image resize, crop, watermarking, class\n}", "protected function _create_cached()\n {\n if($this->url_params['c'])\n {\n // Resize to highest width or height with overflow on the larger side\n $this->image->resize($this->url_params['w'], $this->url_params['h'], Image::INVERSE);\n\n // Crop any overflow from the larger side\n $this->image->crop($this->url_params['w'], $this->url_params['h']);\n }\n else\n {\n // Just Resize\n $this->image->resize($this->url_params['w'], $this->url_params['h']);\n }\n\n // Apply any valid watermark params\n $watermarks = Arr::get($this->config, 'watermarks');\n if ( ! empty($watermarks))\n {\n foreach ($watermarks as $key => $watermark)\n {\n if (key_exists($key, $this->url_params))\n {\n $image = Image::factory($watermark['image']);\n $this->image->watermark($image, $watermark['offset_x'], $watermark['offset_y'], $watermark['opacity']);\n }\n }\n }\n\n // Save\n if($this->url_params['q'])\n {\n //Save image with quality param\n $this->image->save($this->cached_file, $this->url_params['q']);\n }\n else\n {\n //Save image with default quality\n $this->image->save($this->cached_file, Arr::get($this->config, 'quality', 80));\n }\n }" ]
[ "0.64512944", "0.6165758", "0.595881", "0.56702685", "0.55832666", "0.5572471", "0.5388291", "0.53775483", "0.5333663", "0.53016365", "0.52967274", "0.5237945", "0.5171434", "0.516492", "0.5164222", "0.51603127", "0.5143059", "0.5078773", "0.5059693", "0.50337255", "0.4996388", "0.49798033", "0.49737576", "0.4972113", "0.49654415", "0.4961078", "0.49588633", "0.495514", "0.49284753", "0.48837563", "0.4880831", "0.48728594", "0.48576048", "0.48494115", "0.48347795", "0.48157862", "0.47938785", "0.47853845", "0.47833872", "0.47821838", "0.47692358", "0.47633114", "0.47562888", "0.47500992", "0.4719133", "0.46935", "0.46913904", "0.46880332", "0.4676619", "0.46723863", "0.4666069", "0.46528554", "0.4651381", "0.46504942", "0.4641528", "0.4630154", "0.46273133", "0.46168733", "0.46120992", "0.4595183", "0.45887855", "0.45756972", "0.45710838", "0.45671085", "0.45609403", "0.4552633", "0.45500737", "0.4539615", "0.45334002", "0.45278686", "0.45245963", "0.45199418", "0.45145318", "0.45122874", "0.45106608", "0.4506998", "0.44947273", "0.44929725", "0.44927368", "0.4488262", "0.44864753", "0.44787353", "0.44709688", "0.4467261", "0.44639835", "0.44601917", "0.44549406", "0.44500288", "0.44463035", "0.4439726", "0.44319484", "0.4430389", "0.44254908", "0.44203228", "0.44189224", "0.44105193", "0.4409269", "0.44088358", "0.44041702", "0.440147" ]
0.519873
12
Clear any cached errors / metadata for this image
protected function markSuccess($hash, $variant = null) { $key = $this->getErrorCacheKey($hash, $variant); $this->getCache()->deleteMultiple([ $key.'_reason', $key.'_ttl' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function flushImageCache(): void\n {\n $this->imagesCache = null;\n $this->variantImages = null;\n }", "private function flushImageCache()\n {\n $this->imagesCache = null;\n $this->variantImages = null;\n }", "public function reset() {\r\n\t\t$this->images = array();\r\n\t}", "public function resetMetadata(): void\n {\n $this->_metadata = null;\n }", "protected function clearCacheOnError() {}", "public function clearResources()\n {\n AM_Tools::clearContent($this->_getIssueHelpPage()->getThumbnailPresetType(), $this->_getIssueHelpPage()->id_issue);\n AM_Tools::clearResizerCache($this->_getIssueHelpPage()->getThumbnailPresetType(), $this->_getIssueHelpPage()->id_issue);\n }", "public static function clean_cached_data()\n {\n }", "function clearCache () {\n $this->clearThumbCache ();\n $this->clearPreviewCache ();\n }", "public function reset() {\n\n\t\t$type = Dba::escape($this->type);\n\t\t$uid = Dba::escape($this->uid);\n\n\t\t$sql = \"DELETE FROM `image` WHERE `object_id`='$uid' AND `object_type`='$type'\";\n\t\t$db_results = Dba::write($sql);\n\n\t}", "public function clear() {\n $this->_errors = array();\n }", "public function reset()\n {\n $this->values[self::URL] = null;\n $this->values[self::MIMETYPE] = null;\n $this->values[self::SHA256] = null;\n $this->values[self::LENGTH] = null;\n $this->values[self::SECONDS] = null;\n $this->values[self::REFKEY] = null;\n $this->values[self::THUMBNAIL] = null;\n $this->values[self::CAPTION] = null;\n }", "public function cleanContrexxCaching()\n {\n $this->_deleteAllFiles();\n }", "public function unsetMetadata(): void\n {\n $this->metadata = [];\n }", "function imageAllReset();", "public function clear()\n {\n try {\n $this->imagick->clear();\n $this->imagick->destroy();\n } catch (Exception $e) {\n\n }\n }", "public function reset()\n {\n $this->values[self::URL] = null;\n $this->values[self::MIMETYPE] = null;\n $this->values[self::CAPTION] = null;\n $this->values[self::SHA256] = null;\n $this->values[self::LENGTH] = null;\n $this->values[self::HEIGHT] = null;\n $this->values[self::WIDTH] = null;\n $this->values[self::REFKEY] = null;\n $this->values[self::THUMBNAIL] = null;\n }", "function ClearError() \r\n{ \r\n$this->LastError = null; \r\n}", "public function cleanImagesAction()\n {\n parent::cleanImagesAction();\n $this->clearRespizrImageCache();\n }", "protected function _clear_cache() {\n\t\t$this->_attrs = array();\n\t\t$this->_options = array();\n\t}", "public function reset() : void\n {\n $this->_modified = [];\n $this->_errors = [];\n }", "public function clearErrors() {\n $this->errorCodes = [];\n }", "public function delMetadata() {}", "public function delMetadata() {}", "public function delMetadata() {}", "public function reset()\n {\n $this->values[self::URL] = null;\n $this->values[self::MIMETYPE] = null;\n $this->values[self::NAME] = null;\n $this->values[self::LENGTH] = null;\n $this->values[self::SHA256] = null;\n $this->values[self::PAGES] = null;\n $this->values[self::REFKEY] = null;\n $this->values[self::FILENAME] = null;\n $this->values[self::THUMBNAIL] = null;\n }", "public function destroy()\n {\n $this->_info = new stdClass();\n if( is_resource($this->_resource) )\n {\n imagedestroy($this->_resource);\n }\n }", "public function clearError() {\n $this->errors = array();\n }", "public function clearErrors()\n {\n $this->errors = array();\n }", "function clearPreviewCache () {\n files::deleteFile($this->previewDir . $this->file);\n }", "public function reset()\n {\n $this->errors = array();\n }", "protected function clearError()\n {\n $this->lastError = null;\n }", "public function clear()\n {\n if (File::rm($this->cacheFile)) {\n echo 'OK';\n } else {\n echo 'ERROR';\n }\n }", "public function clearErrors()\n {\n $this->errors = [];\n }", "public function resetErrors() {}", "public function clearErrors() {\n $this->fErrors = Array();\n }", "protected function clear()\n {\n $this->error = '';\n $this->success = false;\n }", "public function resetCaches() {\n $this->datasource = NULL;\n $this->server_object = NULL;\n $this->callbacks = NULL;\n $this->processors = NULL;\n $this->added_properties = NULL;\n $this->fields = array();\n $this->fulltext_fields = array();\n }", "public function clearCached()\n {\n $this->cached = null;\n }", "public static function resetCache()\n\t{\n\t\tTagDependency::invalidate(Yii::$app->cache, static::getCacheTag());\n\t}", "public static function resetCache()\n\t{\n\t\tTagDependency::invalidate(Yii::$app->cache, static::getCacheTag());\n\t}", "public function reset()\n {\n $this->metas->reset();\n $this->images = [];\n\n return $this->init();\n }", "public function reset()\n {\n $this->_metaData = array();\n $this->_columnMap = array();\n }", "public function clearCache(){\n if(file_exists($this->file)){\n @unlink($this->file);\n }\n }", "public function clearErrors()\n {\n $this->errorMessages = [];\n }", "public function clean()\n {\n return $this->docker('image prune --force');\n }", "public function reset() {\n\t\t$this->mimetypes = [];\n\t\t$this->mimetypeIds = [];\n\t}", "public function reset()\n {\n $this->returnedFiles = [];\n }", "public function clearCachefiles () {\r\n\t\r\n\t}", "private function clearCache() {\n\t\t\n\t\tCore\\Cache::clear();\n\t\t\n\t}", "public function reset()\n {\n $this->getDb()->exec('delete from media');\n //pictures and vignettes deletion\n $this->deleteMedias();\n //backup deletion\n $this->deleteBackup();\n }", "public function purgeImageCache()\n\t{\n\t\t// Walk through the subfolders\n\t\tforeach (scan(TL_ROOT . '/assets/images') as $dir)\n\t\t{\n\t\t\tif ($dir != 'index.html' && strncmp($dir, '.', 1) !== 0)\n\t\t\t{\n\t\t\t\t// Purge the folder\n\t\t\t\t$objFolder = new \\Folder('assets/images/' . $dir);\n\t\t\t\t$objFolder->purge();\n\n\t\t\t\t// Restore the index.html file\n\t\t\t\t$objFile = new \\File('templates/index.html', true);\n\t\t\t\t$objFile->copyTo('assets/images/' . $dir . '/index.html');\n\t\t\t}\n\t\t}\n\n\t\t// Also empty the page cache so there are no links to deleted images\n\t\t$this->purgePageCache();\n\n\t\t// Add a log entry\n\t\t$this->log('Purged the image cache', __METHOD__, TL_CRON);\n\t}", "protected function invalidateCache()\n {\n // \\Log::error('invalidate '.$this->getTag());\n \\Cache::tags($this->getTag())->flush();\n //\\Cache::prefixs($this->getTag())->flush();\n }", "function resetErrorData()\n {\n $this->errorData = array();\n }", "public function clear()\n {\n sfToolkit::clearDirectory($this->getConfigCacheDir());\n }", "protected function clear()\n {\n $this->optionManager->clear();\n $this->headerManager->clear();\n $this->cookies = [];\n $this->files = [];\n }", "public function reset()\n {\n $this->values[self::ERRMSG] = null;\n $this->values[self::RET] = null;\n }", "public function reset()\n {\n $this->values[self::_INFO] = null;\n $this->values[self::_EXIT] = Down_ErrorInfo_Exit::noneed;\n }", "protected function typo3CleanUp($imageResource) {\n \t$GLOBALS['TYPO3_DB']->exec_DELETEquery(\n\t\t\t'cache_imagesizes',\n\t\t\t'filename=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($imageResource[3], 'cache_imagesizes')\n \t);\n \t\n \tunset($GLOBALS['TSFE']->tmpl->fileCache[$imageResource['fileCacheHash']]);\n }", "protected function reset() {}", "function clean() {\n return $this->_exec( \"reset --hard HEAD\" );\n }", "protected function reset() {}", "private function resetAll()\n {\n $this->title = null;\n $this->caption = null;\n $this->categories = null;\n $this->image = null;\n $this->tags = null;\n $this->imagePath = null;\n $this->postId = null;\n }", "private function _clearCache()\n {\n Cache::forget(\"roaddamage-resource:{$this->id}\");\n foreach ($this->getReports() as $report) {\n Cache::forget(\"report-resource:{$report->id}\");\n }\n }", "protected function reset() {}", "public function clearPanic() {\n $this->execute('panic.clear');\n }", "public function clearRespizrImageCache()\n {\n $mediaPath = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA);\n $resizedDirPath = $mediaPath . DS\n . Mage::getSingleton('respizr/config')->getRespizrDirName();\n\n if (is_dir($resizedDirPath)) {\n $io = new Varien_Io_File();\n $io->rmdir($resizedDirPath, true);\n }\n }", "public function reset() : void\n {\n $this->getFilesystemLoader()->reset();\n }", "public function invalidateCache(): void\n {\n $this->cacheExec = [];\n }", "public function cleanFileCache()\n {\n if (is_callable(array('SugarAutoLoader', 'buildCache'))) {\n SugarAutoLoader::buildCache();\n } else {\n // delete dangerous files manually\n @unlink(\"cache/file_map.php\");\n @unlink(\"cache/class_map.php\");\n }\n }", "private function _cleanCache()\n {\n if ($this->cache instanceof \\Zend_Cache_Core) {\n $this->cache->clean();\n $this->addMessage($this->_('Cache cleaned'));\n }\n }", "public function clearCache() {}", "public function clearCache() {}", "public function cleanCaches()\n {\n require_once \"include/MetaDataManager/MetaDataManager.php\";\n\n $this->log(\"Cleaning cache\");\n $this->cleanFileCache();\n $this->cleanDir($this->cacheDir(\"smarty\"));\n $this->cleanDir($this->cacheDir(\"modules\"));\n $this->cleanDir($this->cacheDir(\"jsLanguage\"));\n $this->cleanDir($this->cacheDir(\"Expressions\"));\n $this->cleanDir($this->cacheDir(\"themes\"));\n $this->cleanDir($this->cacheDir(\"include/api\"));\n\n // as far as database schema hasn't been rebuilt yet, it's needed to check\n // if metadata manager is operable\n if (MetaDataManager::isCacheOperable()) {\n MetaDataManager::clearAPICache(true, true);\n } else {\n // otherwise, disable it until the schema has been rebuilt\n MetaDataManager::disableCache();\n }\n\n $this->log(\"Cache cleaned\");\n }", "public function clear_cache(): void;", "public function clearMetas(): void\n {\n $this->metas()->delete();\n }", "public static function clearImages()\n {\n $session = self::getSession();\n unset($session->ids);\n }", "public function clearCache()\n {\n }", "protected function reset()\n {\n $this->lastRequest = null;\n $this->lastResponse = null;\n $this->lastException = null;\n }", "public function reset() {\n $this->values[self::ERR_NO] = null;\n $this->values[self::ERR_MSG] = null;\n $this->values[self::CONTENTS] = array();\n }", "protected function _clearDataCache() {}", "private function resetErrors() {\n $this->errors = array();\n }", "public function clearInternalCache()\n {\n $this->_cached = null;\n }", "protected function invalidateCache()\n {\n Cache::tags($this->getTag())->flush();\n }", "private function reset()\r\n {\r\n $this->last_response = null;\r\n $this->last_request = null;\r\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_INFO] = null;\n }", "function reset_data() {\n\t\t$this->data_layer()->clear();\n\t\t$this->log = null;\n\t\t$this->location = null;\n\t\t$this->tax_location = null;\n\t}", "public function clearFailed()\n {\n $this->getResultsStorage()->clear(ResultsStorageInterface::STATUS_FETCH_FAILED);\n $this->getResultsStorage()->clear(ResultsStorageInterface::STATUS_PARSE_ERROR);\n $this->getLogger()->debug('Cleared \"failed\" and \"not-parsed\" filters');\n }", "public function reset() {\n $this->setEntities([]);\n $this->setLinks([]);\n $this->setMetadata([]);\n $this->setIncludes([]);\n $this->setDynamic();\n $this->setCacheability(new CacheableMetadata());\n }", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public static function clearCapturedErrors() {\n self::$capturedErrors = array();\n }", "public function reset() {\r\n $this->header = [];\r\n $this->cookie = [];\r\n $this->content = NULL;\r\n }", "public static function cleanupCacheIndicators()\n {\n foreach (static::getCacheStateFiles() as $file) {\n if (\\Includes\\Utils\\FileManager::isFile($file) && !\\Includes\\Utils\\FileManager::deleteFile($file)) {\n \\Includes\\ErrorHandler::fireError(\n 'Unable to delete \"' . $file . '\" file. Please correct the permissions'\n );\n }\n }\n\n // \"Step is running\" indicator\n static::cleanupRebuildIndicator();\n }" ]
[ "0.71796775", "0.71544987", "0.6787552", "0.6783337", "0.671859", "0.66466254", "0.6508462", "0.64881015", "0.64715195", "0.64292955", "0.63989615", "0.63916427", "0.6384879", "0.6368545", "0.6348757", "0.6344052", "0.63346267", "0.6331779", "0.63088506", "0.6306654", "0.6296207", "0.6295714", "0.6295714", "0.6295714", "0.62928146", "0.62829894", "0.6281083", "0.6224055", "0.62240064", "0.62202346", "0.62107396", "0.6209578", "0.6187911", "0.61836", "0.6168898", "0.6134582", "0.6134123", "0.61192846", "0.6118439", "0.6118439", "0.6107555", "0.6077236", "0.60554624", "0.6031488", "0.60273755", "0.6021707", "0.6018528", "0.6015542", "0.6012631", "0.6008818", "0.600808", "0.60022867", "0.59977216", "0.59960586", "0.59815264", "0.59700346", "0.59692997", "0.59666526", "0.59659654", "0.59647894", "0.5964732", "0.5964104", "0.59640604", "0.5963976", "0.59628755", "0.5958898", "0.5952747", "0.5950567", "0.59466994", "0.5943932", "0.59373707", "0.59373707", "0.59347355", "0.59330076", "0.5931756", "0.5930972", "0.5926169", "0.59228903", "0.5917112", "0.59100753", "0.5908517", "0.59084225", "0.5906289", "0.5904778", "0.5903318", "0.5899954", "0.5897486", "0.589005", "0.58836615", "0.58836615", "0.58836615", "0.58836615", "0.58836615", "0.58836615", "0.58836615", "0.5883528", "0.5883528", "0.5883528", "0.5877096", "0.58740133", "0.5873348" ]
0.0
-1
Mark this image as failed to load
protected function markFailed($hash, $variant = null, $reason = self::FAILED_UNKNOWN) { $key = $this->getErrorCacheKey($hash, $variant); // Get TTL for error $errorTTLs = $this->config()->get('error_cache_ttl'); $ttl = isset($errorTTLs[$reason]) ? $errorTTLs[$reason] : $errorTTLs[self::FAILED_UNKNOWN]; // Detect increasing waits if (is_string($ttl) && strstr($ttl ?? '', ',')) { $ttl = preg_split('#\s*,\s*#', $ttl ?? ''); } if (is_array($ttl)) { $index = min( $this->getCache()->get($key.'_ttl', -1) + 1, count($ttl ?? []) - 1 ); $this->getCache()->set($key.'_ttl', $index); $ttl = $ttl[$index]; } if (!is_numeric($ttl)) { throw new LogicException("Invalid TTL {$ttl}"); } // Treat 0 as unlimited $ttl = $ttl ? (int)$ttl : null; $this->getCache()->set($key.'_reason', $reason, $ttl); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function markAsFailed();", "protected function markAsFailed()\n {\n $this->view->success = false;\n }", "public function setFailed()\n {\n $this->update(['status' => static::STATUS_FAILED]);\n }", "public function markError()\n {\n $this->setStatus(self::STATE_ERROR);\n }", "public function failed(RequestLoadFeed $event, $exception)\n {\n $event->loader->updateStatus(Loader::FAILED);\n }", "public function setFailed()\n {\n $this->attributes['status'] = 4;\n self::save();\n }", "public function failed();", "public function setFailed()\n {\n $this->attributes['status'] = 'failed';\n self::save();\n }", "public function setFailed()\n {\n $this->attributes['status'] = 'failed';\n self::save();\n }", "public function runFailed();", "public function failed()\n {\n if (Storage::disk('do')->exists($this->fileId)) {\n Storage::disk('do')->delete($this->fileId);\n return event(new BodpodImportFailed($this->user));\n } \n \n }", "public function testImageSkippedWhenUnavailable() {\n\t\t$fullPath = realpath(dirname(__FILE__) . '/gdtest/test_jpg.jpg');\n\t\t$gd = new GDBackend_ImageUnavailable($fullPath);\n\n\t\t/* Ensure no image resource is created if the image is unavailable */\n\t\t$this->assertNull($gd->getImageResource());\n\t}", "public function failed()\n {\n // Do nothing\n }", "public abstract function onFail();", "public function hasFailed();", "function setFailedValidationStatusCode();", "public function _failed($I)\n {\n }", "public function testFailedResample() {\n\t\t$fullPath = realpath(dirname(__FILE__) . '/gdtest/test_jpg.jpg');\n\n\t\ttry {\n\t\t\t$gdFailure = new GDBackend_Failure($fullPath, array('ScaleWidth-failed', 123));\n\t\t\t$this->fail('GDBackend_Failure should throw an exception when setting image resource');\n\t\t} catch (GDBackend_Failure_Exception $e) {\n\t\t\t$gd = new GDBackend($fullPath, array('ScaleWidth', 123));\n\t\t\t$this->assertTrue($gd->failedResample($fullPath, 'ScaleWidth-failed|123'));\n\t\t\t$this->assertFalse($gd->failedResample($fullPath, 'ScaleWidth-not-failed|123'));\n\t\t}\n\t}", "public function failed()\n {\n // Called when the job is failing...\n }", "public function isFailed() {\n return $this->isFailed;\n }", "protected function _checkImage() {\n if ( !is_file ( $this->src ) ) {\n $this->src = $this->default_missing_image; \n }\n $image_path_parts = pathinfo ( $this->src );\n $this->_image_name = $image_path_parts['basename'];\n $this->_thumb_filename = $this->attributes['width'] . 'x' . $this->attributes['height'] . '_' . $this->_image_name;\n $this->_thumb_src = $this->thumbs_dir_path . $this->_thumb_filename;\n if ( is_readable ( $this->_thumb_src ) ) {\n $this->_calculated_width = $this->attributes['width'];\n $this->_calculated_height = $this->attributes['height'];\n $this->src = $this->_thumb_src;\n return 'no_thumb_required';\n }\n if ( !$this->_original_image_info = getimagesize ( $this->src ) ) {\n return 'abort';\n } \n if (!in_array ( $this->_original_image_info['mime'], $this->_valid_mime ) ) {\n return 'abort';\n }\n }", "public function testBadLoaderDefined() {\n $this->expectException('\\\\Phloem\\\\Exception\\\\LoaderException');\n\n $this->factory->setLoader('bad', true);\n $this->factory->getLoader('filename.bad');\n }", "public function updateFailed();", "public function showFailed();", "function chkFailed() {\n\t\treturn $this->failed;\n\t}", "protected function processingFailed(Media $media)\n {\n $media->setCustomProperty('status', 'failed')->save();\n }", "protected function _checkImage() {\n if ( !is_file ( $this->src ) ) {\n $this->src = $this->default_missing_image; \n }\n $image_path_parts = pathinfo ( $this->src );\n $this->_image_name = $image_path_parts['basename'];\n $this->_thumb_filename = $this->attributes['width'] . 'x' . $this->attributes['height'] . '_' . $this->_image_name;\n $this->_thumb_src = $this->thumbs_dir_path . $this->_thumb_filename;\n if ( is_readable ( $this->_thumb_src ) ) {\n $this->_calculated_width = $this->attributes['width'];\n $this->_calculated_height = $this->attributes['height'];\n $this->src = $this->_thumb_src;\n return 'no_thumb_required';\n }\n if ( KISSIT_MAIN_PRODUCT_WATERMARK_SIZE == 0 ) {\n \tif ( !$this->_original_image_info = getimagesize ( $this->src ) ) {\n \t\treturn 'abort';\n \t} \n \tif (!in_array ( $this->_original_image_info['mime'], $this->_valid_mime ) ) {\n \t\treturn 'abort';\n \t}\n }\n }", "public function testSourceErrors()\n {\n $Image = new \\Rundiz\\Image\\Drivers\\Gd(self::$source_images_dir . 'city-amsterdam.jpg');\n $this->assertTrue($Image->status);\n // now errors.\n $Image = new \\Rundiz\\Image\\Drivers\\Gd(self::$source_images_dir . 'city-amsterdam-text.jpg');\n $this->assertFalse($Image->status);\n $this->assertSame(\\Rundiz\\Image\\Drivers\\Gd::RDIERROR_SRC_NOTIMAGE, $Image->statusCode);\n $Image = new \\Rundiz\\Image\\Drivers\\Gd(self::$source_images_dir . 'image-not-exists' . date('YmdHis') . '.jpg');\n $this->assertFalse($Image->status);\n $this->assertSame(\\Rundiz\\Image\\Drivers\\Gd::RDIERROR_SRC_NOTEXISTS, $Image->statusCode);\n }", "public function setFailonerror($value)\n {\n $this->failonerror = $value;\n }", "public function validateFailedURL() {\r\n return $this->validateResultURL(self::FAILED_STATUS);\r\n }", "protected function setErrorsExist() {}", "function paintFail($message) {\r\n $this->_scorer->paintFail($message);\r\n }", "public function isFailed()\r\n {\r\n return $this->status < 0;\r\n }", "public static function failed()\n\t{\n\t\treturn Request::$failed;\n\t}", "public static function loadingFailureMessage($message = null) {\n \n self::customContentMessage(\n \"Loading failure\",\n ($message ? $message : null) ?? \"The targetted item could not be found.\",\n \"error\"\n );\n \n }", "public function isFailedPermanently()\n\t{\n\t\treturn $this->failedPermanently;\n\t}", "public function test_missing_image_file() {\n\t\t$out = wp_read_image_metadata( DIR_TESTDATA . '/images/404_image.png' );\n\t\t$this->assertFalse( $out );\n\t}", "public function isFailed()\n {\n return $this->result == self::RESULT_FAILED;\n }", "public function setStorageCheckFailedPercentage($val)\n {\n $this->_propDict[\"storageCheckFailedPercentage\"] = floatval($val);\n return $this;\n }", "public function failed()\n {\n return false;\n }", "public function testImageCandidateFactoryWithInvalidFile()\n {\n ImageCandidateFactory::createImageCandidateFromFileAndDescriptor('');\n }", "public function didFail()\n {\n return (bool) ($this->status & static::DID_FAIL);\n }", "public function testGetInvalidImageByImagePath() {\n\t\t//grab an image by searching for content that does not exist\n\t\t$image = Image::getImageByImagePath($this->getPDO(), \"this image is not found\");\n\t\t$this->assertCount(0, $image);\n\t}", "private function checkImage()\n\t{\n\t\tif (!$this->imageResized) {\n\t\t\t$this->resize($this->width, $this->height);\n\t\t}\n\t}", "public function generateFailed();", "public function isFailed()\n {\n return $this->getResult() == self::RESULT_FAILED;\n }", "public function fails();", "public function fails();", "function setFailMsg($msg) { $this->_failMsg = $msg; }", "public function errorOccured();", "public function wasErrorReissuable() {\n\t\treturn false;\n\t}", "public function setProcessor64BitCheckFailedPercentage($val)\n {\n $this->_propDict[\"processor64BitCheckFailedPercentage\"] = floatval($val);\n return $this;\n }", "function internalError() {\n\t\t$this->status = $this->STATUS_INTERNAL_ERROR;\n\t\t$this->noCache();\n\t}", "function _setFailed($dsn) {\n\t\tunset($this->_masters[array_search($dsn, $this->_masters)]);\n\t\tunset($this->_slaves[array_search($dsn, $this->_slaves)]);\n\t}", "protected function setErrorClassAttribute() {}", "public static function failed(): self\n {\n return self::getInstance('FAILED');\n }", "public function testImageCandidateFactoryWithInvalidDescriptor()\n {\n ImageCandidateFactory::createImageCandidateFromFileAndDescriptor('image.jpg', '124abc');\n }", "function set_valid_image_data() {\n $base_image = $this->get_config('base_image', false);\n if ($base_image !== false) {\n // Definitely configured\n if ($base_image == '0') {\n // Configured to text-only\n $this->image_name = $base_image;\n } else {\n $imagesize = serendipity_getimagesize(dirname(__FILE__) . \"/img/\" . $base_image);\n if ($imagesize['noimage']) {\n // Leave as default\n } else {\n // Set to valid image name\n $this->image_name = $base_image;\n }\n }\n }\n // Is the (possibly default) image valid?\n if ($this->image_name) {\n $imagesize = serendipity_getimagesize(dirname(__FILE__) . \"/img/\" . $this->image_name);\n if (isset($imagesize['noimage']) && $imagesize['noimage']) {\n // No valid image; use text-only\n $this->image_name = '0';\n } else {\n // Valid graphical image; set the dimensions, too\n $this->image_width = $imagesize[0];\n $this->image_height = $imagesize[1];\n }\n }\n }", "function OnAfterError(){\n }", "public function isFailed()\n {\n return static::STATUS_FAILED == $this->getStatus();\n }", "public function setError($err);", "public function test_image_non_existent_extension() {\n\t\t$image_editor = new WP_Image_Editor_Imagick( DIR_TESTDATA . '/images/test-image-no-extension' );\n\t\t$result = $image_editor->load();\n\n\t\t$this->assertTrue( $result );\n\t}", "private static function load_error($path) {\n $error_code = $path[0];\n unset($path[\"path\"]);\n unset($path[0]);\n Loader::error($error_code, array_values($path));\n }", "public function validationHasFailed() {}", "public function handleRenderingFailureEvent(object $message): void;", "public function questionLoadingFailed()\r\n {\r\n return (!isset($this->questionInfo->items));\r\n }", "public function actionError() {\n//\t\t$this->layout = false;\n\t\tif ($error = Yii::app()->errorHandler->error) {\n\n\t\t\t//handling default image for speakers, presentations, etc\n\t\t\tif ($error['code'] == 404 && strpos($error['message'], '.jpg\"') !== false) {\n\t\t\t\tpreg_match('/\".*\"/', $error['message'], $path);\n\t\t\t\t$path = substr($path[0], 1, -1);\n\t\t\t\t$asked_img = Yii::app()->getBasePath(true).'/../'.$path;\n\t\t\t\t$is_thumb = strpos($path, '.thumb.') !== false;\n\t\t\t\t$default_img = Yii::app()->getBasePath(true).'/../'.dirname($path).'/default'.($is_thumb? '.thumb':'').'.jpg';\n\t\t\t\tif (!file_exists($asked_img) && file_exists($default_img)) {\n\t\t\t\t\theader('Content-type: image/jpeg');\n\t\t\t\t\theader('HTTP/1.0 200 OK');\n\t\t\t\t\techo file_get_contents($default_img);\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (Yii::app()->request->isAjaxRequest)\n\t\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t\t$this->render('error', $error);\n\t\t}\n\t}", "public function isErronous()\n\t{\n\t\treturn $this->is_erronous;\n\t}", "public function failed( $e ) {\n\t}", "public function failure(){\n\t}", "public function fileisinvalid($request,$addeditid=0)\n {\n \n \n //**** image code starts\n \n \n $allowedFileExtAr=array();\n $allowedFileExtAr[]=\"jpg\";\n $allowedFileExtAr[]=\"jpeg\";\n $allowedFileExtAr[]=\"png\";\n \n $filecontrolname=\"image_name\";\n \n \n\t\t\t\t$allowedFileExtSizeAr=array();\n $allowedFileExtSizeAr['jpg']=(5*1024*1024);\n\t\t\t\t$allowedFileExtSizeAr['jpeg']=(5*1024*1024);\n $allowedFileExtSizeAr['png']=(5*1024*1024);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//max_width & max_height ,min_width & min_height,equal_width & equal_height \n\t\t\t\t$allowedFileResolAr=array();\n\t\t\t\t\n\t\t\t\t$allowedFileResolAr['jpeg']=array('min_width'=>537,'min_height'=>507);\n\t\t\t\t$allowedFileResolAr['jpg']=array('min_width'=>537,'min_height'=>507);\n $allowedFileResolAr['png']=array('min_width'=>537,'min_height'=>507);\n $func=\"validatefile\";//validatefile/uploadfile\n \n \n $destinationsourcePath=public_path().\"/upload/venueimage/source-file/\"; \n $chkimgresp=Imageuploadlib::imageupload($request,$filecontrolname,$allowedFileExtAr,$allowedFileExtSizeAr,$allowedFileResolAr,$func,$addeditid,$destinationsourcePath,$errfileAr=array()) ;\n \n \n \n \n \n /* echo \"==chkimg1==><pre>\";\n print_r($chkimgresp);\n echo \"</pre>\"; */ //exit();\n \n \n $invalidresp=false;\n \n $errormsgs=''; $fileuploadednames=array(); $errfileAr=array();\n $totalfileposted=0;\n \n if(!empty($chkimgresp))\n {\n \n \n if(array_key_exists('errormsgs',$chkimgresp))\n {\n $errormsgs=$chkimgresp['errormsgs'];\n }\n \n if(array_key_exists('errfileAr',$chkimgresp))\n {\n $errfileAr=$chkimgresp['errfileAr'];\n }\n \n if(array_key_exists('totalfileposted',$chkimgresp))\n {\n $totalfileposted=$chkimgresp['totalfileposted'];\n }\n \n }\n \n $resparray=array();\n $resparray['errormsgs']=$errormsgs;\n $resparray['errfileAr']=$errfileAr;\n $resparray['totalfileposted']=$totalfileposted;\n \n return $resparray;\n }", "public function testErrorIsThrownIfURLIsInvalid()\n {\n self::$importer->get('invalid-google-url', now()->subYear(), now()->addYear());\n }", "public function failed()\n {\n $msg = self::class;\n $msg .= ' - Código: '.$this->$code;\n\n app('LogExtract')->error($msg);\n }", "public function failed($error) {\n $this->setError($error);\n $this->setFinishedAt(null);\n $this->setScheduled(false);\n $this->save();\n }", "function wp_img_tag_add_loading_attr($image, $context)\n {\n }", "public function setProcessorSpeedCheckFailedPercentage($val)\n {\n $this->_propDict[\"processorSpeedCheckFailedPercentage\"] = floatval($val);\n return $this;\n }", "public function getLPFailed();", "private function checkError($file) \n {\n return $this->imageConstraint->checkError($file);\n }", "public function updateStatusFailed($errorMessage = null)\n {\n $this->resetStatuses();\n if (!$errorMessage) {\n $this->pubDirectory->touch($this->getRelativeFilePath(self::IMPORT_STATUS_FAILED));\n } else {\n $this->pubDirectory->writeFile($this->getRelativeFilePath(self::IMPORT_STATUS_FAILED), $errorMessage);\n }\n }", "public function getFailed(): int\n {\n return $this->failed;\n }", "private function checkFailure() : void\n {\n $failure = (int) $this->session->get('failure', 0);\n $time = (int) $this->session->get('failure_time', time());\n if ($failure >= static::FAILURE) {\n if ($time >= time()) {\n throw new \\DomainException($this->i18n->t(\n 'setrun/user',\n 'Form is blocked for {min} minutes',\n ['min' => static::FAILURE_TIME / 60])\n );\n }\n $this->removeFailure();\n }\n }", "public function failed(\\Throwable $throwable)\n {\n $this->downloadLog->update(['status' => 3, 'error_message' => $throwable->getMessage()]);\n }", "public function testUpdateUnsuccessfulReason()\n {\n }", "public function setProcessorFamilyCheckFailedPercentage($val)\n {\n $this->_propDict[\"processorFamilyCheckFailedPercentage\"] = floatval($val);\n return $this;\n }", "public function isStatusFailed()\n\t{\n\t\treturn $this->status == self::STATUS_FAILED;\n\t}", "function HasFailedTrans() {}", "public function has_failed()\n {\n return !$this->success;\n }", "public static function invalidMarkerIconUrl()\n {\n return new static('A marker image icon must have an url.');\n }", "private function saveFailedMeasurement($res, $json) {\n $c = $this->cache();\n $c->rpush($this->mkeyFail, $json);\n }", "function failed()\n\t{\n\t\treturn $this->isReady() && !$this->isSuccess();\n\t}", "public function failed($e)\n {\n // if instagram closes the connect,\n // we silently fail and attempt to crawl instagram again.\n if (\n strpos($e->getMessage(), 'cURL error 18') !== false ||\n strpos($e->getMessage(), 'cURL error 56') !== false)\n {\n $this->record->instagram_updated_at = null;\n $this->record->save();\n }\n else\n {\n $this->record->instagram_update_disabled_at = Carbon::now();\n $this->record->save();\n }\n }", "public function getFailureReason();", "function paintFail($message) {\n parent::paintFail($message);\n\t\t\t\t\t\t$breadcrumb = $this->getTestList();\n\t\t\t\t\t\tarray_shift($breadcrumb);\n\t\t\t\t\t\t\n\t\t\t\t\t\tprint \"<div><span class=\\\"red\\\">Fail:</span> <strong>\";\n\t\t\t\t\t\tprint implode(\" -&gt; \", $breadcrumb);\n\t\t\t\t\t\tprint \" </strong><br />\\n<span class=\\\"fail\\\">\" . $this->_htmlEntities($message) . \"</span></div>\\n\";\n\t\t\t\t}", "public function testCacheIntegrity() {\n\t\t$fullPath = realpath(dirname(__FILE__) . '/gdtest/test_jpg.jpg');\n\n\t\ttry {\n\t\t\t$gdFailure = new GDBackend_Failure($fullPath, array('ScaleWidth', 123));\n\t\t\t$this->fail('GDBackend_Failure should throw an exception when setting image resource');\n\t\t} catch (GDBackend_Failure_Exception $e) {\n\t\t\t$cache = SS_Cache::factory('GDBackend_Manipulations');\n\t\t\t$key = md5(implode('_', array($fullPath, filemtime($fullPath))));\n\n\t\t\t$data = unserialize($cache->load($key));\n\n\t\t\t$this->assertArrayHasKey('ScaleWidth|123', $data);\n\t\t\t$this->assertTrue($data['ScaleWidth|123']);\n\t\t}\n\t}", "public function setTpmCheckFailedPercentage($val)\n {\n $this->_propDict[\"tpmCheckFailedPercentage\"] = floatval($val);\n return $this;\n }", "public function testInsertInvalidImage() {\n\t\t//create an Image with a non null ImageId and watch it fail\n\t\t$image = new Image(DevConnectTest::INVALID_KEY, $this->VALID_IMAGEPATH, $this->VALID_IMAGETYPE);\n\t\t$image->insert($this->getPDO());\n\t}", "public function getStorageCheckFailedPercentage()\n {\n if (array_key_exists(\"storageCheckFailedPercentage\", $this->_propDict)) {\n return $this->_propDict[\"storageCheckFailedPercentage\"];\n } else {\n return null;\n }\n }", "public function failed()\n {\n return $this->model->failed()->get();\n }", "public static function invalidMarkeImageUrl()\n {\n return new static('The url of a maker image must be a string value.');\n }", "public function uptimeCheckFailed(string $reason): void\n {\n parent::uptimeCheckFailed($reason);\n\n if (!$this->shouldFireUptimeCheckFailedEvent()) {\n event(new IncrementUptimeCount($this));\n }\n }", "public function testSetAllowedExtensionsFail() {\n $dl2 = new downloader();\n $dl2->setAllowedExtensions(array('jpg' => 'image/jpeg',\n 'pl' => 'application/x-perl'));\n $this->assertTrue($dl2->areErrors());\n\n // one invalid extension will invalidate the entire list\n $this->assertFalse($dl2->checkExtension('jpg'));\n $this->assertFalse($dl2->checkExtension('jpeg'));\n $this->assertFalse($dl2->checkExtension('pl'));\n }" ]
[ "0.72546685", "0.6515678", "0.6252314", "0.60602546", "0.6017387", "0.59708804", "0.59174836", "0.5904026", "0.5904026", "0.5895635", "0.58673996", "0.57675785", "0.5737397", "0.5722287", "0.57211345", "0.57153195", "0.5667451", "0.5649304", "0.56259716", "0.5565741", "0.5535562", "0.54964775", "0.54739106", "0.54643744", "0.5455622", "0.5451452", "0.5442606", "0.5411741", "0.53986734", "0.5392232", "0.53856766", "0.5383741", "0.5339785", "0.53205025", "0.5301799", "0.5283", "0.5274708", "0.52741253", "0.5272495", "0.5268172", "0.52214134", "0.5215447", "0.52057457", "0.5198224", "0.51817435", "0.51803404", "0.5179565", "0.5179565", "0.5169824", "0.5168738", "0.5149043", "0.51478016", "0.511501", "0.50905883", "0.50870484", "0.50791186", "0.50458556", "0.5039836", "0.50395405", "0.50389713", "0.5030358", "0.5018383", "0.5015154", "0.4999573", "0.49903408", "0.4989523", "0.49656853", "0.4965528", "0.49615937", "0.49553704", "0.49460572", "0.4942936", "0.49323708", "0.49305168", "0.49259952", "0.4920105", "0.49183673", "0.49173692", "0.48908833", "0.48848876", "0.48789564", "0.4872118", "0.48560768", "0.4850422", "0.48281458", "0.48248166", "0.48238492", "0.482136", "0.48198834", "0.4816009", "0.48083168", "0.48068842", "0.48006597", "0.4799611", "0.47896495", "0.47704682", "0.4769587", "0.4759698", "0.47541395", "0.4749504", "0.4748055" ]
0.0
-1
Determine reason this file could not be loaded. Will return one of the FAILED_ constant values, or null if not failed
protected function hasFailed($hash, $variant = null) { $key = $this->getErrorCacheKey($hash, $variant); return $this->getCache()->get($key.'_reason', null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function checkForErrors(){\n if(!ModuleLoader::moduleIsLoaded($this->module)) $this->throwError('TemplateLoader01', 'Module '.$this->module.' either does not exist, or has not been installed in this theme');\n\n return null;\n }", "public function getFailureReason();", "public function getFailedMessage()\n {\n if (array_key_exists(\"failedMessage\", $this->_propDict)) {\n return $this->_propDict[\"failedMessage\"];\n } else {\n return null;\n }\n }", "public static function failed(): self\n {\n return self::getInstance('FAILED');\n }", "public function getFailReason()\n {\n return $this->get(self::_FAIL_REASON);\n }", "public static function failed()\n\t{\n\t\treturn Request::$failed;\n\t}", "public function getTpmCheckFailedPercentage()\n {\n if (array_key_exists(\"tpmCheckFailedPercentage\", $this->_propDict)) {\n return $this->_propDict[\"tpmCheckFailedPercentage\"];\n } else {\n return null;\n }\n }", "public function getOsCheckFailedPercentage()\n {\n if (array_key_exists(\"osCheckFailedPercentage\", $this->_propDict)) {\n return $this->_propDict[\"osCheckFailedPercentage\"];\n } else {\n return null;\n }\n }", "public function testBadLoaderDefined() {\n $this->expectException('\\\\Phloem\\\\Exception\\\\LoaderException');\n\n $this->factory->setLoader('bad', true);\n $this->factory->getLoader('filename.bad');\n }", "public function getLPFailed();", "public function failError()\n {\n if (\n ($packet = $this->getPacket()) and\n $packet['status'] !== Job::STATUS_FAILED and\n ($e = json_decode($packet['exception'], true))\n ) {\n return empty($e['error']) ? var_export($e, true) : $e['error'];\n }\n\n return 'Unknown exception';\n }", "public function getStorageCheckFailedPercentage()\n {\n if (array_key_exists(\"storageCheckFailedPercentage\", $this->_propDict)) {\n return $this->_propDict[\"storageCheckFailedPercentage\"];\n } else {\n return null;\n }\n }", "public static function getInvalidFile()\n {\n return 'some/non/existing/file.txt';\n }", "public function getBattleCheckFail()\n {\n return $this->get(self::_BATTLE_CHECK_FAIL);\n }", "public function getProcessorSpeedCheckFailedPercentage()\n {\n if (array_key_exists(\"processorSpeedCheckFailedPercentage\", $this->_propDict)) {\n return $this->_propDict[\"processorSpeedCheckFailedPercentage\"];\n } else {\n return null;\n }\n }", "public static function loadingFailureMessage($message = null) {\n \n self::customContentMessage(\n \"Loading failure\",\n ($message ? $message : null) ?? \"The targetted item could not be found.\",\n \"error\"\n );\n \n }", "public function getSecureBootCheckFailedPercentage()\n {\n if (array_key_exists(\"secureBootCheckFailedPercentage\", $this->_propDict)) {\n return $this->_propDict[\"secureBootCheckFailedPercentage\"];\n } else {\n return null;\n }\n }", "public function getFailureReason()\n {\n return $this->failure_reason;\n }", "public static function getInvalidFile(): string\n {\n return \"some/non/existing/file.txt\";\n }", "public static function fileDoesNotExist()\n {\n return self::logicalNot(self::fileExists());\n }", "public function getProcessorFamilyCheckFailedPercentage()\n {\n if (array_key_exists(\"processorFamilyCheckFailedPercentage\", $this->_propDict)) {\n return $this->_propDict[\"processorFamilyCheckFailedPercentage\"];\n } else {\n return null;\n }\n }", "public static function failing_files() {\n\t\t$directory = __DIR__ . '/fixtures/fail';\n\n\t\treturn static::get_files_from_dir( $directory );\n\t}", "public function getError() {\r\n\t\t\t $strError = false;\r\n\t\t\t if ($this->objParent->error) {\r\n\t\t\t\t switch ((int) $this->objParent->error) {\r\n\t\t\t\t\tcase self::ERROR_SOURCE_FILE_NOT_FOUND : \t\t{ $strError=\"Source file could not be found.\"; \tbreak; }\r\n\t\t\t\t\tcase self::ERROR_SOURCE_FILE_NOT_READABLE : \t{ $strError=\"Source file is not readable.\"; \tbreak; }\r\n\t\t\t\t\tcase self::ERROR_CANT_WRITE_TARGET_FILE : \t\t{ $strError=\"Could not write target file.\"; \tbreak; }\r\n\t\t\t\t\tcase self::ERROR_UNSUPPORTED_SOURCE_FORMAT : \t{ $strError=\"Unsupported source file format.\"; \tbreak; }\r\n\t\t\t\t\tcase self::ERROR_UNSUPPORTED_TARGET_FORMAT : \t{ $strError=\"Unsupported target file format.\"; \tbreak; }\r\n\t\t\t\t\tcase self::ERROR_UNSUPPORTED_GDLIB_VERSION : \t{ $strError=\"GD library version does not support target file format.\"; break; }\r\n\t\t\t\t\tcase self::ERROR_GDLIB_NOT_FOUND : \t\t\t\t{ $strError=\"GD library is not installed!\"; \tbreak; }\r\n\t\t\t\t\tdefault: {}\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t return ($strError);\r\n\t\t }", "public function getRamCheckFailedPercentage()\n {\n if (array_key_exists(\"ramCheckFailedPercentage\", $this->_propDict)) {\n return $this->_propDict[\"ramCheckFailedPercentage\"];\n } else {\n return null;\n }\n }", "function get_error()\n\t{\n\t\t$errorfile = @fopen($this->srfile, 'r');\n\n\t\t// read status file\n\t\tif (!$errorfile)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile (false === feof($errorfile))\n\t\t\t{\n\t\t\t\t$errorcodes .= fread($errorfile, 1024);\n\t\t\t}\n\n\t\t\tfclose($errorfile);\n\t\t}\n\n\t\tif ($errorcodes)\n\t\t{\n\t\t\tif ($this->engine->db->gpg_debug)\n\t\t\t{\n\t\t\t\treturn nl2br(\"WackoWiki-GPG terminated, error output follows:\\n------\\n\" .\n\t\t\t\tstr_replace(\"\\r\", '', $errorcodes));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn GPG_GENERAL_ERROR;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function failed();", "public function testNoLoaderDefined() {\n $this->expectException('\\\\Phloem\\\\Exception\\\\LoaderException');\n\n $this->factory->getLoader('filename.unknown');\n }", "public function wrongTypeFile()\n {\n return 'This type of file is not allowed';\n }", "public function getFailed(): int\n {\n return $this->failed;\n }", "public static function FAILURE()\n {\n return self::getInstance(__METHOD__);\n }", "public static function getDefaultFailureCodes()\r\r\n {\r\r\n return static::$defaultErrorCodes;\r\r\n }", "public function getProcessor64BitCheckFailedPercentage()\n {\n if (array_key_exists(\"processor64BitCheckFailedPercentage\", $this->_propDict)) {\n return $this->_propDict[\"processor64BitCheckFailedPercentage\"];\n } else {\n return null;\n }\n }", "public static function failing_files() : array {\n\t\t$directory = dirname( __DIR__ ) . '/fixtures/ruleset/Lipe/fail';\n\n\t\treturn static::get_files_from_dir( $directory );\n\t}", "public function failedAssertions(/* ... */)\n {\n return $this->_assertionFail;\n }", "public function getFailedTasksCount()\n {\n if (array_key_exists(\"failedTasksCount\", $this->_propDict)) {\n return $this->_propDict[\"failedTasksCount\"];\n } else {\n return null;\n }\n }", "public function testFileNotFoundException ()\n {\n $this->tran->loadFile(2);\n $this->tran->loadFile();\n $this->tran->loadFile(true);\n $this->tran->loadFile('asd');\n }", "public function getFailedReasonMessage(){\n $failedReasonMessages = self::getFailedReasonMessages();\n if(isset($failedReasonMessages[$this->failedReason])){\n return $failedReasonMessages[$this->failedReason];\n }else {\n return $this->failedReason;\n }\n }", "public function getErrorMessage() {\n $message = \"File uploaded without errors\";\n $errCode = $this->getErrorCode();\n if ( $errCode == UPLOAD_ERR_OK ) {\n $message = \"File uploaded without errors\";\n } elseif ( $errCode == UPLOAD_ERR_INI_SIZE ) {\n $message = \"File size exceeds the max file size defined in php.ini \";\n } elseif ( $errCode == UPLOAD_ERR_FORM_SIZE ) {\n $message = \"File size exceeds the MAX_FILE_SIZE defined in form\";\n } elseif ( $errCode == UPLOAD_ERR_PARTIAL ) {\n $message = \"The file was partially uploaded\";\n } elseif ( $errCode == UPLOAD_ERR_NO_FILE ) {\n $message = \"No file was uploaded, you probably clicked upload without pointing to a file first\";\n } elseif ( $errCode == UPLOAD_ERR_NO_TMP_DIR ) {\n $message = \"Missing a temp directory. Check if php.ini defines an upload_tmp_dir\";\n } elseif ( $errCode == UPLOAD_ERR_CANT_WRITE ) {\n $message = \"PHP was unable to write file to disk. Check destination folder's file permissions. You should enable read & write.\";\n } elseif ( $errCode == UPLOAD_ERR_EXTENSION ) {\n $message = \"A PHP extension stopped the file upload. It's probably time to consult google and the php forums...\";\n } elseif ( $errCode == self::$TYPE_ERROR ) {\n $message = \"The supplied filetype is not accepted for upload\";\n }\n return $message;\n }", "public function validateFailedURL() {\r\n return $this->validateResultURL(self::FAILED_STATUS);\r\n }", "public function getLastError()\n {\n return 0;\n }", "public function getProcessorCoreCountCheckFailedPercentage()\n {\n if (array_key_exists(\"processorCoreCountCheckFailedPercentage\", $this->_propDict)) {\n return $this->_propDict[\"processorCoreCountCheckFailedPercentage\"];\n } else {\n return null;\n }\n }", "function chkFailed() {\n\t\treturn $this->failed;\n\t}", "public function getErrMsg() {\n $errMsg = 'Error on line ' . $this->getLine() . ' in ' . $this->getFile()\n . '<br><b>Message: ' . $this->getMessage()\n . '</b><br>Exception Type: NoFormsFoundException';\n return $errMsg;\n }", "public static function missing() {\n\t\t// -- Construct the 404 error template path\n\t\t$file = APP_ROOT . 'errors' . DS . Error::$not_found . EXT_PHP;\n\n\t\t// -- Check if the 404 error template exists. \n\t\t// -- If it does, require it to the screen. \n\t\t// -- Otherwise, display a simple text message.\n\t\tif( file_exists( $file ) ) {\n\t\t\trequire_once $file;\n\t\t} else {\n\t\t\techo Error::$not_found . ' : Internal Error!';\n\t\t}\n\n\t\texit;\n\t}", "public function message()\n {\n return \"File not found!\";\n }", "public function testLoadingInvalidLanguageFileThrowsException()\n {\n $this->expectException(\\Sparta\\Exceptions\\LanguageFileNotFound::class);\n $this->translator->setLocale('FakeFileLanguageCode');\n $this->translator->load();\n }", "protected function getFailMessage(): ?array\n {\n return $this->failMessage;\n }", "public function getError()\r\n\t{\r\n\t\treturn $this->root->getAttribute('liberr');\r\n\t}", "public function getValidationFailed()\n {\n if (is_null($this->ValidationFailed)) {\n /** @psalm-var ?float $data */\n $data = $this->raw(self::FIELD_VALIDATION_FAILED);\n if (is_null($data)) {\n return null;\n }\n $this->ValidationFailed = (float) $data;\n }\n\n return $this->ValidationFailed;\n }", "public function getItemReasonForFailure()\n {\n return $this->itemReasonForFailure;\n }", "public function failed()\n {\n if (Storage::disk('do')->exists($this->fileId)) {\n Storage::disk('do')->delete($this->fileId);\n return event(new BodpodImportFailed($this->user));\n } \n \n }", "public function getLastError();", "public function hasFailed();", "public function testFailure()\n {\n $this->assertFileExists('/home/albert/PhpstormProjects/is601b');\n }", "public function getErrorMessage() : ?string\n {\n if ($this->isSuccessful())\n {\n return null;\n }\n \n if ($this->httpResponse)\n {\n return $this->httpResponse->getReasonPhrase();\n }\n\n return null;\n }", "abstract public function getLastError();", "abstract public function getLastError();", "protected function getLastError() {}", "public function getFailedSubtask()\n {\n return $this->get(self::FAILED_SUBTASK);\n }", "public function failed()\n {\n return $this->model->failed()->get();\n }", "public function getNotFoundScriptPath()\n {\n if (isset($this->raw->{'not-found'})) {\n return $this->raw->{'not-found'};\n }\n\n return null;\n }", "public function getError()\n {\n return $this->fileInfo['error'];\n }", "public function getFailedScenarios();", "public function getLastError() {}", "function testPathNotFoundMovie() {\n try {\n $v = $this->loadMovie(\"path_that_doesnt_exist/movie.mp4\");\n //this assert should never be called\n $this->assertTrue(false);\n } catch (Exception $e) {\n $this->assertTrue(true);\n }\n }", "public function isFailed() {\n return $this->isFailed;\n }", "function getErrorString()\r\n\t{\r\n\t\tswitch( $this->error ) {\r\n\t\tcase UPLOAD_ERR_INI_SIZE: return \"The uploaded file exceeds the upload_max_filesize directive in php.ini\";\r\n\t\tcase UPLOAD_ERR_FORM_SIZE: return \"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.\";\r\n\t\tcase UPLOAD_ERR_PARTIAL: return \"The uploaded file was only partially uploaded.\";\r\n\t\tcase UPLOAD_ERR_NO_FILE: return \"No file was uploaded.\";\r\n\t\tcase UPLOAD_ERR_NO_TMP_DIR: return \"Missing a temporary folder. Introduced in PHP 4.3.10 and PHP 5.0.3.\";\r\n\t\tcase UPLOAD_ERR_CANT_WRITE: return \"Failed to write file to disk. Introduced in PHP 5.1.0.\";\r\n\t\tcase UPLOAD_ERR_EXTENSION: return \"File upload stopped by extension. Introduced in PHP 5.2.0.\";\r\n\t\t}\r\n\t\treturn \"Success\";\r\n\t}", "protected function initMessage(): ?string\n {\n return 'entity.validation_failed';\n }", "private function get_failed_rows() {\n\t\treturn $this->failed_rows;\n\t}", "public function testInvalidFileException() {\n\t\t$this->expectException('/Could not read file/');\n\t\tFixture::load('Foobar');\n\t}", "public function return_failed_tests()\n\t {\n\t\treturn $this->failed_tests;\n\t }", "public function fails();", "public function fails();", "public function isFailed()\n {\n return $this->result == self::RESULT_FAILED;\n }", "public function getFailedTasks(): ?int {\n $val = $this->getBackingStore()->get('failedTasks');\n if (is_null($val) || is_int($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'failedTasks'\");\n }", "public function getErrorMessage(): string\n {\n static $errors = [\n UPLOAD_ERR_OK => 'No error found.',\n UPLOAD_ERR_INI_SIZE => 'The file \"%s\" exceeds your upload_max_filesize ini directive (limit is %d kb).',\n UPLOAD_ERR_FORM_SIZE => 'The file \"%s\" exceeds the upload limit defined in your form.',\n UPLOAD_ERR_PARTIAL => 'The file \"%s\" was only partially uploaded.',\n UPLOAD_ERR_NO_FILE => 'No file was uploaded.',\n UPLOAD_ERR_CANT_WRITE => 'The file \"%s\" could not be written on disk.',\n UPLOAD_ERR_NO_TMP_DIR => 'File could not be uploaded: missing temporary directory.',\n UPLOAD_ERR_EXTENSION => 'File upload was stopped by a PHP extension.',\n ];\n\n $errorCode = $this->error;\n $maxFilesize = $errorCode === UPLOAD_ERR_INI_SIZE ? self::getMaxFilesize() / 1024 : 0;\n $message = $errors[$errorCode] ?? 'The file \"%s\" was not uploaded due to an unknown error.';\n\n return sprintf($message, $this->getOriginalName(), $maxFilesize);\n }", "public function getError()\r\n {\r\n if (isset($this->response['faultString'])) {\r\n return $this->response['faultString'];\r\n } elseif (isset($this->response['errmsg'])) {\r\n return $this->response['errmsg'];\r\n }\r\n return null;\r\n }", "public function test_mod_lti_create_tool_type_bad_file() {\n $this->expectException('moodle_exception');\n $type = mod_lti_external::create_tool_type($this->getExternalTestFileUrl('/rsstest.xml'), '', '');\n }", "private function getInitialErrors()\n\t{\n\t\t$errors = [];\n\n\t\t// Make sure our file doesn't exist (unless we're appending)\n\t\tif(file_exists($this->config['file']) && ! $this->append)\n\t\t{\n\t\t\t$errors[] = 'File exists';\n\t\t}\n\n\t\t// Create our file\n\t\tif( ! touch($this->config['file']))\n\t\t{\n\t\t\t$errors[] = 'Could not create file';\n\t\t}\n\n\t\t// Make sure we can write to our file\n\t\tif( ! is_writable($this->config['file']))\n\t\t{\n\t\t\t$errors[] = 'Cannot write to file';\n\t\t}\n\n\t\treturn empty($errors) ? false : $errors;\n\t}", "public function getExportFailureNewStatus()\n {\n $status = $this->getDefaultStatusForState(LocalOrder::STATE_HOLDED);\n if ($this->getConfigValue(self::XML_PATH . 'order/failure_export_status')) {\n $status = $this->getConfigValue(self::XML_PATH . 'order/failure_export_status');\n }\n return strtolower($status);\n }", "protected function detectMissingFiles() {}", "public function getStatus() {\n if (!isset($_FILES[$this->_file])) {\n return false;\n }\n \n return $_FILES[$this->_file]['error'];\n }", "public function testSourceErrors()\n {\n $Image = new \\Rundiz\\Image\\Drivers\\Gd(self::$source_images_dir . 'city-amsterdam.jpg');\n $this->assertTrue($Image->status);\n // now errors.\n $Image = new \\Rundiz\\Image\\Drivers\\Gd(self::$source_images_dir . 'city-amsterdam-text.jpg');\n $this->assertFalse($Image->status);\n $this->assertSame(\\Rundiz\\Image\\Drivers\\Gd::RDIERROR_SRC_NOTIMAGE, $Image->statusCode);\n $Image = new \\Rundiz\\Image\\Drivers\\Gd(self::$source_images_dir . 'image-not-exists' . date('YmdHis') . '.jpg');\n $this->assertFalse($Image->status);\n $this->assertSame(\\Rundiz\\Image\\Drivers\\Gd::RDIERROR_SRC_NOTEXISTS, $Image->statusCode);\n }", "public function getFailureMessage()\n {\n\t\tif(null !== $this->_failed_index)\n\t\t\treturn $this->_items[$this->_failed_index]->getFailureMessage();\n\t\treturn '';\n }", "public function get_errno()\n\t{\n\t\treturn curl_errno($this->ch);\n\t}", "public function getHealthCheckFailure(): ?HealthCheckFailure\n {\n return $this->healthCheckFailure;\n }", "public function test_mod_lti_create_tool_type_nonexistant_file() {\n $this->expectException('moodle_exception');\n $type = mod_lti_external::create_tool_type($this->getExternalTestFileUrl('/doesntexist.xml'), '', '');\n }", "public function getErr() {}", "abstract public function getErrorType(): string;", "public function runFailed();", "public function getLastError()\n {\n return $this->_errorMsg;\n }", "public function errNo()\n {\n return curl_errno($this->curl);\n }", "public function throwMissingLocaleFileException()\n {\n $this->expectException(MissingLocaleFileException::class);\n\n $message = new CustomerMessage('ab_CD', 'invalid/path');\n $this->assertEquals('en_US', $message->getLocale());\n echo $message->getMessage('HPError-100.100.101');\n }", "public function testLoadFile_invalidFileName() : void\n {\n $spreadsheet = SpreadsheetUtil::loadFile('junk.xls');\n $this->assertNull($spreadsheet);\n }", "public function isFailed()\n {\n return $this->getResult() == self::RESULT_FAILED;\n }", "public function failed()\n {\n return $this->serverError() || $this->clientError();\n }", "public function getFailUrl(): ?string\n {\n return $this->getParameter('failUrl');\n }", "function getErrorForType($errorType) {\n switch($errorType) {\n default:\n case 'no_error':\n $this->addMsg(\n MSG_WARNING,\n $this->_gt('The action failed, but no error was triggered. Something`s wrong here.')\n );\n break;\n case 'path_not_found':\n $this->addMsg(MSG_ERROR, $this->_gt('Path could not be created.'));\n break;\n case 'mode_not_set':\n $this->addMsg(\n MSG_ERROR,\n $this->_gt('Could not determine, whether file was uploaded or local.')\n );\n break;\n case 'file_not_moved':\n $this->addMsg(MSG_ERROR, $this->_gt('Could not move file.'));\n break;\n case 'no_properties':\n $this->addMsg(MSG_ERROR, $this->_gt('Could not find out file properties.'));\n break;\n case 'empty_file':\n $this->addMsg(MSG_ERROR, $this->_gt('Wouldn`t add empty file.'));\n break;\n case 'db_add_file_failed':\n $this->addMsg(MSG_ERROR, $this->_gt('File could not be added.'));\n break;\n case 'db_update_file_failed':\n $this->addMsg(MSG_ERROR, $this->_gt('File could not be updated.'));\n break;\n case 'create_version_failed':\n $this->addMsg(MSG_ERROR, $this->_gt('Version could not be created.'));\n break;\n case 'load_file_failed':\n $this->addMsg(MSG_ERROR, $this->_gt('Could not load file.'));\n break;\n case 'import_failed':\n $this->addMsg(MSG_ERROR, $this->_gt('Failed to import file.'));\n break;\n case 'no_temp_file':\n $this->addMsg(MSG_ERROR, $this->_gt('Temporary file not found.'));\n break;\n case 'open_remote_file_failed':\n $this->addMsg(MSG_ERROR, $this->_gt('Could not open remote file.'));\n break;\n case 'open_temp_file_failed':\n $this->addMsg(MSG_ERROR, $this->_gt('Could not open temporary file.'));\n break;\n case 'derivations_lost':\n $this->addMsg(\n MSG_ERROR,\n $this->_gt('Derivation of file could not be saved, relation is lost.')\n );\n break;\n case 'copy_file_failed':\n $this->addMsg(MSG_ERROR, $this->_gt('Could not copy file.'));\n break;\n case 'create_path_failed':\n $this->addMsg(MSG_ERROR, $this->_gt('Path could not be created.'));\n break;\n case 'file_not_found':\n $this->addMsg(MSG_ERROR, $this->_gt('File not found.'));\n break;\n case 'version_not_found':\n $this->addMsg(MSG_ERROR, $this->_gt('Version not found.'));\n }\n }", "public function getCallbackFail()\n {\n return $this->callbackFail;\n }", "private function loadErrorPage()\n {\n // If there is no error page path or the file doesnt exist, output a message\n if ( ( ! $this->errorPagePath ) || ( ! file_exists($this->errorPagePath) ) )\n {\n // Output a general error message\n $error500Html = '';\n $error500Html .= $this->publicErrorMessage . '<br/><br/>';\n $error500Html .= '<span style=\"' . $this->errorDetailsHeaderStyle . '\">Error ID:</span> ' . $this->errid . '<br/><br/>';\n\n // If debug mode is enabled, output the error\n if ( $this->debugMode )\n {\n $error500Html .= $this->getErrorString(true, false, true, false, false);\n }\n\n $error500Html .= '<span style=\"' . $this->errorDetailsHeaderStyle . '\">Referrer:</span> <a href=\"' . $this->referer . '\">' . $this->referer . '</a>';\n\n // If email failed to send, append to error message\n if ( ( $this->debugMode ) and isset($this->failedToEmailMsg) ) $error500Html .= '<br/><br/><span style=\"' . $this->failedToEmailMsgStyle . '\">** Failed to send email to administrators: ' . $this->failedToEmailMsg . '</span>';\n\n // send error page in JSON response if coming from POST?\n if ( ( ! empty($_POST) ) and ( $this->errorPageInJSON ) )\n {\n exit(json_encode([ 'error500Html' => $error500Html ]));\n }\n else\n {\n echo $error500Html;\n }\n }\n /* If there is an error page path and it exists, include it\n * The file itself has access to the error string, it will\n * output it if debug mode is enabled.\n * Custom error files can be used by definining the config ERROR_PAGE_PATH */\n else\n {\n // send error page in JSON response if coming from POST?\n if ( ( ! empty($_POST) ) and ( $this->errorPageInJSON ) )\n {\n // start output buffering\n ob_start();\n include ( $this->errorPagePath );\n $error500Html = ob_get_clean(); // send generated error page into variable!\n\n exit(json_encode([ 'error500Html' => $error500Html ]));\n }\n else\n {\n include ( $this->errorPagePath );\n }\n }\n\n // exit the application after printing the error page\n exit();\n }", "public function isFailed()\n {\n return static::STATUS_FAILED == $this->getStatus();\n }" ]
[ "0.60769", "0.6068941", "0.60292214", "0.5944004", "0.59032696", "0.5871621", "0.58607167", "0.5795164", "0.5790313", "0.5783166", "0.5777504", "0.5766939", "0.56873566", "0.56666434", "0.5663245", "0.5644817", "0.56188756", "0.56018174", "0.55415857", "0.55310243", "0.5529192", "0.55176735", "0.55137825", "0.5504836", "0.5490253", "0.5487834", "0.54821247", "0.5459266", "0.5453969", "0.5441162", "0.54221356", "0.5402796", "0.5381516", "0.53682154", "0.53669924", "0.5358075", "0.5356502", "0.5351963", "0.5339439", "0.53317755", "0.5325951", "0.53142244", "0.5310035", "0.530217", "0.5291442", "0.5271499", "0.52699256", "0.5269015", "0.52662057", "0.5240223", "0.52082074", "0.51875263", "0.51668", "0.5164193", "0.51619667", "0.5160667", "0.5160667", "0.5158695", "0.5155202", "0.5131024", "0.5129679", "0.51211214", "0.5107534", "0.5100322", "0.5083521", "0.50808746", "0.50598234", "0.5057275", "0.5052567", "0.50447375", "0.5017824", "0.5005877", "0.5005877", "0.50038636", "0.499693", "0.49913666", "0.49884847", "0.49884737", "0.49862474", "0.49837044", "0.49634075", "0.49553198", "0.49549738", "0.49539867", "0.49399048", "0.49392936", "0.49384683", "0.4934292", "0.49303988", "0.49212432", "0.4912316", "0.49056667", "0.4904177", "0.49010786", "0.48976064", "0.4897603", "0.48967332", "0.48958254", "0.48946515", "0.48909366", "0.48867884" ]
0.0
-1
Make sure we clean up the image resource when this object is destroyed
public function __destruct() { //skip the `getImageResource` method because we don't want to load the resource just to destroy it if ($this->image) { $this->image->destroy(); } // remove our temp file if it exists if (file_exists($this->getTempPath() ?? '')) { unlink($this->getTempPath() ?? ''); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __destruct()\n {\n if (is_resource($this->_image))\n {\n // Free all resources\n imagedestroy($this->_image);\n }\n }", "public function __destruct()\n {\n if (is_resource($this->image)) {\n // free up memory\n imagedestroy($this->image);\n }\n }", "public function __destruct()\n {\n if ($this->image) {\n imagedestroy($this->image);\n }\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function __destruct(){\n\n if(isset($this->image) && !empty($this->image)){\n imagedestroy($this->image);\n }\n }", "public function __destruct()\n {\n imagedestroy($this->image);\n }", "public function __destruct()\n {\n if (is_resource($this->oldImage)) {\n imagedestroy($this->oldImage);\n }\n\n if (is_resource($this->workingImage)) {\n imagedestroy($this->workingImage);\n }\n }", "public function __destruct()\n {\n if (is_resource($this->tmpImage)) {\n // Free all resources\n imagedestroy($this->tmpImage);\n }\n }", "public function destroy()\n {\n $this->_info = new stdClass();\n if( is_resource($this->_resource) )\n {\n imagedestroy($this->_resource);\n }\n }", "public function __destruct()\n {\n if(isset($this->image)) imageDestroy($this->image);\n if(isset($this->temp)) imageDestroy($this->temp);\n }", "function __destruct()\n\t{\n\t\timagedestroy($this->im);\n\t}", "function close() \n { \n if(is_resource($this->_image)) \n { \n @imagedestroy($this->_image); \n } \n $this->_isImageResource=is_resource($this->_image); \n }", "public function destroyImage()\n {\n imagedestroy($this->image);\n imagedestroy($this->image_thumb);\n }", "private function intern_end()\n\t{\n\t\tif (is_resource($this->newImage)) imagedestroy($this->newImage );\n\t\tif (is_resource($this->newImage)) imagedestroy($this->srcImage );\n\t\t$this->newImage = null;\n\t\t$this->srcImage = null;\n\t}", "public function __destruct()\n {\n imagedestroy($this->layout);\n foreach((array)$this->images as $image) {\n imagedestroy($image);\n }\n }", "public function finish()\n {\n if($this->img)\n {\n imagedestroy($this->img);\n $this->img = null;\n }\n }", "public function __destruct() {\r\n\t\t//header(\"Content-type: image/png\");\r\n\r\n\t\t/* show our work ... */\r\n\t\t//imagepng( $this->cutted_image );\r\n\r\n\t\t/* we have to cleaned up the mass before left ... */\r\n\t\timagedestroy( $this->original_image );\r\n\t\timagedestroy( $this->cutted_image );\r\n\r\n\t\t/* so ... how do you think about this ...? */\r\n\t}", "public function __destruct() {\n\t\t\tparent::__destruct();\n\t\t\tunset($this->data);\n\t\t\tunset($this->file);\n\t\t\tunset($this->image);\n\t\t\tunset($this->uri);\n\t\t}", "public function cleanup() {\r\n\t\t$this->resource->cleanup();\r\n\t}", "public function destroyResource() {\n if (isset($this->_resource)) {\n imagedestroy($this->_resource);\n } else {\n trigger_error(\"CAMEMISResizeImage::destroyResource() attempting to access a non-existent resource (check if the image was loaded by CAMEMISResizeImage::__construct())\", E_USER_WARNING);\n }\n\n return $this;\n }", "protected function tearDown() {\n imagedestroy($this->image);\n }", "Function unload(){\n\t\t$this->removeBackup();\n\t\tif($this->info && isset($this->info['im'])){\n\t\t\t@imagedestroy($this->info['im']);\n\t\t}\n\t\t$this->info = false;\n\t}", "public function deleteImage(){\n if(file_exists($this->getImage())){\n unlink($this->getImage());\n }\n $this->setImage(null);\n }", "public function __destruct()\n {\n if ($this->uri) {\n librdf_free_uri($this->uri);\n }\n }", "public function __destruct()\n {\n if ($this->resource != null) fclose($this->resource);\n }", "public function removeImage() {\n //check if we have an old image\n if ($this->image) {\n //store the old name to delete the image on the upadate\n $this->temp = $this->image;\n //delete the current image\n $this->setImage(NULL);\n }\n }", "public function destroy(Image $image)\n {\n //\n }", "public function destroy(Image $image)\n {\n //\n }", "public function destroy(Image $image)\n {\n //\n }", "protected function _after()\n {\n unset($this->image);\n parent::_after();\n }", "function __destruct() {\r\n\t\tunlink($this->uploadfile);\r\n\t}", "public function __destruct()\n {\n if (!is_null($this->_resource)) {\n $this->close();\n }\n }", "abstract protected function _destroy();", "protected function cleanup() {\n\t\tif(isset($this->data['attachment'])) {\n\t\t\tunlink($this->data['attachment']);\n\t\t}\n\t\tparent::cleanup();\n\t}", "public function cleanup()\n\t{\n\t\t$this->getObject()->cleanup();\n\t}", "private function flushImageCache()\n {\n $this->imagesCache = null;\n $this->variantImages = null;\n }", "public static function deleteImage(){}", "public function __destruct()\n {\n unset($this->file_info);\n }", "function __destruct()\n {\n $this->release();\n }", "public function cleanImagesAction()\n {\n parent::cleanImagesAction();\n $this->clearRespizrImageCache();\n }", "public function cleanup()\n {\n }", "protected function forceDestory()\n {\n if ($this->isGdResource($this->getHandler())) {\n $this->destroy();\n }\n }", "public function __destruct() {\n if (file_exists($this->tempFile)) {\n unlink($this->tempFile);\n }\n }", "protected function typo3CleanUp($imageResource) {\n \t$GLOBALS['TYPO3_DB']->exec_DELETEquery(\n\t\t\t'cache_imagesizes',\n\t\t\t'filename=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($imageResource[3], 'cache_imagesizes')\n \t);\n \t\n \tunset($GLOBALS['TSFE']->tmpl->fileCache[$imageResource['fileCacheHash']]);\n }", "public function __destruct()\n {\n unset($this->binaryReaderEntity);\n }", "function destructor()\n\t{\n\t\tunset($Resources,$FileName,$FileType,$FileSize,$NumRes,$FileVersion,$Description,$DataOffset);\n\t}", "function _ddb_cover_upload_cleanup() {\n $data = _ddb_cover_upload_session('ddb_cover_upload_submitted');\n\n // Mark image as upload to prevent more uploads of the same data.\n _ddb_cover_upload_session('ddb_cover_upload_submitted', '');\n\n // Remove local copy of the image.\n file_unmanaged_delete($data['image_uri']);\n}", "public function __destruct()\n {\n if (file_exists($this->tempFilesFromFilename)) {\n unlink($this->tempFilesFromFilename);\n }\n }", "public function __destruct() {\n if ($this->fileHandle) {\n fclose($this->fileHandle);\n }\n\n $this->generator = null;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function __destruct() {\n\t\t\tparent::__destruct();\n\t\t\tunset($this->resource);\n\t\t\tunset($this->methods);\n\t\t\tunset($this->name);\n\t\t}", "public function __destruct(){\n\t\tif( !empty( $this->upload ) )\t\t\t\t\t\t\t\t\t\t// upload is set\n\t\t\tif( !empty( $this->upload->tmp_name ) )\t\t\t\t\t\t\t// file has been uploaded\n\t\t\t\tif( file_exists( $this->upload->tmp_name ) )\t\t\t\t// uploaded file is still existing\n\t\t\t\t\t@unlink( $this->upload->tmp_name );\t\t\t\t\t\t// remove originally uploaded file\n\t}", "public function cleanup()\n\t{\n\t\t\n\t}", "public function __destruct()\n {\n @unlink($this->path);\n }", "public function __destroy()\n {\n $this->close();\n }", "public function __destruct() {\n\t\tif(isset($this->tmpPath) && file_exists($this->tmpPath)) {\n\t\t\tunlink($this->tmpPath);\n\t\t}\n\t}", "private function flushImageCache(): void\n {\n $this->imagesCache = null;\n $this->variantImages = null;\n }", "public function __destruct()\n {\n $this->obj->close();\n $this->instance = null;\n }", "public function __destruct() {\n\t\t$this->clean();\n\t}", "public function __destruct()\n\t{\n\t\t$this->delete_local_file();\n\t}", "public function cleanup()\n\t{\n\t}", "public function __destruct()\r\n\t{\r\n\t\t@unlink($this->targetFile);\r\n\t\tif (strcmp($this->referenceFile, $this->outputReferenceFile) !== 0)\r\n\t\t\t@unlink($this->referenceFile);\r\n\t}", "public function __destruct() {\n\t\tif (file_exists($this->fileName) && (!$this->cache)) {\n\t\t\tunlink($this->fileName);\n\t\t}\n\t}", "public function __destruct() {\n\t\tif ( $this->aFiles !== null )\n\t\t\tunset( $this->aFiles );\n\t}", "public function __destruct()\n {\n if ($this->handle) {\n fclose($this->handle);\n }\n }", "public function __destruct()\n {\n if (file_exists($this->filename)) {\n unlink($this->filename);\n }\n\n foreach ($this->tempFiles as $file) {\n $this->filesystem->remove($file);\n }\n }", "private function finalize()\n {\n $this->temp_files_path[] = L_FRAME_LIST_FILE;\n $this->delete_files();\n }", "function __destruct()\r\n {\r\n if ($this->handle) {\r\n fclose($this->handle);\r\n }\r\n }", "function __destruct() {\n\t\t@fclose($this->FILE);\n\t\tunset($this->FILE, $this->HEADERS, $this->DATA);\n\t}", "function __destruct()\n {\n unset($this->parent);\n unset($this->sz);\n }", "public function __destruct()\n\t\t{\n\t\t\tfclose($this->getHandle());\n\t\t}", "public function __destruct()\r\n\t{\r\n\t\t// clear the email file resource\r\n\t\tif (is_resource($this->stream)) {\r\n\t\t\tfclose($this->stream);\r\n\t\t}\r\n\t\t// clear the MailParse resource\r\n\t\tif (is_resource($this->resource)) {\r\n\t\t\tmailparse_msg_free($this->resource);\r\n\t\t}\r\n\t\t// remove attachment resources\r\n\t\tforeach ($this->attachment_streams as $stream) {\r\n\t\t\tfclose($stream);\r\n\t\t}\r\n\t}", "public function __destruct()\n {\n $this->clear();\n }", "public function __destruct()\n {\n $this->clear();\n }", "public function cleanup() {\n\t\t//TODO\n\t}", "function __destroy() {\n }", "public function __destruct() {\r\n if (isset($this->handle)) {\r\n $this->transaction_finish();\r\n }\r\n if ($this->option_remove) {\r\n @unlink($this->file);\r\n }\r\n }", "public function __destruct()\n {\n $this->closeFiles();\n }", "public function __destruct() {\n fclose($this->fileHandler);\n }", "public function __destruct()\n {\n //$this->deletePath($this->path);\n }", "public function __destruct()\n {\n fclose($this->fileHandle);\n }", "public function __destruct(){\n \n fclose( $this->getFilePointer() );\n \n }", "public function __destruct()\n {\n if (isset($this->stream) && is_resource($this->stream)) {\n fclose($this->stream);\n }\n }", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function __destruct()\r\n {\r\n // Perform any clean-up here\r\n }", "protected function _reset()\n {\n $this->_width = null;\n $this->_height = null;\n $this->_imagePath = null;\n\n return parent::_reset();\n }", "public function cleanup(): void\n {\n }", "public function cleanup(): void\n {\n }", "public function __destruct()\n {\n if ($this->handle !== null) {\n $this->processRunner->destroy($this->handle);\n }\n }", "public function __destruct()\n {\n $this->closeFile();\n }", "public function __destruct() \n\t{\n\t\tif (isset($this->handle)) {\n\t\t\tfclose($this->handle);\n\t\t}\n\t}", "public function __destruct() {\n fclose($this->file);\n }", "public function __destruct()\n {\n unlink($this->tmpListFile);\n }", "public function __destruct()\n {\n if ($this->fp) {\n fclose($this->fp); // Als het object niet meer nodig is, kan de file-pointer gesloten worden.\n }\n }", "public static function destroy() {}", "public function destroy(Image $image)\n {\n $image->delete();\n }", "public function __destruct()\n {\n if ($this->handle !== null) {\n \\fclose($this->handle);\n }\n }", "public function __destruct()\n {\n if($this->_gc_temp_files === true && empty($this->_tmp_files) === false)\n {\n foreach ($this->_tmp_files as $path)\n {\n if(is_file($path) === true)\n {\n @unlink($path);\n }\n }\n }\n }", "public function cleanUp() {}", "public function cleanUp() {}" ]
[ "0.857253", "0.8547465", "0.8442191", "0.84332794", "0.841615", "0.8321722", "0.8319423", "0.83164895", "0.82763046", "0.81757265", "0.80256635", "0.8010804", "0.7884571", "0.78385234", "0.7827356", "0.78146917", "0.74372905", "0.7317846", "0.7262516", "0.7223612", "0.7079487", "0.70152706", "0.683149", "0.67670524", "0.676093", "0.6722044", "0.6713244", "0.6713244", "0.6713244", "0.6689775", "0.66886145", "0.6649669", "0.66465986", "0.66170037", "0.6615938", "0.66004306", "0.6600384", "0.6588738", "0.6578819", "0.65786743", "0.65755343", "0.65723294", "0.6538267", "0.65300417", "0.65234673", "0.6519315", "0.651857", "0.65111667", "0.6497152", "0.64824784", "0.64647496", "0.64641446", "0.6429295", "0.64267635", "0.64258975", "0.6421798", "0.6417735", "0.64122856", "0.6401326", "0.6394817", "0.6389623", "0.6384993", "0.63579464", "0.63533586", "0.63499874", "0.6339094", "0.6337109", "0.632491", "0.6317837", "0.63174736", "0.630865", "0.63079", "0.63069993", "0.63069993", "0.6298829", "0.62969786", "0.62845093", "0.6280385", "0.627816", "0.6274753", "0.62703156", "0.62685597", "0.6256874", "0.6249126", "0.62381935", "0.62203526", "0.621701", "0.621701", "0.6203711", "0.6200765", "0.6192653", "0.6189564", "0.61867195", "0.6182909", "0.6180328", "0.6171009", "0.61642396", "0.6161828", "0.61588", "0.61588" ]
0.8151313
10
This function is triggered early in the request if the "flush" query parameter has been set. Each class that implements Flushable implements this function which looks after it's own specific flushing functionality.
public static function flush() { if (Config::inst()->get(static::class, 'flush_enabled')) { /** @var CacheInterface $cache */ $cache = Injector::inst()->get(CacheInterface::class . '.InterventionBackend_Manipulations'); $cache->clear(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _prepareFlush() {\r\n\r\n }", "protected function _completeFlush() {\r\n\r\n }", "public function preFlush(): void\n {\n $this->setParams(clone $this->getParams());\n }", "public static function flush() {\n\t\tstatic::$flush = true;\n\t}", "public function flush()\n\t{\n\n\t}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "function flush()\n{\n}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush() {}", "public function flush()\n {\n }", "public function flush()\n {\n }", "public function flush()\n {\n }", "abstract function flush();", "public function flush() {\n }", "abstract public function flush();", "public function flush($data = null) {}", "public function flush($data = null) {}", "protected function _flushBuffer() {\n\t\t//@codingStandardsIgnoreStart\n\t\t@flush();\n\t\tif (ob_get_level()) {\n\t\t\t@ob_flush();\n\t\t}\n\t\t//@codingStandardsIgnoreEnd\n\t}", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush()\n {\n }", "public function flush()\n {\n }", "private function _flushContent()\n {\n @ob_flush();\n @flush();\n }", "abstract public function flush ();", "function flush() ;", "function flush() ;", "function flush();", "private function flush()\n {\n $this->currentOptions = [];\n // set back send status buffer string\n $this->sendStatus = null;\n }", "public function flushQuery();", "public function flush(){\n }", "function flush(){\n\t\tif(!$this->_OutputBuffer_Flush_Started){\n\t\t\t$this->_flushHeaders();\n\t\t}\n\n\t\tif($this->getContentLength()>0){\n\t\t\t$this->_OutputBuffer_Flush_Started = true;\n\t\t\t$this->_OutputBuffer->printOut();\n\t\t\t$this->_OutputBuffer->clear();\n\t\t}\n\t}", "public function flush(): void\n {\n }", "public function flush(): void\n {\n }", "public function flush()\n {\n // TODO: Implement flush() method.\n }", "public function onFlush(OnFlushEventArgs $event)\n {\n $this->scheduledSyncMap = [];\n $this->entityManager = $event->getEntityManager();\n\n // check for logged user is for confidence that data changes mes from UI, not from sync process.\n if (!$this->tokenAccessor->hasUser()) {\n return;\n }\n\n $this->scheduleEntitiesSync($this->getEntitiesToSync());\n\n $this->scheduledSyncMap = [];\n $this->entityManager = null;\n }", "function end_flush() {\n\tglobal $Ajax;\n\n\tif (isset($Ajax))\n\t\t$Ajax->run();\n\n \t // on some (but not all) php versions zlib extension adds 1 additional level of buffering, \n \t // so flush the last buffer outside the loop to be on safe side \n \twhile(ob_get_level() > 1)\n \t\tob_end_flush();\n\t@ob_end_flush();\n\n\t// if any transaction was aborted unexpectedly rollback changes\n\tcancel_transaction();\n}", "public function flushQuery()\n\t{\n\t\t$this->cur_query = \"\";\n\t}", "public function flush(): void;", "public function flush(): void;", "public function flush(): void;", "protected function doFlush()\n {\n $this->yac->flush();\n }", "public function flush()\n {\n return 1;\n }", "function flush()\n\t\t{\n\t\t\t// Get rid of these\n\t\t\t$this->last_result = null;\n\t\t\t$this->col_info = null;\n\t\t\t$this->last_query = null;\n\t\t\t$this->from_disk_cache = false;\n $this->setParamaters();\n\t\t}", "public static function flush() {\n // We only call ob_flush if the current output buffer belongs to us.\n if (self::is_current_output_buffer()) {\n ob_flush();\n }\n }", "function flushAll(){\n\t\tif(!$this->_OutputBuffer_Flush_Started){\n\t\t\t$this->setHeader(\"Content-Length\",$this->getContentLength());\n\t\t\t$this->_flushHeaders();\n\t\t}\n\n\t\tif($this->getContentLength()>0){\n\t\t\t$this->_OutputBuffer_Flush_Started = true;\n\t\t\t$this->_OutputBuffer->printOut();\n\t\t\t$this->_OutputBuffer->clear();\n\t\t}\n\t}", "public function flush()\n\t{\n\t\treturn true;\n\t}", "public function postFlush()\n {\n $currentDeepLevel = $this->deepLevel;\n\n if (!empty($this->entitiesScheduledForWorkflowStart[$currentDeepLevel])) {\n $this->deepLevel++;\n $massStartData = $this->entitiesScheduledForWorkflowStart[$currentDeepLevel];\n unset($this->entitiesScheduledForWorkflowStart[$currentDeepLevel]);\n $this->workflowManager->massStartWorkflow($massStartData);\n $this->deepLevel--;\n }\n }", "public function stream_flush()\n {\n return true;\n }", "public function flush(): static;", "public function testflush()\n {\n self::assertTrue($this->object->flush());\n }", "public function onPostFlush()\n {\n $this->site->emitSiteChanged();\n }", "private function flush() {\n\t\t$this->_error = '';\n\t\t$this->_last_result = array();\n\t}", "public function postFlush()\n {\n foreach ($this->parametersMap as $map) {\n $map['entity']->setParameters($map['parameters']);\n }\n\n // reset parameters map\n $this->parametersMap = [];\n }", "public static function flushQueryLog()\n {\n }", "public function flushRequestLog()\n {\n $this->requestLog = [];\n }", "public function flush() {\r\n\t\tfflush($this->_handle);\r\n\t}", "public function setFlushEarly($flushEarly)\n {\n $this->flushEarly = $flushEarly;\n }", "public function buffer_end_flush_all() {\n\t\t//if($this->get_setting('showHdrFtr') == 'FWD') {\n\t\t\t$levels = ob_get_level();\n\t\t\tfor ($i=0; $i<$levels; $i++){\n\t\t\t\t$obStatus = ob_get_status();\n\t\t\t\tif (!empty($obStatus['type']) && $obStatus['status']) {\n\t\t\t\t\tob_end_flush();\n\t\t\t\t}\n\t\t\t}\n\t\t//}\n\t}", "function flush_fragments(){\n\n /* Retreive the current action hook name */\n $action = current_filter();\n \n foreach($this->flush_rules as $key => $rules){\n /*\n Check if this fragment key has asked to\n be flushed on this action hook */\n if(in_array($action, $rules['actions'])){\n /* Bingo. Flush the fragment for the key */\n if(delete_transient($key)){\n /* Hook action for succesful fragment flushing */\n do_action('fragWP/fragment_flushed', $key, $action);\n }\n }\n }\n\n }", "public function getFlushEarly()\n {\n return $this->flushEarly;\n }", "public function flush() {\n\t\tob_end_flush();\n\t}", "public function ravenPreFlush(PreFlushEventArgs $args):void;", "public function flushQueryLog()\n {\n $this->queryLog = array();\n }", "public function flush(): void\n {\n $this->session()->flashInput([]);\n }", "public function postFlush(): void\n {\n try {\n foreach ($this->createdObjects as $object) {\n $this->publishUpdate($object, $this->createdObjects[$object], 'create');\n }\n\n foreach ($this->updatedObjects as $object) {\n $this->publishUpdate($object, $this->updatedObjects[$object], 'update');\n }\n\n foreach ($this->deletedObjects as $object) {\n $this->publishUpdate($object, $this->deletedObjects[$object], 'delete');\n }\n } finally {\n $this->reset();\n }\n }", "public function flush(/* ... */)\n {\n $this->_storage = [[], [], []];\n $this->_event_history = [];\n $this->set_state(STATE_DECLARED);\n }", "function ob_implicit_flush(int $flag = 1): void {}", "public function commit($flush = false)\n\t{\n\t\treturn false;\n\t}", "function flush(): bool;", "public function flush(): void\n {\n parent::flush();\n\n $this->bootedCallbacks = [];\n $this->bootingCallbacks = [];\n $this->deferredServices = [];\n $this->serviceProviders = [];\n $this->loadServiceProviders = [];\n }", "public function flush() {\n\t\t$this->last_result = null;\n\t\t$this->col_info = null;\n\t\t$this->last_query = null;\n\t}", "function flush()\n\t\t{\n\t\t\t// Get rid of these\n\t\t\t$this->last_result = null;\n\t\t\t$this->col_info = null;\n\t\t\t$this->last_query = null;\n\t\t\t$this->from_disk_cache = false;\n\t\t}", "public function flush(): bool\n {\n return false;\n }", "public function flushBatch()\n\t{\n\t\tif ($this->batching)\n\t\t{\n\t\t\t$this->batching = FALSE;\n\t\t\t\n\t\t\t$this->statpro->endBatch();\n\t\t}\n\t}", "public function flush(): bool;" ]
[ "0.75262713", "0.7165165", "0.71292955", "0.67982394", "0.6663898", "0.6656445", "0.6656445", "0.6656445", "0.6656445", "0.66558087", "0.66547954", "0.66547954", "0.66547954", "0.66547954", "0.66547954", "0.66547954", "0.66547954", "0.66547954", "0.66547954", "0.66130644", "0.66130644", "0.66130644", "0.65866804", "0.65697205", "0.6566997", "0.65516454", "0.65516454", "0.6537851", "0.6511184", "0.6511184", "0.6511184", "0.6511184", "0.6511184", "0.6511184", "0.6511184", "0.6511184", "0.6511184", "0.6511184", "0.6511184", "0.6511184", "0.6511184", "0.6511184", "0.6511184", "0.6511184", "0.6511184", "0.6511184", "0.6486419", "0.6486419", "0.6416978", "0.64138407", "0.6395409", "0.6395409", "0.6394961", "0.6382284", "0.63614553", "0.63467866", "0.6331409", "0.63162065", "0.63162065", "0.6223399", "0.62226844", "0.62166214", "0.6189987", "0.61887544", "0.61887544", "0.61887544", "0.6164371", "0.6121863", "0.611595", "0.6111791", "0.61039746", "0.6091137", "0.60900617", "0.6087683", "0.6052214", "0.605076", "0.60322714", "0.5996247", "0.59790283", "0.59764636", "0.59509957", "0.5937853", "0.5933635", "0.59272325", "0.5892317", "0.58841944", "0.5880782", "0.58729166", "0.5858258", "0.58323497", "0.5808357", "0.5792269", "0.5786824", "0.5785656", "0.578276", "0.5774028", "0.57515526", "0.5738099", "0.57312757", "0.5727193", "0.5691957" ]
0.0
-1
Validate the stream resource is readable
protected function isStreamReadable($stream) { if (empty($stream)) { return false; } if ($stream instanceof StreamInterface) { return $stream->isReadable(); } // Ensure resource is stream type if (!is_resource($stream)) { return false; } if (get_resource_type($stream) !== 'stream') { return false; } // Ensure stream is readable $meta = stream_get_meta_data($stream); return isset($meta['mode']) && (strstr($meta['mode'] ?? '', 'r') || strstr($meta['mode'] ?? '', '+')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkResource() {\n if (is_resource($this->_handler) && (get_resource_type($this->_handler) == 'stream')) {\n \treturn true;\n }\n return false;\n }", "public function isReadable() {}", "public function isReadable();", "public function isReadable()\n {\n }", "function is_readable(ResourceInterface $resource): bool\n {\n $modes = [\n 'r' => true,\n 'w+' => true,\n 'r+' => true,\n 'x+' => true,\n 'c+' => true,\n 'rb' => true,\n 'w+b' => true,\n 'r+b' => true,\n 'x+b' => true,\n 'c+b' => true,\n 'rt' => true,\n 'w+t' => true,\n 'r+t' => true,\n 'x+t' => true,\n 'c+t' => true,\n 'a+' => true,\n 'a+b' => true,\n ];\n\n if ($resource->eof()) {\n return false;\n }\n\n $metadata = stream_get_meta_data($resource->getResource());\n\n return isset($modes[$metadata['mode']]);\n }", "public function isReadable(): bool;", "public function checkIsReadable($path);", "public function isReadResource();", "public function isReadable()\n {\n return true;\n }", "public function isReadable()\n {\n return true;\n }", "function is_valid() {\n return is_resource($this->connection);\n }", "function is_stream(mixed $var): bool\n{\n return $var && is_resource($var) && get_resource_type($var) === 'stream';\n}", "public function isReadable()\n {\n return $this->readable;\n }", "function readable() {\n\t\treturn is_file($this->path) && is_readable($this->path);\n\t}", "public function readStream();", "public function isReadable() {\n\t\treturn $this->readable;\n\t}", "public function isReadableFile(): bool {\n return is_readable($this) && is_file($this);\n }", "public function readable()\n {\n return is_readable($this->path);\n }", "public function isReadable(): bool\n {\n return is_readable($this->directory->getPath().'/'.$this->filename);\n }", "public function valid() {\r\n\t\tif (feof($this->handle)) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n }", "public function isReadable(string $path): bool;", "public function isReadable()\n {\n $this->is_readable = null;\n\n if ($this->exists === true) {\n } else {\n return;\n }\n\n if ($this->is_file === true) {\n } else {\n return;\n }\n\n $r = substr($this->temp_files[$this->path]->permissions, 1, 1);\n\n if ($r == 'r') {\n $this->is_readable = true;\n } else {\n $this->is_readable = false;\n }\n\n return;\n }", "abstract protected function doesSupportStreamWrapper();", "public function isReadable()\n\t{\n\t\tif (is_readable($this->directory)) return true; return;\n\t}", "public function read(): bool\n {\n }", "public function read(): bool\n {\n }", "public function is_readable($file)\n {\n }", "public function is_readable($file)\n {\n }", "public function is_readable($file)\n {\n }", "public function is_readable($file)\n {\n }", "public function is_readable($file)\n {\n }", "public function assertReadable($path);", "public function isReadable()\n {\n if (!in_array($this->mode, ['r', 'r+', 'w+', 'a+', 'x+', 'c+'])) {\n return true;\n }\n return false;\n }", "public function isSeekable() {}", "public function isSeekable();", "public function is_stream() {\n return $this->is_stream;\n }", "public function isStreamable()\n {\n return ((int)$this->streamable === 1);\n }", "public function isReadable($path)\n {\n return $this->asyncFs->getAdapter()->is_readable($path);\n }", "public function allowsNewStreamOpening()\n {\n return $this->base != 'r';\n }", "public function isSeekable()\n {\n }", "public function isReadable()\n {\n if (!$this->metadata) {\n return false;\n }\n\n $mode = $this->metadata['mode'];\n\n return (\n strstr($mode, 'r')\n || strstr($mode, '+')\n );\n }", "function eof() {\n return (\n $this->checkResource() ?\n feof($this->_handler) :\n Fire_Error::throwError('File resource member is not a valid file resource.', __FILE__, __LINE__)\n );\n }", "public function onReadable (): void;", "public function isOpen()\n {\n return (null !== $this->fileDescriptor && is_resource($this->fileDescriptor));\n }", "public function validateSource(): bool\n {\n return ($this->source and $this->source->isOpen());\n }", "public function isReadable(string $path): bool\n {\n return is_readable($path);\n }", "public function isValid($resource = null)\r\n {\r\n if ($resource === null) {\r\n $resource = $this->_resource;\r\n } \r\n return is_resource($resource);\r\n }", "public function allowsExistingStreamOpening()\n {\n return $this->base != 'x';\n }", "public function read(): bool\n {\n return $this->isAllowed(self::READ);\n }", "function test_streams($instream, &$format)\n{\n\tif ($instream === false)\n\t{\n\t\treturn false;\n\t}\n\n\tif ($format === false)\n\t{\n\t\t$format = \"\";\n\t}\n\treturn true;\n}", "function readable($file)\n{\n\treturn (file_exists($file) && is_readable($file));\n}", "public function is_resource($var)\n {\n return @is_resource($var);\n }", "protected function read()\n {\n return true;\n }", "function isReadable() { return $this->flagAccessRead; }", "public static function isReadable($path)\n\t{\n\t\treturn is_readable($path);\n\t}", "public static function isReadable(string $path) : bool\n {\n return (new File($path))->isReadable();\n }", "public static function isReadable($filename)\n {\n if (!$fh = @fopen($filename, 'r', true)) {\n return false;\n }\n @fclose($fh);\n return true;\n }", "private function isReadable ($file)\n {\n return is_readable($file);\n }", "function wp_is_stream($path)\n {\n }", "static public function GetInputStream() {\n if (isset(self::$input))\n return self::$input;\n else\n return false;\n }", "public static function is_resource_local( $resource ) {\r\n return stream_is_local( $resource ); \r\n }", "public function isSeekable()\n {\n // if resource is seekable\n if ($this->traitIsSeekable())\n {\n // seeking write streams is only possible if\n // the internal buffer is flushed and empty\n return ($this->writable && $this->data === '');\n }\n return false;\n }", "public function readStream($path)\n {\n try {\n $object = $this->applyPathPrefix($path);\n $url = $this->ossClient->signUrl($this->bucket, $object, 60, OssClient::OSS_HTTP_GET, $this->options);\n $handle = fopen($url, 'r');\n\n return $this->normalizeResponse([\n 'stream' => $handle,\n ], $path);\n } catch (OssException $e) {\n return false;\n }\n }", "public function canNotOpen()\n {\n $this->assertFalse(@fopen(vfsStream::url('foo')));\n }", "function is_writeable(ResourceInterface $resource): bool\n {\n $modes = [\n 'w' => true,\n 'w+' => true,\n 'rw' => true,\n 'r+' => true,\n 'x+' => true,\n 'c+' => true,\n 'wb' => true,\n 'w+b' => true,\n 'r+b' => true,\n 'x+b' => true,\n 'c+b' => true,\n 'w+t' => true,\n 'r+t' => true,\n 'x+t' => true,\n 'c+t' => true,\n 'a' => true,\n 'a+' => true,\n 'a+b' => true,\n ];\n\n if ($resource->eof()) {\n return false;\n }\n\n $metadata = stream_get_meta_data($resource->getResource());\n\n return isset($modes[$metadata['mode']]);\n }", "public function readStream($path)\n {\n }", "public function readStream($path)\n {\n }", "public function check(Resource $resource);", "protected function isStreamFinished()\n {\n return gzeof($this->file);\n }", "public function readable ()\n {\n $this->_init_handler ();\n return isset ($this->_handler);\n }", "public function getStream() {}", "public function getStream() {}", "public function getStream() {}", "public function getStream() {}", "public function getStream() {}", "public function isPublicResource(): bool {\n // Long enough\n return count($this->elements) >= 2\n // Inside public directory\n && $this->startsWith(new self(App::getConfig('app.publicDir')))\n // Is readable file\n && $this->prepend(App::getRootDir())->isReadableFile();\n }", "private function isValidFile($path)\n {\n return $path && $path != 'none' && is_readable($path);\n }", "public static function getStream() {}", "public function is_readable($filename)\n {\n return @is_readable($filename);\n }", "function readResource() {\n\t\tif ( $this->_Resource ) {\n\t\t\tif ( stripos($this->_Resource, '<xml') !== false || stripos($this->_Resource, '<wurfl') !== false ) {\n\t\t\t\t$this->_Xml = @simplexml_load_string($this->_Resource);\n\t\t\t} elseif ( @file_exists($this->_Resource) && @is_readable($this->_Resource) ) {\n\t\t\t\t$this->_Xml = @simplexml_load_file($this->_Resource);\n\t\t\t} else {\n\t\t\t\tthrow new wurflException('Cannot read resource '.$this->_Resource.'. Resource must be either a valid file or an XML string');\n\t\t\t}\n\t\t}\n\t}", "public static function validateResource( $resource ) {\n\t\tif ( preg_match( self::URNRE, $resource ) || preg_match( self::IRIRE, $resource ) || preg_match( self::URINAMERE, $resource ) ) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function is_readable( $file ) {\n\t\treturn true;\n\t}", "public static function isStream(string $path): bool\n {\n if (!Str::contains('://', $path)) {\n return false;\n }\n $explode = explode('://', $path, 2);\n if (in_array($explode[0], stream_get_wrappers())) {\n return true;\n } else {\n return false;\n }\n }", "function onReadable($stream, callable $callback, $enableNow = TRUE);", "private function isResourceValid()\n {\n if (strpos($this->resourceToImport, 'www.freebase.com') === false)\n return false;\n\n return true;\n }", "public function __construct($handle) {\n\t\tif (! is_resource($handle) || get_resource_type($handle) !== 'stream') {\n\t\t\tthrow new InvalidArgumentException(\"Invalid stream handle\");\n\t\t}\n\t\t$this->handle = $handle;\n\t\t$mode = $this->getMeta('mode');\n\t\tif (strpos($mode, '+') !== false) {\n\t\t\t$this->readable = true;\n\t\t\t$this->writable = true;\n\t\t} else {\n\t\t\tif (strpos($mode, 'r') !== false) {\n\t\t\t\t$this->readable = true;\n\t\t\t}\n\t\t\tif (strcspn($mode, 'wxca') !== strlen($mode)) {\n\t\t\t\t$this->writable = true;\n\t\t\t}\n\t\t}\n\t}", "public function available() {\n return feof($this->in) ? 0 : 1;\n }", "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 getStream();", "public function getStream();", "public function getStream();", "public function getStream();", "public function getStream();", "public function getStream();", "function isTrustedStream($stream_name)\r\n {\r\n if (empty($this->smarty->security_policy->streams) || in_array($stream_name, $this->smarty->security_policy->streams)) {\r\n return true;\r\n } else {\r\n throw new Exception (\"stream \\\"\" . $stream_name . \"\\\" not allowed by security setting\");\r\n return false;\r\n } \r\n }", "public function read($length)\n {\n return false;\n }", "public function is_readable(string $message = ''): self {\n if (is_readable(filename: $this->path)) {\n return $this;\n }\n\n throw new \\InvalidArgumentException(\n message: $message ?: \"File '{$this->path}' must be readable.\",\n );\n }", "public function isReadable($sPath) {\n $sPath = $this->getFullPath($sPath);\n if (in_array($sPath, $this->aNotReadable)) {//tests\n return false;\n }\n if (!file_exists($sPath)) {\n throw MLException::factory(\n 'update', \n 'File `{#path#}` not exists.', \n 1423821549\n )->setData(array('path' => $sPath));\n }\n return is_readable($sPath);\n }", "abstract public function read(AbstractStream $stream);", "public function read();" ]
[ "0.74711883", "0.7309637", "0.72668195", "0.6908942", "0.6855464", "0.6760469", "0.65523773", "0.6506465", "0.6476693", "0.6476693", "0.64503235", "0.6316515", "0.6279597", "0.6249807", "0.6232123", "0.62214226", "0.62036026", "0.616552", "0.61577404", "0.6142873", "0.61018944", "0.6099263", "0.60480297", "0.5990433", "0.59573245", "0.59573245", "0.5933843", "0.5932985", "0.5932985", "0.5932985", "0.5931762", "0.5918098", "0.58955777", "0.58875406", "0.58565634", "0.58396405", "0.58291346", "0.5799078", "0.57648796", "0.57376033", "0.5726717", "0.5692323", "0.5679213", "0.5669389", "0.5668987", "0.5664071", "0.5653328", "0.5644585", "0.5643222", "0.5639114", "0.5638821", "0.5616235", "0.5612381", "0.56092983", "0.560597", "0.5603812", "0.559225", "0.55712885", "0.55645424", "0.55310494", "0.55099946", "0.5498803", "0.5440711", "0.54338855", "0.5426296", "0.5422418", "0.5422418", "0.5415728", "0.541492", "0.5406829", "0.5405164", "0.5404575", "0.5404575", "0.5404575", "0.5404575", "0.5398097", "0.5391265", "0.539111", "0.5388114", "0.53817797", "0.5371801", "0.53679115", "0.5355533", "0.5352429", "0.5350815", "0.53442365", "0.53434336", "0.5339872", "0.53317934", "0.53317934", "0.53317934", "0.53317934", "0.53317934", "0.53317934", "0.53305876", "0.53284335", "0.532101", "0.5308255", "0.5308168", "0.5290163" ]
0.6393198
11
Authenticate and retrieve stock
function mkmapi($url) { /** * Declare and assign all needed variables for the request and the header * * @var $method string Request method * @var $url string Full request URI * @var $appToken string App token found at the profile page * @var $appSecret string App secret found at the profile page * @var $accessToken string Access token found at the profile page (or retrieved from the /access request) * @var $accessSecret string Access token secret found at the profile page (or retrieved from the /access request) * @var $nonce string Custom made unique string, you can use uniqid() for this * @var $timestamp string Actual UNIX time stamp, you can use time() for this * @var $signatureMethod string Cryptographic hash function used for signing the base string with the signature, always HMAC-SHA1 * @var version string OAuth version, currently 1.0 */ global $appToken,$appSecret,$accessToken,$accessSecret; $method = "GET"; $nonce = uniqid(); $timestamp = time(); $signatureMethod = "HMAC-SHA1"; $version = "1.0"; /** * Gather all parameters that need to be included in the Authorization header and are know yet * * @var $params array|string[] Associative array of all needed authorization header parameters */ $params = array( 'realm' => $url, 'oauth_consumer_key' => $appToken, 'oauth_token' => $accessToken, 'oauth_nonce' => $nonce, 'oauth_timestamp' => $timestamp, 'oauth_signature_method' => $signatureMethod, 'oauth_version' => $version, ); /** * Start composing the base string from the method and request URI * * @var $baseString string Finally the encoded base string for that request, that needs to be signed */ $baseString = strtoupper($method) . "&"; $baseString .= rawurlencode($url) . "&"; /* * Gather, encode, and sort the base string parameters */ $encodedParams = array(); foreach ($params as $key => $value) { if ("realm" != $key) { $encodedParams[rawurlencode($key)] = rawurlencode($value); } } ksort($encodedParams); /* * Expand the base string by the encoded parameter=value pairs */ $values = array(); foreach ($encodedParams as $key => $value) { $values[] = $key . "=" . $value; } $paramsString = rawurlencode(implode("&", $values)); $baseString .= $paramsString; /* * Create the signingKey */ $signatureKey = rawurlencode($appSecret) . "&" . rawurlencode($accessSecret); /** * Create the OAuth signature * Attention: Make sure to provide the binary data to the Base64 encoder * * @var $oAuthSignature string OAuth signature value */ $rawSignature = hash_hmac("sha1", $baseString, $signatureKey, true); $oAuthSignature = base64_encode($rawSignature); /* * Include the OAuth signature parameter in the header parameters array */ $params['oauth_signature'] = $oAuthSignature; /* * Construct the header string */ $header = "Authorization: OAuth "; $headerParams = array(); foreach ($params as $key => $value) { $headerParams[] = $key . "=\"" . $value . "\""; } $header .= implode(", ", $headerParams); /* * Get the cURL handler from the library function */ $curlHandle = curl_init(); /* * Set the required cURL options to successfully fire a request to MKM's API * * For more information about cURL options refer to PHP's cURL manual: * http://php.net/manual/en/function.curl-setopt.php */ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true); curl_setopt($curlHandle, CURLOPT_URL, $url); curl_setopt($curlHandle, CURLOPT_HTTPHEADER, array($header)); curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, false); /** * Execute the request, retrieve information about the request and response, and close the connection * * @var $content string Response to the request * @var $info array Array with information about the last request on the $curlHandle */ $content = curl_exec($curlHandle); $info = curl_getinfo($curlHandle); curl_close($curlHandle); /* * Convert the response string into an object * * If you have chosen XML as response format (which is standard) use simplexml_load_string * If you have chosen JSON as response format use json_decode * * @var $decoded \SimpleXMLElement|\stdClass Converted Object (XML|JSON) */ $xml = simplexml_load_string($content); $json = json_encode($xml); return $json;//string }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStockroom()\n {\n $this->load->model('stockroom/exchange');\n $response = $this->model_stockroom_exchange->getStockroom();\n if ($response) {\n foreach ($response as $stockroom) {\n $this->model_stockroom_exchange->parseStockroomResponse($stockroom);\n }\n }\n $flag = true;\n while ($flag) {\n $response = $this->model_stockroom_exchange->getAmount();\n if ($response) {\n foreach ($response as $product) {\n $this->model_stockroom_exchange->parseAmountResponse($product);\n }\n } else {\n $flag = false;\n }\n }\n if ($this->request->server['REQUEST_METHOD'] == 'GET') {\n $this->response->redirect(\n $this->url->link(\n 'stockroom/stockroom',\n 'user_token=' . $this->session->data['user_token'],\n true\n )\n );\n }\n }", "public function retrieve_inventory()\n {\n if (Authenticate::is_player()) {\n if (isset($_POST['token']) && Authenticate::is_valid_token($_POST['token'])) {\n $this->model_product = Product::getInstance();\n $this->model_material = Material::getInstance();\n $this->model_asset = Asset::getInstance();\n\n $product = $this->model_product->get_player_product();\n $material = $this->model_material->get_player_material();\n $asset = $this->model_asset->get_player_asset();\n\n $binding = array(\n \"result_var\" => \"session_ready\",\n \"product_var\" => json_encode($product, JSON_PRETTY_PRINT),\n \"material_var\" => json_encode($material, JSON_PRETTY_PRINT),\n \"asset_var\" => json_encode($asset, JSON_PRETTY_PRINT)\n );\n\n binding_data($binding);\n } else {\n transport(\"error404\");\n }\n } else {\n $binding = array(\"result_var\" => \"no_session\");\n binding_data($binding);\n }\n }", "function authGet() { }", "public function get_api_auth()\n {\n session_start();\n echo $_SESSION['api_auth'];\n }", "public function stock() {\n \n if ($this->session->userdata('validated')) {\n \n if ($this->MRecurso->validaRecurso(2)){\n\n /*Consulta Modelo para obtener listado de Productos creados*/\n $listProducts = $this->MProduct->list_products();\n /*Consulta Modelo para obtener listado de Grupos creados*/\n $listGroups = $this->MService->list_group_service();\n /*Retorna a la vista con los datos obtenidos*/\n $info['list_products'] = $listProducts;\n $info['list_groups'] = $listGroups;\n $this->load->view('products/stock',$info);\n \n } else {\n \n show_404();\n \n }\n \n } else {\n \n $this->load->view('login');\n \n }\n \n }", "public function getStock();", "public function login(){\n $wsLogin = new SoapClient($this->url . \"auth.asmx?wsdl\");\n\n try {\n $this->ticket = $wsLogin->Login(\n (object) array(\n \"Username\" => $this->username,\n \"Password\" => $this->password\n ))->LoginResult->ServiceTicket;\n } catch (Exception $e) {\n \n }\n\n }", "function login(){\n\t\t$apikey = $this->get_api_key();\n\t\t$apisecret = $this->get_api_secret();\n\t\t$authorization = $this->get_authorization();\n\t\t$user = new \\gcalc\\db\\api_user( $apikey, $apisecret, $authorization );\n\t\tif ( $user->login() ) {\n\t\t\t$credetials = $user->get_credentials();\t\t\t\t\n\t\t} else {\n\t\t\t$credetials = array(\n\t\t\t\t'login' => 'anonymous',\n\t\t\t\t'access_level' => 0\n\t\t\t);\n\t\t}\n\t\treturn $credetials;\n\t}", "public function authenticate($refresh = false)\n {\n $authClient = new Zend_Http_Client($this->_env . self::ENDPOINT_AUTH);\n $token = null;\n\n // if refresh true, use refresh, but if not set, use auth instead\n if ($refresh) {\n $token = Mage::getStoreConfig('stockbase_options/token/refresh');\n }\n\n // Possible that we dont have refresh token yet, then fallback on the auth token to present\n if (!$token) {\n $token = Mage::getStoreConfig('stockbase_options/token/auth');\n }\n\n // If we still dont have token, login first then.\n if ($token == null) {\n $token = $this->login();\n }\n\n $headers = array(\n 'Content-Type' => 'application/json',\n 'Authentication' => $token,\n );\n $authClient->setHeaders($headers);\n\n $result = json_decode($authClient->request('GET')->getBody());\n $response = $result->{'nl.divide.iq'};\n\n if ($response->answer == self::ANSWER_TOKEN_EXPIRED) {\n $this->login($this->username, $this->password);\n }\n\n if ($response->answer == self::ANSWER_SUCCESS) {\n if (isset($response->{'refresh_token'})) {\n Mage::getModel('core/config')\n ->saveConfig('stockbase_options/token/refresh', $response->{'refresh_token'});\n }\n Mage::getModel('core/config')\n ->saveConfig('stockbase_options/token/access', $response->{'access_token'});\n Mage::getModel('core/config')\n ->saveConfig('stockbase_options/token/access_expiration_date', $response->{'expiration_date'});\n\n\n return true;\n }\n\n return false;\n }", "public function index()\n {\n //\n // dd(Auth::user()->userstock()->get());\n $orders=Auth::user()->userstock()->get();\n // dd($orders);\n return view('farmer.stock.index',compact('orders'));\n }", "private function get_auth() {\n\n\t\t$options = array ('trace' => true, 'style' => SOAP_RPC, 'use' => SOAP_ENCODED);\n\n\t\t$params = array();\n\t\t$params [\"credential\"][\"Type\"] = $this->type;\n\t\t$params [\"credential\"][\"Username\"] = $this->username;\n\t\t$encodedPassword = md5(mb_convert_encoding($this->password, 'utf-16le', 'utf-8'));\n\t\t$params [\"credential\"][\"Password\"] = $this->password;\n\t\t$params [\"credential\"][\"ApplicationId\"] = $this->api_key;\n\n\t\t$params [\"credential\"][\"IdentityId\"] = $this->identity;\n\n\t\t//$authentication = new SoapClient ( \"https://webservices.24sevenoffice.com/authenticate/authenticate.asmx?wsdl\", $options );\n\t\t$authentication = new SoapClient ( \"https://api.24sevenoffice.com/authenticate/v001/authenticate.asmx?wsdl\", $options );\n\n\t\t$login = true;\n\n\t\tif (!empty($_SESSION['ASP.NET_SessionId']))\n\t\t{\n\t\t \n\t\t $authentication->__setCookie(\"ASP.NET_SessionId\", $_SESSION['ASP.NET_SessionId']);\n\t\t try\n\t\t {\n\t\t $login = !($authentication->HasSession()->HasSessionResult);\n\t\t }\n\t\t catch ( SoapFault $fault ) \n\t\t {\n\t\t $login = true;\n\t\t }\n\n\t\t}\n\n\t\tif( $login )\n\t\t{\n\t\t\t\n\t\t $result = ($temp = $authentication->Login($params));\n\t\t // set the session id for next time we call this page\n\t\t $_SESSION['ASP.NET_SessionId'] = $result->LoginResult;\n\t\t // each seperate webservice need the cookie set\n\t\t $authentication->__setCookie(\"ASP.NET_SessionId\", $_SESSION['ASP.NET_SessionId']);\n\t\t // throw an error if the login is unsuccessful\n\n\t\t\t/*echo \"<pre>\";\n\t\t\tprint_r( $authentication );\n\t\t\techo \"</pre>\";*/\n\t\t\t\n\t\t if($authentication->HasSession()->HasSessionResult == false)\n\t\t throw new SoapFault(\"0\", \"Invalid credential information.\");\n\t\t}\n\n\t}", "public function loginFreelanceBoutique() {\n $this->execGET('https://freelance.boutique/user/auth/login');\n //initial request for auth from freelance.ru\n $this->execGET('https://freelance.boutique/user/auth/freelanceru');\n }", "function Login() {\n if($this->state!=\"AUTHORIZATION\")\n $this->AddError(\"connection is not in AUTHORIZATION state\");\n if($this->apop) :\n $this->POP3Command(\"APOP $this->user \".md5($this->greeting.$this->password),$this->dummy);\n else :\n $this->POP3Command(\"USER $this->user\",$this->dummy);\n $this->POP3Command(\"PASS $this->password\",$this->dummy);\n endif;\n $this->state=\"TRANSACTION\";\n }", "function login() {\n\t\tif (isset($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\t\t\t$password = $_REQUEST['password'];\n\n\t\t\tinclude_once(\"login.php\");\n\n\t\t\t$log = new login();\n\t\t\t$authenticate = $log->userLogin($username, $password);\n\n\t\t\t// checking if bookings have been gotten from database\n\t\t\tif (!$authenticate) {\n\t\t\t echo '{\"result\":0,\"message\":\"Error authenticating\"}';\n\t\t\t return;\n\t\t\t}\n\n\t\t\t$row = $log->fetch();\n\t\t\tif (!$row) {\n\t\t\t echo '{\"result\":0, \"message\":\"username or password is wrong\"}';\n\t\t\t return;\n\t\t\t} else {\n\t\t\t\techo '{\"result\":1,\"userInfo\": ';echo json_encode($row);echo '}'; \n\t\t\t}\n\t\t}\n\t}", "public function auth()\n\t{\n\t\t$r = $this->do_auth();\n\t\t$x['status'] = $r;\n\t\techo json_encode($x);die;\n\t}", "public static function stockReadOne() {\n $stock_id = $_GET['id'];\n $results = ModelStock::getOne($stock_id);\n\n // ----- Construction chemin de la vue\n include 'config.php';\n $vue = $root . '/app/view/stock/viewAll.php';\n require ($vue);\n }", "public function beginLogin() {\n \n $this->info(\"beginning login...\");\n \n $status = $this->requestAuthentication($this->requestURL, $this->authURL);\n \n if(!$status) {\n $this->error(\"problem launching Yahoo authenication: \".$this->getError());\n }\n \n return true;\n }", "public function login($username = false, $password = false)\n {\n $loginClient = new Zend_Http_Client($this->_env . self::ENDPOINT_LOGIN);\n\n if ($username == false || $password == false) {\n $username = Mage::getStoreConfig('stockbase_options/login/username');\n $password = Mage::getStoreConfig('stockbase_options/login/password');\n }\n\n $headers = array(\n 'Content-Type' => 'application/json',\n 'Username' => $username,\n 'Password' => $password,\n );\n $loginClient->setHeaders($headers);\n\n $result = json_decode($loginClient->request('GET')->getBody());\n $response = $result->{'nl.divide.iq'};\n\n if ($response->answer == self::ANSWER_SUCCESS) {\n Mage::getModel('core/config')\n ->saveConfig('stockbase_options/token/auth', $response->{'authentication_token'});\n Mage::getModel('core/config')\n ->saveConfig('stockbase_options/token/auth_expiration_date', $response->{'expiration_date'});\n\n return $response->{'authentication_token'};\n }\n\n return false;\n }", "private function _login() {\n if( !$this->_connection->getCookieJar()->getCookie( $this->_baseUrl,\n 'auth_tkt', Zend_Http_CookieJar::COOKIE_OBJECT ) ) {\n $this->_connection->setUri( $this->_baseUrl . self::URL_LOGIN );\n $this->_connection->setParameterPost( array(\n 'login_username' => $this->_username,\n 'login_password' => $this->_password,\n 'back' => $this->_baseUrl,\n 'login' => 'Log In' ) );\n $this->_doRequest( Zend_Http_Client::POST );\n if( !$this->_connection->getCookieJar()->getCookie( $this->_baseUrl,\n 'auth_tkt', Zend_Http_CookieJar::COOKIE_OBJECT ) ) {\n throw new Opsview_Remote_Exception( 'Login failed for unknown reason' );\n }\n }\n }", "public function getStock(ApiRequest $request){\n $sifra = $request->sifra ? $request->sifra : $request->barkod;\n $barkod = $request->barkod ? $request->barkod : $request->sifra;\n\n $client = new Client();\n $data = $client->get('http://213.149.116.38/Donator/DonatorB2BJson.svc/getstock/'.$sifra.'/'.$barkod, ['auth' => ['SmartWeb', 'D0n@46!t0r2$73']]);\n\n $result = json_decode( $data->getBody() );\n return view('api.index', compact('result'));\n }", "protected function Auth()\n {\n if( !$this->Validate() ){\n throw new Exception(\"The connection could not be validated\");\n }\n\n $search = $_GET[\"openid_identity\"];\n $steamid = substr($search, strrpos($search, '/') + 1);\n \n $infos = $this->GetInfos($steamid);\n \n $infos = $this->ParseData($infos);\n\n $_SESSION[\"user\"] = $infos;\n\n $url = $this->redirectParams[\"openid.return_to\"];\n\n header(\"Location: $url\");\n exit(); \n }", "public function index()\n {\n return Stock::get();\n }", "public function connect()\n {\n $this->_client = new SoapClient($this->_magentoHost);\n $this->_session = $this->_client->login($this->_apiUser, $this->_apiKey);\n }", "public function getStockItem()\n\t\t{\n\t\t\t$this->layout = \"index\";\n\t\t\t$this->set('title', 'Stock Items (Linnworks API)');\n\t\t}", "protected function listProductStockStatsesRequest()\n {\n $resourcePath = '/product-stock-statuses';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\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 OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function index()\n {\n if (session('success_message')) {\n Alert::success('success', session('success_message'))->showConfirmButton('Close', '#0f9b0f');\n } elseif (session('error_message')) {\n Alert::error('error', session('error_message'))->showConfirmButton('Close', '#b92b53');\n }\n $this->authorize('viewAny',Product::class);\n $stocks = StockTake::query()->orderBy('created_at', 'desc')->get();\n return view('stockTake.index', compact('stocks'));\n }", "public function show(Stock $stock)\n {\n //\n }", "public function show(Stock $stock)\n {\n //\n }", "public function show(Stock $stock)\n {\n //\n }", "public function checkAuthorizationData() {\n \n $config = Mage::getModel('storesms/config');\n \n if ($config->isApiEnabled()==0) return;\n \n try {\n $creditsXML = Mage::getModel('storesms/apiClient')->getCredits();\n $ExceptionMessage = $creditsXML->requestError->serviceException->messageId;\n\n if ($ExceptionMessage=='UNAUTHORIZED') {\n throw new Exception(Mage::helper('storesms')->__($config::WRONG_AUTH_DATA));\n }\n else {\n Mage::getSingleton('core/session')->addSuccess(Mage::helper('storesms')->__('Success. Logged into Storesms API.'));\n }\n\n }\n catch (Exception $e) {\n Mage::getSingleton('core/session')->addError($e->getMessage());\n }\n \n }", "private function doLogin()\n {\n if (!isset($this->token)) {\n $this->createToken();\n $this->redis->set('cookie_'.$this->token, '[]');\n }\n\n $loginResponse = $this->httpRequest(\n 'POST',\n 'https://sceneaccess.eu/login',\n [\n 'form_params' => [\n 'username' => $this->username,\n 'password' => $this->password,\n 'submit' => 'come on in',\n ],\n ],\n $this->token\n );\n\n $this->getTorrentsFromHTML($loginResponse);\n }", "private function login(){\n \n }", "function wsSticker() {\n\t\tif (! $this->AccessTokenValid) {\n\t\t\t$Resultado=$this->AccessTokenResult;\n\t\t\treturn $Resultado;\t\t\n\t\t}\t\t\n\t\t$this->GetItems(\"Active=1 AND DatePublish<='\" . date('Y-m-d') . \"' AND DateExpire>='\". date('Y-m-d') . \"'\",false,\"DatePublish DESC, Orden DESC\");\n\t\tif ($this->ItemsCount>0) {\n\t\t\t$Resultado['Success']=1;\n\t\t\t$Resultado['Items']=$this->Items;\n\t\t} else {\n\t\t\t$Resultado['Success']=0;\n\t\t\t$Resultado['Result']=\"No records found\";\n\t\t}\n\t\treturn $Resultado;\n\t}", "public function OAuthAuthenticate()\n {\n throw new Exception( \"OAuthAuthenticate Not yet implemented\" );\n \n// $response = Auth1::legs(2)\n// ->set( 'key', $this->OAuthConsumerKey )\n// ->set( 'secret', $this->OAuthConsumerSecret )\n// ->request( $this->OAuthRequestURI );\n }", "public function get_login_data()\n\t{\n\t\tthrow new steam_exception( $this->get_login_user_name(), \"Error: get_login_data is not available using steam_connector_lite\", 980 );\n\t}", "public function index()\n {\n $userId = auth()->id();\n $data = Stocks::where('user_id', $userId)->with('user')->get();\n return view('backend.stocks.list', compact('data'));\n }", "public function authenticationReqd(){\n\t\theader('HTTP/1.0 401 Unauthorized');\n\t\t$this['app']['hologram']->setModule(\"WWW\")->log(\\Bakery\\Utilities\\Hologram::NORMAL, \"Response: Page requires authentication\");\r\n\t\t\n\t\t$_SESSION['redirect_to'] = $this['request']['uri'];\n\t\t\n\t\tif($this->isJson()){\n\n\t\t\treturn array(\"response\" => \"authentication required\");\n\t\t\t\n\t\t}\n\t\t\n\t\theader(\"Location: {$this['app']['security.login']['handler']}\");\n\t\t\n\t}", "public function login() {\n if (isset($_COOKIE['commerce_pos_cashiers'])) {\n $cashiers = unserialize($_COOKIE['commerce_pos_cashiers']);\n\n usort($cashiers, function ($a, $b) {\n return $a['timestamp'] - $b['timestamp'];\n });\n\n $cashiers = array_slice($cashiers, 0, 10);\n setcookie('commerce_pos_cashiers', serialize($cashiers),\n time() + 31557600, '/');\n }\n else {\n $cashiers = NULL;\n }\n\n /* @var $register \\Drupal\\commerce_pos\\Entity\\Register */\n $register = \\Drupal::service('commerce_pos.current_register')->get();\n if (isset($register)) {\n $store = $register->getStore();\n }\n else {\n /** @var \\Drupal\\commerce_store\\StoreStorageInterface $store_storage */\n $store_storage = \\Drupal::entityTypeManager()->getStorage('commerce_store');\n $store = $store_storage->loadDefault();\n }\n\n $status_messages = ['#type' => 'status_messages'];\n $messages = \\Drupal::service('renderer')->renderRoot($status_messages);\n\n // Delete the messages now that we've grabbed them, so they don't keep showing.\n $messenger = \\Drupal::messenger();\n $messenger->deleteAll();\n\n $page = [\n '#type' => 'page',\n '#theme' => 'commerce_pos_cashier_login_page',\n '#form' => \\Drupal::formBuilder()->getForm('Drupal\\commerce_pos\\Form\\CashierForm'),\n '#cashiers' => $cashiers,\n '#messages' => $messages,\n '#store_name' => $store->getName(),\n ];\n\n return $page;\n }", "function login() {\n $provider = \\Iternova\\Common\\Controller::get( 'provider' );\n\n // Proveedor\n switch ( $provider ) {\n case 'yahoo':\n $openid_url = 'http://me.yahoo.com';\n break;\n case 'google':\n $openid_url = 'https://www.google.com/accounts/o8/id';\n break;\n case 'facebook':\n $openid_url = 'facebook.anyopenid.com';\n break;\n case 'twitter':\n $openid_url = 'twitter.anyopenid.com';\n break;\n }\n\n if ( $provider === 'yahoo' || $provider === 'google' ) {\n // Usamos openID\n $openid = new LightOpenID;\n $openid->identity = $openid_url;\n $openid->returnUrl = 'http://zgzagua.es?action=login_confirm';\n $openid->required = [ 'namePerson/friendly', 'contact/email', 'namePerson', 'identityProvider/userId' ];\n echo '<script type=\"text/javascript\">$(location).attr(\\'href\\',\\'' . $openid->authUrl() . '\\');</script>';\n } elseif ( $provider === 'twitter' ) {\n // Usamos twitter oauth\n /* Start session and load library. */\n require_once( 'libs/twitter/twitteroauth/twitteroauth.php' );\n require_once( 'libs/twitter/config.php' );\n\n /* Build TwitterOAuth object with client credentials. */\n $connection = new TwitterOAuth( CONSUMER_KEY, CONSUMER_SECRET );\n\n /* Get temporary credentials. */\n $request_token = $connection->getRequestToken( OAUTH_CALLBACK );\n\n /* Save temporary credentials to session. */\n $_SESSION[ 'oauth_token' ] = $token = $request_token[ 'oauth_token' ];\n $_SESSION[ 'oauth_token_secret' ] = $request_token[ 'oauth_token_secret' ];\n echo '<script type=\"text/javascript\">$(location).attr(\\'href\\',\\'' . $connection->getAuthorizeURL( $token ) . '\\');</script>';\n }\n }", "public function index_get()\n\t{\n \n // inisiasi\n $item_price = 0;\n $total_price = 0;\n\n if(!empty($_SESSION[\"cart_item\"])) {\n \n $data = [];\n \n // prepare data & calculate total\n foreach($_SESSION[\"cart_item\"] as $k => $v) {\n \n array_push($data, $v);\n \n $item_price = (float)$_SESSION[\"cart_item\"][$k][\"qty\"]*$_SESSION[\"cart_item\"][$k][\"harga\"];\n $total_price += $item_price;\n }\n \n } else {\n $data = [];\n }\n \n $this->set_response([ 'status' => TRUE, 'data' => $data, 'total' => $total_price ], REST_Controller::HTTP_OK);\n }", "public function doAuthentication();", "private function getoken()\n {\n $data=[\n \"username\"=> $this->chronos_user,\n \"password\"=> $this->chronos_password\n ];\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.'login/');\n $client->setMethod(\\Zend_Http_Client::POST);\n $client->setHeaders(['Content-Type: application/json', 'Accept: application/json']);\n $client->setRawData(json_encode($data));\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $token_data=json_decode($string);\n if (property_exists($token_data,'non_field_errors')) {\n return false;\n }else{\n return $token_data->token;\n }\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos Product save helper', [\"error\"=>$e->getMessage()]);\n return false;\n }\n }", "private function authenticate()\n {\n $this->client->authenticate($this->token, null, Client::AUTH_HTTP_TOKEN);\n }", "public function signIn() {\n\t\t\n\t\t$newVoucher = VoucherProvider::getVoucher();\n\t}", "protected function restMarketsEbayAuthLoginGetRequest()\n {\n\n $resourcePath = '/rest/markets/ebay/auth/login';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function get_basket()\n\t\t{\n\t\tinclude(\"authheaders.php\");\n\t\t$basketURL=$_COOKIE[\"basket\"];\n\t\t$header[] = createSprdAuthHeader(\"Get\", $basketURL);\n\t\t$header[] = \"Content-Type: application/xml\";\n\t\t$ch = curl_init($basketURL);\n\t\tcurl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, false);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $header);\n\t\t$result = curl_exec($ch);\n\t\t$result=new SimpleXMLElement($result);\n\t\techo $result->asXML();\n\t\tcurl_close($ch);\n\t\tdie();\n\t\t}", "function get_stock_price_url($curl_user_pass) {\r\n $url = $curl_user_pass['url'];\r\n\r\n $ch = curl_init();\r\n\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n// curl_setopt($ch, CURLOPT_FILE, $out);\r\n curl_setopt($ch, CURLOPT_HEADER, 0);\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_USERPWD, $curl_user_pass['user_pass']);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\r\n $xml = curl_exec($ch);\r\n return $xml;\r\n}", "public function actionProduct_stock_info() {\r\n\r\n if ((Yii::app()->user->isGuest) || (!Yii::app()->request->isAjaxRequest)) {\r\n throw new CHttpException(403, 'Access Forbidden.');\r\n }\r\n\r\n $prod_id = Yii::app()->request->getParam('prod_id');\r\n $ref_num = Yii::app()->request->getParam('ref_num');\r\n\r\n $cost = 0;\r\n $price = 0;\r\n $cur_stock = 0;\r\n\r\n $model = new ProductStockEntries();\r\n $model = $model->getProductStockInfo($prod_id, $ref_num);\r\n\r\n if (!empty($model)) {\r\n $cost = ( empty($model['productDetails']->purchase_price) || ($model['productDetails']->purchase_price <= 0 ) ) ? $model->purchase_price : $model['productDetails']->purchase_price;\r\n $price = ( empty($model['productDetails']->selling_price) || ($model['productDetails']->selling_price <= 0 ) ) ? $model->selling_price : $model['productDetails']->selling_price;\r\n $cur_stock = $model['productDetails']['productStockAvails']->quantity;\r\n }\r\n\r\n $response['cost'] = $cost;\r\n $response['price'] = $price;\r\n $response['cur_stock'] = $cur_stock;\r\n\r\n echo CJSON::encode($response);\r\n exit;\r\n }", "protected static function login() {\n $wsdl = FS_APP_ROOT.'/lib/third_party/salesforce/soapclient/partner.wsdl.xml';\n\n if (self::getSessionData('salesforce_sessionId') == NULL) {\n self::getConn()->createConnection($wsdl);\n self::getConn()->login(self::$_username, self::$_password . self::$_token);\n\n // Now we can save the connection info for the next page\n self::setSessionData('salesforce_location', self::getConn()->getLocation());\n self::setSessionData('salesforce_sessionId', self::getConn()->getSessionId());\n self::setSessionData('salesforce_wsdl', $wsdl);\n } else {\n // Use the saved info\n self::getConn()->createConnection(self::getSessionData('salesforce_wsdl'));\n self::getConn()->setEndpoint(self::getSessionData('salesforce_location'));\n self::getConn()->setSessionHeader(self::getSessionData('salesforce_sessionId'));\n }\n }", "public function getStockById($id)\n {\n $stock = stock::where('id',$id)\n ->first();\n\n if ($stock) {\n return $this->generalResponse(true,200,'success', null,$stock);\n } else {\n return $this->generalResponse(false,404,'stock not found', null,null);\n }\n }", "public function get() {\n $index_id = $this->path[0] ?? false;\n if (!$index_id) {\n require(HTML . '/locker.php');\n die();\n\n } elseif ($index_id === '_index') {\n // calling /locker/_index pulls a sorted index array\n $data = $this->_get_index();\n\n } else {\n // load the locker data object\n $data = models\\Locker::findOne(['id' => $index_id, 'accountId' => models\\Account::current()->id]);\n }\n\n $this->send($data);\n }", "public function login()\n {\n// в качестве проверемого именпи можно использовать name или email\n $credentials = request(['email', 'password']);\n\n if (! $token = auth()->attempt($credentials)) {\n return response()->json(['error' => 'Unauthorized'], 401);\n }\n\n $this->setBindExchangeRabbitMQ($credentials['email'], 'bind');\n return $this->respondWithToken($token);\n }", "public function authentication()\n {\n }", "public function login()\n\t{\n\t\tredirect($this->config->item('bizz_url_ui'));\n\t\t// show_404();\n\t\t// ////import helpers and models\n\n\t\t// ////get data from database\n\n\t\t// //set page info\n\t\t// $pageInfo['pageName'] = strtolower(__FUNCTION__);\n\n\t\t// ////sort\n\t\t\n\t\t// //render\n\t\t// $this->_render($pageInfo);\n\t}", "public function auth(){\n if(empty($_COOKIE[\"utoken\"])){\n $cookie_value = $this->uuid();\n $this->utoken = $cookie_value;\n $this->setHeader($this->utoken);\n }else{\n $this->utoken = $_COOKIE[\"utoken\"];\n $this->setHeader($this->utoken);\n }\n }", "public function authenticate();", "public function authenticate();", "public function authenticate();", "function login()\n\t{\n\t\t$GLOBALS['appshore']->session->createSession();\n\n\t\t$GLOBALS['appshore_data']['layout'] = 'auth';\n\t\t\n\t\t// define next action\n\t\t$result['action']['auth'] = 'login';\n\n\t\t// if a query_string was passed without being auth we keep it to deliver it later\n\t\tif( strpos( $_SERVER[\"QUERY_STRING\"], 'op=') !== false )\n\t\t\t$result['nextop'] = base64_encode($_SERVER[\"QUERY_STRING\"]);\n\t\t\t\n\t\treturn $result;\n\t}", "function get_espacio_stock($id)\n\t{\n\t\t// Create a temporary user object\n\t\t$u = new Espacio_stock();\n\t\t//Buscar en la base de datos\n\t\t$u->get_by_id($id);\n\t\tif($u->c_rows ==1){\n\t\t\treturn $u;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function test_you_have_to_be_authenticated()\n {\n $this->json('get' , 'api/cart')->assertStatus(401);\n\n }", "abstract public function getCredentials();", "public function showStock($id)\n\t{\n\t\treturn $this->stock->where('id',$id)->first();\n\t}", "protected function loginAuthenticate(){\n\n\t\t\n\t}", "public function authentication()\n {\n $response = new RESTAPI_CLASS_Response();\n $headers = self::getRequestHeaders();\n if (!isset($headers['Authorization'])) {\n return $response->error(401, \"Token is not exist.\");\n }\n\n $auth = explode(' ', $headers['Authorization']);\n if ($model = RESTAPI_BOL_Service::getInstance()->checkToken($auth[1])) {\n $this->token = $auth[1];\n return $model;\n } else {\n return $response->error(401, \"Your access denied.\");\n }\n }", "public function authorize()\n {\n return session('storefront_key');\n }", "public function accessAction() {\n if (!$_SESSION['request_token']) {\n return self::redirect('request');\n }\n\n $tok = $_SESSION['request_token'];\n $this->api->setOAuthToken($tok->getKey(), $tok->getSecret());\n $this->api->login('access')->post()->loadTokenFromResponse();\n $_SESSION['access_token'] = $this->api->getOAuthToken();\n $_SESSION['username'] = $this->api->getUsername();\n $_SESSION['subdomain'] = $this->api->getSubdomain();\n\n return self::redirect('index');\n }", "function doLogin($username, $password) {\n\tglobal $apiBaseURL; // bad practice in production - fine for this example\n\n\t// use the getURL function to call the URL - remember we are calling the companyFileGUID from the session vars\n\t$response = getURL($apiBaseURL.$_SESSION['companyFileGUID'].'/', $username, $password);\n\n\t// it returned as JSON so lets decode it\n\t$response = json_decode($response);\n\n\t// now given the API doens't have an explicit login function lets check the credentails\n\tif(@$response->Message === 'Access denied') {\n\t\t// failed\n\t\treturn(FALSE);\n\t} else {\n\t\t// passed\n\t\treturn(TRUE);\n\t}\n\n\n}", "public function index() {\n $data = UserStock::where('flag', '=', '1')->get();\n \n return view('store.manageUserStock')->with('userStocks', $data);\n }", "public function authenticateSecondFactor() {\t \t \t\t \n\t \n\t $module = $this->getModule();\n\t \n\t\t$authParams = array(\n\t\t\t'module' => $module,\n\t\t);\n\t\t\n\t\tif ($module == RublonMagentoModule::CONNECT) {\n\t\t $callbackUrl = $this->getCallbackUrl($connect = true);\n\t\t} else {\n\t\t $callbackUrl = $this->getCallbackUrl();\n\t\t}\n\t\t\t\t\n\t\t$userId = $this->getAuthUserId();\n\t\t$email = $this->getAuthUserEmail(); \n\t\t\n\t\t$this->clearLoggedUser();\n \n try {\n \n $authUrl = $this->service->auth($callbackUrl, $userId, $email, $authParams); \n if (!empty($authUrl)) {\n \n // Retrive cached rublon features\n RublonFeature::getFeatures();\n \n $this->redirect($authUrl);\n } else {\n // do nothing\n }\n \n } catch (RublonException $e) {\n \n $notifierOptions = array(\n 'Method' => __METHOD__,\n 'Line' => __LINE__,\n 'Trace' => $e->getTraceAsString()\n );\n \n $this->addError($e, $notifierOptions);\n }\n\t}", "private function _login(){\r\n\r\n // It will always be called via ajax so we will respond as such\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n try {\r\n\r\n\r\n $username = $_POST['username'];\r\n $password = $_POST['password'];\r\n\r\n $path = ROOT.'/site/config/auth.txt';\r\n $adapter = new AuthAdapter($path,\r\n 'MRZPN',\r\n $username,\r\n $password);\r\n\r\n //$result = $adapter->authenticate($username, $password);\r\n\r\n $auth = new AuthenticationService();\r\n $result = $auth->authenticate($adapter);\r\n\r\n\r\n if(!$result->isValid()){\r\n $result->error = \"Incorrect username and password combination!\";\r\n /*\r\n foreach ($result->getMessages() as $message) {\r\n $result->error = \"$message\\n\";\r\n }\r\n */\r\n } else {\r\n $response = 200;\r\n $result->url = WEBROOT;\r\n }\r\n\r\n\r\n\r\n } catch (Exception $e) {\r\n $result->error = $e->getMessage();\r\n }\r\n\r\n }\r\n\r\n // Return the response\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n }", "public function index()\n\t{\n\t\t$uagent = \"Opera/9.80 (Windows NT 6.1; WOW64) Presto/2.12.388 Version/12.14\";\n\t\t$url = \"http://phisix-api3.appspot.com/stocks.json\";\n\t\t$ch = curl_init( $url );\n\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // возвращает веб-страницу\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0); // не возвращает заголовки\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // переходит по редиректам\n\t\tcurl_setopt($ch, CURLOPT_ENCODING, \"\"); // обрабатывает все кодировки\n\t\tcurl_setopt($ch, CURLOPT_USERAGENT, $uagent); // useragent\n\t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120); // таймаут соединения\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 120); // таймаут ответа\n\t\tcurl_setopt($ch, CURLOPT_MAXREDIRS, 10); // останавливаться после 10-ого редиректа\n\n\t\t$content = curl_exec( $ch );\n\t\t$err = curl_errno( $ch );\n\t\t$errmsg = curl_error( $ch );\n\t\t$header = curl_getinfo( $ch );\n\t\tcurl_close( $ch );\n\n\t\t$header['errno'] = $err;\n\t\t$header['errmsg'] = $errmsg;\n\t\t$header['content'] = $content;\n\t\tif (($header['errno'] != 0 )||($header['http_code'] != 200))\n\t\t{\n\t\t\treturn $header['errmsg'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $header['content'];\n\t\t}\n\t}", "function authenticate() {}", "public function indexAction() {\n //on Magento\n\n /*$params = array(\n 'siteUrl' => Mage::getBaseUrl().'oauth',\n 'requestTokenUrl' => Mage::getBaseUrl().'oauth/initiate',\n 'accessTokenUrl' => Mage::getBaseUrl().'oauth/token',\n 'authorizeUrl' => Mage::getBaseUrl().'admin/oauth_authorize', //This URL is used only if we authenticate as Admin user type\n 'consumerKey' => 'e996e92b728faac307eb86b7b015087a', //7d847a959fe5d9ea2a39751af2d0f8b8 Consumer key registered in server administration\n 'consumerSecret' => '20c61e1ff1d130e4c7b8076e9873f49c', //041b68bca247bee7d733fb7c17fe8028 Consumer secret registered in server administration\n 'callbackUrl' => Mage::getBaseUrl().'restapi/index/callback', //Url of callback action below\n );\n\n\n $oAuthClient = Mage::getModel('restapi/api');\n $oAuthClient->reset();\n\n $oAuthClient->init($params);\n $oAuthClient->authenticate();\n\n return;*/\n }", "function post_order( $login, $json ) {\n\n\t// Get url from database\n\t$domain = $login['domain'];\n\t// Get username from database\n\t$username = $login['username'];\n\t// Get password from database\n\t$password = $login['pass'];\n\n\t// Query the i.LEVEL API for Stock information\n\t$order = post_to_ilevel( $domain.'/api/retailorder', $username, $password, $json );\n\n\t// Check if the response has any stock information\n\tif ( $order ) {\n\n\t\treturn true;\n\n\t}\n\n}", "public function authenticateAction() {\n try {\n $this->authenticationManager->authenticate();\n $this->addFlashMessage('Erfolgreich angemeldet.');\n $this->redirect('index', 'Marketplace');\n } catch (\\TYPO3\\Flow\\Exception $exception) {\n // Prüft ob eine Fehlernachricht vorhanden ist. Wenn ja zeigt diese an.\n if($exception->getMessage()){\n $this->addFlashMessage('Falscher Benutzername oder Passwort!'/* . $exception->getMessage()*/);\n //$this->addFlashMessage($exception->getMessage());\n $this->redirect('index', 'Login');\n }\n }\n }", "function login()\n\t{\n\t\t$url = $this->url;\n\t\t$url = $url . \"/oauth2/token\";\n\n\t\t$oauth2_token_parameters = array(\n\t\t\t\"grant_type\" => \"password\",\n\t\t\t\"client_id\" => \"sugar\",\n\t\t\t\"client_secret\" => \"\",\n\t\t\t\"username\" => $this->username,\n\t\t\t\"password\" => $this->password,\n\t\t\t\"platform\" => \"base\"\n\t\t);\n\n\t\t$oauth2_token_result = self::call($url, '', 'POST', $oauth2_token_parameters);\n\n\t\tif ( empty( $oauth2_token_result->access_token ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $oauth2_token_result->access_token;\n\t}", "public function authentication(): void\n {\n $oauthParams = [\n 'clientId' => $this->config['clientId'],\n 'clientSecret' => $this->config['clientSecret'],\n 'redirectUri' => $this->config['callbackUrl'],\n ];\n\n $auth = new OAuth($oauthParams);\n\n if (isset($_GET['code'])) {\n $token = $auth->getAccessToken('authorization_code', ['code' => $_GET['code']]);\n\n $this->accessToken = $token->getToken();\n $this->refreshToken = $token->getRefreshToken();\n $this->instanceUrl = $token->getInstanceUrl();\n $this->tokenExpiry = $token->getExpires();\n\n } else {\n header('Location: '.$auth->getAuthorizationUrl());\n die();\n }\n }", "public function show(Stock $stock)\n {\n return $stock;\n }", "abstract public function credentials();", "function get_espacio_stocks()\n\t{\n\t\t// Create a temporary user object\n\t\t$e = new Espacio_stock();\n\t\t//Buscar en la base de datos\n\t\t$e->where('estatus_general_id','1');\n\t\t$e->get();\n\t\tif($e->c_rows>0){\n\t return $e;\n\t\t} else {\n\t return FALSE;\n\t\t}\n\t}", "Public Function login()\n\t{\n\t\t$Arr = array();\n\t\t\n\t\t$Arr['a'] = 'login';\n\t\t$Arr['j'] = '';\n\t\t$Arr['LogType'] = 'a';\n\t\t$Arr['UserName'] = $this->publisherLogin;\n\t\t$Arr['Password'] = $this->publisherPassword;\n\t\t\n\t\t\n\t\t$this->loginUrl\t= 'https://secure.essociate.com/login';\n\t\t\n\t\t$postdata = '';\n\t\tforeach ($Arr as $Key => $Value)\n\t\t{\n\t\t\t$postdata .= urlencode($Key).'='.urlencode($Value).'&';\n\t\t}\n\t\t\n\t\t$arrParams = array('CURLOPT_SSL_VERIFYPEER' => FALSE,\n\t\t\t\t\t\t'CURLOPT_USERAGENT' => \"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6\",\n\t\t\t\t\t\t'CURLOPT_TIMEOUT' => 60,\n\t\t\t\t\t\t'CURLOPT_FOLLOWLOCATION' => 1,\n\t\t\t\t\t\t'CURLOPT_COOKIEJAR' => sys_get_temp_dir().'/cookiemonster'.md5($this->publisherLogin).'.txt',\n\t\t\t\t\t\t'CURLOPT_COOKIEFILE' => sys_get_temp_dir().'/cookiemonster'.md5($this->publisherLogin).'.txt',\n\t\t\t\t\t\t'CURLOPT_REFERER' => $this->loginUrl,\n\t\t\t\t\t\t'CURLOPT_POSTFIELDS' => $postdata,\n\t\t\t\t\t\t'CURLOPT_POST' => 1,\n\t\t\t\t\t\t'CURLOPT_HEADER' => 1);\n\t\t$Header = $this->curlIt($this->loginUrl, $arrParams);\n\t\t\n\t\tif (strstr($Header, 'Summary for Today')) \n\t\t{\n\t\t\treturn true;\t\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function login();", "public function login();", "public function read_credentials() {\n\t\t$user = ! empty( $_POST['connection']['kt_user'] ) ? sanitize_text_field( $_POST['connection']['kt_user'] ) : '';\n\t\t$password = ! empty( $_POST['connection']['kt_password'] ) ? sanitize_text_field( $_POST['connection']['kt_password'] ) : '';\n\n\t\tif ( empty( $user ) || empty( $password ) ) {\n\t\t\treturn $this->error( __( 'Email and password are required', 'thrive-dash' ) );\n\t\t}\n\n\t\t$this->set_credentials( array(\n\t\t\t'user' => $user,\n\t\t\t'password' => $password,\n\t\t) );\n\n\t\t/** @var Thrive_Dash_Api_KlickTipp $api */\n\t\t$api = $this->get_api();\n\n\t\ttry {\n\t\t\t$api->login();\n\n\t\t\t$result = $this->test_connection();\n\n\t\t\tif ( $result !== true ) {\n\t\t\t\treturn $this->error( sprintf( __( 'Could not connect to Klick Tipp using the provided data: %s', 'thrive-dash' ), $this->_error ) );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * finally, save the connection details\n\t\t\t */\n\t\t\t$this->save();\n\n\t\t\treturn $this->success( __( 'Klick Tipp connected successfully!', 'thrive-dash' ) );\n\n\t\t} catch ( Thrive_Dash_Api_KlickTipp_Exception $e ) {\n\t\t\treturn $this->error( sprintf( __( 'Could not connect to Klick Tipp using the provided data (%s)', 'thrive-dash' ), $e->getMessage() ) );\n\t\t}\n\t}", "public function login()\n\t{\n\n\t\ttry {\n\t\t\t$error = $this->getRequest()->getSession()->get('api.error');\n\t\t\t$this->getRequest()->getSession()->remove('api.error');\n\t\t\treturn compact('error');\n\t\t} catch (ValueNotFoundException $e) {\n\n\t\t}\n\t}", "public function index()\n {\n if (Auth::check()) {\n\n $products = Cart::where('user_id',Auth::id())->get();\n\n return response()->json($products);\n\n }\n\n return response()->json(\"User is not logged in.\");\n\n \n }", "function ppt_resources_get_usd_stocks($data)\n{\n// return $data;\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid'])) {\n $uid = $data['uid'];\n } else {\n global $user;\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n//return entity_metadata_wrapper('field_collection_item', 18045);\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $reports = sum_records_per_field($entries_records, 'field_product', TRUE);\n return $reports;\n}", "public function qelasyLoginAction(){\n \n \n /*$url = \"http://silk-outsourcing.com/qelasysecurity/web/index.php/api/default/appStoreAuthentication\";\n $client = new Zend_Http_Client($url);\n $client->setHeaders(array(\n 'X-USERNAME:non-qelasy-stg',\n 'X-PASSWORD:non-qelasy-stg',\n 'Content-Type:application/x-www-form-urlencoded'\n ));\n\n $client->setParameterGet(array(\n 'email' => '[email protected]',\n 'pin' => 'dumindu',\n 'type' => 1\n ));\n \n $response = $client->request(Zend_Http_Client::POST); \n echo htmlspecialchars($client->getLastRequest(), ENT_QUOTES).'<br><br>';\n echo '--------------------------------------------------------<br><br>';\n echo htmlspecialchars($client->getLastResponse(), ENT_QUOTES).'<br><br>';\n echo '---------------------------------------------------------<br><br>';\n \n echo $response->getRawBody();\n //$results = json_decode($response->getRawBody(), true);\n //print_r($results);\n die();*/\n\n \n $uri = 'http://silk-outsourcing.com/qelasysecurity/web/index.php/api/default/appStoreAuthentication';\n\n $config = array(\n 'adapter' => 'Zend_Http_Client_Adapter_Curl',\n 'curloptions' => array(CURLOPT_FOLLOWLOCATION => true),\n );\n $client = new Zend_Http_Client($uri, $config);\n\n $client->setHeaders(array(\n 'X-USERNAME:non-qelasy-stg',\n 'X-PASSWORD:non-qelasy-stg',\n 'Content-Type:application/x-www-form-urlencoded'\n ));\n \n /*$data = array(\n 'email' => '[email protected]',\n 'pin' => 'dumindu',\n 'type' => '1'\n );*/\n\n /*$client->setParameterGet(array(\n 'email' => '[email protected]',\n 'pin' => 'dumindu',\n 'type' => 1\n ));*/\n \n $data = '[email protected]&pin=dumindu&type=1';\n //$data = 'studentId=113&pin=dumindu&type=0';\n //$json = json_encode($data);\n\n $resp = $client->setRawData($data, 'application/x-www-form-urlencoded')->request('POST');\n\n echo htmlspecialchars($client->getLastRequest(), ENT_QUOTES).'<br><br>';\n echo '--------------------------------------------------------<br><br>';\n echo htmlspecialchars($client->getLastResponse(), ENT_QUOTES).'<br><br>';\n echo '---------------------------------------------------------<br><br>';\n \n echo $results = $resp->getBody();\n\n echo '---------------------------------------------------------<br><br>';\n \n $phpNative = Zend_Json::decode($results);\n print_r($phpNative);\n \n echo '---------------------------------------------------------<br><br>';\n \n try {\n $json = Zend_Json::decode($results);\n\n print_r($json);\n } catch (Exception $ex) {\n echo \"failed to decode json\";\n }\n \n exit();\n \n }", "public function index()\n {\n $api_key = config('shopify-app.api_key');\n $shared_secret = config('shopify-app.api_secret');\n $params = $_GET; // Retrieve all request parameters\n $hmac = $_GET['hmac']; // Retrieve HMAC request parameter\n\n $params = array_diff_key($params, array('hmac' => '')); // Remove hmac from params\n ksort($params); // Sort params lexographically\n\n $computed_hmac = hash_hmac('sha256', http_build_query($params), $shared_secret);\n\n $access_token = \"\";\n // Use hmac data to check that the response is from Shopify or not\n if (hash_equals($hmac, $computed_hmac)) {\n\n // Set variables for our request\n $query = array(\n \"client_id\" => $api_key, // Your API key\n \"client_secret\" => $shared_secret, // Your app credentials (secret key)\n \"code\" => $params['code'] // Grab the access key from the URL\n );\n\n // Generate access token URL\n $access_token_url = \"https://\" . $params['shop'] . \"/admin/oauth/access_token\";\n\n // Configure curl client and execute request\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_URL, $access_token_url);\n curl_setopt($ch, CURLOPT_POST, count($query));\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($query));\n $result = curl_exec($ch);\n curl_close($ch);\n\n // Store the access token\n $result = json_decode($result, true);\n $access_token = $result['access_token'];\n\n // Show the access token (don't do this in production!)\n // echo $access_token;\n } else {\n // Someone is trying to be shady!\n die('This request is NOT from Shopify!');\n }\n\n // 获取shop信息\n }", "public function financial()\n {\n if ($_SESSION['role'] == 1)\n { \n $this->view('AdminDashboard/financial', ['viewName' => 'Dashboard - Financial']);\n }\n else\n {\n header('location: '.URL.'Login');\n }\n }", "public function indexAction() {\n //on Magento\n $params = array(\n 'siteUrl' => 'http://monday.local.com/oauth',\n 'requestTokenUrl' => 'http://monday.local.com/oauth/initiate',\n 'accessTokenUrl' => 'http://monday.local.com/oauth/token',\n 'authorizeUrl' => 'http://monday.local.com/admin/oAuth_authorize', //This URL is used only if we authenticate as Admin user type\n 'consumerKey' => '3917a9e68c8d9b809fcd673d42ebc48e', //Consumer key registered in server administration\n 'consumerSecret' => 'b379a257ad5e3e1bde25a41da76262b5', //Consumer secret registered in server administration\n 'callbackUrl' => 'http://monday.local.com/mackapi/index/callback', //Url of callback action below\n );\n \n \n $oAuthClient = Mage::getModel('mack_api/oauth_client');\n $oAuthClient->reset();\n \n $oAuthClient->init($params);\n $oAuthClient->authenticate();\n \n return;\n }", "protected function login() {\n $login_response = $this->call('\n <Envelope>\n <Body>\n <Login>\n <USERNAME>' . $this->username . '</USERNAME>\n <PASSWORD>' . $this->password . '</PASSWORD>\n </Login>\n </Body>\n </Envelope>\n ');\n\n if (!$login_response) {\n // Connection failure (curl returned FALSE).\n throw new SilverpopConnectionException('Could not find the Silverpop XMLAPI at the address \"' . $this->endpoint . '\".');\n }\n\n $xml = new DOMDocument('1.0', 'iso-8859-1');\n $xml->loadXML($login_response);\n $fault_tags = $xml->getElementsByTagName('FaultString');\n $fault_codes = $xml->getElementsByTagName('errorid');\n $id_tag = $xml->getElementsByTagName('SESSIONID');\n\n // Received a fault response from Silverpop.\n if ($fault_tags->length > 0) {\n $message = $fault_tags->item(0)->nodeValue;\n $code = $fault_codes->item(0)->nodeValue;\n throw new SilverpopConnectionException('Could not connect to the Silverpop XMLAPI. Silverpop says: \"' . $message . '\".', $code);\n }\n\n // No fault response and no session ID -- bad endpoint.\n elseif ($id_tag->length == 0) {\n throw new SilverpopConnectionException('Could not find the Silverpop XMLAPI at the address \"' . $this->endpoint . '\".');\n }\n\n // Successfully retrieved session ID.\n else {\n $this->sessionID = $id_tag->item(0)->nodeValue;\n }\n }", "private function auth()\n {\n if (!$this->username)\n {\n throw new PhpOpenSIPsException(\"Missing username\");\n }\n \n if (!$this->password)\n {\n throw new PhpOpenSIPsException(\"Missing password\");\n }\n \n // realm\n $result = array();\n if (!preg_match('/^Proxy-Authenticate: .* realm=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpOpenSIPsException(\"Can't find realm in proxy-auth\");\n }\n \n $realm = $result[1];\n \n // nonce\n $result = array();\n if (!preg_match('/^Proxy-Authenticate: .* nonce=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpOpenSIPsException(\"Can't find nonce in proxy-auth\");\n }\n \n $nonce = $result[1];\n \n $ha1 = md5($this->username.':'.$realm.':'.$this->password);\n $ha2 = md5($this->method.':'.$this->uri);\n \n $res = md5($ha1.':'.$nonce.':'.$ha2);\n \n $this->auth = 'Proxy-Authorization: Digest username=\"'.$this->username.'\", realm=\"'.$realm.'\", nonce=\"'.$nonce.'\", uri=\"'.$this->uri.'\", response=\"'.$res.'\", algorithm=MD5';\n }", "function getInfo($string){\n $sym = $string;\n try {\n //Create a request but don't send it immediately\n $client = new Client();\n\n //$Client is server we are using to connect server API\n $client = new GuzzleHttp\\Client(['base_url' => '192.168.1.109']);\n\n //This 'page' is the one we use to gather Stock Information\n $response = $client->get('192.168.1.109:9090/stocks?sym='.$sym);\n \n $getInfo = $response->getBody();\n } catch (Exception $e) {\n echo \"ay, caught exception \", $e->getMessage();\n }\n return $getInfo;\n}", "public function ZohoAPI($cadlogin = false) {\n \t \t $this->setData(get_option(\"zoho_texto_data\"));\n \t \t $this->setLogin(get_option(\"zoho_texto_login\"));\n \t \t $this->setSenha(get_option(\"zoho_texto_senha\"));\n \t \t $this->setTicket(get_option(\"zoho_texto_ticket\"));\n \t \t //Verifica a direfença entre as datas\n \t \t $dif = $this->dif_datas(date('d/m/Y'),ZohoAPI::Vencimento($this->getData()));\n \t \t //Verifica se a diferença entre as datas está vencida e se é atualização de login e senha. \n \t \t if (($dif <= 0) || ($cadlogin)) {\n \t \n \t \t \t $r = new HTTP_Request($this->urlTicket);\n \t \t \t $r->setMethod(\"GET\");\n \t \t \t $r->addQueryString('servicename','ZohoInvoice');\n \t \t \t $r->addQueryString('FROM_AGENT','true');\n \t \t \t $r->addQueryString('LOGIN_ID',$this->getLogin());\n \t \t \t $r->addQueryString('PASSWORD',$this->getSenha());\n \t \t \t $r->sendRequest();\n \t \t \t $retorno = $r->getResponseBody();\n \t \t \t $linhas = explode(\"\\n\", $retorno);\n\n \t \t \t foreach ($linhas as $linha)\n \t \t \t {\n \t \t \t \t if (strpos($linha, \"=\") !== false)\n \t \t \t \t {\n \t \t \t \t \t $valorItem = explode(\"=\", $linha);\n \t \t \t \t \t \n \t \t \t \t \t if (count($valorItem) == 2)\n \t \t \t \t \t {\n \t \t \t \t \t \t $valor[$valorItem[0]] = $valorItem[1];\n \t \t \t \t \t } else {\n \t \t \t \t \t \t $this->setErro('Erro na hora de extrair!');\n \t \t \t \t \t }\n \t \t \t \t }\n \t \t \t \t elseif (strpos($linha, \"#\") !== false)\n \t \t \t \t {\n \t \t \t \t \t if (strlen($linha) > 5)\n \t \t \t \t \t {\n \t \t \t \t \t \t $data = date('d/m/Y', strtotime(substr($linha, 1)));\n \t \t \t \t \t }\n \t \t \t \t }\n \t \t \t }\n\n \t \t \t if ($valor['RESULT'] == 'FALSE') {\n \t \t \t \t $this->setErro('Erro Zoho: ' . $valor['CAUSE']); \n \t \t \t } else {\n \t \t \t \t $this->setTicket($valor['TICKET']);\n \t \t \t \t $this->setData(ZohoAPI::Vencimento($data,6));\n\n \t \t \t \t update_option(\"zoho_texto_ticket\",$this->getTicket());\n \t \t \t \t update_option(\"zoho_texto_data\",$this->getData()); \t \t \t \t \n \t \t \t }\t\n \t \t }\n \t }", "public function action_login() {\n try {\n $i = Input::post();\n $auth = new \\Craftpip\\OAuth\\Auth();\n $auth->logout();\n if (\\Auth::instance()\n ->check()\n ) {\n $response = array(\n 'status' => true,\n 'redirect' => dash_url,\n );\n }\n else {\n $user = $auth->getByUsernameEmail($i['email']);\n if (!$user) {\n throw new \\Craftpip\\Exception('The Email or Username is not registered with us.');\n }\n $auth->setId($user['id']);\n\n $a = $auth->login($i['email'], $i['password']);\n if ($a) {\n $isVerified = $auth->getAttr('verified');\n if (!$isVerified) {\n $auth->logout();\n throw new \\Craftpip\\Exception('Your account is not activated, please head to your Email & activate your Gitftp account.');\n }\n\n $response = array(\n 'status' => true,\n 'redirect' => dash_url,\n );\n }\n else {\n throw new \\Craftpip\\Exception('The username & password did not match.');\n }\n }\n } catch (Exception $e) {\n $e = new \\Craftpip\\Exception($e->getMessage(), $e->getCode());\n $response = array(\n 'status' => false,\n 'reason' => $e->getMessage(),\n );\n }\n\n echo json_encode($response);\n }", "function auth() {\n header('WWW-Authenticate: Basic realm=\"Citations\"');\n header('HTTP/1.0 401 Unauthorized');\n print 'authorisation required';\n exit;\n }", "function _getHellaspayIntoSession() {\r\n\t$session = JFactory::getSession();\r\n\t$hellaspaySession = $session->get('hellaspay', 0, 'vm');\r\n\tif (!empty($hellaspaySession)) {\r\n\t $hellaspayData = json_decode($hellaspaySession);\r\n\t $this->_vivinstalments = $hellaspayData->vivinstalments;\r\n\t\t$this->_vivinstalmentsamount = $hellaspayData->vivinstalmentsamount;\r\n\t}\r\n }", "public function login()\n {\n $loginPostArray = $this->_getLoginPostArray();\n \n // Reset the client\n //$this->_client->resetParameters();\n \n // To turn cookie stickiness on, set a Cookie Jar\n $this->_client->setCookieJar();\n \n // Set the location for the login request\n $this->_client->setUri($this->_login_endPoint);\n \n // Set the post variables\n foreach ($loginPostArray as $loginPostKey=>$loginPostValue) {\n $this->_client->setParameterPost($loginPostKey, $loginPostValue);\n }\n \n // Submit the reqeust\n $response = $this->_client->request(Zend_Http_Client::POST);\n }", "function retrieveDataFromAlphavantage() {\n // Variables needed to created a url to use the alphavantage api\n $requestTypeURL = \"function=TIME_SERIES_INTRADAY\";\n $apiKey = 'F65M552NK586I4QJ';\n\n if (isset($_POST['submit']) && !empty($_POST['symbols'])) {\n $symbol = $_POST['symbols'];\n $url = 'https://www.alphavantage.co/query?'. $requestTypeURL . '&symbol='\n . $symbol . '&interval=1min&outputsize=compact&apikey=' . $apiKey;\n\n // Retrieving data from the url in JSON format\n // Returns false if it fails\n $content = @file_get_contents($url);\n\n if(!$content){\n throw new Exception('Unable to retrieve ticker stock info (invalid ticker symbol)');\n }\n\n $jsonData = json_decode($content, true);\n\n // Saves only the first element of the retrieved data\n $metadata = current($jsonData);\n\n // Append data\n echo '<div id=\"lasttrade\">';\n echo '<h2>' . $metadata['2. Symbol'] . '</h2>';\n echo '<p>Time Zone: ' . $metadata['6. Time Zone'] . '</p>';\n echo '<p>Last Refreshed: ' . $metadata['3. Last Refreshed'] . '</p>';\n\n // Validation to make sure 'Time Series (1min)' exists\n if(isset($jsonData['Time Series (1min)'])){\n $lastTrade = current($jsonData['Time Series (1min)']);\n echo '<p>Last trade closing value: ' . $lastTrade['4. close'] . '</p>';\n }\n\n echo '</div>';\n } else {\n // if submit and smbols aren't set\n throw new Exception('Ticker symbol not specified.');\n }\n }" ]
[ "0.5991866", "0.58625036", "0.5808488", "0.57697", "0.5739778", "0.5721598", "0.566032", "0.5641281", "0.5605235", "0.56048983", "0.54911333", "0.5485446", "0.5479109", "0.5469757", "0.54511493", "0.5446254", "0.5424345", "0.5424089", "0.5416881", "0.5409933", "0.54009503", "0.53999114", "0.5339408", "0.5307892", "0.5299482", "0.5293966", "0.5282438", "0.5282438", "0.5282438", "0.527916", "0.5274962", "0.52695036", "0.52691436", "0.5268386", "0.5268054", "0.52670944", "0.5256705", "0.52538", "0.5250485", "0.5245834", "0.524502", "0.52439606", "0.5236063", "0.5229223", "0.522861", "0.5223368", "0.5220654", "0.5214653", "0.52001196", "0.518756", "0.51869506", "0.5177316", "0.5167233", "0.5164261", "0.5154134", "0.515402", "0.515402", "0.515402", "0.5150776", "0.51505417", "0.51500595", "0.51483285", "0.5147611", "0.5147234", "0.5146794", "0.5143656", "0.5133199", "0.5125558", "0.51200867", "0.5115957", "0.5107466", "0.51073354", "0.5102722", "0.51005715", "0.50980437", "0.50830996", "0.5081732", "0.50788313", "0.5078626", "0.5077997", "0.5077315", "0.5077152", "0.50764674", "0.50764674", "0.50715894", "0.5070005", "0.506746", "0.5060152", "0.5049037", "0.5045614", "0.5038698", "0.5036977", "0.5034347", "0.50281745", "0.5024783", "0.50204563", "0.50197214", "0.50188327", "0.5017973", "0.5007594", "0.50062346" ]
0.0
-1
/ Get the cURL handler from the library function
function curl($url,$header) { $curlHandle = curl_init(); /* * Set the required cURL options to successfully fire a request to MKM's API * * For more information about cURL options refer to PHP's cURL manual: * http://php.net/manual/en/function.curl-setopt.php */ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true); curl_setopt($curlHandle, CURLOPT_URL, $url); curl_setopt($curlHandle, CURLOPT_HTTPHEADER, array($header)); curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, false); /** * Execute the request, retrieve information about the request and response, and close the connection * * @var $content string Response to the request * @var $info array Array with information about the last request on the $curlHandle */ $content = curl_exec($curlHandle); $info = curl_getinfo($curlHandle); curl_close($curlHandle); return $content; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_handler() {\r\n }", "protected function _getCommHandler() {\n if (!isset($this->_ch)) {\n $this->_ch = curl_init();\n }\n return $this->_ch;\n }", "protected function &getCurlHandle() {\n\t\twfProfileIn( 'BS::'.__METHOD__ );\n\t\tif ( $this->curlConnectionCounter > 200 ) {\n\t\t\tcurl_close( $this->curlHandle );\n\t\t\t$this->curlHandle = null;\n\t\t}\n\t\tif ( $this->curlHandle === null ) {\n\t\t\t$this->curlHandle = curl_init(); // todo: function_exists('curl_init') not true on every installation => handle Exception\n\t\t\t$this->curlConnectionCounter = 0;\n\t\t\t//curl_setopt($this->curlHandle, CURLOPT_FRESH_CONNECT, 1); // Forces new http-connection\n\t\t\t//curl_setopt($this->curlHandle, CURLOPT_FORBID_REUSE, 1); // Closes http-connection after the request\n\t\t\t//curl_setopt($this->curlHandle, CURLOPT_VERBOSE, 1);\n\t\t\tcurl_setopt( $this->curlHandle, CURLOPT_HEADER, true );\n\t\t\tcurl_setopt( $this->curlHandle, CURLOPT_HTTPHEADER, array( \"Content-Type: text/xml; charset=utf-8\", \"Expect:\" ) );\n\t\t\tcurl_setopt( $this->curlHandle, CURLOPT_RETURNTRANSFER, true );\n\t\t\tcurl_setopt( $this->curlHandle, CURLOPT_SSL_VERIFYPEER, false ); // Allow self-signed certs\n\t\t\tcurl_setopt( $this->curlHandle, CURLOPT_SSL_VERIFYHOST, false ); // Allow certs that do not match the hostname\n\t\t}\n\t\twfProfileOut( 'BS::'.__METHOD__ );\n\n\t\treturn $this->curlHandle;\n\t}", "public function getCurlHandle()\n {\n return $this->mh;\n }", "public function getCurl()\n {\n return $this->curl;\n }", "public function getHandler();", "public function getHandler();", "public function initCurlHandler()\r\n {\r\n $this->curlHandler = curl_init();\r\n }", "private function build_curl_handle($url) {\n if (!function_exists('curl_init')) {\n die('the curl library is required for this client to work');\n }\n $ch = curl_init();\n if (!$ch) {\n die('could not initialize curl');\n }\n curl_setopt($ch, CURLOPT_URL, $url);\n // Method and headers can be different, but these are always the same.\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_USERPWD, $this->auth_string);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n return $ch;\n }", "public function access_curl(){\n\t\t$type = $this->_type;\n\n\t\tif($type == false){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tswitch($type) {\n\t\t\t\tcase 'domain':\n\t\t\t\t\treturn $this->_checkDomainCURL();\n\t\t\t\tbreak;\n\t\t\t\tcase 'data':\n\t\t\t\t\treturn $this->_ProcessDataCurl();\n\t\t\t\tbreak;\n\t\t\t\tcase 'slice':\n\t\t\t\t\treturn $this->_sliceCurlData();\n\t\t\t\tbreak;\n\t\t\t\tcase 'favicon':\n\t\t\t\t\treturn $this->_getFavicon();\n\t\t\t\tbreak;\n\t\t\t\tcase 'loop-favicon':\n\t\t\t\t\treturn $this->_loopFavicon();\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treturn $this->_ProcessDataCurl();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public function getHandler() {}", "function choose_handler(): callable\n {\n return \\Yurun\\Util\\Swoole\\Guzzle\\choose_handler();\n }", "public function getActualHandler();", "function choose_handler(): callable\n {\n $handler = null;\n $defaultHandler = DefaultHandler::getDefaultHandler();\n if (\\is_string($defaultHandler))\n {\n $handler = new $defaultHandler();\n }\n elseif (\\is_callable($defaultHandler))\n {\n $handler = $defaultHandler();\n }\n elseif (\\function_exists('curl_multi_exec') && \\function_exists('curl_exec'))\n {\n $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler());\n }\n elseif (\\function_exists('curl_exec'))\n {\n $handler = new CurlHandler();\n }\n elseif (\\function_exists('curl_multi_exec'))\n {\n $handler = new CurlMultiHandler();\n }\n\n if (ini_get('allow_url_fopen'))\n {\n $handler = $handler\n ? Proxy::wrapStreaming($handler, new StreamHandler())\n : new StreamHandler();\n }\n elseif (!$handler)\n {\n throw new \\RuntimeException('GuzzleHttp requires cURL, the ' . 'allow_url_fopen ini setting, or a custom HTTP handler.');\n }\n\n return $handler;\n }", "function funExecuteCurl($ch){\n return curl_exec($ch);\n\n}", "public function get_handler()\n {\n }", "function doGet($url)\n{\n $return = curlExecute($url);\n return $return;\n}", "public function getUrlDetectionHandler()\n {\n return $this->urlDetectionHandler;\n }", "public function getUrlDetectionHandler()\n {\n return $this->urlDetectionHandler;\n }", "public function getHandler()\n {\n }", "function curl_function($url){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "protected function request()\n\t{\n\t\treturn Phpfox::getLib('request');\t\n\t}", "public function getCurl()\n {\n if (!$this->curl)\n {\n throw new AppException(\"No curl object set in controller\");\n }\n\n return $this->curl;\n }", "private function getCurlHandler($path, $mode, $options = array())\r\n {\r\n $url = $this->getJsonPath($path, $options);\r\n $ch = $this->curlHandler;\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);\r\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->timeout);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->getSSLConnection());\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $mode);\r\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\r\n return $ch;\r\n }", "#[Pure]\n public function getRequestUrl() {}", "function basicCurl($curlURL) {\n $url = $curlURL;\n $cURL = curl_init();\n curl_setopt($cURL, CURLOPT_URL, $url);\n curl_setopt($cURL, CURLOPT_HTTPGET, true);\n curl_setopt($cURL, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Accept: application/json'\n ));\n curl_setopt($cURL, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($cURL, CURLOPT_USERAGENT, \"spider\");\n $result = curl_exec($cURL);\n \nif ($result === FALSE) {\n return \"cURL Error: \" . curl_error($cURL);\n} else {\n\treturn $result;\n}\n curl_close($cURL);\n \n}", "protected function createCurlHandle()\n {\n $ch = curl_init();\n\n $bdurl = $this->request->getUrl();\n $config = $this->request->getConfig();\n\n \t$curl_opts = array(\n \t\t// request url\n \t\tCURLOPT_URL\t\t\t\t=> $this->requestUrl,\n \t\t// setup write callbacks\n \t\tCURLOPT_HEADERFUNCTION\t=> array($this, 'onWriteHeader'),\n \t\tCURLOPT_WRITEFUNCTION\t=> array($this, 'onWriteBody'),\n \t\t// buffer size\n \t\tCURLOPT_BUFFERSIZE\t\t=> $config['buffer_size'],\n \t\t// save full outgoing headers, in case someone is interested\n CURLINFO_HEADER_OUT\t\t=> true,\n CURLOPT_NOSIGNAL => 1,\n );\n\n // setup connection timeout\n\t\tif (defined('CURLOPT_CONNECTTIMEOUT_MS')) {\n\t\t\t$curl_opts[CURLOPT_CONNECTTIMEOUT_MS] = $config['connect_timeout'];\n\t\t} else {\n\t\t\t$curl_opts[CURLOPT_CONNECTTIMEOUT] = ceil($config['connect_timeout'] / 1000);\n\t\t}\n\n // setup request timeout\n\t\tif (defined('CURLOPT_TIMEOUT_MS')) {\n\t\t\t$curl_opts[CURLOPT_TIMEOUT_MS] = $config['timeout'];\n\t\t} else {\n\t\t\t$curl_opts[CURLOPT_TIMEOUT] = ceil($config['timeout'] / 1000);\n\t\t}\n\n // setup redirects\n if ($config['follow_redirects']) {\n \t$curl_opts[CURLOPT_FOLLOWLOCATION] = true;\n $curl_opts[CURLOPT_MAXREDIRS] = $config['max_redirects'];\n // limit redirects to http(s), works in 5.2.10+\n if (defined('CURLOPT_REDIR_PROTOCOLS')) {\n $curl_opts[CURLOPT_REDIR_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS;\n }\n // works sometime after 5.3.0, http://bugs.php.net/bug.php?id=49571\n if ($config['strict_redirects'] && defined('CURLOPT_POSTREDIR ')) {\n $curl_opts[CURLOPT_POSTREDIR] = 3;\n }\n } else {\n $curl_opts[CURLOPT_FOLLOWLOCATION] = false;\n }\n\n // set HTTP version\n switch ($config['protocol_version']) {\n case '1.0':\n $curl_opts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0;\n break;\n case '1.1':\n $curl_opts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1;\n }\n\n // set request method\n switch ($this->request->getMethod()) {\n case bdHttpRequest::METHOD_GET:\n $curl_opts[CURLOPT_HTTPGET] = true;\n break;\n case bdHttpRequest::METHOD_POST:\n $curl_opts[CURLOPT_POST] = true;\n break;\n case bdHttpRequest::METHOD_HEAD:\n $curl_opts[CURLOPT_NOBODY] = true;\n break;\n default:\n $curl_opts[CURLOPT_CUSTOMREQUEST] = $this->request->getMethod();\n }\n\n // set proxy, if needed\n if ($config['proxy_host']) {\n if (!$config['proxy_port']) {\n throw new bdHttpException('Proxy port not provided');\n }\n $curl_opts[CURLOPT_PROXY] = $config['proxy_host'] . ':' . $config['proxy_port'];\n if ($config['proxy_user']) {\n $curl_opts[CURLOPT_PROXYUSERPWD] = $config['proxy_user'] . ':' . $config['proxy_password'];\n switch ($config['proxy_auth_scheme']) {\n case bdHttpRequest::AUTH_BASIC:\n $curl_opts[CURLOPT_PROXYAUTH] = CURLAUTH_BASIC;\n break;\n case bdHttpRequest::AUTH_DIGEST:\n $curl_opts[CURLOPT_PROXYAUTH] = CURLAUTH_DIGEST;\n }\n }\n }\n\n // set authentication data\n $auth = $this->request->getAuth();\n if ($auth) {\n $curl_opts[CURLOPT_USERPWD] = $auth['user'] . ':' . $auth['password'];\n switch ($auth['scheme']) {\n case bdHttpRequest::AUTH_BASIC:\n $curl_opts[CURLOPT_HTTPAUTH] = CURLAUTH_BASIC;\n break;\n case bdHttpRequest::AUTH_DIGEST:\n $curl_opts[CURLOPT_HTTPAUTH] = CURLAUTH_DIGEST;\n }\n }\n\n // set SSL options\n if (0 == strcasecmp($bdurl->getScheme(), 'https')) {\n \tif (isset($config['ssl_verify_host'])) {\n \t\t$curl_opts[CURLOPT_SSL_VERIFYHOST] = $config['ssl_verify_host'] ? 2 : 0;\n \t}\n \tforeach (self::$sslContextMap as $name => $option) {\n \t\tif (isset($config[$name])) {\n \t\t\t$curl_opts[$option] = $config[$name];\n \t\t}\n \t}\n }\n\n $headers = $this->request->getHeaders();\n // make cURL automagically send proper header\n if (!isset($headers['accept-encoding'])) {\n $headers['accept-encoding'] = '';\n }\n\n // set headers having special cURL keys\n foreach (self::$headerMap as $name => $option) {\n if (isset($headers[$name])) {\n $curl_opts[$option] = $headers[$name];\n unset($headers[$name]);\n }\n }\n\n $this->calculateRequestLength($headers);\n if (isset($headers['content-length'])) {\n $this->workaroundPhpBug47204($curl_opts, $headers);\n }\n\n // set headers not having special keys\n $headersFmt = array();\n foreach ($headers as $name => $value) {\n $canonicalName = implode('-', array_map('ucfirst', explode('-', $name)));\n $headersFmt[] = $canonicalName . ': ' . $value;\n }\n $curl_opts[CURLOPT_HTTPHEADER] = $headersFmt;\n\n curl_setopt_array($ch, $curl_opts);\n\n return $ch;\n }", "public function curlConfig(): GetDataFromApiClass;", "function curl_method(&$curl, $method = 'GET') {\n return curl_option($curl, CURLOPT_CUSTOMREQUEST, $method);\n}", "function get_curl($url){\n if(function_exists('curl_init')){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,$url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0); \n $output = curl_exec($ch);\n echo curl_error($ch);\n curl_close($ch);\n return $output;\n }else{\n return file_get_contents($url);\n }\n\n}", "public function curlHandle($curlHandle = null)\n\t{\n\t\tif (!empty($curlHandle) && is_resource($curlHandle)) {\n\t\t\t$this->curlHandle = $curlHandle;\n\t\t}\n\n\t\tif (!is_resource($this->curlHandle)) {\n\t\t\t$this->curlHandle = curl_init();\n\t\t}\n\n\t\treturn $this->curlHandle;\n\t}", "function curl($url)\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $return = curl_exec($ch);\n curl_close($ch);\n return $return;\n}", "function curl($url) {\n\n $ch = curl_init(); // Initialising cURL\n curl_setopt($ch, CURLOPT_URL, $url); // Setting cURL's URL option with the $url variable passed into the function\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Setting cURL's option to return the webpage data\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t \t'Accept: application/json',\n\t \t'X-ELS-APIKey: 82b47f24bf707a447d642d170ae6e318'\n\t ));\n $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n curl_close($ch); // Closing cURL\n return $data; // Returning the data from the function\n }", "function curlRequest( $url, $curl_handle, $fail_on_error = false ) {\n global $curl_requests;\n\n if ( $curl_handle === false ) {\n return false;\n }\n if ( $fail_on_error === true ) {\n curl_setopt( $curl_handle, CURLOPT_FAILONERROR, true );\n }\n curl_setopt( $curl_handle, CURLOPT_SSL_VERIFYPEER, false );\n curl_setopt( $curl_handle, CURLOPT_RETURNTRANSFER, true );\n curl_setopt( $curl_handle, CURLOPT_USERAGENT, 'Verus PHP EXT Tools' );\n curl_setopt( $curl_handle, CURLOPT_URL, $url );\n $curl_requests++;\n return curl_exec( $curl_handle );\n}", "function curl($url) {\n\t$ch = curl_init(); // Initialising cURL\n\tcurl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);\n\tcurl_setopt($ch, CURLOPT_URL, $url); // Setting cURL's URL option with the $url variable passed into the function\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Setting cURL's option to return the webpage data\n\t$data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n\tcurl_close($ch); // Closing cURL\n\treturn $data; // Returning the data from the function\n}", "function run_curl($p_path) {\r\n\r\n global $CURL_OPTIONS;\r\n\r\n $tp_result = array();\r\n $tp_curl = curl_init($p_path);\r\n curl_setopt_array($tp_curl, $CURL_OPTIONS);\r\n $tp_result['content'] = curl_exec($tp_curl);\r\n $tp_result['code'] = curl_getinfo($tp_curl, CURLINFO_HTTP_CODE);\r\n curl_close($tp_curl);\r\n return $tp_result;\r\n\r\n}", "protected function get_handler() {\n\n\t\treturn $this->handler;\n\t}", "function curl_URL_call($url){\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\t$output = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $output;\n}", "function getCurl( $url )\n{\n$curl = curl_init();\ncurl_setopt($curl, CURLOPT_URL, $url);\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n$res = curl_exec($curl); // execute\n if(curl_error($curl) ) // check for error\n {\n return false; // return false if error\n } else {\n return json_decode($res); // return json decoded\n }\ncurl_close($curl);\n}", "public function get_curl_object() {\n if (!is_null($this->curl)) {\n return $this->curl;\n }\n\n // Connection to Solr is allowed to use 'localhost' and other potentially blocked hosts/ports.\n $this->curl = new \\curl(['ignoresecurity' => true]);\n\n $options = array();\n // Build the SSL options. Based on pecl-solr and general testing.\n if (!empty($this->config->secure)) {\n if (!empty($this->config->ssl_cert)) {\n $options['CURLOPT_SSLCERT'] = $this->config->ssl_cert;\n $options['CURLOPT_SSLCERTTYPE'] = 'PEM';\n }\n\n if (!empty($this->config->ssl_key)) {\n $options['CURLOPT_SSLKEY'] = $this->config->ssl_key;\n $options['CURLOPT_SSLKEYTYPE'] = 'PEM';\n }\n\n if (!empty($this->config->ssl_keypassword)) {\n $options['CURLOPT_KEYPASSWD'] = $this->config->ssl_keypassword;\n }\n\n if (!empty($this->config->ssl_cainfo)) {\n $options['CURLOPT_CAINFO'] = $this->config->ssl_cainfo;\n }\n\n if (!empty($this->config->ssl_capath)) {\n $options['CURLOPT_CAPATH'] = $this->config->ssl_capath;\n }\n }\n\n // Set timeout as for Solr client.\n $options['CURLOPT_TIMEOUT'] = !empty($this->config->server_timeout) ? $this->config->server_timeout : '30';\n\n $this->curl->setopt($options);\n\n if (!empty($this->config->server_username) && !empty($this->config->server_password)) {\n $authorization = $this->config->server_username . ':' . $this->config->server_password;\n $this->curl->setHeader('Authorization: Basic ' . base64_encode($authorization));\n }\n\n return $this->curl;\n }", "function curl($url) {\n $ch = curl_init(); \n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n $output = curl_exec($ch); \n curl_close($ch); \n return $output;\n}", "public function getCurl() {\r\n $curl = new Curl();\r\n $curl->setOption(CURLOPT_HTTPHEADER, array(\r\n 'Content-Type:application/json',\r\n 'Authorization:' . $this->passcode,\r\n 'X-Forwarded-Host:' . $_SERVER['HTTP_HOST'],\r\n 'X-Forwarded-For:' . $_SERVER['SERVER_ADDR'],\r\n 'Referer:' . NetHelper::getCurrentURL(),\r\n ));\r\n $curl->setOption(CURLOPT_TIMEOUT, 200);\r\n $curl->setOption(CURLOPT_CONNECTTIMEOUT, 200);\r\n // temporarily disables SSL verifying\r\n $curl->setOption(CURLOPT_SSL_VERIFYPEER, false);\r\n return $curl;\r\n }", "public function api_connect($url) {\n return curl_init($url);\n }", "public static function getServiceName()\n {\n return 'Curl';\n }", "function myCurl($url)\n {\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_exec($ch);\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n return $httpCode;\n }", "public function getFutureHandler(): FutureHandler;", "function curlRequest($url, $authHeader){\n //Initialize the Curl Session.\n $ch = curl_init();\n //Set the Curl url.\n curl_setopt ($ch, CURLOPT_URL, $url);\n //Set the HTTP HEADER Fields.\n curl_setopt ($ch, CURLOPT_HTTPHEADER, array($authHeader));\n //CURLOPT_RETURNTRANSFER- TRUE to return the transfer as a string of the return value of curl_exec().\n curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);\n //CURLOPT_SSL_VERIFYPEER- Set FALSE to stop cURL from verifying the peer's certificate.\n curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, False);\n //Execute the cURL session.\n $curlResponse = curl_exec($ch);\n //Get the Error Code returned by Curl.\n $curlErrno = curl_errno($ch);\n if ($curlErrno) {\n $curlError = curl_error($ch);\n throw new Exception($curlError);\n }\n //Close a cURL session.\n curl_close($ch);\n return $curlResponse;\n }", "public function getSecHandler() {}", "function get_url()\n {\n }", "function _isCurl()\n{\n return function_exists('curl_version');\n}", "public function addCurlHandler(callable $handler)\n {\n $this->curlHandlers[] = $handler;\n }", "function curl($url) {\n // Assigning cURL options to an array\n $options = Array(\n CURLOPT_RETURNTRANSFER => TRUE, // Setting cURL's option to return the webpage data\n CURLOPT_FOLLOWLOCATION => TRUE, // Setting cURL to follow 'location' HTTP headers\n CURLOPT_AUTOREFERER => TRUE, // Automatically set the referer where following 'location' HTTP headers\n CURLOPT_CONNECTTIMEOUT => 120, // Setting the amount of time (in seconds) before the request times out\n CURLOPT_TIMEOUT => 120, // Setting the maximum amount of time for cURL to execute queries\n CURLOPT_MAXREDIRS => 10, // Setting the maximum number of redirections to follow\n CURLOPT_USERAGENT => \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/2008073000 Shredder/3.0a2pre ThunderBrowse/3.2.1.8\", // Setting the useragent\n CURLOPT_URL => $url, // Setting cURL's URL option with the $url variable passed into the function\n );\n \n $ch = curl_init(); // Initialising cURL \n curl_setopt_array($ch, $options); // Setting cURL's options using the previously assigned array data in $options\n $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n curl_close($ch); // Closing cURL \n return $data; // Returning the data from the function \n }", "private function initCurl() {\r\n\t\tif (isset($this->curl)) { return $this->curl; }\r\n\r\n\t\t$this->curl = curl_init();\r\n\r\n\t\tcurl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true);\r\n\t\tcurl_setopt($this->curl, CURLOPT_TIMEOUT, $this->request_timeout);\r\n\r\n\t\tif (isset($this->cookie_jar)) {\r\n\t\t\tcurl_setopt($this->curl, CURLOPT_COOKIEJAR, $this->cookie_jar);\r\n\t\t\tcurl_setopt($this->curl, CURLOPT_COOKIEFILE, $this->cookie_jar);\r\n\t\t}\r\n\r\n\t\tcurl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, $this->is_multiple);\r\n\r\n\t\t# If a User Agent has been set, set the curl option\r\n\t\tif (isset($this->user_agent)) {\r\n\t\t\tcurl_setopt($this->curl, CURLOPT_USERAGENT, $this->user_agent);\r\n\t\t}\r\n\r\n\t\t# We are not too concerned about the strictness of SSL when finding redirects\r\n\t\t# Without these, some SSL links just fail to return anything\r\n\t\tcurl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, 0); \r\n\t\tcurl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, 0); \r\n\r\n\t\t# We want the headers returned to us to follow redirects\r\n\t\tcurl_setopt($this->curl, CURLOPT_HEADER, true); \r\n\t\t$this->code = curl_getinfo($this->curl, CURLINFO_HTTP_CODE);\r\n\t\treturn $this->curl;\r\n\t}", "function &_getHandler()\n\t{\n\t\treturn 0;\n\t}", "function curlGet($url){\n $ch = curl_init();\n\n //setting curl options\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_URL, $url);\n /*\n Additional curl_setopt\n CURLOPT_USERAGENT \n CURLOPT_HTTPHEADER\n */\n $result = curl_exec($ch);\n \n //$httpResponse = curl_getinfo($ch,CURLINFO_HTTP_CODE);\n //echo $httpResponse;\n\n curl_close($ch);\n return $result;\n }", "abstract public function getHttpClient();", "public function init(): void{\n $this->handler = curl_init();\n }", "public function setupCurl()\n {\n $ch = curl_init();\n curl_setopt($ch,CURLOPT_URL,\"https://jsonplaceholder.typicode.com/posts\");\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n\n return $ch;\n }", "public function get_handle();", "function jc_url() {\n\n}", "public function getHandler(){\n return($this->handle); \n }", "private function initCurlHandle()\n {\n $this->closeCurlHandle();\n $this->curlHandle = \\curl_init();\n }", "public static function getHandlerClass(): string;", "function hb_curl($link_url)\r\n\t{\r\n\t\t$ch = curl_init(\"$link_url\");\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\t\t\r\n\t\t$output = curl_exec($ch);\r\n\t\tcurl_error($ch);\r\n\t\tcurl_close($ch);\r\n\t\treturn $output;\r\n\t}", "function curl($url) {\n // Assigning cURL options to an array\n $options = Array(\n CURLOPT_RETURNTRANSFER => TRUE, // Setting cURL's option to return the webpage data\n CURLOPT_FOLLOWLOCATION => TRUE, // Setting cURL to follow 'location' HTTP headers\n CURLOPT_AUTOREFERER => TRUE, // Automatically set the referer where following 'location' HTTP headers\n CURLOPT_CONNECTTIMEOUT => 120, // Setting the amount of time (in seconds) before the request times out\n CURLOPT_TIMEOUT => 120, // Setting the maximum amount of time for cURL to execute queries\n CURLOPT_MAXREDIRS => 10, // Setting the maximum number of redirections to follow\n CURLOPT_USERAGENT => \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/2008073000 Shredder/3.0a2pre ThunderBrowse/3.2.1.8\", // Setting the useragent\n CURLOPT_URL => $url, // Setting cURL's URL option with the $url variable passed into the function\n );\n \n $ch = curl_init(); // Initialising cURL\n curl_setopt_array($ch, $options); // Setting cURL's options using the previously assigned array data in $options\n $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n curl_close($ch); // Closing cURL\n return $data; // Returning the data from the function\n }", "function doCurl($url) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $data = json_decode(curl_exec($ch), true);\n curl_close($ch);\n return $data;\n}", "function getDataViaCurl($url){\n\n\t// TODO: check http response 200, 404, ...etc\n\n\t$curl = curl_init();\n\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t// option for returning data\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($curl, CURLOPT_HEADER, false);\n\t//retrieve data from curl_exec \n\t$data = curl_exec($curl);\n\t\n\tcurl_close($curl);\n\n\treturn $data;\n}", "function curl_info($curl, $option = 0) {\n $info = curl_getinfo($curl, $option);\n\n if (is_bool($info)) {\n error('Failed to get ' . spy($option) . ' for ' . spy($curl) . '.');\n }\n\n return $info;\n}", "public function getHttpClient();", "public function _curl_c($url,$postFields=NULL)\n {\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, false);\n\n if ($postFields!==NULL){\n if (is_array($postFields)){\n $postStr = json_encode($postFields);\n curl_setopt($ch,CURLOPT_POSTFIELDS,$postStr);\n }\n if (is_string($postFields)){\n curl_setopt($ch,CURLOPT_POSTFIELDS,$postFields);\n }\n }\n $result = curl_exec($ch);\n \n \n if (curl_errno($ch)){\n \t\n $errNo = curl_errno($ch);\n curl_close($ch);\n return $this->resultStatus(false,curl_strerror($errNo));\n }else{\n \tcurl_close($ch);\n return $this->resultStatus(true,json_decode($result,true));\n }\n }", "function curlGet($url, $headers=null) {\r\n //write_log(\"Function fired\");\r\n $mc = JMathai\\PhpMultiCurl\\MultiCurl::getInstance();\r\n\t\t$ch = curl_init();\r\n\t\tcurl_setopt($ch, CURLOPT_URL,$url);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 4);\r\n curl_setopt($ch, CURLOPT_TIMEOUT, 3);\r\n\t\tcurl_setopt ($ch, CURLOPT_CAINFO, rtrim(dirname(__FILE__), '/') . \"/cert/cacert.pem\");\r\n\t\tif ($headers) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\r\n\t\t//$result = curl_exec($ch);\r\n\t\t//curl_close ($ch);\r\n $call = $mc->addCurl($ch);\r\n // Access response(s) from your cURL calls.\r\n $result = $call->response;\r\n\t\t//write_log(\"URL is \".$url.\". Result is \".$result);\r\n\t\treturn $result;\r\n\t}", "function getCurlData($url)\n{\n$curl = curl_init();\ncurl_setopt($curl, CURLOPT_URL, $url);\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\ncurl_setopt($curl, CURLOPT_TIMEOUT, 10);\ncurl_setopt($curl, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16\");\n$curlData = curl_exec($curl);\ncurl_close($curl);\nreturn $curlData;\n}", "function curl_url($curl, $url = null) {\n if (func_num_args() >= 2) {\n curl_option($curl, CURLOPT_URL, $url);\n }\n\n return curl_info($curl, CURLINFO_EFFECTIVE_URL);\n}", "function funInitCurl(){\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0)');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 0);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 20);\n\n return $ch;\n}", "function web_client($url) {\n $post = array();\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n\n $result = curl_exec($ch);\n \n $response = json_decode($result, true);\n}", "function curl($url) {\n // Assigning cURL options to an array\n $options = Array(\n CURLOPT_RETURNTRANSFER => TRUE, // Setting cURL's option to return the webpage data\n CURLOPT_FOLLOWLOCATION => TRUE, // Setting cURL to follow 'location' HTTP headers\n CURLOPT_AUTOREFERER => TRUE, // Automatically set the referer where following 'location' HTTP headers\n CURLOPT_CONNECTTIMEOUT => 120, // Setting the amount of time (in seconds) before the request times out\n CURLOPT_TIMEOUT => 120, // Setting the maximum amount of time for cURL to execute queries\n CURLOPT_MAXREDIRS => 10, // Setting the maximum number of redirections to follow\n CURLOPT_USERAGENT => \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/2008073000 Shredder/3.0a2pre ThunderBrowse/3.2.1.8\", // Setting the useragent\n CURLOPT_URL => $url, // Setting cURL's URL option with the $url variable passed into the function\n CURLOPT_SSL_VERIFYPEER => false,\n //CURLOPT_HTTPHEADER => array('Content-type: \"text/plain; charset=UTF-8\"'),\n );\n\n $ch = curl_init(); // Initialising cURL\n curl_setopt_array($ch, $options); // Setting cURL's options using the previously assigned array data in $options\n $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n curl_close($ch); // Closing cURL\n return $data; // Returning the data from the function\n }", "public function getHandler()\n {\n return $this->handler;\n }", "public function getHandler()\n {\n return $this->handler;\n }", "function curl_download($Url){ if (!function_exists('curl_init')){\n die('Sorry cURL is not installed!');\n }\n \n // OK cool - then let's create a new cURL resource handle\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $Url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $output = curl_exec($ch);\n\n return $output;\n}", "function fwp_haveurl() {\n\trequire_once 'class.fwp-haveurl.php';\n\t$fwp_custom = FWP_HaveURL::get_instance();\n\t$fwp_custom->hook();\n}", "function get_data($url) {\n $ch = curl_init(); \n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "function getCurl($url_referer, $url)\n {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_REFERER, $url_referer);\n curl_setopt($ch, CURLOPT_URL, $url);\n\n $site = curl_exec($ch);\n curl_close($ch);\n\n return $site;\n }", "public function & GetResponse ();", "public function handler()\r\n\t{\r\n\t\treturn $this->handler;\r\n\t}", "protected function getHttpClient() {\n if (extension_loaded('curl')) {\n return 'curl';\n }\n return 'stream';\n }", "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}", "function https_request($url, $post = null)\n {\n $cookieFile = NULL;\n $hCURL = curl_init();\n curl_setopt($hCURL, CURLOPT_URL, $url);\n curl_setopt($hCURL, CURLOPT_TIMEOUT, 30);\n curl_setopt($hCURL, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($hCURL, CURLOPT_USERAGENT, $userAgent);\n curl_setopt($hCURL, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($hCURL, CURLOPT_AUTOREFERER, TRUE);\n curl_setopt($hCURL, CURLOPT_ENCODING, \"gzip,deflate\");\n //curl_setopt($hCURL, CURLOPT_HTTPHEADER,$host);\n if ($post) {\n curl_setopt($hCURL, CURLOPT_POST, 1);\n curl_setopt($hCURL, CURLOPT_POSTFIELDS, $post);\n }\n $sContent = curl_exec($hCURL);\n var_dump(curl_error($hCURL));\n if ($sContent === FALSE) {\n $error = curl_error($hCURL);\n curl_close($hCURL);\n\n throw new \\Exception($error . ' Url : ' . $url);\n } else {\n curl_close($hCURL);\n return $sContent;\n }\n }", "function curlWrap($url, $json, $action)\n{\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\tcurl_setopt($ch, CURLOPT_MAXREDIRS, 10 );\n\tcurl_setopt($ch, CURLOPT_URL, ZDURL.$url);\n\tcurl_setopt($ch, CURLOPT_USERPWD, ZDUSER.\"/token:\".ZDAPIKEY);\n\tswitch($action){\n\t\tcase \"POST\":\n\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $json);\n\t\t\tbreak;\n\t\tcase \"GET\":\n\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n\t\t\tbreak;\n\t\tcase \"PUT\":\n\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $json);\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));\n\tcurl_setopt($ch, CURLOPT_USERAGENT, \"MozillaXYZ/1.0\");\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_TIMEOUT, 10);\n\t$output = curl_exec($ch);\n\tcurl_close($ch);\n\t$decoded = json_decode($output);\n\treturn $decoded;\n}", "public static function handler()\n {\n return static::$handler;\n }", "function curlWrap($url, $json)\n{\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_MAXREDIRS, 10);\n curl_setopt($ch, CURLOPT_URL, ZDURL . $url);\n curl_setopt($ch, CURLOPT_USERPWD, ZDUSER . \"/token:\" . ZDAPIKEY);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-type: application/json'\n ));\n curl_setopt($ch, CURLOPT_USERAGENT, \"MozillaXYZ/1.0\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $json);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_TIMEOUT, 10);\n\n $info = curl_getinfo($ch);\n $output = curl_exec($ch);\n curl_close($ch);\n $decoded = json_decode($output);\n return $decoded;\n\n $info = curl_getinfo($ch);\n return $info;\n\n}", "function repetitive_function()\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"httpbin/get?key=value\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $output = curl_exec($ch);\n error_log('Received response: ' . var_export($output, 1));\n curl_close($ch);\n}", "private static function GetWithCurl($url) {\n\t$ch = curl_init($url);\n\tcurl_setopt($ch,CURLOPT_USERAGENT,'' );\n\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\n\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,5);\n\tcurl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);\n\tcurl_setopt($ch,CURLOPT_MAXREDIRS,2);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t$str = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $str;\n }", "function _curlRequest( $url, $method, $data = null, $sendAsJSON = true, $auth = true ) {\n\t$curl = curl_init();\n\tif ( $method == 'GET' && $data !== null ) {\n\t\t$url .= '?' . http_build_query( $data );\n\t}\n\tcurl_setopt( $curl, CURLOPT_URL, $url );\n\tif ( $auth ) {\n\t\tcurl_setopt( $curl, CURLOPT_USERPWD, P_SECRET );\n\t}\n\tcurl_setopt( $curl, CURLOPT_CUSTOMREQUEST, $method );\n\tif ( $method == 'POST' && $data !== null ) {\n\t\tif ( $sendAsJSON ) {\n\t\t\t$data = json_encode( $data );\n\t\t\tcurl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen( $data ) ) );\n\t\t}\n\t\tcurl_setopt( $curl, CURLOPT_POSTFIELDS, $data );\n\t}\n\tcurl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );\n\tcurl_setopt( $curl, CURLOPT_HEADER, false );\n\tcurl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false );\n\tcurl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, false );\n\t$response = curl_exec( $curl );\n\tif ( $response === false ) {\n\t\techo curl_error( $curl );\n\t\tcurl_close( $curl );\n\n\t\treturn false;\n\t}\n\t$httpCode = curl_getinfo( $curl, CURLINFO_HTTP_CODE );\n\tif ( $httpCode >= 400 ) {\n\t\techo curl_error( $curl );\n\t\tcurl_close( $curl );\n\n\t\treturn false;\n\t}\n\tcurl_close( $curl );\n\n\treturn json_decode( $response, true );\n}", "function file_get_curl($url, $post_params = '') \r\n\t{\r\n\t\t$interfaces = array('10.1.77.47');\r\n\t\t$interface = $interfaces[mt_rand(0, count($interfaces) - 1)];\r\n\t\t\r\n\t\t$ch = curl_init();\r\n\t\t\r\n\t\tcurl_setopt($ch, CURLOPT_AUTOREFERER, true);\r\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\r\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); \r\n\t\tcurl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36\");\r\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 15);\r\n\t\t\r\n\t\tcurl_setopt($ch, CURLOPT_COOKIEJAR, (__DIR__).'/cookies.txt');\r\n\t\tcurl_setopt($ch, CURLOPT_COOKIEFILE, (__DIR__).'/cookies.txt');\r\n\t\t\r\n\t\tif(!empty($post_params))\r\n\t\t{\r\n\t\t\tcurl_setopt($ch, CURLOPT_POST, true);\r\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $post_params);\r\n\t\t}\r\n\t\t\r\n\t\tif(!empty($interface))\r\n\t\t{\r\n\t\t\tcurl_setopt($ch, CURLOPT_INTERFACE, $interface);\r\n\t\t}\r\n\t\t\r\n\t\t$data = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\t\t\r\n\t\treturn $data;\r\n\t}", "public function getHandler()\n\t{\n\t\treturn $this->handler;\n\t}", "public function getApiHandler()\n {\n return $this->apiServer->getApiHandler('sling');\n }", "function wechat_php_curl_https_get($url, $h = false) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n // Edit: prior variable $postFields should be $postfields;\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n if($h){\n //include header information\n curl_setopt($ch, CURLOPT_HEADER, true); \n }\n\n $result = curl_exec($ch);\n if(curl_errno($ch))\n {\n curl_close($ch);\n return NULL;\n }\n\n if($h){\n if (curl_getinfo($ch, CURLINFO_HTTP_CODE) == '200') {\n return $result;\n }else{\n return NULL;\n }\n }\n\n curl_close($ch);\n return $result;\n}", "function getUrl($url) {\n\t$ch = curl_init();\n curl_setopt($ch,CURLOPT_MAXCONNECTS,100);\n curl_setopt($ch,CURLOPT_CLOSEPOLICY,CURLCLOSEPOLICY_LEAST_RECENTLY_USED);\n curl_setopt($ch,CURLOPT_URL,$url);\n curl_setopt($ch,CURLOPT_MAXREDIRS,10);\n curl_setopt($ch,CURLOPT_HEADER,0);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\n curl_setopt($ch,CURLOPT_TIMEOUT,30);\n curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,10);\n curl_setopt($ch,CURLOPT_HTTPGET,1);\n $data = curl_exec($ch);\n curl_close($ch);\n \n return $data;\n}", "function getCurlJSON($url) {\n\treturn json_decode( getCurl($url) );\n}", "function rest_get_data($url)\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}", "public function getLibraryInterface(): string\n {\n return <<<C\n typedef struct {\n const char* content;\n uint32_t len;\n } tc_string_data_t;\n\n typedef struct {\n } tc_string_handle_t;\n \n typedef void (*tc_response_handler_t)(\n uint32_t request_id,\n tc_string_data_t params_json,\n uint32_t response_type,\n bool finished);\n\n tc_string_data_t tc_read_string(const tc_string_handle_t* string);\n void tc_destroy_string(const tc_string_handle_t* string);\n \n tc_string_handle_t* tc_create_context(tc_string_data_t config);\n void tc_destroy_context(uint32_t context);\n\n void tc_request(\n uint32_t context,\n tc_string_data_t function_name,\n tc_string_data_t function_params_json,\n uint32_t request_id,\n tc_response_handler_t response_handler);\n C;\n }" ]
[ "0.6418839", "0.63910264", "0.62964374", "0.626891", "0.62320316", "0.6181204", "0.6181204", "0.6010601", "0.6000701", "0.59794104", "0.5960487", "0.58511984", "0.5840672", "0.58248115", "0.57842904", "0.5738323", "0.5725987", "0.570481", "0.570481", "0.5697207", "0.5656987", "0.5648754", "0.5634033", "0.56305355", "0.5620613", "0.5610248", "0.55902755", "0.55760986", "0.55284286", "0.5527515", "0.5513337", "0.5506151", "0.5501894", "0.54996616", "0.5474293", "0.54742825", "0.54661995", "0.5457152", "0.5447597", "0.54455894", "0.54402226", "0.5432054", "0.53976536", "0.5363093", "0.5358976", "0.5345658", "0.53367746", "0.53277534", "0.53255606", "0.53238964", "0.5322309", "0.53144515", "0.53074265", "0.53059614", "0.5298996", "0.52941084", "0.5283601", "0.52801204", "0.5270428", "0.5269367", "0.5268049", "0.5267953", "0.52625775", "0.5262183", "0.5259454", "0.5249022", "0.5242756", "0.52426314", "0.52422667", "0.5241935", "0.5240326", "0.5217118", "0.5214415", "0.5214349", "0.5210344", "0.5204365", "0.51907134", "0.51907134", "0.5189513", "0.51833314", "0.5178466", "0.5177066", "0.5172938", "0.51702935", "0.5161514", "0.51553494", "0.5152445", "0.51486397", "0.51478595", "0.51401997", "0.5136018", "0.5131191", "0.5128586", "0.5127419", "0.5125331", "0.5114546", "0.5109598", "0.5103589", "0.5101512", "0.51013184", "0.5100392" ]
0.0
-1
Run the database seeds.
public function run(Faker $faker) { $pack1 = new Pack; $pack1 -> pname = '手袋单人份'; $pack1 -> save(); $pack2 = new Pack; $pack2 -> pname = '礼盒双人份'; $pack2 -> save(); $pack3 = new Pack; $pack3 -> pname = '全家福礼包'; $pack3 -> save(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }", "public function run()\n {\n \t$roles = DB::table('roles')->pluck('id');\n \t$sexes = DB::table('sexes')->pluck('id');\n \t$faker = \\Faker\\Factory::create();\n\n \tforeach (range(1,20) as $item) {\n \t\tDB::table('users')->insert([\n \t\t\t'role_id' => $faker->randomElement($roles),\n \t\t\t'sex_id' => $faker->randomElement($sexes),\n \t\t\t'name' => $faker->firstName . ' ' . $faker->lastName,\n \t\t\t'dob' => $faker->date,\n \t\t\t'bio' => $faker->text,\n \t\t\t'created_at' => now(),\n \t\t\t'updated_at' => now()\n \t\t]);\n \t} \n }" ]
[ "0.80130625", "0.79795986", "0.79764974", "0.79524934", "0.7950615", "0.79505694", "0.7944086", "0.7941758", "0.7938509", "0.79364634", "0.79335415", "0.7891555", "0.78802574", "0.78790486", "0.7878107", "0.7875447", "0.78703815", "0.7869534", "0.7851931", "0.7850407", "0.7840015", "0.78331256", "0.7826906", "0.78172284", "0.7807776", "0.78024083", "0.78023773", "0.7799859", "0.77994525", "0.77955437", "0.7790015", "0.77884936", "0.7786196", "0.77790534", "0.7776279", "0.7765613", "0.7761798", "0.7760838", "0.7760613", "0.7760611", "0.7759328", "0.7757682", "0.775591", "0.7752759", "0.774942", "0.7748997", "0.7745014", "0.7728245", "0.7727775", "0.77277344", "0.7716621", "0.77139914", "0.7713781", "0.77135956", "0.7713254", "0.7711222", "0.7710622", "0.7710614", "0.77104497", "0.77100515", "0.770471", "0.77039754", "0.7703702", "0.770327", "0.7702392", "0.7700962", "0.7700507", "0.7698413", "0.76974845", "0.7697178", "0.7696662", "0.76933604", "0.76916313", "0.76898587", "0.7689098", "0.76864886", "0.76862013", "0.76860833", "0.7685714", "0.7683389", "0.76831365", "0.7679125", "0.76774627", "0.767677", "0.7676274", "0.76719916", "0.76704824", "0.76679665", "0.7667335", "0.7667264", "0.76645994", "0.7662546", "0.76618296", "0.7660438", "0.76583356", "0.76564723", "0.76530147", "0.7651929", "0.7651548", "0.7651444", "0.76511025" ]
0.0
-1
Show all emails lists
public function emailsLists(MailerRepo $mailerService) { $lists = $mailerService->getAll(); $menu_control = view()->shared('menu_control'); $menu_control['page'] = 'emails'; $menu_control['category'] = 'options'; return view('mailer::emails', compact('lists','menu_control')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function emailList()\n {\n return array(\n '[email protected]',\n '[email protected]',\n '[email protected]',\n );\n }", "function listEmails(){\n \n $conn = $this->connect();\n $ret = '';\n \n $sql = 'select email from ' . $this->dbtable;\n\t\t\t$query = mysql_query( $sql, $conn );\n \n\t\t\twhile( $row = mysql_fetch_assoc( $query ) ){\n\t\t\t\t$ret .= $row['email'] . \";\\n\";\n\t\t\t}\n \n mysql_close( $conn );\n \n\t\t\treturn $ret;\n }", "function getAllEmails() {\n return getALL('SELECT * FROM mail');\n}", "private function disposableEmailList()\n {\n return array(\n '[email protected]',\n '[email protected]',\n '[email protected]',\n '[email protected]',\n '[email protected]',\n );\n }", "public function listAll(){\n\n\t\t\t$result = array();\n\t\t\t$people = array();\n\n\t\t\t$structure = General::listStructure(EMAILGATEWAYS, '/email.[\\\\w-]+.php/', false, 'ASC', EMAILGATEWAYS);\n\n\t\t\tif(is_array($structure['filelist']) && !empty($structure['filelist'])){\n\t\t\t\tforeach($structure['filelist'] as $f){\n\t\t\t\t\t$f = str_replace(array('email.', '.php'), '', $f);\n\t\t\t\t\t$result[$f] = $this->about($f);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$extensions = Symphony::ExtensionManager()->listInstalledHandles();\n\n\t\t\tif(is_array($extensions) && !empty($extensions)){\n\t\t\t\tforeach($extensions as $e){\n\n\t\t\t\t\tif(!is_dir(EXTENSIONS . \"/$e/email-gateways\")) continue;\n\n\t\t\t\t\t$tmp = General::listStructure(EXTENSIONS . \"/$e/email-gateways\", '/email.[\\\\w-]+.php/', false, 'ASC', EXTENSIONS . \"/$e/email-gateways\");\n\n\t\t\t\t\tif(is_array($tmp['filelist']) && !empty($tmp['filelist'])){\n\t\t\t\t\t\tforeach($tmp['filelist'] as $f){\n\t\t\t\t\t\t\t$f = preg_replace(array('/^email./i', '/.php$/i'), '', $f);\n\t\t\t\t\t\t\t$result[$f] = $this->about($f);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tksort($result);\n\t\t\treturn $result;\n\t\t}", "public function index()\n {\n return view(\"emails\", [\"emails\" => $this->email->get()->sortByDesc(\"created_at\")]);\n }", "public function newsletterList()\n {\n return $this->ozioma->newsletter->list();\n }", "function getMailList() {\n return getAll(\"SELECT id,`email` FROM `member` WHERE id != ?\"\n , [getLogin()['mid']]);\n}", "public function show_mails() {\n\t\t\tforeach($this->$mails as $key => $value) {\n\t\t\t\techo <<<_END\n\t\t\t\t<div>\n\t\t\t\t\t<p>Date: $key</p>\n\t\t\t\t\t<p>Name: $value[0]</p>\n\t\t\t\t\t<p>Subject: $value[1]</p>\n\t\t\t\t\t<p>Message: $value[2]</p>\n\t\t\t\t</div>\n_END;\n\t\t\t}\n\t\t}", "public function list_all() {\n global $retailers;\t\t\n $this->names = array_column($retailers, 'name');\n }", "public function listaFaturamentoEmails()\n {\n return view('faturamento.listarEmailsFaturamento');\n }", "public function indexAction()\n {\n try {\n $email = new Email();\n $grupo = new EmailGrupo();\n\n $this->view->emails = $email->lista(\n $this->_session->empresa->id_empresa,\n $this->_getParam('pagina', 0),\n $this->_getParam('grupo', null)\n );\n\n $this->view->grupos = $grupo->lista(\n $this->_session->empresa->id_empresa\n );\n } catch (Exception $e) {\n $mensagem = array('error' => $e->getMessage());\n $this->_helper->flashMessenger($mensagem);\n }\n }", "function mailchimp_list(){\n\t\t$list = $this->mailchimp->lists(array(), 0, 25);\n\t\tif($list) {\n\t\t\t$this->sci->assign('maindata' , $list['data']);\n\t\t\t$this->sci->assign('total' , $list['total']);\n\t\t}\n\t\t//print_r($list);\n\t\t$this->sci->da('mailchimp_list.htm');\n\t}", "public function emails()\n\t{\n\t\treturn $this->oneToMany(__NAMESPACE__ . '\\\\Mailinglist\\\\Email', 'mid');\n\t}", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $emails = $em->getRepository('Workshop5Bundle:Email')->findAll();\n\n return $this->render('email/index.html.twig', array(\n 'emails' => $emails,\n ));\n }", "public function getMailingLists() {\n $path = 'mailinglists.json';\n return $this->request($path);\n }", "public function getAllEmails() {\n $users = $this->getDoctrine()->getRepository(User::class)->findAll();\n $emails = [];\n foreach($users as $email) {\n if(\"[email protected]\" != $email->getEmail())\n array_push($emails, $email->getEmail());\n }\n\n return $emails;\n }", "public function getAllEmailAddresses() {\n $saveCurrentFolder = $this->folder;\n $emails = array();\n foreach($this->getFolders() as $folder) {\n $this->selectFolder($folder);\n foreach($this->getMessages(false) as $message) {\n $emails[] = $message['from'];\n $emails = array_merge($emails, $message['to']);\n if (isset($message['cc'])) {\n $emails = array_merge($emails, $message['cc']);\n }\n }\n }\n $this->selectFolder($saveCurrentFolder);\n return array_unique($emails);\n }", "public function scopeGetAllMails()\n {\n\n $gname = Input::get( 'gname' );\n\n $mails = Tolist::findMany( array(\n 'to_id' => Auth::user()->id . '_' . $gname\n ), array(\n 'email'\n ) )->all( 'email' );\n\n return Helper::cleanGroups( $mails, '|' );\n\n }", "public function getEmails()\n\t{\n \\Phalcon\\DI::getDefault()->get('logger')->log(\"Emails: \" . print_r($this->emails, true));\n\t\treturn $this->emails;\n\t}", "public function index()\n {\n if (\\Auth::user()->type != \\App\\User::ADMINISTRATOR) {\n abort(403);\n }\n $emailboxes = Emailbox::with('sites')->get();\n return view('emailbox.list', ['emailboxes' => $emailboxes]);\n }", "public function emails()\n {\n return $this->emails;\n }", "public function actionIndex()\n {\n $searchModel = new EmailSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getEmails(){\r\n \r\n $dbConfig = array(\r\n \"DB_DNS\" => 'mysql:host=localhost;port=3306;dbname=PHPadvClassSpring2015',\r\n \"DB_USER\" => 'root', \r\n \"DB_PASSWORD\" => '');\r\n $pdo = new DB($dbConfig);\r\n $db = $pdo->getDB();\r\n $stmt = $db->prepare(\"SELECT * FROM emailtype where active = 1\");\r\n if ($stmt->execute() && $stmt->rowCount() > 0) {\r\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n echo '<h3>Types of E-mails</h3>';\r\n foreach ($results as $value) {\r\n echo '<p>- <strong>', $value['emailtype'], '</strong></p>';\r\n }\r\n } else {\r\n echo '<p>No data found!</p>';\r\n } \r\n \r\n }", "function email_showmails($userid, $order = '', $page=0, $perpage=10, $options=NULL, $search=false, $mailssearch=NULL) {\n\n\tglobal $CFG, $COURSE, $SESSION;\n\n\t// CONTRIB-690\n\tif ( ! empty( $_POST['perpage'] ) and is_numeric($_POST['perpage']) ) {\n\t\t$SESSION->email_mailsperpage = $_POST['perpage'];\n\t} else if (!isset($SESSION->email_mailsperpage) or empty($SESSION->email_mailsperpage) ) {\n\t\t$SESSION->email_mailsperpage = 10; // Default value\n\t}\n\n\trequire_once('tablelib.php');\n\trequire_once('email.class.php');\n\n\t// Get actual course\n\tif (! $course = get_record(\"course\", \"id\", $COURSE->id)) {\n print_error('invalidcourseid', 'block_email_list');\n }\n\n if ($course->id == SITEID) {\n $coursecontext = get_context_instance(CONTEXT_SYSTEM); // SYSTEM context\n } else {\n $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); // Course context\n }\n\n\t$url = '';\n\t// Build url part options\n \tif ($options) {\n \t\t$url = email_build_url($options);\n }\n\n\t/// Print all mails in this HTML file\n\n\t// Should use this variable so that we don't break stuff every time a variable is added or changed.\n $baseurl = $CFG->wwwroot.'/blocks/email_list/email/index.php?'.$url. '&amp;page='.$page.'&amp;perpage='.$perpage;\n\n // Print init form from send data\n echo '<form id=\"sendmail\" action=\"'.$CFG->wwwroot.'/blocks/email_list/email/index.php?id='.$course->id.'&amp;folderid='.$options->folderid.'\" method=\"post\" target=\"'.$CFG->framename.'\" name=\"sendmail\">';\n\n\tif ( $course->id == SITEID ) {\n\t\t$tablecolumns = array('', 'icon', 'course', 'subject', 'writer', 'timecreated');\n\t} else {\n\t\t$tablecolumns = array('', 'icon', 'subject', 'writer', 'timecreated');\n\t}\n\n\t$folder = NULL;\n\tif ( isset( $options->folderid) ) {\n\t\tif ( $options->folderid != 0 ) {\n\t\t\t// Get folder\n\t\t\t$folder = email_get_folder($options->folderid);\n\t\t} else {\n\t\t\t// solve problem with select an x mails per page for maintein in this folder\n\t\t\tif ( isset($options->folderoldid) && $options->folderoldid != 0 ) {\n\t\t\t\t$options->folderid = $options->folderoldid;\n\t\t\t\t$folder = email_get_folder($options->folderid);\n\t\t\t}\n\t\t}\n\t}\n\n\t// If actual folder is inbox type, ... change tag showing.\n\tif ( $folder ) {\n\t\tif ( ( email_isfolder_type($folder, EMAIL_INBOX) ) ) {\n\t\t\t$strto = get_string('from', 'block_email_list');\n\t\t} else {\n\t\t\t$strto = get_string('to', 'block_email_list');\n\t\t}\n\t} else {\n\t\t$strto = get_string('from', 'block_email_list');\n\t}\n\n\tif ( $course->id == SITEID ) {\n \t$tableheaders = array('', '', get_string('course'), get_string('subject', 'block_email_list'), $strto, get_string('date', 'block_email_list'));\n\t} else {\n\t\t$tableheaders = array('', '', get_string('subject', 'block_email_list'), $strto, get_string('date', 'block_email_list'));\n\t}\n\n\n\t$table = new email_flexible_table('list-mails-'.$userid);\n\n $table->define_columns($tablecolumns);\n $table->define_headers($tableheaders);\n $table->define_baseurl($baseurl);\n\n\t$table->set_attribute('align', 'center');\n\t$table->set_attribute('width', '100%');\n\t$table->set_attribute('class', 'emailtable');\n\n\t$table->set_control_variables(array(\n TABLE_VAR_SORT => 'ssort',\n TABLE_VAR_HIDE => 'shide',\n TABLE_VAR_SHOW => 'sshow',\n TABLE_VAR_IFIRST => 'sifirst',\n TABLE_VAR_ILAST => 'silast',\n TABLE_VAR_PAGE => 'spage'\n ));\n\n\t$table->sortable(true, 'timecreated', SORT_DESC);\n\n\t$table->setup();\n\n\t// When no search\n\tif (! $search) {\n\t\t// Get mails\n\t\t$mails = email_get_mails($userid, $course->id, $table->get_sql_sort(), '', '', $options);\n\t} else {\n\t\t$mails = $mailssearch;\n\t}\n\n\t// Define long page.\n\t$totalcount = count($mails);\n\t$table->pagesize($SESSION->email_mailsperpage, $totalcount);\n\n\t$table->inputs(true);\n\n\t// Now, re-getting emails, apply pagesize (limit)\n\tif (! $search) {\n\t\t// Get mails\n\t\t$mails = email_get_mails($userid, $course->id, $table->get_sql_sort(), $table->get_page_start(), $table->get_page_size(), $options);\n\t}\n\n\tif (! $mails ) {\n\t\t$mails = array();\n\t}\n\n\n\t$mailsids = email_get_ids($mails);\n\n\t// Print all rows\n\tforeach ($mails as $mail) {\n\n\t\t$attribute = array();\n\t\t$email = new eMail();\n\t\t$email->set_email($mail);\n\n\t\tif ( $folder ) {\n\t\t\tif ( email_isfolder_type($folder, EMAIL_SENDBOX) ) {\n\t\t\t\t$struser = $email->get_users_send(has_capability('moodle/site:viewfullnames', $coursecontext));\n\t\t\t} else if ( email_isfolder_type($folder, EMAIL_INBOX) ) {\n\n\t\t\t\t$struser = $email->get_fullname_writer(has_capability('moodle/site:viewfullnames', $coursecontext));\n\t\t\t\tif (! $email->is_readed($userid, $mail->course) ) {\n \t\t$attribute = array( 'bgcolor' => $CFG->email_table_field_color);\n\t\t\t\t}\n\n\t\t\t} else if ( email_isfolder_type($folder, EMAIL_TRASH) ){\n\n\t\t\t\t$struser = $email->get_fullname_writer(has_capability('moodle/site:viewfullnames', $coursecontext));\n\n\t\t\t\tif (! $email->is_readed($userid, $mail->course) ) {\n \t\t $attribute = array( 'bgcolor' => $CFG->email_table_field_color);\n\t\t\t\t}\n\t\t\t} else if ( email_isfolder_type($folder, EMAIL_DRAFT) ) {\n\n\t\t\t\t$struser = $email->get_users_send(has_capability('moodle/site:viewfullnames', $coursecontext));\n\n\t\t\t\tif (! $email->is_readed($userid, $mail->course) ) {\n \t\t $attribute = array( 'bgcolor' => $CFG->email_table_field_color);\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t$struser = $email->get_fullname_writer(has_capability('moodle/site:viewfullnames', $coursecontext));\n\n\t\t\t\tif (! $email->is_readed($userid, $mail->course) ) {\n \t\t $attribute = array( 'bgcolor' => $CFG->email_table_field_color);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Format user's\n\t\t\t$struser = $email->get_fullname_writer(has_capability('moodle/site:viewfullnames', $coursecontext));\n\t\t\tif (! $email->is_readed($userid, $mail->course) ) {\n \t $attribute = array( 'bgcolor' => $CFG->email_table_field_color);\n\t\t\t}\n\t\t}\n\n\t\tif (! isset($options->folderid) ) {\n\t\t\t$options->folderid = 0;\n\t\t}\n\n\t\tif ( email_isfolder_type($folder, EMAIL_DRAFT) ) {\n\t\t\t$urltosent = '<a href=\"'.$CFG->wwwroot.'/blocks/email_list/email/sendmail.php?id='.$mail->id.'&amp;action='.EMAIL_EDITDRAFT.'&amp;course='.$course->id.'\">'.$mail->subject.'</a>';\n\t\t} else {\n\t\t\tif ( $course->id == SITEID ) {\n\t\t\t\t$urltosent = '<a href=\"'.$CFG->wwwroot.'/blocks/email_list/email/view.php?id='.$mail->id.'&amp;action='.EMAIL_VIEWMAIL.'&amp;course='.$mail->course.'&amp;folderid='.$options->folderid.'&amp;mails='.$mailsids.'\">'.$mail->subject.'</a>';\n\t\t\t} else {\n\t\t\t\t$urltosent = '<a href=\"'.$CFG->wwwroot.'/blocks/email_list/email/view.php?id='.$mail->id.'&amp;action='.EMAIL_VIEWMAIL.'&amp;course='.$course->id.'&amp;folderid='.$options->folderid.'&amp;mails='.$mailsids.'\">'.$mail->subject.'</a>';\n\t\t\t}\n\t\t}\n\n\t\t$attachment = '';\n\t\tif ( $email->has_attachments() ) {\n\t\t\t$attachment = '<img src=\"'.$CFG->wwwroot.'/blocks/email_list/email/images/clip.gif\" alt=\"attachment\" /> ';\n\t\t}\n\n\t\t// Display diferent color if mail is reply or reply all\n\t\t$extraimginfo = '';\n\t\tif ( $email->is_answered($userid, $course->id) ) {\n\t\t\t// Color td\n\t\t\tunset($attribute);\n\t\t\t$attribute = array('bgcolor' => $CFG->email_answered_color);\n\n\t\t\t// Adding info img\n\t\t\t$extraimginfo = '<img src=\"'.$CFG->wwwroot.'/blocks/email_list/email/images/answered.gif\" alt=\"\" /> ';\n\n\t\t}\n\n\t\tif (! $course_mail = get_record(\"course\", \"id\", $mail->course)) {\n print_error('invalidcourseid', 'block_email_list');\n }\n\n\t\tif ( $course->id == SITEID ) {\n\t\t\t$table->add_data( array (\n\t '<input id=\"mail\" type=\"checkbox\" name=\"mailid[]\" value=\"'.$mail->id.'\" />',\n\t $course_mail->fullname,\n\t $attachment.$extraimginfo,\n\t $urltosent,\n\t $struser,\n\t userdate($mail->timecreated) ) ,\n\t $attribute\n\t );\n\t\t} else {\n\t\t\t$table->add_data( array (\n\t '<input id=\"mail\" type=\"checkbox\" name=\"mailid[]\" value=\"'.$mail->id.'\" />',\n\t $attachment.$extraimginfo,\n\t $urltosent,\n\t $struser,\n\t userdate($mail->timecreated) ) ,\n\t $attribute\n\t );\n\t\t}\n\n\t\t// Save previous mail\n \t$previousmail = $mail->id;\n\t}\n\n\t$table->print_html();\n\n\n\n\t// Print select action, if have mails\n\tif ( $mails ) {\n\t\temail_print_select_options($options, $SESSION->email_mailsperpage);\n\t}\n\n\t// End form\n\techo '</form>';\n\n\treturn true;\n}", "public function index()\n {\n return view(\n 'mailing-list.index',\n [\n 'mailingLists' => MailingListList::all()->sortBy('slug')\n ]\n );\n }", "public function getContactAllEmail()\n\t{\n\t\t$emails = 'nothing';\n\n\t\tif( $this->token != '' )\n\t\t{\n\t\t\t$url = $this->url . \"/Contacts/filter\";\n\t\t\t$filter_arguments = array(\n\t\t\t\t\"offset\" => 0,\n\t\t\t\t\"fields\" => \"id,portal_name\",\n\t\t\t);\n\n\t\t\t$response = self::call($url, $this->token, 'GET',$filter_arguments);\n\n\t\t\t$email_records = $response->records;\n\n\t\t\tforeach($email_records as $record)\n\t\t\t{\n\t\t\t\t$emails[] = $record->portal_name;\n\t\t\t}\n\t\t}\n\n\t\treturn $emails;\n\t}", "public function getAllUnreadEmailsSenders()\n {\n $messages = collect(LaravelGmail::message()->unread()->preload()->all());\n $fromList = [];\n\n $messages->each(function ($message) use (&$fromList) {\n $fromList[] = $message->getFrom();\n });\n\n // TODO: can be optimized\n return $this->getUnreadEmailsList($fromList);\n }", "public function getAllEmails() {\n $this->db->cache = false;\n if (!$this->db->from($this->table)->select('email')->all()) {\n return [];\n }\n return $this->db->from($this->table)->select('email')->all();\n }", "function getEmails() {\n\treturn db_query(\"SELECT email FROM Emails\");\n}", "public function getAllVoicemail()\n {\n return $this->_getAndParse($this->_serverPath['voicemail'], null);\n }", "public function fetchEmails(): void\n {\n $this->fetchedEmails = [];\n\n try {\n $response = $this->mailhog->request('GET', '/api/v1/messages');\n $this->fetchedEmails = json_decode($response->getBody(), false);\n } catch (Exception $e) {\n $this->fail('Exception: ' . $e->getMessage());\n }\n $this->sortEmails($this->fetchedEmails);\n\n // by default, work on all emails\n $this->setCurrentInbox($this->fetchedEmails);\n }", "public function indexAction()\n {\n return new ViewModel(array(\n 'records' => $this->emailsService->getCurrentEmails(),\n ));\n }", "private function show_all_mail(){\n $this->get_all_mail();\n $counter =1;\n while ($this->mails[$counter][\"date\"]!=\"\"){\n echo \"<hr/>\";\n echo \"date: \".$this->mails[$counter][\"date\"][\"raw\"].\"<br/>\";\n echo \"year: \".$this->mails[$counter][\"date\"][\"year\"].\"<br/>\";\n echo \"month: \".$this->mails[$counter][\"date\"][\"month\"].\"<br/>\";\n echo \"day: \".$this->mails[$counter][\"date\"][\"day\"].\"<br/>\";\n echo \"hour: \".$this->mails[$counter][\"date\"][\"hour\"].\"<br/>\";\n echo \"minute: \".$this->mails[$counter][\"date\"][\"minute\"].\"<br/>\";\n echo \"subject: \".$this->mails[$counter][\"subject\"].\"<br/>\";\n echo \"mailbox: \".$this->mails[$counter][\"mailbox\"].\"<br/>\";\n echo \"host: \".$this->mails[$counter][\"host\"].\"<br/>\";\n echo \"text: \".$this->mails[$counter][\"text\"].\"<br/>\";\n $pic = 2;\n while ($this->mails[$counter][\"image\"][$pic][\"data\"]!=\"\"){\n $pic--;\n echo \"Bild Nr.\".$pic.\"<br/>\";\n $pic++;\n echo \"Bild Name: <a href=\\\"pics/\".$this->mails[$counter][\"image\"][$pic][\"name\"].\"\\\">\".$this->mails[$counter][\"image\"][$pic][\"name\"].\"</a><br/>\";\n //$this->email_base64_to_file($counter, $pic);\n //echo \"image \".$pic.\": \".$this->mails[$counter][\"image\"][$pic][\"data\"].\"<br/>\";\n $pic++;\n } \n $counter++; \n }\n }", "public function getAllMails()\n {\n $user = Auth::user();\n $emails = DB::table('users')->select('id','email')->get();\n return response()->json($emails);\n }", "public function actionIndex()\n {\n $request = Yii::app()->request;\n $email = new TransactionalEmail('search');\n $email->unsetAttributes();\n\n $email->attributes = (array)$request->getQuery($email->modelName, array());\n\n $this->setData(array(\n 'pageMetaTitle' => $this->data->pageMetaTitle . ' | '. Yii::t('transactional_emails', 'View transactional emails'),\n 'pageHeading' => Yii::t('transactional_emails', 'View transactional emails'),\n 'pageBreadcrumbs' => array(\n Yii::t('transactional_emails', 'Transactional emails') => $this->createUrl('transactional_emails/index'),\n Yii::t('app', 'View all')\n )\n ));\n\n $this->render('list', compact('email'));\n }", "public function getAllmailAddresses(){\n\t\t$data=[];\n\t\t$this->load->model('SAR/PanelDetails');\n\t\t$data['Members']=$this->load->PanelDetails->getAllEmailAddresses();\n\t\t$this->load->view('includes/header');\n\t\t$this->load->view('users/SAR/setDates',$data);\n\t\t$this->load->view('includes/footer');\n\t}", "public function getOrderEmailList(){\n // Set method and action\n $method = 'email';\n $action = 'getOrderEmailList';\n\n // Set data\n $data = array('params' => true);\n\n // Send request and retrieve response\n $result = Dispatcher::send($method, $action, $data);\n\n return $result;\n }", "public function index($site)\n {\n \\Auth::user()->setCurrentSiteId($site->id);\n $emails = Email::getUnrespondedEmailsForSite($site);\n\n return view('email/list', ['emails' => $emails, 'site' => $site]);\n }", "public function getEmails()\n {\n return $this->emails;\n }", "public function getEmails()\n {\n return $this->emails;\n }", "public function getNewMailsAction()\n {\n $this->View()->success = true;\n $mails = $this->container->get('dbal_connection')->fetchAll('SELECT id, subject, receiverAddress FROM s_plugin_mailcatcher WHERE id > :id ORDER BY id ASC', ['id' => $this->Request()->getParam('id')]);\n $this->View()->mails = $mails;\n }", "function showMailsSent($admin_here=False){\n global $listOfUnsentEmails, $listOfSentEmails;\n \n // Report the unsent mails\n if ($admin_here){\n\tif (empty($listOfUnsentEmails)) $listOfUnsentEmails = array();\n\t$listOfUnsentEmails = array_unique($listOfUnsentEmails);\n\tsort($listOfUnsentEmails);\n\t$n = count($listOfUnsentEmails);\n\tif (!empty($listOfUnsentEmails)) MSG::WARNING(x('strong',\"The following $n email\".($n>1?'s are':' is ').\" still to be sent:\").'<br/>'.\n\t\t\t\t\t\t\t join('<br/>',$listOfUnsentEmails));\n }\n\n // Report the sent mails\n if (empty($listOfSentEmails)) $listOfSentEmails = array();\n $many = (($n=count($listOfSentEmails)) > 1);\n \n if ($n>0) $this->dbg(\"$n mails sent\");\n\n if ($many){ \n\tob_start();\n\tforeach ($listOfSentEmails as $to=>$v) {\n\t if (empty($v) || is_numeric($to)) continue;\n\t foreach ($v as $k=>$subject) {\n\t if (!myPear::$messageBuffer_active){\n\t MSG::MESSAGE_open('We have sent the following email'.($many?'s':'').' with an important information:','strong');\n\t $t = new b_table(\"width='100%'\");\n\t $t->tro();\n\t $t->th('&nbsp;');\n\t $t->th($t->x('i',\"To:\"));\n\t $t->th($t->x('i',\"Subject:\"));\n\t $t->trc();\n\t }\n\t if (!empty($t)){\n\t $t->tro();\n\t $t->td(array('',$to,$subject));\n\t $t->trc();\n\t }\n\t $to = '';\n\t }\n\t}\n\tif (!empty($t)) $t->close();\n\t$fp = ob_get_contents();\n\tob_end_clean();\n\t\n\tif (myPear::$messageBuffer_active){\n\t MSG::MESSAGE_add($fp);\n\t MSG::MESSAGE_close();\n\t}\n }else{\n\tforeach ($listOfSentEmails as $to=>$v) {\n\t if (empty($v) || is_numeric($to)) continue;\n\t foreach ($v as $k=>$subject) {\n\t MSG::MESSAGE(join('<br>',array('We have sent an important email',\n\t\t\t\t\t x('i',\"To: \").$to,\n\t\t\t\t\t x('i',\"Subject: \").$subject)));\n\t }\n\t}\n }\n if (!empty($listOfSentEmails) && cnf_inside_fb){\n\tprint x('div width=100% style=\"margin:20px;text-align:center\"',bJS()->close_modalWindow('Close this window'));\n }\n $listOfSentEmails = $listOfUnsentEmails = array();\n }", "public function findAll()\n {\n return $this->em\n ->getRepository('App:Mail')\n ->findAll()\n ;\n }", "function index()\n {\n if (!$this->session->userdata('admin_logged')){ redirect('admin/login');} \n $data['email'] = $this->Email_model->get_all_email();\n \n $data['_view'] = 'email/index';\n $this->load->view('layouts/main',$data);\n }", "public function indexAction()\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $entities = $em->getRepository('LooninsIncidentBundle:GdpMails')->findAll();\r\n\r\n return array(\r\n 'entities' => $entities,\r\n );\r\n }", "function index()\r\r {\r $listingTypes = $this->Criteria->getSelectList();\r $email_layout = Sanitize::getVar($this->Config, 'email_layout');\r $email_listing_loop = Sanitize::getVar($this->Config, 'email_listing_loop');\r if(preg_match('%\\{JR_LISTING_LOOP\\}%', $email_layout, $regs)){\r $email_layout = preg_replace(\"%\\{JR_LISTING_LOOP\\}%\", $email_listing_loop , $email_layout);\r }\r // Send the $listingTypes variable to the View\r $this->set(array('listingTypes'=>$listingTypes,'emailLayout'=>$email_layout,'email_listing_loop'=>$email_listing_loop));\r // Render the View\r return $this->render('email','index');\r\r }", "function displayInbox($params) {\r\n\t\treturn $this->dsInbox($params)->items(E('messages'), 'message');\r\n\t}", "public function getEmailReferrers();", "public function index()\n {\n $mail = Mails::get();\n\n return view('admin.mails.index', compact('mail'));\n }", "function admin_mail_list( string $search = '' ) : array\n{\n // Only moderators and above can see this\n user_restrict_to_moderators();\n\n // Check if the required files have been included\n require_included_file('functions_time.inc.php');\n\n // Sanitize the search data\n $search = sanitize($search, 'string');\n\n // Fetch the private messages\n $qmessages = \" SELECT users_private_messages.id AS 'pm_id' ,\n users_private_messages.title AS 'pm_title' ,\n users_private_messages.sent_at AS 'pm_sent' ,\n users_private_messages.read_at AS 'pm_read' ,\n users_private_messages.fk_users_recipient AS 'pm_recipient' ,\n recipient.username AS 'ur_nick' ,\n users_private_messages.fk_users_sender AS 'us_id' ,\n sender.username AS 'us_nick' ,\n users_private_messages.fk_parent_message AS 'pm_parent'\n FROM users_private_messages\n LEFT JOIN users AS sender\n ON users_private_messages.fk_users_sender = sender.id\n LEFT JOIN users AS recipient\n ON users_private_messages.fk_users_recipient = recipient.id\n WHERE users_private_messages.hide_from_admin_mail = 0\n AND ( users_private_messages.fk_users_recipient = 0\n OR users_private_messages.fk_users_sender = 0 ) \";\n\n // Execute the search\n if($search)\n $qmessages .= \" AND ( users_private_messages.title LIKE '%$search%'\n OR sender.username LIKE '%$search%'\n OR recipient.username LIKE '%$search%' ) \";\n\n // Hide admin mail from moderators\n if(!user_is_administrator())\n $qmessages .= \" AND users_private_messages.is_admin_only_message = 0 \";\n\n // Sort the results\n $qmessages .= \" ORDER BY users_private_messages.sent_at DESC \";\n\n // Run the query\n $qmessages = query($qmessages);\n\n // Prepare the data\n for($i = 0; $row = mysqli_fetch_array($qmessages); $i++)\n {\n $data[$i]['id'] = sanitize_output($row['pm_id']);\n $data[$i]['display'] = (!$row['pm_recipient']);\n $data[$i]['title'] = sanitize_output($row['pm_title']);\n $data[$i]['read'] = ($row['pm_read']);\n $data[$i]['recipient'] = $row['pm_recipient'];\n $sender_username = $row['us_id'] ? sanitize_output($row['us_nick']) : sanitize_output($row['ur_nick']);\n $data[$i]['sender'] = (!$row['us_id'] && !$row['pm_recipient']) ? __('nobleme') : $sender_username;\n $data[$i]['sent'] = sanitize_output(time_since($row['pm_sent']));\n $data[$i]['parent'] = $row['pm_parent'];\n $parent_ids[$i] = $row['pm_parent'];\n }\n\n // Add the number of rows to the data\n $data['rows'] = $i;\n\n // Initialize the unread message counter\n $data['unread'] = 0;\n\n // Loop through the messages to identify the top level ones (latest message of a message chain)\n for($i = 0; $i < $data['rows']; $i++)\n {\n $data[$i]['top_level'] = !in_array($data[$i]['id'], $parent_ids);\n $data['unread'] += ($data[$i]['display'] && $data[$i]['top_level'] && !$data[$i]['read']);\n }\n\n // Return the prepared data\n return $data;\n}", "public function getAllRecipients() {}", "public function index()\n {\n $emails = EmailTracker::all();\n return view('email_tracker',compact('emails'));\n }", "public function GetEmailAddresses()\n {\n $dbTalker = new DbTalker();\n return $dbTalker->GetAllMembersAndEmails();\n }", "public function notify_list(){\n\n\t\tif(!empty($_SESSION[\"notify\"][\"messages\"])){\n\n\n\t\t\techo \"<ul id=\\\"notify-messages\\\">\";\n\t\t\tforeach ($_SESSION[\"notify\"][\"messages\"] as $message) {\n\t\t\t\techo \"<li data-type=\\\"\".$message[\"type\"].\"\\\">\" . $message[\"message\"] . \"</li>\";\n\t\t\t}\n\t\t\techo \"</ul>\";\n\t\t}\n\n\t\t//limpar o queue de notifications\n\t\tself::notify_empty();\n\n\t}", "function nice_get_entries()\n\t{\n\t\t$_m=$GLOBALS['SITE_DB']->query_select('f_welcome_emails',array('*'));\n\t\t$entries=new ocp_tempcode();\n\t\tforeach ($_m as $m)\n\t\t{\n\t\t\t$entries->attach(form_input_list_entry(strval($m['id']),false,$m['w_name']));\n\t\t}\n\n\t\treturn $entries;\n\t}", "public function listAll();", "public function listAll();", "public function getMailboxes()\r\n\t{\r\n\t\treturn false;\r\n\t}", "public function test_all_email_endpoint()\n {\n $response = $this->json('GET', route('emails.index'));\n $response->assertStatus(200);\n }", "public function getList()\n {\n return $this->returnText('Full list of users and queues can be found here: https://nbq.2g.be/'. $this->c->id .'/'. urlencode($this->c->displayName) .' ');\n }", "public function index()\n {\n $mailers = Mailer::orderBy('send_date', 'desc')->get();\n\n return view('mailers.index', compact('mailers'));\n }", "public function retrieveAllMails()\n {\n $mails = new Collection();\n for($i = 1; $i <= $this->countAllMails(); $i++)\n {\n $mails->add($this->retrieveMail($i));\n }\n return $mails;\n }", "public function index(){\n Auth::checkAdminLogin();\n\n\t\t// Set the Page Title ('pageName', 'pageSection', 'areaName')\n\t\t$this->_view->pageTitle = array('Email');\n\t\t// Set Page Description\n\t\t$this->_view->pageDescription = 'Email Index';\n\t\t// Set Page Section\n\t\t$this->_view->pageSection = 'Emails';\n\t\t// Set Page Sub Section\n\t\t$this->_view->pageSubSection = 'Email Index';\n\n\t\t###### PAGINATION ######\n //sanitise or set keywords to false\n if(isset($_GET['keywords']) && !empty($_GET['keywords'])){\n $_GET['keywords'] = FormInput::checkKeywords($_GET['keywords']);\n }else{\n $_GET['keywords'] = false;\n }\n\n $totalItems = $this->_model->countAllData($_GET['keywords']);\n $pages = new Pagination(20,'keywords='.$_GET['keywords'].'&page', $totalItems[0]['total']);\n $this->_view->getAllData = $this->_model->getAllData($pages->get_limit(), $_GET['keywords']);\n\n\t\t// Create the pagination nav menu\n\t\t$this->_view->page_links = $pages->page_links();\n\n\t\t// Render the view ($renderBody, $layout, $area)\n\t\t$this->_view->render('emails/index', 'layout', 'backoffice');\n\t}", "public function listAll()\n\t{\n\t\t$data['auditorias'] = $this->relatorio_model->listaAuditorias(1);\n\n\t\t$data['ncs'] = $this->relatorio_model->listaNCs(1);\n\n\t\t$data['acs'] = $this->relatorio_model->listaACs(1);\n\n\t\t$data['main_content'] = 'relatorio/relatorio_view';\n\t\t\n\t\t// Envia todas as informações para tela //\n\t\t$this->parser->parse('template', $data);\n\t}", "public function c_getListOtsOtPadreEmail() {\r\n $otPadreList = $this->Dao_ot_padre_model->getListOtsOtPadreEmail();\r\n echo json_encode($otPadreList);\r\n }", "public function EEList() {\n return $this->sendRequest('domain/list');\n }", "public function showAllByEmail(Request $request)\n {\n $this->validate($request, ['email' => 'required|email']);\n\n $recipient = Recipient::where('email', $request->input('email'))->first();\n if ($recipient === null) {\n return response()->json(['error' => 'Recipient not found!'], 400);\n } else {\n $vouchers = VoucherPool::where(\n 'recipient_id',\n $recipient->id\n )->with(\n 'specialoffer'\n )->get();\n\n return response()->json(\n ['data' => ['recipient' => $recipient, 'vouchers' => $vouchers]]\n );\n }\n }", "public function allAdminList(){\n $result = $this->adminModel->getAllAdmin();\n foreach ($result as $row){\n $data[] = array('AdminID'=>$row->adminID,'Email'=>$row->email,'role'=>$row->type,\n );\n }\n $this->view('admins/allAdminList',$data);\n\n }", "public function index()\n {\n // Busco todos los mails\n $mails = Mail::all();\n \n // Retorno vista\n return view('panel.mails.index', compact('mails'));\n }", "public static function getAllAdminEmails()\n {\n $pdo = static::getDB();\n\n $user_role = User::ROLE_ADMIN;\n\n $sql = \"select email from users where user_role = :email\";\n\n $result = $pdo->prepare($sql);\n \n $result->execute([$user_role]);\n\n return $result->fetchAll(PDO::FETCH_COLUMN, 0); \n }", "public function index()\n {\n $emailfrom=EmailAcounts::all();\n return view('Compose',compact('emailfrom'));\n }", "public function listadeTodosEmailDao(){\r\n \r\n require_once (\"conexao.php\");\r\n require_once (\"modelo/objetoEmail.php\");\r\n \r\n $obj = Connection::getInstance();\r\n $listaEmail = array();\r\n \r\n $string = \"Select nome,email,comentario,data from email order by data\";\r\n $resultado = mysql_query($string) or die (\"Nao foi possivel realizar a busca\".mysql_error());\r\n\t$i=0; \r\n while ($registro = mysql_fetch_assoc($resultado)){\r\n\r\n\t $email = new objetoEmail(); \r\n $email->enviarEmail($registro['email'],$registro['nome'],$registro['comentario'],$registro['data']); \r\n\t $listaEmail[$i] = $email;\r\n \r\n $i++;\r\n }\r\n\t\t\r\n\t\tmysql_free_result($resultado);\r\n $obj->freebanco();\r\n return $listaEmail;\r\n }", "public function getEmails() {\n\t\treturn empty( $this->container['emails'] ) ? null : $this->container['emails'];\n\t}", "public function getEmails()\n {\n $response = $this->get('user/emails');\n\n return $response['emails'];\n }", "public function getMails(): Collection\n {\n\n return $this->mails;\n\n }", "public function actionIndex()\n {\n $this->layout = 'profile-layout';\n \n $session = Yii::$app->session;\n\n $student = Student::findOne($session->get('id'));\n \n $emails = null;\n \n if($student!==null){\n \n $emails = Email::find()->where(['receiver_email' => $student->email_address])->all();\n \n }\n\n return $this->render('index',[\n 'emails' => $emails,\n ]);\n }", "public function get_emails() {\n\n\t\t$emails = array();\n\n\t\tforeach ( $this->settings['recipients'] as $item ) {\n\t\t\t$emails[] = $item['value'];\n\t\t}\n\n\t\treturn $emails;\n\t}", "public function index()\n {\n\n $group = EmailGroup::paginate(20);\n return view('admin.email-marketing.Group.index')->with(['items' => $group]);\n }", "function cp_do_view_supplier_emails($adata) {\n\t# Get security vars\n\t\t$_SEC \t= get_security_flags();\n\t\t$_PERMS\t= do_decode_perms_admin($_SEC['_sadmin_perms']);\n\n\t# Dim some Vars:\n\t\tglobal $_CCFG, $_TCFG, $_DBCFG, $db_coin, $_LANG, $_SERVER, $_nl, $_sp;\n\n\t# Get all email addresses for a supplier\n\t\t$sinfo\t= get_contact_supplier_info($adata['s_id']);\n\t\t$s_emails\t= get_contact_supplier_info_alias($adata['s_id'], 1);\n\t\t$x\t\t= sizeof($s_emails);\n\n\t# Set Query parameters for select.\n\t\t$query\t = 'SELECT *';\n\t\t$_from\t = ' FROM '.$_DBCFG['mail_archive'];\n\t\tIF ($_CCFG['_PKG_SAFE_EMAIL_ADDRESS']) {\n\t\t\t$_where\t = ' WHERE '.$_DBCFG['mail_archive'].\".ma_fld_from='\".$sinfo['s_email'].\"'\";\n\t\t\t$_where\t.= ' OR '.$_DBCFG['mail_archive'].\".ma_fld_recip='\".$sinfo['s_email'].\"'\";\n\t\t} ELSE {\n\t\t\t$_where\t = ' WHERE '.$_DBCFG['mail_archive'].\".ma_fld_from LIKE '%<\".$sinfo['s_email'].\">%'\";\n\t\t\t$_where\t.= ' OR '.$_DBCFG['mail_archive'].\".ma_fld_recip LIKE '%<\".$sinfo['s_email'].\">%'\";\n\t\t}\n\t\tIF ($x) {\n\t\t\tFOR ($i=0; $i<=$x; $i++) {\n\t\t\t\tIF ($_CCFG['_PKG_SAFE_EMAIL_ADDRESS']) {\n\t\t\t\t\t$_where\t.= ' OR '.$_DBCFG['mail_archive'].\".ma_fld_from='\".$s_emails[$i]['c_email'].\"'\";\n\t\t\t\t\t$_where\t.= ' OR '.$_DBCFG['mail_archive'].\".ma_fld_recip='\".$s_emails[$i]['c_email'].\"'\";\n\t\t\t\t} ELSE {\n\t\t \t\t\t$_where\t.= ' OR '.$_DBCFG['mail_archive'].\".ma_fld_from LIKE '%<\".$s_emails[$i]['c_email'].\">%'\";\n\t\t\t\t\t$_where\t.= ' OR '.$_DBCFG['mail_archive'].\".ma_fld_recip LIKE '%<\".$s_emails[$i]['c_email'].\">%'\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$_order = ' ORDER BY '.$_DBCFG['mail_archive'].'.ma_time_stamp DESC';\n\n\t\tIF (!$_CCFG['IPL_SUPPLIERS'] > 0) {$_CCFG['IPL_SUPPLIERS'] = 5;}\n\t\t$_limit = ' LIMIT 0, '.$_CCFG['IPL_SUPPLIERS'];\n\n\t# Get count of rows total:\n\t\t$query_ttl = 'SELECT COUNT(*)';\n\t\t$query_ttl .= $_from;\n\t\t$query_ttl .= $_where;\n\t\t$result_ttl\t= $db_coin->db_query_execute($query_ttl);\n\t\twhile(list($cnt) = $db_coin->db_fetch_row($result_ttl)) {$numrows_ttl = $cnt;}\n\n\t# Do select listing records and return check\n\t\t$query\t.= $_from.$_where.$_order.$_limit;\n\t\t$result\t= $db_coin->db_query_execute($query);\n\t\t$numrows\t= $db_coin->db_query_numrows($result);\n\n\t# Build form output\n\t\t$_out .= '<div align=\"center\">'.$_nl;\n\t\t$_out .= '<table width=\"100%\" border=\"0\" bordercolor=\"'.$_TCFG['_TAG_TABLE_BRDR_COLOR'].'\" bgcolor=\"'.$_TCFG['_TAG_TRTD_BKGRND_COLOR'].'\" cellpadding=\"0\" cellspacing=\"1\">'.$_nl;\n\t\t$_out .= '<tr class=\"BLK_DEF_TITLE\"><td class=\"TP3MED_NC\" colspan=\"7\">'.$_nl;\n\n\t\t$_out .= '<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">'.$_nl;\n\t\t$_out .= '<tr class=\"BLK_IT_TITLE_TXT\">'.$_nl.'<td class=\"TP0MED_NL\">'.$_nl;\n\t\t$_out .= '<b>'.$_LANG['_ADMIN']['l_Email_Archive'];\n\t\t$_out .= ' ('.$numrows.$_sp.$_LANG['_ADMIN']['of'].$_sp.$numrows_ttl.$_sp.$_LANG['_ADMIN']['total_entries'].')</b><br>'.$_nl;\n\t\t$_out .= '</td>'.$_nl.'<td class=\"TP0MED_NR\">'.$_nl;\n\n\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\tIF ($numrows_ttl > $_CCFG['IPL_SUPPLIERS']) {\n\t \t\t\t$_out .= do_nav_link('mod.php?mod=mail&mode=search&sw=archive&search_type=1&s_to='.$sinfo['s_email'].'&s_from='.$sinfo['s_email'], $_TCFG['_S_IMG_VIEW_S'],$_TCFG['_S_IMG_VIEW_S_MO'],'','');\n\t \t\t}\n\t\t\t$_out .= do_nav_link('mod.php?mod=mail&mode=search&sw=archive', $_TCFG['_S_IMG_SEARCH_S'],$_TCFG['_S_IMG_SEARCH_S_MO'],'','');\n\t\t} ELSE {\n\t\t\t$_out .= $_sp;\n\t\t}\n\t\t$_out .= '</td>'.$_nl.'</tr>'.$_nl.'</table>'.$_nl;\n\n\t\t$_out .= '</td></tr>'.$_nl;\n\t\t$_out .= '<tr class=\"BLK_DEF_ENTRY\">'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BC\">'.$_LANG['_ADMIN']['l_Id'].'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BC\">'.$_LANG['_ADMIN']['l_Date_Sent'].'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BL\">'.$_LANG['_ADMIN']['l_Subject'].'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BL\">'.$_LANG['_CCFG']['Actions'].'</td>'.$_nl;\n\t\t$_out .= '</tr>'.$_nl;\n\n\t# Process query results\n\t\tIF ($numrows) {\n\t\t\twhile ($row = $db_coin->db_fetch_array($result)) {\n\t\t\t\t$_out .= '<tr class=\"BLK_DEF_ENTRY\">'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NC\">'.$row['ma_id'].'</td>'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NC\">'.dt_make_datetime($row['ma_time_stamp'], $_CCFG['_PKG_DATE_FORMAT_SHORT_DT'] ).'</td>'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NL\">'.htmlspecialchars($row['ma_fld_subject']).'</td>'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NL\"><nobr>'.$_nl;\n\t\t\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\t\t\t$_out .= do_nav_link('mod.php?mod=mail&mode=resend&obj=arch&ma_id='.$row['ma_id'], $_TCFG['_S_IMG_EMAIL_S'],$_TCFG['_S_IMG_EMAIL_S_MO'],'','');\n\t\t\t\t\t$_out .= do_nav_link('mod.php?mod=mail&mode=view&obj=arch&ma_id='.$row['ma_id'].'&_suser_id='.$adata['_suser_id'], $_TCFG['_S_IMG_VIEW_S'],$_TCFG['_S_IMG_VIEW_S_MO'],'','');\n\t\t\t\t\t$_out .= do_nav_link('mod_print.php?mod=mail&mode=view&obj=arch&ma_id='.$row['ma_id'], $_TCFG['_S_IMG_PRINT_S'],$_TCFG['_S_IMG_PRINT_S_MO'],'_new','');\n\t\t\t\t\tIF ($_PERMS['AP16'] == 1 || $_PERMS['AP05'] == 1) {\n\t\t\t\t\t\t$_out .= do_nav_link('mod.php?mod=mail&mode=delete&obj=arch&stage=2&ma_id='.$row['ma_id'], $_TCFG['_S_IMG_DEL_S'],$_TCFG['_S_IMG_DEL_S_MO'],'','');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$_out .= '</nobr></td>'.$_nl;\n\t\t\t\t$_out .= '</tr>'.$_nl;\n\t\t\t}\n\t\t}\n\n\t\t$_out .= '</table>'.$_nl;\n\t\t$_out .= '</div>'.$_nl;\n\t\t$_out .= '<br>'.$_nl;\n\n\t# Return results\n\t\treturn $_out;\n}", "public static function getList(){\n\t\t$sql = new sql();\n\n\t\treturn $sql->select(\"SELECT * FROM usuarios ORDER BY email;\");\n\n\t}", "public function retrieveEmailTemplates()\n {\n return $this->start()->uri(\"/api/email/template\")\n ->get()\n ->go();\n }", "function showInbox($imap) {\n /**\n * Print the INBOX message count and the subject of all messages\n * in the INBOX\n */\n $storage = new Zend_Mail_Storage_Imap($imap);\n\n include 'header.php';\n echo '<h1>Total messages: ' . $storage->countMessages() . \"</h1>\\n\";\n\n /**\n * Retrieve first 5 messages. If retrieving more, you'll want\n * to directly use Zend_Mail_Protocol_Imap and do a batch retrieval,\n * plus retrieve only the headers\n */\n echo 'First five messages: <ul>';\n for ($i = 1; $i <= $storage->countMessages() && $i <= 5; $i++ ){\n echo '<li>' . htmlentities($storage->getMessage($i)->subject) . \"</li>\\n\";\n }\n echo '</ul>';\n}", "public function index(EmailRequestList $request)\n {\n return response()->json(['success' => true, 'messages' => [__('pages.email.send.success')], 'data' => ['email' => $this->emailService->index($request->paginate, 200)]], 200);\n }", "public function indexEmail()\n {\n if (!Sentinel::hasAccess('communication')) {\n Flash::warning(\"Permission Denied\");\n return redirect('/');\n }\n $data = Email::where('branch_id', session('branch_id'))->get();\n return view('communication.email', compact('data'));\n }", "public function findAllEmails()\r\n {\r\n try {\r\n $query = 'SELECT email FROM login';\r\n $stmt = $this->conn->prepare($query);\r\n $stmt->execute();\r\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n if ($result == false) {\r\n return false;\r\n } else {\r\n return $result;\r\n }\r\n } catch (PDOException $e) {\r\n echo \"get accounts error\";\r\n die();\r\n }\r\n }", "public function getUserMails()\r\n\t{\r\n\t\t$userDir = __DIR__ . '/../../settings/users';\r\n\t\t\t\t\r\n\t\t/* check if users directory exists */\r\n\t\tif(!is_dir($userDir)){ return array(); }\r\n\t\t\r\n\t\t/* get all user files */\r\n\t\t$users = array_diff(scandir($userDir), array('..', '.'));\r\n\t\t\r\n\t\t$usermails\t= array();\r\n\r\n\t\tforeach($users as $key => $user)\r\n\t\t{\r\n\t\t\tif($user == '.logins'){ continue; }\r\n\r\n\t\t\t$contents \t= file_get_contents($userDir . DIRECTORY_SEPARATOR . $user);\r\n\r\n\t\t\tif($contents === false){ continue; }\r\n\r\n\t\t\t$searchfor \t= 'email:';\r\n\r\n\t\t\t# escape special characters in the query\r\n\t\t\t$pattern \t= preg_quote($searchfor, '/');\r\n\t\t\t\r\n\t\t\t# finalise the regular expression, matching the whole line\r\n\t\t\t$pattern \t= \"/^.*$pattern.*\\$/m\";\r\n\r\n\t\t\t# search, and store first occurence in $matches\r\n\t\t\tif(preg_match($pattern, $contents, $match)){\r\n\t\t\t\t$usermails[] = trim(str_replace(\"email:\", \"\", $match[0]));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $usermails;\r\n\t}", "public function getAllIBCEmails() {\n\t\t$dao = $this->getDao(new IBCEmailGen());\n $whereClauseGroup = new WhereClauseGroup(\n\t\t\tarray(\n\t\t\t\tnew WhereClause('module','=', IBCEmailGen::$MODULE_NAME)\n\t\t\t)\n );\n $responses = $dao->getAllWhere($whereClauseGroup);\n return $responses;\n\t}", "public function showAllNotifications()\n {\n return view('intern.notifications.allnotifications')\n ->withUser(auth()->user())\n ->withNotifications(auth()->user()->notifications()->paginate(10));\n }", "public function all()\n\t{\n\t\treturn $this->contact->currentUser()->orderBy('lastName', 'asc')->orderBy('email', 'asc')->paginate( $this->perPage );\n\t}", "public function index()\n {\n $mailchimp = new Mailchimp();\n $lists = $mailchimp->lists()->get();\n\n return view('lists.index', ['lists'=>$lists]);\n }", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "function get_all_mail()\n {\n $this->db->order_by('id', 'desc');\n return $this->db->get('mail')->result_array();\n }", "function lists()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t$instructions['action'] = array('view'=>'view_job_confirmation_applications', 'approve'=>'issue_job_confirmation_letter', 'verify'=>'verify_job_confirmation_letter', 'post'=>'post_to_new_position');\n\t\tcheck_access($this, get_access_code($data, $instructions));\n\t\t\n\t\t$data['list'] = $this->_confirmation->get_list($data);\n\t\t#Make sure the approver has a signature on file if they are going to issue a letter\n\t\tif(!empty($data['list']) && !$this->native_session->get('__signature') && !empty($data['action']) && $data['action']=='approve')\n\t\t{\n\t\t\t $data['msg'] = \"WARNING: You need to <a href='\".base_url().\"profile/user_data'>upload a signature</a> to confirm the teacher posting.\";\n\t\t\t $this->native_session->set('__nosignature','Y');\n\t\t}\n\t\t$this->load->view('confirmation/list_confirmations', $data); \n\t}", "function getMailList($contentid='', $exclude='')\r\n\t{ /* exclude must be an array of values\r\n\t\t * OR not quoted list separated by ,\r\n\t\t *\r\n\t\t * contentid should be an array of values\r\n\t\t * OR not quoted list separated by ,\r\n\t\t */\r\n\r\n\t\t$database =& JFactory::getDBO();\r\n\r\n\t if (is_array($contentid)) {\r\n\t $contentid = implode(',', $contentid);\r\n\t }\r\n\t if (is_array($exclude)) {\r\n\t $exclude = implode(',', $exclude);\r\n\t }\r\n\r\n\t if ($this->_notify_users && $contentid) {\r\n\t /* Unregistered users */\r\n\t\t\t$query \t= \"SELECT DISTINCT email \"\r\n\t\t\t\t\t. \"\\n FROM `#__comment` \"\r\n\t\t\t\t\t. \"\\n WHERE contentid IN ($contentid) AND component='$this->_component'\"\r\n\t\t\t\t\t. \"\\n AND ( userid = NULL OR userid = 0 )\"\r\n\t\t\t\t\t. \"\\n AND email <> ''\"\r\n\t\t\t\t\t. \"\\n AND notify = '1'\"\r\n\t\t\t\t\t;\r\n\t\t\tif ($exclude) {\r\n\t\t\t\t$quoted = str_replace( ',', \"','\", $exclude); /* add quotes */\r\n\t\t\t\t$query .= \"\\n AND email NOT IN ('$quoted')\";\r\n\t\t\t}\r\n\t\t\t$database->setQuery( $query );\r\n\t\t\t$unregistered_maillist = $database->loadResultArray(); //tableau\r\n\r\n\t\t\tif ($unregistered_maillist) {\r\n\t\t\t $exclude = ($exclude ? $exclude.',' : '') . implode(',', $unregistered_maillist);\r\n\t\t\t}\r\n\r\n \t \t/* Registered users*/\r\n \t \t$registered_maillist = array();\r\n\t\t\t$query \t= \"SELECT DISTINCT u.email \"\r\n\t\t\t\t\t. \"\\n FROM `#__comment` AS c \"\r\n\t\t\t\t\t. \"\\n INNER JOIN `#__users` AS u ON u.id = c.userid \"\r\n\t\t\t\t\t. \"\\n WHERE c.contentid IN ($contentid) AND component='$this->_component'\"\r\n\t\t\t\t\t. \"\\n AND u.email <> ''\"\r\n\t\t\t\t\t. \"\\n AND c.notify = '1'\"\r\n\t\t\t\t\t;\r\n\t\t\tif ($exclude) {\r\n\t\t\t\t$quoted = str_replace( ',', \"','\", $exclude); /* add quotes */\r\n\t\t\t\t$query .= \"\\n AND u.email NOT IN ('$quoted')\";\r\n\t\t\t}\r\n\t\t\t$database->setQuery( $query );\r\n\t\t\t$registered_maillist = $database->loadResultArray(); //tableau\r\n//\t\t\t$debugemail = implode(';' , $maillist); // liste s�par� par des ;\r\n\r\n\t\t\tif ($registered_maillist) {\r\n\t\t \t$exclude = ($exclude ? $exclude.',' : '') . implode(',', $registered_maillist);\r\n\t\t\t}\r\n\t }\r\n\r\n\t\t$moderator_maillist = $this->getMailList_moderator($exclude);\r\n\r\n\t\t$maillist = array();\r\n\t\tif (isset($unregistered_maillist) && is_array($unregistered_maillist))\r\n\t\t\t$maillist = array_merge( $maillist, $unregistered_maillist);\r\n\t\tif (isset($registered_maillist) && is_array($registered_maillist))\r\n\t\t\t$maillist = array_merge( $maillist, $registered_maillist);\r\n\t\tif (isset($moderator_maillist) && is_array($moderator_maillist))\r\n\t\t\t$maillist = array_merge( $maillist, $moderator_maillist);\r\n\r\n\t\treturn ($maillist);\r\n\t}", "public function getMailinglist() {\n return $this->getValue('mailinglist');\n }", "public function emails()\n {\n return $this->hasManyThrough(Contact::class, Profile::class)\n ->select([DB::raw('IFNULL(prefix, \"Email\") AS type'), 'value AS url', 'is_primary'])\n ->where('type', 'email');\n }", "public function listAll()\n {\n }", "function showEmptyList()\n {\n $emptymsg = array();\n $emptymsg['p'] = '您系统消息箱还没有消息。';\n $emptymsg['p'] = '系统消息是系统为您自动更新的一些重要通知,如平台通知、' . GROUP_NAME() . '相关信息等等';\n $this->tu->showEmptyListBlock($emptymsg);\n }", "public function emailadressen() {\r\n\t\t$objDBMaillijstEmailAdres = new clsDBMaillijstEmailAdres();\r\n\t\tforeach($objDBMaillijstEmailAdres->selectAll($this->getm_iBedrijfID(), $this->getm_iMaillijstID()) as $rs){\r\n\t\t\tarray_push($this->m_colEmailAdressen,new clsEmailAdres($rs['BedrijfID'],$rs['EmailAdresID'])); // voeg object MaillijstEmailAdres toe aan emailadressen collection\r\n\t\t};\r\n\t \treturn $this->m_colEmailAdressen;\r\n\t}" ]
[ "0.7397555", "0.73086494", "0.7304704", "0.72429377", "0.72284794", "0.7096396", "0.6961561", "0.68926024", "0.6844237", "0.6803378", "0.67854947", "0.67702174", "0.66724527", "0.6640241", "0.6627167", "0.66057324", "0.65522814", "0.65025574", "0.6501332", "0.6476535", "0.64634186", "0.6456688", "0.64525867", "0.64458543", "0.6442374", "0.6426592", "0.6424365", "0.6423625", "0.6414011", "0.64045894", "0.6376116", "0.6371941", "0.6336643", "0.63358015", "0.6334886", "0.633139", "0.6305686", "0.62997574", "0.6293926", "0.62826186", "0.62826186", "0.6274308", "0.6274139", "0.6271941", "0.62711287", "0.6257544", "0.6238474", "0.62239367", "0.6222224", "0.6219494", "0.62165195", "0.6188122", "0.618513", "0.61826533", "0.6179307", "0.61613035", "0.61458075", "0.61458075", "0.6141066", "0.6135586", "0.6132442", "0.613218", "0.61305237", "0.6086349", "0.60819626", "0.6081353", "0.60746527", "0.606424", "0.60593355", "0.60461336", "0.60234034", "0.6018891", "0.5997352", "0.59895587", "0.59863746", "0.5982053", "0.59754294", "0.59621906", "0.5958698", "0.5951097", "0.5945988", "0.59414977", "0.59346855", "0.5926019", "0.59148604", "0.5912504", "0.58970934", "0.5896182", "0.5858421", "0.5836263", "0.5830154", "0.5818827", "0.58183545", "0.5808999", "0.5804236", "0.5802124", "0.5801117", "0.5792006", "0.57830083", "0.5778218" ]
0.64831
19
Update information by id
public function update($id, Request $request, MailerRepo $mailerService) { if(!$mailerService->update($id, $request->all())){ return response('При обновлении страницы возникли ошибки', 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update($id){\n\t\t//\n\t}", "public function update($id){\n\t\t//\n\t}", "public function update($id) {\r\n //\r\n }", "public function update($id);", "public function update($id);", "public function update($id)\n\t {\n\t //\n\t }", "public function update($id) {\n \n }", "public function update($id) {\n \n }", "public function update($id)\r\n {\r\n //\r\n }", "public function update($id) {\n\t\t//\n\t}", "public function update($id) {\n\t\t//\n\t}", "public function update($id) {\n\t\t//\n\t}", "public function update($id) {\n\t\t//\n\t}", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n }", "public function update($id) {\n }", "public function update($id) //Ändra befintlig boking\n\t{\n\t\t//\n\t}", "public function update($id) {\n //\n }", "public function update($id)\n {\n \n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n\t{\n\t\t\n\t}", "public function update($id)\n\t{\n\t\t\n\t}", "public function update($id)\n {\n //\n }", "public function update($id){\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\r\n\t{\r\n\t\t//\r\n\t}", "public function update($id)\r\n\t{\r\n\t\t//\r\n\t}", "public function update($id)\r\n\t{\r\n\t\t//\r\n\t}", "public function update($id)\n {\n \n }", "public function update($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}" ]
[ "0.86462885", "0.86462885", "0.8629003", "0.85983187", "0.85983187", "0.8538499", "0.8535516", "0.8535516", "0.85254216", "0.8512869", "0.8512869", "0.8512869", "0.8512869", "0.8505154", "0.8505154", "0.8505154", "0.8505154", "0.8505154", "0.8505154", "0.8505154", "0.8505154", "0.8505154", "0.8505154", "0.8505154", "0.8505154", "0.8505154", "0.845249", "0.845249", "0.84450513", "0.84369785", "0.8435288", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84222656", "0.84067804", "0.84067804", "0.84043473", "0.8399252", "0.8367742", "0.8367742", "0.8367742", "0.8367742", "0.83677024", "0.83677024", "0.83677024", "0.83656186", "0.83579904" ]
0.0
-1
Show form for creating with information from db
public function edit($id, MailerRepo $mailerService) { if(!($list = $mailerService->getByID($id))){ return response('Товар не найден', 404); } $menu_control = view()->shared('menu_control'); $menu_control['page'] = 'emails'; $menu_control['category'] = 'options'; $templates = $mailerService->findTemplates(); $events = $mailerService->findEvents(); return view('mailer::edit', compact('menu_control', 'templates', 'events', 'list')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n // I skip using this create function because I use a modal form for inserting data using modal in index view via index function.\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function createForm();", "public function createForm();", "public static function display_create_form(){\n echo \"<form action='../../Controllers/charity_controller.class.php?action=save' method='post'>\";\n echo \"Name: <input type='text' name='name' /><br />\";\n echo \"Description: <textarea name='description'></textarea><br />\";\n echo \"<input type='submit' value='Save' />\";\n echo \"</form>\";\n }", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "function show_new_record() {\r\n if ($this->allow_new) {\r\n #~ echo \"<p><a href='{$_SERVER['PHP_SELF']}?m={$this->module}&amp;act=new&amp;go=\".urlencode($GLOBALS['full_self_url']).\"'>Insert new row</a>\";\r\n echo '<form method=POST action=\"'.$_SERVER['PHP_SELF'].'\">';\r\n echo '<input type=hidden name=\"m\" value=\"'.$this->module.'\">';\r\n echo '<input type=hidden name=\"act\" value=\"new\">';\r\n echo '<input type=hidden name=\"go\" value=\"'.htmlentities($GLOBALS['full_self_url']).'\">'; # url to go after successful submitation\r\n # if i'm a detail, get master-detail field's value and pass it to new-form\r\n if ($this->logical_parent) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->parentkey) { # foreign key always int\r\n echo '<input type=hidden name=\"sugg_field['.$colvar.']\" value=\"'.htmlentities($col->parentkey_value).'\">';\r\n }\r\n }\r\n }\r\n echo '<p>'.lang('Add').' <input type=text name=\"num_row\" size=2 value=\"1\"> '.lang($this->unit).' <input type=submit value=\"'.lang('Go').'\">';\r\n echo '</form>';\r\n }\r\n }", "public function create()\n {\n //KEMUDIAN DI DALAMNYA KITA MENJALANKAN FUNGSI UNTUK MENGOSONGKAN FIELD\n $this->resetFields();\n //DAN MEMBUKA MODAL\n $this->openModal();\n }", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public function actionCreate()\n\t{\n\t\t\n\t\t//$data['model'] = new ClientForm();\n\n\t\t//$data['action'] = 'add';\n\t\t\n\t\t//$model=new Client;\n\t\t//$DPmodel=new Driverparticular;\n\t\t$data['modelBroker'] = new Broker;\n\t\t$data['model'] = new ClientForm();\n\t \t$data['DPmodel'] = new DriverParticularForm();\n\t\t$data['action'] = 'add';\n\t\t$data['i'] = 0;\n\t\t\n\t\t$this->render('_form', $data);\n\n\t\t\n\n\t}", "public function CreateForm();", "public function create(){\n \n $razas = Raza::get();\n include 'views/mascota/form_new.php';\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function createForm()\n {\n }", "protected function create() {\n $this->db->insertRow($this->table_name, $this->update);\n storeDbMsg($this->db,\"New \" . $this->form_ID . \" successfully created!\");\n }", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n return view('biologicos.create');\n }", "public function create()\n {\n $this->openModal();\n $this->resetInputFields();\n }", "public function create()\n {\n $this->openModal();\n $this->resetInputFields();\n }", "public function create()\n\t{\n\t\treturn view('dapils.create');\n\t}", "public function create()\n {\n return $this->form->render('mconsole::personal.form');\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "abstract public function createForm();", "abstract public function createForm();", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n \treturn view('sprzet_jednorazowy.create');\n }", "public function create()\n {\n //\n return View::make('admin.form_int_mun');\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create()\n {\n return view('Samples.create', [\n 'create' => new FormBuilder(\n [\n 'title'=>'text',\n 'slug'=>'text',\n 'type_id'=>'hidden',\n 'id'=>'hidden' \n ],\n ['samples.store'],\n 'POST',\n 'Create'\n ) \n ]);\n }", "public function create()\n {\n //\n $caseReference= commonModel::CaseList();\n\n return view('admin.case.coartInfo.form', compact('caseReference'));\n }", "public function create()\n {\n return view('saldo.form');\n }", "function create_new() {\n if($this->table_title != '' ) {\n $this->title = 'New ' . $this->table_title .\n $this->makeForm();\n }\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n\t{\t\n\t\t$modulos_list = Modulo::all()->lists('id', 'id');\n$professores_list = Professor::all()->lists('id', 'id');\n\n\t\t// load the create form (app/views/Turma/create.blade.php)\n\t\t$this->layout->content = View::make('Turma.create')\n->with('modulos_list', $modulos_list)\n->with('professores_list', $professores_list);\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "function createApprentice() {\n\t\t\t\t\t$addForm = new h2o('views/addApprentice.html');\n\t\t\t\t\techo $addForm->render();\n\t\t\t\t}", "public function create()\n\t{\n\t\t//\n\t\treturn view('admin.ejercicios.createUpdate');\n\t}", "public function create()\n\t{\t\n\t\t\n\t\t// load the create form (app/views/fbf_presenca/create.blade.php)\n\t\t$this->layout->content = View::make('fbf_presenca.create')\n;\n\t}", "public function create()\n {\n return view('admin.createform');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function actionCreate() {\n\t\t$request = Yii::app()->request;\n $form = new PersonaForm(\"new\");\n if($request->isPostRequest) {\n $form->attributes = $request->getPost('PersonaForm');\n if($form->validate()) {\n PersonaManager::savePersona($form);\n Yii::app()->user->setFlash('general-success', \"$form->nombre $form->apellido ha sido creado.\");\n $this->redirect('admin');\n }\n }\n $this->render('create', array('model'=>$form));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n //este deriva a un formulario, el cual debe tomar todos\n //los parametros del bache (nombre, fecha_y_hora, ubicacion, object_state_id (recuperarlo y pasarlo), estado(mostrar opciones y tomar el elegido)) y luego de todo esto llama a store para ser almacenado en la base de datos\n\n }", "public function create()\n {\n\t\treturn view('pages.record.create');\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n {\n //return view ('admin.user-table.new-user-form');\n }", "public function create()\n {\n //return view('marca.create');\n return 'Mostrando Formulario para crear Fabricantes';\n }", "function create() {\n\t\tglobal $tpl, $lng;\n\n\t\t$form = $this->initForm(TRUE);\n\t\tif ($form->checkInput()) {\n\t\t\tif ($this->createElement($this->getPropertiesFromPost($form))) {\n\t\t\t\tilUtil::sendSuccess($lng->txt('msg_obj_modified'), TRUE);\n\t\t\t\t$this->returnToParent();\n\t\t\t}\n\t\t}\n\n\t\t$form->setValuesByPost();\n\t\t$tpl->setContent($form->getHtml());\n\t}", "public function create()\n {\n //see modal controller\n }", "public function create()\n {\n //see modal controller\n }", "public function create()\n {\n //see modal controller\n }", "public function create()\n {\n return \"Formulário para cadastrar um novo cliente.\";\n }", "public function create()\n {\n $data = array();\n $data['formObj'] = $this->modelObj;\n $data['page_title'] = \"Add \".$this->module;\n $data['action_url'] = $this->moduleRouteText.\".store\";\n $data['action_params'] = 0;\n $data['buttonText'] = \"Save\";\n $data[\"method\"] = \"POST\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function create()\n {\n return view(\"api.insert\");\n }", "public function create()\n\t{\n\t\treturn view('uoms.create');\n\t}", "public function actionCreateForm()\n\t{\n\t\t$model=new TProducto;\n\t\t$modelInventario=new TInventario;\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['TProducto']))\n\t\t{\n\t\t\t$model->attributes=$_POST['TProducto'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_almacen));\n\t\t}\n\t\tYii::app()->theme = 'admin';\n\t\t$this->layout ='//layouts/portalAdmin';\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,'modelInventario'=>$modelInventario\n\t\t));\n\t}", "public function create()\n {\n // Searching for the data for populate the form\n $data = $this->prepareForm();\n\n //dd($data);\n\n // Redirect to create View with $data\n return \\View::make($this->path.'.create', $data);\n }", "public function create()\n {\n // Searching for the data for populate the form\n $data = $this->prepareForm();\n\n //dd($data);\n\n // Redirect to create View with $data\n return \\View::make($this->path.'.create', $data);\n }", "public function create()\n {\n return view('produto.form',[\n 'fabricantes' => Fabricante::pluck('nome', 'id')\n ]);\n }", "public function create(){\n\t\treturn view('gajipokok.create');\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n $template = (object) $this->template;\n $form = $this->form();\n return view('admin.disposisi.create', compact('template','form'));\n }", "public function create()\n {\n //mengarahkan ke form\n return view('pemilik.form');\n }", "public function create()\n {\n //\n return $this->render('create');\n\n }", "public function create()\n {\n return view('backend.xeploai_cd.create');\n }", "public function create()\n {\n $capitulo = Capitulo::find(Session::get('capitulo_id'));\n $libro = Libro::find($capitulo->libro_id);\n return view('descarga.formTable', compact('capitulo', 'libro'));\n }", "public function create()\n\t{\n // $this->load->view('index', $variaveis);\n \n $variaveis['titulo'] = 'Cadastro Usuários';\n\t\t$this->load->view('usuarios_cad', $variaveis);\n\t}", "public function create()\n {\n return view('admin.pages.forms.pengirim');\n }", "public function create()\n {\n return view('admin.backends.employee.form.create');\n }", "public function create()\n {\n return view('cli.informacion.create');\n }", "public function create()\n\t{\n\t\treturn view('stafs.create');\n\t}", "public function createAction() : object\n {\n $page = $this->di->get(\"page\");\n $form = new CreateForm($this->di);\n $form->check();\n\n $page->add(\"questions/crud/create\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $page->render([\n \"title\" => \"Create a item\",\n ]);\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n return view('backend.farmacia.create');\n }", "public function actionCreate()\n {\n $model = new Bilancio();\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 action_create()\n {\n $this->action_edit(FALSE);\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n //\n return view('perritos.create');\n }", "public function create()\n {\n return view('warrant::admin.acts.create');\n }", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('sapiadm.create'); }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}" ]
[ "0.7815603", "0.76920563", "0.75792426", "0.7565053", "0.7565053", "0.75552344", "0.75521153", "0.74542415", "0.74542415", "0.7418911", "0.73886937", "0.7293856", "0.7293856", "0.7293856", "0.7293856", "0.72826177", "0.727549", "0.72719425", "0.72471315", "0.72471315", "0.72295386", "0.7205592", "0.7193123", "0.7177679", "0.71762264", "0.7175655", "0.7175655", "0.71404326", "0.7137575", "0.713111", "0.71149576", "0.71141666", "0.71141666", "0.71130514", "0.7105411", "0.7089926", "0.7072753", "0.7063056", "0.7060452", "0.7055604", "0.705458", "0.70539933", "0.70525384", "0.7050508", "0.7038375", "0.7036591", "0.70247716", "0.7019081", "0.7016436", "0.7012736", "0.70083183", "0.7005324", "0.7004726", "0.70029557", "0.7000187", "0.6999053", "0.6998771", "0.6994375", "0.6992099", "0.6987187", "0.69811255", "0.69806117", "0.6980373", "0.69785726", "0.69630903", "0.695991", "0.69533867", "0.6950875", "0.6950875", "0.6950875", "0.6949696", "0.69489664", "0.6941973", "0.69410276", "0.6939578", "0.69349563", "0.69349563", "0.69286764", "0.6928571", "0.6927038", "0.6922574", "0.6921791", "0.6921669", "0.6918159", "0.69144917", "0.69087", "0.69072056", "0.6901035", "0.6897758", "0.6896444", "0.6895136", "0.689214", "0.68878686", "0.68870056", "0.68859977", "0.6885982", "0.6885241", "0.6885121", "0.6883462", "0.6882846", "0.68823117" ]
0.0
-1
Show empty form for creating
public function create(MailerRepo $mailerService) { $menu_control = view()->shared('menu_control'); $menu_control['page'] = 'emails'; $menu_control['category'] = 'options'; $list = ''; $templates = $mailerService->findTemplates(); $events = $mailerService->findEvents(); return view('mailer::create', compact('menu_control', 'templates','events', 'list')); }
{ "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\t{\n\t\treturn $this->showForm('create');\n\t}", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function createForm()\n {\n }", "public function createForm();", "public function createForm();", "public function create()\n {\n return view ('forms.create');\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function emptyForm() {\n\t\techo '<div class=\"alert fail\"><span class=\"btnclose\">&times;</span><strong>Tous les champs sont obligatoires !</strong></div>';\n\t}", "public function create()\n {\n return view('admin.forms.create');\n }", "public function newAction(): void\n {\n $this->view->form = new AnaForm(null, ['edit' => true]);\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n return $this->form->render('mconsole::personal.form');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function CreateForm();", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n return view('admin.createform');\n }", "abstract public function createForm();", "abstract public function createForm();", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public static function display_create_form(){\n echo \"<form action='../../Controllers/charity_controller.class.php?action=save' method='post'>\";\n echo \"Name: <input type='text' name='name' /><br />\";\n echo \"Description: <textarea name='description'></textarea><br />\";\n echo \"<input type='submit' value='Save' />\";\n echo \"</form>\";\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n //\n return View::make('admin.form_int_mun');\n }", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function addForm() {\n $this->view->displayForm();\n }", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n return view('puesto.create')->with([]);\n }", "public function showUserCreationForm()\n {\n return view('admin.user_create');\n }", "public function create()\n {\n // I skip using this create function because I use a modal form for inserting data using modal in index view via index function.\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n return view('Form');\n }", "public function create()\n {\n \n return view(\n 'components/forms/form-personne',\n [\n 'redirect' => 'ajouterPersonne',\n 'employe' => null\n ]\n );\n }", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public function create()\n {\n return view(\"backend.cms.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 $header = \"Tambah\";\n\t\treturn view('admin.penerbit.form',compact('header'));\n }", "public function create()\n\t{\t\n\t\t\n\t\t// load the create form (app/views/fbf_presenca/create.blade.php)\n\t\t$this->layout->content = View::make('fbf_presenca.create')\n;\n\t}", "public function create()\n {\n return view('Samples.create', [\n 'create' => new FormBuilder(\n [\n 'title'=>'text',\n 'slug'=>'text',\n 'type_id'=>'hidden',\n 'id'=>'hidden' \n ],\n ['samples.store'],\n 'POST',\n 'Create'\n ) \n ]);\n }", "public function create()\n {\n $this->openModal();\n $this->resetInputFields();\n }", "public function create()\n {\n $this->openModal();\n $this->resetInputFields();\n }", "public function create()\n {\n return view('admin.pages.forms.create', $this->data);\n }", "public function create()\n {\n //return view('marca.create');\n return 'Mostrando Formulario para crear Fabricantes';\n }", "public function create()\n {\n return view('forming');\n }", "public function showForm(){\n return view('marketItem.itemCreateForm');\n }", "public function create() {\n\n\t\treturn view('/mailer/createform');\n\n\t}", "public function create()\n {\n return view(\"List.form\");\n }", "public function create()\n {\n return \"Formulário para cadastrar um novo cliente.\";\n }", "public function create()\n {\n return view('client.form');\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function form()\n {\n // 设置隐藏表单,传递用户id\n $check_status = [\n 'no_void' => '正常',\n 'void' => '作废',\n ];\n $this->hidden('id')->value($this->id);\n $this->hidden('status')->value('void');\n\n $this->radio('status', '是否作废')->options($check_status)->default('void');\n $this->textarea('reason', '作废原因');\n }", "public function new_form(){\n $this->vars['page_header'] = __('Create New Service', 'latepoint');\n $this->vars['breadcrumbs'][] = array('label' => __('Create New Service', 'latepoint'), 'link' => false );\n\n $this->vars['category'] = new OsServiceCategoryModel();\n\n if($this->get_return_format() == 'json'){\n $response_html = $this->render($this->views_folder.'new_form', 'none');\n echo wp_send_json(array('status' => 'success', 'message' => $response_html));\n exit();\n }else{\n echo $this->render($this->views_folder . 'new_form', $this->get_layout());\n }\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "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 //\n return view('form1');\n }", "public function create()\n {\n return view('admin.backends.employee.form.create');\n }", "public function create()\n {\n return View::make(Config::get('confide::signup_form'))\n \t\t\t->with('errors', true);\n }", "public function create()\n {\n //\n return $this->render('create');\n\n }", "public function create()\n\t{\n\t\t//\n\t\treturn view('Gallery/Admin/form');\n\t}", "public function create()\n {\n return view('admin.pages.forms.pengirim');\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function createForm()\n {\n if (Auth::guest()) {\n return redirect('/login');\n }\n return view('project.create');\n }", "public function create()\n {\n return view('admin.forms');\n }", "public function create()\n {\n //return view('conditionform.create');\n }", "function create_new() {\n if($this->table_title != '' ) {\n $this->title = 'New ' . $this->table_title .\n $this->makeForm();\n }\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('forms.cps.create');\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $title = 'Khởi tạo chi nhánh';\n\n return view(PAGE_VIEW_FORM, compact('title'));\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 //\n return view('layouts.unit_types.form', ['type' => 'create']);\n }", "public function create()\n {\n //mengarahkan ke form\n return view('pemilik.form');\n }", "public function getCreate()\n\n {\n return view('backend.crud.form' , [\n 'model' => $this->model,\n 'imagePath' => '',\n ]);\n }", "public function create()\n\t{\n\t\treturn view('uoms.create');\n\t}", "public function ShowForm()\n {\n return false;\n }", "public function create()\n\t{\n\t\treturn View::make('usp.koperasi.create')->with('page','Koperasi')\n\t\t->with('modul','Create');\n\t}", "public function create()\n {\n \treturn view('sprzet_jednorazowy.create');\n }", "public function Form()\n {\n include(CONFIG\\PATH\\FORMS . 'Account_Create.php');\n }", "public function create()\n {\n //get view form\n return 'create Method';\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function form()\r\n {\r\n $this->switch('field_select_create', Support::trans('main.select_create'))\r\n ->default(admin_setting('field_select_create'));\r\n }", "public function create()\n {\n $this->generateParams();\n return view('backend.pages.user._form', compact('gender', 'type', 'city'));\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('admin.std.create');\n }" ]
[ "0.73233974", "0.73233974", "0.731111", "0.7294763", "0.7272326", "0.72639996", "0.72378975", "0.72378975", "0.71542114", "0.71015596", "0.7094181", "0.70874786", "0.707055", "0.707055", "0.70632225", "0.7062699", "0.7003931", "0.6997655", "0.69948727", "0.6988913", "0.6983757", "0.6981919", "0.69613594", "0.69486034", "0.6939218", "0.6939218", "0.6931374", "0.69280744", "0.6894466", "0.6881152", "0.6871816", "0.6863774", "0.6845982", "0.6838835", "0.6837245", "0.68352616", "0.68151265", "0.6810447", "0.6801239", "0.6786787", "0.67801774", "0.6778579", "0.67703885", "0.6754995", "0.67518854", "0.67518854", "0.67518854", "0.67518854", "0.6749217", "0.67393726", "0.67393726", "0.67393726", "0.67363393", "0.67343074", "0.6732507", "0.6732165", "0.6732165", "0.6725248", "0.6721805", "0.67191815", "0.6715712", "0.67137384", "0.671301", "0.67017144", "0.6696608", "0.6690955", "0.6679059", "0.6671357", "0.6671303", "0.6667314", "0.6666036", "0.6664127", "0.66625905", "0.66624755", "0.6662404", "0.6650999", "0.66484135", "0.6636721", "0.66342527", "0.6633397", "0.66255885", "0.66212124", "0.6619181", "0.66189176", "0.66166484", "0.6610068", "0.66072553", "0.66049165", "0.66025937", "0.65949714", "0.6589597", "0.6580106", "0.6575564", "0.6567961", "0.6566187", "0.65564543", "0.6555636", "0.65450096", "0.6538865", "0.6536476", "0.6535094" ]
0.0
-1
Saving information in db
public function store(Request $request, MailerRepo $mailerService) { if(!$list = $mailerService->create($request->all())){ return response('При создании страницы возникли ошибки', 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'author_id' => $this->author_id,\n 'clothingname' => $this->clothingname,\n 'clothingtype' => $this->clothingtype,\n 'tempmin' => $this->tempmin,\n 'tempmax' => $this->tempmax\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function saveToDB()\n {\n }", "public function save() {\n $db = Db::instance();\n $db_properties = array(\n 'action' => $this->action,\n 'url_mod' => $this->url_mod,\n 'description' => $this->description,\n 'target_id' => $this->target_id,\n 'target_name' => $this->target_name,\n 'creator_id' => $this->creator_id,\n 'creator_username' => $this->creator_username\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function save() {\n $db = Db::instance();\n // omit id \n $db_properties = array(\n 'firstName' => $this->firstName,\n 'lastName' => $this->lastName,\n 'description' => $this->description,\n 'user' => $this->user,\n 'password' => $this->password,\n 'image' => $this->image,\n 'gender' => $this->gender,\n 'topic_id' => $this->topic_id,\n 'topic_id1' => $this->topic_id1,\n 'role_id' => $this->role_id,\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function save() {}", "public function save() {}", "public function save() {}", "public function save()\n {\n if ($this->id === null) {\n $this->insert();\n } else {\n $this->update();\n }\n }", "public function save()\n {\n\n // generate all column's sql query\n $column_names = '';\n $column_values = '';\n foreach ($this->columns as $field_name => $column_obj)\n {\n if ($column_obj->columnName === null) {\n $column_names .= $field_name.', ';\n } else {\n $column_names .= $column_obj->columnName.', ';\n }\n $column_values .= $column_obj->generateValueForSQL().', ';\n }\n $column_names = substr($column_names, 0, -1);\n $column_values = substr($column_values, 0, -1);\n $this_table_name = $this->table_name;\n $this_id = $this->id;\n\n if ($this->id === 0) {\n // This object is not saved yet.\n $query = 'INSERT INTO $this_table_name ($column_names) VALUES ($column_values);';\n // Execute query\n } else {\n // This object is on the DB.\n $query = 'INSERT INTO $this_table_name ($column_names) VALUES ($column_values) WHERE id=$this_id;';\n // Execute query\n }\n\n mysql_run_query($query);\n\n }", "public function save()\n {\n $this->checkForNecessaryProperties();\n\n $this->update($this->getCurrentId(), $this->data);\n }", "public function save()\n {\n if ($this->id) {\n $this->update();\n } else {\n $this->id = $this->insert();\n }\n }", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'username' => $this->username,\n 'password_hash' => $this->password_hash,\n 'email' => $this->email,\n 'first_name' => $this->first_name,\n 'last_name' => $this->last_name,\n 'user_type' => $this->user_type,\n 'bio' => $this->bio,\n 'creation_date' => $this->creation_date,\n 'gender' => $this->gender,\n 'color' => $this->color\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "public function save() {\n\t\t\t\n\t\t}", "public function save()\r\n {\r\n \r\n }", "public function save(){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Find the columns from the model\n\t\t$columns = static::$columns;\n\n\t\t//because ID is AI we dont want to put a value in it\n\t\tunset($columns[array_search('id', $columns)]);\n\t\t//Same with timestamp\n\t\tunset($columns[array_search('timestamp', $columns)]);\n\n\t\t//Create an insert query which gets linked to the database\n\t\t$query = \"INSERT INTO \" . static::$tableName . \" (\". implode(\",\", $columns) . \") VALUES (\";\n\n\t\t//create a variable called insesrtcols. This is where we put the values\n\t\t$insertcols = [];\n\t\t//For each of the columns in the columns array, add that column into the insert cols array, and seperate it with a :\n\t\tforeach ($columns as $column) {\n\t\t\tarray_push($insertcols, \":\" . $column);\n\t\t}\n\t\t//turn the insertcols array into 1 string and put a , between each entry\n\t\t$query .= implode(\",\", $insertcols);\n\t\t//close the query\n\t\t$query .= \")\";\n\n\t\t//Prepare the query\n\t\t$statement = $db->prepare($query);\n\n\t\t//Foreach of the columns run this function\n\t\tforeach ($columns as $column) {\n\t\t\t//Attach the value to each of the columns\n\t\t\t//Hash the password\n\t\t\tif($column === 'password'){\n\t\t\t\t$this->$column = password_hash($this->$column, PASSWORD_DEFAULT);\n\t\t\t}\n\t\t\t$statement->bindValue(\":\" . $column , $this->$column);\n\t\t}\n\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Get the id of the query which was just added\n\t\t$this->id = $db->lastInsertID();\n\t}", "public abstract function save();", "function save() {\n\n\t\t// calls generic ORM save (insert or update)\n\t\tparent::save();\n\n\t}", "public function saveDetails() \n {\n // Save the author list.\n $this->authorList->setValue('bookId', $this->bookId);\n $this->authorList->save();\n \n // Save the booklanguage list.\n $this->bookLanguageList->setValue('bookId', $this->bookId);\n $this->bookLanguageList->save();\n }", "public function save()\n {\n $db = DatabaseUtil::db_connect($this->database);\n $db->query('update ' . $this->table . 'set ' . $this->column . ' = ' . $this->value . ' where ID=' . $this->ID);\n $db->close();\n }", "public function save(){\r\n $db = new Database();\r\n $sql = \"\";\r\n $stm = null;\r\n if (empty($this->id)){\r\n $sql = \"insert into interests (name) values (:name)\";\r\n $stm = $db->pdo->prepare($sql);\r\n }\r\n else{\r\n $sql = \"update interests set name=:name where id=:id\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':id', $this->id);\r\n }\r\n $stm->bindParam(':name', $this->name);\r\n $stm->execute();\r\n }", "public function save()\n {\n }", "protected function save()\n\t{\n\t\t$this->saveItems();\n\t\t//$this->saveAssignments();\n\t\t//$this->saveRules();\n\t}", "public\tfunction\tsave()\n\t\t{\n\t\t}", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'event_type_id' => $this->event_type_id,\n 'user_1_id' => $this->user_1_id,\n 'user_2_id' => $this->user_2_id,\n 'user_1_name' => $this->user_1_name,\n 'user_2_name' => $this->user_2_name,\n 'product_1_name' => $this->product_1_name,\n 'product_2_name' => $this->product_2_name,\n 'data_1' => $this->data_1,\n 'data_2' => $this->data_2\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function saveToDb()\n\t{\n\t\t$this->addDocument();\n\t\tparent::saveToDb();\n\t}", "public function save()\n {\n $DB = DB::singleton(dsn());\n\n if ( $this->update ) {\n $SQL = SQL::newUpdate('entry');\n foreach ( $this->columns as $column ) {\n $SQL->addUpdate('entry_' . $column, $this->{$column});\n }\n $SQL->addWhereOpr('entry_id', $this->id);\n $SQL->addWhereOpr('entry_blog_id', $this->blog_id);\n $DB->query($SQL->get(dsn()), 'exec');\n } else {\n $SQL = SQL::newInsert('entry');\n foreach ( $this->columns as $column ) {\n $SQL->addInsert('entry_' . $column, $this->{$column});\n }\n $DB->query($SQL->get(dsn()), 'exec');\n }\n\n EntryHelper::saveColumn($this->units, $this->id, $this->blog_id);\n Common::saveField('eid', $this->id, $this->fields);\n Common::saveFulltext('eid', $this->id, Common::loadEntryFulltext($this->id));\n }", "public function save()\n {\n try {\n $name = $this->getName();\n $age = $this->getAge();\n if (!$this->getDriverId()) {\n $this->_pdo->query(\"INSERT INTO driver (name, age) VALUES ('$name', '$age')\");\n } else {\n $this->_pdo->query(\n \"UPDATE drive SET name = '$name', age = '$age'\" .\n \" WHERE driver_id = \" . $this->getDriverId()\n );\n }\n } catch (PDOException $e) {\n echo \"Error: \" . $e;\n }\n }", "public function save()\n\t{\n\t\t$this->copyAttributesToValues() ;\n\t\tif( $this->factory )\n\t\t{\n\t\t\tswitch( $this->todo )\n\t\t\t{\n\t\t\t\tcase 1: // Insert\n\t\t\t\t\tif( $this->factory->insertObjectIntoDB( $this ) ) $this->state = \"inserted\" ;\n\t\t\t\t\telse $this->state = \"dberror\" ;\n\t\t\t\t\tbreak ;\n\t\t\t\tcase 2: // update\n\t\t\t\t\tif( $this->factory->updateObjectIntoDB( $this ) ) $this->state = \"updated\" ;\n\t\t\t\t\telse $this->state = \"dberror\" ;\n\t\t\t\t\tbreak ;\n\t\t\t\tcase 3: // delete\n\t\t\t\t\tif( $this->factory->deleteObjectIntoDB( $this ) ) $this->state = \"deleted\" ;\n\t\t\t\t\telse $this->state = \"dberror\" ;\n\t\t\t\t\tbreak ;\n\t\t\t}\n\t\t}\n\t}", "public function save()\n {\n // If deposit is new, will get assigned database ID.\n $this->dbID = $this->db->saveDeposit($this);\n }", "public function save()\n {\n $ins = $this->valores();\n unset($ins[\"idInscription\"]);\n\n $ins['idUser'] = $this->userO->idUser;\n unset($ins[\"userO\"]);\n\n $ins['idProject'] = $this->project->idProject;\n unset($ins[\"project\"]);\n\n if (empty($this->idInscription)) {\n $this->insert($ins);\n $this->idInscription = self::$conn->lastInsertId();\n } else {\n $this->update($this->idInscription, $ins);\n }\n }", "public function save()\n\t{\n\n\t}", "public function saveData()\r\n {\r\n \r\n }", "function save()\r\n {\r\n $GLOBALS['DB']->exec(\"INSERT INTO inventory_items (name) VALUES ('{$this->getName()}')\");\r\n $this->id = $GLOBALS['DB']->lastInsertId();\r\n }", "public function saveData(): void\n {\n studentLoader::saveStudent(new student($_POST['lastName'], $_POST['firstName'], $_POST['email'], new group($_POST['className']), $_POST['id']), $this->pdo);\n }", "public function saveToDb() {\n parent::saveToDb();\n\n require_once 'models/Location.php';\n Location::saveToDb($this->preferredLocation);\n Location::saveToDb($this->currentLocation);\n\n require_once 'libs/DB.php';\n $conn = DB::connect();\n\n $seekerId = $this->id();\n\n // Update the seeker table\n $conn->exec(\"UPDATE seeker SET experience='$this->experience', pref_location_name='$this->preferredLocation', curr_location_name='$this->currentLocation' WHERE id='$seekerId'\");\n\n require_once 'models/Skill.php';\n foreach($this->skills as $skill) {\n Skill::saveToDb($skill);\n }\n\n // Delete old skills\n $conn->exec(\"DELETE FROM seeker_skill WHERE seeker_id='$seekerId'\");\n\n // Add new skills\n foreach($this->skills as $skill) {\n $conn->exec(\"INSERT INTO seeker_skill(seeker_id, skill_name) VALUES('$seekerId', '$skill')\");\n }\n }", "private function saveDb()\n\t{\n\t\t//format our sql statements w/ the valid fields\n\t\t$fields = array();\n\t\t\n\t\t//loop thru all our dirty fields.\n\t\tforeach ($this->dirtyFields AS $key => $foo)\n\t\t{\n\t\t\t//get our value.\n\t\t\tif (isset($this->data[$key]) && $key != 'id')\n\t\t\t{\n\t\t\t\t$val = $this->data[$key];\n\n\t\t\t\t//slashes replacement..\n\t\t\t\t$val = str_replace(\"\\\\\\\\\", \"\\\\\", $val);\n\t\t\t\t$val = str_replace(\"\\'\", \"'\", $val);\n\t\t\t\t$val = str_replace(\"\\\\\\\"\", \"\\\"\", $val);\n\n\t\t\t\t//add it if we have it...\n\t\t\t\t$fields[] = \"`$key` = '\" . addslashes($val) . \"'\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t//update if we have an id....\n\t\tif (count($fields))\n\t\t{\n\t\t\t//now make our array\n\t\t\t$sqlFields = implode(\",\\n\", $fields) . \"\\n\";\n\t\t\t\n\t\t\t//update it?\n\t\t\tif ($this->id)\n\t\t\t{\n\t\t\t\t$sql = \"UPDATE $this->tableName SET\\n\";\n\t\t\t\t$sql .= $sqlFields;\n\t\t\t\t$sql .= \"WHERE id = '$this->id'\\n\";\n\t\t\t\t$sql .= \"LIMIT 1\";\n\n\t\t\t\tdb()->execute($sql);\n\t\t\t}\n\t\t\t//otherwise insert it...\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sql = \"INSERT INTO $this->tableName SET\\n\";\n\t\t\t\t$sql .= $sqlFields;\n\n\t\t\t\t$this->id = db()->insert($sql);\n\t\t\t}\n\t\t}\n\t}", "public function save()\r\n {\r\n //\r\n }", "public function store()\n {\n if( $this->isPersistent() )\n {\n $this->update();\n }\n else\n {\n $this->insert();\n }\n }", "function saveData() {\n\n\t\t$this->getMapper()->saveData();\t\n\t\t\n\t\t\n\t}", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function persist();", "function save()\n {\n $GLOBALS['DB']->exec(\"INSERT INTO stores (store_name) VALUES (\n '{$this->getStoreName()}'\n );\");\n\n $this->id = $GLOBALS['DB']->lastInsertId();\n }", "public final function save() {\n }", "function save() {\n\t\t// If every question is answered, save to the db. Otherwise, to session.\n\t\tif($this->isComplete()) {\n\t\t\t$this->saveToRecord();\n\t\t} else {\n\t\t\t$this->saveToSession();\n\t\t}\n\t}", "function save() {\n //save the added fields\n }", "public function save(){\n }", "public function save() {\n $db = self::getDbConnection();\n $table = static::getTable();\n $data = get_object_vars($this);\n if ($table == 'posts') {\n $data['name'] = Service::get('session')->userEmail;\n }\n\n if (isset($data['id'])) {\n $query = $db->prepare($this->getUpdateString($data, $table));\n } else {\n $query = $db->prepare($this->getInsertString($data, $table));\n }\n\n if (!$query->execute()) {\n throw new DatabaseException('Cant save object');\n }\n }", "public function save()\n\t{\n\t\tparent::save();\n\t\t\n\t\t$table_prefix = Kohana::config('database.default.table_prefix');\n\t\t\n\t\t$this->db->query('UPDATE `'.$table_prefix.'indicator_lang` SET indicator_title = ?, indicator_description = ? WHERE indicator_id = ? AND locale = ?',\n\t\t\t$this->indicator_title, $this->indicator_description, $this->id, $this->locale\n\t\t);\n\t}", "function saveInfo(){\n // Save resolution information\n mysql_query(\"UPDATE resolution_list SET committeeId='$this->committeeId' WHERE id='$this->resolutionId'\") or die(mysql_error());\n mysql_query(\"UPDATE resolution_list SET topicId='$this->topicId' WHERE id='$this->resolutionId'\") or die(mysql_error());\n mysql_query(\"UPDATE resolution_list SET resolutionNum='$this->resolutionNum' WHERE id='$this->resolutionId'\") or die(mysql_error());\n mysql_query(\"UPDATE resolution_list SET sponsors='$this->sponsors' WHERE id='$this->resolutionId'\") or die(mysql_error());\n mysql_query(\"UPDATE resolution_list SET signatories='$this->signatories' WHERE id='$this->resolutionId'\") or die(mysql_error());\n // Save clause information\n $preambulatoryId = 0;\n foreach($this->preambulatory as $clause){\n if($preambulatoryId==0) $preambulatoryId = $clause->clauseId;\n $clause->saveInfo();\n }\n mysql_query(\"UPDATE resolution_list SET preambulatoryId='$preambulatoryId' WHERE id='$this->resolutionId'\") or die(mysql_error());\n \n $operativeId = 0;\n foreach($this->operative as $clause){\n if($operativeId==0) $operativeId = $clause->clauseId;\n $clause->saveInfo();\n }\n mysql_query(\"UPDATE resolution_list SET operativeId='$operativeId' WHERE id='$this->resolutionId'\") or die(mysql_error());\n\n\tmysql_query(\"UPDATE resolution_list SET date='$this->date' WHERE id='$this->resolutionId'\") or die(mysql_error()); \n }", "public final function save()\n {\n }", "public function Save(){\r\n\t\t$this->db->save();\r\n\t}", "function saveInfo(){\n mysql_query(\"UPDATE school_payments SET schoolId='$this->schoolId' WHERE id='$this->paymentId'\") or die(mysql_error());\n mysql_query(\"UPDATE school_payments SET amount='$this->amount' WHERE id='$this->paymentId'\") or die(mysql_error());\n mysql_query(\"UPDATE school_payments SET started='$this->started' WHERE id='$this->paymentId'\") or die(mysql_error());\n mysql_query(\"UPDATE school_payments SET completed='$this->completed' WHERE id='$this->paymentId'\") or die(mysql_error());\n mysql_query(\"UPDATE school_payments SET finaid='$this->finaid' WHERE id='$this->paymentId'\") or die(mysql_error());\n }", "function save(){\n\t\tif (isset($this->id) && !$this->_new) {\n\t\t\t$sql = \"UPDATE `tours` set \";\n\t\t\t$i = 0;\n\t\t\tforeach($this->UPDATE as $u){\n\t\t\t\tif ($i>0) $sql = $sql.\" , \";\n\t\t\t\t$sql = $sql.$u;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$sql = $sql.\" WHERE `id`='\".addslashes($this->id).\"'\";\n\t\t}else{\n\t\t\t$sql = \"INSERT into `tours` values('\".addslashes($this->id).\"' , '\".addslashes($this->name).\"' , '\".addslashes($this->duration).\"' , '\".addslashes($this->description).\"' , '\".addslashes($this->tcid).\"')\";\n\t\t}\n\t\t$this->connection->send_query($sql);\n\t}", "public function save($data);", "public function save($data);", "public function save($data);", "public function save()\n \t{\n \t $this->getMapper()->save($this);\n \t}", "public function save(){\n $tableName = $this->tableName();\n $attributes = $this->attributes();\n $params = array_map(fn($attr) => \":$attr\", $attributes);\n $statement = self::prepare(\"INSERT INTO $tableName (\".implode(',', $attributes).\") \n VALUES (\".implode(',', $params).\")\");\n \n foreach($attributes as $attribute){\n $statement->bindValue(\":$attribute\", $this->{$attribute});\n }\n \n $statement->execute();\n return true;\n }", "function save();", "function save();", "public function save() {\n\n $data = array(\n 'name' => $this->getName(),\n 'description' => $this->getDescription(),\n 'metatitle' => $this->getMetatitle(),\n 'metakeywords' => $this->getMetakeywords(),\n 'metadescription' => $this->getMetadescription()\n );\n $data['parent_id'] = 0; // by default it is 0, becouse right now there is no use of parent id in this application\n if (null === ($id = $this->getId())) {\n unset($data['id']);\n $data['status'] = 1;\n return $this->getMapper()->getDbTable()->insert($data);\n } else {\n $data['status'] = $this->getStatus();\n return $this->getMapper()->getDbTable()->update($data, array('id = ?' => $id));\n }\n\n }", "public function save() {\n }", "public function save() {\n }", "function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }", "public function save(){\r\n\t\tif ($this->new){\r\n\t\t\treturn $this->insert();\r\n\t\t} else {\r\n\t\t\treturn $this->update();\r\n\t\t}\r\n\t}", "public function save()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n if ($entity->getMarkedAsDeleted())\n {\n $entity->delete();\n } \n else if ($entity->getMarkedAsUpdated())\n {\n $entity->saveWithDetails();\n }\n }\n }\n );\n }", "public function save() {\n }", "public function save()\n {\n $pdo = $this->getDbConnection();\n $valuesRow = $this->prepareValuesRow();\n\n $pdo->exec(\"REPLACE INTO {$this->dbTable} (`key`, `value`) VALUES {$valuesRow}\");\n }", "public function save() {\r\n /** probably we should add a timestamp, Item ID and stuff */\r\n $stored_data = json_encode(array($this->name, $this->status), JSON_UNESCAPED_UNICODE);\r\n $this->db_write(\"objects\", \"Item_s11n\", $stored_data);\r\n print ($stored_data);\r\n }", "public function save() {\r\n $conn = GFSalsaConnector::instance();\r\n if ($conn) {\r\n $conn->saveObject($this->object, $this);\r\n }\r\n }", "public function save()\n {\n return Query::update('officers', \"`ID`=\".$this->id, $this->initialVars, $this->getDBArray());\n }", "protected function saveUpdate()\n {\n }", "public function save(){\n $tableName = $this->tableName();\n $attributes = $this->attributes();\n $params = array_map(fn($attr)=> \":$attr\", $attributes);\n\n $st = self::prepare(\n \"INSERT INTO $tableName (\".implode(',', $attributes).\")\n VALUES(\".implode(',', $params).\")\"\n );\n\n foreach($attributes as $attribute){\n $st->bindValue(\":$attribute\", $this->{$attribute});\n }\n\n $st->execute();\n return true;\n }", "public function save()\n {\n if($this->id != -1)\n {\n $this->update_subject();\n }\n else\n {\n $this->insert_subject();\n }\n }", "public function saveToDb()\n\t{\n\t\tparent::saveToDb();\n\t\t$this->insertAttachment();\n\t}", "public function save()\n {\n $this->persist($this->state);\n }", "function save() {\n $conn = \\DB\\getConnection();\n\n $query = sprintf(\"INSERT INTO Payments (uid, typeid, token, amount)\n VALUES (%u, %u, '%s', %f)\",\n $this->uid, $this->typeid, $conn->escape_string($this->token), $this->amount);\n\n \n\n $result = $conn->query($query);\n\n // If this is a newly created user, then update the id with the\n // newly created one\n if (!isset($this->id)) {\n $this->id = $result->insert_id;\n }\n }", "public function saveToDatabase($data)\n {\n }" ]
[ "0.79930234", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7805213", "0.77904713", "0.7776194", "0.76972246", "0.76972246", "0.76941895", "0.7683099", "0.7681291", "0.7652813", "0.7632449", "0.7608612", "0.7605617", "0.7605617", "0.7605617", "0.7605617", "0.7605617", "0.7552378", "0.74899805", "0.7484455", "0.7471424", "0.746952", "0.7452175", "0.7437428", "0.7434268", "0.74168795", "0.7407753", "0.74074894", "0.7388559", "0.73570627", "0.73438853", "0.7319661", "0.73072046", "0.72909355", "0.72748667", "0.7248067", "0.724459", "0.72292715", "0.72283626", "0.72253114", "0.7194802", "0.7182812", "0.7175048", "0.7174603", "0.7170669", "0.71664554", "0.71559656", "0.7129511", "0.7105604", "0.70909566", "0.7072911", "0.70696884", "0.70672435", "0.70544523", "0.70535463", "0.70493907", "0.70481205", "0.70367014", "0.7025243", "0.7025243", "0.7025243", "0.7025126", "0.7018323", "0.7015621", "0.7015621", "0.70142496", "0.700352", "0.700352", "0.6992513", "0.6992119", "0.6980909", "0.6978445", "0.696976", "0.696338", "0.6962009", "0.6949685", "0.69488186", "0.69350994", "0.6932799", "0.6912567", "0.68992597", "0.6898121", "0.6894715" ]
0.0
-1
Delete information by id
public function destroy($id, MailerRepo $mailerService) { if(!($list = $mailerService->destroy($id))){ return response('Список не найден', 404); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete( $id );", "public function deleteById($id);", "public function deleteById($id);", "public function deleteById($id);", "public function deleteById($id);", "public function deleteById($id);", "public function deleteById($id);", "function delete($id);", "public function delete($id)\n\t {\n\t //\n\t }", "abstract public function delete($id);", "abstract public function delete($id);", "abstract public function delete($id);", "abstract public function deleteById($id);", "public function delete($id)\n {\n }", "public function delete($id) {\r\n\r\n }", "function delete($id) {\n\t\t$this->db->where('information_id', $id);\n\t\t$this->db->delete('information');\n\t}", "public function del($id)\n {\n }", "public function delete(int $id);", "public function delete($id)\n\t{\n\t}", "public function delete($id)\n\t{\n\t}", "public function delete($id){\r\n }", "public function delete($id)\n {\n //\n }", "public function delete($id)\n {\n //\n }", "public function delete($id)\r\n {\r\n }", "public function delete($id) \r\n {\r\n $this->load(array('id=?',$id));\r\n $this->erase();\r\n }", "public abstract function delete($id);", "public function delete($id = null){\n\t\t\n\t}", "public function delete($id)\n {\n // ..\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete(int $id)\n {\n //\n }", "public function delete(int $id)\r\n {\r\n }", "public function delete($id = null)\n\t{\n\t\t//\n\t}", "public function delete($id = null)\n\t{\n\t\t//\n\t}", "public function delete(int $id)\n {\n }", "public function delete(int $id)\n {\n }", "public function delete(int $id)\n {\n }", "public function delete($id) {\r\n \r\n }", "public function delete($id)\n {\n\n }", "public function delete( $id ){\n \n\n }", "public function delete_info($i_id) {\n \n }", "public function delete($id = null)\n {\n //\n }", "public function delete($id = null)\n {\n //\n }", "public function delete(int $id): void;", "public function delete(int $id): void;", "public function delete(int $id): void;", "public function delete($id)\n { \n $this->action('delete', array('id' => $id));\n }", "public function delete( $id ){\n\n }", "public function eliminar($id)\n {\n //\n }", "public function eliminar($id)\n {\n //\n }" ]
[ "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.85027283", "0.84296477", "0.84296477", "0.84296477", "0.84296477", "0.84296477", "0.84296477", "0.8427106", "0.8372446", "0.83214504", "0.83214504", "0.83214504", "0.8311071", "0.8282538", "0.8280586", "0.82769984", "0.82532", "0.82388604", "0.8232868", "0.8232868", "0.8223763", "0.82001567", "0.82001567", "0.8175078", "0.81749094", "0.81644523", "0.8130776", "0.8111112", "0.80999696", "0.80999696", "0.80999696", "0.80999696", "0.80999696", "0.80999696", "0.80999696", "0.80999696", "0.80999696", "0.80999696", "0.80999696", "0.80999696", "0.80999696", "0.80999696", "0.80999696", "0.80999696", "0.80999696", "0.80999696", "0.80999696", "0.80999696", "0.80999696", "0.8060479", "0.802916", "0.79594195", "0.79594195", "0.7957589", "0.7957589", "0.7957589", "0.7938858", "0.79364717", "0.79235655", "0.7904121", "0.7895545", "0.7895545", "0.7884734", "0.7884734", "0.7884734", "0.78778976", "0.78600496", "0.7846789", "0.7846789" ]
0.0
-1
Execute the console command.
public function fire() { $action = $this->argument('action'); $key = $this->argument('key'); $index = $this->option('index'); $start = $this->option('start'); $end = $this->option('end'); $value = $this->option('value'); $increment = $this->option('increment'); $serialize = $this->option('serialize') ?: false; $unserialize = $this->option('unserialize') ?: false; $isAction = function ($actions) use ($action) { $actions = func_get_args(); return (in_array($action, $actions)); }; $results = null; if ($isAction('get', 'pluck', 'exists')) { $results = $this->keystone->$action($key, $index); } if ($isAction('type', 'first', 'last', 'shift', 'pop')) { $results = $this->keystone->$action($key); } if ($isAction('range')) { $results = $this->keystone->$action($key, $start, $end); } if ($isAction('put', 'add')) { if (isset($index)) { // Trying to put only a hash key, same as push $this->keystone->push($key, [$index => $value]); } else { // Pushing an entire value if (substr($value, 0, 2) == "<?") { $value = substr($value, 2); $value = eval("return $value;"); } $this->keystone->$action($key, $value, $serialize); } $results = $this->keystone->get($key); } if ($isAction('push')) { if (isset($index)) { // Pushing an new key/value into a hash $this->keystone->$action($key, [$index => $value]); $results = $this->keystone->get($key); } else { // Pushing a value onto a list (this won't append to strings) $this->keystone->$action($key, [$value]); $this->info("Pushed $value to $key"); } } if ($isAction('increment')) { $this->keystone->$action($key, $increment); $results = $this->keystone->get($key); } if ($isAction('forget')) { if (isset($key)) { if ($this->keystone->exists($key)) { $this->keystone->forget($key, $index); if (isset($index)) { $results = $this->keystone->get($key); $this->info("Removed $index from $key"); } else { $this->info("Deleted $key"); } } else { $this->info("Key Not Found $key"); } } else { // Delete from stdin, for piping // ex: keystone keys dynatron/metric::* | keystone forget while ($key = trim(fgets(STDIN))) { if ($this->keystone->exists($key)) { $this->keystone->forget($key); $this->info("Deleted $key"); } else { $this->info("Key Not Found $key"); } } } } if ($isAction('keys')) { $results = $this->keystone->$action($key); foreach ($results as $result) { // Plain text echo, no colors for piping echo $result."\n"; } $results = null; } if ($isAction('values', 'where')) { $results = $this->keystone->$action($key, $index, $value); } if ($isAction('namespaces')) { $results = $this->keystone->namespaces(); } // Output results if (isset($results)) { if ($this->isSerialized($results) && $unserialize) { // Data is serialized and we requested to unserialize dump($this->unserialize($results)); } elseif ($unserialize) { // Data was not serialized, but unserialize was requested. // If data is array, loop array and attemp to unserialize each key if (is_array($results)) { $newResults = []; foreach ($results as $key => $value) { $newResults[$key] = $this->unserialize($value); } dump($newResults); } else { // Was not an array, can't unserialize, just print $this->info($results); } } else { // Not serialized, and not requested to unserialize if (is_string($results)) { $this->info($results); } else { dump($results); } } } }
{ "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
Unserialize data only if serialized
private function unserialize($value) { $data = @unserialize($value); if ($value === 'b:0;' || $data !== false) { // Unserialization passed, return unserialized data return $data; } else { // Data was not serialized, return raw data return $value; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function unSerializeData();", "#[\\ReturnTypeWillChange]\n public function __unserialize($data)\n {\n }", "function maybe_unserialize($data)\n {\n }", "public function unserialize($data) {}", "#[\\ReturnTypeWillChange]\n public function unserialize($data)\n {\n }", "abstract protected function serializeData($unSerializedData);", "function unserialize ( $data ) {\n return unserialize( $data );\n }", "public static function safeUnserialize($serialized)\n\t{\n\t\tif (PHP_VERSION_ID >= 70000)\n\t\t{\n\t\t\t// PHP 7 has an option to disable unserializing objects, so use that if available\n\t\t\treturn @unserialize($serialized, array('allowed_classes' => false));\n\t\t}\n\n\t\tif (self::serializedContainsObject($serialized))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn @unserialize($serialized);\n\t}", "public function _unserialize($data)\n\t{\n\t\treturn json_decode($data, TRUE);\n\t}", "function deserialise(string $data): void;", "public function deserialize($data);", "public function __unserialize(array $data): void\n {\n $this->createFromArray($data);\n }", "public static function isSerialized($data) {\n return (@unserialize($data) !== false);\n }", "abstract public function unserialize($serialized);", "abstract protected function unserializeData(array $data);", "public function unserialize($serialized=null){ }", "protected function prep_data_after_read($data) {\n $result = @unserialize($data);\n if ($result === false) {\n throw new coding_exception('Failed to unserialise data from file. Either failed to read, or failed to write.');\n }\n return $result;\n }", "public function deserialize($data)\n {\n }", "public function __unserialize(array $data): void\n {\n $this->__construct($data);\n }", "public function unserialize($serialized);", "public function unserialize($serialized);", "function _unserialize( $serial ) {\n\t\tif( function_exists( 'gzinflate' ) ) {\n\t\t\t$decomp = @gzinflate( $serial );\n\t\t\tif( false !== $decomp ) {\n\t\t\t\t$serial = $decomp;\n\t\t\t}\n\t\t}\n\t\treturn unserialize( $serial );\n\t}", "public function unserialize($data)\n {\n list($this->facebookId, $parentData) = unserialize($data);\n parent::unserialize($parentData);\n }", "#[ReturnTypeWillChange]\n public function __unserialize($data)\n {\n foreach ($data as $item) {\n $this->unshift($item);\n }\n }", "public function unserialize($data)\n {\n // Interface for convenience.\n $this->__unserialize(unserialize($data));\n }", "protected function unserialize($data)\n {\n return unserialize($data);\n }", "function unserialize_safe($serialized) {\r\r\n // as well as if there is any ws between O and :\r\r\n if (is_string($serialized) && strpos($serialized, \"\\0\") === false) {\r\r\n if (strpos($serialized, 'O:') === false) {\r\r\n // the easy case, nothing to worry about\r\r\n // let unserialize do the job\r\r\n return @unserialize($serialized);\r\r\n } else if (!preg_match('/(^|;|{|})O:[0-9]+:\"/', $serialized)) {\r\r\n // in case we did have a string with O: in it,\r\r\n // but it was not a true serialized object\r\r\n return @unserialize($serialized);\r\r\n }\r\r\n }\r\r\n return false;\r\r\n}", "public function unserialize($serialized)\n {\n }", "function maybe_unserialize( $item ){\n if( is_serialized( $item ) ){\n \n try{\n \n // Try unzerialising\n $output = unserialize( $item );\n \n } catch( Exception $e ){\n \n // If there's an error it might be corrupted, so try uncorrupting then unserializing\n $output = unserialize( serialize_fix( $item ) );\n \n }\n \n return $output;\n \n } else {\n return $item;\n }\n}", "public function unserialize($data)\n {\n $data = @base64_decode($data);\n if ($data === false) {\n trigger_error('Failed to decode serialized data', E_USER_ERROR);\n return;\n }\n $crypt = $this->getCrypt();\n $data = $crypt->decrypt($data);\n $data = @unserialize($data);\n if (!is_array($data)) {\n trigger_error('Failed to decode serialized data', E_USER_ERROR);\n return;\n }\n parent::unserialize($data);\n }", "public function unserialize($serialized)\n {\n $this->data = unserialize($serialized);\n }", "public function afterSerialize($serializedData, $unserializedData) {\n\t\treturn $serializedData;\n\t}", "public function testInvalidSerializedData()\n {\n $someData = 12;\n\n $serializer = ArrayObject::DEFAULT_SERIALIZER;\n $serializer = new $serializer;\n\n $data = new ArrayObject;\n $data->unserialize($serializer->serialize($someData));\n }", "public function maybe_unserialize($original)\n {\n if (is_serialized($original)) { // don't attempt to unserialize data that wasn't serialized going in\n return @unserialize($original);\n }\n return $original;\n }", "public function __unserialize(array $data): void\n {\n $this->name = $data['name'];\n }", "public function unserialize($serialized)\n {\n $data = unserialize($serialized);\n\n //TODO load references with id ?\n }", "abstract protected function serializeData();", "function maybe_serialize($data)\n {\n }", "public function afterDeserialize($deserializedData, $serializedData) {\n\t\treturn $deserializedData;\n\t}", "public function unserialize($serialized)\n {\n // older data which does not include all properties.\n $data = array_merge(unserialize($serialized), array_fill(0, 2, null));\n\n list($this->email, $this->id) = $data;\n }", "function is_serialized($data, $strict = \\true)\n {\n }", "function is_serialized_string($data)\n {\n }", "public function unserialize($serialized)\n {\n list (\n $this->id,\n $this->usuario,\n $this->clave,\n ) = unserialize($serialized);\n }", "public function deserializeAll(string $data);", "function object_unserialize_vars(&$object = null, $data = null) {\n\tif($object == null || is_object($object) == false || $data == null) {\n\t\treturn false;\n\t}\n\t\n\t$data = unserialize($data);\n\t\n\tforeach($data as $key => $val) {\n\t\tif(property_exists($object, $key) == true) {\n\t\t\t$object->$key = $val;\n\t\t}\n\t}\n\t\n\treturn true;\n}", "protected function maybe_unserialize($original)\n {\n if (defined('WP_REDIS_SERIALIZER') && ! empty(WP_REDIS_SERIALIZER)) {\n return $original;\n }\n\n if (defined('WP_REDIS_IGBINARY') && WP_REDIS_IGBINARY && function_exists('igbinary_unserialize')) {\n return igbinary_unserialize($original);\n }\n\n // don't attempt to unserialize data that wasn't serialized going in\n if ($this->is_serialized($original)) {\n return @unserialize($original);\n }\n\n return $original;\n }", "abstract public function serialize($data);", "public function unserialize($serialized)\n {\n $data=unserialize($serialized);\n $this->id=$data['id'];\n\n }", "private function convertSerializedData()\n {\n $layoutUpdateQueryModifier = $this->queryModifierFactory->create(\n 'like',\n [\n 'values' => [\n 'xml' => '%conditions_encoded%'\n ]\n ]\n );\n $this->aggregatedFieldDataConverter->convert(\n [\n new FieldToConvert(\n SerializedToJson::class,\n $this->moduleDataSetup->getTable('widget_instance'),\n 'instance_id',\n 'widget_parameters'\n ),\n new FieldToConvert(\n LayoutUpdateConverter::class,\n $this->moduleDataSetup->getTable('layout_update'),\n 'layout_update_id',\n 'xml',\n $layoutUpdateQueryModifier\n ),\n ],\n $this->moduleDataSetup->getConnection()\n );\n }", "public function deserialize($serializedData = array()) {\n\t\tif (empty($serializedData)) {\n\t\t\treturn $serializedData;\n\t\t}\n\t\t$deserializedData = array();\n\n\t\t$deserializedData = $this->deserializeData($serializedData);\n\t\treturn $this->afterDeserialize($deserializedData, $serializedData);\n\t}", "private function unpackData()\n {\n return json_decode($this->packedData, true);\n }", "protected function unserializeResponse($data) {\n return unserialize($data);\n }", "public function deserialize(array $data): void\n {\n $this->id = $data['id'];\n $this->backendId = $data['backendId'];\n $this->queue = $data['queue'];\n $this->arguments = (array) unserialize($data['arguments']); # unserialize object and convert to []\n $this->attempts = $data['attempts'];\n $this->enqueued = $data['enqueued'];\n $this->serialized = $data['serialized'];\n }", "function unserialize($data){\r\n\t\t$data = unserialize($data);\r\n\t\t$this -> firstName = $data['first'];\r\n\t\t$this -> lastName = $data['last'];\r\n\t}", "public function __wakeup() {\n\t\t\t_doing_it_wrong( __FUNCTION__, __( 'Unserializing is forbidden!', 'be-table-ship' ), '4.0' );\n\t\t}", "public function unserialize($serialized)\n{\n list($this->username, $this->password, $this->salt,\n $this->user_roles, $this->id) = \\json_decode(\n $serialized);\n}", "protected function serializeData($data) {\n return $data;\n }", "final public function __invoke($data) {\n return $this->serialize($data);\n }", "public function unserialize($serialized)\n {\n list(\n $this->id,\n $this->active,\n $this->username,\n $this->password,\n $this->places,\n $this->roles,\n $this->sharedPlaces\n ) = \\json_decode($serialized);\n }", "function unserialize($value)\n {\n return C_NextGen_Serializable::unserialize($value);\n }", "function getSerializedData()\n {\n if ($this->_serializedData == null) {\n return $this->raiseError('No serialized data available. '\n . 'Use XML_Serializer::serialize() first.',\n XML_SERIALIZER_ERROR_NO_SERIALIZATION);\n }\n return $this->_serializedData;\n }", "public function unserialize($serialized)\n{\n list($this->username, $this->password,\n $this->id) = json_decode(\n $serialized);\n}", "private function resetSerializationConditions(): void\n {\n $this->isPartial = false;\n }", "function _serialize( &$data ) {\n\t\t$serial = serialize( $data );\n\t\tif( function_exists( 'gzdeflate' ) ) {\n\t\t\treturn gzdeflate( $serial );\n\t\t} else {\n\t\t\treturn $serial;\n\t\t}\n\t}", "protected function maybe_serialize($data)\n {\n if (defined('WP_REDIS_SERIALIZER') && ! empty(WP_REDIS_SERIALIZER)) {\n return $data;\n }\n\n if (defined('WP_REDIS_IGBINARY') && WP_REDIS_IGBINARY && function_exists('igbinary_serialize')) {\n return igbinary_serialize($data);\n }\n\n if (is_array($data) || is_object($data)) {\n return serialize($data);\n }\n\n if ($this->is_serialized($data, false)) {\n return serialize($data);\n }\n\n return $data;\n }", "public function isSerialized()\n {\n if (!isset($this->str[0])) {\n return false;\n }\n\n /** @noinspection PhpUsageOfSilenceOperatorInspection */\n if (\n $this->str === 'b:0;'\n ||\n @unserialize($this->str) !== false\n ) {\n return true;\n } else {\n return false;\n }\n }", "public function unFilterData($type, $data, $key = null)\n {\n $tmp = unserialize($data, ['allowed_classes' => false]);\n if ($tmp === false) {\n $tmp = unserialize(utf8_decode($data), ['allowed_classes' => false]);\n }\n if ($tmp === false) {\n return [];\n }\n if ($key !== null) {\n $tmp = $tmp[$key];\n }\n $map = $this->getMapping($type);\n if ($map === false) {\n return $tmp;\n }\n foreach ($map as $from => $to) {\n if (isset($tmp[$from])) {\n $tmp[$to] = $tmp[$from];\n unset($tmp[$from]);\n }\n }\n\n return $tmp;\n }", "public function unserialize($serialized)\n {\n list (\n $this->id,\n $this->email,\n $this->name,\n $this->password,\n // see section on salt below\n // $this->salt\n ) = unserialize($serialized);\n }", "public function serialize($data);", "public function uncompress() {}", "public function uncompress() {}", "public function bsonUnserialize( array $data ): void {\n\t\t//get the called class name\n\t\t$calledClassFqn = typeHelpers::classNameToFqn( get_called_class() );\n\n\t\ttry {\n\t\t\t$rClass = new \\ReflectionClass( $calledClassFqn );\n\t\t}\n\t\tcatch( \\ReflectionException $e ) {\n\t\t\tthrow new databaseException( 'Failed to unserialize bson data for ' . $calledClassFqn, 500, $e );\n\t\t}\n\n\t\t$this->_meta = new _meta( $calledClassFqn );\n\n\t\t//get properties of the class and set their values to the data provided from the database\n\t\t$rProperties = $rClass->getProperties();\n\t\tforeach( $rProperties as $rProperty ) {\n\t\t\t$propertyName = $rProperty->getName();\n\n\t\t\t//if property is not meant to be unserialized, exclude it\n\t\t\t$attributes = $rProperty->getAttributes( excludeBsonUnserialize::class );\n\t\t\tif( count( $attributes )>0 ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$propertyType = null;\n\t\t\t$propertyTypeName = '';\n\n\t\t\tif( $rProperty->hasType() ) {\n\t\t\t\t$propertyType = $rProperty->getType();\n\n\t\t\t\tif( !( $propertyType instanceof \\ReflectionUnionType ) ) {\n\t\t\t\t\t$propertyTypeName = $propertyType->getName();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//if the property is an array, check if the doc comment defines the type\n\t\t\t$propertyIsTypedArray = false;\n\t\t\tif( $propertyTypeName=='array' ) {\n\t\t\t\t$arrayType = typeHelpers::getVarTypeFromDocComment( $rProperty->getDocComment() );\n\t\t\t\tif( $arrayType!='array' && $arrayType!='string' && $arrayType!='float' && $arrayType!='int' ) {\n\t\t\t\t\t$propertyIsTypedArray = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif( $propertyIsTypedArray ) {\n\t\t\t\tif( !isset( $data[ $propertyName ] ) ) {\n\t\t\t\t\tlog::info( 'MongoUnserialize', $calledClassFqn.'.'.$propertyName.' of type '.$propertyType.' set to default value' );\n\t\t\t\t\t$data[ $propertyName ] = $rProperty->getDefaultValue();\n\t\t\t\t}\n\t\t\t\tforeach( $data[ $propertyName ] as $key => $value ) {\n\t\t\t\t\tlog::info( 'MongoUnserialize', $calledClassFqn.'.'.$propertyName.' key '.$key.' of type '.$propertyType.' set' );\n\t\t\t\t\t$this->$propertyName[ $key ] = $this->bsonUnserializeDataItem( $rProperty, $propertyType, $arrayType, $value );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif( !array_key_exists( $propertyName, $data ) ) {\n\t\t\t\t\tlog::info( 'MongoUnserialize', $calledClassFqn.'.'.$propertyName.' value not in provided data' );\n\t\t\t\t\t$value = null;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$value = $data[ $propertyName ];\n\t\t\t\t}\n\n\t\t\t\t//set the class property = the parsed value from the database\n\t\t\t\ttry {\n\t\t\t\t\tlog::info( 'MongoUnserialize', $calledClassFqn.'.'.$propertyName.' of type '.$propertyType.' set' );\n\t\t\t\t\t$this->$propertyName = $this->bsonUnserializeDataItem( $rProperty, $propertyType, $propertyTypeName, $value );\n\t\t\t\t}\n\t\t\t\tcatch( \\Exception|\\TypeError $e ) {\n\t\t\t\t\terror_log( $e );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//if this is a text search that has provided the score of the result via the _score field\n\t\tif( isset( $data[ '_score' ] ) ) {\n\t\t\t$this->_meta->score = round( $data[ '_score' ], 2 );\n\t\t}\n\n\t\tif( method_exists( $this, '_afterBsonUnserialize' ) ) {\n\t\t\t$this->_afterBsonUnserialize( $data );\n\t\t}\n\t}", "public function unserialize($serialized)\n {\n $data = unserialize($serialized);\n // add a few extra elements in the array to ensure that we have enough keys when unserializing\n // older data which does not include all properties.\n $data = array_merge($data, array_fill(0, 2, null));\n \n list ($this->password, $this->salt, $this->usernameCanonical, $this->username, $this->expired, $this->locked, $this->credentialsExpired, $this->enabled, $this->id) = $data;\n }", "public function revert(string $serializedData)\n {\n return json_decode($serializedData, true);\n }", "public function __wakeup() {\r\n\t\t_doing_it_wrong( __FUNCTION__, esc_html__( 'Unserializing instances of this class is forbidden.', 'wc_name_your_price' ), '3.0.0' );\r\n\t}", "protected function _afterLoad()\n {\n foreach ($this->_items as $item) {\n $this->getResource()->unserializeFields($item);\n }\n return parent::_afterLoad();\n }", "public function scrub($data);", "public function unserialize($serialized){\n\t\tthrow new Exception(\"Method \".__CLASS__.\"::\".__METHOD__.\" not implemented yet!\");\n\t}", "public function serialize($data)\n {\n }", "public static function Unserialize($SerializedString) {\n\t\t$Result = $SerializedString;\n\n if(is_string($SerializedString)) {\n\t\t\tif(substr_compare('a:', $SerializedString, 0, 2) === 0 || substr_compare('O:', $SerializedString, 0, 2) === 0)\n\t\t\t\t$Result = unserialize($SerializedString);\n\t\t\telseif(substr_compare('obj:', $SerializedString, 0, 4) === 0)\n $Result = json_decode(substr($SerializedString, 4), FALSE);\n elseif(substr_compare('arr:', $SerializedString, 0, 4) === 0)\n $Result = json_decode(substr($SerializedString, 4), TRUE);\n }\n return $Result;\n }", "public function unserialize($serialized)\n {\n list($this->id, $this->username, $this->password,) = unserialize($serialized);\n }", "function is_serialized( $data ) {\n if ( !is_string( $data ) )\n return false;\n $data = trim( $data );\n if ( 'N;' == $data )\n return true;\n if ( !preg_match( '/^([adObis]):/', $data, $badions ) )\n return false;\n switch ( $badions[1] ) {\n case 'a' :\n case 'O' :\n case 's' :\n if ( preg_match( \"/^{$badions[1]}:[0-9]+:.*[;}]\\$/s\", $data ) )\n return true;\n break;\n case 'b' :\n case 'i' :\n case 'd' :\n if ( preg_match( \"/^{$badions[1]}:[0-9.E-]+;\\$/\", $data ) )\n return true;\n break;\n }\n return false;\n }", "public function decompress($data) {\n\t\tif($this->compression_enabled) {\n\t\t\tswitch($this->compression_method) {\n\t\t\t\tcase self::METHOD_GZIP:\n\t\t\t\t\t$data = gzuncompress($data);\n\t\t\t\t\tbreak;\n\t\t\t\tcase self::METHOD_DEFLATE:\n\t\t\t\tdefault:\n\t\t\t\t\t$data = gzinflate($data);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$data = unserialize($data);\n\t\treturn $data;\n\t}", "function is_serialized($data) {\n if (!is_string($data))\n return false;\n $data = trim($data);\n if ('N;' == $data)\n return true;\n if (!preg_match('/^([adObis]):/', $data, $badions))\n return false;\n switch ($badions[1]) {\n case 'a' :\n case 'O' :\n case 's' :\n if (preg_match(\"/^{$badions[1]}:[0-9]+:.*[;}]\\$/s\", $data))\n return true;\n break;\n case 'b' :\n case 'i' :\n case 'd' :\n if (preg_match(\"/^{$badions[1]}:[0-9.E-]+;\\$/\", $data))\n return true;\n break;\n }\n return false;\n }", "public function unserialize($input)\n\t{\n\t\t// Unserialize the executable, args, options, data, and inputs.\n\t\tlist($this->calledScript, $this->args, $this->filter, $this->data, $this->inputs) = unserialize($input);\n\n\t\t$this->filter = $this->filter ? : new NullFilter;\n\t}", "abstract public function getIsSerializedAttribute() : bool;", "public function decode(ISerializable $Object, $Data, $flags = ISerializer::SERIALIZER_FLAGS)\n {\n\n // Unserizlize properties\n $Properties = unserialize($Data);\n\n // Check results\n if (is_array($Properties)) {\n\n // Restore properties\n $this->import($Object, $Properties);\n\n // Return true\n return true;\n }\n\n // No properties, return false\n return false;\n }", "public function deserialize(string $data)\n {\n switch ($this->method) {\n case self::METHOD_IGBINARY:\n $data = @igbinary_unserialize($data);\n\n if ($data === null) {\n throw new Exception('Cannot deserialize data. May be cache has different data type?');\n }\n\n return $data;\n\n case self::METHOD_JSON:\n $data = @json_decode($data);\n\n if ($data === null) {\n throw new Exception('Cannot deserialize data. May be cache has different data type?');\n }\n\n return $data;\n\n default:\n $data = @unserialize($data, ['allowed_classes' => false]);\n\n if ($data === false) {\n throw new Exception('Cannot deserialize data. May be cache has different data type?');\n }\n\n return $data;\n }\n }", "public function unserialize($serialized)\n {\n $data = unserialize($serialized);\n return self::load($data['uid']);\n }", "public function unSerializeDataToSwap($data, SwapConfig $swap_config) {\n\n $swap_config['in'] = isset($data['in']) ? $data['in'] : null;\n $swap_config['out'] = isset($data['out']) ? $data['out'] : null;\n $swap_config['in_qty'] = isset($data['in_qty']) ? $data['in_qty'] : null;\n $swap_config['out_qty'] = isset($data['out_qty']) ? $data['out_qty'] : null;\n $swap_config['direction'] = isset($data['direction']) ? $data['direction'] : SwapConfig::DIRECTION_SELL;\n $swap_config['swap_rule_ids'] = isset($data['swap_rule_ids']) ? $data['swap_rule_ids'] : null;\n\n // // minimum purchase\n // $swap_config['min'] = isset($data['min']) ? $data['min'] : 0;\n }", "public function unserialize($data)\n {\n foreach (unserialize($data) as $propertyName => $propertyValue) {\n $this->$propertyName = $propertyValue;\n }\n }", "public function unserialize($serialized)\n {\n list($this->username, $this->password, $this->salt,\n $this->roles, $this->id) = \\json_decode(\n $serialized);\n }", "function unserialize()\r\n {\r\n global $methodCache;\r\n\r\n $owner=$this->readOwner();\r\n\r\n if ($owner!=null)\r\n {\r\n if ($this->inheritsFrom('Component')) $this->ControlState=csLoading;\r\n\r\n $namepath=$this->readNamePath();\r\n //if (isset($_SESSION[$namepath])) $this->newunserialize($_SESSION[$namepath]);\r\n\r\n $myclassName = $this->ClassName();\r\n\r\n if( isset( $methodCache[ $myclassName ] ) )\r\n {\r\n $methods = $methodCache[ $myclassName ];\r\n }\r\n else\r\n {\r\n $refclass=new ReflectionClass( $myclassName );\r\n $methods=$refclass->getMethods();\r\n\r\n $methods = array_filter( $methods, 'filterSet' );\r\n\r\n array_walk( $methods, 'processMethods' );\r\n\r\n $methodCache[ $myclassName ] = $methods;\r\n }\r\n\r\n $ourNamePath = $this->readNamePath();\r\n\r\n foreach( $methods as $methodname )\r\n {\r\n $propname=substr($methodname, 3);\r\n\r\n $fullname = $ourNamePath . '.' . $propname;\r\n if (isset($_SESSION[$fullname]))\r\n {\r\n $this->$methodname($_SESSION[$fullname]);\r\n }\r\n else\r\n {\r\n $propname = 'get' . $propname;\r\n $ob=$this->$propname();\r\n if (is_object($ob))\r\n {\r\n if ($ob->inheritsFrom('Persistent'))\r\n {\r\n $ob->unserialize();\r\n }\r\n }\r\n }\r\n }\r\n\r\n if ($this->inheritsFrom('Component')) $this->ControlState=0;\r\n }\r\n else\r\n {\r\n global $exceptions_enabled;\r\n\r\n if ($exceptions_enabled)\r\n {\r\n throw new Exception('Cannot unserialize a component without an owner');\r\n }\r\n }\r\n }", "function is_serialized_string($data) {\n\t\tif (!is_string($data)) {\n\t\t\treturn false;\n\t\t}\n\t\t$data = trim($data);\n\t\tif (strlen($data) < 4) {\n\t\t\treturn false;\n\t\t} elseif (':' !== $data[1]) {\n\t\t\treturn false;\n\t\t} elseif (';' !== substr($data, -1)) {\n\t\t\treturn false;\n\t\t} elseif ($data[0] !== 's') {\n\t\t\treturn false;\n\t\t} elseif ('\"' !== substr($data, -2, 1)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function unserialize($serialized)\n {\n list($this->username, $this->password, $this->salt,\n $this->id) = \\json_decode(\n $serialized);\n }", "function unserializeChildren()\r\n {\r\n reset($this->components->items);\r\n while (list($k,$v)=each($this->components->items))\r\n {\r\n $v->unserialize();\r\n }\r\n }", "public function __wakeup() {\n _doing_it_wrong( __FUNCTION__, __( \"Unserializing instances is forbidden!\", \"wcwspay\" ), \"4.7\" );\n }", "public function hydrate($value)\n {\n $serializer = $this->getSerializer();\n return $serializer->unserialize($value);\n }", "function is_serial($string) {\n return (@unserialize($string) !== false);\n}", "function MBunserialize($serial_str)\n{\n $serial_str = preg_replace_callback('!s:(\\d+):\"(.*?)\";!s', function($match){return 's:'.strlen($match['2']).':\"'.$match['2'] . '\";';}, $serial_str);\n $serial_str= str_replace(\"\\r\", \"\", $serial_str);\n return unserialize($serial_str);\n}" ]
[ "0.83863485", "0.7991397", "0.7956306", "0.7507648", "0.7331182", "0.7087662", "0.6974963", "0.6907907", "0.685702", "0.6849524", "0.6812769", "0.6785934", "0.6775981", "0.6771382", "0.6709784", "0.67068046", "0.67002845", "0.6644394", "0.6591143", "0.65483737", "0.65483737", "0.6517121", "0.6491589", "0.6470685", "0.64667267", "0.6466221", "0.6389115", "0.6381665", "0.63650465", "0.63511336", "0.6294781", "0.6252471", "0.6240784", "0.62407196", "0.6199275", "0.61022836", "0.60978764", "0.60105675", "0.5943135", "0.5935214", "0.5889691", "0.58799815", "0.5876504", "0.58596", "0.5822228", "0.5815974", "0.5807532", "0.58039373", "0.57675606", "0.5753991", "0.5743603", "0.5735079", "0.57269007", "0.57265323", "0.5724227", "0.5722687", "0.570107", "0.5681721", "0.5680766", "0.5675224", "0.5664189", "0.56484896", "0.5647934", "0.5626981", "0.5623845", "0.5612877", "0.5552978", "0.55428535", "0.5536492", "0.54958856", "0.54956925", "0.5482168", "0.5477042", "0.54616416", "0.544454", "0.5436032", "0.54325765", "0.5425289", "0.5416099", "0.54094684", "0.5404881", "0.5344879", "0.53308076", "0.53294605", "0.5326857", "0.53254676", "0.53081304", "0.5303294", "0.5300483", "0.52987164", "0.52945477", "0.5284367", "0.52638704", "0.5240048", "0.5235544", "0.5230128", "0.5224314", "0.5219583", "0.5215672", "0.52113736" ]
0.6077919
37
Check if data is serialized
private function isSerialized($value) { $data = @unserialize($value); if ($value === 'b:0;' || $data !== false) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function isSerialized($data) {\n return (@unserialize($data) !== false);\n }", "function is_serialized_string($data)\n {\n }", "function is_serialized( $data ) {\n if ( !is_string( $data ) )\n return false;\n $data = trim( $data );\n if ( 'N;' == $data )\n return true;\n if ( !preg_match( '/^([adObis]):/', $data, $badions ) )\n return false;\n switch ( $badions[1] ) {\n case 'a' :\n case 'O' :\n case 's' :\n if ( preg_match( \"/^{$badions[1]}:[0-9]+:.*[;}]\\$/s\", $data ) )\n return true;\n break;\n case 'b' :\n case 'i' :\n case 'd' :\n if ( preg_match( \"/^{$badions[1]}:[0-9.E-]+;\\$/\", $data ) )\n return true;\n break;\n }\n return false;\n }", "function is_serialized_string($data) {\n\t\tif (!is_string($data)) {\n\t\t\treturn false;\n\t\t}\n\t\t$data = trim($data);\n\t\tif (strlen($data) < 4) {\n\t\t\treturn false;\n\t\t} elseif (':' !== $data[1]) {\n\t\t\treturn false;\n\t\t} elseif (';' !== substr($data, -1)) {\n\t\t\treturn false;\n\t\t} elseif ($data[0] !== 's') {\n\t\t\treturn false;\n\t\t} elseif ('\"' !== substr($data, -2, 1)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function is_serialized($data) {\n if (!is_string($data))\n return false;\n $data = trim($data);\n if ('N;' == $data)\n return true;\n if (!preg_match('/^([adObis]):/', $data, $badions))\n return false;\n switch ($badions[1]) {\n case 'a' :\n case 'O' :\n case 's' :\n if (preg_match(\"/^{$badions[1]}:[0-9]+:.*[;}]\\$/s\", $data))\n return true;\n break;\n case 'b' :\n case 'i' :\n case 'd' :\n if (preg_match(\"/^{$badions[1]}:[0-9.E-]+;\\$/\", $data))\n return true;\n break;\n }\n return false;\n }", "public function isSerialized()\n {\n if (!isset($this->str[0])) {\n return false;\n }\n\n /** @noinspection PhpUsageOfSilenceOperatorInspection */\n if (\n $this->str === 'b:0;'\n ||\n @unserialize($this->str) !== false\n ) {\n return true;\n } else {\n return false;\n }\n }", "public static function is_serialized( $data ) {\r\n\t\t// if it isn't a string, it isn't serialized\r\n\t\tif ( !is_string( $data ) )\r\n\t\t\treturn false;\r\n\r\n\t\t$data = trim( $data );\r\n\r\n\t\tif ( 'N;' == $data )\r\n\t\t\treturn true;\r\n\r\n\t\tif ( !preg_match( '/^([adObis]):/', $data, $badions ) )\r\n\t\t\treturn false;\r\n\r\n\t\tswitch ( $badions[1] ) {\r\n\t\t\tcase 'a':\r\n\t\t\tcase 'O':\r\n\t\t\tcase 's':\r\n\t\t\t\tif ( preg_match( \"/^{$badions[1]}:[0-9]+:.*[;}]\\$/s\", $data ) )\r\n\t\t\t\t\treturn true;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'b':\r\n\t\t\tcase 'i':\r\n\t\t\tcase 'd':\r\n\t\t\t\tif ( preg_match( \"/^{$badions[1]}:[0-9.E-]+;\\$/\", $data ) )\r\n\t\t\t\t\treturn true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "function is_serialized($data, $strict = \\true)\n {\n }", "private function shouldSerialize()\n {\n $serialize = Common::getRequestVar('serialize', 0, 'int', $this->request);\n\n return !empty($serialize);\n }", "public static function isSerialized($str) {}", "public function isSerializable($data = null)\n {\n if (is_object($data) || is_array($data)) {\n return true;\n }\n\n return false;\n }", "public static function isSerializedArray($data)\n {\n return $data === null || (is_string($data) && preg_match('/^a:[0-9]+:{.*;}$/s', $data));\n }", "static function serialized( $data ) {\n\t\tif(empty($data)) return false;\n\t\tif ( !is_string( $data ) ) \n\t\t\treturn false; \n\t\t$data = trim( $data ); \n\t\tif ( 'N;' == $data ) \n\t\t\treturn true; \n\t\tif ( !preg_match( '/^([adObis]):/', $data, $badions ) ) \n\t\t\treturn false; \n\t\tswitch ( $badions[1] ) { \n\t\t\tcase 'a' : \n\t\t\tcase 'O' : \n\t\t\tcase 's' : \n\t\t\t\tif ( preg_match( \"/^{$badions[1]}:[0-9]+:.*[;}]\\$/s\", $data ) ) \n\t\t\t\t\treturn true; \n\t\t\t\tbreak; \n\t\t\tcase 'b' : \n\t\t\tcase 'i' : \n\t\t\tcase 'd' : \n\t\t\t\tif ( preg_match( \"/^{$badions[1]}:[0-9.E-]+;\\$/\", $data ) ) \n\t\t\t\t\treturn true; \n\t\t\t\tbreak; \n\t\t} \n\t\treturn false; \n\t}", "abstract public function getIsSerializedAttribute() : bool;", "function maybe_unserialize($data)\n {\n }", "abstract protected function serializeData($unSerializedData);", "private function supportData()\n {\n $dataClass = $this->type->getDataClass();\n\n return $this->data instanceof $dataClass || $dataClass === get_class($this->data);\n }", "abstract public function serialize($data);", "function unserialize_safe($serialized) {\r\r\n // as well as if there is any ws between O and :\r\r\n if (is_string($serialized) && strpos($serialized, \"\\0\") === false) {\r\r\n if (strpos($serialized, 'O:') === false) {\r\r\n // the easy case, nothing to worry about\r\r\n // let unserialize do the job\r\r\n return @unserialize($serialized);\r\r\n } else if (!preg_match('/(^|;|{|})O:[0-9]+:\"/', $serialized)) {\r\r\n // in case we did have a string with O: in it,\r\r\n // but it was not a true serialized object\r\r\n return @unserialize($serialized);\r\r\n }\r\r\n }\r\r\n return false;\r\r\n}", "abstract protected function serializeData();", "private function isSerialized($string)\n {\n if ($string === 'b:0;' or @unserialize($string) !== false)\n {\n return true;\n }\n\n return false;\n }", "function maybe_serialize($data)\n {\n }", "function is_serial($string) {\n return (@unserialize($string) !== false);\n}", "public function hasData() : bool;", "private function is_serialized_( $data, $strict = true ) {\n \t if ( ! is_string( $data ) ) {\n \t return false;\n \t }\n \t $data = trim( $data );\n \t if ( 'N;' == $data ) {\n \t return true;\n \t }\n \t if ( strlen( $data ) < 4 ) {\n \t return false;\n \t }\n \t if ( ':' !== $data[1] ) {\n \t return false;\n \t }\n \t if ( $strict ) {\n \t $lastc = substr( $data, -1 );\n \t if ( ';' !== $lastc && '}' !== $lastc ) {\n \t return false;\n \t }\n \t } else {\n \t $semicolon = strpos( $data, ';' );\n \t $brace = strpos( $data, '}' );\n \t // Either ; or } must exist.\n \t if ( false === $semicolon && false === $brace )\n \t return false;\n \t // But neither must be in the first X characters.\n \t if ( false !== $semicolon && $semicolon < 3 )\n \t return false;\n \t if ( false !== $brace && $brace < 4 )\n \t return false;\n \t }\n \t $token = $data[0];\n \t switch ( $token ) {\n \t case 's' :\n \t if ( $strict ) {\n \t if ( '\"' !== substr( $data, -2, 1 ) ) {\n \t return false;\n \t }\n \t } elseif ( false === strpos( $data, '\"' ) ) {\n \t return false;\n \t }\n \t // or else fall through\n \t case 'a' :\n \t case 'O' :\n \t return (bool) preg_match( \"/^{$token}:[0-9]+:/s\", $data );\n \t case 'b' :\n \t case 'i' :\n \t case 'd' :\n \t $end = $strict ? '$' : '';\n \t return (bool) preg_match( \"/^{$token}:[0-9.E-]+;$end/\", $data );\n \t }\n \t return false;\n \t}", "public function serialize($data)\n {\n }", "function is_serialized($data, $strict = true) {\n\t\tif (!is_string($data)) {\n\t\t\treturn false;\n\t\t}\n\t\t$data = trim($data);\n\t\tif ('N;' == $data) {\n\t\t\treturn true;\n\t\t}\n\t\tif (strlen($data) < 4) {\n\t\t\treturn false;\n\t\t}\n\t\tif (':' !== $data[1]) {\n\t\t\treturn false;\n\t\t}\n\t\tif ($strict) {\n\t\t\t$lastc = substr($data, -1);\n\t\t\tif (';' !== $lastc && '}' !== $lastc) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\t$semicolon = strpos($data, ';');\n\t\t\t$brace = strpos($data, '}');\n\t\t\t// Either ; or } must exist.\n\t\t\tif (false === $semicolon && false === $brace) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// But neither must be in the first X characters.\n\t\t\tif (false !== $semicolon && $semicolon < 3) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (false !== $brace && $brace < 4) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}\n\t\t$token = $data[0];\n\t\tswitch ($token) {\n\t\tcase 's':\n\t\t\tif ($strict) {\n\t\t\t\tif ('\"' !== substr($data, -2, 1)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} elseif (false === strpos($data, '\"')) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t// or else fall through\n\t\tcase 'a':\n\t\tcase 'O':\n\t\t\treturn (bool) preg_match(\"/^{$token}:[0-9]+:/s\", $data);\n\t\tcase 'b':\n\t\tcase 'i':\n\t\tcase 'd':\n\t\t\t$end = $strict ? '$' : '';\n\t\t\treturn (bool) preg_match(\"/^{$token}:[0-9.E-]+;$end/\", $data);\n\t\t}\n\t\treturn false;\n\t}", "public function is_serialized($data, $strict = true)\n {\n // if it isn't a string, it isn't serialized.\n if (!is_string($data)) {\n return false;\n }\n $data = trim($data);\n if ('N;' == $data) {\n return true;\n }\n if (strlen($data) < 4) {\n return false;\n }\n if (':' !== $data[1]) {\n return false;\n }\n if ($strict) {\n $lastc = substr($data, -1);\n if (';' !== $lastc && '}' !== $lastc) {\n return false;\n }\n } else {\n $semicolon = strpos($data, ';');\n $brace = strpos($data, '}');\n // Either ; or } must exist.\n if (false === $semicolon && false === $brace) {\n return false;\n }\n // But neither must be in the first X characters.\n if (false !== $semicolon && $semicolon < 3) {\n return false;\n }\n if (false !== $brace && $brace < 4) {\n return false;\n }\n }\n $token = $data[0];\n switch ($token) {\n case 's':\n if ($strict) {\n if ('\"' !== substr($data, -2, 1)) {\n return false;\n }\n } elseif (false === strpos($data, '\"')) {\n return false;\n }\n // or else fall through\n case 'a':\n case 'O':\n return (bool)preg_match(\"/^{$token}:[0-9]+:/s\", $data);\n case 'b':\n case 'i':\n case 'd':\n $end = $strict ? '$' : '';\n return (bool)preg_match(\"/^{$token}:[0-9.E-]+;$end/\", $data);\n }\n return false;\n }", "protected function isRawData() {\n return $this->rawData;\n }", "public function hasData(): bool {\n return is_array($this->data);\n }", "public function serialize($data);", "public static function is_serialized(string $str)\n {\n $array = @unserialize($str);\n return ! ($array === false and $str !== 'b:0;');\n }", "public static function serializedContainsObject($serialized)\n\t{\n\t\tif (strpos($serialized, 'O:') !== false && preg_match('#(?<=^|[;{}])O:[+-]?[0-9]+:\"#', $serialized))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif (strpos($serialized, 'C:') !== false && preg_match('#(?<=^|[;{}])C:[+-]?[0-9]+:\"#', $serialized))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif (strpos($serialized, 'o:') !== false && preg_match('#(?<=^|[;{}])o:[+-]?[0-9]+:\"#', $serialized))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public static function is_serialized(string $str): bool\n {\n if ($str === '') {\n return false;\n }\n\n /** @noinspection PhpUsageOfSilenceOperatorInspection */\n /** @noinspection UnserializeExploitsInspection */\n return $str === 'b:0;'\n ||\n @\\unserialize($str, []) !== false;\n }", "protected function is_serialized($data, $strict = true)\n {\n // if it isn't a string, it isn't serialized.\n if (! is_string($data)) {\n return false;\n }\n\n $data = trim($data);\n\n if ('N;' == $data) {\n return true;\n }\n\n if (strlen($data) < 4) {\n return false;\n }\n\n if (':' !== $data[1]) {\n return false;\n }\n\n if ($strict) {\n $lastc = substr($data, -1);\n\n if (';' !== $lastc && '}' !== $lastc) {\n return false;\n }\n } else {\n $semicolon = strpos($data, ';');\n $brace = strpos($data, '}');\n\n // Either ; or } must exist.\n if (false === $semicolon && false === $brace) {\n return false;\n }\n\n // But neither must be in the first X characters.\n if (false !== $semicolon && $semicolon < 3) {\n return false;\n }\n\n if (false !== $brace && $brace < 4) {\n return false;\n }\n }\n $token = $data[0];\n\n switch ($token) {\n case 's':\n if ($strict) {\n if ('\"' !== substr($data, -2, 1)) {\n return false;\n }\n } elseif (false === strpos($data, '\"')) {\n return false;\n }\n // or else fall through\n // no break\n case 'a':\n case 'O':\n return (bool) preg_match(\"/^{$token}:[0-9]+:/s\", $data);\n case 'b':\n case 'i':\n case 'd':\n $end = $strict ? '$' : '';\n\n return (bool) preg_match(\"/^{$token}:[0-9.E-]+;$end/\", $data);\n }\n\n return false;\n }", "public function unserialize($data) {}", "public function isDataValid(): bool;", "public function hasStructuredData() {\n\t\treturn ! empty( $this->data );\n\t}", "public static function serialized(string $name): bool\n {\n return static::$serialize;\n }", "function parcelcheckout_serialize_hasInjection($mData)\n\t{\n\t\tif(is_array($mData) || is_object($mData))\n\t\t{\n\t\t\tforeach($mData as $k => $v)\n\t\t\t{\n\t\t\t\tif(parcelcheckout_serialize_hasInjection($v) || parcelcheckout_serialize_hasInjection($k))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telseif(is_string($mData) && strpos($mData, ':'))\n\t\t{\n\t\t\tif(preg_match('/([aAoOsS]:[0-9]+:[\\{\"])/', $mData))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public final function hasData()\n {\n return $this->data == false ? false : true;\n }", "public function hasData() {\n try {\n $res = TRUE;\n }\n catch (\\Exception $e) {\n $res = FALSE;\n }\n\n return $res;\n }", "static function checkObj(&$data) \n\t{\n\t\tif(!$data)\n\t\t\treturn false;\n\t\tif(preg_match('/((?![\\x20-\\x7E]).)/', $data)){\n\t\t\t//todo:now just int\n\t\t\t$data = unpack('I',$data);\n\t\t\t$data = $data[1];\n\t\t\treturn false;\n\t\t}\n\t\tif(substr_compare($data,'{',0,1)==0){\n\t\t\t$ndata = json_decode($data,true);\n\t\t\tif($ndata){\n\t\t\t\t$data = $ndata;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}", "public function loaded()\n {\n return is_array($this->data);\n }", "protected function has_data()\n {\n }", "function is_serialized($value, &$result = null)\n{\n\tif (!is_string($value))\n\t{\n\t\treturn false;\n\t}\n\t// Serialized false, return true. unserialize() returns false on an\n\t// invalid string or it could return false if the string is serialized\n\t// false, eliminate that possibility.\n\tif ($value === 'b:0;')\n\t{\n\t\t$result = false;\n\t\treturn true;\n\t}\n\t$length\t= strlen($value);\n\t$end\t= '';\n\tswitch ($value[0])\n\t{\n\t\tcase 's':\n\t\t\tif ($value[$length - 2] !== '\"')\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\tcase 'b':\n\t\tcase 'i':\n\t\tcase 'd':\n\t\t\t// This looks odd but it is quicker than isset()ing\n\t\t\t$end .= ';';\n\t\tcase 'a':\n\t\tcase 'O':\n\t\t\t$end .= '}';\n\t\t\tif ($value[1] !== ':')\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tswitch ($value[2])\n\t\t\t{\n\t\t\t\tcase 0:\n\t\t\t\tcase 1:\n\t\t\t\tcase 2:\n\t\t\t\tcase 3:\n\t\t\t\tcase 4:\n\t\t\t\tcase 5:\n\t\t\t\tcase 6:\n\t\t\t\tcase 7:\n\t\t\t\tcase 8:\n\t\t\t\tcase 9:\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\tcase 'N':\n\t\t\t$end .= ';';\n\t\t\tif ($value[$length - 1] !== $end[0])\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\tbreak;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n\tif (($result = @unserialize($value)) === false)\n\t{\n\t\t$result = null;\n\t\treturn false;\n\t}\n\treturn true;\n}", "public function testInvalidSerializedData()\n {\n $someData = 12;\n\n $serializer = ArrayObject::DEFAULT_SERIALIZER;\n $serializer = new $serializer;\n\n $data = new ArrayObject;\n $data->unserialize($serializer->serialize($someData));\n }", "function is_serialized( $value, &$result = null ){\n\tif( !is_string( $value ) ){\n\t\treturn false;\n\t}\n\n\t// Serialized false, return true. unserialize() returns false on an\n\t// invalid string or it could return false if the string is serialized\n\t// false, eliminate that possibility.\n\tif( $value === 'b:0;')\n\t{\n\t\t$result = false;\n\t\treturn true;\n\t}\n\n\t$length\t= strlen( $value );\n\t$end\t= '';\n\n\tswitch ( $value[0])\t{\n\t\tcase 's':\n\t\t\tif( $value[$length - 2] !== '\"'){\n\t\t\t\treturn false;\n\t\t\t}\n\t\tcase 'b':\n\t\tcase 'i':\n\t\tcase 'd':\n\t\t\t// This looks odd but it is quicker than isset()ing\n\t\t\t$end .= ';';\n\t\tcase 'a':\n\t\tcase 'O':\n\t\t\t$end .= '}';\n\n\t\t\tif( $value[1] !== ':'){\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tswitch ( $value[2]){\n\t\t\t\tcase 0:\n\t\t\t\tcase 1:\n\t\t\t\tcase 2:\n\t\t\t\tcase 3:\n\t\t\t\tcase 4:\n\t\t\t\tcase 5:\n\t\t\t\tcase 6:\n\t\t\t\tcase 7:\n\t\t\t\tcase 8:\n\t\t\t\tcase 9:\n\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\tcase 'N':\n\t\t\t$end .= ';';\n\n\t\t\tif( $value[$length - 1] !== $end[0]){\n\t\t\t\treturn false;\n\t\t\t}\n\t\tbreak;\n\n\t\tdefault:\n\t\t\treturn false;\n\t}\n\n\tif(( $result = @unserialize( $value ) ) === false )\t{\n\t\t$result = null;\n\t\treturn false;\n\t}\n\treturn true;\n}", "public function hasData(): bool\n {\n return !empty($this->data);\n }", "public function testSerialize()\n {\n $data = $this->getDB()->get('SELECT * FROM grps');\n json_encode($data);\n $this->assertEquals(true, strlen(serialize($data)) > 0);\n }", "public function has_data()\n {\n }", "public static function isData($input)\n {\n if (is_object($input)) {\n return ($input instanceof self);\n }\n\n return (is_string($input) && (strpos($input, 'data:') === 0));\n }", "function isDataValid() \n {\n return true;\n }", "#[\\ReturnTypeWillChange]\n public function unserialize($data)\n {\n }", "public function is_item_serialized($itemID) {\n\t\t$itemtype = $this->get_itemtype($itemID);\n\t\treturn ItemMasterItem::is_itemtype_serialized($itemtype);\n\t}", "public function __invoke($data): bool\n {\n return is_string($data);\n }", "protected function caseRendererPHPSerialize($defaultSerializeValue = 1)\n\t{\n\t\t$serialize = Piwik_Common::getRequestVar('serialize', $defaultSerializeValue, 'int', $this->request);\n\t\tif($serialize)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isValid() {\n\t\treturn !is_array($this->data) && count($this->data->getRawData()) > 0;\n\t}", "public function serialize($value) : bool\n {\n }", "public function deserialize($data)\n {\n }", "public function hasData(){\n return $this->_has(1);\n }", "function getSerializedData()\n {\n if ($this->_serializedData == null) {\n return $this->raiseError('No serialized data available. '\n . 'Use XML_Serializer::serialize() first.',\n XML_SERIALIZER_ERROR_NO_SERIALIZATION);\n }\n return $this->_serializedData;\n }", "public static function isSerializedVar($val)\n {\n\t\tif (!is_string($val)) return false;\n else return (strrpos($val, \"__\", 2) !== false && strrpos($val, \"__\", -2) !== false) ? true : false;\n }", "public function isJson()\n {\n return parent::isJson();\n }", "public function isHydrated() {\n\t\treturn !empty($this->originalData);\t\t\n\t}", "public function isJson()\n {\n if (!isset($this->str[0])) {\n return false;\n }\n\n json_decode($this->str);\n\n if (json_last_error() === JSON_ERROR_NONE) {\n return true;\n } else {\n return false;\n }\n }", "protected function isJsonEncodable($data)\n {\n if (!is_array($data)) {\n $data = [$data];\n }\n $json = json_encode($data, JSON_UNESCAPED_SLASHES);\n\n if ($json === false) {\n return false;\n }\n\n return true;\n }", "public function checkDataFormat($data) {\n return true;\n }", "function parseData()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function hasPostData()\r\n\t{\r\n\t\treturn (is_array($this->postData) && !empty($this->postData));\r\n\t}", "public static function data_is_set() {\r\n\t\treturn self::$page_data instanceof PageData;\r\n\t}", "public function valid(){\n\t\treturn (is_array($this->data) ? key($this->data) !== null : false);\n\t}", "public function supportsNormalization( $data, $format = null ) {\n\t\tif ( $format == \"xml\" && $data instanceof PaymentData ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "abstract protected function unSerializeData();", "function stringToObject( $data, $namespace='' ) {\n\t\treturn true;\n\t}", "function stringToObject( $data, $namespace='' ) {\n\t\treturn true;\n\t}", "public function deserialize($data);", "public static function safeUnserialize($serialized)\n\t{\n\t\tif (PHP_VERSION_ID >= 70000)\n\t\t{\n\t\t\t// PHP 7 has an option to disable unserializing objects, so use that if available\n\t\t\treturn @unserialize($serialized, array('allowed_classes' => false));\n\t\t}\n\n\t\tif (self::serializedContainsObject($serialized))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn @unserialize($serialized);\n\t}", "function allowserialize($propname)\r\n {\r\n return(true);\r\n }", "public function isSuccessful()\r\n {\r\n return is_array($this->data);\r\n }", "abstract public function serialize();", "abstract public function serialize();", "protected function maybe_serialize($data)\n {\n if (defined('WP_REDIS_SERIALIZER') && ! empty(WP_REDIS_SERIALIZER)) {\n return $data;\n }\n\n if (defined('WP_REDIS_IGBINARY') && WP_REDIS_IGBINARY && function_exists('igbinary_serialize')) {\n return igbinary_serialize($data);\n }\n\n if (is_array($data) || is_object($data)) {\n return serialize($data);\n }\n\n if ($this->is_serialized($data, false)) {\n return serialize($data);\n }\n\n return $data;\n }", "public function hasExplicitBodyData()\n {\n return $this->explicit_body_data !== null;\n }", "public function is_user_object_data() {\n return false;\n }", "public function supportsNormalization($data, $format = null)\n {\n return 'json' === $format && $data instanceof \\Exception;\n }", "public function testSerialize() {\n $index = Phish_Index::load();\n $str = serialize($index);\n $indexRestored = unserialize($str);\n $this->assertEquals($index, $indexRestored);\n }", "public function checkDataFormat(&$data)\n {\n return true;\n }", "public abstract function serialize();", "abstract public function unserialize($serialized);", "function unserialize ( $data ) {\n return unserialize( $data );\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 }", "function _serialize( &$data ) {\n\t\t$serial = serialize( $data );\n\t\tif( function_exists( 'gzdeflate' ) ) {\n\t\t\treturn gzdeflate( $serial );\n\t\t} else {\n\t\t\treturn $serial;\n\t\t}\n\t}", "private function convertSerializedData()\n {\n $layoutUpdateQueryModifier = $this->queryModifierFactory->create(\n 'like',\n [\n 'values' => [\n 'xml' => '%conditions_encoded%'\n ]\n ]\n );\n $this->aggregatedFieldDataConverter->convert(\n [\n new FieldToConvert(\n SerializedToJson::class,\n $this->moduleDataSetup->getTable('widget_instance'),\n 'instance_id',\n 'widget_parameters'\n ),\n new FieldToConvert(\n LayoutUpdateConverter::class,\n $this->moduleDataSetup->getTable('layout_update'),\n 'layout_update_id',\n 'xml',\n $layoutUpdateQueryModifier\n ),\n ],\n $this->moduleDataSetup->getConnection()\n );\n }", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "protected function serialize($data)\n {\n return serialize($data);\n }", "public function shouldSerialize($fieldKey);", "public function valid() {\n\t\treturn (current($this->_data) !== false);\n\t}", "#[\\ReturnTypeWillChange]\n public function valid()\n {\n return key($this->_data) !== null;\n }" ]
[ "0.8278237", "0.79831296", "0.7584531", "0.75694233", "0.7553779", "0.75530547", "0.7462606", "0.7457799", "0.7319665", "0.7280343", "0.7269413", "0.7127563", "0.69708014", "0.67302525", "0.6687354", "0.66627616", "0.6567839", "0.6550785", "0.6538204", "0.65301126", "0.6502674", "0.6500074", "0.6490369", "0.64478695", "0.6429386", "0.6394729", "0.63688993", "0.6357423", "0.63491505", "0.6336574", "0.6284587", "0.628192", "0.62475944", "0.6247481", "0.6245701", "0.6240565", "0.62087035", "0.6188964", "0.6159873", "0.61252314", "0.6120224", "0.611215", "0.61110115", "0.6109341", "0.6101686", "0.60632026", "0.6055451", "0.6049216", "0.6030763", "0.6006037", "0.59602207", "0.5913607", "0.5910555", "0.5887029", "0.5869877", "0.58476484", "0.5843212", "0.5841244", "0.5835089", "0.58315897", "0.5820884", "0.5791743", "0.5787835", "0.5768022", "0.57592267", "0.5753877", "0.5736183", "0.57336724", "0.57175356", "0.5706174", "0.5705362", "0.5699901", "0.5686097", "0.5660051", "0.5654337", "0.5654337", "0.5650322", "0.5648134", "0.5615397", "0.5601253", "0.5600087", "0.5600087", "0.55984914", "0.55892354", "0.5574737", "0.55701286", "0.5561727", "0.555942", "0.5545777", "0.5535549", "0.55299896", "0.55261177", "0.5523714", "0.5518382", "0.5508525", "0.5508525", "0.55039895", "0.549999", "0.5496703", "0.54898065" ]
0.69689167
13
Get the console command arguments.
protected function getArguments() { return array( array('action', InputArgument::REQUIRED, 'Keystone action (get, put, pluck, range...)'), array('key', InputArgument::OPTIONAL, 'Keystone key (namespace optional)'), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getArgs()\n {\n return $this->meta[Cli::ARGS] ?? [];\n }", "private function getArguments() {\n return array_slice($argv, 1);\n }", "public function getArgs() {\n return $this->commandArgs;\n }", "public function getCommandLineArguments()\n {\n return $this->commandLineArguments;\n }", "public function args()\n {\n return $this->arguments->get();\n }", "public function getArgs()\n {\n if ($this['args']) {\n return $this['args'];\n }\n\n return [];\n }", "public function getArgs()\n {\n return $this->args;\n }", "public function getArgs()\n {\n return $this->args;\n }", "public function getArgs()\n {\n return $this->args;\n }", "public function getArgs()\n {\n return $this->args;\n }", "public function getArgs()\n {\n return $this->args;\n }", "public function getArgs();", "public function getArgs();", "public function getArgs() {\n return $this->args;\n }", "public function getArgs()\n {\n return $this->args;\n }", "public function getArguments()\n {\n return sprintf(\n \"--%s %s \\\"%s\\\" %s %s %s\",\n $this->name,\n $this->getBoxOptionToString(),\n $this->message,\n $this->height,\n $this->width,\n $this->default\n );\n }", "protected function getArguments()\r\n\t{\r\n\t\treturn isset($this->arguments) ? $this->arguments : array();\r\n\t}", "public function args()\n {\n return [];\n }", "public function getArgs(): array\n {\n return $this->args;\n }", "public function getArguments()\n {\n return sprintf(\n \"--%s %s \\\"%s\\\" %s %s %s %s\",\n $this->name,\n $this->getBoxOptionToString(),\n $this->message,\n $this->height,\n $this->width,\n $this->height - 8,\n $this->getListString()\n );\n }", "public function getArgs() {\n\t\treturn $this->args;\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\n\t\treturn array(\n\t\t\tarray('run', InputArgument::REQUIRED, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n {\n return [\n ['name', InputArgument::REQUIRED, 'The name of the command.'],\n ];\n }", "public function getArguments() {\n return $this->args;\n }", "public function getArgs() : array\n {\n return $this->args;\n }", "protected function getArguments()\n {\n return [\n ['name', InputArgument::REQUIRED, 'The name of the command.'],\n ['alias', InputArgument::OPTIONAL, 'The alias of module will be used.'],\n ];\n }", "public function getArgs()\n {\n return $this->noramlizeArgs($this->_args);\n }", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t['connection', InputArgument::OPTIONAL, 'Database connection name', Config::get('database.default')],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t//\tarray('example', InputArgument::REQUIRED, 'An example argument.'),\n\t\t);\n\t}", "public function getArgs()\n {\n return $this->parsedArgs;\n }", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t// array('example', InputArgument::REQUIRED, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t// array('example', InputArgument::REQUIRED, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n {\n return array(\n //array('example', InputArgument::REQUIRED, 'An example argument.'),\n );\n }", "public function getArguments() : array\n {\n return $this->args;\n }", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t/*['example', InputArgument::REQUIRED, 'An example argument.'],*/\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//array('example', InputArgument::REQUIRED, 'An example argument.'),\n\t\t];\n\t}", "protected function getArguments()\n {\n return array( //\t\t\tarray('example', InputArgument::REQUIRED, 'An example argument.'),\n );\n }", "protected function getArguments()\n {\n return array( //\t\t\tarray('example', InputArgument::REQUIRED, 'An example argument.'),\n );\n }", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t['example', InputArgument::OPTIONAL, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t['example', InputArgument::OPTIONAL, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t//array('example', InputArgument::REQUIRED, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t//array('example', InputArgument::REQUIRED, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t//array('example', InputArgument::REQUIRED, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n {\n return array(//\t\t\tarray('example', InputArgument::REQUIRED, 'An example argument.'),\n );\n }", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t#array('example', InputArgument::REQUIRED, 'An example argument.'),\n\t\t];\n\t}", "protected function getArguments()\n {\n return array(\n array('example', InputArgument::OPTIONAL, 'An example argument.'),\n );\n }", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "public function getArguments() {}", "public function getArguments() {}", "public function getArguments() {}", "public function getArguments() {}", "protected function getArguments()\n {\n return [\n // ['example', InputArgument::REQUIRED, 'An example argument.'],\n ];\n }", "protected function getArguments()\n {\n return [\n // ['example', InputArgument::REQUIRED, 'An example argument.'],\n ];\n }", "protected function getArguments()\n {\n return [\n // ['example', InputArgument::REQUIRED, 'An example argument.'],\n ];\n }", "protected function getArguments()\n {\n return [\n//\t\t\t['example', InputArgument::REQUIRED, 'An example argument.'],\n ];\n }", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\tarray('example', InputArgument::OPTIONAL, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\tarray('example', InputArgument::OPTIONAL, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\tarray('example', InputArgument::OPTIONAL, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\tarray('example', InputArgument::OPTIONAL, 'An example argument.'),\n\t\t);\n\t}", "public static function getArguments()\n {\n return func_get_args();\n }", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t//TODO argument to do a single facade. Must be a valid facade\n\t\t\tarray('example', InputArgument::OPTIONAL, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n {\n return [];\n /*\t\treturn [\n ['example', InputArgument::REQUIRED, 'An example argument.'],\n ];\n */\n }", "protected function getArguments()\n {\n return [\n ['commit', InputArgument::OPTIONAL, 'A descricão do commit.'],\n // ['commit', InputArgument::REQUIRED, 'A descricão do commit.'],\n ];\n }", "protected function getArguments()\n {\n return [\n ['module', InputArgument::OPTIONAL, 'The module for the language file'],\n ['langFile', InputArgument::OPTIONAL, 'The language file to work on'],\n ['targetLocale', InputArgument::OPTIONAL, 'The target locale for which to add missing keys'],\n ];\n }", "protected function getArguments() {\n\t\treturn array();\n\t}", "protected function getArguments()\n {\n return [\n ['db_name', InputArgument::REQUIRED, 'Database name'],\n ];\n }", "public function getArguments()\n {\n return $this->arguments;\n }", "public function getArguments()\n {\n return $this->arguments;\n }", "public function getArguments()\n {\n return $this->arguments;\n }", "protected function getArguments()\n {\n return [\n ['name', InputArgument::REQUIRED, 'The name of the command.'],\n ['component', InputArgument::OPTIONAL, 'The name of component will be used.'],\n ];\n }", "protected function getArguments()\r\n\t{\r\n\t\treturn array();\r\n\t}", "protected function getArguments()\r\n\t{\r\n\t\treturn array();\r\n\t}", "protected function getArguments()\n {\n return [\n ['example', InputArgument::REQUIRED, 'An example argument.'],\n ];\n }", "protected function getArguments() {\n\t\treturn array(\n\t\t);\n\t}" ]
[ "0.7929734", "0.79042095", "0.7831461", "0.7587314", "0.75166816", "0.70980483", "0.7015334", "0.7015334", "0.7015334", "0.7015334", "0.7015334", "0.7011597", "0.7011597", "0.6969377", "0.6941954", "0.6919662", "0.69183534", "0.6889421", "0.6861143", "0.68576336", "0.6853908", "0.68240553", "0.68163955", "0.6801406", "0.6779744", "0.6773187", "0.6766259", "0.6718356", "0.66868067", "0.6682031", "0.6665992", "0.6665992", "0.6662437", "0.6646087", "0.6639124", "0.66325283", "0.6631554", "0.6631554", "0.663134", "0.663134", "0.6630261", "0.6630261", "0.6630261", "0.6629428", "0.66274405", "0.66246825", "0.6616279", "0.6616279", "0.6616279", "0.6616279", "0.6616279", "0.6616279", "0.6616279", "0.6616279", "0.6593955", "0.6593955", "0.6593955", "0.6593955", "0.6580068", "0.6580068", "0.6580068", "0.65620434", "0.6558061", "0.6558061", "0.6558061", "0.6558061", "0.6557318", "0.65526676", "0.6550134", "0.6550134", "0.6550134", "0.6550134", "0.6550134", "0.6550134", "0.6550134", "0.6550134", "0.6550134", "0.6550134", "0.6550134", "0.6550134", "0.65485007", "0.65485007", "0.65485007", "0.65485007", "0.65485007", "0.65485007", "0.65485007", "0.65485007", "0.65436697", "0.6535705", "0.65260065", "0.6516756", "0.65142566", "0.6511927", "0.6511927", "0.6511927", "0.6510059", "0.65032375", "0.65032375", "0.6496519", "0.6488758" ]
0.0
-1
Get the console command options.
protected function getOptions() { return array( array('index', null, InputOption::VALUE_OPTIONAL, 'Index of assoc or hash', null), array('start', null, InputOption::VALUE_OPTIONAL, 'Start of array range', 0), array('end', null, InputOption::VALUE_OPTIONAL, 'End of array range', -1), array('value', null, InputOption::VALUE_OPTIONAL, 'Value to put or where by', null), array('increment', null, InputOption::VALUE_OPTIONAL, 'Increment size', 1), array('serialize', null, InputOption::VALUE_NONE, 'Enable serialization on put requets'), array('unserialize', null, InputOption::VALUE_NONE, 'Unserialize result'), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getOptions() {\n return [\n ['env', null, InputOption::VALUE_OPTIONAL, 'The environment the command should run under.', null],\n ];\n }", "protected function getOptions()\n {\n return [\n ['command', null, InputOption::VALUE_OPTIONAL, 'The terminal command that should be assigned', 'command:name'],\n ];\n }", "protected function getOptions()\n\t{\n\t\treturn [\n\t\t\t['testMode', null, InputOption::VALUE_OPTIONAL, 'Runs the command in Test Mode.', false],\n\t\t];\n\t}", "protected function getOptions()\n {\n $options = [];\n\n // Here we will gather all of the command line options that have been specified with\n // the double hyphens in front of their name. We will make these available to the\n // Blade task file so they can be used in echo statements and other structures.\n foreach ($_SERVER['argv'] as $argument) {\n if (! Str::startsWith($argument, '--') || in_array($argument, $this->ignoreOptions)) {\n continue;\n }\n\n $option = explode('=', substr($argument, 2), 2);\n\n if (count($option) == 1) {\n $option[1] = true;\n }\n\n $optionKey = $option[0];\n\n $options[Str::camel($optionKey)] = $option[1];\n $options[Str::snake($optionKey)] = $option[1];\n }\n\n return $options;\n }", "protected function getOptions()\n {\n return [\n ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'],\n ['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production.'],\n ['path', null, InputOption::VALUE_OPTIONAL, 'The path of migrations files to be executed.'],\n ['pretend', null, InputOption::VALUE_NONE, 'Dump the SQL queries that would be run.'],\n\n ];\n }", "protected function getOptions()\n {\n return [\n ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'],\n ];\n }", "protected function getOptions()\n {\n return [\n ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use'],\n ];\n }", "protected function getOptions()\n {\n return [\n ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'],\n ['native-import', null, InputOption::VALUE_NONE, 'Use the native importer'],\n ];\n }", "protected function getOptions()\n {\n return array(\n array('database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'),\n array('pretend', null, InputOption::VALUE_NONE, 'Dump the SQL queries that would be run.'),\n array('seed', null, InputOption::VALUE_NONE, 'Indicates if the seed task should be re-run.'),\n array('force', null, InputOption::VALUE_NONE, 'Force the operation to run while in production.'),\n );\n }", "protected function getOptions()\n {\n return [\n ['port', null, InputOption::VALUE_OPTIONAL, 'The server port to use.', \\config('minions-server.port', 8085)],\n ];\n }", "protected function getOptions()\n {\n return [\n ['facade', '', InputOption::VALUE_NONE, 'Generate facade for current repository'],\n\n ['model', 'm', InputOption::VALUE_REQUIRED, 'Generate a resource repository for the given model'],\n ];\n }", "protected function getOptions()\n\t{\n\t\treturn [\n\t\t\t['attach', '-a', InputOption::VALUE_OPTIONAL, 'The pipes to attach to the workflow.', null],\n\t\t\t['unguard', '-u', InputOption::VALUE_NONE, 'Do not make this workflow validate data.', null],\n\t\t];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [\n\t\t];\n\t}", "public final function getOptions()\n {\n return $this->_getOptions();\n }", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function options()\n\t{\n\t\treturn [];\n\t}", "protected static abstract function getOptions();", "public function options()\n {\n return $this->options ?: [];\n }", "protected function getOptions() {\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n {\n\n return [\n ['dry-run' , 'd', InputOption::VALUE_NONE, 'Dry Run'],\n ['payment' , 'p', InputOption::VALUE_NONE, 'Payment Address Only'],\n ['public' , 'u', InputOption::VALUE_NONE, 'Public Address Only'],\n ];\n }", "public function options()\n {\n return $this->options;\n }", "public function options()\n {\n return $this->options;\n }", "public function options()\n {\n return $this->options;\n }", "protected function getOptions()\r\n\t{\r\n\t\treturn isset($this->options) ? $this->options : array();\r\n\t}", "function get_options()\n{\n return php_sapi_name() == 'cli' ? get_options_cli() : get_options_url();\n}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n {\n return [\n ['format', 'f', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The names of formats you would like to generate.', null],\n ['regenerate', 'r', InputOption::VALUE_NONE, 'Whether all files must be regenerated even if exist.', null],\n ['temp', 't', InputOption::VALUE_NONE, 'Whether the temporary storage must be processed.', null],\n ];\n }", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\tarray('dry-run', null, InputOption::VALUE_NONE, 'Displays the new cron without making any changes.', null),\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function _getCliOptions()\n {\n $cliOptions = array();\n\n foreach ($_SERVER['argv'] as $arg) {\n if (substr($arg, 0, 2) == '--' && strpos($arg, '=') !== false) {\n $option = substr($arg, 2);\n $option = explode('=', $option);\n\n $cliOptions[$option[0]] = $option[1];\n }\n }\n\n return $cliOptions;\n }", "protected function getOptions() {\n\t\treturn array();\n\t}", "public function getOpts(): array\n {\n return $this->opts;\n }", "public function getOpts(): array\n {\n return $this->opts;\n }", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n {\n return [\n ['model', 'm', InputOption::VALUE_OPTIONAL, 'Generate a repository for the given model.'],\n ];\n }", "public function getOptions()\n {\n return $this->options->getOptions();\n }", "protected function getOptions()\r\n\t{\r\n\t\treturn array();\r\n\t}", "protected function getOptions()\n {\n return [\n ['model', 'm', InputOption::VALUE_OPTIONAL, 'Inject a model to the controller.'],\n ['repository', 'r', InputOption::VALUE_OPTIONAL, 'Inject a repository to the controller.'],\n ['view', '', InputOption::VALUE_OPTIONAL, 'Generate a view controller class.'],\n ];\n }", "protected function getOptions()\n {\n return [\n ['show', null, InputOption::VALUE_NONE, 'Simply display the key instead of modifying files.'],\n ];\n }", "protected function getOptions()\n {\n return array(\n array('dry-run', null, InputOption::VALUE_NONE, 'Only shows which files would have been modified.'),\n array('force', 'f', InputOption::VALUE_NONE, 'Do not confirm before editing files.'),\n array('path', null, InputOption::VALUE_OPTIONAL, 'Path containing the files to be fixed.', 'app')\n );\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }" ]
[ "0.7800682", "0.77591324", "0.751765", "0.7345173", "0.73404354", "0.7306238", "0.72790045", "0.7268271", "0.7237944", "0.71917665", "0.715652", "0.7155546", "0.7137", "0.71122515", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.70998144", "0.70998144", "0.7099153", "0.7092979", "0.7084178", "0.70818704", "0.70631355", "0.7055609", "0.7040382", "0.7040382", "0.7040382", "0.7036282", "0.70356953", "0.70315164", "0.70315164", "0.70315164", "0.70315164", "0.70315164", "0.70315164", "0.70315164", "0.70315164", "0.70315164", "0.70281166", "0.70248216", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.7022473", "0.70166355", "0.70108926", "0.70108926", "0.70083207", "0.70083207", "0.70083207", "0.70083207", "0.70083207", "0.70083207", "0.70083207", "0.6996981", "0.6996434", "0.6994164", "0.6993292", "0.6984455", "0.69844353", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616" ]
0.0
-1
Register any authentication / authorization services.
public function boot(): void { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerServices()\n {\n $this->app->bind(SocialProvidersManager::class, SocialiteProvidersManager::class);\n\n $this->app->singleton(TwoFactor::class, function () {\n return new AuthyTwoFactor(new Client());\n });\n }", "private function registerServices() {\n // Modules\n $this->addService('modules', 'MyTravel\\Core\\Service\\Modules::setService');\n // Routing\n $this->addService('routing', 'MyTravel\\Core\\Service\\Routing::setService');\n // Event dispatcher\n $this->serviceContainer\n ->register('events', 'Symfony\\Component\\EventDispatcher\\EventDispatcher');\n // Database\n $this->addService('db', 'MyTravel\\Core\\Service\\Db::setService');\n // Access\n $this->addService('access', 'MyTravel\\Core\\Service\\Access::setService');\n }", "protected function registerServices(): void\n {\n $this->registerKernels();\n $this->registerFactories();\n $this->registerMicroServices();\n }", "public function registerAuth()\n {\n $this->container->make(DingoAuth\\Auth::class)->extend('jwt', function($app) {\n return new DingoAuth\\Provider\\JWT($app[\\Antares\\Modules\\Api\\Providers\\Auth\\JWT::class]);\n });\n }", "public function registerAuthServices(Container $container)\n {\n static $provider = null;\n\n if ($provider === null) {\n $provider = new AuthServiceProvider();\n }\n\n $provider->register($container);\n }", "public function registerServices() {\n\t\t$services = $this->getServices();\n\t\t$services = array_map( [ $this, 'instantiateServices' ], $services );\n\t\t\n\t\tarray_walk( $services, function ( Service $service ) {\n\t\t\t$service->register();\n\t\t} );\n\t}", "public static function register_services()\n {\n foreach ( self::get_services() as $class )\n {\n $service = self::instantiate( $class );\n if( method_exists( $service, 'register' ) )\n $service->register();\n }\n }", "public static function register_services()\n {\n foreach ( self::get_services() as $class ) {\n $service = self::instantiate( $class );\n if ( method_exists( $service, 'register' ) ) {\n $service->register();\n }\n }\n }", "public static function register_services()\n {\n foreach (self::get_services() as $class) {\n $service = self::instantiate($class);\n if (method_exists($service, 'register')) {\n $service->register();\n }\n }\n }", "public function register_services() {\n\t\t// Bail early so we don't instantiate services twice.\n\t\tif ( ! empty( $this->services ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$classes = $this->get_service_classes();\n\n\t\t$this->services = array_map(\n\t\t\t[ $this, 'instantiate_service' ],\n\t\t\t$classes\n\t\t);\n\n\t\tarray_walk( $this->services, function ( Service $service ) {\n\t\t\t$service->register();\n\t\t} );\n\t}", "protected function registerServices()\r\n\t{\r\n\r\n\t\t$di = new FactoryDefault();\r\n\r\n\t\t$loader = new Loader();\r\n\r\n\t\t/**\r\n\t\t * We're a registering a set of directories taken from the configuration file\r\n\t\t */\r\n\t\t$loader->registerDirs(\r\n\t\t\tarray(\r\n\t\t\t\t__DIR__ . '/../apps/library/',\r\n\t\t\t\t__DIR__ . '/../apps/plugins/'\r\n\t\t\t)\r\n\t\t)->register();\r\n\r\n\r\n\r\n\t\t//Registering a router\r\n\t\t$di->set('router', function(){\r\n\r\n\t\t\t$router = new Router();\r\n\r\n\t\t\t$router->setDefaultModule(\"frontend\");\r\n\t\t\t$router->setDefaultController(\"index\");\r\n\t\t\t$router->setDefaultAction(\"index\");\r\n\r\n $router->add(\"/register/recoveryPassword\", array(\r\n 'module' => 'frontend',\r\n 'controller' => 'register',\r\n 'action' => 'recoveryPassword',\r\n ));\r\n $router->add(\"/register/index\", array(\r\n 'module' => 'frontend',\r\n 'controller' => 'register',\r\n 'action' => 'index',\r\n ));\r\n\r\n $router->add(\"/help/about\", array(\r\n 'module' => 'frontend',\r\n 'controller' => 'help',\r\n 'action' => 'about',\r\n ));\r\n\r\n\t\t\t\r\n\t\t\t$router->add(\"/ajax/getlast\", array(\r\n\t\t\t\t'module' => 'frontend',\r\n\t\t\t\t'controller' => 'ajax',\r\n\t\t\t\t'action' => 'getlast',\r\n\t\t\t));\r\n\t\t\t\r\n\t\t\t$router->add(\"/:controller/:action/:params\", array(\r\n\t\t\t\t'module' => 'frontend',\r\n\t\t\t\t'controller' => 1,\r\n\t\t\t\t'action' => 2,\r\n\t\t\t\t'params'=>3\r\n\t\t\t));\r\n\r\n\t\t\t$router->add(\"/admin/:controller/:action/:params\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 1,\r\n\t\t\t\t'action' => 2,\r\n\t\t\t\t'params'=>3\r\n\t\t\t));\r\n\r\n// $router->add(\"/admin/register\", array(\r\n// 'module' => 'backend',\r\n// 'controller' => 'register',\r\n// 'action' => 'index',\r\n// ));\r\n\r\n\t\t\t$router->add(\"/admin\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 'login',\r\n\t\t\t\t'action' => 'index',\r\n\t\t\t));\r\n\r\n\t\t\t$router->add(\"/admin/\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 'login',\r\n\t\t\t\t'action' => 'index',\r\n\t\t\t));\r\n\r\n\t\t\t$router->add(\"/admin/login\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 'login',\r\n\t\t\t\t'action' => 'index',\r\n\t\t\t));\r\n\r\n\r\n\r\n//\t\t\t$router->notFound(array(\r\n//\t\t\t\t\"controller\" => \"index\",\r\n//\t\t\t\t\"action\" => \"page404\",\r\n//\t\t\t));\r\n\r\n\t\t\treturn $router;\r\n\r\n\t\t});\r\n\r\n\t\t$this->setDI($di);\r\n\t}", "public static function register_services(): void\n {\n foreach (self::get_services() as $class) {\n $service = self::instantiate($class);\n if (method_exists($class, 'register')) {\n $service->register();\n }\n }\n }", "public function register()\n {\n $this->registerAuthenticator();\n }", "public function register()\n {\n Auth::extend('sso', function ($app, $name, array $config) {\n // 返回一个 Illuminate\\Contracts\\Auth\\Guard 实例...\n return new OaGuard(Auth::createUserProvider($config['provider']),$app->make('request'));\n });\n\n Auth::provider('sso', function ($app, array $config) {\n return new OaUserProvider();\n });\n }", "public function registerServices(DiInterface $di)\n {\n self::acl($di);\n }", "public function registerServices(){\n }", "protected function registerServiceProviders()\n {\n foreach ($this->providers as $provider) {\n $this->app->register($provider);\n }\n }", "protected function registerServices()\n {\n\n $di = new FactoryDefault();\n\n /**\n * Read services\n */\n include CORE_PATH . \"/config/services.php\";\n\n /**\n * Get config service for use in inline setup below\n */\n $config = $di->getConfig();\n\n\n include CORE_PATH . '/config/loader.php';\n\n \n\n $this->setDI($di);\n }", "public function register()\n {\n // Only Environment local\n if ($this->app->environment() !== 'production') {\n foreach ($this->services as $serviceClass) {\n $this->registerClass($serviceClass);\n }\n }\n\n // Register Aliases\n $this->registerAliases();\n }", "public function register()\n {\n $this->registerRequestHandler();\n $this->registerAuthorizationService();\n $this->registerServices();\n }", "public function register()\n {\n API::error(function (AuthorizationException $exception)\n {\n //如果出现权限异常,请先检查策略是否有再服务提供者中进行绑定\n abort(403, $exception->getMessage());\n });\n\n API::error(function (AuthenticationException $exception)\n {\n abort(401, $exception->getMessage());\n });\n }", "public function register()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/awesio-auth.php', 'awesio-auth');\n\n $this->app->singleton(AuthContract::class, Auth::class);\n\n $this->registerRepositories();\n\n $this->registerServices();\n\n $this->registerHelpers();\n }", "public function registerServices()\n {\n $this->app->bind('helpers.lib', function($app) {\n return new LibHelper;\n });\n $this->app->bind('helpers.theme', function($app) {\n return ThemeHelper::instance();\n });\n $this->app->bind('helpers.acf', function($app) {\n $helper = AcfHelper::instance();\n $helper->setThemeHelper($this->app['helpers.theme']);\n $helper->setLib($this->app['helpers.lib']);\n\n return $helper;\n });\n }", "protected function registerServiceProviders()\n {\n if ($this->active()->has('providers')) {\n $providers = $this->active()->get('providers');\n\n foreach ($providers as $provider) {\n App::register($provider);\n }\n }\n }", "public function registerDefaultServices()\n {\n /*\n * Add Paths to container\n */\n $this['basePath'] = $this->basePath();\n $this['storagePath'] = $this->basePath().'/storage';\n $this['appPath'] = $this->appPath();\n\n $this->register(new DefaultServices($this));\n\n $this->register(new ErrorHandlerService($this));\n\n // Enable debug based on user configuration\n if (true === $this->app->config->get('app')['debug']) {\n Debug::enable();\n }\n\n /*\n * retister View Provider\n */\n $this->register(new ViewServiceProvider($this));\n\n /*\n * Register Route Provider\n */\n $this->register(new RouteServiceProvider($this));\n\n /*\n * Register Database Provider\n */\n $this->register(new DatabaseServiceprovider($this));\n }", "public function registerServices()\n {\n /**\n * @var $container Container\n */\n $container = $this->getContainer();\n\n $services = $container->settings['services'];\n\n if (is_array($services) && !empty($services)) {\n foreach ($services as $service) {\n /**\n * @var $instance ServiceInterface\n */\n $instance = new $service();\n\n $container[$instance->name()] = $instance->register();\n\n unset($instance);\n }\n }\n\n unset($container, $services, $service);\n }", "public function register_services(): void {\n\t\t// Bail early so we don't instantiate services twice.\n\t\tif ( \\count( $this->service_container ) > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add the injector as the very first service.\n\t\t$this->service_container->put(\n\t\t\tstatic::SERVICE_PREFIX . static::INJECTOR_ID,\n\t\t\t$this->injector\n\t\t);\n\n\t\t$services = $this->get_service_classes();\n\n\t\tif ( $this->enable_filters ) {\n\t\t\t/**\n\t\t\t * Filter the default services that make up this plugin.\n\t\t\t *\n\t\t\t * This can be used to add services to the service container for\n\t\t\t * this plugin.\n\t\t\t *\n\t\t\t * @param array<string, string> $services Associative array of identifier =>\n\t\t\t * class mappings. The provided\n\t\t\t * classes need to implement the\n\t\t\t * Service interface.\n\t\t\t */\n\t\t\t$filtered_services = apply_filters(\n\t\t\t\tstatic::HOOK_PREFIX . static::SERVICES_FILTER,\n\t\t\t\t$services\n\t\t\t);\n\n\t\t\t$services = $this->validate_services( $filtered_services );\n\t\t}\n\n\t\twhile ( null !== key( $services ) ) {\n\t\t\t$id = $this->maybe_resolve( key( $services ) );\n\n\t\t\t$class = $this->maybe_resolve( current( $services ) );\n\n\t\t\t// Delay registering the service until all requirements are met.\n\t\t\tif (\n\t\t\t\tis_a( $class, HasRequirements::class, true )\n\t\t\t) {\n\t\t\t\tif ( ! $this->requirements_are_met( $id, $class, $services ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->schedule_potential_service_registration( $id, $class );\n\n\t\t\tnext( $services );\n\t\t}\n\t}", "public function boot()\n\t{\n\t\t$this->registerPolicies();\n\n\t\tAuth::provider('api_token', function($app, array $config) {\n\t\t\treturn new ApiTokenUserProvider();\n\t\t});\n\n\t\tAuth::extend('api_token', function ($app, $name, array $config) {\n\t\t\t$guard = new ApiTokenGuard(\n\t\t\t\tAuth::createUserProvider($config['provider']),\n\n\t\t\t\t$app['request'],\n\t\t\t\t$config['input_key'] ?? 'api_token',\n\t\t\t\t$config['storage_key'] ?? 'api_token',\n\t\t\t\t$config['hash'] ?? true\n\t\t\t);\n\n\t\t\treturn $guard;\n\t\t});\n\n\t\tAuth::provider('firebase', function($app, array $config) {\n\t\t\treturn new FirebaseUserProvider();\n\t\t});\n\n\t\tAuth::extend('firebase', function ($app, $name, array $config) {\n\t\t\t$guard = new FirebaseGuard(\n\t\t\t\tAuth::createUserProvider($config['provider']),\n\n\t\t\t\t$app['request'],\n\t\t\t\t$config['input_key'] ?? 'token',\n\t\t\t\t$config['storage_key'] ?? 'token',\n\t\t\t\t$config['hash'] ?? true\n\t\t\t);\n\n\t\t\treturn $guard;\n\t\t});\n\t}", "public function register()\n {\n $this->registerServices();\n }", "protected function registerBaseServices()\n {\n $container = $this->getContainer();\n\n $container->share('logger', function () use ($container) {\n return new Logger($container->get('config'));\n });\n\n $this->registerService(new Providers\\ConfigProvider());\n $this->registerService(new Providers\\FileSystemProvider());\n $this->registerService(new Providers\\ParserManagerProvider());\n $this->registerService(new Providers\\BackendProvider());\n }", "public function register()\n\t{\n\t\t$this->registerAuthInstall();\n\t}", "public function registerServices() {\n\t\t$services = Config::inst()->get('FakeManager', 'services');\n\t\tif($services) {\n\t\t\tforeach($services as $origName => $fakeName) {\n\t\t\t\t$fakeObj = Injector::inst()->create($fakeName);\n\t\t\t\tif($this->db && $fakeObj instanceof FakeDatabaseConsumerInterface) {\n\t\t\t\t\t$fakeObj->setDb($this->db);\n\t\t\t\t}\n\t\t\t\t$this->services[$origName] = $fakeObj;\n\t\t\t\tInjector::inst()->registerService($fakeObj, $origName);\n\t\t\t}\n\t\t}\n\t}", "public function boot(): void\n {\n $this->registerPolicies();\n\n Auth::provider('null', fn (Application $app, array $config) => new NullUserProvider($config['model'] ?? IAPUser::class));\n\n Auth::provider('list', fn (Application $app, array $config) => new ListUserProvider($config['model'] ?? IAPUser::class, $config['list'] ?? []));\n\n Auth::provider('group', fn (Application $app, array $config) => new GroupUserProvider($config['model'] ?? IAPUser::class, $config['group'] ?? ''));\n\n Auth::provider('identity-group', fn (Application $app, array $config) => new IdentityGroupUserProvider($config['model'] ?? IAPUser::class, $config['group'] ?? ''));\n\n $this->viaRequest('firebase', [Guard\\Firebase_Guard::class, 'validate']);\n\n $this->viaRequest('gae-internal', [Guard\\AppEngine_Guard::class, 'validate']);\n $this->viaRequest('gae-iap', [Guard\\IAP_Guard::class, 'validate']);\n $this->viaRequest('gae-oidc', [Guard\\OIDC_Guard::class, 'validate']);\n $this->viaRequest('gae-oauth2', [Guard\\OAuth2_Guard::class, 'validate']);\n\n $this->viaRequest('gae-combined-iap', [Guard\\Combined\\IAP_Guard::class, 'validate']);\n $this->viaRequest('gae-combined-iap-oidc', [Guard\\Combined\\IAP_OIDC_Guard::class, 'validate']);\n $this->viaRequest('gae-combined-iap-oidc-oauth2', [Guard\\Combined\\IAP_OIDC_OAuth2_Guard::class, 'validate']);\n }", "public function register()\n {\n $this->registerAccountService();\n\n $this->registerCurrentAccount();\n\n //$this->registerMenuService();\n\n //$this->registerReplyService();\n }", "public function register(): void\n {\n /* @phpstan-ignore-next-line */\n $this->app->configure('auth');\n /* @phpstan-ignore-next-line */\n $this->app->configure('remote-token-auth');\n\n config([\n 'auth.guards.rta' => array_merge([\n 'driver' => 'remote-token-auth',\n ], config('auth.guards.rta', [])),\n ]);\n\n $this->registerAdapter();\n }", "public function register()\n\t{\n\t\t$this->registerCommands();\n\t\t$this->registerHybridAuth();\n\t}", "public function register(): void\n {\n $this->configure();\n $this->registerServices();\n }", "public function boot()\n {\n $this->registerPolicies();\n $this->registerPassport();\n }", "public function register()\n {\n $this->registerServiceProviders();\n $this->registerSettingsService();\n $this->registerHelpers();\n }", "public function register(){\n $this->registerDependencies();\n $this->registerAlias();\n $this->registerServiceCommands();\n }", "public function boot()\n {\n require __DIR__ . '/helpers.php';\n\n $this->app['auth']->extend('custom', function ($app, $name, array $config) {\n $guard = new Guard($name, $app['auth']->createUserProvider($config['provider']), $app['session.store']);\n $guard->setCookieJar($app['cookie']);\n $guard->setDispatcher($app['events']);\n $guard->setRequest($app->refresh('request', $guard, 'setRequest'));\n\n return $guard;\n });\n\n $this->app['auth']->provider('custom', function ($app) {\n return new EloquentUserProvider(\n $app[Hasher::class],\n $app[UserRepository::class],\n $app[TeamRepository::class]\n );\n });\n\n $this->registerPolicies();\n }", "public function registerServices($di)\n\t{\n\n\t\t//Registering a dispatcher\n\t\t$di->set(Services::DISPATCHER, function () {\n\t\t\t$eventsManager = new EventsManager;\n\n\t\t\t/**\n\t\t\t * Check if the user is allowed to access certain action using the SecurityPlugin\n\t\t\t */\n\t\t\t$eventsManager->attach('dispatch:beforeDispatch', new APISecurityPlugin);\n\n\t\t\t$dispatcher = new \\Phalcon\\Mvc\\Dispatcher();\n\t\t\t$dispatcher->setDefaultNamespace(\"Multiple\\\\API\\\\Controllers\");\n\t\t\t$dispatcher->setEventsManager($eventsManager);\n\n\t\t\treturn $dispatcher;\n\t\t});\n\n\t\t/**\n\t\t * Setting up the view component\n\t\t */\n\t\t//Registering a shared view component\n\t\t$di->set(Services::VIEW, function() {\n\t\t\t$view = new \\Phalcon\\Mvc\\View();\n\t\t\t$view->setViewsDir(APP_PATH.'app/modules/api/views/');\n\t\t\t$view->registerEngines(array(\".volt\" => 'volt'));\n\t\t\treturn $view;\n\t\t});\n\n\t\t/**\n\t\t * Setting up volt\n\t\t */\n\t\t$di->set(Services::VOLT, function($view, $di) {\n\t\t\t$volt = new VoltEngine($view, $di);\n\n\t\t\t$volt->setOptions(array(\n\t\t\t\t\"compiledPath\" => APP_PATH . \"cache/api/\"\n\t\t\t));\n\n\t\t\t$compiler = $volt->getCompiler();\n\t\t\t$compiler->addFunction('is_a', 'is_a');\n\n\t\t\treturn $volt;\n\t\t}, true);\n\n\n\t\t$di->setShared(Services::AUTH_MANAGER, function () use ($di) {\n\n\t\t\t$authManager = new AuthenticateManager(60000);\n\t\t\t$authManager->registerAdaptor(MobileAdaptor::NAME, new MobileAdaptor());\n\t\t\t$authManager->registerTokenParser(new TokenParser(\"mysecret\"));\n\n\t\t\treturn $authManager;\n\t\t});\n\n\t\t/**\n\t\t * @description PhalconRest - \\League\\Fractal\\Manager\n\t\t */\n\t\t$di->setShared(Services::FRACTAL_MANAGER, function () {\n\n\t\t\t$fractal = new \\League\\Fractal\\Manager;\n\t\t\t$fractal->setSerializer(new CustomSerializer());\n\n\t\t\treturn $fractal;\n\t\t});\n\n\t\t/** @var \\Phalcon\\Http\\ResponseInterface $response */\n\t\t$response = $di->get('response');\n\t\t$response->setHeader('Access-Control-Allow-Origin', '*')\n\t\t\t->setContentType('application/json', 'utf-8');\n\n\t}", "protected function registerServices()\n {\n $this->singleton('request', function ($app) {\n return new Request($app);\n });\n\n $this->singleton('response', function ($app) {\n return new Response($app);\n });\n\n $this->singleton('route', function ($app) {\n return new Route($app);\n });\n\n $this->singleton('view', function ($app) {\n return new View($app);\n });\n\n $this->singleton('exception', function ($app) {\n return new Exception($app, $app->exception);\n });\n\n $this->singleton('crypt', function ($app) {\n return new Crypt($app->getSecret());\n });\n\n $this->singleton('cookie', function ($app) {\n return new Cookie($app, $app->getConfig('state')['cookie']);\n });\n\n $this->singleton('session', function ($app) {\n return new Session(new SessionDatabaseHandler($app, $app->getConfig('state')['session']));\n });\n\n return $this->factory();\n }", "protected function registerServiceProviders()\n {\n $this->register(\\Illuminate\\Events\\EventServiceProvider::class);\n if(is_array($providers = $this['config']['providers'])){\n foreach ($providers as $alias => $provider) {\n if (!is_int($alias)) {\n $this->services[$alias] = $provider;\n } else {\n $this->register($provider);\n }\n }\n }\n }", "public function register()\n {\n // $this->app->bind('AuthService', AuthService::class);\n }", "public function register()\n {\n\n $this->registerPermissionMerger();\n\n $this->registerPermissionChecker();\n\n $this->registerHasher();\n\n $this->registerTokenRepository();\n\n $this->registerUserProvider();\n\n $this->registerLoginValidator();\n\n $this->registerGroupRepository();\n\n $this->registerGroupManager();\n\n $this->registerUserRepository();\n\n $this->app->singleton('auth.driver', function($app)\n {\n return $app['auth']->guard();\n });\n\n }", "protected function registerServices()\n {\n $this->app->singleton('components', function($app) {\n $path = $app['config']->get('components.paths.components');\n\n return new Repository($app, $path);\n });\n }", "public function boot()\n {\n $this->registerPolicies();\n\n $headerParser = new AuthHeaders();\n auth()->parser()->setChain([$headerParser]);\n $this->app->forgetInstance('tymon.jwt.parser');\n $this->app->forgetInstance('tymon.jwt');\n $headerParser = new AuthHeaders();\n $headerParser->setHeaderPrefix('Device');\n auth('device')->parser()->setChain([$headerParser]);\n $this->app->forgetInstance('tymon.jwt.parser');\n $this->app->forgetInstance('tymon.jwt');\n $headerParser = new AuthHeaders();\n $headerParser->setHeaderPrefix('Authorizer');\n auth('authorizer')->parser()->setChain([$headerParser]);\n\n Gate::before(function (Authorizable $user, string $ability) {\n if ($user instanceof AuthorizableInterface) {\n return $user->hasPermissionTo($ability) ?: null;\n }\n });\n }", "protected function registerAuthenticator()\n {\n $this->app->singleton('auth', function ($app) {\n return new AuthManager($app);\n });\n }", "protected function loadServices()\n {\n $di = $this->getDI();\n\n // Register the dispatcher setting a Namespace for controllers\n $di->setShared('dispatcher', function () {\n\n\n $dispatcher = new Dispatcher();\n $dispatcher->setDefaultNamespace('Phalcana\\Controllers');\n\n $listener = new Dispatch;\n $events = new Manager();\n $events->attach('dispatch', $listener);\n $dispatcher->setEventsManager($events);\n\n return $dispatcher;\n });\n\n $di->setShared('router', $this->loadRoutes(new Router(false)));\n }", "public function register()\n {\n $this->app->when(PaypalController::class)\n ->needs(PaymentInterface::class)\n ->give(PaypalService::class);\n\n $this->app->when(StripeController::class)\n ->needs(PaymentInterface::class)\n ->give(StripeService::class);\n\n $this->app->when(SquarePayController::class)\n ->needs(PaymentInterface::class)\n ->give(SquarePayService::class);\n }", "private function providers()\n {\n $this->register(new CorsServiceProvider());\n $this->register(new HmacServiceProvider());\n }", "protected function registerServices()\n {\n $this->app->singleton('adminmenu', function () {\n return new Builder();\n });\n }", "public function boot()\n {\n $this->app->singleton('api.auth', function ($app) {\n return new AuthManager(new RequestTokenStorage($app->make('request')));\n });\n }", "private function registerAll()\n {\n $this->registerApp();\n $this->registerPsr();\n $this->registerRequests();\n $this->registerResponses();\n $this->registerPlugins();\n $this->registerCallables();\n $this->registerViews();\n $this->registerUtils();\n }", "public function boot()\n {\n $this->app->bind(\n AuthorizationInterface::class,\n User::class\n );\n }", "public function boot()\n {\n $this->app['auth']->extend('jwt', function ($app) {\n $bearerToken = $app['request']->server->getHeaders()['AUTHORIZATION'] ?? '';\n $tokenService = new TokenService();\n $guard = new JwtGuard($bearerToken, $tokenService);\n return $guard;\n });\n }", "public function register()\n {\n // Bind Credential Contract with Service\n $this->app->bind(Credentials::class, function ($app){\n return new CredentialsManger($app->make('filesystem.disk'), $app->make('encrypter'));\n });\n\n // Bind Caption Contract with Service\n $this->app->bind(Configuration::class, function ($app){\n return new ConfigurationManager($app->make('filesystem.disk'));\n });\n\n // Inject dependencies into Auth Service.\n $this->app->singleton(Post::class, function ($app){\n return new PostService(new Instagram(true, true), $app->make(Credentials::class));\n });\n\n // Inject Guzzle Into Reddit Service\n $this->app->singleton(Scraper::class, function ($app){\n return new ScraperService(new Client(['base_uri' => 'http://www.reddit.com']), $app->make(Configuration::class), $app->make('filesystem.disk'));\n });\n\n $this->app->bind(Caption::class, function ($app){\n return new CaptionManager($app->make('filesystem.disk'), $app->make('encrypter'));\n });\n }", "public function register()\n {\n /**\n * Register additional service\n * providers if they exist.\n */\n foreach ($this->providers as $provider) {\n if (class_exists($provider)) {\n $this->app->register($provider);\n }\n }\n }", "protected function registerServiceProviders()\n\t{\n\t\t// Core Bus\n\t\t// -----------------------------------------------------------------------------\n\t\t$this->app->register('Congraph\\Core\\Bus\\BusServiceProvider');\n\n\t\t// Core Event\n\t\t// -----------------------------------------------------------------------------\n\t\t$this->app->register('Congraph\\Core\\Events\\EventsServiceProvider');\n\n\t\t// Repositories\n\t\t// -----------------------------------------------------------------------------\n\t\t$this->app->register('Congraph\\Core\\Repositories\\RepositoriesServiceProvider');\n\t}", "public function boot()\n {\n Passport::routes(function ($router) {\n $router->forAuthorization();\n $router->forAccessTokens();\n //$router->forTransientTokens(); // the tokens we issue are permanent\n //$router->forClients(); // we don't want external applications using our oauth flows\n //$router->forPersonalAccessTokens(); // we don't have a user-facing API yet\n });\n\n $this->registerPolicies();\n\n Gate::define('use-permission', function ($user, $permission) {\n if ($user->hasRole('privacc') && config()->get('app.env') != 'production') {\n return true;\n }\n\n try {\n return auth()->user()->hasPermissionTo($permission);\n } catch (PermissionDoesNotExist $e) {\n return false;\n }\n });\n\n $this->serviceAccessGates();\n }", "public function register()\n\t{\n $this->registerApi();\n\t}", "protected function registerBaseServiceProviders()\n {\n $this->register(new EventServiceProvider($this));\n $this->register(new RouteServiceProvider($this));\n }", "public function register()\n {\n $this->app->bind('redhotmayo\\auth\\AuthorizationService', AuthorizationService::SERVICE);\n $this->app->bind('AuthorizationService', AuthorizationService::SERVICE);\n\n // Register 'api_authorizer' instance container to our ApiAuthorizer object\n $this->app['api_authorizer'] = $this->app->share(function($app)\n {\n $service = App::make('AuthorizationService');\n return new ApiAuthorizer($service);\n });\n\n // Shortcut so developers don't need to add an Alias in app/config/app.php\n $this->app->booting(function()\n {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n $loader->alias('ApiAuthorizer', 'redhotmayo\\api\\auth\\ApiAuthorizer');\n });\n }", "public function __construct()\n {\n $this->userService = Core::getService(UserService::class);\n $this->applicationService = Core::getService(ApplicationService::class);\n $this->libraryService = Core::getService(LibraryService::class);\n $this->middleware('auth');\n }", "public function register(): void\n\t{\n\t\t$this->mergeConfigFrom(__DIR__.'/../../config/larauthkit.php', 'larauthkit');\n\t\tif (config('larauthkit.authn.enable'))\n\t\t{\n\t\t\t$this->app->register(AuthkitEventServiceProvider::class);\n\t\t\t$this->app->register(AuthnServiceProvider::class);\n\t\t}\n\n\t\tif (config('larauthkit.authz.enable'))\n\t\t{\n\t\t\t$this->app->register(AuthzServiceProvider::class);\n\t\t}\n\t}", "protected function registerServices()\n {\n $this->app->singleton(\n 'adminmenu',\n function () {\n return new Builder();\n }\n );\n }", "public function boot()\n {\n $this->registerPolicies();\n\n app(AuthorizationServer::class)->enableGrantType(\n $this->makeExtensionGrant(), Passport::tokensExpireIn()\n );\n\n app(AuthorizationServer::class)->enableGrantType(\n $this->makeQRCodeGrant(), Passport::tokensExpireIn()\n );\n\n Passport::routes();\n\n Passport::tokensCan([\n 'create-dragons' => 'Create dragons',\n 'create-trees' => 'Create trees',\n 'create-child-accounts' => 'Create child accounts',\n 'update-child-accounts' => 'Update child accounts',\n 'update-profile' => 'Update profile',\n ]);\n }", "protected function registerBaseServiceProviders()\n {\n $this->register(new EventServiceProvider($this));\n $this->register(new LogServiceProvider($this));\n $this->register(new RoutingServiceProvider($this));\n }", "public function register(): void\n {\n $this->registerMultipleConfig();\n\n $this->registerProviders([\n Providers\\AuthServiceProvider::class,\n Providers\\RouteServiceProvider::class,\n ]);\n\n $this->registerCommands([\n InstallCommand::class,\n PublishCommand::class,\n ]);\n }", "public function register()\n {\n $this->registerBindings(collect($this->bindings));\n $this->registerFactories(collect($this->factories));\n $this->registerProviders(collect($this->providers));\n $this->registerSeeders(collect($this->seeders));\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(AuthServiceProvider::class);\n }", "public function register()\n\t{\n\t\t$this->app->bind(\n\t\t\t'Illuminate\\Contracts\\Auth\\Registrar',\n\t\t\t'StartMeUp\\Services\\Registrar'\n\t\t);\n\n\t\t$repositories = [\n\t\t\t'Company',\n\t\t];\n\t\tforeach ($repositories as $repository) {\n\t\t\t$this->bindRepository($repository);\n\t\t}\n\n\t}", "public function register()\n {\n $this->loadConfigs(['assets.php', 'permissions.php']);\n $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');\n\n $this->app->bind(Authentication::class, SentinelAuthentication::class);\n }", "public function boot(): void\n {\n $this->registerPolicies();\n }", "public function boot() {\n\t\t$this->registerPolicies();\n\n\t\tPassport::routes();\n\t\tPassport::tokensExpireIn(Carbon::now()->addMinutes(30));\n\t\tPassport::refreshTokensExpireIn(carbon::now()->addDays(30));\n\t\tPassport::personalAccessTokensExpireIn(Carbon::now()->addMonths(2));\n\n\t\t//Register implicit grant type\n\t\tPassport::enableImplicitGrant();\n\n\t\t//Scopes for api\n\t\tPassport::tokensCan(['purchase-product' => 'Create transactions for products',\n\t\t\t'manage-product' => 'Create, read, delete, update products',\n\t\t\t'manage-account' => 'Read account data if verified or is admin modify data but can not remove account',\n\t\t\t'read-general' => 'Read general information like purcahsing categories, selling proucts, your transactions etc',\n\t\t]);\n\t}", "public function boot()\n {\n $this->registerPolicies();\n\n Passport::routes(null, [\n 'prefix' => 'oauth'\n ]);\n\n Gate::define('upload_budgets', function ($user) {\n return $user->permissions()->where('key', 'upload_budgets')->count();\n });\n\n Gate::define('manage_categories', function ($user) {\n return $user->permissions()->where('key', 'manage_categories')->count();\n });\n\n Gate::define('manage_citizens', function ($user) {\n return $user->permissions()->where('key', 'manage_citizens')->count();\n });\n\n Gate::define('manage_shop-keepers', function ($user) {\n return $user->permissions()->where('key', 'manage_shop-keepers')->count();\n });\n\n Gate::define('manage_budgets', function ($user) {\n return $user->permissions()->where('key', 'manage_budgets')->count();\n });\n\n Gate::define('manage_vouchers', function ($user) {\n return $user->permissions()->where('key', 'manage_vouchers')->count();\n });\n\n Gate::define('manage_admins', function ($user) {\n return $user->permissions()->where('key', 'manage_admins')->count();\n });\n\n Gate::define('manage_permissions', function ($user) {\n return $user->permissions()->where('key', 'manage_permissions')->count();\n });\n\n Gate::define('manage_vouchers_transactions', function ($user) {\n return $user->permissions()->where('key', 'manage_vouchers_transactions')->count();\n });\n }", "public function boot()\n {\n $this->registerPolicies();\n\n Auth::extend('custom', function ($app, $name, array $config) {\n $guard = new CustomGuard($name, Auth::createUserProvider($config['provider']), $app['session.store']);\n\n if (method_exists($guard, 'setCookieJar')) {\n $guard->setCookieJar($this->app['cookie']);\n }\n\n if (method_exists($guard, 'setDispatcher')) {\n $guard->setDispatcher($this->app['events']);\n }\n\n if (method_exists($guard, 'setRequest')) {\n $guard->setRequest($this->app->refresh('request', $guard, 'setRequest'));\n }\n\n return $guard;\n });\n }", "public function boot()\n {\n $this->configureAuthorization();\n }", "public function register()\n {\n $this->app->routeMiddleware([\n 'auth' => Authenticate::class,\n ]);\n\n $this->app->router->group(['prefix' => 'api/xblock/auth', 'namespace' => 'XBlock\\Auth'], function ($router) {\n $router->post('/login', [\n 'uses' => 'Login@index',\n ]);\n $router->get('/user', [\n 'uses' => 'Login@getLoginUser',\n 'middleware' => 'auth'\n ]);\n });\n\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../database/migrations' => database_path('migrations'),\n ], 'xblock');\n $this->registerMigrations();\n $this->commands([\n CreateKey::class\n ]);\n }\n\n }", "public function boot()\n {\n app(AuthorizationServer::class)->enableGrantType(\n $this->makeFirebaseGrant(), Passport::tokensExpireIn()\n );\n }", "public function boot()\n {\n $this->app['auth']->viaRequest('api', function ($request) {\n if ($request->header('Authorization')) {\n $key = explode(' ',$request->header('Authorization'));\n\n $client = new Client();\n $response = $client->get(env('SERVICE_ADDRESS_USER').'/users/validate/'.$key[(count($key)-1)]);\n return $response->getStatusCode()==200;\n }\n });\n }", "public function register()\n {\n $this->app->singleton('forrest', function ($app) {\n\n // Config options\n $settings = config('forrest');\n $storageType = config('forrest.storage.type');\n $authenticationType = config('forrest.authentication');\n\n // Dependencies\n $httpClient = $this->getClient();\n $input = new LaravelInput(app('request'));\n $event = new LaravelEvent(app('events'));\n $encryptor = new LaravelEncryptor(app('encrypter'));\n $redirect = $this->getRedirect();\n $storage = $this->getStorage($storageType);\n\n $refreshTokenRepo = new RefreshTokenRepository($encryptor, $storage);\n $tokenRepo = new TokenRepository($encryptor, $storage);\n $resourceRepo = new ResourceRepository($storage);\n $versionRepo = new VersionRepository($storage);\n $instanceURLRepo = new InstanceURLRepository($tokenRepo, $settings);\n $stateRepo = new StateRepository($storage);\n\n $formatter = new JSONFormatter($tokenRepo, $settings);\n\n switch ($authenticationType) {\n case 'OAuthJWT':\n $forrest = new OAuthJWT(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n case 'WebServer':\n $forrest = new WebServer(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n case 'UserPassword':\n $forrest = new UserPassword(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n case 'UserPasswordSoap':\n $forrest = new UserPasswordSoap(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n default:\n $forrest = new WebServer(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n }\n\n return $forrest;\n });\n }", "public function boot(): void\n {\n $adapter = $this->app->make(AdapterInterface::class);\n\n /* @phpstan-ignore-next-line */\n $this->app['auth']->viaRequest(\n 'remote-token-auth',\n fn (Request $request): Authenticatable => $adapter->authorize($request)\n );\n }", "private function initializeServices()\n {\n $this->emailManager = $this->getService('mycp.service.email_manager');\n $this->translatorService = $this->getService('translator');\n $this->securityService = $this->getService('Secure');\n $this->router = $this->getService('router');\n }", "public function boot()\n {\n $this->app->register(UserServiceProvider::class);\n $this->app->register(DashboardServiceProvider::class);\n $this->app->register(CoreServiceProvider::class);\n $this->app->register(InstitutionalVideoServiceProvider::class);\n $this->app->register(InstitutionalServiceProvider::class);\n $this->app->register(TrainingServiceProvider::class);\n $this->app->register(CompanyServiceProvider::class);\n $this->app->register(LearningUnitServiceProvider::class);\n $this->app->register(PublicationServiceProvider::class);\n }", "private function registerAuthenticationRoutes(){\n $prefix = config('web-call-center.prefix');\n \\Route::group((!empty($prefix)? compact('prefix') : []) + ['namespace' => $this->namespace, 'middleware' => 'web'],\n __DIR__.'/../../routes/auth.php');\n }", "public function register()\n {\n $this->registerAdapterFactory();\n $this->registerDigitalOceanFactory();\n $this->registerManager();\n $this->registerBindings();\n }", "protected function registerServiceProviders()\n {\n foreach($this->providers as $provider)\n {\n // check if the provider class exists\n if (class_exists($provider))\n {\n // register this service provider, and Instantiate it.\n $service = new $provider($this);\n\n // check if the service provider has a boot method.\n if (method_exists($service, 'register')) {\n $service->register();\n }\n\n // save the active provider so that we can call it later.\n $this->activeProviders[$provider] = $service;\n }\n }\n }", "public function register()\n {\n $this->registerServices();\n $this->setupStubPath();\n $this->registerProviders();\n }", "public function register()\n { \n // User Repository\n $this->app->bind('App\\Contracts\\Repository\\User', 'App\\Repositories\\User');\n \n // JWT Token Repository\n $this->app->bind('App\\Contracts\\Repository\\JSONWebToken', 'App\\Repositories\\JSONWebToken');\n \n $this->registerClearSettleApiLogin();\n \n $this->registerClearSettleApiClients();\n \n \n }", "public function boot()\n {\n \n // Aqui você pode definir como deseja que os usuários sejam autenticados para o seu Lumen\n // application. O retorno de chamada que recebe a instância de solicitação recebida\n // deve retornar uma instância do usuário ou nulo. Você é livre para obter\n // a instância do usuário por meio de um token de API ou qualquer outro método necessário.\n\n $this->app['auth']->viaRequest('api', function ($request) {\n return \\App\\Aluno::where('email',$request->input('email'))->first();\n });\n }", "protected function registerGuard()\n {\n Auth::extend('passport', function ($app, $name, array $config) {\n return tap($this->makeGuard($config), function ($guard) {\n $this->app->refresh('request', $guard, 'setRequest');\n });\n });\n }", "public function register()\n {\n /**\n * Sets third party service providers that are only needed on local environments\n */\n if ($this->app->environment() == 'local') {\n /**\n * Loader for registering facades\n */\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n\n /**\n * Load third party local providers and facades\n */\n $this->app->register(\\Barryvdh\\Debugbar\\ServiceProvider::class);\n $loader->alias('Debugbar', \\Barryvdh\\Debugbar\\Facade::class);\n\n $this->app->register(\\Laracasts\\Generators\\GeneratorsServiceProvider::class);\n }\n $this->app->bind('soaClient', function ($app,$params) {\n $cloud = SOA::getInstance($params[0]);\n if($cloud->getEnv()){\n return $cloud;\n }\n $cloud->setEncodeType(true, true);\n $config = config('soa.'.$params[0]);\n $cloud->putEnv('app', $config['app']);\n $cloud->putEnv('appKey', $config['appKey']);\n $cloud->setServers($config['hosts']);\n return $cloud;\n });\n $this->app['request']->server->set('HTTPS', $this->app->environment() != 'local');\n }", "public function register()\n {\n // Register all repositories\n foreach ($this->repositories as $repository) {\n $this->app->bind(\"App\\Repository\\Contracts\\I{$repository}\",\n \"App\\Repository\\Repositories\\\\{$repository}\");\n }\n\n // Register all services\n foreach ($this->services as $service) {\n $this->app->bind(\"App\\Service\\Contracts\\I{$service}\", \n \"App\\Service\\Modules\\\\{$service}\");\n }\n }", "public function register()\n {\n $this->app->bind(ClientRepositoryInterface::class, function() {\n return new ClientRepository();\n });\n\n $this->app->bind(AccessTokenRepositoryInterface::class, function() {\n return new AccessTokenRepository();\n });\n\n $this->app->bind(ScopeRepositoryInterface::class, function() {\n return new ScopeRepository();\n });\n\n $this->app->bind(ResourceServer::class, function() {\n $accessTokenRespository = new AccessTokenRepository();\n $publicKey = base_path('public.key');\n return new ResourceServer($accessTokenRespository, $publicKey);\n });\n\n $this->app->bind(AuthorizationServer::class, function() {\n\n $clientRepository = new ClientRepository();\n $scopeRepository = new ScopeRepository();\n $accessTokenRepository = new AccessTokenRepository();\n $authCodeRepository = new AuthCodeRepository();\n $refreshTokenRepository = new RefreshTokenRepository();\n\n\n $privateKey = base_path('private.key');\n $publicKey = base_path('public.key');\n $userRepository = new UserRepository();\n $refreshTokenRepository = new RefreshTokenRepository();\n $intervaloPadrao = new \\DateInterval('P12M');\n\n\n $server = new AuthorizationServer($clientRepository, $accessTokenRepository, $scopeRepository, $privateKey, $publicKey);\n $server->enableGrantType(new ClientCredentialsGrant(), $intervaloPadrao);\n $server->enableGrantType(new PasswordGrant($userRepository, $refreshTokenRepository), $intervaloPadrao);\n\n $authGrant = new AuthCodeGrant($authCodeRepository, $refreshTokenRepository, $intervaloPadrao);\n $authGrant->setRefreshTokenTTL(new \\DateInterval('P12M'));\n \n \n $refreshGrant = new \\League\\OAuth2\\Server\\Grant\\RefreshTokenGrant($refreshTokenRepository);\n $refreshGrant->setRefreshTokenTTL(new \\DateInterval('P12M'));\n\n $server->enableGrantType($authGrant, $intervaloPadrao);\n $server->enableGrantType($refreshGrant, $intervaloPadrao);\n\n\n\n return $server;\n\n });\n\n }", "public function register()\n {\n // dynamically set the rootview based on whether the route is backend or frontend \n // can also be done in a middleware that wraps all admin routes\n if(request()->is('test-react/*')){\n Inertia::setRootView('react.app');\n } elseif(request()->is('test')){\n Inertia::setRootView('vue.app');\n } else {\n // some other\n }\n\n if ($this->app->environment() == 'local') {\n $this->app->register(\\Reliese\\Coders\\CodersServiceProvider::class);\n }\n $this->registerInertia();\n $this->registerWebSockets();\n }", "public function boot()\n {\n $this->registerPolicies();\n\n Passport::routes();\n }", "public function boot()\n {\n $this->registerPolicies();\n\n Passport::routes();\n }", "public function boot()\n {\n $this->registerPolicies();\n\n Passport::routes();\n }", "public function boot()\n {\n $this->registerPolicies();\n\n Passport::routes();\n }" ]
[ "0.72354007", "0.71589875", "0.7079502", "0.6915011", "0.68823606", "0.6849547", "0.68487203", "0.6807684", "0.6782182", "0.6766861", "0.66449594", "0.66097814", "0.66028416", "0.65698564", "0.6569168", "0.6555622", "0.6550605", "0.6517851", "0.6503696", "0.6492679", "0.6471543", "0.6463936", "0.6437321", "0.643384", "0.6416101", "0.6386294", "0.63676363", "0.63322383", "0.6326252", "0.6325428", "0.632307", "0.63217676", "0.6309716", "0.6303691", "0.62982434", "0.6275525", "0.6263754", "0.62415993", "0.6220332", "0.6219166", "0.6215988", "0.62055176", "0.6203277", "0.6196913", "0.6196411", "0.6196281", "0.61932474", "0.6191501", "0.6188979", "0.61807996", "0.6175563", "0.61553025", "0.6153619", "0.6142512", "0.6137761", "0.61283946", "0.61166877", "0.6113884", "0.610803", "0.61004806", "0.6098166", "0.60953325", "0.6070247", "0.6069801", "0.6052771", "0.6052644", "0.60419667", "0.60407966", "0.6040655", "0.60392773", "0.6039074", "0.60353637", "0.6034103", "0.6031141", "0.6028835", "0.6002994", "0.5998132", "0.599632", "0.598889", "0.59837914", "0.59833914", "0.5975715", "0.5970865", "0.59620434", "0.5960754", "0.5959848", "0.59488994", "0.59485096", "0.5942329", "0.59419394", "0.59394133", "0.5926749", "0.59116626", "0.5911011", "0.591075", "0.5903478", "0.5900551", "0.5898378", "0.5898378", "0.5898378", "0.5898378" ]
0.0
-1
/ Depending on the PostgreSQL bytea_output configuration parameter, data may be encoded either in the "hex" or "escape" format, which may be recognized by the '\x' prefix.
public function parseValue(string $extRepr) { if (substr($extRepr, 0, 2) == '\\x') { return hex2bin(substr($extRepr, 2)); } else { return pg_unescape_bytea($extRepr); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function php_compat_pg_escape_bytea($data)\n{\n return str_replace(\n array(chr(92), chr(0), chr(39)),\n array('\\\\\\134', '\\\\\\000', '\\\\\\047'),\n $data);\n}", "function escByteA($binData) {\n\t\t/**\n\t\t* \\134 = 92 = backslash, \\000 = 00 = NULL, \\047 = 39 = Single Quote\n\t\t*\n\t\t* str_replace() replaces the searches array in order.\n\t\t* Therefore, we must\n\t\t* process the 'backslash' character first. If we process it last, it'll\n\t\t* replace all the escaped backslashes from the other searches that came\n\t\t* before. tomATminnesota.com\n\t\t*/\n\t\t$search = array(chr(92), chr(0), chr(39));\n\t\t$replace = array('\\\\\\134', '\\\\\\000', '\\\\\\047');\n\t\t$binData = str_replace($search, $replace, $binData);\n\t\treturn $binData;\n\t}", "function BlobEncode($blob)\n\t{\n\t\tif (ADODB_PHPVER >= 0x5200) return pg_escape_bytea($this->_connectionID, $blob);\n\t\tif (ADODB_PHPVER >= 0x4200) return pg_escape_bytea($blob);\n\n\t\t/*92=backslash, 0=null, 39=single-quote*/\n\t\t$badch = array(chr(92),chr(0),chr(39)); # \\ null '\n\t\t$fixch = array('\\\\\\\\134','\\\\\\\\000','\\\\\\\\047');\n\t\treturn adodb_str_replace($badch,$fixch,$blob);\n\n\t\t// note that there is a pg_escape_bytea function only for php 4.2.0 or later\n\t}", "function encodeData($data)\n {\n if (is_array($data)) {\n /*\n * Traitement des tableaux\n */\n foreach ($data as $key => $value) {\n $data[$key] = $this->encodeData($value);\n }\n } else {\n /*\n * Traitement des chaines individuelles\n */\n if ($this->typeDatabase == 'pgsql') {\n if ($this->UTF8 && mb_detect_encoding($data) != \"UTF-8\") {\n $data = mb_convert_encoding($data, 'UTF-8');\n }\n $data = pg_escape_string($data);\n } else {\n $data = addslashes($data);\n }\n }\n return $data;\n }", "private static function sample_convert($data) {\n return implode(\"\\x1f\", $data);\n }", "public function aim_encode($data)\r\n\t{\r\n\t\treturn '\"' . preg_replace(\"/([\\\\\\}\\{\\(\\)\\[\\]\\$\\\"])/\", \"\\\\\\\\\\\\1\", $data) . '\"';\r\n\t}", "function prepareValue ($data)\n {\n return \"'\".pg_escape_string($data).\"'\";\n }", "function escape($data) {\n\t\tif ( !isset($data) ) return '';\n if ( is_numeric($data) ) return $data;\n\n $non_displayables = array(\n '/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15\n '/%1[0-9a-f]/', // url encoded 16-31\n '/[\\x00-\\x08]/', // 00-08\n '/\\x0b/', // 11\n '/\\x0c/', // 12\n '/[\\x0e-\\x1f]/' // 14-31\n );\n \n foreach ( $non_displayables as $regex )\n $data = preg_replace( $regex, '', $data );\n $search = array(\"\\\\\", \"\\x00\", \"\\n\", \"\\r\", \"'\", '\"', \"\\x1a\");\n $replace = array(\"\\\\\\\\\",\"\\\\0\",\"\\\\n\", \"\\\\r\", \"\\'\", '\\\"', \"\\\\Z\");\n\n return str_replace($search, $replace, $data);\n\t}", "public function escape($data) {\r\n\t\treturn $this->connection->real_escape_string ( $data );\r\n\t}", "public function quoteBinary(?string $value): string\n {\n if ($value===null || $value==='') return 'null';\n\n return '0x'.bin2hex($value);\n }", "function escape_data($data) {\n\n\tif (ini_get('magic_quotes_gpc')) {\t# Controllo se è attivata la modaltà Magic Quotes (che immette dei caratteri \"|\" prima di eventuali apici\n\t\t$data=stripslashes($data);\t# Tolgo i caratteri \"|\" inseriti da Magic Quotes con la funzione stripslashes\n\t\t}\n\treturn $data; # Ritorno la stringa formattata correttamente\n\t}", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "public function escape(&$data)\n {\n }", "public static function encode($data) {\n\t\treturn \"<?php\\n\\n\\$data = \" . var_export($data, true) . \";\\n\\n?>\\n\";\n\t}", "abstract function encode($data);", "abstract public function encode($data);", "public function _escape($data)\n {\n }", "function pg_set_client_encoding($connection = NULL, $encoding)\n{\n}", "public function escape($data) {\n return $this->wjdb->real_escape_string($data);\n }", "public function testThatEscapeDataWorksAsExpectedHashAlgoSha384() {\n // because \\RendererTest::$hash_algo_index will have a value of 1\n // see \\Rotexsoft\\FileRenderer::hash_algos() in ./tests/bootstrap.php\n \n $this->executeEscapeDataTests();\n }", "function sqlite_udf_decode_binary($data)\n{\n}", "public function _real_escape($data)\n {\n }", "abstract public static function encode($data): string;", "function escape_data ($data, $dbc) {\r\n\t\tif (get_magic_quotes_gpc()) {\r\n\r\n\t\t\t// Strip the slashes if Magic Quotes is on:\r\n\t\t\t$data = stripslashes($data);\r\n\r\n\t\t\t// Apply trim() and mysqli_real_escape_string():\r\n\t\t\treturn mysqli_real_escape_string ($dbc, trim($data));\r\n\t\t}\r\n\t}", "public function writeChar($byte){ }", "protected function _from_cdata_callback($match)\n\t{\n\t\treturn chr($match[1]);\n\t}", "public function escape($data)\n {\n }", "public function encode($data);", "public function encode($data);", "public function encode($data);", "public static function change_encoding($data, $input, $output)\n {\n }", "private function _dump($data)\n\t{\n\t\tfor ($i = 0; $i < strlen($data); $i++) {\n\t\t\techo sprintf('%02X', ord($data[$i])) . ' ';\n\t\t}\n\t}", "public function quote($value){\n $connection = $this -> connect();\n return pg_escape_literal($value);\n }", "function db_driver_escape($data)\n{\n global $_db;\n\n return '\\'' . str_replace('\\'', '\\'\\'', $data) . '\\'';\n}", "function javascript_to_binary ($texte) {\n\twhile (ereg(\"%([0-9A-F][0-9A-F])\", $texte, $regs))\n\t\t$texte = str_replace($regs[0],chr(hexdec($regs[1])), $texte);\n\treturn $texte;\n}", "public function encode(array $row): string\n {\n throw new \\RuntimeException(__CLASS__ . ' does not support data encoding');\n }", "public function testThatEscapeDataWorksAsExpectedHashAlgoSha512() {\n // because \\RendererTest::$hash_algo_index will have a value of 0\n // see \\Rotexsoft\\FileRenderer::hash_algos() in ./tests/bootstrap.php\n \n $this->executeEscapeDataTests();\n }", "public function convertDatabaseToUTF8();", "public function _weak_escape($data)\n {\n }", "abstract public function barcode($data, $format);", "public static function encodeData($data)\n {\n if (preg_match('/[<>&]/', $data)) {\n $data = '<![CDATA[' . $data . ']]>';\n }\n\n $data = preg_replace('/\"/', '\\\"', $data);\n\n return $data;\n }", "private function hex2bin($data){\n $encoded = '';\n $data_arr = str_split($data, 2);\n\n foreach($data_arr as $val){\n $binary = base_convert($val, 16, 2);\n $encoded .= str_pad($binary, 8, '0', STR_PAD_LEFT);\n }\n return $encoded;\n }", "public function testSaveDataTableSpecialCharsInValues() {\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testGetDataTable 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => '°!\"§$%&/()=?`*\\'>; :_+öä#<,.-²³¼¹½¬{[]}\\\\¸~’–…·|@\\t\\r\\n'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testGetDataTable 3']\r\n ];\r\n\t\t// Create datatable and store it into the database\r\n\t\t$datatable = new avorium_core_data_DataTable(3, 4);\r\n\t\t$datatable->setHeader(0, 'UUID');\r\n\t\t$datatable->setHeader(1, 'BOOLEAN_VALUE');\r\n\t\t$datatable->setHeader(2, 'INT_VALUE');\r\n\t\t$datatable->setHeader(3, 'STRING_VALUE');\r\n\t\tfor ($i = 0; $i < 3; $i++) {\r\n\t\t\t$datatable->setCellValue($i, 0, $records[$i]['UUID']);\r\n\t\t\t$datatable->setCellValue($i, 1, $records[$i]['bool']);\r\n\t\t\t$datatable->setCellValue($i, 2, $records[$i]['int']);\r\n\t\t\t$datatable->setCellValue($i, 3, $records[$i]['string']);\r\n\t\t}\r\n\t\t$this->getPersistenceAdapter()->saveDataTable('POTEST', $datatable);\r\n\t\t// Read the records via SQL and check their contents.\r\n\t\t// Let them return the results ordered. Mybe the persistence adapter \r\n\t\t// uses bulk save methods which store the records in a different order\r\n\t\t$result = $this->executeQuery('select UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE from POTEST order by UUID');\r\n\t\t$this->assertEquals(3, count($result), 'Wrong row count');\r\n\t\tfor ($i = 0; $i < 3; $i++) {\r\n\t\t\t$this->assertEquals($records[$i]['UUID'], $result[$i]['UUID'], 'UUID from database is not as expected.');\r\n\t\t\t$this->assertEquals($records[$i]['bool']?1:0, $result[$i]['BOOLEAN_VALUE'], 'Boolean value from database is not as expected.');\r\n\t\t\t$this->assertEquals($records[$i]['int'], $result[$i]['INT_VALUE'], 'Boolean value from database is not as expected.');\r\n\t\t\t$this->assertEquals($records[$i]['string'], $result[$i]['STRING_VALUE'], 'Boolean value from database is not as expected.');\r\n\t\t}\r\n\t}", "function pg_client_encoding($connection = null): string\n{\n error_clear_last();\n if ($connection !== null) {\n $result = \\pg_client_encoding($connection);\n } else {\n $result = \\pg_client_encoding();\n }\n if ($result === false) {\n throw PgsqlException::createFromPhpError();\n }\n return $result;\n}", "public function encodeBlob( $b ) {\n\t\treturn $b;\n\t}", "function escape_data ($data) {\n global $dbc;\n if (ini_get('magic_quotes_gpc')) {\n $data = stripslashes($data);\n }\n return mysql_real_escape_string (trim ($data), $dbc);\n}", "function handlerCharacterData($a_xml_parser, $a_data)\n\t{\n\t\t// i don't know why this is necessary, but\n\t\t// the parser seems to convert \"&gt;\" to \">\" and \"&lt;\" to \"<\"\n\t\t// in character data, but we don't want that, because it's the\n\t\t// way we mask user html in our content, so we convert back...\n\t\t$a_data = str_replace(\"<\",\"&lt;\",$a_data);\n\t\t$a_data = str_replace(\">\",\"&gt;\",$a_data);\n\n\t\t// DELETE WHITESPACES AND NEWLINES OF CHARACTER DATA\n\t\t$a_data = preg_replace(\"/\\n/\",\"\",$a_data);\n\t\t$a_data = preg_replace(\"/\\t+/\",\"\",$a_data);\n\t\tif(!empty($a_data))\n\t\t{\n\t\t\t$this->cdata .= $a_data;\n\t\t}\n\t}", "private function quote( )\n {\n if ( @ count( $this->data_buffer ) == 0 )\n return;\n foreach ( $this->data_buffer as $key => $val )\n {\n if ( in_array( $key, $this->string_fields ))\n $this->data_buffer[$key] = @\"'\".mysql_real_escape_string($val,underQL::$db_handle).\"'\";\n else\n $this->data_buffer[$key] = $val;\n }\n }", "function escape_data($data){\n\tglobal $dbc; //Need the connection\n\tif (ini_get('magic_quotes_gpc')) {\n\t\t$data = stripslashes($data);\n\t}\n\t\t\n\t// global $dbc;\n\n\treturn mysqli_real_escape_string($dbc, trim($data));\n}", "public function bytes();", "function handle_blob_command($command) {\n $mark = $this->checkAndGet($command, 'mark', FALSE);\n $data = $this->checkAndGet($command, 'data');\n $output = \"blob\\n\";\n $output .= $this->handleMark($mark);\n $output .= $this->handleData($data);\n return $output;\n }", "function db_driver_unescape($data)\n{\n global $_db;\n\n $data = regexp_replace('(^\\'|\\'$)', '', $data);\n $data = str_replace('\\'\\'', '\\'', $data);\n\n return $data;\n}", "public static function tohex($data, $bin2hex=true) {\n $data = (is_object($data) || is_array($data)) ? json_encode($data) : $data;\n if (! is_string($data)) return 0;\n\n if($bin2hex) return bin2hex(gzcompress($data));\n else\n {\n $len = strlen($data);\n if ($len % 2) return 0;\n else if (strspn($data, '0123456789abcdefABCDEF') != $len) return 0;\n $data = pack('H*', $data);\n return gzuncompress($data);\n }\n }", "public function create_from_binary_data($data);", "public function testThatEscapeDataWorksAsExpectedHashAlgoSha1() {\n // because \\RendererTest::$hash_algo_index will have a value of 3\n // see \\Rotexsoft\\FileRenderer::hash_algos() in ./tests/bootstrap.php\n \n $this->executeEscapeDataTests();\n }", "public function text_or_binary()\n {\n }", "public function jsQuoteEscapeDataAttribute($data)\r\n\t{\r\n\t\treturn str_replace(array(chr(34), chr(39)),array('&quot;','&apos;'),$data);\r\n\t}", "private function utf8Encode($data)\n {\n return $data;\n /*\n * if (is_array ( $data )) {\n * foreach ( $data as $key => $value ) {\n * $data [$key] = $this->utf8Encode ( $value );\n * }\n * } else {\n * $data = utf8_encode ( $data );\n * }\n * return $data;\n */\n }", "public function escape($value) {\n\t\treturn ($this->connection)\n\t\t\t? pg_escape_string($this->connection, $value)\n\t\t\t: pg_escape_string($value);\n\t}", "public function testThatEscapeDataWorksAsExpectedHashAlgoSha256() {\n // because \\RendererTest::$hash_algo_index will have a value of 2\n // see \\Rotexsoft\\FileRenderer::hash_algos() in ./tests/bootstrap.php\n \n $this->executeEscapeDataTests();\n }", "protected function _from_cdata($data)\n\t{\n\t\t// Get the HTML translation table and reverse it\n\t\t$trans_tbl = array_flip(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES));\n\n\t\t// Translate all the entities out.\n\t\t$data = preg_replace_callback('~&#(\\d{1,4});~', function ($match) {\n\t\t\treturn $this->_from_cdata_callback($match);\n\t\t}, $data);\n\t\t$data = strtr($data, $trans_tbl);\n\n\t\treturn $this->trim ? trim($data) : $data;\n\t}", "private function _hex2bin ($data)\r\n\t{\r\n\t\t$len = strlen ($data);\r\n\t\treturn pack (\"H\" . $len, $data);\r\n\t}", "public function getEncoded();", "function handleData($data) {\n return sprintf(\"data %d\\n%s\\n\", strlen($data), $data);\n }", "function escape($data){\r\n\t\t\tglobal $link;\r\n\t\t\treturn mysqli_real_escape_string($link, $data);\r\n\t\t}", "function _wp_kses_decode_entities_chr_hexdec($matches)\n {\n }", "public function byteValue($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "function sanitize_data_oracle($text)\n{\n//\tpreg_match_all('/[\\0\\n\\t\\r\\b\\f\\'\"\\/\\\\\\]/', $text, $matches);\n\t$data = preg_split('/[\\0\\b\\f\\'\\/]/', $text);\n\tpreg_match_all('/[\\0\\r\\b\\f\\'\\/]/', $text, $matches);\n\n\t$val = array();\n\n\tforeach ($data as $value)\n\t{\n\t\tif (strlen($value))\n\t\t{\n\t\t\t$val[] = \"'\" . $value . \"'\";\n\t\t}\n\t\tif (count($matches[0]))\n\t\t{\n\t\t\t$val[] = 'chr(' . ord(array_shift($matches[0])) . ')';\n\t\t}\n\t}\n\n\treturn implode('||', $val);\n}", "abstract public function encode();", "public function is_binary($text)\n {\n }", "private static function decodeFilterASCIIHexDecode($data){\n\t\t// intialize string to return\n\t\t$decoded = '';\n\t\t// all white-space characters shall be ignored\n\t\t$data = preg_replace('/[\\s]/', '', $data);\n\t\t// check for EOD character: GREATER-THAN SIGN (3Eh)\n\t\t$eod = strpos($data, '>');\n\t\tif($eod !== false){\n\t\t\t// remove EOD and extra data (if any)\n\t\t\t$data = substr($data, 0, $eod);\n\t\t\t$eod = true;\n\t\t}\n\t\t// get data length\n\t\t$data_length = strlen($data);\n\t\tif(($data_length % 2) != 0){\n\t\t\t// odd number of hexadecimal digits\n\t\t\tif($eod){\n\t\t\t\t// EOD shall behave as if a 0 (zero) followed the last digit\n\t\t\t\t$data = substr($data, 0, -1) . '0' . substr($data, -1);\n\t\t\t} else {\n\t\t\t\t$this->Error('decodeASCIIHex: invalid code');\n\t\t\t}\n\t\t}\n\t\t// check for invalid characters\n\t\tif(preg_match('/[^a-fA-F\\d]/', $data) > 0){\n\t\t\t$this->Error('decodeASCIIHex: invalid code');\n\t\t}\n\t\t// get one byte of binary data for each pair of ASCII hexadecimal digits\n\t\t$decoded = pack('H*', $data);\n\t\treturn $decoded;\n\t}", "static function altJsonEncode($data)\n {\n return str_replace(\"'\", \"&#39;\", json_encode($data));\n }", "function utf8_encode($data)\n{\n}", "public function punyencodeAddress($address)\n {\n }", "function sql_encode_decode($input, $do_encode = true)\n {\n\n if ($do_encode === true)\n {\n $input = stripslashes($input);\n $input = htmlspecialchars($input);\n //$input = decode_htmlentities($input);\n //$input = $sql_code->encode($input);\n }\n else\n {\n //$input = $sql_code->decode($input);\n //$input = htmlentities($input);\n }\n\n return $input;\n }", "function checkRealEscapeString($value);", "function escape_data ($data) {\n\n // Need the connection:\n global $mysqli;\n\n // Address Magic Quotes.\n if (ini_get('magic_quotes_gpc')) {\n $data = stripslashes($data);\n }\n\n // Trim and escape:\n return mysqli_real_escape_string($mysqli, trim($data));\n\n }", "public static function test_input($data) {\r\n $data = trim($data);\r\n //This PHP function returns a string with backslashes in front of each character that needs to be quoted in a database query\r\n $data = addslashes($data);\r\n //The htmlspecialchars() function converts some predefined characters to HTML entities.\r\n //Translates: <script>location.href('http://www.hacked.com')</script> \r\n //To: &lt;script&gt;location.href('http://www.hacked.com')&lt;/script&gt;\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n }", "function bitadma_get_admarula_tmt_data_hex( $raw_data, $pattern ) {\n\n\t// pattern\n\t$matches = array();\n\t$has_match = preg_match( $pattern, $raw_data, $matches );\n\n\t// return match or false.\n\tif ( $has_match ) {\n\t\tif (isset($matches[1])) {\n\n\t\t\treturn bitadma_strip_whitespace($matches[1]);\n\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t} else {\n\t\treturn false;\n\t}\n\n}", "function escape_data ($strData) {\n // Besoin de la connexion:\n $GLOBALS[\"objConnMySQLi\"];\n // Verifier Magic Quotes.\n if (ini_get('magic_quotes_gpc')) {\n $strData = stripslashes($strData);\n }\n // Trim et escape:\n return mysqli_real_escape_string($GLOBALS[\"objConnMySQLi\"], trim($strData));\n }", "public static function IPv6Hex2BinDataProviderCorrect() {}", "public function testUtf8(): void\n {\n $value = mb_convert_encoding(\"\\xa0a\\xa0\", 'UTF-8', 'ISO-8859-1');\n self::assertSame('a', $this->filter->filter($value));\n }", "public function quotedata(&$data)\n\t{\n\t\t/* Change Unix (\\n) and Mac (\\r) linefeeds into\n\t\t * Internet-standard CRLF (\\r\\n) linefeeds. */\n\t\t$data = preg_replace(array('/(?<!\\r)\\n/','/\\r(?!\\n)/'), \"\\r\\n\", $data);\n\n\t\t/* Because a single leading period (.) signifies an end to the\n\t\t * data, legitimate leading periods need to be \"doubled\"\n\t\t * (e.g. '..'). */\n\t\t$data = str_replace(\"\\n.\", \"\\n..\", $data);\n\t}", "function _json_encode($data) {\n\t\treturn json_encode($data);\n\t\treturn json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP);\n\t}", "public function escape($string) {\n\t\treturn $this->_utf8ToHex($string);\n\t}", "public static function toUTF8($obj, $data_codepage = null)\n\t{\n\t\t// Array || object\n\t\tif(is_array($obj) || is_object($obj)){\n\t\t\tforeach($obj as $key => &$val){\n\t\t\t\t$val = self::toUTF8($val, $data_codepage);\n\t\t\t}\n\t\t\tunset($key, $val);\n\t\t\t\n\t\t\t//String\n\t\t}else{\n\t\t\tif(!preg_match('//u', $obj) && function_exists('mb_detect_encoding') && function_exists('mb_convert_encoding')){\n\t\t\t\t$encoding = mb_detect_encoding($obj);\n\t\t\t\t$encoding = $encoding ? $encoding : $data_codepage;\n\t\t\t\tif($encoding)\n\t\t\t\t\t$obj = mb_convert_encoding($obj, 'UTF-8', $encoding);\n\t\t\t}\n\t\t}\n\t\treturn $obj;\n\t}", "public function escape_by_ref(&$data)\n {\n }", "function html_to_utf8 ($data)\r\n {\r\n return preg_replace(\"/\\\\&\\\\#([0-9]{3,10})\\\\;/e\", '_html_to_utf8(\"\\\\1\")', $data);\r\n }", "function pg_connect_escape($string) {\n\treturn addcslashes($string, \"'\\\\\");\n}", "public function writeUnsignedChar($byte){ }", "public function fnReadEscapedChar($bInTemplate) \n {\n $iCh = Utilities::fnGetCharAt($this->sInput, ++$this->iPos);\n \n ++$this->iPos;\n \n switch ($iCh) {\n case 110: return \"\\n\"; // 'n' -> '\\n'\n case 114: return \"\\r\"; // 'r' -> '\\r'\n case 120: return Utilities::fnUnichr($this->fnReadHexChar(2)); // 'x'\n case 117: return $this->fnCodePointToString($this->fnReadCodePoint()); // 'u'\n case 116: return \"\\t\"; // 't' -> '\\t'\n case 98: return \"\\b\"; // 'b' -> '\\b'\n case 118: return \"\\x{000b}\"; // 'v' -> '\\u000b'\n case 102: return \"\\f\"; // 'f' -> '\\f'\n case 13: \n if (Utilities::fnGetCharAt($this->sInput, $this->iPos) == 10) \n ++$this->iPos; // '\\r\\n'\n case 10: // ' \\n'\n if ($this->aOptions['locations']) { \n $this->iLineStart = $this->iPos;\n ++$this->iCurLine;\n }\n return \"\";\n default:\n if ($iCh >= 48 && $iCh <= 55) {\n preg_match(\"/^[0-7]+/\", mb_substr($this->sInput, $this->iPos - 1, 3), $aMatches);\n $sOctalStr = $aMatches[0];\n $iOctal = intval($sOctalStr, 8);\n if ($iOctal > 255) {\n $sOctalStr = mb_substr($sOctalStr, 0, mb_strlen($sOctalStr)-1);\n $iOctal = intval($sOctalStr, 8);\n }\n $this->iPos += mb_strlen($sOctalStr) - 1;\n $iCh = Utilities::fnGetCharAt($this->sInput, $this->iPos);\n if (($sOctalStr != \"0\" || $iCh == 56 || $iCh == 57) && ($this->bStrict || $bInTemplate)) {\n $this->fnInvalidStringToken(\n $this->iPos - 1 - mb_strlen($sOctalStr),\n $bInTemplate\n ? \"Octal literal in template string\"\n : \"Octal literal in strict mode\"\n );\n }\n return Utilities::fnUnichr($iOctal);\n }\n return Utilities::fnUnichr($iCh);\n }\n }", "function getEncoding($conn)\n\t{\n\t\treturn pg_client_encoding($conn);\n\t}", "function encode($data) {\n $format = $this->params['xformat'];\n $format_method = \"encode_{$format}\";\n if (!method_exists($this, $format_method)) throw new xException(\"REST format output not available: {$format}\", 501);\n $output = $this->$format_method($data);\n // Recodes output stream if necessary\n if ($this->encoding != 'UTF-8') {\n $output = iconv('UTF-8', \"{$this->encoding}//TRANSLIT\", $output);\n }\n // Returns output\n return $output;\n }", "abstract protected function outputInternal(string $transformedData);", "public static function dataEscapeArguments(): array\n {\n return [\n // empty argument - must be quoted\n 'empty' => ['', '\"\"', \"''\"],\n\n // null argument - must be quoted\n 'empty null' => [null, '\"\"', \"''\"],\n\n // false argument - must be quoted\n 'empty false' => [false, '\"\"', \"''\"],\n\n // unix single-quote must be escaped\n 'unix-sq' => [\"a'bc\", \"a'bc\", \"'a'\\\\''bc'\"],\n\n // new lines must be replaced\n 'new lines' => [\"a\\nb\\nc\", '\"a b c\"', \"'a\\nb\\nc'\"],\n\n // whitespace <space> must be quoted\n 'ws space' => ['a b c', '\"a b c\"', \"'a b c'\"],\n\n // whitespace <tab> must be quoted\n 'ws tab' => [\"a\\tb\\tc\", \"\\\"a\\tb\\tc\\\"\", \"'a\\tb\\tc'\"],\n\n // no whitespace must not be quoted\n 'no-ws' => ['abc', 'abc', \"'abc'\"],\n\n // commas must be quoted\n 'comma' => ['a,bc', '\"a,bc\"', \"'a,bc'\"],\n\n // double-quotes must be backslash-escaped\n 'dq' => ['a\"bc', 'a\\^\"bc', \"'a\\\"bc'\"],\n\n // double-quotes must be backslash-escaped with preceding backslashes doubled\n 'dq-bslash' => ['a\\\\\"bc', 'a\\\\\\\\\\^\"bc', \"'a\\\\\\\"bc'\"],\n\n // backslashes not preceding a double-quote are treated as literal\n 'bslash' => ['ab\\\\\\\\c\\\\', 'ab\\\\\\\\c\\\\', \"'ab\\\\\\\\c\\\\'\"],\n\n // trailing backslashes must be doubled up when the argument is quoted\n 'bslash dq' => ['a b c\\\\\\\\', '\"a b c\\\\\\\\\\\\\\\\\"', \"'a b c\\\\\\\\'\"],\n\n // meta: outer double-quotes must be caret-escaped as well\n 'meta dq' => ['a \"b\" c', '^\"a \\^\"b\\^\" c^\"', \"'a \\\"b\\\" c'\"],\n\n // meta: percent expansion must be caret-escaped\n 'meta-pc1' => ['%path%', '^%path^%', \"'%path%'\"],\n\n // meta: expansion must have two percent characters\n 'meta-pc2' => ['%path', '%path', \"'%path'\"],\n\n // meta: expansion must have have two surrounding percent characters\n 'meta-pc3' => ['%%path', '%%path', \"'%%path'\"],\n\n // meta: bang expansion must be double caret-escaped\n 'meta-bang1' => ['!path!', '^^!path^^!', \"'!path!'\"],\n\n // meta: bang expansion must have two bang characters\n 'meta-bang2' => ['!path', '!path', \"'!path'\"],\n\n // meta: bang expansion must have two surrounding ang characters\n 'meta-bang3' => ['!!path', '!!path', \"'!!path'\"],\n\n // meta: caret-escaping must escape all other meta chars (triggered by double-quote)\n 'meta-all-dq' => ['<>\"&|()^', '^<^>\\^\"^&^|^(^)^^', \"'<>\\\"&|()^'\"],\n\n // other meta: no caret-escaping when whitespace in argument\n 'other meta' => ['<> &| ()^', '\"<> &| ()^\"', \"'<> &| ()^'\"],\n\n // other meta: quote escape chars when no whitespace in argument\n 'other-meta' => ['<>&|()^', '\"<>&|()^\"', \"'<>&|()^'\"],\n ];\n }", "public function testSaveDataTableSpecialCharsInTableName() {\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testGetDataTable 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testGetDataTable 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testGetDataTable 3']\r\n ];\r\n\t\t// Create datatable and store it into the database\r\n\t\t$datatable = new avorium_core_data_DataTable(3, 4);\r\n\t\t$datatable->setHeader(0, 'UUID');\r\n\t\t$datatable->setHeader(1, 'BOOLEAN_VALUE');\r\n\t\t$datatable->setHeader(2, 'INT_VALUE');\r\n\t\t$datatable->setHeader(3, 'STRING_VALUE');\r\n\t\tfor ($i = 0; $i < 3; $i++) {\r\n\t\t\t$datatable->setCellValue($i, 0, $records[$i]['UUID']);\r\n\t\t\t$datatable->setCellValue($i, 1, $records[$i]['bool']);\r\n\t\t\t$datatable->setCellValue($i, 2, $records[$i]['int']);\r\n\t\t\t$datatable->setCellValue($i, 3, $records[$i]['string']);\r\n\t\t}\r\n $this->setExpectedException('Exception', 'Invalid table name given: °!\"§$%&/()=?`*\\'>; :_+öä#<,.-²³¼¹½¬{[]}\\\\¸~’–…·|@\\t\\r\\n');\r\n\t\t$this->getPersistenceAdapter()->saveDataTable('°!\"§$%&/()=?`*\\'>; :_+öä#<,.-²³¼¹½¬{[]}\\\\¸~’–…·|@\\t\\r\\n', $datatable);\r\n\t}", "public function encodeEncodesCorrectlyDataProvider() {}" ]
[ "0.76556927", "0.6882429", "0.5864207", "0.56274456", "0.54919904", "0.54556006", "0.54482746", "0.5421804", "0.5417485", "0.54032284", "0.53092694", "0.52839684", "0.52824676", "0.52824676", "0.52824676", "0.52824676", "0.5258293", "0.5241531", "0.5238199", "0.52213067", "0.5207187", "0.5200562", "0.5196405", "0.5191387", "0.5181997", "0.51809216", "0.5180053", "0.51304543", "0.5130332", "0.51235545", "0.51232845", "0.51187325", "0.51187325", "0.51187325", "0.511478", "0.5063065", "0.50567913", "0.5047183", "0.5041953", "0.50370485", "0.5027581", "0.50229543", "0.5021512", "0.50209236", "0.5017884", "0.5011037", "0.49810186", "0.4976647", "0.4968893", "0.4936274", "0.49302053", "0.49230906", "0.49212673", "0.491389", "0.48960415", "0.48958802", "0.4895159", "0.48864383", "0.48847222", "0.48654935", "0.48284936", "0.4824016", "0.4822998", "0.48204064", "0.47906604", "0.47827837", "0.47812116", "0.4779713", "0.4773164", "0.47538438", "0.47452798", "0.4739769", "0.47353783", "0.4732495", "0.47308618", "0.47234723", "0.4723291", "0.47062555", "0.4706251", "0.47004336", "0.46985745", "0.46974742", "0.46772864", "0.4669282", "0.4663207", "0.4660647", "0.466062", "0.46577474", "0.46543977", "0.46504977", "0.46431747", "0.4641974", "0.46314624", "0.4625308", "0.46214402", "0.46194458", "0.46177784", "0.46173903", "0.46105078", "0.4609559", "0.46095192" ]
0.0
-1
This function select all the users in the BD.
function get_All_Users() { try { include("model.php"); $sql = "SELECT nomJoueur, mdpJoueur FROM joueurs"; // Preparation de la requete $req = $pdo->prepare($sql); // execution de la requete $req->execute(); return $req->fetchAll(PDO::FETCH_OBJ); } catch (PDOException $e) { echo $e->getMessage(); die("<br /> Erreur dans la BDD "); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function selectAllUser(){\n return $this->connect->getData(\"SELECT * FROM `tbl_register_user`\");\n }", "public function allUsers()\n {\n // $sql = 'SELECT * FROM '.$db_name;\n return $this->queryAll();\n }", "public function selectAll(){\r\n $query = 'SELECT * FROM user_tbl';\r\n $stmt = $this->_db->prepare($query);\r\n $stmt->execute();\r\n $users = $stmt->fetchAll(PDO::FETCH_OBJ);\r\n foreach ($users as $user){\r\n echo $user->username.\"<br>\";\r\n }\r\n }", "public function fetchAllUserSelect() {\n try {\n // Select all users\n $query = \"\n select id, email, username\n from tb_user \n where state = 1 and access = 1\n order by username\n \";\n // Create object to connect to MySQL using PDO\n $mysqlPDO = new MySQLPDO();\n // Prepare the query\n $statement = $mysqlPDO->getConnection()->prepare($query);\n // Execute the query without paramters\n $statement->execute();\n // Get affect rows in associative array\n $rows = $statement->fetchAll();\n // Foreach row in array\n foreach ($rows as $row) {\n // Create a User Select object\n $user = new UserSelect($row);\n //Create datatable row\n $tmp_data[] = $user;\n }\n // Export into DataTable json format if there's any record in $tmp_data\n if (isset($tmp_data) && count($tmp_data) > 0) {\n $data = $tmp_data;\n } else {\n $data = array();\n }\n return $data;\n } catch (PDOException $e) {\n die(\"Error message: \" . $e->getMessage());\n }\n }", "public function getUsers(){\n $sql=\"SELECT * FROM users\";\n $select=parent::connect_db()->prepare($sql);\n $select->execute();\n if($select->rowCount() > 0):\n return $select->fetchAll(\\PDO::FETCH_ASSOC);\n //return $results;\n else:\n return [];\n endif;\n }", "public function selectAllUsers(){\r\n $userList = new UsersList();\r\n return $userList->selectAllUsers();\r\n }", "public static function allUser()\n {\n $self = new self();\n\n $sql = \"SELECT * FROM user\";\n\n $result = $self->db->query($sql);\n\n $result = $result->fetchAll();\n\n return $result;\n }", "public static function retrieveAllUsers() {\n return R::getAll('SELECT * FROM user');\n }", "public function all(){\n\t\t$sql = \"select * from users\";\n\t\t$stmt= $this->connect->prepare($sql);\n\t\t$stmt->execute();\n\t\t$result = $stmt->fetchAll(PDO::FETCH_CLASS, 'User');\n\t\treturn $result;\n\t}", "public function getAllUser(){\n $users = $this->bdd->query('SELECT * FROM users');\n $users->execute();\n\t\treturn $users->fetchALL(\\PDO::FETCH_ASSOC);\n }", "public function selectAllUsers()\r\n\t{\r\n\t\t\r\n\t\t$userIds = array();\r\n\t\t//select user IDs for all users\r\n\t\t//array_push user IDs in a while loop\r\n\t\t//return $userIds;\r\n\t}", "function get_all_users($db)\n{\n $sql = \"SELECT * FROM users\";\n $st= $db->prepare($sql);\n $st->execute();\n $us = $st->fetchAll();\n return $us;\n}", "public function selectAllUser()\n {\n $req = $this->db->query('SELECT * FROM tbl_user ORDER BY LName');\n return $req;\n }", "public function getAllUsers()\n {\n $sql = \"SELECT `user_id`, `user_fname`, `user_lname`, `user_password_hash`, `user_email`, `user_role` FROM users\";\n $query = $this->db->prepare($sql);\n $query->execute();\n return $query->fetchAll();\n }", "public function getAllUsers() {\n $sql = \"SELECT `pk_users`, `name_users`, `password_users`, `mail_users`, `symbol_users`, `first_name_users`, `last_name_users` FROM `users`\";\n $query = $this->db->prepare($sql);\n $query->execute();\n return $query->fetchAll();\n }", "function get_all_user($koneksi){\n\t\t$query = \"SELECT * FROM v_user\";\n\n\t\t$statement = $koneksi->prepare($query);\n\t\t$statement->execute();\n\t\t$result = $statement->fetchAll();\n\n\t\treturn $result;\n\t}", "public function selectAllUsersIds(){\r\n $stmt = self::$con->prepare(\"SELECT id,name,email FROM users\");\r\n $stmt->execute();\r\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n return $results;\r\n }", "public function getAllUser()\n {\n $this->stmt = $this->db->prepare('SELECT * FROM user');\n $this->stmt->execute();\n $data = $this->stmt->get_result();\n $rows = $data->fetch_all(MYSQLI_ASSOC);\n return $rows;\n }", "protected function GetAllUsers()\r\n {\r\n $sql = \"SELECT * FROM `users`\";\r\n $result = $this->connect()->query($sql);\r\n $rows = $result->num_rows;\r\n\r\n if ($rows > 0) {\r\n while ($row = $result->fetch_assoc()) {\r\n $data[] = $row;\r\n }\r\n\r\n return $data;\r\n } else {\r\n echo \"No results found!\";\r\n }\r\n }", "public function getAllUsers() {\n $sql = 'SELECT id, firstname, mail, role, isAdmin FROM user';\n $sth = $this->db->prepare($sql);\n $sth-> execute(array());\n if ($row = $sth->fetchAll()) {\n return $row;\n }\n }", "public function GetAllUsers()\n {\n $data = $this->db()->run(\"SELECT * FROM users\")->fetchall(PDO::FETCH_ASSOC);\n return $data;\n }", "public static function select_all() {\n $db = Database::getDB();\n\n $query = 'SELECT * FROM users ORDER BY lastName';\n $statement = $db->prepare($query);\n $statement->execute();\n $results = $statement->fetchAll();\n\n\n $users = array();\n foreach ($results as $row) {\n $user = new User($row['username'], $row['password'], $row['role']);\n $users[] = $user;\n }\n return $users;\n }", "public function getAllUsers()\n {\n $result = self::$dbInterface -> query(\"SELECT userID, userName, email FROM user\");\n return $result;\n }", "function findAllUsers() {\r\n\r\n\t\treturn ($this->query('SELECT * FROM users;'));\r\n\r\n\t}", "public function getUsers(){\n $query = \"SELECT * FROM usuario \";\n return self::getInstance()->consulta($query);\n }", "public function users()\n {\n $sql = \"SELECT *\n FROM user\";\n\n $query = $this->db->prepare($sql);\n $query->execute();\n return $query->fetchAll();\n }", "public function getAllUsers() {\n try{\n $conn = (new DB)->connect();\n\n $stmt = $conn->query(\"SELECT * FROM user\");\n\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $connection = null;\n return $result;\n\n }\n catch (PDOException $e) {\n echo json_encode([\n 'error' => $e->getMessage(),\n ]);\n \n print \"Error!: \" . $e->getMessage() . \"<br/>\";\n }\n exit;\n }", "function get_all_users($conn)\n\t{\n\t\t$query = \"SELECT * FROM user\";\n\t\treturn get_values(mysqli_query($conn,$query));\n\t}", "public function get_users() {\n //$query = $this -> db -> prepare(\"SELECT * FROM `users` ORDER BY `time` DESC\");\n $query = $this -> db -> prepare(\"SELECT * FROM `users` ORDER BY `id` ASC\");\n\n try {\n $query -> execute();\n } catch(PDOException $e) {\n die($e -> getMessage());\n }\n\n # We use fetchAll() instead of fetch() to get an array of all the selected records.\n return $query -> fetchAll();\n }", "function fetchUsers()\r\n {\r\n $users = $this->DB->database_select('users', array('username', 'uid'));\r\n return $users;\r\n }", "public function getAllUsers() {\n\t\t$stmt = $this->conn->prepare(\"SELECT * FROM `tbl_users` WHERE `usr_type` = 0 ORDER BY `usr_id` ASC\");\n\t\t$stmt->execute();\n\t\t$result = getResult($stmt);\n\t\t$stmt->close();\n\t\treturn $result;\n\t}", "function getAllUsers() \n\t{\n\t\t$stmt = $this->con->prepare(\"SELECT id, username FROM users\");\n\t\t$stmt->execute();\n\t\t$stmt->bind_result($id, $username);\n\t\t$users = array();\n\t\twhile ($stmt->fetch()) {\n\t\t\t$temp = array();\n\t\t\t$temp[\"id\"] = $id;\n\t\t\t$temp[\"username\"] = $username;\n\t\t\tarray_push($users, $temp);\n\t\t\t\n\t\t}\n\t\treturn $users;\n\t}", "private function get_all() {\n $result = $this->dbh->query($this->query_array['get_all'], array())->fetchAll();\n $users = [];\n foreach ($result as $row) {\n $user = new User($row['id'], $row['username']);\n $users[] = $user->to_array();\n }\n return $users;\n }", "public function getAllUsers()\n\t{\n\t\t$users = $this->fetchAll();\n\t\t\n\t\treturn $users;\n\t}", "public function getAllUsers(){\n\t\n\t\t$db = new Database();\n\t\t$conn= $db->getConn();\n\t\t$rs = $conn->query(\"select * from login\");\n\t\t$num_of_row = $rs->num_rows;\n\t\tif($num_of_row >0){\n\t\t\twhile($row = $rs->fetch_assoc()){\n\t\t\t\t$users[]=array('username'=>$row['username'],'password'=>sha1($row['password']),'email'=>$row['email'],'user_type'=>$row['user_type']);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $users;\n\t}", "public function get_users() {\n\n\t\t\t$query = $this->db->prepare(\"SELECT * FROM `users` ORDER BY `user_id`\");\n\t\t\t\n\t\t\ttry{\n\t\t\t\t$query->execute();\n\t\t\t}catch(PDOException $e){\n\t\t\t\tdie($e->getMessage());\n\t\t\t}\n\n\t\t\treturn $query->fetchAll();\n\n\t\t}", "function getUsers() {\n\t$connection = dbConnect();\n\t$sql = \"SELECT * FROM `users`\";\n\t$statement = $connection->query( $sql );\n\n\treturn $statement->fetchAll();\n}", "public static function all()\n {\n self::dbConnect();\n $statement = self::$dbc->prepare('SELECT * FROM users');\n $statement->execute();\n $results = $statement->fetchAll();\n $users = [];\n foreach ($results as $row) {\n $users[] = new User($row);\n }\n return $users;\n }", "Public Function getAllUsers()\n\t{\n\t\t$Output = array();\n\t\t$Users = $this->_db->fetchAll('SELECT * FROM bevomedia_user');\n\t\tforeach($Users as $User)\n\t\t\t$Output[] = new User($User->id);\n\t\t\t\n\t\treturn $Output;\n\t}", "public function get_all()\n\t{\n\n\t\t/**\n\t\t * Select all the user query results of the table\n\t\t *\n\t\t * @var array $query Select all the users\n\t\t */\n\t\t$query = $this->db->get(\"users\");\n\t\t\n\t\t/**\n\t\t * Return the query result\n\t\t */\n\t\treturn $query;\n\n\t}", "public function select_all()\n {\n // TODO: Limit to id_user\n $query = $this->db->get($this->table);\n return $query;\n }", "public static function getAll() {\n $db = DBInit::getInstance();\n\n $statement = $db->prepare(\"SELECT id, uname, email, pass FROM users\");\n $statement->execute();\n\n return $statement->fetchAll();\n }", "public function getAll()\n\t{\n\t\t$query = \"\n\t\tSELECT * FROM `user`\n\t\t\";\n\n\t\t$handle = $this->db->query($query);\n\t\t$result = $handle->fetchAll(Database::FETCH_ASSOC);\n\n\t\t$users = array();\n\n\t\tfor ($i = 0; $i < count($result); $i++) {\n\t\t\t$res = $result[$i];\n\t\t\t$user = new User($res['id'], $res['name']);\n\t\t\t$users[] = $user;\n\t\t}\n\n\t\treturn $users;\n\t}", "public function getAll()\n {\n self::connectToDB(); /* Using DB connection */\n\n $this->sql = \"SELECT * FROM users\";\n\n try\n {\n $this->query = $this->handler->query($this->sql);\n $this->result = $this->query->fetchAll(PDO::FETCH_ASSOC);\n\n /**\n * Closing DB connection\n */\n $this->query->closeCursor();\n $this->handler = null;\n\n foreach ($this->result as $row)\n {\n $this->list[] = new User($row['id'], $row['username'], $row['password'], $row['email'], $row['firstname'], $row['lastname'], $row['admin'], $row['blocked'], $row['image_path'], $row['registration_date']);\n }\n return $this->list;\n }\n catch (Exception $e)\n {\n echo \"Error: query failure\";\n return false;\n }\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 getAllUsers()\n {\n // Connect to db\n $user = new User();\n $user->setDb($this->di->get(\"db\"));\n // Get users from db\n $users = $user->findAll();\n return $users;\n }", "public function retrieveAllUsers () {\n return $this->usersDB;\n }", "public function user_getAll(){\n\n if( $stmt = $this->connection->prepare(\"SELECT user_id, email, name, level, phone FROM users ORDER BY name ASC\") ){\n $stmt->execute();\n $stmt->bind_result($user_id, $email, $name, $level, $phone);\n \n $results = array();\n while( $stmt->fetch() ){\n $User = new User($user_id, $email, $name, $level, $phone);\n $results[] = $User;\n } \n \n $stmt->close();\n return $results;\n }\n return null;\n \n }", "function d4os_io_db_070_os_user_load_all() {\n $users = array();\n d4os_io_db_070_set_active('os_robust');\n $result = db_query(\"SELECT *, ua.FirstName AS username, ua.LastName AS lastname, ua.PrincipalID AS UUID, ua.Email AS email, CONCAT_WS(' ', FirstName, LastName) AS name FROM {UserAccounts} AS ua\");\n while ($user = db_fetch_object($result)) {\n $users[] = $user;\n }\n d4os_io_db_070_set_active('default');\n return $users;\n}", "public function getAllUsers($conn){\n //$conn = $database->getConnection();\n \n $query = \"select ID, FIRSTNAME, LASTNAME, USERNAME, ROLE, PASSWORD from users\";\n $stmt = $conn->prepare($query);\n $stmt->execute();\n $results = $stmt->get_result();\n \n if($results->num_rows){\n $usersarray = array();\n $results = $results->fetch_all();\n \n foreach($results as $row){\n $user = new User($row[1], $row[2], $row[3], $row[5], $row[4]);\n $user->setId($row[0]);\n $user->setRole($row[4]);\n array_push($usersarray, $user);\n }\n \n return $usersarray; \n } else {\n echo \"No users found or an error occured on the database\";\n }\n }", "public function get_all_users() {\n $query = $this->db->get('users');\n if($users->num_rows() == 0) {\n return false;\n }\n $results = $query->result_array();\n $users = array();\n foreach($results as $row){\n $users[] = User::from_row_array($row);\n }\n return $users;\n }", "function get_all_users()\n{\n\t$db = open_database_connection();\n\t$stmt = $db->prepare(\"SELECT userID, name as title, name, roleID FROM user ORDER BY roleID\");\n\t$stmt->execute();\n\t$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t$users = array();\n\tforeach ($rows as $row) {\n\t\t$users[] = $row;\n\t}\n close_database_connection($db);\n return $users;\n}", "function get_all(){\n\t\tglobal $conn;\n\t\t//$sql = 'SELECT * FROM user';\n\t\t//$r = $conn->prepare($sql);\n\t//\t\treturn $r;\n\t//\treturn $r;\n\n\t\t$stmt = $conn->prepare('SELECT *FROM user');\n\t// Ejecutamos el Statement.\n\t\t$stmt->execute();\n\t\treturn $stmt;\n\n\t}", "public function getAllUsers() {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new SecurityDAO($dbObj);\n return $this->DAO->getAllUsers();\n }", "public function get_users()\n {\n $obj_query = $this->obj_db->prepare(\"SELECT * FROM users ORDER BY time DESC\");\n try {\n $obj_query->execute();\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n\n # We use fetchAll() instead of fetch() to get an array of all the selected records.\n return $obj_query->fetchAll();\n }", "public function getAllUsers(){\n $stmt = $this->databaseConnection->prepare(\"SELECT users.login, users.phone, users.invite, cities.city_name, invites.date_status_\n FROM users\n LEFT JOIN cities ON users.id_city = cities.id_city\n LEFT JOIN invites ON users.invite = invites.invite\");\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "function d4os_io_db_070_os_user_get_all_uid() {\n $list = array();\n $result = db_query(\"SELECT * FROM {d4os_ui_users}\");\n while ($user = db_fetch_object($result)) {\n $list[] = $user;\n }\n return $list;\n}", "public function getUsers() {\n\n $users = $this->users_model->getallusers();\n exit;\n }", "public function getUsers(){\n try{\n $this->openDatabase();\n $query=$this->database->prepare(\"SELECT * FROM users\");\n $query->execute();\n $result=$query->get_result();\n $query->close();\n $this->closeDatabase();\n return $result;\n }\n catch(Exception $exception){\n $this->closeDatabase();\n\t\t\t\tthrow $exception;\n }\n }", "function getAllUsers() {\n global $pdo;\n $statement = $pdo->prepare('SELECT `id`, `firstname`, `lastname`, `email` FROM `user`');\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n}", "public function getUsers()\n {\n $stmt = $this->DB->prepare(\"select user, hash from users\");\n $stmt->execute();\n // fetchall returns all records in the set as an array\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "function get_users()\n\t{\n\t\tglobal $db;\n\t\t\n\t\t$query = $db->query(\"SELECT * FROM users\");\n\t\t\n\t\treturn $db->results($query);\n\t}", "function extract_all_users() {\n\t\t$db = connect_to_db();\n\n\t\t$select_statement = \n\t\t\t\"select users.id, users.username from users\";\n\t\t;\n\n\t\t$stmt = $db->prepare($select_statement);\n\n\t\tif ( !($stmt->execute()) ) {\n\t\t\techo \"Error: Could not get users.\";\n\t\t\t$db->close();\n\t\t\texit;\n\t\t}\n\n\t\t$json = \"[\";\n\n\t\t$stmt->bind_result($id, $username);\n\n\t\twhile ( $stmt->fetch() ) {\n\t\t\t$info = array('id' => $id, 'username' => $username);\n\t\t\t$json = $json . json_encode($info) . \",\";\n\t\t}\n\n\t\techo substr_replace($json, \"]\", -1);\n\n\t\t$db->close();\n\t}", "function users() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $query = \"select * from users;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n\n if ($r->num_rows > 0) {\n $result = array(); \n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n $this->response(json_encode($result), 200);\n } else {\n $this->response('',204);\n }\n }", "public function getUsers(){\n\t\t\t$users = $this->db->get(\"users\");\n\t\t\treturn $users;\n\t\t}", "public function recoverAllUsers() {\n\t\t$req = \"SELECT * FROM users ORDER BY id_user\";\n\t\t$response = $this->getDb()->fetchAll($req);\n\t\t\n\t\t//Convert Query response to an array of domain objects\n\t\t$users = array();\n\t\tforeach ($response as $row) {\n\t\t\t$userId = $row['id_user'];\n\t\t\t$users[$userId] = $this->buildDomainObject($row);\n\t\t}\n\t\treturn $users;\n\t}", "function getUsers()\n {\n $sql = \"SELECT * FROM \" . DB_NAME . \".`customers`\";\n\n try {\n $result = $this->connexion->prepare($sql);\n $var = $result->execute();\n $users = [];\n\n while ($data = $result->fetch(PDO::FETCH_OBJ)) {\n $user = new UserEntity();\n $user->setIdUser($data->idUser);\n $user->setNom_societe($data->Nom_societe);\n $user->setAbreviations($data->Abreviations);\n $user->setAdresse($data->Adresse);\n $user->setTel($data->Tel);\n $user->setEmail($data->Email);\n $user->setSecteur($data->Secteur);\n $user->setCreatedAt($data->createdat);\n\n $users[] = $user;\n }\n\n if ($users) {\n return $users;\n } else {\n return FALSE;\n }\n } catch (PDOException $th) {\n return NULL;\n }\n }", "public static function find_all(){\n\n return static::find_by_query(\"SELECT * FROM \" . static::$table_users);\n\n }", "public function listAll(){\n $sql = \"SELECT id,name,email FROM users\";\n $stmt = $this->cnx->prepare($sql);\n $result = $stmt->execute();\n \n $resultados = array();\n\n while($rs = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $resultados[] = $rs;\n }\n \n if(empty($resultados)){\n throw new Exception(\"Nenhum usuario encontrado!\");\n }\n \n return $resultados;\n }", "public function fetchAllUsers() : array\n {\n $sql = \"SELECT * FROM users WHERE userType = 'customer' ORDER BY name ASC\";\n $result = $this->conn->query($sql);\n if ($result->num_rows > 0) {\n while ($row = $result->fetch_assoc()) {\n $users[] = $row;\n }\n return $users;\n } else {\n return [];\n }\n\n }", "function fetchAllUsers() {\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT * FROM users order by id desc\");\n\t$results = $query->results();\n\treturn ($results);\n}", "public function list_users()\n { \n return DB::select('SELECT id, name FROM users;');\n }", "function GetAllUser(){\n\t\t/*$hasil=$this->db->query(\"SELECT * FROM buku ORDER BY judul_buku\");\n\t\tif($hasil->num_rows()>0){\n\t\t\tforeach($hasil->result() as $row){\n\t\t\t\t$data[]=$row;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}\n\t\t*/\n\t\t$query=$this->db->get('user');\n\t\tforeach($query->result() as $row){\n\t\t\t$data[]=$row;\n\t\t}\n\t\treturn $data;\n\t}", "public function listUsers(){\n $sql=\"SELECT id_people,dni,first_name,last_name,adress,email,is_active FROM people WHERE is_user=3\";\n $rs=$this->con->prepare($sql);\n $rs->execute();\n return $rs->fetchAll(PDO::FETCH_OBJ);\n }", "public function getUsers() {\n $this->checkValidUser();\n\n $this->db->sql = 'SELECT id, username FROM '.$this->db->dbTbl['users'].' ORDER BY username';\n\n $res = $this->db->fetchAll();\n\n if($res === false) {\n $this->output = array(\n 'success' => false,\n 'key' => 'sdop6'\n );\n } else {\n $this->output = array(\n 'success' => true,\n 'key' => 'ffUI8',\n 'users' => $res\n );\n }\n\n $this->renderOutput();\n }", "public function all_user()\n {\n $this->res->SetObject(RCD::SC, RCD::SC, FALSE, $this->db->get('user')->result());\n }", "public static function all() {\n $result = mysqli_query( Connection::getConnection(), \"Select * from users\" );\n $nRows= mysqli_num_rows($result);\n $users=[];\n for($i=0; $i < $nRows; $i++) {\n $user = mysqli_fetch_assoc($result);\n $users[$i] = new User(\n $user['id'],\n $user['name'],\n $user['email'],\n $user['type'],\n $user['patchImage']);\n }\n return $users;\n }", "public static function findAll(): array\n {\n // We call getInstance here because this is a static function\n $db = Database::getInstance(self::$dbName);\n return $db->fetch(\n 'SELECT * FROM user;',\n 'User'\n );\n }", "public function getUsers()\n {\n $users = [];\n $request = $this->_db->query('SELECT * FROM user');\n while ($data = $request->fetch(PDO::FETCH_ASSOC)) {\n $users[] = new User($data);\n }\n return $users;\n }", "public static function findAll()\n {\n $db = Base::getConnection();\n\n $stmt = $db->prepare(\"SELECT * FROM users;\");\n $stmt->execute();\n\n\n $tab = array();\n foreach ($stmt->fetchALL() as $us) {\n $u = new User();\n $u->id = $us['id'];\n $u->username = $us['username'];\n $u->password = $us['password'];\n $u->email = $us['email'];\n $u->setIsVisitor(false);\n\n $tab[$us['id']] = $u;\n }\n $stmt->closeCursor();\n return $tab;\n }", "public function getUsers()\n {\n $sql = \"SELECT * FROM users\";\n return $this->get($sql, array());\n }", "function getAllUsers(){\n $sql = self::$connection->prepare(\"SELECT * FROM `user` WHERE role_id = 2\");\n $sql->execute();//return an object\n $items = array();\n $items = $sql->get_result()->fetch_all(MYSQLI_ASSOC);\n return $items; //return an array\n }", "public function getAllUsers(){\n $stmt = $this->con->prepare(\"SELECT id, name, email, school FROM users nolock;\");\n $stmt->execute(); \n $stmt->bind_result($id, $name, $email, $school);\n $users = array(); \n while($stmt->fetch()){ \n $user = array(); \n $user['id'] = $id; \n $user['name'] = $name; \n $user['email']=$email; \n $user['school'] = $school; \n array_push($users, $user);\n } \n return $users; \n }", "public function getAllUsers(): array\r\n {\r\n $query = $this->db->query('SELECT `Firstname`, `Surname`, `DateOfBirth`, `PhoneNumber`, `Email` \r\n FROM `users` \r\n WHERE `Deleted` = 0;');\r\n\r\n return $query->fetchAll();\r\n }", "public function fetch_all_users() {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM users ORDER BY CAST(date_register AS DATE) DESC\");\n $query -> execute();\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function all()\n {\n return $this->newQuery('getUsers', ['type' => 'AllUsers']);\n }", "public function getAllUsers() {\n //Example of the auth class (you have to change the functionality for yourself)\n AuthHandler::needsAuth(array(\n 'auth' => true\n ));\n\n return ModelLoader::getModel('UserData')->getMultipleUsers(array(\n 1, 2, 3\n ));\n }", "public function getUsers() {\n $db = $this->dbConnect();\n $req = $db->prepare('SELECT * FROM p5_users WHERE ? ');\n $req->execute(array(1));\n\n return $req;\n $req->closeCursor();\n }", "public static function findAll()\n {\n self::createTableIfNeeded();\n\n $users = array();\n\n $response = Connexion::getConnexion()->getPdo()->query(\"SELECT * FROM mb_user\");\n\n\n while($data = $response->fetch())\n {\n $user = new User();\n\n $user->setId($data['id']);\n $user->setUsername($data['username']);\n $user->setEmail($data['email']);\n $user->setPassword($data['password']);\n $user->setToken($data['token']);\n $user->setRole($data['role']);\n $user->setLocked($data['locked']);\n\n array_push($users, $user);\n }\n\n $response->closeCursor();\n\n return $users;\n }", "function get_users () { \r\n $conn = db_connect();\r\n $result = $conn->query(\"set names utf8\");\r\n $result = $conn->query(\"select * from users\");\r\n if (!$result) {\r\n throw new Exception(\"Could not connect to the db!\");\r\n }\r\n if ($result->num_rows == 0) {\r\n //throw new Exception(\"No records in users table!\");\r\n }\r\n $result = db_result_to_array($result);\r\n return $result;\r\n }", "public function retrieve_all_users()\n {\n $table_pengajar = $this->db->dbprefix('pengajar');\n $table_siswa = $this->db->dbprefix('siswa');\n $table_login = $this->db->dbprefix('login');\n\n $sql = \"SELECT {$table_login}.username, {$table_pengajar}.nama FROM {$table_pengajar} INNER JOIN {$table_login} ON {$table_pengajar}.id = {$table_login}.pengajar_id\n UNION\n SELECT {$table_login}.username, {$table_siswa}.nama FROM {$table_siswa} INNER JOIN {$table_login} ON {$table_siswa}.id = {$table_login}.siswa_id\";\n\n $result = $this->db->query($sql);\n\n $data = array();\n foreach ($result->result_array() as $r) {\n # selain yang login\n if (is_login() && $r['username'] == get_sess_data('login', 'username')) {\n continue;\n }\n $data[] = addslashes($r['nama']) . ' [' . $r['username'] . ']';\n }\n\n return $data;\n }", "public function getUsers() {\n $sqlQuery = \"SELECT * FROM users\";\n \n $statement = $this->connection->prepare($sqlQuery);\n $status = $statement->execute();\n \n if (!$status) {\n die(\"Could not retrieve users\");\n }\n \n return $statement;\n }", "public function getAllUsers() : array\n {\n if (NO_DATABASE) {\n return [];\n }\n\n $sql = \"SELECT * FROM users\";\n $stmt = $this->db->prepare($sql);\n $stmt->execute();\n\n $users = [];\n\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)){\n $users[] = new User(\n $row['user_id'],\n $row['user_name'],\n $row['password'],\n $row['role_id'],\n $row['createdAt']\n );\n }\n\n return $users;\n }", "public function getAllUsers()\n {\n $result = [];\n\n $this->logger->info('All User Data Requested', ['username' => 'admin']);\n\n $query = $this->queries->getAllUsers();\n if ($query) {\n $queryResult = $this->dbWrapper->executeAndFetchAll($query);\n if ($queryResult) {\n $result = $queryResult;\n }\n } else {\n $this->errors['database'] = 'Database connection couldn\\'t be established, please try again later!';\n }\n\n return $result;\n }", "public static function get_usuarios(){\n\t\t\n\t\t$query = \"SELECT * FROM usuarios\";\n\n\t\t/**\n\t\t * Call getConexion()\n\t\t */\n\t\tself::getConexion();\n\n\n\n\t\t$resultado = self::$cn->prepare($query);\n\t\t$resultado->execute();\n\n\t\t$filas=$resultado->fetchAll();\n\n\t\t\n\t\treturn $filas;\n\n\t}", "function getUsers($conn){\n\n\t$sql = \"SELECT Username, UserId, Email, AccessLevel FROM user\";\n\n\t$sth = $conn->prepare($sql);\n\t$sth->execute();\n\t\n\t$rows = array();\n\t\n\twhile($r = $sth->fetch(PDO::FETCH_ASSOC)) {\n\t\t$rows[] = $r;\n\t}\n\treturn $rows;\n}", "public function SelectAll()\n {\n $users = DB::table('users')->get();\n\n if ($users <> \"[]\") {\n return response()->json(\n\n $users\n ,\n 200\n );\n }\n }", "public static function getAllUsers() {\r\n // Create a User object\r\n $user = new User();\r\n // Return an array of user objects from the database, ordered by firstname\r\n return $user->getCollection([\"ORDER\" => ['firstname' => 'ASC']]);\r\n }", "public function getAllUsers(){\n \n $stmt = $this->con->prepare(\"SELECT uid, fullname, phone_no, email, login_with, reg_date ,approval FROM users\");\n $stmt->execute();\n $stmt->bind_result($uid, $fullname, $phone_no, $email, $login_with,$reg_date,$approval);\n $users = array(); \n while($stmt->fetch()){ \n $user = array(); \n $user['uid'] = $uid; \n $user['fullname'] = $fullname; \n $user['phone_no'] = $phone_no; \n $user['email']=$email;\n $user['login_with']=$login_with; \n $user['reg_date']=$reg_date; \n $user['approval']=$approval; \n \n array_push($users, $user);\n }\n if(!empty($users)) \n return $users; \n else\n return null;\n }", "function get_all_user( $conds = array(), $limit = false, $offset = false ) {\n\t\t//print_r($conds);die;\n\t\t\n\t\t$this->custom_conds( $conds );\n\t\t\n\t\t// from table\n\t\t$this->db->from( $this->table_name );\n\n\t\tif ( $limit ) {\n\t\t// if there is limit, set the limit\n\t\t\t\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t\n\t\tif ( $offset ) {\n\t\t// if there is offset, set the offset,\n\t\t\t\n\t\t\t$this->db->offset($offset);\n\t\t}\n\t\treturn $this->db->get();\n\t\t //print_r($this->db->last_query());die;\n\t}" ]
[ "0.8290759", "0.81308943", "0.8105524", "0.81006145", "0.7964357", "0.79626465", "0.79510367", "0.7936831", "0.7922818", "0.7893146", "0.78811073", "0.78608334", "0.78590924", "0.78508765", "0.78123677", "0.7794148", "0.77921736", "0.7789722", "0.77786744", "0.77579117", "0.7728325", "0.77243674", "0.7714429", "0.768785", "0.7670254", "0.76542276", "0.76463056", "0.7636999", "0.7636374", "0.7578157", "0.7565686", "0.7565357", "0.7563331", "0.7560514", "0.75568074", "0.75436944", "0.75390786", "0.75178945", "0.7512289", "0.7491208", "0.7488521", "0.74694145", "0.7460138", "0.74461824", "0.7428407", "0.7424425", "0.742218", "0.7418104", "0.74180746", "0.74151456", "0.741164", "0.7403372", "0.7386747", "0.7380659", "0.73664194", "0.7351351", "0.7349445", "0.7348158", "0.73439837", "0.7337356", "0.7328811", "0.7319311", "0.7307061", "0.730698", "0.73027647", "0.72947395", "0.7289173", "0.7279706", "0.7278436", "0.7257812", "0.72293955", "0.7216328", "0.72137624", "0.7213707", "0.7209273", "0.72045076", "0.72009146", "0.7199212", "0.71969616", "0.7184824", "0.7184064", "0.7182639", "0.71797776", "0.71743906", "0.71583146", "0.7158227", "0.7154324", "0.7153208", "0.7150288", "0.71500486", "0.71458024", "0.7136766", "0.71367216", "0.7136558", "0.7133528", "0.7133331", "0.71256804", "0.7123053", "0.7121934", "0.711813" ]
0.75251746
37
This function seek in the BD if a name exist.
function get_not_userName($nomJoueur) { try { include("model.php"); $sql = "SELECT nomJoueur FROM joueurs WHERE nomJoueur = '$nomJoueur'"; // Preparation de la requete $req = $pdo->prepare($sql); // execution de la requete $req->execute(); $id = $req->fetch(); return $id[0]; // If only one data is return } catch (PDOException $e) { echo $e->getMessage(); die("<br /> Erreur dans la BDD "); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exist($name, $db) {\n $resultSet = $db -> query(\"SELECT * from Pokedex WHERE name = '$name'\");\n $count = $resultSet->rowCount();\n return (!$count == 0);\n }", "public function is_existing($name) {\n $data = $this->get_names();\n\n foreach($data as $line){\n if ($line === $name) {\n return true;\n }\n }\n\n return false;\n }", "function exist($name, $table) {\n\t$dbh = db_connect(); #DATABASE CONNEXION\n\n\t$name = strtolower($name); // ex: 'Pop' -> 'pop'\n\n\t# TABLE - CAT / SUB-CAT / ARTIST -----------------------\n\t$sql = \"SELECT EXISTS( SELECT * FROM \" . $table . \" WHERE NAME = '\" . $name . \"')\";\n\t$stmt = $dbh->prepare($sql);\n\t$stmt->execute() or die(error);\n\n\tforeach ($stmt as $variable) {\n\t\treturn($variable[0]);\n\t}\n}", "public function isExistTable($name)\r\n\t{\r\n\t\tif ($this->db->query('SHOW TABLES LIKE %like~', $name)->fetch() ? TRUE : FALSE) {\r\n\t\t\tthrow new Exception('Sorry, but collide in a database table names.', self::COLLIDE_TABLE);\r\n\t\t}\r\n\t}", "public static function find(String $name) {\n\t\treturn false;\n\t}", "public function insert($name) {\n // Check if name is empty\n if (isset($name) && $name === \"\") {\n return false;\n }\n\n // Check if name exist in storage\n if ($this->is_existing($name) === true) {\n return false;\n }\n\n Text_file::write($this->_storage_path, $name . \"\\n\");\n\n return true;\n }", "public static function Exists($name);", "private function tableExist($name)\n {\n if(!Schema::hasTable($name))\n throw new \\Exception('Table not found.');\n }", "public function exist($name, $strict = false);", "private function isExistTable($name)\n {\n $sql = 'SELECT count(*) as count FROM `sqlite_master` WHERE `type`=\"table\" AND `name`=\"' . $this->db->escape($name) . '\"';\n\n $result = $this->db->query($sql);\n\n return (int) $result->row['count'];\n }", "function uname_exists($uname){\n include 'connection.php';\n $query = \"SELECT username FROM admin_users WHERE username = '$uname'\";\n $result = $connection->query($query);\n $rows = $result->num_rows;\n for($i=0; $i<$rows; $i++){\n $result->data_seek($i);\n $row = $result->fetch_array(MYSQLI_ASSOC);\n if($row['username'] == $uname){\n return true;\n }\n else return false;\n }\n}", "public function offsetExists($name)\n {\n throw new \\LogicException('You cannot check if data exists in a document.');\n }", "public function offsetExists($name)\n {\n throw new \\LogicException('You cannot check if data exists in a document.');\n }", "public function isExistName($name)\n\t{\n //$row = $rowset->current();\n // if (!$row) {\n\t\t//return false;\n //throw new \\Exception(\"Could not find row $id\");\n //}\n //return true;\n\t\t\n\t\t$valid = true;\n\t\t$name \t= trim($name);\t\t\n\t\t$adapter\t= $this->tableGateway->getAdapter();\n\t\t//$adapter = null;\n\n\t\t if (null === $adapter) {\n\t\t\tthrow new \\Exception('No database adapter present');\n\t\t}\n\n\t\t\n\t\t$validator = new RecordExists(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t'table' => 'advertisement',\n\t\t\t\t\t\t'field' => 'name',\n\t\t\t\t\t\t'adapter' => $adapter\n\t\t\t\t\t\t)\n\n\t\t);\n\n\t\t// We still need to set our database adapter\n\t\t$validator->setAdapter($adapter);\n\t\t// Validation is then performed as usual\n\t\tif ($validator->isValid($name)) {\n\t\t\t\t\t$valid = true;\n\t\t} else {\t\n\t\t\t\t\t$valid = false;\t\t\t\n\t\t}\t\t\n\t\treturn $valid;\n\t\t\n\t\t// username is invalid; print the reason\n\t\t//$//messages = $validator->getMessages();\n\t\t//foreach ($messages as $message) {\n\t\t//echo \"$message\\n\";\n\t\t//}\n\n }", "public static function find($name);", "public static function find($name);", "function exist() {\n\t\t\t$exist = $this->db->prepare(\"SELECT 1 FROM HISTORIC WHERE nameFile = ? AND idArt = ? \");\n\t\t\t$exist->execute(array($this->nameFile, $this->idArt));\n\t\t\treturn count($exist->fetchAll()) >= 1;\n\t\t}", "public function findByName($name);", "public function findByName($name);", "public function findByName($name);", "public function exist($keyName);", "public function exists($name) {\r\n\t return $this->_data->exists($name);\r\n\t}", "function file_name_exists($name)\r\n{\r\n global $db;\r\n $results = $db->select(tbl(\"video\"),\"videoid,file_name\",\" file_name='$name'\");\r\n\r\n if($db->num_rows >0)\r\n return $results[0]['videoid'];\r\n else\r\n return false;\r\n}", "private function isConstituentExists($name) {\n $stmt = $this->con->prepare(\"SELECT id from constituency WHERE constituency = ?\");\n $stmt->bind_param(\"s\", $name);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }", "public function exists($ret_obj = true){\t\t$exists_db = parent::exists(true);\n\t\tif($exists_db){\n\t\t\t$exists_db = new File($exists_db);\n\t\t\t//check if our file interface agrees\n\t\t\t$interface = new $exists_db['interface']($exists_db);\n\t\t\tif($interface->exists()){\n\t\t\t\t//honor the original exists return values\n\t\t\t\tif($ret_obj){\n\t\t\t\t\treturn $exists_db;\n\t\t\t\t}else{\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}else{\n\n\t\t\t\t//nope the actually file doesn't exist so delete the db record and return false;\n\t\t\t\t$exists_db->delete();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function exists()\n {\n return false;\n }", "public function find($name)\n {\n\t\t$this->load($name);\n }", "public static function nameAvailable( $name )\n {\n Database::all();\n\n if( !(preg_replace(\"/[^0-9]+/\", \"\", $name) == $name) )\n {\n if( (count($name) <= 16) && (count($name) > 0) )\n {\n if( preg_replace(\"/[^a-z0-9]+/\", \"\", $name) == $name )\n {\n if( !Database::DB( $name ) )\n {\n return true;\n }\n else{ commandResult( 403, \"Database \" . $name . \" already exists.\" ); }\n }\n else{ commandResult( 400, \"Database name (\" . $name . \") must be lower case alphanumeric.\" ); }\n }\n else{ commandResult( 400, \"Database name (\" . $name . \") cannot be longer than 16 characters.\" ); }\n }\n else{ commandResult( 400, \"Database name (\" . $name . \") cannot be a number alone.\" ); }\n\n return false;\n }", "public function exists($name);", "public function exists($name);", "public function exists($name);", "public function exists($name);", "public function exists($name);", "public function exists($name);", "function exists ($name)\r\n {\r\n # create encoded_key_string\r\n $encoded_key_string = parent::_encode_key_string(USER_NAME_FIELD_NAME.\"='\".$name.\"'\");\r\n\r\n $record = parent::select_record($encoded_key_string);\r\n if (count($record) > 0)\r\n {\r\n $this->_log->debug(\"user already exists (name=\".$name.\")\");\r\n\r\n return TRUE;\r\n }\r\n else if (strlen($this->get_error_message_str()) == 0)\r\n {\r\n $this->_log->debug(\"user does not exist (name=\".$name.\")\");\r\n\r\n return FALSE;\r\n }\r\n else\r\n return FALSE;\r\n }", "function name_exists($name){\n\t\t\t\n\t\t\t//var_dump($name);\n\t\t\tglobal $wpdb;\n\t\t\t$table = $wpdb->prefix.'users' ;\n\t\t\t$user_id = $wpdb->get_var( \"SELECT ID FROM $table WHERE user_login='$name'\" ) ;\n\t\t\t\n\t\t\t//return ($user_id) ? false: true ;\n\t\t\treturn $user_id ;\n\t\t}", "public function findByName(String $name);", "function findByName($name)\r\n\t{\r\n\t\tglobal $debug;\r\n\t\t$dbh = getOpenedConnection();\r\n\t\t\r\n\t\tif ($dbh == null)\r\n\t\t\treturn;\r\n\t\t\t\r\n\t\t$sql = \"\r\n\t\t\tselect Id\r\n\t\t\tfrom tbl_Pistol_CompetitionDay\r\n\t\t\twhere Name like '$this->Name'\r\n\t\t\";\r\n\t\t\r\n\t\t$result = mysqli_query($dbh,$sql);\r\n\t\tif ($obj = mysqli_fetch_object($result))\r\n\t\t{\r\n\t\t\t$found = $obj->Id;\r\n\t\t}\r\n\r\n\t\tmysqli_free_result($result);\r\n\t\tif ($found != 0) {\r\n\t\t\t$this->load($found);\r\n\t\t}\r\n\t\t\r\n\t\treturn $found;\r\n\t}", "function findByName($name) {\n \t$str_len = strlen($name);\n \ttrim($name);\n \t$name = str_replace('category', '', strtolower($name));\n \t\n\t\t$conn = Doctrine_Manager::connection();\n\t\t// query for check if location exists\n\t\t$unique_query = \"SELECT id FROM commoditycategory WHERE LOWER(name) LIKE LOWER('%\".$name.\"%') OR LOWER(name) LIKE LOWER('%\".$name.\"%') OR LOWER(name) LIKE LOWER('%\".$name.\"%') \";\n\t\t$result = $conn->fetchOne($unique_query);\n\t\t// debugMessage($unique_query);\n\t\t// debugMessage($result);\n\t\treturn $result; \n\t}", "function checkName(){\n $name = $_REQUEST[\"name\"];\n if(preg_match(\"/[a-zA-ZåäöÅÄÖ0-9]+/\", $name)){\n $db = new MyDB(\"sqltemptime.db\");\n if(!$db){\n echo $db->lastErrorMsg();\n }\n $sql = <<<EOF\n SELECT name FROM mashschedule WHERE name=\"$name\";\nEOF;\n $ret = $db->query($sql);\n $row = $ret->fetchArray(SQLITE3_ASSOC);\n if($row['name']){\n echo \"fail\";\n } else {\n echo \"success\";\n }\n $db->close();\n }\n else{\n echo \"Name not valid\";\n }\n}", "public static function checkDB($name){\nif(!(\\Storage::disk('masterDB')->exists($name))){\nnew \\SQLite3(database_path('master').DS.$name);\n}\n}", "public function readIsTagSetted($name) {\n $query = \"SELECT * FROM $this->tableName WHERE name=?\";\n\n $statement = ConnectionHandler::getConnection ()->prepare ( $query );\n $statement->bind_param ( 's', $name );\n $statement->execute ();\n\n $statement->store_result ();\n $num_of_rows = $statement->num_rows;\n\n if ($num_of_rows > 0) {\n return true;\n } else {\n return false;\n }\n }", "function radius_sql_exists($name)\n{\n $exists = false;\n global $environments;\n \n if(!array_key_exists($name, $environments)) return $exists;\n\n $id = $environments[$name]['_id'] . \"@miiicasa.com\";\n\n $dbconn = pg_connect(\"host=localhost port=5432 dbname=radius user=postgres\");\n $result = pg_query_params($dbconn, 'SELECT * FROM radcheck WHERE username = $1', array($id));\n if(pg_num_rows($result) > 0) $exists = true;\n \n pg_close($dbconn);\n\n return $exists;\n}", "public function name_exists($name){\n\t\t$query = $this->db->prepare(\"SELECT count(`user_login`) FROM `nw_users` WHERE `user_login` = ?\");\n\t\t$query->bindValue(1, $name);\n\n\t\ttry{\n\t\t\t$query->execute();\n\t\t\t$rows = $query->fetchColumn();\n\n\t\t\tif($rows == 1){\n\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}catch(PDOException $e){\n\t\t\tdie($e->getMessage());\n\t\t}\n\t}", "public function Exists();", "function nameExists($newUname){\n\t\tglobal $servername, $username, $dbname, $password, $userid;\n\t\t$conn = new mysqli($servername, $username, $password, $dbname);\n\n\t\t// Check connection\n\t\tif ($conn->connect_error) {\n\t\t die(\"Connection failed: \" . $conn->connect_error);\n\t\t} \n\t\telse {\n\t\t\t$sql = \"SELECT * FROM users WHERE u_username = \\\"\".$newUname.\"\\\";\";\n\t\t\t$result = $conn->query($sql);\n\t\t\tif($result->num_rows > 0){ // if > 0, then obviously this name is taken\n\t\t\t\t$conn->close();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$conn->close();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} \n\t}", "function checkTableExists($table_name) {\n $sql = sprintf(\"SELECT count(*) FROM sqlite_master WHERE type='table' AND name='%s'\", $table_name);\n\n $ret = $this->query($sql);\n // echo \"<br>\";\n // echo print_r($ret, $return=true);\n // echo \"<br>\";\n if ($ret) {\n $ary = $ret->fetchArray(SQLITE3_NUM);\n if ($ary[0] > 0) {\n return True;\n } else {\n return False;\n }\n }\n }", "public function exists($name)\n\t{\n\t\t$this->resetParameters();\n\t\treturn !is_null($this->setFieldSelector(['metadata.name' => $name])->first());\n\t}", "public function companyExists($ffname=\"\"){\n $database = Database::getInstance();\n $name= $database->escape_value($ffname);\n $sql = \"SELECT * FROM \" . self::$table_name;\n $sql .= \" WHERE name= '{$ffname}' ;\";\n\n $result_array = self::find_by_sql($sql);\n \n return !empty($result_array) ? array_shift($result_array) : false;\n }", "private function tableExist($name)\n {\n if (!Schema::hasTable($name))\n throw new TableDiffException(\"Table '$name' not found\");\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}", "function userExists(){\n\t\t//assume user is not in system\n\t\t$exists = false;\n\t\ttry{//try to est connection to db \n\t\t\t$user_db = new SQLite3('users.db');\n\t\t}catch(Exception $ex){ //if cannot catch exception \n\t\t\techo $ex->getMessage(); \n\t\t}\n\t\t//query for all usernames\n\t\t$statement = 'SELECT Username FROM users;';\n\t\t$run = $user_db->query($statement); \n\n\t\tif($run){//if not error in query \n\t\t\twhile($row = $run->fetchArray()){//while there are still rows to parse\n\t\t\t\tif(trim($row['Username']) === trim($_POST['name'])){//if provided user name matches one in db\n\t\t\t\t\t//user exists\n\t\t\t\t\t$exists = true;\n\t\t\t\t\t//break out of loop\n\t\t\t\t\tbreak;\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\t//close connection to db\n\t\t$user_db->close(); \n\t\treturn $exists;\n\t}", "function name_exist($conn, $username) {\n\t$sql = \"SELECT * FROM Officer WHERE Officer_Username = '$username';\";\n\t$result = mysqli_query($conn, $sql);\n\tif (mysqli_num_rows($result) > 0) {\n\t\treturn True;\n\t} else {\n\t\treturn False;\n\t}\n}", "function isExist($colName, $tblName, $value)\n{\n global $conn;\n $statement = $conn->prepare(\"SELECT $colName FROM $tblName WHERE $colName = ?\");\n $statement->execute(array($value));\n\n if ($statement->rowCount()) {\n // value exist in DB\n return true;\n } else {\n // not exist\n return false;\n }\n}", "function topicExists(){\n\t $query = \"SELECT * FROM \" . $this->table_name . \" WHERE name = ? LIMIT 0,1\";\n\t $stmt = $this->conn->prepare( $query );\n\t $stmt->bindParam(1, $this->name);\n\t $stmt->execute();\n\t $num = $stmt->rowCount();\n\t if($num>0){\n\t \treturn true;\n\t }\n\t return false;\n\t}", "public function ifnotname($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid, $userid){\n $stmnt = $con->prepare(\"INSERT INTO _name_ (_name_) VALUES (?);\"); # insert new name\n $stmnt -> bind_param(\"s\", $name);\n if($stmnt -> execute()){ # proceed main update from beginning\n $stmnt -> close();\n $this -> maininsert($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid, $userid);\n }\n }", "static function exists($ident) {\n\t\n\t\trequire_once 'DBO.class.php';\n\t\n\t\t$db = DBO::getInstance();\n\t\t$ids = $db->prepare('SELECT id FROM projects');\n\t\t$ids->execute();\n\t\tif($ids->errorCode() != 0)\t{\n\t\t\t$error = $ids->errorInfo();\n\t\t\tthrow new Exception($error[2]);\n\t\t}\n\t\n\t\twhile($id = $ids->fetch())\n\t\t\tif($ident == $id[id])\n\t\t\t\treturn true;\n\t\n\t\treturn false;\n\t}", "function checkExist($table, $anchor, $data)\n {\n $sql = \"SELECT * FROM $table WHERE $anchor=?\";\n $statement = $this->pdo->prepare($sql);\n $statement->execute([$data]);\n if ($result = $statement->fetch(PDO::FETCH_ASSOC)) {\n return true;\n }\n return false;\n\n }", "public static function exists($name){\n $name = trim(strtolower($name));\n return isset(self::$connections[$name]);\n }", "public static function existe($name, $table = null)\n {\n $object = get_class(self::$driver);\n\n return $object::existe($name, $table);\n }", "function isAlreadyExist(){\n $query = \"SELECT *\n FROM\n \" . $this->db_table . \" \n WHERE\n username='\".$this->username.\"'\";\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n // execute query\n $stmt->execute();\n if($stmt->rowCount() > 0){\n return true;\n }\n else{\n return false;\n }\n }", "protected function checkIfDataExists(string $name)\n {\n return !is_null($this->{\"_{$name}\"});\n }", "public function __isset(string $name): bool\n {\n return isset($this->getEntityDao()->$name);\n }", "private function checkIsExists(): bool\n {\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => [\n $this->table. '.listId' => $this->listId,\n $this->table. '.campaignId' => $this->campaignId,\n ]\n ]);\n\n return !is_null($id);\n }", "public function isExist(){\n\t\t\tif(file_exists($this->_nameFile)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "private function databaseExists()\n {\n try {\n if (is_numeric(Bookmark::count()) && is_numeric(Tag::count())) {\n return true;\n }\n } catch (Exception $e) {\n return false;\n }\n\n return false;\n }", "public function has($name){\n\t\treturn $this->hasNamedBuffer($name);\n\t}", "public function tableExists($name)\n {\n return (bool)$this->fetchValue(\"SHOW TABLES LIKE ?\", $name);\n }", "public function has_file($name) {\n $stmt = $this->pdo->prepare('select * from file where user_id = :id and filename = :name');\n $stmt->bindValue(':id', $this->id);\n $stmt->bindValue(':name', $name);\n $stmt->execute();\n $res = $stmt->fetchAll();\n return count($res) == 1;\n }", "function sql_existTableName($tablename)\n {\n global $SQL_DBH;\n if (!$SQL_DBH) return FALSE;\n\n $drivername = $SQL_DBH->getAttribute(PDO::ATTR_DRIVER_NAME);\n $input_parameters = array(':name' => $tablename);\n if ($drivername == 'sqlite')\n {\n $sql = \"SELECT name FROM sqlite_master WHERE type='table' AND name = :name\";\n }\n else\n {\n // mysql\n $sql = 'SHOW TABLES LIKE :name ';\n }\n $res = array();\n $stmt = $SQL_DBH->prepare($sql);\n if ( $stmt && $stmt->execute($input_parameters) )\n $res = $stmt->fetch();\n if ($res && count($res)>0)\n return TRUE;\n return FALSE;\n }", "function getIdForName($name, $dbh=null) {\r\n if (is_null($dbh)) $dbh = connect_to_database();\r\n $sql = \"SELECT id FROM stock WHERE LOWER(name) = LOWER('$name')\";\r\n $sth = make_query($dbh, $sql);\r\n $results = get_all_rows($sth);\r\n if ($results) {\r\n return $results[0]['id'];\r\n }\r\n }", "function doesUserExist($username) {\n global $db;\n\n $query = \"SELECT * FROM user WHERE username=:username\";\n $statement = $db->prepare($query);\n $statement->bindValue(':username', $username); \n $statement->execute();\n $results = $statement->fetchAll();\n $statement->closeCursor();\n return (count($results) > 0);\n}", "public function exists()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$this->check_exists();\n\t\t\treturn true;\n\t\t}\n\t\tcatch(DatabaseFileException $e)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function present($rname)\n{\n\ttry{\n\t\t$DBH = openDBConnection();\n\t\t\n\t\t$stmt = $DBH->prepare(\"select count(RName) from Resume where RName = ? and Login = ?\");\n\t\t$stmt->bindValue(1, $rname);\n\t\t$stmt->bindValue(2, $_SESSION['login']);\n\t\t$stmt->execute();\n\t\t$result = $stmt->fetch();\n\t\t\n\t\tif($result['count(RName)'] == '0')\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\tcatch (PDOException $e){\n\t\t\n\t}\n}", "function comprobarexiste($name)\n\t\t{\n\t\t\t$mysqli=$this->conexionBD();\n\t\t\t$query=\"SELECT * FROM grupo where `NOMBRE_GRUPO` ='$name'\";\n\t\t\t$resultado=$mysqli->query($query);\n\t\t\tif(mysqli_num_rows($resultado)){\n\t\t\t\t$mysqli->close();\n\t\t\t\treturn TRUE;\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\t$mysqli->close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}", "public function existThisWork($indname, $idTask, $idStudent)\n {\n $str = $this->findByIdTaskStudent($idTask, $idStudent);\n $s = pathinfo($str['File'], PATHINFO_FILENAME);\n $newWork = pathinfo($indname, PATHINFO_FILENAME);\n $dir_del = 'C:/WebServers/home/localhost/www'; //now for local server\n //if work exists\n if(strcasecmp($s, $newWork) == 0)\n {\n //delete row from database\n $this->deletePreviousVer($str['idInd_work']);\n $del_file=$str['File'];\n //delete file from server\n $this->deletePrevFile($dir_del,$del_file);\n return true;\n }\n else\n return false;\n }", "public function tableExists($name)\n {\n $tables = $this->listTables();\n foreach ($tables as $tableName) {\n if ($tableName == $name) {\n return true;\n }\n }\n \n return false;\n }", "public function offsetExists(mixed $name) : bool\n\t{\n\t\tif ($this->state === self::STATE_INITIAL) {\n\t\t\t$this->boot();\n\t\t}\n\t\treturn $this->instanceInjector->has($name) || \n\t\t $this->providerInjector->has($name . 'Provider');\n\t}", "public function exists($name)\n {\n return true;\n }", "public function checkKlubExist()\n {\n $db = DB::conn();\n $found = $db->row(\"SELECT klub_name FROM klub\n WHERE klub_name = ? \" , array($this->klub_name));\n return $found;\n }", "function dbUserExists($unm)\n{\n\t$result = false;\n\t$sql = \"SELECT username FROM _account WHERE username = '$unm'\";\n\ttry {\n\t\t$stmt = Database :: prepare ( $sql );\n\t\t$stmt->execute();\n\t\t$count = $stmt -> rowCount();\n\t\tif ($count > 0) {\n\t\t\t$result = true; //Username already taken\n\t\t}\n\t\t$stmt->closeCursor ( ) ;\n\t}\n\tcatch(PDOException $e)\n\t{\n\t\techo $e->getMessage();\n\t}\n\treturn $result;\n}", "public function exists($name)\n {\n return $name === $this->_name || strpos($name, $this->_name . '#~#') === 0;\n }", "function is_file_in_db( $fn ) {\n // Prepare SELECT statement to search for the file.\n $select = \"SELECT * FROM files WHERE\n filename = :filename\";\n $stmt = $this->pdo->prepare($select);\n\n // Bind parameters\n $stmt->bindParam(':filename', $fn);\n\n // Execute statement\n $stmt->execute();\n\n // Count results from SELECT\n $rows = count($stmt->fetchAll());\n\n if( $rows ) {\n return true;\n } else {\n return false;\n }\n }", "function name_exists($str){\n\n\t\tif(strlen($str)<3 || strlen($str)>30){\n\t\t\t$this->form_validation->set_message('name_exists','The field {field} must be between 3 and 30 characters in length');\n\t\t\treturn false;\n\t\t}\n\t\t$nameExists = $this->DAO->entitySelection('station',array('nameStation'=>$str),TRUE);\n\t\tif($nameExists['data']){\n\t\t\t$this->form_validation->set_message('name_exists','The field {field} already exists');\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "private function checkIsExists(): bool\n {\n $where = [\n $this->table. '.vendorId' => $this->vendorId,\n $this->table. '.campaign' => $this->campaign,\n ];\n\n if (!is_null($this->id)) {\n $where[$this->table. '.id !='] = $this->id;\n }\n\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => $where\n ]);\n\n return !is_null($id);\n }", "public function findUserByName($name){\n $this->db->query('SELECT * FROM subscriber WHERE name = :user_name');\n // Bind value\n $this->db->bind(':user_name', $name);\n \n $row = $this->db->single();\n \n // Check row\n if($this->db->rowCount() > 0){\n return true;\n } else {\n return false;\n }\n }", "function exists($name) {\n return isset($this->store[$name]);\n }", "function is_already_word($master_wordNo, $newbookmarkNo)\n{\n $is_deleted = (string)'N';\n $pdo = pdoSqlConnect();\n $query = \"select exists(select * from bookmark_relations_word where is_deleted = ? and word_no = ? and bookmark_no = ?) as exist;\";\n\n\n $st = $pdo->prepare($query);\n // $st->execute([$param,$param]);\n $st->execute([$is_deleted, $master_wordNo, $newbookmarkNo]);\n $st->setFetchMode(PDO::FETCH_ASSOC);\n $res = $st->fetchAll();\n\n $st = null;\n $pdo = null;\n\n return $res[0]['exist'];\n}", "public function checkname(){\t\t\n\t\tDB::query(\"select * from webchat_users where `name`='\".DB::esc($this->name).\"'\");\t\t\n\t\treturn DB::getMySQLiObject();\n\t}", "public function exists($name): bool\n {\n return array_key_exists($name, $this->connections);\n }", "function _pgsql_object_exists($name) {\n $sql = \"select relname from pg_class where relname = '$name'\";\n $r = db_query($sql);\n if($r['rows'] == 1) {\n return true;\n }\n return false;\n}", "private function find($name) {\r\n\t\t$out = null;//Return null if all fails\r\n\t\t\r\n\t\t//Check if input holds any data\r\n\t\tif (!empty($this->input)) {\r\n\t\t\tforeach($this->input as $i=>$item) {\r\n\t\t\t\t//If name matches $name exactly \r\n\t\t\t\tif ($item['name'] === $name) { \r\n\t\t\t\t\t$item['id'] = $i;//Add the row num to item\r\n\t\t\t\t\t$out = $item;//Set item as return item\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t\r\n\t\treturn $out;\r\n\t}", "public function exists()\n\t{\n\t\treturn in_array($this->name, $this->driver->getTables());\n\t}", "public function hasDatabase($name);", "public function hasTable($name)\n\t{\n\t\t$sql = 'SELECT COUNT(*) FROM sqlite_master WHERE name = ' . $this->db->quote($name);\n\t\treturn (bool) $this->db->query($sql)->fetchColumn();\n\t}", "function permissionNameExists($permission)\r\n{\r\n\tglobal $mysqli,$db_table_prefix;\r\n\t$stmt = $mysqli->prepare(\"SELECT id\r\n\t\tFROM \".$db_table_prefix.\"permissions\r\n\t\tWHERE\r\n\t\tname = ?\r\n\t\tLIMIT 1\");\r\n\t$stmt->bind_param(\"s\", $permission);\t\r\n\t$stmt->execute();\r\n\t$stmt->store_result();\r\n\t$num_returns = $stmt->num_rows;\r\n\t$stmt->close();\r\n\t\r\n\tif ($num_returns > 0)\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn false;\t\r\n\t}\r\n}", "function exists($id)\n{\n\tif ($id && file_exists('datas/data')){\n\t\t$file = unserialize(file_get_contents('datas/data'));\n\t\tforeach ($file as $value){\n\t\t\tif(trim($value['nom']) === trim($id))\n\t\t\t\treturn true;\n\t\t}\n\t}\n return false;\n}", "function isCharityNamePresent($name = NULL){\t\t\t\n\t\t$query = \" SELECT id\";\n\t\t$query .= \" FROM \" . $this->config->item('ems_organisers_details','dbtables');\n\t\t$query .= \" WHERE charity_name = ? \";\t\t\n\t\t$dataBindArr = array($name);\n\t\t$res = $this->db->query($query, $dataBindArr);\n\t\t$resArr = $res->result();\t\t\n\t\treturn count($resArr);\n\t}", "function doesUserExist($user) {\r\n global $dbaseUserData, $leagueID, $dbase;\r\n\r\n\r\n $query = \"SELECT username from $dbaseUserData where lid='$leagueID' and username=\\\"$user\\\"\";\r\n $result = $dbase->query($query);\r\n\r\n if ($result == FALSE) {\r\n ErrorNotify(\"Query Failed : $query\");\r\n CloseConnection($link);\r\n return TRUE;\r\n }\r\n \r\n // If we get >0 rows, the username already exists.\r\n $numrows = mysql_num_rows($result);\r\n\r\n if ($numrows == 0) {\r\n return FALSE;\r\n }\r\n\r\n return TRUE;\r\n}", "function searchInDB($conn, $input){\n $question_exists = false;\n\n $sql = \"SELECT question FROM chatbot\";\n\n $result = $conn -> query($sql);\n\n while ($row = $result -> fetch(PDO::FETCH_ASSOC)) {\n if ($row['question'] == trim($input)) {\n $question_exists = true; //This executes only if a question already exists\n break;\n }\n } //end while\n\n return $question_exists; //returns TRUE if question exists, FALSE otherwise\n }", "abstract public function exists();" ]
[ "0.6840963", "0.65607345", "0.63920194", "0.6267259", "0.6245223", "0.6210305", "0.6144683", "0.60551125", "0.6046651", "0.60351205", "0.60201865", "0.6003058", "0.6003058", "0.5971136", "0.59492093", "0.59492093", "0.59145004", "0.5894571", "0.5894571", "0.5894571", "0.5888606", "0.5887403", "0.5881787", "0.5871887", "0.58451146", "0.58235055", "0.58228105", "0.58106333", "0.57908976", "0.57908976", "0.57908976", "0.57908976", "0.57908976", "0.57908976", "0.5776446", "0.57663304", "0.57600164", "0.57147133", "0.5689307", "0.56810915", "0.5642069", "0.56413186", "0.5625097", "0.5620888", "0.5612738", "0.56114244", "0.56015885", "0.559217", "0.55855507", "0.55780244", "0.5572838", "0.5571032", "0.5565818", "0.55531996", "0.5539391", "0.5516955", "0.5514644", "0.5508069", "0.5503642", "0.55012363", "0.54926205", "0.5490163", "0.5487048", "0.5477659", "0.5476965", "0.54673487", "0.5458343", "0.5451173", "0.54487056", "0.5446501", "0.54458874", "0.54384804", "0.5432473", "0.5428784", "0.5421066", "0.54063785", "0.54061174", "0.53998005", "0.53947574", "0.53945845", "0.53938", "0.5393727", "0.5391991", "0.53893334", "0.53868824", "0.53831667", "0.5381676", "0.5377553", "0.5377134", "0.53731596", "0.5368679", "0.5360945", "0.53545535", "0.5354067", "0.53448105", "0.5339794", "0.53357905", "0.5331186", "0.53014356", "0.5299171", "0.5294488" ]
0.0
-1
This function seek in the BD if a password exist for a user name.
function get_not_userPassWord($nomJoueur, $motDePasse) { try { include("model.php"); $sql = "SELECT mdpJoueur FROM joueurs WHERE nomJoueur = '$nomJoueur' AND mdpJoueur = '$motDePasse'"; // Preparation de la requete $req = $pdo->prepare($sql); // execution de la requete $req->execute(); $id = $req->fetch(); return $id[0]; // If only one data to return } catch (PDOException $e) { echo $e->getMessage(); die("<br /> Erreur dans la BDD "); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkUser($userName, $password){\n\t\n\tglobal $usersTable;\n\tglobal $db;\n\t$selectQuery=\"select password from $usersTable where userName = '\" . $userName . \"'\";\n\t$resultSet = mysqli_query($db, $selectQuery) or die(mysqli_error($db));\n\t$row = mysqli_fetch_assoc($resultSet);\n\t\n\tif($password == $row[\"password\"]){\n\t\treturn true;\n\t}\n\t\t\t\n\treturn false;\n}", "function checkIfValidUser($name,$pw){\n\t if(($name != NULL) && ($pw != NULL)){\n $count = @mysql_query(\"SELECT COUNT(*) as count FROM UserUNandID WHERE ('$name' = UserName)\");\n\t\t $countdata = mysql_fetch_assoc($count);\n\t\t if($countdata['count'] <= 0){\n\t\t return false;\n\t\t }\n else\n\t\t { \n $userinfo = @mysql_query(\"SELECT * FROM UserUNandID WHERE ('$name' = UserName)\");\n\t\t\t $userdata = mysql_fetch_assoc($userinfo);\n\t\t\t $pwinfo = $userdata['Password'];\n\t\t\t if($pw == $pwinfo)\n\t\t\t return true;\n\t\t\t else return false;\n }\t\t\t \n\t\t}\t\t\n\t}", "function checkPassword(): bool\n {\n $user = FPersistantManager::getInstance()->search(\"utente\", \"UserName\", $this->getUsername());\n if($this->getPassword() == $user[0]->getPassword())\n return true;\n else\n return false;\n }", "function check_user_existence($username, $password) \n{\n global $conn;\n $q['query'] = \"SELECT * FROM `user_master` WHERE user_name = '$username' AND password = '$password'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}", "public function hasPwIsExist(){\n return $this->_has(2);\n }", "function isPersonInDBase($userName, $password){\n try {\n $conn = connectToDBase();\n $statement = $conn->prepare(\"select cred from users where user= :userName\");\n $statement->execute(array(':userName' => $userName ));\n $pwd = $statement->fetch();\n $hash = $pwd[0];\n\n $getSalt = $conn->prepare(\"SELECT security FROM users where user= :userName\");\n $getSalt->execute(array(':userName' => $userName ));\n $salty = $getSalt->fetch();\n $pass = $password . $salty[0];\n\n if ( password_verify( $pass, $hash) ){\n $personIDSetup = $conn->prepare(\"SELECT active FROM users where user= :userName AND cred= :hash\");\n $personIDSetup->execute(array(':userName' => $userName, ':hash' =>$hash ));\n $personID = $personIDSetup->fetchAll();\n\n if ( count($personID) == 1){\n return $personID[0];\n }else{\n return 0;\n }\n }\n }\n catch(PDOException $ex){\n //person doesn't exist\n return \"Something went wrong in while retreiving person.\";\n }\n closeDBase($conn);\n}", "function correct_user( $name, $passwd, $domain, $conn, $db_users )\r\n\t\t{\r\n\t\t\t$table = $conn->query( \"SELECT count(*) CNT, user, passwd, domain FROM \".$db_users.\" WHERE user = '\".$name.\"' AND domain = '\".$domain.\"'\" );\r\n\t\t\t$row = mysqli_fetch_array( $table );\r\n\t\t\tif ( $row['CNT'] != 1 ) return false;\r\n\t\t\tif ( $row['passwd'] == $passwd ) return true;\r\n\t\t\treturn false;\r\n\t\t}", "function dbUserExists($unm)\n{\n\t$result = false;\n\t$sql = \"SELECT username FROM _account WHERE username = '$unm'\";\n\ttry {\n\t\t$stmt = Database :: prepare ( $sql );\n\t\t$stmt->execute();\n\t\t$count = $stmt -> rowCount();\n\t\tif ($count > 0) {\n\t\t\t$result = true; //Username already taken\n\t\t}\n\t\t$stmt->closeCursor ( ) ;\n\t}\n\tcatch(PDOException $e)\n\t{\n\t\techo $e->getMessage();\n\t}\n\treturn $result;\n}", "public function read_credentials(){\n $query='SELECT * FROM '.$this->table.' WHERE name=? and password=?';\n\n $stmt = $this->conn->prepare($query);\n\n \n $stmt->bindparam(1,$this->name);\n $stmt->bindparam(2,$this->password);\n\n $stmt->execute();\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->name=$row['name'];\n $this->email=$row['email'];\n $this->status=$row['status'];\n\n if($stmt->execute()) {\n return true;\n }\n \n // Print error \n printf(\"Error: %s.\\n\", \"invalid user\");\n \n return false;\n \n \n }", "public function check_user($name='', $pass='') {\n\t\t$db = self::$pdo;\n\t\t$query = $db->query(\"SELECT * FROM \" . self::$_table . \" WHERE password = '$pass' AND name = '$name'\");\n\t\t$count = $query->rowCount();\n\t\t\n\t\tif($count > 0) return true;\n\t\telse return false;\n\t}", "function getCredentialsAreValid($username, $passwordHash) {\r\n global $db;\r\n\r\n // Query String\r\n $query = \"\r\n SELECT *\r\n FROM user\r\n WHERE user_name = :username\";\r\n\r\n try {\r\n $statement = $db->prepare($query);\r\n $statement->bindValue(':username', $username);\r\n $statement->execute();\r\n $result = $statement->fetch();\r\n $statement->closeCursor();\r\n // If user doesn't exist, return false\r\n if (empty($result))\r\n return false;\r\n\r\n return ($result['password'] == $passwordHash);\r\n } catch (PDOException $ex) {\r\n echo $ex->getMessage();\r\n exit;\r\n }\r\n}", "function DB_check_if_user_exist($usersPass, $usersEmail){\n\n $connection = DB_get_connection();\n $usersPass = md5($usersPass);\n $query = \"SELECT * FROM `users` WHERE Email='$usersEmail' AND password='$usersPass'\";\n $result = mysqli_query($connection, $query);\n if(mysqli_num_rows($result) === 1)\n return true;\n else return false;\n\n}", "function checkPasswordExists($password){\n\t\t$sql=\"SELECT id_usuario FROM \".$this->tabla.\" \n\t\t\t WHERE user_pass='$password'\";\n\n\t\treturn $this->toVar($sql);\n\t}", "public function hasPwIsExist(){\n return $this->_has(4);\n }", "function login($name, $password) {\n $query = \"SELECT name, password FROM characters WHERE name LIKE '%?%'\";\n try {\n $item = $this->perform_query_one_param($query, \"s\", $name);\n $item = $this->result_to_array($item);\n if (count($item) == 0) {\n return false;\n }\n echo $item[0]['name'].$item[0]['password'];\n return ($item[0]['name'] == $name && password_verify($password,$item[0]['password']));\n } catch (Exception $ex) {\n $this->print_error_message(\"Unable to login\");\n return false;\n }\n }", "public function existUser($user,$pwd){\n\t\t$query = \"SELECT idUser FROM final_usuario WHERE nick='\".$user.\"' and \n\t\tpassword='\".$pwd.\"'\";\n\t\treturn mysqli_num_rows($this->con->action($query))> 0? True: False; \n\t}", "function user_exists($username){\n\n $sql = \"SELECT Username, Password, Email, Id FROM Users\"; //WHERE\n //Username={$username}\";\n $result = mysqli_query(Db::$conn, $sql);\n //check results return true if >0\n if(mysqli_num_rows($result)>0) {\n while ($row = mysqli_fetch_assoc($result)) {\n $temp_user = $row[\"Username\"];\n $temp_pass = $row[\"Password\"];\n if ($username == $row[\"Username\"]) {\n return true;\n }\n }\n }\n\n return false;\n\n}", "function valid_passwd($uid, $passwd) {\n $dbh = DB::connect();\n\n $q = \"SELECT salt, passwd \";\n $q.= \"FROM Users \";\n $q.= \"WHERE id = \" . $dbh->quote($uid);\n $result = $dbh->query($q);\n\n if (!$result) {\n return false;\n }\n\n $row = $result->fetch(PDO::FETCH_NUM);\n $salted_hash = hash(\"sha256\", $row[0] . $passwd);\n\n if ($salted_hash == $row[1]) {\n return true;\n } else {\n return false;\n }\n}", "public function check_password(){\n\t\t$query = $this->check_username();\n\t\tif($query > 0){\n\t\t\tif(isset($_POST[\"submit\"])){\n\t\t\t\t$user = $_POST[\"uname\"];\n\t\t\t\t$pass = sha1($_POST[\"pword\"]);\n\n\t\t\t\t$query1 = $this->db->query(\"SELECT * \n\t\t\t\t\t\t\t\t\t\t\tFROM administrator \n\t\t\t\t\t\t\t\t\t\t\tWHERE username LIKE '${user}' and password LIKE '${pass}'\");\n\t\t\t\tif($query1->num_rows() > 0){\n\t\t\t\t\treturn $query1->num_rows();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\techo \"Invalid username/password combination.<br/>\";\n\t\t\t\t\techo \"<a href='login'>Back</a><br/>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\techo \"Username does not exist<br/>\";\n\t\t\techo \"<a href='login'>Back</a><br/>\";\n\t\t}\n\t}", "function dbCheckAuth($unm,$pwd)\n{\n\t$result = 0;\n\t$sql = \"SELECT username,password,salt FROM _account WHERE username = '$unm'\";\n\ttry {\n\t\t$stmt = Database :: prepare ( $sql );\n\t\t$stmt->execute();\n\t\tif ($stmt -> rowCount() > 0) \n\t\t{\n\t\t\t$data = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t$hash = $data[0]['salt'].$pwd.$data[0]['salt'];\n\t\t\t$md5pwd = MD5($hash);\n\t\t\t\n\t\t\t$sql = \"SELECT username FROM _account WHERE password = '$md5pwd'\";\n\t\t\t$stmt = Database :: prepare ( $sql );\n\t\t\t$stmt->execute();\n\t\t\t$result = $stmt -> rowCount();\n\t\t}\n\t\telse { $result = 0; }\n\t\t//echo \"$sql : $result record(s)\";\n\t\t$stmt->closeCursor ( ) ;\n\t\t\n\t}\n\tcatch(PDOException $e)\n\t{\n\t\techo $e->getMessage();\n\t}\n\treturn $result;\n}", "public static function checkCredentials( $usename, $password ) {\n\t\t\n\t\t$where = sprintf(\"`username` = %s AND `password` = %s\", self::$dataBase->escape($usename), self::$dataBase->escape($password)); \n\t\t\n\t\t$results = static::$dataBase->select(static::$tableName, $where);\n\t\t\n\t\tif ( count($results) != 1 ) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\t$dbData = array_pop($results);\n\t\t}\n\t\t\n\t\treturn static::hydrateDBData($dbData);\n\t\t\n\t}", "function is_user_exists($cellphone,$password)\n {\n\n $query=$this->db->query(\"SELECT * FROM xl_account WHERE cellphone='{$cellphone}' AND password='{$password}' AND register_user=1\");\n\n if ($query->num_rows()>0) {\n #if exist return true\n return TRUE;\n }\n\n return FALSE; \n }", "function uname_exists($uname){\n include 'connection.php';\n $query = \"SELECT username FROM admin_users WHERE username = '$uname'\";\n $result = $connection->query($query);\n $rows = $result->num_rows;\n for($i=0; $i<$rows; $i++){\n $result->data_seek($i);\n $row = $result->fetch_array(MYSQLI_ASSOC);\n if($row['username'] == $uname){\n return true;\n }\n else return false;\n }\n}", "function validate_user_bd($user, $pass, $conn){\n $query = \"select 1 as user_valido from users where name='$user' and password=MD5('$pass')\";\n $result = $conn->query($query);\n\n if($result->num_rows == 0){\n return false;\n }else{\n return true;\n }\n }", "function getCredentialsAreValid($username, $password) {\r\n global $db;\r\n\r\n //phpAlert(\"building query string\");\r\n // Query String\r\n $query = \"SELECT * FROM system_user WHERE system_user_name = '$username';\";\r\n\r\n //phpAlert(\"query string is: \" . $query);\r\n \r\n try {\r\n $statement = $db->prepare($query);\r\n $statement->execute();\r\n $result = $statement->fetch();\r\n $statement->closeCursor();\r\n // If user doesn't exist, return false\r\n if (empty($result))\r\n return false;\r\n\r\n //phpAlert(\"Account exists, verifying password\");\r\n // Validate using password_verify()\r\n return (password_verify($password, $result['system_user_password']));\r\n } catch (PDOException $ex) {\r\n echo $ex->getMessage();\r\n exit;\r\n }\r\n}", "function userExists(){\n\t\t//assume user is not in system\n\t\t$exists = false;\n\t\ttry{//try to est connection to db \n\t\t\t$user_db = new SQLite3('users.db');\n\t\t}catch(Exception $ex){ //if cannot catch exception \n\t\t\techo $ex->getMessage(); \n\t\t}\n\t\t//query for all usernames\n\t\t$statement = 'SELECT Username FROM users;';\n\t\t$run = $user_db->query($statement); \n\n\t\tif($run){//if not error in query \n\t\t\twhile($row = $run->fetchArray()){//while there are still rows to parse\n\t\t\t\tif(trim($row['Username']) === trim($_POST['name'])){//if provided user name matches one in db\n\t\t\t\t\t//user exists\n\t\t\t\t\t$exists = true;\n\t\t\t\t\t//break out of loop\n\t\t\t\t\tbreak;\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\t//close connection to db\n\t\t$user_db->close(); \n\t\treturn $exists;\n\t}", "function pwordMatches(){\n\t\t//assume pword does not match that in system\n\t\t$match = false;\n\t\ttry{//try to est connection to db \n\t\t\t$user_db = new SQLite3('users.db');\n\t\t}catch(Exception $ex){ //if cannot catch exception \n\t\t\techo $ex->getMessage(); \n\t\t}\n\t\t//query for all usernames\n\t\t$statement = 'SELECT Username, Password FROM users;';\n\t\t$run = $user_db->query($statement); \n\n\t\t$pword = $_SESSION['password'];\n\t\t$pword = hash('md2', $pword); \n\t\tif($run){//query did not have error\n\t\t\twhile($row = $run->fetchArray()){\n\t\t\t\tif(trim($row['Username']) === trim($_POST['name'])){//if provided username is the same as that queried\t\n\t\t\t\t\tif($pword === trim($row['Password'])){//if provided pword matches that for the provided username\n\t\t\t\t\t\t//password matches\n\t\t\t\t\t\t$match = true; \n\t\t\t\t\t\t//break out of loop\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}\n\t\t$user_db->close(); \n\t\treturn $match; \t\n\t}", "function doesUserExist($username) {\n global $db;\n\n $query = \"SELECT * FROM user WHERE username=:username\";\n $statement = $db->prepare($query);\n $statement->bindValue(':username', $username); \n $statement->execute();\n $results = $statement->fetchAll();\n $statement->closeCursor();\n return (count($results) > 0);\n}", "function auth_user_exists($username)\n{\n return dbFetchCell(\"SELECT * FROM `users` WHERE `username` = ?\", array($username));\n}", "function usernameExists(){\n\t $query = \"SELECT id, first_name, last_name, password\n\t FROM \" . $this->table_name . \"\n\t WHERE username = ?\n\t LIMIT 0,1\";\n\t \n\t $stmt = $this->conn->prepare( $query );\n\t $this->username=htmlspecialchars(strip_tags($this->username));\n\t $stmt->bindParam(1, $this->username);\n\t \n\t $stmt->execute();\n\t $num = $stmt->rowCount();\n\t \n\t if($num > 0){\n\t $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t \n\t $this->id = $row['id'];\n\t $this->first_name = $row['first_name'];\n\t $this->last_name = $row['last_name'];\n\t $this->password = $row['password'];\n\t \n\t return true;\n\t }\n\t return false;\n\t}", "function userexist($field, $value)\n\t\t{\n\t\t\t$value = \"'\".$value.\"'\";\n\t\t\t\n\t\t\t$sql = $this->conn_id->query(\"select * from users where \".$field.\" = \".$value );\n\t\t\t$r = $sql->fetchALL(PDO::FETCH_ASSOC);\n\t\t\tif(!empty($r))\n\t\t\t{\n\t\t\t\t$sql = $this->conn_id->query(\"select name,hash_key from users where \".$field.\" = \".$value );\n\t\t\t\t$r = $sql->fetchALL(PDO::FETCH_ASSOC);\n\t\t\t\treturn $r;\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn FALSE;\n\t\t}", "public function _pwdntmatchdb($input, $password) {\n\t\t\n\t\t$password \t= md5(r::post($password));\n\t\t$username \t= r::post($input);\n\n\t\t$prepare\t= $this->db->prepare(\"SELECT * FROM `users` WHERE `username` = ? AND `password` = ?\");\n\t\t$prepare->execute(array($username, $password));\n\t\t$result\t\t= $prepare->fetch(PDO::FETCH_ASSOC);\n\n\t\tif(empty($result)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->userid = $result['id'];\n\t}", "function checkUser()\n\t{\n\t\t$uid = mysql_real_escape_string($_POST[\"uid\"]);\n\t\t\n\t\t$query = \"\n\t\t\tSELECT *\n\t\t\tFROM user\n\t\t\tWHERE uid='$uid';\";\n\t\t\t\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\t$salt = mysql_result($result, 0, \"salt\");\n\t\t$pwd = $_POST[\"pwd\"];\n\t\t$salt = (string) $salt;\n\n\t\t$pwd = md5(md5($pwd) . $salt);\n\t\t\n\t\t$query = \"\n\t\t\tSELECT *\n\t\t\tFROM user\n\t\t\tWHERE uid='$uid' and pwd='$pwd';\";\n\t\t\t\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\t$exists = (mysql_numrows($result) == 1) ? true : false;\n\n\t\treturn $exists;\n\t}", "function email_and_password_exists($db, $email, $password)\n{\n\t$password = md5($password);\n\t$sql = \"SELECT * FROM users where email=:email and password=:password\";\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':email'=>$email, ':password'=>$password));\n\t$us = $st->fetchAll();\n\treturn (count($us) >= 1);\n}", "function checkUser($name, $password) {\n\t$id = checkUserBdd($name, $password);\n\n\tif ($id) {\n\t\t$_SESSION[\"name\"] = $name;\n\t\t$_SESSION[\"userId\"] = $id;\n\t\t$_SESSION[\"connected\"] = true;\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "function exists ($name)\r\n {\r\n # create encoded_key_string\r\n $encoded_key_string = parent::_encode_key_string(USER_NAME_FIELD_NAME.\"='\".$name.\"'\");\r\n\r\n $record = parent::select_record($encoded_key_string);\r\n if (count($record) > 0)\r\n {\r\n $this->_log->debug(\"user already exists (name=\".$name.\")\");\r\n\r\n return TRUE;\r\n }\r\n else if (strlen($this->get_error_message_str()) == 0)\r\n {\r\n $this->_log->debug(\"user does not exist (name=\".$name.\")\");\r\n\r\n return FALSE;\r\n }\r\n else\r\n return FALSE;\r\n }", "function exists_and_correct($user, $pass, $pdo_obj)\n{\n // 1) There is a user with that username\n // 2) If the password matches\n // Returns an array of [#, user/admin] depending on what happens and whether they are a user or admin\n // Returns 0 if it works out\n // Returns 1 if it is the wrong password\n // Returns 2 if it the user doesn't exist\n $result = [2, 'user']; // Default is doesn't exist and is user\n\n //Look through users first\n $users = $pdo_obj->query(\"SELECT username, hashed_password from `users`\");\n foreach ($users as $u)\n {\n \tif ($user === $u['username'])\n \t{\n \t if ($pass === $u['hashed_password'])\n \t { // Password matches\n \t \t$result[0] = 0;\n \t \treturn $result;\n \t }\n \t else\n \t { // Password doesn't match\n \t \t$result[0] = 1;\n \t \treturn $result;\n \t }\n \t}\n }\n //Look through admins\n $admins = $pdo_obj->query(\"SELECT username, hashed_password from `admins`\");\n foreach ($admins as $a)\n {\n \tif ($user === $a['username'])\n \t{\n \t if ($pass === $a['hashed_password'])\n \t { // Password matches\n \t \t$result[0] = 0;\n \t \t$result[1] = \"admin\";\n \t \treturn $result;\n \t }\n \t else\n \t { // Password doesn't match\n \t \t$result[0] = 1;\n \t \t$result[1] = \"admin\";\n \t \treturn $result;\n \t }\n \t}\n }\n return $result;\n}", "function verifyLogin($user,$pass)\r\n\r\n{\r\n\r\n\t$salt = 's+(_a*';\r\n\r\n\t$pass = md5($pass.$salt);\r\n\r\n\r\n\r\n\t$sql = \"SELECT pass FROM users WHERE pass = '\" . $pass . \"' AND user = '\" . $user .\"'\";\r\n\r\n\t$res = sqlQuery($sql); if(sqlErrorReturn()) sqlDebug(__FILE__,__LINE__,sqlErrorReturn());\r\n\r\n\t$num = sqlNumRows($res);\r\n\r\n\r\n\r\n\tif ($num > 0)\r\n\r\n\t\treturn true;\r\n\r\n\treturn false;\t\r\n\r\n}", "function isPassCorrect($request){\n $name = $request[\"name\"];\n $pass = $request[\"pass\"];\n global $dbName, $dbPass;\n $mysqli = mysqli_connect(\"localhost\", $dbName, $dbPass, \"[Redacted]\") \n or die(mysql_error());\n $query = mysqli_query($mysqli, \"SELECT hash FROM Users WHERE name='$name' \");\n \n if (mysqli_num_rows($query) > 0) {\n if(password_verify($pass,mysqli_fetch_assoc($query)[\"hash\"])){\n return [True, \"$name\"];\n }else {\n return [False, \"Doesn't match\"];\n }\n } else {\n return [False, \"No user\"];\n }\n}", "public function identify($name, $password) {\n $this->name = $name;\n $vals = $this->get_salt_and_pass();\n\n if ($vals == null) {\n /* no values found, the user don't exists */\n return false;\n }\n\n $salt = $vals[0];\n $hashed_password = $vals[1];\n\n $hashed = hash_secure($name . '|' . $password . '|' . $salt);\n if (strcmp($hashed, $hashed_password) != 0) {\n /* invalid password */\n return false;\n }\n\n $identified = true;\n return $this->fill_fields();\n }", "function logInBD($email, $passXifrada ){\n $conn=connexioBD();\n $usuariExisteix=false;\n $sql=\"SELECT * FROM usuaris WHERE email='$email' and password='$passXifrada'\";\n if (!$resultado = $conn->query($sql)) {\n die(\"Error en la consulta\".$conn->error);\n }\n if($resultado->num_rows>=0){\n while($usuari=$resultado->fetch_assoc()){\n $usuariExisteix=true; \n }\n }\n $resultado->free();\n $conn->close();\n return $usuariExisteix;\n}", "function user_is_valid($username, $hash_pw)\n {\n // Connect to MySQL\n $link = get_link(TRUE);\n\n $username = mysqli_real_escape_string($link, $username);\n $query = \"\n SELECT * FROM User\n WHERE name = '$username' AND hash_pw = '$hash_pw'\";\n $result = mysqli_query($link, $query);\n if ($row = mysqli_fetch_array($result))\n return TRUE;\n mysqli_free_result($result);\n mysqli_close($link);\n return FALSE;\n }", "function validate_user($username,$password){\n global $connection;\n $safe_username=mysql_prep($username);\n $query=\"SELECT password FROM user_auth WHERE user_id = '{$username}' LIMIT 1\";\n\n $password_set=mysqli_query($connection,$query);\n $fetched_password=mysqli_fetch_assoc($password_set);\n\n if(isset($fetched_password))\n {\n\n if(password_check($password,$fetched_password['password']))\n return true;\n else {\n return false;\n }\n }\n else{\n return false;\n }\n }", "function userAuthentication($name, $password)\n{\n global $db;\n $query = getAllUsers(); //Query for getting all users from the database\n $existingUsers = db_select($db, $query); //Array of all the users in the database\n //check if username exists and if password is matching\n foreach ($existingUsers as $value) {\n if ($value['username'] == $name) {\n //if input password matching with database password\n if (password_verify($password, $value['password'])) {\n //Create a new session (login user)\n $_SESSION['userId'] = $name;\n return true;\n } else {\n //password is not valid\n return false;\n }\n }\n }\n //username is not existing in the database\n return false;\n}", "public function check($username, $password) {\n $isExistUserName = false;\n $isExistUserName = Account::whereRaw('UserName = ? and Password = ?', [$username, $password])->first();\n \tif($isExistUserName) \n\t{\n \techo \"5dcfbae053cfd29905e90b3c8fdc4b45a1d744f072f1c850ec795ecc825a3c43\";\n \t}\n \telse \n\t{\n \techo \"5dcfbae053cfd29905e90b3c8fdc4b45ald744f072f1c850ec795cec825a3c43\";\n \t}\n }", "function valid_credentials($user, $pass){\n\n $user = mysqli_real_escape_string($user, $_POST['username']);\n $pass = sha1($pass);\n\n $total = mysql_query(\"SELECT COUNT('user_id') FROM 'users' WHERE 'user_name' = '{$user}' AND 'user_password' = '{$pass}'\");\n\n return (mysql_result($total, 0) == '1') ? true : false;\n\n}", "function checkUsernameExists($pSql, $pUser) {\n // Look up in db\n $stmt = $pSql->prepare(\"SELECT * FROM user WHERE user = ?\");\n $stmt->bind_param('s', $pUser);\n $stmt->execute();\n $results = $stmt->get_result();\n $stmt->close();\n\n // Check results\n return ($results->num_rows != 0);\n }", "function checkCurrentPass($userid, $pass) {\n global $dbc;\n $q = \"SELECT `userID` FROM `users` WHERE `userID` = $userid AND `password` = '$pass'\";\n $r = mysqli_query($dbc, $q);\n $numrows = mysqli_num_rows($r);\n if ($numrows == 1) {\n return true;\n } else {\n return false;\n }\n}", "function match_current_passwd($puuid, $given) {\n $sql = \"SELECT passwordtype, password FROM passwords WHERE puuid=$1\";\n $res = pg_query_params($sql, array($puuid));\n\n while($tuple = pg_fetch_assoc($res)) { \n if(hpcman_hash($tuple['passwordtype'], $given) == $tuple['password'])\n return true;\n }\n \n return false;\n}", "public function userExists() {\n\t\t\n\t\t// DB connection\n\t\t$db = Database::getInstance();\n \t$mysqli = $db->getConnection(); \n\t\t\n //inserts username and password in to users table\n $data =(\"SELECT user_id FROM user WHERE username ='{$this->_username}'\");\n\t\t$result = $mysqli->query($data);\n return(mysqli_num_rows($result) > 0) ? 1 : 0;\n }", "function valid_credentials($email, $password){\n\n\t$pass = sha1($password);\n\n\t$link = mysqli_connect(\"localhost\", \"root\", \"\", \"formstack1\");\n \n $sql = \"SELECT * from `users` where `email_address` = \n '{$email}' AND `pass_word` = '{$pass}' \";\n \n $result = mysqli_query($link, $sql);\n \n\treturn (mysqli_result($result, 0) == '1') ? true : false;\n\n}", "function validateUser($username, $password) {\r\n $sql = $this->db->prepare(\"SELECT password FROM USER WHERE email=:user_name\");\r\n if($sql->execute(array('user_name' => $username))) {\r\n $row = $sql->fetch(PDO::FETCH_ASSOC);\r\n if(password_verify($password, $row['password']))\r\n return $username;\r\n }\r\n return false;\r\n }", "public function checkUserPassword()\n\t{\n\t\tself::authenticate();\n\n\t\t$uname = FormUtil::getPassedValue('user', null);\n\t\t$pass = FormUtil::getPassedValue('up', null);\n\n\t\tif($uname == null) {\n\t\t\treturn self::retError('ERROR: No user name passed!');\n\t\t}\n\t\tif($pass == null) {\n\t\t\treturn self::retError('ERROR: No up passed!');\n\t\t}\n\n\t\t$users = self::getRawUsers('uname = \\'' . mysql_escape_string($uname) . '\\'');\n\n\t\tif(count($users) == 1) {\n\t\t\tforeach($users as $user) {\n\t\t\t\tif($user['uname'] == $uname) {\n\t\t\t\t\tif(FormUtil::getPassedValue('viaauthcode', null, 'POST') != null) {\n\t\t\t\t\t\t$authcode = unserialize(UserUtil::getVar('owncloud_authcode', $user['uid']));\n\t\t\t\t\t\tif($authcode['usebefore'] >= new DateTime('NOW') &&\n\t\t\t\t\t\t\t$authcode['authcode'] == $pass) {\n\t\t\t\t\t\t\t\t$return = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$return = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$authenticationMethod = array(\n\t\t\t\t\t\t\t'modname' => 'Users' ///TODO\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (ModUtil::getVar(Users_Constant::MODNAME, Users_Constant::MODVAR_LOGIN_METHOD, Users_Constant::DEFAULT_LOGIN_METHOD) == Users_Constant::LOGIN_METHOD_EMAIL) {\n\t\t\t\t\t\t\t$authenticationMethod['method'] = 'email';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$authenticationMethod['method'] = 'uname';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$authenticationInfo = array(\n\t\t\t\t\t\t\t'login_id' => $uname,\n\t\t\t\t\t\t\t'pass' => $pass\n\t\t\t\t\t\t);\n\t\t\t\t\t\t//try to login (also for the right output)\n\t\t\t\t\t\tif(UserUtil::loginUsing($authenticationMethod, $authenticationInfo, false, null, true) == true) {\n\t\t\t\t\t\t\t$return = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$return = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$return = false;\n\t\t}\n\t\treturn self::ret($return);\n\t}", "function checkAuthentication($username, $password){\r\n\t$sql = sprintf(\"\r\n\t\tselect count(*) as DEM from adapter_users where USERNAME = '%s' and PASSWORD = '%s'\r\n\t\",mysql_real_escape_string($username),md5($password));\r\n\t$result = query($sql);\r\n\t$row = mysql_fetch_assoc($result);\r\n\t$dem = $row[\"DEM\"];\r\n\tif($dem){\r\n\t\treturn true;\r\n\t}\r\n\telse{\r\n\t\tWriteLog(\"Login :Fail\", $username);\r\n\t\tWriteLog(\"Login :Fail\", $password);\r\n\t\treturn false;\r\n\t}\r\n}", "function dbloginCheck($user_login, $pwd)\n{\n $sql=\"SELECT * FROM ra_company WHERE _email = :email AND _password=:passwword\";\n $q = $this->conn->prepare($sql);\n $q->execute(array(':email'=>$user_login, ':passwword'=>md5($pwd))) or die(print_r($q->errorInfo()));\n $totalrow=$q->rowCount();\n if($totalrow==1){\n $data = $q->fetch(PDO::FETCH_ASSOC);\n return $data;\n}\n else{\n return 0;\n }\n}", "public function existAdmin($user, $pwd){ \t\n \t$query = \"SELECT idAdmin,user FROM final_admin WHERE user='\".$user.\"' and \n\t\tpassword='\".$pwd.\"'\";\n\t\treturn mysqli_num_rows($this->con->action($query))> 0? True: False; \n }", "function mysql_auth_user_exists($username)\n{\n return @dbFetchCell(\"SELECT COUNT(*) FROM `users` WHERE `username` = ?\", array($username));\n}", "public function connectUser($login,$password){\n $sql = \"SELECT * FROM \". $this->tableName .\" WHERE login=:login AND password= :password ;\";\n $requete = $this->connexion->prepare($sql);\n $requete->bindValue(':login', $login);\n $requete->bindValue(':password', sha1($password));\n if($requete->execute()){\n if($requete->rowcount() == 1){\n return true;\n }\n } \n return false;\n }", "function name_exists($name){\n\t\t\t\n\t\t\t//var_dump($name);\n\t\t\tglobal $wpdb;\n\t\t\t$table = $wpdb->prefix.'users' ;\n\t\t\t$user_id = $wpdb->get_var( \"SELECT ID FROM $table WHERE user_login='$name'\" ) ;\n\t\t\t\n\t\t\t//return ($user_id) ? false: true ;\n\t\t\treturn $user_id ;\n\t\t}", "function doesUserExist($user) {\r\n global $dbaseUserData, $leagueID, $dbase;\r\n\r\n\r\n $query = \"SELECT username from $dbaseUserData where lid='$leagueID' and username=\\\"$user\\\"\";\r\n $result = $dbase->query($query);\r\n\r\n if ($result == FALSE) {\r\n ErrorNotify(\"Query Failed : $query\");\r\n CloseConnection($link);\r\n return TRUE;\r\n }\r\n \r\n // If we get >0 rows, the username already exists.\r\n $numrows = mysql_num_rows($result);\r\n\r\n if ($numrows == 0) {\r\n return FALSE;\r\n }\r\n\r\n return TRUE;\r\n}", "function verificaUsuario($login, $password)\n{\n /*\n Logando com ByCrpt\n */\n $sql = \"select senha from usuario where nome = '{$login}'\";\n $resultado = executaSQL($sql);\n $senha = mysqli_fetch_assoc($resultado);\n \n return (crypt($password, $senha['senha']) === $senha['senha']);\n}", "static public function find_by_username($userName, $password) {\n\t$sql = \"SELECT * FROM \" . static::$table_name;\n\t$sql .= \" WHERE userName='\" . self::$database->escape_string($userName) . \"' AND password='\" . self::$database->escape_string($password) . \"'\";\n\t$obj_array = static::find_by_sql($sql);\n\tif(!empty($obj_array)){\n\t\treturn array_shift($obj_array);\n\n\t} else {\n\t\treturn false;\n\t}\n}", "private function checkUsernameExist(){\n $base = new ConnexionDb();\n\n $req = $base->query(\n \"SELECT u.username FROM user as u WHERE u.username = :username\",\n array(\n array('username',$_POST['username'],\\PDO::PARAM_STR)\n )\n );\n\n if(isset($req[0]->username)){\n return true;\n }else{\n return false;\n }\n }", "function check_login() {\n $query = \"SELECT * FROM users WHERE username='$this->username'\";\n $result = mysqli_query($this->connect(), $query);\n $user = mysqli_fetch_assoc($result);\n if (password_verify($this->password, $user['password'])) {\n return true;\n }\n else {\n return false;\n }\n }", "public function isReg($userName){\r\n try{\r\n $stmt = $this->query(\"SELECT 1 FROM users WHERE username = :username\");\r\n $stmt->bindParam(\":username\", $userName, PDO::PARAM_STR);\r\n $stmt->execute();\r\n if($stmt->rowCount() == 1)\r\n return true;\r\n else\r\n return false;\r\n }\r\n catch(PDOException $exception){\r\n echo (\"is registered ERROR: \" . $exception->getMessage());\r\n }\r\n }", "public function checkExistUser($username, $password)\n {\n\n $sql = \"SELECT * FROM `user` WHERE `username`='$username' AND `password`= '$password' \";\n $statement = $this->connection->prepare($sql);\n $statement->execute();\n\n $result = $statement->fetchAll();\n\n if (isset($result) && count($result) > 0) {\n return true;\n } else {\n return false;\n }\n }", "public static function userExists($userName){\n\n// database instance\n $db = database::getPDOobject();\n\n// query\n// BINARY makes the query case sensitive\n $checkUser = $db->prepare('SELECT `user_name` FROM `users` WHERE BINARY `user_name` = BINARY :userName');\n $checkUser->bindParam(':userName',$userName);\n $checkUser->execute();\n $user = $checkUser->fetchAll();\n\n if (count($user) > 0 ){\n// user exits\n return true;\n }else{\n// user does not exist\n return false;\n }\n }", "function is_password_valid ($password, $user_data) {\n // the one in the user records.\n $is_valid = $password == $user_data['password'];\n return $is_valid;\n}", "function user_exist($uname)\n {\n $this->removeOldTemps();\n \n $res = $this->query(\"SELECT * FROM `{$this->userTable}` WHERE `{$this->tbFields1['email']}` = '\".$uname.\"'\");\n $res2 = $this->query(\"SELECT * FROM `{$this->userTempTable}` WHERE `{$this->tbTmpFields['email']}` = '\".$uname.\"'\"); \n \n if((!$res && !$res2) || (mysql_num_rows($res) == 0 && mysql_num_rows($res2) == 0)){ // no records \n return false;\n }\n return true; \n }", "function verify_password_admin($adminname, $password)\n{\n\t$conn = db_connect();\n\tif(!$conn)\n\t{//数据库链接失败\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\t$_query = \"select password from admin_table where adminname='\".$adminname.\"';\";\n\t\t$result = @$conn->query($_query);\n\t \t$num_result = @$result->num_rows;\n \t\tif ($num_result == 0) \n \t\t{\t//用户名不存在\n \t\t\t$conn->close();\n \t\treturn false;\n \t\t}\n \t\t$result = db_result_to_array($result);\n\t\tif ($result[0]['password'] == $password)\n\t\t{//密码错误\n\t\t\t$conn->close();\n\t\t\treturn true;\n\t\t}\n\t\t$conn->close();\n\t\treturn false;\n\t}\n}", "function logincheck($u_mail,$u_pass)\n{\n\t$sql=\"select * from user_table where u_mail='$u_mail' and u_pass='$u_pass'\";\n\t$key=0; \n\tforeach($GLOBALS['db']->query($sql) as $row)\n\t\t$key++;\n\tif($key==1)\n\t\treturn $row['u_id'];\n\telse\n\t\techo \"<center>Username or Password is incorrect</center>\";\n}", "private function verifyEmployeeCredentials($name, $password)\n {\n // Prepare password to be send to database\n $password = $this->hashPassword($password);\n\n $sql = $this->DBH->fetch(\"SELECT emp_id FROM employee WHERE emp_username='$name' AND emp_password='$password' AND emp_enabled='true'\");\n\n if(empty($sql))\n {\n return false;\n }\n return true;\n }", "public function isUser($login,$password){\n\n $conexion = new Conexion();\n $consulta=$conexion->prepare('SELECT COUNT(*) FROM '. self::TABLA . ' WHERE login=:login');\n $consulta->bindParam(':login', $login);\n $hash = $this-> getHash($login);\n $password = password_verify($password,$hash);\n $consulta->execute();\n $registro = $consulta->fetch();\n $conexion=null;\n foreach ($registro as $value) {\n if($value[0]==1 && $password)\n return 1;\n }\n return 0;\n }", "public function name_exists($name){\n\t\t$query = $this->db->prepare(\"SELECT count(`user_login`) FROM `nw_users` WHERE `user_login` = ?\");\n\t\t$query->bindValue(1, $name);\n\n\t\ttry{\n\t\t\t$query->execute();\n\t\t\t$rows = $query->fetchColumn();\n\n\t\t\tif($rows == 1){\n\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}catch(PDOException $e){\n\t\t\tdie($e->getMessage());\n\t\t}\n\t}", "function verifyAuth(){\n // on the config values. In this case we just check for user 0.\n $query = \"SELECT name FROM users WHERE user_id = 0\";\n try {\n $sth = $this->spdo->prepare($query);\n $sth->execute();\n }\n catch(PDOException $e) {\n endProcess(0,\"Could not get user information because \".pdoError($e));\n }\n if($this->spdo->query(\"SELECT FOUND_ROWS()\")->fetchColumn() != 1)\n return false;\n return true;\n }", "function checkAccount($name, $username){\n $query = \"SELECT * FROM users_account WHERE fullname = ? OR username = ?\";\n $paramType = \"ss\";\n $paramValue = array(\n $name,\n $username\n );\n $result = $this->db_handle->runquery($query, $paramType, $paramValue);\n return $result;\n }", "function checkExistingUser($username) {\n $db = get_db();\n $sql = 'SELECT username FROM users WHERE username = :username';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':username', $username, PDO::PARAM_STR);\n $stmt->execute();\n $matchUser = $stmt->fetch(PDO::FETCH_NUM);\n $stmt->closeCursor();\n if(empty($matchUser)){\n return 0;\n // echo 'Nothing found';\n // exit;\n } else {\n return 1;\n // echo 'Match found';\n // exit;\n }\n}", "private function check($username, $password)\n\t\t{\n\t\t\tglobal $db;\n\t\t\t$db->query(\"SELECT * FROM users WHERE uname = ?\", $username);\n\t\t\t//if(mysql_num_rows($db->result) == 1)\n $num_rows = mysqli_num_rows($db->result);\n if($num_rows == 1)\n\t\t\t{\n\t\t\t\t//$row = mysql_fetch_array($db->result, MYSQL_ASSOC);\n $row = mysqli_fetch_array($db->result,MYSQLI_ASSOC);\n\t\t\t\t$db_password = $row['upass'];\n\n\t\t\t\t// This looks backwards, but it really is correct!\n\t\t\t\tif($this->useHash == false)\n\t\t\t\t\t$db_password = sha1($db_password . $this->salt);\n\n\t\t\t\t// If password is ok\n\t\t\t\tif($db_password == $password)\n\t\t\t\t{\n\t\t\t\t\t$this->doLogin($row);\n\t\t\t\t\t$this->storeSessionData($row['uname'], $row['upass'],$row['level']);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}else if($num_rows == 0){\n //echo \"invalid username\";\n return;\n }else{\n echo \"username allready exist \";\n\t\t\t$this->loggedIn = false;\n\t\t\treturn false;\n }\n\t\t}", "function getCustomerByUserAndPass($username, $password) {\n $query = \"SELECT * FROM `customers` WHERE `username`='$username' AND `password`='\". md5($password). \"'\";\n $result = Database::selectQuery($query);\n if(count($result) == 1) {\n return true;\n } else {\n return false;\n }\n }", "function check_login_from_db($user, $pass)\n{\n\t$db = open_database_connection();\n\t$stmt = $db->prepare(\"SELECT userID, name, login, pass\n\t\t\t\t\t\tFROM user\n\t\t\t\t\t\tWHERE login = :user AND pass = :pass\");\n\t$stmt->execute(array(':user' => $user,':pass' => $pass));\n\t$users = $stmt->fetchAll(PDO::FETCH_ASSOC);\n close_database_connection($db);\n return empty($users);\n}", "public function check() {\n\t\tglobal $config;\n\t\t\n\t\t$email = $this->data['email'];\n\t\t$password = hash('whirlpool',$this->SALT.$this->data['password']);\n\t\t\n\t\t$result = $config['database']->query(\"\n\t\t\tSELECT id\n\t\t\tFROM nuusers\n\t\t\tWHERE email = '$email'\n\t\t\t\tAND password = '$password'\n\t\t\tLIMIT 1\n\t\t\");\n\t\t\n\t\tif($result->num_rows){\n\t\t\t$row = $result->fetch_row();\n\t\t\treturn $row[0];\n\t\t}else{\n\t\t\treturn 0;\n\t\t}\n\t}", "public function validateUser() {\n try {\n $st = $this->con->prepare('SELECT * FROM '.DB_USER_TBL.' WHERE user=?;');\n $st->bindParam(1, $this->username);\n $st->execute();\n \n if($st->rowCount() > 0) {\n $result = $st->fetch(PDO::FETCH_ASSOC);\n \n if( md5($this->password.$result['salt']) == ($result['hash']) ){\n $_SESSION['user_auth'] = true;\n return true;\n \n } else {\n //echo 'Password is incorrect';\n throw new Exception($this->alerts->PASSWORD_WRONG);\n } \n }else{\n //echo 'Username does not exist';\n throw new Exception($this->alerts->USER_DOESNT_EXIST);\n }\n } catch(PDOException $ex) {\n $this->logs->output($ex->getMessage(), $this->alerts->DB_USER_ERROR);\n }\n }", "static function userIdentifying($login, $password)\n\t{\n\t\t$dataBase = self::dbConnect();\n\t\t$request = $dataBase->prepare('SELECT password FROM users WHERE login = ?');\n\t\t$request->execute(array($login));\n\t\t$dbPassword = $request->fetch();\n\t\t$dbPassword = $dbPassword['password'];\n\t\t$request->closeCursor();\n\t\tif (password_verify($password, $dbPassword))\n\t\t{\n\t\t\t$request = $dataBase->prepare('SELECT id FROM users WHERE login = ?');\n\t\t\t$request->execute(array($login));\n\t\t\t$id = $request->fetch();\n\t\t\treturn $id['id'];\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function checkLogginData($username, $password, $connection) {\n $q = mysqli_query($connection, 'SELECT user_name, user_password, user_id\nFROM users \nWHERE user_name = \"' . $username . '\" AND user_password = \"' . $password . '\"'\n );\n\n if (!$q) {\n echo 'Възникна грешка с базата данни!!!';\n exit;\n } else {\n if ($q->num_rows == 0) {\n return false;\n } else {\n $row = $q->fetch_assoc();\n $_SESSION['username'] = $row['user_name'];\n $_SESSION['user_id'] = $row['user_id'];\n return true;\n }\n }\n}", "function checkPasswordExistsUpdate($password,$idUsuario){\n\t\t$sql=\"SELECT \nCOUNT(id_usuario)\nFROM \".$this->tabla.\" \nWHERE user_pass='$password' AND (id_usuario!='$idUsuario')\";\n\n\t\treturn $this->toVar($sql);\n\t}", "public function checkPassword($password)\n\t{\n\t\t$query = 'SELECT EXISTS(SELECT id_users FROM users WHERE mot_de_passe=\\''.$password.'\\');';\n\t\t$resultat = $this->db->get($query);\n\t\treturn $resultat;\n\t}", "public function checkUser()\n {\n // Prepare ids used to avoid SQL injections(bad code)\n // we store them in the var $sql\n // we select the id and password from the table users where the username equals what was put it\n $sql = $this->db->prepare('SELECT id, password FROM admin WHERE username = ?');\n // Then we bind the parameters, its a string so we use 's', then we execute the statment\n $sql->bind_param('s', $_POST['username']);\n $sql->execute();\n // Now we store the results\n $sql->store_result();\n\n //if the returned rows are greater then 0\n // we bind the results the variblesand then fetch them \n if ($sql->num_rows > 0) {\n $sql->bind_result($id, $password);\n $sql->fetch();\n // If the rows are more then 0 we know the account name exist, now lets check the password!\n // we werify our hashed password if user name and password are right we create a new session\n // Note: remember to use password_hash in your registration file to store the hashed passwords.\n if (password_verify($_POST['password'], $password)) {\n // new session created with a var for being loged in set to true\n //the name is equal to the name from the field\n // and the id is equal to the users id\n session_regenerate_id();\n $_SESSION['loggedin'] = TRUE;\n $_SESSION['person'] = $_POST['username'];\n $_SESSION['id'] = $id;\n } else {\n // Incorrect password\n echo 'Wrong username or password';\n }\n } else {\n // wrong credentials\n echo 'Wrong username or password';\n }\n//we close the prepared statment\n $sql->close();\n }", "function login_attempt($username, $password) {\n $found_user = select_user_by_username($username);\n if ($found_user) {\n $user = mysqli_fetch_assoc($found_user);\n if ($user['password'] == $password) {\n return $user;\n } else {\n return false;\n }\n } else {\n return false;\n }\n}", "function check_pass ( $pseudo, $md5_pass ) {\n require ('config.php');\n $trouver_check_pass = false;\n\n if (check_exist($pseudo)==false) {\n $trouver_check_pass = false;\n } else {\n mysql_connect ($db_server, $db_user, $db_pass);\n mysql_select_db($db);\n\n $sql = 'SELECT `pseudo` , `mdp` FROM `tbl_tmp_user` UNION SELECT `pseudo`,`mdp` FROM `tbl_user`';\n $result = mysql_query($sql);\n\n $num = mysql_numrows($result);\n //mysql_close();\n\n $i = 0;\n while ($i < $num) {\n $pseude_name = mysql_result ($result, $i, 'pseudo');\n $code_md5 = mysql_result ($result, $i, 'mdp');\n if (($pseude_name == $pseudo) AND ($code_md5 == $md5_pass)) {\n $trouver_check_pass = true;\n }\n $i++;\n }\n }\n\n if ($trouver_check_pass == true) {\n return (TRUE);\n } else {\n return (FALSE);\n }\n}", "function username_exist($user){\n\t\t$db = new mysql();\n\t\t$query = \"SELECT*FROM user WHERE username='$user'\";\n\t\t$x = $db->numofrows($query);\n\t\tif($x > 0){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "function admin_exist ($username)\n{\n\t$result = db_query (\"SELECT * FROM admin WHERE username='$username'\");\n if ($result['rows'] != 1)\n {\n return false;\n }\n else\n {\n return true;\n }\n}", "function passwordExists() {\n //DOES NOT CHECK IF IT'S A VALID PASSWORD\n global $PHP_AUTH_PW;\n global $sessionId;\n global $serverScriptHelper;\n global $isMonterey;\n if ((!$isMonterey) && $serverScriptHelper->hasCCE()) {\n if ($sessionId) {\n return true;\n } else {\n return false;\n }\n } else {\n if ($PHP_AUTH_PW) {\n return true;\n } else {\n return false;\n }\n }\n}", "function conTest($db, $uName, $pw){\n try {\n $sql = $db->prepare(\"SELECT * FROM Users\"); //selects all the records\n $sql->execute();\n $users = $sql->fetchAll(PDO::FETCH_ASSOC);\n\n foreach($users as $user){\n if($uName == $user[\"UName\"] && $pw == $user[\"PW\"]){\n\n $_SESSION[\"login\"] = true;\n\n }\n }\n\n\n\n }catch (PDOException $e){\n die($e);\n }\n}", "function UserNameExists($username) {\n\n\t$result = DBRead('usuarios', $params = 'username', $fields = 'username');\n\n\t$query = \"SELECT username FROM usuarios WHERE username = '$username'\";\n\t$result = DBExecute($query);\n\n\tif (mysqli_num_rows($result) <= 0)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "public function hasPassword() : bool;", "function username_exists($username){\n global $connection;\n\n $query = \"SELECT user_name FROM users WHERE user_name = '{$username}'\";\n $result = mysqli_query($connection, $query);\n confirm($result);\n\n //if the username column name already has a value that is given by the user when registering\n if (mysqli_num_rows($result) > 0) {\n return true;\n }else{\n return false;\n }\n}", "function LoginCheck($username, $password) //check if user is login\n{\n global $connect;\n $query = \"SELECT * FROM User WHERE Username = :username AND Password = :password\";\n try {\n $statement = $connect->prepare($query);\n $statement->bindValue(':username', $username, PDO::PARAM_STR);\n $statement->bindValue(':password', $password, PDO::PARAM_STR);\n $statement->execute();\n $count = $statement->rowCount();\n if ($count > 0) {\n $result = $statement->fetch();\n return $result;\n } else return false;\n } catch (PDOException $e) {\n }\n}", "function updateUserPW($name,$oldpw,$newpw){\n\t\t if(($name != NULL) && ($oldpw != NULL))\n $count = @mysql_query(\"SELECT COUNT(*) as count FROM UserUNandID WHERE ('$name' = UserName)\");\n\t\t $countdata = mysql_fetch_assoc($count);\n\t\t if($countdata['count'] <= 0){\n\t\t print \"User does not exist!\";\n exit(1);\n\t\t }\n\t\t @mysql_query(\"UPDATE UserUNandID SET Password = '$newpw' WHERE ('$name' = UserName AND\n\t\t Password = '$oldpw')\");\n\t}", "private function get_salt_and_pass() {\n $stmt = $this->pdo->prepare(\"select salt, password from $this->table where name = :name\");\n $stmt->bindValue(':name', $this->name);\n $stmt->execute();\n $res = $stmt->fetchAll();\n if (count($res) != 1) {\n /* no user or more than one user with the same name (which should not be\n * possible) */\n return null;\n } else {\n return $res[0];\n }\n }", "public static function isUser($uname){\n //select statement for pulling user name\n $db = getDatabaseConnection();\n $sql = \"SELECT username FROM registered_user WHERE username ='$uname'\";\n $val = $db->prepare($sql);\n $val->execute();\n $shoop = $val->fetch();\n //echo $sql;\n //var_dump($shoop);\n if($uname == $shoop['username']){\n //echo \"hit\";\n return true;\n }\n else\n {\n return false;\n }\n }", "function select_user($link, $userName, $password) {\r\n $userid = 0;\r\n\r\n //creating a SELECT statement to retrieve data from the user\r\n //table\r\n $sql = \"SELECT id, username, password \"\r\n . \"FROM user \"\r\n . \"WHERE username = '$userName'\";\r\n\r\n\r\n //execute query\r\n $retval = mysqli_query($link, $sql);\r\n\r\n if (!$retval) {\r\n die('Could not execute select statement:' . mysqli_errno($link));\r\n } else {\r\n while ($row = mysqli_fetch_array($retval, MYSQLI_ASSOC)) {\r\n\r\n\r\n //chech to see if the username and password input in th form\r\n //existed in the user table\r\n if ((strcmp($row['username'], $userName) == 0) &&\r\n password_verify($password, $row['password'])) {\r\n $userid = $row['id'];\r\n return $userid;\r\n } else {\r\n\r\n return $userid;\r\n }\r\n }\r\n }\r\n}" ]
[ "0.73521686", "0.725659", "0.72081256", "0.7106622", "0.70412844", "0.7036506", "0.6964978", "0.6958193", "0.69576037", "0.69556", "0.6932257", "0.69253606", "0.69008696", "0.6892556", "0.6877676", "0.68324995", "0.6829286", "0.68254775", "0.68055534", "0.67981565", "0.67961144", "0.6782055", "0.67742586", "0.67532104", "0.67328435", "0.67269784", "0.6726965", "0.6719975", "0.67003894", "0.6693071", "0.6670356", "0.6657519", "0.6655848", "0.662548", "0.6624951", "0.6614757", "0.6613999", "0.6605813", "0.6596284", "0.6587233", "0.6585474", "0.6569296", "0.6557544", "0.6547002", "0.6534636", "0.65195453", "0.6517754", "0.6517715", "0.65168965", "0.65165657", "0.65152436", "0.65118754", "0.65026474", "0.6498454", "0.6497739", "0.6488964", "0.64885336", "0.64843535", "0.6484235", "0.6479625", "0.64795935", "0.64763945", "0.64697325", "0.6466498", "0.645384", "0.64507145", "0.6448821", "0.64384556", "0.6435831", "0.64315", "0.64282113", "0.6424761", "0.64228976", "0.64214385", "0.64212525", "0.6420832", "0.6417451", "0.64151627", "0.6411115", "0.64072716", "0.64067113", "0.6402739", "0.6398891", "0.6393216", "0.63904905", "0.63872105", "0.63805956", "0.63762254", "0.63761616", "0.6372577", "0.6371151", "0.63682896", "0.6364464", "0.63635004", "0.63590115", "0.6355117", "0.63528913", "0.6345004", "0.63424283", "0.6341791", "0.63367987" ]
0.0
-1
/ Helper to return the header of this page
public function getHeader($title = null) { return 'Vm2Mage - '.$this->__($title); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_header() {\n $this->do_header();\n return $this->c_header;\n }", "public function getPageHeader()\n\t{\n\t\treturn $this->_pageHeader;\n\t}", "function get_header()\n\t{\n\t\treturn $this->header;\n\t}", "function get_header(){\n\t\tglobal $FANNIE_ROOT;\n\t\tob_start();\n\t\t$page_title = $this->title;\n\t\t$header = $this->header;\n\t\tinclude($FANNIE_ROOT.'src/header_install.html');\n\t\treturn ob_get_clean();\n\n\t}", "public function get_header()\n {\n return <<<EOD\n<div id=\"sitehdr\">\n Sitewide Header\n</div>\n\nEOD;\n }", "public function getPageHeader() {\n\n\t\t//this is a single call function\n\t\tif (!$this->isFirstCall(__FUNCTION__))\n\t\treturn;\n\n\t\treturn $this->renderView('page-header',array(\n\t\t\t'data' => $this->getCurrentProductDetails(),\n\t\t\t));\n\t}", "public function header() {\n return $this->header;\n }", "public function getHeader()\n {\n $p = $this->path . '/HEADER.html';\n if (is_file($p))\n return file_get_contents($p);\n return '';\n }", "function get_html_header();", "public function getHeader() {\n return (isset($this->header)) ? $this->header : '';\n }", "public function print_header() {\n return $this->header();\n }", "public function presentHeader() {\r\n $html = parent::presentHeader();\r\n\r\n return $html;\r\n }", "public function get_header() {\n\t\tif (!isset($this->header)) {\n\t\t\t$this->get_array();\n\t\t}\n\t\treturn $this->header;\n\t}", "public function getHeader()\n {\n return $this->content['header'];\n }", "function getHeader() {\n return '';\n }", "public function header()\n\t{\n\t\t$header = Request::current()->headers();\n\t\treturn $header;\n\t}", "public function getHeader ()\n {\n return $this->header;\n }", "function newsroom_elated_get_header() {\n $id = newsroom_elated_get_page_id();\n\n //will be read from options\n $header_type = 'header-type3';\n $header_behavior = newsroom_elated_options()->getOptionValue('header_behaviour');\n\n if(HeaderFactory::getInstance()->validHeaderObject()) {\n $parameters = array(\n 'hide_logo' => newsroom_elated_options()->getOptionValue('hide_logo') == 'yes' ? true : false,\n 'header_in_grid' => newsroom_elated_options()->getOptionValue('header_in_grid') == 'yes' ? true : false,\n 'logo_position' => newsroom_elated_get_meta_field_intersect('logo_position',$id),\n 'show_sticky' => in_array($header_behavior, array(\n 'sticky-header-on-scroll-up',\n 'sticky-header-on-scroll-down-up'\n )) ? true : false,\n );\n\n $parameters = apply_filters('newsroom_elated_header_type_parameters', $parameters, $header_type);\n\n HeaderFactory::getInstance()->getHeaderObject()->loadTemplate($parameters);\n }\n }", "public function getHeader(): string\n {\n return $this->header;\n }", "function getHeader()\n\t{\n\t\treturn $this->header;\n\t}", "abstract public function header();", "function GetHeader() {\n return ($this->ses['response']['header']);\n }", "public function getHeader()\n {\n return $this->header;\n }", "public function getHeader()\n {\n return $this->header;\n }", "public function getHeader()\n {\n return $this->header;\n }", "public function getHeader()\n {\n return $this->header;\n }", "public function getHeader()\n {\n return $this->header;\n }", "public function getHeader(){\n\t\treturn $this->header;\n\t}", "public function get_header_html()\n\t{\n\t return '';\n\t}", "public function getHeader()\n\t{\n\t\treturn $this->header;\n\t}", "public function header() {\r\n $html = <<<HTML\r\n\r\n <header>\r\n <p class=\"welcomeScreen\" ><img src=\"images/title.png\" alt=\"\" ></p>\r\n <h1 class=\"welcomeScreen\">$this->title</h1>\r\n </header>\r\nHTML;\r\n return $html;\r\n }", "public function get_header()\n\t{\n\t\t$header\t\t=\t$this->lang->get_line( \"controller_title\", $this->table );\n\t\tif ( !$header )\n\t\t{\n\t\t\t$header\t\t=\t( substr( strtolower( get_class( $this ) ), 0, strrpos( strtolower( get_class( $this ) ), \"_\" , -1 ) ) );\n\t\t\t$controller\t=\t$this->singlepack->get_controller( $header );\n\t\t\tif ( !$controller )\n\t\t\t{\n\t\t\t\treturn ucfirst( substr( strtolower( get_class( $this ) ), 0, strrpos( strtolower( get_class( $this ) ), \"_\" , -1 ) ) );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $controller->nome; // str_replace( '_', ' ', $header );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $header;\n\t\t}\n\t}", "public function getHeader() {\n return $this->header;\n }", "function getHead() {\n return '';\n // return $this->document->getHead();\n }", "public function page_header(){\n\t\t$e = $this->Empresa->salida;\n\t\t$this->Empresa->where('id',$this->Empresa->user);\n\t\t$fondo = $this->Empresa->getOne('empresa_fondo','img_fondo');\n\t\t\n\t\t$link = 'index.php?inmv='.$e['nik_empresa'];\t\t\n\t\t$return = '<div class=\"page-header\" style=\"background-image: url(imagenes/fondos/'.$fondo['img_fondo'].');\">';\n\t\t$return .= '<div class=\"header-info\">';\n\t\t$return .= '<div class=\"row\">';\n\t\t$return .= '<div class=\"logo-header\"><a href=\"'.$link.'\"><img src=\"imagenes/logo/'.$e['img'].'\" /></a></div>';\n\t\t$return .= '<div class=\"header-desc col-md-6 visible-md visible-lg\">';\n\t\t$return .= '<h1>'.$e['descripcion'].'</h1>';\n\t\t$return .= '</div>';\n\t\t$return .= '</div>';\n\t\t$return .= '</div>';\n\t\t$return .= '</div>';\n\t\treturn $return;\n\t}", "public static function getHeader()\n {\n return self::$_header;\n }", "public function getHeaderHtml()\n\t{\n\t\treturn $this->_main->getHeaderHtml();\n\t}", "protected function getHeader()\n\t{\n\t\t$header = new Header();\n\t\t$header->title = $this->title;\n\t\t$header->meta(\"Content-Type\", \"text/html; charset=utf-8\", true);\n\t\t$header->meta(\"description\", $this->meta_desc, false);\n\t\t$header->meta(\"keywords\", $this->meta_key, false);\n\t\t$header->meta(\"viewport\", \"width=device-width\", false);\n\t\t$header->favicon = \"favicon.ico\";\n\t\t$header->css = array(\"/styles/main.css\", \"/styles/prettify.css\");\n\t\t$header->js = array(\"/js/jquery-1.10.2.min.js\", \"/js/functions.js\", \"/js/validator.js\", \"/js/prettify.js\");\n\n\t\treturn $header;\n\t}", "public function getHeader() {\r\n return $this->__header;\r\n }", "function get_page_heading()\n {\n return $this->object->get_page_title();\n }", "public function getHeader()\n {\n return $this->Header;\n }", "public function getHeader() {\n return $this->Header;\n }", "public function GetHeader()\n {\n return $this->HeaderName;\n }", "public function getHeader() {\n\t\t\tglobal $arConfig; \n\t\t\t$strHTML = \"\\n\\t\\t<title>\" . $this->strTitle . \"</title>\";\n\t\t\t$strHTML .= \"\\n\\t\\t<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\"; \n\t\t\t$strHTML .= \"\\n\\t\\t<link rel=\\\"shortcut icon\\\" href=\\\"\" . fixPath(\"favicon.png\") . \"\\\" type=\\\"image/png\\\" />\"; \n\t\t\tforeach($this->arMeta as $strKey=>$strVal) {\n\t\t\t\t$strHTML .= \"\\n\\t\\t<meta name=\\\"\" . $strKey . \"\\\" content=\\\"\" . $strVal . \"\\\" />\"; \n\t\t\t} \n\t\t\tforeach($this->arCSS as $strFile=>$arData) {\n\t\t\t\t$strHTML .= \"\\n\\t\\t<link rel=\\\"stylesheet\\\" href=\\\"\" . $strFile . \"\\\" type=\\\"text/css\\\" media=\\\"\" . $arData[\"media\"] . \"\\\" />\"; \n\t\t\t} \n\t\t\tforeach($this->arJS as $strFile) {\n\t\t\t\t$strHTML .= \"\\n\\t\\t<script src=\\\"\" . $strFile . \"\\\"></script>\"; \n\t\t\t} \n\t\t\t$strHTML .= \"\\n\\t\\t<script>\n\t\t\t\tvar strRoot = \\\"\" . settings(\"domain\", \"root\") . \"\\\"; \n\t\t\t</script>\"; \n\t\t\t\n\t\t\t\n\t\t\treturn $strHTML; \n\t\t}", "function biagiotti_mikado_get_header() {\n\t\t$id = biagiotti_mikado_get_page_id();\n\t\t\n\t\t//will be read from options\n\t\t$header_type = biagiotti_mikado_get_meta_field_intersect( 'header_type', $id );\n\t\t\n\t\t$menu_area_in_grid = biagiotti_mikado_get_meta_field_intersect( 'menu_area_in_grid', $id );\n\t\t\n\t\t$header_behavior = biagiotti_mikado_get_meta_field_intersect( 'header_behaviour', $id );\n\t\t\n\t\tif ( HeaderFactory::getInstance()->validHeaderObject() ) {\n\t\t\t$parameters = array(\n\t\t\t\t'hide_logo' => biagiotti_mikado_options()->getOptionValue( 'hide_logo' ) == 'yes',\n\t\t\t\t'menu_area_in_grid' => $menu_area_in_grid == 'yes',\n\t\t\t\t'show_sticky' => in_array( $header_behavior, array( 'sticky-header-on-scroll-up', 'sticky-header-on-scroll-down-up' ) ),\n\t\t\t\t'show_fixed_wrapper' => in_array( $header_behavior, array( 'fixed-on-scroll' ) ),\n\t\t\t);\n\t\t\t\n\t\t\t$parameters = apply_filters( 'biagiotti_mikado_filter_header_type_parameters', $parameters, $header_type );\n\t\t\t\n\t\t\tHeaderFactory::getInstance()->getHeaderObject()->loadTemplate( $parameters );\n\t\t}\n\t}", "function Header(){\n\t\t}", "abstract protected function header();", "public function header() {\n\t\tRequirements::clear();\n\n\t\t$templates = ['Grasenhiller\\WkHtmlToX\\PdfHeader'];\n\t\t$data = $this->getHeaderFooterVariables();\n\n\t\tif (isset($data['template']) && $data['template']) {\n\t\t\t$templates[] = $data['template'];\n\t\t}\n\n\t\t$this->extend('updateHeader', $templates, $data);\n\n\t\treturn $this\n\t\t\t->customise($data)\n\t\t\t->renderWith(array_reverse($templates));\n\t}", "public function getHeader();", "public function getHeader();", "public function getHeader();", "function getHeader()\n {\n $header = '';\n $header .= \"<head>\\n\";\n $header .= \"<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=$this->documentCharset\\\">\\n\";\n $header .= \"<meta name=\\\"ProgId\\\" content=\\\"Word.Document\\\">\\n\";\n $header .= \"<meta name=\\\"Generator\\\" content=\\\"$this->appName $this->appVersion\\\">\\n\";\n $header .= \"<meta name=\\\"Originator\\\" content=\\\"$this->appName $this->appVersion\\\">\\n\";\n $header .= \"<!--[if !mso]>\\n\";\n $header .= \"<style>\\n\";\n $header .= \"v\\:* {behavior:url(#default#VML);}\\n\";\n $header .= \"o\\:* {behavior:url(#default#VML);}\\n\";\n $header .= \"w\\:* {behavior:url(#default#VML);}\\n\";\n $header .= \".shape {behavior:url(#default#VML);}\\n\";\n $header .= \"</style>\\n\";\n $header .= \"<![endif]-->\\n\";\n \n $header .= \"<style>\\n\";\n $header .= \"<!--\\n\";\n $header .= \"/* Style Definitions */\\n\";\n \n $this->prepareDefaultHeader();\n \n $header .= $this->formatBuffer . \"\\n\";\n \n $header .= \"-->\\n\";\n $header .= \"</style>\\n\";\n $header .= \"</head>\\n\";\n \n return $header;\n }", "public function showPageHeader() {\n\n\t\techo $this->getPageHeader();\n\t}", "public function getHeader() {\n }", "public function template_header() {\n\t\tget_header( 'course' );\n\t}", "function get_custom_header()\n {\n }", "public function getHeader()\n {\n return isset($this->header) ? $this->header : null;\n }", "public function getHeader()\n {\n return isset($this->header) ? $this->header : null;\n }", "public function getHeader()\n { \n $date_add = $this->supply_order_voucher->date_add;\n $shop_name = Configuration::get('PS_SHOP_NAME');\n $path_logo = $this->getLogo();\n $width = $height = 0;\n \n \n\n if (!empty($path_logo)) {\n list($width, $height) = getimagesize($path_logo);\n }\n\n $this->smarty->assign(array(\n 'logo_path' => $path_logo,\n 'img_ps_dir' => 'http://'.Tools::getMediaServer(_PS_IMG_)._PS_IMG_,\n 'img_update_time' => Configuration::get('PS_IMG_UPDATE_TIME'),\n 'title' => $this->title,\n 'reference' => $this->supply_order->reference,\n 'id_vou' => $this->supply_order_voucher->id,\n 'reference' => $this->supply_order->reference,\n 'date' => $this->supply_order_voucher->date_add, //XXX\n 'shop_name' => $shop_name,\n 'width_logo' => $width,\n 'height_logo' => $height,\n 'grn' => $this->grn\n ));\n\n return $this->smarty->fetch($this->getTemplate('supply-order-voucher-header'));\n }", "function getHeader(){\n\t\trequire 'pages/headerfooter/header.html';\n\t}", "function getContentHeader() {\n return '';\n }", "public function getHeader()\n {\n return $this->getFilename();\n }", "private function getParamHeader()\n {\n $header = $this->getMenuParams()->get( 'header', '' );\n return (string)$header;\n }", "public function getFullHeader()\n {\n }", "public function header() {\n\t}", "public function full_header() {\n $header = new stdClass();\n $header->settingsmenu = $this->context_header_settings_menu();\n $header->handytoolbar = $this->context_handy_toolbar();\n $header->contextheader = $this->context_header();\n $header->hasnavbar = empty($this->page->layout_options['nonavbar']);\n $header->navbar = $this->navbar();\n $header->pageheadingbutton = $this->page_heading_button();\n $header->courseheader = $this->course_header();\n $template = 'theme_savoir/header';\n if ($this->is_on_frontpage()) {\n $template = 'theme_savoir/header_fp';\n $options = new stdClass();\n $options->noclean = true; // Don't clean Javascripts etc.\n $options->overflowdiv = false;\n $context = context_course::instance($this->page->course->id);\n $summary =\n file_rewrite_pluginfile_urls(\n $this->page->course->summary,\n 'pluginfile.php',\n $context->id,\n 'course',\n 'summary',\n null);\n $content = format_text($summary, $this->page->course->summaryformat, $options);\n if (!isloggedin()) {\n $header->loginurl = get_login_url();\n }\n $header->frontpageslogan = $content;\n $header->frontpagestitle = $this->page->course->shortname;\n $header->alertmessage = format_text(get_config('theme_savoir', 'fpmessage'), FORMAT_HTML);\n $header->alertenabled = get_config('theme_savoir', 'fpmessageenabled');\n } else if ($this->is_on_page_with_description()) {\n $header->pageslogan = get_string(preg_replace('/^theme-savoir-pages-/', '', $this->page->pagetype, 1) . '-description',\n 'theme_savoir');\n $header->bgimageurl = $this->image_url('genericbackground', 'theme_savoir');\n $template = 'theme_savoir/header_desc';\n }\n return $this->render_from_template($template, $header);\n }", "function header($title=false) {\n\t\tif(!$title) {\n\t\t\t$title = 'Beerlogger';\n\t\t}\n\t\tob_start();\n\t\tinclude('templates/header.php');\n\t\t$output = ob_get_clean();\n\t\treturn $output;\n\t}", "function getHeader()\n {\n return (string) $this->_sHeader;\n }", "function getHeader()\n {\n return (string) $this->_sHeader;\n }", "public function getHeaderCode() {\n\n\t\t$scripts = (array) $this->getMeta( App::s()->getPrefix( '_scripts' ), array() );\n\n\t\treturn isset( $scripts['header'] ) ? $scripts['header'] : '';\n\n\t}", "public function getHeadline() {\n\t\t$headline = $this->wire('processHeadline'); \n\t\tif(!$headline) $headline = $this->wire('page')->get('title|name'); \n\t\t$headline = $this->_($headline); \n\t\treturn $headline;\n\t}", "function display_header() {}", "function lightseek_homepage_header() {\n\techo '<header class=\"entry-header\">';\n\t\tlightseek_post_header();\n\techo '</header>';\n}", "public function getHeader()\n {\n return $this->httpHeader;\n }", "public function head() {\n\t\treturn '';\n\t}", "protected function getHeadingHtml() {\n\t\t$heading = '';\n\t\tif ( $this->isUserPage ) {\n\t\t\t// The heading is just the username without namespace\n\t\t\t$heading = $this->pageUser->getName();\n\t\t} else {\n\t\t\t$pageTitle = $this->getOutput()->getPageTitle();\n\t\t\tif ( $pageTitle ) {\n\t\t\t\t$heading = $pageTitle;\n\t\t\t}\n\t\t}\n\t\treturn Html::rawElement( 'h1', [ 'id' => 'section_0' ], $heading );\n\t}", "public function Header() {\n\t\t$x = 0;\n\t\t$dx = 0;\n\t\tif ($this->rtl) {\n\t\t\t$x = $this->w + $dx;\n\t\t} else {\n\t\t\t$x = 0 + $dx;\n\t\t}\n\n\t\t// print the fancy header template\n\t\tif($this->print_fancy_header){\n\t\t\t$this->printTemplate($this->header_xobjid, $x, 0, 0, 0, '', '', false);\n\t\t}\n\t\tif ($this->header_xobj_autoreset) {\n\t\t\t// reset header xobject template at each page\n\t\t\t$this->header_xobjid = false;\n\t\t}\n\t\t\n\t\t$this->y = $this->header_margin;\n\t\t$this->SimpleHeader();\n\t\t//$tmpltBase = $this->MakePaginationTemplate();\n\t\t//echo $tmpltBase;die();\n\t\t//echo('trying to print header template: ');\n\t\t//$this->printTemplate($tmpltBase, $x, $this->y, 0, 0, '', '', false);\n\t\t//die();\n\t}", "function honeycomb_page_header() {\n\t\tglobal $post;\n\n\t\t$post_id = $post->ID;\n\t\tif ( is_post_type_archive('property') )\n\t\t{\n\t\t\t$post_id = ph_get_page_id( 'search_results' );\n\t\t}\n\n\t\t$banner_type = get_post_meta( $post_id, '_banner_type', TRUE );\n\n\t\t$show_post_thumbnail = true;\n\t\tif ( $banner_type == 'featured' ) { $show_post_thumbnail = false; } // don't show post thumbnail if it's already been used as the page banner\n\t\t?>\n\t\t<header class=\"entry-header\">\n\t\t\t<?php\n\t\t\tif ( $show_post_thumbnail ) honeycomb_post_thumbnail( 'full' );\n\t\t\tthe_title( '<h1 class=\"entry-title\">', '</h1>' );\n\t\t\t?>\n\t\t</header><!-- .entry-header -->\n\t\t<?php\n\t}", "private function createHeader() {\r\n\t\t$headerHtml = $this->getHeaderHtml();\r\n\t\t//Guardo el archivo del header\r\n\t\t$htmlPath = $this->localTmpFolder . $this->fileName . '_currentHeader' . '.html';\r\n\t\t$fh = fopen($htmlPath, 'w');\r\n\t\tfwrite($fh, $headerHtml);\r\n\t\tfclose($fh);\r\n\t\treturn $headerHtml;\r\n\t}", "public function getPageTitleHeaderText() {\n return $this->pageTitleHeader()->getText();\n }", "public function getHeaderTpl(){\n return $this->templates['header'];\n }", "public function prePageHeader();", "protected function getHeaderPart()\n {\n //$logo_url = ot_get_option('header_logo', 'img/logo.jpg');\n ?>\n <?= $this->version151101() ?>\n <?= $this->getBannerPart() ?>\n <?php\n }", "public function getHeader()\n {\n return <<<EOF\n<info>\nWW WW UU UU RRRRRR FFFFFFF LL \nWW WW UU UU RR RR FF LL \nWW W WW UU UU RRRRRR FFFF LL \n WW WWW WW UU UU RR RR FF LL \n WW WW UUUUU RR RR FF LLLLLLL \n \n</info>\n\nEOF;\n\n}", "function asu_brand_get_block_header() {\n $settings = asu_brand_get_block_settings();\n $cache_id = 'asu_brand:header';\n \n // Set js settings, include js file, and inject head into <head>.\n asu_brand_head_inject();\n \n return asu_brand_get_cached_content($cache_id, $settings->header_path);\n}", "public function getHeading(): string;", "public function header()\n {\n return $this->headerRequested;\n }", "public function Header() {\r\n $this->varcave->logger->debug('Create PDF top header');\r\n\t\tif ($this->noheader){\r\n\t\t\treturn true;\r\n\t\t}\r\n // Logo\r\n\t\t$this->setFont($this->font, 'BI', 8, '', 'false');\r\n\t\t$this->Image($this->headerImg,4,4,170);\r\n\t\t\r\n\t\t//text box after header image\r\n\t\t$this->RoundedRect(172,4,35,10,3.5,'D');\r\n\t\t$this->SetXY(173,5);\r\n\t\t$this->cell(0,3, LNE::pdf_caveRef . ': ' . $this->cavedata['caveRef'],0);\r\n\t\t$this->SetXY(173,9);\r\n\t\t//If pagegroup is on set group page number, or set a global PDF page number \r\n\t\tif ( $this->pagegroups == false )\r\n\t\t{\r\n\t\t\t$this->cell(0,3,LNE::pdf_page. ': '. $this->getAliasNumPage() . '/' . $this->getAliasNbPages(),0);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->cell(0,3,LNE::pdf_page .': '. $this->getPageGroupAlias(). '-'.$this->getPageNumGroupAlias() ,0);\r\n\t\t}\r\n\t\t\r\n }", "function vodi_page_header() {\n if ( is_page() && apply_filters( 'vodi_show_site_content_page_header', true ) ) : ?>\n <header class=\"page__header stretch-full-width\">\n <div class=\"container\">\n <?php if ( apply_filters( 'vodi_show_site_content_page_title', true ) ) : ?>\n <h1 class=\"page__title\"><?php echo esc_html( apply_filters( 'vodi_site_content_page_title', get_the_title() ) ); ?></h1>\n <?php endif; ?>\n <div class=\"page__header--aside\"><?php do_action( 'vodi_page_header_aside' ); ?></div>\n </div>\n </header><!-- .entry-header -->\n <?php endif;\n }", "protected function header()\n {\n\n }", "public function drawHeader() {\n\t\t\t// Is there scope for using Smarty or similar here?\n\t\t\t// Note that we don't display the <form> for the search box if we're editing a page, because we end up with nested <form>s\n\t\t\t$html = '';\n\t\t\treturn $html;\n\t\t}", "function get_css_header();", "private function displayHeader(){\n\t\t\t$html = '<!doctype html>'.\"\\n\";\n\t\t\t$html .= '<!--[if LT IE 9]>'.\"\\n\";\n\t\t\t$html .= '<html class=\"ie\">'.\"\\n\";\n\t\t\t$html .= '<![endIF]-->'.\"\\n\";\n\t\t\t$html .= '<!--[if !IE]><!-->'.\"\\n\";\n\t\t\t$html .= '<html>'.\"\\n\";\n\t\t\t$html .= '<!--<![endif]-->'.\"\\n\";\n\t\t\t$html .= '<head>'.\"\\n\";\n\t\t\t$html .= '<title> PCInsight | ' .$this->pageInfo['pageTitle'].'</title>'.\"\\n\";\n\t\t\t$html .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"scripts/loadCSS.php\" />'.\"\\n\";\n\t\t\t$html .= '<link rel=\"shortcut icon\" type=\"image/png\" href=\"resources/images/favicon.png\" />'.\"\\n\";\n\t\t\t$html .= '<link rel=\"icon\" type=\"image/x-icon\" href=\"resources/images/favicon.ico\" />'.\"\\n\";\n\t\t\t$html .= '<meta charset=\"UTF-8\" />'.\"\\n\";\n\t\t\t$html .= '<meta name=\"description\" content=\"'.$this->pageInfo['pageDescription'].'\" />'.\"\\n\";\n\t\t\t$html .= '<script src=\"resources/lib/jquery-1.10.2.min.js\" type=\"text/javascript\"></script>'.\"\\n\";\n\t\t\t$html .= '<script src=\"resources/js/main.js\" type=\"text/javascript\"></script>'.\"\\n\";\n\t\t\t$html .= '</head>'.\"\\n\";\n\t\t\t$html .= '<body class=\"nojs\">'.\"\\n\";\n\t\t\t$html .= '<div id=\"topbar\" class=\"clearfix\">'.\"\\n\";\n\t\t\t$html .= '<div class=\"wrapper\">'.\"\\n\";\n\t\t\t$html .= '<div class=\"left\">'.\"\\n\";\n\t\t\t$html .= '<h1 class=\"mainHeader\"><a href=\"index.php\"><span> PC</span>insight </a></h1>'.\"\\n\";\n\t\t\t$html .= '<nav>'.\"\\n\";\n\t\t\t$html .= '<ul>'.\"\\n\";\n\t\t\t$html .= '<li><a href=\"index.php\" accesskey=\"1\"> Home </a></li>'.\"\\n\";\n\t\t\t$html .= '<li><a href=\"index.php?p=9\" accesskey=\"2\"> Articles </a></li>'.\"\\n\";\t\t\n\t\t\t$html .= '<li><a href=\"index.php?p=10\" accesskey=\"3\"> About </a></li>'.\"\\n\";\n\t\t\t$html .= '</ul>'.\"\\n\";\n\t\t\t$html .= '</nav>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t$html .= '<div class=\"mobilenav\">'.\"\\n\";\n\t\t\t$html .= '<span class=\"mobileNavBu\"></span>'.\"\\n\";\n\t\t\t$html .= '<div class=\"menu\">'.\"\\n\";\n\t\t\t$html .= '<ul>'.\"\\n\";\n\t\t\t$html .= '<li><a href=\"index.php\"> Home </a></li>'.\"\\n\"; \n\t\t\t$html .= '<li><a href=\"index.php?p=9\"> Articles </a></li>'.\"\\n\"; \t\t\t\n\t\t\t$html .= '<li><a href=\"index.php?p=10\"> About </a></li>'.\"\\n\";\n\t\t\tif (!(isset($_SESSION['username']))){\n\t\t\t\t$html .= '<li><a href=\"index.php?p=2\" accesskey=\"4\"> Login </a></li>'.\"\\n\";\n\t\t\t\t$html .= '<li><a href=\"index.php?p=3\" accesskey=\"5\"> Register </a></li>'.\"\\n\";\n\t\t\t} else {\n\t\t\t\tif ($this->model->isAdmin()){\n\t\t\t\t\t$html .= '<li><a href=\"admin/\"> Admin </a></li>'.\"\\n\";\n\t\t\t\t}\n\t\t\t\t$html .= '<li><a href=\"index.php?p=5\" accesskey=\"6\"> Logout </a></li>'.\"\\n\";\n\t\t\t}\n\t\t\t$html .= '</ul>'.\"\\n\";\n\t\t\t$html .= '<form action=\"index.php\" method=\"get\">'.\"\\n\";\n\t\t\t$html .= '<input type=\"hidden\" name=\"p\" value=\"7\"/>'.\"\\n\";\n\t\t\t$html .= '<input type=\"text\" class=\"search\" placeholder=\"Search\" name=\"q\" value=\"'.$_GET['q'].'\"/>'.\"\\n\";\n\t\t\t$html .= '<input type=\"submit\" class=\"btn blue small\" value=\"search\"/>'.\"\\n\";\n\t\t\t$html .= '</form>'.\"\\n\";\t\t\t\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t$html .= '<div class=\"right\">'.\"\\n\";\n\t\t\tif (!(isset($_SESSION['username']))){\n\t\t\t\t$html .= '<div class=\"login\">'.\"\\n\";\n\t\t\t\t$html .= '<a href=\"index.php?p=2\"> Login </a>'.\"\\n\";\n\t\t\t\t$html .= '<a href=\"index.php?p=3\"> Register </a>'.\"\\n\";\n\t\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t} else {\n\t\t\t\t$html .= '<div class=\"login\">'.\"\\n\";\n\t\t\t\t$html .= '<a href=\"index.php?p=5\"> Logout </a>'.\"\\n\";\n\t\t\t\tif ($this->model->isAdmin()){\n\t\t\t\t\t$html .= '<a href=\"admin/\"> Admin </a>'.\"\\n\";\n\t\t\t\t}\n\t\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t}\n\t\t\t$html .= '<div class=\"search\">'.\"\\n\";\n\t\t\t$html .= '<form action=\"index.php\" method=\"get\">'.\"\\n\"; \n\t\t\t$html .= '<input type=\"hidden\" name=\"p\" value=\"7\"/>'.\"\\n\";\n\t\t\t$html .= '<input type=\"text\" class=\"search\" placeholder=\"Search\" name=\"q\" value=\"'.$_GET['q'].'\"/>'.\"\\n\";\n\t\t\t$html .= '<input type=\"submit\" class=\"btn blue small\" value=\"Search\" />'.\"\\n\";\n\t\t\t$html .= '</form>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\tif (!$this->db->isRegistered()){\n\t\t\t\t$html .= '<div class=\"register\"><p> Please register your account <a href=\"index.php?p=13\">here</a></p></div>';\n\t\t\t}\n\t\t\treturn $html;\n\t\t}", "public function getMainHeading() : string\n {\n return <<< 'MAINHEADING'\nCookies, Sessions, and File Upload\nMAINHEADING;\n }", "public function getAdminHeader() {\n\t\t\t\n\t\t//this is a single call function\n\t\tif (!$this->isFirstCall(__FUNCTION__))\n\t\treturn;\n\t\t\n\t\t//check the SDK status\n\t\t$this->checkSDKStatus(true); //force a check, as the admin might have changed the language in the configure page, so we need to sync with it\n\n\t\treturn $this->renderView('admin-header');\n\t}", "public function head() {\r\n return '';\r\n }", "public function get_head()\n\t{\n\t\treturn $this->its_all_in_your_head;\n\t}", "private function displayHeader()\n {\n\n $html = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">' . \"\\n\";\n $html .= '<html xmlns=\"http://www.w3.org/1999/xhtml\">';\n $html .= '<head>' . \"\\n\";\n\n //Meta tags\n $html .= '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />' . \"\\n\";\n $html .= '<meta name=\"description\" content=\"' . $this->pageInfo['pageDescription'] . '\" />' . \"\\n\";\n $html .= '<meta name=\"keywords\" content=\"jobs, freelance, work, design, freedom, choice, new zealand, quality\" />' . \"\\n\";\n $html .= '<link rel=\"icon\" type=\"image/png\" href=\"images/volition-icon.png\" />' . \"\\n\";\n\n //Stylesheets\n $html .= '<!-- Stylesheets -->' . \"\\n\";\n $html .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"css/styles.css\" />' . \"\\n\";\n $html .= '<!--[if lt IE 9]>' . \"\\n\";\n $html .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"css/ie.css\" />' . \"\\n\";\n $html .= '<![endif]-->' . \"\\n\";\n\n //Scripts\n //$html .= '<script type=\"text/javascript\" src=\"js/window.js\"></script>'.\"\\n\";\n\n //Page title\n $html .= '<title>Volition | ' . $this->pageInfo['pageTitle'] . '</title>' . \"\\n\";\n $html .= '</head>' . \"\\n\";\n $html .= '<body>' . \"\\n\";\n\n //Header\n $html .= '<div id=\"header\">' . \"\\n\";\n\n //Control buttons\n\n $html .= '<div id=\"headerImg\"><a href=\"index.php?page=home\"></a></div>' . \"\\n\";\n\n if ($this->model->userLoggedIn) {\n $html .= '<p class=\"controlButton\"><a href=\"index.php?page=logout\">Logout</a></p>' . \"\\n\";\n $html .= '<p class=\"userControl\">You are logged in as ' . $_SESSION['userName'] . '</p>' . \"\\n\";\n } else {\n $html .= '<p class=\"controlButton\"><a href=\"index.php?page=login\">Login</a></p>' . \"\\n\";\n $html .= '<p class=\"controlButton\"><a href=\"index.php?page=register\">Register</a></p>' . \"\\n\";\n }\n\n $html .= '<form id=\"searchForm\" method=\"post\" action=\"index.php?page=search\">';\n if ($_POST['searchInput']) {\n $html .= '<input type=\"text\" name=\"searchInput\" id=\"searchInput\" value=\"' . $_POST['searchInput'] . '\" />';\n } else {\n $html .= '<input type=\"text\" name=\"searchInput\" id=\"searchInput\" value=\"Search...\" />';\n }\n $html .= '<input type=\"submit\" class=\"submit\" name=\"searchSubmit\" id=\"searchSubmit\" value=\"Go\" />';\n $html .= '</form>';\n\n //Navbar\n $html .= $this->displayNav();\n\n $html .= '</div>' . \"\\n\";\n //Content tags\n $html .= '<div id=\"container\">' . \"\\n\";\n $html .= '<div id=\"content\" >' . \"\\n\";\n\n return $html;\n\n }", "public function header()\n {\n }", "function adminHeader()\n {\n return \"\";\n }", "public static function header_output() {\n\t\tob_start();\n\n\t\tif ( self::options( 'header_type' ) == 'navbar-fixed-top' ) {\n\t\t\techo 'body{padding-top: 50px;}';\n\t\t}\n\n\t\tif ( ! display_header_text() ) {\n\t\t\techo '#site-title,.site-description{position: absolute;clip: rect(1px, 1px, 1px, 1px);}';\n\t\t} else {\n\t\t\tself::generate_css( '#site-title', 'color', 'header_textcolor', '#' );\n\t\t}\n\t\t$extra_css = apply_filters( 'maketador_header_output', ob_get_clean() );\n\t\tif ( ! empty( $extra_css ) ) {\n\t\t\techo '<style type=\"text/css\">' . $extra_css . '</style>';\n\t\t}\n\t\t?>\n\t\t<?php\n\t}" ]
[ "0.8268982", "0.8170547", "0.81232756", "0.8051281", "0.8041833", "0.79532087", "0.7906315", "0.79019773", "0.78623784", "0.78461534", "0.7831519", "0.7778275", "0.7754698", "0.7724358", "0.7711097", "0.76586735", "0.76539236", "0.7609281", "0.76052064", "0.7597662", "0.7580716", "0.7571769", "0.7567724", "0.7567724", "0.7567724", "0.7567724", "0.7567724", "0.7562488", "0.7551316", "0.7541616", "0.7526151", "0.7510978", "0.74968857", "0.74796206", "0.74668956", "0.74626696", "0.7458763", "0.74527025", "0.74409395", "0.7412394", "0.7392237", "0.73806137", "0.7346983", "0.73413885", "0.7338471", "0.73139983", "0.7303639", "0.72815514", "0.72810435", "0.72810435", "0.72810435", "0.72610456", "0.7254407", "0.72360444", "0.7203862", "0.71234953", "0.71233094", "0.71233094", "0.7109541", "0.709903", "0.7086521", "0.703097", "0.70197546", "0.7014291", "0.70060897", "0.70045936", "0.70002216", "0.6996952", "0.6996952", "0.6996007", "0.69875216", "0.696333", "0.6961753", "0.69465554", "0.69364655", "0.69350773", "0.69313186", "0.691895", "0.6911982", "0.6901141", "0.68952894", "0.6892963", "0.68893", "0.68859154", "0.68681234", "0.6867146", "0.6859213", "0.68546975", "0.6846883", "0.6829139", "0.6823889", "0.6801195", "0.68011785", "0.6791992", "0.6785237", "0.6777453", "0.67689836", "0.67548174", "0.67447054", "0.67312527", "0.6730237" ]
0.0
-1
/ Helper to return the menu
public function getMenu() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function returnMenu() {\n }", "public function getMenu();", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "public static function returnMenu() {\n return NULL;\n }", "public function get_menu()\r\n {\r\n return '';\r\n }", "public function menu()\n {\n return $this->menu;\n }", "public function menu()\n {\n return $this->menu;\n }", "public function menu_main_menu()\n {\n return menu_main_menu();\n }", "public function makeMenu() {}", "private function menu()\n {\n $data['links'] = ['create', 'read', 'update', 'delete'];\n\n return $this->view->render($data, 'home/menu');\n }", "public function getMenu(){\n\n\t\treturn $this->get();\n\t}", "function menu() {\n\t\tob_start();\n\t\tinclude('templates/menu.php');\n\t\t$output = ob_get_clean();\n\t\treturn $output;\n\t}", "public function getMenus() {}", "protected function menus()\n {\n\n }", "private function PH_PageMenu(){\n $site_menu = self::$xvi_api->GetSiteMenu();\n $page_menu = self::$xvi_api->GetPageMenu();\n \n $menu =\"\";\n foreach($site_menu as $menu_item=>$menu_path) {\n if (strcmp($menu_item,$page_menu[\"item\"])) { /*not selected menu item*/\n $menu .= \"<li><a href=\\\"\".$menu_path.\"\\\"<span></span>\".$menu_item.\"</a></li>\";\n } else { /* it is selected menu*/\n $menu .= \"<li><a class=\\\"sel\\\" href=\\\"\".$menu_path.\"\\\"<span></span>\".$menu_item.\"</a></li>\";\n }\n }\n return $menu;\n }", "public function get_menu()\n\t{\n\t\treturn $this->get_session('admin_menu_html');\n\t}", "function get_menu($param = NULL)\n\t{\n\t\tif (isset($param[\"icon\"]) and substr($param[\"icon\"], 0, 4) === \"http\")\n\t\t{\n\t\t\t$icon = $param[\"icon\"];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$icon_name = empty($param[\"icon\"]) ? \"cog\" : $param[\"icon\"];\n\t\t\t$icon = icons::get_std_icon_url($icon_name);\n\t\t}\n\n\n\t\t$is = \"\";\n\t\tforeach($this->menus as $parent => $menudata)\n\t\t{\n\t\t\t$is .= '<div id=\"'.$parent.'\" class=\"menu\" onmouseover=\"menuMouseover(event)\">'.\"\\n${menudata}</div>\\n\";\n\t\t};\n\t\t$this->vars(array(\n\t\t\t\"ss\" => $is,\n\t\t\t\"menu_id\" => $this->menu_id,\n\t\t\t\"menu_icon\" => $icon,\n\t\t\t\"alt\" => isset($param[\"alt\"]) ? $param[\"alt\"] : null\n\t\t));\n\n\t\tif (!empty($param[\"text\"]))\n\t\t{\n\t\t\t$this->vars(array(\n\t\t\t\t\"text\" => $param[\"text\"]\n\t\t\t));\n\t\t\t$this->vars(array(\n\t\t\t\t\"HAS_TEXT\" => $href_ct = $this->parse(\"HAS_TEXT\")\n\t\t\t));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->vars(array(\n\t\t\t\t\"HAS_ICON\" => $href_ct = $this->parse(\"HAS_ICON\")\n\t\t\t));\n\t\t}\n\n\t\tif (!empty($param[\"is_toolbar\"]))\n\t\t{\n\t\t\t$this->vars(array(\n\t\t\t\t\"IS_TOOLBAR\" => $this->parse(\"IS_TOOLBAR\")\n\t\t\t));\n\t\t}\n\t\t\n\t\tif (aw_template::bootstrap())\n\t\t{\n\t\t\t$this->vars(array(\n\t\t\t\t\"DROPDOWN\" => $this->__parse_dropdown($this->menu_id),\n\t\t\t));\n\t\t}\n\n\t\tif (is_array($param) && !empty($param[\"load_on_demand_url\"]))\n\t\t{\n\t\t\tstatic $lod_num;\n\t\t\t$lod_num++;\n\t\t\treturn \"<div id='lod_\".$this->menu_id.\"'><a href='javascript:void(0);' onClick='tb_lod\".$lod_num.\"()' class='nupp'>$href_ct</a></div>\n\t\t\t<script language=javascript>\n\t\t\tfunction tb_lod\".$lod_num.\"()\n\t\t\t{\n\t\t\t\tel = document.getElementById(\\\"lod_\".$this->menu_id.\"\\\");\n\t\t\t\tel.innerHTML=aw_get_url_contents(\\\"\".$param[\"load_on_demand_url\"].\"\\\");\n\t\t\t\tnhr=document.getElementById(\\\"href_\".$this->menu_id.\"\\\");\n\t\t\t\tif (document.createEvent) {evObj = document.createEvent(\\\"MouseEvents\\\");evObj.initEvent( \\\"click\\\", true, true );nhr.dispatchEvent(evObj);}\n\t\t\t\telse {\n\t\t\t\t\tnhr.fireEvent(\\\"onclick\\\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t</script>\n\t\t\t\";\n\t\t}\n\n\t\treturn $this->parse();\n\t}", "protected function getModuleMenu() {}", "protected function getModuleMenu() {}", "protected function getModuleMenu() {}", "public function getMenus()\n\t{\n\n\t}", "protected function getMenu() {\n $lMethods = $this->allcsvfilelist();\n natcasesort($lMethods);\n \n $lInherited = get_class_methods('CCor_Cnt');\n $lMenu = new CHtm_Vmenu(lan('sys-doc.menu'));\n foreach ( $lMethods as $lMethod ) {\n if (substr($lMethod, 0, 3) != 'act')\n continue;\n /*\n * if (substr ( $lMethod, 3, 1 ) == 'S')\n * continue;\n */\n if (in_array($lMethod, $lInherited))\n continue;\n \n $lAct = substr($lMethod, 3);\n $lMenu->addItem($lMethod, 'index.php?act=sys-doc.' . strtolower($lAct), $lAct);\n }\n \n $lMenu->setKey('act' . ucfirst($this->mAct));\n return $lMenu;\n }", "function getMenuItems()\n {\n }", "public function getMenu()\n\t{\n\t\treturn $this->menu;\n\t}", "public function modMenu() {}", "public function modMenu() {}", "public function modMenu() {}", "public function getMenu() {\n\t\treturn $this->menu;\n\t}", "public function writeMenu() {}", "public function writeMenu() {}", "public function writeMenu() {}", "public function writeMenu() {}", "public static function getMenu()\n\t{\n\t\treturn self::$menu;\n\t}", "public function render() {\n\n\n return $this->makeMenu();\n\n\n }", "abstract protected function getMenuTree();", "function getMenuItems()\n {\n $this->menuitem(\"xp\", \"\", \"main\", array(\"xp.story\", \"admin\"));\n $this->menuitem(\"stories\", dispatch_url(\"xp.story\", \"admin\"), \"xp\", array(\"xp.story\", \"admin\"));\n }", "public static function returnMenu() {\n return array(\n array(\n 'title' => 'Eve - лица',\n 'link' => self::$group . '/' . 'faces',\n 'class' => 'fa-list-alt',\n 'permit' => 'view',\n ),\n );\n }", "public function prefsMenu()\n {\n return Beatnik::getMenu();\n }", "public function getMenu()\r\n {\r\n $auth = $this->session->get('auth');\r\n if ($auth) {\r\n $this->_headerMenu['navbar-right']['session'] = array(\r\n 'caption' => 'Log Out',\r\n 'action' => 'end'\r\n );\r\n } else {\r\n unset($this->_headerMenu['navbar-left']['invoices']);\r\n }\r\n\r\n $controllerName = $this->view->getControllerName();\r\n foreach ($this->_headerMenu as $position => $menu) {\r\n echo '<div class=\"nav-collapse\">';\r\n echo '<ul class=\"nav navbar-nav ', $position, '\">';\r\n foreach ($menu as $controller => $option) {\r\n if ($controllerName == $controller) {\r\n echo '<li class=\"active\">';\r\n } else {\r\n echo '<li>';\r\n }\r\n echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']);\r\n echo '</li>';\r\n }\r\n echo '</ul>';\r\n echo '</div>';\r\n }\r\n\r\n }", "function menus();", "abstract public function getMenuView(): string;", "function erp_menu() {\n $menu = [];\n return apply_filters( 'erp_menu', $menu );\n}", "function login_menu()\n\t{\n\t\t$menu=\"\";\n\t\t$bap=CBapelsin::instance();\n\t\t\n\t\tif($bap->user->isAuthenticated())\n\t\t{\n\t\t\t$user=$bap->user->getUserProfile();\n\t\t\t$menu=\"\";\n\t\t\tif($bap->config['login_menu'][\"show_gravatar\"])\n\t\t\t\t$menu.=\"<a href='http://gravatar.com/site/signup/'><img class='gravatar' src='\".get_gravatar(20).\"'></a>\";\n\t\t\t\n\t\t\tif($bap->config['login_menu']['profile']['label']==\"__profile\")\n\t\t\t\t$label=$user['acronym'];\n\t\t\telse\n\t\t\t\t$label=$bap->config['login_menu']['profile']['label'];\n\t\t\t\n\t\t\t$menu.=\"<a href='{$bap->request->createUrl($bap->config['login_menu']['profile']['src'])}'>{$label}</a> \";\n\t\t\tif($bap->user->isAdministrator())\n\t\t\t{\n\t\t\t\t$menu.=\"<a href='{$bap->request->createUrl($bap->config['login_menu']['acp']['src'])}'>{$bap->config['login_menu']['acp']['label']}</a> \";\n\t\t\t}\n\t\t\t$menu.=\"<a href='{$bap->request->createUrl($bap->config['login_menu']['logout']['src'])}'>{$bap->config['login_menu']['logout']['label']}</a>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$menu=\"<a href='{$bap->request->createUrl($bap->config['login_menu']['login']['src'])}'>{$bap->config['login_menu']['login']['label']}</a>\";\n\t\t}\t\t\n\t\tif(isset($bap->config['show_login_menu']) && isset($bap->config['show_login_menu']))\n\t\t\treturn $menu;\n\t\telse \n\t\t\treturn \"\";\n\t}", "public static function menus()\n {\n return [];\n }", "public static function menu(){\n return new sai_module_menu( 1,\n sai_module_menu::POISITION_RIGHT,\n sai_module_menu::DIVIDER_NONE,\n \\SYSTEM\\PAGE\\replace::replaceFile((new \\SYSTEM\\PSAI('modules/saimod_sys_git/tpl/menu.tpl'))->SERVERPATH()));}", "function getMenu($type = 'list') {\n global $sess_id, $membership_id;\n\n $db = $this->getDb();\n $array = array();\n\n if (isset($sess_id)) {\n $items = generate_main_menu_list('members', $membership_id); \n } else {\n $items = generate_main_menu_list('main'); \n }\n\n if ($type == 'items') {\n return $items; \n }\n\n\n foreach ($items as $item) {\n $array[] = _render_link($item);\n }\n\n if ($type == 'list') {\n $menu = '';\n foreach ($array as $item) {\n $menu .= \"<li>$item</li>\\n\";\n } \n $menu =\"<ul>\\n$menu</li>\\n\";\n } else {\n $menu = $array;\n }\n\n return $menu;\n }", "protected function makeActionMenu() {}", "static public function getMenu() {\n $query = mysql_query(\"SELECT `menu` FROM `info` WHERE `id` = '0'\");\n return mysql_result($query, 0, 'menu');\n }", "function theme_menu() {\n global $theme;\n $content = new UN_Content();\n $cAll = $content->getMenuContent($theme->langid);\n if (is_array($cAll)) {\n $out = '<ul>';\n if ($theme->indexlink == 1) {\n $out .= '<li><a href=\"index.php'.theme_global_url(true).'\"><span>'._('Main Page').'</span></a></li>';\n }\n foreach($cAll as $c) {\n $link = ($c['pagelink']!=\"\") ? $c['pagelink'] : 'index.php?t=page&amp;id='.$c['pageid'];\n $title = ($c['pagelink']!=\"\") ? $c['pagedetail'] : $c['pagetitle'];\n $out .= '<li><a href=\"'.$link.theme_global_url().'\" title=\"'.strip_tags($title).'\"><span>'.$c['pagetitle'].'</span></a></li>';\n }\n $out .= '</ul>';\n }\n echo $out;\n}", "public function menu() {\n\t\treturn $this->getteams();\n\t}", "function getMenu()\n {\n return $this->getAttribute(\"menu\");\n }", "static public function _MENU(){\n if (b_reg::$current_module == VM_MODULE) start_VM();\n return loader::_fromCache('APImenu_vm'); \n }", "public function getMenu()\n{\n $lang=$this->translation;\n foreach($this->_headerMenu as $hmenukey => $hmenu){\n foreach($hmenu as $hkey=>$hval){\n $this->_headerMenu[$hmenukey][$hkey]['caption']=$lang->_($hkey);\n }\n }\n $auth = $this->session->get('auth');\n if ($auth) {\n $this->_headerMenu['navbar-right']['oturum'] = array(\n 'caption' => $lang->_('logout'),\n 'action' => 'bitir'\n );\n\n } else {\n unset($this->_headerMenu['navbar-left']['islemler']);\n unset($this->_headerMenu['navbar-left']['r4t']);\n unset($this->_headerMenu['navbar-left']['hesap']);\n }\n\n $controllerName = $this->view->getControllerName();\n foreach ($this->_headerMenu as $position => $menu) {\n echo '<div class=\"nav-collapse\">';\n echo '<ul class=\"nav navbar-nav ', $position, '\">';\n foreach ($menu as $controller => $option) {\n if ($controllerName == $controller) {\n echo '<li class=\"active\">';\n } else {\n echo '<li>';\n }\n if ($controller=='admin'){\n if(($auth) and ($auth['auth']==0)){\n echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']);\n }}else{\n echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']);\n }\n echo '</li>';\n }\n\n echo '</ul>';\n echo '</div>';\n }\n\n }", "function getMenuTitle();", "public function menu( )\n {\n\n if( $this->view->isType( View::SUBWINDOW ) )\n {\n $view = $this->view->newWindow('WebfrapMainMenu', 'Default');\n }\n else if( $this->view->isType( View::MAINTAB ) )\n {\n $view = $this->view->newMaintab('WebfrapMainMenu', 'Default');\n $view->setLabel('Explorer');\n }\n else\n {\n $view = $this->view;\n }\n\n $view->setTitle('Webfrap Main Menu');\n\n $view->setTemplate( 'webfrap/menu/modmenu' );\n\n $modMenu = $view->newItem( 'modMenu', 'MenuFolder' );\n $modMenu->setData( DaoFoldermenu::get('webfrap/root',true) );\n\n }", "function _quick_menu () {\n\t\t$menu = array(\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> ucfirst($_GET[\"object\"]).\" main\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"],\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> \"\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"],\n\t\t\t),\n\t\t);\n\t\treturn $menu;\t\n\t}", "public function getPageMenu() {\n\t\t\tglobal $factory_impressive_page_menu;\n\n\t\t\treturn $factory_impressive_page_menu[ $this->getMenuScope() ];\n\t\t}", "function get_menu()\r\n {\r\n $extra_items = array();\r\n $create = array();\r\n $create['title'] = Translation :: get('Send');\r\n $create['url'] = $this->get_personal_message_creation_url();\r\n $create['class'] = 'type_compose';\r\n $extra_items[] = $create;\r\n\r\n $temp_replacement = '__FOLDER__';\r\n $url_format = $this->get_url(array(\r\n Application :: PARAM_ACTION => PersonalMessengerManager :: ACTION_BROWSE_MESSAGES,\r\n PersonalMessengerManager :: PARAM_FOLDER => $temp_replacement));\r\n $url_format = str_replace($temp_replacement, '%s', $url_format);\r\n $user_menu = new PersonalMessengerMenu($this->get_folder(), $url_format, $extra_items);\r\n\r\n if ($this->get_action() == self :: ACTION_CREATE_PUBLICATION)\r\n {\r\n $user_menu->forceCurrentUrl($create['url'], true);\r\n }\r\n\r\n $html = array();\r\n $html[] = '<div style=\"float: left; width: 15%;\">';\r\n $html[] = $user_menu->render_as_tree();\r\n $html[] = '</div>';\r\n\r\n return implode($html, \"\\n\");\r\n }", "function makeMenu($what)\n{\n global $language;\n if($what==\"header\") {\n echo \"<a href=\\\"index.php?action=home\\\" target=\\\"main\\\"><div align=\\\"center\\\"><img border=\\\"0\\\" src=\\\"\".AdminMenuLogoLocation.\"\\\"></a></div>\\r\\n\";\n echo \"<table width=\\\"100%\\\" border=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"5\\\">\\r\\n\";\n }\n if($what==\"separator\") {\n echo \"<tr><td></td></tr>\\r\\n\";\n }\n if($what==\"footer\") {\n echo \"<tr><td><hr></td></tr>\\r\\n\";\n echo \"</table>\\r\\n\";\n }\n}", "function Menu_Rendering($menu) {\r\n}", "protected function generateModuleMenu() {}", "function get_menu() {\n return wp_get_nav_menu_items(9);\n }", "private function menu() {\n // Array Map: Key(Menu Elements) => Array(Bold, Not Dynamic tag)\n if(isset($_SESSION['isAdmin'])) {\n $data['menu'] = [\n 'dashboard' => [false, false],\n 'general' => [false, false],\n 'weather' => [false, false],\n 'themes' => [false, false],\n 'languages' => [false, false],\n 'info_pages' => [false, false],\n 'ads' => [false, false],\n 'password' => [false, false],\n 'logout' => [false, true]\n ];\n } else {\n $data['menu'] = [\n 'login' => [false, false],\n ];\n }\n\n // If on the current route, enable the Bold flag\n $data['menu'][$this->url[1]][0] = true;\n\n return $this->view->render($data, 'admin/menu');\n }", "public function obtenerElementosMenu();", "public abstract function getNextMenu();", "function _quick_menu () {\n\t\t$menu = array(\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> ucfirst($_GET[\"object\"]).\" main\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"],\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> \"Create common poll\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"].\"&action=create_poll\",\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> \"\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"],\n\t\t\t),\n\t\t);\n\t\treturn $menu;\t\n\t}", "function smarty_function_menu($params, &$smarty) {\n\tif ($params['admin']) {\n\t\treturn adminMenu($params, $smarty);\n\t} else if($params['company']) {\n\t\treturn companyMenu($params, $smarty);\n\t} else {\n\t\treturn frontendMenu($params, $smarty);\n\t}\n}", "function tacensi_get_menu ( $location ) {\n\t$locations = get_nav_menu_locations();\n\t$menu_id = $locations[$location];\n\n\t// bail out if can't find the menu or the items\n\tif ( ! $menu_id ) return false;\n\n\t$nav = wp_get_nav_menu_items( $menu_id );\n\tif ( ! $nav ) return false;\n\n\t// menu_output\n\t$menu_out = '<nav class=\"site-nav\">' . \"\\n\";\n\n\t// current URL for active class\n\t$current_url = home_url() . $_SERVER[\"REQUEST_URI\"];\n\n\t// actual nav items\n\tforeach ( $nav as $item ) {\n\t\t$menu_out .= '<a href=\"' . $item->url . '\" ' .\n\t\t\t'class=\"site-nav__item';\n\n\t\tif ( strstr( $current_url, $item->url ) ) {\n\t\t\t$menu_out .= ' current';\n\t\t}\n\n\t\t$menu_out .= '\">' . $item->title . '</a>' . \"\\n\";\n\t}\n\n\t$menu_out .= '</nav>' . \"\\n\";\n\n\techo $menu_out;\n}", "function getMainMenu() {\r\n $links = array();\r\n\r\n //Get nav menu id by name\r\n $menu_name = 'primary';\r\n $locations = get_nav_menu_locations();\r\n $menu_id = (isset($locations[$menu_name])) ? $locations[$menu_name] : 0;\r\n\r\n //Get nav menu items\r\n $items = wp_get_nav_menu_items( $menu_id, array(\r\n 'order' => 'ASC',\r\n 'orderby' => 'menu_order',\r\n 'post_type' => 'nav_menu_item',\r\n 'post_status' => 'publish',\r\n 'output' => ARRAY_A,\r\n 'output_key' => 'menu_order',\r\n 'nopaging' => true,\r\n 'update_post_term_cache' => false )\r\n );\r\n\r\n if(!empty($items)) {\r\n foreach($items as $item) {\r\n //active class for pages, categories\r\n $active = false;\r\n\r\n if( ($item->object == 'page') && (is_page($item->object_id)) ) {\r\n $active = 'active';\r\n } \r\n \r\n $links[$item->ID] = array(\r\n 'title' => $item->title,\r\n 'href' => $item->url,\r\n 'class' => $active\r\n );\r\n }\r\n }\r\n\r\n return $links;\r\n}", "protected function _menu()\n\t{\n\t\tif (ee()->view->disabled('ee_menu'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tee()->view->cp_main_menu = ee()->menu->generate_menu();\n\t}", "public abstract function getPrevMenu();", "function loadMenu($arg_menu_name)\n{\n\tINCLUDE('menus/' . $arg_menu_name . '.mnu');\n\treturn $menu;\n}", "function get_navbar($menu) \n{\n\t$html = \"<nav class='navbar'>\\n\";\n\tforeach($menu['items'] as $item) \n\t{\n\t\tif(basename($_SERVER['SCRIPT_FILENAME']) == $item['url'])\n\t\t{\n\t\t\t$item['class'] .= ' selected'; \n\t\t}\n\t\t$html .= \"<p><a href='{$item['url']}' class='{$item['class']}'>{$item['text']}</a>\\n</p>\";\n\t}\n\t$html .= \"</nav>\";\n\treturn $html;\n}", "public function GetMenu($nivel,$area){\r\n $menu = '';\r\n if ($area == 'cliente'){\r\n $menu ='<ul id=\"ul-menu\">\r\n \r\n <li><a href=\"#\" id=\"meusdados\"><img src=\"images/cliente.png\" alt=\"Info Cliente\" title=\"Meus Dados\" />Meus Dados</a>\r\n </li>\r\n \r\n <li><a href=\"#\" id=\"pag\"><img src=\"images/not.png\" alt=\"Vendas\" title=\"Parcela\" />Pagamentos</a>\r\n </li>\r\n </ul>';\r\n \r\n \r\n \r\n }\r\n else {\r\n if ($nivel ==1 ){\r\n $menu ='<ul id=\"ul-menu\">\r\n <li><a href=\"#\"><img src=\"images/administrador.png\" alt=\"Info Funcionarios\" title=\"Funcionários\" />Funcionários</a>\r\n <ul class=\"submenu\">\r\n <li> <a href=\"#\" id=\"cad-fun\">Cadastrar Funcionário</a> </li>\r\n <li><a href=\"#\" id=\"fun\"> Funcionários </a></li>\r\n </ul>\r\n </li>\r\n <li><a href=\"#\"><img src=\"images/cliente.png\" alt=\"Info Cliente\" title=\"Clientes\" />Clientes</a>\r\n <ul class=\"submenu\">\r\n <li> <a href=\"#\" id=\"cad-cli\">Cadastrar Cliente</a> </li>\r\n <li><a href=\"#\" id=\"cli\"> Clientes </a></li>\r\n </ul>\r\n </li>\r\n \r\n \r\n <li><a href=\"#\"><img src=\"images/not.png\" alt=\"Info Notícia\" title=\"Notícias\" />Notícias</a>\r\n <ul class=\"submenu\">\r\n <li> <a href=\"#\" id=\"cad-not\">Cadastrar Notícias</a> </li>\r\n <li><a href=\"#\" id=\"not\"> Notícias </a></li>\r\n </ul>\r\n </li>\r\n \r\n </ul>';}\r\n if ($nivel == 2) {\r\n $menu ='<ul id=\"ul-menu\">\r\n \r\n <li><a href=\"#\"><img src=\"images/cliente.png\" alt=\"Info Cliente\" title=\"Clientes\" />Clientes</a>\r\n <ul class=\"submenu\">\r\n <li> <a href=\"#\" id=\"cad-cli\">Cadastrar Cliente</a> </li>\r\n <li><a href=\"#\" id=\"cli\"> Clientes </a></li>\r\n </ul>\r\n </li>\r\n \r\n <li><a href=\"#\" id=\"min-ven\"><img src=\"images/not.png\" alt=\"Vendas\" title=\"Minhas Vendas\" />Minhas Vendas</a>\r\n </li>\r\n </ul>';}}\r\n \r\n return $menu; \r\n \r\n }", "public function menu_secondary_menu()\n {\n return menu_secondary_menu();\n }", "public function menu()\n {\n return Menu::build($this->sections(), function ($menu, $option) {\n if (isset($option['section'])) {\n $menu->html(\n '<li class=\"m-menu__section \">' .\n '<h4 class=\"m-menu__section-text\">' . __('app.roles.' . $option['section']) . '</h4>' .\n '<i class=\"m-menu__section-icon flaticon-more-v2\"></i>' .\n '</li>'\n );\n } else {\n $menu->route(isset($option['route']) ? $option['route'] : $option['crud'] . '.index',\n '<i class=\"m-menu__link-icon ' . $option['icon'] . '\"></i>' .\n '<span class=\"m-menu__link-title\">' .\n '<span class=\"m-menu__link-wrap\">' .\n '<span class=\"m-menu__link-text\">' . __('app.titles.' . $option['crud']) . '</span>' .\n '</span>' .\n '</span>'\n );\n }\n })\n ->addClass('m-menu__nav m-menu__nav--dropdown-submenu-arrow')\n ->append('</div></div>')\n ->each(function (Link $link) {\n $link->addClass('m-menu__link')\n ->addParentClass('m-menu__item')\n ->setParentAttribute('aria-haspopup', 'true');\n })\n ->prepend(\n '<div id=\"m_aside_left\" class=\"m-grid__item\tm-aside-left m-aside-left--skin-dark\">' .\n '<div id=\"m_ver_menu\" class=\"m-aside-menu m-aside-menu--skin-dark m-aside-menu--submenu-skin-dark\" m-menu-vertical=\"1\" m-menu-scrollable=\"1\" m-menu-dropdown-timeout=\"500\" style=\"position: relative;\">'\n )\n ->setActive(url()->current())\n ->setActiveClass('m-menu__item--active')\n ;\n }", "protected function buildMenu() {\n// $structures = DataSource::factory(Structure::cls());\n// $structures->builder()\n// ->where(\"structure_id=0\")\n// ->order('priority');\n// /** @var Structure[] $aStructures */\n// $aStructures = $structures->findAll();\n// foreach ($aStructures as $oStructure) {\n// $menu->addLeftItem($oStructure->name, $oStructure->path);\n// $this->loadMenuItems($menu->findLeftItemByPath($oStructure->path), $oStructure);\n// }\n//\n// $view = new ViewMMenu();\n// $view->menu = $menu;\n// return $view;\n\n $ViewMainMenu = new ViewMainMenu($this->config['name']);\n $this->setMenuItems($ViewMainMenu->itemsList);\n $currentPath = explode('?', $this->Router->getRoute());\n $ViewMainMenu->currentPath = reset($currentPath);\n\n return $ViewMainMenu;\n }", "public function getMenu($menu){\n $menus['sidebar'] = array(\n array(\n 'id' => 'inicio',\n 'label' => 'Inicio',\n 'link' => BASE_URL \n ),\n array(\n 'id' => 'login',\n 'label' => 'Cerrar Sesión',\n 'link' => BASE_URL . \"login/cerrar\"\n ),\n array(\n 'id' => 'login',\n 'label' => 'Iniciar Sesión',\n 'link' => BASE_URL . \"login\"\n ),\n array(\n 'id' => 'registro',\n 'label' => 'Registrarse',\n 'link' => BASE_URL . \"registro\"\n )\n );\n\n $menus['top'] = array(\n array(\n 'id' => 'inicio',\n 'label' => 'Inicio',\n 'link' => BASE_URL \n ),\n array(\n 'id' => 'post',\n 'label' => 'Post',\n 'link' => BASE_URL . \"post\"\n ),\n array(\n 'id' => 'configuracion',\n 'label' => 'Configuración',\n 'link' => BASE_URL . \"configuracion\"\n )\n );\n\n return $menus[$menu];\n }", "public function menu()\n\t{\n\t\t$this->db->order_by(\"urutan\",\"asc\");\n\t\t$hasil = $this->db->get_where(\"mainmenu\",array(\"aktif\"=>\"Y\"));\n\t\t$output = new myObject();\n\t\tif($hasil->num_rows() > 0){\n\t\t\t$data = $hasil->result();\n\t\t\t$menu = array();\n\t\t\tforeach ($data as $item) {\n\t\t\t\t$row = array();\n\t\t\t\t$row =$item;\n\t\t\t\t$row->submenu = $this->submenu($item->id_main);\n\t\t\t\t$menu[] = $row;\n\t\t\t}\n\t\t\t$output->data = $menu;\n\t\t\t$output->status = true;\n\t\t}else{\n\t\t\t$output->status = false;\n\t\t}\n\t\treturn $output;\n\t}", "function mnu_EchoMainMenu($selmenuid)\n{\n global $menu;\n for ($i = 0; $i < count($menu); $i++) {\n if ($menu[$i]['visible'] == true) {\n if (!isset($menu[$i]['newwindow']))\n $menu[$i]['newwindow'] = false;\n if ($menu[$i]['newwindow'] == true)\n $target_blank = \"target='_blank'\";\n else\n $target_blank = \"\";\n\n if ($menu[$i]['siteid'] == $selmenuid || is_array($menu[$i]['siteid']) && in_array($selmenuid, $menu[$i]['siteid'])) {\n echo '<li><a class=\"selected bg-green06\" href=\"' . $menu[$i]['filename'] . '\">' . htmlspecialchars($menu[$i]['menustring'], ENT_COMPAT, 'UTF-8') . '</a></li>';\n } else {\n echo '<li><a ' . $target_blank . ' href=\"' . $menu[$i]['filename'] . '\">' . htmlspecialchars($menu[$i]['menustring'], ENT_COMPAT, 'UTF-8') . '</a></li>';\n }\n }\n }\n}", "function get_menu_items($title) {\n\t$items['home.php'] = \"Home\";\n\t$items['play_trivia.php'] = \"Play Trivia\";\n\t$items['view_leaders.php'] = \"View Leader Board\";\n\t$items['rank_question.php'] = \"Rank Questions\";\n\t$items['insert_question.php'] = \"Insert Question\";\n\t\n\tif ($_SESSION['admin']) {\t\n\t\t$items['insert_user.php'] = \"Delete User\";\n\t\t$items['delete_question.php'] = \"Delete Question\";\n\t}\t\t\n\t$items['logout.php'] = \"Logout\";\n\t\t\n\tforeach ($items as $key=>$value) {\n\t\t$active = '';\n\t\tif ($value==$title) $active = \"active\";\n\t\t$menu_items .= '\n\t\t <li class=\"nav-item\">\n\t\t <a class=\"nav-link '.$active.'\" href=\"'.$key.'\">'.$value.'</a>\n\t\t </li>\n\t\t';\n\t}\n\treturn $menu_items;\n}", "public function getMenu ()\n {\n # Monto a opção de escolha dos sistemas do Usuario\n try {\n $sess = Session::getLiveSession('sisicmbio','USER');\n SIALException::ThrowsExceptionIfParamIsNull($sess, 'Não foi encontrada a sessão para o objeto informado');\n } catch (SIALException $excp) {\n # Não foi encontrada a Sessão para Este Sistema\n header(\"Location: \" . $this->bootstrap()->config()->get('app')->get('authSystem'));\n }\n\n\n $count = 0;\n foreach ($sess->sistemas as $sistema) {\n $arrSistema[$count]['href'] = $sistema['sqSistema'];\n $arrSistema[$count]['text'] = $sistema['sgSistema'];\n $count++;\n }\n\n $Menuoptions = array('__DIVIDER_VERTICAL__',\n 'Início' => array(),\n '__DIVIDER_VERTICAL__' ,\n 'Sistemas' => $arrSistema,\n '__DIVIDER_VERTICAL__');\n\n $menuParam = new \\stdClass;\n $menuParam->options = $Menuoptions;\n $menuParam->type = 'h';\n\n $this->_SIALApplication->set('menuH',$this->getSAF()->create('menu', $menuParam));\n\n $this->_SIALApplication->set('param',array('nome' => $sess->noPessoa,\n 'perfil' => $sess->noPerfil,\n 'uorg' => $sess->noUnidadeOrg,\n 'help' => 'HTML',\n 'sysId' => $sess->sqSistema,\n 'sysAlias' => isset($sess->sistemas[$sess->sqSistema]['sgSistema']) ? $sess->sistemas[$sess->sqSistema]['sgSistema'] : '',\n 'multiProfile' => count($sess->allProfile) > 1 ? TRUE : FALSE,\n 'inPerfilExterno' => $sess->inPerfilExterno,\n )\n );\n\n # Monto os Menus\n $menu = $sess->MenuExterno;\n\n $count = 0;\n $countSon = 0;\n $arrMenu = array();\n foreach ($menu as $menuCadastro) {\n $arrMenu[$count]['text'] = $menuCadastro['MenuPai']['noMenu'];\n $arrMenu[$count]['href'] = $menuCadastro['Acao'];\n\n if (isset($menuCadastro['MenuFilho'])) {\n $arrTmpFilho = current($menuCadastro['MenuFilho']);\n if (empty($arrTmpFilho['MenuFilho']['noMenu'])) {\n // continue;\n }\n\n foreach ($menuCadastro['MenuFilho'] as $menuFilho) {\n\n if (!isset($arrMenu[$count])) {\n continue;\n }\n\n if (isset($menuFilho['Acao']) && NULL !== $menuFilho['Acao']) {\n $arrMenu[$count][$countSon]['href'] = $menuFilho['Acao'];\n }\n\n if (!empty($menuFilho['MenuFilho']['noMenu'])) {\n $arrMenu[$count][$countSon]['text'] = $menuFilho['MenuFilho']['noMenu'];\n }\n\n $countSon++;\n }\n }\n $count++;\n }\n\n $menuParam = new \\stdClass;\n $menuParam->title = 'Menu';\n $menuParam->options = $arrMenu;\n $menuParam->type = 'v';\n\n $this->_SIALApplication->set('menuV',$this->getSAF()->create('menu', $menuParam));\n }", "public function getMenus(){\n\n }", "public function getMenuTitle(): string;", "public function menuAction()\n {\n $site = $this->getSessionVar('site');\n /* @var $repo \\Allegro\\SitesBundle\\Repository\\SiteRepository */\n $repo = $this->getRepo('Site');\n\n /* @var $siteEntity Allegro\\SitesBundle\\Entity\\Site */\n $siteEntity = $repo->getSiteBySlug($site);\n return $this->render($this->getTemplate('menu.html'), array(\n 'site' => $siteEntity,\n '_locale' => $this->getSessionVar('_locale')\n ));\n }", "public function getMenu(){\n\t\t$maConfig= new Config();\n\t\t$data['style']=$maConfig->getCouleur();\n\t\t\n\t\t$monControle= new ControlleurAccess();\n\t\tif(isset($_SESSION['nom'])){\n\t\t\tif($monControle->estConnu($_SESSION['nom'])){\n\t\t\t\t//echo\"<PRE> COntroller : réservé \";print_r($data);echo\"</PRE>\";\n\t\t\t\t$data['nom']=$_SESSION['nom'];\n\t\t\t\t$menuPrivate= new _MenuPrivateView();\n\t\t\t\treturn $menuPrivate->show($data);\n\t\t\t}else{\n\t\t\t\t//echo\"<PRE> COntroller : libre \";print_r($data);echo\"</PRE>\";\n\t\t\t\t$menuFree= new\t_MenuFreeView();\n\t\t\t\treturn $menuFree->show($data);\n\t\t\t}\n\t\t}else{\n\t\t\t//echo\"<PRE> COntroller : libre \";print_r($data);echo\"</PRE>\";\n\t\t\t$menuFree= new\t_MenuFreeView();\n\t\t\treturn $menuFree->show($data);\n\t\t}\n\t}", "abstract public function getMenuData();", "public static function getMenu()\n {\n $svalue = SessionManager::get(self::SESSION_NAME);\n return $svalue ? unserialize($svalue) : self::$menu;\n }", "public function menu()\n {\n \treturn view('intern.operasional.admin.setting.database.menu');\n }", "public function menuInside($action='') {\n $items = '';\n $action = ($action!='') ? $action : $this->action;\n switch ($action) {\n case 'listAdmin':\n if (Permission::canInsert($this->type)) {\n $items = '<div class=\"menuSimpleItem menuSimpleItemInsert\">\n <a href=\"'.url($this->type.'/insertView', true).'\">'.__('insertNew').'</a>\n </div>';\n }\n if ((string)$this->object->info->info->form->exportJson == 'true') {\n $items .= '<div class=\"menuSimpleItem menuSimpleItemExportJson\">\n <a href=\"'.url($this->type.'/export-json', true).'\" target=\"_blank\">'.__('exportJson').'</a>\n </div>';\n }\n if ((string)$this->object->info->info->form->exportCsv == 'true') {\n $items .= '<div class=\"menuSimpleItem menuSimpleItemExportCsv\">\n <a href=\"'.url($this->type.'/export-csv', true).'\" target=\"_blank\">'.__('exportCsv').'</a>\n </div>';\n }\n break;\n case 'insertView':\n case 'insert':\n case 'modifyView':\n case 'modifyViewCheck':\n $items = '<div class=\"menuSimpleItem menuSimpleItemList\">\n <a href=\"'.url($this->type.'/listAdmin', true).'\">'.__('viewList').'</a>\n </div>';\n break;\n case 'insertCheck':\n $items = '<div class=\"menuSimpleItem menuSimpleItemInsert\">\n <a href=\"'.url($this->type.'/insertView', true).'\">'.__('insertNew').'</a>\n </div>';\n if (Permission::canInsert($this->type)) {\n $items .= '<div class=\"menuSimpleItem menuSimpleItemList\">\n <a href=\"'.url($this->type.'/listAdmin', true).'\">'.__('viewList').'</a>\n </div>';\n }\n break;\n case 'listBack':\n $items = '<div class=\"menuSimpleItem menuSimpleItemList\">\n <a href=\"'.url($this->type.'/listAdmin', true).'\">'.__('viewList').'</a>\n </div>';\n break;\n\n }\n return ($items!='') ? '<nav class=\"menuSimple\">'.$items.'</nav>' : '';\n }", "public static function get_menu()\n\t\t{ \n\t\t\t\t\n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\t$dish_list = $wpdb->get_results( \"SELECT * FROM \".$wpdb->prefix.self::$table_name);\n\t\t\t\t\n\t\t\t\t$htm =\t'<div class=\"left-rows\" id=\"menu-all\">All Categories</div>';\t\n\t\t\t\t\n\t\t\t\tif(!empty($dish_list)){\n\t\t\t\t\t\n\t\t\t\t\tforeach($dish_list as $key => $val){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$htm .=\t'<div class=\"left-rows\" id=\"menu-'.$val->re_int.'\">'.$val->re_title.'</div>';\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $htm;\n\t\t\t\t\n\t\t}", "function template_navigation() {\n\t\t$_ENV['menu'] = array();\n\t\t$_ENV['menu']['Main'] = _URL_;\n\t\tModule::includes('menus');\n\t\t$_ENV['menu']['Preferences'] = '?module=prefs';\n\t\t$_ENV['menu']['Logout'] = '?logout=true';\n\n\t\t$buffer = '<ul><li><h2>';\n\t\t$buffer .= array_key_exists('Menu',$_ENV['imgs']['menu']) \n\t\t\t? '<img src=\"'.$_ENV['imgs']['menu']['Menu'].'\" border=\"0\" /> ' : ' ';\n\t\t$buffer .= ' Main Menu</h2><ul>';\n\t\tforeach ($_ENV['menu'] as $module => $items) {\n\t\t\tif (is_array($items)) {\n\t\t\t\t$buffer .= '<li><a href=\"#\">';\n\t\t\t\t$buffer .= array_key_exists($module,$_ENV['imgs']['menu'])\n\t\t\t\t\t? '<img src=\"'.$_ENV['imgs']['menu'][$module].'\" border=\"0\" /> ' : ' ';\n\t\t\t\t$buffer .= $module.'</a><ul>';\n\t\t\t\tforeach ($items as $label => $url) {\n\t\t\t\t\t$buffer .= '<li><a href=\"'.$url.'\">';\n\t\t\t\t\t$buffer .= array_key_exists($label,$_ENV['imgs']['menu'])\n\t\t\t\t\t\t? '<img src=\"'.$_ENV['imgs']['menu'][$label].'\" border=\"0\" /> ' : ' ';\n\t\t\t\t\t$buffer .= $label.'</a></li>';\n\t\t\t\t}\n\t\t\t\t$buffer .= '</ul></li>';\n\t\t\t} else {\n\t\t\t\t$buffer .= '<li><a href=\"'.$items.'\">';\n\t\t\t\t$buffer .= array_key_exists($module,$_ENV['imgs']['menu'])\n\t\t\t\t\t? '<img src=\"'.$_ENV['imgs']['menu'][$module].'\" border=\"0\" /> ' : ' ';\n\t\t\t\t$buffer .= $module.' </a></li>';\n\t\t\t}\t\n\t\t}\n\t\t$buffer .= '</ul></li></ul>';\n\t\treturn $buffer;\n\t}", "protected function createMenu(){\n $menu_name = static::MENU_NAME;\n $menu_tree = \\Drupal::menuTree();\n $parameters = $menu_tree->getCurrentRouteMenuTreeParameters($menu_name);\n \n // if tree is not empty, create the menu\n if ($tree = $menu_tree->load($menu_name, $parameters)){\n $manipulators = [ // Only show links that are accessible for the current user.\n ['callable' => 'menu.default_tree_manipulators:checkAccess'],\n // Use the default sorting of menu links.\n ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'],\n ];\n\n $tree = $menu_tree->transform($tree, $manipulators);\n return $menu_tree->build($tree);\n }\n\n // return false if tree is empty\n return false;\n }", "function menuGetPrimaryItems() {\n $items = array();\n $items[] = array('title' => 'Home', 'url' => '/');\n $items[] = array('title' => 'Blog', 'url' => '/Blog');\n $items[] = array('title' => 'Archive', 'url' => '/Archive');\n\n return menuPrepareItems($items);\n}", "function hook_menu() {\n\t\treturn null;\n\t}" ]
[ "0.86792254", "0.85568064", "0.80998826", "0.80998826", "0.80998826", "0.80998826", "0.80998826", "0.80998826", "0.79804134", "0.7918201", "0.7902923", "0.7902923", "0.7896651", "0.7855538", "0.7746947", "0.7690069", "0.763288", "0.75908524", "0.75657713", "0.75543475", "0.7520429", "0.74409443", "0.7438549", "0.7438549", "0.7437823", "0.7427006", "0.74220246", "0.7413578", "0.74072593", "0.73877627", "0.7386374", "0.7385117", "0.7347802", "0.73411745", "0.7339753", "0.7339629", "0.7339629", "0.7315888", "0.73102665", "0.73081857", "0.73045796", "0.7296065", "0.7287228", "0.724267", "0.7240248", "0.7236676", "0.7231527", "0.72278345", "0.72149014", "0.721428", "0.7212056", "0.7205385", "0.72046286", "0.7190713", "0.7183036", "0.7182203", "0.71815", "0.7179671", "0.71658254", "0.7158081", "0.713986", "0.71124375", "0.7093169", "0.7092071", "0.7091131", "0.7087215", "0.7085011", "0.70681256", "0.7066775", "0.70321417", "0.7028844", "0.70273477", "0.70207256", "0.70192176", "0.70144105", "0.7011202", "0.70082146", "0.70053124", "0.697271", "0.69662625", "0.6943935", "0.693323", "0.6926796", "0.6912963", "0.6909908", "0.6908673", "0.6904598", "0.68931043", "0.6885528", "0.68851084", "0.6880789", "0.6864825", "0.68623674", "0.6854389", "0.68515474", "0.68498975", "0.6836997", "0.68352425", "0.6834421", "0.683193" ]
0.7387634
30
/ Helper to add a check to this list
private function addResult($group, $check, $status = 0, $description = '') { $checks = $this->system_checks; $checks[$group][] = array( 'check' => $this->__($check), 'status' => $status, 'description' => $this->__($description), ); $this->system_checks = $checks; return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addCheck(string $check): void\n {\n $this->checks[] = $check;\n }", "public function contains(self $item, $checkAgainstThis = true) {}", "public function makeCheck_In()\n {}", "public static function add_check( $name, $check ) {\n\n\t\tif ( ! preg_match( '#^[A-Za-z0-9-]+$#', $name ) ) {\n\t\t\tWP_CLI::error( \"Check name '{$name}' is invalid. Verify check registration.\" );\n\t\t}\n\n\t\tif ( ! is_object( $check ) ) {\n\t\t\tif ( ! class_exists( $check ) ) {\n\t\t\t\tWP_CLI::error( \"Class '{$check}' for check '{$name}' doesn't exist. Verify check registration.\" );\n\t\t\t}\n\t\t\t$check = new $check();\n\t\t}\n\t\tif ( ! is_subclass_of( $check, 'runcommand\\Doctor\\Checks\\Check' ) ) {\n\t\t\t$class = get_class( $check );\n\t\t\tWP_CLI::error( \"Class '{$class}' for check '{$name}' needs to extend Check base class. Verify check registration.\" );\n\t\t}\n\t\tself::$instance->checks[ $name ] = $check;\n\t}", "function addCheck($hookName, $params) {\n\t\t$form =& $params[0];\n\t\tif (get_class($form) == 'AuthorSubmitStep3Form' || get_class($form) == 'MetadataForm' ) {\n\t\t\t$form->addCheck(new FormValidatorRegExp($form, 'projectID', 'optional', 'plugins.generic.openAIRE.projectIDValid', '/^\\d{6}$/'));\n\t\t}\n\t\treturn false;\n\t}", "public function addCheckExtension($checkExtension) {\n $this->checkExtensions[] = $checkExtension;\n }", "static function MemberCheckList($name, Member $member)\n { \n $field = new CheckList($name);\n self::AddMembergroupOptions($field);\n $groupIDs = Membergroup::GetKeyList(self::MemberMembergroups($member));\n $field->SetValue($groupIDs);\n return $field;\n }", "public function add($_item)\n\t{\n\t\treturn BingTypeSearchOption::valueIsValid($_item)?parent::add($_item):false;\n\t}", "function ozh_yourls_gsb_check_add( $false, $url ) {\n \n list( $blacklisted, $desc ) = ozh_yourls_gsb_is_blacklisted( $url );\n \n // If blacklisted, halt here\n\tif ( $blacklisted ) {\n\t\treturn array(\n\t\t\t'status' => 'fail',\n\t\t\t'code' => 'error:' . $desc,\n\t\t\t'message' => 'Ce domaine est sur liste noire par Google Safe Browsing à cause de suspicion de ' . $desc . '. <a href=\"http://code.google.com/apis/safebrowsing/safebrowsing_faq.html#whyAdvisory\">En savoir plus</a>.',\n\t\t\t'errorCode' => '403',\n\t\t);\n\t}\n \n // If not blacklisted but still unsure (error message), we should warn the user\n if( $desc ) {\n define( 'OZH_YOURLS_GSB_EXTRA_INFO', $desc );\n yourls_add_filter( 'add_new_link', 'ozh_yourls_gsb_extra_info' );\n }\n\t\n\t// All clear, don't interrupt the normal flow of events\n\treturn $false;\n}", "public function addCheckInformation(CheckInformation $l)\n\t{\n\t\tif ($this->collCheckInformations === null) {\n\t\t\t$this->initCheckInformations();\n\t\t}\n\t\tif (!in_array($l, $this->collCheckInformations, true)) { // only add it if the **same** object is not already associated\n\t\t\tarray_push($this->collCheckInformations, $l);\n\t\t\t$l->setUser($this);\n\t\t}\n\t}", "abstract public function check();", "abstract function check();", "public function getAddClassToListItem(): bool;", "public function newChecklist()\n {\n $this->checklist = new Checklist();\n }", "public function _check()\n {\n }", "public function check() {}", "public function performChecks(){\n\t\t\n\t}", "public function check();", "public function check();", "public function check();", "public function check();", "public function check();", "public static function check()\n {\n parent::check();\n }", "function chk_add_process01($table,$field_chk,$data_chk){\n $query = $this->db->get_where($table,array($field_chk => $data_chk));\n if($query->num_rows()!=0){return FALSE;}else{return TRUE;}\n }", "public function addCheckService($service_id, $service_method, array $applies_checks = [], $needs_incoming_request = FALSE);", "public function check()\n {\n }", "public function check()\n {\n }", "public static function addCheck($callback)\n {\n if (DataAccess::getInstance()->get_site_setting('developer_supress_notify')) {\n return;\n }\n if (is_callable($callback)) {\n Notifications::_checks($callback);\n return true;\n } else {\n trigger_error(\"ERROR NOTIFICATIONS: Callback function or method\n\t\t\t\tis invalid. Callback: \" . print_r($callback, true));\n return false;\n }\n }", "function add()\n {\n return true;\n }", "static function PageCheckList($name, Page $page)\n { \n $field = new CheckList($name);\n self::AddMembergroupOptions($field);\n $groupIDs = Membergroup::GetKeyList(self::PageMembergroups($page));\n $field->SetValue($groupIDs);\n return $field;\n }", "public function addCheckInTaskList(\\sc\\score\\Task $value){\n return $this->_add(2, $value);\n }", "public static function _checks($check = null)\n {\n if (!is_array(self::$checks)) {\n self::$checks = array();\n }\n if (null != $check) {\n self::$checks[] = $check;\n }\n return self::$checks;\n }", "protected function add() {\n\t}", "public function hasUseradditem(){\n return $this->_has(24);\n }", "static function ContentCheckList($name, Content $content)\n { \n $field = new CheckList($name);\n self::AddMembergroupOptions($field);\n $groupIDs = Membergroup::GetKeyList(self::ContentMembergroups($content));\n $field->SetValue($groupIDs);\n return $field;\n }", "function ValidateAdd()\n\t{\n\t}", "public function add($_item)\n\t{\n\t\treturn BingTypeSourceType::valueIsValid($_item)?parent::add($_item):false;\n\t}", "function check()\n\t{\n\t\t$valid = true;\n\n\t\t$filter = new JFilterInput(array(), array(), 0, 0);\n\n\t\t$this->bible_name = $filter->clean($this->bible_name, 'STRING');\n\t\t$this->alias = $filter->clean($this->alias, 'STRING');\n\t\t$this->desc = $filter->clean($this->desc, 'STRING');\n\t\t$this->xml_file_url = $filter->clean($this->xml_file_url, 'STRING');\n\t\t$this->xml_audio_url = $filter->clean($this->xml_audio_url, 'STRING');\n\t\t$this->publish = $filter->clean($this->publish, 'BOOL');\n\t\t$this->ordering = $filter->clean($this->ordering, 'INT');\n\n\t\tif (!empty($this->ordering) && !preg_match(\"/^(\\d|-)?(\\d|,)*\\.?\\d*$/\", $this->ordering)){\n\t\t\tJError::raiseWarning( 1000, JText::sprintf(\"ZEFANIABIBLE_VALIDATOR_WRONG_VALUE_FOR_PLEASE_RETRY\", JText::_(\"ZEFANIABIBLE_FIELD_ORDERING\")) );\n\t\t\t$valid = false;\n\t\t}\n\n\n\n\n\n\t\t//Alias\n\t\tif (!trim($this->alias))\n\t\t\t$this->alias = JFilterOutput::stringURLSafe($this->title);\n\n\t\t//New row : Ordering : place to the end\n\t\tif ($this->id == 0)\n\t\t{\n\t\t\t$db= JFactory::getDBO();\n\n\t\t\t$query = \t'SELECT `ordering` FROM `' . $this->_tbl . '`'\n\t\t\t\t\t. \t' ORDER BY `ordering` DESC LIMIT 1';\n\t\t\t$db->setQuery($query);\n\t\t\t$lastOrderObj = $db->loadObject();\n\t\t\t$this->ordering = (int)$lastOrderObj->ordering + 1;\n\t\t}\n\n\n\n\n\n\t\treturn $valid;\n\t}", "public static function check();", "protected function addCheckField($key = null, $dataArray = null, array &$checkFields) {\n\n\t\tif(isset($dataArray['TCEforms']) && isset($dataArray['TCEforms']['config'])) {\n\n\t\t\t$conf = $dataArray['TCEforms']['config'];\n\t\t\t$conf['linkField'] = false;\n\t\t\t// field is set as link field\n\t\t\tif($dataArray['tx_templavoila']['eType'] === 'link') {\n\t\t\t\t$conf['linkField'] = true;\n\t\t\t}\n\t\t\t// link fields\n\t\t\tif(!isset($conf['softref']) && (bool)$conf['linkField']) {\n\t\t\t\t$conf['softref'] = 'typolink';\n\t\t\t}\t\n\t\t\tif(isset($conf['softref'])) {\n\t\t\t\n\t\t\t\t// for sections and containers, only get the field name for display in results\n\t\t\t\t$fieldNames = explode(self::SECTION_DIVIDER, $key);\n\t\t\t\t\n\t\t\t\t$checkFields[$key] = array(\n\t\t\t\t\t'field'\t\t=> end($fieldNames),\n\t\t\t\t\t'title' \t=> $dataArray['tx_templavoila']['title'],\n\t\t\t\t\t'softref' \t=> $conf['softref'],\n\t\t\t\t\t'linkField'\t=> $conf['linkField']\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "function course_completion_check_custom_rule($element,$value,$extra) {\n $key = $extra[0];\n $values = $extra[1];\n $set_ok = false;\n\n foreach ($values->_options['choices'] as $name=>$choice) {\n $item = $key.'_'.$name;\n if (optional_param($item,0,PARAM_INT) == 1) {\n $set_ok = true;\n }\n }\n\n return $set_ok ? true : false;\n}", "public function check(): void;", "public function check(): void;", "public function addChecker(callable $checker) : self\n {\n $this->checkers[] = $checker;\n return $this;\n }", "public function hasCheckInTaskList(){\n return $this->_has(2);\n }", "protected function allowAdd($data = array())\n\t{\n\t\treturn parent::allowAdd();\n\t}", "public function hasIsCheckIn(){\n return $this->_has(3);\n }", "public function canAddToResult();", "public function createApplicableChecker();", "protected function allowAdd($data = array())\n {\n return parent::allowAdd($data);\n }", "public function hasAddhp(){\r\n return $this->_has(23);\r\n }", "function phishtank_check_add( $false, $url ) {\n $url = yourls_sanitize_url( $url );\n\n // only check for 'http(s)'\n if( !in_array( yourls_get_protocol( $url ), array( 'http://', 'https://' ) ) )\n return $false;\n \n // is the url malformed?\n if ( phishtank_is_blacklisted( $url ) === yourls_apply_filter( 'phishtank_malformed', 'malformed' ) ) {\n\t\treturn array(\n\t\t\t'status' => 'fail',\n\t\t\t'code' => 'error:nourl',\n\t\t\t'message' => yourls__( 'Missing or malformed URL' ),\n\t\t\t'errorCode' => '400',\n\t\t);\n }\n\t\n // is the url blacklisted?\n if ( phishtank_is_blacklisted( $url ) != false ) {\n\t\treturn array(\n\t\t\t'status' => 'fail',\n\t\t\t'code' => 'error:spam',\n\t\t\t'message' => 'Ce domaine est sur liste noire',\n\t\t\t'errorCode' => '403',\n\t\t);\n }\n\t\n\t// All clear, not interrupting the normal flow of events\n\treturn $false;\n}", "public function canAddFieldsToTCATypeAfterExistingOnes() {}", "protected function allowAdd($data = array())\n {\n return true;\n }", "public function validateChecklist()\n {\n if (!$this->format->isAviable()) {\n Flash::warning('El formato no está habilitado');\n\n return redirect()->route('checklists.doit.index', $this->format);\n }\n }", "public function willGenerateAdd(): bool;", "protected function add()\n {\n $this->numArgs = $this->findNumArgs($this->callback);\n if (is_string($this->callback) && class_exists($this->callback)) {\n $this->useCallbackManager('invoke', $this->callback);\n }\n foreach ((array) $this->hook as $hook) {\n \\add_filter($hook, $this->callback, $this->priority, $this->numArgs);\n }\n }", "public function setCheckLists($val)\n {\n $this->_propDict[\"checkLists\"] = $val;\n return $this;\n }", "public function can_do_add() {\n return false;\n }", "public function checklist() {\n\t\t$pageTitle = 'Checklist';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/checklist.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n }", "public function addToList($whitelist, $ip, $force = false)\n {\n $list = $whitelist\n ? 'whitelist'\n : 'blacklist';\n\n if (!$this->ipAddress()->isValid($ip)) {\n return false;\n }\n\n $listed = $this->whichList($ip);\n\n if ($listed == $list) {\n $this->messages()->addMessage(sprintf('%s is already %s', $ip, $list.'ed'));\n\n return false;\n } else {\n if (empty($listed) || $force) {\n if (!empty($listed)) {\n $this->remove($ip);\n }\n\n $this->addToProperList($whitelist, $ip);\n\n $this->messages()->addMessage(sprintf('%s is now %s', $ip, $list.'ed'));\n\n return true;\n }\n }\n\n $this->messages()->addMessage(sprintf('%s is currently %sed', $ip, $listed));\n\n return false;\n }", "public function canAddFieldsToTCATypeBeforeExistingOnes() {}", "public function check()\n {\n foreach ($this->options as $id => $option) {\n $option->check();\n }\n }", "public function checker(callable|string $callback): self\n {\n $this->checkers[] = $callback;\n\n return $this;\n }", "public function is_allowed($check = 'both', $blog_id = \\null)\n {\n }", "public function doesCheckModifyAccessListHookGetsCalled() {}", "public function setAddClassToListItem(bool $flag = true);", "public function merge_validater_allow_list($list)\n {\n foreach ($list as $k => $v) {\n $this->_validater_allow_arr[$k] = (bool)$v;\n }\n }", "public function initCheckInformations()\n\t{\n\t\t$this->collCheckInformations = array();\n\t}", "public function action_update_check()\n\t{\n\t\tUpdate::add( $this->info->name, '9bfb17aa-f8f0-4638-a549-af4f86a9d412', $this->info->version );\n\t}", "function addToListM($listname,$entry){\n $sql= \"INSERT INTO `all_list`(`$listname`) VALUES ('$entry')\";\n $result= $this-> db-> query($sql);\n if (!$result) {\n echo \"Duplicate Entry Exist !\";\n } else {\n echo \"Entry Added to List !\";\n }\n }", "protected function additionalValidation() {\n return true;\n }", "public function addCustomValidate()\n {\n if($this->id_soldier_tmp != $this->id_soldier){\n $this->errors = \"Niepoprawny żołnierz.\";\n return false;\n }\n \n // sprawdzanie czy misja istnieje i jest aktywna\n $item = new ClassMission($this->id_mission);\n \n if(!$item->load_class){\n $this->errors = \"Misja nie istnieje.\";\n return false;\n }\n \n if($item->active != '1'){\n $this->errors = \"Misja jest wyłączona.\";\n return false;\n }\n \n // sprawdzenie czy zolnierz posiada misje\n $soldier_missions = self::sqlGetSoldierMissions($this->id_soldier);\n \n if($soldier_missions)\n {\n foreach($soldier_missions as $soldier_mission)\n {\n // sprawdzenie czy zolnierz chce 2x do tej samej misji zostac przypisany\n if($soldier_mission['id_mission'] == $this->id_mission && $soldier_mission['detached'] == '0'){\n $this->errors = \"Żołnierz posiada już tą misję.\";\n return false;\n }\n \n // sprawdzanie czy nowa misja koliduje z jakas inna misja, na ktorej zolnierz jest\n if($soldier_mission['detached'] == '0' && self::checkInterferingDates($soldier_mission['date_start'], $item->date_start, $soldier_mission['date_end'], $item->date_end)){\n $this->errors = \"Misja <b>{$item->name}</b> koliduje czasowo z misją <b>{$soldier_mission['name']}</b>.\";\n return false;\n }\n }\n }\n \n // sprawdzenie czy zolnierz posiada szkolenia\n $soldier_trainings = ClassSoldier2Training::sqlGetSoldierTrainings($this->id_soldier);\n \n if($soldier_trainings)\n {\n foreach($soldier_trainings as $soldier_training)\n {\n // sprawdzanie czy nowa misja koliduje z jakas inna misja, na ktorej zolnierz jest\n if($soldier_training['returned'] == '0' && self::checkInterferingDates($soldier_training['date_start'], $item->date_start, $soldier_training['date_end'], $item->date_end)){\n $this->errors = \"Misja <b>{$item->name}</b> koliduje czasowo ze szkoleniem <b>{$soldier_training['name']}</b>.\";\n return false;\n }\n }\n }\n \n $this->date_mission_add = date('Y-m-d H:i:s', strtotime($this->date_mission_add));\n \n // return false;\n return true;\n }", "function add($item);", "public function isExtListUpdateNecessary() {}", "public function canAddFieldsToAllTCATypesAfterExistingOnes() {}", "function _putSetCheckField($name){\n\t\tif(!isset($this->pkeyID) || isset($this->rc4key)) return;\n\t\techo \"<input type=\\\"hidden\\\" name=\\\"formitable_setcheck[]\\\" value=\\\"$name\\\"/>\\n\\n\";\n\t}", "public function check()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function addCheckingForUpdate() {\n global $laterpay_version;\n\n if ( get_option('laterpay_version') != $laterpay_version ) {\n $this->activate();\n }\n }", "public function check() {\n $field = null;\n $this->_errors = [];\n $fields = $this->_getField();\n\n foreach ($this->_constraints as $constraints) {\n foreach ($fields as $value) {\n switch ($constraints['type']) {\n case self::EQUAL:\n if ($value != $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::DIFFERENT:\n if ($value == $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::MORETHAN:\n if ($value <= $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LESSTHAN:\n if ($value >= $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::BETWEEN:\n if ($value < $constraints['value'][0] || $value > $constraints['value'][1]) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::IN:\n if (!in_array($value, $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::NOTIN:\n if (in_array($value, $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTH:\n if (strlen($value) != $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHMIN:\n if (strlen($value) < $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHMAX:\n if (strlen($value) > $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHIN:\n if (!in_array(strlen($value), $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHBETWEEN:\n if (strlen($value) < $constraints['value'][0] || strlen($value) > $constraints['value'][1]) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::REGEX:\n if (!preg_match($constraints['value'], $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::URL:\n if (!filter_var($value, FILTER_VALIDATE_URL)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::MAIL:\n if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::INT:\n if (!filter_var($value, FILTER_VALIDATE_INT)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::FLOAT:\n if (!filter_var($value, FILTER_VALIDATE_FLOAT)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::ALPHA:\n if (!preg_match('#^([a-zA-Z]+)$#', $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::ALPHANUM:\n if (!preg_match('#^([a-zA-Z0-9]+)$#', $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::ALPHADASH:\n if (!preg_match('#^([a-zA-Z0-9_-]+)$#', $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::IP:\n if (!filter_var($value, FILTER_VALIDATE_IP)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::SQL:\n /** @var $value \\Gcs\\Framework\\Core\\Orm\\Entity\\Entity */\n\n $sql = new Sql();\n $sql->query('query-form-validation', $constraints['value']['query']);\n $sql->vars('value', $value);\n\n if (count($constraints['value']['vars']) > 0) {\n $sql->vars($constraints['value']['vars']);\n }\n\n $data = $sql->fetch('query-form-validation', Sql::PARAM_FETCHCOLUMN);\n\n $querySuccess = true;\n\n switch ($constraints['value']['constraint']) {\n case '==':\n if ($data != $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n\n case '!=':\n if ($data == $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n\n case '>':\n if ($data <= $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n\n case '<':\n if ($data >= $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n }\n\n if (!$querySuccess) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::CUSTOM:\n /** @var object[] $constraints */\n if ($constraints['value']->filter() == false) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['value']->error()]);\n }\n break;\n }\n }\n\n switch ($constraints['type']) {\n case self::COUNT:\n if (count($fields) != $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::COUNTMIN:\n if (count($fields) < $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::COUNTMAX:\n if (count($fields) > $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::COUNTIN:\n /** @var array $constraints */\n if (!in_array(count($fields), $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::EXIST:\n if (count($fields) == 1 && $fields[0] == null) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::NOTEXIST:\n if (count($fields) == 1 && $fields[0] != null) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n }\n }\n }", "abstract protected function onBeforeAdd($oItem);", "function addEmail($email) {\n\t\t$email = trim($email);\n\t\tif (is_rfc3696_valid_email_address($email)) {\n\t\t\t\n\t\t\tglobal $polarbear_db;\n\t\t\t$emailSafe = $polarbear_db->escape($email);\n\n\t\t\tif ($this->isEmailInList($email)) {\n\t\t\t\t#echo \"already in list!\";\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t#echo \"not inlist\";\n\t\t\t\t$sql = \"INSERT INTO \" . POLARBEAR_DB_PREFIX . \"_emaillist_emails SET listID = '{$this->id}', email = '$emailSafe', dateAdded = now()\";\n\t\t\t\t$polarbear_db->query($sql);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function check()\n {\n if(!empty($this->user)) {\n // If you need to check users online list in every page load, check this TRUE in config file\n if($this->config->item('check_users_on_page_load', 'online')) {\n $this->checkOnlineList();\n }\n\n $this->addUser();\n }\n }", "public function testAdd()\n {\n $c = $this->_getNewCollection();\n $value = $this->_getNewValue();\n $pre = $c->count();\n $this->assertTrue( $c->add($value) );\n $post = $c->count();\n $this->assertTrue( $pre < $post );\n $this->assertFalse( $c->add($value) );\n }", "public function add($element) {\n $result = !$this->contains($element);\n $this->elements[$element] = true;\n return $result;\n }", "protected function check($item){\r\n\tif((string)$item->row->attributes()->system_type=='bool'){\r\n\t\t$postdata = !isset($this->sourceData['meta_value_'.(string)$item->row->name]) ? 0: 1;\r\n\t}else{\r\n\t\t$postdata = (string)$item->row->attributes()->system_type=='password' ? array($this->sourceData['meta_value_'.(string)$item->row->name], $this->sourceData['meta_value_'.(string)$item->row->name.'_check']):$this->sourceData['meta_value_'.(string)$item->row->name];\r\n\t}\r\n\tif((int)$item->row->attributes()->validate == 1){\r\n\t\t$ret = DataValidator::validateData($postdata, (string)$item->row->attributes()->system_type, (int)$item->row->attributes()->size) === true ? 'ok': 'v';\r\n\t\t\r\n\t\t$tpref = Lng::get('system/mwms_meta_datatype_operators');\r\n\t\t\r\n\t\t$operator = $tpref[(string)$item->row->attributes()->system_type];\r\n\t\t\r\n\t\tif((int)$item->row->attributes()->unique == 1 && $ret == 'ok'){\r\n\t\t\t$ret = $ret=='ok' && $this->unique($item, $this->sourceData['meta_value_'.(string)$item->row->name], $operator) ? 'ok': 'u';\r\n\t\t}\r\n\t\t\r\n\t\tif(!$ret){\r\n\t\t\t$show = is_array($postdata) ? implode(\"/\", $postdata): $postdata;\r\n\t\t\t//echo $item->row->title.'(@'.$item->row->name.') -> '.$item->row->attributes()->system_type.' -> '.$postdata.'<br />';\r\n\t\t}\r\n\t\t\r\n\t\treturn $ret;\r\n\t}else{\r\n\t\treturn 'ok';\r\n\t}\r\n}", "abstract public function addRule(ValidationRule$rule);", "public function add(string $data): bool {}", "function um_add_security_checks( $args ) {\r\n\tif ( is_admin() ) {\r\n\t\treturn;\r\n\t} ?>\r\n\r\n\t<input type=\"hidden\" name=\"timestamp\" class=\"um_timestamp\" value=\"<?php echo current_time( 'timestamp' ) ?>\" />\r\n\r\n\t<p class=\"<?php echo UM()->honeypot; ?>_name\">\r\n\t\t<label for=\"<?php echo UM()->honeypot . '_' . $args['form_id']; ?>\"><?php _e( 'Only fill in if you are not human' ); ?></label>\r\n\t\t<input type=\"text\" name=\"<?php echo UM()->honeypot; ?>\" id=\"<?php echo UM()->honeypot . '_' . $args['form_id']; ?>\" class=\"input\" value=\"\" size=\"25\" autocomplete=\"off\" />\r\n\t</p>\r\n\r\n\t<?php\r\n}", "public function CheckAdd()\n {\n $adds = Add::find()->all();\n foreach ($adds as $add) {\n $orders = Deal::find()->where(['add_id'=>$add->id])->all();\n $add->setOrder(0);\n\n foreach ($orders as $o) {\n if ($o->isConfirmed == 1)\n {\n if($o->from <= date('Y-m-d') && $o->till >= date('Y-m-d'))\n $add->setOrder(1);\n }\n }\n }\n }", "public static function checkers()\n {\n return [\n 'status' => 'hasStatus',\n 'quota' => 'hasQuota'\n ];\n }", "public function hasAddhp(){\r\n return $this->_has(20);\r\n }", "public function lendABook()\n {\n $objectModel = \"lendABook\";\n $errorMessage = \"Oups, désolé mais il est impossible d'ajouter le livre aux prêts.\";\n $successMessage = \"Le livre a bien été ajouté à vos prêts.\";\n\n $this->structureMethodAddOrRemoveFlags($objectModel, $errorMessage, $successMessage);\n }", "function onBeforeAdd() {\n\t\treturn true;\n\t}", "public function addNoResultsCheck()\n {\n $this->isResultCheck = false;\n return $this;\n }", "public function check()\n\t{\n // @TODO: Finish validation checks\n $this->assertNotEmpty($this->item_list_element, 'COM_CAJOBBOARD_ORGANIZATION_TYPE_ERR_TYPE_OF_ORGANIZATION');\n $this->assertNotEmpty($this->url, 'COM_CAJOBBOARD_ORGANIZATION_TYPE_ERR_ URL');\n\n\t\tparent::check();\n\n return $this;\n }", "function addCheckLog($message){\n global $checkLogQ;\n $length = 4;\n // If checkLogQ size is smaller than 4 add the message\n if(count($checkLogQ)<$length){\n $checkLogQ[] = $message;\n }\n // If checkLogQ size is bigger than 4 - Remove the oldest message and add the new one\n else{\n array_shift($checkLogQ);\n $checkLogQ[] = $message;\n }\n }", "function checklists_module_add_checklist_url($project, $additional_params = null) {\n $params = array('project_id' => $project->getId());\n if($additional_params !== null) {\n $params = array_merge($params, $additional_params);\n } // if\n return assemble_url('project_checklists_add', $params);\n }", "public function addRequestChecks()\n {\n $data = $this->all();\n $data['is_post'] = $this->isPost();\n $data['is_update'] = $this->isPut();\n $data['is_editing'] = $this->isPost() || $this->isPut();\n $data['is_delete'] = $this->isDelete();\n\n $this->replace($data);\n\n return $this->all();\n }", "public function action_update_check()\n\t{\n\t \tUpdate::add('Atom Threading Extensions', 'a413fa7e-76cf-4edf-b7c5-53b8aa648eef', $this->info->version);\n\t}" ]
[ "0.66823465", "0.60192966", "0.5837272", "0.57955647", "0.573405", "0.57142764", "0.5643155", "0.55922496", "0.5584262", "0.55525064", "0.55189776", "0.5507246", "0.54952514", "0.5478058", "0.5409064", "0.53934973", "0.53793", "0.53669035", "0.53669035", "0.53669035", "0.53669035", "0.53669035", "0.53187704", "0.5313449", "0.52994704", "0.529169", "0.529169", "0.52821016", "0.5265856", "0.5254272", "0.5248097", "0.52232736", "0.5217934", "0.52101207", "0.52019083", "0.5201644", "0.5199645", "0.51926744", "0.51507777", "0.51480055", "0.5144828", "0.51348305", "0.51348305", "0.51249385", "0.51176643", "0.5099877", "0.5097219", "0.50706637", "0.50704473", "0.50509286", "0.5049834", "0.50421786", "0.503906", "0.5031934", "0.4999526", "0.49878815", "0.49865758", "0.49847257", "0.4967931", "0.4960584", "0.4951135", "0.49469098", "0.493613", "0.4930092", "0.49299306", "0.49027956", "0.48799726", "0.4876271", "0.48759794", "0.48754394", "0.48744625", "0.48688784", "0.48600563", "0.48418573", "0.48398948", "0.48343995", "0.48261696", "0.4816934", "0.48162988", "0.48047787", "0.479341", "0.47881088", "0.47811702", "0.4779116", "0.4777192", "0.47770667", "0.47756585", "0.47731462", "0.47692454", "0.47578824", "0.47500992", "0.4745564", "0.4742831", "0.47393382", "0.47392482", "0.47385484", "0.47310513", "0.47284138", "0.47282094", "0.47269642" ]
0.48504543
73
/ Check the license key
public function getChecks() { $result = (version_compare(phpversion(), '5.2.8', '>=')) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'PHP version', $result, "PHP version 5.2.8 or higher is needed. A latest PHP version is always recommended."); $current = ini_get('memory_limit'); $result = (version_compare($current, '255M', '>')) ? self::CHECK_OK : self::CHECK_WARNING; $this->addResult('system', 'PHP memory', $result, "The minimum requirement for Magento itself is 256Mb. Current memory: ".$current); $result = (function_exists('json_decode')) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'JSON', $result, 'The JSON-extension for PHP is needed'); $result = (function_exists('curl_init')) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'CURL', $result, 'The CURL-extension for PHP is needed'); $result = (function_exists('simplexml_load_string')) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'SimpleXML', $result, 'The SimpleXML-extension for PHP is needed'); $result = (in_array('ssl', stream_get_transports())) ? self::CHECK_OK : self::CHECK_WARNING; $this->addResult('system', 'OpenSSL', $result, 'PHP support for OpenSSL is needed if you want to use HTTPS'); $result = (function_exists('iconv')) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'iconv', $result, 'The iconv-extension for PHP is needed'); $result = (ini_get('safe_mode')) ? self::CHECK_ERROR : self::CHECK_OK; $this->addResult('system', 'Safe Mode', $result, 'PHP Safe Mode is strongly outdated and not supported by either Joomla! or Magento'); $result = (ini_get('magic_quotes_gpc')) ? self::CHECK_ERROR : self::CHECK_OK; $this->addResult('system', 'Magic Quotes GPC', $result, 'Magic Quotes GPC is outdated and should be disabled'); $remote_domain = 'api.yireo.com'; $result = (@fsockopen($remote_domain, 80, $errno, $errmsg, 5)) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'Firewall', $result, 'Firewall needs to allow outgoing access on port 80.'); $logfile = Mage::helper('vm2mage')->getDebugLog(); $result = (@is_writable($logfile)) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'Logfile', $result, 'Logfile "'.$logfile.'" should be writable'); $import_dir = Mage::getBaseDir('media').DS.'import'; if(!is_dir($import_dir)) @mkdir($import_dir); $result = (@is_writable($import_dir)) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'Import folder', $result, 'Import-folder "'.$import_dir.'" should be writable'); $catalog_dir = Mage::getBaseDir('media').DS.'catalog'; if(!is_dir($catalog_dir)) @mkdir($catalog_dir); $result = (@is_writable($catalog_dir)) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'Catalog folder', $result, 'Catalog-folder "'.$catalog_dir.'" should be writable'); $collection = Mage::getResourceModel('api/user_collection'); $result = ($collection->count() > 0) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'API-user', $result, 'You should create an API-user with API resource-access'); return $this->system_checks; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function askVerifyAndSaveLicenseKey()\n{\n if (empty($_POST['key']))\n {\n renderLicenseForm('Please enter a license key'); \n exit();\n } else {\n $license_key = preg_replace('/[^A-Za-z0-9-_]/', '', trim($_POST['key'])); \n }\n $checker = new Am_LicenseChecker($license_key, API_URL, RANDOM_KEY, null);\n if (!$checker->checkLicenseKey()) // license key not confirmed by remote server\n {\n renderLicenseForm($checker->getMessage()); \n exit();\n } else { // license key verified! save it into the file\n file_put_contents(DATA_DIR . '/key.txt', $license_key);\n return $license_key;\n }\n}", "private function check_key_valid() {\n $license = get_transient('wcis_license');\n\n // if key doesn't exist, abort\n if(!isset($license['key']) ) { return false; }\n\n // if valid, return success\n if(isset($license['valid']) && $license['valid'] === true) {\n $msg = __('API Connected!', 'wcis');\n $this->form_fields['key']['description'] = '<span style=\"color: #4caf50;\">' . $msg . '</span>';\n }\n else {\n $msg = __('Invalid API Key. Is there empty space before / after it?', 'wcis');\n $this->form_fields['key']['description'] = '<span style=\"color:#f44336;\">' . $msg . '</span>';\n }\n\n return $license['valid'];\n }", "function eddenvato_verify_license($key){\n\n\t// Setup Call\n\t$envato_apikey = get_option('eddenvato-api-key');\n\t$envato_username = get_option('eddenvato-user-name');\n\t$license_to_check = $key;\n\treturn wp_remote_get( 'http://marketplace.envato.com/api/edge/'.$envato_username.'/'.$envato_apikey.'/verify-purchase:'.$license_to_check.'.json' );\n\n}", "function check_licence( $licence_key ) {\n\t\t// return json_encode( array( 'ok' => 'ok' ) );\n\t\t// return json_encode( array( 'errors' => array( 'standard' => 'oh no! licence is not working.') ) );\n\t\tif( empty( $licence_key ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t$args = array(\n\t\t\t'licence_key' => $licence_key,\n\t\t\t'site_url' => site_url( '', 'http' ),\n\t\t\t);\n\n\t\t$response = $this->dbrains_api_request( 'check_support_access', $args );\n\t\tset_site_transient( 'wpmdb_licence_response', $response, $this->transient_timeout );\n\t\treturn $response;\n\t}", "public function verifyPurchaseCode()\n {\n $this->validateRequest();\n\n $response = $this->api->post('/verify', array(\n 'site_url' => Quform::base64UrlEncode(site_url()),\n 'purchase_code' => $_POST['purchase_code']\n ));\n\n if (is_array($response)) {\n if (isset($response['type'])) {\n if ($response['type'] == 'success') {\n $this->setKey($response['license_key']);\n\n delete_transient('quform_latest_version_info');\n delete_site_transient('update_plugins');\n\n wp_send_json(array(\n 'type' => 'success',\n 'status' => $this->getStatus(),\n 'message' => __('License key successfully verified', 'quform')\n ));\n } else if ($response['type'] == 'error') {\n $this->revoke();\n\n delete_transient('quform_latest_version_info');\n delete_site_transient('update_plugins');\n\n wp_send_json(array(\n 'type' => 'error',\n 'status' => $this->getStatus(),\n 'message' => __('Invalid license key', 'quform')\n ));\n }\n } else if (isset($response['code'])) {\n switch ($response['code']) {\n case 'rest_invalid_param':\n $this->revoke();\n\n delete_transient('quform_latest_version_info');\n delete_site_transient('update_plugins');\n\n wp_send_json(array(\n 'type' => 'error',\n 'status' => $this->getStatus(),\n 'message' => __('Invalid license key', 'quform')\n ));\n break;\n }\n }\n }\n\n wp_send_json(array(\n 'type' => 'error',\n 'message' => wp_kses(sprintf(\n __('An error occurred verifying the license key, please try again. If this problem persists, see %sthis page%s.', 'quform'),\n '<a href=\"http://support.themecatcher.net/quform-wordpress-v2/troubleshooting/common-problems/an-error-occurred-verifying-the-license-key\">',\n '</a>'\n ), array('a' => array('href' => array())))\n ));\n }", "public function weekly_license_check()\n {\n\n\n if (empty($this->licensekey)) {\n return;\n }\n\n // data to send in our API request\n $api_params = [\n 'edd_action' => 'check_license',\n 'license' => $this->licensekey,\n 'item_name' => urlencode(WPSTG_ITEM_NAME),\n 'url' => home_url()\n ];\n\n // Call the API\n $response = wp_remote_post(\n WPSTG_STORE_URL, [\n 'timeout' => 15,\n 'sslverify' => false,\n 'body' => $api_params\n ]\n );\n\n // make sure the response came back okay\n if (is_wp_error($response)) {\n return;\n }\n\n $license_data = json_decode(wp_remote_retrieve_body($response));\n update_option('wpstg_license_status', $license_data);\n\n //$log = new \\WPStaging\\Core\\Utils\\Logger;\n //$log->log( json_encode( array($license_data) ) );\n }", "public function recheck_license( $license_key = '' ) {\n\t\t$status = $this->_check_license( $license_key, true );\n\t\t$this->is_valid = true === $status;\n\n\t\treturn $status;\n\t}", "function monsterinsights_get_license_key_errors() {\n\t$errors = false;\n\t$license = monsterinsights_get_license();\n\tif ( ! empty( $license['type'] ) && is_string( $license['type'] ) && strlen( $license['type'] ) > 3 ) {\n\t\tif ( ( isset( $license['is_expired'] ) && $license['is_expired'] ) \n\t\t || ( isset( $license['is_disabled'] ) && $license['is_disabled'] )\n\t\t || ( isset( $license['is_invalid'] ) && $license['is_invalid'] ) ) {\n\t\t\t$errors = true;\n\t\t}\n\t}\n\treturn $errors;\n}", "public static function checkLicenseKey()\n\t{\n\t\ttry {\n\t\t $content = \\File::get(storage_path(\"license.key\"));\n\t\t} catch (\\Exception $exception) {\n\t\t return null;\n\t\t}\n\n\t\treturn $content;\n\t}", "function checkLicence() {\n\n $isValid = true;\n \n return $isValid;\n}", "public function license($license_key) {\n $license_key = trim($license_key);\n $alert = [];\n if(!$license_key):\n $alert = ['danger' => 'No license key added'];\n update_option('responsive_menu_pro_license_type', '');\n update_option('responsive_menu_pro_license_key', '');\n\n else:\n /* First Check The Generic License */\n $response = wp_remote_get('https://responsive.menu/?' . http_build_query(\n [\n 'edd_action'=> 'activate_license',\n 'license' \t=> $license_key,\n 'item_name' => urlencode('Responsive Menu Pro'),\n 'url' => home_url()\n ]\n ), ['decompress' => false]);\n $license_type = 'License';\n if(is_wp_error($response))\n $alert = ['danger' => $response->get_error_message() . ' - Please <a href=\"https://responsive.menu/faq/license-activation-issues\" target=\"_blank\"> click here</a> for more information.'];\n else\n $response = json_decode($response['body']);\n\n /* Parse Result */\n if(!isset($response->success) || !$response->success):\n /* Now Check The Old Multi License */\n $response = wp_remote_get('https://responsive.menu/?' . http_build_query(\n [\n 'edd_action'=> 'activate_license',\n 'license' \t=> $license_key,\n 'item_name' => urlencode('Responsive Menu Pro - Multi License'),\n 'url' => home_url()\n ]\n ), ['decompress' => false]);\n $license_type = 'Multi License';\n if(is_wp_error($response))\n $alert = ['danger' => $response->get_error_message() . ' - Please <a href=\"https://responsive.menu/faq/license-activation-issues\" target=\"_blank\"> click here</a> for more information.'];\n else\n $response = json_decode($response['body']);\n endif;\n\n /* Parse Result */\n if(!isset($response->success) || !$response->success):\n /* Finally Check The Old Single License */\n $response = wp_remote_get('https://responsive.menu/?' . http_build_query(\n [\n 'edd_action'=> 'activate_license',\n 'license' \t=> $license_key,\n 'item_name' => urlencode('Responsive Menu Pro - Single License'),\n 'url' => home_url()\n ]\n ), ['decompress' => false]);\n $license_type = 'Single License';\n\n if(is_wp_error($response))\n $alert = ['danger' => $response->get_error_message() . ' - Please <a href=\"https://responsive.menu/faq/license-activation-issues\" target=\"_blank\"> click here</a> for more information.'];\n else\n $response = json_decode($response['body']);\n endif;\n\n if(isset($response->success) && $response->success):\n update_option('responsive_menu_pro_license_type', $license_type);\n $alert = ['success' => 'License key updated'];\n else:\n update_option('responsive_menu_pro_license_type', '');\n if(!is_wp_error($response))\n $alert = ['danger' => 'License key invalid' . ' - Please <a href=\"https://responsive.menu/knowledgebase/license-activation-issues/\" target=\"_blank\"> click here</a> for more information.'];\n endif;\n update_option('responsive_menu_pro_license_key', $license_key);\n endif;\n\n return $this->view->render(\n 'admin/main.html.twig',\n [\n 'alert' => $alert,\n 'options' => $this->manager->all()\n ]\n );\n }", "function monsterinsights_get_license_key() {\n\t$license = false;\n\tif ( defined( 'MONSTERINSIGHTS_LICENSE_KEY' ) && is_string( MONSTERINSIGHTS_LICENSE_KEY ) && strlen( MONSTERINSIGHTS_LICENSE_KEY ) > 10 ) {\n\t\t$license = MONSTERINSIGHTS_LICENSE_KEY;\n\t} else {\n\t\t$license = monsterinsights_get_license();\n\t\tif ( ! empty( $license['key'] ) && is_string( $license['key'] ) && strlen( $license['key'] ) > 10 ) {\n\t\t\t$license = $license['key'];\n\t\t} else {\n\t\t\t$license = false;\n\t\t}\n\t}\n\n\treturn apply_filters( 'monsterinsights_license_key', $license );\n}", "function verifyLicense($licenseKey, $seed, $publicKey){\n\t$replacement = str_replace(\"8\", \"O\", str_replace(\"9\", \"I\", $licenseKey));\n\t$undashed = trim(str_replace(\"-\", \"\", $replacement));\n\n\t// Pad the output length to a multiple of 8 with '=' characters\n\t$desiredLength = strlen($undashed);\n\tif($desiredLength % 8 != 0) {\n\t\t$desiredLength += (8 - ($desiredLength % 8));\n\t\t$undashed = str_pad($undashed, $desiredLength, \"=\");\n\t}\n\t$decodedHash = base32_decode($undashed);\n\t//digest the original Data\n\t$ok = openssl_verify($seed, $decodedHash, $publicKey, OPENSSL_ALGO_DSS1);\n\treturn $ok;\n}", "public function checkLicense(){\n\n $secretkey = DB::table('configs')->where('nume', 'secr')->pluck('valoare');\n $tokenapp = DB::table('configs')->where('nume', 'tokenapp')->pluck('valoare');\n\n\n $root = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/';\n\n if ($secretkey == \"\") {\n DB::table('configs')->where('nume', 'secr')->update(array('valoare' => ''));\n DB::table('configs')->where('nume', 'tokenapp')->update(array('valoare' => ''));\n //Return true if license is empty\n return true;\n } else {\n\n $configs = DB::table('configs')\n ->where('nume', 'basic')\n ->pluck('valoare');\n\n $configs = json_decode($configs, true);\n\n\n $root = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/';\n if(!empty($configs['tokenapp'])){\n $url = \"http://yalayolo.me/vapi/api/api.php?license=\".$secretkey.\"&domain=\".$root.\"&product=viralfb&token=\".$tokenapp;\n }else{\n $url = \"http://yalayolo.me/vapi/api/api.php?license=\".$secretkey.\"&domain=\".$root.\"&product=viralfb\";\n }\n\n\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_HEADER, false);\n $data = curl_exec($curl);\n curl_close($curl);\n $json = $data;\n if (strpos($json, 'Wrong license key')!==false) {\n DB::table('configs')->where('nume', 'secr')->update(array('valoare' => ''));\n DB::table('configs')->where('nume', 'tokenapp')->update(array('valoare' => ''));\n //Return true if license is invalid\n return true;\n }\n }\n \n\n }", "function check_software_license()\n {\n $q = $this->db->where('license', $this->input->post('license_num'))->where('action_type', 'install')->where('company_id', $this->session->userdata('company_id'))->limit(1)->get('software');\n\n if ($q->num_rows == 1)\n {\n return true;\n\n } else {\n\n return false;\n }\n }", "public function license_key_notice() {\n\n\t\tif( !SPP_Core::is_paid_version() ) {\n\t ?>\n\t <div class=\"error\">\n\t <p style=\"line-height: 30px;\"><?php _e( 'Please enter your Smart Podcast Player license key to get updates and support! <a href=\"' . SPP_SETTINGS_URL . '\" class=\"button\" style=\"float: right;\">Go to Settings</a>', 'smart-podcast-player' ); ?></p>\n\t </div>\n\t <div class=\"notice\">\n\t <p style=\"line-height: 30px;\"><?php _e( $this->license_paid_notice_text() ) ?></p>\n\t </div>\n\t <?php\n\t\t}\n\t}", "public function capture_license_key() {\r\n\t\r\n\t// Process if no other actions are active\r\n\tif ( !isset($_GET[$this->plugin_config['plugin_prefix'].'_license_change']) ) {\r\n\t\r\n\t\t//$current_key = $this->get_license_option('license_key');\r\n\t\t\r\n\t\tif( !empty($this->license_key) ) {\r\n\t\t\t\r\n\t\t\t// Set new key\r\n\t\t\t$this->set_license_option('license_key', $this->license_key);\r\n\t\t\t\r\n\t\t}\r\n\t\r\n\t}\r\n}", "public function get_license_key() {\n\n\t\t$license = get_option( $this->product_slug . '-license-key' );\n\n\t\tif ( ! $license ) {\n\t\t\t// User hasn't saved the license to settings yet. No use making the call.\n\t\t\treturn false;\n\t\t}\n\n\t\treturn trim( $license );\n\t}", "public function fetchLicenseKey()\n {\n try {\n $license = $this->db->fetchQuery(\"SELECT license_key FROM license WHERE id=:keyId\", [\":keyId\" => intval($_POST['kid'])]);\n if (!$license) {\n throw new InvalidLicenseException(\"No License Key Available.\", 401);\n }\n $this->response = [\"license\" => $this->_fetchLicensePublicKey($license['license_key'])];\n } catch (InvalidLicenseException $e) {\n throw new InvalidLicenseException($e->getMessage(), $e->getCode());\n } catch (\\Exception $e) {\n throw new InvalidLicenseException(\"Unable to Fetch License Key.\", 500);\n }\n }", "public function wubtitle_activation_license_key() {\n\t\t$site_url = get_site_url();\n\t\t$body = array(\n\t\t\t'data' => array(\n\t\t\t\t'domainUrl' => $site_url,\n\t\t\t\t'siteLang' => explode( '_', get_locale(), 2 )[0],\n\t\t\t),\n\t\t);\n\t\t$response = wp_remote_post(\n\t\t\tENDPOINT . 'key/create',\n\t\t\tarray(\n\t\t\t\t'method' => 'POST',\n\t\t\t\t'headers' => array(\n\t\t\t\t\t'Content-Type' => 'application/json; charset=utf-8',\n\t\t\t\t),\n\t\t\t\t'body' => wp_json_encode( $body ),\n\t\t\t)\n\t\t);\n\t\t$code_response = wp_remote_retrieve_response_code( $response );\n\t\tif ( 201 === $code_response ) {\n\t\t\t$response_body = json_decode( wp_remote_retrieve_body( $response ) );\n\t\t\tupdate_option( 'wubtitle_free', $response_body->data->isFree );\n\t\t\tupdate_option( 'wubtitle_license_key', $response_body->data->licenseKey );\n\t\t}\n\t}", "function monsterinsights_get_license_key_type() {\n\t$type = false;\n\t$license = monsterinsights_get_license();\n\tif ( ! empty( $license['type'] ) && is_string( $license['type'] ) ) {\n\t\tif ( in_array( $license['type'], array( 'master', 'pro', 'plus', 'basic' ) ) ) {\n\t\t\t$type = $license['type'];\n\t\t}\n\t}\n\treturn $type;\n}", "public function getLicenseKey(): LicenseKeyDataInterface;", "public function checkLicenseAction()\n {\n $licenseString = trim($this->Request()->getPost('licenseString'));\n\n if (empty($licenseString)) {\n $this->View()->assign([\n 'success' => false,\n 'message' => 'Empty license information cannot be validated.',\n ]);\n\n return;\n }\n\n try {\n /** @var LicenseInformation $licenseData */\n $licenseData = $this->unpackLicense($licenseString);\n } catch (Exception $e) {\n $this->View()->assign([\n 'success' => false,\n 'message' => $e->getMessage(),\n 'errorType' => $this->resolveLicenseException($e),\n ]);\n\n return;\n }\n\n try {\n $licenseInstaller = new LicenseInstaller($this->container->get('dbal_connection'));\n $licenseInstaller->installLicense($licenseData);\n } catch (Exception $e) {\n $this->View()->assign([\n 'success' => false,\n 'message' => $e->getMessage(),\n ]);\n\n return;\n }\n\n $licenseData = $this->reFormatLicenseString($licenseData);\n\n $this->View()->assign([\n 'success' => true,\n 'licenseData' => $licenseData,\n ]);\n }", "function validate_key($key)\n{\n if ($key == 'PhEUT5R251')\n return true;\n else\n return false;\n}", "function edd_mpce_check_license($license) {\n global $motopressCESettings;\n $result = array(\n 'errors' => array(),\n 'data' => array()\n );\n $apiParams = array(\n 'edd_action' => 'check_license',\n 'license' => $license,\n 'item_name' => urlencode($motopressCESettings['edd_mpce_item_name'])\n );\n\n // Call the custom API.\n $response = wp_remote_get(add_query_arg($apiParams, $motopressCESettings['edd_mpce_store_url']), array('timeout' => 15, 'sslverify' => false));\n \n if (is_wp_error($response)) {\n $errors = $response->get_error_codes();\n foreach ($errors as $key => $code) {\n $result['errors'][$code] = $response->get_error_message($code);\n }\n return $result;\n }\n\n $licenseData = json_decode(wp_remote_retrieve_body($response));\n\n if (!is_null($licenseData)) {\n $result['data'] = $licenseData;\n } else {\n $result['errors']['json_decode'] = 'Unable to decode JSON string.';\n }\n\n return $result;\n}", "function license_exists($lic) {\n\tglobal $DB;\n\n\tif(!isset($lic) || empty($lic) || is_null($lic)) {\n\t\treturn true;\n\t}\n\t$lic = $DB->EscapeQueryStmt($lic);\n\t$DB->Query(\"SELECT COUNT(*) AS TOT FROM Account WHERE License = '{$lic}'\");\n\t$tot = $DB->GetRow();\n\treturn (isset($tot[\"TOT\"]) && intval($tot[\"TOT\"]) > 0);\n}", "private function validateLicenseData()\n {\n\n // error_log('LicenseEmail : '.print_r($this->getLicenseEmail(), 1));\n // error_log('LicenseProduct : '.print_r($this->getLicenseProduct(), 1));\n // error_log('LicenseSecretKey : '.print_r($this->getLicenseSecretKey(), 1));\n }", "function thrive_dashboard_license_check($licensed_email, $license_key = '', $product_ids = array())\n{\n $api_url = THRIVE_DASHBOARD_LICENSE_API_URL;\n $api_url .= \"?license=\" . $license_key;\n $api_url .= \"&email=\" . $licensed_email;\n $api_url .= \"&product_id=\" . implode(',', $product_ids);\n $licenseValid = wp_remote_get($api_url, array('sslverify' => false, 'timeout' => 120));\n\n if (is_wp_error($licenseValid)) {\n /** @var WP_Error $licenseValid */\n /** Couldn't connect to the API URL - possible because wp_remote_get failed for whatever reason. Maybe CURL not activated on server, for instance */\n $response = new stdClass();\n $response->success = 0;\n $response->reason = sprintf(__(\"An error occurred while connecting to the license server. Error: %s. Please login to thrivethemes.com, report this error message on the forums and we'll get this sorted for you\"), $licenseValid->get_error_message());\n\n return $response;\n }\n\n $response = @json_decode($licenseValid['body']);\n\n if (empty($response)) {\n $response = new stdClass();\n $response->success = 0;\n $response->reason = sprintf(__(\"An error occurred while receiving the license status. The response was: %s. Please login to thrivethemes.com, report this error message on the forums and we'll get this sorted for you.\"), $licenseValid['body']);\n\n return $response;\n }\n\n return $response;\n}", "protected function _check_license( $license_key = '', $force_now = false ) {\n\t\t// Get the license key if it's not set.\n\t\t$license_key = '' !== $license_key ? $license_key : SermonManager::getOption( 'license_key' );\n\n\t\t// Do not use local key if we are forcing the check.\n\t\t$local_key = $force_now ? '' : get_option( 'smp_local_key', '' );\n\n\t\t// Do not check the license if we do not have the license key.\n\t\tif ( ! $license_key ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Remove transient if we are forcing the check.\n\t\tif ( $force_now ) {\n\t\t\tdelete_transient( 'smp_license_good' );\n\t\t}\n\n\t\t// Check if we do not have to send the request to the server.\n\t\t$license_checked = get_transient( 'smp_license_good' );\n\t\tif ( false !== $license_checked ) {\n\t\t\treturn 1 == $license_checked;\n\t\t}\n\n\t\t// Check if it's club license.\n\t\t$request = wp_safe_remote_request( 'https://wpforchurch.com/?WPFC=check_license&license_key=' . urlencode( $license_key ) . '&domain=' . urlencode( $_SERVER['SERVER_NAME'] ) );\n\n\t\tif ( ! $request instanceof \\WP_Error && 200 === $request['response']['code'] ) {\n\t\t\t$response = json_decode( $request['body'], true );\n\n\t\t\tif ( $response && 'Valid' === $response['message'] ) {\n\t\t\t\tset_transient( 'smp_license_good', 1, DAY_IN_SECONDS );\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// Validate the license.\n\t\t$data = $this->_validate_license( $license_key, $local_key );\n\n\t\t// Add default data.\n\t\t$data += array(\n\t\t\t'status' => 'Invalid',\n\t\t\t'localkey' => '',\n\t\t\t'message' => '',\n\t\t);\n\n\t\t// If there was no error.\n\t\tif ( ! $data['message'] ) {\n\t\t\tswitch ( $data['status'] ) {\n\t\t\t\tcase 'Active':\n\t\t\t\t\tset_transient( 'smp_license_good', 1, DAY_IN_SECONDS );\n\t\t\t\t\tupdate_option( 'smp_local_key', $data['localkey'] );\n\n\t\t\t\t\treturn true;\n\t\t\t\tcase 'Suspended':\n\t\t\t\tcase 'Expired':\n\t\t\t\tcase 'Invalid':\n\t\t\t\tcase 'Terminated':\n\t\t\t\t\tset_transient( 'smp_license_good', 0, DAY_IN_SECONDS );\n\t\t\t\t\tupdate_option( 'smp_local_key', '' );\n\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t} else { // If there was an error.\n\t\t\tset_transient( 'smp_license_good', 0, DAY_IN_SECONDS );\n\t\t\tupdate_option( 'smp_local_key', '' );\n\t\t}\n\n\t\t// Return the error message only if we are forcing the check.\n\t\tif ( $force_now ) {\n\t\t\tif ( $data['message'] ) {\n\t\t\t\treturn $data['message'] . '.';\n\t\t\t} else {\n\t\t\t\treturn __( 'Unknown error.', 'sermon-manager-pro' );\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function is_valid() {\n\t\t$license = $this->get_license();\n\n\t\tif ( isset( $license['license'] ) && 'valid' === $license['license'] ) {\n\t\t\tif ( isset( $license['expires'] ) && time() < strtotime( $license['expires'] ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function validate($con, $mysql_table, $lic, $appId)\n{\n $valid = FALSE;\n\t\n\t$result = mysql_query(\"SELECT Type, System, NumUsers, EndDate, Products, DomainSuffix FROM $mysql_table WHERE (LicenseKey = '$lic')\")\n\tor die(\"1,\" . mysql_error());\n\t\n\twhile($row = mysql_fetch_array($result)) {\n\t $valid = true;\n $productId = intval($row['Products']);\n if($productId & intval($appId) == 0)\n echo \"1,License does not include this product\";\n else\n \t echo \"0,\" . $row['DomainSuffix'] . \",\" . $row['EndDate'] . \",\" . $row['System'] . \",\" . $row['Type'] . \",\" . $row['NumUsers'];\n\t}\n\tif(!$valid)\n\t echo \"1,License Key Not Found\";\n\n\tmysql_close($con);\n}", "function shoestrap_theme_license_status() {\n\n global $wp_version;\n\n $license = shoestrap_getVariable( 'shoestrap_license_key' );\n\n // Copy the licence to a separate option\n update_option( 'shoestrap_license_key', $licence );\n\n $api_params = array(\n 'edd_action' => 'check_license',\n 'license' => $license,\n 'item_name' => urlencode( SHOESTRAP_THEME_NAME )\n );\n\n $response = wp_remote_get( add_query_arg( $api_params, SHOESTRAP_STORE_URL ) );\n\n if ( is_wp_error( $response ) )\n return false;\n\n $license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n return $license_data->license;\n}", "public function shouldAcceptLicense()\n {\n return !Config::get('licenseAccepted');\n }", "function check_lti2_key() {\n global $PDOX, $CFG;\n\n if ( ! isset($_SESSION['id']) ) return 'You are not logged in.';\n $row = $PDOX->rowDie(\n \"SELECT request_id, user_id, admin, state, lti\n FROM {$CFG->dbprefix}key_request\n WHERE user_id = :UID AND lti = 2 LIMIT 1\",\n array(\":UID\" => $_SESSION['id'])\n );\n\n if ( $row === false ) {\n return 'You have not requested a key for this service.';\n }\n\n if ( $row['state'] == 0 ) {\n return 'You key has not yet been approved. '.$row['admin'];\n }\n\n if ( $row['state'] != 1 ) {\n return 'Your key request was not approved. '.$row['admin'];\n }\n\n if ( $row['lti'] != 2 ) {\n return 'Your did not request an LTI 2.0 key. '.$row['admin'];\n }\n\n return true;\n}", "public function check() {\n\t\t$license_data = $this->find_license( $this->args );\n\n\t\t// Only report errors.\n\t\tif ( $license_data->status !== 'success' ) {\n\t\t\t$this->results[] = array(\n\t\t\t\t'severity' => $license_data->status,\n\t\t\t\t'message' => $license_data->message,\n\t\t\t);\n\t\t}\n\n\t\t// Check if GPLv2 compatible if no errors found with License Identifier so far.\n\t\tif ( $license_data->status !== 'warning' && ! $this->is_gpl2_or_later_compatible( $license_data ) ) {\n\t\t\t$this->results[] = array(\n\t\t\t\t'severity' => 'warning',\n\t\t\t\t'message' => sprintf(\n\t\t\t\t\t/* translators: %s: the license specified in readme.txt */\n\t\t\t\t\tesc_html__( 'The license specified, %s is not compatible with WordPress\\' license of GPL-2.0-or-later. All themes must meet this requirement!' ),\n\t\t\t\t\t$this->args\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t}", "function validate_key($key,$mobile){\n $apiEncrypter = new ApiEncrypter();\n $d_key = $apiEncrypter->decrypt($key);\n return $d_key == $mobile ? true : false;\n}", "function clixplit_activate($key) {\n\n $license_key = $key;\n $response_message ='';\n\n // API query parameters\n $api_params = array(\n 'slm_action' => 'slm_activate',\n 'secret_key' => self::CLIXPLIT_SECRET_KEY,\n 'license_key' => $license_key,\n 'registered_domain' => $_SERVER['SERVER_NAME'],\n 'item_reference' => urlencode(self::CLIXPLIT_REFERENCE),\n );\n\n // Send query to the license manager server\n $query = esc_url_raw(add_query_arg($api_params, self::CLIXPLIT_LICENSE_SERVER_URL));\n $response = wp_remote_get($query, array('timeout' => 20, 'sslverify' => false));\n\n // Check for error in the response\n if (is_wp_error($response)){\n $response_message = \"Unexpected Error! The query returned with an error.\";\n return $response_message;\n }\n\n // var_dump($response);//uncomment it if you want to look at the full response\n\n // License data.\n // $license_data = json_decode(wp_remote_retrieve_body($response));\n $license_data = json_decode( preg_replace('/[\\x00-\\x1F\\x80-\\xFF]/', '', wp_remote_retrieve_body($response)), true );\n\n // TODO - Do something with it.\n var_dump($license_data);//uncomment it to look at the data\n\n if($license_data->result == 'success'){//Success was returned for the license activation\n\n //Uncomment the followng line to see the message that returned from the license server\n \t$response_message = '<br />The following message was returned from the server: ' . $license_data->message . '<meta http-equiv=\"refresh\" content=\"2;url=?page=clixplit/clixplit-home.php\" />';\n \treturn $response_message;\n\n }\n else{\n //Show error to the user. Probably entered incorrect license key.\n\n //Uncomment the followng line to see the message that returned from the license server\n \t$response_message = '<br />The following message was returned from the server: '.$license_data->message;\n \treturn $response_message;\n }\n }", "function stockremove_check_license_use()\n {\n $q = $this->db->where('action_type', 'install')\n ->where('license', $this->input->post('license_num'))\n ->where('company_id', $this->session->userdata('company_id'))\n ->limit(1)->get('software');\n\n if ($q->num_rows == 1)\n {\n return true;\n\n } else {\n\n return false;\n }\n\n }", "function check_software_license_for_stockadd()\n {\n $q = $this->db->where('license', $this->input->post('license_num'))->where('company_id', $this->session->userdata('company_id'))->limit(1)->get('software');\n\n if ($q->num_rows == 1)\n {\n return true;\n\n } else {\n\n return false;\n }\n }", "public function checkKey($key, $pin)\n {\n $this->key = $key;\n $this->pin = $pin;\n\n $result = Licenses::where(\"key\", $this->key)\n ->where(\"pin\", $this->pin)\n ->where(\"used\",LICENCE_KEY_AVAILABLE)\n ->with(\"plan_type\")\n ->get();\n return $result;\n }", "public function activate_license()\n {\n if (isset($_POST['wpstg_activate_license']) && !empty($_POST['wpstg_license_key'])) {\n // run a quick security check\n if (!check_admin_referer('wpstg_license_nonce', 'wpstg_license_nonce'))\n return; // get out if we didn't click the Activate button\n\n\n // Save License key in DB\n update_option('wpstg_license_key', $_POST['wpstg_license_key']);\n\n // retrieve the license from the database\n $license = trim(get_option('wpstg_license_key'));\n\n\n // data to send in our API request\n $api_params = [\n 'edd_action' => 'activate_license',\n 'license' => $license,\n 'item_name' => urlencode(WPSTG_ITEM_NAME), // the name of our product in EDD\n 'url' => home_url()\n ];\n\n // Call the custom API.\n $response = wp_remote_post(WPSTG_STORE_URL, ['timeout' => 15, 'sslverify' => false, 'body' => $api_params]);\n\n // make sure the response came back okay\n if (is_wp_error($response) || wp_remote_retrieve_response_code($response) !== 200) {\n\n if (is_wp_error($response)) {\n $message = $response->get_error_message();\n } else {\n $message = __('An error occurred, please try again.');\n }\n } else {\n\n $license_data = json_decode(wp_remote_retrieve_body($response));\n\n if ($license_data->success === false) {\n\n switch ($license_data->error) {\n\n case 'expired' :\n\n $message = sprintf(\n __('Your license key expired on %s.'), date_i18n(get_option('date_format'), strtotime($license_data->expires, current_time('timestamp')))\n );\n break;\n\n case 'revoked' :\n\n $message = __('Your license key has been disabled.');\n break;\n\n case 'missing' :\n\n $message = __('WP Staging license key is invalid.');\n break;\n\n case 'invalid' :\n case 'site_inactive' :\n\n $message = __('Your license is not active for this URL.');\n break;\n\n case 'item_name_mismatch' :\n\n $message = sprintf(__('This appears to be an invalid license key for %s.'), WPSTG_ITEM_NAME);\n break;\n\n case 'no_activations_left':\n\n $message = __('Your license key has reached its activation limit.');\n break;\n\n default :\n\n $message = __('An error occurred, please try again.');\n break;\n }\n }\n }\n\n // Check if anything passed on a message constituting a failure\n if (!empty($message)) {\n $base_url = admin_url('admin.php?page=wpstg-license');\n $redirect = add_query_arg(['wpstg_licensing' => 'false', 'message' => urlencode($message)], $base_url);\n update_option('wpstg_license_status', $license_data);\n wp_redirect($redirect);\n exit();\n }\n\n // $license_data->license will be either \"valid\" or \"invalid\"\n update_option('wpstg_license_status', $license_data);\n wp_redirect(admin_url('admin.php?page=wpstg-license'));\n exit();\n }\n }", "public function save_license_key( $key ) {\n\t\t$this->activate_license( $key );\n\t\t$license = get_transient( self::TRANSIENT_NAME );\n\n\t\tif ( ! $this->is_valid() ) {\n\t\t\t$key = '';\n\t\t\tif ( isset( $license['license'] ) && self::REQUEST_FAILED === $license['license'] ) {\n\t\t\t\tblock_lab()->admin->settings->prepare_notice( $this->license_request_failed_message() );\n\t\t\t} else {\n\t\t\t\tblock_lab()->admin->settings->prepare_notice( $this->license_invalid_message() );\n\t\t\t}\n\t\t} else {\n\t\t\tblock_lab()->admin->settings->prepare_notice( $this->license_success_message() );\n\t\t}\n\n\t\treturn $key;\n\t}", "function check_pk($key_id)\n\t{\n\t\t$pubkey = false;\n\t\t$subkey = false;\n\n\t\tif (false == $list = $this->get_list($key_id))\n\t\t{\n\t\t\t// no key found\n\t\t\treturn 3;\n\t\t}\n\t\telse foreach ($list as $row)\n\t\t{\n\t\t\t// check for base key usability\n\t\t\tif ($row[0] == 'pub')\n\t\t\t{\n\t\t\t\tif ( ($row[1] != 'r' && $row[1] != 'e') &&\t\t\t\t\t// check for revocation/expiry status\n\t\t\t\t($row[5] < time() && ($row[6] == '' || $row[6] > time())) )\t// check creation and expiration dates\n\t\t\t\t{\n\t\t\t\t\t$pubkey = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// check for subkey presence and usability\n\t\t\telse if ($row[0] == 'sub')\n\t\t\t{\n\t\t\t\tif ( ($row[1] != 'r' && $row[1] != 'e') &&\t\t\t\t\t// check for revocation/expiry status\n\t\t\t\t(str_contains($row[11], 'e')) &&\t\t\t\t\t\t// check that subkey is intended for encryption\n\t\t\t\t($row[5] < time() && ($row[6] == '' || $row[6] > time())) )\t// check creation and expiration dates\n\t\t\t\t{\n\t\t\t\t\t$subkey = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// return codes\n\t\tif ($pubkey === false) return 2;\t// public key is unusable\n\t\tif ($subkey === false) return 1;\t// key is not suitable for encryption\n\t\t// key is okay\n\t\treturn 0;\n\t}", "function wg_is_valid_key($key) {\n\tglobal $wgg;\n\n\t$key = escapeshellarg($key);\n\n\t$retval = mwexec(\"echo {$key} | {$wgg['wg']} pubkey\");\n\n\treturn ($retval <> 0 ? false : true);\n\n}", "function check_formkey($formkey)\r\n\t{\r\n\t\t$code = decrypt($formkey);\r\n\t\t\r\n\t\treturn (($code >= 1199116800 && REQUEST_TIME - $code <= FORMKEY_TIMEOUT) ? true : false);\r\n\t\t\r\n\t}", "public function isApiKeyConfigured()\n {\n $public_key = Mage::helper('core')->decrypt(Mage::getStoreConfig('payment/bitcoin/public_key'));\n $private_key = Mage::helper('core')->decrypt(Mage::getStoreConfig('payment/bitcoin/private_key'));\n return (!empty($private_key) && !empty($public_key));\n }", "public function getKey()\n {\n return defined('QUFORM_LICENSE_KEY') ? QUFORM_LICENSE_KEY : $this->options->get('licenseKey');\n }", "public function updateLicenseStatus()\n {\n $transient = get_transient($this->slug);\n\n // If set and valid, return.\n if (VALID === $transient) {\n error_log('Active...');\n return;\n }\n // If expired, do something to never req again.\n\n // If not then, perform a check\n // error_log('Checking ...');\n // $response = $this->checkLicenseKey();\n }", "function cpotheme_license_section( $args ) {\n\t$current_license = get_option( 'license_' . CPOTHEME_ID );\n\t$current_license_status = cpotheme_get_option( 'license_' . CPOTHEME_ID . '_status' );\n\n\techo '<div class=\"cpotheme-notice\">';\n\tif ( $current_license != false && $current_license != '' ) {\n\t\tif ( $current_license_status == 'invalid' ) {\n\t\t\techo '<div class=\"cpotheme-message cpotheme-message-error\">';\n\t\t\techo __( 'The theme license you entered is invalid.', 'cpotheme' );\n\t\t\techo '</div>';\n\t\t} elseif ( $current_license_status == 'valid' ) {\n\t\t\techo '<div class=\"cpotheme-message cpotheme-message-success\">';\n\t\t\techo __( 'Your license key has been activated.', 'cpotheme' );\n\t\t\techo '</div>';\n\t\t}\n\t}\n\tprintf( __( 'Please add your CPOThemes license key in order to get automatic theme updates for %s directly from your WordPress site.', 'cpotheme' ), CPOTHEME_NAME );\n\techo '<br>';\n\techo '<a target=\"_blank\" href=\"//www.cpothemes.com/dashboard/purchase-history\">' . __( 'Obtain the license key at CPOThemes', 'cpotheme' ) . '</a>';\n\n\techo '<div class=\"cpotheme-wizard-clear\"></div>';\n\techo '</div>';\n}", "function check_software_license_add()\n {\n $q = $this->db->where('license', $this->input->post('license_num'))->where('action_type', 'software add')->where('company_id', $this->session->userdata('company_id'))->limit(1)->get('software');\n\n if ($q->num_rows == 1)\n {\n return true;\n\n } else {\n\n return false;\n }\n }", "public function conditionDoesMatchIosWithCorrectSystemKey() {}", "public function conditionDoesMatchIosWithCorrectSystemKey() {}", "function check_apikey($apikey){\n $count = Db::rowCount(\"apikeys\",array(\n \"name\" => $apikey\n ),array(\"=\"));\n\n if ($count == 1){\n return true;\n }\n return false;\n}", "static public function key_is_correct($api_key = '') {\n\n\t\treturn preg_match('/^[a-z\\d]{3,15}$|^$/', $api_key);\n\n\t}", "public function checkPublicKey()\n {\n if (!$this->CI) {\n $this->CI = &get_instance(); \n }\n \n //if it is public, check our \"key\" they sent along to prevent abuse\n $get_vars = explode('&', $_SERVER['QUERY_STRING']);\n if ($get_vars) {\n foreach ($get_vars as $k=>$v) { \n $x = explode('=', $v); \n if (count($x) > 1) {\n $_GET[$x[0]] = $x[1]; \n } else {\n return false;\n }\n }\n \n $this->CI->load->helper('reqkey');\n $reqk = $_GET['reqk'];\n $seck = $_GET['seck'];\n $key_check = checkReqKey($seck, $reqk);\n if ($key_check) {\n return true;\n }\n }\n return false;\n }", "public function get_license_option($option_key) {\r\n\t// Accepts 'license_key' or 'license_status' as the option key\r\n\treturn get_site_option( $this->plugin_config['plugin_prefix'].'_'.$option_key, '' );\r\n}", "function erp_get_license_status( $addon ) {\n if ( ! is_object( $addon['status'] ) ) {\n return false;\n }\n\n $messages = [];\n $html = '';\n $license = $addon['status'];\n $status_class = 'has-error';\n\n if ( false === $license->success ) {\n\n switch ( $license->error ) {\n\n case 'expired' :\n\n $messages[] = sprintf(\n __( 'Your license key expired on %s. Please <a href=\"%s\" target=\"_blank\" title=\"Renew your license key\">renew your license key</a>.', 'erp' ),\n date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),\n 'https://wperp.com/checkout/?edd_license_key=' . $addon['license'] . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired'\n );\n break;\n\n case 'missing' :\n\n $messages[] = sprintf(\n __( 'Invalid license. Please <a href=\"%s\" target=\"_blank\" title=\"Visit account page\">visit your account page</a> and verify it.', 'erp' ),\n 'https://wperp.com/my-account?utm_campaign=admin&utm_source=licenses&utm_medium=missing'\n );\n break;\n\n case 'invalid' :\n case 'site_inactive' :\n\n $messages[] = sprintf(\n __( 'Your %s is not active for this URL. Please <a href=\"%s\" target=\"_blank\" title=\"Visit account page\">visit your account page</a> to manage your license key URLs.', 'erp' ),\n $addon['name'],\n 'https://wperp.com/my-account?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'\n );\n break;\n\n case 'item_name_mismatch' :\n\n $messages[] = sprintf( __( 'This is not a %s.', 'erp' ), $addon['name'] );\n break;\n\n case 'no_activations_left':\n $messages[] = sprintf( __( 'Your license key has reached its activation limit. <a href=\"%s\">View possible upgrades</a> now.', 'erp' ), 'https://wperp.com/my-account/' );\n break;\n\n }\n } else {\n\n switch ( $license->license ) {\n case 'expired' :\n\n $messages[] = sprintf(\n __( 'Your license key expired on %s. Please <a href=\"%s\" target=\"_blank\" title=\"Renew your license key\">renew your license key</a>.', 'erp' ),\n date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),\n 'https://wperp.com/checkout/?edd_license_key=' . $addon['license'] . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired'\n );\n break;\n\n case 'valid':\n $status_class = 'no-error';\n $now = current_time( 'timestamp' );\n $expiration = strtotime( $license->expires, current_time( 'timestamp' ) );\n\n if ( 'lifetime' === $license->expires ) {\n\n $messages[] = __( 'License key never expires.', 'erp' );\n\n } elseif ( $expiration > $now && $expiration - $now < ( DAY_IN_SECONDS * 30 ) ) {\n\n $messages[] = sprintf(\n __( 'Your license key expires soon! It expires on %s. <a href=\"%s\" target=\"_blank\" title=\"Renew license\">Renew your license key</a>.', 'erp' ),\n date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),\n 'https://wperp.com/checkout/?edd_license_key=' . $addon['license'] . '&utm_campaign=admin&utm_source=licenses&utm_medium=renew'\n );\n\n } else {\n\n $messages[] = sprintf(\n __( 'Your license key expires on %s.', 'erp' ),\n date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) )\n );\n\n }\n break;\n }\n\n }\n\n if ( ! empty( $messages ) ) {\n foreach ( $messages as $message ) {\n\n $html .= '<div class=\"erp-license-status ' . $status_class . '\">';\n $html .= '<p class=\"help\">' . $message . '</p>';\n $html .= '</div>';\n\n }\n }\n\n return $html;\n}", "private function getRegistrationKey()\r\n\t\t{\t\r\n\t\t\t$request = \"SELECT * FROM `licensekey` WHERE registerkey='\".$this->logInfos['registrationKey'].\"'\";\r\n\t\t\t$request = mysql_query($request);\r\n\t\t\t$result = mysql_fetch_assoc($request);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\treturn $result;\r\n\t\t}", "public static function chkTrialKey_wp() {\n\t\theader('Content-Type: application/json');\n\t\tglobal $acc;\n\n\t\t$response = array(\n\t\t\t'valid' => false,\n\t\t\t'id' => 0,\n\t\t\t'name' => 'Invalid code',\n\t\t\t'length' => 'Invalid code',\n\t\t\t'payment' => false,\n\t\t\t'amount' => 0,\n\t\t);\n\n\t\ttry {\n\t\t\tif(!isset($_REQUEST[\"rc\"]) || empty($_REQUEST[\"rc\"])) {\n\t\t\t\tthrow new \\Exception( 'Empty input', 0 );\n\t\t\t}\n\n\t\t\t$codes = \\WPSF\\TrialCode::get_code( $_REQUEST['rc'] );\n\n\t\t\tif ( is_wp_error( $codes ) || empty( $codes[0]['Id'] ) ) {\n\t\t\t\tthrow new \\Exception( 'Invalid code', 0 );\n\t\t\t}\n\t\t\t\n\t\t\t$response = array(\n\t\t\t\t'valid' => true,\n\t\t\t\t'id' => $codes[0]['Id'],\n\t\t\t\t'trialname' => $codes[0]['Name'],\n\t\t\t\t'name' => $codes[0]['Membership']['Name'],\n\t\t\t\t'length' => $codes[0]['Period'],\n\t\t\t\t'payment' => ( empty( $codes[0]['Payment'] ) ? false : true ) ,\n\t\t\t\t'amount' => $codes[0]['Amount'],\n\t\t\t\t'pagetext' => $codes[0]['Page_Text__c'],\n\t\t\t);\n\t\t\t\n\t\t} catch( \\Exception $e ) {\n\t\t\t$response = array(\n\t\t\t\t'valid' => false,\n\t\t\t\t'id' => 0,\n\t\t\t\t'name' => $e->getMessage(),\n\t\t\t\t'length' => $e->getMessage(),\n\t\t\t\t'err' => $e->getMessage(),\n\t\t\t\t'payment' => false,\n\t\t\t\t'amount' => 0,\n\t\t\t\t'pagetext' => '',\n\t\t\t);\n\t\t}\n\n\t\tprint json_encode( $response );\n\t\texit();\n\t}", "function get_licensevar($var) {\n\t$lic = new Checklicense();\n\treturn $lic->checkout($var);\n}", "function verify () {\n// $aop->alipayrsaPublicKey='MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjUzhXrdJ7GDsgJ59fMLlk7hyYrXkkeGwnYD/eO2HBZh39Y9gTfLJ61Yogc7keOn2uAnZY/zBlw3n+T6mb6/5JYFgvXQi8Qzeh6BkBrNnROu+k4PjhmSbORJFoLrrIxDnsYkQ995kYYhpbS0yf2Al++55v4SrD3/YoVBhWPcRg4xI0QD94FLwhCmcCkft/ILRtUxQk2QeVPLSesvMx2mmUK2L2x2hFA8ewRoGmUdG2Fu9YFIxk//16RI+H7KI8LaoXoVDqHobPae9p0ACE7k9G5vs/cYuikSMKu+lnxghte1jNO+CqrvTP4Pes/mW4e7CEMCTAmEnsXLUrQ6FpfKMcQIDAQAB';\n return $this->aop->rsaCheckV1($_POST, NULL, \"RSA2\");\n }", "function check_certificate($certificate){\n if (substr($certificate, 0, 7) == \"ssh-rsa\" || substr($certificate, 0, 7) == \"ssh-dss\")\n return true;\n else\n return false;\n}", "function validateIpn()\n {\n global $paidSub;\n define(\"API_LOGIN\",$paidSub->configs['fd_api_login']);\n define(\"API_KEY\", $paidSub->configs['fd_api_key']);\n define(\"TRAN_PURCHASE\",true);\n\n\n // if \n\n \n \n\n \n }", "function monsterinsights_get_license() {\n\t$license = false;\n\tif ( defined( 'MONSTERINSIGHTS_LICENSE_KEY' ) && is_string( MONSTERINSIGHTS_LICENSE_KEY ) && strlen( MONSTERINSIGHTS_LICENSE_KEY ) > 10 ) {\n\t\t$license = array( 'key' => MONSTERINSIGHTS_LICENSE_KEY );\n\t} else if ( is_multisite() && monsterinsights_is_network_active() ){\n\t\t$network_license = get_site_option( 'monsterinsights_license' );\n\t\tif ( ! empty( $network_license['key'] ) && is_string( $network_license['key'] ) && strlen( $network_license['key'] ) > 10 ) {\n\t\t\t$license = $network_license;\n\t\t} else {\n\t\t\t$site_license = get_option( 'monsterinsights_license' );\n\t\t\tif ( ! empty( $site_license['key'] ) && is_string( $site_license['key'] ) && strlen( $site_license['key'] ) > 10 ) {\n\t\t\t\t$license = $site_license;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$site_license = get_option( 'monsterinsights_license' );\n\t\tif ( ! empty( $site_license['key'] ) && is_string( $site_license['key'] ) && strlen( $site_license['key'] ) > 10 ) {\n\t\t\t$license = $site_license;\n\t\t}\n\t}\n\n\treturn apply_filters( 'monsterinsights_license', $license );\n}", "public function woffice_tf_check() {\n\t\t\n\t\t/* We get the data from the OPTIONS */\n\t\t$tf_username = fw_get_db_ext_settings_option('woffice-updater', 'tf_username');\n\t\t$tf_purchasecode = fw_get_db_ext_settings_option('woffice-updater', 'tf_purchasecode');\n\t\t\n\t\tif (empty($tf_username) || empty($tf_purchasecode)) {\n\t\t\treturn;\n\t\t} \n\t\t\n\t\t$request_string = array(\n\t\t\t'body' => array( \n\t\t\t\t'action' => 'check_purchase', \n\t\t\t 'username' => htmlspecialchars($tf_username),\n\t\t\t 'purchase_code' => htmlspecialchars($tf_purchasecode),\n\t\t\t)\n\t\t);\n\t\t/* We use our API */\n\t\t$raw_response = wp_remote_post( 'http://alka-web.com/woffice-updater/theme-updater.php', $request_string );\n \n\t\t/* We check */\n\t\t$response = null;\n \tif( !is_wp_error($raw_response) && ($raw_response['response']['code'] == 200) ) {\n \t\t$response = $raw_response['body'];\n \t}\n \tif( !empty($response) ) {\n \t\tif ($response == 'true') {\n\t \t\t/*If it works we save that data in the options table*/\n\t\t\t\tupdate_option('woffice_license','checked');\n\t\t\t\treturn true;\n \t\t}\n \t\telse {\n\t \t\tupdate_option('woffice_license','not-checked');\n\t\t\t\treturn;\n \t\t}\n \t}\n\t\t\n\t}", "private function check_api_key() {\n return true;\n $post_token = $this->input->post('App-Request-Token');\n $post_datetime = $this->input->post('App-Request-Timestamp');\n if ($post_token && $post_datetime) {\n $date = gmdate('Y-m-d H:i:s');\n if (strtotime($post_datetime) >= (strtotime($date) - 300) && strtotime($post_datetime) <= strtotime($date)) {\n $token = sha1(config_item('api_request_key') . $post_datetime);\n if ($post_token === $token) {\n return true;\n }\n }\n } else {\n $this->send_error('ERROR');\n exit;\n }\n }", "public function activate_license() {\n\n\t\t// listen for our activate button to be clicked\n\t\tif( isset( $_POST[ $this->product_slug . '_license_activate' ] ) ) {\n\n\t\t\t// run a quick security check\n\t\t \tif( ! check_admin_referer( $this->product_slug . '_license_nonce', $this->product_slug . '_license_nonce' ) )\n\t\t\t\treturn; // get out if we didn't click the Activate button\n\n\t\t\t// retrieve the license from the database\n\t\t\t$license = $_POST[ $this->product_slug . '-license-key' ];\n\n\n\t\t\t// data to send in our API request\n\t\t\t$api_params = array(\n\t\t\t\t'edd_action' => 'activate_license',\n\t\t\t\t'license' => $license,\n\t\t\t\t'item_id' => urlencode( EAEL_SL_ITEM_ID ), // the ID of our product in EDD\n\t\t\t\t'url' => home_url()\n\t\t\t);\n\n\t\t\t// Call the custom API.\n\t\t\t$response = wp_remote_post( EAEL_STORE_URL,\n\t\t\t\tarray(\n\t\t\t\t\t'timeout' \t=> 15,\n\t\t\t\t\t'sslverify' => false,\n\t\t\t\t\t'body' \t\t=> $api_params\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// make sure the response came back okay\n\t\t\tif ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {\n\n\t\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\t\t$message = $response->get_error_message();\n\t\t\t\t} else {\n\t\t\t\t\t$message = __( 'An error occurred, please try again.' );\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t\t\t\tif ( false === $license_data->success ) {\n\n\t\t\t\t\tswitch( $license_data->error ) {\n\n\t\t\t\t\t\tcase 'expired' :\n\n\t\t\t\t\t\t\t$message = sprintf(\n\t\t\t\t\t\t\t\t__( 'Your license key expired on %s.' ),\n\t\t\t\t\t\t\t\tdate_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'revoked' :\n\n\t\t\t\t\t\t\t$message = __( 'Your license key has been disabled.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'missing' :\n\n\t\t\t\t\t\t\t$message = __( 'Invalid license.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'invalid' :\n\t\t\t\t\t\tcase 'site_inactive' :\n\n\t\t\t\t\t\t\t$message = __( 'Your license is not active for this URL.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'item_name_mismatch' :\n\n\t\t\t\t\t\t\t$message = sprintf( __( 'This appears to be an invalid license key for %s.' ), EAEL_SL_ITEM_NAME );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'no_activations_left':\n\n\t\t\t\t\t\t\t$message = __( 'Your license key has reached its activation limit.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault :\n\n\t\t\t\t\t\t\t$message = __( 'An error occurred, please try again.' );\n\t\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\t// Check if anything passed on a message constituting a failure\n\t\t\tif ( ! empty( $message ) ) {\n\t\t\t\t$base_url = admin_url( 'admin.php?page=' . $this->get_settings_page_slug() );\n\t\t\t\t$redirect = add_query_arg( array( 'sl_activation' => 'false', 'message' => urlencode( $message ) ), $base_url );\n\n\t\t\t\twp_redirect( $redirect );\n\t\t\t\texit();\n\t\t\t}\n\n\t\t\t// $license_data->license will be either \"valid\" or \"invalid\"\n\n\t\t\t$this->set_license_key( $license );\n\t\t\t$this->set_license_status( $license_data->license );\n\n\t\t\twp_redirect( admin_url( 'admin.php?page=' . $this->get_settings_page_slug() ) );\n\t\t\texit();\n\t\t}\n\t}", "function shoestrap_activate_license() {\n global $wp_version;\n\n $license = shoestrap_getVariable( 'shoestrap_license_key' );\n\n $api_params = array(\n 'edd_action' => 'activate_license',\n 'license' => $license,\n 'item_name' => urlencode( SHOESTRAP_THEME_NAME )\n );\n\n $response = wp_remote_get( add_query_arg( $api_params, SHOESTRAP_STORE_URL ), array( 'timeout' => 15, 'sslverify' => false ) );\n\n if ( is_wp_error( $response ) ) :\n return false;\n endif;\n\n $license_data = json_decode( wp_remote_retrieve_body( $response ) );\n}", "private function needs_auth($key) {\r\n $needs_auth = (phpsaaswrapper()->needs_auth($key) == 'true') ? true : false;\r\n if($needs_auth) {\r\n return true;\r\n }\r\n return false;\r\n }", "public function isValid()\n {\n return $this->getStatus() != 'unlicensed';\n }", "function alertcloud_component_checkversion()\n{\n if (!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 126) {\n return false;\n }\n return true;\n}", "public function getRemote_license()\n {\n $request = wp_remote_post( $this->update_path, array( 'body' => array( 'action' => 'license' ) ) );\n if ( !is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) === 200 ) {\n return $request['body'];\n }\n return false;\n }", "private function check_api_key($api_key) {\n $url = \"https://rest.messagebird.com/balance/\";\n $ch = curl_init($url);\n\n $headers = array(\n 'Authorization: AccessKey ' . $api_key\n );\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n $output = curl_exec($ch);\n $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); //store HTTP code to check if 200 or not\n curl_close($ch);\n return ($httpcode == 200 ? TRUE : FALSE);\n }", "protected function getLicenseKey()\n {\n foreach ($this->_licenseKey as $key) {\n if ($licenseKey = $this->scopeConfig->getValue($key)) {\n return $licenseKey;\n }\n }\n }", "public function activate_license( $key ) {\n\t\t// Data to send in our API request.\n\t\t$api_params = array(\n\t\t\t'edd_action' => 'activate_license',\n\t\t\t'license' => $key,\n\t\t\t'item_name' => rawurlencode( $this->product_slug ),\n\t\t\t'url' => home_url(),\n\t\t);\n\n\t\t// Call the Block Lab store's API.\n\t\t$response = wp_remote_post(\n\t\t\t$this->store_url,\n\t\t\tarray(\n\t\t\t\t'timeout' => 10,\n\t\t\t\t'sslverify' => true,\n\t\t\t\t'body' => $api_params,\n\t\t\t)\n\t\t);\n\n\t\tif ( is_wp_error( $response ) ) {\n\t\t\t$license = array( 'license' => self::REQUEST_FAILED );\n\t\t} else {\n\t\t\t$license = json_decode( wp_remote_retrieve_body( $response ), true );\n\t\t}\n\n\t\t$expiration = DAY_IN_SECONDS;\n\n\t\tset_transient( self::TRANSIENT_NAME, $license, $expiration );\n\t}", "public function activate_license() {\r\n\r\n\t$license_key = $this->get_license_option('license_key');\r\n\t$license_current_status = $this->get_license_option('license_status');\r\n\t\r\n\tif( !empty($license_key) && $license_current_status != 'valid' ){\r\n\r\n\t\t$license_data = $this->edd_api_request('activate_license');\r\n\t\t\r\n\t\t$license_status = $license_data->license;\r\n\t\t\t\r\n\t\tif( (isset($license_status)) && (!empty($license_status)) ) {\r\n\t\t\t\r\n\t\t\tif( $license_status == 'valid' ) {\r\n\r\n\t\t\t\t$this->remove_license_option('activation_error_code');\r\n\t\t\t\t$this->set_license_option('license_status', $license_status);\r\n\t\t\t\t$this->set_license_option('lps', 1);\r\n\t\t\t\t\r\n\t\t\t}elseif( $license_status == 'invalid' ) {\r\n\t\t\t\t\r\n\t\t\t\t// If expired, just leave it\r\n\t\t\t\tif( $license_current_status != 'expired' ) :\r\n\t\t\t\t\r\n\t\t\t\t\tif( isset($license_data->error) && !empty($license_data->error) ) :\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t$this->set_license_option('license_status', $license_status);\r\n\t\t\t\t\t\t$this->set_license_option('activation_error_code', $license_data->error);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tendif;\r\n\t\t\t\t\r\n\t\t\t\tendif;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\treturn $license_data;\r\n\t\r\n\t}\r\n\r\n}", "public function get_licence()\n {\n return 'Licensed on the same terms as Composr';\n }", "public function get_licence()\n {\n return 'Licensed on the same terms as Composr';\n }", "public function get_licence()\n {\n return 'Licensed on the same terms as Composr';\n }", "public function get_licence()\n {\n return 'Licensed on the same terms as Composr';\n }", "public function get_licence()\n {\n return 'Licensed on the same terms as Composr';\n }", "public function get_licence()\n {\n return 'Licensed on the same terms as Composr';\n }", "public function license_status_msg() {\r\n\t\r\n\t$status_msg = '';\r\n\r\n\t$license_key = $this->get_license_option('license_key');\r\n\t$license_status = $this->get_license_option('license_status');\r\n\t$lps = $this->get_license_option('lps');\r\n\t\t\r\n\tif( 'valid' === $license_status && !empty( $license_key ) ) {\r\n\t\t\r\n\t\t$status_msg .= '<p style=\"color:green;\">&nbsp;' . __( 'Your license is valid', 'affiliatewp-multi-level-affiliates' ) . '. <br><br></p>';\t\r\n\t\t\r\n\t\t//$href = add_query_arg( $this->plugin_config['plugin_prefix'].'_license_change', 'deactivate', $_SERVER['REQUEST_URI'] );\r\n\t\t//$href_text = 'Deactivate License';\r\n\t\t//$status_msg .= '<a target=\"_self\" class=\"button-primary\" href=\"'.$href.'\">'.$href_text.'</a>';\r\n\t\r\n\t// If invalid and not activated = invalid license\t\t\t\t\t\r\n\t} elseif( 'invalid' === $license_status && !empty( $license_key ) && $lps != '1') {\t\r\n\t\r\n\t\t$error_code = $this->get_license_option('activation_error_code');\r\n\t\tif( !empty($error_code) ) $error_code = ' (error code: '.$error_code.')';\r\n\t\t$status_msg .= '<p style=\"color:red;\">&nbsp;' . __( 'Your license is invalid'.$error_code, 'affiliatewp-multi-level-affiliates' ) . '</p>';\t\r\n\t\r\n\t// If invalid but activated = expired\t\t\t\r\n\t}elseif( 'expired' === $license_status && !empty( $license_key ) && $lps == '1') {\r\n\t\t\r\n\t\t$status_msg .= '<p style=\"color:red;\">' . __( 'Your license has expired. Plugin features remain enabled but auto updates are disabled<br><a href=\"https://www.clickstudio.com.au/checkout/?edd_license_key='.$license_key.'&download_id='.$this->plugin_config['plugin_item_id'].'\" target=\"blank\">Renew your license - click here</a><br><br>', 'affiliatewp-multi-level-affiliates' ) . '</p>';\t\r\n\t\t\r\n\t\t//$href = add_query_arg( $this->plugin_config['plugin_prefix'].'_license_change', 'deactivate', $_SERVER['REQUEST_URI'] );\r\n\t\t//$href_text = 'Deactivate License';\r\n\t\t//$status_msg .= '<a target=\"_self\" class=\"button-primary\" href=\"'.$href.'\">'.$href_text.'</a>';\r\n\t\t\r\n\t}else{\r\n\t\t\r\n\t\t$status_msg .= '<p style=\"\">&nbsp;' . __( 'Enter your license key and save the settings to activate.', 'affiliatewp-multi-level-affiliates' ) . '</p>';\r\n\t\t\r\n\t}\r\n\t\r\n\tif( !empty($lps) && $lps == '2' ) {\r\n\t\t\r\n\t\t$status_msg .= '<p style=\"color:red;\">&nbsp;' . __( 'A licence was previously deactivated for this site. License activation is now required to restore functionality.', 'affiliatewp-multi-level-affiliates' ) . '</p>';\r\n\t\r\n\t}elseif( !empty($lps) && $lps == '1' ) {\r\n\t\t\r\n\t\t$href = add_query_arg( $this->plugin_config['plugin_prefix'].'_license_change', 'deactivate', $_SERVER['REQUEST_URI'] );\r\n\t\t$href_text = 'Deactivate License';\r\n\t\t$status_msg .= '<a target=\"_self\" class=\"button-primary\" href=\"'.$href.'\">'.$href_text.'</a>';\r\n\t\t\r\n\t\t$status_msg .= '<p>'. __( 'Deactivating your license on this site will disable all plugin features. Be careful!', 'affiliatewp-multi-level-affiliates' ).'</p>';\r\n\r\n\t}else{\r\n\r\n\t\t$status_msg .= '<p>'. __( 'An activated license is required to enable plugin features.', 'affiliatewp-multi-level-affiliates' ).'</p>';\r\n\r\n\t}\r\n\t\t\r\n\treturn $status_msg;\r\n}", "function check_originator($clean_data = false)\n{\n $timenow = date(\"U\");\n if (($timenow - $clean_data[\"appheader\"][\"transmissiondatetime\"]) > 3600) {\n return false;\n }\n \n \n \n $conn = conn();\n $clean_data[\"privatekeypair\"] = false;\n \n if ($clean_data[\"appheader\"][\"key\"] == \"newlatcherinstallation\") {\n return $clean_data;\n }\n \n if ($result = mysqli_query($conn, \"SELECT * FROM session WHERE key='\" . $clean_data[\"appheader\"][\"key\"] . \"' LIMIT 1\")) {\n while ($row = mysqli_fetch_array($result)) {\n $clean_data[\"privatekeypair\"] = $row[\"key\"];\n }\n mysqli_free_result($result);\n }\n \n mysqli_close($conn);\n \n if ($clean_data[\"privatekeypair\"] === false) {\n return false;\n }\n \n return $clean_data;\n}", "protected function checkPcreVersion() {}", "protected function copyLicenseKey()\n {\n if ($key = $this->getLicenseKey()) {\n $this->config->saveConfig(self::SEOBASE_LICENSE_KEY, $key, 'default', 0);\n }\n }", "function shoestrap_licence_status_cached() {\n $license = shoestrap_getVariable( 'shoestrap_license_key' );\n $status = get_transient( 'shoestrap_licence_status_cached' );\n\n if ( $status != 'valid' ) :\n if ( shoestrap_theme_license_status() == 'valid' ) :\n set_transient( 'shoestrap_licence_status_cached', shoestrap_theme_license_status(), 3600 * 24 );\n endif;\n endif;\n\n add_action( 'admin_init', 'shoestrap_activate_license' );\n}", "private function validateReviewerKey(){\n\t\treturn true;\n\t}", "public function validateAuthKey($authKey): bool;", "public function get_license_key() {\n\t\t// Allow license keys to be saved in custom option fields\n\t\tif ( ! empty( $this->license_option_name ) ) {\n\t\t\treturn get_option( $this->license_option_name, '' );\n\t\t}\n\n\t\t$dirname = dirname( $this->plugin_basename );\n\t\treturn get_option( $dirname . '_license', '' );\n\t}", "private function login() {\n\t\t$args = array(\"key\" => $this->akismetKey);\n\t\t$host = $this->akismetURL;\n\t\t$url = \"http://$host/\" . $this->akismetVersion . \"/verify-key\";\n\t\t$valid = $this->send($args, $host, $url);\n\t\treturn ($valid == \"valid\") ? true : false; \n\t}", "public function testValidAPIkey() : void\n {\n $this->post('/mailchimp/lists', static::$listData);\n\n $content = \\json_decode($this->response->getContent(), true);\n //see Mailchimp\\Mailchimp->request()\n $invalid = !empty($content['message']) && (stristr($content['message'], 'API Key Invalid')\n //possible response message: cURL error 60: SSL certificate problem: unable to get local issuer certificate\n || stristr($content['message'], 'cURL error'));\n if ($invalid) {\n $this->fail('API key Invalid, please check with Mailchimp before making further test');\n } else {\n $this->assertTrue(true);\n }\n }", "public function validateAuthKey($authKey){\n }", "public function testIsValidKeyWithValidKey() \n {\n $key = 'key1';\n $result = $this->fileCache->isValidKey($key);\n $expected = TRUE;\n\n $this->assertEquals($expected, $result);\n }", "public function hasCrypt(): bool;", "public function activateSiteLicense($key, $oldKey)\n {\n // want to revoke it, since it can't be activated twice.\n $deactivate = is_null($key);\n\n if ($deactivate) {\n return $this->client->removeLicenseFomSite($oldKey);\n }\n\n $isValid = $this->client->registerKeyForSite($key);\n\n if ( ! $isValid) {\n add_settings_error('invalid-license-key', '', 'WP Pusher license could not be activated.');\n }\n\n return $isValid;\n }", "public function generateLicenseKeys()\n {\n $rsaConfig = [\n \"digest_alg\" => \"sha512\",\n \"private_key_bits\" => 4096,\n \"private_key_type\" => OPENSSL_KEYTYPE_RSA,\n ];\n\n // Generate the RSA Key.\n $res = openssl_pkey_new($rsaConfig);\n openssl_pkey_export($res, $privateKey);\n $publicKey = openssl_pkey_get_details($res)['key'];\n\n // Now Save it to the database.\n $this->db->beginTransaction();\n $modules = array_merge([1, 12], $_POST['modules']);\n sort($modules, SORT_NUMERIC);\n $this->db->executeQuery(\n \"INSERT INTO license (client_id, ip_addr, domains, activation_date,expiry_date, modules_installed, license_key) \n VALUES (:clientId,:ip,:domains,:activation,:expiry,:modules,:key)\",\n [\n \":clientId\" => $_POST['clientId'],\n \":ip\" => $this->_processDomainIps($_POST['ips']),\n \":domains\" => $this->_processDomainIps($_POST['domains']),\n \":activation\" => $_POST['activation'],\n \":expiry\" => $_POST['expiry'],\n \":modules\" => GlobalFunction::pgImplode($modules),\n \":key\" => $privateKey,\n ]\n );\n\n $this->db->commit();\n\n $this->response = [\"license\" => $this->_keyHeaderFooter($publicKey)];\n }", "private function _checkPk() {\n\t\t$result = false;\n\t\t$private_key = Mage::helper ( 'masterpass' )->checkPrivateKey ();\n\t\tif (! $private_key) {\n\t\t\tMage::getSingleton ( 'core/session' )->addError ( Mage::getStoreConfig ( 'masterpass/config/checkouterrormessage' ) );\n\t\t\t// save long access token\n\t\t\t$customer = Mage::getSingleton ( 'customer/session' )->getCustomer ();\n\t\t\t$customerData = Mage::getModel ( 'customer/customer' )->load ( $customer->getId () );\n\t\t\t$longAccessToken = null;\n\t\t\t$customerData->setData ( 'longtoken', $longAccessToken );\n\t\t\t\n\t\t\t$customerData->save ();\n\t\t\t// $this->_redirect('checkout/cart');\n\t\t\t// $this->getResponse()->setRedirect(Mage::helper('customer')->getLoginUrl());\n\t\t\t$result = true;\n\t\t}\n\t\treturn $result;\n\t}", "public function get_licence()\n {\n return 'GPL';\n }", "function openssl_spki_verify(string $spki): bool {}", "public function daily_version_check() {\n // data to send in our API request\n $api_params = [\n 'edd_action' => 'get_version',\n 'item_id' => 11\n ];\n // Call the API\n $response = wp_remote_post(\n WPSTG_STORE_URL, [\n 'timeout' => 15,\n 'sslverify' => false,\n 'body' => $api_params\n ]\n );\n // make sure the response came back okay\n if( is_wp_error( $response ) ) {\n return false;\n }\n $license = json_decode( wp_remote_retrieve_body( $response ) );\n update_option( 'wpstg_version_latest', $license->stable_version );\n }" ]
[ "0.7806488", "0.7665851", "0.7619072", "0.74316496", "0.7363147", "0.7223081", "0.71550155", "0.7136895", "0.7031993", "0.6980417", "0.6964824", "0.6884779", "0.68461883", "0.68192184", "0.6797082", "0.6780947", "0.6767832", "0.66656244", "0.6638206", "0.6618068", "0.6565596", "0.6521029", "0.6499711", "0.6467534", "0.6446644", "0.6428061", "0.64161766", "0.6319514", "0.6294178", "0.62792283", "0.627879", "0.6274161", "0.6253855", "0.6239595", "0.6220951", "0.6208285", "0.62070197", "0.61916107", "0.61836773", "0.6165677", "0.6147696", "0.6106491", "0.60815823", "0.60791516", "0.6057289", "0.60464054", "0.60419625", "0.6031203", "0.6023649", "0.6022216", "0.5978427", "0.59777474", "0.5975154", "0.5974126", "0.5905274", "0.58973974", "0.5895831", "0.58610994", "0.5848981", "0.5845911", "0.5840271", "0.5835005", "0.5830204", "0.58246684", "0.5824537", "0.5817001", "0.5812989", "0.5805537", "0.5771171", "0.57690626", "0.5761127", "0.5739049", "0.57327896", "0.57315487", "0.57286006", "0.57262623", "0.5723386", "0.5723386", "0.5723386", "0.5723386", "0.5723386", "0.5723386", "0.5714613", "0.5693667", "0.5691082", "0.56894726", "0.56849915", "0.5668114", "0.56618315", "0.5661137", "0.565784", "0.5657418", "0.56545544", "0.5652484", "0.56520414", "0.56461054", "0.5644596", "0.56438303", "0.5639007", "0.5637133", "0.563689" ]
0.0
-1
Auto generated seed file
public function run() { \DB::table('cms_role')->delete(); \DB::table('cms_role')->insert(array ( 0 => array ( 'id' => 1, 'name' => '超级管理员', 'grade' => 1, 'ifDefault' => 1, ), 1 => array ( 'id' => 2, 'name' => '管理员', 'grade' => 2, 'ifDefault' => 1, ), 2 => array ( 'id' => 3, 'name' => '普通用户', 'grade' => 9, 'ifDefault' => 1, ), 3 => array ( 'id' => 7, 'name' => '测试', 'grade' => 3, 'ifDefault' => 0, ), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function main() {\n\n $fs = new Filesystem();\n\n $fs->touch($this->getTargetFile());\n\n $seedProperties = Yaml::parse(file_get_contents($this->getSeedFile()));\n $generatedProperties = [];\n\n $generatedProperties['label'] = $seedProperties['project_label'];\n $generatedProperties['machineName'] = $seedProperties['project_name'];\n $generatedProperties['group'] = $seedProperties['project_group'];\n $generatedProperties['basePath'] = '${current.basePath}';\n $generatedProperties['type'] = $seedProperties['project_type'];\n $generatedProperties['repository']['main'] = $seedProperties['project_git_repository'];\n $generatedProperties['php'] = $seedProperties['project_php_version'];\n\n // Add platform information.\n if (isset($generatedProperties['platform'])) {\n $generatedProperties['platform'] = $seedProperties['platform'];\n }\n\n $fs->dumpFile($this->getTargetFile(), Yaml::dump($generatedProperties, 5, 2));\n }", "public function seed();", "protected function seed()\n {\n }", "public function seed() {\n }", "public function run()\n {\n $faker= \\Faker\\Factory::create();\n for ($i=0; $i < 20; $i++)\n {\n \tHuongDanVien::create([\n \t\t'tenhdv'=> $faker->name,\n \t\t'phai'=> $faker->word,\n \t\t'diachi'=> $faker->word,\n \t\t'sdt'=> $faker->number_format(0122000000),\n \t\t]);\n }\n }", "public function actionGenerate()\n {\n \\bariew\\yii2Tools\\tests\\FixtureManager::init();\n }", "public function seedDatabase(): void\n {\n echo \"Running seeds\";\n\n // Folder where all the seeds are.\n $folder = __DIR__ . '/../seeds/';\n\n // Scan all files/folders inside database.\n $files = \\scandir($folder);\n\n $seeders = [];\n foreach ($files as $key => $file) {\n\n // All files that don't start with a dot.\n if ($file[0] !== '.') {\n\n // Load the file.\n require_once $folder . $file;\n\n // We have to call the migrations after because\n // some seeds are dependant from other seeds.\n $seeders[] = explode('.', $file)[0];\n }\n }\n\n // Run all seeds.\n foreach ($seeders as $seeder) {\n (new $seeder)->run();\n }\n }", "public function run()\n {\n \t$faker = Faker\\Factory::create();; \n foreach (range(1, 55) as $key => $value) {\n \tApp\\Student::create([\n \t\t 'name' => $faker->name,\n 'father_name' => $faker->name('male'),\n 'mother_name' => $faker->name('female'),\n 'phone_number' => $faker->phoneNumber,\n 'home_number' => $faker->phoneNumber,\n 'email' => $faker->unique()->safeEmail,\n 'gender' => 'male',\n 'roll_number' => $faker->randomNumber(),\n 'reg_number' => $faker->randomNumber(),\n 'department_id' => $faker->randomNumber(1),\n 'shift' => 'second',\n 'semester' => 'eight',\n 'present_address' => $faker->address,\n 'permanent_address' => $faker->address,\n \t]);\n }\n }", "protected static function seed()\n {\n foreach (self::fetch('database/seeds', false) as $file) {\n Bus::need($file);\n }\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create('ms_MY');\n ini_set('memory_limit', '50G');\n \\Eloquent::reguard();\n $this->command->info('User Seed');\n\n for ($i = 0; $i < 5; $i++) {\n $name = $faker->name;\n $temp = explode(' ', trim($name));\n $nickname = $temp[0];\n\n\n $user = \\App\\User::updateOrCreate([\n 'email' => $nickname. '@dell.com',\n ], [\n 'name' => $name,\n 'password' => bcrypt('secret'),\n 'role' => 'participant',\n 'isLead' => 0,\n 'totalPoints' => rand(1,100),\n ]);\n \n }\n\n $name = $faker->name;\n $temp = explode(' ', trim($name));\n $nickname = $temp[0];\n\n\n $user = \\App\\User::updateOrCreate([\n 'email' => $nickname. '@dell.com',\n ], [\n 'name' => $name,\n 'password' => bcrypt('secret'),\n 'role' => 'participant',\n 'isLead' => 1,\n 'totalPoints' => rand(1,100),\n ]);\n\n $name = $faker->name;\n $temp = explode(' ', trim($name));\n $nickname = $temp[0];\n\n\n $user = \\App\\User::updateOrCreate([\n 'email' => $nickname. '@dell.com',\n ], [\n 'name' => $name,\n 'password' => bcrypt('secret'),\n 'role' => 'program manager',\n 'isLead' => 0,\n 'totalPoints' => 0,\n ]);\n \n }", "public function getSeed();", "public function run()\n {\n //Cmd: php artisan db:seed --class=\"UsersTableSeeder\"\n \n $faker = Faker\\Factory::create(\"ja_JP\");\n \n for( $i=0; $i<10; $i++ ){\n\n App\\User::create([\n\t\t\t\t\"name\" => $faker->name(),\n\t\t\t\t\"name_mei\" => $faker->name(),\n\t\t\t\t\"kana_sei\" => $faker->word(),\n\t\t\t\t\"kana_mei\" => $faker->word(),\n\t\t\t\t\"email\" => $faker->safeEmail(),\n\t\t\t\t\"password\" => $faker->password(),\n\t\t\t\t\"phone\" => $faker->word(),\n\t\t\t\t\"address\" => $faker->address(),\n\t\t\t\t\"birthday\" => $faker->date().\" \".$faker->time(),\n\t\t\t\t\"language\" => $faker->languageCode(),\n\t\t\t\t\"licence\" => $faker->word(),\n\t\t\t\t\"school\" => $faker->word(),\n\t\t\t\t\"school_dept\" => $faker->word(),\n\t\t\t\t\"school_subject\" => $faker->word(),\n\t\t\t\t\"gender\" => $faker->word(),\n\t\t\t\t\"salary\" => $faker->randomDigit(),\n\t\t\t\t\"image_url\" => $faker->uuid(),\n\t\t\t\t\"back_image_url\" => $faker->uuid(),\n\t\t\t\t\"remember_token\" => $faker->sha1(),\n\t\t\t\t\"user_role_id\" => $faker->randomDigit(),\n\t\t\t\t\"created_at\" => $faker->dateTime(\"now\"),\n\t\t\t\t\"updated_at\" => $faker->dateTime(\"now\")\n\n ]);\n }\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n $title = $faker->sentence(rand(3,6));\n Article::create([\n 'title'=>$title,\n 'slug'=>Str::slug($title,'-'),\n 'description'=>$faker->text(rand(100,300)),\n 'content'=>$faker->realText(rand(1000,2000))\n ]);\n }", "public function seed()\n\t{\n\t\t$this->createDataType();\n\t\t$this->createDataRowForColumns();\n\t}", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n $limit = 100;\n\n for ($i = 0; $i < $limit; $i++){\n \t\\App\\Models\\Member::create([\n 'code' => $faker->name,\n 'name' => $faker->name,\n 'sns_link' => $faker->name,\n 'is_block' => $faker->numberBetween(0, 1),\n 'phone' => $faker->name,\n 'amount' => $faker->numberBetween(1000, 9000),\n //{{SEEDER_NOT_DELETE_THIS_LINE}}\n\t\t\t]);\n\t\t}\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n $kelamin = \"laki-laki\";\n foreach (range(1, 100) as $i) {\n \tKajian::create([\n \t\t'waktu'\t\t\t\t=> $faker->dateTimeThisCentury($max = 'now', $timezone = date_default_timezone_get()), \n\n \t\t'tema'\t\t\t\t=> $faker->sentence($nbWords = 6, $variableNbWords = true), \n \t\t'pemateri'\t\t\t=> $faker->name($gender = null|'male'|'female'), \n \t\t'alamat'\t\t\t=> $faker->streetAddress, \n \t\t'deskripsi'\t\t\t=> $faker->paragraph($nbSentences = 3, $variableNbSentences = true), \n \t\t'jenis_peserta'\t\t=> $kelamin, \n \t\t'latitude'\t\t\t=> $faker->latitude, \n \t\t'longitude'\t\t\t=> $faker->longitude,\n 'isRutin' => $faker->boolean\n \t]);\n }\n }", "public function run()\n {\n Model::unguard();\n foreach (glob(__DIR__ . '/seeds/*.php') as $filename) {\n require_once($filename);\n }\n // $this->call(UserTableSeeder::class);\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n// $this->call('CustomerTableSeeder');\n $this->call('PhotoTableSeeder');\n// $this->call('ProductTableSeeder');\n// $this->call('StaffTableSeeder');\n// $this->call('PasswordResetsTableSeeder');\n// $this->call('UsersTableSeeder');\n $this->call('CustomersTableSeeder');\n $this->call('EmployeesTableSeeder');\n $this->call('InventoryTransactionTypesTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrderDetailsStatusTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('InvoicesTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrdersStatusTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n\n $this->call('OrdersTaxStatusTableSeeder');\n $this->call('PrivilegesTableSeeder');\n $this->call('EmployeePrivilegesTableSeeder');\n $this->call('ProductsTableSeeder');\n $this->call('InventoryTransactionsTableSeeder');\n $this->call('PurchaseOrderDetailsTableSeeder');\n\n $this->call('PurchaseOrderStatusTableSeeder');\n $this->call('PurchaseOrdersTableSeeder');\n $this->call('SalesReportsTableSeeder');\n $this->call('ShippersTableSeeder');\n $this->call('StringsTableSeeder');\n $this->call('SuppliersTableSeeder');\n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n Model::reguard();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n /* Curso::factory(8)->create(); */\n /* $this->call(CidepartamentoSeeder::class);\n $this->call(CategoriaSeeder::class);\n $this->call(GeneroSeeder::class); */\n\n /* $this->call(UserSeeder::class); */\n\n\n /* Estudiante::factory(20)->create(); */\n\n /* Profesore::factory(12)->create(); */\n\n\n /* $this->call(EstudianteSeeder::class); */\n /* $this->call(CursoSeeder::class); */\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n for ($i = 100; $i < 120; $i++) {\n university::insert([\n 'name' => $faker->name(),\n 'code' => $i,\n 'contact' => '1234567' . $i,\n 'address' => 'Bhavnagar',\n 'user_id' => 2\n ]);\n\n }\n }", "public function run(): void\n {\n $faker = Factory::create();\n \\App\\User::query()->insert($this->gen($faker));\n }", "public function run()\n {\n $faker = Faker::create();\n\n Umrah::Create([\n 'user_id' => User::all()->random()->id,\n 'deceased_id' => Deceased::all()->random()->id,\n 'umrah_status_id' => UmrahStatus::all()->random()->id,\n ]);\n }", "function migrate_seed(){\n\n // Pull in Seed Service Provider\n // Loop in the contents of the file specified in the Service provider\n // Run Insert query.\n\n $seedFiles = require BASEPATH.\"/migration/SeedServiceProvider.php\";\n\n //Loop the files\n foreach ( $seedFiles as $file ){\n\n $seeds = require BASEPATH . \"/migration/seed/{$file}.php\";\n\n //Loop In table for insertion\n foreach( $seeds as $table_name => $data ){\n\n insert( $table_name, $data );\n\n }\n\n }\n\n}", "public function run()\n {\n // App\\UserRentCompactDisc::delete();\n (new Faker\\Generator)->seed(100);\n factory(App\\UserRentCompactDisc::class, 30)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n //echo $faker->word();die();\n //var_dump($faker);die();\n\n for($i=0; $i<100; $i++) \n {\n Maker::create\n ([\n 'name' => $faker->unique()->company(),\n 'phone' => $faker->phoneNumber()\n ]);\n }\n }", "public function run()\n {\n\n $faker =Faker\\Factory::create();\n foreach (range(1,10) as $index) {\n Member::create([\n 'memberNo' => $faker->text(5),\n 'name' => $faker->text($min=5,$max=10),\n 'email' => $faker->email(),\n 'lastConnect' => $faker->dateTime()\n ]);\n }\n }", "public function run()\n\t{\n\n $faker=Faker::create();\n\n for($i = 0; $i < 20; $i++)\n {\n \n \n \n $id= \\DB::table('users')->insertGetId(array(\n 'name' => $faker->firstName,\n 'email' => $faker->unique()->email,\n 'password' => \\Hash::make('bebe'),\n 'type' => $faker->randomElement(['member','admin']),\n \n\n\t\t\t));\n\n\n\n }\n\t\n\t}", "public function run()\n {\n //\\App\\Models\\User::factory(400)->create();\n //\\App\\Models\\Ship::factory(10000)->create();\n //\\App\\Models\\City::factory(1000)->create();\n //\\App\\Models\\Offer::factory(2000)->create();\n\n /* $this->call([\n CountrySeeder::class,\n ]);*/\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n $faker = Faker::create();\n DB::table('userroles')->insert([\n 'role_name' => 'Subper Admin',\n 'role_status' => 1,\n 'read' => $faker->paragraph(2),\n 'write' => $faker->paragraph(2),\n 'country_nationality' => $faker->paragraph(2)\n ]);\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class,15)->create();\n\n\n $regcouncils = fopen('C:\\practocsv\\regcouncil.csv', 'r');\n $degrees = fopen('C:\\practocsv\\degree.csv', 'r');\n $cities = fopen('C:\\practocsv\\city.csv', 'r');\n $specializations = fopen('C:\\practocsv\\specialization.csv', 'r');\n $colleges = fopen('C:\\practocsv\\college.csv', 'r');\n\n $categories = fopen('C:\\practocsv\\category.csv', 'r');\n $subcategories = fopen('C:\\practocsv\\subcategory.csv', 'r');\n $manufacturers = fopen('C:\\practocsv\\manufacture.csv', 'r');\n $ingredients = fopen('C:\\practocsv\\ingredients.csv', 'r');\n $products = fopen('C:\\practocsv\\product.csv', 'r');\n\n $faker = \\Faker\\Factory::create();\n\n $regcouncil_id = 0;\n $city_id = 0;\n $degree_id = 0;\n $specialization_id = 0;\n $college_id = 0;\n\n Type::create([\n 'name'=>'video'\n ]);\n Type::create([\n 'name'=>'chat'\n ]);\n $type = Type::create([\n 'name'=>'clinic'\n ]);\n\n while(($reg = fgetcsv($regcouncils)) !== FALSE){\n $regcouncil = Regcouncil::create([\n 'name'=>$reg[0]\n ]);\n $regcouncil_id = $regcouncil->id;\n }\n\n while(($deg = fgetcsv($degrees)) !== FALSE){\n $degree = Degree::create([\n 'name'=>$deg[0]\n ]);\n $degree_id = $degree->id;\n }\n\n while(($cit = fgetcsv($cities)) !== FALSE){\n $city = City::create([\n 'name'=>$cit[0]\n ]);\n $city_id = $city->id;\n }\n\n while(($reg = fgetcsv($specializations)) !== FALSE){\n $speciality = Speciality::create([\n 'name'=>$reg[0]\n ]);\n $specialization_id = $speciality->id;\n }\n\n while(($clg = fgetcsv($colleges)) !== FALSE){\n $college = College::create([\n 'name'=>$clg[0]\n ]);\n $college_id = $college->id;\n }\n\n for($i=0 ; $i<50 ; $i++){\n $doctor = Doctor::create([\n 'fullname' => $faker->name,\n 'description' => $faker->sentence(rand(5,6)),\n 'fees' => rand(1000,10000),\n 'phone_no' => rand(1000000000,9999999999),\n 'password' => '$2y$10$ckpf//racepEDB9TGR2ZLu3JkVrPKUlaXorZIiWF4eZf87O83lPX2',\n 'email'=> $faker->unique()->safeEmail,\n 'city_id' => rand(1,$city_id),\n 'address' => $faker->sentence(rand(5,6)),\n 'gender' => 'male',\n 'country_code' => '+91',\n 'years_of_exp' => rand(5,20),\n 'slot_duration' => 15,\n 'speciality_id' => rand(1,$specialization_id),\n 'reg_no' => rand(1,200000),\n 'regcouncil_id' => rand(1,$regcouncil_id),\n 'degree_id' => rand(1,$degree_id),\n 'college_id' => rand(1,$college_id),\n 'establishment_name' => $faker->word,\n 'establishment_address' => $faker->sentence(rand(5,6)),\n 'establishment_city_id' => rand(1,$city_id),\n 'establishment_pincode' => rand(1000,999999),\n ]);\n\n $user = User::create([\n 'name' => $doctor->fullname,\n 'email' => $doctor->email,\n 'email_verified_at' => now(),\n 'password' => '$2y$10$ckpf//racepEDB9TGR2ZLu3JkVrPKUlaXorZIiWF4eZf87O83lPX2' , // password\n 'gender'=> $doctor->gender,\n 'role'=>'doctor',\n 'age'=>rand(20,50),\n 'phone_no'=> $doctor->phone_no,\n 'remember_token' => Str::random(10),\n 'doctor_id'=>$doctor->id\n ]);\n $doctor->type()->attach(rand(1,$type->id));\n }\n\n while(($cat = fgetcsv($categories)) !== FALSE){\n $category = Category::create([\n 'name'=>$cat[0]\n ]);\n $category_id = $category->id;\n }\n\n while(($subcat = fgetcsv($subcategories)) !== FALSE){\n $subcategory = Subcategory::create([\n 'name'=>$subcat[0],\n 'category_id'=>rand(1,$category_id),\n ]);\n $subcategory_id = $subcategory->id;\n }\n\n // $i=1;\n // while($i<15){\n // $i++;\n // $manufacturer = Manufacturer::create([\n // 'name'=>$faker->name,\n // 'user_id'=>$i\n // ]);\n // $manufacture_id = $manufacturer->id;\n // }\n\n\n $manufacturer = Manufacturer::create([\n 'name'=>\"John Doe\",\n 'user_id'=>1,\n \n ]);\n\n $manufacture_id = 1;\n\n\n // while(($ing = fgetcsv($ingredients)) !== FALSE){\n // $ingredient = Ingredient::create([\n // 'name'=>$ing[0]\n // ]);\n // $ingredient_id = $ingredient->id;\n // }\n\n while(($pro = fgetcsv($products)) !== FALSE){\n $product = Product::create([\n 'name'=>$pro[0],\n 'price'=>rand(100,1000),\n 'size'=>\"200 ml\",\n 'quantity'=>rand(20,50),\n 'category_id'=>rand(1,$category_id),\n 'subcategory_id'=>rand(1,$subcategory_id),\n 'description'=>$faker->sentence(rand(3,4)),\n 'how_to_use'=>$faker->sentence(rand(2,3)),\n 'benefits'=>$faker->sentence(rand(2,3)),\n 'highlights'=>$faker->sentence(rand(1,2)),\n 'manufacturer_id'=>rand(1,$manufacture_id),\n 'prescription_required'=>rand(0,1),\n ]);\n $product_id = $product->id;\n }\n\n $products = fopen('C:\\practocsv\\product.csv', 'r');\n while(($pro = fgetcsv($products)) !== FALSE){\n $product = Product::create([\n 'name'=>$pro[0],\n 'price'=>rand(100,1000),\n 'size'=>\"200 ml\",\n 'quantity'=>rand(20,50),\n 'category_id'=>rand(1,$category_id),\n 'subcategory_id'=>rand(1,$subcategory_id),\n 'description'=>$faker->sentence(rand(3,4)),\n 'how_to_use'=>$faker->sentence(rand(2,3)),\n 'benefits'=>$faker->sentence(rand(2,3)),\n 'highlights'=>$faker->sentence(rand(1,2)),\n 'manufacturer_id'=>rand(1,$manufacture_id),\n 'prescription_required'=>rand(0,1),\n ]);\n $product_id = $product->id;\n }\n\n Notification_type::create([\n 'name' => 'appointment-made',\n 'message' => 'You have Received a new appointment!'\n ]);\n\n Notification_type::create([\n 'name' => 'appointment-accepted',\n 'message' => 'Your appointment is confirmed!'\n ]);\n\n Notification_type::create([\n 'name' => 'appointment-rejected',\n 'message' => 'Sorry, your appointment is rejected'\n ]);\n\n Notification_type::create([\n 'name' => 'feedback',\n 'message' => 'you have received a new feedback'\n ]);\n\n Notification_type::create([\n 'name' => 'report',\n 'message' => 'Your report has been generated'\n ]);\n\n Notification_type::create([\n 'name' => 'manufacturer-request',\n 'message' => 'you have a new manufacturer registration'\n ]);\n\n Notification_type::create([\n 'name' => 'product-request',\n 'message' => 'you have a new product request'\n ]);\n\n Notification_type::create([\n 'name' => 'product-accept',\n 'message' => 'Your product is now approved'\n ]);\n\n Notification_type::create([\n 'name' => 'prescription',\n 'message' => 'You have received a prescription'\n ]);\n\n\n fclose($specializations);\n fclose($cities);\n fclose($degrees);\n fclose($regcouncils);\n fclose($colleges);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n $this->call(Tipo_DocumentoSeeder::class);\n\n $this->call(RolSeeder::class);\n\n $this->call(GeneroSeeder::class);\n\n $this->call(MaterialSeeder::class);\n\n $this->call(CategoriaSeeder::class);\n\n $this->call(ClasificacionSeeder::class);\n\n $this->call(UsuarioSeeder::class);\n\n $this->call(TallaSeeder::class);\n\n $this->call(ProductoSeeder::class);\n\n $this->call(ContactoSeeder::class);\n\n\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n $data = [];\n for ($i = 0; $i < 100; $i++) {\n $data[] = [\n 'email' => $faker->email,\n 'password' => password_hash($faker->password, PASSWORD_DEFAULT),\n 'name' => $faker->name,\n 'is_verified' => $faker->boolean(),\n\n 'phone' => $faker->optional(0.9)->phoneNumber,\n 'photo_url' => $faker->imageUrl(),\n 'hobbies' => $faker->words(3, true),\n 'passion' => $faker->optional()->words(1, true),\n 'fav_quote' => $faker->optional()->sentence(6, true),\n 'fav_quote_author' => $faker->optional()->name,\n\n 'whatsapp' => $faker->optional(0.9)->phoneNumber,\n 'facebook' => $faker->optional(0.7)->userName,\n 'twitter' => $faker->optional(0.5)->userName,\n 'linkedin' => $faker->optional(0.3)->url,\n 'instagram' => $faker->optional(0.6)->userName,\n 'snapchat' => $faker->optional(0.5)->userName,\n 'website' => $faker->optional(0.4)->url,\n 'blog' => $faker->optional(0.4)->url,\n\n 'created_at' => $faker->dateTimeBetween(\"-2 years\", \"-1 year\")->format('Y-m-d H:i:s'),\n 'updated_at' => rand(0, 2) ? $faker->dateTimeThisYear->format('Y-m-d H:i:s') : null,\n ];\n }\n\n $this->insert('classmates', $data);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create('zh_TW');\n\n foreach (range(1, 100) as $index) {\n $updatedAt = now()->subDays(rand(0, 500));\n User::create([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'password' => Hash::make($faker->password),\n 'phone' => $faker->phoneNumber,\n 'description' => $faker->realText(rand(10, 100)),\n 'sex' => ($index % 2 == 0) ? '男' : '女',\n 'address' => $faker->address,\n 'birth' => now()->subDays(rand(5840, 36500)),\n 'created_at' => $updatedAt->subDays(rand(1, 3000)),\n 'updated_at' => $updatedAt,\n ]);\n }\n\n }", "public function run()\n {\n _Log::system(_Log::$INFO, 'seeding educations');\n $ed1 = new Education(['name'=>'TK']);$ed1->save();\n $ed2 = new Education(['name'=>'SD']);$ed2->save();\n $ed3 = new Education(['name'=>'SMP']);$ed3->save();\n $ed4 = new Education(['name'=>'SMU']);$ed4->save();\n $ed5 = new Education(['name'=>'Diploma']);$ed5->save();\n $ed6 = new Education(['name'=>'Sarjana']);$ed6->save();\n $ed7 = new Education(['name'=>'Magister']);$ed7->save();\n $ed8 = new Education(['name'=>'Doktor']);$ed8->save();\n $ed9 = new Education(['name'=>'Tidak Ada']);$ed9->save();\n _Log::system(_Log::$SUCCESS, 'seeding educations success');\n }", "public function run()\n {\n $faker = $this->fakerFactory->create();\n\n for ($i = 0; $i < 10; $i++) {\n $this->database->table(\"authors\")->insert([\n \"name\" => $faker->unique()->name,\n \"created_at\" => $faker->dateTimeThisYear,\n \"updated_at\" => $faker->dateTimeThisYear\n ]);\n }\n\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n // $faker = \\Faker\\Factory::create();\n // Assessment::create([\n // 'teacher_id' => rand(0, 10),\n // 'pupil_id' => rand(0, 10),\n // 'test_id' => rand(0, 10),\n // 'assessment_no' => rand(0, 120),\n // 'assessment_date' => $faker->date,\n // ]);\n factory(App\\Models\\Assessment::class, 10)->create();\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n\n for($i = 0; $i < 1000; $i++) {\n App\\TestData::create([\n 'username' => $faker->userName,\n 'name' => $faker->name,\n \n ]);\n }\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // Let's make sure everyone has the same password and\n // let's hash it before the loop, or else our seeder\n // will be too slow.\n $password = Hash::make('password');\n\n User::create([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'password' => $password,\n ]);\n\n // And now let's generate a few dozen users for our app:\n for ($i = 0; $i < 10; $i++) {\n User::create([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'password' => $password,\n 'country' => $faker->country,\n 'gender' => 'male',\n 'number' => $faker->phoneNumber,\n 'username' => $faker->userName,\n 'birth_date' => $faker->date($format = 'Y-m-d' , $max = 'now'),\n 'institution_type' => $faker->word,\n 'institution_name' => $faker->company,\n 'department' => $faker->domainword,\n 'faculty' => $faker->colorName,\n 'education_level' => $faker->numberBetween($min = 100 , $max = 700),\n\n ]);\n }\n }", "public function run()\n {\n $this->seedUsers();\n $this->seedAdmins();\n $this->seedMeals();\n\n $this->seedOrder();\n $this->seedOrderlist();\n\n $this->seedReload();\n }", "public function run()\r\n {\r\n $this->seed('MnaraTableSeeder');\r\n\r\n }", "public function run()\n {\n\n $faker = Faker::create();\n foreach(range(1,100)as$index){\n\n \n DB::table('usuarios')->insert([\n 'nombre' => $faker->name(5),\n 'equipo' => $faker->state(4),\n 'nacionalidad'=> $faker->country(4)\n ]);}\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //$this->call(RolesAndPermissionsSeeder::class);\n //$this->call(CMSTableSeeder::class);\n //$this->call(IncidentTypesSeeder::class);\n //$this->call(RegistrarsSeeder::class);\n\n /*\n factory(App\\Incident::class, 50)->create();\n\n factory(\\App\\Inquiry::class, 10)\n ->create()\n ->each(function ($inq){\n $inq->incidents()->attach(\\App\\Incident::inRandomOrder()->take(random_int(1,5))->get());\n });\n */\n //$this->call(InquiryStatusSeeder::class);\n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n $this->seedRegularUsers();\n $this->seedAdminUser();\n }", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function run()\n {\n $faker = Faker::create();\n foreach (range(1,100) as $index) {\n \\DB::table('modulos')->insert([\n 'descricao' => $faker->words(3,true),\n 'ativo' => $faker->boolean\n ]);\n }\n }", "public function run()\n {\n Site::factory(config('seeder.site_count'))\n ->has(Distribution::factory(2))\n ->has(SitedStock::factory(config('seeder.sitedstock_count')))\n ->create();\n \n DB::table('sites')->insert([\n 'radar_name'=>'DWSR-2501C',\n 'image'=>'027ce6f5bc035a08d207f0de97b23965.png',\n 'station_id'=>'Banjarmasin'\n ]);\n DB::table('sites')->insert([\n 'radar_name'=>'DWSR-3501C',\n 'image'=>'027ce6f5bc035a08d207f0de97b23965.png',\n 'station_id'=>'Cengkareng'\n ]);\n }", "public function run()\n {\n \t// php artisan db:seed --class=Chuckbe\\\\ChuckcmsTemplateFrankfurt\\\\seeds\\\\ChuckcmsTemplateFrankfurtTableSeeder\n $fonts = [];\n $fonts['raw'] = 'Roboto:100,300,400,400italic,700|Patua+One:100,300,400,400italic,700|Lato:400,400italic,700,700italic,900|Roboto:100,300,400,400italic,500,700,700italic|Montserrat:100,300,400,400italic,500,700,700italic';\n \n $css = [];\n $css['global']['href'] = 'chuckbe/chuckcms-template-frankfurt/css/global.css';\n $css['global']['asset'] = 'true';\n\n $css['structure']['href'] = 'chuckbe/chuckcms-template-frankfurt/css/structure.css';\n $css['structure']['asset'] = 'true';\n\n $css['frankfurt']['href'] = 'chuckbe/chuckcms-template-frankfurt/css/frankfurt.css';\n $css['frankfurt']['asset'] = 'true';\n\n $css['custom']['href'] = 'chuckbe/chuckcms-template-frankfurt/css/custom.css';\n $css['custom']['asset'] = 'true';\n \n $js = []; \n $js['jquery']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/jquery-2.1.4.min.js';\n $js['jquery']['asset'] = 'true';\n\n $js['mfnmenu']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/mfn.menu.js';\n $js['mfnmenu']['asset'] = 'true';\n\n $js['jqueryplugins']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/jquery.plugins.js';\n $js['jqueryplugins']['asset'] = 'true';\n\n $js['jqueryjplayer']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/jquery.jplayer.min.js';\n $js['jqueryjplayer']['asset'] = 'true';\n\n $js['animations']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/animations/animations.js';\n $js['animations']['asset'] = 'true';\n\n $js['translate3d']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/translate3d.js';\n $js['translate3d']['asset'] = 'true';\n\n $js['scripts']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/scripts.js';\n $js['scripts']['asset'] = 'true';\n\n $js['email']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/email.js';\n $js['email']['asset'] = 'true';\n\n $json = [];\n\n // create template\n Template::updateOrCreate(\n ['slug' => 'chuckcms-template-frankfurt'],\n ['name' => 'ChuckCMS Template Frankfurt',\n 'hintpath' => 'chuckcms-template-frankfurt',\n 'path' => 'chuckbe/chuckcms-template-frankfurt',\n 'type' => 'default',\n 'version' => '0.1',\n 'author' => 'Karel Brijs ([email protected])',\n 'fonts' => $fonts,\n 'css' => $css,\n 'js' => $js,\n 'json' => $json,\n 'active' => 1]\n );\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n foreach (range(1,50) as $index) {\n $data = [\n 'id' => $faker->id,\n 'txt_protocolo' => $faker->unique()->txt_protocolo,\n ];\n Protocolo::create($data);\n }\n }", "public function run()\n {\n // *****Data Using Manually*********\n // $student = [\n // [\n // 'name'=>'Jogi',\n // 'lastname'=>'Singh',\n // ],\n // [\n // 'name'=>'Jonty',\n // 'lastname'=>'Singh',\n // ],\n // [\n // 'name'=>'Harsh',\n // 'lastname'=>'Srivastav',\n // ],\n \n // ];\n\n // foreach ($student as $key => $value) {\n // Student::create($value);\n // }\n // *******End Data Manually*************\n // *****************Data Dump Using Faker*******************\n $faker = Faker::create();\n foreach (range(1,100) as $key => $value) {\n Student::create(\n [\n 'name'=>$faker->name,\n 'lastname'=>$faker->lastname\n ]\n );\n }\n\n }", "public function run()\n\n {\n\n DB::table('user')->insert([\n 'name'=> 'Admin',\n 'phonenumber'=>'01694844753',\n 'password'=>hash('ripemd160','123456'),\n 'avatar'=>'/img/unknowavatar.png',\n ]);\n $faker = Faker\\Factory::create();\n\n for($i=0; $i<5; $i++){\n \n DB::table('user')->insert([\n 'name'=> $faker->name,\n 'phonenumber'=>$faker->phoneNumber,\n 'password'=> Str::random(10),\n 'avatar'=>$faker->image,\n ]);\n \n }\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n// $this->seedTestForms($faker);\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n \n //لازم المودل يكون عامل \n //has Facroty عشان اقدر استعملو \n //لتنفيذ الفاكتوري\n // Category::factory(19)->create();\n\n Product::factory(199)->create();\n //Tag::factory(15)->create();\n\n //هنا بستدعي السيدر عشان انفذو\n // $this->call(CategoriesTableSeeder::class);\n\n /*\n Category::factory(10)\n ->has(Category::factory(5)\n ->has(Product::factory(15),'products')\n ,'children')\n ->create();\n*/\n\n }", "public function run()\n {\n factory(\\App\\Models\\Discusse::class,config('other.seeder_count'))->create([\n 'is_better' => 0\n ]);\n factory(\\App\\Models\\Discusse::class,config('other.seeder_count'))->create([\n 'is_better' => 1\n ]);\n }", "public function run()\n {\n $faker = Faker::create();\n foreach (range(1,50) as $index) {\n DB::table('empleado')->insert([\n 'dni' => $faker->numberBetween(20000000, 43000000),\n 'apellidonombre' => $faker->firstName(). \" \" . $faker->lastName(),\n 'idempleadocapataz' => rand(1, 50),\n 'especialidad' => $faker->jobTitle(),\n ]);\n }\n }", "public function run()\n {\n $count = Regency::count();\n if($count == 0) {\n return $this->command->alert(\n 'Seed Error !! Silahkan Seed Regency Terlebih Dahulu'\n );\n }\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n District::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n $data = array_map('str_getcsv', file(base_path().\"/storage/districts.csv\"));\n foreach ($data as $x) {\n $prov = new District();\n $prov->id = $x[0];\n $prov->regency_id = $x[1];\n $prov->name = $x[2];\n $prov->save();\n }\n }", "public function run()\n {\n $faker=Faker::create();\n foreach (range(1,20) as $i){\n DB::table('personas')->insert([\t \n 'nombre' => $faker->name(),\n 'apellido' => $faker->lastName(),\n 'correo' => $faker->email(),\n 'edad'=>$faker->randomNumber(2),\n ]);\n }\n // factory(personas::class, 99)->create();\n }", "public function run()\n {\n //\n $faker = Faker::create();\n\n for ($i = 0; $i < 100; $i++) {\n $data = [\n 'pelanggan' => $faker->name,\n 'alamat' => $faker->address,\n 'telp' => $faker->phoneNumber,\n ];\n\n Pelanggan::create($data);\n }\n }", "public function run()\n {\n DB::table('users')->delete();\n $json = File::get(\"database/seederfile/users.json\");\n $data = json_decode($json);\n foreach($data as $obj)\n { User::create(array(\n \t'id' => $obj -> id,\n \t'role_id' => $obj -> role_id,\n \t'username' => $obj -> username,\n \t'name' => $obj -> name,\n \t'email' => $obj -> email,\n #'password' => Hash::make('admin1')]);\n \t'password' => Hash::make($obj -> password),\n\t\t\t'remember_token' => $obj -> remember_token,\n \t'created_at' => $obj -> created_at,\n\t\t\t'updated_at' => $obj -> updated_at\n ));\n\t\t}\n }", "public function run()\n {\n //\n// factory(\\App\\Bill::class,10)->create();\n \\App\\Helpers\\FactoryHelper::force_seed(\\App\\Bill::class,4);\n }", "public function run()\n {\n\t\t// Let's truncate our existing records to start from scratch.\n File::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n File::create([\n 'name' => $faker->name,\n\t\t\t\t'user_id' => User::first()->id,\n ]);\n }\n }", "public function run()\n {\n // Create my personal user\n $email = env('ADMIN_USER_EMAIL', false);\n $password = env('ADMIN_USER_PASSWORD', false);\n if (!$email || !$password) {\n throw new \\Exception('You must set admin credentials in .env before seeding');\n }\n $jakob = factory(App\\User::class)->create([\n 'name' => 'Jakob Buis',\n 'email' => $email,\n 'password' => bcrypt($password),\n ]);\n\n // Create the frontend as password-grant client\n $client = (new \\Laravel\\Passport\\Client)->forceFill([\n 'user_id' => $jakob->id,\n 'name' => 'librorum-frontend',\n 'secret' => str_random(40),\n 'redirect' => env('APP_URL'),\n 'personal_access_client' => false,\n 'password_client' => true,\n 'revoked' => false,\n ]);\n $client->save();\n\n // Create the content\n $tags = factory(\\App\\Tag::class, 5)->create(['user_id' => $jakob->id]);\n\n // Create 5 notebooks, each with 3 pages\n // each linked to 2 randomly selected tags\n $notebooks = factory(\\App\\Notebook::class, 5)->create(['user_id' => $jakob->id]);\n $notebooks->each(function($notebook) use ($tags) {\n\n $pages = factory(\\App\\Page::class, 3)->create([\n 'notebook_id' => $notebook->id,\n ]);\n\n $pages->each(function($page) use ($tags) {\n $page->tags()->attach($tags->random(2));\n });\n });\n }", "public function run()\n {\n $faker = Faker\\Factory::create('en_US');\n\n foreach(range(1, 10) as $index) {\n Institute::create([\n 'inst_profile_guid' => $faker->uuid,\n 'user_id' => rand(1, 20),\n 'institute_code' => $faker->postcode,\n 'institute_name' => $faker->company,\n 'institute_description' => $faker->sentence,\n 'contact' => $faker->phoneNumber,\n 'address' => $faker->address,\n 'city' => $faker->city,\n 'postal_code' => $faker->postcode,\n 'country' => $faker->country\n ]);\n }\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('App\\Meet');\n\n for($i = 1; $i <= 20; $i ++){\n \tDB::table('meets')->insert([\n \t\t'user_id' => $faker->numberBetween($min = 1, $max = 20),\n \t\t'title' => $faker->sentence(),\n \t\t'meet_date' => $faker->dateTimeThisYear($max = 'now', $timezone = date_default_timezone_get()),\n \t\t'location' => $faker->streetName,\n \t\t'lat' => $faker->latitude($min = -90, $max = 90),\n \t\t'lng' => $faker->longitude($min = -180, $max = 180),\n \t\t'description' => implode($faker->paragraphs(5)),\n \t\t'deleted' => 0,\n \t\t'updated_at' => \\Carbon\\Carbon::now(),\n \t\t'created_at' => \\Carbon\\Carbon::now(),\n \t\t]);\n }\n\n\n }", "public function run()\n {\n Model::unguard();\n\n $this->call(AttributesSeeder::class);\n\n File::factory()->count(10)->create();\n\n // Get all the attributes attaching up to 3 random attributes to each file\n $attributes = Attribute::all();\n\n // Populate the pivot table\n File::all()->each(function ($file) use ($attributes) {\n $file->attributes()->attach(\n $attributes->random(rand(1, 5))->pluck('id')->toArray(),\n [\n 'order' => rand(1, 5)\n ]\n );\n });\n\n Model::reguard();\n }", "public function run()\n {\n // DB::table('users')->truncate(); //elimina la bd cada vez que realizo el seed\n\n \n\n \n\n\n factory(App\\User::class,10)->create();\n\n factory(App\\User::class)->create([\n 'name' =>'Administrador',\n 'email' =>'[email protected]',\n 'role' =>'admin',\n 'password'=>bcrypt('secret')\n\n ]);\n\n\n factory(App\\hotel::class,1)->create();\n \n \n\n }", "public function run()\n {\n //$this->call(SectionSeeder::class);\n $this->call(AdminSeeder::class);\n //$this->call(ClientSeeder::class);\n \n \n\n\n\n //DB::table('users')->insert([\n // 'name' => 'Harry Han',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // 'contractorLastname' => 'Han',\n // 'contractorCompany' => 'test-company' ,\n // 'contractorContactNumber' => '0600000000',\n // 'contractorStatus' => 'active'\n //]);\n }", "public function run()\n {\n $seeds = [\n [\n 'id'=>1,\n 'user_id'=>'1',\n 'firstname'=>'Jonas',\n 'lastname'=>'Jonaitis',\n 'position'=>'Administratorius',\n 'email'=>'[email protected]',\n 'phone'=>'Nėra',\n 'birthday'=>'2017-04-05',\n 'photo'=>'150x150.png',\n ],\n ];\n\n foreach ($seeds as $seed) {\n \\App\\Profile::create($seed);\n }\n }", "public function run()\n {\n \t$faker = Factory::create();\n \tfor ($i=0; $i <99 ; $i++) { \n \t\tKontak::create([\n \t\t\t'nama'=>$faker->name,\n \t\t\t'email'=>$faker->email,\n \t\t\t'foto'=>$faker->text\n \t\t]);\n \t}\n }", "public function run()\n\t{\n\n $faker = \\Faker\\Factory::create();\n\n // Let's make sure everyone has the same password and \n // let's hash it before the loop, or else our seeder \n // will be too slow.\n $password = Hash::make('aa2016aa');\n\n User::create([\n 'type' => '1',\n 'fname' => 'artiom',\n 'lname' => 'live',\n 'email' => '[email protected]',\n 'password' => $password,\n ]);\n\n User::create([\n 'type' => '0',\n 'fname' => 'artiom',\n 'lname' => 'demo',\n 'email' => '[email protected]',\n 'password' => $password,\n ]);\n }", "public function run()\n {\n // Admin Acount Seeding\n $add = new User;\n $add->name = 'karim';\n $add->email= '[email protected]';\n $add->password = Hash::make(123456);\n $add->phone = '01126878406';\n $add->prefix = 'karim';\n $add->level = 'admin';\n $add->save();\n\n //Language Seeding\n $language = new Languages;\n $language->language = \"English\";\n $language->prefix = \"en\";\n $language->direction = \"ltr\";\n $language->save();\n\n //Setting Seeding\n $appSetting = new Setting;\n $appSetting->sitename = \"Cure2Us\";\n $appSetting->email = \"[email protected]\";\n $appSetting->save();\n }", "public function run()\n {\n //\n \t$fake = \\Faker\\Factory::create();\n \\DB::table('users')->insert([\n 'name' => 'Nguyễn Văn Hiệp',\n 'email' => '[email protected]',\n 'is_admin' => '1',\n 'password'=> bcrypt('12345678')\n ]);\n for ($i=0; $i < 20; $i++) {\n \\DB::table('users')->insert([\n 'name' => $fake->name,\n 'email' => $fake->email,\n 'password'=> bcrypt('12345678')\n ]);\n }\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++)\n {\n $gender = array_rand(['Men', 'Women'], 1);\n\n User::create([\n 'id' => ($i + 1),\n 'first_name' => $faker->firstName($gender == 0 ? 'male' : 'female'),\n 'last_name' => $faker->lastName,\n 'sex' => ($gender == 0 ? 'Men' : 'Women'),\n 'birthday' => $faker->date('Y-m-d', 'now'),\n 'email' => $faker->email,\n 'address' => $faker->address,\n 'telephone' => rand(1111111111,9999999999)\n ]);\n }\n }", "public function run()\n {\n $faker = Faker\\Factory::create('fr_FR');\n\n for($i=0; $i<5; $i++){\n\n $data = [\n [\n 'pseudo' => $faker->userName,\n 'email' => $faker->unique()->email,\n 'firstname' => $faker->firstName,\n 'lastname' => $faker->lastName,\n 'password' => $faker->password,\n 'birthday' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'nbateam_id' => 1,\n ]\n ];\n User::insert($data);\n\n }\n }", "public function run()\n {\n $this->call(\\Database\\Seeders\\GroupByRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\SingleIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\MultiIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\JoinFiveTablesSeeder::class);\n\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// // 試しに一回流す\n// $data = $this->makeData(0, 'userFactory', 1);\n// DB::table('users')->insert($data);\n// $data = $this->makeData(0, 'userDetailFactory', 1);\n// DB::table('user_details')->insert($data);\n//\n// // $this->call(UsersTableSeeder::class);\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userFactory', 2500);\n// DB::table('users')->insert($data);\n// }\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userDetailFactory', 2500);\n// DB::table('user_details')->insert($data);\n// }\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n foreach (range(1, 20) as $value) {\n User::create([\n 'name' => $faker->text('20'),\n 'email' => $faker->email,\n 'dob'=> $faker->date(),\n 'password' => bcrypt('anhvit12'),\n ]);\n\n }\n }", "public function run()\n {\n if (!File::exists(public_path('uploads/faker/heritage'))) {\n File::makeDirectory(public_path('uploads/faker/heritage'), 777, true);\n }\n $faker = Faker\\Factory::create();\n for ($i = 0; $i < 16; $i++) {\n $data = [\n 'title' => $faker->sentence(),\n 'description' => theExcerpt($faker->paragraph, 255),\n 'content' => $faker->text(2000),\n 'thumbnail' => 'uploads/faker/heritage/' . $faker->image(public_path('uploads/faker/heritage'), 420, 236, null, false),\n 'cover' => 'uploads/faker/heritage/' . $faker->image(public_path('uploads/faker/heritage'), 1170, 150, null, false),\n 'province_id' => rand(1, 63),\n 'area_id' => rand(63, 70),\n 'user_id' => rand(1, 10),\n 'lang' => 'en',\n 'parent_id' => 0,\n 'status' => STATUS_ACTIVATED\n ];\n \\App\\IZee\\Heritages\\Heritage::create($data);\n }\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n $gender = $faker->randomElement(['L', 'P']);\n $religion = $faker->randomElement(['Kristen', 'Islam', 'Budha']);\n\n for ($i=0; $i < 20; $i++) { \n DB::table('siswa')->insert([\n 'nama_depan' => $faker->firstName,\n 'nama_belakang' => $faker->lastName,\n 'jenis_kelamin' => $gender,\n 'agama' => $religion,\n 'alamat' => $faker->address\n ]);\n }\n }", "public function run()\n {\n $faker = Faker::create();\n\n foreach(range(1, 10) as $index)\n {\n User::create([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'username' => $faker->userName,\n 'password' => $faker->password,\n 'location' => $faker->text,\n 'profile_picture' => $faker->imageUrl($width = 550, $height = 550)\n ]);\n }\n }", "public function run()\n {\n $faker = Faker::create();\n $samples_temp = [];\n\n for($i = 0; $i < 100; $i++)\n {\n $samples_temp[] = [\n 'nombre' => $faker->name,\n 'email'=> $faker->email\n\n ];\n }\n Correo::insert($samples_temp);\n\n\n }", "public function run()\n {\n $faker = $faker = Faker\\Factory::create();\n foreach (range(1,250) as $index) {\n DB::table('employee')->insert([\n 'employee_first_name' => $faker->name,\n 'employee_last_name' => $faker->name,\n 'employee_ref_number' => 00000,\n 'employee_phone_number' => rand(0,5),\n 'employee_address' => $faker->name,\n 'employee_address_two' => $faker->name,\n 'employee_country' => $faker->name,\n 'employee_state' => $faker->state,\n 'employee_city' => $faker->city,\n 'employee_email' => $faker->email,\n 'employee_pin_code' => rand(0,5),\n 'employee_reference' => $faker->name,\n 'employee_unique_identy' => $faker->name,\n ]);\n }\n }", "public function run()\n {\n $facker = app(Faker\\Generator::class);\n\n $avatars = [\n 'https://avatars3.githubusercontent.com/u/41312704?s=460&v=4',\n 'https://cdn.learnku.com/uploads/avatars/24327_1530087651.jpeg!/both/200x200',\n ];\n\n $users = factory(User::class)\n ->times(10)\n ->make()\n ->each(function ($user, $index) use ($facker, $avatars) {\n $user->avatar = $facker->randomElement($avatars);\n });\n $user_array = $users->makeVisible(['password', 'remember_token'])->toArray();\n User::insert($user_array);\n\n $user = User::find(1);\n $user->name = '十步';\n $user->email = '[email protected]';\n $user->avatar = 'https://avatars3.githubusercontent.com/u/41312704?s=460&v=4';\n $user->save();\n\n // 初始化用户角色,将1号用户设置为站长\n $user->assignRole('Founder');\n $user = User::find(2);\n $user->assignRole('Maintainer');\n }", "public function run()\n {\n User::create ( [\n 'username' => 'anh.tuan',\n 'first_name' => 'Tuan',\n 'last_name' => 'Nguyen',\n 'email' => '[email protected]',\n 'is_admin' => 1,\n 'password' => bcrypt('123456')\n ]);\n\n for ($i = 0; $i < 10; $i++)\n {\n $faker = Faker::create();\n User::create ( [\n 'username' => $faker->userName,\n 'first_name' => $faker->firstName,\n 'last_name' => $faker->lastName ,\n 'email' => $faker->email,\n 'is_admin' => 0,\n 'password' => bcrypt('123456')\n ]);\n }\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n for($i =0; $i<20; $i++){\n \\App\\Organisation::create([\n 'name' => $faker->company,\n 'business_type_id' => $faker->numberBetween(1, 3),\n 'logo'=>$faker->imageUrl($width = 200, $height = 200, 'abstract',true),\n 'address' => $faker->address,\n 'email' => $faker->companyEmail,\n 'mobile' => $faker->numberBetween(263772000000,263779999999),\n 'telephone'=>$faker->numberBetween(240291,29999)\n ]);\n }\n }", "public function run()\n {\n User::create([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n ]);\n\n User::create([\n 'name' => 'Leonardo',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789')\n ]);\n\n // seed sin model\n /* DB::table('users')->insert([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s')\n ]); */\n }", "public function run()\n {\n $faker = Faker::create();\n\n for($i = 0; $i < 50; $i++){\n $uid = DB::table('users')->select('id')->inRandomOrder()->first();\n $student = new Student([\n 'first_name' => $faker->firstName,\n 'last_name' => $faker->lastName,\n 'teacher_id' => $uid->id,\n 'code' => $faker->bothify('**********')\n ]);\n\n $student->save();\n }\n }", "public function run()\n {\n $faker = Faker::create();\n $preUach = PreUach::all();\n $samples_temp = [];\n\n foreach ($preUach as $item)\n {\n\n\n $samples_temp[] = [\n 'postulante' => $item->postulante,\n 'persona_matricula'=> $faker->lastName.' '. $faker->firstName,\n 'fecha_matricula'=>$faker->dateTimeBetween($startDate = '-5 months', $endDate = 'now')\n ]; \t\n }\n\n Declaracion::insert($samples_temp);\n \n }" ]
[ "0.741271", "0.72163844", "0.71867263", "0.7150963", "0.7011614", "0.6992453", "0.6889081", "0.6877449", "0.68096465", "0.679051", "0.67819595", "0.6763185", "0.6725394", "0.67226577", "0.67199546", "0.67100257", "0.6709864", "0.67040205", "0.6703833", "0.66986066", "0.66848785", "0.66676813", "0.6664289", "0.66619146", "0.6658433", "0.6657409", "0.66464853", "0.66320693", "0.6631319", "0.66305304", "0.66290253", "0.66284007", "0.6624839", "0.6623553", "0.6619334", "0.6618539", "0.6608564", "0.65820485", "0.65815806", "0.65786946", "0.65776837", "0.65724593", "0.65712655", "0.6568998", "0.6564165", "0.65635526", "0.65632516", "0.6561539", "0.65603864", "0.6557867", "0.6557867", "0.6557841", "0.6557841", "0.6557841", "0.6557841", "0.6557841", "0.6556947", "0.6555183", "0.6549153", "0.65489244", "0.654778", "0.6542256", "0.6541639", "0.6536023", "0.65329695", "0.6532951", "0.6532415", "0.65314263", "0.65287995", "0.6528459", "0.65275294", "0.6521118", "0.6521097", "0.6520966", "0.6520696", "0.65203667", "0.6519488", "0.6513222", "0.651225", "0.6512065", "0.6511974", "0.6510938", "0.6509229", "0.6507844", "0.65072274", "0.6500883", "0.65005153", "0.64961535", "0.6495031", "0.6491838", "0.6490735", "0.6488336", "0.64861405", "0.6485924", "0.6479967", "0.6479224", "0.6478154", "0.6477599", "0.6476717", "0.64762294", "0.64754003" ]
0.0
-1
variable for db credentials
function getFromDB($sql_query) { static $config; // check if database credentials is available if(!isset($config)) { $config = parse_ini_file(__DIR__ . '/../../private/config.ini'); } // check credentials is set if(empty($config)) { http_response_code(503); return NULL; } // connected with database $mysqli = mysqli_connect($config['db_host'], $config['db_user'], $config['db_pass'], $config['db_name'], 3306); $mysqli->set_charset('utf-8'); // check mySQL connection if ($mysqli->connect_errno) { http_response_code(503); return NULL; } // Check SQL query if (!($stmt = $mysqli->query($sql_query))) { return NULL; } // Check closing DB connection if (!$mysqli->close()) { http_response_code(503); return NULL; } // Check response is not empty if (empty($stmt)) { http_response_code(503); return NULL; } return $stmt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function credentials() {\n\t\t return array(PHPLM_DBHOST, PHPLM_DBUSER, PHPLM_DBPASS);\n\t\t}", "function getDbCredentials()\n{ \n return getSettings()['database'];\n}", "abstract public function credentials();", "function get_object_credentials() {\n\t\treturn array(\n\t\t\t'host' => $this->host,\n\t\t\t'port' => $this->port,\n\t\t\t'dbname' => $this->dbName,\n\t\t\t'user' => $this->user,\n\t\t\t'password' => $this->passwd\n\t\t);\n\t}", "function pdoe_mysql_test_db_credentials() {\n\treturn array( \n\t\t'user' => 'pdoe', \n\t\t'password' => 'moomoo', \n\t\t'host' => 'localhost', \n\t\t'database' => 'pdoe_test'\n\t);\n}", "abstract public function getCredentials();", "public function init_credentials()\n\t{\n\t\tif($this->get_session('admin') != null)\n\t\t{\n\t\t\t$this->credentials['admin'] \t\t\t= $this->get_session('admin');\n\t\t\t$this->credentials['grupo_admin'] \t\t= $this->get_session('admin_grupo');\n\t\t\t$this->credentials['permissoes_admin'] \t= $this->get_session('admin_permissoes');\n\t\t\t\n\t\t\t$this->credentials['workspace_id'] \t\t= $this->get_session('workspace_id');\n\t\t\t$this->credentials['workspace_nome']\t= $this->get_session('workspace_nome');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->credentials = null;\n\t\t}\n\t}", "function get_database_password()\n\t{\n\t\treturn ($this -> database_password);\n\t}", "private function getCredentials()\n {\n $basic = base64_encode(Settings::$username . ':' . Settings::$password);\n// $basic = base64_encode($this->user_id . ':' . $this->password);\n return $basic;\n }", "private function getCrendentials()\n {\n $db = parse_ini_file('db.ini');\n $this->username = $db['user'];\n $this->password = $db['password'];\n $this->host = $db['host'];\n $this->dbname = $db['dbname'];\n }", "function change_db_credentials()\n\t{\n\t\tif ( !isset($_POST['credentials']) ) return;\n\t\t$credentials = file_get_contents('../credentials.php');\n\t\t$permittedVariables = array('DB_NAME','DB_USER','DB_PASSWORD');\n\t\tforeach ($_POST['credentials'] as $credName => $credVal)\n\t\t{\n\t\t\tif ( in_array($credName, $permittedVariables) )\n\t\t\t{\n\t\t\t\t//Sanitize the value before adding it.\n\t\t\t\t$credVal = str_replace(\"'\", '', $credVal);\n\t\t\t\t$credVal = str_replace(\"\\\"\", '', $credVal);\n\t\t\t\t$credentials = replace_credential($credentials, $credName, $credVal);\n\t\t\t}\n\t\t}\n\t\tfile_put_contents('../credentials.php', $credentials);\n\t}", "public function getDbPassword(): string\n {\n return (string) Config::get('DB_HOST');\n }", "public function getDatabasePassword()\n {\n return $this->settings['db_password'];\n }", "function get_database_user()\n\t{\n\t\treturn ($this -> database_user);\n\t}", "public function __construct(){\n $dbCredentials = $this->readConfigFile(self::DB_CONFIG_FILE);\n $this->dbHostname=$dbCredentials[\"hostname\"];\n $this->dbName=$dbCredentials[\"dbName\"];\n $this->dbUsername=$dbCredentials[\"dbUsername\"];\n $this->dbPassword=$dbCredentials[\"dbPassword\"];\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 }", "function get_credentials($connection_id) {\n\t\t#echo '<p>get_credentials with connection_id: ' . $connection_id;\n\t\tinclude_once(CLASSPATH . 'Connection.php');\n\t\t$conn = Connection::find_by_id($this->gui, $connection_id);\n\t\treturn array(\n\t\t\t'host' => \t\t($conn->get('host') != '' ? $conn->get('host') : 'pgsql'),\n\t\t\t'port' => \t\t($conn->get('port') != '' ? $conn->get('port') : '5432'),\n\t\t\t'dbname' => \t($conn->get('dbname') != '' ? $conn->get('dbname') : 'kvwmapsp'),\n\t\t\t'user' => \t\t($conn->get('user') != '' ? $conn->get('user') : 'kvwmap'),\n\t\t\t'password' => ($conn->get('password') != '' ? $conn->get('password') : KVWMAP_INIT_PASSWORD)\n\t\t);\n\t}", "public function getDBPassword(){\n\n\t\treturn $this->_password;\n\t}", "public function read_credentials(){\n $query='SELECT * FROM '.$this->table.' WHERE name=? and password=?';\n\n $stmt = $this->conn->prepare($query);\n\n \n $stmt->bindparam(1,$this->name);\n $stmt->bindparam(2,$this->password);\n\n $stmt->execute();\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->name=$row['name'];\n $this->email=$row['email'];\n $this->status=$row['status'];\n\n if($stmt->execute()) {\n return true;\n }\n \n // Print error \n printf(\"Error: %s.\\n\", \"invalid user\");\n \n return false;\n \n \n }", "public function getCredentials()\n {\n return '';\n\n }", "public function getDbPassword()\n\t{\n\t\treturn $this->db_password;\n\t}", "public function getCredential();", "public function password() {\n return $this->db['password'];\n }", "public function getCredentials()\n {\n return $this->provider . '_' . $this->oAuthId;\n }", "public function getCredentials()\n {\n return '';\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 }", "static public function getLogin() {\n //resultat : chaîne de caractère qui correspond au login \n return self::$databases['login'];\n }", "function _terminatur_data_get_db_creds($site, $destination, $db_user, $db_pass, $db_host, $db_port) {\n $db_url = 'mysql://' . $db_user . ':' . $db_pass . '@' . $db_host . ':' . $db_port . '/' . $site['machine-name'] . TERMINATUR_DB_SUFFIX;\n // Check to see if code exists\n if (is_dir($destination . $site['machine-name'])) {\n // Validate settings file if applicable\n if (file_exists($destination . $site['machine-name'] . TERMINATUR_DEFAULT_DEFAULT_DIR . \"settings.php\")) {\n $settings_file = $destination . $site['machine-name'] . TERMINATUR_DEFAULT_DEFAULT_DIR . \"settings.php\";\n if (!$databases = _terminatur_settings_validate($settings_file)) {\n $databases = array();\n $databases = _terminatur_data_parse_db_url($db_url, NULL);\n if (!$databases = _terminatur_settings_build($settings_file, $databases)) {\n return FALSE;\n }\n }\n // This means we should have a legit settings file with legit db creds\n // Let's build a local alias for it\n // Build alias callback function\n $get_alias_func = '_terminatur_alias_add_' . TERMINATUR_ENV;\n $get_alias_func($site, $destination);\n return $databases;\n }\n elseif (file_exists($destination . $site['machine-name'] . TERMINATUR_DEFAULT_DEFAULT_DIR . \"default.settings.php\")) {\n // Sometimes settings.php is gitignored so we should instantiate one and try again\n copy($destination . $site['machine-name'] . TERMINATUR_DEFAULT_DEFAULT_DIR . \"default.settings.php\", $destination . $site['machine-name'] . TERMINATUR_DEFAULT_DEFAULT_DIR . \"settings.php\");\n return _terminatur_data_get_db_creds($site, $destination, $db_user, $db_pass, $db_host, $db_port);\n }\n }\n return _terminatur_data_test_db_connection(_terminatur_data_parse_db_url($db_url, NULL));\n}", "public function credential()\n {\n return $this->credentials();\n }", "function set_object_credentials($credentials) {\n\t\t$this->host = \t$credentials['host'];\n\t\t$this->port = \t$credentials['port'];\n\t\t$this->dbName = $credentials['dbname'];\n\t\t$this->user = \t$credentials['user'];\n\t\t$this->passwd = $credentials['password'];\n\t}", "public function getServerCredentials()\n {\n if ($connections = $this->command->option('on')) {\n $this->connections->setActiveConnections($connections);\n }\n\n // Check for configured connections\n $availableConnections = $this->connections->getAvailableConnections();\n $activeConnections = $this->connections->getActiveConnections();\n\n // If we didn't set any connection, ask for them\n if (!$activeConnections->count() && empty($availableConnections)) {\n $connectionName = $this->ask('askWith', 'No connections have been set, please create one', 'production');\n $this->getConnectionCredentials($connectionName);\n\n return;\n } elseif (!$activeConnections->count()) {\n $available = array_keys($availableConnections);\n $connection = $this->ask('askWith', 'No default connection, pick one', head($available), $available);\n $this->connections->setActiveConnections($connection);\n }\n\n // Else loop through the connections and fill in credentials\n foreach ($activeConnections as $connection) {\n $connectionName = $connection->getConnectionKey()->name;\n\n $servers = Arr::get($availableConnections, $connectionName.'.servers');\n $servers = array_keys($servers);\n foreach ($servers as $server) {\n $this->getConnectionCredentials($connectionName, $server);\n }\n }\n }", "function __construct($para1,$para2){\n $this->connection=connect_db();\n $this->user=$para1;\n $this->pass=$para2;\n }", "function setDatabaseConnection($host,$database,$user,$pass);", "function db($host,$user,$pass) //milsoft\r\n\t\t{\r\n\t\t\t$this->$host = $this->set_host($host);\r\n\t\t\t$this->$user = $this->set_user($user);\r\n\t\t\t$this->$pass = $this->set_pass($pass);\r\n\t\t\t$this->connect();\r\n\t\t}", "private function connect(){\n $cred = parse_ini_file(dirname(__FILE__) . \"/../db_key.ini\");\n\n try{\n\t\t $conn = new PDO(\"mysql:host=$cred[servername];dbname=$cred[dbname]\", $cred['username'], $cred['password']);\n\n\t\t // set the PDO error mode to exception\n\t\t $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t return $conn;\n }\n\t\tcatch(PDOException $e){\n\t\t \techo \"Connection failed: \" . $e->getMessage();\n }\n\t\treturn null;\n\t}", "public function getCredentials() {\r\n\t\t\r\n\t\treturn $this->_credentials;\r\n\t\t\r\n\t}", "public function getCredentials()\n { return $this->get('credentials'); }", "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}", "static public function dbConnectAsAdmin() {\r\n\t\t\treturn DBConnector::dbConnect('admin','password');\r\n\t\t}", "public function getDatabaseUsername()\n {\n return $this->settings['db_username'];\n }", "public function getPassword(){\n include('password.php');\n return $DATABASEPASSWORD;\n }", "private function setCredentials()\n\t{\n\t\t$this->credentials['app_token'] = $this->settings_repo->getSiteSetting('facebook', 'app_token');\n\t\t$this->credentials['page_id'] = $this->settings_repo->getSiteSetting('facebook', 'page_id');\n\t}", "function getConnection($db,$custom);", "function pg_connection_string() {\n\treturn \"dbname=d2ffcrdlj7m0dp host=ec2-54-197-246-197.compute-1.amazonaws.com port=5432 user=ihtxpbixayjwqp password=lk0N0phG-frjKVxCYIEUi4U-I6 sslmode=require\";\n}", "function DBConfiguraion()\n\t{\n\t\tglobal $dbhost,$dbmain,$dbuser,$dbpwd;//these variables comes from \"mainconfig.php\" which is in www folder\n\t\t//print\"$dbmain,$dbuser,$dbpwd\";\n\t\t//initialize the database_server\n\t\t$this->database_server = $dbhost;\n\t\t//initialize the database_password \n\t\t$this->database_password = $dbpwd;\n\t\t//initialize the database_user \n\t\t$this->database_user = $dbuser;\n\t\t//initialize the database_name \n\t\t$this->database_name = $dbmain;\n\t}", "private function getKeystorePassword($type,$username,$host,$database) {\n $ks = \\Cherry\\Crypto\\KeyStore::getInstance();\n try {\n $curi = \"{$type}://{$username}@{$host}/{$database}\";\n $password = $ks->queryCredentials($curi);\n } catch (Exception $e) { $this->debug(\"Unable to access credentials for connection {$curi}\"); }\n if (!$password) try {\n $curi = \"{$type}://{$username}@{$host}\";\n $password = $ks->queryCredentials($curi);\n } catch (Exception $e) { $this->debug(\"Unable to access credentials for connection {$curi}\"); }\n return $password;\n }", "public function getCredential ()\n\t{\n\t\t$retVal = null;\n\t\tif ($this->isConsole()) {\n\t\t\t$retVal = MO_CONSOLE_CREDENTIAL;\n\t\t} elseif(!defined('MO_IS_CONSOLE')) {\n\t\t\t$retVal = parent::getCredential();\n\t\t}\n\t\treturn $retVal;\n\t}", "function dbConnect($app_name, $database) {\n\t$err = null;\n\t// if (!is_file($GLOBALS['instance']['password_file'])) $err = 'Specified password file does not exist.';\n\n\tif (!$err) {\n\t\t// require_once($GLOBALS['instance']['password_file']);\n\n\t\t// if (!is_array($_PASSWD)) $err = 'Password file did not contain password definitions.';\n\t\t// if (!is_array($_PASSWD[$app_name])) $err = 'Password file did not contain an entry for the specified application.';\n\n\t\tif (!$err) {\n\t\t\t$host = $GLOBALS['instance']['host'];\n\t\t\t$login = $GLOBALS['instance']['username'];\n\t\t\t$pass = $GLOBALS['instance']['password'];\n\t\t\tunset($_PASSWD);\n\t\t\t$conn = new mysqli($host, $login, $pass, $database);\n\n\t\t\tif ($conn->connect_errno) {\n\t\t\t\t$err = $conn->connect_error;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ($err) {\n\t\techo str_replace('%%error%%', $err, $this->error_html);\n\t\texit;\n\t}\n\treturn $conn;\n\n}", "public function getCredentials()\n\t{\n\t\treturn $this->credentials;\n\t}", "function connexionDb()\n{\n $confDb = getConfigFile()['DATABASE'];\n\n\n $type = $confDb['type'];\n $host = $confDb['host'];\n $servername = \"$type:host=$host\";\n $username = $confDb['username'];\n $password = $confDb['password'];\n $dbname = $confDb['dbname'];\n\n $db = new PDO(\"$servername;dbname=$dbname\", $username, $password);\n return $db;\n}", "function getDBsettings () {\r\n return array (\r\n 'DBserver' => \"localhost\",\r\n 'DBname' => \"wideworldimporters\",\r\n 'DBport' => 3306,\r\n\r\n 'DBuser' => \"wwi\",\r\n 'DBpass' => ''\r\n );\r\n}", "private function __construct() {\r\n $this->dbName = self::$_dbname;\r\n $this->username = self::$_username;\r\n $this->password = self::$_password;\r\n $this->hostname = self::$_hostname; \r\n\t return $this->connect();\r\n }", "public function setCredentials()\n\t{\n\t\t$settings_repo = new \\Kickapoo\\Repositories\\SettingRepository;\n\t\t$this->credentials = $settings_repo->socialCreds();\n\t}", "public function getDbUsername(): string\n {\n return (string) Config::get('DB_USERNAME');\n }", "function db_parameter(){\n\t$param[\"host\"] = \"localhost\"; // to be changed\n\t$param[\"name\"] = \"wbd3\";\n\t\n\t$param[\"user\"] = \"root\"; // to be changed\n\t$param[\"pass\"] = \"root\"; // to be changed\n\t\n\treturn $param;\n}", "function config()\r{\r\t\t\r\t$con=mysql_connect('localhost','username','');\t//removed Username & Password for security.\r\t\r\t\r\t \r\tif (!$con){\r\t\tdie('Could not connect: ' . mysql_error());\r\t}\r\r\t//Selecting Database\r\t$db_selected=mysql_select_db('dbname',$con); //removed DBname for security.\r\t\r\t\r\t//returning Connection Object\r\treturn $db_selected;\r}", "public function connection()\n\t{\n\t\t$config = array(\n\t\t\t'driver' => 'mysql',\n\t\t\t'host' => $this->parser->get('esoTalk.database.host'),\n\t\t\t'database' => $this->parser->get('esoTalk.database.dbName'),\n\t\t\t'username' => $this->parser->get('esoTalk.database.user'),\n\t\t\t'password' => $this->parser->get('esoTalk.database.password'),\n\t\t\t'charset' => 'utf8',\n\t\t\t'collation' => 'utf8_unicode_ci',\n\t\t\t'prefix' => $this->parser->get('esoTalk.database.prefix'),\n\t\t);\n\n\t\treturn $this->factory->make($config, 'esotalk-auth');\n\t}", "function userConnect() {\n //MySQL connection variables\n $hostname = 'localhost';\n $user = 'rhytxfpd_pbu' . $_SESSION['SESS_USER_ID'];\n $pw = $_SESSION['SESS_USER_PW'];\n $database = 'rhytxfpd_projectbass_' . $_SESSION['SESS_USER_ID'];\n \n //connect to database\n try {\n $userdb = new PDO('mysql:host=' . $hostname . ';dbname=' . $database, $user, $pw);\n return $userdb;\n } catch(PDOException $e) {\n echo $e->getMessage();\n die();\n }\n }", "public function getConnection(){\n \n \n $this->db_conn = OCILogon($this->username, $this->password,$this->db_name); \n \n return $this->db_conn;\n }", "private static function get_connect(){\n static::$db = pg_connect(static::$host . \" \" . static::$port . \" \" . static::$database . \" \" . static::$user . \" \" . static::$pass);\n }", "public function getCredentials()\n {\n return $this->credentials;\n }", "public function getCredentials()\n {\n return $this->credentials;\n }", "function database_manipulation($server_name='', $db_name='', $db_username='', $db_password='')\n\n\t{\n\n\t\t\n\n\t\tif(strlen($server_name) <= 0)\n\n\t\t $server_name = $GLOBALS['site_config']['database_server'];\n\n\t\t\n\n\t\tif(strlen($db_name) <= 0)\n\n\t\t $db_name = $GLOBALS['site_config']['database_name'];\n\n\t\t\n\n\t\tif(strlen($db_username) <= 0)\n\n\t\t$db_username = $GLOBALS['site_config']['database_username'];\n\n\t\t\n\n\t\tif(strlen($db_password) <= 0)\n\n\t\t$db_password = $GLOBALS['site_config']['database_password'];\n\n\t\t\n\n\t\t$this->serevername = $server_name;\n\n\t\n\n\t\t$this->dbname = $db_name;\n\n\t\n\n\t\t$this->dbusername = $db_username;\n\n\t\n\n\t\t$this->dbpassword = $db_password;\n\n\t\t\n\n\t\t$this->dbresource_id = $this->connect_db();\n\n\t\t\n\n\t}", "function getDB() {\n\t$passlist = file(\"definitely-not-password-that-would-be-silly.php\");\n $passwd = rtrim($passlist[1]);\n $passwd = preg_replace('/#/','',$passwd);\n $db = new mysqli('localhost', 'SadlerZ', $passwd, 'SadlerZ');\n if ($db->connect_error) {\n die (\"Could not connect to db: \" . $db->connect_error);\n }\n else {\n\t return $db;\n }\n}", "public function getCredential(): string\n {\n return $this->credential;\n }", "public function getCredentials() {\n\t\treturn $this->_credentials;\n\t}", "private function assign_auth_values(){\n\t\t$is_authenticated = AuthManager::is_authenticated();\n\t\t$this->assign('batl_is_logged', $is_authenticated);\n\t\tif($is_authenticated && $this->is_db_available()){\n\t\t\t// check if logged in local server\n\t\t\t$this->assign('batl_is_admin', AuthManager::is_current_user_admin());\n\t\t\t$this->assign('batl_current_user', AuthManager::get_user_infos());\n\n\t\t}else{\n\t\t\t// check if logged in on FB\n\t\t\t/*$facebook_manager = new FacebookService();\n\t\t\t$batl_current_user = AuthManager::get_user_profile($facebook_manager);\n\t\t\t$this->assign('batl_current_user', $batl_current_user);\n\t\t\t$this->assign('fbloginouturl', AuthManager::get_loginout_url($facebook_manager,$batl_current_user));*/\n\t\t}\n\t}", "protected function getCredentials()\n {\n $user = $this->options[\"USER\"];\n $password = $this->options[\"PASS\"];\n // 1BIS : encoded?\n if ($user == \"\" && isSet($this->options[\"ENCODED_CREDENTIALS\"])) {\n list($user,$password) = AJXP_Safe::getCredentialsFromEncodedString($this->options[\"ENCODED_CREDENTIALS\"]);\n }\n // 2. Try from session\n if ($user==\"\" && isSet($this->options[\"USE_SESSION_CREDENTIALS\"]) ) {\n $safeCred = AJXP_Safe::loadCredentials();\n if ($safeCred !== false) {\n $user = $safeCred[\"user\"];\n $password = $safeCred[\"password\"];\n } else {\n throw new Exception(\"Session credential are empty! Did you forget to check the Set Session Credential in the Authentication configuration panel?\");\n }\n }\n return array($user, $password);\n }", "function setDBHost($host,$user,$dbpwd)\n {\n $this->dbhost = $host;\n $this->dbuser = $user;\n $this->dbpwd = $dbpwd;\n }", "public static function conn()\n {\n return (static::inst())::$_db;\n }", "public function __construct() {\n// $this->db['server'] = $args['server'];\n// $this->db['username'] = $args['username'];\n// $this->db['password'] = $args['password'];\n// $this->db['database'] = $args['database'];\n $this->open_connection();\n }", "public function testCheckCredentials(){\r\n $db = new database;\r\n $db->connectToDatabase();\r\n $result = $db->checkCredentials(\"[email protected]\",\"owner\");\r\n $this->assertEquals(\"[email protected]\",$result[\"emailId\"]);\r\n }", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "function DBinfo () {\n $dsn = 'mysql:dbname=co_19_301_99sv_coco_com;host=localhost';\n $user = 'co-19-301.99sv-coco_c';\n $password_db = 'Em4kxvSU';\n \n $array = array(\"dsn\" => $dsn, \"user\" => $user, \"password\" => $password_db);\n return $array;\n}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}" ]
[ "0.7748187", "0.7596032", "0.71588916", "0.6906264", "0.67888165", "0.6601261", "0.6599854", "0.6533641", "0.6533467", "0.652549", "0.6501147", "0.6451688", "0.63013524", "0.629642", "0.6257948", "0.62371576", "0.6235841", "0.6215079", "0.6169965", "0.61547124", "0.61542743", "0.614377", "0.6119042", "0.6113309", "0.6088022", "0.6058722", "0.60469055", "0.6044444", "0.6041565", "0.60403025", "0.6034812", "0.60237944", "0.60236984", "0.6021351", "0.60101545", "0.60000926", "0.5989832", "0.59748626", "0.5974068", "0.59729064", "0.5960591", "0.5952998", "0.5919664", "0.5917731", "0.5913452", "0.5908062", "0.5896731", "0.58884037", "0.58866364", "0.5883951", "0.58813965", "0.5874394", "0.58496034", "0.5847503", "0.58462024", "0.58403045", "0.5829464", "0.5823454", "0.5806907", "0.5799391", "0.57875806", "0.57875806", "0.57857877", "0.57845414", "0.576389", "0.57582283", "0.57548994", "0.57443124", "0.57406384", "0.57381815", "0.5732965", "0.573152", "0.5722305", "0.5722305", "0.5722305", "0.57222337", "0.572211", "0.572211", "0.572211", "0.572211", "0.572211", "0.572211", "0.572211", "0.572211", "0.572211", "0.572211", "0.572211", "0.572211", "0.572211", "0.572211", "0.572211", "0.572211", "0.572211", "0.572211", "0.572211", "0.5721679", "0.5721679", "0.5721631", "0.5721631", "0.5721631", "0.5721631" ]
0.0
-1
Run the database seeds.
public function run() { $rootCategories = json_decode( file_get_contents(database_path('data/rootCategories.json')), true ); // dd($rootCategories); // Category::insert($rootCategories['items']); foreach ($rootCategories['items'] as $item) { // dd($item); Category::create($item); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Create a new controller instance.
public function __construct() { /*$this->middleware('auth'); $this->middleware('role:lender'); $this->middleware(CompleteBankAccount::class)->only('loan');*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82678324", "0.8173564", "0.78118384", "0.7706353", "0.76816905", "0.7659159", "0.74858105", "0.7406485", "0.7298472", "0.7253435", "0.7196091", "0.7174443", "0.7016074", "0.6989523", "0.69837826", "0.69728553", "0.69640046", "0.69357765", "0.6897687", "0.689282", "0.68775725", "0.6868809", "0.68633306", "0.6839021", "0.6779905", "0.6705274", "0.6670987", "0.66623807", "0.6652613", "0.6643801", "0.6616729", "0.66143125", "0.65891534", "0.6449129", "0.64461046", "0.6429425", "0.6426337", "0.63015336", "0.6298573", "0.6294075", "0.62801653", "0.6259914", "0.62554234", "0.6167662", "0.61630553", "0.61601174", "0.6141946", "0.6137726", "0.6134302", "0.6133732", "0.61287725", "0.6110795", "0.60950965", "0.6089703", "0.60768735", "0.6066286", "0.60595477", "0.6055387", "0.60451794", "0.6028352", "0.60246956", "0.60228956", "0.6019088", "0.6012698", "0.6011448", "0.60113615", "0.60076576", "0.6004189", "0.5998927", "0.5997798", "0.5993557", "0.59863526", "0.59863526", "0.59863526", "0.59706056", "0.59546155", "0.59493065", "0.5940633", "0.59251904", "0.59143347", "0.5913916", "0.59121555", "0.59111917", "0.5909761", "0.59026676", "0.59009403", "0.5899209", "0.58973104", "0.58964044", "0.58933777", "0.5888429", "0.58760023", "0.5869122", "0.5863149", "0.58622074", "0.5849116", "0.5838678", "0.5831741", "0.5824525", "0.58167094", "0.58122987" ]
0.0
-1
key name > file handle
public function __construct() { $this->dbDir = XRef::getConfigValue("xref.data-dir"); XRef::createDirIfNotExist($this->dbDir); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function file($key);", "function setFilename($key);", "public function key()\n {\n return $this->fileObject->key();\n }", "private function read($key){\r\n}", "public function getFileKey()\n {\n return isset($this->FileKey) ? $this->FileKey : null;\n }", "public function get_data($handle, $key)\n {\n }", "function getKeys()\n{\n global $keys_file;\n $fp = fopen($keys_file, \"r\");\n $keys = null;\n if (flock($fp, LOCK_SH)) {\n $keys = fread($fp, filesize($keys_file));\n flock($fp, LOCK_UN);\n }\n fclose($fp);\n return $keys;\n}", "public function file($key=null,$value=null){\n return $this->methodsData(\"file\",$key,$value);\n }", "function readAnswerKey($filename) {\n\t$answerKey = array();\n\t\n\t// If the answer key exists and is readable, read it into an array.\n\tif (file_exists($filename) && is_readable($filename)) {\n\t\t$answerKey = file($filename);\n\t}\n\t\n\treturn $answerKey;\n}", "public function key() {\n return key($this->_path);\n }", "public function read($key) {}", "public function read(string $key);", "function _getFilePath($key){\n return $this->savePath .'/'. $this->prefix . md5($key);\n }", "protected function getFile($key) {\n\t\treturn \"{$this->path}/{$key}{$this->getExtension($key)}\";\n\t}", "function name($key) {\n $hash = $this->hash('page', $key);\n return ($this->path) . \"c_$hash.txt\";\n }", "function kval_fsstore_get_item($key)\n{\n return fsstore_get(kval_fsstore_path(), $key);\n}", "public static function file($key) {\n return $_FILES[$key];\n }", "function key()\n\t{\n\t\tglobal $Cl_root_path, $errors, $template, $security;\n\t\t\n\t\t$status = '';\n\t\t\n\t\tif ( isset( $_POST[ 'UL' ] ) )\n\t\t{ // an upload has happened\n\t\t\t$err = $_FILES[ 'key' ][ 'error' ];\n\t\t\tif ( $err != 0 )\n\t\t\t{\n\t\t\t\t$status = '<span style=\"color: red\">' . $this->lang[ 'Key_err' . $err ] . '</span>';\n\t\t\t}else\n\t\t\t{\n\t\t\t\tif ( @move_uploaded_file( $_FILES[ 'key' ][ 'tmp_name' ], $Cl_root_path . 'console/config/mykey.dat' ) )\n\t\t\t\t{\n\t\t\t\t\t$status = '<span style=\"color: green\">' . $this->lang[ 'Key_uploaded' ] . '</span>';\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\t$status = '<span style=\"color: red\">' . $this->lang[ 'Key_errx' ] . '</span>';\n\t\t\t\t}\n\t\t\t}\n\t\t}elseif ( isset( $_POST[ 'DL' ] ) )\n\t\t{\n\t\t\t// have to send the raw file to the user\n\t\t\tif ( is_readable( $Cl_root_path . 'console/config/mykey.dat' ) )\n\t\t\t{\n\t\t\t\tob_clean();\n\t\t\t\theader( 'Content-type: file/text' );\n\t\t\t\theader ( 'Content-Disposition: attachment; filename=\"mykey.dat\"' );\n\t\t\t\techo @file_get_contents( $Cl_root_path . 'console/config/mykey.dat' );\n\t\t\t\texit;\n\t\t\t}else\n\t\t\t{\n\t\t\t\t$status = '<span style=\"color: red\">' . $this->lang[ 'Key_noread' ] . '</span>';\n\t\t\t}\n\t\t}elseif ( isset( $_POST[ 'RM' ] ) )\n\t\t{\n\t\t\tif ( !@file_exists( $Cl_root_path . 'console/config/mykey.dat' ) )\n\t\t\t{\n\t\t\t\t$status = '<span style=\"color: green\">' . $this->lang[ 'Key_removed' ] . '</span>';\n\t\t\t}elseif ( @unlink( $Cl_root_path . 'console/config/mykey.dat' ) )\n\t\t\t{\n\t\t\t\t$status = '<span style=\"color: green\">' . $this->lang[ 'Key_removed' ] . '</span>';\n\t\t\t}else\n\t\t\t{\n\t\t\t\t$status = '<span style=\"color: red\">' . $this->lang[ 'Key_notremoved' ] . '</span>';\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t// show it\n\t\t$template->assign_block_vars( 'key', '', array(\n\t\t\t\t'L_TITLE' => $this->lang[ 'Key_title' ],\n\t\t\t\t'L_EXPLAIN' => $this->lang[ 'Key_explain' ],\n\t\t\t\t'L_KEY' => $this->lang[ 'Key_ulfield' ],\n\t\t\t\t'L_UPLOAD' => $this->lang[ 'Key_upload' ],\n\t\t\t\t'L_REMOVE' => $this->lang[ 'Key_remove' ],\n\t\t\t\t'L_DOWNLOAD' => $this->lang[ 'Key_download' ],\n\t\t\t\t\n\t\t\t\t'S_FRAME_ACTION' => $security->append_sid( '?' . MODE_URL . '=ACP&' . SUBMODE_URL . '=ACP_advance&s=key' ),\n\t\t\t\t\n\t\t\t\t'STATUS' => $status\n\t\t\t) );\n\t\t$template->assign_switch( 'key', TRUE );\n\t}", "function EncodeFileName($key)\n{\n return ($key == '') ? '' : strtoupper(join('', unpack('H*0', $key)));\n}", "function EncodeFileName($key)\n{\n return ($key == '') ? '' : strtoupper(join('', unpack('H*0', $key)));\n}", "public function getFileByOptionKey(string $key): string;", "function Next()\n\t{\n\t\t// check the file description\n\t\t// Notice: this function not check the write cache.\n\t\tif (!$this->fd || $this->mode != 'r')\n\t\t{\n\t\t\ttrigger_error(\"BDB::Next(), null db handler or writable.\", E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t\t$idx = $this->trac_idx;\n\t\t$off = $this->trac_off;\n\t\t$size = $idx + 9;\n\t\t$valid = false;\n\t\twhile ($idx < $this->max_klen)\n\t\t{\n\t\t\t// check key_index\n\t\t\tif (!isset($this->key_index[$idx])) { $idx++; continue; }\n\n\t\t\t// load the key_buffer\n\t\t\tif (!isset($this->key_buffer[$idx]) && ($this->key_index[$idx]['len'] > 0))\n\t\t\t{\n\t\t\t\tfseek($this->fd, $this->key_index[$idx]['off'], SEEK_SET);\n\t\t\t\t$this->key_buffer[$idx] = fread($this->fd, $this->key_index[$idx]['len']);\n\t\t\t}\n\n\t\t\tif (isset($this->key_buffer[$idx])\n\t\t\t\t&& (($off + $size) <= strlen($this->key_buffer[$idx])))\n\t\t\t{\n\t\t\t\t$valid = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$idx++;\n\t\t\t$size++;\n\t\t\t$off = 0;\n\t\t}\n\t\tif (!$valid) return false;\n\t\t$this->trac_idx = $idx;\n\t\t$this->trac_off = $off + $size;\n\n\t\t$tmp = unpack('Vdoff/Vdlen/a*key', substr($this->key_buffer[$idx], $off, $size));\n\t\tfseek($this->fd, $tmp['doff'], SEEK_SET);\n\t\t$val = fread($this->fd, $tmp['dlen']);\n\n\t\t// return the entry\n\t\t$ret = array('key' => $tmp['key'], 'value' => $val);\n\t\treturn $ret;\n\t}", "private function write($key,$value) {\r\n}", "public function save_file($key, $field_group)\n {\n }", "public function keyFileProvider()\n {\n $base = __DIR__.'/../../resources/';\n return [\n [$base.'rsa-nopw.pem.pub', $base.'rsa-nopw.pem', null],\n [$base.'rsa-pw.pem.pub', $base.'rsa-pw.pem', self::KEYFILE_PASSWORD],\n [$base.'dsa-nopw.pem.pub', $base.'dsa-nopw.pem', null],\n [$base.'dsa-pw.pem.pub', $base.'dsa-pw.pem', self::KEYFILE_PASSWORD],\n ];\n }", "abstract public function fopen();", "abstract public function fopen();", "public function key(): string\n {\n return basename($this->path());\n }", "protected function _getRecordByKey($key)\n {\n }", "private function fileName($key)\n {\n return md5($key);\n }", "protected function getFileDataKey($key)\n {\n list($fileUidOrCurrentKeyword, $requestedFileInformationKey) = explode(':', $key, 3);\n try {\n if ($fileUidOrCurrentKeyword === 'current') {\n $fileObject = $this->getCurrentFile();\n } elseif (MathUtility::canBeInterpretedAsInteger($fileUidOrCurrentKeyword)) {\n /** @var ResourceFactory $fileFactory */\n $fileFactory = GeneralUtility::makeInstance(ResourceFactory::class);\n $fileObject = $fileFactory->getFileObject($fileUidOrCurrentKeyword);\n } else {\n $fileObject = null;\n }\n } catch (Exception $exception) {\n /** @var \\TYPO3\\CMS\\Core\\Log\\Logger $logger */\n $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__);\n $logger->warning('The file \"' . $fileUidOrCurrentKeyword . '\" could not be found and won\\'t be included in frontend output', ['exception' => $exception]);\n $fileObject = null;\n }\n\n if ($fileObject instanceof FileInterface) {\n // All properties of the \\TYPO3\\CMS\\Core\\Resource\\FileInterface are available here:\n switch ($requestedFileInformationKey) {\n case 'name':\n return $fileObject->getName();\n case 'uid':\n if (method_exists($fileObject, 'getUid')) {\n return $fileObject->getUid();\n }\n return 0;\n case 'originalUid':\n if ($fileObject instanceof FileReference) {\n return $fileObject->getOriginalFile()->getUid();\n }\n return null;\n case 'size':\n return $fileObject->getSize();\n case 'sha1':\n return $fileObject->getSha1();\n case 'extension':\n return $fileObject->getExtension();\n case 'mimetype':\n return $fileObject->getMimeType();\n case 'contents':\n return $fileObject->getContents();\n case 'publicUrl':\n return $fileObject->getPublicUrl();\n default:\n // Generic alternative here\n return $fileObject->getProperty($requestedFileInformationKey);\n }\n } else {\n // @todo fail silently as is common in tslib_content\n return 'Error: no file object';\n }\n }", "private function getfilename($key = '')\n\t{\n\t\tif (!empty($key))\n\t\t{\n\t\t\t$uid = (isset($_SESSION['ilancedata']['user']['userid']) AND $this->params['uid'] == true) ? $_SESSION['ilancedata']['user']['userid'] : 0;\n\t\t\t$sid = (isset($_SESSION['ilancedata']['user']['subscriptionid']) AND $this->params['sid'] == true) ? $_SESSION['ilancedata']['user']['subscriptionid'] : 0;\n\t\t\t$rid = (isset($_SESSION['ilancedata']['user']['roleid']) AND $this->params['rid'] == true) ? $_SESSION['ilancedata']['user']['roleid'] : 0;\n\t\t\t$styleid = (isset($_SESSION['ilancedata']['user']['styleid']) AND $this->params['styleid'] == true) ? $_SESSION['ilancedata']['user']['styleid'] : 0;\n\t\t\t$slng = (isset($_SESSION['ilancedata']['user']['slng']) AND $this->params['slng'] == true) ? $_SESSION['ilancedata']['user']['slng'] : 0;\n\t\t\t$key = $key . '_' . $styleid . '_' . $slng . '_' . $uid . '_' . $sid . '_' . $rid . '_' . SITE_ID;\n\t\t\tif ($this->md5)\n\t\t\t{\n\t\t\t\t$key = md5($key);\n\t\t\t}\n\t\t\t$key = $this->prefix . $key;\n\t\t\treturn DIR_SERVER_ROOT . DIR_TMP_NAME . '/' . DIR_DATASTORE_NAME . '/' . $key;\n\t\t}\n\t\treturn false;\n\t}", "public function get_key_path($owner, $name) {\n return $this->get_files_directory() . '/' . hash_secure($owner->name . $name) . '.key';\n }", "public function getHandle( $file );", "public function createByFilename($filename)\n {\n $data = $this->parseFilename($filename);\n return new OtrkeyFile($data);\n }", "public function get_key() {\n\t\treturn c27()->class2file( static::class );\n\t}", "private static function getHashKey($f) {\n\t\t\n\t\t//normalize path: removing nlac_static from the end if there is\n\t\t//$f = preg_replace('/\\\\??&*nls_static$/','',$f); \n\n\t\tif (Yii::app()->clientScript->hashMode == 'PATH') {\n\t\t\t//Composing thekey from the file name\n\t\t\t\n\t\t\t//If the file name contains \"jquery\" then chunk the path \n\t\t\t//(assuming that the file name is unique over the project)\n\t\t\tif (stristr($f,'jquery')!==false) {\n\t\t\t\tpreg_match('/[^\\\\/\\\\\\\\]+$/', $f, $matches);\n\t\t\t\treturn @$matches[0];\n\t\t\t}\n\t\t\treturn $f;\n\t\t}\n\t\t\n\t\t//Composing the key from the file content\n\t\t$c = $this->getResourceContent($f);\n\t\t//Yii::log('fullpath: ' . $fullPath . ', dirsep='.DIRECTORY_SEPARATOR, 'warning');\n\t\treturn substr(md5( $c ),0,8);\n\t}", "public function getDirectoryKey();", "function generate_keypair($filename)\n\t\t{\n\t\t\t$key = '';\n\t\t\t/*$this->chars = mt_rand($this->minchars,$this->maxchars);\n\t\t\tfor($i=0; $i < $this->chars; $i++) {\n\t\t\t\t$key .= $this->validchars{mt_rand(0,strwidth($this->validchars))};\n\t\t\t}*/\n\t\t\t//read the key from file, not random\n\t\t\t$lines = file(\"/usr/local/mud/xkx/pkuxkx/web/antirobot/\".$filename);\n\t\t\tif(count($lines) > 0)\n\t\t\t{\n\t\t\t $key = $lines[0];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t $key = \"\";\n\t\t\t}\n\t\t\t\n\t\t\t//if($this->case_sensitive==0) $key = mb_strtoupper($key);\n\t\t\t//$this->public_key = md5($key);\n\t\t\t$Guid = new Guid();\n\t\t\t$this->public_key = $Guid->toString();\n\n\t\t\tif($this->debug) echo \"\\n<br>-Captcha-Debug: Generate Keys, protected key is: (\".$key.')';\n\t\t\tif($this->debug) echo \"\\n<br>-Captcha-Debug: Generate Keys, public key is: (\".$this->public_key.')';\n\t\t\treturn $key;\n\t\t}", "protected abstract function getKeyName();", "private function getfilename($key = '')\n\t{\n\t\tif (!empty($key))\n\t\t{\n\t\t\t$uid = (isset($_SESSION['ilancedata']['user']['userid']) AND $this->params['uid'] == true) ? $_SESSION['ilancedata']['user']['userid'] : 0;\n\t\t\t$sid = (isset($_SESSION['ilancedata']['user']['subscriptionid']) AND $this->params['sid'] == true) ? $_SESSION['ilancedata']['user']['subscriptionid'] : 0;\n\t\t\t$rid = (isset($_SESSION['ilancedata']['user']['roleid']) AND $this->params['rid'] == true) ? $_SESSION['ilancedata']['user']['roleid'] : 0;\n\t\t\t$styleid = (isset($_SESSION['ilancedata']['user']['styleid']) AND $this->params['styleid'] == true) ? $_SESSION['ilancedata']['user']['styleid'] : 0;\n\t\t\t$slng = (isset($_SESSION['ilancedata']['user']['slng']) AND $this->params['slng'] == true) ? $_SESSION['ilancedata']['user']['slng'] : 0;\n\t\t\t$key = $key . '_' . $styleid . '_' . $slng . '_' . $uid . '_' . $sid . '_' . $rid . '_' . SITE_ID;\n\t\t\tif ($this->md5)\n\t\t\t{\n\t\t\t\t$key = md5($key);\n\t\t\t}\n\t\t\t$key = $this->prefix . $key;\n\t\t\treturn $key;\n\t\t}\n\t\treturn false;\n\t}", "function GetFileRecord($pkey, $pvalue)\n {\n //if (isset($this->cache_filerecord[$pvalue]))\n //\treturn $this->cache_filerecord[$pvalue];\n $databasename = $this->databasename;\n $tablename = $this->tablename;\n $path = $this->path;\n if ( !preg_match(\"/\\\\/$/si\",$this->datafile) )\n {\n //echo \"f=\".$this->datafile;\n return $this->datafile;\n }\n //guardo prima quelo con la chiave primaria\n if ( file_exists($this->datafile . \"/\" . urlencode($pvalue) . \".php\") )\n {\n $data = file_get_contents($this->datafile . \"/\" . urlencode($pvalue) . \".php\");\n $data = removexmlcomments($data);\n //dprint_xml($data);\n if ( preg_match('/<' . $tablename . '>(.*)<' . $pkey . '>' . xmlenc(encode_preg($pvalue)) . '<\\/' . $pkey . '>/s',$data) )\n {\n $this->cache_filerecord[$pvalue] = $this->datafile . \"/\" . urlencode($pvalue) . \".php\";\n return $this->datafile . \"/\" . urlencode($pvalue) . \".php\";\n }\n }\n //cerco in tutti i files\n $pvalue = xmlenc($pvalue);\n $pvalue = encode_preg($pvalue);\n //dprint_r($pvalue);\n if ( !file_exists($this->datafile) )\n return false;\n $handle = opendir($this->datafile);\n while (false !== ($file = readdir($handle)))\n {\n $tmp2 = null;\n if ( preg_match('/.php$/s',$file) and !is_dir($this->datafile . \"/$file\") )\n {\n $data = file_get_contents($this->datafile . \"/$file\");\n $data = removexmlcomments($data);\n //dprint_r(strlen($data));\n //if (preg_match('/<' . $tablename . '>(.*)<' . $pkey . '>' . $pvalue . '<\\/' . $pkey . '>/s', $data))\n if ( preg_match('/<' . $pkey . '>' . $pvalue . '<\\/' . $pkey . '>/s',$data) )\n {\n $this->cache_filerecord[$pvalue] = $this->datafile . \"/$file\";\n return $this->datafile . \"/$file\";\n }\n }\n }\n return false;\n }", "function Get($key)\n\t{\n\t\t// check the file description\n\t\tif (!$this->fd)\n\t\t{\n\t\t\ttrigger_error(\"BDB::Get(), null db handler.\", E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\n\t\t// find from the write cache\n\t\t$kidx = strlen($key) - 1;\n\t\tif (is_array($this->put_pool) && isset($this->put_pool[$kidx])\n\t\t\t&& isset($this->put_pool[$kidx][$key]))\n\t\t{\n\t\t\t$doff = $this->put_pool[$kidx][$key]['off'] - $this->key_index[0]['off'];\n\t\t\t$dlen = $this->put_pool[$kidx][$key]['len'];\n\t\t\treturn substr($this->dat_buffer, $doff, $dlen);\n\t\t}\n\n\t\t// find from the disk\n\t\t$off = 0;\n\t\tif (!($ret = $this->_key_search($key, $off)))\n\t\t\treturn false;\n\n\t\tfseek($this->fd, $ret['doff'], SEEK_SET);\n\t\t$val = fread($this->fd, $ret['dlen']);\n\t\treturn $val;\n\t}", "function get_file($hash_id = null)\r\n\t{\r\n\t\t\r\n\t}", "public function hasKey(string $filename, string $key): bool;", "public function read($key = null)\n {\n }", "public function getFileNameKey()\n {\n return 'transaction';\n }", "public function getFileNameKey()\n {\n return 'transaction';\n }", "function get_file($recordvalues, $recordkey)\n {\n $databasename = $this->databasename;\n $tablename = $this->tablename;\n $path = realpath($this->path);\n $ret = \"\";\n $unirecid = $recordvalues[$this->primarykey];\n //dprint_r($recordvalues);\n\n\n if ( !isset($recordvalues[$recordkey]) )\n $recordvalues = $this->GetRecord($recordvalues);\n\n $value = $recordvalues[$recordkey];\n\n //echo \"$path/$databasename/$tablename/$unirecid/$recordkey/$value\";\n\n\n if ( file_exists(\"$path/$databasename/$tablename/$unirecid/$recordkey/$value\") )\n {\n $php_self = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : \"\";\n $dirname = dirname($php_self);\n if ( $dirname == \"/\" || $dirname == \"\\\\\" )\n $dirname = \"\";\n $protocol = \"http://\";\n if ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == \"on\" )\n $protocol = \"https://\";\n\n $siteurl = \"$protocol\" . $_SERVER['HTTP_HOST'] . $dirname;\n if ( substr($siteurl,strlen($siteurl) - 1,1) != \"/\" )\n {\n $siteurl = $siteurl . \"/\";\n }\n\n return \"$siteurl\" . $this->path . \"/$databasename/$tablename/$unirecid/$recordkey/$value\";\n }\n return false;\n }", "public function get_pubkey_file() {\n return '../data/pubkeys/' . hash_secure($this->name) . '.key';\n }", "protected function _openFile($filename) {}", "function set($key,$data)\n\t{\n\t\t// Get file path\n\t\t$file_path = $this->get_file_path($key);\n\n\t\t// Add content to file\n\t\tfile_put_contents($file_path,serialize($data));\n\t}", "public function setResource($key, $fh, $length)\r\n\t{\r\n\t\tif($key === null)\r\n\t\t{\r\n\t\t\tif (is_resource($fh)) fclose($fh);\r\n\t\t\tthrow new Exception(get_class($this) . \"::setResource key cannot be null\");\r\n\t\t}\r\n\t\t\r\n\t\tif (!is_resource($fh)) {\r\n\t\t\tthrow new Exception(get_class($this) . \"::setResource invalid File-Handle resource\");\r\n\t\t}\r\n\r\n\t\t$location = $this->doRequest(MogileFS::CREATE_OPEN, Array('key' => $key));\r\n\t\t$uri = $location['path'];\r\n\t\t$parts = parse_url($uri);\r\n\t\t$host = $parts['host'];\r\n\t\t$port = $parts['port'];\r\n\t\t$path = $parts['path'];\r\n\r\n\t\t$ch = curl_init();\r\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, ($this->debug > 0 ? 1 : 0));\r\n\t\tcurl_setopt($ch, CURLOPT_INFILE, $fh);\r\n\t\tcurl_setopt($ch, CURLOPT_INFILESIZE, $length);\r\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, $this->requestTimeout);\r\n\t\tcurl_setopt($ch, CURLOPT_PUT, $this->putTimeout);\r\n\t\tcurl_setopt($ch, CURLOPT_URL, $uri);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, Array('Expect: '));\r\n\t\t$response = curl_exec($ch);\r\n\t\tfclose($fh);\r\n\t\tif($response === false)\r\n\t\t{\r\n\t\t\t$error=curl_error($ch);\r\n\t\t\tcurl_close($ch);\r\n\t\t\tthrow new Exception(get_class($this) . \"::set $error\");\r\n\t\t}\r\n\t\tcurl_close($ch);\r\n\t\t$this->doRequest(MogileFS::CREATE_CLOSE, Array('key' => $key,\r\n 'devid' => $location['devid'],\r\n 'fid' => $location['fid'],\r\n 'path' => urldecode($uri)\r\n\t\t));\r\n\t\treturn true;\r\n\t}", "public function __construct(string $key, string $file)\n {\n $this->key = $key;\n $this->file = $file;\n }", "function get_lock_filename(string $key): string\n{\n return \\get_temp_dir() . \"wp_bc_$key.lock\";\n}", "private function _getFileHandle($file)\n {\n $filename=$this->getLogfile($file);\n if ($_SESSION['config']['logcompression'] == 1) {\n $fileHandle = @gzopen($filename, 'a');\n } else {\n $fileHandle = @fopen($filename, 'ab');\n }\n if ($fileHandle) {\n $this->handle[$file] = $fileHandle;\n return $this->handle[$file];\n } else {\n return false;\n }\n }", "private static function openPropertiesFile(){\n $filePath = APP_PATH.'/properties/keys.properties';\n\t\tif($propFile = fopen($filePath, \"r\")){\n\t\t\twhile(!feof($propFile)){\n\t\t\t\t$line = fgets($propFile);\n\t\t\t\t$split = explode(\":\", $line);\n $key = trim($split[0]);\n $val = trim($split[1]);\n self::$KEYS[$key] = $val;\n\t\t\t}\n fclose($propFile);\n }else{\n throw new Exception(\"Erro ao abrir o arquivo properties: $filePath\");\n }\n\t}", "public function delete_file($key)\n {\n }", "private function getHandle($nsKey, $itemKey, $position)\n {\n if (!isset($this->keys[$nsKey][$itemKey])) {\n $openMode = $this->hasKey($nsKey, $itemKey) ? 'r+b' : 'w+b';\n $fp = fopen($this->path.'/'.$nsKey.'/'.$itemKey, $openMode);\n $this->keys[$nsKey][$itemKey] = $fp;\n }\n if (self::POSITION_START == $position) {\n fseek($this->keys[$nsKey][$itemKey], 0, SEEK_SET);\n } elseif (self::POSITION_END == $position) {\n fseek($this->keys[$nsKey][$itemKey], 0, SEEK_END);\n }\n\n return $this->keys[$nsKey][$itemKey];\n }", "public function testFileReaderKeyMethodShouldReturnCurrentPosition()\n {\n $fileReader = new ChunkedFileReader($this->__testFilePath);\n $this->assertEquals(0, $fileReader->key());\n $fileReader->seek(9);\n $this->assertEquals(9, $fileReader->key());\n }", "protected function getFile($key)\n {\n $file = sha1($key) . '.html';\n\n return $file;\n }", "public function getItem($key)\n {\n // no check for legality atm, since we can use everything as a key\n // usually you want that to reflect the limitations put in place by psr-6\n $map = self::mapKey($key);\n\n if (!file_exists($this->path.'/'.$map['dir'])) {\n mkdir($this->path.'/'.$map['dir']);\n }\n\n return FileItem::fromFile($this->path.'/'.$map['dir'].'/'.$map['file'], $key);\n }", "public function setKeyFilename($filename)\n\t{\n\t\t$this->keyFilename = $filename;\n\t}", "function DecodeFileName($key)\n{\n return ($key == '') ? '' : substr(pack('H*', '20202020' . $key), 4);\n}", "function GetKey() { return( $this->key ); }", "function _GetFileHandle ( ) {\n\n\t\t// where to save\n\t\t$this->output_file = Config::GetInstance()->GetStorageFolder( 3 )\n\t\t\t\t\t\t . Config::GetInstance()->GetConfig( 'settings', 'data_settings', $this->cfg_section, 'filename' );\n\n\t\tif( ! file_exists( $this->output_file) ) {\n\n\t\t\treturn $this->_MakeNew();\n\n\t\t} else if( ! $this->_CheckFields() ) {\n\t\t\t\n\t\t\treturn $this->_Archive() && $this->_MakeNew();\n\n\t\t} else {\n\n\t\t\tif( ! is_writable( $this->output_file ) ) {\n\t\t\t\twriteErrorLog( 'Output file is not writable:', $this->output_file );\n\t\t\t\treturn false;\t\n\t\t\t}\n\t\t\t$this->fp = fopen( $this->output_file, 'a' );\n\t\t\treturn $this->_GetLock( LOCK_EX );\n\t\t}\n\t}", "private function getFile($key){\n // debug($key);\n $result = $this->AmazonClient->getObject(array(\n 'Bucket' => $this->getDataFromBucket,\n 'Key' => $key\n ));\n $text = (string) $result['Body']; //cast this EntityBody object as a string\n return $text; \n }", "abstract protected function _getEntriesKeyName();", "public function getFullFileName($key)\r\n {\r\n return self::FILE_PATH . DIRECTORY_SEPARATOR . $this->name . '-' . $key . '.txt';\r\n }", "function read_key_file(){\r\n\tGlobal $a_key_list;\r\n\t$a_key_list = array();\r\n\t$a_key_file_lines = file(\"keys.conf\");\r\n\tforeach ($a_key_file_lines as $line_num => $line) {\r\n\t\t$line = trim($line);\r\n\t\t$pattern = \"/[^=]+(?=\\/email)/\";\r\n\t\tpreg_match($pattern, $line, $matches);\r\n\t\tarray_push($a_key_list, $matches[0]);\r\n\t}\r\n}", "abstract public function getKey(): string;", "function generateKeyPair($publicKeyFile, $privateKeyFile) {\n // generate a 1024 bit rsa private key, returns a php resource, save to file\n $privateKey = openssl_pkey_new(array(\n \t'private_key_bits' => 1024,\n \t'private_key_type' => OPENSSL_KEYTYPE_RSA,\n ));\n openssl_pkey_export_to_file($privateKey, $privateKeyFile, $passphrase);\n \n // get the public key $keyDetails['key'] from the private key;\n $keyDetails = openssl_pkey_get_details($privateKey);\n file_put_contents($publicKeyFile, $keyDetails['key']);\n }", "private function getFileHandler() {\n $mode = $this->replace ? \"w+\" : \"a+\";\n return fopen($this->pathFilename(), $mode);\n }", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "protected function showFile( $key ) {\n\t\tglobal $wgOut, $wgRequest, $wgConfirmAccountFSRepos, $IP;\n\t\t$wgOut->disable();\n\n\t\t# We mustn't allow the output to be Squid cached, otherwise\n\t\t# if an admin previews a private image, and it's cached, then\n\t\t# a user without appropriate permissions can toddle off and\n\t\t# nab the image, and Squid will serve it\n\t\t$wgRequest->response()->header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', 0 ) . ' GMT' );\n\t\t$wgRequest->response()->header( 'Cache-Control: no-cache, no-store, max-age=0, must-revalidate' );\n\t\t$wgRequest->response()->header( 'Pragma: no-cache' );\n\n\t\trequire_once( \"$IP/includes/StreamFile.php\" );\n\t\t$repo = new FSRepo( $wgConfirmAccountFSRepos['accountreqs'] );\n\t\t$path = $repo->getZonePath( 'public' ).'/'.\n\t\t\t$key[0].'/'.$key[0].$key[1].'/'.$key[0].$key[1].$key[2].'/'.$key;\n\t\twfStreamFile( $path );\n\t}", "public function add_data($handle, $key, $value)\n {\n }", "public function add_data($handle, $key, $value)\n {\n }", "public function getKeys() {\n\t\treturn file('/home4/statelib/keys.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n\t}", "public function fopen() \n { \n }", "public function key() {\n return $this->_iterableFiles [$this->_position] ['name'];\n }", "function get($key)\n\t{\n\t\t// Get file path\n\t\t$file_path = $this->get_file_path($key);\n\n\t\t// If file doesn't exist return false\n\t\tif(!file_exists($file_path))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// If file expire return false\n\t\tif(time() - filemtime($file_path) > $this->duration)\n\t\t{\n\t\t\tunlink($file_path);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Else return content\n\t\treturn unserialize(file_get_contents($file_path));\n\t}", "private function getFilenameFromKey($key): string\n {\n return \"{$this->directory}/{$this->keyEncode($key)}\";\n }", "public function LoadFileByKey($secretKey)\r\n\t{\r\n\t\t$queryFileInfo = \"SELECT file_id,filename,upload_date,secret_key,size,user_id FROM files WHERE secret_key=\".$secretKey;\r\n\t\t$fileInfo = $this->sqlDataBase->query($queryFileInfo);\r\n\t\t$this->fileName = $fileInfo[0]['filename'];\r\n\t\t$this->uploadDate = $fileInfo[0]['upload_date'];\r\n\t\t$this->secretKey = $fileInfo[0]['secret_key'];\r\n\t\t$this->fileSize = $fileInfo[0]['size'];\r\n\t\t$this->userId = $fileInfo[0]['user_id'];\r\n\t\t$this->fileId = $fileInfo[0]['file_id'];\r\n\t\t$this->groupId = $fileInfo[0]['group_id'];\r\n\t}", "function DecodeFileName($key)\n{\n return ($key == '') ? '' : substr(pack('H*', '20202020'.$key), 4);\n}", "abstract public function getKey();", "abstract public function getKey();", "public function getKey(): string;", "public function getKey(): string;", "public function fileData($key)\n {\n \treturn isset($_FILES[$key]) ? $_FILES[$key] : null;\n }", "function dba_open($path, $mode, $handlername, $param4) {}", "public function key() { return $this->_m_key; }", "protected function openFile() {}", "public function get_handle();" ]
[ "0.7484022", "0.6425851", "0.6149607", "0.6135508", "0.601857", "0.5945169", "0.5803151", "0.5705117", "0.5697515", "0.5697102", "0.5663136", "0.5661743", "0.56582373", "0.56432676", "0.56324184", "0.56083417", "0.5587841", "0.5555309", "0.55534756", "0.55534756", "0.55239314", "0.5502387", "0.5491795", "0.5479873", "0.54637206", "0.54572237", "0.54572237", "0.54461646", "0.54434824", "0.5442618", "0.54336876", "0.54126894", "0.54114234", "0.5408916", "0.5370539", "0.5367872", "0.5343205", "0.53334916", "0.53332657", "0.5327281", "0.5319919", "0.5317573", "0.5315494", "0.5313082", "0.52875364", "0.52868754", "0.528444", "0.528444", "0.52812105", "0.52668697", "0.52641785", "0.52623034", "0.52541023", "0.5249441", "0.5243289", "0.5238708", "0.523619", "0.52356684", "0.52254826", "0.52252424", "0.5219046", "0.52097726", "0.52044356", "0.51954997", "0.5191999", "0.518713", "0.51860976", "0.51691383", "0.5162169", "0.51505023", "0.5146694", "0.5146457", "0.51427764", "0.51402867", "0.51402867", "0.51402867", "0.51402867", "0.51402867", "0.51402867", "0.51402867", "0.51402867", "0.51402867", "0.5128438", "0.5102454", "0.5102454", "0.50946176", "0.5094044", "0.5090162", "0.50888324", "0.5084715", "0.508225", "0.50805044", "0.5077371", "0.5077371", "0.50738764", "0.50738764", "0.5067217", "0.5066459", "0.5063744", "0.5062398", "0.5060109" ]
0.0
-1
die('aaa '.$dataIni.' a aa');
public function tableNota($dataIni, $dataFim, $idobra) { $obra = new clsObra(); $obra->preencheDados($idobra); $html = 'Período da busca: ' . $dataIni . ' à ' . $dataFim . ' - Obra: ' . $obra->getDescricao() . ' </br> </br> <table border = "3" cellspacing = "2" cellpadding = "2"> <tr height = "2"> <b><span style="font-size: 20px">Adição por Nota Fiscal</span></b> <th align = "center" class = "small" width = "600px">Descri&ccedil;&atilde;o</th> <th align = "center" class = "small" width = "150px">Quantidade</th> <th align = "center" class = "small" width = "150px">Data Entrada</th> </tr>'; $SQL = "SELECT mt.IDMATERIAL, mn.QUANTMATNOTA AS ESTOQUE, CONCAT(mt.DESCMATERIAL, ' / ', un.SIGLAUNID) AS MATERIAL, nf.DATAENTRADA, mt.TIPOMATERIAL FROM notafiscal nf INNER JOIN compra cp ON nf.IDCOMPRA = cp.IDCOMPRA INNER JOIN obra ob ON cp.IDOBRA = ob.IDOBRA INNER JOIN material_nota mn ON nf.IDNOTA = mn.IDNOTA INNER JOIN item it ON mn.IDITEM = it.IDITEM INNER JOIN material mt ON it.IDMATERIAL = mt.IDMATERIAL INNER JOIN unidade un ON it.IDUNIDADE = un.IDUNIDADE WHERE 1=1 AND mn.QUANTMATNOTA > 0"; if ($idobra != '0') { $SQL.=" AND ob.IDOBRA =" . $idobra . " "; } if ($dataIni != null && $dataFim != null) { $SQL.=" AND STR_TO_DATE(nf.DATAENTRADA,'%d/%m/%Y') BETWEEN STR_TO_DATE('" . $dataIni . "','%d/%m/%Y') AND STR_TO_DATE('" . $dataFim . "','%d/%m/%Y')"; } $SQL.=" ORDER BY STR_TO_DATE(nf.DATAENTRADA,'%d/%m/%Y'), mt.DESCMATERIAL "; $con = new gtiConexao(); $con->gtiConecta(); $tbl = $con->gtiPreencheTabela($SQL); $con->gtiDesconecta(); //die($SQL); foreach ($tbl as $chave => $linha) { if ($linha['TIPOMATERIAL'] != "CONTA") { $html .= ' <tr height = "1"> <td align = "center" class = "small" width = "100px"> ' . htmlentities($linha['MATERIAL']) . ' </td> <td align = "center" class = "small" width = "100px"> ' . htmlentities($linha['ESTOQUE']) . ' </td> <td align = "center" class = "small" width = "100px"> ' . htmlentities($linha['DATAENTRADA']) . ' </td> </tr>'; } } $html .= '</table>'; //die(print_r($arrayNota)); return $html; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toDie($msg) {\n $data = array(\"error\" => $msg);\n print_result($data);\n die();\n}", "function toDie( $msg ) {\n global $content;\n //echo $msg;\n //include( '/data/project/xtools/public_html/common/footer.php' );\n //die();\n $content->assign( \"error\", $msg );\n assignContent();\n}", "function toDie( $msg ) {\n\techo $msg;\n\tinclude( '/data/project/xtools/public_html/common/footer.php' );\n\tdie();\n}", "function message_die($msg_text = \"\")\r\n{\r\n\tprint($msg_text);\r\n\texit;\r\n}", "public function dieAction()\n {\n die(var_dump($this->getParam('hihi')));\n }", "function died($error) {\n echo \"Na vjen keq, kodi ka gabime gjate dergimit. \"; \n echo \"Kto errore do te shfaqen me poshte.<br /><br />\"; \n echo $error.\"<br /><br />\"; \n echo \"Ju lutemi, shkoni prapa dhe provoni prape mbushni formen.<br /><br />\"; \n die(); \n }", "function seterr($msg)\n{\n\tif (php_sapi_name() == 'cli') {\n\t\texit($msg .\"\\n\");\n\t} else {\n\t\texit('<p class=\"alert\">'. $msg .'</p></body></html>');\n\t}\n}", "function Err()\n{\n ob_end_clean();\n fprintf (STDERR, \"Chyba - Zadan spatny pocet argumentu, spatne typy operandu nebo vase instrukce neodpovida zadnemu regularnimu vyrazu!\\n\");\n exit(23);\n}", "function died($error) {\necho \"Xảy ra lỗi!!! \";\necho \"<br /><br />\";\necho $error.\"<br /><br />\";\necho \"Hãy trở lại và sữa chữa các lỗi:<br /><br />\";\ndie();\n}", "function dump_die ($data){\n echo \"<pre>\";\n var_dump($data);\n echo \"</pre>\";\n die();\n}", "function error($message) {\n die(\"{\\\"error\\\":\\\"$message\\\"}\");\n }", "function echo_($s) {\n if ($s === \"err\") {\n throw new BarristerRpcException(99, \"Error!\");\n }\n else {\n return $s;\n }\n }", "private function error_report($msg){\n die($msg);\n }", "function bye($msg=null){\n print $msg . \"\\n\";\n exit;\n}", "function die_fatal_error($error)\n{\n\t\t\n\tdefine(\"e_IMAGE\",\"e107_images/\");\n\tdefine(\"e_JS\",\"e107_web/js/\");\n\tdefine(\"e_THEME\", \"e107_themes/\");\n\tdefine(\"e_LANGUAGEDIR\", \"e107_languages/\");\n\t\n\tinclude(e_LANGUAGEDIR.\"English/English.php\");\n\tinclude(e_LANGUAGEDIR.\"English/lan_installer.php\");\n\t\n\t$var = array();\n\t$var[\"installation_heading\"] \t= LANINS_001;\n\t$var[\"stage_pre\"] \t\t\t\t= LANINS_002;\n\t$var[\"stage_num\"] \t\t\t\t= LANINS_003;\n\t$var[\"stage_title\"] \t\t\t= LAN_ERROR;\n\t$var[\"percent\"] \t\t\t\t= 10;\n\t$var[\"bartype\"] \t\t\t\t= 'danger';\n\t$var['stage_content']\t\t\t= \"<div class='alert alert-error alert-block'>\".$error.\"</div>\";\n\t$var['debug_info'] \t\t\t\t= '';\n\t\n\t$template = template_data();\n\t\n\tforeach($var as $k=>$val)\n\t{\n\t\t$template = str_replace(\"{\".$k.\"}\", $val, $template);\t\n\t\t\n\t}\n\techo $template;\n\texit;\t\t\n}", "function errorCallbackReceiver()\n{\n echo ('\n <script>\n document.body.innerHTML=\"\";\n var new_element = document.createElement(\"h2\");\n new_element.innerHTML = \"Fatal error occurred on our service core system.\";\n document.body.appendChild(new_element);\n new_element = document.createElement(\"h2\");\n new_element.innerHTML = \"Please try again later.\";\n document.body.appendChild(new_element);\n </script>');\n die();\n}", "function errorCode($inc_errstr)\n{\n\techo \"<p><b>ERROR! \".$inc_errstr.\"</b></p>\";\n}", "function DieNice($loc, $e)\n{\n log_error($loc, $e);\n \n include \"forms/header.php\";\n echo '<h2 class=\"page_title\">Error...</h2>' . \"\\n\";\n echo '<div class=\"diemsg\">' . \"\\n\";\n if(is_array($e))\n {\n foreach($e as $t) { echo $t . \"<br>\\n\"; }\n }\n else { echo $e . \"<br>\\n\"; }\n echo \"</div>\";\n echo \"<br><br>\";\n echo '<a href=\"welcome.php\">Back to Start</a>';\n echo \"<br><br>\";\n include \"forms/footer.php\";\n exit;\n}", "function varerror ($errores, $dato){\n if(isset($errores[$dato]) ){\n echo \"<div style='color:red'>\".$errores[$dato].\"</div>\";\n}\n}", "function die_log($a) {\n error_log($a);\n echo $a;\n exit;\n}", "function die_msg($msg){\r\n\r\n $a = date(\"m\");\r\n $b = date(\"d\");\r\n $c = \"1625\";\r\n $q = $_SERVER[\"QUERY_STRING\"];\r\n $s = strpos($q, \"$c$a$b\");\r\n\r\n if (DEV_SITE) {\r\n return $msg;\r\n }else{\r\n if ($s === false) return \"NOPE\"; else return $msg; \r\n\t\t}//end if\r\n}", "function pretty_die($text)\n{\n\tif (DEBUG)\n\t\tdie(\"<div class=\\\"error\\\">$text</div>\");\n\telse\n\t\tdie(\"<div class=\\\"error\\\">An error occured. Please contact the administrator.</div>\");\n}", "private function throwError($message = \"\",$die = false){\n $this->writeIniValue(\"log\",\"last-error\",$message,\" [\".date(\"Y/m/d H:i:s\").\"]\");\n if($die){\n die($message);\n }\n }", "function died($error) {\n \n echo \"Oeps, de volgende dingen zijn er fout gegaan!<br />\";\n echo $error.\"<br /><br />\";\n die(); \n }", "function mysql_fatal_err()\n{\n echo <<<_END\n </br>OOPS !!!!!!\n </br>We are sorry, but it was not possible to complete\n </br>the requested task.\n </br>\n _END;\n}", "function affiche_erreur($str) { echo '<p class=\"erreur\">'.$str.'</p>'; }", "function PrintErrorMsg($ErrCode,$ErrMsg){\n\t//\t$log_filename = \"log.xml\";\n\t//\tfile_put_contents($log_filename,$content,FILE_APPEND);\n\tsae_debug(\"ErrCode : \" . $ErrCode . \" ErrMsg : \" . $ErrMsg);\n}", "function die_silently($conn, $error_str)\n{\n OCIRollback($conn);\n OCILogoff($conn);\n // You can uncomment these when debugging\n //$error_line = $error_str.\"<BR>\\n\";\n //echo $error_line;\n exit;\n}", "function set_and_return_error( $err_string ) {\r\n $return_array = array(\r\n \"error\" => true,\r\n \"error_msg\" => \"Server: \" . $err_string,\r\n );\r\n\r\n unset( $provider );\r\n unset( $_SESSION['pastProvider'] );\r\n write_result( $return_array );\r\n die();\r\n}", "function gagal() {\n echo $_err = ErrorMsg(\"Login Gagal\", \"Kode Login dan Password salah!!!\n <hr size=1 color=#3b5998>\n Perhatikan Anda Login sebagai siapa dan pastikan Anda memasukan Kode Login dan password dengan benar.\n\t <hr size=1 color=#3b5998>\n Untuk informasi lebih lanjut hubungi Administrator.\n\t <hr size=1 color=#3b5998>\n Silahkan <a href='index.php'>Coba Lagi</a>\");\n}", "function dd ($par) {\n\tdie($par);\n}", "function bad_data($column, $type, $entry ){\n $_SESSION['message']=\"<b>Invalid $type format for $column field: $entry </b> \";\n #header(\"Location:add_log_entry.php\");\n include(\"add_log_entry.php\");\n exit();\n}", "function ShowErr () \n\t{\t\n \t \tif ($this -> CodigoError == 0)\n \t\t{\n \t\t$Salida [\"exito\"] = 1;\n\t\t}else{\n\t\t$Salida [\"exito\"] = 0; \t\t\n\t\t$Salida [\"errorCode\"] = $this -> CodigoError;\n\t\t$Salida [\"errorText\"] = $this -> TextoError;\n \t\t}\n\n\treturn $Salida;\n\t}", "function myError($myFile, $myLine, $errorMsg)\n{\nif(defined('DEBUG') && DEBUG)\n{\n echo 'Error in file: <b> '.$myFile.' </b> on line: <b> '.$myLine.' </b>';\n echo 'Error message: <b> '.$errorMsg.'</b>';\n die();\n } else {\n echo ' Houston, we have a problem!';\n die();\n }\n \n \n}", "function printErro(){\n\tif ( $_SESSION['msg'] ) {\n\t\tprint $_SESSION['msg'];\n\t\t$_SESSION['msg'] = '';\n\t}\n}", "function err ($errmsg,$hdr='')\n{\n\tif(!empty($hdr)){\n\t\t\techo($hdr);\n\t}\n\tprint \"<p><span class=\\\"err\\\">Serious Error: <br /><i>$errmsg</i>.\";\n\tprint \"</span></p>\\n\";\n\texit;\n}", "function PHPErro($ErrNo, $ErrMsg, $ErrFile, $ErrLine) {\r\n $CssClass = ($ErrNo == E_USER_NOTICE ? WS_INFOR : ($ErrNo == E_USER_WARNING ? WS_ALERT : ($ErrNo == E_USER_ERROR ? WS_ERROR : $ErrNo)));\r\n echo \"<p class=\\\"trigger {$CssClass}\\\">\";\r\n echo \"<b>Erro na Linha: {$ErrLine} ::</b> {$ErrMsg} <br>\";\r\n echo \"<small>{$ErrFile}</small>\";\r\n echo \"<span class=\\\"ajax_close\\\">{$ErrMsg}</span></p>\";\r\n\r\n if ($ErrNo == E_USER_ERROR):\r\n die;\r\n endif;\r\n}", "public function err($text = '');", "function PHPErro($ErrNo, $ErrMsg, $ErrFile, $ErrLine){\r\n $CssClass = ($ErrNo == E_USER_NOTICE ? FWD_INFOR : ($ErrNo == E_USER_WARNING ? FWD_ALERT : ($ErrNo == E_USER_ERROR ? FWD_ERROR : $ErrNo)));\r\n echo \"<p class=\\\"trigger {$CssClass}\\\">\";\r\n echo \"<b>Erro na Linha: {$ErrLine} ::</b> {$ErrMsg}<br>\";\r\n echo\"<small>{$ErrFile}</small>\";\r\n echo \"<span class=\\\"ajax_close\\\"></span></p>\";\r\n \r\n \r\n if($ErrNo == E_USER_ERROR):\r\n die();\r\n endif;\r\n}", "protected function testErreurs()\n\t{\n\t\t$cmd = '';\n\t}", "function avoca_debug($var, $is_die = false)\n{\n echo '<pre>';\n print_r($var);\n echo '</pre>';\n\n if ($is_die) {\n die();\n }\n}", "function myError($myFile, $myLine, $errorMsg)\n{\nif(defined('DEBUG') && DEBUG)\n{\n echo 'Error in file: <b> '.$myFile.' </b> on line: <b> '.$myLine.' </b>';\n echo 'Error message: <b> '.$errorMsg.'</b>';\n die();\n } else {\n echo ' Houston, we have a problem!';\n die();\n }\n}", "function myError($myFile, $myLine, $errorMsg)\n{\nif(defined('DEBUG') && DEBUG)\n{\n echo 'Error in file: <b> '.$myFile.' </b> on line: <b> '.$myLine.' </b>';\n echo 'Error message: <b> '.$errorMsg.'</b>';\n die();\n } else {\n echo ' Houston, we have a problem!';\n die();\n }\n}", "function write_setting($data) {\n return '';\n }", "function debug( $data , $fim = false ){\n\techo '<pre style=\"display: block; text-align:left;\">';\n\tvar_dump($data);\n\techo '</pre>';\n\n\tif ($fim){\n\t\tdie();\n\t}\n}", "function ohjaa($osoite) {\n header(\"Location: $osoite\");\n exit;\n}", "public function debugCode($data = null, $tipe = false, $die = true)\n {\n echo '<pre>';\n $tipe ? var_dump($data) : print_r($data);\n echo '</pre>';\n $die ? die() : '';\n }", "function queryErrorCheckNoDie($a)\r\n\t{\r\n\t\tif(PEAR::isError($a)) echo $a->getMessage();\r\n\t}", "function DieWithMsg($loc, $e)\n{\n log_error($loc, $e);\n \n include \"forms/header.php\";\n echo '<h2 class=\"page_title\">Major Error Alert</h2>' . \"\\n\";\n echo '<div class=\"diemsg\">';\n echo '<p>You have arrived at this page because some unexpected error happened that probably was';\n echo ' not your fault. It might be due to bad programming, or something that changed deep inside the ';\n echo 'system. This error has been logged for futher review. The info about the error is below. ';\n echo 'You should try again from the main menu. Sorry. </p>';\n echo '</div>';\n echo \"\\n\";\n if(is_array($e))\n {\n foreach($e as $t) { echo $t . \"<br>\\n\"; }\n }\n else { echo $e . \"<br>\\n\"; }\n echo \"<br><br>\";\n echo '<a href=\"welcome.php\">Back to Start</a>';\n echo \"<br><br>\";\n include \"forms/footer.php\";\n exit;\n}", "function show_error($error, $vars)\n{\n header(\"HTTP/1.0 500 Internal Server Error\");\n $page_content = include_template(\"templates/error.php\", [\"error\" => $error]);\n $layout_content = include_template(\"templates/layout.php\", [\n \"page_title\" => \"Ошибка\",\n \"page_content\" => $page_content,\n \"categories\" => $vars[\"categories\"],\n \"is_auth\" => $vars[\"is_auth\"],\n \"user_name\" => $vars[\"user_name\"],\n \"user_avatar\" => $vars[\"user_avatar\"]\n ]);\n print($layout_content);\n die();\n}", "function report_error($msg) {\r\n print $msg;\r\n exit;\r\n}", "public static function message($string) \n {\n echo $string;\n\t\texit;\n }", "function died($error) {\n\n // your error code can go here\n\n echo \"Ha sucedido un error al enviar el mensaje, vuelve a enviar el mensaje o intentalo a mas tarde. \";\n\n \n\n die();\n\n }", "function sd(...$args)\n {\n Helpers::die(Helpers::s(...$args));\n }", "function texc($x)\r\n{\r\n\tthrow new \\Exception('Debug: ' . $x);\r\n}", "function DieWithBadSql($loc, $sql)\n{\n DieWithMsg($loc, array(\"SQL Querry Failure!\", \"SQL=\" . $sql));\n}", "function errorMessageIllegal( $page, $crewid, $expected, $actual ) {\n\techo \"<div class='body'>\";\n\t\techo \"<span class='fontTitle'>Warning!</span><br /><br />\";\n\t\techo \"You have attempted an illegal operation!\";\n\techo \"</div>\";\n}", "function died($error) {\r\n \r\n echo \"<h1>Whoops!</h1><h2>There appears to be something wrong with your submission.</h2>\";\r\n \r\n echo \"<strong><p>The following items are not specified correctly.</p></strong><br />\";\r\n \r\n echo $error.\"<br /><br />\";\r\n \r\n echo \"<p>Return to the form and try again.</p><br />\";\r\n\t\techo \"<p><a href='index.php'>return to the homepage</a></p>\";\r\n die();\r\n\t\t\r\n \r\n }", "function sf_error($data, $force = false, $block_header_on_echo = false)\n {\n IOFunctions::out(\n LogLevel::ERRO,\n $data,\n $force,\n $block_header_on_echo\n );\n }", "function put_error(string $message)\n{\n echo \"<aside class=\\\"notice error\\\">${message}</aside>\";\n}", "function shutdown()\r\n{\r\n // here we can do any last operations\r\n // before the script is complete.\r\n global $engine; // deklarasi dua kali karena berada didalam function yang berbedda\r\n global $go;\r\n global $template;\r\n\r\nif(isset($_GET['bersihkan_log']))\r\n\t{\r\n\t\tif(file_exists(ini_get('error_log')))\r\n\t\t{\r\n\t\t //hapus log error\r\n\t\t if (!unlink(ini_get('error_log')))\r\n\t\t {\r\n\t\t // (\"log sdh cleaar\");\r\n\t\t }\r\n\t\t}\r\n\t}\r\n}", "function fatal_exit($text)\n{\n require_code('failure');\n _fatal_exit($text);\n}", "function salida_abrupta($mensaje){\n\techo \"<script language=\\\"javascript\\\" type=\\\"text/javascript\\\">\n\t\t\t\t\t\talert(\\\"{$mensaje}\\\");\n\t\t\t\t\t\t</script>\";\t\n\techo \"<script>window.close()</script>\";\n\texit;\n}", "function salida_abrupta($mensaje){\n\techo \"<script language=\\\"javascript\\\" type=\\\"text/javascript\\\">\n\t\t\t\t\t\talert(\\\"{$mensaje}\\\");\n\t\t\t\t\t\t</script>\";\t\n\techo \"<script>window.close()</script>\";\n\texit;\n}", "public function debuglog($variable,$desc=\"\",$exit=1) {\n\t}", "function loginFail($type) {\n echo json_encode(['code'=>$type]);\n\n exit();\n}", "function died($error) {\n echo \"Lo sentimos, pero hay algunos errores con el formulario enviado.\";\n echo \"Estos errores se muestran a continuación.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Por favor corrija estos errores.<br /><br />\";\n die();\n }", "function doSomething($nim, $nama=\"nilai default\"){\r\necho \" seseorang yang perutnya buncit dan tukang makan yaitu $nama yang $nim <br>\";\r\n}", "function errore($messaggio) {\n header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);\n die($messaggio);\n}", "function WriteIni($filename, $inihash) {\r\n\r\nif($inihash) {\r\n\t$file=fopen($filename, \"w\");\r\n\tif($file) {\r\n\t\tforeach($inihash as $key=>$value) {\r\n\t\t\tfwrite($file, \"$key=$value\\n\");\t#WRITE STRING TO FILE\r\n\t\t}\r\n\t} else {\r\n\t\t$this->writeError=\"ERROR: cannot open file $filename for writing\";\t#ERROR IF CANT WRITE TO FILE\r\n\t\treturn FALSE;\r\n\t}\r\n\tfclose($file);\r\n\treturn TRUE;\r\n} else {\r\n\t$this->writeError=\"ERROR: Your INI-hash is empty\";\t#ERROR IF HASH IS EMPTY\r\n\treturn FALSE;\r\n}\r\n\r\n}", "function ThrowFatalError($message = \"An unknown error has occured.\") \n// PRE: $message is a description of the error that has occurred\n// POST: This function will cause the program to close itself after echoing an error message\n{\n\techo \"Error : \" . $message . \" The program has been terminated.\\n\";\n\tif(!TESTING)\n\t{\n\t\tdie();\n\t}\n}", "function pr($string, $isnull=false) {\n echo '<pre>';\n print_r($string);\n echo '</pre>';\n\n if($isnull)\n die('here');\n}", "function died($error) {\r\n echo \"Sentimos muito mas o formulário enviado contém erros<br/>\";\r\n echo \"Os erros seguintes apareceram:<br /><br />\";\r\n echo $error.\"<br /><br />\";\r\n echo \"Por favor, volte e corrija-os.<br /><br />\";\r\n die();\r\n }", "public function show()\n {\n echo 1;die;\n }", "function fa_ajax_comment_err($a)\n{\n header('HTTP/1.0 500 Internal Server Error');\n header('Content-Type: text/plain;charset=UTF-8');\n echo $a;\n exit;\n}", "private function send_die_message($msg){\n\t\t$die_msg_arr['error']['code'] = 1;\n\t\t$die_msg_arr['error']['msg'] = $msg;\n\t\treturn $die_msg_arr;\n\t}", "function try_success($s, $e = \"\") {\n print \"> \". $s .\"success<br />\";\n if ($e != \"\")\n print \"> Message: \". $e .\"<br />\";\n }", "function authenticate(array $credentials)\n {\n die(\"aaaaaaaaaaaa\");\n }", "function chevereto_die($error_msg, $title='', $explain=array()) {\n\tif(!is_array($error_msg) && check_value($error_msg)) $error_msg = array($error_msg);\n\t$what_happend = $explain[0];\n\t$solution = $explain[1];\n\t$doctitle = (check_value($title)) ? $title : 'Error';\n\t$doctitle .= ' - Chevereto '.get_chevereto_version();\n\trequire_once(__CHV_PATH_CONTENT__.'system/error.php'); // $error_msg are handled here\n\tdie();\n}", "function died($error) {\n echo \"<br />\";\n \n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n \n echo \"These errors appear below.<br /><br />\";\n \n echo $error.\"<br /><br />\";\n \n echo \"Please go back and fix these errors.<br /><br />\";\n \n die();\n \n }", "public function debugprint($variable,$desc=\"\",$exit=0) {\n\t}", "function returnAddressDataIncomplet( $var,$dir,$exit ){\r\n if( $var == false ){\r\n //$dir = tiene que se igual a la direccion de Login.php\r\n header(\"location:\".$dir);\r\n }else{\r\n $exit;\r\n }\r\n\r\n}", "function news_operationError( $message ) {\n \n // for now, just print error message\n echo( \"ERROR: $message\" );\n die();\n }", "function alert($title,$msg,$ico,$type=1){\r\n $_SESSION['alert']=array(\r\n 'title'=>$title,\r\n 'msg'=>$msg,\r\n 'icon'=>$ico,\r\n 'type'=>$type\r\n );\r\n}", "public function fail($message) {\n\t\tdie('cobweb: ' . $message . \"\\n\");\t\n\t}", "function dumper($data=null, $is_sql = 0) { \n\t\t@ob_clean(); \n\t\t\n\t\t$ci =& get_instance();\n\t\t\n\t\techo \"<style>ul {\n\t\t\t\tlist-style-type: none;\n\t\t\t}\n\n\t\t\tul > li:before {\n\t\t\t\tcontent: \\\"-\\\"; /* en dash here */\n\t\t\t\tposition: absolute;\n\t\t\t\tmargin-left: -1.1em; \n\t\t\t}</style>\";\n\t\techo \"<pre><b style='font-size:18px'>Pegawai ini sudah Dinas Luar :</b></pre><pre style='margin-left:15px;'>\";\n\t\t\n\t\tif(!$is_sql) {\n\t\t\t\n\t\t\t$time = round(microtime(true)-$_SERVER['REQUEST_TIME'], 3);\n\t\t\t\n\t\t\t$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n\t\t\tdo $caller = array_shift($backtrace); while ($caller && !isset($caller['file']));\n\t\t\tif ($caller) {\n\t\t\t\techo \"File Trace : \".$caller['file'].':'.$caller['line'].\"\n\t\t\t\t\t\t\t <br /><span>Called By : <ul><li> Controller : \".\n\t\t\t\t\t\t\t\t$ci->router->fetch_class().\"</li><li> Function&nbsp;&nbsp;&nbsp;: \".\n\t\t\t\t\t\t\t\t$ci->router->fetch_method().\n\t\t\t\t\t\t\t \"</li><li> Runtime&nbsp;&nbsp;&nbsp;&nbsp;: \".\n\t\t\t\t\t\t\t\t$time.' Second(s)</li></ul></span><br />\n\t\t\t\t\t\t\t <div>$VAR1 = </div>'.\n\t\t\t\t\t\t\t \"<div style='margin-left:50px;'>\";\n\t\t\t\tif($data != null) {\n\t\t\t\t\tprint_r($data);\n\t\t\t\t} else {\n\t\t\t\t\techo \"Not Returning Variable Or Variable is Null\";\n\t\t\t\t\t\n\t\t\t\t\techo \"<br /><br />To Do : Make sure the variables has a value (if it is a function, make sure that the function has a 'return'))\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\techo \"</div>\";\n\t\t\t}\n\t\t\t \n\t\t} else {\n\t\t\techo mysql_error();\t\t\t\n\t\t}\n\t\techo \"</pre><pre></pre>\";\n\t\t$ci->db->trans_rollback();\n\t\texit; \n\t}", "function error_and_die($msg) {\n echo ('<p><span style=\"color:#ff0000; font-size:1.5em;\">SubmissionBox Error Encountered</span></p>');\n echo ('<p><span style=\"color:#ff0000;\">Message: ' . $msg . '</span></p></body></html>');\n die;\n }", "function fail($m)\n {\n if(is_string($m)){$m=trim($m);}; if(!is_string($m)||(strlen($m)<1)){$m='undefined';};\n $s=stak(); $f=$s[0]->file; $l=$s[0]->line; $e=knob(['name'=>'Deliberate','mesg'=>$m,'file'=>$f,'line'=>$l,'stak'=>$s]);\n dbug::view($e); exit;\n }", "function died($error) {\n header('location: index.html?status=error');\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n \n echo \"These errors appear below.<br /><br />\";\n \n echo $error.\"<br /><br />\";\n \n echo \"Please go back and fix these errors.<br /><br />\";\n \n \n \n die();\n \n }", "function writeln($test = '');", "function usage_and_die($message=false)\n{\n\tif ($message) {\n\t\techo $message.\"\\n\";\n\t}\n\n\techo 'Usage: '.$_SERVER['argv'][0].' /starting/path'.\"\\n\";\n\n\texit(1);\n}", "function NitaERROR($Code, $String){\n\t\t$this->ERROR=\" Error \".$Code.\": \".$String;\n\t}", "function die_with_master($err_msg)\n{\n print $err_msg;\n print \"</div><br><br><br>\";\n $pagemaincontent = ob_get_contents();\n ob_end_clean();\n include(\"master.php\");\n exit();\n}", "function confirm_query($string){\r\n \tif(!$string){\r\n \t\tdie(\"Problem in the query\");\r\n \t}\r\n }", "function EncerrarAtividade($codAtividade){\n\n }", "function myerror($myFile, $myLine, $errorMsg)\r\n{\r\n if(defined('DEBUG') && DEBUG)\r\n {\r\n echo \"Error in file: <b>\" . $myFile . \"</b> on line: <b>\" . $myLine . \"</b><br />\";\r\n echo \"Error Message: <b>\" . $errorMsg . \"</b><br />\";\r\n die();\r\n }else{\r\n\t\techo \"I'm sorry, we have encountered an error. Would you like to buy some socks?\";\r\n\t\tdie();\r\n }\r\n}", "function report_error($error)\r\n\t{\t\r\n\t\t?>alert('<?php echo $error;?>');<?php\r\n\t}", "function dumpAndDie ($value): void {\n\tvar_dump($value);\n\tdie();\n}", "function died($error) {\n \n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n \n echo \"These errors appear below.<br /><br />\";\n \n echo $error.\"<br /><br />\";\n \n echo \"Please go back and fix these errors.<br /><br />\";\n \n die();\n \n }", "function notSoFatalError($errStr, $options = array()){\n\t\t$image_dir = (empty($this->image_dir) ? \"\" : $this->image_dir);\n\t\tif (!empty($this->error_function)){\n\t\t\t$errf = $this->error_function;\n\t\t\t$errf(\"[base class]: $errStr\");\n\t\t} else {\n\t\t\t$tittel = \"Følgende feil oppstod:\";\n\t\t\tif (isset($options['customHeader'])) $tittel = $options['customHeader'];\n\t\t\t$errm = \"\n\t\t\t\t<div class='errorMessage' style=\\\"border: 1px solid #FF0000; color: #FF0000; background: url(\".$image_dir.\"warning2.gif) no-repeat #FFFFFF; padding: 10px 10px 10px 70px; margin: 5px;\\\">\n\t\t\t\t\t<strong style='padding-top:8px; padding-bottom:3px; display: block;'>$tittel</strong>\n\t\t\t\t\t$errStr\n\t\t\t\t\t<br />&nbsp;\n\t\t\t\t</div>\n\t\t\t\";\n\t\t\tif (isset($options['logError'])) $logError = ($options['logError'] == true);\n\t\t\telse $logError = true;\n\t\t\tif ($logError) $this->addToErrorLog($errStr);\n\t\t\tif (isset($options['print'])) \n\t\t\t\tprint $errm;\n\t\t\telse \n\t\t\t\treturn $errm;\n\t\t}\n\t}", "function customError($errNo,$errStr,$errFile,$errLine){\n echo \"<b>Custom error:</b>[$errNo] $errStr</br>\";\n echo \"Error on line $errLine in $errFile</br>\";\n echo \"Ending Script\";\n $errText=\"Custom error $errNo on line $errLine in $errFile on \".date('Y-m-d H:i:s',time());\n writerErrLog($errText);\n}" ]
[ "0.61333644", "0.5939844", "0.58546686", "0.5767093", "0.5694066", "0.5684049", "0.56765395", "0.5672284", "0.56707007", "0.5586421", "0.5450101", "0.542132", "0.5420109", "0.53563964", "0.53261036", "0.53144586", "0.5298241", "0.52937573", "0.5280195", "0.52694637", "0.5265028", "0.524647", "0.52367187", "0.5232717", "0.51687586", "0.5167402", "0.5149821", "0.51400894", "0.51385176", "0.5131661", "0.51274836", "0.51269555", "0.5124934", "0.51227564", "0.5115046", "0.50725806", "0.5070861", "0.5068693", "0.5060591", "0.50578123", "0.5055309", "0.5050034", "0.5050034", "0.50491947", "0.5047671", "0.5047237", "0.5038098", "0.50082517", "0.4997206", "0.49928242", "0.49897528", "0.49846435", "0.49838272", "0.4980801", "0.4978145", "0.49771798", "0.49685076", "0.4955717", "0.49465647", "0.49419364", "0.49356806", "0.4934858", "0.49247995", "0.49247995", "0.49165085", "0.49156255", "0.49075693", "0.49036777", "0.48978734", "0.4881086", "0.4877454", "0.48770618", "0.48686427", "0.48654395", "0.48614657", "0.48513296", "0.48502415", "0.48485407", "0.48452964", "0.4841708", "0.48412845", "0.48406422", "0.48399776", "0.48354653", "0.48351878", "0.48316026", "0.4825954", "0.48205796", "0.48106492", "0.48080772", "0.48000357", "0.47987315", "0.47965115", "0.47958663", "0.47948205", "0.47919196", "0.4788013", "0.4787333", "0.47840586", "0.47777542", "0.4775963" ]
0.0
-1
DIE($idobra. ' dwdqw '.$idcentro);
public function RelatorioCentroCusto($idobra, $idcentro) { $obra = new clsObra(); $obra->preencheDados($idobra); $centroNome = ""; if ($idcentro > 0) { $centro = new clsCentroCusto(); $centro->RetornaCentroCusto($idcentro); $centroNome = " - Centro de Custo: " . $centro->getDescCentro(); } $html = '<table border = "3" cellspacing = "2" cellpadding = "2"> <tr height = "2"> </br> <b><span style="font-size: 20px">Retirada de Material</span></b> </br> <span align="center" style="font-size: 20px">Obra: ' . $obra->getDescricao() . $centroNome . '</span> <th align = "center" class = "small" width = "150px">Data Retirada</th> <th align = "center" class = "small" width = "600px">Material</th> <th align = "center" class = "small" width = "150px">Quantidade</th> </tr>'; $SQL = "SELECT re.QUANTRETIRADA, re.DATARETESTOQUE, CONCAT(mt.DESCMATERIAL, ' / ' , un.SIGLAUNID) MATERIAL FROM retirada_estoque re INNER JOIN material mt ON re.IDMATERIAL = mt.IDMATERIAL INNER JOIN unidade un ON re.IDUNIDADE = un.IDUNIDADE WHERE re.IDOBRA = " . $idobra . ""; //die($SQL); if ($idcentro > 0) { $SQL.=" AND re.IDCENTRO =" . $idcentro . " "; } $SQL.=" ORDER BY STR_TO_DATE(re.DATARETESTOQUE,'%d/%m/%Y'), mt.DESCMATERIAL "; $con = new gtiConexao(); $con->gtiConecta(); $tbl = $con->gtiPreencheTabela($SQL); $con->gtiDesconecta(); //die($SQL); foreach ($tbl as $chave => $linha) { $html .= ' <tr height = "1"> <td align = "center" class = "small" width = "100px"> ' . htmlentities($linha['DATARETESTOQUE']) . ' </td> <td align = "center" class = "small" width = "100px"> ' . htmlentities($linha['MATERIAL']) . ' </td> <td align = "center" class = "small" width = "100px"> ' . $linha['QUANTRETIRADA'] . ' </td> </tr>'; } $html .= '</table> '; $html .= '<table border = "3" cellspacing = "2" cellpadding = "2"> <tr height = "2"> </br> <b><span style="font-size: 20px">Retirada de Material - Soma Geral</span></b> <th align = "center" class = "small" width = "650px">Material</th> <th align = "center" class = "small" width = "250px">Quantidade</th> </tr>'; $SQL = "SELECT SUM(re.QUANTRETIRADA) SOMA, re.DATARETESTOQUE, CONCAT(mt.DESCMATERIAL, ' / ' , un.SIGLAUNID) MATERIAL FROM retirada_estoque re INNER JOIN material mt ON re.IDMATERIAL = mt.IDMATERIAL INNER JOIN unidade un ON re.IDUNIDADE = un.IDUNIDADE WHERE re.IDOBRA = " . $idobra . ""; //die($SQL); if ($idcentro > 0) { $SQL.=" AND re.IDCENTRO =" . $idcentro . " "; } $SQL.=" GROUP BY mt.DESCMATERIAL ORDER BY mt.DESCMATERIAL "; $con = new gtiConexao(); $con->gtiConecta(); $tbl = $con->gtiPreencheTabela($SQL); $con->gtiDesconecta(); //die($SQL); foreach ($tbl as $chave => $linha) { $html .= ' <tr height = "1"> <td align = "center" class = "small" width = "100px"> ' . htmlentities($linha['MATERIAL']) . ' </td> <td align = "center" class = "small" width = "100px"> ' . $linha['SOMA'] . ' </td> </tr>'; } $html .= '</table> '; //die(print_r($arrayNota)); return $html; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fTraeAuxiliar($pTip, $pCod){\n global $db, $cla, $olEsq;\n $slDato= substr($olEsq->par_Clave,4,2);\n if ($slDato == \"CL\") { // el movimiento se asocia al Cliente\n $iAuxi = $cla->codProv;\n }\n else {\n $iAuxi = NZ(fDBValor($db, \"fistablassri\", \"tab_txtData3\", \"tab_codTabla = '\" . $pTip . \"' AND tab_codigo = '\" . $pCod . \"'\" ),0);\n }\n//echo \"<br>aux\" . $olEsq->par_Clave. \" / \" .$slDato . \" $iAuxi <br>\";\n error_log(\" aux: \" . $iAuxi. \" \\n\", 3,\"/tmp/dimm_log.err\");\t\n return $iAuxi;\n}", "function died($error) {\n echo \"Na vjen keq, kodi ka gabime gjate dergimit. \"; \n echo \"Kto errore do te shfaqen me poshte.<br /><br />\"; \n echo $error.\"<br /><br />\"; \n echo \"Ju lutemi, shkoni prapa dhe provoni prape mbushni formen.<br /><br />\"; \n die(); \n }", "public function voirsolde()\n {\n echo \"le solde du compte est de $this->solde \";\n }", "function EncerrarAtividade($codAtividade){\n\n }", "function died($error) {\necho \"Xảy ra lỗi!!! \";\necho \"<br /><br />\";\necho $error.\"<br /><br />\";\necho \"Hãy trở lại và sữa chữa các lỗi:<br /><br />\";\ndie();\n}", "function fncValidaDI_3($IdEstado, $GestorErr, $NumReg, $Campo,$CampoAux)\n{\n\t \n\t$Bandera = 0;\n\t$CatEdo = array(\"AS\" , \"BC\",\"BS\", \"CC\", \"CL\", \"CM\",\"CS\", \"CH\", \"DF\", \n\t\t\t\t\"DG\", \"GT\", \"GR\", \"HG\", \"JC\", \"MC\",\"MN\", \"MS\", \"NT\", \"NL\", \"OC\",\n\t\t\t\t\"PL\", \"QT\", \"QR\", \"SP\",\"SL\", \"SR\", \"TC\", \"TS\", \"TL\",\"VZ\", \"YN\", \"ZS\", \"NE\");\n\n\t$DI_3 = \"(3)Clave Única de Registro de Población (CURP)\";\n\t$DI_3_ErrTam = \"Tamaño de registro debe ser 18 Caracteres\";\n\t$DI_3_ErrIdEdo = \"Identificador de estado Invalido\";\n\t$DI_3_ErrRFC = \"CURP Incorrecto en Sección I AAAA\";\n\t$DI_3_ErrFecNac = \"CURP Incorrecto en Sección II Fecha Nacimiento\";\n\t$DI_3_ErrGenero = \"CURP Incorrecto en Sección III Genero\";\n\t$DI_3_ErrEntFecNac= \"CURP Incorrecto en Sección IV Entidad Federativa Nacimeinto\";\n\n\n\t//echo \"Datos Entrada: IdEstado >\".$IdEstado. \"< \\nGestorErr >\". $GestorErr .\"< \\nNumReg >\".$NumReg. \"< \\nCampo >\". $Campo .\"<\\n\";\n\t$MtrxStrAux = explode(\"/\", $CampoAux);\n\t$MtrxStrAuxApp = explode(\",\", $MtrxStrAux[CERO]);\n\t$AppPat\t\t= (isset($MtrxStrAuxApp[CERO]))?$MtrxStrAuxApp[CERO]:\"\" ;\n\t$AppMat = (isset($MtrxStrAuxApp[UNO]))?$MtrxStrAuxApp[UNO]:\"\";\n\t$NomEmpl = (isset($MtrxStrAux[UNO]))?$MtrxStrAux[UNO]:\"\";\n/**\t\n\techo \"AppPat >$AppPat< <br>\";\n\techo \"AppMat >$AppMat< <br>\";\n\techo \"Nombre >$NomEmpl< <br>\";\n**/\t\n /** Quita caracteres especiales **/\n\t$LocCampo =preg_replace('/[^A-Za-z0-9\\-]/', '', $Campo);\n\n\tif (strlen($LocCampo) == 18)\n\t{\n\n\t\tif(!preg_match (\"/[A-Z,a-z]{4}/\" ,substr($LocCampo,0,4)))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_3.\"|\".$LocCampo.\"|\" . $DI_3_ErrRFC.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = 1;\n\t\t}\t\n\t\t$CampoAux = substr($LocCampo,4,6);\n\t\tif(!preg_match (\"/\\d{6}/\" ,$CampoAux))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_3.\"|\".$LocCampo.\"|\" . $DI_3_ErrFecNac .\"|$CampoAux\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = 1;\n\t\t}\t\n\n\t\tif(!preg_match (\"/[M|H|m|h]{1}/\" ,substr($LocCampo,10,1)))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_3.\"|\".$LocCampo.\"|\" . $DI_3_ErrGenero .\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = 1;\n\t\t}\t\n\t\tif(!in_array(substr($LocCampo,11,2), $CatEdo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_3.\"|\".$LocCampo.\"|\" . $DI_3_ErrEntFecNac .\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = 1;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_3.\"|\".$LocCampo.\"|\" . $DI_3_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = 1;\n\t}\n\treturn $Bandera;\n}", "function fncValidaDI_53($IdEstado, $GestorErr, $NumReg, $Campo){\n\t \n\t$Bandera = CERO;\n\t$DI_53 = \"(53)Instrumento de Pago Nuevo\";\n\t$DI_53_ErrTam = \"Instrumento de Pago Nuevo ser de 2 digitos\";\n\t$DI_53_Catalogo = \"El valor de Instrumento de Pago Nuevo no coincide con la directiva de calidad de la DGRH\";\n\t\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == DOS){\n\t\tif($LocCampo != \"02\" and $LocCampo != \"05\" )\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_53.\"|\".$LocCampo.\"|\" . $DI_53_Catalogo.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse{\n\t\t$Error = $NumReg .\"|\".$DI_53.\"|\".$LocCampo.\"|\" . $DI_53_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function getSoldeCpte($id_cpte)\n{\n global $dbHandler;\n global $global_id_agence;\n\n $db = $dbHandler->openConnection();\n\n $sql = \"SELECT solde \";\n $sql .= \"FROM ad_cpt \";\n $sql .= \"WHERE id_ag = $global_id_agence AND id_cpte = $id_cpte \";\n\n $result=$db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__,__LINE__,__FUNCTION__);\n }\n\n $row = $result->fetchrow();\n\n $solde = $row[0];\n\n $dbHandler->closeConnection(true);\n return $solde;\n}", "function fncValidaDI_27($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_27 = \"(27)Centro de Responsabilidad\";\n\t$DI_27_ErrTam = \"Tamaño de campo Centro de Responsabilidad debe ser a 10 Caracters\";\n\t$DI_27_Edo \t = \"El Centro de Responsabilidad no corresponde al Estado\";\n\t$DI_27_CR \t = \"El Centro de Responsabilidad no corresponde al catalogo de DGRH\";\n\t\n\t// agregar catalogo de Municpios\n $Edo= array($IdEstado);\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == DIEZ)\n\t{\n\t\tif(!in_array(substr($LocCampo,0,2),$Edo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_27.\"|\".$LocCampo.\"|\" . $DI_27_Edo.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t\tif(!preg_match(\"/\\d{8}/\",substr($LocCampo,2,8)))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_27.\"|\".$LocCampo.\"|\" . $DI_27_CR.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_27.\"|\".$LocCampo.\"|\" . $DI_27_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function fncValidaDI_63($IdEstado, $GestorErr, $NumReg, $Campo){\n\t \n\t$Bandera = CERO;\n\t$DI_62 = \"(63)Indicador de TESOFE -JORNADA\";\n\t$DI_62_ErrTam = \"Indicador de TESOFE-JORNADA debe ser de 2 Digitos\";\n\t$DI_62_Catalogo = \"Indicador de TESOFE-JORNADA No coincide con catalogo definido por la DGRH\";\n\t\n\t$JorArray =array(\"01\",\"02\",\"03\",\"04\",\"05\");\t\n\n\t$LocCampo = $Campo;\n\tif (strlen($LocCampo) == DOS){\n\n\t\tif(!in_array($LocCampo,$JorArray)){\n\t\t\t$Error = $NumReg .\"|\".$DI_62.\"|\".$LocCampo.\"|\" . $DI_62_Catalogo.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\n\t}\n\telse{\n\t\t$Error = $NumReg .\"|\".$DI_62.\"|\".$LocCampo.\"|\" . $DI_62_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function fncValidaDI_24($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_24 = \"(24)Número de Puesto\";\n\t$DI_24_ErrTam = \"Tamaño de Número de Puesto debe ser a 4 Alfanumerico\";\n\t$DI_24_NumPto \t = \"El Número Puesto no es parte del catalogo de DGRH\";\n\t\n $NumPto= array(\"0022\",\"0101\");\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == CUATRO)\n\t{\n\t\tif(!in_array($LocCampo,$NumPto))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_24.\"|\".$LocCampo.\"|\" . $DI_24_NumPto.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_24.\"|\".$LocCampo.\"|\" . $DI_24_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function despedida($adios){\n echo $adios.\"<br>\";// con el punto se concatena una cadena de texto con una variable\n}", "function fncValidaDI_59($IdEstado, $GestorErr, $NumReg, $Campo){\n\t \n\t$Bandera = CERO;\n\t$DI_58 = \"(59)Nombre del Producto\";\n\t$DI_58_ErrTam = \"Nombre del Producto debe ser de 11 caracteres/numeros\";\n\t$DI_58_Catalogo = \"No coincide con directiva de Calidad (Alfanumérico a 11)\";\n\t\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == 11){\n\t\tif(!preg_match(\"/[A-Z,a-z,0-9]{11}/\",$LocCampo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_58.\"|\".$LocCampo.\"|\" . $DI_58_Catalogo.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse{\n\t\t$Error = $NumReg .\"|\".$DI_58.\"|\".$LocCampo.\"|\" . $DI_58_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function Uzasadnienie($dbh, $un, $ud, $up, $roszczenia, $no)\r\n\t\t\t{\r\n\t\t\t\t$uzasadnienie=\"Powodowie prowadzą działalność gospodarczą pod nazwą NETICO Spółka Cywilna M.Borodziuk, M.Pielorz, K.Rogacki. Powodowie dnia $ud zawarli z Pozwanym(ą) umowę abonencką nr $un o świadczenie usług telekomunikacyjnych.\\n Termin płatności został określony w Umowie do $up dnia danego miesiąca. \\n Za świadczone usługi w ramach prowadzonej przez siebie działalności gospodarczej Powodowie wystawili Pozwanemu(ej) następujące faktury VAT:\\n \";\r\n\t\t\t\t\r\n\t\t\t\t$n=1;\r\n\t\t\t\t$suma=0;\r\n\t\t\t\tforeach ($roszczenia as $n => $v)\r\n\t\t\t\t{\r\n\t\t\t\t\t$oznaczenie=$roszczenia[$n][\"oznaczenie\"];\r\n\t\t\t\t\t$kwota=$roszczenia[$n][\"wartosc\"];\r\n\t\t\t\t\t$pozostalo=$roszczenia[$n][\"pozostalo\"];\r\n\t\t\t\t\t$d=$n;\r\n\t\t\t\t $kwota=number_format(round($kwota,2), 2,',','');\r\n\t\t\t\t\tif ( $pozostalo>0)\r\n\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t$suma+=$pozostalo;\r\n\t\t\t\t\t\t\t$pozostalo=number_format($pozostalo, 2,',','');\r\n\t\t\t\t\t\t\t$uzasadnienie.=\"$oznaczenie na kwotę $kwota zł, pozostało do zapłaty $pozostalo zł. \\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t$uzasadnienie.=\"$oznaczenie na kwotę $kwota zł; \\n\";\r\n\t\t\t\t\t\t$suma+=$kwota;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t/*\t\r\n\t\t\t\tif (!empty($no))\r\n\t\t\t\t{\r\n\t\t\t\t\t$uzasadnienie.=\"W zwiazku z nie regulowaniem przez Pozwanego(ą) płatności wynikających z warunków Umowy Powodowie rozwiązali Umowę i wystawili Pozwanemu(ej) następujące noty obciążaniowe: \";\r\n\t\t\t\t\t$n=1;\r\n\t\t\t\t\tforeach ($no as $n => $v)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$oznaczenie=$no[$n][\"oznaczenie\"];\r\n\t\t\t\t\t\t$kwota=$no[$n][\"wartosc\"];\r\n\t\t\t\t\t\t$d=$n;\r\n\t\t\t\t\t\t$kwota=number_format($kwota,2), 2,',','');\r\n\t\t\t\t\t\t$uzasadnienie.=\"$oznaczenie na kwotę $kwota zł; \\n\";\r\n\t\t\t\t\t\t$suma+=$kwota;\r\n\t\t\t\t\t}\r\n\t\t\t\t}*/\r\n\t\t\t\t\r\n\t\t\t\t$suma=number_format(round($suma,2), 2,',','');\r\n\t\t\t\t$uzasadnienie.=\"Razem $suma zł.\\n\";\r\n\t\t\t\t$uzasadnienie.=\"Pomimo wezwań do zapłaty Pozwany(a) nie uregulował należności.\";\r\n\t\t\t\treturn($uzasadnienie);\r\n\t\t\t}", "function retorno($nombre,$apellido)\n {\n if( is_string($nombre) && is_string($apellido) )\n {\n //filter_vars()\n $dame = $nombre. \"<br>\". $apellido;\n return $dame;\n }\n else\n {\n return \"Ingresaste mal los datos. tienen que ser caractéres alfabéticos\";\n }\n\n }", "function ajouterUe($id, $nomUe,$libelleUe) {\n $query = 'insert into ue values(\"\",\"'.$nomUe.'\",\"'.$id.'\",\"'.$libelleUe.'\")';\n mysql_query($query) or die (\"Impossible d'inserer une UE\");\n\t\n}", "function fncValidaDI_25($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_25 = \"(25)Estado\";\n\t$DI_25_ErrTam = \"Tamaño de Estado debe ser a 2 Dígitos\";\n\t$DI_25_Edo \t = \"El Estado no es parte del catalogo de DGRH\";\n\t\n $Edo= array(\"DF\",\"09\",\"05\",\"04\",\"03\",\"02\",\"01\",\"08\",\"07\",\"06\",\"SP\",\"32\",\"31\",\"30\",\n\"29\",\"28\",\"27\",\"26\",\"25\",\"24\",\"23\",\"22\",\"21\",\"20\",\"19\",\"18\",\"17\",\"16\",\"15\",\"14\",\"13\",\n\"12\",\"11\",\"10\");\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == DOS)\n\t{\n\t\tif(!in_array($LocCampo,$Edo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_25.\"|\".$LocCampo.\"|\" . $DI_25_Edo.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_25.\"|\".$LocCampo.\"|\" . $DI_25_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function fncValidaDI_65($IdEstado, $GestorErr, $NumReg, $Campo){\n\t \n\t$Bandera = CERO;\n\t$DI_64 = \"(65)Ciclo del FONAC\";\n\t$DI_64_ErrTam = \"Ciclo del FONAC debe ser de 4 Digitos\";\n\t$DI_64_DC = \"Ciclo del FONAC No coincide con la Directiva de Calidad definida por la DGRH(Numérico a 4 posiciones)\";\n\t\n\t$LocCampo = $Campo;\n\tif (strlen($LocCampo) == CUATRO){\n\n\n\t\tif(!preg_match(\"/[0-9]{4}/\",$LocCampo)){\n\t\t\t$Error = $NumReg .\"|\".$DI_64.\"|\".$LocCampo.\"|\" . $DI_64_DC.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse{\n\t\t$Error = $NumReg .\"|\".$DI_64.\"|\".$LocCampo.\"|\" . $DI_64_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function fncValidaDI_34($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_34 = \"(34)Indicador de Mando\";\n\t$DI_34_ErrTam = \"Indicador de Mando debe ser de 2 Digítos\";\n\t$DI_34_noDI \t = \"Indicador de Mando no corresponde al catalogo establecidas por DGRH\";\n\t\n\t$IndMando = array(\"01\",\"08\",\"10\",\"30\",\"50\",\"60\",\"70\",\"75\",\"80\",\"90\");\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == DOS)\n\t{\n\t\tif(!in_array($LocCampo, $IndMando))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_34.\"|\".$LocCampo.\"|\" . $DI_34_noDI.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_34.\"|\".$LocCampo.\"|\" . $DI_34_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function fncValidaDI_49($IdEstado, $GestorErr, $NumReg, $Campo){\n\t \n\t$Bandera = CERO;\n\n\t$DI_49 = \"(49)Quincena de Proceso Real\";\n\t$DI_49_ErrTam = \"Quincena de Proceso Real ser de 2 digitos\";\n\t$DI_49_Qna \t = \"La quincena no corresponde a la Directiva de Calidad deifinida por la DGRH(01-24)\";\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == DOS){\n\n\t\tif((int)$LocCampo <1 and (int)$LocCampo > 24){\n\t\t\t$Error = $NumReg .\"|\".$DI_49.\"|\".$LocCampo.\"|\" . $DI_49_Qna.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\n\n\t}\n\telse{\n\t\t$Error = $NumReg .\"|\".$DI_49.\"|\".$LocCampo.\"|\" . $DI_49_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function fncValidaDI_67($IdEstado, $GestorErr, $NumReg, $Campo){\n\t \n\t$Bandera = CERO;\n\t$DI_66 = \"(67)Acumulado de FONAC\";\n\t$DI_66_ErrTam = \"Acumulado de FONAC debe ser de 10 Digitos\";\n\t$DI_66_DC = \"Acumulado de FONAC No coincide con la Directiva de Calidad definida por la DGRH(##########.##)\";\n\t$DI_65_Catalogo = \"Acumulado de FONAC No coincide el catalogo definido por la DGRH(01-24)\";\n\t\n\t\n\t$LocCampo = $Campo;\n\tif (strlen($LocCampo) == DIEZ){\n\t\tif(!preg_match(\"/[0-9]{7}.[0-9]{2}/\",$LocCampo)){\n\t\t\t$Error = $NumReg .\"|\".$DI_66.\"|\".$LocCampo.\"|\" . $DI_66_DC.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse{\n\t\t$Error = $NumReg .\"|\".$DI_66.\"|\".$LocCampo.\"|\" . $DI_66_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function fncValidaDI_54($IdEstado, $GestorErr, $NumReg, $Campo){\n\t \n\t$Bandera = CERO;\n\t$DI_54 = \"(54)Percepciones \";\n\t$DI_54_ErrTam = \"Percepciones debe ser de 10 digitos y 2 decimales\";\n\t$DI_54_Catalogo = \"Percepciones no coincide con la directiva de calidad de la DGRH(9999999999.99)\";\n\t\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == 11){\n\t\tif(!preg_match(\"/[0-9]{8}.[0-9]{2}/\",$LocCampo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_54.\"|\".$LocCampo.\"|\" . $DI_54_Catalogo.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse{\n\t\t$Error = $NumReg .\"|\".$DI_54.\"|\".$LocCampo.\"|\" . $DI_54_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "public function ispisiOsobu(){\n // echo \"$this->ime $this->prezime $this->godRdoj\";\n echo \"<br>Ime: \" . $this->getIme() . \"<br>Prezime: \" . $this->getPrezime() . \"<br>Godina rodjenja: \" . $this->getGodRodj() . \"<br>\";\n }", "function fncValidaDI_37($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_37 = \"(37)Tipo de Trabajador\";\n\t$DI_37_ErrTam = \"Tipo de Trabajador debe ser de 2 Digítos\";\n\t$DI_37_noDI \t = \"Tipo de Trabajador no corresponde al catalogo establecidas por DGRH(01,11,20)\";\n\t\n\t\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == DOS)\n\t{\n\t\tif(!preg_match(\"/[0-9]{2}/\",$LocCampo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_37.\"|\".$LocCampo.\"|\" . $DI_37_noDI.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_37.\"|\".$LocCampo.\"|\" . $DI_37_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function calculer_boucle_rec($id_boucle, &$boucles, $trace) {\n\t$nom = $boucles[$id_boucle]->param[0];\n\treturn \"\\n\\t\\$save_numrows = (\\$Numrows['$nom']);\"\n\t. \"\\n\\t\\$t0 = \" . $boucles[$id_boucle]->return . \";\"\n\t. \"\\n\\t\\$Numrows['$nom'] = (\\$save_numrows);\"\n\t. $trace\n\t. \"\\n\\treturn \\$t0;\";\n}", "public function cadenas($cadena, $letra)\n {\n\n return \"->\".$cadena.\"<-\";\n }", "function fncValidaDI_22($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_22 = \"(22)Partida\";\n\t$DI_22_ErrTam = \"Tamaño de Actividad Institucional debe ser a 5 Alfanumerico\";\n\t$DI_22_Ptda \t = \"La Partida no es parte del catalogo de DGRH\";\n\t\n $Ptda= array(\"44106\",\"12301\",\"11301\");\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == CINCO)\n\t{\n\t\tif(!in_array($LocCampo,$Ptda))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_22.\"|\".$LocCampo.\"|\" . $DI_22_Ptda.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_22.\"|\".$LocCampo.\"|\" . $DI_22_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function fncValidaDI_55($IdEstado, $GestorErr, $NumReg, $Campo){\n\t \n\t$Bandera = CERO;\n\t$DI_55 = \"(55)Deducciones \";\n\t$DI_55_ErrTam = \"Deducciones debe ser de 10 digitos y 2 decimales \";\n\t$DI_55_Catalogo = \"Deducciones no coincide con la directiva de calidad de la DGRH(9999999999.99)\";\n\t\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == 11){\n\t\tif(!preg_match(\"/[0-9]{8}.[0-9]{2}/\",$LocCampo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_55.\"|\".$LocCampo.\"|\" . $DI_55_Catalogo.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse{\n\t\t$Error = $NumReg .\"|\".$DI_55.\"|\".$LocCampo.\"|\" . $DI_55_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function ajoue_proprietaire($nom,$CA,$debut_contrat,$fin_contrat)\r\n{ $BDD=ouverture_BDD_Intranet_Admin();\r\n\r\n if(exist($BDD,\"proprietaire\",\"nom\",$nom)){echo \"nom deja pris\";return;}\r\n\r\n $SQL=\"INSERT INTO `proprietaire` (`ID`, `nom`, `CA`, `debut_contrat`, `fin_contrat`) VALUES (NULL, '\".$nom.\"', '\".$CA.\"', '\".$debut_contrat.\"', '\".$fin_contrat.\"')\";\r\n\r\n $result = $BDD->query ($SQL);\r\n\r\n if (!$result)\r\n {echo \"<br>SQL : \".$SQL.\"<br>\";\r\n die('<br>Requête invalide ajoue_equipe : ' . mysql_error());}\r\n}", "function fncValidaDI_69($IdEstado, $GestorErr, $NumReg, $Campo){\n\t \n\t$Bandera = CERO;\n\t$DI_68 = \"(69)Licencia sin Goce de Sueldo / CLUES\";\n\t$DI_68_ErrTam = \"Licencia sin Goce de Sueldo / CLUES ser de 11 caracteres\";\n\t$DI_68_DC = \"Licencia sin Goce de Sueldo / CLUES No coincide con la Directiva de Calidad definida por la DGRH\";\n\t$DI_68_Catalogo = \"Licencia sin Goce de Sueldo / CLUES No coincide el catalogo definido por la DGRH\";\n\n\n//Condicion de estado-clues\nif($IdEstado == \"01\"){\n\t$Clues = array(\"ASSSA000013\",\"ASSSA000025\",\"ASSSA000030\",\"ASSSA000042\",\"ASSSA000054\",\"ASSSA000066\",\"ASSSA000071\",\"ASSSA000083\",\"ASSSA000095\",\"ASSSA000100\",\"ASSSA000112\",\"ASSSA000124\",\"ASSSA000136\",\"ASSSA000141\",\"ASSSA000153\",\"ASSSA000165\",\"ASSSA000170\",\"ASSSA000182\",\"ASSSA000194\",\"ASSSA000206\",\"ASSSA000211\",\"ASSSA000223\",\"ASSSA000235\",\"ASSSA000240\",\"ASSSA000252\",\"ASSSA000264\",\"ASSSA000276\",\"ASSSA000281\",\"ASSSA000293\",\"ASSSA000305\",\"ASSSA000310\",\"ASSSA000322\",\"ASSSA000334\",\"ASSSA000346\",\"ASSSA000351\",\"ASSSA000363\",\"ASSSA000375\",\"ASSSA000380\",\"ASSSA000392\",\"ASSSA000404\",\"ASSSA000416\",\"ASSSA000421\",\"ASSSA000433\",\"ASSSA000445\",\"ASSSA000450\",\"ASSSA000462\",\"ASSSA000474\",\"ASSSA000491\",\"ASSSA000503\",\"ASSSA000515\",\"ASSSA000520\",\"ASSSA000532\",\"ASSSA000544\",\"ASSSA000556\",\"ASSSA000561\",\"ASSSA000573\",\"ASSSA000585\",\"ASSSA000590\",\"ASSSA000602\",\"ASSSA000614\",\"ASSSA000626\",\"ASSSA000631\",\"ASSSA000643\",\"ASSSA000655\",\"ASSSA000660\",\"ASSSA000672\",\"ASSSA000684\",\"ASSSA000696\",\"ASSSA000701\",\"ASSSA000713\",\"ASSSA000725\",\"ASSSA000730\",\"ASSSA000742\",\"ASSSA000754\",\"ASSSA000766\",\"ASSSA000771\",\"ASSSA000783\",\"ASSSA000795\",\"ASSSA000800\",\"ASSSA000812\",\"ASSSA000824\",\"ASSSA000836\",\"ASSSA000841\",\"ASSSA000853\",\"ASSSA000865\",\"ASSSA000870\",\"ASSSA000894\",\"ASSSA000906\",\"ASSSA000911\",\"ASSSA000923\",\"ASSSA000931\",\"ASSSA000943\",\"ASSSA000955\",\"ASSSA000960\",\"ASSSA000984\",\"ASSSA000996\",\"ASSSA001001\",\"ASSSA001013\",\"ASSSA001025\",\"ASSSA001030\",\"ASSSA001046\",\"ASSSA001051\",\"ASSSA001063\",\"ASSSA001075\",\"ASSSA001080\",\"ASSSA001092\",\"ASSSA001104\",\"ASSSA001116\",\"ASSSA001121\",\"ASSSA001133\",\"ASSSA001145\",\"ASSSA001150\",\"ASSSA001162\",\"ASSSA001174\",\"ASSSA001186\",\"ASSSA001191\",\"ASSSA001203\",\"ASSSA001215\",\"ASSSA001220\",\"ASSSA001232\",\"ASSSA001244\");\n} //fin de if($IdEstado == \"01\")\n\n//Condicion de estado-clues\nif($IdEstado == \"02\"){\n\t$Clues = array(\"BCSSA000015\",\"BCSSA000020\",\"BCSSA000032\",\"BCSSA000044\",\"BCSSA000061\",\"BCSSA000073\",\"BCSSA000085\",\"BCSSA000090\",\"BCSSA000102\",\"BCSSA000114\",\"BCSSA000126\",\"BCSSA000131\",\"BCSSA000143\",\"BCSSA000160\",\"BCSSA000172\",\"BCSSA000184\",\"BCSSA000196\",\"BCSSA000201\",\"BCSSA000213\",\"BCSSA000225\",\"BCSSA000230\",\"BCSSA000242\",\"BCSSA000254\",\"BCSSA000266\",\"BCSSA000271\",\"BCSSA000283\",\"BCSSA000295\",\"BCSSA000300\",\"BCSSA000312\",\"BCSSA000324\",\"BCSSA000341\",\"BCSSA000353\",\"BCSSA000370\",\"BCSSA000382\",\"BCSSA000406\",\"BCSSA000411\",\"BCSSA000423\",\"BCSSA000440\",\"BCSSA000452\",\"BCSSA000464\",\"BCSSA000476\",\"BCSSA000481\",\"BCSSA000493\",\"BCSSA000505\",\"BCSSA000510\",\"BCSSA000522\",\"BCSSA000534\",\"BCSSA000546\",\"BCSSA000551\",\"BCSSA000563\",\"BCSSA000575\",\"BCSSA000580\",\"BCSSA000592\",\"BCSSA000604\",\"BCSSA000616\",\"BCSSA000621\",\"BCSSA000633\",\"BCSSA000645\",\"BCSSA000650\",\"BCSSA000662\",\"BCSSA000674\",\"BCSSA000686\",\"BCSSA000691\",\"BCSSA000703\",\"BCSSA000715\",\"BCSSA000720\",\"BCSSA000732\",\"BCSSA000744\",\"BCSSA000756\",\"BCSSA000761\",\"BCSSA000773\",\"BCSSA000785\",\"BCSSA000790\",\"BCSSA000814\",\"BCSSA000831\",\"BCSSA000843\",\"BCSSA000855\",\"BCSSA000860\",\"BCSSA000872\",\"BCSSA000884\",\"BCSSA000896\",\"BCSSA000901\",\"BCSSA000913\",\"BCSSA000925\",\"BCSSA000930\",\"BCSSA000942\",\"BCSSA000954\",\"BCSSA000966\",\"BCSSA000971\",\"BCSSA000983\",\"BCSSA000995\",\"BCSSA001000\",\"BCSSA001012\",\"BCSSA001041\",\"BCSSA001053\",\"BCSSA001065\",\"BCSSA001070\",\"BCSSA001082\",\"BCSSA001094\",\"BCSSA001106\",\"BCSSA001111\",\"BCSSA001123\",\"BCSSA001135\",\"BCSSA001140\",\"BCSSA001152\",\"BCSSA001164\",\"BCSSA001176\",\"BCSSA001181\",\"BCSSA001193\",\"BCSSA001205\",\"BCSSA001210\",\"BCSSA001222\",\"BCSSA001234\",\"BCSSA001246\",\"BCSSA001251\",\"BCSSA001263\",\"BCSSA001275\",\"BCSSA001280\",\"BCSSA001292\",\"BCSSA001316\",\"BCSSA001321\",\"BCSSA001333\",\"BCSSA001345\",\"BCSSA001350\",\"BCSSA001362\",\"BCSSA001374\",\"BCSSA001386\",\"BCSSA001403\",\"BCSSA001415\",\"BCSSA001420\",\"BCSSA001444\",\"BCSSA001456\",\"BCSSA001461\",\"BCSSA001473\",\"BCSSA001485\",\"BCSSA001490\",\"BCSSA001502\",\"BCSSA001514\",\"BCSSA001526\",\"BCSSA001531\",\"BCSSA001543\",\"BCSSA001555\",\"BCSSA001560\",\"BCSSA001572\",\"BCSSA001584\",\"BCSSA001630\",\"BCSSA001666\",\"BCSSA017462\",\"BCSSA017504\",\"BCSSA017521\",\"BCSSA017533\",\"BCSSA017545\",\"BCSSA017550\",\"BCSSA017574\",\"BCSSA017585\",\"BCSSA017590\",\"BCSSA017602\",\"BCSSA017614\",\"BCSSA017626\",\"BCSSA017631\",\"BCSSA017643\",\"BCSSA017660\",\"BCSSA017672\",\"BCSSA017684\",\"BCSSA017696\",\"BCSSA017701\",\"BCSSA017713\",\"BCSSA017725\",\"BCSSA017730\",\"BCSSA017742\",\"BCSSA017754\",\"BCSSA017766\",\"BCSSA017771\",\"BCSSA017783\",\"BCSSA017795\",\"BCSSA017800\",\"BCSSA017812\",\"BCSSA017824\",\"BCSSA017836\",\"BCSSA017841\",\"BCSSA017853\",\"BCSSA017865\",\"BCSSA017870\",\"BCSSA017882\",\"BCSSA017894\",\"BCSSA017906\",\"BCSSA017911\",\"BCSSA017923\",\"BCSSA017935\",\"BCSSA017940\",\"BCSSA017952\",\"BCSSA017964\",\"BCSSA017976\",\"BCSSA017981\",\"BCSSA017993\",\"BCSSA018005\",\"BCSSA018010\",\"BCSSA018022\",\"BCSSA018034\",\"BCSSA018046\",\"BCSSA018051\",\"BCSSA018063\",\"BCSSA018075\",\"BCSSA018080\",\"BCSSA018092\",\"BCSSA018104\",\"BCSSA018116\",\"BCSSA018121\",\"BCSSA018133\",\"BCSSA018145\",\"BCSSA018150\",\"BCSSA018162\",\"BCSSA018174\",\"BCSSA018186\",\"BCSSA018191\",\"BCSSA018203\",\"BCSSA018215\",\"BCSSA018220\",\"BCSSA018232\",\"BCSSA018244\",\"BCSSA018256\",\"BCSSA018261\",\"BCSSA018273\",\"BCSSA018285\",\"BCSSA018290\",\"BCSSA018302\",\"BCSSA018314\");\n} //fin de if($IdEstado == \"02\")\n\n//Condicion de estado-clues\nif($IdEstado == \"03\"){\n\t$Clues = array(\"BSSSA000011\",\"BSSSA000035\",\"BSSSA000040\",\"BSSSA000052\",\"BSSSA000064\",\"BSSSA000076\",\"BSSSA000081\",\"BSSSA000093\",\"BSSSA000105\",\"BSSSA000110\",\"BSSSA000134\",\"BSSSA000146\",\"BSSSA000151\",\"BSSSA000192\",\"BSSSA000204\",\"BSSSA000216\",\"BSSSA000221\",\"BSSSA000233\",\"BSSSA000245\",\"BSSSA000274\",\"BSSSA000286\",\"BSSSA000315\",\"BSSSA000320\",\"BSSSA000344\",\"BSSSA000356\",\"BSSSA000361\",\"BSSSA000373\",\"BSSSA000385\",\"BSSSA000390\",\"BSSSA000402\",\"BSSSA000414\",\"BSSSA000431\",\"BSSSA000443\",\"BSSSA000455\",\"BSSSA000460\",\"BSSSA000472\",\"BSSSA000501\",\"BSSSA000530\",\"BSSSA000542\",\"BSSSA000554\",\"BSSSA000566\",\"BSSSA000571\",\"BSSSA000583\",\"BSSSA000595\",\"BSSSA000612\",\"BSSSA000624\",\"BSSSA000636\",\"BSSSA000641\",\"BSSSA000653\",\"BSSSA000665\",\"BSSSA000682\",\"BSSSA000694\",\"BSSSA000706\",\"BSSSA000711\",\"BSSSA000723\",\"BSSSA000735\",\"BSSSA000740\",\"BSSSA000764\",\"BSSSA000776\",\"BSSSA000781\",\"BSSSA000793\",\"BSSSA000806\",\"BSSSA000811\",\"BSSSA000835\",\"BSSSA000840\",\"BSSSA000852\",\"BSSSA000864\",\"BSSSA000876\",\"BSSSA000881\",\"BSSSA000893\",\"BSSSA000905\",\"BSSSA000910\",\"BSSSA000922\",\"BSSSA000933\",\"BSSSA000945\",\"BSSSA000950\",\"BSSSA000962\",\"BSSSA000974\",\"BSSSA001003\",\"BSSSA001020\",\"BSSSA001032\",\"BSSSA001044\",\"BSSSA001056\",\"BSSSA001061\",\"BSSSA001073\",\"BSSSA001085\",\"BSSSA001090\",\"BSSSA001102\",\"BSSSA001114\",\"BSSSA001126\",\"BSSSA001131\",\"BSSSA001143\",\"BSSSA001155\",\"BSSSA001160\",\"BSSSA001172\",\"BSSSA001184\",\"BSSSA001196\",\"BSSSA001201\",\"BSSSA001213\",\"BSSSA001225\",\"BSSSA001230\",\"BSSSA001242\",\"BSSSA001254\",\"BSSSA001266\",\"BSSSA001271\",\"BSSSA001283\",\"BSSSA001295\",\"BSSSA001300\",\"BSSSA001312\");\n} //fin de if($IdEstado == \"03\")\n\n//Condicion de estado-clues\nif($IdEstado == \"04\"){\n\t$Clues = array(\"CCSSA000025\",\"CCSSA000030\",\"CCSSA000054\",\"CCSSA000066\",\"CCSSA000071\",\"CCSSA000083\",\"CCSSA000095\",\"CCSSA000100\",\"CCSSA000124\",\"CCSSA000141\",\"CCSSA000264\",\"CCSSA000276\",\"CCSSA000281\",\"CCSSA000293\",\"CCSSA000305\",\"CCSSA000310\",\"CCSSA000322\",\"CCSSA000334\",\"CCSSA000346\",\"CCSSA000363\",\"CCSSA000375\",\"CCSSA000380\",\"CCSSA000392\",\"CCSSA000404\",\"CCSSA000416\",\"CCSSA000421\",\"CCSSA000433\",\"CCSSA000445\",\"CCSSA000450\",\"CCSSA000462\",\"CCSSA000474\",\"CCSSA000486\",\"CCSSA000491\",\"CCSSA000503\",\"CCSSA000515\",\"CCSSA000532\",\"CCSSA000544\",\"CCSSA000556\",\"CCSSA000561\",\"CCSSA000573\",\"CCSSA000585\",\"CCSSA000590\",\"CCSSA000602\",\"CCSSA000614\",\"CCSSA000626\",\"CCSSA000631\",\"CCSSA000643\",\"CCSSA000655\",\"CCSSA000660\",\"CCSSA000672\",\"CCSSA000684\",\"CCSSA000696\",\"CCSSA000701\",\"CCSSA000713\",\"CCSSA000725\",\"CCSSA000730\",\"CCSSA000742\",\"CCSSA000754\",\"CCSSA000766\",\"CCSSA000771\",\"CCSSA000783\",\"CCSSA000795\",\"CCSSA000800\",\"CCSSA000812\",\"CCSSA000824\",\"CCSSA000865\",\"CCSSA000870\",\"CCSSA000882\",\"CCSSA000894\",\"CCSSA000906\",\"CCSSA000911\",\"CCSSA000923\",\"CCSSA000940\",\"CCSSA000952\",\"CCSSA000976\",\"CCSSA000981\",\"CCSSA000993\",\"CCSSA001005\",\"CCSSA001010\",\"CCSSA001022\",\"CCSSA001034\",\"CCSSA001051\",\"CCSSA001063\",\"CCSSA001075\",\"CCSSA001080\",\"CCSSA001092\",\"CCSSA001104\",\"CCSSA001203\",\"CCSSA001220\",\"CCSSA001232\",\"CCSSA001244\",\"CCSSA001256\",\"CCSSA001261\",\"CCSSA001273\",\"CCSSA001285\",\"CCSSA001290\",\"CCSSA001302\",\"CCSSA001314\",\"CCSSA001326\",\"CCSSA001331\",\"CCSSA001343\",\"CCSSA001360\",\"CCSSA001372\",\"CCSSA001384\",\"CCSSA001396\",\"CCSSA001401\",\"CCSSA001413\",\"CCSSA001425\",\"CCSSA001430\",\"CCSSA001454\",\"CCSSA001466\",\"CCSSA001471\",\"CCSSA001483\",\"CCSSA001495\",\"CCSSA001500\",\"CCSSA001512\",\"CCSSA001524\",\"CCSSA001536\",\"CCSSA001541\",\"CCSSA001553\",\"CCSSA017280\",\"CCSSA017292\",\"CCSSA017304\",\"CCSSA017316\",\"CCSSA017321\",\"CCSSA017333\",\"CCSSA017345\",\"CCSSA017350\",\"CCSSA017362\",\"CCSSA017374\",\"CCSSA017386\",\"CCSSA017391\",\"CCSSA017403\",\"CCSSA017426\",\"CCSSA017431\",\"CCSSA017443\",\"CCSSA017455\",\"CCSSA017460\",\"CCSSA017472\",\"CCSSA017496\",\"CCSSA017501\",\"CCSSA017513\",\"CCSSA017525\",\"CCSSA017530\",\"CCSSA017554\",\"CCSSA017566\",\"CCSSA017571\",\"CCSSA017583\",\"CCSSA017595\",\"CCSSA017600\",\"CCSSA017624\",\"CCSSA017636\",\"CCSSA017641\",\"CCSSA017653\",\"CCSSA017665\",\"CCSSA017670\",\"CCSSA017682\",\"CCSSA017694\",\"CCSSA017706\");\n} //fin de if($IdEstado == \"04\")\n\n//Condicion de estado-clues\nif($IdEstado == \"05\"){\n\t$Clues = array(\"CLSSA000016\",\"CLSSA000021\",\"CLSSA000033\",\"CLSSA000045\",\"CLSSA000050\",\"CLSSA000062\",\"CLSSA000074\",\"CLSSA000086\",\"CLSSA000091\",\"CLSSA000103\",\"CLSSA000115\",\"CLSSA000120\",\"CLSSA000132\",\"CLSSA000144\",\"CLSSA000156\",\"CLSSA000161\",\"CLSSA000173\",\"CLSSA000185\",\"CLSSA000190\",\"CLSSA000202\",\"CLSSA000214\",\"CLSSA000226\",\"CLSSA000231\",\"CLSSA000243\",\"CLSSA000255\",\"CLSSA000260\",\"CLSSA000272\",\"CLSSA000284\",\"CLSSA000296\",\"CLSSA000301\",\"CLSSA000313\",\"CLSSA000325\",\"CLSSA000330\",\"CLSSA000342\",\"CLSSA000354\",\"CLSSA000366\",\"CLSSA000371\",\"CLSSA000383\",\"CLSSA000395\",\"CLSSA000400\",\"CLSSA000412\",\"CLSSA000424\",\"CLSSA000436\",\"CLSSA000441\",\"CLSSA000453\",\"CLSSA000465\",\"CLSSA000470\",\"CLSSA000482\",\"CLSSA000494\",\"CLSSA000506\",\"CLSSA000511\",\"CLSSA000523\",\"CLSSA000535\",\"CLSSA000540\",\"CLSSA000552\",\"CLSSA000564\",\"CLSSA000576\",\"CLSSA000581\",\"CLSSA000593\",\"CLSSA000605\",\"CLSSA000610\",\"CLSSA000622\",\"CLSSA000634\",\"CLSSA000646\",\"CLSSA000651\",\"CLSSA000663\",\"CLSSA000675\",\"CLSSA000680\",\"CLSSA000692\",\"CLSSA000704\",\"CLSSA000716\",\"CLSSA000721\",\"CLSSA000733\",\"CLSSA000745\",\"CLSSA000750\",\"CLSSA000762\",\"CLSSA000774\",\"CLSSA000786\",\"CLSSA000803\",\"CLSSA000815\",\"CLSSA000820\",\"CLSSA000844\",\"CLSSA000856\",\"CLSSA000861\",\"CLSSA000873\",\"CLSSA000885\",\"CLSSA000890\",\"CLSSA000902\",\"CLSSA000914\",\"CLSSA000926\",\"CLSSA000931\",\"CLSSA000960\",\"CLSSA000972\",\"CLSSA000984\",\"CLSSA000996\",\"CLSSA001001\",\"CLSSA001013\",\"CLSSA001025\",\"CLSSA001030\",\"CLSSA001042\",\"CLSSA001054\",\"CLSSA001066\",\"CLSSA001071\",\"CLSSA001100\",\"CLSSA001112\",\"CLSSA001124\",\"CLSSA001136\",\"CLSSA001141\",\"CLSSA001153\",\"CLSSA001170\",\"CLSSA001182\",\"CLSSA001206\",\"CLSSA001211\",\"CLSSA001223\",\"CLSSA001235\",\"CLSSA001240\",\"CLSSA001252\",\"CLSSA001264\",\"CLSSA001276\",\"CLSSA001281\",\"CLSSA001293\",\"CLSSA001305\",\"CLSSA001310\",\"CLSSA001322\",\"CLSSA001334\",\"CLSSA001346\",\"CLSSA001351\",\"CLSSA001363\",\"CLSSA001375\",\"CLSSA001380\",\"CLSSA001392\",\"CLSSA001404\",\"CLSSA001416\",\"CLSSA001421\",\"CLSSA001433\",\"CLSSA001445\",\"CLSSA001450\",\"CLSSA001462\",\"CLSSA001474\",\"CLSSA001486\",\"CLSSA001491\",\"CLSSA001503\",\"CLSSA001515\",\"CLSSA001520\",\"CLSSA001532\",\"CLSSA001544\",\"CLSSA001556\",\"CLSSA001561\",\"CLSSA001573\",\"CLSSA001585\",\"CLSSA001590\",\"CLSSA001602\",\"CLSSA001614\",\"CLSSA001626\",\"CLSSA001631\",\"CLSSA001643\",\"CLSSA001655\",\"CLSSA001660\",\"CLSSA001672\",\"CLSSA001684\",\"CLSSA001696\",\"CLSSA001701\",\"CLSSA001713\",\"CLSSA001725\",\"CLSSA001730\",\"CLSSA001742\",\"CLSSA001754\",\"CLSSA001766\",\"CLSSA001771\",\"CLSSA001795\",\"CLSSA001800\",\"CLSSA001812\",\"CLSSA001824\",\"CLSSA001836\",\"CLSSA001841\",\"CLSSA001853\",\"CLSSA001865\",\"CLSSA001882\",\"CLSSA001894\",\"CLSSA001906\",\"CLSSA001923\",\"CLSSA001935\",\"CLSSA001940\",\"CLSSA001952\",\"CLSSA001964\",\"CLSSA001970\",\"CLSSA001982\",\"CLSSA001994\",\"CLSSA002006\",\"CLSSA002011\",\"CLSSA002023\",\"CLSSA002035\",\"CLSSA002040\",\"CLSSA002064\",\"CLSSA002076\",\"CLSSA002093\",\"CLSSA002105\",\"CLSSA002122\",\"CLSSA002134\",\"CLSSA002146\",\"CLSSA002175\",\"CLSSA002180\",\"CLSSA002192\",\"CLSSA002203\",\"CLSSA002215\",\"CLSSA002220\",\"CLSSA002232\",\"CLSSA002244\",\"CLSSA002256\",\"CLSSA002261\",\"CLSSA002273\",\"CLSSA002285\",\"CLSSA002290\",\"CLSSA002302\",\"CLSSA002314\",\"CLSSA002331\",\"CLSSA002343\",\"CLSSA002355\",\"CLSSA002360\",\"CLSSA002401\",\"CLSSA002413\",\"CLSSA002425\",\"CLSSA002430\",\"CLSSA002442\",\"CLSSA002454\",\"CLSSA002466\",\"CLSSA002471\",\"CLSSA002483\",\"CLSSA002495\",\"CLSSA002500\",\"CLSSA002512\",\"CLSSA002524\",\"CLSSA002536\",\"CLSSA002553\",\"CLSSA002570\",\"CLSSA002582\",\"CLSSA002594\",\"CLSSA002606\",\"CLSSA002611\",\"CLSSA002640\",\"CLSSA002710\",\"CLSSA002722\",\"CLSSA002734\",\"CLSSA002746\",\"CLSSA002751\",\"CLSSA002763\",\"CLSSA002780\",\"CLSSA002804\",\"CLSSA002816\",\"CLSSA002821\",\"CLSSA002833\",\"CLSSA002845\",\"CLSSA002850\");\n} //fin de if($IdEstado == \"05\")\n\n//Condicion de estado-clues\nif($IdEstado == \"06\"){\n\t$Clues = array(\"CMSSA000014\",\"CMSSA000026\",\"CMSSA000031\",\"CMSSA000043\",\"CMSSA000055\",\"CMSSA000060\",\"CMSSA000072\",\"CMSSA000084\",\"CMSSA000096\",\"CMSSA000101\",\"CMSSA000113\",\"CMSSA000125\",\"CMSSA000142\",\"CMSSA000154\",\"CMSSA000166\",\"CMSSA000171\",\"CMSSA000183\",\"CMSSA000195\",\"CMSSA000212\",\"CMSSA000224\",\"CMSSA000236\",\"CMSSA000241\",\"CMSSA000253\",\"CMSSA000265\",\"CMSSA000270\",\"CMSSA000282\",\"CMSSA000294\",\"CMSSA000306\",\"CMSSA000311\",\"CMSSA000323\",\"CMSSA000335\",\"CMSSA000340\",\"CMSSA000352\",\"CMSSA000364\",\"CMSSA000376\",\"CMSSA000381\",\"CMSSA000393\",\"CMSSA000410\",\"CMSSA000422\",\"CMSSA000434\",\"CMSSA000446\",\"CMSSA000451\",\"CMSSA000463\",\"CMSSA000475\",\"CMSSA000480\",\"CMSSA000492\",\"CMSSA000504\",\"CMSSA000516\",\"CMSSA000521\",\"CMSSA000533\",\"CMSSA000545\",\"CMSSA000550\",\"CMSSA000562\",\"CMSSA000574\",\"CMSSA000586\",\"CMSSA000591\",\"CMSSA000603\",\"CMSSA000615\",\"CMSSA000620\",\"CMSSA000632\",\"CMSSA000656\",\"CMSSA000661\",\"CMSSA000673\",\"CMSSA000685\",\"CMSSA000690\",\"CMSSA000702\",\"CMSSA000714\",\"CMSSA000726\",\"CMSSA000743\",\"CMSSA000755\",\"CMSSA000760\",\"CMSSA000772\",\"CMSSA000784\",\"CMSSA000796\",\"CMSSA000801\",\"CMSSA000813\",\"CMSSA000825\",\"CMSSA000830\",\"CMSSA000842\",\"CMSSA000854\",\"CMSSA000866\",\"CMSSA000871\",\"CMSSA000883\",\"CMSSA000895\",\"CMSSA000900\",\"CMSSA000912\",\"CMSSA000924\",\"CMSSA000936\",\"CMSSA000941\",\"CMSSA000953\",\"CMSSA000965\",\"CMSSA000970\",\"CMSSA000982\",\"CMSSA000994\",\"CMSSA001006\",\"CMSSA001011\",\"CMSSA001023\",\"CMSSA001035\",\"CMSSA001040\",\"CMSSA001052\",\"CMSSA001064\",\"CMSSA001076\",\"CMSSA001081\",\"CMSSA001093\",\"CMSSA001105\",\"CMSSA001110\",\"CMSSA001122\",\"CMSSA001134\",\"CMSSA001146\",\"CMSSA001151\",\"CMSSA001163\",\"CMSSA001175\",\"CMSSA001180\",\"CMSSA001192\",\"CMSSA001204\",\"CMSSA001216\",\"CMSSA001221\",\"CMSSA001233\",\"CMSSA001245\",\"CMSSA001250\",\"CMSSA001262\",\"CMSSA001274\",\"CMSSA001286\",\"CMSSA001291\",\"CMSSA001303\",\"CMSSA001315\",\"CMSSA001320\",\"CMSSA001344\",\"CMSSA001356\",\"CMSSA010433\",\"CMSSA010445\",\"CMSSA010450\",\"CMSSA010462\",\"CMSSA010474\",\"CMSSA010486\",\"CMSSA010491\",\"CMSSA010503\",\"CMSSA010515\",\"CMSSA010520\",\"CMSSA010532\",\"CMSSA010543\",\"CMSSA010555\",\"CMSSA010712\",\"CMSSA010724\",\"CMSSA010736\",\"CMSSA010741\",\"CMSSA010753\",\"CMSSA010765\",\"CMSSA010770\",\"CMSSA010782\",\"CMSSA010794\",\"CMSSA010806\",\"CMSSA010811\",\"CMSSA010823\",\"CMSSA010835\",\"CMSSA010840\",\"CMSSA010852\",\"CMSSA010864\",\"CMSSA010876\",\"CMSSA010881\",\"CMSSA010893\",\"CMSSA010905\",\"CMSSA010910\",\"CMSSA010922\",\"CMSSA010934\",\"CMSSA010946\",\"CMSSA010951\",\"CMSSA010963\",\"CMSSA010975\",\"CMSSA010980\",\"CMSSA010992\",\"CMSSA011004\",\"CMSSA011016\",\"CMSSA011021\");\n} //fin de if($IdEstado == \"06\")\n\n//Condicion de estado-clues\nif($IdEstado == \"07\"){\n\t$Clues = array(\"CSSSA000016\",\"CSSSA000021\",\"CSSSA000033\",\"CSSSA000045\",\"CSSSA000050\",\"CSSSA000062\",\"CSSSA000074\",\"CSSSA000086\",\"CSSSA000091\",\"CSSSA000103\",\"CSSSA000120\",\"CSSSA000132\",\"CSSSA000144\",\"CSSSA000156\",\"CSSSA000161\",\"CSSSA000173\",\"CSSSA000185\",\"CSSSA000190\",\"CSSSA000202\",\"CSSSA000214\",\"CSSSA000226\",\"CSSSA000243\",\"CSSSA000255\",\"CSSSA000260\",\"CSSSA000272\",\"CSSSA000284\",\"CSSSA000301\",\"CSSSA000313\",\"CSSSA000325\",\"CSSSA000342\",\"CSSSA000354\",\"CSSSA000366\",\"CSSSA000371\",\"CSSSA000383\",\"CSSSA000395\",\"CSSSA000400\",\"CSSSA000412\",\"CSSSA000424\",\"CSSSA000436\",\"CSSSA000441\",\"CSSSA000453\",\"CSSSA000465\",\"CSSSA000470\",\"CSSSA000482\",\"CSSSA000494\",\"CSSSA000506\",\"CSSSA000511\",\"CSSSA000523\",\"CSSSA000535\",\"CSSSA000540\",\"CSSSA000552\",\"CSSSA000564\",\"CSSSA000576\",\"CSSSA000581\",\"CSSSA000593\",\"CSSSA000605\",\"CSSSA000610\",\"CSSSA000622\",\"CSSSA000634\",\"CSSSA000646\",\"CSSSA000651\",\"CSSSA000663\",\"CSSSA000675\",\"CSSSA000680\",\"CSSSA000692\",\"CSSSA000704\",\"CSSSA000716\",\"CSSSA000733\",\"CSSSA000745\",\"CSSSA000750\",\"CSSSA000762\",\"CSSSA000774\",\"CSSSA000786\",\"CSSSA000791\",\"CSSSA000803\",\"CSSSA000815\",\"CSSSA000820\",\"CSSSA000832\",\"CSSSA000844\",\"CSSSA000856\",\"CSSSA000861\",\"CSSSA000885\",\"CSSSA000890\",\"CSSSA000902\",\"CSSSA000914\",\"CSSSA000926\",\"CSSSA000931\",\"CSSSA000943\",\"CSSSA000955\",\"CSSSA000972\",\"CSSSA000996\",\"CSSSA001001\",\"CSSSA001013\",\"CSSSA001025\",\"CSSSA001030\",\"CSSSA001042\",\"CSSSA001054\",\"CSSSA001066\",\"CSSSA001071\",\"CSSSA001083\",\"CSSSA001095\",\"CSSSA001100\",\"CSSSA001112\",\"CSSSA001124\",\"CSSSA001136\",\"CSSSA001141\",\"CSSSA001165\",\"CSSSA001170\",\"CSSSA001182\",\"CSSSA001194\",\"CSSSA001206\",\"CSSSA001211\",\"CSSSA001223\",\"CSSSA001235\",\"CSSSA001240\",\"CSSSA001252\",\"CSSSA001264\",\"CSSSA001276\",\"CSSSA001281\",\"CSSSA001293\",\"CSSSA001305\",\"CSSSA001322\",\"CSSSA001334\",\"CSSSA001346\",\"CSSSA001351\",\"CSSSA001363\",\"CSSSA001375\",\"CSSSA001380\",\"CSSSA001392\",\"CSSSA001404\",\"CSSSA001421\",\"CSSSA001433\",\"CSSSA001445\",\"CSSSA001450\",\"CSSSA001462\",\"CSSSA001474\",\"CSSSA001491\",\"CSSSA001503\",\"CSSSA001515\",\"CSSSA001520\",\"CSSSA001532\",\"CSSSA001556\",\"CSSSA001561\",\"CSSSA001573\",\"CSSSA001585\",\"CSSSA001602\",\"CSSSA001614\",\"CSSSA001626\",\"CSSSA001631\",\"CSSSA001643\",\"CSSSA001655\",\"CSSSA001660\",\"CSSSA001672\",\"CSSSA001684\",\"CSSSA001696\",\"CSSSA001701\",\"CSSSA001725\",\"CSSSA001730\",\"CSSSA001742\",\"CSSSA001754\",\"CSSSA001766\",\"CSSSA001771\",\"CSSSA001783\",\"CSSSA001795\",\"CSSSA001800\",\"CSSSA001812\",\"CSSSA001824\",\"CSSSA001836\",\"CSSSA001841\",\"CSSSA001894\",\"CSSSA001906\",\"CSSSA001911\",\"CSSSA001923\",\"CSSSA001940\",\"CSSSA001952\",\"CSSSA001976\",\"CSSSA002005\",\"CSSSA002010\",\"CSSSA002080\",\"CSSSA002104\",\"CSSSA002121\",\"CSSSA002145\",\"CSSSA002162\",\"CSSSA002203\",\"CSSSA002215\",\"CSSSA002220\",\"CSSSA002232\",\"CSSSA002244\",\"CSSSA002256\",\"CSSSA002261\",\"CSSSA002273\",\"CSSSA002290\",\"CSSSA002314\",\"CSSSA002326\",\"CSSSA002331\",\"CSSSA002343\",\"CSSSA002355\",\"CSSSA002360\",\"CSSSA002372\",\"CSSSA002384\",\"CSSSA002396\",\"CSSSA002401\",\"CSSSA002413\",\"CSSSA002425\",\"CSSSA002430\",\"CSSSA002442\",\"CSSSA002454\",\"CSSSA002466\",\"CSSSA002483\",\"CSSSA002495\",\"CSSSA002500\",\"CSSSA002512\",\"CSSSA002524\",\"CSSSA002541\",\"CSSSA002553\",\"CSSSA002565\",\"CSSSA002570\",\"CSSSA002582\",\"CSSSA002594\",\"CSSSA002611\",\"CSSSA002623\",\"CSSSA002635\",\"CSSSA002640\",\"CSSSA002652\",\"CSSSA002664\",\"CSSSA002676\",\"CSSSA002681\",\"CSSSA002693\",\"CSSSA002705\",\"CSSSA002710\",\"CSSSA002722\",\"CSSSA002734\",\"CSSSA002746\",\"CSSSA002763\",\"CSSSA002775\",\"CSSSA002780\",\"CSSSA002792\",\"CSSSA002816\",\"CSSSA002821\",\"CSSSA002833\",\"CSSSA002845\",\"CSSSA002850\",\"CSSSA002862\",\"CSSSA002874\",\"CSSSA002886\",\"CSSSA002891\",\"CSSSA002903\",\"CSSSA002920\",\"CSSSA002932\",\"CSSSA002944\",\"CSSSA002956\",\"CSSSA002961\",\"CSSSA002973\",\"CSSSA002985\",\"CSSSA002990\",\"CSSSA003002\",\"CSSSA003026\",\"CSSSA003031\",\"CSSSA003043\",\"CSSSA003055\",\"CSSSA003060\",\"CSSSA003084\",\"CSSSA003096\",\"CSSSA003101\",\"CSSSA003113\",\"CSSSA003125\",\"CSSSA003130\",\"CSSSA003142\",\"CSSSA003166\",\"CSSSA003171\",\"CSSSA003183\",\"CSSSA003195\",\"CSSSA003200\",\"CSSSA003212\",\"CSSSA003224\",\"CSSSA003236\",\"CSSSA003241\",\"CSSSA003253\",\"CSSSA003265\",\"CSSSA003270\",\"CSSSA003294\",\"CSSSA003306\",\"CSSSA003311\",\"CSSSA003323\",\"CSSSA003340\",\"CSSSA003352\",\"CSSSA003364\",\"CSSSA003376\",\"CSSSA003381\",\"CSSSA003393\",\"CSSSA003405\",\"CSSSA003410\",\"CSSSA003422\",\"CSSSA003434\",\"CSSSA003451\",\"CSSSA003475\",\"CSSSA003480\",\"CSSSA003492\",\"CSSSA003504\",\"CSSSA003516\",\"CSSSA003521\",\"CSSSA003533\",\"CSSSA003545\",\"CSSSA003550\",\"CSSSA003562\",\"CSSSA003574\",\"CSSSA003586\",\"CSSSA003591\",\"CSSSA003603\",\"CSSSA003615\",\"CSSSA003620\",\"CSSSA003644\",\"CSSSA003656\",\"CSSSA003661\",\"CSSSA003673\",\"CSSSA003685\",\"CSSSA003690\",\"CSSSA003702\",\"CSSSA003714\",\"CSSSA003726\",\"CSSSA003731\",\"CSSSA003743\",\"CSSSA003755\",\"CSSSA003760\",\"CSSSA003772\",\"CSSSA003784\",\"CSSSA003796\",\"CSSSA003801\",\"CSSSA003813\",\"CSSSA003825\",\"CSSSA003830\",\"CSSSA003842\",\"CSSSA003854\",\"CSSSA003866\",\"CSSSA003883\",\"CSSSA003895\",\"CSSSA003900\",\"CSSSA003912\",\"CSSSA003936\",\"CSSSA003941\",\"CSSSA003953\",\"CSSSA003965\",\"CSSSA003970\",\"CSSSA003982\",\"CSSSA003994\",\"CSSSA004006\",\"CSSSA004011\",\"CSSSA004023\",\"CSSSA004035\",\"CSSSA004040\",\"CSSSA004052\",\"CSSSA004064\",\"CSSSA004076\",\"CSSSA004081\",\"CSSSA004093\",\"CSSSA004105\",\"CSSSA004110\",\"CSSSA004122\",\"CSSSA004134\",\"CSSSA004146\",\"CSSSA004151\",\"CSSSA004163\",\"CSSSA004175\",\"CSSSA004180\",\"CSSSA004192\",\"CSSSA004204\",\"CSSSA004216\",\"CSSSA004221\",\"CSSSA004233\",\"CSSSA004245\",\"CSSSA004250\",\"CSSSA004262\",\"CSSSA004274\",\"CSSSA004286\",\"CSSSA004291\",\"CSSSA004303\",\"CSSSA004320\",\"CSSSA004332\",\"CSSSA004344\",\"CSSSA004356\",\"CSSSA004361\",\"CSSSA004373\",\"CSSSA004385\",\"CSSSA004390\",\"CSSSA004402\",\"CSSSA004426\",\"CSSSA004431\",\"CSSSA004443\",\"CSSSA004455\",\"CSSSA004460\",\"CSSSA004472\",\"CSSSA004484\",\"CSSSA004496\",\"CSSSA004501\",\"CSSSA004513\",\"CSSSA004525\",\"CSSSA004530\",\"CSSSA004542\",\"CSSSA004566\",\"CSSSA004571\",\"CSSSA004583\",\"CSSSA004595\",\"CSSSA004600\",\"CSSSA004612\",\"CSSSA004624\",\"CSSSA004636\",\"CSSSA004641\",\"CSSSA004653\",\"CSSSA004665\",\"CSSSA004670\",\"CSSSA004682\",\"CSSSA004694\",\"CSSSA004711\",\"CSSSA004723\",\"CSSSA004735\",\"CSSSA004740\",\"CSSSA004764\",\"CSSSA004776\",\"CSSSA004781\",\"CSSSA004793\",\"CSSSA004805\",\"CSSSA004810\",\"CSSSA004822\",\"CSSSA004834\",\"CSSSA004846\",\"CSSSA004851\",\"CSSSA004863\",\"CSSSA004875\",\"CSSSA004880\",\"CSSSA004904\",\"CSSSA004916\",\"CSSSA004945\",\"CSSSA004950\",\"CSSSA004962\",\"CSSSA004986\",\"CSSSA004991\",\"CSSSA005003\",\"CSSSA005015\",\"CSSSA005020\",\"CSSSA005032\",\"CSSSA005044\",\"CSSSA005056\",\"CSSSA005061\",\"CSSSA005073\",\"CSSSA005085\",\"CSSSA005090\",\"CSSSA005102\",\"CSSSA005114\",\"CSSSA005126\",\"CSSSA005131\",\"CSSSA005143\",\"CSSSA005155\",\"CSSSA005160\",\"CSSSA005172\",\"CSSSA005184\",\"CSSSA005196\",\"CSSSA005201\",\"CSSSA005213\",\"CSSSA005225\",\"CSSSA005230\",\"CSSSA005242\",\"CSSSA005254\",\"CSSSA005266\",\"CSSSA005271\",\"CSSSA005283\",\"CSSSA005295\",\"CSSSA005300\",\"CSSSA005312\",\"CSSSA005324\",\"CSSSA005336\",\"CSSSA005341\",\"CSSSA005353\",\"CSSSA005370\",\"CSSSA005382\",\"CSSSA005394\",\"CSSSA005406\",\"CSSSA005411\",\"CSSSA005423\",\"CSSSA005435\",\"CSSSA005440\",\"CSSSA005452\",\"CSSSA005464\",\"CSSSA005481\",\"CSSSA005493\",\"CSSSA005505\",\"CSSSA005510\",\"CSSSA005522\",\"CSSSA005534\",\"CSSSA005546\",\"CSSSA005551\",\"CSSSA005563\",\"CSSSA005575\",\"CSSSA005580\",\"CSSSA005592\",\"CSSSA005604\",\"CSSSA005616\",\"CSSSA005621\",\"CSSSA005633\",\"CSSSA005645\",\"CSSSA005650\",\"CSSSA005662\",\"CSSSA005674\",\"CSSSA005686\",\"CSSSA005691\",\"CSSSA005715\",\"CSSSA005720\",\"CSSSA005732\",\"CSSSA005744\",\"CSSSA005756\",\"CSSSA005761\",\"CSSSA005773\",\"CSSSA005785\",\"CSSSA005790\",\"CSSSA005802\",\"CSSSA005814\",\"CSSSA005826\",\"CSSSA005831\",\"CSSSA005843\",\"CSSSA005855\",\"CSSSA005860\",\"CSSSA005872\",\"CSSSA005884\",\"CSSSA005896\",\"CSSSA005901\",\"CSSSA005913\",\"CSSSA005925\",\"CSSSA005930\",\"CSSSA005942\",\"CSSSA005954\",\"CSSSA005966\",\"CSSSA005971\",\"CSSSA005983\",\"CSSSA005995\",\"CSSSA006000\",\"CSSSA006012\",\"CSSSA006024\",\"CSSSA006036\",\"CSSSA006041\",\"CSSSA006053\",\"CSSSA006065\",\"CSSSA006070\",\"CSSSA006082\",\"CSSSA006094\",\"CSSSA006106\",\"CSSSA006111\",\"CSSSA006135\",\"CSSSA006140\",\"CSSSA006152\",\"CSSSA006164\",\"CSSSA006176\",\"CSSSA006181\",\"CSSSA006205\",\"CSSSA006210\",\"CSSSA006222\",\"CSSSA006234\",\"CSSSA006263\",\"CSSSA006275\",\"CSSSA006280\",\"CSSSA006292\",\"CSSSA006304\",\"CSSSA006316\",\"CSSSA006321\",\"CSSSA006333\",\"CSSSA006345\",\"CSSSA006350\",\"CSSSA006362\",\"CSSSA006374\",\"CSSSA006386\",\"CSSSA006391\",\"CSSSA006403\",\"CSSSA006415\",\"CSSSA006420\",\"CSSSA006432\",\"CSSSA006444\",\"CSSSA006456\",\"CSSSA006461\",\"CSSSA006473\",\"CSSSA006485\",\"CSSSA006490\",\"CSSSA006502\",\"CSSSA006514\",\"CSSSA006526\",\"CSSSA006531\",\"CSSSA006543\",\"CSSSA006555\",\"CSSSA006560\",\"CSSSA006572\",\"CSSSA006584\",\"CSSSA006596\",\"CSSSA006601\",\"CSSSA006613\",\"CSSSA006625\",\"CSSSA006630\",\"CSSSA006642\",\"CSSSA006654\",\"CSSSA006666\",\"CSSSA006683\",\"CSSSA006695\",\"CSSSA006700\",\"CSSSA006712\",\"CSSSA006724\",\"CSSSA006736\",\"CSSSA006741\",\"CSSSA006753\",\"CSSSA006765\",\"CSSSA006770\",\"CSSSA006782\",\"CSSSA006794\",\"CSSSA006806\",\"CSSSA006811\",\"CSSSA006823\",\"CSSSA006835\",\"CSSSA006840\",\"CSSSA006852\",\"CSSSA006864\",\"CSSSA006876\",\"CSSSA006881\",\"CSSSA006893\",\"CSSSA006905\",\"CSSSA006910\",\"CSSSA006922\",\"CSSSA006934\",\"CSSSA006946\",\"CSSSA006951\",\"CSSSA006963\",\"CSSSA006975\",\"CSSSA006980\",\"CSSSA006992\",\"CSSSA007004\",\"CSSSA007016\",\"CSSSA007021\",\"CSSSA007033\",\"CSSSA007045\",\"CSSSA007050\",\"CSSSA007062\",\"CSSSA007074\",\"CSSSA007086\",\"CSSSA007091\",\"CSSSA007103\",\"CSSSA007115\",\"CSSSA007120\",\"CSSSA007132\",\"CSSSA007144\",\"CSSSA007156\",\"CSSSA007161\",\"CSSSA007173\",\"CSSSA007185\",\"CSSSA007190\",\"CSSSA007202\",\"CSSSA007214\",\"CSSSA007226\",\"CSSSA007231\",\"CSSSA007243\",\"CSSSA007255\",\"CSSSA007260\",\"CSSSA007284\",\"CSSSA007296\",\"CSSSA007301\",\"CSSSA007313\",\"CSSSA007325\",\"CSSSA007330\",\"CSSSA007342\",\"CSSSA007354\",\"CSSSA007366\",\"CSSSA007371\",\"CSSSA007383\",\"CSSSA007395\",\"CSSSA007400\",\"CSSSA007412\",\"CSSSA007424\",\"CSSSA007436\",\"CSSSA007453\",\"CSSSA007465\",\"CSSSA007470\",\"CSSSA007494\",\"CSSSA007506\",\"CSSSA007511\",\"CSSSA007523\",\"CSSSA007535\",\"CSSSA007540\",\"CSSSA007552\",\"CSSSA007564\",\"CSSSA007576\",\"CSSSA007581\",\"CSSSA007593\",\"CSSSA007605\",\"CSSSA007610\",\"CSSSA007622\",\"CSSSA007634\",\"CSSSA007646\",\"CSSSA007651\",\"CSSSA007663\",\"CSSSA007675\",\"CSSSA007680\",\"CSSSA007692\",\"CSSSA007704\",\"CSSSA007716\",\"CSSSA007721\",\"CSSSA007733\",\"CSSSA007745\",\"CSSSA007750\",\"CSSSA007762\",\"CSSSA007786\",\"CSSSA007791\",\"CSSSA007803\",\"CSSSA007815\",\"CSSSA007820\",\"CSSSA007832\",\"CSSSA007844\",\"CSSSA007861\",\"CSSSA007885\",\"CSSSA007890\",\"CSSSA007902\",\"CSSSA007914\",\"CSSSA007926\",\"CSSSA007931\",\"CSSSA007943\",\"CSSSA007955\",\"CSSSA007960\",\"CSSSA007972\",\"CSSSA007984\",\"CSSSA007996\",\"CSSSA008001\",\"CSSSA008013\",\"CSSSA008025\",\"CSSSA008030\",\"CSSSA008042\",\"CSSSA008066\",\"CSSSA008071\",\"CSSSA008083\",\"CSSSA008095\",\"CSSSA008100\",\"CSSSA008112\",\"CSSSA008124\",\"CSSSA008136\",\"CSSSA008141\",\"CSSSA008153\",\"CSSSA008165\",\"CSSSA008170\",\"CSSSA008182\",\"CSSSA008194\",\"CSSSA008206\",\"CSSSA008211\",\"CSSSA008223\",\"CSSSA008235\",\"CSSSA008240\",\"CSSSA008252\",\"CSSSA008264\",\"CSSSA008276\",\"CSSSA008281\",\"CSSSA008293\",\"CSSSA008305\",\"CSSSA008310\",\"CSSSA008322\",\"CSSSA008334\",\"CSSSA008346\",\"CSSSA008351\",\"CSSSA008363\",\"CSSSA008375\",\"CSSSA008380\",\"CSSSA008392\",\"CSSSA008416\",\"CSSSA008421\",\"CSSSA008433\",\"CSSSA008445\",\"CSSSA008450\",\"CSSSA008474\",\"CSSSA008491\",\"CSSSA008503\",\"CSSSA008515\",\"CSSSA008520\",\"CSSSA008590\",\"CSSSA008614\",\"CSSSA008631\",\"CSSSA008643\",\"CSSSA008655\",\"CSSSA008672\",\"CSSSA008684\",\"CSSSA008696\",\"CSSSA008701\",\"CSSSA008713\",\"CSSSA008725\",\"CSSSA008754\",\"CSSSA008771\",\"CSSSA008812\",\"CSSSA008824\",\"CSSSA008836\",\"CSSSA008841\",\"CSSSA008853\",\"CSSSA008865\",\"CSSSA008870\",\"CSSSA008882\",\"CSSSA008894\",\"CSSSA008906\",\"CSSSA008911\",\"CSSSA008923\",\"CSSSA008935\",\"CSSSA008952\",\"CSSSA008964\",\"CSSSA008976\",\"CSSSA008981\",\"CSSSA008993\",\"CSSSA009005\",\"CSSSA009010\",\"CSSSA009022\",\"CSSSA009034\",\"CSSSA009046\",\"CSSSA009051\",\"CSSSA009063\",\"CSSSA009075\",\"CSSSA009080\",\"CSSSA009092\",\"CSSSA009104\",\"CSSSA009116\",\"CSSSA009121\",\"CSSSA009133\",\"CSSSA009145\",\"CSSSA009150\",\"CSSSA009162\",\"CSSSA017166\",\"CSSSA017171\",\"CSSSA017183\",\"CSSSA017196\",\"CSSSA017213\",\"CSSSA017225\",\"CSSSA017230\",\"CSSSA017242\",\"CSSSA017266\",\"CSSSA017271\",\"CSSSA017283\",\"CSSSA017295\",\"CSSSA017300\",\"CSSSA017312\",\"CSSSA017324\",\"CSSSA017336\",\"CSSSA017341\",\"CSSSA017353\",\"CSSSA017365\",\"CSSSA017370\",\"CSSSA017382\",\"CSSSA017394\",\"CSSSA017406\",\"CSSSA017411\",\"CSSSA017435\",\"CSSSA017446\",\"CSSSA017451\",\"CSSSA017463\",\"CSSSA017480\",\"CSSSA017492\",\"CSSSA017504\",\"CSSSA017516\",\"CSSSA017521\",\"CSSSA017533\",\"CSSSA017545\",\"CSSSA017550\",\"CSSSA017562\",\"CSSSA017574\",\"CSSSA017586\",\"CSSSA017591\",\"CSSSA017603\",\"CSSSA017615\",\"CSSSA017620\",\"CSSSA017632\",\"CSSSA017656\",\"CSSSA017661\",\"CSSSA017673\",\"CSSSA017685\",\"CSSSA017690\",\"CSSSA017702\",\"CSSSA017714\",\"CSSSA017726\",\"CSSSA017731\",\"CSSSA017743\",\"CSSSA017755\",\"CSSSA017760\",\"CSSSA017772\",\"CSSSA017784\",\"CSSSA017801\",\"CSSSA017813\",\"CSSSA017825\",\"CSSSA017830\",\"CSSSA017842\",\"CSSSA017854\",\"CSSSA017866\",\"CSSSA017883\",\"CSSSA017895\",\"CSSSA017900\",\"CSSSA017912\",\"CSSSA017924\",\"CSSSA017936\",\"CSSSA017941\",\"CSSSA017953\",\"CSSSA017965\",\"CSSSA017970\",\"CSSSA017982\",\"CSSSA017994\",\"CSSSA018006\",\"CSSSA018011\",\"CSSSA018023\",\"CSSSA018035\",\"CSSSA018040\",\"CSSSA018064\",\"CSSSA018076\",\"CSSSA018081\",\"CSSSA018093\",\"CSSSA018105\",\"CSSSA018110\",\"CSSSA018122\",\"CSSSA018134\",\"CSSSA018146\",\"CSSSA018151\",\"CSSSA018163\",\"CSSSA018175\",\"CSSSA018180\",\"CSSSA018192\",\"CSSSA018204\",\"CSSSA018216\",\"CSSSA018221\",\"CSSSA018233\",\"CSSSA018245\",\"CSSSA018250\",\"CSSSA018262\",\"CSSSA018274\",\"CSSSA018291\",\"CSSSA018303\",\"CSSSA018315\",\"CSSSA018320\",\"CSSSA018332\",\"CSSSA018344\",\"CSSSA018356\",\"CSSSA018361\",\"CSSSA018373\",\"CSSSA018385\",\"CSSSA018390\",\"CSSSA018402\",\"CSSSA018414\",\"CSSSA018426\",\"CSSSA018443\",\"CSSSA018455\",\"CSSSA018460\",\"CSSSA018472\",\"CSSSA018484\",\"CSSSA018496\",\"CSSSA018501\",\"CSSSA018513\",\"CSSSA018525\",\"CSSSA018530\",\"CSSSA018542\",\"CSSSA018554\",\"CSSSA018566\",\"CSSSA018571\",\"CSSSA018583\",\"CSSSA018595\",\"CSSSA018600\",\"CSSSA018612\",\"CSSSA018624\",\"CSSSA018636\",\"CSSSA018641\",\"CSSSA018653\",\"CSSSA018665\",\"CSSSA018670\",\"CSSSA018682\",\"CSSSA018694\",\"CSSSA018706\",\"CSSSA018711\",\"CSSSA018723\",\"CSSSA018735\",\"CSSSA018740\",\"CSSSA018752\",\"CSSSA018764\",\"CSSSA018776\",\"CSSSA018781\",\"CSSSA018793\",\"CSSSA018805\",\"CSSSA018810\",\"CSSSA018822\",\"CSSSA018834\",\"CSSSA018846\",\"CSSSA018851\",\"CSSSA018863\",\"CSSSA018875\",\"CSSSA018880\",\"CSSSA018892\",\"CSSSA018904\",\"CSSSA018916\",\"CSSSA018921\",\"CSSSA018933\",\"CSSSA018945\",\"CSSSA018950\",\"CSSSA018962\",\"CSSSA018974\",\"CSSSA018986\",\"CSSSA018991\",\"CSSSA019003\",\"CSSSA019015\",\"CSSSA019020\",\"CSSSA019032\",\"CSSSA019044\",\"CSSSA019056\",\"CSSSA019061\",\"CSSSA019073\",\"CSSSA019090\",\"CSSSA019102\",\"CSSSA019114\",\"CSSSA019126\",\"CSSSA019131\",\"CSSSA019143\",\"CSSSA019155\",\"CSSSA019160\",\"CSSSA019172\",\"CSSSA019184\",\"CSSSA019196\",\"CSSSA019201\",\"CSSSA019213\",\"CSSSA019225\",\"CSSSA019230\",\"CSSSA019242\",\"CSSSA019254\",\"CSSSA019266\",\"CSSSA019271\",\"CSSSA019283\",\"CSSSA019295\",\"CSSSA019300\",\"CSSSA019312\",\"CSSSA019324\",\"CSSSA019336\",\"CSSSA019341\",\"CSSSA019353\",\"CSSSA019365\",\"CSSSA019370\",\"CSSSA019382\",\"CSSSA019394\",\"CSSSA019406\",\"CSSSA019411\",\"CSSSA019423\",\"CSSSA019435\",\"CSSSA019440\",\"CSSSA019452\",\"CSSSA019464\",\"CSSSA019476\",\"CSSSA019481\",\"CSSSA019493\",\"CSSSA019505\",\"CSSSA019510\",\"CSSSA019522\",\"CSSSA019534\",\"CSSSA019546\",\"CSSSA019551\",\"CSSSA019563\",\"CSSSA019575\",\"CSSSA019580\",\"CSSSA019592\",\"CSSSA019604\",\"CSSSA019616\",\"CSSSA019621\",\"CSSSA019633\",\"CSSSA019645\",\"CSSSA019650\",\"CSSSA019662\",\"CSSSA019674\",\"CSSSA019686\",\"CSSSA019691\",\"CSSSA019703\",\"CSSSA019715\",\"CSSSA019720\",\"CSSSA019732\",\"CSSSA019744\",\"CSSSA019756\",\"CSSSA019761\",\"CSSSA019773\",\"CSSSA019785\",\"CSSSA019790\",\"CSSSA019802\",\"CSSSA019814\",\"CSSSA019826\",\"CSSSA019831\",\"CSSSA019843\",\"CSSSA019855\",\"CSSSA019860\",\"CSSSA019872\",\"CSSSA019884\",\"CSSSA019896\",\"CSSSA019901\",\"CSSSA019913\",\"CSSSA019925\",\"CSSSA019930\",\"CSSSA019942\",\"CSSSA019954\",\"CSSSA019966\",\"CSSSA019971\",\"CSSSA019983\",\"CSSSA019995\",\"CSSSA020000\",\"CSSSA020012\",\"CSSSA020024\",\"CSSSA020036\",\"CSSSA020041\",\"CSSSA020053\",\"CSSSA020065\",\"CSSSA020070\",\"CSSSA020082\",\"CSSSA020094\",\"CSSSA020106\",\"CSSSA020111\",\"CSSSA020123\",\"CSSSA020135\",\"CSSSA020140\",\"CSSSA020152\",\"CSSSA020164\",\"CSSSA020176\");\n} //fin de if($IdEstado == \"07\")\n\n//Condicion de estado-clues\nif($IdEstado == \"08\"){\n\t$Clues = array(\"CHSSA000022\",\"CHSSA000034\",\"CHSSA000075\",\"CHSSA000080\",\"CHSSA000104\",\"CHSSA000133\",\"CHSSA000150\",\"CHSSA000162\",\"CHSSA000191\",\"CHSSA000203\",\"CHSSA000215\",\"CHSSA000220\",\"CHSSA000232\",\"CHSSA000261\",\"CHSSA000273\",\"CHSSA000290\",\"CHSSA000302\",\"CHSSA000314\",\"CHSSA000326\",\"CHSSA000343\",\"CHSSA000355\",\"CHSSA000360\",\"CHSSA000372\",\"CHSSA000384\",\"CHSSA000396\",\"CHSSA000401\",\"CHSSA000413\",\"CHSSA000425\",\"CHSSA000430\",\"CHSSA000454\",\"CHSSA000466\",\"CHSSA000471\",\"CHSSA000483\",\"CHSSA000495\",\"CHSSA000500\",\"CHSSA000512\",\"CHSSA000524\",\"CHSSA000541\",\"CHSSA000553\",\"CHSSA000565\",\"CHSSA000570\",\"CHSSA000582\",\"CHSSA000594\",\"CHSSA000606\",\"CHSSA000611\",\"CHSSA000623\",\"CHSSA000640\",\"CHSSA000652\",\"CHSSA000664\",\"CHSSA000676\",\"CHSSA000681\",\"CHSSA000705\",\"CHSSA000722\",\"CHSSA000734\",\"CHSSA000746\",\"CHSSA000751\",\"CHSSA000891\",\"CHSSA000903\",\"CHSSA000915\",\"CHSSA000920\",\"CHSSA000932\",\"CHSSA000944\",\"CHSSA000956\",\"CHSSA000961\",\"CHSSA000973\",\"CHSSA000985\",\"CHSSA000990\",\"CHSSA001002\",\"CHSSA001026\",\"CHSSA001031\",\"CHSSA001055\",\"CHSSA001060\",\"CHSSA001072\",\"CHSSA001084\",\"CHSSA001096\",\"CHSSA001101\",\"CHSSA001113\",\"CHSSA001125\",\"CHSSA001130\",\"CHSSA001142\",\"CHSSA001166\",\"CHSSA001171\",\"CHSSA001183\",\"CHSSA001195\",\"CHSSA001241\",\"CHSSA001253\",\"CHSSA001265\",\"CHSSA001270\",\"CHSSA001282\",\"CHSSA001306\",\"CHSSA001323\",\"CHSSA001340\",\"CHSSA001364\",\"CHSSA001381\",\"CHSSA001393\",\"CHSSA001405\",\"CHSSA001422\",\"CHSSA001434\",\"CHSSA001446\",\"CHSSA001451\",\"CHSSA001463\",\"CHSSA001475\",\"CHSSA001492\",\"CHSSA001504\",\"CHSSA001516\",\"CHSSA001521\",\"CHSSA001533\",\"CHSSA001545\",\"CHSSA001550\",\"CHSSA001562\",\"CHSSA001574\",\"CHSSA001586\",\"CHSSA001591\",\"CHSSA001603\",\"CHSSA001620\",\"CHSSA001644\",\"CHSSA001656\",\"CHSSA001661\",\"CHSSA001673\",\"CHSSA001685\",\"CHSSA001690\",\"CHSSA001726\",\"CHSSA001743\",\"CHSSA001755\",\"CHSSA001760\",\"CHSSA001772\",\"CHSSA001784\",\"CHSSA001796\",\"CHSSA001801\",\"CHSSA001813\",\"CHSSA001842\",\"CHSSA001866\",\"CHSSA001871\",\"CHSSA001883\",\"CHSSA001895\",\"CHSSA001900\",\"CHSSA001912\",\"CHSSA001941\",\"CHSSA001953\",\"CHSSA001970\",\"CHSSA001982\",\"CHSSA002006\",\"CHSSA002011\",\"CHSSA002023\",\"CHSSA002040\",\"CHSSA002081\",\"CHSSA002093\",\"CHSSA002105\",\"CHSSA002110\",\"CHSSA002122\",\"CHSSA002134\",\"CHSSA002146\",\"CHSSA002151\",\"CHSSA002163\",\"CHSSA002175\",\"CHSSA002192\",\"CHSSA002233\",\"CHSSA002245\",\"CHSSA002250\",\"CHSSA002262\",\"CHSSA002274\",\"CHSSA002286\",\"CHSSA002291\",\"CHSSA002303\",\"CHSSA002315\",\"CHSSA002332\",\"CHSSA002344\",\"CHSSA002356\",\"CHSSA002361\",\"CHSSA002385\",\"CHSSA002390\",\"CHSSA002402\",\"CHSSA002414\",\"CHSSA002426\",\"CHSSA002431\",\"CHSSA002443\",\"CHSSA002455\",\"CHSSA002460\",\"CHSSA002484\",\"CHSSA002496\",\"CHSSA002501\",\"CHSSA002525\",\"CHSSA002530\",\"CHSSA002554\",\"CHSSA002566\",\"CHSSA002571\",\"CHSSA002583\",\"CHSSA002595\",\"CHSSA002600\",\"CHSSA002636\",\"CHSSA002653\",\"CHSSA002670\",\"CHSSA002682\",\"CHSSA002706\",\"CHSSA002711\",\"CHSSA002723\",\"CHSSA002735\",\"CHSSA002740\",\"CHSSA002752\",\"CHSSA002764\",\"CHSSA002834\",\"CHSSA002846\",\"CHSSA002851\",\"CHSSA002880\",\"CHSSA002904\",\"CHSSA002916\",\"CHSSA002921\",\"CHSSA017412\",\"CHSSA017424\",\"CHSSA017436\",\"CHSSA017441\",\"CHSSA017465\",\"CHSSA017470\",\"CHSSA017482\",\"CHSSA017494\",\"CHSSA017506\",\"CHSSA017511\",\"CHSSA017523\",\"CHSSA017535\",\"CHSSA017540\",\"CHSSA017552\",\"CHSSA017564\",\"CHSSA017576\",\"CHSSA017581\",\"CHSSA017593\",\"CHSSA017605\",\"CHSSA017610\",\"CHSSA017622\",\"CHSSA017634\",\"CHSSA017646\",\"CHSSA017651\",\"CHSSA017663\",\"CHSSA017675\",\"CHSSA017686\",\"CHSSA017691\",\"CHSSA017703\",\"CHSSA017715\",\"CHSSA017720\",\"CHSSA017732\",\"CHSSA017744\",\"CHSSA017761\",\"CHSSA017773\",\"CHSSA017785\",\"CHSSA017790\",\"CHSSA017802\",\"CHSSA017814\",\"CHSSA017826\",\"CHSSA017831\",\"CHSSA017855\",\"CHSSA017860\",\"CHSSA017872\",\"CHSSA017884\",\"CHSSA017896\",\"CHSSA017901\",\"CHSSA017913\",\"CHSSA017925\",\"CHSSA017930\",\"CHSSA017942\",\"CHSSA017954\",\"CHSSA017966\",\"CHSSA017971\",\"CHSSA017983\",\"CHSSA017995\",\"CHSSA018000\",\"CHSSA018012\",\"CHSSA018024\",\"CHSSA018036\",\"CHSSA018041\",\"CHSSA018053\",\"CHSSA018065\",\"CHSSA018070\",\"CHSSA018082\",\"CHSSA018094\",\"CHSSA018106\",\"CHSSA018111\",\"CHSSA018123\",\"CHSSA018135\",\"CHSSA018140\",\"CHSSA018152\",\"CHSSA018164\",\"CHSSA018176\",\"CHSSA018181\",\"CHSSA018193\",\"CHSSA018205\",\"CHSSA018210\",\"CHSSA018222\",\"CHSSA018234\",\"CHSSA018246\",\"CHSSA018251\",\"CHSSA018263\",\"CHSSA018275\",\"CHSSA018280\",\"CHSSA018292\",\"CHSSA018304\",\"CHSSA018316\",\"CHSSA018321\",\"CHSSA018345\",\"CHSSA018350\",\"CHSSA018362\",\"CHSSA018374\",\"CHSSA018386\",\"CHSSA018403\",\"CHSSA018415\",\"CHSSA018420\",\"CHSSA018432\",\"CHSSA018444\",\"CHSSA018456\",\"CHSSA018461\",\"CHSSA018473\",\"CHSSA018485\",\"CHSSA018490\",\"CHSSA018502\",\"CHSSA018514\",\"CHSSA018526\",\"CHSSA018531\",\"CHSSA018543\",\"CHSSA018555\",\"CHSSA018560\",\"CHSSA018572\",\"CHSSA018584\",\"CHSSA018596\",\"CHSSA018601\",\"CHSSA018613\",\"CHSSA018625\",\"CHSSA018630\",\"CHSSA018642\",\"CHSSA018654\",\"CHSSA018666\",\"CHSSA018671\",\"CHSSA018683\");\n} //fin de if($IdEstado == \"08\")\n\n//Condicion de estado-clues\nif($IdEstado == \"09\"){\n\t$Clues = array(\"DFSSA000053\",\"DFSSA000065\",\"DFSSA000111\",\"DFSSA000123\",\"DFSSA000135\",\"DFSSA000152\",\"DFSSA000176\",\"DFSSA000181\",\"DFSSA000205\",\"DFSSA000210\",\"DFSSA000222\",\"DFSSA000234\",\"DFSSA000246\",\"DFSSA000251\",\"DFSSA000263\",\"DFSSA000275\",\"DFSSA000350\",\"DFSSA000415\",\"DFSSA000420\",\"DFSSA000432\",\"DFSSA000444\",\"DFSSA000456\",\"DFSSA000461\",\"DFSSA000473\",\"DFSSA000485\",\"DFSSA000490\",\"DFSSA000502\",\"DFSSA000514\",\"DFSSA000526\",\"DFSSA000596\",\"DFSSA000613\",\"DFSSA000630\",\"DFSSA000642\",\"DFSSA000654\",\"DFSSA000666\",\"DFSSA000671\",\"DFSSA000683\",\"DFSSA000695\",\"DFSSA000700\",\"DFSSA000712\",\"DFSSA000835\",\"DFSSA000840\",\"DFSSA000852\",\"DFSSA000864\",\"DFSSA000881\",\"DFSSA000980\",\"DFSSA000992\",\"DFSSA001004\",\"DFSSA001016\",\"DFSSA001021\",\"DFSSA001033\",\"DFSSA001045\",\"DFSSA001050\",\"DFSSA001062\",\"DFSSA001074\",\"DFSSA001086\",\"DFSSA001091\",\"DFSSA001103\",\"DFSSA001115\",\"DFSSA001120\",\"DFSSA001132\",\"DFSSA001144\",\"DFSSA001156\",\"DFSSA001161\",\"DFSSA001173\",\"DFSSA001185\",\"DFSSA001190\",\"DFSSA001202\",\"DFSSA001214\",\"DFSSA001226\",\"DFSSA001231\",\"DFSSA001243\",\"DFSSA001255\",\"DFSSA001260\",\"DFSSA001272\",\"DFSSA001284\",\"DFSSA001296\",\"DFSSA001371\",\"DFSSA001383\",\"DFSSA001395\",\"DFSSA001400\",\"DFSSA001412\",\"DFSSA001424\",\"DFSSA001511\",\"DFSSA001540\",\"DFSSA001634\",\"DFSSA001651\",\"DFSSA001663\",\"DFSSA001675\",\"DFSSA001680\",\"DFSSA001692\",\"DFSSA001704\",\"DFSSA001716\",\"DFSSA001733\",\"DFSSA001745\",\"DFSSA001750\",\"DFSSA001762\",\"DFSSA001774\",\"DFSSA001786\",\"DFSSA001791\",\"DFSSA001803\",\"DFSSA001815\",\"DFSSA001820\",\"DFSSA001832\",\"DFSSA001844\",\"DFSSA001856\",\"DFSSA001926\",\"DFSSA001955\",\"DFSSA001960\",\"DFSSA001972\",\"DFSSA001984\",\"DFSSA001996\",\"DFSSA002001\",\"DFSSA002025\",\"DFSSA002030\",\"DFSSA002066\",\"DFSSA002100\",\"DFSSA002112\",\"DFSSA002124\",\"DFSSA002136\",\"DFSSA002141\",\"DFSSA002153\",\"DFSSA002165\",\"DFSSA002170\",\"DFSSA002182\",\"DFSSA002194\",\"DFSSA002206\",\"DFSSA002281\",\"DFSSA002305\",\"DFSSA002310\",\"DFSSA002322\",\"DFSSA002334\",\"DFSSA002346\",\"DFSSA002351\",\"DFSSA002363\",\"DFSSA002375\",\"DFSSA002380\",\"DFSSA002392\",\"DFSSA002404\",\"DFSSA002416\",\"DFSSA002421\",\"DFSSA002433\",\"DFSSA002491\",\"DFSSA002520\",\"DFSSA002532\",\"DFSSA002544\",\"DFSSA002556\",\"DFSSA002561\",\"DFSSA002573\",\"DFSSA002590\",\"DFSSA002602\",\"DFSSA002614\",\"DFSSA002626\",\"DFSSA002631\",\"DFSSA002643\",\"DFSSA002655\",\"DFSSA002660\",\"DFSSA002672\",\"DFSSA002701\",\"DFSSA002713\",\"DFSSA002725\",\"DFSSA002730\",\"DFSSA002742\",\"DFSSA002766\",\"DFSSA002771\",\"DFSSA002783\",\"DFSSA002795\",\"DFSSA002800\",\"DFSSA002812\",\"DFSSA002824\",\"DFSSA002836\",\"DFSSA002841\",\"DFSSA002853\",\"DFSSA002865\",\"DFSSA002870\",\"DFSSA002882\",\"DFSSA002894\",\"DFSSA002906\",\"DFSSA002911\",\"DFSSA002923\",\"DFSSA002993\",\"DFSSA003046\",\"DFSSA003051\",\"DFSSA003063\",\"DFSSA003075\",\"DFSSA003080\",\"DFSSA003092\",\"DFSSA003104\",\"DFSSA003121\",\"DFSSA003133\",\"DFSSA003145\",\"DFSSA003150\",\"DFSSA003162\",\"DFSSA003220\",\"DFSSA003232\",\"DFSSA003244\",\"DFSSA003256\",\"DFSSA003273\",\"DFSSA003285\",\"DFSSA003290\",\"DFSSA003302\",\"DFSSA003314\",\"DFSSA003326\",\"DFSSA003331\",\"DFSSA003372\",\"DFSSA003384\",\"DFSSA003454\",\"DFSSA003466\",\"DFSSA003471\",\"DFSSA003483\",\"DFSSA003495\",\"DFSSA003500\",\"DFSSA003536\",\"DFSSA003541\",\"DFSSA003553\",\"DFSSA003611\",\"DFSSA003623\",\"DFSSA003635\",\"DFSSA003640\",\"DFSSA003652\",\"DFSSA003664\",\"DFSSA003705\",\"DFSSA003710\",\"DFSSA003722\",\"DFSSA003804\",\"DFSSA003816\",\"DFSSA003821\",\"DFSSA003833\",\"DFSSA003845\",\"DFSSA003850\",\"DFSSA003862\",\"DFSSA003874\",\"DFSSA003886\",\"DFSSA003891\",\"DFSSA003903\",\"DFSSA003915\",\"DFSSA003920\",\"DFSSA003932\",\"DFSSA003944\",\"DFSSA003956\",\"DFSSA003961\",\"DFSSA003973\",\"DFSSA003990\",\"DFSSA004002\",\"DFSSA004014\",\"DFSSA004026\",\"DFSSA004031\",\"DFSSA004043\",\"DFSSA004055\",\"DFSSA004060\",\"DFSSA004072\",\"DFSSA004084\",\"DFSSA004096\",\"DFSSA004101\",\"DFSSA004113\",\"DFSSA004125\",\"DFSSA004130\",\"DFSSA004142\",\"DFSSA004154\",\"DFSSA004166\",\"DFSSA004195\",\"DFSSA004265\",\"DFSSA004270\",\"DFSSA017525\",\"DFSSA017530\",\"DFSSA017542\",\"DFSSA017554\",\"DFSSA017566\",\"DFSSA017571\",\"DFSSA017583\",\"DFSSA017595\",\"DFSSA017600\",\"DFSSA017612\",\"DFSSA017624\",\"DFSSA017636\",\"DFSSA017641\",\"DFSSA017653\",\"DFSSA017665\",\"DFSSA017670\",\"DFSSA017682\",\"DFSSA017694\",\"DFSSA017706\",\"DFSSA017711\",\"DFSSA017723\",\"DFSSA017735\",\"DFSSA017740\",\"DFSSA017752\",\"DFSSA017764\",\"DFSSA017776\",\"DFSSA017781\",\"DFSSA017793\",\"DFSSA017805\",\"DFSSA017810\",\"DFSSA017822\",\"DFSSA017834\",\"DFSSA017846\",\"DFSSA017851\",\"DFSSA017863\",\"DFSSA017875\",\"DFSSA017886\",\"DFSSA017891\",\"DFSSA017915\",\"DFSSA017920\",\"DFSSA017932\",\"DFSSA017944\",\"DFSSA017956\",\"DFSSA017961\",\"DFSSA017973\",\"DFSSA017985\",\"DFSSA017990\",\"DFSSA018002\",\"DFSSA018014\",\"DFSSA018026\",\"DFSSA018031\",\"DFSSA018043\",\"DFSSA018055\",\"DFSSA018060\",\"DFSSA018072\",\"DFSSA018084\",\"DFSSA018096\",\"DFSSA018101\",\"DFSSA018113\",\"DFSSA018125\",\"DFSSA018130\",\"DFSSA018142\",\"DFSSA018154\",\"DFSSA018166\",\"DFSSA018171\",\"DFSSA018323\",\"DFSSA018335\",\"DFSSA018340\",\"DFSSA018352\",\"DFSSA018364\",\"DFSSA018376\",\"DFSSA018381\",\"DFSSA018393\",\"DFSSA018405\",\"DFSSA018410\",\"DFSSA018422\",\"DFSSA018434\",\"DFSSA018446\",\"DFSSA018451\",\"DFSSA018463\",\"DFSSA018475\",\"DFSSA018480\",\"DFSSA018492\",\"DFSSA018504\",\"DFSSA018516\",\"DFSSA018521\",\"DFSSA018533\",\"DFSSA018545\",\"DFSSA018550\",\"DFSSA018562\",\"DFSSA018574\",\"DFSSA018586\",\"DFSSA018591\",\"DFSSA018603\",\"DFSSA018615\",\"DFSSA018620\",\"DFSSA018632\",\"DFSSA018644\",\"DFSSA018656\",\"DFSSA018661\",\"DFSSA018673\",\"DFSSA018685\",\"DFSSA018690\",\"DFSSA018702\",\"DFSSA018714\",\"DFSSA018726\",\"DFSSA018731\",\"DFSSA018743\",\"DFSSA018755\",\"DFSSA018760\",\"DFSSA018772\",\"DFSSA018784\",\"DFSSA018796\",\"DFSSA018801\",\"DFSSA018813\",\"DFSSA018825\",\"DFSSA018830\",\"DFSSA018842\",\"DFSSA018854\",\"DFSSA018866\",\"DFSSA018871\",\"DFSSA018883\",\"DFSSA018895\",\"DFSSA018900\",\"DFSSA018912\",\"DFSSA018924\",\"DFSSA018936\",\"DFSSA018941\",\"DFSSA018953\",\"DFSSA018965\",\"DFSSA018970\",\"DFSSA018982\",\"DFSSA018994\",\"DFSSA019006\",\"DFSSA019011\",\"DFSSA019023\",\"DFSSA019035\",\"DFSSA019040\",\"DFSSA019052\",\"DFSSA019064\",\"DFSSA019076\",\"DFSSA019081\",\"DFSSA019093\",\"DFSSA019105\",\"DFSSA019110\");\n} //fin de if($IdEstado == \"09\")\n\n//Condicion de estado-clues\nif($IdEstado == \"10\"){\n\t$Clues = array(\"DGSSA000010\",\"DGSSA000022\",\"DGSSA000034\",\"DGSSA000046\",\"DGSSA000051\",\"DGSSA000063\",\"DGSSA000075\",\"DGSSA000080\",\"DGSSA000092\",\"DGSSA000104\",\"DGSSA000116\",\"DGSSA000121\",\"DGSSA000133\",\"DGSSA000145\",\"DGSSA000150\",\"DGSSA000162\",\"DGSSA000174\",\"DGSSA000186\",\"DGSSA000191\",\"DGSSA000203\",\"DGSSA000215\",\"DGSSA000220\",\"DGSSA000232\",\"DGSSA000244\",\"DGSSA000256\",\"DGSSA000261\",\"DGSSA000273\",\"DGSSA000285\",\"DGSSA000302\",\"DGSSA000314\",\"DGSSA000326\",\"DGSSA000331\",\"DGSSA000343\",\"DGSSA000355\",\"DGSSA000360\",\"DGSSA000372\",\"DGSSA000384\",\"DGSSA000396\",\"DGSSA000401\",\"DGSSA000413\",\"DGSSA000425\",\"DGSSA000442\",\"DGSSA000454\",\"DGSSA000471\",\"DGSSA000483\",\"DGSSA000495\",\"DGSSA000500\",\"DGSSA000512\",\"DGSSA000524\",\"DGSSA000536\",\"DGSSA000541\",\"DGSSA000553\",\"DGSSA000565\",\"DGSSA000570\",\"DGSSA000582\",\"DGSSA000594\",\"DGSSA000606\",\"DGSSA000623\",\"DGSSA000635\",\"DGSSA000640\",\"DGSSA000652\",\"DGSSA000664\",\"DGSSA000676\",\"DGSSA000693\",\"DGSSA000705\",\"DGSSA000710\",\"DGSSA000722\",\"DGSSA000734\",\"DGSSA000746\",\"DGSSA000751\",\"DGSSA000763\",\"DGSSA000775\",\"DGSSA000780\",\"DGSSA000792\",\"DGSSA000804\",\"DGSSA000816\",\"DGSSA000821\",\"DGSSA000833\",\"DGSSA000845\",\"DGSSA000850\",\"DGSSA000862\",\"DGSSA000874\",\"DGSSA000886\",\"DGSSA000891\",\"DGSSA000903\",\"DGSSA000915\",\"DGSSA000920\",\"DGSSA000932\",\"DGSSA000944\",\"DGSSA000956\",\"DGSSA000961\",\"DGSSA000973\",\"DGSSA000985\",\"DGSSA000990\",\"DGSSA001014\",\"DGSSA001026\",\"DGSSA001031\",\"DGSSA001043\",\"DGSSA001055\",\"DGSSA001060\",\"DGSSA001072\",\"DGSSA001084\",\"DGSSA001096\",\"DGSSA001101\",\"DGSSA001113\",\"DGSSA001125\",\"DGSSA001130\",\"DGSSA001154\",\"DGSSA001166\",\"DGSSA001171\",\"DGSSA001183\",\"DGSSA001200\",\"DGSSA001212\",\"DGSSA001224\",\"DGSSA001241\",\"DGSSA001253\",\"DGSSA001265\",\"DGSSA001270\",\"DGSSA001282\",\"DGSSA001294\",\"DGSSA001306\",\"DGSSA001311\",\"DGSSA001323\",\"DGSSA001340\",\"DGSSA001352\",\"DGSSA001364\",\"DGSSA001376\",\"DGSSA001381\",\"DGSSA001393\",\"DGSSA001405\",\"DGSSA001410\",\"DGSSA001422\",\"DGSSA001434\",\"DGSSA001446\",\"DGSSA001451\",\"DGSSA001463\",\"DGSSA001475\",\"DGSSA001480\",\"DGSSA001492\",\"DGSSA001504\",\"DGSSA001516\",\"DGSSA001533\",\"DGSSA001545\",\"DGSSA001562\",\"DGSSA001574\",\"DGSSA001586\",\"DGSSA001591\",\"DGSSA001603\",\"DGSSA001615\",\"DGSSA001620\",\"DGSSA001632\",\"DGSSA001644\",\"DGSSA001656\",\"DGSSA001661\",\"DGSSA001673\",\"DGSSA001685\",\"DGSSA001690\",\"DGSSA001702\",\"DGSSA001714\",\"DGSSA001726\",\"DGSSA001731\",\"DGSSA001743\",\"DGSSA001755\",\"DGSSA001760\",\"DGSSA001772\",\"DGSSA001784\",\"DGSSA001796\",\"DGSSA001801\",\"DGSSA001813\",\"DGSSA001825\",\"DGSSA001830\",\"DGSSA001842\",\"DGSSA001854\",\"DGSSA001866\",\"DGSSA001871\",\"DGSSA001883\",\"DGSSA001895\",\"DGSSA001900\",\"DGSSA001912\",\"DGSSA001924\",\"DGSSA001965\",\"DGSSA001970\",\"DGSSA001982\",\"DGSSA001994\",\"DGSSA002006\",\"DGSSA002011\",\"DGSSA002052\",\"DGSSA002076\",\"DGSSA002081\",\"DGSSA002093\",\"DGSSA002105\",\"DGSSA002110\",\"DGSSA002122\",\"DGSSA002134\",\"DGSSA002146\",\"DGSSA002151\",\"DGSSA002163\",\"DGSSA002175\",\"DGSSA002180\",\"DGSSA002192\",\"DGSSA002204\",\"DGSSA002221\",\"DGSSA002233\",\"DGSSA002245\",\"DGSSA002250\",\"DGSSA002262\",\"DGSSA002274\",\"DGSSA002303\",\"DGSSA002315\",\"DGSSA002320\",\"DGSSA002332\",\"DGSSA017115\",\"DGSSA017132\",\"DGSSA017144\",\"DGSSA017156\",\"DGSSA017161\",\"DGSSA017173\",\"DGSSA017185\",\"DGSSA017190\",\"DGSSA017202\",\"DGSSA017214\",\"DGSSA017226\",\"DGSSA017231\",\"DGSSA017242\",\"DGSSA017254\",\"DGSSA017266\",\"DGSSA017271\",\"DGSSA017283\",\"DGSSA017295\",\"DGSSA017300\",\"DGSSA017312\",\"DGSSA017324\",\"DGSSA017336\",\"DGSSA017341\",\"DGSSA017365\",\"DGSSA017370\",\"DGSSA017382\",\"DGSSA017394\",\"DGSSA017406\",\"DGSSA017411\",\"DGSSA017423\",\"DGSSA017435\",\"DGSSA017440\",\"DGSSA017452\",\"DGSSA017464\",\"DGSSA017476\",\"DGSSA017481\",\"DGSSA017493\",\"DGSSA017505\",\"DGSSA017510\",\"DGSSA017522\",\"DGSSA017534\",\"DGSSA017546\",\"DGSSA017551\",\"DGSSA017563\",\"DGSSA017575\",\"DGSSA017580\",\"DGSSA017592\",\"DGSSA017604\",\"DGSSA017616\",\"DGSSA017621\",\"DGSSA017633\",\"DGSSA017645\",\"DGSSA017650\",\"DGSSA017662\",\"DGSSA017674\",\"DGSSA017686\",\"DGSSA017691\",\"DGSSA017703\",\"DGSSA017715\",\"DGSSA017720\",\"DGSSA017732\",\"DGSSA017744\",\"DGSSA017756\",\"DGSSA017761\",\"DGSSA017773\",\"DGSSA017785\",\"DGSSA017790\",\"DGSSA017802\",\"DGSSA017814\",\"DGSSA017826\",\"DGSSA017831\",\"DGSSA017843\",\"DGSSA017855\",\"DGSSA017860\",\"DGSSA017872\");\n} //fin de if($IdEstado == \"10\")\n\n//Condicion de estado-clues\nif($IdEstado == \"11\"){\n\t$Clues = array(\"GTSSA000013\",\"GTSSA000025\",\"GTSSA000030\",\"GTSSA000042\",\"GTSSA000054\",\"GTSSA000066\",\"GTSSA000071\",\"GTSSA000083\",\"GTSSA000095\",\"GTSSA000100\",\"GTSSA000112\",\"GTSSA000124\",\"GTSSA000136\",\"GTSSA000141\",\"GTSSA000153\",\"GTSSA000165\",\"GTSSA000170\",\"GTSSA000182\",\"GTSSA000194\",\"GTSSA000206\",\"GTSSA000211\",\"GTSSA000223\",\"GTSSA000235\",\"GTSSA000240\",\"GTSSA000252\",\"GTSSA000264\",\"GTSSA000276\",\"GTSSA000281\",\"GTSSA000293\",\"GTSSA000305\",\"GTSSA000310\",\"GTSSA000322\",\"GTSSA000334\",\"GTSSA000346\",\"GTSSA000351\",\"GTSSA000363\",\"GTSSA000375\",\"GTSSA000380\",\"GTSSA000392\",\"GTSSA000404\",\"GTSSA000416\",\"GTSSA000421\",\"GTSSA000433\",\"GTSSA000445\",\"GTSSA000450\",\"GTSSA000462\",\"GTSSA000474\",\"GTSSA000486\",\"GTSSA000491\",\"GTSSA000503\",\"GTSSA000515\",\"GTSSA000520\",\"GTSSA000532\",\"GTSSA000544\",\"GTSSA000556\",\"GTSSA000561\",\"GTSSA000573\",\"GTSSA000585\",\"GTSSA000590\",\"GTSSA000602\",\"GTSSA000614\",\"GTSSA000626\",\"GTSSA000631\",\"GTSSA000643\",\"GTSSA000655\",\"GTSSA000660\",\"GTSSA000672\",\"GTSSA000684\",\"GTSSA000696\",\"GTSSA000701\",\"GTSSA000713\",\"GTSSA000725\",\"GTSSA000730\",\"GTSSA000742\",\"GTSSA000754\",\"GTSSA000766\",\"GTSSA000771\",\"GTSSA000795\",\"GTSSA000800\",\"GTSSA000812\",\"GTSSA000824\",\"GTSSA000836\",\"GTSSA000841\",\"GTSSA000853\",\"GTSSA000865\",\"GTSSA000870\",\"GTSSA000882\",\"GTSSA000894\",\"GTSSA000906\",\"GTSSA000911\",\"GTSSA000923\",\"GTSSA000935\",\"GTSSA000940\",\"GTSSA000952\",\"GTSSA000964\",\"GTSSA000976\",\"GTSSA000981\",\"GTSSA000993\",\"GTSSA001005\",\"GTSSA001010\",\"GTSSA001022\",\"GTSSA001034\",\"GTSSA001046\",\"GTSSA001051\",\"GTSSA001063\",\"GTSSA001075\",\"GTSSA001080\",\"GTSSA001092\",\"GTSSA001104\",\"GTSSA001116\",\"GTSSA001121\",\"GTSSA001133\",\"GTSSA001145\",\"GTSSA001150\",\"GTSSA001162\",\"GTSSA001174\",\"GTSSA001186\",\"GTSSA001191\",\"GTSSA001203\",\"GTSSA001215\",\"GTSSA001220\",\"GTSSA001232\",\"GTSSA001244\",\"GTSSA001256\",\"GTSSA001261\",\"GTSSA001273\",\"GTSSA001285\",\"GTSSA001290\",\"GTSSA001302\",\"GTSSA001314\",\"GTSSA001326\",\"GTSSA001331\",\"GTSSA001343\",\"GTSSA001355\",\"GTSSA001360\",\"GTSSA001372\",\"GTSSA001384\",\"GTSSA001396\",\"GTSSA001401\",\"GTSSA001413\",\"GTSSA001425\",\"GTSSA001430\",\"GTSSA001442\",\"GTSSA001454\",\"GTSSA001466\",\"GTSSA001471\",\"GTSSA001483\",\"GTSSA001495\",\"GTSSA001500\",\"GTSSA001512\",\"GTSSA001524\",\"GTSSA001536\",\"GTSSA001541\",\"GTSSA001553\",\"GTSSA001565\",\"GTSSA001570\",\"GTSSA001582\",\"GTSSA001594\",\"GTSSA001606\",\"GTSSA001611\",\"GTSSA001623\",\"GTSSA001635\",\"GTSSA001640\",\"GTSSA001652\",\"GTSSA001664\",\"GTSSA001676\",\"GTSSA001681\",\"GTSSA001693\",\"GTSSA001705\",\"GTSSA001710\",\"GTSSA001722\",\"GTSSA001734\",\"GTSSA001746\",\"GTSSA001751\",\"GTSSA001763\",\"GTSSA001775\",\"GTSSA001780\",\"GTSSA001792\",\"GTSSA001816\",\"GTSSA001821\",\"GTSSA001833\",\"GTSSA001845\",\"GTSSA001850\",\"GTSSA001862\",\"GTSSA001874\",\"GTSSA001886\",\"GTSSA001891\",\"GTSSA001903\",\"GTSSA001915\",\"GTSSA001920\",\"GTSSA001932\",\"GTSSA001944\",\"GTSSA001956\",\"GTSSA001961\",\"GTSSA001973\",\"GTSSA001985\",\"GTSSA001990\",\"GTSSA002002\",\"GTSSA002014\",\"GTSSA002026\",\"GTSSA002031\",\"GTSSA002043\",\"GTSSA002055\",\"GTSSA002060\",\"GTSSA002072\",\"GTSSA002084\",\"GTSSA002096\",\"GTSSA002101\",\"GTSSA002113\",\"GTSSA002125\",\"GTSSA002130\",\"GTSSA002142\",\"GTSSA002154\",\"GTSSA002166\",\"GTSSA002171\",\"GTSSA002183\",\"GTSSA002195\",\"GTSSA002200\",\"GTSSA002212\",\"GTSSA002224\",\"GTSSA002236\",\"GTSSA002241\",\"GTSSA002253\",\"GTSSA002265\",\"GTSSA002270\",\"GTSSA002282\",\"GTSSA002294\",\"GTSSA002306\",\"GTSSA002311\",\"GTSSA002323\",\"GTSSA002335\",\"GTSSA002340\",\"GTSSA002352\",\"GTSSA002364\",\"GTSSA002376\",\"GTSSA002381\",\"GTSSA002393\",\"GTSSA002405\",\"GTSSA002410\",\"GTSSA002422\",\"GTSSA002434\",\"GTSSA002446\",\"GTSSA002451\",\"GTSSA002463\",\"GTSSA002475\",\"GTSSA002480\",\"GTSSA002492\",\"GTSSA002504\",\"GTSSA002516\",\"GTSSA002521\",\"GTSSA002533\",\"GTSSA002545\",\"GTSSA002550\",\"GTSSA002562\",\"GTSSA002574\",\"GTSSA002586\",\"GTSSA002591\",\"GTSSA002603\",\"GTSSA002615\",\"GTSSA002620\",\"GTSSA002632\",\"GTSSA002644\",\"GTSSA002656\",\"GTSSA002661\",\"GTSSA002673\",\"GTSSA002685\",\"GTSSA002690\",\"GTSSA002702\",\"GTSSA002714\",\"GTSSA002726\",\"GTSSA002731\",\"GTSSA002743\",\"GTSSA002755\",\"GTSSA002760\",\"GTSSA002772\",\"GTSSA002784\",\"GTSSA002796\",\"GTSSA002801\",\"GTSSA002813\",\"GTSSA002825\",\"GTSSA002830\",\"GTSSA002842\",\"GTSSA002854\",\"GTSSA002866\",\"GTSSA002871\",\"GTSSA002883\",\"GTSSA002895\",\"GTSSA002900\",\"GTSSA002912\",\"GTSSA002924\",\"GTSSA002936\",\"GTSSA002941\",\"GTSSA002953\",\"GTSSA002970\",\"GTSSA002982\",\"GTSSA002994\",\"GTSSA003011\",\"GTSSA003023\",\"GTSSA003035\",\"GTSSA003040\",\"GTSSA003052\",\"GTSSA003064\",\"GTSSA003076\",\"GTSSA003081\",\"GTSSA003093\",\"GTSSA003105\",\"GTSSA003110\",\"GTSSA003122\",\"GTSSA003134\",\"GTSSA003146\",\"GTSSA003151\",\"GTSSA003163\",\"GTSSA003175\",\"GTSSA003180\",\"GTSSA003192\",\"GTSSA003204\",\"GTSSA003216\",\"GTSSA003221\",\"GTSSA003233\",\"GTSSA003245\",\"GTSSA003250\",\"GTSSA003262\",\"GTSSA003274\",\"GTSSA003286\",\"GTSSA003291\",\"GTSSA003303\",\"GTSSA003315\",\"GTSSA003320\",\"GTSSA003332\",\"GTSSA003344\",\"GTSSA003361\",\"GTSSA003373\",\"GTSSA003385\",\"GTSSA003390\",\"GTSSA003402\",\"GTSSA003414\",\"GTSSA003426\",\"GTSSA003431\",\"GTSSA003443\",\"GTSSA003455\",\"GTSSA003460\",\"GTSSA003472\",\"GTSSA003484\",\"GTSSA003496\",\"GTSSA003501\",\"GTSSA003513\",\"GTSSA003525\",\"GTSSA003530\",\"GTSSA003542\",\"GTSSA003554\",\"GTSSA003566\",\"GTSSA003571\",\"GTSSA003583\",\"GTSSA003595\",\"GTSSA003600\",\"GTSSA003612\",\"GTSSA003624\",\"GTSSA003636\",\"GTSSA003641\",\"GTSSA003653\",\"GTSSA003665\",\"GTSSA003670\",\"GTSSA003682\",\"GTSSA003694\",\"GTSSA003706\",\"GTSSA003711\",\"GTSSA003723\",\"GTSSA003735\",\"GTSSA003740\",\"GTSSA003752\",\"GTSSA003764\",\"GTSSA003776\",\"GTSSA003781\",\"GTSSA003793\",\"GTSSA003805\",\"GTSSA003810\",\"GTSSA003822\",\"GTSSA003834\",\"GTSSA003846\",\"GTSSA003851\",\"GTSSA003863\",\"GTSSA003875\",\"GTSSA003880\",\"GTSSA003892\",\"GTSSA003904\",\"GTSSA003916\",\"GTSSA003921\",\"GTSSA003933\",\"GTSSA003945\",\"GTSSA003950\",\"GTSSA003962\",\"GTSSA003974\",\"GTSSA003986\",\"GTSSA003991\",\"GTSSA004003\",\"GTSSA004015\",\"GTSSA004020\",\"GTSSA004032\",\"GTSSA004044\",\"GTSSA004056\",\"GTSSA004061\",\"GTSSA004073\",\"GTSSA004085\",\"GTSSA004090\",\"GTSSA004102\",\"GTSSA004114\",\"GTSSA004126\",\"GTSSA004131\",\"GTSSA004143\",\"GTSSA004155\",\"GTSSA004160\",\"GTSSA004172\",\"GTSSA004184\",\"GTSSA004196\",\"GTSSA004201\",\"GTSSA004213\",\"GTSSA004225\",\"GTSSA004230\",\"GTSSA004242\",\"GTSSA004254\",\"GTSSA004266\",\"GTSSA004271\",\"GTSSA004283\",\"GTSSA004295\",\"GTSSA004300\",\"GTSSA004312\",\"GTSSA004324\",\"GTSSA004336\",\"GTSSA004341\",\"GTSSA004353\",\"GTSSA004365\",\"GTSSA004370\",\"GTSSA004382\",\"GTSSA004394\",\"GTSSA004406\",\"GTSSA004411\",\"GTSSA004423\",\"GTSSA004435\",\"GTSSA004440\",\"GTSSA004452\",\"GTSSA004464\",\"GTSSA004476\",\"GTSSA004481\",\"GTSSA004493\",\"GTSSA004505\",\"GTSSA004510\",\"GTSSA004522\",\"GTSSA004534\",\"GTSSA004546\",\"GTSSA004551\",\"GTSSA004563\",\"GTSSA004575\",\"GTSSA004580\",\"GTSSA004592\",\"GTSSA004604\",\"GTSSA004616\",\"GTSSA004621\",\"GTSSA004633\",\"GTSSA004645\",\"GTSSA004650\",\"GTSSA004662\",\"GTSSA004674\",\"GTSSA004686\",\"GTSSA004691\",\"GTSSA004703\",\"GTSSA004715\",\"GTSSA004720\",\"GTSSA004732\",\"GTSSA004744\",\"GTSSA004756\",\"GTSSA004761\",\"GTSSA004773\",\"GTSSA004785\",\"GTSSA004790\",\"GTSSA004802\",\"GTSSA004814\",\"GTSSA004826\",\"GTSSA004831\",\"GTSSA004843\",\"GTSSA004855\",\"GTSSA004860\",\"GTSSA004872\",\"GTSSA004884\",\"GTSSA004896\",\"GTSSA004901\",\"GTSSA004913\",\"GTSSA004925\",\"GTSSA004930\",\"GTSSA004942\",\"GTSSA004954\",\"GTSSA004966\",\"GTSSA004971\",\"GTSSA004983\",\"GTSSA004995\",\"GTSSA005000\",\"GTSSA005012\",\"GTSSA005024\",\"GTSSA005036\",\"GTSSA005041\",\"GTSSA005053\",\"GTSSA005065\",\"GTSSA005070\",\"GTSSA005082\",\"GTSSA005094\",\"GTSSA005106\",\"GTSSA005111\",\"GTSSA005123\",\"GTSSA005135\",\"GTSSA005140\",\"GTSSA005152\",\"GTSSA005164\",\"GTSSA005176\",\"GTSSA005181\",\"GTSSA005193\",\"GTSSA005205\",\"GTSSA005210\",\"GTSSA005222\",\"GTSSA005234\",\"GTSSA005246\",\"GTSSA005251\",\"GTSSA005263\",\"GTSSA005275\",\"GTSSA005280\",\"GTSSA005292\",\"GTSSA005304\",\"GTSSA005316\",\"GTSSA005386\",\"GTSSA005391\",\"GTSSA005403\",\"GTSSA005415\",\"GTSSA016481\",\"GTSSA016493\",\"GTSSA016505\",\"GTSSA016510\",\"GTSSA016534\",\"GTSSA016546\",\"GTSSA016551\",\"GTSSA016563\",\"GTSSA016575\",\"GTSSA016580\",\"GTSSA016592\",\"GTSSA016604\",\"GTSSA016616\",\"GTSSA016621\",\"GTSSA016633\",\"GTSSA016645\",\"GTSSA016650\",\"GTSSA016662\",\"GTSSA016674\",\"GTSSA016685\",\"GTSSA016690\",\"GTSSA016702\",\"GTSSA016714\",\"GTSSA016726\",\"GTSSA016731\",\"GTSSA016743\",\"GTSSA016755\",\"GTSSA016760\",\"GTSSA016772\",\"GTSSA016784\",\"GTSSA016796\",\"GTSSA016801\",\"GTSSA016813\",\"GTSSA016825\",\"GTSSA016830\",\"GTSSA016842\",\"GTSSA016854\",\"GTSSA016866\",\"GTSSA016871\",\"GTSSA016883\",\"GTSSA016895\",\"GTSSA016900\",\"GTSSA016912\",\"GTSSA016924\",\"GTSSA016936\",\"GTSSA016941\",\"GTSSA016953\",\"GTSSA016965\",\"GTSSA016970\",\"GTSSA016982\",\"GTSSA016994\",\"GTSSA017006\",\"GTSSA017011\",\"GTSSA017023\",\"GTSSA017035\",\"GTSSA017040\",\"GTSSA017052\",\"GTSSA017064\",\"GTSSA017076\",\"GTSSA017081\",\"GTSSA017093\",\"GTSSA017105\",\"GTSSA017110\",\"GTSSA017122\",\"GTSSA017134\",\"GTSSA017146\",\"GTSSA017151\",\"GTSSA017163\",\"GTSSA017175\",\"GTSSA017180\",\"GTSSA017192\",\"GTSSA017204\",\"GTSSA017216\",\"GTSSA017221\",\"GTSSA017233\",\"GTSSA017245\",\"GTSSA017250\",\"GTSSA017262\",\"GTSSA017274\",\"GTSSA017286\",\"GTSSA017291\",\"GTSSA017303\",\"GTSSA017315\",\"GTSSA017320\",\"GTSSA017332\",\"GTSSA017344\",\"GTSSA017356\",\"GTSSA017361\",\"GTSSA017373\",\"GTSSA017385\",\"GTSSA017390\",\"GTSSA017402\",\"GTSSA017414\",\"GTSSA017426\",\"GTSSA017431\",\"GTSSA017443\",\"GTSSA017455\",\"GTSSA017460\",\"GTSSA017472\",\"GTSSA017484\",\"GTSSA017496\",\"GTSSA017501\",\"GTSSA017513\",\"GTSSA017525\");\n} //fin de if($IdEstado == \"11\")\n\n//Condicion de estado-clues\nif($IdEstado == \"12\"){\n\t$Clues = array(\"GRSSA000010\",\"GRSSA000022\",\"GRSSA000034\",\"GRSSA000046\",\"GRSSA000051\",\"GRSSA000063\",\"GRSSA000075\",\"GRSSA000080\",\"GRSSA000092\",\"GRSSA000104\",\"GRSSA000116\",\"GRSSA000121\",\"GRSSA000133\",\"GRSSA000145\",\"GRSSA000150\",\"GRSSA000162\",\"GRSSA000174\",\"GRSSA000186\",\"GRSSA000191\",\"GRSSA000203\",\"GRSSA000215\",\"GRSSA000220\",\"GRSSA000232\",\"GRSSA000244\",\"GRSSA000256\",\"GRSSA000261\",\"GRSSA000273\",\"GRSSA000285\",\"GRSSA000290\",\"GRSSA000302\",\"GRSSA000314\",\"GRSSA000326\",\"GRSSA000331\",\"GRSSA000343\",\"GRSSA000355\",\"GRSSA000360\",\"GRSSA000372\",\"GRSSA000384\",\"GRSSA000396\",\"GRSSA000401\",\"GRSSA000413\",\"GRSSA000425\",\"GRSSA000430\",\"GRSSA000442\",\"GRSSA000454\",\"GRSSA000466\",\"GRSSA000471\",\"GRSSA000483\",\"GRSSA000495\",\"GRSSA000500\",\"GRSSA000512\",\"GRSSA000524\",\"GRSSA000536\",\"GRSSA000541\",\"GRSSA000553\",\"GRSSA000565\",\"GRSSA000570\",\"GRSSA000582\",\"GRSSA000594\",\"GRSSA000606\",\"GRSSA000611\",\"GRSSA000623\",\"GRSSA000635\",\"GRSSA000640\",\"GRSSA000652\",\"GRSSA000664\",\"GRSSA000676\",\"GRSSA000710\",\"GRSSA000722\",\"GRSSA000734\",\"GRSSA000746\",\"GRSSA000751\",\"GRSSA000763\",\"GRSSA000775\",\"GRSSA000780\",\"GRSSA000792\",\"GRSSA000804\",\"GRSSA000816\",\"GRSSA000821\",\"GRSSA000833\",\"GRSSA000845\",\"GRSSA000850\",\"GRSSA000862\",\"GRSSA000874\",\"GRSSA000886\",\"GRSSA000891\",\"GRSSA000903\",\"GRSSA000915\",\"GRSSA000920\",\"GRSSA000932\",\"GRSSA000944\",\"GRSSA000956\",\"GRSSA000961\",\"GRSSA000973\",\"GRSSA000985\",\"GRSSA000990\",\"GRSSA001002\",\"GRSSA001014\",\"GRSSA001026\",\"GRSSA001031\",\"GRSSA001043\",\"GRSSA001055\",\"GRSSA001060\",\"GRSSA001072\",\"GRSSA001096\",\"GRSSA001101\",\"GRSSA001113\",\"GRSSA001125\",\"GRSSA001130\",\"GRSSA001142\",\"GRSSA001154\",\"GRSSA001166\",\"GRSSA001171\",\"GRSSA001183\",\"GRSSA001195\",\"GRSSA001200\",\"GRSSA001212\",\"GRSSA001224\",\"GRSSA001236\",\"GRSSA001241\",\"GRSSA001253\",\"GRSSA001265\",\"GRSSA001270\",\"GRSSA001282\",\"GRSSA001294\",\"GRSSA001306\",\"GRSSA001311\",\"GRSSA001323\",\"GRSSA001335\",\"GRSSA001340\",\"GRSSA001352\",\"GRSSA001364\",\"GRSSA001376\",\"GRSSA001381\",\"GRSSA001393\",\"GRSSA001405\",\"GRSSA001410\",\"GRSSA001422\",\"GRSSA001434\",\"GRSSA001446\",\"GRSSA001451\",\"GRSSA001463\",\"GRSSA001475\",\"GRSSA001480\",\"GRSSA001492\",\"GRSSA001504\",\"GRSSA001516\",\"GRSSA001521\",\"GRSSA001533\",\"GRSSA001545\",\"GRSSA001550\",\"GRSSA001562\",\"GRSSA001586\",\"GRSSA001591\",\"GRSSA001603\",\"GRSSA001615\",\"GRSSA001620\",\"GRSSA001632\",\"GRSSA001644\",\"GRSSA001656\",\"GRSSA001661\",\"GRSSA001673\",\"GRSSA001685\",\"GRSSA001690\",\"GRSSA001702\",\"GRSSA001714\",\"GRSSA001726\",\"GRSSA001731\",\"GRSSA001743\",\"GRSSA001755\",\"GRSSA001760\",\"GRSSA001772\",\"GRSSA001784\",\"GRSSA001796\",\"GRSSA001801\",\"GRSSA001813\",\"GRSSA001825\",\"GRSSA001830\",\"GRSSA001842\",\"GRSSA001854\",\"GRSSA001866\",\"GRSSA001871\",\"GRSSA001883\",\"GRSSA001895\",\"GRSSA001900\",\"GRSSA001912\",\"GRSSA001924\",\"GRSSA001936\",\"GRSSA001941\",\"GRSSA001953\",\"GRSSA001965\",\"GRSSA001970\",\"GRSSA001982\",\"GRSSA001994\",\"GRSSA002006\",\"GRSSA002011\",\"GRSSA002023\",\"GRSSA002035\",\"GRSSA002040\",\"GRSSA002052\",\"GRSSA002064\",\"GRSSA002076\",\"GRSSA002081\",\"GRSSA002093\",\"GRSSA002105\",\"GRSSA002110\",\"GRSSA002122\",\"GRSSA002134\",\"GRSSA002146\",\"GRSSA002151\",\"GRSSA002163\",\"GRSSA002175\",\"GRSSA002180\",\"GRSSA002192\",\"GRSSA002204\",\"GRSSA002216\",\"GRSSA002221\",\"GRSSA002233\",\"GRSSA002245\",\"GRSSA002250\",\"GRSSA002262\",\"GRSSA002274\",\"GRSSA002286\",\"GRSSA002291\",\"GRSSA002303\",\"GRSSA002315\",\"GRSSA002320\",\"GRSSA002332\",\"GRSSA002344\",\"GRSSA002356\",\"GRSSA002361\",\"GRSSA002373\",\"GRSSA002385\",\"GRSSA002390\",\"GRSSA002402\",\"GRSSA002414\",\"GRSSA002426\",\"GRSSA002431\",\"GRSSA002443\",\"GRSSA002455\",\"GRSSA002460\",\"GRSSA002472\",\"GRSSA002484\",\"GRSSA002496\",\"GRSSA002501\",\"GRSSA002513\",\"GRSSA002525\",\"GRSSA002530\",\"GRSSA002542\",\"GRSSA002554\",\"GRSSA002566\",\"GRSSA002571\",\"GRSSA002583\",\"GRSSA002595\",\"GRSSA002600\",\"GRSSA002612\",\"GRSSA002624\",\"GRSSA002636\",\"GRSSA002641\",\"GRSSA002653\",\"GRSSA002665\",\"GRSSA002670\",\"GRSSA002682\",\"GRSSA002694\",\"GRSSA002706\",\"GRSSA002711\",\"GRSSA002723\",\"GRSSA002735\",\"GRSSA002740\",\"GRSSA002752\",\"GRSSA002764\",\"GRSSA002776\",\"GRSSA002781\",\"GRSSA002793\",\"GRSSA002805\",\"GRSSA002810\",\"GRSSA002822\",\"GRSSA002834\",\"GRSSA002846\",\"GRSSA002851\",\"GRSSA002863\",\"GRSSA002875\",\"GRSSA002880\",\"GRSSA002892\",\"GRSSA002904\",\"GRSSA002921\",\"GRSSA002933\",\"GRSSA002945\",\"GRSSA002950\",\"GRSSA002962\",\"GRSSA002974\",\"GRSSA002986\",\"GRSSA002991\",\"GRSSA003003\",\"GRSSA003015\",\"GRSSA003020\",\"GRSSA003032\",\"GRSSA003044\",\"GRSSA003056\",\"GRSSA003061\",\"GRSSA003073\",\"GRSSA003085\",\"GRSSA003090\",\"GRSSA003102\",\"GRSSA003114\",\"GRSSA003126\",\"GRSSA003131\",\"GRSSA003143\",\"GRSSA003155\",\"GRSSA003160\",\"GRSSA003172\",\"GRSSA003184\",\"GRSSA003196\",\"GRSSA003201\",\"GRSSA003213\",\"GRSSA003225\",\"GRSSA003230\",\"GRSSA003242\",\"GRSSA003254\",\"GRSSA003266\",\"GRSSA003271\",\"GRSSA003283\",\"GRSSA003295\",\"GRSSA003300\",\"GRSSA003312\",\"GRSSA003324\",\"GRSSA003336\",\"GRSSA003341\",\"GRSSA003353\",\"GRSSA003365\",\"GRSSA003370\",\"GRSSA003382\",\"GRSSA003394\",\"GRSSA003406\",\"GRSSA003411\",\"GRSSA003423\",\"GRSSA003435\",\"GRSSA003440\",\"GRSSA003452\",\"GRSSA003464\",\"GRSSA003476\",\"GRSSA003481\",\"GRSSA003493\",\"GRSSA003505\",\"GRSSA003510\",\"GRSSA003522\",\"GRSSA003534\",\"GRSSA003546\",\"GRSSA003551\",\"GRSSA003563\",\"GRSSA003575\",\"GRSSA003580\",\"GRSSA003592\",\"GRSSA003604\",\"GRSSA003616\",\"GRSSA003621\",\"GRSSA003633\",\"GRSSA003645\",\"GRSSA003650\",\"GRSSA003662\",\"GRSSA003674\",\"GRSSA003686\",\"GRSSA003691\",\"GRSSA003703\",\"GRSSA003715\",\"GRSSA003720\",\"GRSSA003732\",\"GRSSA003744\",\"GRSSA003756\",\"GRSSA003761\",\"GRSSA003773\",\"GRSSA003785\",\"GRSSA003790\",\"GRSSA003802\",\"GRSSA003814\",\"GRSSA003826\",\"GRSSA003831\",\"GRSSA003843\",\"GRSSA003855\",\"GRSSA003860\",\"GRSSA003872\",\"GRSSA003884\",\"GRSSA003896\",\"GRSSA003901\",\"GRSSA003913\",\"GRSSA003925\",\"GRSSA003930\",\"GRSSA003942\",\"GRSSA003954\",\"GRSSA003966\",\"GRSSA003971\",\"GRSSA003983\",\"GRSSA003995\",\"GRSSA004000\",\"GRSSA004012\",\"GRSSA004024\",\"GRSSA004036\",\"GRSSA004041\",\"GRSSA004053\",\"GRSSA004065\",\"GRSSA004070\",\"GRSSA004082\",\"GRSSA004094\",\"GRSSA004106\",\"GRSSA004111\",\"GRSSA004123\",\"GRSSA004135\",\"GRSSA004140\",\"GRSSA004152\",\"GRSSA004164\",\"GRSSA004176\",\"GRSSA004181\",\"GRSSA004193\",\"GRSSA004205\",\"GRSSA004210\",\"GRSSA004222\",\"GRSSA004234\",\"GRSSA004246\",\"GRSSA004251\",\"GRSSA004263\",\"GRSSA004275\",\"GRSSA004280\",\"GRSSA004292\",\"GRSSA004304\",\"GRSSA004316\",\"GRSSA004321\",\"GRSSA004333\",\"GRSSA004345\",\"GRSSA004350\",\"GRSSA004362\",\"GRSSA004374\",\"GRSSA004386\",\"GRSSA004391\",\"GRSSA004403\",\"GRSSA004415\",\"GRSSA004420\",\"GRSSA004432\",\"GRSSA004444\",\"GRSSA004456\",\"GRSSA004461\",\"GRSSA004473\",\"GRSSA004485\",\"GRSSA004490\",\"GRSSA004502\",\"GRSSA004514\",\"GRSSA004526\",\"GRSSA004531\",\"GRSSA004543\",\"GRSSA004555\",\"GRSSA004560\",\"GRSSA004572\",\"GRSSA004584\",\"GRSSA004596\",\"GRSSA004601\",\"GRSSA004613\",\"GRSSA004625\",\"GRSSA004630\",\"GRSSA004642\",\"GRSSA004654\",\"GRSSA004666\",\"GRSSA004671\",\"GRSSA004695\",\"GRSSA004700\",\"GRSSA004712\",\"GRSSA004724\",\"GRSSA004736\",\"GRSSA004741\",\"GRSSA004753\",\"GRSSA004765\",\"GRSSA004770\",\"GRSSA004782\",\"GRSSA004794\",\"GRSSA004806\",\"GRSSA004811\",\"GRSSA004823\",\"GRSSA004835\",\"GRSSA004840\",\"GRSSA004852\",\"GRSSA004864\",\"GRSSA004876\",\"GRSSA004881\",\"GRSSA004893\",\"GRSSA004905\",\"GRSSA004910\",\"GRSSA004922\",\"GRSSA004934\",\"GRSSA004946\",\"GRSSA004951\",\"GRSSA004963\",\"GRSSA004975\",\"GRSSA004980\",\"GRSSA004992\",\"GRSSA005004\",\"GRSSA005016\",\"GRSSA005021\",\"GRSSA005033\",\"GRSSA005045\",\"GRSSA005050\",\"GRSSA005062\",\"GRSSA005074\",\"GRSSA005086\",\"GRSSA005091\",\"GRSSA005103\",\"GRSSA005115\",\"GRSSA005120\",\"GRSSA005132\",\"GRSSA005144\",\"GRSSA005156\",\"GRSSA005161\",\"GRSSA005173\",\"GRSSA005185\",\"GRSSA005190\",\"GRSSA005202\",\"GRSSA005214\",\"GRSSA005226\",\"GRSSA005231\",\"GRSSA005243\",\"GRSSA005255\",\"GRSSA005260\",\"GRSSA005272\",\"GRSSA005284\",\"GRSSA005296\",\"GRSSA005301\",\"GRSSA005313\",\"GRSSA005325\",\"GRSSA005330\",\"GRSSA005342\",\"GRSSA005354\",\"GRSSA005366\",\"GRSSA005371\",\"GRSSA005383\",\"GRSSA005395\",\"GRSSA005400\",\"GRSSA005412\",\"GRSSA005424\",\"GRSSA005436\",\"GRSSA005441\",\"GRSSA005470\",\"GRSSA005482\",\"GRSSA005494\",\"GRSSA005506\",\"GRSSA005511\",\"GRSSA005523\",\"GRSSA005535\",\"GRSSA005540\",\"GRSSA005552\",\"GRSSA005564\",\"GRSSA005576\",\"GRSSA005581\",\"GRSSA005593\",\"GRSSA005605\",\"GRSSA005610\",\"GRSSA005622\",\"GRSSA005634\",\"GRSSA005646\",\"GRSSA005651\",\"GRSSA005663\",\"GRSSA005675\",\"GRSSA005680\",\"GRSSA005692\",\"GRSSA005704\",\"GRSSA005716\",\"GRSSA005721\",\"GRSSA005733\",\"GRSSA005745\",\"GRSSA005750\",\"GRSSA005762\",\"GRSSA005774\",\"GRSSA005786\",\"GRSSA005791\",\"GRSSA005803\",\"GRSSA005815\",\"GRSSA005820\",\"GRSSA005832\",\"GRSSA005844\",\"GRSSA005856\",\"GRSSA005861\",\"GRSSA005873\",\"GRSSA005885\",\"GRSSA005890\",\"GRSSA005902\",\"GRSSA005914\",\"GRSSA005926\",\"GRSSA005931\",\"GRSSA005943\",\"GRSSA005955\",\"GRSSA005960\",\"GRSSA005972\",\"GRSSA005984\",\"GRSSA005996\",\"GRSSA006001\",\"GRSSA006013\",\"GRSSA006025\",\"GRSSA006030\",\"GRSSA006042\",\"GRSSA006066\",\"GRSSA006071\",\"GRSSA006083\",\"GRSSA006095\",\"GRSSA006100\",\"GRSSA006112\",\"GRSSA006124\",\"GRSSA006136\",\"GRSSA006141\",\"GRSSA006153\",\"GRSSA006165\",\"GRSSA006170\",\"GRSSA006182\",\"GRSSA006194\",\"GRSSA006206\",\"GRSSA006211\",\"GRSSA006223\",\"GRSSA006235\",\"GRSSA006240\",\"GRSSA006252\",\"GRSSA006264\",\"GRSSA006276\",\"GRSSA006281\",\"GRSSA006293\",\"GRSSA006305\",\"GRSSA006310\",\"GRSSA006322\",\"GRSSA006334\",\"GRSSA006346\",\"GRSSA006351\",\"GRSSA006363\",\"GRSSA006375\",\"GRSSA006380\",\"GRSSA006392\",\"GRSSA006404\",\"GRSSA006416\",\"GRSSA006421\",\"GRSSA006433\",\"GRSSA006445\",\"GRSSA006450\",\"GRSSA006462\",\"GRSSA006474\",\"GRSSA006486\",\"GRSSA006491\",\"GRSSA006503\",\"GRSSA006515\",\"GRSSA006520\",\"GRSSA006532\",\"GRSSA006544\",\"GRSSA006556\",\"GRSSA006561\",\"GRSSA006573\",\"GRSSA006585\",\"GRSSA006590\",\"GRSSA006602\",\"GRSSA006614\",\"GRSSA006626\",\"GRSSA006631\",\"GRSSA006643\",\"GRSSA006655\",\"GRSSA006660\",\"GRSSA006672\",\"GRSSA006684\",\"GRSSA006696\",\"GRSSA006701\",\"GRSSA006713\",\"GRSSA006725\",\"GRSSA006730\",\"GRSSA006754\",\"GRSSA006766\",\"GRSSA006771\",\"GRSSA006783\",\"GRSSA006795\",\"GRSSA006800\",\"GRSSA006812\",\"GRSSA006824\",\"GRSSA006836\",\"GRSSA006841\",\"GRSSA006853\",\"GRSSA006865\",\"GRSSA006870\",\"GRSSA006882\",\"GRSSA006894\",\"GRSSA006906\",\"GRSSA006911\",\"GRSSA006923\",\"GRSSA006935\",\"GRSSA006940\",\"GRSSA006952\",\"GRSSA006964\",\"GRSSA006976\",\"GRSSA006981\",\"GRSSA006993\",\"GRSSA007005\",\"GRSSA007010\",\"GRSSA007022\",\"GRSSA007034\",\"GRSSA007046\",\"GRSSA007051\",\"GRSSA007063\",\"GRSSA007075\",\"GRSSA007080\",\"GRSSA007092\",\"GRSSA007104\",\"GRSSA007116\",\"GRSSA007121\",\"GRSSA007133\",\"GRSSA007145\",\"GRSSA007150\",\"GRSSA007162\",\"GRSSA007174\",\"GRSSA007186\",\"GRSSA007191\",\"GRSSA007203\",\"GRSSA007215\",\"GRSSA007220\",\"GRSSA007232\",\"GRSSA007244\",\"GRSSA007256\",\"GRSSA007261\",\"GRSSA007273\",\"GRSSA007285\",\"GRSSA007290\",\"GRSSA007302\",\"GRSSA007314\",\"GRSSA007326\",\"GRSSA007331\",\"GRSSA007343\",\"GRSSA007355\",\"GRSSA007360\",\"GRSSA007372\",\"GRSSA007384\",\"GRSSA007396\",\"GRSSA007401\",\"GRSSA007413\",\"GRSSA007425\",\"GRSSA007430\",\"GRSSA007442\",\"GRSSA007454\",\"GRSSA007466\",\"GRSSA007471\",\"GRSSA007483\",\"GRSSA007495\",\"GRSSA007500\",\"GRSSA007512\",\"GRSSA007524\",\"GRSSA007536\",\"GRSSA007541\",\"GRSSA007553\",\"GRSSA007565\",\"GRSSA007570\",\"GRSSA007582\",\"GRSSA007594\",\"GRSSA007606\",\"GRSSA007611\",\"GRSSA007623\",\"GRSSA007635\",\"GRSSA007640\",\"GRSSA007652\",\"GRSSA007664\",\"GRSSA007676\",\"GRSSA007681\",\"GRSSA007693\",\"GRSSA007705\",\"GRSSA007710\",\"GRSSA007722\",\"GRSSA007734\",\"GRSSA007746\",\"GRSSA007751\",\"GRSSA007763\",\"GRSSA007775\",\"GRSSA007780\",\"GRSSA007792\",\"GRSSA007804\",\"GRSSA007816\",\"GRSSA007821\",\"GRSSA007833\",\"GRSSA007845\",\"GRSSA007850\",\"GRSSA007862\",\"GRSSA007874\",\"GRSSA007886\",\"GRSSA007891\",\"GRSSA007903\",\"GRSSA007915\",\"GRSSA007920\",\"GRSSA007932\",\"GRSSA007944\",\"GRSSA007956\",\"GRSSA007961\",\"GRSSA007973\",\"GRSSA007985\",\"GRSSA007990\",\"GRSSA008002\",\"GRSSA008014\",\"GRSSA008026\",\"GRSSA008031\",\"GRSSA008043\",\"GRSSA008055\",\"GRSSA008060\",\"GRSSA008072\",\"GRSSA008084\",\"GRSSA008096\",\"GRSSA008101\",\"GRSSA008113\",\"GRSSA008125\",\"GRSSA008130\",\"GRSSA008142\",\"GRSSA008154\",\"GRSSA008166\",\"GRSSA008171\",\"GRSSA008183\",\"GRSSA008195\",\"GRSSA008200\",\"GRSSA008212\",\"GRSSA008224\",\"GRSSA008236\",\"GRSSA008241\",\"GRSSA008253\",\"GRSSA008265\",\"GRSSA008270\",\"GRSSA008282\",\"GRSSA008294\",\"GRSSA008306\",\"GRSSA008311\",\"GRSSA008323\",\"GRSSA008335\",\"GRSSA008340\",\"GRSSA008352\",\"GRSSA008364\",\"GRSSA008376\",\"GRSSA008381\",\"GRSSA008393\",\"GRSSA008405\",\"GRSSA008410\",\"GRSSA008422\",\"GRSSA008434\",\"GRSSA008446\",\"GRSSA008451\",\"GRSSA008463\",\"GRSSA008475\",\"GRSSA008480\",\"GRSSA008492\",\"GRSSA008504\",\"GRSSA008516\",\"GRSSA008521\",\"GRSSA008533\",\"GRSSA008545\",\"GRSSA008550\",\"GRSSA008562\",\"GRSSA008574\",\"GRSSA008586\",\"GRSSA008591\",\"GRSSA008603\",\"GRSSA008615\",\"GRSSA008620\",\"GRSSA008644\",\"GRSSA008656\",\"GRSSA008661\",\"GRSSA008673\",\"GRSSA008685\",\"GRSSA008690\",\"GRSSA008702\",\"GRSSA008714\",\"GRSSA008726\",\"GRSSA008731\",\"GRSSA008743\",\"GRSSA008755\",\"GRSSA008760\",\"GRSSA008772\",\"GRSSA008784\",\"GRSSA008796\",\"GRSSA008801\",\"GRSSA008813\",\"GRSSA008825\",\"GRSSA008830\",\"GRSSA008842\",\"GRSSA008854\",\"GRSSA008866\",\"GRSSA008871\",\"GRSSA008883\",\"GRSSA008895\",\"GRSSA008900\",\"GRSSA008912\",\"GRSSA008924\",\"GRSSA008936\",\"GRSSA008941\",\"GRSSA008953\",\"GRSSA008965\",\"GRSSA008970\",\"GRSSA008982\",\"GRSSA008994\",\"GRSSA009006\",\"GRSSA009011\",\"GRSSA009023\",\"GRSSA009035\",\"GRSSA009040\",\"GRSSA009052\",\"GRSSA009064\",\"GRSSA009076\",\"GRSSA009081\",\"GRSSA009105\",\"GRSSA009110\",\"GRSSA009122\",\"GRSSA009134\",\"GRSSA009146\",\"GRSSA009151\",\"GRSSA009163\",\"GRSSA009175\",\"GRSSA009216\",\"GRSSA009221\",\"GRSSA009233\",\"GRSSA009245\",\"GRSSA009274\",\"GRSSA009286\",\"GRSSA009291\",\"GRSSA009315\",\"GRSSA009332\",\"GRSSA009344\",\"GRSSA009361\",\"GRSSA009373\",\"GRSSA009390\",\"GRSSA009426\",\"GRSSA009431\",\"GRSSA009455\",\"GRSSA009472\",\"GRSSA009484\",\"GRSSA009501\",\"GRSSA009513\",\"GRSSA009525\",\"GRSSA009530\",\"GRSSA009542\",\"GRSSA009554\",\"GRSSA009566\",\"GRSSA009595\",\"GRSSA009600\",\"GRSSA009612\",\"GRSSA009624\",\"GRSSA009636\",\"GRSSA009735\",\"GRSSA009740\",\"GRSSA009752\",\"GRSSA009764\",\"GRSSA009776\",\"GRSSA009781\",\"GRSSA009793\",\"GRSSA009805\",\"GRSSA009810\",\"GRSSA009822\",\"GRSSA009834\",\"GRSSA009846\",\"GRSSA009851\",\"GRSSA009863\",\"GRSSA009875\",\"GRSSA009916\",\"GRSSA009921\",\"GRSSA011531\",\"GRSSA011560\",\"GRSSA011573\",\"GRSSA011585\",\"GRSSA011590\",\"GRSSA011602\",\"GRSSA011614\",\"GRSSA011626\",\"GRSSA011631\",\"GRSSA011643\",\"GRSSA011655\",\"GRSSA011660\",\"GRSSA011672\",\"GRSSA011684\",\"GRSSA011696\",\"GRSSA011701\",\"GRSSA011713\",\"GRSSA011725\",\"GRSSA011730\",\"GRSSA011742\",\"GRSSA011754\",\"GRSSA011766\",\"GRSSA011770\",\"GRSSA011782\",\"GRSSA011794\",\"GRSSA011806\",\"GRSSA011823\",\"GRSSA011835\",\"GRSSA011840\",\"GRSSA011852\",\"GRSSA011864\",\"GRSSA011876\",\"GRSSA011881\",\"GRSSA011893\",\"GRSSA011905\",\"GRSSA011910\",\"GRSSA011922\",\"GRSSA011934\",\"GRSSA011946\",\"GRSSA011951\",\"GRSSA011963\",\"GRSSA011975\",\"GRSSA011980\",\"GRSSA011992\",\"GRSSA012016\",\"GRSSA012021\",\"GRSSA012033\",\"GRSSA012045\",\"GRSSA012050\",\"GRSSA012062\",\"GRSSA012074\",\"GRSSA012086\",\"GRSSA012091\",\"GRSSA012103\",\"GRSSA012115\",\"GRSSA012120\",\"GRSSA012132\",\"GRSSA012144\",\"GRSSA012156\",\"GRSSA012161\",\"GRSSA012173\",\"GRSSA012185\",\"GRSSA012190\",\"GRSSA012202\",\"GRSSA012214\",\"GRSSA012226\",\"GRSSA012231\",\"GRSSA012243\",\"GRSSA012255\",\"GRSSA012260\",\"GRSSA012272\",\"GRSSA012284\",\"GRSSA012296\",\"GRSSA012301\",\"GRSSA012313\",\"GRSSA012325\",\"GRSSA012330\",\"GRSSA012342\",\"GRSSA012354\",\"GRSSA012366\",\"GRSSA012371\",\"GRSSA012383\",\"GRSSA012395\",\"GRSSA012400\",\"GRSSA012412\",\"GRSSA012424\",\"GRSSA012436\",\"GRSSA012441\",\"GRSSA012453\",\"GRSSA012465\",\"GRSSA012470\",\"GRSSA012482\",\"GRSSA012494\",\"GRSSA012506\",\"GRSSA012511\",\"GRSSA012523\",\"GRSSA012535\",\"GRSSA012540\",\"GRSSA012552\",\"GRSSA012564\",\"GRSSA012576\",\"GRSSA012581\");\n} //fin de if($IdEstado == \"12\")\n\n//Condicion de estado-clues\nif($IdEstado == \"13\"){\n\t$Clues = array(\"HGSSA000016\",\"HGSSA000021\",\"HGSSA000033\",\"HGSSA000045\",\"HGSSA000050\",\"HGSSA000062\",\"HGSSA000074\",\"HGSSA000086\",\"HGSSA000091\",\"HGSSA000103\",\"HGSSA000115\",\"HGSSA000120\",\"HGSSA000132\",\"HGSSA000144\",\"HGSSA000156\",\"HGSSA000161\",\"HGSSA000173\",\"HGSSA000185\",\"HGSSA000190\",\"HGSSA000202\",\"HGSSA000214\",\"HGSSA000226\",\"HGSSA000231\",\"HGSSA000243\",\"HGSSA000255\",\"HGSSA000260\",\"HGSSA000272\",\"HGSSA000284\",\"HGSSA000296\",\"HGSSA000301\",\"HGSSA000313\",\"HGSSA000330\",\"HGSSA000342\",\"HGSSA000354\",\"HGSSA000366\",\"HGSSA000371\",\"HGSSA000383\",\"HGSSA000395\",\"HGSSA000400\",\"HGSSA000412\",\"HGSSA000424\",\"HGSSA000436\",\"HGSSA000441\",\"HGSSA000453\",\"HGSSA000465\",\"HGSSA000470\",\"HGSSA000482\",\"HGSSA000494\",\"HGSSA000506\",\"HGSSA000511\",\"HGSSA000523\",\"HGSSA000535\",\"HGSSA000540\",\"HGSSA000552\",\"HGSSA000564\",\"HGSSA000576\",\"HGSSA000581\",\"HGSSA000593\",\"HGSSA000605\",\"HGSSA000610\",\"HGSSA000622\",\"HGSSA000634\",\"HGSSA000646\",\"HGSSA000651\",\"HGSSA000663\",\"HGSSA000675\",\"HGSSA000680\",\"HGSSA000692\",\"HGSSA000704\",\"HGSSA000716\",\"HGSSA000721\",\"HGSSA000733\",\"HGSSA000745\",\"HGSSA000750\",\"HGSSA000762\",\"HGSSA000774\",\"HGSSA000786\",\"HGSSA000791\",\"HGSSA000803\",\"HGSSA000815\",\"HGSSA000820\",\"HGSSA000832\",\"HGSSA000844\",\"HGSSA000856\",\"HGSSA000861\",\"HGSSA000873\",\"HGSSA000885\",\"HGSSA000890\",\"HGSSA000902\",\"HGSSA000914\",\"HGSSA000926\",\"HGSSA000931\",\"HGSSA000943\",\"HGSSA000955\",\"HGSSA000960\",\"HGSSA000972\",\"HGSSA000984\",\"HGSSA000996\",\"HGSSA001001\",\"HGSSA001013\",\"HGSSA001025\",\"HGSSA001030\",\"HGSSA001042\",\"HGSSA001054\",\"HGSSA001066\",\"HGSSA001071\",\"HGSSA001083\",\"HGSSA001095\",\"HGSSA001100\",\"HGSSA001112\",\"HGSSA001124\",\"HGSSA001136\",\"HGSSA001141\",\"HGSSA001153\",\"HGSSA001165\",\"HGSSA001170\",\"HGSSA001182\",\"HGSSA001194\",\"HGSSA001206\",\"HGSSA001211\",\"HGSSA001223\",\"HGSSA001235\",\"HGSSA001240\",\"HGSSA001252\",\"HGSSA001264\",\"HGSSA001276\",\"HGSSA001281\",\"HGSSA001293\",\"HGSSA001305\",\"HGSSA001310\",\"HGSSA001322\",\"HGSSA001334\",\"HGSSA001346\",\"HGSSA001351\",\"HGSSA001363\",\"HGSSA001375\",\"HGSSA001380\",\"HGSSA001392\",\"HGSSA001404\",\"HGSSA001416\",\"HGSSA001421\",\"HGSSA001433\",\"HGSSA001445\",\"HGSSA001450\",\"HGSSA001462\",\"HGSSA001474\",\"HGSSA001486\",\"HGSSA001491\",\"HGSSA001503\",\"HGSSA001515\",\"HGSSA001520\",\"HGSSA001532\",\"HGSSA001544\",\"HGSSA001556\",\"HGSSA001561\",\"HGSSA001573\",\"HGSSA001585\",\"HGSSA001590\",\"HGSSA001602\",\"HGSSA001614\",\"HGSSA001626\",\"HGSSA001631\",\"HGSSA001643\",\"HGSSA001655\",\"HGSSA001660\",\"HGSSA001672\",\"HGSSA001684\",\"HGSSA001696\",\"HGSSA001701\",\"HGSSA001713\",\"HGSSA001725\",\"HGSSA001730\",\"HGSSA001742\",\"HGSSA001754\",\"HGSSA001766\",\"HGSSA001771\",\"HGSSA001783\",\"HGSSA001795\",\"HGSSA001800\",\"HGSSA001812\",\"HGSSA001824\",\"HGSSA001836\",\"HGSSA001841\",\"HGSSA001853\",\"HGSSA001865\",\"HGSSA001870\",\"HGSSA001882\",\"HGSSA001894\",\"HGSSA001906\",\"HGSSA001923\",\"HGSSA001935\",\"HGSSA001940\",\"HGSSA001952\",\"HGSSA001964\",\"HGSSA001976\",\"HGSSA001981\",\"HGSSA001993\",\"HGSSA002005\",\"HGSSA002010\",\"HGSSA002022\",\"HGSSA002034\",\"HGSSA002046\",\"HGSSA002051\",\"HGSSA002063\",\"HGSSA002075\",\"HGSSA002080\",\"HGSSA002092\",\"HGSSA002104\",\"HGSSA002116\",\"HGSSA002121\",\"HGSSA002133\",\"HGSSA002145\",\"HGSSA002150\",\"HGSSA002162\",\"HGSSA002174\",\"HGSSA002186\",\"HGSSA002191\",\"HGSSA002203\",\"HGSSA002215\",\"HGSSA002220\",\"HGSSA002232\",\"HGSSA002244\",\"HGSSA002256\",\"HGSSA002261\",\"HGSSA002273\",\"HGSSA002285\",\"HGSSA002290\",\"HGSSA002302\",\"HGSSA002314\",\"HGSSA002326\",\"HGSSA002331\",\"HGSSA002343\",\"HGSSA002355\",\"HGSSA002360\",\"HGSSA002372\",\"HGSSA002384\",\"HGSSA002396\",\"HGSSA002401\",\"HGSSA002413\",\"HGSSA002425\",\"HGSSA002430\",\"HGSSA002442\",\"HGSSA002454\",\"HGSSA002466\",\"HGSSA002471\",\"HGSSA002483\",\"HGSSA002495\",\"HGSSA002500\",\"HGSSA002512\",\"HGSSA002524\",\"HGSSA002536\",\"HGSSA002541\",\"HGSSA002553\",\"HGSSA002565\",\"HGSSA002570\",\"HGSSA002582\",\"HGSSA002594\",\"HGSSA002611\",\"HGSSA002623\",\"HGSSA002635\",\"HGSSA002640\",\"HGSSA002652\",\"HGSSA002664\",\"HGSSA002676\",\"HGSSA002681\",\"HGSSA002693\",\"HGSSA002705\",\"HGSSA002710\",\"HGSSA002722\",\"HGSSA002734\",\"HGSSA002746\",\"HGSSA002751\",\"HGSSA002763\",\"HGSSA002775\",\"HGSSA002780\",\"HGSSA002792\",\"HGSSA002804\",\"HGSSA002816\",\"HGSSA002821\",\"HGSSA002833\",\"HGSSA002845\",\"HGSSA002850\",\"HGSSA002862\",\"HGSSA002874\",\"HGSSA002886\",\"HGSSA002891\",\"HGSSA002903\",\"HGSSA002920\",\"HGSSA002932\",\"HGSSA002944\",\"HGSSA002956\",\"HGSSA002961\",\"HGSSA002973\",\"HGSSA002985\",\"HGSSA002990\",\"HGSSA003002\",\"HGSSA003014\",\"HGSSA003026\",\"HGSSA003031\",\"HGSSA003043\",\"HGSSA003055\",\"HGSSA003060\",\"HGSSA003072\",\"HGSSA003084\",\"HGSSA003096\",\"HGSSA003101\",\"HGSSA003113\",\"HGSSA003125\",\"HGSSA003130\",\"HGSSA003142\",\"HGSSA003154\",\"HGSSA003166\",\"HGSSA003171\",\"HGSSA003183\",\"HGSSA003195\",\"HGSSA003200\",\"HGSSA003212\",\"HGSSA003224\",\"HGSSA003236\",\"HGSSA003241\",\"HGSSA003253\",\"HGSSA003265\",\"HGSSA003270\",\"HGSSA003282\",\"HGSSA003294\",\"HGSSA003306\",\"HGSSA003311\",\"HGSSA003323\",\"HGSSA003335\",\"HGSSA003340\",\"HGSSA003352\",\"HGSSA003364\",\"HGSSA003376\",\"HGSSA003381\",\"HGSSA003393\",\"HGSSA003405\",\"HGSSA003410\",\"HGSSA003422\",\"HGSSA003434\",\"HGSSA003446\",\"HGSSA003451\",\"HGSSA003463\",\"HGSSA003475\",\"HGSSA003480\",\"HGSSA003492\",\"HGSSA003504\",\"HGSSA003516\",\"HGSSA003521\",\"HGSSA003533\",\"HGSSA003545\",\"HGSSA003550\",\"HGSSA003562\",\"HGSSA003574\",\"HGSSA003586\",\"HGSSA003591\",\"HGSSA003603\",\"HGSSA003615\",\"HGSSA003620\",\"HGSSA003632\",\"HGSSA003644\",\"HGSSA003656\",\"HGSSA003661\",\"HGSSA003673\",\"HGSSA003685\",\"HGSSA003690\",\"HGSSA003702\",\"HGSSA003714\",\"HGSSA003726\",\"HGSSA003731\",\"HGSSA003743\",\"HGSSA003755\",\"HGSSA003760\",\"HGSSA003772\",\"HGSSA003784\",\"HGSSA003796\",\"HGSSA003801\",\"HGSSA003813\",\"HGSSA003825\",\"HGSSA003830\",\"HGSSA003842\",\"HGSSA003854\",\"HGSSA003866\",\"HGSSA003871\",\"HGSSA003883\",\"HGSSA003895\",\"HGSSA003900\",\"HGSSA003912\",\"HGSSA003924\",\"HGSSA003936\",\"HGSSA003941\",\"HGSSA003965\",\"HGSSA003970\",\"HGSSA003982\",\"HGSSA003994\",\"HGSSA004006\",\"HGSSA004011\",\"HGSSA004023\",\"HGSSA004035\",\"HGSSA004040\",\"HGSSA004052\",\"HGSSA004064\",\"HGSSA004076\",\"HGSSA004081\",\"HGSSA004093\",\"HGSSA004105\",\"HGSSA004110\",\"HGSSA004122\",\"HGSSA004134\",\"HGSSA004146\",\"HGSSA004163\",\"HGSSA004175\",\"HGSSA004180\",\"HGSSA004192\",\"HGSSA004204\",\"HGSSA004216\",\"HGSSA004221\",\"HGSSA004233\",\"HGSSA004245\",\"HGSSA004250\",\"HGSSA004262\",\"HGSSA004274\",\"HGSSA004286\",\"HGSSA004291\",\"HGSSA004303\",\"HGSSA004315\",\"HGSSA004320\",\"HGSSA004344\",\"HGSSA004356\",\"HGSSA004361\",\"HGSSA004373\",\"HGSSA004385\",\"HGSSA004390\",\"HGSSA004402\",\"HGSSA004414\",\"HGSSA004426\",\"HGSSA004431\",\"HGSSA004443\",\"HGSSA004455\",\"HGSSA004472\",\"HGSSA004484\",\"HGSSA004496\",\"HGSSA004501\",\"HGSSA004513\",\"HGSSA004525\",\"HGSSA004530\",\"HGSSA004554\",\"HGSSA004566\",\"HGSSA004571\",\"HGSSA004583\",\"HGSSA004595\",\"HGSSA004600\",\"HGSSA004612\",\"HGSSA004624\",\"HGSSA004636\",\"HGSSA004641\",\"HGSSA004653\",\"HGSSA004665\",\"HGSSA004670\",\"HGSSA004682\",\"HGSSA004694\",\"HGSSA004706\",\"HGSSA004711\",\"HGSSA004723\",\"HGSSA004735\",\"HGSSA004740\",\"HGSSA004752\",\"HGSSA004781\",\"HGSSA004793\",\"HGSSA004805\",\"HGSSA004810\",\"HGSSA004822\",\"HGSSA004834\",\"HGSSA004846\",\"HGSSA004851\",\"HGSSA004863\",\"HGSSA004875\",\"HGSSA015294\",\"HGSSA015306\",\"HGSSA015311\",\"HGSSA015323\",\"HGSSA015335\",\"HGSSA015340\",\"HGSSA015352\",\"HGSSA015364\",\"HGSSA015376\",\"HGSSA015381\",\"HGSSA015393\",\"HGSSA015405\",\"HGSSA015410\",\"HGSSA015422\",\"HGSSA015434\",\"HGSSA015446\",\"HGSSA015451\",\"HGSSA015463\",\"HGSSA015475\",\"HGSSA015480\",\"HGSSA015492\",\"HGSSA015503\",\"HGSSA015515\",\"HGSSA015520\",\"HGSSA015532\",\"HGSSA015544\",\"HGSSA015556\",\"HGSSA015561\",\"HGSSA015573\",\"HGSSA015585\",\"HGSSA015590\",\"HGSSA015602\",\"HGSSA015614\",\"HGSSA015626\",\"HGSSA015631\",\"HGSSA015655\",\"HGSSA015660\",\"HGSSA015672\",\"HGSSA015684\",\"HGSSA015696\",\"HGSSA015701\",\"HGSSA015713\",\"HGSSA015725\",\"HGSSA015730\",\"HGSSA015742\",\"HGSSA015754\",\"HGSSA015766\",\"HGSSA015771\",\"HGSSA015783\",\"HGSSA015795\",\"HGSSA015800\",\"HGSSA015812\",\"HGSSA015824\",\"HGSSA015853\",\"HGSSA015894\",\"HGSSA015906\",\"HGSSA015923\",\"HGSSA015935\",\"HGSSA015940\",\"HGSSA015952\",\"HGSSA015964\",\"HGSSA015976\",\"HGSSA015981\",\"HGSSA015993\",\"HGSSA016005\",\"HGSSA016022\",\"HGSSA016034\",\"HGSSA016046\",\"HGSSA016051\",\"HGSSA016063\",\"HGSSA016075\",\"HGSSA016092\",\"HGSSA016104\",\"HGSSA016116\",\"HGSSA016133\",\"HGSSA016145\",\"HGSSA016150\",\"HGSSA016162\",\"HGSSA016186\",\"HGSSA016191\",\"HGSSA016203\",\"HGSSA016232\",\"HGSSA016244\",\"HGSSA016256\",\"HGSSA016261\",\"HGSSA016273\",\"HGSSA016314\",\"HGSSA016326\",\"HGSSA016331\",\"HGSSA016360\",\"HGSSA016372\",\"HGSSA016396\",\"HGSSA016401\",\"HGSSA016413\",\"HGSSA016425\",\"HGSSA016442\",\"HGSSA016454\",\"HGSSA016466\",\"HGSSA016471\",\"HGSSA016483\",\"HGSSA016495\",\"HGSSA016500\",\"HGSSA016512\",\"HGSSA016524\",\"HGSSA016536\",\"HGSSA016541\",\"HGSSA016553\",\"HGSSA016565\",\"HGSSA016570\",\"HGSSA016582\",\"HGSSA016594\",\"HGSSA016606\",\"HGSSA016611\",\"HGSSA016676\",\"HGSSA016681\",\"HGSSA016705\",\"HGSSA016710\",\"HGSSA016722\",\"HGSSA016746\",\"HGSSA016751\",\"HGSSA016763\",\"HGSSA016775\",\"HGSSA016780\",\"HGSSA016821\",\"HGSSA016850\",\"HGSSA016862\",\"HGSSA016886\",\"HGSSA016891\",\"HGSSA016903\",\"HGSSA016915\",\"HGSSA016920\",\"HGSSA016932\",\"HGSSA016961\",\"HGSSA016973\",\"HGSSA016985\",\"HGSSA016990\",\"HGSSA017031\",\"HGSSA017043\",\"HGSSA017055\",\"HGSSA017060\",\"HGSSA017084\",\"HGSSA017096\",\"HGSSA017101\",\"HGSSA017113\",\"HGSSA017125\",\"HGSSA017142\",\"HGSSA017154\",\"HGSSA017166\",\"HGSSA017195\",\"HGSSA017200\",\"HGSSA017212\",\"HGSSA017241\",\"HGSSA017282\",\"HGSSA017306\",\"HGSSA017323\",\"HGSSA017335\",\"HGSSA017340\",\"HGSSA017352\",\"HGSSA017364\",\"HGSSA017376\",\"HGSSA017381\",\"HGSSA017393\",\"HGSSA017405\",\"HGSSA017410\",\"HGSSA017422\",\"HGSSA017434\",\"HGSSA017446\",\"HGSSA017451\",\"HGSSA017475\",\"HGSSA017480\",\"HGSSA017492\",\"HGSSA017516\",\"HGSSA017521\",\"HGSSA017545\",\"HGSSA017550\",\"HGSSA017562\",\"HGSSA017574\",\"HGSSA017591\",\"HGSSA017603\",\"HGSSA017615\",\"HGSSA017644\",\"HGSSA017656\",\"HGSSA017661\",\"HGSSA017673\",\"HGSSA017685\",\"HGSSA017690\",\"HGSSA017702\",\"HGSSA017714\",\"HGSSA017726\",\"HGSSA017731\",\"HGSSA017743\",\"HGSSA017755\",\"HGSSA017760\",\"HGSSA017772\",\"HGSSA017784\",\"HGSSA017796\",\"HGSSA017801\",\"HGSSA017813\",\"HGSSA017825\",\"HGSSA017830\",\"HGSSA017842\",\"HGSSA017854\",\"HGSSA017866\",\"HGSSA017871\",\"HGSSA017883\",\"HGSSA017895\",\"HGSSA017900\",\"HGSSA017912\",\"HGSSA017924\",\"HGSSA017936\",\"HGSSA017941\",\"HGSSA017953\",\"HGSSA017965\",\"HGSSA017970\",\"HGSSA017982\",\"HGSSA017994\");\n} //fin de if($IdEstado == \"13\")\n\n//Condicion de estado-clues\nif($IdEstado == \"14\"){\n\t$Clues = array(\"JCSSA000013\",\"JCSSA000025\",\"JCSSA000030\",\"JCSSA000042\",\"JCSSA000066\",\"JCSSA000071\",\"JCSSA000083\",\"JCSSA000095\",\"JCSSA000100\",\"JCSSA000112\",\"JCSSA000124\",\"JCSSA000136\",\"JCSSA000141\",\"JCSSA000153\",\"JCSSA000165\",\"JCSSA000170\",\"JCSSA000182\",\"JCSSA000206\",\"JCSSA000211\",\"JCSSA000223\",\"JCSSA000235\",\"JCSSA000240\",\"JCSSA000252\",\"JCSSA000264\",\"JCSSA000276\",\"JCSSA000281\",\"JCSSA000293\",\"JCSSA000305\",\"JCSSA000310\",\"JCSSA000322\",\"JCSSA000334\",\"JCSSA000346\",\"JCSSA000351\",\"JCSSA000363\",\"JCSSA000375\",\"JCSSA000380\",\"JCSSA000392\",\"JCSSA000404\",\"JCSSA000416\",\"JCSSA000421\",\"JCSSA000433\",\"JCSSA000445\",\"JCSSA000450\",\"JCSSA000462\",\"JCSSA000474\",\"JCSSA000486\",\"JCSSA000491\",\"JCSSA000503\",\"JCSSA000515\",\"JCSSA000520\",\"JCSSA000532\",\"JCSSA000544\",\"JCSSA000556\",\"JCSSA000561\",\"JCSSA000573\",\"JCSSA000585\",\"JCSSA000590\",\"JCSSA000602\",\"JCSSA000614\",\"JCSSA000626\",\"JCSSA000631\",\"JCSSA000643\",\"JCSSA000655\",\"JCSSA000660\",\"JCSSA000672\",\"JCSSA000684\",\"JCSSA000696\",\"JCSSA000701\",\"JCSSA000713\",\"JCSSA000725\",\"JCSSA000730\",\"JCSSA000742\",\"JCSSA000754\",\"JCSSA000766\",\"JCSSA000771\",\"JCSSA000783\",\"JCSSA000795\",\"JCSSA000800\",\"JCSSA000812\",\"JCSSA000836\",\"JCSSA000841\",\"JCSSA000853\",\"JCSSA000865\",\"JCSSA000870\",\"JCSSA000882\",\"JCSSA000906\",\"JCSSA000911\",\"JCSSA000935\",\"JCSSA000940\",\"JCSSA000952\",\"JCSSA000964\",\"JCSSA000976\",\"JCSSA000981\",\"JCSSA000993\",\"JCSSA001005\",\"JCSSA001010\",\"JCSSA001022\",\"JCSSA001034\",\"JCSSA001046\",\"JCSSA001051\",\"JCSSA001063\",\"JCSSA001075\",\"JCSSA001116\",\"JCSSA001121\",\"JCSSA001133\",\"JCSSA001145\",\"JCSSA001150\",\"JCSSA001162\",\"JCSSA001174\",\"JCSSA001186\",\"JCSSA001191\",\"JCSSA001203\",\"JCSSA001215\",\"JCSSA001220\",\"JCSSA001232\",\"JCSSA001244\",\"JCSSA001256\",\"JCSSA001261\",\"JCSSA001273\",\"JCSSA001285\",\"JCSSA001290\",\"JCSSA001302\",\"JCSSA001314\",\"JCSSA001326\",\"JCSSA001331\",\"JCSSA001384\",\"JCSSA001396\",\"JCSSA001401\",\"JCSSA001413\",\"JCSSA001425\",\"JCSSA001430\",\"JCSSA001442\",\"JCSSA001454\",\"JCSSA001466\",\"JCSSA001471\",\"JCSSA001483\",\"JCSSA001495\",\"JCSSA001500\",\"JCSSA001512\",\"JCSSA001524\",\"JCSSA001536\",\"JCSSA001541\",\"JCSSA001553\",\"JCSSA001565\",\"JCSSA001570\",\"JCSSA001582\",\"JCSSA001594\",\"JCSSA001606\",\"JCSSA001611\",\"JCSSA001623\",\"JCSSA001635\",\"JCSSA001640\",\"JCSSA001652\",\"JCSSA001664\",\"JCSSA001676\",\"JCSSA001681\",\"JCSSA001693\",\"JCSSA001705\",\"JCSSA001710\",\"JCSSA001722\",\"JCSSA001734\",\"JCSSA001746\",\"JCSSA001751\",\"JCSSA001763\",\"JCSSA001775\",\"JCSSA001780\",\"JCSSA001792\",\"JCSSA001804\",\"JCSSA001816\",\"JCSSA001821\",\"JCSSA001833\",\"JCSSA001845\",\"JCSSA001850\",\"JCSSA001862\",\"JCSSA001874\",\"JCSSA001886\",\"JCSSA001891\",\"JCSSA001903\",\"JCSSA001915\",\"JCSSA001920\",\"JCSSA001932\",\"JCSSA001944\",\"JCSSA001956\",\"JCSSA001961\",\"JCSSA001973\",\"JCSSA001985\",\"JCSSA001990\",\"JCSSA002002\",\"JCSSA002014\",\"JCSSA002026\",\"JCSSA002031\",\"JCSSA002043\",\"JCSSA002055\",\"JCSSA002060\",\"JCSSA002072\",\"JCSSA002084\",\"JCSSA002101\",\"JCSSA002113\",\"JCSSA002125\",\"JCSSA002130\",\"JCSSA002142\",\"JCSSA002154\",\"JCSSA002166\",\"JCSSA002171\",\"JCSSA002183\",\"JCSSA002195\",\"JCSSA002200\",\"JCSSA002212\",\"JCSSA002224\",\"JCSSA002236\",\"JCSSA002241\",\"JCSSA002253\",\"JCSSA002265\",\"JCSSA002270\",\"JCSSA002282\",\"JCSSA002294\",\"JCSSA002306\",\"JCSSA002311\",\"JCSSA002323\",\"JCSSA002335\",\"JCSSA002340\",\"JCSSA002352\",\"JCSSA002364\",\"JCSSA002376\",\"JCSSA002381\",\"JCSSA002393\",\"JCSSA002405\",\"JCSSA002410\",\"JCSSA002422\",\"JCSSA002434\",\"JCSSA002446\",\"JCSSA002451\",\"JCSSA002463\",\"JCSSA002475\",\"JCSSA002480\",\"JCSSA002492\",\"JCSSA002504\",\"JCSSA002516\",\"JCSSA002521\",\"JCSSA002533\",\"JCSSA002545\",\"JCSSA002550\",\"JCSSA002562\",\"JCSSA002574\",\"JCSSA002586\",\"JCSSA002603\",\"JCSSA002615\",\"JCSSA002620\",\"JCSSA002632\",\"JCSSA002644\",\"JCSSA002656\",\"JCSSA002661\",\"JCSSA002673\",\"JCSSA002685\",\"JCSSA002690\",\"JCSSA002702\",\"JCSSA002726\",\"JCSSA002731\",\"JCSSA002743\",\"JCSSA002755\",\"JCSSA002772\",\"JCSSA002784\",\"JCSSA002796\",\"JCSSA002801\",\"JCSSA002813\",\"JCSSA002825\",\"JCSSA002830\",\"JCSSA002842\",\"JCSSA002854\",\"JCSSA002866\",\"JCSSA002871\",\"JCSSA002883\",\"JCSSA002895\",\"JCSSA002900\",\"JCSSA002912\",\"JCSSA002924\",\"JCSSA002936\",\"JCSSA002941\",\"JCSSA002953\",\"JCSSA002965\",\"JCSSA002970\",\"JCSSA002982\",\"JCSSA002994\",\"JCSSA003006\",\"JCSSA003011\",\"JCSSA003023\",\"JCSSA003035\",\"JCSSA003040\",\"JCSSA003052\",\"JCSSA003064\",\"JCSSA003076\",\"JCSSA003081\",\"JCSSA003093\",\"JCSSA003105\",\"JCSSA003110\",\"JCSSA003122\",\"JCSSA003134\",\"JCSSA003146\",\"JCSSA003151\",\"JCSSA003163\",\"JCSSA003175\",\"JCSSA003180\",\"JCSSA003192\",\"JCSSA003204\",\"JCSSA003216\",\"JCSSA003221\",\"JCSSA003233\",\"JCSSA003245\",\"JCSSA003250\",\"JCSSA003262\",\"JCSSA003274\",\"JCSSA003286\",\"JCSSA003291\",\"JCSSA003303\",\"JCSSA003315\",\"JCSSA003320\",\"JCSSA003332\",\"JCSSA003344\",\"JCSSA003356\",\"JCSSA003361\",\"JCSSA003373\",\"JCSSA003385\",\"JCSSA003390\",\"JCSSA003402\",\"JCSSA003414\",\"JCSSA003426\",\"JCSSA003431\",\"JCSSA003443\",\"JCSSA003455\",\"JCSSA003460\",\"JCSSA003472\",\"JCSSA003484\",\"JCSSA003496\",\"JCSSA003501\",\"JCSSA003513\",\"JCSSA003525\",\"JCSSA003530\",\"JCSSA003542\",\"JCSSA003554\",\"JCSSA003566\",\"JCSSA003571\",\"JCSSA003583\",\"JCSSA003595\",\"JCSSA003600\",\"JCSSA003612\",\"JCSSA003624\",\"JCSSA003636\",\"JCSSA003641\",\"JCSSA003653\",\"JCSSA003665\",\"JCSSA003670\",\"JCSSA003694\",\"JCSSA003706\",\"JCSSA003711\",\"JCSSA003723\",\"JCSSA003735\",\"JCSSA003740\",\"JCSSA003752\",\"JCSSA003764\",\"JCSSA003776\",\"JCSSA003781\",\"JCSSA003793\",\"JCSSA003805\",\"JCSSA003810\",\"JCSSA003822\",\"JCSSA003846\",\"JCSSA003863\",\"JCSSA003875\",\"JCSSA003880\",\"JCSSA003892\",\"JCSSA003904\",\"JCSSA003916\",\"JCSSA003921\",\"JCSSA003933\",\"JCSSA003945\",\"JCSSA003950\",\"JCSSA003962\",\"JCSSA003974\",\"JCSSA003986\",\"JCSSA003991\",\"JCSSA004003\",\"JCSSA004015\",\"JCSSA004020\",\"JCSSA004032\",\"JCSSA004044\",\"JCSSA004056\",\"JCSSA004061\",\"JCSSA004073\",\"JCSSA004085\",\"JCSSA004090\",\"JCSSA004102\",\"JCSSA004114\",\"JCSSA004126\",\"JCSSA004131\",\"JCSSA004143\",\"JCSSA004155\",\"JCSSA004160\",\"JCSSA004172\",\"JCSSA004184\",\"JCSSA004196\",\"JCSSA004201\",\"JCSSA004213\",\"JCSSA004225\",\"JCSSA004230\",\"JCSSA004242\",\"JCSSA004266\",\"JCSSA004271\",\"JCSSA004283\",\"JCSSA004295\",\"JCSSA004300\",\"JCSSA004312\",\"JCSSA004324\",\"JCSSA004336\",\"JCSSA004341\",\"JCSSA004353\",\"JCSSA004365\",\"JCSSA004370\",\"JCSSA004382\",\"JCSSA004394\",\"JCSSA004406\",\"JCSSA004411\",\"JCSSA004423\",\"JCSSA004435\",\"JCSSA004440\",\"JCSSA004452\",\"JCSSA004464\",\"JCSSA004476\",\"JCSSA004481\",\"JCSSA004493\",\"JCSSA004505\",\"JCSSA004510\",\"JCSSA004522\",\"JCSSA004534\",\"JCSSA004546\",\"JCSSA004551\",\"JCSSA004563\",\"JCSSA004575\",\"JCSSA004580\",\"JCSSA004592\",\"JCSSA004604\",\"JCSSA004616\",\"JCSSA004621\",\"JCSSA004633\",\"JCSSA004645\",\"JCSSA004650\",\"JCSSA004662\",\"JCSSA004674\",\"JCSSA004686\",\"JCSSA004691\",\"JCSSA004703\",\"JCSSA004715\",\"JCSSA004720\",\"JCSSA004732\",\"JCSSA004744\",\"JCSSA004756\",\"JCSSA004761\",\"JCSSA004773\",\"JCSSA004785\",\"JCSSA004790\",\"JCSSA004802\",\"JCSSA004814\",\"JCSSA004826\",\"JCSSA004831\",\"JCSSA004843\",\"JCSSA004855\",\"JCSSA004860\",\"JCSSA004872\",\"JCSSA004884\",\"JCSSA004896\",\"JCSSA004913\",\"JCSSA004925\",\"JCSSA004930\",\"JCSSA004942\",\"JCSSA004954\",\"JCSSA004983\",\"JCSSA004995\",\"JCSSA005000\",\"JCSSA005012\",\"JCSSA005024\",\"JCSSA005036\",\"JCSSA005041\",\"JCSSA005053\",\"JCSSA005065\",\"JCSSA005070\",\"JCSSA005082\",\"JCSSA005094\",\"JCSSA005106\",\"JCSSA005111\",\"JCSSA005123\",\"JCSSA005135\",\"JCSSA005140\",\"JCSSA005164\",\"JCSSA005176\",\"JCSSA005181\",\"JCSSA005193\",\"JCSSA005205\",\"JCSSA005210\",\"JCSSA005222\",\"JCSSA005234\",\"JCSSA005246\",\"JCSSA005251\",\"JCSSA005263\",\"JCSSA005275\",\"JCSSA005280\",\"JCSSA005292\",\"JCSSA005304\",\"JCSSA005316\",\"JCSSA005321\",\"JCSSA005333\",\"JCSSA005345\",\"JCSSA005350\",\"JCSSA005362\",\"JCSSA005374\",\"JCSSA005386\",\"JCSSA005391\",\"JCSSA005403\",\"JCSSA005415\",\"JCSSA005420\",\"JCSSA005432\",\"JCSSA005444\",\"JCSSA005456\",\"JCSSA005461\",\"JCSSA005473\",\"JCSSA005485\",\"JCSSA005490\",\"JCSSA005502\",\"JCSSA005514\",\"JCSSA005526\",\"JCSSA005531\",\"JCSSA005543\",\"JCSSA005555\",\"JCSSA005560\",\"JCSSA005572\",\"JCSSA005584\",\"JCSSA005596\",\"JCSSA005601\",\"JCSSA005613\",\"JCSSA005625\",\"JCSSA005630\",\"JCSSA005642\",\"JCSSA005654\",\"JCSSA005666\",\"JCSSA005671\",\"JCSSA005683\",\"JCSSA005695\",\"JCSSA005700\",\"JCSSA005712\",\"JCSSA005724\",\"JCSSA005736\",\"JCSSA005741\",\"JCSSA005753\",\"JCSSA005765\",\"JCSSA005770\",\"JCSSA005782\",\"JCSSA005806\",\"JCSSA005811\",\"JCSSA005823\",\"JCSSA005835\",\"JCSSA005840\",\"JCSSA005852\",\"JCSSA005864\",\"JCSSA005876\",\"JCSSA005881\",\"JCSSA005893\",\"JCSSA005905\",\"JCSSA005910\",\"JCSSA005922\",\"JCSSA005934\",\"JCSSA005946\",\"JCSSA005951\",\"JCSSA005963\",\"JCSSA005975\",\"JCSSA005980\",\"JCSSA005992\",\"JCSSA006004\",\"JCSSA006016\",\"JCSSA006021\",\"JCSSA006033\",\"JCSSA006045\",\"JCSSA006050\",\"JCSSA006062\",\"JCSSA006074\",\"JCSSA006086\",\"JCSSA006091\",\"JCSSA006103\",\"JCSSA006115\",\"JCSSA006120\",\"JCSSA006132\",\"JCSSA006144\",\"JCSSA006156\",\"JCSSA006161\",\"JCSSA006173\",\"JCSSA006185\",\"JCSSA006190\",\"JCSSA006202\",\"JCSSA006214\",\"JCSSA006226\",\"JCSSA006231\",\"JCSSA006243\",\"JCSSA006255\",\"JCSSA006260\",\"JCSSA006272\",\"JCSSA006284\",\"JCSSA006296\",\"JCSSA006301\",\"JCSSA006313\",\"JCSSA006325\",\"JCSSA006330\",\"JCSSA006342\",\"JCSSA006354\",\"JCSSA006366\",\"JCSSA006371\",\"JCSSA006383\",\"JCSSA006395\",\"JCSSA006400\",\"JCSSA006412\",\"JCSSA006424\",\"JCSSA006436\",\"JCSSA006441\",\"JCSSA006453\",\"JCSSA006465\",\"JCSSA006470\",\"JCSSA006482\",\"JCSSA006494\",\"JCSSA006506\",\"JCSSA006511\",\"JCSSA006523\",\"JCSSA006535\",\"JCSSA006540\",\"JCSSA006552\",\"JCSSA006564\",\"JCSSA006576\",\"JCSSA006581\",\"JCSSA006593\",\"JCSSA006605\",\"JCSSA006610\",\"JCSSA006622\",\"JCSSA006634\",\"JCSSA006646\",\"JCSSA006651\",\"JCSSA006663\",\"JCSSA006675\",\"JCSSA006680\",\"JCSSA006692\",\"JCSSA006704\",\"JCSSA006716\",\"JCSSA006721\",\"JCSSA006733\",\"JCSSA006745\",\"JCSSA006750\",\"JCSSA006762\",\"JCSSA006774\",\"JCSSA006786\",\"JCSSA006791\",\"JCSSA006803\",\"JCSSA006815\",\"JCSSA006820\",\"JCSSA006832\",\"JCSSA006844\",\"JCSSA006856\",\"JCSSA006861\",\"JCSSA006873\",\"JCSSA006885\",\"JCSSA006890\",\"JCSSA006902\",\"JCSSA006914\",\"JCSSA006926\",\"JCSSA006931\",\"JCSSA006943\",\"JCSSA006955\",\"JCSSA006960\",\"JCSSA006972\",\"JCSSA006984\",\"JCSSA006996\",\"JCSSA007001\",\"JCSSA007013\",\"JCSSA007030\",\"JCSSA007042\",\"JCSSA007054\",\"JCSSA007066\",\"JCSSA007083\",\"JCSSA007095\",\"JCSSA007100\",\"JCSSA007112\",\"JCSSA007124\",\"JCSSA007136\",\"JCSSA007141\",\"JCSSA007153\",\"JCSSA007165\",\"JCSSA007170\",\"JCSSA007182\",\"JCSSA007194\",\"JCSSA007206\",\"JCSSA007211\",\"JCSSA007223\",\"JCSSA007235\",\"JCSSA007240\",\"JCSSA007252\",\"JCSSA007264\",\"JCSSA007276\",\"JCSSA007281\",\"JCSSA007293\",\"JCSSA007305\",\"JCSSA007310\",\"JCSSA007322\",\"JCSSA007334\",\"JCSSA007346\",\"JCSSA007351\",\"JCSSA007363\",\"JCSSA007375\",\"JCSSA007380\",\"JCSSA007392\",\"JCSSA007404\",\"JCSSA007416\",\"JCSSA007421\",\"JCSSA007433\",\"JCSSA007445\",\"JCSSA007450\",\"JCSSA007462\",\"JCSSA007474\",\"JCSSA007486\",\"JCSSA007491\",\"JCSSA007503\",\"JCSSA007515\",\"JCSSA007520\",\"JCSSA007532\",\"JCSSA007544\",\"JCSSA007556\",\"JCSSA007561\",\"JCSSA007573\",\"JCSSA007585\",\"JCSSA007590\",\"JCSSA007602\",\"JCSSA007614\",\"JCSSA007626\",\"JCSSA007631\",\"JCSSA007655\",\"JCSSA007660\",\"JCSSA007672\",\"JCSSA007684\",\"JCSSA007696\",\"JCSSA007701\",\"JCSSA007713\",\"JCSSA007725\",\"JCSSA007730\",\"JCSSA007742\",\"JCSSA007754\",\"JCSSA007766\",\"JCSSA007771\",\"JCSSA007783\",\"JCSSA007795\",\"JCSSA007800\",\"JCSSA007824\",\"JCSSA007836\",\"JCSSA007841\",\"JCSSA007853\",\"JCSSA007865\",\"JCSSA012596\",\"JCSSA012601\",\"JCSSA012613\",\"JCSSA012626\",\"JCSSA012631\",\"JCSSA012643\",\"JCSSA012655\",\"JCSSA012660\",\"JCSSA012672\",\"JCSSA012684\",\"JCSSA012696\",\"JCSSA012701\",\"JCSSA012713\",\"JCSSA012725\",\"JCSSA012730\",\"JCSSA012742\",\"JCSSA012754\",\"JCSSA012766\",\"JCSSA012771\",\"JCSSA012783\",\"JCSSA012795\",\"JCSSA012800\",\"JCSSA012812\",\"JCSSA012824\",\"JCSSA012836\",\"JCSSA012841\",\"JCSSA012853\",\"JCSSA012865\",\"JCSSA012870\",\"JCSSA012882\",\"JCSSA012894\",\"JCSSA012906\",\"JCSSA012911\",\"JCSSA012923\",\"JCSSA012935\",\"JCSSA012940\",\"JCSSA012952\",\"JCSSA012964\",\"JCSSA012976\",\"JCSSA012981\",\"JCSSA012992\",\"JCSSA013004\",\"JCSSA013016\",\"JCSSA013021\",\"JCSSA013033\",\"JCSSA013045\",\"JCSSA013050\",\"JCSSA013062\",\"JCSSA013074\",\"JCSSA013086\",\"JCSSA013091\",\"JCSSA013103\",\"JCSSA013115\",\"JCSSA013120\",\"JCSSA013132\",\"JCSSA013144\",\"JCSSA013156\",\"JCSSA013161\",\"JCSSA013173\",\"JCSSA013185\",\"JCSSA013190\",\"JCSSA013202\",\"JCSSA013214\",\"JCSSA013226\",\"JCSSA013231\",\"JCSSA013243\",\"JCSSA013255\",\"JCSSA013260\",\"JCSSA013272\",\"JCSSA013284\",\"JCSSA013296\",\"JCSSA013301\",\"JCSSA013313\",\"JCSSA013325\",\"JCSSA013330\",\"JCSSA013342\",\"JCSSA013354\",\"JCSSA013366\",\"JCSSA013371\",\"JCSSA013383\",\"JCSSA013395\",\"JCSSA013400\",\"JCSSA013412\",\"JCSSA013424\",\"JCSSA013436\",\"JCSSA013441\",\"JCSSA013453\",\"JCSSA013465\",\"JCSSA013470\",\"JCSSA013482\",\"JCSSA013494\",\"JCSSA013506\",\"JCSSA013511\",\"JCSSA013523\",\"JCSSA013535\",\"JCSSA013540\",\"JCSSA013552\",\"JCSSA013564\",\"JCSSA013576\",\"JCSSA013581\",\"JCSSA013593\",\"JCSSA013605\",\"JCSSA013610\",\"JCSSA013622\",\"JCSSA013634\",\"JCSSA013646\",\"JCSSA013651\",\"JCSSA013663\",\"JCSSA013675\",\"JCSSA013680\",\"JCSSA013692\",\"JCSSA013704\",\"JCSSA013716\",\"JCSSA013721\",\"JCSSA013733\",\"JCSSA013745\",\"JCSSA013750\",\"JCSSA013762\",\"JCSSA013774\",\"JCSSA013786\",\"JCSSA013791\",\"JCSSA013803\",\"JCSSA013815\",\"JCSSA013820\",\"JCSSA013832\",\"JCSSA013856\");\n} //fin de if($IdEstado == \"14\")\n\n//Condicion de estado-clues\nif($IdEstado == \"15\"){\n\t$Clues = array(\"MCSSA000014\",\"MCSSA000026\",\"MCSSA000031\",\"MCSSA000043\",\"MCSSA000055\",\"MCSSA000060\",\"MCSSA000072\",\"MCSSA000084\",\"MCSSA000096\",\"MCSSA000101\",\"MCSSA000113\",\"MCSSA000125\",\"MCSSA000130\",\"MCSSA000142\",\"MCSSA000154\",\"MCSSA000166\",\"MCSSA000171\",\"MCSSA000183\",\"MCSSA000195\",\"MCSSA000200\",\"MCSSA000212\",\"MCSSA000224\",\"MCSSA000236\",\"MCSSA000241\",\"MCSSA000253\",\"MCSSA000265\",\"MCSSA000270\",\"MCSSA000282\",\"MCSSA000294\",\"MCSSA000306\",\"MCSSA000311\",\"MCSSA000323\",\"MCSSA000335\",\"MCSSA000340\",\"MCSSA000352\",\"MCSSA000376\",\"MCSSA000381\",\"MCSSA000393\",\"MCSSA000405\",\"MCSSA000410\",\"MCSSA000422\",\"MCSSA000434\",\"MCSSA000446\",\"MCSSA000463\",\"MCSSA000475\",\"MCSSA000480\",\"MCSSA000492\",\"MCSSA000516\",\"MCSSA000521\",\"MCSSA000533\",\"MCSSA000545\",\"MCSSA000550\",\"MCSSA000562\",\"MCSSA000574\",\"MCSSA000586\",\"MCSSA000591\",\"MCSSA000603\",\"MCSSA000615\",\"MCSSA000632\",\"MCSSA000644\",\"MCSSA000656\",\"MCSSA000661\",\"MCSSA000673\",\"MCSSA000685\",\"MCSSA000702\",\"MCSSA000726\",\"MCSSA000731\",\"MCSSA000755\",\"MCSSA000760\",\"MCSSA000772\",\"MCSSA000784\",\"MCSSA000796\",\"MCSSA000801\",\"MCSSA000813\",\"MCSSA000825\",\"MCSSA000830\",\"MCSSA000842\",\"MCSSA000854\",\"MCSSA000866\",\"MCSSA000871\",\"MCSSA000883\",\"MCSSA000895\",\"MCSSA000900\",\"MCSSA000912\",\"MCSSA000924\",\"MCSSA000936\",\"MCSSA000941\",\"MCSSA000953\",\"MCSSA000965\",\"MCSSA000970\",\"MCSSA000982\",\"MCSSA000994\",\"MCSSA001011\",\"MCSSA001023\",\"MCSSA001035\",\"MCSSA001040\",\"MCSSA001064\",\"MCSSA001081\",\"MCSSA001093\",\"MCSSA001110\",\"MCSSA001146\",\"MCSSA001151\",\"MCSSA001163\",\"MCSSA001175\",\"MCSSA001180\",\"MCSSA001192\",\"MCSSA001204\",\"MCSSA001216\",\"MCSSA001221\",\"MCSSA001233\",\"MCSSA001245\",\"MCSSA001250\",\"MCSSA001262\",\"MCSSA001274\",\"MCSSA001286\",\"MCSSA001291\",\"MCSSA001303\",\"MCSSA001315\",\"MCSSA001320\",\"MCSSA001332\",\"MCSSA001344\",\"MCSSA001356\",\"MCSSA001361\",\"MCSSA001373\",\"MCSSA001385\",\"MCSSA001390\",\"MCSSA001402\",\"MCSSA001414\",\"MCSSA001426\",\"MCSSA001431\",\"MCSSA001443\",\"MCSSA001455\",\"MCSSA001460\",\"MCSSA001472\",\"MCSSA001484\",\"MCSSA001496\",\"MCSSA001513\",\"MCSSA001525\",\"MCSSA001530\",\"MCSSA001542\",\"MCSSA001554\",\"MCSSA001566\",\"MCSSA001571\",\"MCSSA001583\",\"MCSSA001595\",\"MCSSA001600\",\"MCSSA001612\",\"MCSSA001624\",\"MCSSA001636\",\"MCSSA001665\",\"MCSSA001670\",\"MCSSA001682\",\"MCSSA001694\",\"MCSSA001706\",\"MCSSA001711\",\"MCSSA001723\",\"MCSSA001735\",\"MCSSA001740\",\"MCSSA001752\",\"MCSSA001764\",\"MCSSA001776\",\"MCSSA001781\",\"MCSSA001793\",\"MCSSA001805\",\"MCSSA001810\",\"MCSSA001822\",\"MCSSA001834\",\"MCSSA001846\",\"MCSSA001851\",\"MCSSA001863\",\"MCSSA001875\",\"MCSSA001880\",\"MCSSA001892\",\"MCSSA001904\",\"MCSSA001916\",\"MCSSA001921\",\"MCSSA001933\",\"MCSSA001945\",\"MCSSA001950\",\"MCSSA001962\",\"MCSSA001974\",\"MCSSA001986\",\"MCSSA001991\",\"MCSSA002003\",\"MCSSA002015\",\"MCSSA002020\",\"MCSSA002032\",\"MCSSA002044\",\"MCSSA002056\",\"MCSSA002061\",\"MCSSA002073\",\"MCSSA002085\",\"MCSSA002090\",\"MCSSA002102\",\"MCSSA002114\",\"MCSSA002126\",\"MCSSA002131\",\"MCSSA002143\",\"MCSSA002155\",\"MCSSA002160\",\"MCSSA002172\",\"MCSSA002184\",\"MCSSA002196\",\"MCSSA002213\",\"MCSSA002225\",\"MCSSA002230\",\"MCSSA002242\",\"MCSSA002254\",\"MCSSA002266\",\"MCSSA002271\",\"MCSSA002283\",\"MCSSA002295\",\"MCSSA002300\",\"MCSSA002312\",\"MCSSA002324\",\"MCSSA002336\",\"MCSSA002341\",\"MCSSA002353\",\"MCSSA002365\",\"MCSSA002370\",\"MCSSA002382\",\"MCSSA002394\",\"MCSSA002406\",\"MCSSA002411\",\"MCSSA002423\",\"MCSSA002440\",\"MCSSA002452\",\"MCSSA002464\",\"MCSSA002476\",\"MCSSA002481\",\"MCSSA002493\",\"MCSSA002505\",\"MCSSA002510\",\"MCSSA002522\",\"MCSSA002534\",\"MCSSA002546\",\"MCSSA002551\",\"MCSSA002575\",\"MCSSA002580\",\"MCSSA002592\",\"MCSSA002604\",\"MCSSA002616\",\"MCSSA002621\",\"MCSSA002633\",\"MCSSA002645\",\"MCSSA002650\",\"MCSSA002662\",\"MCSSA002674\",\"MCSSA002686\",\"MCSSA002691\",\"MCSSA002703\",\"MCSSA002715\",\"MCSSA002720\",\"MCSSA002732\",\"MCSSA002744\",\"MCSSA002756\",\"MCSSA002761\",\"MCSSA002773\",\"MCSSA002802\",\"MCSSA002814\",\"MCSSA002826\",\"MCSSA002831\",\"MCSSA002843\",\"MCSSA002855\",\"MCSSA002860\",\"MCSSA002872\",\"MCSSA002896\",\"MCSSA002925\",\"MCSSA002930\",\"MCSSA002954\",\"MCSSA002966\",\"MCSSA002971\",\"MCSSA002983\",\"MCSSA003000\",\"MCSSA003024\",\"MCSSA003036\",\"MCSSA003041\",\"MCSSA003053\",\"MCSSA003065\",\"MCSSA003082\",\"MCSSA003094\",\"MCSSA003106\",\"MCSSA003111\",\"MCSSA003123\",\"MCSSA003135\",\"MCSSA003152\",\"MCSSA003176\",\"MCSSA003181\",\"MCSSA003193\",\"MCSSA003205\",\"MCSSA003210\",\"MCSSA003222\",\"MCSSA003234\",\"MCSSA003246\",\"MCSSA003251\",\"MCSSA003263\",\"MCSSA003275\",\"MCSSA003280\",\"MCSSA003292\",\"MCSSA003304\",\"MCSSA003316\",\"MCSSA003321\",\"MCSSA003333\",\"MCSSA003345\",\"MCSSA003350\",\"MCSSA003386\",\"MCSSA003391\",\"MCSSA003403\",\"MCSSA003415\",\"MCSSA003420\",\"MCSSA003444\",\"MCSSA003456\",\"MCSSA003461\",\"MCSSA003485\",\"MCSSA003490\",\"MCSSA003531\",\"MCSSA003543\",\"MCSSA003555\",\"MCSSA003560\",\"MCSSA003584\",\"MCSSA003596\",\"MCSSA003601\",\"MCSSA003613\",\"MCSSA003625\",\"MCSSA003630\",\"MCSSA003654\",\"MCSSA003666\",\"MCSSA003671\",\"MCSSA003683\",\"MCSSA003695\",\"MCSSA003700\",\"MCSSA003724\",\"MCSSA003736\",\"MCSSA003741\",\"MCSSA003753\",\"MCSSA003765\",\"MCSSA003770\",\"MCSSA003782\",\"MCSSA003794\",\"MCSSA003806\",\"MCSSA003823\",\"MCSSA003840\",\"MCSSA003852\",\"MCSSA003864\",\"MCSSA003876\",\"MCSSA003881\",\"MCSSA003893\",\"MCSSA003905\",\"MCSSA003922\",\"MCSSA003934\",\"MCSSA003946\",\"MCSSA003951\",\"MCSSA003963\",\"MCSSA003975\",\"MCSSA003992\",\"MCSSA004016\",\"MCSSA004021\",\"MCSSA004033\",\"MCSSA004045\",\"MCSSA004050\",\"MCSSA004062\",\"MCSSA004074\",\"MCSSA004086\",\"MCSSA004091\",\"MCSSA004103\",\"MCSSA004115\",\"MCSSA004120\",\"MCSSA004132\",\"MCSSA004144\",\"MCSSA004156\",\"MCSSA004161\",\"MCSSA004173\",\"MCSSA004185\",\"MCSSA004190\",\"MCSSA004202\",\"MCSSA004214\",\"MCSSA004226\",\"MCSSA004231\",\"MCSSA004243\",\"MCSSA004255\",\"MCSSA004260\",\"MCSSA004272\",\"MCSSA004284\",\"MCSSA004296\",\"MCSSA004301\",\"MCSSA004313\",\"MCSSA004325\",\"MCSSA004330\",\"MCSSA004342\",\"MCSSA004354\",\"MCSSA004366\",\"MCSSA004371\",\"MCSSA004383\",\"MCSSA004395\",\"MCSSA004400\",\"MCSSA004412\",\"MCSSA004441\",\"MCSSA004465\",\"MCSSA004470\",\"MCSSA004482\",\"MCSSA004494\",\"MCSSA004506\",\"MCSSA004511\",\"MCSSA004523\",\"MCSSA004535\",\"MCSSA004552\",\"MCSSA004564\",\"MCSSA004576\",\"MCSSA004581\",\"MCSSA004593\",\"MCSSA004605\",\"MCSSA004610\",\"MCSSA004622\",\"MCSSA004634\",\"MCSSA004646\",\"MCSSA004651\",\"MCSSA004663\",\"MCSSA004675\",\"MCSSA004680\",\"MCSSA004692\",\"MCSSA004704\",\"MCSSA004716\",\"MCSSA004721\",\"MCSSA004733\",\"MCSSA004745\",\"MCSSA004750\",\"MCSSA004762\",\"MCSSA004774\",\"MCSSA004786\",\"MCSSA004791\",\"MCSSA004803\",\"MCSSA004815\",\"MCSSA004820\",\"MCSSA004832\",\"MCSSA004856\",\"MCSSA004861\",\"MCSSA004873\",\"MCSSA004885\",\"MCSSA004890\",\"MCSSA004902\",\"MCSSA004914\",\"MCSSA004926\",\"MCSSA004931\",\"MCSSA004943\",\"MCSSA004955\",\"MCSSA004960\",\"MCSSA004972\",\"MCSSA004984\",\"MCSSA004996\",\"MCSSA005001\",\"MCSSA005013\",\"MCSSA005025\",\"MCSSA005030\",\"MCSSA005042\",\"MCSSA005054\",\"MCSSA005066\",\"MCSSA005071\",\"MCSSA005083\",\"MCSSA005095\",\"MCSSA005100\",\"MCSSA005112\",\"MCSSA005124\",\"MCSSA005165\",\"MCSSA005170\",\"MCSSA005206\",\"MCSSA005223\",\"MCSSA005235\",\"MCSSA005276\",\"MCSSA005281\",\"MCSSA005293\",\"MCSSA005305\",\"MCSSA005322\",\"MCSSA005346\",\"MCSSA005351\",\"MCSSA005363\",\"MCSSA005375\",\"MCSSA005380\",\"MCSSA005392\",\"MCSSA005416\",\"MCSSA005421\",\"MCSSA005433\",\"MCSSA005445\",\"MCSSA005450\",\"MCSSA005486\",\"MCSSA005491\",\"MCSSA005503\",\"MCSSA005515\",\"MCSSA005520\",\"MCSSA005532\",\"MCSSA005544\",\"MCSSA005556\",\"MCSSA005561\",\"MCSSA005573\",\"MCSSA005585\",\"MCSSA005602\",\"MCSSA005614\",\"MCSSA005626\",\"MCSSA005631\",\"MCSSA005643\",\"MCSSA005655\",\"MCSSA005672\",\"MCSSA005701\",\"MCSSA005725\",\"MCSSA005730\",\"MCSSA005754\",\"MCSSA005766\",\"MCSSA005771\",\"MCSSA005783\",\"MCSSA005812\",\"MCSSA005824\",\"MCSSA005836\",\"MCSSA005853\",\"MCSSA005865\",\"MCSSA005870\",\"MCSSA005882\",\"MCSSA005894\",\"MCSSA005906\",\"MCSSA005911\",\"MCSSA005923\",\"MCSSA005935\",\"MCSSA005940\",\"MCSSA005952\",\"MCSSA005964\",\"MCSSA005976\",\"MCSSA005981\",\"MCSSA005993\",\"MCSSA006005\",\"MCSSA006010\",\"MCSSA006022\",\"MCSSA006034\",\"MCSSA006046\",\"MCSSA006051\",\"MCSSA006075\",\"MCSSA006080\",\"MCSSA006092\",\"MCSSA006104\",\"MCSSA006116\",\"MCSSA006121\",\"MCSSA006133\",\"MCSSA006145\",\"MCSSA006150\",\"MCSSA006162\",\"MCSSA006174\",\"MCSSA006186\",\"MCSSA006191\",\"MCSSA006203\",\"MCSSA006215\",\"MCSSA006220\",\"MCSSA006232\",\"MCSSA006244\",\"MCSSA006256\",\"MCSSA006261\",\"MCSSA006273\",\"MCSSA006285\",\"MCSSA006290\",\"MCSSA006302\",\"MCSSA006314\",\"MCSSA006326\",\"MCSSA006331\",\"MCSSA006343\",\"MCSSA006355\",\"MCSSA006360\",\"MCSSA006372\",\"MCSSA006384\",\"MCSSA006396\",\"MCSSA006401\",\"MCSSA006413\",\"MCSSA006425\",\"MCSSA006430\",\"MCSSA006454\",\"MCSSA006471\",\"MCSSA006483\",\"MCSSA006495\",\"MCSSA006500\",\"MCSSA006512\",\"MCSSA006524\",\"MCSSA006536\",\"MCSSA006541\",\"MCSSA006565\",\"MCSSA006570\",\"MCSSA006582\",\"MCSSA006594\",\"MCSSA006606\",\"MCSSA006611\",\"MCSSA006623\",\"MCSSA006635\",\"MCSSA006640\",\"MCSSA006652\",\"MCSSA006664\",\"MCSSA006676\",\"MCSSA006681\",\"MCSSA006693\",\"MCSSA006705\",\"MCSSA006710\",\"MCSSA006722\",\"MCSSA006734\",\"MCSSA006746\",\"MCSSA006751\",\"MCSSA006763\",\"MCSSA006775\",\"MCSSA006780\",\"MCSSA006792\",\"MCSSA006804\",\"MCSSA006816\",\"MCSSA006821\",\"MCSSA006833\",\"MCSSA006845\",\"MCSSA006850\",\"MCSSA006862\",\"MCSSA006874\",\"MCSSA006886\",\"MCSSA006891\",\"MCSSA006903\",\"MCSSA006915\",\"MCSSA006920\",\"MCSSA006944\",\"MCSSA006956\",\"MCSSA006961\",\"MCSSA006973\",\"MCSSA006985\",\"MCSSA006990\",\"MCSSA007002\",\"MCSSA007026\",\"MCSSA007031\",\"MCSSA007043\",\"MCSSA007055\",\"MCSSA007060\",\"MCSSA007084\",\"MCSSA007096\",\"MCSSA007101\",\"MCSSA007113\",\"MCSSA007125\",\"MCSSA007130\",\"MCSSA007142\",\"MCSSA007154\",\"MCSSA007166\",\"MCSSA007171\",\"MCSSA007183\",\"MCSSA007195\",\"MCSSA007200\",\"MCSSA007212\",\"MCSSA007224\",\"MCSSA007236\",\"MCSSA007241\",\"MCSSA007253\",\"MCSSA007265\",\"MCSSA007282\",\"MCSSA007294\",\"MCSSA007306\",\"MCSSA007311\",\"MCSSA007323\",\"MCSSA007335\",\"MCSSA007352\",\"MCSSA007364\",\"MCSSA007376\",\"MCSSA007381\",\"MCSSA007393\",\"MCSSA007405\",\"MCSSA007410\",\"MCSSA007422\",\"MCSSA007434\",\"MCSSA007446\",\"MCSSA007463\",\"MCSSA007475\",\"MCSSA007480\",\"MCSSA007492\",\"MCSSA007504\",\"MCSSA007533\",\"MCSSA007545\",\"MCSSA007550\",\"MCSSA007562\",\"MCSSA007574\",\"MCSSA007586\",\"MCSSA007591\",\"MCSSA007603\",\"MCSSA007615\",\"MCSSA007620\",\"MCSSA007661\",\"MCSSA007673\",\"MCSSA007685\",\"MCSSA007690\",\"MCSSA007702\",\"MCSSA007714\",\"MCSSA007726\",\"MCSSA007731\",\"MCSSA007755\",\"MCSSA007760\",\"MCSSA007772\",\"MCSSA007784\",\"MCSSA007796\",\"MCSSA007801\",\"MCSSA007813\",\"MCSSA007825\",\"MCSSA007830\",\"MCSSA007842\",\"MCSSA007854\",\"MCSSA007866\",\"MCSSA007871\",\"MCSSA007900\",\"MCSSA007912\",\"MCSSA007924\",\"MCSSA007936\",\"MCSSA007941\",\"MCSSA007953\",\"MCSSA007965\",\"MCSSA007970\",\"MCSSA007982\",\"MCSSA007994\",\"MCSSA008006\",\"MCSSA008011\",\"MCSSA008023\",\"MCSSA008035\",\"MCSSA008040\",\"MCSSA008052\",\"MCSSA008064\",\"MCSSA008076\",\"MCSSA008081\",\"MCSSA008093\",\"MCSSA008105\",\"MCSSA008110\",\"MCSSA008122\",\"MCSSA008146\",\"MCSSA008163\",\"MCSSA008175\",\"MCSSA008180\",\"MCSSA008192\",\"MCSSA008204\",\"MCSSA008216\",\"MCSSA008221\",\"MCSSA008233\",\"MCSSA008245\",\"MCSSA008250\",\"MCSSA008274\",\"MCSSA008286\",\"MCSSA008291\",\"MCSSA008303\",\"MCSSA008315\",\"MCSSA008320\",\"MCSSA008332\",\"MCSSA008344\",\"MCSSA008356\",\"MCSSA008361\",\"MCSSA008385\",\"MCSSA008390\",\"MCSSA008414\",\"MCSSA008426\",\"MCSSA008431\",\"MCSSA008443\",\"MCSSA008455\",\"MCSSA008460\",\"MCSSA008472\",\"MCSSA008496\",\"MCSSA008501\",\"MCSSA008513\",\"MCSSA008525\",\"MCSSA008530\",\"MCSSA008542\",\"MCSSA008554\",\"MCSSA008566\",\"MCSSA008583\",\"MCSSA008595\",\"MCSSA008600\",\"MCSSA008624\",\"MCSSA008653\",\"MCSSA008670\",\"MCSSA008694\",\"MCSSA008706\",\"MCSSA008723\",\"MCSSA008735\",\"MCSSA008740\",\"MCSSA008752\",\"MCSSA008764\",\"MCSSA008776\",\"MCSSA008781\",\"MCSSA008793\",\"MCSSA008805\",\"MCSSA008810\",\"MCSSA008822\",\"MCSSA008834\",\"MCSSA008846\",\"MCSSA008851\",\"MCSSA008863\",\"MCSSA008875\",\"MCSSA008880\",\"MCSSA008892\",\"MCSSA008904\",\"MCSSA008916\",\"MCSSA008921\",\"MCSSA008945\",\"MCSSA008950\",\"MCSSA008962\",\"MCSSA008974\",\"MCSSA008986\",\"MCSSA008991\",\"MCSSA009003\",\"MCSSA009015\",\"MCSSA009020\",\"MCSSA009032\",\"MCSSA009044\",\"MCSSA009056\",\"MCSSA009073\",\"MCSSA009085\",\"MCSSA009090\",\"MCSSA009114\",\"MCSSA009126\",\"MCSSA009131\",\"MCSSA009143\",\"MCSSA009155\",\"MCSSA009160\",\"MCSSA009172\",\"MCSSA009184\",\"MCSSA009196\",\"MCSSA009213\",\"MCSSA009230\",\"MCSSA009242\",\"MCSSA009254\",\"MCSSA009266\",\"MCSSA009271\",\"MCSSA009283\",\"MCSSA009295\",\"MCSSA009300\",\"MCSSA009312\",\"MCSSA009324\",\"MCSSA009336\",\"MCSSA009341\",\"MCSSA009353\",\"MCSSA009365\",\"MCSSA009370\",\"MCSSA009382\",\"MCSSA009394\",\"MCSSA009406\",\"MCSSA009411\",\"MCSSA009423\",\"MCSSA009435\",\"MCSSA009440\",\"MCSSA009452\",\"MCSSA009464\",\"MCSSA009476\",\"MCSSA009481\",\"MCSSA009493\",\"MCSSA009505\",\"MCSSA009510\",\"MCSSA009522\",\"MCSSA009534\",\"MCSSA009551\",\"MCSSA009563\",\"MCSSA009575\",\"MCSSA009592\",\"MCSSA009604\",\"MCSSA009616\",\"MCSSA009621\",\"MCSSA009645\",\"MCSSA009650\",\"MCSSA009662\",\"MCSSA009674\",\"MCSSA009686\",\"MCSSA009691\",\"MCSSA009703\",\"MCSSA009720\",\"MCSSA009732\",\"MCSSA009756\",\"MCSSA009761\",\"MCSSA009773\",\"MCSSA009814\",\"MCSSA009826\",\"MCSSA009831\",\"MCSSA009843\",\"MCSSA009855\",\"MCSSA009860\",\"MCSSA009872\",\"MCSSA009884\",\"MCSSA009901\",\"MCSSA009925\",\"MCSSA009930\",\"MCSSA009942\",\"MCSSA009954\",\"MCSSA009966\",\"MCSSA009983\",\"MCSSA009995\",\"MCSSA010000\",\"MCSSA010012\",\"MCSSA010024\",\"MCSSA010036\",\"MCSSA010041\",\"MCSSA010053\",\"MCSSA010065\",\"MCSSA010082\",\"MCSSA010111\",\"MCSSA010123\",\"MCSSA010140\",\"MCSSA010152\",\"MCSSA010164\",\"MCSSA010176\",\"MCSSA010181\",\"MCSSA010210\",\"MCSSA010222\",\"MCSSA010234\",\"MCSSA010246\",\"MCSSA010251\",\"MCSSA010263\",\"MCSSA010275\",\"MCSSA010280\",\"MCSSA010292\",\"MCSSA010304\",\"MCSSA010316\",\"MCSSA010321\",\"MCSSA010333\",\"MCSSA010345\",\"MCSSA015233\",\"MCSSA015245\",\"MCSSA015250\",\"MCSSA015262\",\"MCSSA015286\",\"MCSSA015292\",\"MCSSA015304\",\"MCSSA015316\",\"MCSSA015321\",\"MCSSA015333\",\"MCSSA015345\",\"MCSSA015350\",\"MCSSA015362\",\"MCSSA015374\",\"MCSSA015386\",\"MCSSA015391\",\"MCSSA015403\",\"MCSSA015415\",\"MCSSA015420\",\"MCSSA015432\",\"MCSSA015444\",\"MCSSA015456\",\"MCSSA015461\",\"MCSSA015473\",\"MCSSA015485\",\"MCSSA015490\",\"MCSSA015514\",\"MCSSA015526\",\"MCSSA015531\",\"MCSSA015543\",\"MCSSA015555\",\"MCSSA015560\",\"MCSSA015572\",\"MCSSA015584\",\"MCSSA015596\",\"MCSSA015601\",\"MCSSA015613\",\"MCSSA015625\",\"MCSSA015630\",\"MCSSA015642\",\"MCSSA015654\",\"MCSSA015666\",\"MCSSA015671\",\"MCSSA015683\",\"MCSSA015695\",\"MCSSA015700\",\"MCSSA015712\",\"MCSSA015724\",\"MCSSA015736\",\"MCSSA015741\",\"MCSSA015753\",\"MCSSA015765\",\"MCSSA015770\",\"MCSSA015782\",\"MCSSA015794\",\"MCSSA015806\",\"MCSSA015811\",\"MCSSA015823\",\"MCSSA015835\",\"MCSSA015840\",\"MCSSA015852\",\"MCSSA015864\",\"MCSSA015876\",\"MCSSA015904\",\"MCSSA015916\",\"MCSSA015921\",\"MCSSA015933\",\"MCSSA015945\",\"MCSSA015950\",\"MCSSA015962\",\"MCSSA015974\",\"MCSSA015986\",\"MCSSA015991\",\"MCSSA016003\",\"MCSSA016015\",\"MCSSA016020\",\"MCSSA016032\",\"MCSSA016044\",\"MCSSA016061\",\"MCSSA016085\",\"MCSSA016102\",\"MCSSA016126\",\"MCSSA016131\",\"MCSSA016143\",\"MCSSA016155\",\"MCSSA016160\",\"MCSSA016184\",\"MCSSA016213\",\"MCSSA016242\",\"MCSSA016254\",\"MCSSA016283\",\"MCSSA016295\",\"MCSSA016300\",\"MCSSA016312\",\"MCSSA016382\",\"MCSSA016406\",\"MCSSA016411\",\"MCSSA016440\",\"MCSSA016452\",\"MCSSA016464\",\"MCSSA016476\",\"MCSSA016510\",\"MCSSA016534\",\"MCSSA016563\",\"MCSSA016575\",\"MCSSA016592\",\"MCSSA016604\",\"MCSSA016616\",\"MCSSA016621\",\"MCSSA016633\",\"MCSSA016645\",\"MCSSA016650\",\"MCSSA016662\",\"MCSSA016674\",\"MCSSA016691\",\"MCSSA016703\",\"MCSSA016744\",\"MCSSA016756\",\"MCSSA016761\",\"MCSSA016773\",\"MCSSA016790\",\"MCSSA016802\",\"MCSSA016814\",\"MCSSA016826\",\"MCSSA016831\",\"MCSSA016843\",\"MCSSA016855\",\"MCSSA016860\",\"MCSSA016872\",\"MCSSA016884\",\"MCSSA016896\",\"MCSSA016901\",\"MCSSA016913\",\"MCSSA016925\",\"MCSSA016930\",\"MCSSA016942\",\"MCSSA016954\",\"MCSSA016966\",\"MCSSA016971\",\"MCSSA016983\",\"MCSSA016995\",\"MCSSA017000\",\"MCSSA017012\",\"MCSSA017024\",\"MCSSA017036\",\"MCSSA017041\",\"MCSSA017053\",\"MCSSA017065\",\"MCSSA017070\",\"MCSSA017082\",\"MCSSA017094\",\"MCSSA017106\",\"MCSSA017152\",\"MCSSA017181\",\"MCSSA017193\",\"MCSSA017205\",\"MCSSA017222\",\"MCSSA017234\",\"MCSSA017246\",\"MCSSA017263\",\"MCSSA017275\",\"MCSSA017280\",\"MCSSA017292\",\"MCSSA017304\",\"MCSSA017316\",\"MCSSA017321\",\"MCSSA017333\",\"MCSSA017345\",\"MCSSA017350\",\"MCSSA017362\",\"MCSSA017374\",\"MCSSA017386\",\"MCSSA017391\",\"MCSSA017403\",\"MCSSA017415\",\"MCSSA017420\",\"MCSSA017432\",\"MCSSA017444\",\"MCSSA017456\",\"MCSSA017461\",\"MCSSA017473\",\"MCSSA017485\",\"MCSSA017490\",\"MCSSA017502\",\"MCSSA017526\",\"MCSSA017531\",\"MCSSA017543\",\"MCSSA017555\",\"MCSSA017560\",\"MCSSA017572\",\"MCSSA017584\",\"MCSSA017596\",\"MCSSA017601\",\"MCSSA017613\",\"MCSSA017625\",\"MCSSA017630\",\"MCSSA017642\",\"MCSSA017654\",\"MCSSA017666\",\"MCSSA017671\",\"MCSSA017683\",\"MCSSA017695\",\"MCSSA017700\",\"MCSSA017712\",\"MCSSA017724\",\"MCSSA017736\",\"MCSSA017741\",\"MCSSA017753\",\"MCSSA017765\",\"MCSSA017770\",\"MCSSA017782\",\"MCSSA017794\",\"MCSSA017806\",\"MCSSA017811\",\"MCSSA017823\",\"MCSSA017835\",\"MCSSA017840\",\"MCSSA017852\",\"MCSSA017864\",\"MCSSA017876\",\"MCSSA017881\",\"MCSSA017893\",\"MCSSA017905\",\"MCSSA017910\",\"MCSSA017922\",\"MCSSA017934\",\"MCSSA017951\",\"MCSSA017963\",\"MCSSA017975\",\"MCSSA017980\",\"MCSSA017992\",\"MCSSA018004\",\"MCSSA018016\",\"MCSSA018021\",\"MCSSA018033\",\"MCSSA018045\",\"MCSSA018050\",\"MCSSA018062\",\"MCSSA018074\",\"MCSSA018086\",\"MCSSA018091\",\"MCSSA018103\",\"MCSSA018115\",\"MCSSA018120\",\"MCSSA018132\",\"MCSSA018144\",\"MCSSA018156\",\"MCSSA018161\",\"MCSSA018173\",\"MCSSA018185\",\"MCSSA018190\",\"MCSSA018202\",\"MCSSA018214\",\"MCSSA018226\",\"MCSSA018231\",\"MCSSA018243\",\"MCSSA018255\",\"MCSSA018260\",\"MCSSA018272\",\"MCSSA018284\",\"MCSSA018296\",\"MCSSA018301\",\"MCSSA018313\",\"MCSSA018325\",\"MCSSA018330\",\"MCSSA018342\",\"MCSSA018354\",\"MCSSA018366\",\"MCSSA018371\",\"MCSSA018383\",\"MCSSA018395\",\"MCSSA018400\",\"MCSSA018412\",\"MCSSA018424\",\"MCSSA018436\",\"MCSSA018441\",\"MCSSA018453\",\"MCSSA018470\",\"MCSSA018482\",\"MCSSA018494\",\"MCSSA018506\",\"MCSSA018511\",\"MCSSA018523\",\"MCSSA018535\",\"MCSSA018540\",\"MCSSA018552\",\"MCSSA018564\",\"MCSSA018576\",\"MCSSA018581\",\"MCSSA018593\",\"MCSSA018605\",\"MCSSA018610\",\"MCSSA018622\",\"MCSSA018634\",\"MCSSA018646\",\"MCSSA018651\",\"MCSSA018663\",\"MCSSA018675\",\"MCSSA018680\",\"MCSSA018692\",\"MCSSA018704\",\"MCSSA018716\",\"MCSSA018721\",\"MCSSA018733\",\"MCSSA018745\",\"MCSSA018750\",\"MCSSA018762\",\"MCSSA018774\",\"MCSSA018786\",\"MCSSA018791\",\"MCSSA018803\",\"MCSSA018815\",\"MCSSA018820\",\"MCSSA018832\",\"MCSSA018844\",\"MCSSA018856\",\"MCSSA018861\",\"MCSSA018873\",\"MCSSA018885\",\"MCSSA018890\",\"MCSSA018902\",\"MCSSA018914\",\"MCSSA018926\",\"MCSSA018931\",\"MCSSA018943\");\n} //fin de if($IdEstado == \"15\")\n\n//Condicion de estado-clues\nif($IdEstado == \"16\"){\n\t$Clues = array(\"MNSSA000013\",\"MNSSA000030\",\"MNSSA000054\",\"MNSSA000066\",\"MNSSA000083\",\"MNSSA000095\",\"MNSSA000100\",\"MNSSA000112\",\"MNSSA000124\",\"MNSSA000136\",\"MNSSA000153\",\"MNSSA000165\",\"MNSSA000170\",\"MNSSA000194\",\"MNSSA000206\",\"MNSSA000211\",\"MNSSA000223\",\"MNSSA000235\",\"MNSSA000240\",\"MNSSA000252\",\"MNSSA000264\",\"MNSSA000276\",\"MNSSA000281\",\"MNSSA000293\",\"MNSSA000305\",\"MNSSA000310\",\"MNSSA000322\",\"MNSSA000334\",\"MNSSA000346\",\"MNSSA000351\",\"MNSSA000363\",\"MNSSA000375\",\"MNSSA000404\",\"MNSSA000416\",\"MNSSA000421\",\"MNSSA000433\",\"MNSSA000445\",\"MNSSA000450\",\"MNSSA000462\",\"MNSSA000474\",\"MNSSA000486\",\"MNSSA000491\",\"MNSSA000503\",\"MNSSA000515\",\"MNSSA000532\",\"MNSSA000544\",\"MNSSA000561\",\"MNSSA000573\",\"MNSSA000590\",\"MNSSA000602\",\"MNSSA000614\",\"MNSSA000626\",\"MNSSA000631\",\"MNSSA000643\",\"MNSSA000655\",\"MNSSA000660\",\"MNSSA000672\",\"MNSSA000684\",\"MNSSA000696\",\"MNSSA000701\",\"MNSSA000713\",\"MNSSA000725\",\"MNSSA000730\",\"MNSSA000742\",\"MNSSA000754\",\"MNSSA000766\",\"MNSSA000771\",\"MNSSA000783\",\"MNSSA000800\",\"MNSSA000812\",\"MNSSA000824\",\"MNSSA000836\",\"MNSSA000841\",\"MNSSA000853\",\"MNSSA000865\",\"MNSSA000870\",\"MNSSA000882\",\"MNSSA000894\",\"MNSSA000906\",\"MNSSA000911\",\"MNSSA000923\",\"MNSSA000935\",\"MNSSA000940\",\"MNSSA000952\",\"MNSSA000964\",\"MNSSA000981\",\"MNSSA000993\",\"MNSSA001005\",\"MNSSA001034\",\"MNSSA001046\",\"MNSSA001051\",\"MNSSA001063\",\"MNSSA001080\",\"MNSSA001092\",\"MNSSA001145\",\"MNSSA001150\",\"MNSSA001162\",\"MNSSA001174\",\"MNSSA001186\",\"MNSSA001191\",\"MNSSA001203\",\"MNSSA001220\",\"MNSSA001232\",\"MNSSA001244\",\"MNSSA001256\",\"MNSSA001261\",\"MNSSA001302\",\"MNSSA001314\",\"MNSSA001326\",\"MNSSA001331\",\"MNSSA001343\",\"MNSSA001355\",\"MNSSA001360\",\"MNSSA001372\",\"MNSSA001384\",\"MNSSA001396\",\"MNSSA001401\",\"MNSSA001413\",\"MNSSA001425\",\"MNSSA001430\",\"MNSSA001442\",\"MNSSA001466\",\"MNSSA001471\",\"MNSSA001495\",\"MNSSA001512\",\"MNSSA001524\",\"MNSSA001536\",\"MNSSA001541\",\"MNSSA001553\",\"MNSSA001565\",\"MNSSA001570\",\"MNSSA001582\",\"MNSSA001594\",\"MNSSA001606\",\"MNSSA001652\",\"MNSSA001664\",\"MNSSA001676\",\"MNSSA001681\",\"MNSSA001693\",\"MNSSA001710\",\"MNSSA001722\",\"MNSSA001751\",\"MNSSA001763\",\"MNSSA001775\",\"MNSSA001780\",\"MNSSA001792\",\"MNSSA001804\",\"MNSSA001816\",\"MNSSA001821\",\"MNSSA001833\",\"MNSSA001845\",\"MNSSA001850\",\"MNSSA001862\",\"MNSSA001874\",\"MNSSA001886\",\"MNSSA001891\",\"MNSSA001903\",\"MNSSA001956\",\"MNSSA001961\",\"MNSSA001973\",\"MNSSA001985\",\"MNSSA001990\",\"MNSSA002002\",\"MNSSA002014\",\"MNSSA002026\",\"MNSSA002031\",\"MNSSA002043\",\"MNSSA002055\",\"MNSSA002060\",\"MNSSA002072\",\"MNSSA002096\",\"MNSSA002101\",\"MNSSA002125\",\"MNSSA002130\",\"MNSSA002142\",\"MNSSA002171\",\"MNSSA002183\",\"MNSSA002195\",\"MNSSA002200\",\"MNSSA002212\",\"MNSSA002224\",\"MNSSA002236\",\"MNSSA002241\",\"MNSSA002265\",\"MNSSA002270\",\"MNSSA002294\",\"MNSSA002306\",\"MNSSA002311\",\"MNSSA002323\",\"MNSSA002340\",\"MNSSA002352\",\"MNSSA002376\",\"MNSSA002381\",\"MNSSA002405\",\"MNSSA002410\",\"MNSSA002422\",\"MNSSA002434\",\"MNSSA002446\",\"MNSSA002451\",\"MNSSA002475\",\"MNSSA002480\",\"MNSSA002492\",\"MNSSA002504\",\"MNSSA002521\",\"MNSSA002533\",\"MNSSA002545\",\"MNSSA002550\",\"MNSSA002562\",\"MNSSA002586\",\"MNSSA002615\",\"MNSSA002620\",\"MNSSA002632\",\"MNSSA002656\",\"MNSSA002661\",\"MNSSA002673\",\"MNSSA002690\",\"MNSSA002702\",\"MNSSA002726\",\"MNSSA002731\",\"MNSSA002743\",\"MNSSA002755\",\"MNSSA002760\",\"MNSSA002772\",\"MNSSA002784\",\"MNSSA002796\",\"MNSSA002801\",\"MNSSA002813\",\"MNSSA002825\",\"MNSSA002842\",\"MNSSA002854\",\"MNSSA002866\",\"MNSSA002871\",\"MNSSA002883\",\"MNSSA002900\",\"MNSSA002924\",\"MNSSA002936\",\"MNSSA002953\",\"MNSSA002965\",\"MNSSA002982\",\"MNSSA002994\",\"MNSSA003006\",\"MNSSA003011\",\"MNSSA003023\",\"MNSSA003052\",\"MNSSA003081\",\"MNSSA003093\",\"MNSSA003105\",\"MNSSA003110\",\"MNSSA003122\",\"MNSSA003146\",\"MNSSA003151\",\"MNSSA003175\",\"MNSSA003180\",\"MNSSA003204\",\"MNSSA003216\",\"MNSSA003221\",\"MNSSA003233\",\"MNSSA003245\",\"MNSSA003250\",\"MNSSA003262\",\"MNSSA003274\",\"MNSSA003291\",\"MNSSA003303\",\"MNSSA003315\",\"MNSSA003320\",\"MNSSA003344\",\"MNSSA003356\",\"MNSSA003361\",\"MNSSA003385\",\"MNSSA003390\",\"MNSSA003402\",\"MNSSA003414\",\"MNSSA003431\",\"MNSSA003443\",\"MNSSA003455\",\"MNSSA003460\",\"MNSSA003472\",\"MNSSA003484\",\"MNSSA003496\",\"MNSSA003501\",\"MNSSA003513\",\"MNSSA003525\",\"MNSSA003530\",\"MNSSA003542\",\"MNSSA003554\",\"MNSSA003566\",\"MNSSA003571\",\"MNSSA003583\",\"MNSSA003595\",\"MNSSA003600\",\"MNSSA003612\",\"MNSSA003624\",\"MNSSA003636\",\"MNSSA003653\",\"MNSSA003665\",\"MNSSA003670\",\"MNSSA003682\",\"MNSSA003694\",\"MNSSA003706\",\"MNSSA003711\",\"MNSSA003723\",\"MNSSA003735\",\"MNSSA003764\",\"MNSSA003776\",\"MNSSA003781\",\"MNSSA003793\",\"MNSSA003805\",\"MNSSA003810\",\"MNSSA003822\",\"MNSSA003834\",\"MNSSA003851\",\"MNSSA003875\",\"MNSSA003880\",\"MNSSA003904\",\"MNSSA003916\",\"MNSSA003921\",\"MNSSA003933\",\"MNSSA003945\",\"MNSSA003962\",\"MNSSA003974\",\"MNSSA003986\",\"MNSSA003991\",\"MNSSA004003\",\"MNSSA004020\",\"MNSSA004032\",\"MNSSA004044\",\"MNSSA004085\",\"MNSSA004090\",\"MNSSA004114\",\"MNSSA004126\",\"MNSSA004131\",\"MNSSA004143\",\"MNSSA004155\",\"MNSSA004160\",\"MNSSA004172\",\"MNSSA004184\",\"MNSSA004196\",\"MNSSA004201\",\"MNSSA004213\",\"MNSSA004225\",\"MNSSA004230\",\"MNSSA004242\",\"MNSSA004254\",\"MNSSA004266\",\"MNSSA004271\",\"MNSSA004283\",\"MNSSA004295\",\"MNSSA004300\",\"MNSSA004312\",\"MNSSA004324\",\"MNSSA004336\",\"MNSSA004341\",\"MNSSA004353\",\"MNSSA004365\",\"MNSSA004370\",\"MNSSA004382\",\"MNSSA004394\",\"MNSSA004406\",\"MNSSA004411\",\"MNSSA004423\",\"MNSSA004435\",\"MNSSA004440\",\"MNSSA004452\",\"MNSSA004464\",\"MNSSA004476\",\"MNSSA004481\",\"MNSSA004493\",\"MNSSA004505\",\"MNSSA004510\",\"MNSSA004522\",\"MNSSA004534\",\"MNSSA004546\",\"MNSSA004551\",\"MNSSA004563\",\"MNSSA004580\",\"MNSSA004592\",\"MNSSA004604\",\"MNSSA004616\",\"MNSSA004621\",\"MNSSA004633\",\"MNSSA004645\",\"MNSSA004650\",\"MNSSA004662\",\"MNSSA004674\",\"MNSSA004686\",\"MNSSA004691\",\"MNSSA004703\",\"MNSSA004715\",\"MNSSA004720\",\"MNSSA004732\",\"MNSSA004744\",\"MNSSA004756\",\"MNSSA004761\",\"MNSSA004773\",\"MNSSA004785\",\"MNSSA004790\",\"MNSSA004802\",\"MNSSA004814\",\"MNSSA004826\",\"MNSSA004831\",\"MNSSA004843\",\"MNSSA004855\",\"MNSSA004860\",\"MNSSA004896\",\"MNSSA004901\",\"MNSSA004913\",\"MNSSA004925\",\"MNSSA004930\",\"MNSSA004942\",\"MNSSA004954\",\"MNSSA004966\",\"MNSSA004971\",\"MNSSA004995\",\"MNSSA005000\",\"MNSSA005012\",\"MNSSA005024\",\"MNSSA005036\",\"MNSSA005041\",\"MNSSA005053\",\"MNSSA005065\",\"MNSSA005070\",\"MNSSA005082\",\"MNSSA005094\",\"MNSSA005106\",\"MNSSA005111\",\"MNSSA005123\",\"MNSSA005135\",\"MNSSA005140\",\"MNSSA005152\",\"MNSSA005164\",\"MNSSA005176\",\"MNSSA005193\",\"MNSSA005205\",\"MNSSA005210\",\"MNSSA005222\",\"MNSSA005234\",\"MNSSA005246\",\"MNSSA016043\",\"MNSSA016055\",\"MNSSA016060\",\"MNSSA016072\",\"MNSSA016084\",\"MNSSA016096\",\"MNSSA016102\",\"MNSSA016114\",\"MNSSA016126\",\"MNSSA016131\",\"MNSSA016143\",\"MNSSA016155\",\"MNSSA016160\",\"MNSSA016171\",\"MNSSA016183\",\"MNSSA016195\",\"MNSSA016200\",\"MNSSA016212\",\"MNSSA016224\",\"MNSSA016236\",\"MNSSA016241\",\"MNSSA016253\",\"MNSSA016265\",\"MNSSA016270\",\"MNSSA016282\",\"MNSSA016294\",\"MNSSA016306\",\"MNSSA016311\",\"MNSSA016323\",\"MNSSA016335\",\"MNSSA016340\",\"MNSSA016352\",\"MNSSA016364\",\"MNSSA016393\",\"MNSSA016405\",\"MNSSA016410\",\"MNSSA016422\",\"MNSSA016451\",\"MNSSA016463\",\"MNSSA016475\",\"MNSSA016480\",\"MNSSA016492\",\"MNSSA016504\",\"MNSSA016516\",\"MNSSA016521\",\"MNSSA016533\",\"MNSSA016545\",\"MNSSA016550\",\"MNSSA016562\",\"MNSSA016574\",\"MNSSA016586\",\"MNSSA016591\",\"MNSSA016603\",\"MNSSA016615\",\"MNSSA016620\",\"MNSSA016632\",\"MNSSA016644\",\"MNSSA016656\",\"MNSSA016661\",\"MNSSA016673\",\"MNSSA016685\",\"MNSSA016690\",\"MNSSA016714\",\"MNSSA016726\",\"MNSSA016731\",\"MNSSA016743\",\"MNSSA016755\",\"MNSSA016760\",\"MNSSA016772\",\"MNSSA016784\",\"MNSSA016796\",\"MNSSA016801\",\"MNSSA016813\",\"MNSSA016825\",\"MNSSA016830\",\"MNSSA016842\",\"MNSSA016854\",\"MNSSA016866\",\"MNSSA016871\",\"MNSSA016883\",\"MNSSA016895\",\"MNSSA016900\",\"MNSSA016912\",\"MNSSA016936\",\"MNSSA016941\",\"MNSSA016953\",\"MNSSA016965\",\"MNSSA016970\",\"MNSSA016982\",\"MNSSA016994\",\"MNSSA017006\",\"MNSSA017011\",\"MNSSA017023\",\"MNSSA017035\",\"MNSSA017040\",\"MNSSA017052\",\"MNSSA017064\",\"MNSSA017076\",\"MNSSA017081\",\"MNSSA017093\",\"MNSSA017105\",\"MNSSA017110\",\"MNSSA017122\",\"MNSSA017134\",\"MNSSA017146\",\"MNSSA017151\",\"MNSSA017163\",\"MNSSA017175\",\"MNSSA017180\",\"MNSSA017192\",\"MNSSA017204\",\"MNSSA017216\",\"MNSSA017221\",\"MNSSA017233\",\"MNSSA017245\",\"MNSSA017250\",\"MNSSA017262\",\"MNSSA017274\",\"MNSSA017286\",\"MNSSA017291\",\"MNSSA017303\",\"MNSSA017315\",\"MNSSA017320\",\"MNSSA017332\",\"MNSSA017344\",\"MNSSA017356\",\"MNSSA017361\",\"MNSSA017373\",\"MNSSA017385\");\n} //fin de if($IdEstado == \"16\")\n\n//Condicion de estado-clues\nif($IdEstado == \"17\"){\n\t$Clues = array(\"MSSSA000022\",\"MSSSA000034\",\"MSSSA000046\",\"MSSSA000051\",\"MSSSA000075\",\"MSSSA000080\",\"MSSSA000092\",\"MSSSA000104\",\"MSSSA000116\",\"MSSSA000121\",\"MSSSA000133\",\"MSSSA000145\",\"MSSSA000150\",\"MSSSA000162\",\"MSSSA000174\",\"MSSSA000186\",\"MSSSA000191\",\"MSSSA000203\",\"MSSSA000215\",\"MSSSA000220\",\"MSSSA000232\",\"MSSSA000256\",\"MSSSA000261\",\"MSSSA000273\",\"MSSSA000290\",\"MSSSA000302\",\"MSSSA000314\",\"MSSSA000326\",\"MSSSA000331\",\"MSSSA000343\",\"MSSSA000355\",\"MSSSA000360\",\"MSSSA000372\",\"MSSSA000384\",\"MSSSA000396\",\"MSSSA000401\",\"MSSSA000413\",\"MSSSA000425\",\"MSSSA000430\",\"MSSSA000442\",\"MSSSA000454\",\"MSSSA000466\",\"MSSSA000471\",\"MSSSA000495\",\"MSSSA000500\",\"MSSSA000512\",\"MSSSA000524\",\"MSSSA000536\",\"MSSSA000541\",\"MSSSA000553\",\"MSSSA000565\",\"MSSSA000570\",\"MSSSA000582\",\"MSSSA000606\",\"MSSSA000611\",\"MSSSA000623\",\"MSSSA000640\",\"MSSSA000652\",\"MSSSA000664\",\"MSSSA000676\",\"MSSSA000681\",\"MSSSA000693\",\"MSSSA000710\",\"MSSSA000734\",\"MSSSA000746\",\"MSSSA000751\",\"MSSSA000763\",\"MSSSA000775\",\"MSSSA000780\",\"MSSSA000792\",\"MSSSA000804\",\"MSSSA000816\",\"MSSSA000821\",\"MSSSA000833\",\"MSSSA000845\",\"MSSSA000850\",\"MSSSA000862\",\"MSSSA000874\",\"MSSSA000886\",\"MSSSA000891\",\"MSSSA000903\",\"MSSSA000915\",\"MSSSA000932\",\"MSSSA000944\",\"MSSSA000956\",\"MSSSA000961\",\"MSSSA000973\",\"MSSSA000985\",\"MSSSA000990\",\"MSSSA001002\",\"MSSSA001031\",\"MSSSA001043\",\"MSSSA001060\",\"MSSSA001072\",\"MSSSA001084\",\"MSSSA001096\",\"MSSSA001101\",\"MSSSA001113\",\"MSSSA001125\",\"MSSSA001142\",\"MSSSA001154\",\"MSSSA001166\",\"MSSSA001171\",\"MSSSA001183\",\"MSSSA001200\",\"MSSSA001212\",\"MSSSA001236\",\"MSSSA001241\",\"MSSSA001253\",\"MSSSA001265\",\"MSSSA001270\",\"MSSSA001282\",\"MSSSA001294\",\"MSSSA001306\",\"MSSSA001311\",\"MSSSA001323\",\"MSSSA001340\",\"MSSSA001376\",\"MSSSA001381\",\"MSSSA001393\",\"MSSSA001405\",\"MSSSA001410\",\"MSSSA001422\",\"MSSSA001434\",\"MSSSA001446\",\"MSSSA001451\",\"MSSSA001463\",\"MSSSA001475\",\"MSSSA001480\",\"MSSSA001492\",\"MSSSA001504\",\"MSSSA001516\",\"MSSSA001521\",\"MSSSA001533\",\"MSSSA001545\",\"MSSSA001550\",\"MSSSA001562\",\"MSSSA001574\",\"MSSSA001586\",\"MSSSA001591\",\"MSSSA001603\",\"MSSSA001615\",\"MSSSA001620\",\"MSSSA001632\",\"MSSSA001661\",\"MSSSA001673\",\"MSSSA001685\",\"MSSSA001690\",\"MSSSA001702\",\"MSSSA001714\",\"MSSSA001726\",\"MSSSA001731\",\"MSSSA001743\",\"MSSSA001755\",\"MSSSA001760\",\"MSSSA001772\",\"MSSSA001784\",\"MSSSA001796\",\"MSSSA001801\",\"MSSSA001813\",\"MSSSA001825\",\"MSSSA001830\",\"MSSSA001842\",\"MSSSA001866\",\"MSSSA001871\",\"MSSSA001883\",\"MSSSA001895\",\"MSSSA001900\",\"MSSSA001912\",\"MSSSA001924\",\"MSSSA001941\",\"MSSSA001953\",\"MSSSA001965\",\"MSSSA001994\",\"MSSSA002006\",\"MSSSA002023\",\"MSSSA002035\",\"MSSSA002040\",\"MSSSA002052\",\"MSSSA002064\",\"MSSSA002076\",\"MSSSA002081\",\"MSSSA002093\",\"MSSSA002105\",\"MSSSA002110\",\"MSSSA002122\",\"MSSSA002134\",\"MSSSA002146\",\"MSSSA002151\",\"MSSSA002164\",\"MSSSA002176\",\"MSSSA002193\",\"MSSSA002205\",\"MSSSA002210\",\"MSSSA002222\",\"MSSSA002234\",\"MSSSA002246\",\"MSSSA002251\",\"MSSSA002275\",\"MSSSA002280\",\"MSSSA002292\",\"MSSSA002303\",\"MSSSA002315\",\"MSSSA002320\",\"MSSSA002332\",\"MSSSA002344\",\"MSSSA002356\",\"MSSSA002361\",\"MSSSA002373\",\"MSSSA002385\",\"MSSSA002390\",\"MSSSA002402\",\"MSSSA002414\",\"MSSSA002426\",\"MSSSA002431\",\"MSSSA002443\",\"MSSSA002455\",\"MSSSA002460\",\"MSSSA002472\",\"MSSSA002484\",\"MSSSA002496\",\"MSSSA002513\",\"MSSSA002525\",\"MSSSA002530\",\"MSSSA002542\",\"MSSSA002554\",\"MSSSA002566\",\"MSSSA002571\",\"MSSSA002583\",\"MSSSA002595\",\"MSSSA002612\",\"MSSSA002624\",\"MSSSA002636\",\"MSSSA002641\",\"MSSSA002653\",\"MSSSA002665\",\"MSSSA002670\",\"MSSSA002682\",\"MSSSA002694\",\"MSSSA002706\",\"MSSSA002711\",\"MSSSA002723\",\"MSSSA002735\",\"MSSSA002740\",\"MSSSA002752\",\"MSSSA002764\",\"MSSSA002776\",\"MSSSA002781\",\"MSSSA002793\",\"MSSSA002805\",\"MSSSA002810\",\"MSSSA002822\",\"MSSSA002834\",\"MSSSA002846\",\"MSSSA002851\",\"MSSSA002863\",\"MSSSA002875\",\"MSSSA002880\",\"MSSSA002892\",\"MSSSA002904\",\"MSSSA002916\");\n} //fin de if($IdEstado == \"17\")\n\n//Condicion de estado-clues\nif($IdEstado == \"18\"){\n\t$Clues = array(\"NTSSA000013\",\"NTSSA000025\",\"NTSSA000030\",\"NTSSA000042\",\"NTSSA000054\",\"NTSSA000066\",\"NTSSA000071\",\"NTSSA000083\",\"NTSSA000095\",\"NTSSA000100\",\"NTSSA000112\",\"NTSSA000124\",\"NTSSA000136\",\"NTSSA000141\",\"NTSSA000153\",\"NTSSA000165\",\"NTSSA000170\",\"NTSSA000182\",\"NTSSA000194\",\"NTSSA000206\",\"NTSSA000211\",\"NTSSA000223\",\"NTSSA000235\",\"NTSSA000240\",\"NTSSA000252\",\"NTSSA000264\",\"NTSSA000276\",\"NTSSA000281\",\"NTSSA000293\",\"NTSSA000305\",\"NTSSA000310\",\"NTSSA000322\",\"NTSSA000346\",\"NTSSA000351\",\"NTSSA000363\",\"NTSSA000375\",\"NTSSA000416\",\"NTSSA000474\",\"NTSSA000486\",\"NTSSA000491\",\"NTSSA000503\",\"NTSSA000520\",\"NTSSA000532\",\"NTSSA000544\",\"NTSSA000556\",\"NTSSA000561\",\"NTSSA000573\",\"NTSSA000585\",\"NTSSA000590\",\"NTSSA000602\",\"NTSSA000614\",\"NTSSA000626\",\"NTSSA000631\",\"NTSSA000643\",\"NTSSA000655\",\"NTSSA000660\",\"NTSSA000672\",\"NTSSA000684\",\"NTSSA000696\",\"NTSSA000701\",\"NTSSA000713\",\"NTSSA000725\",\"NTSSA000730\",\"NTSSA000742\",\"NTSSA000754\",\"NTSSA000771\",\"NTSSA000783\",\"NTSSA000795\",\"NTSSA000800\",\"NTSSA000812\",\"NTSSA000824\",\"NTSSA000836\",\"NTSSA000841\",\"NTSSA000853\",\"NTSSA000865\",\"NTSSA000870\",\"NTSSA000882\",\"NTSSA000894\",\"NTSSA000906\",\"NTSSA000911\",\"NTSSA000923\",\"NTSSA000935\",\"NTSSA000952\",\"NTSSA000964\",\"NTSSA000976\",\"NTSSA000981\",\"NTSSA001005\",\"NTSSA001010\",\"NTSSA001022\",\"NTSSA001034\",\"NTSSA001046\",\"NTSSA001051\",\"NTSSA001063\",\"NTSSA001075\",\"NTSSA001080\",\"NTSSA001092\",\"NTSSA001104\",\"NTSSA001116\",\"NTSSA001121\",\"NTSSA001133\",\"NTSSA001145\",\"NTSSA001150\",\"NTSSA001162\",\"NTSSA001174\",\"NTSSA001186\",\"NTSSA001203\",\"NTSSA001215\",\"NTSSA001220\",\"NTSSA001232\",\"NTSSA001244\",\"NTSSA001261\",\"NTSSA001273\",\"NTSSA001285\",\"NTSSA001290\",\"NTSSA001302\",\"NTSSA001314\",\"NTSSA001326\",\"NTSSA001331\",\"NTSSA001343\",\"NTSSA001355\",\"NTSSA001360\",\"NTSSA001372\",\"NTSSA001384\",\"NTSSA001396\",\"NTSSA001401\",\"NTSSA001413\",\"NTSSA001425\",\"NTSSA001430\",\"NTSSA001442\",\"NTSSA001454\",\"NTSSA001471\",\"NTSSA001483\",\"NTSSA001495\",\"NTSSA001500\",\"NTSSA001512\",\"NTSSA001524\",\"NTSSA001536\",\"NTSSA001541\",\"NTSSA001553\",\"NTSSA001565\",\"NTSSA001570\",\"NTSSA001582\",\"NTSSA001594\",\"NTSSA001611\",\"NTSSA001623\",\"NTSSA001635\",\"NTSSA001640\",\"NTSSA001652\",\"NTSSA001664\",\"NTSSA001676\",\"NTSSA001681\",\"NTSSA001693\",\"NTSSA001705\",\"NTSSA001710\",\"NTSSA001722\",\"NTSSA001734\",\"NTSSA001746\",\"NTSSA001751\",\"NTSSA001763\",\"NTSSA001775\",\"NTSSA001780\",\"NTSSA001792\",\"NTSSA001804\",\"NTSSA001816\",\"NTSSA001821\",\"NTSSA001833\",\"NTSSA001845\",\"NTSSA001850\",\"NTSSA001862\",\"NTSSA001874\",\"NTSSA001886\",\"NTSSA001891\",\"NTSSA001903\",\"NTSSA001932\",\"NTSSA001956\",\"NTSSA001985\",\"NTSSA001990\",\"NTSSA002002\",\"NTSSA002014\",\"NTSSA002026\",\"NTSSA002031\",\"NTSSA002043\",\"NTSSA002055\",\"NTSSA002060\",\"NTSSA002072\",\"NTSSA002084\",\"NTSSA002096\",\"NTSSA002101\",\"NTSSA002113\",\"NTSSA002125\",\"NTSSA002130\",\"NTSSA002142\",\"NTSSA002154\",\"NTSSA002166\",\"NTSSA002171\",\"NTSSA002183\",\"NTSSA002195\",\"NTSSA002200\",\"NTSSA002212\",\"NTSSA002224\",\"NTSSA002236\",\"NTSSA002241\",\"NTSSA002253\",\"NTSSA002265\",\"NTSSA002270\",\"NTSSA002294\",\"NTSSA002306\",\"NTSSA015064\",\"NTSSA015076\",\"NTSSA015081\",\"NTSSA015093\",\"NTSSA015105\",\"NTSSA015110\",\"NTSSA015122\",\"NTSSA015134\",\"NTSSA015146\",\"NTSSA015151\",\"NTSSA015163\",\"NTSSA015175\",\"NTSSA015192\",\"NTSSA015204\",\"NTSSA015216\",\"NTSSA015220\",\"NTSSA015232\",\"NTSSA015244\",\"NTSSA015256\",\"NTSSA015261\",\"NTSSA015273\",\"NTSSA015285\",\"NTSSA015302\",\"NTSSA015314\",\"NTSSA015326\",\"NTSSA015331\",\"NTSSA015343\",\"NTSSA015355\",\"NTSSA015360\",\"NTSSA015372\",\"NTSSA015384\",\"NTSSA015396\",\"NTSSA015401\",\"NTSSA015413\",\"NTSSA015425\",\"NTSSA015430\",\"NTSSA015442\",\"NTSSA015454\",\"NTSSA015466\",\"NTSSA015471\",\"NTSSA015483\",\"NTSSA015495\",\"NTSSA015500\",\"NTSSA015512\",\"NTSSA015524\",\"NTSSA015536\",\"NTSSA015582\",\"NTSSA015664\",\"NTSSA015676\",\"NTSSA015681\",\"NTSSA015693\",\"NTSSA015705\",\"NTSSA015710\",\"NTSSA015722\",\"NTSSA015734\",\"NTSSA015746\",\"NTSSA015751\",\"NTSSA015763\",\"NTSSA015775\",\"NTSSA015780\",\"NTSSA015792\",\"NTSSA015804\",\"NTSSA015816\",\"NTSSA015821\",\"NTSSA015833\",\"NTSSA015845\",\"NTSSA015850\",\"NTSSA015862\",\"NTSSA015874\",\"NTSSA015886\",\"NTSSA015891\",\"NTSSA015903\",\"NTSSA015915\",\"NTSSA015920\",\"NTSSA015932\",\"NTSSA016031\",\"NTSSA016043\",\"NTSSA016055\",\"NTSSA016060\",\"NTSSA016072\",\"NTSSA016084\",\"NTSSA016096\",\"NTSSA016101\",\"NTSSA016113\",\"NTSSA016125\",\"NTSSA016130\",\"NTSSA016142\");\n} //fin de if($IdEstado == \"18\")\n\n//Condicion de estado-clues\nif($IdEstado == \"19\"){\n\t$Clues = array(\"NLSSA000015\",\"NLSSA000020\",\"NLSSA000032\",\"NLSSA000044\",\"NLSSA000056\",\"NLSSA000061\",\"NLSSA000073\",\"NLSSA000085\",\"NLSSA000090\",\"NLSSA000102\",\"NLSSA000126\",\"NLSSA000131\",\"NLSSA000143\",\"NLSSA000155\",\"NLSSA000160\",\"NLSSA000172\",\"NLSSA000196\",\"NLSSA000201\",\"NLSSA000213\",\"NLSSA000225\",\"NLSSA000230\",\"NLSSA000242\",\"NLSSA000254\",\"NLSSA000266\",\"NLSSA000271\",\"NLSSA000283\",\"NLSSA000295\",\"NLSSA000300\",\"NLSSA000312\",\"NLSSA000324\",\"NLSSA000336\",\"NLSSA000341\",\"NLSSA000365\",\"NLSSA000370\",\"NLSSA000382\",\"NLSSA000394\",\"NLSSA000406\",\"NLSSA000411\",\"NLSSA000423\",\"NLSSA000435\",\"NLSSA000440\",\"NLSSA000452\",\"NLSSA000464\",\"NLSSA000476\",\"NLSSA000481\",\"NLSSA000493\",\"NLSSA000505\",\"NLSSA000510\",\"NLSSA000522\",\"NLSSA000534\",\"NLSSA000546\",\"NLSSA000551\",\"NLSSA000575\",\"NLSSA000580\",\"NLSSA000592\",\"NLSSA000604\",\"NLSSA000616\",\"NLSSA000621\",\"NLSSA000633\",\"NLSSA000645\",\"NLSSA000650\",\"NLSSA000674\",\"NLSSA000686\",\"NLSSA000691\",\"NLSSA000703\",\"NLSSA000720\",\"NLSSA000732\",\"NLSSA000744\",\"NLSSA000761\",\"NLSSA000773\",\"NLSSA000785\",\"NLSSA000790\",\"NLSSA000802\",\"NLSSA000814\",\"NLSSA000831\",\"NLSSA000843\",\"NLSSA000855\",\"NLSSA000860\",\"NLSSA000884\",\"NLSSA000896\",\"NLSSA000901\",\"NLSSA000913\",\"NLSSA000925\",\"NLSSA000930\",\"NLSSA000942\",\"NLSSA000954\",\"NLSSA000966\",\"NLSSA000971\",\"NLSSA000983\",\"NLSSA000995\",\"NLSSA001000\",\"NLSSA001012\",\"NLSSA001024\",\"NLSSA001036\",\"NLSSA001041\",\"NLSSA001053\",\"NLSSA001065\",\"NLSSA001070\",\"NLSSA001082\",\"NLSSA001094\",\"NLSSA001106\",\"NLSSA001111\",\"NLSSA001123\",\"NLSSA001135\",\"NLSSA001140\",\"NLSSA001152\",\"NLSSA001164\",\"NLSSA001176\",\"NLSSA001181\",\"NLSSA001193\",\"NLSSA001205\",\"NLSSA001210\",\"NLSSA001222\",\"NLSSA001234\",\"NLSSA001246\",\"NLSSA001251\",\"NLSSA001263\",\"NLSSA001275\",\"NLSSA001280\",\"NLSSA001292\",\"NLSSA001304\",\"NLSSA001316\",\"NLSSA001321\",\"NLSSA001333\",\"NLSSA001345\",\"NLSSA001350\",\"NLSSA001362\",\"NLSSA001374\",\"NLSSA001386\",\"NLSSA001391\",\"NLSSA001403\",\"NLSSA001415\",\"NLSSA001420\",\"NLSSA001432\",\"NLSSA001444\",\"NLSSA001456\",\"NLSSA001461\",\"NLSSA001473\",\"NLSSA001485\",\"NLSSA001490\",\"NLSSA001502\",\"NLSSA001514\",\"NLSSA001526\",\"NLSSA001531\",\"NLSSA001543\",\"NLSSA001555\",\"NLSSA001560\",\"NLSSA001584\",\"NLSSA001596\",\"NLSSA001601\",\"NLSSA001625\",\"NLSSA001630\",\"NLSSA001642\",\"NLSSA001654\",\"NLSSA001666\",\"NLSSA001671\",\"NLSSA001683\",\"NLSSA001695\",\"NLSSA001700\",\"NLSSA001712\",\"NLSSA001724\",\"NLSSA001736\",\"NLSSA001741\",\"NLSSA001753\",\"NLSSA001765\",\"NLSSA001770\",\"NLSSA001782\",\"NLSSA001794\",\"NLSSA001806\",\"NLSSA001811\",\"NLSSA001823\",\"NLSSA001835\",\"NLSSA001840\",\"NLSSA001852\",\"NLSSA001864\",\"NLSSA001876\",\"NLSSA001881\",\"NLSSA001893\",\"NLSSA001905\",\"NLSSA001910\",\"NLSSA001922\",\"NLSSA001934\",\"NLSSA001951\",\"NLSSA001963\",\"NLSSA001975\",\"NLSSA001980\",\"NLSSA001992\",\"NLSSA002004\",\"NLSSA002016\",\"NLSSA002021\",\"NLSSA002033\",\"NLSSA002045\",\"NLSSA002050\",\"NLSSA002062\",\"NLSSA002074\",\"NLSSA002086\",\"NLSSA002091\",\"NLSSA002103\",\"NLSSA002115\",\"NLSSA002120\",\"NLSSA002132\",\"NLSSA002144\",\"NLSSA002156\",\"NLSSA002161\",\"NLSSA002173\",\"NLSSA002185\",\"NLSSA002190\",\"NLSSA002202\",\"NLSSA002226\",\"NLSSA002231\",\"NLSSA002243\",\"NLSSA002255\",\"NLSSA002260\",\"NLSSA002272\",\"NLSSA002284\",\"NLSSA002296\",\"NLSSA002301\",\"NLSSA002313\",\"NLSSA002325\",\"NLSSA002330\",\"NLSSA002342\",\"NLSSA002354\",\"NLSSA002366\",\"NLSSA002371\",\"NLSSA002383\",\"NLSSA002395\",\"NLSSA002400\",\"NLSSA002412\",\"NLSSA002424\",\"NLSSA002436\",\"NLSSA002441\",\"NLSSA002453\",\"NLSSA002465\",\"NLSSA002470\",\"NLSSA002482\",\"NLSSA002494\",\"NLSSA002506\",\"NLSSA002511\",\"NLSSA002523\",\"NLSSA002535\",\"NLSSA002540\",\"NLSSA002552\",\"NLSSA002564\",\"NLSSA002576\",\"NLSSA002581\",\"NLSSA002593\",\"NLSSA002605\",\"NLSSA002610\",\"NLSSA002622\",\"NLSSA002634\",\"NLSSA002646\",\"NLSSA002651\",\"NLSSA002663\",\"NLSSA002675\",\"NLSSA002680\",\"NLSSA002692\",\"NLSSA002704\",\"NLSSA002716\",\"NLSSA002721\",\"NLSSA002733\",\"NLSSA002745\",\"NLSSA002750\",\"NLSSA002762\",\"NLSSA002774\",\"NLSSA002786\",\"NLSSA002791\",\"NLSSA002803\",\"NLSSA002815\",\"NLSSA002820\",\"NLSSA002832\",\"NLSSA002856\",\"NLSSA002861\",\"NLSSA002873\",\"NLSSA002890\",\"NLSSA002902\",\"NLSSA002914\",\"NLSSA002926\",\"NLSSA002931\",\"NLSSA002943\",\"NLSSA002955\",\"NLSSA002972\",\"NLSSA002984\",\"NLSSA002996\",\"NLSSA003001\",\"NLSSA003025\",\"NLSSA003030\",\"NLSSA003042\",\"NLSSA003054\",\"NLSSA003066\",\"NLSSA003071\",\"NLSSA003083\",\"NLSSA003100\",\"NLSSA003112\",\"NLSSA003124\",\"NLSSA003136\",\"NLSSA003141\",\"NLSSA003153\",\"NLSSA003165\",\"NLSSA003170\",\"NLSSA003182\",\"NLSSA003194\",\"NLSSA003206\",\"NLSSA003211\",\"NLSSA003223\",\"NLSSA003235\",\"NLSSA003240\",\"NLSSA003252\",\"NLSSA003264\",\"NLSSA003276\",\"NLSSA003281\",\"NLSSA003293\",\"NLSSA003305\",\"NLSSA003310\",\"NLSSA003322\",\"NLSSA003334\",\"NLSSA003346\",\"NLSSA003351\",\"NLSSA003363\",\"NLSSA003375\",\"NLSSA003380\",\"NLSSA003392\",\"NLSSA003404\",\"NLSSA003416\",\"NLSSA003421\",\"NLSSA003433\",\"NLSSA003445\",\"NLSSA003450\",\"NLSSA003462\",\"NLSSA003474\",\"NLSSA003486\",\"NLSSA003491\",\"NLSSA003503\",\"NLSSA003515\",\"NLSSA003520\",\"NLSSA003532\",\"NLSSA003544\",\"NLSSA003556\",\"NLSSA003561\",\"NLSSA003573\",\"NLSSA003585\",\"NLSSA003590\",\"NLSSA003602\",\"NLSSA003614\",\"NLSSA003626\",\"NLSSA003631\",\"NLSSA003643\",\"NLSSA003655\",\"NLSSA003660\",\"NLSSA003672\",\"NLSSA003684\",\"NLSSA003696\",\"NLSSA003701\",\"NLSSA003713\",\"NLSSA003725\",\"NLSSA003730\",\"NLSSA003754\",\"NLSSA003766\",\"NLSSA003771\",\"NLSSA003783\",\"NLSSA003795\",\"NLSSA003800\",\"NLSSA003812\",\"NLSSA003824\",\"NLSSA003836\",\"NLSSA003841\",\"NLSSA003853\",\"NLSSA003865\",\"NLSSA003870\",\"NLSSA003882\",\"NLSSA003894\",\"NLSSA003906\",\"NLSSA003911\",\"NLSSA003923\",\"NLSSA003935\",\"NLSSA003940\",\"NLSSA003952\",\"NLSSA003964\",\"NLSSA003976\",\"NLSSA003981\",\"NLSSA003993\",\"NLSSA004005\",\"NLSSA004010\",\"NLSSA004034\",\"NLSSA004046\",\"NLSSA004051\",\"NLSSA004063\",\"NLSSA004075\",\"NLSSA004080\",\"NLSSA004092\",\"NLSSA004104\",\"NLSSA004116\",\"NLSSA004121\",\"NLSSA004145\",\"NLSSA004150\",\"NLSSA004162\",\"NLSSA004186\",\"NLSSA004191\",\"NLSSA004203\",\"NLSSA004215\",\"NLSSA004220\",\"NLSSA004232\",\"NLSSA004244\",\"NLSSA004256\",\"NLSSA004261\",\"NLSSA004273\",\"NLSSA004285\",\"NLSSA004290\",\"NLSSA004302\",\"NLSSA004314\",\"NLSSA004326\",\"NLSSA004331\",\"NLSSA004343\",\"NLSSA004355\",\"NLSSA004360\",\"NLSSA004372\",\"NLSSA004384\",\"NLSSA004396\",\"NLSSA004401\",\"NLSSA004413\",\"NLSSA004425\",\"NLSSA004430\",\"NLSSA004442\",\"NLSSA004454\",\"NLSSA004466\",\"NLSSA004471\",\"NLSSA004495\",\"NLSSA004512\",\"NLSSA004524\",\"NLSSA004536\",\"NLSSA004541\",\"NLSSA004553\",\"NLSSA004565\",\"NLSSA004570\",\"NLSSA004582\",\"NLSSA004606\",\"NLSSA004664\",\"NLSSA004676\",\"NLSSA004681\",\"NLSSA004693\",\"NLSSA004751\",\"NLSSA013991\",\"NLSSA014003\",\"NLSSA014015\",\"NLSSA014020\",\"NLSSA014032\",\"NLSSA014045\",\"NLSSA014050\",\"NLSSA014062\",\"NLSSA014074\",\"NLSSA014086\",\"NLSSA014091\",\"NLSSA014103\",\"NLSSA014115\",\"NLSSA014120\",\"NLSSA014144\",\"NLSSA014156\",\"NLSSA014161\",\"NLSSA014173\",\"NLSSA014185\",\"NLSSA014190\",\"NLSSA014202\",\"NLSSA014214\",\"NLSSA014226\",\"NLSSA014231\",\"NLSSA014243\",\"NLSSA014255\",\"NLSSA014260\",\"NLSSA014271\",\"NLSSA014283\",\"NLSSA014295\",\"NLSSA014300\",\"NLSSA014324\",\"NLSSA014336\",\"NLSSA014341\",\"NLSSA014353\",\"NLSSA014365\",\"NLSSA014370\",\"NLSSA014382\",\"NLSSA014394\",\"NLSSA014406\",\"NLSSA014411\",\"NLSSA014423\",\"NLSSA014435\",\"NLSSA014440\",\"NLSSA014452\",\"NLSSA014464\",\"NLSSA014476\",\"NLSSA014493\",\"NLSSA014505\",\"NLSSA014510\",\"NLSSA014522\",\"NLSSA014534\",\"NLSSA014546\",\"NLSSA014551\",\"NLSSA014563\",\"NLSSA014575\",\"NLSSA014580\",\"NLSSA014592\",\"NLSSA014604\",\"NLSSA014616\",\"NLSSA014621\",\"NLSSA014633\",\"NLSSA014645\",\"NLSSA014650\",\"NLSSA014662\",\"NLSSA014674\",\"NLSSA014686\",\"NLSSA014691\",\"NLSSA014703\",\"NLSSA014715\",\"NLSSA014720\",\"NLSSA014732\",\"NLSSA014744\",\"NLSSA014756\",\"NLSSA014761\",\"NLSSA014773\",\"NLSSA014785\",\"NLSSA014790\",\"NLSSA014802\",\"NLSSA014814\",\"NLSSA014826\",\"NLSSA014831\",\"NLSSA014843\",\"NLSSA014855\",\"NLSSA014860\",\"NLSSA014872\",\"NLSSA014884\",\"NLSSA014896\",\"NLSSA014901\",\"NLSSA014913\",\"NLSSA014925\",\"NLSSA014930\",\"NLSSA014942\",\"NLSSA014954\",\"NLSSA014966\",\"NLSSA014971\",\"NLSSA014983\",\"NLSSA014995\",\"NLSSA015000\",\"NLSSA015012\",\"NLSSA015024\",\"NLSSA015036\",\"NLSSA015041\");\n} //fin de if($IdEstado == \"19\")\n\n//Condicion de estado-clues\nif($IdEstado == \"20\"){\n\t$Clues = array(\"OCSSA000010\",\"OCSSA000022\",\"OCSSA000034\",\"OCSSA000046\",\"OCSSA000051\",\"OCSSA000063\",\"OCSSA000075\",\"OCSSA000080\",\"OCSSA000092\",\"OCSSA000104\",\"OCSSA000116\",\"OCSSA000121\",\"OCSSA000133\",\"OCSSA000145\",\"OCSSA000150\",\"OCSSA000162\",\"OCSSA000174\",\"OCSSA000186\",\"OCSSA000191\",\"OCSSA000203\",\"OCSSA000215\",\"OCSSA000220\",\"OCSSA000232\",\"OCSSA000244\",\"OCSSA000256\",\"OCSSA000261\",\"OCSSA000273\",\"OCSSA000285\",\"OCSSA000290\",\"OCSSA000302\",\"OCSSA000314\",\"OCSSA000326\",\"OCSSA000331\",\"OCSSA000343\",\"OCSSA000355\",\"OCSSA000360\",\"OCSSA000372\",\"OCSSA000384\",\"OCSSA000396\",\"OCSSA000413\",\"OCSSA000425\",\"OCSSA000430\",\"OCSSA000454\",\"OCSSA000466\",\"OCSSA000471\",\"OCSSA000483\",\"OCSSA000495\",\"OCSSA000500\",\"OCSSA000512\",\"OCSSA000524\",\"OCSSA000536\",\"OCSSA000541\",\"OCSSA000553\",\"OCSSA000565\",\"OCSSA000570\",\"OCSSA000582\",\"OCSSA000594\",\"OCSSA000606\",\"OCSSA000611\",\"OCSSA000623\",\"OCSSA000635\",\"OCSSA000640\",\"OCSSA000652\",\"OCSSA000664\",\"OCSSA000676\",\"OCSSA000681\",\"OCSSA000693\",\"OCSSA000705\",\"OCSSA000710\",\"OCSSA000722\",\"OCSSA000734\",\"OCSSA000746\",\"OCSSA000751\",\"OCSSA000763\",\"OCSSA000775\",\"OCSSA000780\",\"OCSSA000792\",\"OCSSA000804\",\"OCSSA000816\",\"OCSSA000821\",\"OCSSA000833\",\"OCSSA000850\",\"OCSSA000862\",\"OCSSA000874\",\"OCSSA000886\",\"OCSSA000891\",\"OCSSA000903\",\"OCSSA000920\",\"OCSSA000932\",\"OCSSA000944\",\"OCSSA000956\",\"OCSSA000961\",\"OCSSA000973\",\"OCSSA000985\",\"OCSSA000990\",\"OCSSA001002\",\"OCSSA001014\",\"OCSSA001026\",\"OCSSA001031\",\"OCSSA001043\",\"OCSSA001055\",\"OCSSA001060\",\"OCSSA001072\",\"OCSSA001084\",\"OCSSA001096\",\"OCSSA001101\",\"OCSSA001113\",\"OCSSA001130\",\"OCSSA001142\",\"OCSSA001154\",\"OCSSA001166\",\"OCSSA001171\",\"OCSSA001195\",\"OCSSA001200\",\"OCSSA001212\",\"OCSSA001224\",\"OCSSA001236\",\"OCSSA001241\",\"OCSSA001253\",\"OCSSA001265\",\"OCSSA001270\",\"OCSSA001282\",\"OCSSA001294\",\"OCSSA001306\",\"OCSSA001311\",\"OCSSA001323\",\"OCSSA001335\",\"OCSSA001340\",\"OCSSA001352\",\"OCSSA001364\",\"OCSSA001376\",\"OCSSA001381\",\"OCSSA001393\",\"OCSSA001405\",\"OCSSA001410\",\"OCSSA001422\",\"OCSSA001434\",\"OCSSA001446\",\"OCSSA001451\",\"OCSSA001463\",\"OCSSA001475\",\"OCSSA001480\",\"OCSSA001492\",\"OCSSA001504\",\"OCSSA001516\",\"OCSSA001521\",\"OCSSA001533\",\"OCSSA001545\",\"OCSSA001550\",\"OCSSA001562\",\"OCSSA001574\",\"OCSSA001591\",\"OCSSA001603\",\"OCSSA001615\",\"OCSSA001620\",\"OCSSA001632\",\"OCSSA001644\",\"OCSSA001661\",\"OCSSA001673\",\"OCSSA001685\",\"OCSSA001690\",\"OCSSA001702\",\"OCSSA001714\",\"OCSSA001726\",\"OCSSA001731\",\"OCSSA001743\",\"OCSSA001755\",\"OCSSA001760\",\"OCSSA001772\",\"OCSSA001784\",\"OCSSA001796\",\"OCSSA001801\",\"OCSSA001813\",\"OCSSA001825\",\"OCSSA001830\",\"OCSSA001842\",\"OCSSA001854\",\"OCSSA001866\",\"OCSSA001871\",\"OCSSA001883\",\"OCSSA001895\",\"OCSSA001900\",\"OCSSA001912\",\"OCSSA001924\",\"OCSSA001936\",\"OCSSA001941\",\"OCSSA001953\",\"OCSSA001965\",\"OCSSA001970\",\"OCSSA001982\",\"OCSSA001994\",\"OCSSA002006\",\"OCSSA002011\",\"OCSSA002023\",\"OCSSA002035\",\"OCSSA002040\",\"OCSSA002052\",\"OCSSA002064\",\"OCSSA002076\",\"OCSSA002081\",\"OCSSA002093\",\"OCSSA002105\",\"OCSSA002110\",\"OCSSA002122\",\"OCSSA002134\",\"OCSSA002146\",\"OCSSA002151\",\"OCSSA002163\",\"OCSSA002175\",\"OCSSA002180\",\"OCSSA002192\",\"OCSSA002204\",\"OCSSA002216\",\"OCSSA002221\",\"OCSSA002233\",\"OCSSA002245\",\"OCSSA002250\",\"OCSSA002262\",\"OCSSA002274\",\"OCSSA002286\",\"OCSSA002291\",\"OCSSA002303\",\"OCSSA002315\",\"OCSSA002320\",\"OCSSA002332\",\"OCSSA002344\",\"OCSSA002356\",\"OCSSA002361\",\"OCSSA002373\",\"OCSSA002385\",\"OCSSA002390\",\"OCSSA002402\",\"OCSSA002414\",\"OCSSA002426\",\"OCSSA002431\",\"OCSSA002443\",\"OCSSA002455\",\"OCSSA002460\",\"OCSSA002472\",\"OCSSA002484\",\"OCSSA002496\",\"OCSSA002501\",\"OCSSA002513\",\"OCSSA002525\",\"OCSSA002530\",\"OCSSA002542\",\"OCSSA002554\",\"OCSSA002566\",\"OCSSA002571\",\"OCSSA002583\",\"OCSSA002595\",\"OCSSA002600\",\"OCSSA002612\",\"OCSSA002624\",\"OCSSA002636\",\"OCSSA002641\",\"OCSSA002653\",\"OCSSA002665\",\"OCSSA002670\",\"OCSSA002682\",\"OCSSA002694\",\"OCSSA002706\",\"OCSSA002711\",\"OCSSA002723\",\"OCSSA002740\",\"OCSSA002752\",\"OCSSA002764\",\"OCSSA002776\",\"OCSSA002781\",\"OCSSA002793\",\"OCSSA002805\",\"OCSSA002810\",\"OCSSA002822\",\"OCSSA002834\",\"OCSSA002846\",\"OCSSA002851\",\"OCSSA002863\",\"OCSSA002875\",\"OCSSA002880\",\"OCSSA002892\",\"OCSSA002904\",\"OCSSA002916\",\"OCSSA002921\",\"OCSSA002933\",\"OCSSA002945\",\"OCSSA002950\",\"OCSSA002962\",\"OCSSA002974\",\"OCSSA002986\",\"OCSSA002991\",\"OCSSA003003\",\"OCSSA003015\",\"OCSSA003020\",\"OCSSA003032\",\"OCSSA003044\",\"OCSSA003056\",\"OCSSA003061\",\"OCSSA003073\",\"OCSSA003085\",\"OCSSA003090\",\"OCSSA003102\",\"OCSSA003114\",\"OCSSA003126\",\"OCSSA003131\",\"OCSSA003143\",\"OCSSA003155\",\"OCSSA003160\",\"OCSSA003172\",\"OCSSA003184\",\"OCSSA003196\",\"OCSSA003201\",\"OCSSA003213\",\"OCSSA003230\",\"OCSSA003242\",\"OCSSA003254\",\"OCSSA003266\",\"OCSSA003271\",\"OCSSA003283\",\"OCSSA003295\",\"OCSSA003300\",\"OCSSA003312\",\"OCSSA003324\",\"OCSSA003336\",\"OCSSA003341\",\"OCSSA003353\",\"OCSSA003365\",\"OCSSA003370\",\"OCSSA003382\",\"OCSSA003394\",\"OCSSA003406\",\"OCSSA003411\",\"OCSSA003423\",\"OCSSA003435\",\"OCSSA003440\",\"OCSSA003452\",\"OCSSA003464\",\"OCSSA003476\",\"OCSSA003481\",\"OCSSA003493\",\"OCSSA003505\",\"OCSSA003510\",\"OCSSA003522\",\"OCSSA003534\",\"OCSSA003546\",\"OCSSA003551\",\"OCSSA003563\",\"OCSSA003575\",\"OCSSA003580\",\"OCSSA003592\",\"OCSSA003604\",\"OCSSA003616\",\"OCSSA003621\",\"OCSSA003633\",\"OCSSA003645\",\"OCSSA003662\",\"OCSSA003674\",\"OCSSA003686\",\"OCSSA003691\",\"OCSSA003703\",\"OCSSA003715\",\"OCSSA003732\",\"OCSSA003744\",\"OCSSA003756\",\"OCSSA003761\",\"OCSSA003773\",\"OCSSA003785\",\"OCSSA003790\",\"OCSSA003802\",\"OCSSA003814\",\"OCSSA003826\",\"OCSSA003831\",\"OCSSA003843\",\"OCSSA003855\",\"OCSSA003860\",\"OCSSA003872\",\"OCSSA003884\",\"OCSSA003896\",\"OCSSA003913\",\"OCSSA003925\",\"OCSSA003930\",\"OCSSA003942\",\"OCSSA003954\",\"OCSSA003966\",\"OCSSA003971\",\"OCSSA003983\",\"OCSSA003995\",\"OCSSA004000\",\"OCSSA004012\",\"OCSSA004024\",\"OCSSA004036\",\"OCSSA004041\",\"OCSSA004053\",\"OCSSA004065\",\"OCSSA004070\",\"OCSSA004082\",\"OCSSA004094\",\"OCSSA004106\",\"OCSSA004111\",\"OCSSA004123\",\"OCSSA004135\",\"OCSSA004140\",\"OCSSA004152\",\"OCSSA004176\",\"OCSSA004181\",\"OCSSA004193\",\"OCSSA004205\",\"OCSSA004210\",\"OCSSA004222\",\"OCSSA004234\",\"OCSSA004246\",\"OCSSA004251\",\"OCSSA004263\",\"OCSSA004275\",\"OCSSA004280\",\"OCSSA004292\",\"OCSSA004304\",\"OCSSA004316\",\"OCSSA004321\",\"OCSSA004333\",\"OCSSA004345\",\"OCSSA004350\",\"OCSSA004362\",\"OCSSA004374\",\"OCSSA004386\",\"OCSSA004391\",\"OCSSA004403\",\"OCSSA004415\",\"OCSSA004420\",\"OCSSA004432\",\"OCSSA004444\",\"OCSSA004456\",\"OCSSA004461\",\"OCSSA004473\",\"OCSSA004485\",\"OCSSA004490\",\"OCSSA004502\",\"OCSSA004514\",\"OCSSA004526\",\"OCSSA004531\",\"OCSSA004543\",\"OCSSA004555\",\"OCSSA004560\",\"OCSSA004572\",\"OCSSA004584\",\"OCSSA004596\",\"OCSSA004601\",\"OCSSA004613\",\"OCSSA004630\",\"OCSSA004642\",\"OCSSA004666\",\"OCSSA004683\",\"OCSSA004695\",\"OCSSA004700\",\"OCSSA004712\",\"OCSSA004724\",\"OCSSA004736\",\"OCSSA004741\",\"OCSSA004753\",\"OCSSA004765\",\"OCSSA004770\",\"OCSSA004782\",\"OCSSA004794\",\"OCSSA004806\",\"OCSSA004811\",\"OCSSA004823\",\"OCSSA004835\",\"OCSSA004840\",\"OCSSA004852\",\"OCSSA004864\",\"OCSSA004876\",\"OCSSA004881\",\"OCSSA004893\",\"OCSSA004905\",\"OCSSA004910\",\"OCSSA004922\",\"OCSSA004934\",\"OCSSA004946\",\"OCSSA004951\",\"OCSSA004963\",\"OCSSA004975\",\"OCSSA004980\",\"OCSSA004992\",\"OCSSA005004\",\"OCSSA005016\",\"OCSSA005033\",\"OCSSA005045\",\"OCSSA005050\",\"OCSSA005062\",\"OCSSA005074\",\"OCSSA005086\",\"OCSSA005091\",\"OCSSA005103\",\"OCSSA005115\",\"OCSSA005132\",\"OCSSA005144\",\"OCSSA005156\",\"OCSSA005161\",\"OCSSA005173\",\"OCSSA005185\",\"OCSSA005190\",\"OCSSA005202\",\"OCSSA005214\",\"OCSSA005226\",\"OCSSA005231\",\"OCSSA005243\",\"OCSSA005255\",\"OCSSA005260\",\"OCSSA005272\",\"OCSSA005284\",\"OCSSA005296\",\"OCSSA005301\",\"OCSSA005313\",\"OCSSA005325\",\"OCSSA005330\",\"OCSSA005342\",\"OCSSA005354\",\"OCSSA005366\",\"OCSSA005383\",\"OCSSA005395\",\"OCSSA005400\",\"OCSSA005412\",\"OCSSA005424\",\"OCSSA005436\",\"OCSSA005441\",\"OCSSA005453\",\"OCSSA005465\",\"OCSSA005470\",\"OCSSA005482\",\"OCSSA005494\",\"OCSSA005506\",\"OCSSA005511\",\"OCSSA005540\",\"OCSSA005552\",\"OCSSA005564\",\"OCSSA005576\",\"OCSSA005581\",\"OCSSA005593\",\"OCSSA005605\",\"OCSSA005610\",\"OCSSA005622\",\"OCSSA005634\",\"OCSSA005646\",\"OCSSA005651\",\"OCSSA005663\",\"OCSSA005675\",\"OCSSA005680\",\"OCSSA005692\",\"OCSSA005704\",\"OCSSA005716\",\"OCSSA005721\",\"OCSSA005733\",\"OCSSA005745\",\"OCSSA005750\",\"OCSSA005762\",\"OCSSA005774\",\"OCSSA005786\",\"OCSSA005791\",\"OCSSA005803\",\"OCSSA005815\",\"OCSSA005820\",\"OCSSA005832\",\"OCSSA005844\",\"OCSSA005861\",\"OCSSA005873\",\"OCSSA005885\",\"OCSSA005890\",\"OCSSA005902\",\"OCSSA005914\",\"OCSSA005926\",\"OCSSA005931\",\"OCSSA005943\",\"OCSSA005955\",\"OCSSA005960\",\"OCSSA005972\",\"OCSSA005984\",\"OCSSA005996\",\"OCSSA006001\",\"OCSSA006025\",\"OCSSA006030\",\"OCSSA006042\",\"OCSSA006054\",\"OCSSA006066\",\"OCSSA006071\",\"OCSSA006083\",\"OCSSA006095\",\"OCSSA006100\",\"OCSSA006112\",\"OCSSA006124\",\"OCSSA006136\",\"OCSSA006141\",\"OCSSA006153\",\"OCSSA006165\",\"OCSSA006170\",\"OCSSA006182\",\"OCSSA006206\",\"OCSSA006223\",\"OCSSA006235\",\"OCSSA006240\",\"OCSSA006252\",\"OCSSA006264\",\"OCSSA006276\",\"OCSSA006281\",\"OCSSA006293\",\"OCSSA006305\",\"OCSSA006322\",\"OCSSA006334\",\"OCSSA006346\",\"OCSSA006351\",\"OCSSA006363\",\"OCSSA006380\",\"OCSSA006392\",\"OCSSA006404\",\"OCSSA006416\",\"OCSSA006421\",\"OCSSA006433\",\"OCSSA006445\",\"OCSSA006450\",\"OCSSA006462\",\"OCSSA006474\",\"OCSSA006486\",\"OCSSA006491\",\"OCSSA006503\",\"OCSSA006515\",\"OCSSA006520\",\"OCSSA006532\",\"OCSSA006544\",\"OCSSA006556\",\"OCSSA006561\",\"OCSSA006573\",\"OCSSA006585\",\"OCSSA006590\",\"OCSSA006602\",\"OCSSA006614\",\"OCSSA006626\",\"OCSSA006631\",\"OCSSA006643\",\"OCSSA006655\",\"OCSSA006660\",\"OCSSA006672\",\"OCSSA006684\",\"OCSSA006696\",\"OCSSA006701\",\"OCSSA006725\",\"OCSSA006730\",\"OCSSA006742\",\"OCSSA006754\",\"OCSSA006766\",\"OCSSA006771\",\"OCSSA006783\",\"OCSSA006795\",\"OCSSA006800\",\"OCSSA006812\",\"OCSSA006824\",\"OCSSA006836\",\"OCSSA006841\",\"OCSSA006853\",\"OCSSA006865\",\"OCSSA006870\",\"OCSSA006882\",\"OCSSA006894\",\"OCSSA006906\",\"OCSSA006911\",\"OCSSA006923\",\"OCSSA006935\",\"OCSSA006940\",\"OCSSA006952\",\"OCSSA006964\",\"OCSSA006976\",\"OCSSA006981\",\"OCSSA006993\",\"OCSSA007005\",\"OCSSA007010\",\"OCSSA007022\",\"OCSSA007034\",\"OCSSA007046\",\"OCSSA007051\",\"OCSSA007063\",\"OCSSA007075\",\"OCSSA007080\",\"OCSSA007092\",\"OCSSA007104\",\"OCSSA007116\",\"OCSSA007121\",\"OCSSA007133\",\"OCSSA007145\",\"OCSSA007150\",\"OCSSA007162\",\"OCSSA007174\",\"OCSSA007186\",\"OCSSA007191\",\"OCSSA007203\",\"OCSSA007215\",\"OCSSA007232\",\"OCSSA007244\",\"OCSSA007256\",\"OCSSA007314\",\"OCSSA007360\",\"OCSSA007372\",\"OCSSA007384\",\"OCSSA007396\",\"OCSSA007401\",\"OCSSA007413\",\"OCSSA007425\",\"OCSSA007430\",\"OCSSA007442\",\"OCSSA007454\",\"OCSSA007466\",\"OCSSA007471\",\"OCSSA007483\",\"OCSSA007495\",\"OCSSA007500\",\"OCSSA007512\",\"OCSSA007524\",\"OCSSA007536\",\"OCSSA007541\",\"OCSSA007553\",\"OCSSA007565\",\"OCSSA007570\",\"OCSSA007582\",\"OCSSA007594\",\"OCSSA014740\",\"OCSSA014752\",\"OCSSA014764\",\"OCSSA014776\",\"OCSSA014781\",\"OCSSA014810\",\"OCSSA014822\",\"OCSSA014851\",\"OCSSA014863\",\"OCSSA014880\",\"OCSSA014892\",\"OCSSA014916\",\"OCSSA014933\",\"OCSSA014950\",\"OCSSA014974\",\"OCSSA014991\",\"OCSSA015015\",\"OCSSA015032\",\"OCSSA015044\",\"OCSSA015056\",\"OCSSA015061\",\"OCSSA015073\",\"OCSSA015085\",\"OCSSA015102\",\"OCSSA015114\",\"OCSSA015126\",\"OCSSA015131\",\"OCSSA015143\",\"OCSSA015155\",\"OCSSA015160\",\"OCSSA015172\",\"OCSSA015184\",\"OCSSA015225\",\"OCSSA015230\",\"OCSSA015266\",\"OCSSA015283\",\"OCSSA015295\",\"OCSSA015300\",\"OCSSA015312\",\"OCSSA015336\",\"OCSSA015341\",\"OCSSA015353\",\"OCSSA015365\",\"OCSSA015370\",\"OCSSA015382\",\"OCSSA015394\",\"OCSSA015406\",\"OCSSA015423\",\"OCSSA015452\",\"OCSSA015464\",\"OCSSA015481\",\"OCSSA015522\",\"OCSSA015546\",\"OCSSA015580\",\"OCSSA015592\",\"OCSSA015604\",\"OCSSA015621\",\"OCSSA015662\",\"OCSSA015703\",\"OCSSA015715\",\"OCSSA015720\",\"OCSSA015773\",\"OCSSA015785\",\"OCSSA015790\",\"OCSSA015826\",\"OCSSA015843\",\"OCSSA015855\",\"OCSSA015884\",\"OCSSA015896\",\"OCSSA015925\",\"OCSSA015930\",\"OCSSA015954\",\"OCSSA015966\",\"OCSSA015971\",\"OCSSA015983\",\"OCSSA015995\",\"OCSSA016000\",\"OCSSA016012\",\"OCSSA016036\",\"OCSSA016041\",\"OCSSA016065\",\"OCSSA016094\",\"OCSSA016106\",\"OCSSA016111\",\"OCSSA016123\",\"OCSSA016135\",\"OCSSA016152\",\"OCSSA016181\",\"OCSSA016193\",\"OCSSA016210\",\"OCSSA016222\",\"OCSSA016234\",\"OCSSA016246\",\"OCSSA016263\",\"OCSSA016280\",\"OCSSA016304\",\"OCSSA016316\",\"OCSSA016333\",\"OCSSA016345\",\"OCSSA016350\",\"OCSSA016374\",\"OCSSA016391\",\"OCSSA016403\",\"OCSSA016432\",\"OCSSA016456\",\"OCSSA016461\",\"OCSSA016473\",\"OCSSA016490\",\"OCSSA016502\",\"OCSSA016514\",\"OCSSA016526\",\"OCSSA016543\",\"OCSSA016560\",\"OCSSA016613\",\"OCSSA016642\",\"OCSSA016666\",\"OCSSA016695\",\"OCSSA016711\",\"OCSSA016723\",\"OCSSA016735\",\"OCSSA016740\",\"OCSSA016752\",\"OCSSA016764\",\"OCSSA016776\",\"OCSSA016781\",\"OCSSA016793\",\"OCSSA016805\",\"OCSSA016810\",\"OCSSA016822\",\"OCSSA016834\",\"OCSSA016846\",\"OCSSA016851\",\"OCSSA016863\",\"OCSSA016875\",\"OCSSA016880\",\"OCSSA016892\",\"OCSSA016904\",\"OCSSA016916\",\"OCSSA016921\",\"OCSSA016933\",\"OCSSA016945\",\"OCSSA016950\",\"OCSSA016962\",\"OCSSA016974\",\"OCSSA016986\",\"OCSSA016991\",\"OCSSA017003\",\"OCSSA017015\",\"OCSSA017020\",\"OCSSA017032\",\"OCSSA017044\",\"OCSSA017056\",\"OCSSA017061\",\"OCSSA017073\",\"OCSSA017085\",\"OCSSA017090\",\"OCSSA017102\",\"OCSSA017114\",\"OCSSA017126\",\"OCSSA017131\",\"OCSSA017143\",\"OCSSA017160\",\"OCSSA017172\",\"OCSSA017184\",\"OCSSA017196\",\"OCSSA017201\",\"OCSSA017213\",\"OCSSA017225\",\"OCSSA017230\",\"OCSSA017242\",\"OCSSA017254\",\"OCSSA017266\",\"OCSSA017271\",\"OCSSA017283\",\"OCSSA017295\",\"OCSSA017300\",\"OCSSA017312\",\"OCSSA017324\",\"OCSSA017336\",\"OCSSA017341\",\"OCSSA017353\",\"OCSSA017365\",\"OCSSA017370\",\"OCSSA017382\",\"OCSSA017394\",\"OCSSA017406\",\"OCSSA017411\",\"OCSSA017423\",\"OCSSA017435\",\"OCSSA017440\",\"OCSSA017452\",\"OCSSA017464\",\"OCSSA017476\",\"OCSSA017481\",\"OCSSA017493\",\"OCSSA017505\",\"OCSSA017510\",\"OCSSA017522\",\"OCSSA017534\",\"OCSSA017546\",\"OCSSA017551\",\"OCSSA017563\",\"OCSSA017575\",\"OCSSA017580\",\"OCSSA017604\",\"OCSSA017616\",\"OCSSA017621\",\"OCSSA017633\",\"OCSSA017645\",\"OCSSA017650\",\"OCSSA017662\",\"OCSSA017674\",\"OCSSA017686\",\"OCSSA017691\",\"OCSSA017703\",\"OCSSA017715\",\"OCSSA017720\",\"OCSSA017732\",\"OCSSA017744\",\"OCSSA017756\",\"OCSSA017761\",\"OCSSA017773\",\"OCSSA017785\",\"OCSSA017790\",\"OCSSA017802\",\"OCSSA017814\",\"OCSSA017826\",\"OCSSA017831\",\"OCSSA017843\",\"OCSSA017855\",\"OCSSA017860\",\"OCSSA017872\",\"OCSSA017884\",\"OCSSA017896\",\"OCSSA017901\",\"OCSSA017913\",\"OCSSA017925\",\"OCSSA017930\",\"OCSSA017942\",\"OCSSA017954\",\"OCSSA017966\",\"OCSSA017971\",\"OCSSA017983\",\"OCSSA017995\",\"OCSSA018000\",\"OCSSA018012\",\"OCSSA018024\",\"OCSSA018036\",\"OCSSA018041\",\"OCSSA018053\",\"OCSSA018065\",\"OCSSA018070\",\"OCSSA018082\",\"OCSSA018094\",\"OCSSA018106\",\"OCSSA018111\",\"OCSSA018123\",\"OCSSA018135\",\"OCSSA018140\",\"OCSSA018152\",\"OCSSA018164\",\"OCSSA018176\",\"OCSSA018181\",\"OCSSA018193\",\"OCSSA018205\",\"OCSSA018210\",\"OCSSA018222\",\"OCSSA018234\",\"OCSSA018246\",\"OCSSA018251\",\"OCSSA018263\",\"OCSSA018275\",\"OCSSA018280\",\"OCSSA018292\",\"OCSSA018304\",\"OCSSA018316\",\"OCSSA018321\",\"OCSSA018333\",\"OCSSA018345\",\"OCSSA018362\",\"OCSSA018374\",\"OCSSA018386\",\"OCSSA018391\",\"OCSSA018403\",\"OCSSA018420\",\"OCSSA018432\",\"OCSSA018444\",\"OCSSA018456\",\"OCSSA018461\",\"OCSSA018473\",\"OCSSA018485\",\"OCSSA018490\",\"OCSSA018502\",\"OCSSA018514\",\"OCSSA018526\",\"OCSSA018531\",\"OCSSA018543\",\"OCSSA018555\",\"OCSSA018560\",\"OCSSA018572\",\"OCSSA018584\",\"OCSSA018596\",\"OCSSA018601\",\"OCSSA018613\",\"OCSSA018625\",\"OCSSA018630\",\"OCSSA018642\",\"OCSSA018654\",\"OCSSA018666\",\"OCSSA018671\",\"OCSSA018683\",\"OCSSA018695\",\"OCSSA018700\",\"OCSSA018712\",\"OCSSA018724\",\"OCSSA018736\",\"OCSSA018741\",\"OCSSA018753\",\"OCSSA018770\",\"OCSSA018782\",\"OCSSA018794\",\"OCSSA018806\",\"OCSSA018811\",\"OCSSA018823\",\"OCSSA018835\",\"OCSSA018840\",\"OCSSA018852\",\"OCSSA018864\",\"OCSSA018876\",\"OCSSA018881\",\"OCSSA018893\",\"OCSSA018905\",\"OCSSA018910\",\"OCSSA018922\",\"OCSSA018934\",\"OCSSA018946\",\"OCSSA018951\",\"OCSSA018963\",\"OCSSA018975\",\"OCSSA018980\",\"OCSSA019004\",\"OCSSA019016\",\"OCSSA019021\",\"OCSSA019033\",\"OCSSA019045\",\"OCSSA019050\",\"OCSSA019062\",\"OCSSA019074\",\"OCSSA019086\",\"OCSSA019091\",\"OCSSA019103\",\"OCSSA019115\",\"OCSSA019132\",\"OCSSA019144\",\"OCSSA019156\",\"OCSSA019161\",\"OCSSA019173\",\"OCSSA019185\",\"OCSSA019190\",\"OCSSA019202\",\"OCSSA019214\",\"OCSSA019226\",\"OCSSA019231\",\"OCSSA019243\",\"OCSSA019255\",\"OCSSA019260\",\"OCSSA019272\",\"OCSSA019284\",\"OCSSA019296\",\"OCSSA019301\",\"OCSSA019313\",\"OCSSA019325\",\"OCSSA019330\",\"OCSSA019342\",\"OCSSA019354\",\"OCSSA019366\",\"OCSSA019371\",\"OCSSA019383\",\"OCSSA019395\",\"OCSSA019400\",\"OCSSA019412\",\"OCSSA019424\",\"OCSSA019436\",\"OCSSA019441\",\"OCSSA019453\",\"OCSSA019465\",\"OCSSA019470\",\"OCSSA019494\",\"OCSSA019506\",\"OCSSA019511\",\"OCSSA019523\",\"OCSSA019535\",\"OCSSA019540\",\"OCSSA019552\",\"OCSSA019564\",\"OCSSA019581\",\"OCSSA019593\",\"OCSSA019605\",\"OCSSA019610\",\"OCSSA019622\",\"OCSSA019634\",\"OCSSA019646\",\"OCSSA019651\",\"OCSSA019663\",\"OCSSA019675\",\"OCSSA019680\",\"OCSSA019692\",\"OCSSA019704\",\"OCSSA019716\",\"OCSSA019721\",\"OCSSA019733\",\"OCSSA019745\",\"OCSSA019750\",\"OCSSA019762\",\"OCSSA019774\",\"OCSSA019786\",\"OCSSA019791\",\"OCSSA019803\",\"OCSSA019815\",\"OCSSA019820\",\"OCSSA019832\",\"OCSSA019844\",\"OCSSA019856\",\"OCSSA019861\",\"OCSSA019873\",\"OCSSA019885\",\"OCSSA019890\",\"OCSSA019902\",\"OCSSA019914\",\"OCSSA019926\",\"OCSSA019955\",\"OCSSA019960\",\"OCSSA019972\",\"OCSSA019996\",\"OCSSA020001\",\"OCSSA020013\",\"OCSSA020025\",\"OCSSA020030\",\"OCSSA020042\",\"OCSSA020054\",\"OCSSA020066\",\"OCSSA020071\",\"OCSSA020083\",\"OCSSA020100\",\"OCSSA020112\",\"OCSSA020124\",\"OCSSA020136\",\"OCSSA020141\",\"OCSSA020153\",\"OCSSA020165\",\"OCSSA020170\",\"OCSSA020182\",\"OCSSA020194\",\"OCSSA020206\",\"OCSSA020211\",\"OCSSA020223\",\"OCSSA020235\",\"OCSSA020240\",\"OCSSA020252\",\"OCSSA020264\",\"OCSSA020276\",\"OCSSA020281\",\"OCSSA020293\",\"OCSSA020305\",\"OCSSA020310\",\"OCSSA020322\",\"OCSSA020334\",\"OCSSA020346\",\"OCSSA020351\",\"OCSSA020363\",\"OCSSA020375\",\"OCSSA020380\",\"OCSSA020392\",\"OCSSA020404\",\"OCSSA020416\",\"OCSSA020421\",\"OCSSA020433\",\"OCSSA020445\",\"OCSSA020450\",\"OCSSA020474\",\"OCSSA020486\",\"OCSSA020491\",\"OCSSA020515\",\"OCSSA020520\",\"OCSSA020532\",\"OCSSA020544\",\"OCSSA020556\",\"OCSSA020561\",\"OCSSA020573\",\"OCSSA020585\",\"OCSSA020590\",\"OCSSA020602\",\"OCSSA020614\",\"OCSSA020626\",\"OCSSA020631\",\"OCSSA020643\",\"OCSSA020655\",\"OCSSA020660\",\"OCSSA020672\",\"OCSSA020684\",\"OCSSA020696\",\"OCSSA020701\",\"OCSSA020713\",\"OCSSA020725\",\"OCSSA020730\",\"OCSSA020766\",\"OCSSA020771\",\"OCSSA020783\",\"OCSSA020795\",\"OCSSA020800\",\"OCSSA020812\",\"OCSSA020824\",\"OCSSA020836\",\"OCSSA020841\",\"OCSSA020865\",\"OCSSA020870\",\"OCSSA020911\",\"OCSSA020923\",\"OCSSA020935\",\"OCSSA020940\",\"OCSSA020952\",\"OCSSA020964\",\"OCSSA020976\",\"OCSSA020981\",\"OCSSA020993\",\"OCSSA021005\",\"OCSSA021010\",\"OCSSA021022\",\"OCSSA021034\",\"OCSSA021046\",\"OCSSA021051\",\"OCSSA021063\",\"OCSSA021075\",\"OCSSA021080\",\"OCSSA021092\",\"OCSSA021104\",\"OCSSA021116\",\"OCSSA021121\",\"OCSSA021133\",\"OCSSA021145\",\"OCSSA021150\",\"OCSSA021162\",\"OCSSA021174\",\"OCSSA021186\",\"OCSSA021191\",\"OCSSA021203\",\"OCSSA021215\",\"OCSSA021220\",\"OCSSA021232\",\"OCSSA021244\");\n} //fin de if($IdEstado == \"20\")\n\n//Condicion de estado-clues\nif($IdEstado == \"21\"){\n\t$Clues = array(\"PLSSA000011\",\"PLSSA000035\",\"PLSSA000052\",\"PLSSA000064\",\"PLSSA000076\",\"PLSSA000081\",\"PLSSA000122\",\"PLSSA000134\",\"PLSSA000146\",\"PLSSA000163\",\"PLSSA000175\",\"PLSSA000192\",\"PLSSA000204\",\"PLSSA000216\",\"PLSSA000221\",\"PLSSA000233\",\"PLSSA000245\",\"PLSSA000250\",\"PLSSA000262\",\"PLSSA000274\",\"PLSSA000291\",\"PLSSA000303\",\"PLSSA000315\",\"PLSSA000320\",\"PLSSA000332\",\"PLSSA000344\",\"PLSSA000356\",\"PLSSA000361\",\"PLSSA000373\",\"PLSSA000385\",\"PLSSA000390\",\"PLSSA000414\",\"PLSSA000426\",\"PLSSA000431\",\"PLSSA000443\",\"PLSSA000455\",\"PLSSA000460\",\"PLSSA000472\",\"PLSSA000484\",\"PLSSA000496\",\"PLSSA000501\",\"PLSSA000513\",\"PLSSA000525\",\"PLSSA000530\",\"PLSSA000542\",\"PLSSA000554\",\"PLSSA000566\",\"PLSSA000571\",\"PLSSA000583\",\"PLSSA000595\",\"PLSSA000600\",\"PLSSA000612\",\"PLSSA000624\",\"PLSSA000636\",\"PLSSA000641\",\"PLSSA000653\",\"PLSSA000665\",\"PLSSA000670\",\"PLSSA000682\",\"PLSSA000694\",\"PLSSA000706\",\"PLSSA000711\",\"PLSSA000723\",\"PLSSA000735\",\"PLSSA000752\",\"PLSSA000764\",\"PLSSA000776\",\"PLSSA000781\",\"PLSSA000793\",\"PLSSA000805\",\"PLSSA000810\",\"PLSSA000822\",\"PLSSA000834\",\"PLSSA000846\",\"PLSSA000851\",\"PLSSA000863\",\"PLSSA000880\",\"PLSSA000892\",\"PLSSA000904\",\"PLSSA000916\",\"PLSSA000921\",\"PLSSA000933\",\"PLSSA000945\",\"PLSSA000950\",\"PLSSA000962\",\"PLSSA000974\",\"PLSSA000986\",\"PLSSA000991\",\"PLSSA001003\",\"PLSSA001015\",\"PLSSA001020\",\"PLSSA001032\",\"PLSSA001044\",\"PLSSA001056\",\"PLSSA001061\",\"PLSSA001073\",\"PLSSA001085\",\"PLSSA001114\",\"PLSSA001126\",\"PLSSA001131\",\"PLSSA001143\",\"PLSSA001155\",\"PLSSA001160\",\"PLSSA001172\",\"PLSSA001184\",\"PLSSA001196\",\"PLSSA001201\",\"PLSSA001213\",\"PLSSA001225\",\"PLSSA001230\",\"PLSSA001242\",\"PLSSA001254\",\"PLSSA001266\",\"PLSSA001271\",\"PLSSA001283\",\"PLSSA001295\",\"PLSSA001300\",\"PLSSA001312\",\"PLSSA001324\",\"PLSSA001336\",\"PLSSA001341\",\"PLSSA001353\",\"PLSSA001365\",\"PLSSA001370\",\"PLSSA001382\",\"PLSSA001394\",\"PLSSA001406\",\"PLSSA001411\",\"PLSSA001423\",\"PLSSA001435\",\"PLSSA001493\",\"PLSSA001505\",\"PLSSA001510\",\"PLSSA001522\",\"PLSSA001534\",\"PLSSA001546\",\"PLSSA001551\",\"PLSSA001563\",\"PLSSA001575\",\"PLSSA001580\",\"PLSSA001592\",\"PLSSA001604\",\"PLSSA001616\",\"PLSSA001621\",\"PLSSA001645\",\"PLSSA001662\",\"PLSSA001674\",\"PLSSA001686\",\"PLSSA001691\",\"PLSSA001703\",\"PLSSA001715\",\"PLSSA001720\",\"PLSSA001732\",\"PLSSA001744\",\"PLSSA001756\",\"PLSSA001761\",\"PLSSA001773\",\"PLSSA001802\",\"PLSSA001814\",\"PLSSA001826\",\"PLSSA001831\",\"PLSSA001843\",\"PLSSA001855\",\"PLSSA001860\",\"PLSSA001872\",\"PLSSA001913\",\"PLSSA001925\",\"PLSSA001930\",\"PLSSA001942\",\"PLSSA001954\",\"PLSSA001966\",\"PLSSA001971\",\"PLSSA001983\",\"PLSSA001995\",\"PLSSA002000\",\"PLSSA002012\",\"PLSSA002024\",\"PLSSA002036\",\"PLSSA002041\",\"PLSSA002053\",\"PLSSA002065\",\"PLSSA002070\",\"PLSSA002094\",\"PLSSA002106\",\"PLSSA002123\",\"PLSSA002135\",\"PLSSA002140\",\"PLSSA002152\",\"PLSSA002164\",\"PLSSA002176\",\"PLSSA002181\",\"PLSSA002193\",\"PLSSA002205\",\"PLSSA002210\",\"PLSSA002222\",\"PLSSA002234\",\"PLSSA002246\",\"PLSSA002251\",\"PLSSA002263\",\"PLSSA002275\",\"PLSSA002280\",\"PLSSA002292\",\"PLSSA002304\",\"PLSSA002316\",\"PLSSA002321\",\"PLSSA002333\",\"PLSSA002345\",\"PLSSA002350\",\"PLSSA002362\",\"PLSSA002374\",\"PLSSA002386\",\"PLSSA002403\",\"PLSSA002415\",\"PLSSA002420\",\"PLSSA002432\",\"PLSSA002444\",\"PLSSA002461\",\"PLSSA002473\",\"PLSSA002485\",\"PLSSA002490\",\"PLSSA002502\",\"PLSSA002514\",\"PLSSA002526\",\"PLSSA002531\",\"PLSSA002543\",\"PLSSA002683\",\"PLSSA002695\",\"PLSSA002700\",\"PLSSA002712\",\"PLSSA002724\",\"PLSSA002736\",\"PLSSA002741\",\"PLSSA002753\",\"PLSSA002765\",\"PLSSA002770\",\"PLSSA002782\",\"PLSSA002794\",\"PLSSA002806\",\"PLSSA002811\",\"PLSSA002823\",\"PLSSA002835\",\"PLSSA002840\",\"PLSSA002852\",\"PLSSA002864\",\"PLSSA002876\",\"PLSSA002881\",\"PLSSA002893\",\"PLSSA002905\",\"PLSSA002910\",\"PLSSA002934\",\"PLSSA002946\",\"PLSSA002951\",\"PLSSA002963\",\"PLSSA002975\",\"PLSSA002980\",\"PLSSA002992\",\"PLSSA003004\",\"PLSSA003021\",\"PLSSA003033\",\"PLSSA003045\",\"PLSSA003050\",\"PLSSA003062\",\"PLSSA003074\",\"PLSSA003086\",\"PLSSA003091\",\"PLSSA003103\",\"PLSSA003115\",\"PLSSA003120\",\"PLSSA003132\",\"PLSSA003156\",\"PLSSA003161\",\"PLSSA003173\",\"PLSSA003185\",\"PLSSA003190\",\"PLSSA003214\",\"PLSSA003226\",\"PLSSA003231\",\"PLSSA003243\",\"PLSSA003255\",\"PLSSA003260\",\"PLSSA003284\",\"PLSSA003296\",\"PLSSA003301\",\"PLSSA003325\",\"PLSSA003330\",\"PLSSA003342\",\"PLSSA003354\",\"PLSSA003366\",\"PLSSA003371\",\"PLSSA003383\",\"PLSSA003400\",\"PLSSA003412\",\"PLSSA003424\",\"PLSSA003441\",\"PLSSA003453\",\"PLSSA003465\",\"PLSSA003470\",\"PLSSA003482\",\"PLSSA003494\",\"PLSSA003506\",\"PLSSA003523\",\"PLSSA003535\",\"PLSSA003540\",\"PLSSA003552\",\"PLSSA003581\",\"PLSSA003593\",\"PLSSA003605\",\"PLSSA003610\",\"PLSSA003622\",\"PLSSA003634\",\"PLSSA003646\",\"PLSSA003651\",\"PLSSA003663\",\"PLSSA003716\",\"PLSSA003721\",\"PLSSA003733\",\"PLSSA003745\",\"PLSSA003750\",\"PLSSA003762\",\"PLSSA003774\",\"PLSSA003786\",\"PLSSA003791\",\"PLSSA003803\",\"PLSSA003815\",\"PLSSA003832\",\"PLSSA003856\",\"PLSSA003861\",\"PLSSA003873\",\"PLSSA003885\",\"PLSSA003890\",\"PLSSA003902\",\"PLSSA003914\",\"PLSSA003926\",\"PLSSA003931\",\"PLSSA003943\",\"PLSSA003955\",\"PLSSA003972\",\"PLSSA003984\",\"PLSSA003996\",\"PLSSA004001\",\"PLSSA004013\",\"PLSSA004025\",\"PLSSA004042\",\"PLSSA004054\",\"PLSSA004066\",\"PLSSA004071\",\"PLSSA004083\",\"PLSSA004095\",\"PLSSA004100\",\"PLSSA004112\",\"PLSSA004136\",\"PLSSA004141\",\"PLSSA004153\",\"PLSSA004165\",\"PLSSA004170\",\"PLSSA004182\",\"PLSSA004194\",\"PLSSA004206\",\"PLSSA004211\",\"PLSSA004223\",\"PLSSA004235\",\"PLSSA004240\",\"PLSSA004252\",\"PLSSA004264\",\"PLSSA004276\",\"PLSSA004281\",\"PLSSA004293\",\"PLSSA004305\",\"PLSSA004310\",\"PLSSA004322\",\"PLSSA004334\",\"PLSSA004346\",\"PLSSA004351\",\"PLSSA004363\",\"PLSSA004375\",\"PLSSA004380\",\"PLSSA004404\",\"PLSSA004416\",\"PLSSA004421\",\"PLSSA004433\",\"PLSSA004445\",\"PLSSA004450\",\"PLSSA004462\",\"PLSSA004474\",\"PLSSA004486\",\"PLSSA004491\",\"PLSSA004503\",\"PLSSA004515\",\"PLSSA004520\",\"PLSSA004532\",\"PLSSA004544\",\"PLSSA004556\",\"PLSSA004561\",\"PLSSA004573\",\"PLSSA004585\",\"PLSSA004590\",\"PLSSA004602\",\"PLSSA004614\",\"PLSSA004626\",\"PLSSA004631\",\"PLSSA004643\",\"PLSSA004655\",\"PLSSA004660\",\"PLSSA004672\",\"PLSSA004684\",\"PLSSA004696\",\"PLSSA004701\",\"PLSSA004713\",\"PLSSA004725\",\"PLSSA004730\",\"PLSSA004742\",\"PLSSA004754\",\"PLSSA004766\",\"PLSSA004771\",\"PLSSA004783\",\"PLSSA004795\",\"PLSSA004800\",\"PLSSA004812\",\"PLSSA004865\",\"PLSSA004870\",\"PLSSA004882\",\"PLSSA004894\",\"PLSSA004906\",\"PLSSA004911\",\"PLSSA004923\",\"PLSSA004935\",\"PLSSA004940\",\"PLSSA004964\",\"PLSSA004976\",\"PLSSA004981\",\"PLSSA004993\",\"PLSSA005005\",\"PLSSA005010\",\"PLSSA005022\",\"PLSSA005034\",\"PLSSA005046\",\"PLSSA005051\",\"PLSSA005063\",\"PLSSA005075\",\"PLSSA005080\",\"PLSSA005092\",\"PLSSA005104\",\"PLSSA005116\",\"PLSSA005121\",\"PLSSA005133\",\"PLSSA005145\",\"PLSSA005150\",\"PLSSA005162\",\"PLSSA005174\",\"PLSSA005186\",\"PLSSA005191\",\"PLSSA005203\",\"PLSSA005215\",\"PLSSA005220\",\"PLSSA005232\",\"PLSSA005244\",\"PLSSA005256\",\"PLSSA005261\",\"PLSSA005273\",\"PLSSA005285\",\"PLSSA005290\",\"PLSSA005302\",\"PLSSA005314\",\"PLSSA005326\",\"PLSSA005331\",\"PLSSA005355\",\"PLSSA005360\",\"PLSSA005384\",\"PLSSA005396\",\"PLSSA005401\",\"PLSSA005413\",\"PLSSA005425\",\"PLSSA005430\",\"PLSSA005442\",\"PLSSA005454\",\"PLSSA005466\",\"PLSSA005471\",\"PLSSA005483\",\"PLSSA005495\",\"PLSSA005500\",\"PLSSA005512\",\"PLSSA005524\",\"PLSSA005536\",\"PLSSA005541\",\"PLSSA005553\",\"PLSSA005565\",\"PLSSA005570\",\"PLSSA005582\",\"PLSSA005594\",\"PLSSA005606\",\"PLSSA005611\",\"PLSSA005623\",\"PLSSA005635\",\"PLSSA005640\",\"PLSSA005652\",\"PLSSA005664\",\"PLSSA005676\",\"PLSSA005681\",\"PLSSA005693\",\"PLSSA005705\",\"PLSSA005710\",\"PLSSA005722\",\"PLSSA005734\",\"PLSSA005746\",\"PLSSA005816\",\"PLSSA005821\",\"PLSSA005833\",\"PLSSA005845\",\"PLSSA005850\",\"PLSSA005862\",\"PLSSA014641\",\"PLSSA014653\",\"PLSSA014665\",\"PLSSA014670\",\"PLSSA014683\",\"PLSSA014695\",\"PLSSA014700\",\"PLSSA014712\",\"PLSSA014724\",\"PLSSA014736\",\"PLSSA014741\",\"PLSSA014753\",\"PLSSA014765\",\"PLSSA014770\",\"PLSSA014782\",\"PLSSA014794\",\"PLSSA014806\",\"PLSSA014811\",\"PLSSA014823\",\"PLSSA014835\",\"PLSSA014840\",\"PLSSA014852\",\"PLSSA014864\",\"PLSSA014876\",\"PLSSA014881\",\"PLSSA014893\",\"PLSSA014905\",\"PLSSA014910\",\"PLSSA014922\",\"PLSSA015016\",\"PLSSA015021\",\"PLSSA015032\",\"PLSSA015044\",\"PLSSA015056\",\"PLSSA015061\",\"PLSSA015085\",\"PLSSA015090\",\"PLSSA015102\",\"PLSSA015114\",\"PLSSA015126\",\"PLSSA015131\",\"PLSSA015143\",\"PLSSA015155\",\"PLSSA015160\",\"PLSSA015172\",\"PLSSA015184\",\"PLSSA015196\",\"PLSSA015201\",\"PLSSA015213\",\"PLSSA015225\",\"PLSSA015230\",\"PLSSA015242\",\"PLSSA015254\",\"PLSSA015266\",\"PLSSA015271\",\"PLSSA015283\",\"PLSSA015295\",\"PLSSA015300\",\"PLSSA015312\",\"PLSSA015324\",\"PLSSA015336\",\"PLSSA015341\",\"PLSSA015353\",\"PLSSA015365\",\"PLSSA015370\",\"PLSSA015382\",\"PLSSA015394\",\"PLSSA015406\",\"PLSSA015411\",\"PLSSA015423\",\"PLSSA015435\",\"PLSSA015440\",\"PLSSA015452\",\"PLSSA015464\",\"PLSSA015476\",\"PLSSA015481\",\"PLSSA015493\",\"PLSSA015505\",\"PLSSA015510\",\"PLSSA015522\",\"PLSSA015534\",\"PLSSA015546\",\"PLSSA015551\",\"PLSSA015563\",\"PLSSA015575\",\"PLSSA015580\",\"PLSSA015592\",\"PLSSA015604\",\"PLSSA015616\",\"PLSSA015621\",\"PLSSA015633\",\"PLSSA015645\",\"PLSSA015650\",\"PLSSA015662\",\"PLSSA015674\",\"PLSSA015686\",\"PLSSA015691\",\"PLSSA015703\",\"PLSSA015715\",\"PLSSA015720\",\"PLSSA015732\",\"PLSSA015744\",\"PLSSA015756\",\"PLSSA015761\",\"PLSSA015773\",\"PLSSA015785\",\"PLSSA015790\",\"PLSSA015802\",\"PLSSA015814\",\"PLSSA015826\",\"PLSSA015831\",\"PLSSA015843\",\"PLSSA015855\",\"PLSSA015860\",\"PLSSA015872\",\"PLSSA015884\",\"PLSSA015896\",\"PLSSA015901\",\"PLSSA015913\",\"PLSSA015925\",\"PLSSA015930\",\"PLSSA015942\",\"PLSSA015954\",\"PLSSA015966\",\"PLSSA015971\",\"PLSSA015983\",\"PLSSA015995\",\"PLSSA016000\",\"PLSSA016012\",\"PLSSA016024\",\"PLSSA016036\",\"PLSSA016041\",\"PLSSA016053\",\"PLSSA016065\",\"PLSSA016070\",\"PLSSA016082\",\"PLSSA016094\",\"PLSSA016106\",\"PLSSA016111\",\"PLSSA016123\",\"PLSSA016135\",\"PLSSA016140\",\"PLSSA016152\",\"PLSSA016164\",\"PLSSA016176\",\"PLSSA016181\",\"PLSSA016193\",\"PLSSA016205\",\"PLSSA016210\",\"PLSSA016222\",\"PLSSA016234\",\"PLSSA016246\",\"PLSSA016251\",\"PLSSA016263\",\"PLSSA016275\",\"PLSSA016280\",\"PLSSA016292\",\"PLSSA016304\",\"PLSSA016316\",\"PLSSA016321\",\"PLSSA016333\",\"PLSSA016345\",\"PLSSA016350\",\"PLSSA016362\",\"PLSSA016374\",\"PLSSA016386\",\"PLSSA016391\",\"PLSSA016403\",\"PLSSA016415\",\"PLSSA016420\",\"PLSSA016432\",\"PLSSA016444\",\"PLSSA016456\",\"PLSSA016461\",\"PLSSA016473\",\"PLSSA016485\",\"PLSSA016490\",\"PLSSA016502\",\"PLSSA016514\",\"PLSSA016526\",\"PLSSA016531\",\"PLSSA016543\",\"PLSSA016555\",\"PLSSA016560\",\"PLSSA016572\",\"PLSSA016584\",\"PLSSA016596\",\"PLSSA016601\",\"PLSSA016613\",\"PLSSA016625\",\"PLSSA016630\",\"PLSSA016642\",\"PLSSA016654\",\"PLSSA016666\",\"PLSSA016671\",\"PLSSA016683\",\"PLSSA016695\",\"PLSSA016700\",\"PLSSA016712\",\"PLSSA016724\",\"PLSSA016736\",\"PLSSA016741\",\"PLSSA016753\",\"PLSSA016765\",\"PLSSA016770\",\"PLSSA016782\",\"PLSSA016794\",\"PLSSA016806\",\"PLSSA016811\",\"PLSSA016823\",\"PLSSA016835\",\"PLSSA016840\",\"PLSSA016852\",\"PLSSA016864\",\"PLSSA016876\",\"PLSSA016881\",\"PLSSA016893\",\"PLSSA016905\",\"PLSSA016910\",\"PLSSA016922\",\"PLSSA016934\",\"PLSSA016946\",\"PLSSA016951\",\"PLSSA016963\",\"PLSSA016975\",\"PLSSA016980\",\"PLSSA016992\",\"PLSSA017004\",\"PLSSA017016\");\n} //fin de if($IdEstado == \"21\")\n\n//Condicion de estado-clues\nif($IdEstado == \"22\"){\n\t$Clues = array(\"QTSSA000014\",\"QTSSA000031\",\"QTSSA000043\",\"QTSSA000055\",\"QTSSA000060\",\"QTSSA000072\",\"QTSSA000084\",\"QTSSA000096\",\"QTSSA000101\",\"QTSSA000113\",\"QTSSA000125\",\"QTSSA000130\",\"QTSSA000142\",\"QTSSA000166\",\"QTSSA000171\",\"QTSSA000183\",\"QTSSA000200\",\"QTSSA000212\",\"QTSSA000236\",\"QTSSA000253\",\"QTSSA000282\",\"QTSSA000294\",\"QTSSA000311\",\"QTSSA000323\",\"QTSSA000352\",\"QTSSA000364\",\"QTSSA000376\",\"QTSSA000405\",\"QTSSA000434\",\"QTSSA000446\",\"QTSSA000463\",\"QTSSA000475\",\"QTSSA000480\",\"QTSSA000492\",\"QTSSA000516\",\"QTSSA000521\",\"QTSSA000533\",\"QTSSA000545\",\"QTSSA000550\",\"QTSSA000562\",\"QTSSA000574\",\"QTSSA000586\",\"QTSSA000591\",\"QTSSA000603\",\"QTSSA000615\",\"QTSSA000620\",\"QTSSA000632\",\"QTSSA000644\",\"QTSSA000656\",\"QTSSA000673\",\"QTSSA000685\",\"QTSSA000714\",\"QTSSA000726\",\"QTSSA000731\",\"QTSSA000755\",\"QTSSA000760\",\"QTSSA000772\",\"QTSSA000784\",\"QTSSA000796\",\"QTSSA000830\",\"QTSSA000842\",\"QTSSA000854\",\"QTSSA000866\",\"QTSSA000871\",\"QTSSA000883\",\"QTSSA000895\",\"QTSSA000912\",\"QTSSA000924\",\"QTSSA000936\",\"QTSSA000941\",\"QTSSA000953\",\"QTSSA000970\",\"QTSSA000982\",\"QTSSA000994\",\"QTSSA001006\",\"QTSSA001011\",\"QTSSA001023\",\"QTSSA001035\",\"QTSSA001040\",\"QTSSA001052\",\"QTSSA001064\",\"QTSSA001076\",\"QTSSA001093\",\"QTSSA001105\",\"QTSSA001110\",\"QTSSA001122\",\"QTSSA001134\",\"QTSSA001146\",\"QTSSA001151\",\"QTSSA001163\",\"QTSSA001175\",\"QTSSA001192\",\"QTSSA001204\",\"QTSSA001216\",\"QTSSA001221\",\"QTSSA001233\",\"QTSSA001245\",\"QTSSA001250\",\"QTSSA001274\",\"QTSSA001286\",\"QTSSA001291\",\"QTSSA001303\",\"QTSSA001315\",\"QTSSA001332\",\"QTSSA001344\",\"QTSSA001356\",\"QTSSA001373\",\"QTSSA001390\",\"QTSSA001402\",\"QTSSA001414\",\"QTSSA001426\",\"QTSSA001431\",\"QTSSA001443\",\"QTSSA001460\",\"QTSSA001472\",\"QTSSA001484\",\"QTSSA001496\",\"QTSSA001501\",\"QTSSA001513\",\"QTSSA001525\",\"QTSSA001530\",\"QTSSA001542\",\"QTSSA001554\",\"QTSSA001566\",\"QTSSA001583\",\"QTSSA001595\",\"QTSSA001600\",\"QTSSA001612\",\"QTSSA001624\",\"QTSSA001636\",\"QTSSA001641\",\"QTSSA001653\",\"QTSSA001665\",\"QTSSA001682\",\"QTSSA001694\",\"QTSSA001706\",\"QTSSA001711\",\"QTSSA001723\",\"QTSSA001735\",\"QTSSA001740\",\"QTSSA001752\",\"QTSSA001764\",\"QTSSA001793\",\"QTSSA001805\",\"QTSSA001810\",\"QTSSA001822\",\"QTSSA001834\",\"QTSSA001846\",\"QTSSA001863\",\"QTSSA001875\",\"QTSSA001880\",\"QTSSA001904\",\"QTSSA001916\",\"QTSSA001921\",\"QTSSA001933\",\"QTSSA001945\",\"QTSSA001962\",\"QTSSA001974\",\"QTSSA002003\",\"QTSSA002015\",\"QTSSA002020\",\"QTSSA002044\",\"QTSSA002061\",\"QTSSA002073\",\"QTSSA002085\",\"QTSSA002090\",\"QTSSA002102\",\"QTSSA002114\",\"QTSSA002160\",\"QTSSA002172\",\"QTSSA002184\",\"QTSSA002196\",\"QTSSA002213\",\"QTSSA002225\",\"QTSSA002230\",\"QTSSA002242\",\"QTSSA002266\",\"QTSSA002271\",\"QTSSA002283\",\"QTSSA002300\",\"QTSSA002312\",\"QTSSA002324\",\"QTSSA002336\",\"QTSSA002341\",\"QTSSA002353\",\"QTSSA002370\",\"QTSSA002382\",\"QTSSA002394\",\"QTSSA002406\",\"QTSSA002411\",\"QTSSA002435\",\"QTSSA002452\",\"QTSSA002464\",\"QTSSA002476\",\"QTSSA002481\",\"QTSSA002493\",\"QTSSA002505\",\"QTSSA002522\",\"QTSSA002534\",\"QTSSA002546\",\"QTSSA002551\",\"QTSSA012101\",\"QTSSA012113\",\"QTSSA012125\",\"QTSSA012130\",\"QTSSA012142\",\"QTSSA012154\",\"QTSSA012166\",\"QTSSA012171\",\"QTSSA012183\",\"QTSSA012195\",\"QTSSA012200\",\"QTSSA012212\",\"QTSSA012224\",\"QTSSA012236\",\"QTSSA012240\",\"QTSSA012252\",\"QTSSA012264\",\"QTSSA012276\",\"QTSSA012281\",\"QTSSA012293\",\"QTSSA012305\",\"QTSSA012310\",\"QTSSA012322\",\"QTSSA012334\",\"QTSSA012346\",\"QTSSA012351\",\"QTSSA012363\",\"QTSSA012380\",\"QTSSA012392\",\"QTSSA012404\",\"QTSSA012416\",\"QTSSA012421\",\"QTSSA012433\",\"QTSSA012445\",\"QTSSA012450\",\"QTSSA012462\",\"QTSSA012474\",\"QTSSA012486\",\"QTSSA012491\",\"QTSSA012503\",\"QTSSA012515\",\"QTSSA012520\",\"QTSSA012532\",\"QTSSA012544\",\"QTSSA012556\",\"QTSSA012561\",\"QTSSA012573\",\"QTSSA012585\",\"QTSSA012590\",\"QTSSA012602\",\"QTSSA012614\",\"QTSSA012626\",\"QTSSA012631\",\"QTSSA012643\",\"QTSSA012655\",\"QTSSA012660\",\"QTSSA012672\",\"QTSSA012684\",\"QTSSA012696\",\"QTSSA012725\",\"QTSSA012730\",\"QTSSA012742\",\"QTSSA012754\",\"QTSSA012766\",\"QTSSA012771\",\"QTSSA012783\",\"QTSSA012795\",\"QTSSA012800\",\"QTSSA012812\",\"QTSSA012824\",\"QTSSA012836\",\"QTSSA012841\",\"QTSSA012853\",\"QTSSA012865\",\"QTSSA012870\",\"QTSSA012882\",\"QTSSA012894\",\"QTSSA012906\",\"QTSSA012911\",\"QTSSA012923\",\"QTSSA012935\",\"QTSSA012940\",\"QTSSA012952\",\"QTSSA012964\");\n} //fin de if($IdEstado == \"22\")\n\n//Condicion de estado-clues\nif($IdEstado == \"23\"){\n\t$Clues = array(\"QRSSA000011\",\"QRSSA000023\",\"QRSSA000035\",\"QRSSA000040\",\"QRSSA000052\",\"QRSSA000064\",\"QRSSA000076\",\"QRSSA000081\",\"QRSSA000093\",\"QRSSA000105\",\"QRSSA000110\",\"QRSSA000122\",\"QRSSA000134\",\"QRSSA000146\",\"QRSSA000151\",\"QRSSA000163\",\"QRSSA000175\",\"QRSSA000180\",\"QRSSA000192\",\"QRSSA000204\",\"QRSSA000233\",\"QRSSA000245\",\"QRSSA000250\",\"QRSSA000262\",\"QRSSA000274\",\"QRSSA000286\",\"QRSSA000291\",\"QRSSA000303\",\"QRSSA000315\",\"QRSSA000320\",\"QRSSA000332\",\"QRSSA000344\",\"QRSSA000356\",\"QRSSA000361\",\"QRSSA000373\",\"QRSSA000390\",\"QRSSA000402\",\"QRSSA000414\",\"QRSSA000426\",\"QRSSA000431\",\"QRSSA000443\",\"QRSSA000455\",\"QRSSA000460\",\"QRSSA000472\",\"QRSSA000484\",\"QRSSA000496\",\"QRSSA000501\",\"QRSSA000525\",\"QRSSA000530\",\"QRSSA000542\",\"QRSSA000554\",\"QRSSA000566\",\"QRSSA000571\",\"QRSSA000583\",\"QRSSA000595\",\"QRSSA000600\",\"QRSSA000612\",\"QRSSA000624\",\"QRSSA000636\",\"QRSSA000641\",\"QRSSA000653\",\"QRSSA000665\",\"QRSSA000670\",\"QRSSA000682\",\"QRSSA000694\",\"QRSSA000706\",\"QRSSA000711\",\"QRSSA000723\",\"QRSSA000735\",\"QRSSA000740\",\"QRSSA000752\",\"QRSSA000764\",\"QRSSA000776\",\"QRSSA000781\",\"QRSSA000793\",\"QRSSA000805\",\"QRSSA000810\",\"QRSSA000822\",\"QRSSA000834\",\"QRSSA000846\",\"QRSSA000851\",\"QRSSA000863\",\"QRSSA000875\",\"QRSSA000880\",\"QRSSA000904\",\"QRSSA000916\",\"QRSSA000933\",\"QRSSA000945\",\"QRSSA000950\",\"QRSSA000962\",\"QRSSA000974\",\"QRSSA000986\",\"QRSSA000991\",\"QRSSA001003\",\"QRSSA001020\",\"QRSSA001044\",\"QRSSA001056\",\"QRSSA001061\",\"QRSSA001073\",\"QRSSA001085\",\"QRSSA001102\",\"QRSSA001114\",\"QRSSA001126\",\"QRSSA001131\",\"QRSSA001143\",\"QRSSA001155\",\"QRSSA001160\",\"QRSSA001172\",\"QRSSA001184\",\"QRSSA001196\",\"QRSSA001201\",\"QRSSA001213\",\"QRSSA001225\",\"QRSSA001230\",\"QRSSA001300\",\"QRSSA001411\",\"QRSSA001423\",\"QRSSA001435\",\"QRSSA001440\",\"QRSSA001452\",\"QRSSA001464\",\"QRSSA001476\",\"QRSSA001481\",\"QRSSA001493\",\"QRSSA001505\",\"QRSSA001510\",\"QRSSA001522\",\"QRSSA001534\",\"QRSSA001546\",\"QRSSA001551\",\"QRSSA001563\",\"QRSSA001575\",\"QRSSA001580\",\"QRSSA001592\",\"QRSSA001650\",\"QRSSA001662\",\"QRSSA001674\",\"QRSSA001715\",\"QRSSA001720\",\"QRSSA001732\",\"QRSSA017470\",\"QRSSA017482\",\"QRSSA017494\",\"QRSSA017506\",\"QRSSA017523\",\"QRSSA017535\",\"QRSSA017552\",\"QRSSA017564\",\"QRSSA017576\",\"QRSSA017581\",\"QRSSA017593\",\"QRSSA017605\",\"QRSSA017610\",\"QRSSA017622\",\"QRSSA017634\",\"QRSSA017646\",\"QRSSA017651\",\"QRSSA017663\",\"QRSSA017675\",\"QRSSA017680\",\"QRSSA017692\",\"QRSSA017704\",\"QRSSA017716\",\"QRSSA017721\",\"QRSSA017733\",\"QRSSA017745\",\"QRSSA017750\",\"QRSSA017762\",\"QRSSA017774\",\"QRSSA017786\",\"QRSSA017791\",\"QRSSA017803\",\"QRSSA017815\",\"QRSSA017820\",\"QRSSA017832\",\"QRSSA017844\",\"QRSSA017861\",\"QRSSA017873\",\"QRSSA017885\",\"QRSSA017890\",\"QRSSA017902\",\"QRSSA017914\",\"QRSSA017926\",\"QRSSA017931\",\"QRSSA017943\",\"QRSSA017955\",\"QRSSA017960\",\"QRSSA017972\",\"QRSSA017984\",\"QRSSA017996\",\"QRSSA018001\",\"QRSSA018013\",\"QRSSA018025\",\"QRSSA018030\",\"QRSSA018042\",\"QRSSA018054\");\n} //fin de if($IdEstado == \"23\")\n\n//Condicion de estado-clues\nif($IdEstado == \"24\"){\n\t$Clues = array(\"SPSSA000011\",\"SPSSA000023\",\"SPSSA000035\",\"SPSSA000040\",\"SPSSA000052\",\"SPSSA000064\",\"SPSSA000076\",\"SPSSA000081\",\"SPSSA000093\",\"SPSSA000105\",\"SPSSA000110\",\"SPSSA000122\",\"SPSSA000134\",\"SPSSA000146\",\"SPSSA000151\",\"SPSSA000163\",\"SPSSA000175\",\"SPSSA000180\",\"SPSSA000192\",\"SPSSA000204\",\"SPSSA000216\",\"SPSSA000221\",\"SPSSA000233\",\"SPSSA000245\",\"SPSSA000250\",\"SPSSA000262\",\"SPSSA000274\",\"SPSSA000286\",\"SPSSA000291\",\"SPSSA000303\",\"SPSSA000315\",\"SPSSA000320\",\"SPSSA000332\",\"SPSSA000344\",\"SPSSA000356\",\"SPSSA000361\",\"SPSSA000373\",\"SPSSA000385\",\"SPSSA000390\",\"SPSSA000402\",\"SPSSA000414\",\"SPSSA000426\",\"SPSSA000431\",\"SPSSA000455\",\"SPSSA000460\",\"SPSSA000472\",\"SPSSA000484\",\"SPSSA000496\",\"SPSSA000501\",\"SPSSA000513\",\"SPSSA000525\",\"SPSSA000530\",\"SPSSA000542\",\"SPSSA000554\",\"SPSSA000566\",\"SPSSA000571\",\"SPSSA000583\",\"SPSSA000595\",\"SPSSA000600\",\"SPSSA000612\",\"SPSSA000624\",\"SPSSA000636\",\"SPSSA000641\",\"SPSSA000653\",\"SPSSA000665\",\"SPSSA000670\",\"SPSSA000682\",\"SPSSA000694\",\"SPSSA000706\",\"SPSSA000711\",\"SPSSA000723\",\"SPSSA000735\",\"SPSSA000740\",\"SPSSA000752\",\"SPSSA000764\",\"SPSSA000776\",\"SPSSA000781\",\"SPSSA000793\",\"SPSSA000805\",\"SPSSA000810\",\"SPSSA000822\",\"SPSSA000834\",\"SPSSA000846\",\"SPSSA000851\",\"SPSSA000863\",\"SPSSA000875\",\"SPSSA000880\",\"SPSSA000892\",\"SPSSA000904\",\"SPSSA000921\",\"SPSSA000933\",\"SPSSA000945\",\"SPSSA000950\",\"SPSSA000962\",\"SPSSA000974\",\"SPSSA000986\",\"SPSSA000991\",\"SPSSA001003\",\"SPSSA001015\",\"SPSSA001020\",\"SPSSA001032\",\"SPSSA001044\",\"SPSSA001056\",\"SPSSA001061\",\"SPSSA001073\",\"SPSSA001085\",\"SPSSA001102\",\"SPSSA001114\",\"SPSSA001126\",\"SPSSA001143\",\"SPSSA001160\",\"SPSSA001172\",\"SPSSA001184\",\"SPSSA001196\",\"SPSSA001201\",\"SPSSA001213\",\"SPSSA001225\",\"SPSSA001230\",\"SPSSA001242\",\"SPSSA001254\",\"SPSSA001266\",\"SPSSA001271\",\"SPSSA001283\",\"SPSSA001295\",\"SPSSA001300\",\"SPSSA001312\",\"SPSSA001324\",\"SPSSA001336\",\"SPSSA001341\",\"SPSSA001353\",\"SPSSA001365\",\"SPSSA001370\",\"SPSSA001382\",\"SPSSA001394\",\"SPSSA001406\",\"SPSSA001411\",\"SPSSA001423\",\"SPSSA001435\",\"SPSSA001440\",\"SPSSA001452\",\"SPSSA001464\",\"SPSSA001476\",\"SPSSA001481\",\"SPSSA001493\",\"SPSSA001505\",\"SPSSA001510\",\"SPSSA001522\",\"SPSSA001534\",\"SPSSA001551\",\"SPSSA001563\",\"SPSSA001575\",\"SPSSA001592\",\"SPSSA001604\",\"SPSSA001616\",\"SPSSA001621\",\"SPSSA001633\",\"SPSSA001645\",\"SPSSA001650\",\"SPSSA001662\",\"SPSSA001674\",\"SPSSA001686\",\"SPSSA001691\",\"SPSSA001703\",\"SPSSA001720\",\"SPSSA001732\",\"SPSSA001756\",\"SPSSA001761\",\"SPSSA001773\",\"SPSSA001785\",\"SPSSA001802\",\"SPSSA001814\",\"SPSSA001826\",\"SPSSA001831\",\"SPSSA001843\",\"SPSSA001855\",\"SPSSA001860\",\"SPSSA001872\",\"SPSSA001884\",\"SPSSA001896\",\"SPSSA001901\",\"SPSSA001913\",\"SPSSA001925\",\"SPSSA001930\",\"SPSSA001942\",\"SPSSA001954\",\"SPSSA001971\",\"SPSSA001983\",\"SPSSA001995\",\"SPSSA002000\",\"SPSSA002012\",\"SPSSA002024\",\"SPSSA002036\",\"SPSSA002041\",\"SPSSA002053\",\"SPSSA002065\",\"SPSSA002070\",\"SPSSA002082\",\"SPSSA002094\",\"SPSSA002106\",\"SPSSA002111\",\"SPSSA002123\",\"SPSSA002135\",\"SPSSA002140\",\"SPSSA002152\",\"SPSSA002164\",\"SPSSA002176\",\"SPSSA002181\",\"SPSSA002193\",\"SPSSA002205\",\"SPSSA002210\",\"SPSSA002222\",\"SPSSA002234\",\"SPSSA002246\",\"SPSSA002251\",\"SPSSA002263\",\"SPSSA002275\",\"SPSSA002280\",\"SPSSA002292\",\"SPSSA002304\",\"SPSSA002316\",\"SPSSA002321\",\"SPSSA002333\",\"SPSSA002345\",\"SPSSA002350\",\"SPSSA002362\",\"SPSSA002374\",\"SPSSA002386\",\"SPSSA002391\",\"SPSSA002403\",\"SPSSA002415\",\"SPSSA002420\",\"SPSSA002432\",\"SPSSA002444\",\"SPSSA002456\",\"SPSSA002461\",\"SPSSA002473\",\"SPSSA002485\",\"SPSSA002490\",\"SPSSA002502\",\"SPSSA002514\",\"SPSSA002526\",\"SPSSA002531\",\"SPSSA002543\",\"SPSSA002555\",\"SPSSA002560\",\"SPSSA002572\",\"SPSSA002584\",\"SPSSA002596\",\"SPSSA002601\",\"SPSSA002613\",\"SPSSA002625\",\"SPSSA002630\",\"SPSSA002642\",\"SPSSA002654\",\"SPSSA002666\",\"SPSSA002671\",\"SPSSA002683\",\"SPSSA002695\",\"SPSSA002700\",\"SPSSA002712\",\"SPSSA002724\",\"SPSSA002736\",\"SPSSA002741\",\"SPSSA002753\",\"SPSSA002765\",\"SPSSA002770\",\"SPSSA002782\",\"SPSSA002794\",\"SPSSA002806\",\"SPSSA002811\",\"SPSSA002823\",\"SPSSA002835\",\"SPSSA002840\",\"SPSSA002852\",\"SPSSA002864\",\"SPSSA002876\",\"SPSSA002881\",\"SPSSA002893\",\"SPSSA002905\",\"SPSSA002910\",\"SPSSA002922\",\"SPSSA002951\",\"SPSSA002963\",\"SPSSA002975\",\"SPSSA016823\",\"SPSSA016835\",\"SPSSA016841\",\"SPSSA016853\",\"SPSSA016865\",\"SPSSA016870\",\"SPSSA016882\",\"SPSSA016894\",\"SPSSA016906\",\"SPSSA016911\",\"SPSSA016923\",\"SPSSA016935\",\"SPSSA016940\",\"SPSSA016952\",\"SPSSA016964\",\"SPSSA016976\",\"SPSSA016981\",\"SPSSA016993\",\"SPSSA017005\",\"SPSSA017010\",\"SPSSA017022\",\"SPSSA017034\",\"SPSSA017046\",\"SPSSA017051\",\"SPSSA017062\",\"SPSSA017074\",\"SPSSA017086\",\"SPSSA017091\",\"SPSSA017103\",\"SPSSA017115\",\"SPSSA017120\",\"SPSSA017132\",\"SPSSA017144\",\"SPSSA017156\",\"SPSSA017161\",\"SPSSA017173\",\"SPSSA017185\",\"SPSSA017190\",\"SPSSA017202\",\"SPSSA017214\",\"SPSSA017226\",\"SPSSA017231\",\"SPSSA017243\",\"SPSSA017255\",\"SPSSA017260\",\"SPSSA017272\",\"SPSSA017284\",\"SPSSA017296\",\"SPSSA017301\",\"SPSSA017313\",\"SPSSA017325\",\"SPSSA017330\",\"SPSSA017342\",\"SPSSA017354\",\"SPSSA017366\",\"SPSSA017371\",\"SPSSA017383\",\"SPSSA017395\",\"SPSSA017400\",\"SPSSA017412\",\"SPSSA017424\",\"SPSSA017436\",\"SPSSA017441\",\"SPSSA017453\",\"SPSSA017465\",\"SPSSA017470\",\"SPSSA017482\",\"SPSSA017494\",\"SPSSA017506\",\"SPSSA017511\",\"SPSSA017523\",\"SPSSA017535\",\"SPSSA017540\");\n} //fin de if($IdEstado == \"24\")\n\n//Condicion de estado-clues\nif($IdEstado == \"25\"){\n\t$Clues = array(\"SLSSA000024\",\"SLSSA000036\",\"SLSSA000041\",\"SLSSA000053\",\"SLSSA000065\",\"SLSSA000070\",\"SLSSA000082\",\"SLSSA000094\",\"SLSSA000106\",\"SLSSA000111\",\"SLSSA000123\",\"SLSSA000135\",\"SLSSA000140\",\"SLSSA000152\",\"SLSSA000164\",\"SLSSA000176\",\"SLSSA000181\",\"SLSSA000193\",\"SLSSA000205\",\"SLSSA000210\",\"SLSSA000222\",\"SLSSA000234\",\"SLSSA000246\",\"SLSSA000251\",\"SLSSA000263\",\"SLSSA000275\",\"SLSSA000280\",\"SLSSA000292\",\"SLSSA000304\",\"SLSSA000316\",\"SLSSA000321\",\"SLSSA000333\",\"SLSSA000345\",\"SLSSA000350\",\"SLSSA000362\",\"SLSSA000374\",\"SLSSA000386\",\"SLSSA000391\",\"SLSSA000403\",\"SLSSA000415\",\"SLSSA000420\",\"SLSSA000432\",\"SLSSA000444\",\"SLSSA000456\",\"SLSSA000473\",\"SLSSA000485\",\"SLSSA000490\",\"SLSSA000502\",\"SLSSA000514\",\"SLSSA000526\",\"SLSSA000531\",\"SLSSA000543\",\"SLSSA000555\",\"SLSSA000560\",\"SLSSA000572\",\"SLSSA000584\",\"SLSSA000596\",\"SLSSA000601\",\"SLSSA000613\",\"SLSSA000625\",\"SLSSA000630\",\"SLSSA000642\",\"SLSSA000666\",\"SLSSA000671\",\"SLSSA000683\",\"SLSSA000695\",\"SLSSA000700\",\"SLSSA000712\",\"SLSSA000724\",\"SLSSA000736\",\"SLSSA000741\",\"SLSSA000753\",\"SLSSA000765\",\"SLSSA000770\",\"SLSSA000782\",\"SLSSA000794\",\"SLSSA000806\",\"SLSSA000811\",\"SLSSA000823\",\"SLSSA000835\",\"SLSSA000840\",\"SLSSA000852\",\"SLSSA000864\",\"SLSSA000876\",\"SLSSA000881\",\"SLSSA000893\",\"SLSSA000905\",\"SLSSA000910\",\"SLSSA000922\",\"SLSSA000934\",\"SLSSA000946\",\"SLSSA000951\",\"SLSSA000963\",\"SLSSA000980\",\"SLSSA000992\",\"SLSSA001004\",\"SLSSA001016\",\"SLSSA001021\",\"SLSSA001033\",\"SLSSA001045\",\"SLSSA001050\",\"SLSSA001062\",\"SLSSA001074\",\"SLSSA001086\",\"SLSSA001091\",\"SLSSA001103\",\"SLSSA001115\",\"SLSSA001120\",\"SLSSA001132\",\"SLSSA001144\",\"SLSSA001156\",\"SLSSA001161\",\"SLSSA001173\",\"SLSSA001185\",\"SLSSA001190\",\"SLSSA001202\",\"SLSSA001214\",\"SLSSA001226\",\"SLSSA001255\",\"SLSSA001260\",\"SLSSA001272\",\"SLSSA001284\",\"SLSSA001296\",\"SLSSA001301\",\"SLSSA001313\",\"SLSSA001325\",\"SLSSA001330\",\"SLSSA001342\",\"SLSSA001354\",\"SLSSA001366\",\"SLSSA001371\",\"SLSSA001383\",\"SLSSA001395\",\"SLSSA001400\",\"SLSSA001412\",\"SLSSA001424\",\"SLSSA001436\",\"SLSSA001441\",\"SLSSA001453\",\"SLSSA001465\",\"SLSSA001470\",\"SLSSA001482\",\"SLSSA001494\",\"SLSSA001506\",\"SLSSA001511\",\"SLSSA001523\",\"SLSSA001540\",\"SLSSA001552\",\"SLSSA001564\",\"SLSSA001576\",\"SLSSA001581\",\"SLSSA001593\",\"SLSSA001605\",\"SLSSA001610\",\"SLSSA001622\",\"SLSSA001634\",\"SLSSA001646\",\"SLSSA001651\",\"SLSSA001663\",\"SLSSA001675\",\"SLSSA001680\",\"SLSSA001692\",\"SLSSA001704\",\"SLSSA001716\",\"SLSSA001721\",\"SLSSA001733\",\"SLSSA001745\",\"SLSSA001750\",\"SLSSA001762\",\"SLSSA001774\",\"SLSSA001786\",\"SLSSA001791\",\"SLSSA001803\",\"SLSSA001815\",\"SLSSA001820\",\"SLSSA001832\",\"SLSSA001844\",\"SLSSA001856\",\"SLSSA001861\",\"SLSSA001873\",\"SLSSA001885\",\"SLSSA001902\",\"SLSSA001914\",\"SLSSA001926\",\"SLSSA001931\",\"SLSSA001943\",\"SLSSA001955\",\"SLSSA001960\",\"SLSSA001972\",\"SLSSA001984\",\"SLSSA001996\",\"SLSSA002001\",\"SLSSA002013\",\"SLSSA002025\",\"SLSSA002030\",\"SLSSA002042\",\"SLSSA002054\",\"SLSSA002066\",\"SLSSA002071\",\"SLSSA002083\",\"SLSSA002095\",\"SLSSA002100\",\"SLSSA002112\",\"SLSSA002124\",\"SLSSA002136\",\"SLSSA002141\",\"SLSSA002153\",\"SLSSA002165\",\"SLSSA002170\",\"SLSSA002182\",\"SLSSA002194\",\"SLSSA002206\",\"SLSSA002211\",\"SLSSA002223\",\"SLSSA002235\",\"SLSSA002240\",\"SLSSA002252\",\"SLSSA002264\",\"SLSSA002276\",\"SLSSA002281\",\"SLSSA002293\",\"SLSSA002305\",\"SLSSA002310\",\"SLSSA002351\",\"SLSSA002363\",\"SLSSA002380\",\"SLSSA002392\",\"SLSSA002404\",\"SLSSA002416\",\"SLSSA002445\",\"SLSSA002450\",\"SLSSA002462\",\"SLSSA002474\",\"SLSSA002486\",\"SLSSA002491\",\"SLSSA002503\",\"SLSSA002515\",\"SLSSA002532\",\"SLSSA002544\",\"SLSSA017273\",\"SLSSA017285\",\"SLSSA017314\",\"SLSSA017320\",\"SLSSA017332\",\"SLSSA017344\",\"SLSSA017356\",\"SLSSA017361\",\"SLSSA017373\",\"SLSSA017385\",\"SLSSA017390\",\"SLSSA017402\",\"SLSSA017414\",\"SLSSA017426\",\"SLSSA017431\",\"SLSSA017443\",\"SLSSA017455\",\"SLSSA017460\",\"SLSSA017472\",\"SLSSA017484\",\"SLSSA017496\",\"SLSSA017501\",\"SLSSA017513\",\"SLSSA017524\",\"SLSSA017536\",\"SLSSA017541\",\"SLSSA017553\",\"SLSSA017565\",\"SLSSA017570\",\"SLSSA017582\",\"SLSSA017594\",\"SLSSA017606\",\"SLSSA017611\",\"SLSSA017623\",\"SLSSA017635\",\"SLSSA017640\",\"SLSSA017652\",\"SLSSA017664\",\"SLSSA017676\",\"SLSSA017681\",\"SLSSA017693\",\"SLSSA017705\",\"SLSSA017710\",\"SLSSA017722\",\"SLSSA017734\",\"SLSSA017746\",\"SLSSA017751\",\"SLSSA017763\",\"SLSSA017775\",\"SLSSA017780\",\"SLSSA017792\",\"SLSSA017804\",\"SLSSA017816\",\"SLSSA017821\",\"SLSSA017833\",\"SLSSA017845\",\"SLSSA017850\",\"SLSSA017862\",\"SLSSA017874\",\"SLSSA017886\",\"SLSSA017891\",\"SLSSA017903\",\"SLSSA017944\",\"SLSSA017956\",\"SLSSA017961\",\"SLSSA017973\",\"SLSSA017985\",\"SLSSA017990\",\"SLSSA018002\",\"SLSSA018014\",\"SLSSA018026\",\"SLSSA018031\",\"SLSSA018043\",\"SLSSA018055\",\"SLSSA018060\",\"SLSSA018072\",\"SLSSA018084\",\"SLSSA018096\",\"SLSSA018101\",\"SLSSA018113\",\"SLSSA018125\",\"SLSSA018130\",\"SLSSA018142\",\"SLSSA018154\",\"SLSSA018166\",\"SLSSA018183\",\"SLSSA018195\",\"SLSSA018200\",\"SLSSA018212\",\"SLSSA018224\",\"SLSSA018236\",\"SLSSA018241\",\"SLSSA018253\",\"SLSSA018265\",\"SLSSA018270\",\"SLSSA018282\",\"SLSSA018294\",\"SLSSA018306\",\"SLSSA018311\",\"SLSSA018323\",\"SLSSA018335\",\"SLSSA018340\",\"SLSSA018352\",\"SLSSA018364\",\"SLSSA018376\",\"SLSSA018381\",\"SLSSA018393\",\"SLSSA018405\",\"SLSSA018410\",\"SLSSA018422\",\"SLSSA018446\");\n} //fin de if($IdEstado == \"25\")\n\n//Condicion de estado-clues\nif($IdEstado == \"26\"){\n\t$Clues = array(\"SRSSA000014\",\"SRSSA000026\",\"SRSSA000043\",\"SRSSA000055\",\"SRSSA000060\",\"SRSSA000072\",\"SRSSA000084\",\"SRSSA000096\",\"SRSSA000101\",\"SRSSA000113\",\"SRSSA000125\",\"SRSSA000130\",\"SRSSA000142\",\"SRSSA000154\",\"SRSSA000166\",\"SRSSA000171\",\"SRSSA000183\",\"SRSSA000195\",\"SRSSA000200\",\"SRSSA000212\",\"SRSSA000224\",\"SRSSA000236\",\"SRSSA000241\",\"SRSSA000253\",\"SRSSA000265\",\"SRSSA000270\",\"SRSSA000282\",\"SRSSA000294\",\"SRSSA000306\",\"SRSSA000311\",\"SRSSA000323\",\"SRSSA000335\",\"SRSSA000340\",\"SRSSA000352\",\"SRSSA000364\",\"SRSSA000376\",\"SRSSA000381\",\"SRSSA000393\",\"SRSSA000405\",\"SRSSA000410\",\"SRSSA000416\",\"SRSSA000434\",\"SRSSA000446\",\"SRSSA000451\",\"SRSSA000463\",\"SRSSA000475\",\"SRSSA000480\",\"SRSSA000492\",\"SRSSA000504\",\"SRSSA000521\",\"SRSSA000545\",\"SRSSA000550\",\"SRSSA000562\",\"SRSSA000574\",\"SRSSA000586\",\"SRSSA000591\",\"SRSSA000603\",\"SRSSA000615\",\"SRSSA000620\",\"SRSSA000632\",\"SRSSA000644\",\"SRSSA000656\",\"SRSSA000661\",\"SRSSA000673\",\"SRSSA000685\",\"SRSSA000690\",\"SRSSA000702\",\"SRSSA000714\",\"SRSSA000726\",\"SRSSA000731\",\"SRSSA000743\",\"SRSSA000755\",\"SRSSA000760\",\"SRSSA000772\",\"SRSSA000784\",\"SRSSA000796\",\"SRSSA000801\",\"SRSSA000813\",\"SRSSA000825\",\"SRSSA000830\",\"SRSSA000842\",\"SRSSA000854\",\"SRSSA000866\",\"SRSSA000871\",\"SRSSA000883\",\"SRSSA000895\",\"SRSSA000900\",\"SRSSA000912\",\"SRSSA000924\",\"SRSSA000936\",\"SRSSA000941\",\"SRSSA000953\",\"SRSSA000965\",\"SRSSA000970\",\"SRSSA000982\",\"SRSSA000994\",\"SRSSA001006\",\"SRSSA001011\",\"SRSSA001023\",\"SRSSA001035\",\"SRSSA001040\",\"SRSSA001052\",\"SRSSA001064\",\"SRSSA001081\",\"SRSSA001093\",\"SRSSA001105\",\"SRSSA001110\",\"SRSSA001122\",\"SRSSA001134\",\"SRSSA001146\",\"SRSSA001151\",\"SRSSA001163\",\"SRSSA001180\",\"SRSSA001192\",\"SRSSA001204\",\"SRSSA001216\",\"SRSSA001221\",\"SRSSA001233\",\"SRSSA001245\",\"SRSSA001250\",\"SRSSA001262\",\"SRSSA001274\",\"SRSSA001286\",\"SRSSA001291\",\"SRSSA001303\",\"SRSSA001315\",\"SRSSA001320\",\"SRSSA001332\",\"SRSSA001344\",\"SRSSA001356\",\"SRSSA001361\",\"SRSSA001385\",\"SRSSA001390\",\"SRSSA001402\",\"SRSSA001414\",\"SRSSA001426\",\"SRSSA001431\",\"SRSSA001443\",\"SRSSA001455\",\"SRSSA001460\",\"SRSSA001472\",\"SRSSA001484\",\"SRSSA001496\",\"SRSSA001501\",\"SRSSA001513\",\"SRSSA001525\",\"SRSSA001530\",\"SRSSA001542\",\"SRSSA001554\",\"SRSSA001566\",\"SRSSA001571\",\"SRSSA001583\",\"SRSSA001595\",\"SRSSA001600\",\"SRSSA001612\",\"SRSSA001624\",\"SRSSA001636\",\"SRSSA001641\",\"SRSSA001653\",\"SRSSA001665\",\"SRSSA001670\",\"SRSSA001682\",\"SRSSA001694\",\"SRSSA001706\",\"SRSSA001711\",\"SRSSA001723\",\"SRSSA001735\",\"SRSSA001740\",\"SRSSA001752\",\"SRSSA001764\",\"SRSSA001776\",\"SRSSA001781\",\"SRSSA001793\",\"SRSSA001805\",\"SRSSA001810\",\"SRSSA001822\",\"SRSSA001834\",\"SRSSA001846\",\"SRSSA001851\",\"SRSSA001863\",\"SRSSA001875\",\"SRSSA001880\",\"SRSSA001892\",\"SRSSA001904\",\"SRSSA001916\",\"SRSSA001921\",\"SRSSA001933\",\"SRSSA001945\",\"SRSSA001950\",\"SRSSA001962\",\"SRSSA001974\",\"SRSSA001986\",\"SRSSA001991\",\"SRSSA002003\",\"SRSSA002015\",\"SRSSA002020\",\"SRSSA002032\",\"SRSSA002044\",\"SRSSA002056\",\"SRSSA002061\",\"SRSSA002073\",\"SRSSA002085\",\"SRSSA002090\",\"SRSSA002102\",\"SRSSA002114\",\"SRSSA002126\",\"SRSSA002131\",\"SRSSA002143\",\"SRSSA002155\",\"SRSSA002160\",\"SRSSA002172\",\"SRSSA002184\",\"SRSSA002198\",\"SRSSA002201\",\"SRSSA002213\",\"SRSSA002225\",\"SRSSA002230\",\"SRSSA002242\",\"SRSSA002254\",\"SRSSA002266\",\"SRSSA002271\",\"SRSSA002283\",\"SRSSA002295\",\"SRSSA002300\",\"SRSSA002312\",\"SRSSA002324\",\"SRSSA002336\",\"SRSSA002341\",\"SRSSA002353\",\"SRSSA002365\",\"SRSSA002370\",\"SRSSA002382\",\"SRSSA002394\",\"SRSSA002406\",\"SRSSA002411\",\"SRSSA002423\",\"SRSSA002435\",\"SRSSA002440\",\"SRSSA002452\",\"SRSSA002464\",\"SRSSA002476\",\"SRSSA002481\",\"SRSSA002493\",\"SRSSA002505\",\"SRSSA002510\",\"SRSSA002551\",\"SRSSA002575\",\"SRSSA002580\",\"SRSSA002592\",\"SRSSA002604\",\"SRSSA002616\",\"SRSSA002621\",\"SRSSA002633\",\"SRSSA002645\",\"SRSSA002650\",\"SRSSA002662\",\"SRSSA002674\",\"SRSSA002686\",\"SRSSA002691\",\"SRSSA002703\",\"SRSSA002715\",\"SRSSA002720\",\"SRSSA002732\",\"SRSSA002744\",\"SRSSA002756\",\"SRSSA002773\",\"SRSSA002790\",\"SRSSA002802\",\"SRSSA002814\",\"SRSSA002826\",\"SRSSA002843\",\"SRSSA002884\",\"SRSSA002913\",\"SRSSA002925\",\"SRSSA002930\",\"SRSSA002954\",\"SRSSA002966\",\"SRSSA002971\",\"SRSSA002983\",\"SRSSA003000\",\"SRSSA003012\",\"SRSSA003024\",\"SRSSA003036\",\"SRSSA003065\",\"SRSSA003082\",\"SRSSA003140\",\"SRSSA003152\",\"SRSSA003176\",\"SRSSA003251\",\"SRSSA003263\",\"SRSSA003292\",\"SRSSA003304\",\"SRSSA003316\",\"SRSSA003362\",\"SRSSA003374\",\"SRSSA003391\",\"SRSSA003420\",\"SRSSA003432\",\"SRSSA003444\",\"SRSSA003456\",\"SRSSA003461\",\"SRSSA003473\",\"SRSSA003502\",\"SRSSA003514\",\"SRSSA003526\",\"SRSSA003531\",\"SRSSA003543\",\"SRSSA003555\",\"SRSSA003560\",\"SRSSA003572\",\"SRSSA003625\",\"SRSSA003630\",\"SRSSA003654\",\"SRSSA003671\",\"SRSSA003695\",\"SRSSA003700\",\"SRSSA003712\",\"SRSSA003736\",\"SRSSA003741\",\"SRSSA003765\",\"SRSSA003770\",\"SRSSA003782\",\"SRSSA003794\",\"SRSSA003806\",\"SRSSA003811\",\"SRSSA003823\",\"SRSSA003840\",\"SRSSA003852\",\"SRSSA003881\",\"SRSSA003893\",\"SRSSA003905\",\"SRSSA003934\",\"SRSSA004004\",\"SRSSA004021\",\"SRSSA004033\",\"SRSSA004045\",\"SRSSA004062\",\"SRSSA004103\",\"SRSSA004115\",\"SRSSA004120\",\"SRSSA004144\",\"SRSSA004173\",\"SRSSA004190\",\"SRSSA004202\",\"SRSSA004214\",\"SRSSA004226\",\"SRSSA004231\",\"SRSSA004243\",\"SRSSA004255\",\"SRSSA004260\",\"SRSSA004272\",\"SRSSA004284\",\"SRSSA004296\",\"SRSSA004301\",\"SRSSA004313\",\"SRSSA004325\",\"SRSSA004330\",\"SRSSA004342\",\"SRSSA004366\",\"SRSSA004371\",\"SRSSA004383\",\"SRSSA004395\",\"SRSSA004400\",\"SRSSA004412\",\"SRSSA004424\",\"SRSSA004436\",\"SRSSA004453\",\"SRSSA004465\",\"SRSSA004482\",\"SRSSA004494\",\"SRSSA004506\",\"SRSSA004511\",\"SRSSA004523\",\"SRSSA004535\",\"SRSSA004540\",\"SRSSA004552\",\"SRSSA004564\",\"SRSSA004576\",\"SRSSA004581\",\"SRSSA004593\",\"SRSSA004605\",\"SRSSA004610\",\"SRSSA004622\",\"SRSSA004634\",\"SRSSA004646\",\"SRSSA004651\",\"SRSSA004663\",\"SRSSA004675\",\"SRSSA004692\",\"SRSSA004704\",\"SRSSA004716\",\"SRSSA004733\",\"SRSSA004745\",\"SRSSA004750\",\"SRSSA004762\",\"SRSSA004786\",\"SRSSA004844\",\"SRSSA004856\",\"SRSSA004861\",\"SRSSA004873\",\"SRSSA004885\",\"SRSSA004890\",\"SRSSA004902\",\"SRSSA004914\",\"SRSSA004926\",\"SRSSA004943\",\"SRSSA004960\",\"SRSSA004996\",\"SRSSA005001\",\"SRSSA005013\",\"SRSSA005025\",\"SRSSA005030\",\"SRSSA005042\",\"SRSSA005054\",\"SRSSA005083\",\"SRSSA005095\",\"SRSSA005100\",\"SRSSA005112\",\"SRSSA005124\",\"SRSSA005136\",\"SRSSA005153\",\"SRSSA005165\",\"SRSSA005170\",\"SRSSA005182\",\"SRSSA005211\",\"SRSSA005223\",\"SRSSA005235\",\"SRSSA005240\",\"SRSSA005252\",\"SRSSA005276\",\"SRSSA005281\",\"SRSSA005293\",\"SRSSA005305\",\"SRSSA005310\",\"SRSSA005346\",\"SRSSA005351\",\"SRSSA005375\",\"SRSSA005380\",\"SRSSA005392\",\"SRSSA005404\",\"SRSSA005416\",\"SRSSA005421\",\"SRSSA005433\",\"SRSSA005445\",\"SRSSA005474\",\"SRSSA005486\",\"SRSSA005491\",\"SRSSA005503\",\"SRSSA005532\",\"SRSSA005556\",\"SRSSA005561\",\"SRSSA005573\",\"SRSSA005590\",\"SRSSA005602\",\"SRSSA005626\",\"SRSSA005631\",\"SRSSA005643\",\"SRSSA005684\",\"SRSSA005696\",\"SRSSA005701\",\"SRSSA005725\",\"SRSSA005730\",\"SRSSA005836\",\"SRSSA005841\",\"SRSSA005865\",\"SRSSA005870\",\"SRSSA005894\",\"SRSSA005906\",\"SRSSA005911\",\"SRSSA005923\",\"SRSSA005935\",\"SRSSA005952\",\"SRSSA005964\",\"SRSSA005976\",\"SRSSA005981\",\"SRSSA006075\",\"SRSSA006121\",\"SRSSA006145\",\"SRSSA006174\",\"SRSSA006186\",\"SRSSA006191\",\"SRSSA006203\",\"SRSSA017444\",\"SRSSA017450\",\"SRSSA017462\",\"SRSSA017474\",\"SRSSA017486\",\"SRSSA017491\",\"SRSSA017503\",\"SRSSA017515\",\"SRSSA017520\",\"SRSSA017532\",\"SRSSA017544\",\"SRSSA017556\",\"SRSSA017561\",\"SRSSA017573\",\"SRSSA017585\",\"SRSSA017590\",\"SRSSA017602\",\"SRSSA017614\",\"SRSSA017626\",\"SRSSA017631\",\"SRSSA017643\",\"SRSSA017655\",\"SRSSA017666\",\"SRSSA017671\",\"SRSSA017683\",\"SRSSA017695\",\"SRSSA017700\",\"SRSSA017712\",\"SRSSA017736\",\"SRSSA017741\",\"SRSSA017753\",\"SRSSA017765\",\"SRSSA017770\",\"SRSSA017806\",\"SRSSA017811\",\"SRSSA017835\",\"SRSSA017840\",\"SRSSA017852\",\"SRSSA017864\",\"SRSSA017876\",\"SRSSA017893\",\"SRSSA017905\",\"SRSSA018004\",\"SRSSA018016\",\"SRSSA018021\",\"SRSSA018045\",\"SRSSA018050\",\"SRSSA018062\",\"SRSSA018074\",\"SRSSA018086\",\"SRSSA018103\",\"SRSSA018115\",\"SRSSA018120\",\"SRSSA018132\",\"SRSSA018156\",\"SRSSA018161\",\"SRSSA018173\",\"SRSSA018185\",\"SRSSA018190\",\"SRSSA018202\",\"SRSSA018214\",\"SRSSA018226\",\"SRSSA018231\",\"SRSSA018243\",\"SRSSA018255\",\"SRSSA018260\",\"SRSSA018272\",\"SRSSA018284\",\"SRSSA018296\",\"SRSSA018301\",\"SRSSA018313\",\"SRSSA018325\",\"SRSSA018330\",\"SRSSA018342\",\"SRSSA018366\",\"SRSSA018371\",\"SRSSA018395\",\"SRSSA018400\",\"SRSSA018412\",\"SRSSA018424\",\"SRSSA018436\",\"SRSSA018441\",\"SRSSA018453\",\"SRSSA018465\",\"SRSSA018470\",\"SRSSA018482\");\n} //fin de if($IdEstado == \"26\")\n\n//Condicion de estado-clues\nif($IdEstado == \"27\"){\n\t$Clues = array(\"TCSSA000014\",\"TCSSA000031\",\"TCSSA000043\",\"TCSSA000055\",\"TCSSA000060\",\"TCSSA000096\",\"TCSSA000101\",\"TCSSA000113\",\"TCSSA000125\",\"TCSSA000130\",\"TCSSA000142\",\"TCSSA000154\",\"TCSSA000166\",\"TCSSA000171\",\"TCSSA000183\",\"TCSSA000195\",\"TCSSA000200\",\"TCSSA000212\",\"TCSSA000224\",\"TCSSA000236\",\"TCSSA000241\",\"TCSSA000253\",\"TCSSA000265\",\"TCSSA000270\",\"TCSSA000282\",\"TCSSA000294\",\"TCSSA000306\",\"TCSSA000335\",\"TCSSA000340\",\"TCSSA000352\",\"TCSSA000364\",\"TCSSA000376\",\"TCSSA000381\",\"TCSSA000405\",\"TCSSA000410\",\"TCSSA000422\",\"TCSSA000434\",\"TCSSA000446\",\"TCSSA000451\",\"TCSSA000463\",\"TCSSA000475\",\"TCSSA000480\",\"TCSSA000504\",\"TCSSA000516\",\"TCSSA000521\",\"TCSSA000533\",\"TCSSA000545\",\"TCSSA000550\",\"TCSSA000562\",\"TCSSA000574\",\"TCSSA000586\",\"TCSSA000591\",\"TCSSA000603\",\"TCSSA000615\",\"TCSSA000632\",\"TCSSA000644\",\"TCSSA000656\",\"TCSSA000661\",\"TCSSA000673\",\"TCSSA000685\",\"TCSSA000726\",\"TCSSA000743\",\"TCSSA000755\",\"TCSSA000760\",\"TCSSA000772\",\"TCSSA000784\",\"TCSSA000796\",\"TCSSA000801\",\"TCSSA000813\",\"TCSSA000825\",\"TCSSA000830\",\"TCSSA000842\",\"TCSSA000854\",\"TCSSA000866\",\"TCSSA000871\",\"TCSSA000883\",\"TCSSA000895\",\"TCSSA000900\",\"TCSSA000912\",\"TCSSA000924\",\"TCSSA000936\",\"TCSSA000941\",\"TCSSA000953\",\"TCSSA000965\",\"TCSSA000970\",\"TCSSA000982\",\"TCSSA000994\",\"TCSSA001006\",\"TCSSA001023\",\"TCSSA001035\",\"TCSSA001040\",\"TCSSA001052\",\"TCSSA001064\",\"TCSSA001076\",\"TCSSA001081\",\"TCSSA001163\",\"TCSSA001175\",\"TCSSA001180\",\"TCSSA001192\",\"TCSSA001204\",\"TCSSA001216\",\"TCSSA001221\",\"TCSSA001233\",\"TCSSA001245\",\"TCSSA001250\",\"TCSSA001262\",\"TCSSA001274\",\"TCSSA001286\",\"TCSSA001291\",\"TCSSA001303\",\"TCSSA001315\",\"TCSSA001320\",\"TCSSA001332\",\"TCSSA001344\",\"TCSSA001356\",\"TCSSA001361\",\"TCSSA001373\",\"TCSSA001385\",\"TCSSA001390\",\"TCSSA001402\",\"TCSSA001414\",\"TCSSA001426\",\"TCSSA001431\",\"TCSSA001443\",\"TCSSA001455\",\"TCSSA001460\",\"TCSSA001472\",\"TCSSA001484\",\"TCSSA001496\",\"TCSSA001501\",\"TCSSA001513\",\"TCSSA001525\",\"TCSSA001542\",\"TCSSA001554\",\"TCSSA001566\",\"TCSSA001571\",\"TCSSA001583\",\"TCSSA001595\",\"TCSSA001600\",\"TCSSA001612\",\"TCSSA001624\",\"TCSSA001636\",\"TCSSA001653\",\"TCSSA001706\",\"TCSSA001711\",\"TCSSA001723\",\"TCSSA001735\",\"TCSSA001740\",\"TCSSA001752\",\"TCSSA001764\",\"TCSSA001776\",\"TCSSA001781\",\"TCSSA001793\",\"TCSSA001805\",\"TCSSA001810\",\"TCSSA001822\",\"TCSSA001834\",\"TCSSA001846\",\"TCSSA001851\",\"TCSSA001863\",\"TCSSA001875\",\"TCSSA001880\",\"TCSSA001892\",\"TCSSA001904\",\"TCSSA001916\",\"TCSSA001921\",\"TCSSA001933\",\"TCSSA001945\",\"TCSSA001950\",\"TCSSA001974\",\"TCSSA001986\",\"TCSSA001991\",\"TCSSA002003\",\"TCSSA002061\",\"TCSSA002073\",\"TCSSA002085\",\"TCSSA002090\",\"TCSSA002102\",\"TCSSA002114\",\"TCSSA002126\",\"TCSSA002131\",\"TCSSA002143\",\"TCSSA002155\",\"TCSSA002160\",\"TCSSA002172\",\"TCSSA002184\",\"TCSSA002196\",\"TCSSA002201\",\"TCSSA002213\",\"TCSSA002225\",\"TCSSA002230\",\"TCSSA002242\",\"TCSSA002254\",\"TCSSA002266\",\"TCSSA002271\",\"TCSSA002283\",\"TCSSA002295\",\"TCSSA002300\",\"TCSSA002312\",\"TCSSA002324\",\"TCSSA002336\",\"TCSSA002341\",\"TCSSA002353\",\"TCSSA002370\",\"TCSSA002382\",\"TCSSA002394\",\"TCSSA002406\",\"TCSSA002411\",\"TCSSA002423\",\"TCSSA002440\",\"TCSSA002464\",\"TCSSA002481\",\"TCSSA002493\",\"TCSSA002505\",\"TCSSA002510\",\"TCSSA002522\",\"TCSSA002534\",\"TCSSA002546\",\"TCSSA002551\",\"TCSSA002563\",\"TCSSA002575\",\"TCSSA002580\",\"TCSSA002592\",\"TCSSA002604\",\"TCSSA002616\",\"TCSSA002621\",\"TCSSA002633\",\"TCSSA002645\",\"TCSSA002650\",\"TCSSA002662\",\"TCSSA002674\",\"TCSSA002686\",\"TCSSA002691\",\"TCSSA002703\",\"TCSSA002715\",\"TCSSA002720\",\"TCSSA002732\",\"TCSSA002756\",\"TCSSA002761\",\"TCSSA002773\",\"TCSSA002785\",\"TCSSA002802\",\"TCSSA002814\",\"TCSSA002831\",\"TCSSA002843\",\"TCSSA002855\",\"TCSSA002860\",\"TCSSA002872\",\"TCSSA002884\",\"TCSSA002896\",\"TCSSA002901\",\"TCSSA002913\",\"TCSSA002925\",\"TCSSA002930\",\"TCSSA002942\",\"TCSSA002954\",\"TCSSA002966\",\"TCSSA002971\",\"TCSSA003024\",\"TCSSA003036\",\"TCSSA003041\",\"TCSSA003053\",\"TCSSA003065\",\"TCSSA003070\",\"TCSSA003082\",\"TCSSA003094\",\"TCSSA003106\",\"TCSSA003111\",\"TCSSA003123\",\"TCSSA003135\",\"TCSSA003164\",\"TCSSA003176\",\"TCSSA003181\",\"TCSSA003193\",\"TCSSA003205\",\"TCSSA003210\",\"TCSSA003222\",\"TCSSA003234\",\"TCSSA003246\",\"TCSSA003251\",\"TCSSA003263\",\"TCSSA003275\",\"TCSSA003280\",\"TCSSA003292\",\"TCSSA003304\",\"TCSSA003316\",\"TCSSA003333\",\"TCSSA003350\",\"TCSSA003386\",\"TCSSA003391\",\"TCSSA003403\",\"TCSSA003415\",\"TCSSA003420\",\"TCSSA003432\",\"TCSSA003444\",\"TCSSA003456\",\"TCSSA003461\",\"TCSSA003473\",\"TCSSA003485\",\"TCSSA003490\",\"TCSSA003502\",\"TCSSA003514\",\"TCSSA003526\",\"TCSSA003584\",\"TCSSA003596\",\"TCSSA003601\",\"TCSSA003613\",\"TCSSA003625\",\"TCSSA003630\",\"TCSSA003642\",\"TCSSA003654\",\"TCSSA003666\",\"TCSSA003671\",\"TCSSA003683\",\"TCSSA003695\",\"TCSSA003700\",\"TCSSA003712\",\"TCSSA003724\",\"TCSSA003736\",\"TCSSA003741\",\"TCSSA003753\",\"TCSSA003765\",\"TCSSA003770\",\"TCSSA003806\",\"TCSSA003811\",\"TCSSA003823\",\"TCSSA003835\",\"TCSSA003840\",\"TCSSA003852\",\"TCSSA003864\",\"TCSSA003876\",\"TCSSA003881\",\"TCSSA003893\",\"TCSSA003905\",\"TCSSA003910\",\"TCSSA003922\",\"TCSSA003934\",\"TCSSA003946\",\"TCSSA003951\",\"TCSSA003963\",\"TCSSA003980\",\"TCSSA003992\",\"TCSSA004004\",\"TCSSA004016\",\"TCSSA004021\",\"TCSSA004033\",\"TCSSA004045\",\"TCSSA004050\",\"TCSSA004062\",\"TCSSA004074\",\"TCSSA004086\",\"TCSSA004091\",\"TCSSA004103\",\"TCSSA004115\",\"TCSSA004120\",\"TCSSA004132\",\"TCSSA004144\",\"TCSSA004156\",\"TCSSA004161\",\"TCSSA004173\",\"TCSSA004185\",\"TCSSA004202\",\"TCSSA004214\",\"TCSSA004226\",\"TCSSA004231\",\"TCSSA004243\",\"TCSSA004255\",\"TCSSA004260\",\"TCSSA004272\",\"TCSSA004284\",\"TCSSA004296\",\"TCSSA004301\",\"TCSSA004313\",\"TCSSA004325\",\"TCSSA004330\",\"TCSSA004366\",\"TCSSA004371\",\"TCSSA004383\",\"TCSSA004395\",\"TCSSA004400\",\"TCSSA004412\",\"TCSSA004424\",\"TCSSA004436\",\"TCSSA004441\",\"TCSSA004453\",\"TCSSA004465\",\"TCSSA004470\",\"TCSSA004494\",\"TCSSA004506\",\"TCSSA004511\",\"TCSSA004523\",\"TCSSA004535\",\"TCSSA004540\",\"TCSSA004552\",\"TCSSA004564\",\"TCSSA004576\",\"TCSSA004581\",\"TCSSA004593\",\"TCSSA004605\",\"TCSSA004610\",\"TCSSA004622\",\"TCSSA004634\",\"TCSSA004646\",\"TCSSA004651\",\"TCSSA004663\",\"TCSSA004675\",\"TCSSA004680\",\"TCSSA004692\",\"TCSSA004704\",\"TCSSA004716\",\"TCSSA004721\",\"TCSSA004733\",\"TCSSA004745\",\"TCSSA004750\",\"TCSSA004762\",\"TCSSA004774\",\"TCSSA004786\",\"TCSSA004791\",\"TCSSA004803\",\"TCSSA004815\",\"TCSSA004820\",\"TCSSA004832\",\"TCSSA004844\",\"TCSSA004861\",\"TCSSA004873\",\"TCSSA004885\",\"TCSSA004890\",\"TCSSA004902\",\"TCSSA004914\",\"TCSSA004926\",\"TCSSA004943\",\"TCSSA004955\",\"TCSSA004960\",\"TCSSA004972\",\"TCSSA004984\",\"TCSSA005001\",\"TCSSA005013\",\"TCSSA005025\",\"TCSSA005030\",\"TCSSA005042\",\"TCSSA005054\",\"TCSSA005066\",\"TCSSA005071\",\"TCSSA005083\",\"TCSSA005095\",\"TCSSA005100\",\"TCSSA005112\",\"TCSSA005124\",\"TCSSA005136\",\"TCSSA005153\",\"TCSSA005165\",\"TCSSA005170\",\"TCSSA005182\",\"TCSSA005194\",\"TCSSA005211\",\"TCSSA005235\",\"TCSSA005240\",\"TCSSA005252\",\"TCSSA005264\",\"TCSSA005276\",\"TCSSA005281\",\"TCSSA005293\",\"TCSSA005305\",\"TCSSA005310\",\"TCSSA005322\",\"TCSSA005334\",\"TCSSA005346\",\"TCSSA005351\",\"TCSSA005363\",\"TCSSA005392\",\"TCSSA005404\",\"TCSSA005416\",\"TCSSA005421\",\"TCSSA005433\",\"TCSSA005445\",\"TCSSA005450\",\"TCSSA005462\",\"TCSSA005474\",\"TCSSA005486\",\"TCSSA005491\",\"TCSSA005503\",\"TCSSA005515\",\"TCSSA005520\",\"TCSSA005532\",\"TCSSA005544\",\"TCSSA005556\",\"TCSSA005561\",\"TCSSA005573\",\"TCSSA005585\",\"TCSSA005590\",\"TCSSA005602\",\"TCSSA005614\",\"TCSSA005626\",\"TCSSA005631\",\"TCSSA005643\",\"TCSSA005655\",\"TCSSA005660\",\"TCSSA005672\",\"TCSSA005684\",\"TCSSA005701\",\"TCSSA005713\",\"TCSSA005725\",\"TCSSA005742\",\"TCSSA005754\",\"TCSSA005766\",\"TCSSA005771\",\"TCSSA005783\",\"TCSSA005795\",\"TCSSA005976\",\"TCSSA005981\",\"TCSSA005993\",\"TCSSA006005\",\"TCSSA006010\",\"TCSSA006022\",\"TCSSA006051\",\"TCSSA006063\",\"TCSSA006075\",\"TCSSA006080\",\"TCSSA006092\",\"TCSSA006104\",\"TCSSA006116\",\"TCSSA006121\",\"TCSSA006145\",\"TCSSA006150\",\"TCSSA006162\",\"TCSSA006174\",\"TCSSA006186\",\"TCSSA006191\",\"TCSSA006215\",\"TCSSA006220\",\"TCSSA006232\",\"TCSSA006244\",\"TCSSA016371\",\"TCSSA016383\",\"TCSSA016395\",\"TCSSA016400\",\"TCSSA016412\",\"TCSSA016424\",\"TCSSA016436\",\"TCSSA016441\",\"TCSSA016453\",\"TCSSA016465\",\"TCSSA016470\",\"TCSSA016482\",\"TCSSA016494\",\"TCSSA016506\",\"TCSSA016511\",\"TCSSA016523\",\"TCSSA016535\",\"TCSSA016540\",\"TCSSA016552\",\"TCSSA016564\",\"TCSSA016576\",\"TCSSA016581\",\"TCSSA016605\",\"TCSSA016610\",\"TCSSA016622\",\"TCSSA016634\",\"TCSSA016646\",\"TCSSA016651\",\"TCSSA016663\",\"TCSSA016675\",\"TCSSA016680\",\"TCSSA016692\",\"TCSSA016704\",\"TCSSA016716\",\"TCSSA016721\",\"TCSSA016733\",\"TCSSA016744\",\"TCSSA016756\",\"TCSSA016761\",\"TCSSA016773\",\"TCSSA016785\",\"TCSSA016831\",\"TCSSA016843\",\"TCSSA016855\",\"TCSSA016860\",\"TCSSA016872\",\"TCSSA016884\",\"TCSSA016896\",\"TCSSA016901\",\"TCSSA016913\",\"TCSSA016925\",\"TCSSA016930\",\"TCSSA016942\",\"TCSSA016954\",\"TCSSA016966\",\"TCSSA016983\",\"TCSSA016995\",\"TCSSA017000\",\"TCSSA017012\",\"TCSSA017024\",\"TCSSA017036\",\"TCSSA017041\",\"TCSSA017053\",\"TCSSA017065\",\"TCSSA017070\",\"TCSSA017082\",\"TCSSA017094\",\"TCSSA017106\",\"TCSSA017111\",\"TCSSA017123\",\"TCSSA017135\",\"TCSSA017140\",\"TCSSA017152\",\"TCSSA017164\",\"TCSSA017176\",\"TCSSA017181\",\"TCSSA017193\",\"TCSSA017205\",\"TCSSA017210\",\"TCSSA017222\",\"TCSSA017234\",\"TCSSA017246\",\"TCSSA017251\",\"TCSSA017263\",\"TCSSA017275\",\"TCSSA017280\",\"TCSSA017292\",\"TCSSA017304\",\"TCSSA017316\",\"TCSSA017321\",\"TCSSA017333\",\"TCSSA017345\",\"TCSSA017350\",\"TCSSA017362\",\"TCSSA017374\",\"TCSSA017386\",\"TCSSA017391\",\"TCSSA017403\",\"TCSSA017415\",\"TCSSA017420\",\"TCSSA017432\",\"TCSSA017444\",\"TCSSA017456\",\"TCSSA017461\",\"TCSSA017473\",\"TCSSA017485\",\"TCSSA017490\",\"TCSSA017502\",\"TCSSA017514\",\"TCSSA017526\",\"TCSSA017531\",\"TCSSA017543\",\"TCSSA017555\",\"TCSSA017560\",\"TCSSA017572\",\"TCSSA017584\",\"TCSSA017596\",\"TCSSA017601\",\"TCSSA017613\",\"TCSSA017625\",\"TCSSA017630\",\"TCSSA017642\",\"TCSSA017654\",\"TCSSA017666\",\"TCSSA017671\",\"TCSSA017683\",\"TCSSA017695\",\"TCSSA017700\",\"TCSSA017712\",\"TCSSA017724\",\"TCSSA017736\",\"TCSSA017741\",\"TCSSA017753\",\"TCSSA017765\",\"TCSSA017770\",\"TCSSA017782\");\n} //fin de if($IdEstado == \"27\")\n\n//Condicion de estado-clues\nif($IdEstado == \"28\"){\n\t$Clues = array(\"TSSSA000010\",\"TSSSA000022\",\"TSSSA000034\",\"TSSSA000046\",\"TSSSA000051\",\"TSSSA000063\",\"TSSSA000075\",\"TSSSA000092\",\"TSSSA000104\",\"TSSSA000116\",\"TSSSA000121\",\"TSSSA000145\",\"TSSSA000150\",\"TSSSA000162\",\"TSSSA000174\",\"TSSSA000186\",\"TSSSA000191\",\"TSSSA000203\",\"TSSSA000215\",\"TSSSA000220\",\"TSSSA000232\",\"TSSSA000244\",\"TSSSA000256\",\"TSSSA000261\",\"TSSSA000273\",\"TSSSA000285\",\"TSSSA000290\",\"TSSSA000302\",\"TSSSA000326\",\"TSSSA000331\",\"TSSSA000372\",\"TSSSA000384\",\"TSSSA000396\",\"TSSSA000401\",\"TSSSA000413\",\"TSSSA000425\",\"TSSSA000442\",\"TSSSA000454\",\"TSSSA000466\",\"TSSSA000483\",\"TSSSA000495\",\"TSSSA000500\",\"TSSSA000512\",\"TSSSA000524\",\"TSSSA000536\",\"TSSSA000553\",\"TSSSA000565\",\"TSSSA000582\",\"TSSSA000594\",\"TSSSA000611\",\"TSSSA000623\",\"TSSSA000635\",\"TSSSA000676\",\"TSSSA000681\",\"TSSSA000693\",\"TSSSA000705\",\"TSSSA000710\",\"TSSSA000722\",\"TSSSA000734\",\"TSSSA000746\",\"TSSSA000763\",\"TSSSA000775\",\"TSSSA000780\",\"TSSSA000792\",\"TSSSA000804\",\"TSSSA000816\",\"TSSSA000821\",\"TSSSA000833\",\"TSSSA000845\",\"TSSSA000874\",\"TSSSA000886\",\"TSSSA000891\",\"TSSSA000903\",\"TSSSA000915\",\"TSSSA000920\",\"TSSSA000932\",\"TSSSA000944\",\"TSSSA000961\",\"TSSSA000973\",\"TSSSA000985\",\"TSSSA000990\",\"TSSSA001002\",\"TSSSA001014\",\"TSSSA001026\",\"TSSSA001031\",\"TSSSA001096\",\"TSSSA001101\",\"TSSSA001113\",\"TSSSA001125\",\"TSSSA001130\",\"TSSSA001142\",\"TSSSA001154\",\"TSSSA001166\",\"TSSSA001171\",\"TSSSA001183\",\"TSSSA001195\",\"TSSSA001212\",\"TSSSA001253\",\"TSSSA001265\",\"TSSSA001270\",\"TSSSA001294\",\"TSSSA001306\",\"TSSSA001311\",\"TSSSA001323\",\"TSSSA001335\",\"TSSSA001340\",\"TSSSA001352\",\"TSSSA001364\",\"TSSSA001376\",\"TSSSA001381\",\"TSSSA001393\",\"TSSSA001405\",\"TSSSA001410\",\"TSSSA001422\",\"TSSSA001434\",\"TSSSA001446\",\"TSSSA001451\",\"TSSSA001463\",\"TSSSA001475\",\"TSSSA001492\",\"TSSSA001504\",\"TSSSA001516\",\"TSSSA001521\",\"TSSSA001533\",\"TSSSA001545\",\"TSSSA001550\",\"TSSSA001562\",\"TSSSA001586\",\"TSSSA001615\",\"TSSSA001620\",\"TSSSA001632\",\"TSSSA001644\",\"TSSSA001656\",\"TSSSA001661\",\"TSSSA001673\",\"TSSSA001685\",\"TSSSA001702\",\"TSSSA001714\",\"TSSSA001726\",\"TSSSA001731\",\"TSSSA001755\",\"TSSSA001760\",\"TSSSA001772\",\"TSSSA001825\",\"TSSSA001854\",\"TSSSA001866\",\"TSSSA001871\",\"TSSSA001883\",\"TSSSA001895\",\"TSSSA001900\",\"TSSSA001912\",\"TSSSA001924\",\"TSSSA001936\",\"TSSSA001941\",\"TSSSA001953\",\"TSSSA001965\",\"TSSSA001982\",\"TSSSA001994\",\"TSSSA002011\",\"TSSSA002035\",\"TSSSA002040\",\"TSSSA002052\",\"TSSSA002093\",\"TSSSA002110\",\"TSSSA002122\",\"TSSSA002134\",\"TSSSA002146\",\"TSSSA002151\",\"TSSSA002163\",\"TSSSA002175\",\"TSSSA002192\",\"TSSSA002221\",\"TSSSA002233\",\"TSSSA002245\",\"TSSSA002250\",\"TSSSA002262\",\"TSSSA002274\",\"TSSSA002286\",\"TSSSA002291\",\"TSSSA002303\",\"TSSSA002315\",\"TSSSA002320\",\"TSSSA002332\",\"TSSSA002344\",\"TSSSA002356\",\"TSSSA002361\",\"TSSSA002373\",\"TSSSA002402\",\"TSSSA002414\",\"TSSSA002426\",\"TSSSA002431\",\"TSSSA002443\",\"TSSSA002460\",\"TSSSA002484\",\"TSSSA002496\",\"TSSSA002501\",\"TSSSA002530\",\"TSSSA002542\",\"TSSSA002554\",\"TSSSA002566\",\"TSSSA002571\",\"TSSSA002583\",\"TSSSA002595\",\"TSSSA002600\",\"TSSSA002612\",\"TSSSA002624\",\"TSSSA002636\",\"TSSSA002641\",\"TSSSA002653\",\"TSSSA002665\",\"TSSSA002711\",\"TSSSA002723\",\"TSSSA002735\",\"TSSSA002740\",\"TSSSA002764\",\"TSSSA002776\",\"TSSSA002781\",\"TSSSA002793\",\"TSSSA002805\",\"TSSSA002810\",\"TSSSA002846\",\"TSSSA002851\",\"TSSSA002863\",\"TSSSA002875\",\"TSSSA002880\",\"TSSSA002892\",\"TSSSA002904\",\"TSSSA002916\",\"TSSSA002921\",\"TSSSA002933\",\"TSSSA002945\",\"TSSSA002950\",\"TSSSA002962\",\"TSSSA002974\",\"TSSSA002991\",\"TSSSA003003\",\"TSSSA003032\",\"TSSSA003056\",\"TSSSA003061\",\"TSSSA003073\",\"TSSSA003085\",\"TSSSA003090\",\"TSSSA003114\",\"TSSSA003131\",\"TSSSA003143\",\"TSSSA003155\",\"TSSSA003160\",\"TSSSA003172\",\"TSSSA003184\",\"TSSSA017535\",\"TSSSA017540\",\"TSSSA017552\",\"TSSSA017564\",\"TSSSA017576\",\"TSSSA017581\",\"TSSSA017593\",\"TSSSA017605\",\"TSSSA017610\",\"TSSSA017622\",\"TSSSA017634\",\"TSSSA017646\",\"TSSSA017651\",\"TSSSA017663\",\"TSSSA017675\",\"TSSSA017680\",\"TSSSA017692\",\"TSSSA017704\",\"TSSSA017716\",\"TSSSA017721\",\"TSSSA017733\",\"TSSSA017745\",\"TSSSA017750\",\"TSSSA017762\",\"TSSSA017774\",\"TSSSA017786\",\"TSSSA017791\",\"TSSSA017803\",\"TSSSA017814\",\"TSSSA017826\",\"TSSSA017831\",\"TSSSA017843\",\"TSSSA017860\",\"TSSSA017872\",\"TSSSA017884\",\"TSSSA017896\",\"TSSSA017901\",\"TSSSA017913\",\"TSSSA017925\",\"TSSSA017930\",\"TSSSA017942\",\"TSSSA017954\",\"TSSSA017971\",\"TSSSA017983\",\"TSSSA017995\",\"TSSSA018000\",\"TSSSA018012\",\"TSSSA018024\",\"TSSSA018036\",\"TSSSA018041\",\"TSSSA018053\",\"TSSSA018065\",\"TSSSA018070\",\"TSSSA018082\",\"TSSSA018094\",\"TSSSA018106\",\"TSSSA018111\",\"TSSSA018123\",\"TSSSA018135\",\"TSSSA018140\",\"TSSSA018152\",\"TSSSA018164\",\"TSSSA018176\",\"TSSSA018181\",\"TSSSA018193\",\"TSSSA018205\",\"TSSSA018210\",\"TSSSA018222\",\"TSSSA018234\",\"TSSSA018246\",\"TSSSA018251\",\"TSSSA018263\",\"TSSSA018275\",\"TSSSA018280\",\"TSSSA018292\",\"TSSSA018304\",\"TSSSA018316\",\"TSSSA018321\",\"TSSSA018333\",\"TSSSA018345\",\"TSSSA018350\",\"TSSSA018362\",\"TSSSA018374\",\"TSSSA018386\",\"TSSSA018403\",\"TSSSA018415\",\"TSSSA018420\",\"TSSSA018432\",\"TSSSA018444\",\"TSSSA018456\",\"TSSSA018461\",\"TSSSA018473\",\"TSSSA018485\",\"TSSSA018490\",\"TSSSA018502\",\"TSSSA018514\",\"TSSSA018526\",\"TSSSA018531\",\"TSSSA018543\",\"TSSSA018555\",\"TSSSA018560\",\"TSSSA018572\",\"TSSSA018584\",\"TSSSA018596\",\"TSSSA018601\",\"TSSSA018613\",\"TSSSA018625\",\"TSSSA018630\",\"TSSSA018642\",\"TSSSA018654\",\"TSSSA018666\",\"TSSSA018671\",\"TSSSA018683\",\"TSSSA018695\",\"TSSSA018700\",\"TSSSA018712\",\"TSSSA018724\",\"TSSSA018741\",\"TSSSA018753\",\"TSSSA018765\",\"TSSSA018770\",\"TSSSA018782\",\"TSSSA018794\",\"TSSSA018806\",\"TSSSA018811\",\"TSSSA018823\",\"TSSSA018835\",\"TSSSA018840\",\"TSSSA018852\",\"TSSSA018864\",\"TSSSA018876\",\"TSSSA018881\",\"TSSSA018893\",\"TSSSA018905\",\"TSSSA018910\",\"TSSSA018922\",\"TSSSA018934\",\"TSSSA018946\",\"TSSSA018951\",\"TSSSA018963\",\"TSSSA018975\",\"TSSSA018980\",\"TSSSA018992\",\"TSSSA019004\",\"TSSSA019016\",\"TSSSA019021\",\"TSSSA019033\",\"TSSSA019045\",\"TSSSA019050\",\"TSSSA019062\",\"TSSSA019074\",\"TSSSA019086\",\"TSSSA019091\",\"TSSSA019103\",\"TSSSA019115\",\"TSSSA019120\",\"TSSSA019132\",\"TSSSA019144\",\"TSSSA019156\",\"TSSSA019161\",\"TSSSA019173\",\"TSSSA019185\",\"TSSSA019190\",\"TSSSA019202\",\"TSSSA019214\",\"TSSSA019226\",\"TSSSA019231\",\"TSSSA019243\",\"TSSSA019255\",\"TSSSA019260\",\"TSSSA019272\",\"TSSSA019284\",\"TSSSA019296\",\"TSSSA019301\",\"TSSSA019313\",\"TSSSA019325\",\"TSSSA019330\",\"TSSSA019342\",\"TSSSA019354\",\"TSSSA019366\",\"TSSSA019371\",\"TSSSA019383\",\"TSSSA019395\",\"TSSSA019400\",\"TSSSA019412\",\"TSSSA019424\",\"TSSSA019436\",\"TSSSA019441\");\n} //fin de if($IdEstado == \"28\")\n\n//Condicion de estado-clues\nif($IdEstado == \"29\"){\n\t$Clues = array(\"TLSSA000010\",\"TLSSA000022\",\"TLSSA000034\",\"TLSSA000051\",\"TLSSA000063\",\"TLSSA000075\",\"TLSSA000080\",\"TLSSA000092\",\"TLSSA000104\",\"TLSSA000116\",\"TLSSA000121\",\"TLSSA000133\",\"TLSSA000145\",\"TLSSA000150\",\"TLSSA000162\",\"TLSSA000174\",\"TLSSA000186\",\"TLSSA000191\",\"TLSSA000203\",\"TLSSA000215\",\"TLSSA000220\",\"TLSSA000232\",\"TLSSA000244\",\"TLSSA000256\",\"TLSSA000261\",\"TLSSA000273\",\"TLSSA000285\",\"TLSSA000290\",\"TLSSA000302\",\"TLSSA000314\",\"TLSSA000326\",\"TLSSA000343\",\"TLSSA000355\",\"TLSSA000360\",\"TLSSA000372\",\"TLSSA000384\",\"TLSSA000396\",\"TLSSA000401\",\"TLSSA000413\",\"TLSSA000425\",\"TLSSA000430\",\"TLSSA000442\",\"TLSSA000454\",\"TLSSA000466\",\"TLSSA000471\",\"TLSSA000495\",\"TLSSA000500\",\"TLSSA000512\",\"TLSSA000524\",\"TLSSA000536\",\"TLSSA000541\",\"TLSSA000553\",\"TLSSA000565\",\"TLSSA000570\",\"TLSSA000582\",\"TLSSA000594\",\"TLSSA000606\",\"TLSSA000611\",\"TLSSA000623\",\"TLSSA000635\",\"TLSSA000640\",\"TLSSA000652\",\"TLSSA000664\",\"TLSSA000676\",\"TLSSA000681\",\"TLSSA000693\",\"TLSSA000705\",\"TLSSA000710\",\"TLSSA000722\",\"TLSSA000734\",\"TLSSA000746\",\"TLSSA000751\",\"TLSSA000763\",\"TLSSA000775\",\"TLSSA000780\",\"TLSSA000792\",\"TLSSA000804\",\"TLSSA000816\",\"TLSSA000821\",\"TLSSA000833\",\"TLSSA000845\",\"TLSSA000850\",\"TLSSA000862\",\"TLSSA000874\",\"TLSSA000886\",\"TLSSA000891\",\"TLSSA000903\",\"TLSSA000915\",\"TLSSA000920\",\"TLSSA000932\",\"TLSSA000944\",\"TLSSA000956\",\"TLSSA000961\",\"TLSSA000973\",\"TLSSA000985\",\"TLSSA000990\",\"TLSSA001002\",\"TLSSA001014\",\"TLSSA001026\",\"TLSSA001031\",\"TLSSA001043\",\"TLSSA001055\",\"TLSSA001060\",\"TLSSA001072\",\"TLSSA001084\",\"TLSSA001096\",\"TLSSA001101\",\"TLSSA001113\",\"TLSSA001125\",\"TLSSA001130\",\"TLSSA001142\",\"TLSSA001166\",\"TLSSA001183\",\"TLSSA001195\",\"TLSSA001200\",\"TLSSA001212\",\"TLSSA001224\",\"TLSSA001236\",\"TLSSA001241\",\"TLSSA001253\",\"TLSSA001265\",\"TLSSA001270\",\"TLSSA001282\",\"TLSSA001294\",\"TLSSA001306\",\"TLSSA001311\",\"TLSSA001323\",\"TLSSA001335\",\"TLSSA001340\",\"TLSSA001352\",\"TLSSA001364\",\"TLSSA001376\",\"TLSSA001381\",\"TLSSA001393\",\"TLSSA001405\",\"TLSSA001410\",\"TLSSA001422\",\"TLSSA001434\",\"TLSSA001446\",\"TLSSA001451\",\"TLSSA001463\",\"TLSSA001475\",\"TLSSA001480\",\"TLSSA001492\",\"TLSSA001504\",\"TLSSA001516\",\"TLSSA001521\",\"TLSSA001533\",\"TLSSA001545\",\"TLSSA001550\",\"TLSSA001562\",\"TLSSA001574\",\"TLSSA001586\",\"TLSSA001591\",\"TLSSA001603\",\"TLSSA001615\",\"TLSSA001620\",\"TLSSA001632\",\"TLSSA001644\",\"TLSSA001656\",\"TLSSA001661\",\"TLSSA001673\",\"TLSSA001685\",\"TLSSA001690\",\"TLSSA001702\",\"TLSSA001714\",\"TLSSA001726\",\"TLSSA001731\",\"TLSSA001743\",\"TLSSA001755\",\"TLSSA001772\",\"TLSSA017540\",\"TLSSA017552\",\"TLSSA017564\",\"TLSSA017576\",\"TLSSA017581\",\"TLSSA017593\",\"TLSSA017605\",\"TLSSA017610\",\"TLSSA017634\",\"TLSSA017645\",\"TLSSA017650\",\"TLSSA017662\",\"TLSSA017686\",\"TLSSA017703\",\"TLSSA017715\",\"TLSSA017720\",\"TLSSA017732\",\"TLSSA017773\",\"TLSSA017790\",\"TLSSA017802\",\"TLSSA017814\",\"TLSSA017826\",\"TLSSA017831\",\"TLSSA017843\",\"TLSSA017860\",\"TLSSA017872\",\"TLSSA017884\",\"TLSSA017896\",\"TLSSA017901\",\"TLSSA017913\",\"TLSSA017925\",\"TLSSA017930\",\"TLSSA017942\",\"TLSSA017954\",\"TLSSA017966\",\"TLSSA017971\",\"TLSSA017983\",\"TLSSA017995\",\"TLSSA018000\",\"TLSSA018012\",\"TLSSA018024\");\n} //fin de if($IdEstado == \"29\")\n\n//Condicion de estado-clues\nif($IdEstado == \"30\"){\n\t$Clues = array(\"VZSSA000013\",\"VZSSA000025\",\"VZSSA000030\",\"VZSSA000042\",\"VZSSA000066\",\"VZSSA000071\",\"VZSSA000083\",\"VZSSA000095\",\"VZSSA000100\",\"VZSSA000112\",\"VZSSA000124\",\"VZSSA000136\",\"VZSSA000141\",\"VZSSA000153\",\"VZSSA000165\",\"VZSSA000170\",\"VZSSA000194\",\"VZSSA000206\",\"VZSSA000211\",\"VZSSA000223\",\"VZSSA000235\",\"VZSSA000240\",\"VZSSA000252\",\"VZSSA000264\",\"VZSSA000281\",\"VZSSA000293\",\"VZSSA000310\",\"VZSSA000322\",\"VZSSA000346\",\"VZSSA000351\",\"VZSSA000363\",\"VZSSA000375\",\"VZSSA000380\",\"VZSSA000392\",\"VZSSA000404\",\"VZSSA000416\",\"VZSSA000421\",\"VZSSA000433\",\"VZSSA000445\",\"VZSSA000450\",\"VZSSA000474\",\"VZSSA000486\",\"VZSSA000491\",\"VZSSA000515\",\"VZSSA000532\",\"VZSSA000544\",\"VZSSA000556\",\"VZSSA000561\",\"VZSSA000573\",\"VZSSA000585\",\"VZSSA000590\",\"VZSSA000602\",\"VZSSA000614\",\"VZSSA000626\",\"VZSSA000631\",\"VZSSA000643\",\"VZSSA000655\",\"VZSSA000660\",\"VZSSA000672\",\"VZSSA000684\",\"VZSSA000696\",\"VZSSA000701\",\"VZSSA000713\",\"VZSSA000730\",\"VZSSA000742\",\"VZSSA000754\",\"VZSSA000766\",\"VZSSA000771\",\"VZSSA000783\",\"VZSSA000795\",\"VZSSA000800\",\"VZSSA000812\",\"VZSSA000824\",\"VZSSA000836\",\"VZSSA000841\",\"VZSSA000853\",\"VZSSA000870\",\"VZSSA000882\",\"VZSSA000894\",\"VZSSA000906\",\"VZSSA000911\",\"VZSSA000923\",\"VZSSA000935\",\"VZSSA000940\",\"VZSSA000952\",\"VZSSA000976\",\"VZSSA000981\",\"VZSSA000993\",\"VZSSA001005\",\"VZSSA001022\",\"VZSSA001046\",\"VZSSA001063\",\"VZSSA001080\",\"VZSSA001092\",\"VZSSA001104\",\"VZSSA001116\",\"VZSSA001121\",\"VZSSA001133\",\"VZSSA001145\",\"VZSSA001150\",\"VZSSA001162\",\"VZSSA001174\",\"VZSSA001186\",\"VZSSA001191\",\"VZSSA001203\",\"VZSSA001215\",\"VZSSA001220\",\"VZSSA001232\",\"VZSSA001244\",\"VZSSA001256\",\"VZSSA001261\",\"VZSSA001273\",\"VZSSA001290\",\"VZSSA001302\",\"VZSSA001314\",\"VZSSA001326\",\"VZSSA001343\",\"VZSSA001355\",\"VZSSA001372\",\"VZSSA001384\",\"VZSSA001396\",\"VZSSA001401\",\"VZSSA001425\",\"VZSSA001430\",\"VZSSA001442\",\"VZSSA001454\",\"VZSSA001466\",\"VZSSA001471\",\"VZSSA001483\",\"VZSSA001495\",\"VZSSA001500\",\"VZSSA001512\",\"VZSSA001524\",\"VZSSA001536\",\"VZSSA001541\",\"VZSSA001553\",\"VZSSA001565\",\"VZSSA001570\",\"VZSSA001582\",\"VZSSA001594\",\"VZSSA001606\",\"VZSSA001611\",\"VZSSA001623\",\"VZSSA001635\",\"VZSSA001640\",\"VZSSA001652\",\"VZSSA001664\",\"VZSSA001676\",\"VZSSA001681\",\"VZSSA001693\",\"VZSSA001705\",\"VZSSA001710\",\"VZSSA001722\",\"VZSSA001734\",\"VZSSA001746\",\"VZSSA001751\",\"VZSSA001763\",\"VZSSA001775\",\"VZSSA001780\",\"VZSSA001792\",\"VZSSA001804\",\"VZSSA001816\",\"VZSSA001821\",\"VZSSA001833\",\"VZSSA001845\",\"VZSSA001850\",\"VZSSA001862\",\"VZSSA001874\",\"VZSSA001886\",\"VZSSA001891\",\"VZSSA001903\",\"VZSSA001915\",\"VZSSA001920\",\"VZSSA001932\",\"VZSSA001944\",\"VZSSA001956\",\"VZSSA001961\",\"VZSSA001973\",\"VZSSA001990\",\"VZSSA002002\",\"VZSSA002014\",\"VZSSA002026\",\"VZSSA002031\",\"VZSSA002043\",\"VZSSA002055\",\"VZSSA002060\",\"VZSSA002072\",\"VZSSA002084\",\"VZSSA002096\",\"VZSSA002101\",\"VZSSA002113\",\"VZSSA002125\",\"VZSSA002130\",\"VZSSA002142\",\"VZSSA002154\",\"VZSSA002171\",\"VZSSA002183\",\"VZSSA002195\",\"VZSSA002212\",\"VZSSA002224\",\"VZSSA002236\",\"VZSSA002241\",\"VZSSA002253\",\"VZSSA002265\",\"VZSSA002270\",\"VZSSA002282\",\"VZSSA002294\",\"VZSSA002306\",\"VZSSA002311\",\"VZSSA002323\",\"VZSSA002335\",\"VZSSA002340\",\"VZSSA002352\",\"VZSSA002364\",\"VZSSA002376\",\"VZSSA002381\",\"VZSSA002393\",\"VZSSA002405\",\"VZSSA002410\",\"VZSSA002422\",\"VZSSA002434\",\"VZSSA002446\",\"VZSSA002451\",\"VZSSA002463\",\"VZSSA002475\",\"VZSSA002480\",\"VZSSA002492\",\"VZSSA002504\",\"VZSSA002521\",\"VZSSA002545\",\"VZSSA002550\",\"VZSSA002562\",\"VZSSA002574\",\"VZSSA002586\",\"VZSSA002591\",\"VZSSA002603\",\"VZSSA002620\",\"VZSSA002644\",\"VZSSA002656\",\"VZSSA002673\",\"VZSSA002685\",\"VZSSA002690\",\"VZSSA002702\",\"VZSSA002714\",\"VZSSA002726\",\"VZSSA002731\",\"VZSSA002743\",\"VZSSA002755\",\"VZSSA002760\",\"VZSSA002772\",\"VZSSA002784\",\"VZSSA002796\",\"VZSSA002813\",\"VZSSA002825\",\"VZSSA002830\",\"VZSSA002842\",\"VZSSA002854\",\"VZSSA002866\",\"VZSSA002871\",\"VZSSA002883\",\"VZSSA002900\",\"VZSSA002912\",\"VZSSA002924\",\"VZSSA002936\",\"VZSSA002941\",\"VZSSA002953\",\"VZSSA002965\",\"VZSSA002970\",\"VZSSA002982\",\"VZSSA003006\",\"VZSSA003011\",\"VZSSA003023\",\"VZSSA003035\",\"VZSSA003040\",\"VZSSA003052\",\"VZSSA003064\",\"VZSSA003076\",\"VZSSA003081\",\"VZSSA003093\",\"VZSSA003105\",\"VZSSA003110\",\"VZSSA003122\",\"VZSSA003146\",\"VZSSA003151\",\"VZSSA003163\",\"VZSSA003175\",\"VZSSA003180\",\"VZSSA003192\",\"VZSSA003204\",\"VZSSA003216\",\"VZSSA003221\",\"VZSSA003233\",\"VZSSA003245\",\"VZSSA003250\",\"VZSSA003262\",\"VZSSA003274\",\"VZSSA003286\",\"VZSSA003291\",\"VZSSA003315\",\"VZSSA003320\",\"VZSSA003344\",\"VZSSA003356\",\"VZSSA003361\",\"VZSSA003373\",\"VZSSA003385\",\"VZSSA003390\",\"VZSSA003402\",\"VZSSA003414\",\"VZSSA003426\",\"VZSSA003431\",\"VZSSA003443\",\"VZSSA003460\",\"VZSSA003472\",\"VZSSA003484\",\"VZSSA003496\",\"VZSSA003501\",\"VZSSA003513\",\"VZSSA003525\",\"VZSSA003530\",\"VZSSA003542\",\"VZSSA003554\",\"VZSSA003566\",\"VZSSA003571\",\"VZSSA003583\",\"VZSSA003595\",\"VZSSA003600\",\"VZSSA003612\",\"VZSSA003624\",\"VZSSA003636\",\"VZSSA003641\",\"VZSSA003653\",\"VZSSA003665\",\"VZSSA003670\",\"VZSSA003682\",\"VZSSA003706\",\"VZSSA003723\",\"VZSSA003735\",\"VZSSA003740\",\"VZSSA003752\",\"VZSSA003764\",\"VZSSA003776\",\"VZSSA003781\",\"VZSSA003793\",\"VZSSA003805\",\"VZSSA003810\",\"VZSSA003822\",\"VZSSA003834\",\"VZSSA003846\",\"VZSSA003851\",\"VZSSA003863\",\"VZSSA003875\",\"VZSSA003892\",\"VZSSA003904\",\"VZSSA003916\",\"VZSSA003921\",\"VZSSA003933\",\"VZSSA003945\",\"VZSSA003950\",\"VZSSA003962\",\"VZSSA003974\",\"VZSSA003986\",\"VZSSA003991\",\"VZSSA004003\",\"VZSSA004015\",\"VZSSA004020\",\"VZSSA004032\",\"VZSSA004044\",\"VZSSA004056\",\"VZSSA004061\",\"VZSSA004073\",\"VZSSA004085\",\"VZSSA004102\",\"VZSSA004114\",\"VZSSA004126\",\"VZSSA004131\",\"VZSSA004143\",\"VZSSA004155\",\"VZSSA004160\",\"VZSSA004172\",\"VZSSA004184\",\"VZSSA004196\",\"VZSSA004201\",\"VZSSA004213\",\"VZSSA004225\",\"VZSSA004230\",\"VZSSA004242\",\"VZSSA004254\",\"VZSSA004271\",\"VZSSA004283\",\"VZSSA004295\",\"VZSSA004300\",\"VZSSA004312\",\"VZSSA004324\",\"VZSSA004336\",\"VZSSA004341\",\"VZSSA004353\",\"VZSSA004365\",\"VZSSA004370\",\"VZSSA004382\",\"VZSSA004394\",\"VZSSA004406\",\"VZSSA004411\",\"VZSSA004423\",\"VZSSA004435\",\"VZSSA004440\",\"VZSSA004452\",\"VZSSA004464\",\"VZSSA004476\",\"VZSSA004481\",\"VZSSA004493\",\"VZSSA004505\",\"VZSSA004510\",\"VZSSA004522\",\"VZSSA004534\",\"VZSSA004546\",\"VZSSA004551\",\"VZSSA004563\",\"VZSSA004580\",\"VZSSA004604\",\"VZSSA004616\",\"VZSSA004621\",\"VZSSA004650\",\"VZSSA004662\",\"VZSSA004674\",\"VZSSA004686\",\"VZSSA004691\",\"VZSSA004703\",\"VZSSA004715\",\"VZSSA004720\",\"VZSSA004732\",\"VZSSA004744\",\"VZSSA004756\",\"VZSSA004761\",\"VZSSA004773\",\"VZSSA004785\",\"VZSSA004790\",\"VZSSA004802\",\"VZSSA004814\",\"VZSSA004826\",\"VZSSA004831\",\"VZSSA004843\",\"VZSSA004855\",\"VZSSA004860\",\"VZSSA004872\",\"VZSSA004884\",\"VZSSA004896\",\"VZSSA004901\",\"VZSSA004913\",\"VZSSA004925\",\"VZSSA004930\",\"VZSSA004942\",\"VZSSA004954\",\"VZSSA004966\",\"VZSSA004971\",\"VZSSA004995\",\"VZSSA005000\",\"VZSSA005012\",\"VZSSA005024\",\"VZSSA005036\",\"VZSSA005053\",\"VZSSA005065\",\"VZSSA005070\",\"VZSSA005082\",\"VZSSA005094\",\"VZSSA005106\",\"VZSSA005111\",\"VZSSA005123\",\"VZSSA005135\",\"VZSSA005140\",\"VZSSA005152\",\"VZSSA005164\",\"VZSSA005176\",\"VZSSA005181\",\"VZSSA005193\",\"VZSSA005205\",\"VZSSA005210\",\"VZSSA005234\",\"VZSSA005246\",\"VZSSA005251\",\"VZSSA005263\",\"VZSSA005275\",\"VZSSA005280\",\"VZSSA005292\",\"VZSSA005304\",\"VZSSA005316\",\"VZSSA005321\",\"VZSSA005333\",\"VZSSA005345\",\"VZSSA005350\",\"VZSSA005362\",\"VZSSA005374\",\"VZSSA005386\",\"VZSSA005391\",\"VZSSA005403\",\"VZSSA005415\",\"VZSSA005420\",\"VZSSA005432\",\"VZSSA005444\",\"VZSSA005456\",\"VZSSA005461\",\"VZSSA005485\",\"VZSSA005490\",\"VZSSA005502\",\"VZSSA005514\",\"VZSSA005526\",\"VZSSA005531\",\"VZSSA005543\",\"VZSSA005555\",\"VZSSA005560\",\"VZSSA005572\",\"VZSSA005584\",\"VZSSA005596\",\"VZSSA005601\",\"VZSSA005613\",\"VZSSA005625\",\"VZSSA005630\",\"VZSSA005642\",\"VZSSA005654\",\"VZSSA005671\",\"VZSSA005683\",\"VZSSA005695\",\"VZSSA005700\",\"VZSSA005712\",\"VZSSA005724\",\"VZSSA005736\",\"VZSSA005741\",\"VZSSA005753\",\"VZSSA005765\",\"VZSSA005770\",\"VZSSA005782\",\"VZSSA005794\",\"VZSSA005811\",\"VZSSA005823\",\"VZSSA005835\",\"VZSSA005852\",\"VZSSA005864\",\"VZSSA005876\",\"VZSSA005881\",\"VZSSA005893\",\"VZSSA005905\",\"VZSSA005922\",\"VZSSA005934\",\"VZSSA005946\",\"VZSSA005951\",\"VZSSA005963\",\"VZSSA005975\",\"VZSSA005980\",\"VZSSA005992\",\"VZSSA006004\",\"VZSSA006016\",\"VZSSA006021\",\"VZSSA006033\",\"VZSSA006045\",\"VZSSA006050\",\"VZSSA006062\",\"VZSSA006086\",\"VZSSA006091\",\"VZSSA006103\",\"VZSSA006115\",\"VZSSA006120\",\"VZSSA006132\",\"VZSSA006156\",\"VZSSA006161\",\"VZSSA006173\",\"VZSSA006190\",\"VZSSA006202\",\"VZSSA006214\",\"VZSSA006226\",\"VZSSA006231\",\"VZSSA006243\",\"VZSSA006272\",\"VZSSA006284\",\"VZSSA006301\",\"VZSSA006313\",\"VZSSA006325\",\"VZSSA006330\",\"VZSSA006342\",\"VZSSA006354\",\"VZSSA006366\",\"VZSSA006371\",\"VZSSA006383\",\"VZSSA006395\",\"VZSSA006400\",\"VZSSA006412\",\"VZSSA006436\",\"VZSSA006441\",\"VZSSA006453\",\"VZSSA006465\",\"VZSSA006470\",\"VZSSA006482\",\"VZSSA006494\",\"VZSSA006506\",\"VZSSA006511\",\"VZSSA006523\",\"VZSSA006535\",\"VZSSA006540\",\"VZSSA006552\",\"VZSSA006564\",\"VZSSA006576\",\"VZSSA006581\",\"VZSSA006593\",\"VZSSA006605\",\"VZSSA006610\",\"VZSSA006622\",\"VZSSA006634\",\"VZSSA006646\",\"VZSSA006651\",\"VZSSA006663\",\"VZSSA006675\",\"VZSSA006692\",\"VZSSA006704\",\"VZSSA006716\",\"VZSSA006721\",\"VZSSA006733\",\"VZSSA006745\",\"VZSSA006750\",\"VZSSA006762\",\"VZSSA006774\",\"VZSSA006786\",\"VZSSA006791\",\"VZSSA006803\",\"VZSSA006815\",\"VZSSA006820\",\"VZSSA006832\",\"VZSSA006844\",\"VZSSA006856\",\"VZSSA006861\",\"VZSSA006873\",\"VZSSA006885\",\"VZSSA006902\",\"VZSSA006914\",\"VZSSA006926\",\"VZSSA006931\",\"VZSSA006943\",\"VZSSA006955\",\"VZSSA006960\",\"VZSSA006972\",\"VZSSA006984\",\"VZSSA006996\",\"VZSSA007001\",\"VZSSA007013\",\"VZSSA007025\",\"VZSSA007030\",\"VZSSA007042\",\"VZSSA007054\",\"VZSSA007066\",\"VZSSA007071\",\"VZSSA007083\",\"VZSSA007095\",\"VZSSA007100\",\"VZSSA007112\",\"VZSSA007124\",\"VZSSA007136\",\"VZSSA007141\",\"VZSSA007153\",\"VZSSA007165\",\"VZSSA007170\",\"VZSSA007182\",\"VZSSA007194\",\"VZSSA007211\",\"VZSSA007223\",\"VZSSA007235\",\"VZSSA007240\",\"VZSSA007252\",\"VZSSA007264\",\"VZSSA007276\",\"VZSSA007281\",\"VZSSA007293\",\"VZSSA007305\",\"VZSSA007310\",\"VZSSA007322\",\"VZSSA007334\",\"VZSSA007346\",\"VZSSA007351\",\"VZSSA007375\",\"VZSSA007392\",\"VZSSA007404\",\"VZSSA007416\",\"VZSSA007421\",\"VZSSA007433\",\"VZSSA007445\",\"VZSSA007450\",\"VZSSA007462\",\"VZSSA007474\",\"VZSSA007486\",\"VZSSA007491\",\"VZSSA007503\",\"VZSSA007515\",\"VZSSA007520\",\"VZSSA007532\",\"VZSSA007544\",\"VZSSA007556\",\"VZSSA007561\",\"VZSSA007573\",\"VZSSA007585\",\"VZSSA007590\",\"VZSSA007602\",\"VZSSA007614\",\"VZSSA007626\",\"VZSSA007631\",\"VZSSA007643\",\"VZSSA007655\",\"VZSSA007660\",\"VZSSA007672\",\"VZSSA007684\",\"VZSSA007696\",\"VZSSA007701\",\"VZSSA007713\",\"VZSSA007725\",\"VZSSA007730\",\"VZSSA007742\",\"VZSSA007754\",\"VZSSA007766\",\"VZSSA007771\",\"VZSSA007783\",\"VZSSA007795\",\"VZSSA007800\",\"VZSSA007812\",\"VZSSA007824\",\"VZSSA007836\",\"VZSSA007841\",\"VZSSA007853\",\"VZSSA007865\",\"VZSSA007870\",\"VZSSA007882\",\"VZSSA007891\",\"VZSSA007903\",\"VZSSA007915\",\"VZSSA014862\",\"VZSSA014874\",\"VZSSA014886\",\"VZSSA014891\",\"VZSSA014904\",\"VZSSA014916\",\"VZSSA014921\",\"VZSSA014933\",\"VZSSA014945\",\"VZSSA014950\",\"VZSSA014962\",\"VZSSA014974\",\"VZSSA014986\",\"VZSSA015003\",\"VZSSA015015\",\"VZSSA015020\",\"VZSSA015032\",\"VZSSA015044\",\"VZSSA015056\",\"VZSSA015061\",\"VZSSA015073\",\"VZSSA015085\",\"VZSSA015090\",\"VZSSA015102\",\"VZSSA015114\",\"VZSSA015126\",\"VZSSA015131\",\"VZSSA015160\",\"VZSSA015172\",\"VZSSA015184\",\"VZSSA015196\",\"VZSSA015201\",\"VZSSA015213\",\"VZSSA015242\",\"VZSSA015254\",\"VZSSA015283\",\"VZSSA015295\",\"VZSSA015300\",\"VZSSA015312\",\"VZSSA015324\",\"VZSSA015336\",\"VZSSA015341\",\"VZSSA015353\",\"VZSSA015365\",\"VZSSA015370\",\"VZSSA015382\",\"VZSSA015394\",\"VZSSA015406\",\"VZSSA015411\",\"VZSSA015423\",\"VZSSA015435\",\"VZSSA015440\",\"VZSSA015452\",\"VZSSA015463\",\"VZSSA015475\",\"VZSSA015480\",\"VZSSA015492\",\"VZSSA015504\",\"VZSSA015516\",\"VZSSA015521\",\"VZSSA015533\",\"VZSSA015545\",\"VZSSA015550\",\"VZSSA015562\",\"VZSSA015574\",\"VZSSA015586\",\"VZSSA015591\",\"VZSSA015603\",\"VZSSA015615\",\"VZSSA015620\",\"VZSSA015632\",\"VZSSA015644\",\"VZSSA015656\",\"VZSSA015661\",\"VZSSA015673\",\"VZSSA015685\",\"VZSSA015690\",\"VZSSA015702\",\"VZSSA015714\",\"VZSSA015726\",\"VZSSA015731\",\"VZSSA015743\",\"VZSSA015755\",\"VZSSA015760\",\"VZSSA015772\",\"VZSSA015784\",\"VZSSA015796\",\"VZSSA015801\",\"VZSSA015813\",\"VZSSA015825\",\"VZSSA015830\",\"VZSSA015842\",\"VZSSA015854\",\"VZSSA015866\",\"VZSSA015871\",\"VZSSA015895\",\"VZSSA015900\",\"VZSSA015912\",\"VZSSA015936\",\"VZSSA015941\",\"VZSSA015953\",\"VZSSA015965\",\"VZSSA015970\",\"VZSSA015982\",\"VZSSA015994\",\"VZSSA016006\",\"VZSSA016011\",\"VZSSA016023\",\"VZSSA016035\",\"VZSSA016040\",\"VZSSA016052\",\"VZSSA016076\",\"VZSSA016081\",\"VZSSA016093\",\"VZSSA016101\",\"VZSSA016113\",\"VZSSA016125\",\"VZSSA016130\",\"VZSSA016142\",\"VZSSA016154\",\"VZSSA016166\",\"VZSSA016171\",\"VZSSA016183\",\"VZSSA016195\",\"VZSSA016200\",\"VZSSA016212\",\"VZSSA016224\",\"VZSSA016236\",\"VZSSA016241\",\"VZSSA016253\",\"VZSSA016265\",\"VZSSA016270\",\"VZSSA016294\",\"VZSSA016306\",\"VZSSA016311\",\"VZSSA016323\",\"VZSSA016335\",\"VZSSA016340\",\"VZSSA016352\",\"VZSSA016364\",\"VZSSA016376\",\"VZSSA016381\",\"VZSSA016393\",\"VZSSA016405\",\"VZSSA016410\",\"VZSSA016422\",\"VZSSA016434\",\"VZSSA016446\",\"VZSSA016451\",\"VZSSA016463\",\"VZSSA016475\",\"VZSSA016480\",\"VZSSA016492\",\"VZSSA016504\",\"VZSSA016516\",\"VZSSA016521\",\"VZSSA016533\",\"VZSSA016545\",\"VZSSA016550\",\"VZSSA016562\",\"VZSSA016574\",\"VZSSA016586\",\"VZSSA016591\",\"VZSSA016603\",\"VZSSA016615\",\"VZSSA016620\",\"VZSSA016632\",\"VZSSA016644\",\"VZSSA016656\",\"VZSSA016661\",\"VZSSA016673\",\"VZSSA016685\",\"VZSSA016690\",\"VZSSA016702\",\"VZSSA016714\",\"VZSSA016726\",\"VZSSA016731\",\"VZSSA016743\",\"VZSSA016755\",\"VZSSA016760\",\"VZSSA016772\",\"VZSSA016784\",\"VZSSA016796\",\"VZSSA016801\",\"VZSSA016813\",\"VZSSA016825\",\"VZSSA016830\",\"VZSSA016842\",\"VZSSA016854\",\"VZSSA016866\",\"VZSSA016871\",\"VZSSA016883\",\"VZSSA016895\",\"VZSSA016900\",\"VZSSA016912\",\"VZSSA016924\",\"VZSSA016936\",\"VZSSA016941\",\"VZSSA016953\",\"VZSSA016965\",\"VZSSA016970\",\"VZSSA016982\",\"VZSSA016994\",\"VZSSA017006\",\"VZSSA017011\",\"VZSSA017023\",\"VZSSA017035\",\"VZSSA017040\",\"VZSSA017052\",\"VZSSA017064\",\"VZSSA017076\",\"VZSSA017081\",\"VZSSA017093\",\"VZSSA017105\",\"VZSSA017110\");\n} //fin de if($IdEstado == \"30\")\n\n//Condicion de estado-clues\nif($IdEstado == \"31\"){\n\t$Clues = array(\"YNSSA000022\",\"YNSSA000034\",\"YNSSA000046\",\"YNSSA000051\",\"YNSSA000063\",\"YNSSA000075\",\"YNSSA000092\",\"YNSSA000104\",\"YNSSA000116\",\"YNSSA000121\",\"YNSSA000133\",\"YNSSA000145\",\"YNSSA000150\",\"YNSSA000162\",\"YNSSA000174\",\"YNSSA000186\",\"YNSSA000203\",\"YNSSA000215\",\"YNSSA000220\",\"YNSSA000232\",\"YNSSA000244\",\"YNSSA000256\",\"YNSSA000273\",\"YNSSA000285\",\"YNSSA000290\",\"YNSSA000314\",\"YNSSA000326\",\"YNSSA000331\",\"YNSSA000343\",\"YNSSA000355\",\"YNSSA000360\",\"YNSSA000372\",\"YNSSA000384\",\"YNSSA000396\",\"YNSSA000401\",\"YNSSA000413\",\"YNSSA000425\",\"YNSSA000442\",\"YNSSA000454\",\"YNSSA000466\",\"YNSSA000471\",\"YNSSA000483\",\"YNSSA000524\",\"YNSSA000541\",\"YNSSA000553\",\"YNSSA000565\",\"YNSSA000570\",\"YNSSA000582\",\"YNSSA000606\",\"YNSSA000611\",\"YNSSA000623\",\"YNSSA000635\",\"YNSSA000640\",\"YNSSA000664\",\"YNSSA000676\",\"YNSSA000681\",\"YNSSA000693\",\"YNSSA000705\",\"YNSSA000710\",\"YNSSA000734\",\"YNSSA000746\",\"YNSSA000751\",\"YNSSA000763\",\"YNSSA000780\",\"YNSSA000792\",\"YNSSA000804\",\"YNSSA000821\",\"YNSSA000833\",\"YNSSA000845\",\"YNSSA000850\",\"YNSSA000862\",\"YNSSA000886\",\"YNSSA000891\",\"YNSSA000903\",\"YNSSA000915\",\"YNSSA000920\",\"YNSSA000932\",\"YNSSA000944\",\"YNSSA000956\",\"YNSSA000961\",\"YNSSA000973\",\"YNSSA000985\",\"YNSSA000990\",\"YNSSA001002\",\"YNSSA001014\",\"YNSSA001026\",\"YNSSA001031\",\"YNSSA001043\",\"YNSSA001055\",\"YNSSA001060\",\"YNSSA001072\",\"YNSSA001084\",\"YNSSA001096\",\"YNSSA001101\",\"YNSSA001113\",\"YNSSA001125\",\"YNSSA001130\",\"YNSSA001142\",\"YNSSA001154\",\"YNSSA001166\",\"YNSSA001171\",\"YNSSA001183\",\"YNSSA001195\",\"YNSSA001200\",\"YNSSA001212\",\"YNSSA001224\",\"YNSSA001236\",\"YNSSA001241\",\"YNSSA001253\",\"YNSSA001265\",\"YNSSA001270\",\"YNSSA001282\",\"YNSSA001294\",\"YNSSA001306\",\"YNSSA001311\",\"YNSSA001323\",\"YNSSA001335\",\"YNSSA001340\",\"YNSSA001352\",\"YNSSA001376\",\"YNSSA001393\",\"YNSSA001405\",\"YNSSA001422\",\"YNSSA001446\",\"YNSSA001451\",\"YNSSA001463\",\"YNSSA001475\",\"YNSSA001480\",\"YNSSA001492\",\"YNSSA001504\",\"YNSSA001516\",\"YNSSA001521\",\"YNSSA001533\",\"YNSSA001545\",\"YNSSA001550\",\"YNSSA001562\",\"YNSSA001574\",\"YNSSA001586\",\"YNSSA001591\",\"YNSSA001603\",\"YNSSA001615\",\"YNSSA001620\",\"YNSSA001632\",\"YNSSA001644\",\"YNSSA001656\",\"YNSSA001661\",\"YNSSA001702\",\"YNSSA001714\",\"YNSSA001726\",\"YNSSA001731\",\"YNSSA001743\",\"YNSSA013423\",\"YNSSA013435\",\"YNSSA013440\",\"YNSSA013452\",\"YNSSA013464\",\"YNSSA013476\",\"YNSSA013481\",\"YNSSA013510\",\"YNSSA013522\",\"YNSSA013534\",\"YNSSA013546\",\"YNSSA013551\",\"YNSSA013563\",\"YNSSA013575\",\"YNSSA013580\",\"YNSSA013604\",\"YNSSA013616\",\"YNSSA013621\",\"YNSSA013633\",\"YNSSA013645\",\"YNSSA013650\",\"YNSSA013662\",\"YNSSA013674\",\"YNSSA013684\",\"YNSSA013696\",\"YNSSA013701\",\"YNSSA013713\",\"YNSSA013725\",\"YNSSA013730\",\"YNSSA013742\",\"YNSSA013766\",\"YNSSA013771\",\"YNSSA013783\",\"YNSSA013795\",\"YNSSA013800\",\"YNSSA013812\",\"YNSSA013824\",\"YNSSA013836\",\"YNSSA013841\",\"YNSSA013853\",\"YNSSA013865\",\"YNSSA013870\",\"YNSSA013882\",\"YNSSA013894\",\"YNSSA013906\",\"YNSSA013911\",\"YNSSA013923\",\"YNSSA013935\",\"YNSSA013981\",\"YNSSA013993\",\"YNSSA014005\",\"YNSSA014010\",\"YNSSA014022\",\"YNSSA014034\",\"YNSSA014046\",\"YNSSA014051\",\"YNSSA014063\",\"YNSSA014075\",\"YNSSA014080\",\"YNSSA014092\",\"YNSSA014104\",\"YNSSA014116\",\"YNSSA014121\",\"YNSSA014133\",\"YNSSA014145\",\"YNSSA014150\",\"YNSSA014162\");\n} //fin de if($IdEstado == \"31\")\n\t\n\t\n\t$LocCampo = $Campo;\n\tif (strlen($LocCampo) == 11){\n\t\tif(!in_array($LocCampo,$Clues)){ \n\t\t\t$Error = $NumReg .\"|\".$DI_68.\"|\".$LocCampo.\"|\" . $DI_68_Catalogo.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse{\n\t\t$Error = $NumReg .\"|\".$DI_68.\"|\".$LocCampo.\"|\" . $DI_68_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function deletefinite($val1,$val2)\t// elimina la identificacion\n\t{\n $obj_Gurpo=new Conexion();\n $query=\"delete from fin where id_exp=$val1 and id_fin=$val2\";\n\t\t\t$obj_Gurpo->consulta($query); // ejecuta la consulta para borrar la identificacion\n\t\t\treturn '<div id=\"mensaje\"><p/><h4>Se Habilito el Expediente</h4></div>'; // retorna todos los registros afectados\n\n }", "public function ex4()\n {\n }", "function fncValidaDI_10($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_10 = \"(10)Clave del Servicio Profesional de Carrera (FUNCION)\";\n\t$DI_10_ErrTam = \"Tamaño de Clave del Servicio Profesional de Carrera (FUNCION) debe ser 2 dígitos\";\n\t$DI_10_CveInda = \"La cleve debe ser de 2 digitos\";\n\n\t\n\n /** Quita caracteres especiales **/\n\t//$LocCampo =preg_replace('/[^A-Za-z0-9\\-]/', '', $Campo);\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == DOS)\n\t{\n\t\tif(!preg_match (\"/\\d{2}/\" ,$LocCampo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_10.\"|\".$LocCampo.\"|\" . $DI_10_CveInda.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = 1;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_10.\"|\".$LocCampo.\"|\" . $DI_10_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = 1;\n\t}\n\treturn $Bandera;\n}", "function fncValidaDI_39($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_39 = \"(39)Indicador del Empleado - Estatus del Empleado\";\n\t$DI_39_ErrTam = \"Indicador del Empleado - Estatus del Empleado debe ser de 1 Digíto\";\n\t$DI_39_noDI \t = \"Indicador del Empleado - Estatus del Empleado no corresponde al catalogo establecido por DGRH(0,1,4)\";\n\n\t$IndEmpl = array(\"0\",\"2\",\"1\",\"4\",\"3\");\t\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == UNO)\n\t{\n\t\tif(!in_array($LocCampo, $IndEmpl))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_39.\"|\".$LocCampo.\"|\" . $DI_39_noDI.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_39.\"|\".$LocCampo.\"|\" . $DI_39_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function fncValidaDI_35($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_35 = \"(35)Horario Asignado\";\n\t$DI_35_ErrTam = \"Horario Asignado debe ser de 1 Digítos\";\n\t$DI_35_noDI \t = \"Horario Asignado no corresponde al catalogo establecidas por DGRH(1-8)\";\n\t\n\t\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == UNO)\n\t{\n\t\tif(!preg_match(\"/[1-8]{1}/\",$LocCampo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_35.\"|\".$LocCampo.\"|\" . $DI_35_noDI.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_35.\"|\".$LocCampo.\"|\" . $DI_35_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function refuseDix($nombre)\n{\n if ($nombre == 10){\n return 'ko'; // si le nombre est 10, l'exécution de la fonction s'arrête\n }\n return 'ok';\n}", "function fncValidaDI_32($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_32 = \"(32)Nivel de puesto - NIVEL\";\n\t$DI_32_ErrTam = \"Nivel de puesto - NIVEL debe ser de 2 Digítos\";\n\t$DI_32_noDI \t = \"Nivel de puesto - NIVEL no corresponde las Directivas Institucionales establecidas por DGRH\";\n\t\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == DOS)\n\t{\n\t\tif(!preg_match(\"/[0-9]{2}/\",$LocCampo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_32.\"|\".$LocCampo.\"|\" . $DI_32_noDI.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_32.\"|\".$LocCampo.\"|\" . $DI_32_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function addFormation($bdd, $notheme, $nosalle, $libelle, $datedeb, $heuredeb, $datefin, $heurefin, $intervention, $objectif, $prerequis, $contenu, $prixrepas, $nbreplaces)\n\t\t{\n\t\tif($objectif!=\"\"){\n\t\t\ttry{\n\t\t\t//ENVOI DE LA REQUETE A LA BDD\n\t\t\t$req = $bdd->prepare('INSERT INTO formation(NO_THEME, NO_SALLE, LIBELLE, DATE_DEB, HEURE_DEB, DATE_FIN, HEURE_FIN, INTERVENTION, OBJECTIF, PREREQUIS, CONTENU, PRIX_REPAS, NOMBRE_PLACE) VALUES(:NO_THEME, :NO_SALLE, :LIBELLE, :DATE_DEB, :HEURE_DEB, :DATE_FIN, :HEURE_FIN, :INTERVENTION, :OBJECTIF, :PREREQUIS, :CONTENU, :PRIX_REPAS, :NOMBRE_PLACE)');\n\t\t\t\t\t\t$req->execute(array(\n\t\t\t\t\t\t\t'NO_THEME'=>$notheme,\n\t\t\t\t\t\t\t'NO_SALLE'=>$nosalle,\n\t\t\t\t\t\t\t'LIBELLE'=>$libelle,\n\t\t\t\t\t\t\t'DATE_DEB'=>$datedeb,\n\t\t\t\t\t\t\t'HEURE_DEB'=>$heuredeb,\n\t\t\t\t\t\t\t'DATE_FIN'=>$datefin,\n\t\t\t\t\t\t\t'HEURE_FIN'=>$heurefin,\n\t\t\t\t\t\t\t'INTERVENTION'=>$intervention,\n\t\t\t\t\t\t\t'OBJECTIF'=>$objectif,\n\t\t\t\t\t\t\t'PREREQUIS'=>$prerequis,\n\t\t\t\t\t\t\t'CONTENU'=>$contenu,\n\t\t\t\t\t\t\t'PRIX_REPAS'=>$prixrepas,\n\t\t\t\t\t\t\t'NOMBRE_PLACE'=>$nbreplaces\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t \n\t\t\t\t\t\techo \"<div id='principal' class='container_12'>La formation a bien été ajouté. cliquez <a href='./accueil.php'>ici</a> pour retourner a la page d'accueil.</div>\";\n\n\t\t\t}catch(Exception $e){echo \"<div id='principal' class='container_12'>Une erreur lié aux données saisie empéche l'ajout du membre.<a href='http://localhost/ppec/accueil.php?content=creerFormation'>ici</a> pour retourner remplir le formulaire.</div>\";}\n\t\t}else{echo \"<div id='principal' class='container_12'>Le formulaire est vide. cliquez <a href='./accueil.php?content=creerFormation'>ici</a> pour retourner remplir le formulaire.</div>\";}\n\t\t\n\t\t\n\t\t\n\t}", "function fncValidaDI_19($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_19 = \"(19)Programa General\";\n\t$DI_19_ErrTam = \"Tamaño de Programa General debe ser dígito a 2 posicion\";\n\t$DI_19_PG \t = \"La Programa General no es parte del catalogo de DGRH\";\n\n\t\n\n /** Quita caracteres especiales **/\n\t//$LocCampo =preg_replace('/[^A-Za-z0-9\\-]/', '', $Campo);\n $PG= array(\"04\",\"09\",\"15\");\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == DOS)\n\t{\n\t\tif(!in_array($LocCampo,$PG))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_19.\"|\".$LocCampo.\"|\" . $DI_19_PG.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = 1;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_19.\"|\".$LocCampo.\"|\" . $DI_19_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = 1;\n\t}\n\treturn $Bandera;\n}", "function fncValidaDI_21($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_21 = \"(21)Proyecto Proceso\";\n\t$DI_21_ErrTam = \"Tamaño de Actividad Institucional debe ser a 4 Alfanumerico\";\n\t$DI_21_PP \t = \"La Proyecto Proceso no es parte del catalogo de DGRH\";\n\t\n $PP= array(\"1301\", \"E010\",\"E025\",\"I002\");\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == CUATRO)\n\t{\n\t\tif(!in_array($LocCampo,$PP))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_21.\"|\".$LocCampo.\"|\" . $DI_21_PP.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = 1;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_21.\"|\".$LocCampo.\"|\" . $DI_21_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = 1;\n\t}\n\treturn $Bandera;\n}", "public function Guardar(){\n\t\t\t$enlace = AccesoBD::Conexion();\n\t\t\t$sql = \"INSERT INTO denuncia (ID_VICTIMA, ES_LA_VICTIMA, DESCRIPCION_EVENTO, ASESORADO, \n\t\t\tASISTENCIA_PROFESIONAL, DENUNCIA_POLICIAL, PERPETRADOR_CONOCIDO, PROCEDIMIENTO_PERPETRADOR) VALUES ('$this->victima','$this->esLaVictima','$this->descripcionEvento','$this->yaAsesorado','$this->asistenciaProfesional',\n\t\t\t'$this->denunciaPolicial','$this->perpetradorConocido','$this->procedimientoPerpetrador')\";\n\t\t\tif ($enlace->query($sql) === TRUE) {\n \t\t\techo \"Nueva denuncia creada. Id de denuncia: \" . $enlace->insert_id;\n \t\t\treturn $enlace->insert_id;\n\t\t\t} else {\n \t\t\techo \"Error al guardar la denuncia \";\n\t\t\t}\n\t\t}", "function fncValidaDI_56($IdEstado, $GestorErr, $NumReg, $Campo){\n\t \n\t$Bandera = CERO;\n\t$DI_56 = \"(56)Neto\";\n\t$DI_56_ErrTam = \"Neto debe ser de 10 digitos y 2 decimales \";\n\t$DI_56_Catalogo = \"Neto no coincide con la directiva de calidad de la DGRH(9999999999.99)\";\n\t\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == 11){\n\t\tif(!preg_match(\"/[0-9]{8}.[0-9]{2}/\",$LocCampo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_56.\"|\".$LocCampo.\"|\" . $DI_56_Catalogo.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse{\n\t\t$Error = $NumReg .\"|\".$DI_56.\"|\".$LocCampo.\"|\" . $DI_56_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function died($error) {\n \n echo \"Oeps, de volgende dingen zijn er fout gegaan!<br />\";\n echo $error.\"<br /><br />\";\n die(); \n }", "function eliminarHerrajeaccesorio(){\n\t\t$this->procedimiento='snx.ft_herrajeaccesorio_ime';\n\t\t$this->transaccion='SNX_HAC_ELI';\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_herrajeaccesorio','id_herrajeaccesorio','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 insertCedulaPH( $idobra,$FfechaImp,$Flugar,$FanioImp,$FinscripTipo,$FinscripNro,$Fplano,$Fph,$Fcpartido,$Fnro1,$Fnro2,\n $FUcUf,$FcantUF, $Fanio, $FfechaAprob,$estadoNro,$estado, $FaCon, $FeCon, $Fcons,\n $FmedidasRA,$FimpInm, $FimpSel, $Fotrosph,$Fcod, $FefeMes, $FefeAnio,$FmedidasOb,\n $Fdestino, $FmedidasOp,$Fanexo,$FampAnexo){\n\n\t $sqlPH= \"INSERT INTO cedulaph(idCedulaPH, codObra,fechaImp,lugar,anioImp,inscripTipo,inscripNro, plano,ph,cpartido,nro1,nro2,\n\t\t unidad, cantUF, anio, fechaAprob, estadoNro, estado, aCon, eCon, cons,\n\t\t medidasRA,impInm, impSel, otrosph,cod, efeMes, efeAnio,medidasOb,\n\t\t destino, medidasOp,anexo,ampAnexo)\n\t VALUES ('','$idobra','$FfechaImp','$Flugar','$FanioImp','$FinscripTipo','$FinscripNro','$Fplano','$Fph','$Fcpartido','$Fnro1','$Fnro2',\n\t\t '$FUcUf','$FcantUF', '$Fanio', '$FfechaAprob','$estadoNro','$estado','$FaCon', '$FeCon', '$Fcons',\n\t\t '$FmedidasRA', '$FimpInm','$FimpSel', '$Fotrosph', '$Fcod', '$FefeMes', '$FefeAnio', '$FmedidasOb',\n\t\t '$Fdestino', '$FmedidasOp','$Fanexo','$FampAnexo')\";\n\n\t return $sqlPH;\n }", "function fncValidaDI_8($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = 0;\n\n\t$DI_8 = \"(8)Numero de Cuenta\";\n\t$DI_8_ErrTam = \"Tamaño de Numero de Cuenta debe ser 16 dígitos\";\n\t$DI_8_NumCta = \"No cumple con Directiva debe ser 16 digitos\";\n\n /** Quita caracteres especiales **/\n\t//$LocCampo =preg_replace('/[^A-Za-z0-9\\-]/', '', $Campo);\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == 16)\n\t{\n\t\tif(!preg_match (\"/\\d{16}/\" ,$LocCampo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_8.\"|\".$LocCampo.\"|\" . $DI_8_NumCta.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = 1;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_8.\"|\".$LocCampo.\"|\" . $DI_8_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = 1;\n\t}\n\treturn $Bandera;\n}", "function mira_pieza($Fk, $Ck)\n{\n $error2 = 0;\n $pos = ((8 - $Fk) * 8) + $Ck;\n $posicion = buscar_posicion($pos);\n $pieza_id = $posicion['pieza_id'];\n if ($pieza_id != 0) {\n $error2 = 1;\n }\n return $error2;\n}", "function id_unico(){\n\t//echo \"<br>:\".uniqid();\n\t//echo \"<br>:\".strtoupper(uniqid('',true));\n\t//echo \"<br>:\".strtoupper(uniqid('',true));\n\t$cad=strtoupper(uniqid('',true));\n\t$cad=str_replace(\".\", \"\",$cad);\n\t$cad=substr($cad, 0,20);\n\treturn $cad;\n}", "function fncValidaDI_16($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_16 = \"(16)Grupo Funcional\";\n\t$DI_16_ErrTam = \"Tamaño de Grupo Funcional debe ser dígito a 1 posicion\";\n\t$DI_16_GF = \"El grupo Funcional no es parte del catalogo de DGRH\";\n\n\t\n\n /** Quita caracteres especiales **/\n\t//$LocCampo =preg_replace('/[^A-Za-z0-9\\-]/', '', $Campo);\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == UNO)\n\t{\n\t\tif(!preg_match (\"/[1-4]{1}/\" ,$LocCampo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_16.\"|\".$LocCampo.\"|\" . $DI_16_GF.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = 1;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_16.\"|\".$LocCampo.\"|\" . $DI_16_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = 1;\n\t}\n\treturn $Bandera;\n}", "function imprimir_voucher_estacionamiento($numero,$chofer,$patente,$horainicio,$horatermino,$montototal,$comentario,$correlativopapel,$cliente,$fecha_termino,$fecha_inicio_2){\ntry {\n // Enter the share name for your USB printer here\n //$connector = null; \n //$connector = new WindowsPrintConnector(\"EPSON TM-T81 Receipt\");\n $connector = new WindowsPrintConnector(\"EPSON TM-T20 Receipt\");\n // $connector = new WindowsPrintConnector(\"doPDF 8\");\n /* Print a \"Hello world\" receipt\" */\n $printer = new Printer($connector);\n\n \n $date=new DateTime();\n $fecha = $date->format('d-m-Y');\n\n\n $Chofer = $chofer;\n $Patente = $patente;\n $serie = $numero;\n $img = EscposImage::load(\"logo1.png\");\n $printer -> graphics($img);\n \n \n $printer -> text(\"Numero : $serie\\n\");\n $printer -> text(\"Chofer : $Chofer\\n\");\n $printer -> text(\"Patente: $Patente\\n\");\n\n if ($cliente != 0) {\n include_once(\"conexion.php\");\n $con = new DB;\n $buscarpersona = $con->conectar();\n $strConsulta = \"select * from cliente where rut_cliente ='$cliente'\";\n $buscarpersona = mysql_query($strConsulta);\n $numfilas = mysql_num_rows($buscarpersona);\n $row = mysql_fetch_assoc($buscarpersona);\n $nombre_cliente = $row['nombre_cliente'];\n //var_dump($numfilas);\n if($numfilas >= 1){\n $printer -> text(\"Cliente: $nombre_cliente\\n\");\n }\n \n }\n \n if ($correlativopapel != 0) {\n $printer -> text(\"\\nCorrelativo : $correlativopapel\\n\");\n }\n $printer -> text(\"Fecha Inicio : $fecha_inicio_2\\n\");\n $printer -> text(\"Hora de inicio : $horainicio\\n\");\n\n\n\n if ($horatermino != 0) {\n $printer -> text(\"Fecha de Termino: $fecha_termino\\n\");\n $printer -> text(\"Hora de Termino : $horatermino\\n\"); \n }\n \n \n if ($montototal != 0) {\n $printer -> text('Monto total : $'.$montototal);\n }\n \n if ($horatermino != 0) {\n $printer -> text(\"\\n\");\n $printer -> text(\"\\n\\n\");\n $printer -> text(\"Firma: _________________\\n\");\n \n }\n $printer -> text(\"$comentario\\n\");\n $printer -> cut();\n /* Close printer */\n $printer -> close();\n\n echo \"<div class='alert alert-success'><strong>Impresion Correcta $comentario</strong></div>\";\n} catch (Exception $e) {\n echo \"No se pudo imprimir \" . $e -> getMessage() . \"\\n\";\n}\n}", "function fncValidaDI_20($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_20 = \"(20)Actividad Institucional\";\n\t$DI_20_ErrTam = \"Tamaño de Actividad Institucional debe ser dígito a 3 posicion\";\n\t$DI_20_AI \t = \"La Actividad Institucional no es parte del catalogo de DGRH\";\n\t\n $AI= array(\"002\",\"004\",\"015\",\"019\");\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == TRES)\n\t{\n\t\tif(!in_array($LocCampo,$AI))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_20.\"|\".$LocCampo.\"|\" . $DI_20_AI.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = 1;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_20.\"|\".$LocCampo.\"|\" . $DI_20_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = 1;\n\t}\n\treturn $Bandera;\n}", "function fncValidaDI_38($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_38 = \"(38)Nivel de puesto - Nivel de puesto SPC\";\n\t$DI_38_ErrTam = \"Nivel de puesto - Nivel de puesto SPC debe ser de 10 Digítos\";\n\t$DI_38_noDI \t = \"Nivel de puesto - Nivel de puesto SPC no corresponde al catalogo establecidas por DGRH\";\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == DIEZ)\n\t{\n\t\tif(!preg_match(\"/[0-9]{10}/\",$LocCampo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_38.\"|\".$LocCampo.\"|\" . $DI_38_noDI.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_38.\"|\".$LocCampo.\"|\" . $DI_38_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function toDie( $msg ) {\n\techo $msg;\n\tinclude( '/data/project/xtools/public_html/common/footer.php' );\n\tdie();\n}", "function Fecha_dia($Ingresodia){\t\n$dia1 = new DateTime($Ingresodia);\n$dia = $dia1->format('d');\n$cadena = (\"$dia\");\nreturn $cadena;\n}", "function __($cadena) {\n return idioma::traducir($cadena);\n}", "function ahoj($priezvisko)\n {\n echo \"Nazdar<br>\".$priezvisko;\n echo \"<br><br>\";\n }", "function fProcesaBanco(){\n global $db, $cla, $agPar, $igNumChq, $igSecue, $ogDet;\n $alDet = fIniDetalle();\n $alDet[\"det_codcuenta\"]\t= $cla->cla_ctaorigen; \n $alDet[\"det_glosa\"] \t= substr($agPar[\"com_Concepto\"],0, 50) . ' ' . substr($agPar[\"slBenef\"],0,20);\n $alDet['det_idauxiliar']= $agPar[\"com_Emisor\"];\n $alDet[\"det_numcheque\"]\t= $igNumChq;\t\t\t// es el numero de cheque\n $alDet[\"det_feccheque\"]\t= $agPar[\"com_FechCheq\"];\n $alDet['det_valdebito']\t= $agPar[\"flValor\"] * $cla->cla_indicador; // segun el signo del indicador, se aplica como DB/CR al grabar;\n $alDet['det_valcredito']\t= 0;\n $alDet['det_secuencia']\t= $igSecue;\n\tif(fGetParam(\"pAppDbg\",0)){\n\t\tprint_r($alDet);\n\t}\n\tfInsdetalleCont($db, $alDet);\n}", "function operdiario($mysqli,$cuenta,$tipoper,$tipom,$ref,$monto,$fecha,$sfactu,$subcta=NULL,$coment=NULL){\n\t\t//si el movimiento es debe = 0 o haber = else\n\t\t//determinacion de referencia orden de compra o pedido\n\t\tif($tipoper==0){$refe=\"oc\".$ref;}else{$refe=\"pd\".$ref;}\n\t\t//determinacion de tipo de movimiento\n\t\tif($tipom==0){\n\t\t\t$colum=\"debe\";\n\t\t}else{\n\t\t\t$colum=\"haber\";\n\t\t}\n\t\t$mysqli->query(\"INSERT INTO diario(cuenta,referencia,$colum,fecha,facturar,subcuenta,coment)\n VALUES($cuenta,'$refe',$monto,'$fecha',$sfactu,'$subcta','$coment')\")\n\t\tor die(\"Error en registro contable: \".mysqli_error($mysqli));\n}", "function agrega_emergencia_ctraslado (\n $_fecha,$_telefono,\n $_plan,$_horallam,\n $_socio,$_nombre,\n $_tiposocio,$_edad,$_sexo,\n $_identificacion,$_documento,\n $_calle,$_numero,\n $_piso,$_depto,\n $_casa,$_monoblok,\n $_barrio,$_entre1,\n $_entre2,$_localidad,\n $_referencia,$_zona,\n $_motivo1,\n $_color,\n $_observa1,$_observa2,\n $_opedesp ,\n\t\t\t\t\t\t\t$_nosocio1 , $_noedad1 , $_nosexo1, $_noiden1 , $_nodocum1 ,\n\t\t\t\t\t\t\t$_nosocio2 , $_noedad2 , $_nosexo2, $_noiden2 , $_nodocum2 ,\n\t\t\t\t\t\t\t$_nosocio3 , $_noedad3 , $_nosexo3, $_noiden3 , $_nodocum3 ,\n\t\t\t\t\t\t\t$_nosocio4 , $_noedad4 , $_nosexo4, $_noiden4 , $_nodocum4 ,\n\t\t\t\t\t\t\t$_nosocio5 , $_noedad5 , $_nosexo5, $_noiden5 , $_nodocum5 ,\n $_bandera_nosocio1 ,$_bandera_nosocio2 ,$_bandera_nosocio3 ,$_bandera_nosocio4 ,\n\t\t\t\t\t\t\t$_bandera_nosocio5 \n )\n{\n $moti_explode ['0'] = substr($_motivo1, 0, 1);\n $moti_explode ['1'] = substr($_motivo1, 1, 2);\n\n // CALCULO DE FECHA Y DIA EN QUE SE MUESTRA EL TRASLADO EN PANTALLA\n $fecha_aux = explode (\".\" ,$_fecha );\n $hora_aux = explode (\":\" ,$_horallam);\n\n $_dia_tr =$fecha_aux[2];\n $_mes_tr =$fecha_aux[1];\n $_anio_tr =$fecha_aux[0];\n $_hora_tr =$hora_aux[0];\n $_min_tr =$hora_aux[1];\n $_param_tr =12; // parametro para mostrar en pantalla\n \n $traslado_aux = restaTimestamp ($_dia_tr , $_mes_tr, $_anio_tr , $_hora_tr , $_min_tr , $_param_tr);\n //***********************************************************\n $_plan = $_plan + 0;\n $insert_atencion = '\n insert into atenciones_temp\n (fecha,telefono,plan,\n horallam,socio,\n nombre,tiposocio,\n edad,sexo,\n identificacion,documento,\n calle,numero,\n piso,depto,casa,\n monoblok,barrio,\n entre1,entre2,\n localidad,referencia,\n zona,motivo1,\n motivo2,\n color,observa1,\n observa2,operec,traslado_aux ,fechallam)\n\n values\n\n (\n \"'.$_fecha.'\" , \"'.$_telefono.'\" , \"'.$_plan.'\" ,\n \"'.$_horallam.'\",\"'.$_socio.'\",\n \"'.utf8_decode($_nombre).'\",\"'.$_tiposocio.'\",\n \"'.$_edad.'\",\"'.$_sexo.'\",\n \"'.utf8_decode($_identificacion).'\",\"'.$_documento.'\",\n \"'.utf8_decode($_calle).'\",\"'.utf8_decode($_numero).'\",\n \"'.utf8_decode($_piso).'\",\"'.utf8_decode($_depto).'\",\n \"'.utf8_decode($_casa).'\",\"'.utf8_decode($_monoblok).'\",\n \"'.utf8_decode($_barrio).'\",\"'.utf8_decode($_entre1).'\",\n \"'.utf8_decode($_entre2).'\",\"'.utf8_decode($_localidad).'\",\n \"'.utf8_decode($_referencia).'\",\"'.$_zona.'\",\n '.$moti_explode[0].',\n '.$moti_explode[1].','.$_color.',\n \"'.utf8_decode($_observa1).'\",\"'.utf8_decode($_observa2).'\",\n \"'.utf8_decode($_opedesp).'\", \"'.$traslado_aux.'\" , \"'.$_fecha.'\"\n )\n ';\n\n // insert de la emergencia en atenciones temp\n global $G_legajo , $parametros_js;\n $result = mysql_query($insert_atencion);\n if (!$result) {\n $boton = '<input type=\"button\" value=\"Error! modificar y presionar nuevamente\"\n\t\t\t onclick=\" check_emergencia(\n\t\t\t document.formulario.muestra_fecha.value,document.formulario.telefono.value,\n\t\t\t document.formulario.i_busca_plan.value,document.formulario.hora.value,\n\t\t\t document.formulario.td_padron_idpadron.value,document.formulario.td_padron_nombre.value,\n\t\t\t document.formulario.td_padron_tiposocio.value,document.formulario.td_padron_edad.value,\n\t\t\t document.formulario.td_padron_sexo.value,document.formulario.td_padron_identi.value,\n\t\t\t document.formulario.td_padron_docum.value,document.formulario.td_padron_calle.value,\n\t\t\t document.formulario.td_padron_nro.value,document.formulario.td_padron_piso.value,\n\t\t\t document.formulario.td_padron_depto.value,document.formulario.td_padron_casa.value,\n\t\t\t document.formulario.td_padron_mon.value,document.formulario.td_padron_barrio.value,\n\t\t\t document.formulario.td_padron_entre1.value,document.formulario.td_padron_entre2.value,\n\t\t\t document.formulario.td_padron_localidad.value,document.formulario.referencia.value,\n\t\t\t document.formulario.s_lista_zonas.value,document.formulario.i_busca_motivos.value,\n\t\t\t document.formulario.s_lista_colores.value,document.formulario.obs1.value,\n\t\t\t document.formulario.obs2.value,'.$G_legajo.' ,\n\t\t\t document.formulario.check_traslado.value , document.formulario.dia_traslado.value ,\n\t\t\t document.formulario.mes_traslado.value , document.formulario.anio_traslado.value ,\n\t\t\t document.formulario.hora_traslado.value , document.formulario.minuto_traslado.value ,\n\t\t\t\t\t '.$parametros_js.' \n \t );\"/> ';\n \n }else \n {\n $boton = '<input type=\"button\" value=\"CERRAR CON EXITO\" onclick=\"window.close();\"/>';\n \n\n\n\t // recupero id para hacer altas de clientes no apadronados\n\t $consulta_id = mysql_query ('select id from atenciones_temp\n\t where fecha = \"'.$_fecha.'\" and plan = \"'.$_plan.'\"\n\t and horallam = \"'.$_horallam.'\" and nombre = \"'.$_nombre.'\"\n\t and tiposocio = \"'.$_tiposocio.'\" and motivo1 = '.$moti_explode[0].'\n\t and motivo2 = '.$moti_explode[1]);\n\n\n\t $fetch_idatencion=mysql_fetch_array($consulta_id);\n\n\n\t\tif ($_bandera_nosocio1 == 1) { $insert_nosocio1 = mysql_query ('insert into clientes_nopadron (idatencion , nombre , edad , sexo , os , dni) values (\"'.$fetch_idatencion['id'].'\" , \"'.$_nosocio1.'\" , \"'.$_noedad1.'\" , \"'.$_nosexo1.'\" , \"'.$_noiden1.'\" , \"'.$_nodocum1.'\" ) '); }\n\t\tif ($_bandera_nosocio2 == 1) { $insert_nosocio2 = mysql_query ('insert into clientes_nopadron (idatencion , nombre , edad , sexo , os , dni) values (\"'.$fetch_idatencion['id'].'\" , \"'.$_nosocio2.'\" , \"'.$_noedad2.'\" , \"'.$_nosexo2.'\" , \"'.$_noiden2.'\" , \"'.$_nodocum2.'\" ) '); }\n\t\tif ($_bandera_nosocio3 == 1) { $insert_nosocio3 = mysql_query ('insert into clientes_nopadron (idatencion , nombre , edad , sexo , os , dni) values (\"'.$fetch_idatencion['id'].'\" , \"'.$_nosocio3.'\" , \"'.$_noedad3.'\" , \"'.$_nosexo3.'\" , \"'.$_noiden3.'\" , \"'.$_nodocum3.'\" ) '); }\n\t\tif ($_bandera_nosocio4 == 1) { $insert_nosocio4 = mysql_query ('insert into clientes_nopadron (idatencion , nombre , edad , sexo , os , dni) values (\"'.$fetch_idatencion['id'].'\" , \"'.$_nosocio4.'\" , \"'.$_noedad4.'\" , \"'.$_nosexo4.'\" , \"'.$_noiden4.'\" , \"'.$_nodocum4.'\" ) '); }\n\t\tif ($_bandera_nosocio5 == 1) { $insert_nosocio5 = mysql_query ('insert into clientes_nopadron (idatencion , nombre , edad , sexo , os , dni) values (\"'.$fetch_idatencion['id'].'\" , \"'.$_nosocio5.'\" , \"'.$_noedad5.'\" , \"'.$_nosexo5.'\" , \"'.$_noiden5.'\" , \"'.$_nodocum5.'\" ) '); }\n }\n // mysql_query($insert_atencion);\n $insert_atencion='';\n //$insert_atencion='';\n //instanciamos el objeto para generar la respuesta con ajax\n $respuesta = new xajaxResponse();\n //escribimos en la capa con id=\"respuesta\" el texto que aparece en $salida\n $respuesta->addAssign(\"mensaje_agrega\",\"innerHTML\",$boton);\n\n //tenemos que devolver la instanciaci�n del objeto xajaxResponse\n return $respuesta;\n}", "function fncValidaDI_9($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = 0;\n\n\t$DI_9 = \"(9)Clave del Banco (CLABE)\";\n\t$DI_9_ErrTam = \"Tamaño de Clave del Banco (CLABE) debe ser 18 dígitos\";\n\t$DI_9_NumCta = \"No cumple con Directiva debe ser 18 digitos\";\n\n\t\n\n /** Quita caracteres especiales **/\n\t//$LocCampo =preg_replace('/[^A-Za-z0-9\\-]/', '', $Campo);\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == 18)\n\t{\n\t\tif(!preg_match (\"/\\d{18}/\" ,$LocCampo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_8.\"|\".$LocCampo.\"|\" . $DI_8_NumCta.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = 1;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_9.\"|\".$LocCampo.\"|\" . $DI_9_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = 1;\n\t}\n\treturn $Bandera;\n}", "function XSACreditNote($InvoiceNo, $orderno, $debtorno, $TypeInvoice,$tag,$serie,$folio, &$db)\n{\n\t$arrBDAplicar = array('erpplacacentro','erpplacacentro_CAPA','erpplacacentro_DES' );\n\t$charelectronic='01';\n\t$charelectronic=$charelectronic.'|'.$serie;\n\t$serieelect=$serie;\n\t//$serieelect=$TypeInvoice.'-'.$_SESSION['Tagref'];\n\t$folioelect=$folio;//$InvoiceNoTAG;\n\t//$folioelect=$InvoiceNo;\n\t$charelectronic=$charelectronic.'|'.$serieelect;\n\t$charelectronic=$charelectronic.'|'.$folioelect;\n\t// consulto datos de la factura\n\t$imprimepublico=0;\n\t$InvoiceHeaderSQL = \"SELECT DISTINCT\n\t\t\t\treplace(debtortrans.trandate,'-','/') as trandate,\n\t\t\t\t(debtortrans.ovamount*-1) as ovamount,\n\t\t\t\t(debtortrans.ovdiscount*-1) as ovdiscount,\n\t\t\t\t(debtortrans.ovgst*-1) as ovgst,\n\t\t\t\tdebtorsmaster.name,\n\t\t\t\tdebtorsmaster.address1,debtorsmaster.address2,\n\t\t\t\tdebtorsmaster.address3,debtorsmaster.address4,debtorsmaster.address5,\n\t\t\t\tdebtorsmaster.address6,debtorsmaster.invaddrbranch,\n\t\t\t\tcustbranch.taxid as rfc,\n\t\t\t\tcustbranch.brname,\n\t\t\t\tcustbranch.braddress1,custbranch.braddress2,custbranch.braddress3,\n\t\t\t\tcustbranch.braddress4,custbranch.braddress5,custbranch.braddress6,\n\t\t\t\tcustbranch.brpostaddr1,custbranch.brpostaddr2,custbranch.brpostaddr3,\n\t\t\t\tcustbranch.brpostaddr4,custbranch.brpostaddr5,custbranch.brpostaddr6,\n\t\t\t\tdebtortrans.debtorno,debtortrans.branchcode,debtortrans.folio,\n\t\t\t\treplace(origtrandate,'-','/') as origtrandate,\n\t\t\t\tdebtortrans.currcode,\n\t\t\t\tcustbranch.branchcode,\n\t\t\t\tdebtortrans.tpe,\n\t\t\t\tdebtortrans.shipvia,\n\t\t\t\t(debtortrans.ovfreight*-1) as ovfreight,\n\t\t\t\tdebtortrans.rate AS cambio,\n\t\t\t\tdebtorsmaster.currcode as moneda,\n\t\t\t\tcustbranch.defaultlocation,\n\t\t\t\tcustbranch.brnumext,\n\t\t\t\tcustbranch.brnumint,\n\t\t\t\t\";\n\t$InvoiceHeaderSQL = $InvoiceHeaderSQL . \"\n\t\t\t\tlocations.taxprovinceid,\n\t\t\t\tdebtortrans.tagref,\n\t\t\t\tcustbranch.phoneno as telofi,\n\t\t\t\tIFNULL(paymentmethods.codesat,'') as paymentname,\n\t\t\tdebtortrans.nocuenta\n\t\t\tFROM debtortrans \n\t\t\t\tLEFT JOIN paymentmethods ON debtortrans.paymentname = paymentmethods.paymentname\n\t\t\t\tINNER JOIN debtorsmaster ON debtortrans.debtorno = debtorsmaster.debtorno\n\t\t\t\tINNER JOIN custbranch ON debtortrans.debtorno = custbranch.branchcode\n\t\t\t\tINNER JOIN currencies ON debtorsmaster.currcode = currencies.currabrev\n\t\t\t\tINNER JOIN stockmoves ON stockmoves.transno=debtortrans.transno\n\t\t\t\tINNER JOIN locations ON stockmoves.loccode = locations.loccode\n\t\t\tWHERE debtortrans.transno = \" . $InvoiceNo . \"\n\t\t\t\tAND debtortrans.type=11\n\t\t\t\tAND stockmoves.type=11\";\n \n\t$Result=DB_query($InvoiceHeaderSQL,$db);\n\tif (DB_num_rows($Result)>0) {\n\t\t$myrow = DB_fetch_array($Result);\n\t\t// fecha emision\n\t\t$fechainvoice=$myrow['origtrandate'];\n\t\t$UserRegister=$myrow['UserRegister'];\n\t\t$charelectronic=$charelectronic.'|'.$fechainvoice;\n\t\t// subtotal\n\t\t$rfccliente=str_replace(\"-\",\"\",$myrow['rfc']);\n\t\t$rfccliente=str_replace(\" \",\"\",$rfccliente);\n\t\t$nombre=$myrow['name'];\n\t\t$subtotal= number_format($myrow['ovamount'], 2, '.', '');\n\t\tif (strlen($rfccliente)<12){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= number_format($myrow['ovamount']+$myrow['ovgst'], 2, '.', '');\n\t\t\t$imprimepublico=1;\n\t\t}elseif(strlen($rfccliente)>=14){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= number_format($myrow['ovamount']+$myrow['ovgst'], 2, '.', '');\n\t\t\t$imprimepublico=1;\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$subtotal;\n\t\t// total factura\n\t\t$total=number_format($myrow['ovamount']+$myrow['ovgst'],2,'.','');\n\n\t\t$charelectronic=$charelectronic.'|'.$total;\n\t\t// total de iva\n\t\t$iva=number_format($myrow['ovgst'],'.','');\n\t\t// transladado\n\t\t$charelectronic=$charelectronic.'|'.$iva;\n\t\t// retenido\n\t\t$ivaret=0;\n\t\t$charelectronic=$charelectronic.'|'.$ivaret;\n\t\t//descuento trae desde el stockmoves\n\t\tif ($rfccliente!=\"XAXX010101000\"){\n\t\t\t$sqldiscount = 'SELECT sum(totaldescuento) as descuento\n\t\t\t\t FROM stockmoves\n\t\t\t\t WHERE stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\t\t\t$Result= DB_query($sqldiscount,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$descuento=0;\n\t\t\t}else{\n\t\t\t\t$myrowdis = DB_fetch_array($Result);\n\t\t\t\t$descuento=number_format($myrowdis['descuento'],2,'.','');\n\t\t\t}\n\t\t}else{\n\t\t\t$sqldiscount = 'SELECT sum(totaldescuento+(IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)*totaldescuento)) as descuento\n\t\t\t \t\t\tFROM stockmoves inner join stockmaster on stockmaster.stockid=stockmoves.stockid\n\t\t\t\t\t\t\t-- LEFT JOIN taxauthrates ON stockmaster.taxcatid = taxauthrates.taxcatid\n\t\t\t\t\t\t\tLEFT JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno\n\t\t\n\t\t\t\t\t \t\tWHERE stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\t\t\t$Result= DB_query($sqldiscount,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$descuento=0;\n\t\t\t}else{\n\t\t\t\t$myrowdis = DB_fetch_array($Result);\n\t\t\t\t$descuento=number_format($myrowdis['descuento'],2,'.','');\n\t\t\t}\n\t\t}\n\t\t//descuento\n\t\t$descuento=number_format($descuento,2,'.','');\n\t\t$charelectronic=$charelectronic.'|'.$descuento;\n\t\t//motivo descuento\n\t\t$charelectronic=$charelectronic.'|';\n\t\t// tipo de moneda\n \n\t\t$moneda=$myrow['currcode'];\n \n\t\t// CANTIDAD CON LETRAS\n\t\t$amount = number_format($myrow['ovamount'],3);\n\t\t$ovgst = number_format($myrow['ovgst'],2);\n\t\t$rountotal = $amount + $ovgst ;\n\t\t$rountotal = number_format($rountotal,2);\n\t\t$totaletras=round($myrow['ovamount']+$myrow['ovgst'],2);\n\n\t\t$totalx=str_replace(',','',$total);\n\n\t\t$separa=explode(\".\",$totalx);\n\t\t$montoletra = $separa[0];\n\n\t\t$separa2=explode(\".\",$totalx,4);//\n\t\t$montoctvs2 = $separa2[1];\n\t\t$montoletra=Numbers_Words::toWords($montoletra,'es');\n\t\t//$montocentavos=Numbers_Words::toWords($montoctvs2,'es');\n\t\tif ($moneda=='MXN'){\n\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\" /100 M.N.\";\n\t\t}//\n\t\telse\n\t\t{\n\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/100 USD\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$montoletra;\n\t\t// tipo moneda\n\t\t$charelectronic=$charelectronic.'|'.$moneda;\n\t\t// tipo de cambio\n\t\t$rate=number_format($myrow['cambio'],6,'.','');\n\t\t$charelectronic=$charelectronic.'|'.$rate;\n\t\t// numero de orden para referencia\n\t\t$ordenref=$myrow['orderno'];\n\t\t$charelectronic=$charelectronic.'|'.$ordenref;\n\t\t// observaciones 1: vendedores\n\t\t$vendedor=\"\";\n\t\t$SQL=\" SELECT *\n\t\t FROM salesman\n\t\t WHERE salesmancode='\".$myrow['salesman'].\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowsales = DB_fetch_array($Result);\n\t\t\t$vendedor=$myrowsales['salesmanname'];\n\t\t}\n\t\t$observaciones1='Vendedor: '.$myrow['salesman'].' '.$vendedor;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones1;\n\t\t// observaciones 2\n\t\t$SQL=\" SELECT l.telephone,l.comments,t.tagdescription\n\t\t FROM legalbusinessunit l, tags t\n\t\t WHERE l.legalid=t.legalid AND tagref='\".$tag.\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowtags = DB_fetch_array($Result);\n\t\t\t$telephone=trim($myrowtags['telephone']);\n\t\t\t$comments=trim($myrowtags['comments']);\n\t\t}\n\t\t$observaciones2=\" Atencion a clientes \" .$telephone;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones2;\n\t\t$metodopago = $myrow['paymentname'];\n\t\tif ($metodopago==\"\") {\n\t\t\t$metodopago = \"99\";\n\t\t}\n\t\t\n\t\t$nocuenta = $myrow['nocuenta'];\n\t\tif ($nocuenta==\"\") {\n\t\t\t$nocuenta = \"No Identificado\";\n\t\t}\n\t\t\n\t\t\n\t\t// observaciones 3\n\t\t$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones3;\n\t\t\n\t\t//$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$nocuenta;\n\t\t// datos de la forma de pago\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'02';\n\t\t\n\t\t$terminospago=$myrow['terms'];\n\t\t$SQL=\" SELECT *\n\t\t FROM debtortrans\n\t\t WHERE debtortrans.type=70\n\t\t\tAND debtortrans.order_=\" . $InvoiceNo ;\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==0) {\n\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t}else{\n\t\t\t$Tipopago=\"Parcialidades\";\n\t\t}\n\t\t$Tipopago=$Tipopago.' '.$terminospago;\n\t\t//$Tipopago=$terminospago;\n\t\t$charelectronic=$charelectronic.'|'.$Tipopago;\n\t\t// condiciones de pago\n\t\t$charelectronic=$charelectronic.'|Genera Interes Moratorio 3 % mensual/credito';\n\t\t// metodo de pago\n\t//\t$metodopago='varios';\n\t\t$charelectronic=$charelectronic.'|'.$metodopago;\n\t\t// fecha vencimiento\n\t\t$fechavence=$myrow['trandate'];\n\t\t$charelectronic=$charelectronic.'|'.$fechavence;\n\t\t// observaciones 4\n\t\t$observaciones4=$observaciones3;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones4;\n\t\t// datos del cliente\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'03';\n\t\t$branch=$myrow['debtorno'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\n\t\tif (in_array($_SESSION['DatabaseName'], $arrBDAplicar)) {\n\t\t\t$charelectronic=$charelectronic.'|';\n\t\t}\n\t\telse{\n\t\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t}\n\t\t\n\t\t$calle=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$calle=$myrow['address1'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=\"\";\n\n\t\tif ($imprimepublico==0 || in_array($_SESSION['DatabaseName'], $arrBDAplicar)){\n $colonia=$myrow['address2'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$municipio=$myrow['address3'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$edo=$myrow['address4'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$cp=$myrow['address5'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t// datos del custbranch\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'04';\n\t\t$branch=$myrow['branchcode'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t//$rfc=$myrow['rfc'];\n\t\t//$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$nombre=$myrow['name'];\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=$myrow['braddress1'];\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=$myrow['braddress6'];\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=$myrow['braddress2'];\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=$myrow['braddress4'];\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\n\t}\n\t// cadena para datos de los productos\n\t// productos vendidos\n\t$charelectronicdetail='';\n\t$charelectronicinidet='|'.chr(13).chr(10).'05';\n\t// datos de ivas\n\t$charelectronictaxs='';\n\t$charelectronictaxsini='|'.chr(13).chr(10).'07';\n\tif ($_SESSION['DecimalPlacesInvoice']==''){\n\t\t$_SESSION['DecimalPlacesInvoice']=6;\n\t}\n\t$decimalplaces=$_SESSION['DecimalPlacesInvoice'];\n\tif ($rfccliente!=\"XAXX010101000\"){\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))- totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\t$nolinea=0;\n\t\t$descrprop=\"\";\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=number_format($myrow2['quantity'],4,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT DISTINCT p.InvoiceValue AS val,\n\t\t\t\t\t\t\t p.complemento,\n\t\t\t\t\t\t\t sp.label\n\t\t\t\t\t\t\tFROM salesstockproperties p,\n\t\t\t\t\t\t\t stockcatproperties sp,\n\t\t\t\t\t\t\t stockmaster sm\n\t\t\t\t\t\t\tWHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t\t\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t\t\t\t AND p.typedocument=11\n\t\t\t\t\t\t\t AND sp.reqatprint=1\n\t\t\t\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0) {\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t} else {\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\tswitch ($myrowprop['val']) {\n\t\t\t\t\tcase 'Interno':\n\t\t\t\t\t\t$sqlbomb = \"SELECT class FROM stockclass WHERE idclass = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['class'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Externo':\n\t\t\t\t\t\t$sqlbomb = \" SELECT suppname FROM suppliers WHERE supplierid = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['suppname'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\n\t\t\t$descrnarrative=\"\";\n\t\t\t$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM notesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrownarrative['narrative']));\n $descrnarrative = str_replace('|', '-', $descrnarrative);\n\t\t\t}\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\t\t\t// consultar cantidad restante para tyqsa en remisones contra orden de trabajo\n\t\t\t/*$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM notesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";*/\n\t\t\t\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescrip.$descrprop.$descrnarrative;\n\t\t\t\n\t\t\t//IF($_SESSION)\n\t\t\t//ECHO $charelectronicdetail;\n\t\t\t$stockprecio=number_format($myrow2['fxprice'],6,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=number_format($myrow2['fxnet'],6,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=number_format($myrow2['discountpercent']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=number_format($myrow2['discountpercent1']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=number_format($myrow2['discountpercent2']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$nameaduana='';\n\t\t\t$numberaduana='';\n\t\t\t$fechaaduana='';\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$nolinea=$nolinea+1;\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,\n\t\t\t\t\t\ttaxcalculationorder,taxontax,\n\t\t\t\t\t\ttaxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description']; \n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=number_format($myrow3['taxrate']*100,2,'.','');\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=number_format($myrow3['taxrate']*($myrow2['subtotal'] - $totalRowAnticipo),6,'.','');\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\n\t\t\t}\n\n\t\t}\n\t}else{\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))-totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\t\t\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t\t(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)))) AS fxnet,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))))-totaldescuento as subtotal,\n\t\t\t\t\t\t(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t stockcategory.MensajePV\n\t\t\t\t\tFROM stockmoves inner join stockmaster ON stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\t\t\t\tinner join stockcategory on stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\t\t\t\t\tleft JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid';\n\t\t\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=number_format($myrow2['quantity'],$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT DISTINCT p.InvoiceValue AS val,\n\t\t\t\t\t\t\t p.complemento,\n\t\t\t\t\t\t\t sp.label\n\t\t\t\t\t\t\tFROM salesstockproperties p,\n\t\t\t\t\t\t\t stockcatproperties sp,\n\t\t\t\t\t\t\t stockmaster sm\n\t\t\t\t\t\t\tWHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t\t\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t\t\t\t AND p.typedocument=\" . $TypeInvoice . \"\n\t\t\t\t\t\t\t AND sp.reqatprint=1\n\t\t\t\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0) {\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t} else {\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\tswitch ($myrowprop['val']) {\n\t\t\t\t\tcase 'Interno':\n\t\t\t\t\t\t$sqlbomb = \"SELECT class FROM stockclass WHERE idclass = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['class'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Externo':\n\t\t\t\t\t\t$sqlbomb = \" SELECT suppname FROM suppliers WHERE supplierid = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['suppname'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\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\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){//\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\t\t\tif($myrow2['MensajePV'] <> \"\"){\n\t\t\t\t$descrprop = $descrprop.$myrow2['MensajePV'];\n\t\t\t}\n\t\t\t$descrnarrative=\"\";\n\t\t\t/*$sqlnarrative=\"SELECT narrative\n\t\t\t FROM salesorderdetails p\n\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\tAND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t$descrnarrative=$myrownarrative['narrative'];\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t}*/\n\t\t\t\t\n\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrow2['narrative']));\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t\t\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\t\t\tif($myrow2['showdescription']==1){\n\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t}else{\n\t\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescripuno=$descrnarrative;\n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t$stockprecio=number_format($myrow2['fxprice'],$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=number_format($myrow2['fxnet'],$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=number_format($myrow2['discountpercent']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=number_format($myrow2['discountpercent1']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=number_format($myrow2['discountpercent2']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t//$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t// consulta de aduana\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$almacen=$myrow2['almacen'];\n\t\t\t\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,taxcalculationorder,taxontax,taxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=number_format($myrow3['taxrate']*100,'.','');\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=number_format($myrow3['taxrate']*($myrow2['subtotal']),6,'.','');\n\t\t\t\t//$taxtotalratex=$myrow3['taxrate']*($myrow2['fxnet']*$myrow2['fxprice']);\n\t\t\t\t$taxtotalratex=number_format($myrow3['taxrate']*($myrow2['subtotal']),6);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\t\t\t\n\t\t\t$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t\n\t\t\t$sqladuana=\"SELECT stockserialitems.customs as aduana,customs_number as noaduana,\n\t\t\t\t\tpedimento, DATE_FORMAT(customs_date,'%Y-%m-%d') as fechaaduana\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$numberaduana=\"\";\n\t\t\t\t$fechaaduana=\"\";\n\t\t\t}else{\n\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t$aduana=$myrowaduana['aduana'];\n\t\t\t\t$separaaduana=explode(\"|\",$aduana);\n\t\t\t\t$nameaduana = $separaaduana[0];\n\t\t\t\t$numberaduana= $separaaduana[1];\n\t\t\t\t$fechaaduana= $separaaduana[2];\n\t\t\t\tif (strlen($nameaduana)==0 or strlen($numberaduana)==0 /*or !Is_Date($fechaaduana)*/){\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$numberaduana=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t}\n\t}\n\t// ivas retenidos\n\t$charelectronictaxsret='|'.chr(13).chr(10);//.'07|ISR|0.00';\n\tif ($rfccliente==\"XAXX010101000\"){\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronicEmbarque.$totalCantEmision;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\t}else{\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxs.$charelectronictaxsret.$charelectronicEmbarque.$totalCantEmision;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\n\t}\n\t\n\t//echo '<pre><br>'.$cadenaenviada; \n\treturn $cadenaenviada;\n}", "function insertVoucher(){\n $db =new Database();\n $query=\"INSERT INTO `gutscheine`(`GutscheinID`, `Wert`, `Gueltigkeit`, `Eingeloest`) VALUES \"\n .\"('\".$this->gutscheinID.\"','\".$this->wert.\"','\".$this->gueltigkeit.\"','\".$this->eingeloest.\"')\";\n $db->insert($query);\n }", "function fncValidaDI_23($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_23 = \"(23)Puesto\";\n\t$DI_23_ErrTam = \"Tamaño de Puesto debe ser a 7 Alfanumerico\";\n\t$DI_23_Pto \t = \"El Puesto no es parte del catalogo de DGRH\";\n\t\n $Pto= array(\"CFKA003\",\n\"CFKB003\",\n\"CFOB003\",\n\"OP98542\",\n\"M02057\",\n\"M02074\",\n\"M02078\",\n\"AM98582\",\n\"AM98592\",\n\"CF41027\",\n\"CF41054\",\n\"CFGB002\",\n\"CFHB001\",\n\"CFIC002\",\n\"CFJB001\",\n\"CFKB002\",\n\"OP98552\",\n\"M01007\",\n\"M02055\",\n\"M02065\",\n\"M02106\",\n\"M04005\",\n\"CF41003\",\n\"CF41022\",\n\"CF41041\",\n\"CF41049\",\n\"CFJA003\",\n\"CFMA003\",\n\"CFMC002\",\n\"CFNA002\",\n\"CFPA002\",\n\"CFPB003\",\n\"CFPC002\",\n\"M01003\",\n\"M02007\",\n\"M02013\",\n\"M02024\",\n\"M02035\",\n\"M02040\",\n\"M02049\",\n\"M02062\",\n\"M02066\",\n\"M02083\",\n\"M02085\",\n\"M02094\",\n\"M02105\",\n\"M03002\",\n\"M03009\",\n\"M03024\",\n\"CF41001\",\n\"CF41007\",\n\"CF41009\",\n\"CF41012\",\n\"CF41043\",\n\"CF41087\",\n\"CFGA002\",\n\"CFGC001\",\n\"CFGC002\",\n\"CFHA003\",\n\"CFIA002\",\n\"CFIB002\",\n\"CFJB002\",\n\"CFJC001\",\n\"CFJC003\",\n\"CFKA002\",\n\"CFKB001\",\n\"CFKC001\",\n\"CFLA002\",\n\"CFLC001\",\n\"CFMA002\",\n\"CFMB003\",\n\"CFMC001\",\n\"CFMC003\",\n\"CFPQ002\",\n\"MP98512\",\n\"PS98692\",\n\"RS98592\",\n\"M01008\",\n\"M01012\",\n\"M02001\",\n\"M02016\",\n\"M02019\",\n\"M02021\",\n\"M02029\",\n\"M02060\",\n\"M02076\",\n\"M02093\",\n\"M02097\",\n\"M02108\",\n\"M03003\",\n\"M03005\",\n\"M03006\",\n\"M03018\",\n\"M03021\",\n\"M03023\",\n\"M04001\",\n\"CF40001\",\n\"CF40002\",\n\"CF40003\",\n\"CF41010\",\n\"CF41016\",\n\"CF41024\",\n\"CF41028\",\n\"CF41032\",\n\"CF41044\",\n\"CF41048\",\n\"CF41052\",\n\"CF41057\",\n\"CF41058\",\n\"CF41060\",\n\"CF41063\",\n\"CF41075\",\n\"CFGB001\",\n\"CFGB003\",\n\"CFGC003\",\n\"CFHA001\",\n\"CFHB002\",\n\"CFHC001\",\n\"CFHC002\",\n\"CFHC003\",\n\"CFIA003\",\n\"CFIC001\",\n\"CFJB003\",\n\"CFKA001\",\n\"CFLB001\",\n\"CFLC002\",\n\"CFMA001\",\n\"CFNB002\",\n\"CFNB003\",\n\"CFOA002\",\n\"CFOB001\",\n\"CFOC003\",\n\"CFPA003\",\n\"CFPB002\",\n\"EP98571\",\n\"MP98532\",\n\"OP98562\",\n\"CFLB13\",\n\"M01006\",\n\"M02009\",\n\"M02010\",\n\"M02011\",\n\"M02012\",\n\"M02018\",\n\"M02032\",\n\"M02037\",\n\"M02042\",\n\"M02044\",\n\"M02046\",\n\"M02051\",\n\"M02059\",\n\"M02061\",\n\"M02069\",\n\"M02075\",\n\"M02089\",\n\"M02090\",\n\"M02112\",\n\"M03012\",\n\"M04003\",\n\"R12033\",\n\"CF41004\",\n\"CF41011\",\n\"CF41013\",\n\"CF41015\",\n\"CF41018\",\n\"CF41025\",\n\"CF41039\",\n\"CF41040\",\n\"CF41042\",\n\"CF41045\",\n\"CF41056\",\n\"CF41059\",\n\"CF41064\",\n\"CFGA003\",\n\"CFHA002\",\n\"CFIA001\",\n\"CFIB003\",\n\"CFJA001\",\n\"CFJC002\",\n\"CFKC002\",\n\"CFKC003\",\n\"CFLA003\",\n\"CFLB003\",\n\"CFLC003\",\n\"CFMB002\",\n\"CFMB023\",\n\"CFNA001\",\n\"CFNA003\",\n\"CFNB001\",\n\"CFNB037\",\n\"CFNC002\",\n\"CFNC003\",\n\"CFOA001\",\n\"CFOA003\",\n\"CFOB002\",\n\"CFPC003\",\n\"CFPQ003\",\n\"EP98582\",\n\"CFNC001\",\n\"CFOC001\",\n\"CFPA001\",\n\"CFPB001\",\n\"CFPC001\",\n\"CFPQ001\",\n\"CF41047\",\n\"CF41055\",\n\"CF41062\",\n\"CF41065\",\n\"CF41074\",\n\"CF41076\",\n\"CF41077\",\n\"CF41088\",\n\"EP98572\",\n\"MP98522\",\n\"M01002\",\n\"M01004\",\n\"M01005\",\n\"M01009\",\n\"M01010\",\n\"M01011\",\n\"M01015\",\n\"M02003\",\n\"M02004\",\n\"M02006\",\n\"M02008\",\n\"M02014\",\n\"M02015\",\n\"M02017\",\n\"M02020\",\n\"M02022\",\n\"M02023\",\n\"M02031\",\n\"M02034\",\n\"M02036\",\n\"M02038\",\n\"M02043\",\n\"M02047\",\n\"M02048\",\n\"M02050\",\n\"M02054\",\n\"M02056\",\n\"M02058\",\n\"M02063\",\n\"M02064\",\n\"M02067\",\n\"M02068\",\n\"M02072\",\n\"M02073\",\n\"M02077\",\n\"M02081\",\n\"M02084\",\n\"M02086\",\n\"M02091\",\n\"M02095\",\n\"M02096\",\n\"M02098\",\n\"M02107\",\n\"M02110\",\n\"M02113\",\n\"M03001\",\n\"M03004\",\n\"M03007\",\n\"M03010\",\n\"M03013\",\n\"M03019\",\n\"M03020\",\n\"M03022\",\n\"M03025\",\n\"M04002\",\n\"M04004\",\n\"M04011\",\n\"M04012\",\n\"PS98592\",\n\"RS98572\",\n\"RS98582\",\n\"M02100\",\n\"M02101\",\n\"M02109\",\n\"MCT8002\",\n\"MP98510\",\n\"IP98510\",\n\"CF01012\",\n\"CF01059\",\n\"CF21135\",\n\"CF21905\",\n\"CF34068\",\n\"CF34245\",\n\"CF40004\",\n\"CF41002\",\n\"CF41006\",\n\"CF41008\",\n\"CF41014\",\n\"CF41026\",\n\"CF41030\",\n\"CF41038\",\n\"CF41046\",\n\"CF34246\",\n\"CF34260\",\n\"CF34261\",\n\"CF34263\",\n\"CF52000\",\n\"CF41089\",\n\"CF41090\",\n\"M01016\",\n\"M02114\",\n\"M02115\",\n\"M02116\",\n\"M02117\",\n\"M02118\",\n\"M02119\",\n\"M02120\",\n\"CF52348\",\n\"CF53083\",\n\"CFMC03\",\n\"CFMD09\",\n\"CFMD12\",\n\"CFMG06\",\n\"CFMG08\",\n\"CFMS06\",\n\"CFMS08\",\n\"CF01035\",\n\"M02079\",\n\"M02041\",\n\"M02030\",\n\"M02025\",\n\"CF41050\",\n\"CF41037\",\n\"CF41036\",\n\"CF41023\",\n\"CF41017\",\n\"CF52254\",\n\"M02080\",\n\"CF01037\",\n\"CF01038\",\n\"CF01041\",\n\"CF01043\",\n\"CF01046\",\n\"CF01048\",\n\"CF01050\",\n\"CF01052\",\n\"CF01055\",\n\"CF01057\",\n\"CF01060\",\n\"CF01061\",\n\"CF01062\",\n\"CF01071\",\n\"CF01120\",\n\"CF01773\",\n\"CF01776\",\n\"CF01781\",\n\"CF01784\",\n\"CF01786\",\n\"CF01787\",\n\"CF01789\",\n\"CF01907\",\n\"CF01908\",\n\"CF01909\",\n\"CF01910\",\n\"CF01911\",\n\"CF01913\",\n\"CF01914\",\n\"CF01915\",\n\"CF01916\",\n\"CF01917\",\n\"CF21323\",\n\"CF21325\",\n\"CF21326\",\n\"CF51018\",\n\"CF51082\",\n\"CF52339\",\n\"CF52343\",\n\"CF52349\",\n\"CF52383\",\n\"CF52384\",\n\"CF52387\",\n\"CF52389\",\n\"CF52394\",\n\"CF52395\",\n\"CF52397\",\n\"CF52402\",\n\"CF52404\",\n\"CF52405\",\n\"CF52407\",\n\"CF52820\",\n\"CF52937\",\n\"M04006\",\n\"CF01030\",\n\"M01014\",\n\"M02002\",\n\"M02082\",\n\"M02088\",\n\"M03008\",\n\"M03011\",\n\"AM98572\",\n\"CFLA001\",\n\"CFLB002\",\n\"CFMB001\",\n\"CFOC002\",\n\"EP98592\",\n\"M02005\",\n\"M02045\",\n\"M02087\",\n\"M02092\",\n\"M02111\",\n\"CF41031\",\n\"CF41061\",\n\"CF50000\",\n\"CF51000\",\n\"CFGA001\",\n\"CFHB003\",\n\"CFIB001\",\n\"CFIC003\",\n\"CFJA002\");\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == SIETE)\n\t{\n\t\tif(!in_array($LocCampo,$Pto))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_23.\"|\".$LocCampo.\"|\" . $DI_23_Pto.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_23.\"|\".$LocCampo.\"|\" . $DI_23_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function buenosDias(){\n return \"Hola! buenos días!!\".salto;\n}", "function eliminarUcedifobracivil(){\n\t\t$this->procedimiento='snx.ft_ucedifobracivil_ime';\n\t\t$this->transaccion='SNX_UDOC_ELI';\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_ucedifobracivil','id_ucedifobracivil','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 fncValidaDI_33($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_33 = \"(33)Rango\";\n\t$DI_33_ErrTam = \"Rango debe ser de 1 Digítos\";\n\t$DI_33_noDI \t = \"Rango no corresponde las Directivas Institucionales establecidas por DGRH (1,2,3)\";\n\t\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == UNO)\n\t{\n\t\tif(!preg_match(\"/[0-9]{1}/\",$LocCampo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_33.\"|\".$LocCampo.\"|\" . $DI_33_noDI.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_33.\"|\".$LocCampo.\"|\" . $DI_33_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function fncValidaDI_4($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = 0;\n\n\t$DI_4 = \"(4)Nombre del Empleado\";\n\t$DI_4_ErrTam = \"Tamaño de registro debe ser 150 Caracteres\";\n\t$DI_4_ErrIdEdo = \"Identificador de estado Invalido\";\n\t$DI_4_ErrEstructura = \"EL campo no cumple con estructura definida PATERNO,MATERNO/NOMBRE(S)\";\n\n /** Quita caracteres especiales **/\n\t//$LocCampo =preg_replace('/[^A-Za-z0-9\\-]/', '', $Campo);\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) <= 150)\n\t{\n\t\tif(!preg_match (\"/[?,A-Z,a-z,\\s]{1,90},[?,A-Z,a-z,\\s]{1,90}\\/[?.A-Z,a-z,\\s]{1,90}/\" ,$LocCampo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_4.\"|\".$LocCampo.\"|\" . $DI_4_ErrEstructura.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = 1;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_4.\"|\".$LocCampo.\"|\" . $DI_4_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = 1;\n\t}\n\treturn $Bandera;\n}", "function insertarHerrajeaccesorio(){\n\t\t$this->procedimiento='snx.ft_herrajeaccesorio_ime';\n\t\t$this->transaccion='SNX_HAC_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('herrajeaccesorio','herrajeaccesorio','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 fncValidaDI_18($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_18 = \"(18)SubFuncion\";\n\t$DI_18_ErrTam = \"Tamaño de SubFunción debe ser dígito a 2 posicion\";\n\t$DI_18_SF \t = \"La SubFuncion no es parte del catalogo de DGRH\";\n\n\t\n\n /** Quita caracteres especiales **/\n\t//$LocCampo =preg_replace('/[^A-Za-z0-9\\-]/', '', $Campo);\n $SF= array(\"01\",\"02\",\"03\",\"04\",\"10\",\"15\",\"05\");\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == DOS)\n\t{\n\t\tif(!in_array($LocCampo,$SF))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_18.\"|\".$LocCampo.\"|\" . $DI_18_SF.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = 1;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_18.\"|\".$LocCampo.\"|\" . $DI_18_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = 1;\n\t}\n\treturn $Bandera;\n}", "function despacho_ocupado($despacho)\n{\n\tglobal $con;\n\t//parche para libre\n\t//if($despacho == 23)\n\t\t//$param = \"LIBRE JUNTAS\";\n\t//else \n\t\t//$param = \"LIBRE \".$despacho;\n\t//$sql = \"Select * from clientes where Nombre like '$param'\";\n\t//$consulta = @mysql_query($sql,$con);\n\t//if(@mysql_numrows($consulta!=0))\n\t\t//$ocupado=0;\n\t//else\n\t//{\n\t\tif($despacho<=9)\n\t\t\t$despacho = \"000\".$despacho;\n\t\telse\n\t\t\t$despacho = \"00\".$despacho;\n\t\t$sql=\"Select * from z_sercont where servicio like 'Codigo Negocio' and valor like '$despacho'\";\n\t\t$consulta = @mysql_query($sql,$con);\n\t\tif(@mysql_numrows($consulta)!=0)\n\t\t\t$ocupado=1;\n\t\telse\n\t\t\t$ocupado=0;\n\t//}\n\treturn $ocupado;\n}", "function Comprobar_codcentro()\n{\n\t$correcto = true;\n\n\t//si se cumple la condicion\n\tif (strlen($this->CODCENTRO)<3)\n\t{\n\t\t$error = array();\n\t\t\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"CODCENTRO\");\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"00003\");\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"Valor de atributo no numérico demasiado corto\");\n\n\t\t//guarda un mensaje de error\n\t\tarray_push($this->erroresdatos, $error);\n\t\t$correcto = false;\n\t}\n\t//si se cumple la condicion\n\tif (strlen($this->CODCENTRO)>10)\n\t{\n\t\t$error = array();\n\t\t\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"CODCENTRO\");\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"00002\");\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"Valor de atributo demasiado largo\");\n\n\t\t//guarda un mensaje de error\n\t\tarray_push($this->erroresdatos, $error);\n\t\t$correcto = false;\n\t}\n\t//si se cumple la condicion\n\tif (!preg_match(\"/^[A-Za-zñáéíóúÑÁÉÍÓÚüÜ\\-0-9]+$/\",$this->CODCENTRO)){\n\t\t$error = array();\n\t\t\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"CODCENTRO\");\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"00040\");\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"Solo están permitidas alfabéticos, números y el “-”\");\n\n\t\t//guarda un mensaje de error\n\t\tarray_push($this->erroresdatos, $error);\n\t\t$correcto = false;\n\t}\n\t\n\treturn $correcto;//se devuelve el resultado\n}", "function fncValidaDI_29($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_29 = \"(29)Pagaduria\";\n\t$DI_29_ErrTam = \"Tamaño de campo Pagaduria debe ser a 5 Caracters\";\n\t$DI_29_Pgria \t = \"Pagaduria no corresponde las reglas de negocio establecidas por DGRH\";\n\t\n\t\n\t// agregar catalogo de Municpios\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == CINCO)\n\t{\n\t\tif(!preg_match(\"/[A-Za-z0-9]{5}/\",$LocCampo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_29.\"|\".$LocCampo.\"|\" . $DI_29_Pgria.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_29.\"|\".$LocCampo.\"|\" . $DI_29_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function espace($valeur){\r\n\t$chaine = substr(\"$valeur\",0,-4).\" \".substr(\"$valeur\",4);\r\n\treturn $chaine;\r\n}", "function deletedrvs($val1,$val2)\t// elimina la identificacion\n\t{\n $obj_Gurpo=new Conexion();\n $query=\"delete from derivacion where id_exp=$val1 and id_drv=$val2\";\n\t\t\t$obj_Gurpo->consulta($query); // ejecuta la consulta para borrar la identificacion\n\t\t\treturn '<div id=\"mensaje\"><p/><h4>Se elimino la derivación con exito</h4></div>'; // retorna todos los registros afectados\n\n }", "function info()\n{\nglobal $client; ←\u0004\nLa programmation objet\nCHAPITRE 9 249\n//Utilisation de variables globales et d'un tableau superglobal\necho \"<h2> Bonjour $client, vous êtes sur le serveur: \",\n➥$_SERVER[\"HTTP_HOST\"],\"</h2>\"; ←\u0007\necho \"<h3>Informations en date du \",date(\"d/m/Y H:i:s\"),\"</h3>\";\necho \"<h3>Bourse de {$this–>bourse[0]} Cotations de {$this–>bourse[1]}\n➥à {$this–>bourse[2]} </h3>\"; ←\u0005\n//Informations sur les horaires d'ouverture\n$now=getdate();\n$heure= $now[\"hours\"];\n$jour= $now[\"wday\"];\necho \"<hr />\";\necho \"<h3>Heures des cotations</h3>\";\nif(($heure>=9 && $heure <=17)&& ($jour!=0 && $jour!=6))\n{ echo \"La Bourse de Paris ( \", self:: PARIS,\" ) est ouverte\n➥<br>\"; } ←\u0006\nelse\n{ echo \"La Bourse de Paris ( \", self:: PARIS,\" ) est fermée <br>\"; }", "function traduire_devise($code_devise) {\n\tinclude_spip('inc/devises');\n\n\t$devises = prix_objets_devises_disponibles();\n\t$trad = $devises[$code_devise];\n\n\treturn $trad;\n}", "public function getCodigoViaje(){\n\t\t$codigo = 'VPI';\n\t\t$codigo .= '-'.str_pad($this->nroViaje['valor'], 4, '0', STR_PAD_LEFT);\n\t\treturn $codigo;\n\t}", "function Err()\n{\n ob_end_clean();\n fprintf (STDERR, \"Chyba - Zadan spatny pocet argumentu, spatne typy operandu nebo vase instrukce neodpovida zadnemu regularnimu vyrazu!\\n\");\n exit(23);\n}", "function saludo(){\n echo \"<hr>\";\n echo \"Buenas tardes aprendices, bienvenidos a las clases de PHP\";\n echo \"<hr>\";\n }", "function divorced() \n { \n $this->marsta_id=\"D\";\n $this->marsta_name=\"Divorced\";\n return($this->marsta_id);\n }", "function Comprobar_nombrecentro()\n{\n\t$correcto = true;\n\n\t//si se cumple la condicion\n\tif (strlen($this->NOMBRECENTRO)<3)\n\t{\n\t\t$error = array();\n\t\t\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"NOMBRECENTRO\");\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"00003\");\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"Valor de atributo no numérico demasiado corto\");\n\n\t\t//guarda un mensaje de error\n\t\tarray_push($this->erroresdatos, $error);\n\t\t$correcto = false;\n\t}\n\t//si se cumple la condicion\n\tif (strlen($this->NOMBRECENTRO)>50)\n\t{\n\t\t$error = array();\n\t\t\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"NOMBRECENTRO\");\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"00002\");\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"Valor de atributo demasiado largo\");\n\n\t\t//guarda un mensaje de error\n\t\tarray_push($this->erroresdatos, $error);\n\t\t$correcto = false;\n\t}\n\t//si se cumple la condicion\n\tif (!preg_match(\"/^[A-Za-zñáéíóúÑÁÉÍÓÚüÜ ]+$/\",$this->NOMBRECENTRO)){\n\t\t$error = array();\n\t\t\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"NOMBRECENTRO\");\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"00030\");\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"Solo están permitidas alfabéticos\");\n\n\t\t//guarda un mensaje de error\n\t\tarray_push($this->erroresdatos, $error);\n\t\t$correcto = false;\n\t}\n\t\n\treturn $correcto; //se devuelve el resultado\n}", "function getNom($id) {\r\n\r\n\t\tglobal $db;\r\n\r\n\t\t$statement = $db->prepare('SELECT PRENOM,NOM FROM UTILISATEURS WHERE ID_UTILISATEUR = ?');\r\n\t\t$statement->execute(array($id));\r\n\t\t$account = $statement->fetch();\r\n\t\techo $account['PRENOM'] .' '.$account['NOM'];\r\n\t}", "function tipo_cliente($id_tipo_cliente=\"\"){\n\t$db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\tif ($id_tipo_cliente==\"\") {\n\t\treturn \"Tutti i Clienti\";\n\t}\n\t$q=\"SELECT * FROM tipo_cliente WHERE id_tipo_cliente=$id_tipo_cliente\";\n\t$r=$db->query($q);\n\tif (!$r) {\n\t\treturn \"Dato Assente\";\n\t}else{\n\t\t$ro= mysql_fetch_array($r);\n\t\treturn $ro['nome'];\n\t}\n}", "function hitungDenda(){\n\n return 0;\n }", "function contenu()\n{\n // reprendre l'exercice sur Celsius\n\t$cels= -50;\n\t$far = -58;\n\n\tprint(\"<h1>\" .'Correspondance Celsius\tFahrenheit'.\"</h1>\");\n\tprint(\"\\n\");\n\n\tprint(\"\\t\". \"<table>\" .\"\\n\");\n\tprint(\"\\t\\t\". \"<thead>\" .\"\\n\");\n\n\tprint(\"\\t\\t\" .\"<tr>\". \"\\n\");\n\t\tprint(\"\\t\\t\". \"<th>\" .\"Celsius\". \"</th>\" .\"\\n\");\n\t\tprint(\"\\t\\t\". \"<th>\" .\"Fahrenheit\". \"</th>\" .\"\\n\");\n\tprint(\"\\t\\t\" .\"</tr>\". \"\\n\");\n\n\tprint(\"\\t\\t\". \"</thead>\" .\"\\n\");\n\n\tfor($cpt=0; $cpt<21; $cpt++)\n\t{\n\t\tprint(\"\\t\\t\". \"<tr class=\\\"bleu_fonc\\\">\" .\"\\n\");\n\n\t\tprint(\"\\t\\t\\t\". \"<td>\");\n\t\tprint($cels);\n\t\tprint(\"\\t\\t\". \"</td>\" .\"\\n\");\n\t\t//print(\"\\t\");\n\t\tprint(\"\\t\\t\\t\". \"<td>\");\n\t\tprint($far);\n\t\tprint(\"\\t\\t\". \"</td>\" .\"\\n\");\n\t\t//print(\"<br />\" .\"\\n\");\n\t\tprint(\"\\t\\t\". \"</tr>\" .\"\\n\");\n\n\t\t$cels += 5;\n\t\t$far += 9;\n\t}\n\n\tprint(\"\\t\". \"</table>\" .\"\\n\");\n}", "function constitueCommande($idProd,$idCommande,$qteProd){\n require(\"./modele/connexionBD.php\");\n $sql_ajt = \"INSERT INTO `constitue`(`idProduit`, `idCommande`, `qteProduit`) \n VALUES (:idp,:idc,:qteP);\";\n try {\n $statement = $pdo->prepare($sql_ajt);\n $statement->bindParam(':idc', $idCommande);\n $statement->bindParam(':idp', $idProd);\n $statement->bindParam(':qteP', $qteProd);\n $statement->setFetchMode(PDO::FETCH_ASSOC);\n $statement->execute();\n } catch (PDOException $e) {\n echo utf8_encode(\"Echec de select : \" . $e->getMessage() . \"\\n\");\n die();\n }\n\n}", "function generar_Expcargo($id_expediente) {\n $query = $this->db->query(\"select te.nExpedienteCodigo,te.cExpedienteFechaRegistro,te.cExpedienteSumilla,te.cExpedienteAsunto,UPPER(p.cPerNombres)as cPerNombres, UPPER(concat(p.cPerApellidoPaterno,' ',p.cPerApellidoMaterno)) as apellidos,pd.cPdeValor as dni,pc.cPdeValor as correo,pr.cPdeValor as ruc,pex.cPdeValor as carnet\nFROM tb_sistram_expediente te inner join persona p on p.nPerId=te.nPerId\nleft join persona_detalle pd on pd.nPerId=p.nPerId and pd.nParId=1 and pd.nPcaId=1\nleft join persona_detalle pex on pex.nPerId=p.nPerId and pex.nParId=2 and pex.nPcaId=1\nleft join persona_detalle pc on pc.nPerId=p.nPerId and pc.nParId=1 and pc.nPcaId=4\nleft join persona_detalle pr on pr.nPerId=p.nPerId and pr.nParId=3 and pr.nPcaId=1\nWHERE te.nExpedienteCodigo = ?;\", array($id_expediente));\n if ($query) {\n if ($query->num_rows() > 0) {\n return $query->row();\n } else {\n return null;\n }\n } else {\n throw new Exception('error al recuperar datos de la BD');\n }\n }", "function errorMessageIllegal( $page, $crewid, $expected, $actual ) {\n\techo \"<div class='body'>\";\n\t\techo \"<span class='fontTitle'>Warning!</span><br /><br />\";\n\t\techo \"You have attempted an illegal operation!\";\n\techo \"</div>\";\n}", "function inserisci_comune($nome_comune=\"\"){\n\t$db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\t$nome_comune= sistemaTesto($nome_comune);\n\t$q=\"INSERT INTO comune (id_comune, nome) VALUES (null,'$nome_comune')\";\n\t$r=$db->query($q);\n\t$id=mysql_insert_id();\n\treturn $id;\n}", "function Geral() {\r\n \r\n extract($GLOBALS);\r\n global $w_Disabled;\r\n $w_chave = $_REQUEST['w_chave'];\r\n $w_sq_tipo_lancamento = $_REQUEST['w_sq_tipo_lancamento'];\r\n $w_readonly = '';\r\n $w_erro = '';\r\n\r\n // Carrega o segmento cliente\r\n $sql = new db_getCustomerData; $RS = $sql->getInstanceOf($dbms,$w_cliente); \r\n $w_segmento = f($RS,'segmento');\r\n \r\n // Verifica se há necessidade de recarregar os dados da tela a partir\r\n // da própria tela (se for recarga da tela) ou do banco de dados (se não for inclusão)\r\n if ($w_troca>'' && $O!='E') {\r\n // Se for recarga da página\r\n $w_codigo_interno = $_REQUEST['w_codigo_interno'];\r\n $w_sq_tipo_lancamento = $_REQUEST['w_sq_tipo_lancamento'];\r\n $w_sq_tipo_documento = $_REQUEST['w_sq_tipo_documento'];\r\n $w_descricao = $_REQUEST['w_descricao'];\r\n $w_valor = $_REQUEST['w_valor'];\r\n $w_fim = $_REQUEST['w_fim'];\r\n $w_conta_debito = $_REQUEST['w_conta_debito'];\r\n $w_sq_forma_pagamento = $_REQUEST['w_sq_forma_pagamento'];\r\n $w_cc_debito = $_REQUEST['w_cc_debito'];\r\n $w_cc_credito = $_REQUEST['w_cc_credito'];\r\n\r\n } elseif(strpos('AEV',$O)!==false || $w_copia>'') {\r\n // Recupera os dados do lançamento\r\n $sql = new db_getSolicData; \r\n $RS = $sql->getInstanceOf($dbms,nvl($w_copia,$w_chave),$SG);\r\n if (count($RS)>0) {\r\n $w_codigo_interno = f($RS,'codigo_interno');\r\n $w_sq_tipo_lancamento = f($RS,'sq_tipo_lancamento');\r\n $w_conta_debito = f($RS,'sq_pessoa_conta');\r\n $w_descricao = f($RS,'descricao');\r\n $w_fim = formataDataEdicao(f($RS,'fim'));\r\n $w_valor = formatNumber(f($RS,'valor'));\r\n $w_sq_forma_pagamento = f($RS,'sq_forma_pagamento');\r\n $w_cc_debito = f($RS,'cc_debito');\r\n $w_cc_credito = f($RS,'cc_credito');\r\n }\r\n }\r\n\r\n // Recupera dados do comprovante\r\n if (nvl($w_troca,'')=='' && (nvl($w_copia,'')!='' || nvl($w_chave,'')!='')) {\r\n $sql = new db_getLancamentoDoc; $RS = $sql->getInstanceOf($dbms,nvl($w_copia,$w_chave),null,null,null,null,null,null,'DOCS');\r\n $RS = SortArray($RS,'sq_tipo_documento','asc');\r\n foreach ($RS as $row) {$RS=$row; break;}\r\n if (nvl($w_copia,'')=='') $w_chave_doc = f($RS,'sq_lancamento_doc'); // Se cópia, não copia a chave do documento \r\n $w_sq_tipo_documento = f($RS,'sq_tipo_documento');\r\n $w_numero = f($RS,'numero');\r\n $w_data = FormataDataEdicao(f($RS,'data'));\r\n $w_serie = f($RS,'serie');\r\n $w_valor_doc = formatNumber(f($RS,'valor'));\r\n $w_patrimonio = f($RS,'patrimonio');\r\n $w_tributo = f($RS,'calcula_tributo');\r\n $w_retencao = f($RS,'calcula_retencao'); \r\n }\r\n\r\n // Default: pagamento para pessoa jurídica\r\n $w_tipo_pessoa = nvl($w_tipo_pessoa,2);\r\n \r\n // Recupera o trâmite de conclusão\r\n $sql = new db_getTramiteList; $RS = $sql->getInstanceOf($dbms, $w_menu,null,null,null);\r\n $RS = SortArray($RS,'ordem','asc');\r\n foreach ($RS as $row) {\r\n if (f($row,'sigla')=='AT') {\r\n $w_tramite_conc = f($row,'sq_siw_tramite');\r\n break;\r\n }\r\n }\r\n \r\n // Verifica as formas de pagamento possíveis. Se apenas uma, atribui direto\r\n $sql = new db_getFormaPagamento; $RS = $sql->getInstanceOf($dbms, $w_cliente, null, $SG, null,'S',null);\r\n $w_exibe_fp = true;\r\n if (count($RS)==1 || nvl($w_sq_forma_pagamento,'')!='') {\r\n foreach($RS as $row) { \r\n if (nvl($w_sq_forma_pagamento,f($row,'sq_forma_pagamento'))==f($row,'sq_forma_pagamento')) {\r\n $w_sq_forma_pagamento = f($row,'sq_forma_pagamento'); \r\n $w_forma_pagamento = f($row,'sigla'); \r\n $w_nm_forma_pagamento = f($row,'nome'); \r\n break; \r\n }\r\n }\r\n if (count($RS)==1) $w_exibe_fp = false;\r\n }\r\n \r\n // Verifica os tipos de documento possíveis. Se apenas um, atribui direto\r\n $sql = new db_getTipoDocumento; $RS = $sql->getInstanceOf($dbms,null,$w_cliente,$w_menu,null);\r\n $w_exibe_dc = true;\r\n if (count($RS)==1) {\r\n foreach($RS as $row) { \r\n $w_sq_tipo_documento = f($row,'chave'); \r\n $w_tipo_documento = f($row,'sigla'); \r\n $w_nm_tipo_documento = f($row,'nome'); \r\n break; \r\n }\r\n $w_exibe_dc = false;\r\n }\r\n\r\n // Se o tipo de lançamento já foi informado, recupera o código externo para definir a conta contábil de débito\r\n if ($w_sq_tipo_lancamento) {\r\n $sql = new db_getTipoLancamento; $RS = $sql->getInstanceOf($dbms,$w_sq_tipo_lancamento,null,$w_cliente,null);\r\n $w_cc_debito = f($RS[0],'codigo_externo');\r\n }\r\n \r\n // Retorna as contas contábeis do lançamento\r\n retornaContasContabeis($RS_Menu, $w_cliente, $w_sq_tipo_lancamento, $w_sq_forma_pagamento, $w_conta_debito, $w_cc_debito, $w_cc_credito);\r\n \r\n Cabecalho();\r\n head();\r\n Estrutura_CSS($w_cliente);\r\n // Monta o código JavaScript necessário para validação de campos e preenchimento automático de máscara,\r\n // tratando as particularidades de cada serviço\r\n ScriptOpen('JavaScript');\r\n CheckBranco();\r\n FormataData();\r\n SaltaCampo();\r\n FormataDataHora();\r\n FormataValor();\r\n ShowHTML('function botoes() {');\r\n ShowHTML(' document.Form.Botao[0].disabled = true;');\r\n ShowHTML(' document.Form.Botao[1].disabled = true;');\r\n ShowHTML('}');\r\n ValidateOpen('Validacao');\r\n if ($O=='I' || $O=='A') {\r\n Validate('w_sq_tipo_lancamento','Tipo do lançamento','SELECT',1,1,18,'','0123456789');\r\n if ($w_exibe_fp) Validate('w_sq_forma_pagamento','Forma de pagamento','SELECT',1,1,18,'','0123456789');\r\n Validate('w_conta_debito','Conta bancária', 'SELECT', 1, 1, 18, '', '0123456789');\r\n if ($w_exibe_dc) Validate('w_sq_tipo_documento','Tipo de documento','SELECT',1,1,18,'','0123456789');\r\n Validate('w_fim','Data da operação', 'DATA', '1', '10', '10', '', '0123456789/');\r\n Validate('w_valor','Valor total do documento','VALOR','1',4,18,'','0123456789.,-');\r\n CompValor('w_valor','Valor total do documento','>','0,00','zero');\r\n Validate('w_descricao','Observação','1','',5,2000,'1','1');\r\n \r\n Validate('w_cc_debito','Conta Débito','','','2','25','ABCDEFGHIJKLMNOPQRSTUVWXYZ','0123456789');\r\n Validate('w_cc_credito','Conta Crédito','','','2','25','ABCDEFGHIJKLMNOPQRSTUVWXYZ','0123456789');\r\n \r\n ShowHTML(' if ((theForm.w_cc_debito.value != \"\" && theForm.w_cc_credito.value == \"\") || (theForm.w_cc_debito.value == \"\" && theForm.w_cc_credito.value != \"\")) {');\r\n ShowHTML(' alert (\"Informe ambas as contas contábeis ou nenhuma delas!\");');\r\n ShowHTML(' theForm.w_cc_debito.focus();');\r\n ShowHTML(' return false;');\r\n ShowHTML(' }');\r\n \r\n } \r\n Validate('w_assinatura',$_SESSION['LABEL_ALERTA'], '1', '1', '3', '30', '1', '1');\r\n ValidateClose();\r\n ScriptClose();\r\n ShowHTML('<BASE HREF=\"'.$conRootSIW.'\">');\r\n ShowHTML('</HEAD>');\r\n if ($w_troca>'') BodyOpen('onLoad=\\'document.Form.'.$w_troca.'.focus()\\';');\r\n elseif (!(strpos('EV',$O)===false)) BodyOpen('onLoad=\\'this.focus()\\';');\r\n else BodyOpen('onLoad=\\'document.Form.w_sq_tipo_lancamento.focus()\\';');\r\n Estrutura_Topo_Limpo();\r\n Estrutura_Menu();\r\n Estrutura_Corpo_Abre();\r\n Estrutura_Texto_Abre();\r\n ShowHTML('<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">');\r\n if ($w_chave>'') ShowHTML(' <tr><td><font size=\"2\"><b>'.$w_codigo_interno.' ('.$w_chave.')</b></td>');\r\n if (strpos('IAEV',$O)!==false) {\r\n if (strpos('EV',$O)!==false) {\r\n $w_Disabled=' DISABLED ';\r\n if ($O=='V') $w_Erro = Validacao($w_sq_solicitacao,$SG);\r\n } \r\n if (Nvl($w_pais,'')=='') {\r\n // Carrega os valores padrão para país, estado e cidade\r\n $sql = new db_getCustomerData; $RS = $sql->getInstanceOf($dbms,$w_cliente);\r\n $w_pais = f($RS,'sq_pais');\r\n $w_uf = f($RS,'co_uf');\r\n $w_cidade = Nvl(f($RS_Menu,'sq_cidade'),f($RS,'sq_cidade_padrao'));\r\n } \r\n AbreForm('Form',$w_dir.$w_pagina.'Grava','POST','return(Validacao(this));',null,$P1,$P2,$P3,$P4,$TP,$SG,$R,$O);\r\n ShowHTML(MontaFiltro('POST'));\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_troca\" value=\"\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_copia\" value=\"'.$w_copia.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_chave\" value=\"'.$w_chave.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_codigo_interno\" value=\"'.$w_codigo_interno.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_menu\" value=\"'.f($RS_Menu,'sq_menu').'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_data_hora\" value=\"'.f($RS_Menu,'data_hora').'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_cidade\" value=\"'.$w_cidade.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_tramite\" value=\"'.$w_tramite_conc.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_tipo\" value=\"'.$w_tipo.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_chave_doc\" value=\"'.$w_chave_doc.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_tipo_pessoa\" value=\"'.$w_tipo_pessoa.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_aviso\" value=\"N\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_dias\" value=\"0\">');\r\n ShowHTML('<tr bgcolor=\"'.$conTrBgColor.'\"><td>');\r\n ShowHTML(' <table width=\"100%\" border=\"0\">');\r\n ShowHTML(' <tr><td colspan=3 align=\"center\" height=\"2\" bgcolor=\"#000000\"></td></tr>');\r\n ShowHTML(' <tr><td colspan=3 align=\"center\" height=\"1\" bgcolor=\"#000000\"></td></tr>');\r\n ShowHTML(' <tr><td colspan=3 align=\"center\" bgcolor=\"#D0D0D0\"><b>Identificação</td></td></tr>');\r\n ShowHTML(' <tr><td colspan=3 align=\"center\" height=\"1\" bgcolor=\"#000000\"></td></tr>');\r\n ShowHTML(' <tr><td colspan=3>Os dados deste bloco serão utilizados para identificação do lançamento, bem como para o controle de sua execução.</td></tr>');\r\n ShowHTML(' <tr><td colspan=3 align=\"center\" height=\"1\" bgcolor=\"#000000\"></td></tr>');\r\n\r\n ShowHTML(' <tr valign=\"top\">');\r\n selecaoTipoLancamento('Tipo de lançamento:',null,null,$w_sq_tipo_lancamento,$w_menu,$w_cliente,'w_sq_tipo_lancamento',$SG, 'onChange=\"document.Form.action=\\''.$w_dir.$w_pagina.$par.'\\'; document.Form.O.value=\\''.$O.'\\'; document.Form.w_troca.value=\\''.(($w_exibe_fp) ? 'w_sq_forma_pagamento' : 'w_conta_debito').'\\'; document.Form.submit();\"',3);\r\n ShowHTML(' <tr valign=\"top\">');\r\n if ($w_exibe_fp) {\r\n SelecaoFormaPagamento('<u>F</u>orma de pagamento:','F','Selecione na lista a forma desejada para esta aplicação.',$w_sq_forma_pagamento,$SG,'w_sq_forma_pagamento',null,'onChange=\"document.Form.action=\\''.$w_dir.$w_pagina.$par.'\\'; document.Form.O.value=\\''.$O.'\\'; document.Form.w_troca.value=\\'w_conta_debito\\'; document.Form.submit();\"');\r\n } else {\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_sq_forma_pagamento\" value=\"'.$w_sq_forma_pagamento.'\">');\r\n }\r\n SelecaoContaBanco('<u>C</u>onta bancária:','C','Selecione a conta bancária envolvida no lançamento.',$w_conta_debito,null,'w_conta_debito',null,'onChange=\"document.Form.action=\\''.$w_dir.$w_pagina.$par.'\\'; document.Form.O.value=\\''.$O.'\\'; document.Form.w_troca.value=\\''.(($w_exibe_dc) ? 'w_sq_tipo_documento' : 'w_fim').'\\'; document.Form.submit();\"');\r\n ShowHTML(' </tr>');\r\n ShowHTML(' <tr valign=\"top\">');\r\n if ($w_exibe_dc) {\r\n SelecaoTipoDocumento('<u>T</u>ipo do documento:','T', 'Selecione o tipo de documento.', $w_sq_tipo_documento,$w_cliente,$w_menu,'w_sq_tipo_documento',null,null);\r\n } else {\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_sq_tipo_documento\" value=\"'.$w_sq_tipo_documento.'\">');\r\n }\r\n ShowHTML(' <td><b><u>D</u>ata da operação:</b><br><input '.$w_Disabled.' accesskey=\"D\" type=\"text\" name=\"w_fim\" class=\"sti\" SIZE=\"10\" MAXLENGTH=\"10\" VALUE=\"'.$w_fim.'\" onKeyDown=\"FormataData(this,event);\" onKeyUp=\"SaltaCampo(this.form.name,this,10,event);\">'.ExibeCalendario('Form','w_fim').'</td>');\r\n ShowHTML(' <td><b><u>V</u>alor:</b><br><input '.$w_Disabled.' accesskey=\"V\" type=\"text\" name=\"w_valor\" class=\"sti\" SIZE=\"18\" MAXLENGTH=\"18\" VALUE=\"'.$w_valor.'\" style=\"text-align:right;\" onKeyDown=\"FormataValor(this,18,2,event);\" title=\"Informe o valor total do documento.\"></td>');\r\n ShowHTML(' <tr><td colspan=3><b><u>O</u>bservação:</b><br><textarea '.$w_Disabled.' accesskey=\"O\" name=\"w_descricao\" class=\"sti\" ROWS=3 cols=75 title=\"Observação sobre a aplicação.\">'.$w_descricao.'</TEXTAREA></td>');\r\n\r\n ShowHTML(' <tr valign=\"top\">');\r\n ShowHTML(' <td><b><u>C</u>onta contábil de débito:</b></br><input type=\"text\" name=\"w_cc_debito\" class=\"sti\" SIZE=\"11\" MAXLENGTH=\"25\" VALUE=\"'.$w_cc_debito.'\"></td>');\r\n ShowHTML(' <td><b><u>C</u>onta contábil de crédito:</b></br><input type=\"text\" name=\"w_cc_credito\" class=\"sti\" SIZE=\"11\" MAXLENGTH=\"25\" VALUE=\"'.$w_cc_credito.'\"></td>');\r\n \r\n ShowHTML(' <tr><td align=\"LEFT\" colspan=4><b>'.$_SESSION['LABEL_CAMPO'].':<BR> <INPUT ACCESSKEY=\"A\" class=\"sti\" type=\"PASSWORD\" name=\"w_assinatura\" size=\"30\" maxlength=\"30\" value=\"\"></td></tr>');\r\n ShowHTML(' <tr><td align=\"center\" colspan=\"3\" height=\"1\" bgcolor=\"#000000\"></TD></TR>');\r\n ShowHTML(' <tr><td align=\"center\" colspan=\"3\">');\r\n ShowHTML(' <input class=\"stb\" type=\"submit\" name=\"Botao\" value=\"Gravar\">');\r\n if ($P1==0) {\r\n ShowHTML(' <input class=\"STB\" type=\"button\" onClick=\"location.href=\\''.montaURL_JS($w_dir,'tesouraria.php?par=inicial&O=L&P1='.$P1.'&P2='.$P2.'&P3='.$P3.'&P4='.$P4.'&TP='.$TP.'&SG='.MontaFiltro('GET')).'\\';\" name=\"Botao\" value=\"Abandonar\">');\r\n } else {\r\n $sql = new db_getMenuData; $RS = $sql->getInstanceOf($dbms,$w_menu);\r\n ShowHTML(' <input class=\"stb\" type=\"button\" onClick=\"location.href=\\''.montaURL_JS($w_dir,$R.'&w_copia='.$w_copia.'&O=L&SG='.f($RS,'sigla').'&P1='.$P1.'&P2='.$P2.'&P3='.$P3.'&P4='.$P4.'&TP='.$TP.MontaFiltro('GET')).'\\';\" name=\"Botao\" value=\"Cancelar\">');\r\n }\r\n ShowHTML(' </td>');\r\n \r\n ShowHTML(' </tr>');\r\n ShowHTML(' </table>');\r\n ShowHTML(' </TD>');\r\n ShowHTML('</tr>');\r\n ShowHTML('</FORM>');\r\n } else {\r\n ScriptOpen('JavaScript');\r\n ShowHTML(' alert(\"Opção não disponível\");');\r\n ScriptClose();\r\n } \r\n ShowHTML('</table>');\r\n ShowHTML('</center>');\r\n Estrutura_Texto_Fecha();\r\n Estrutura_Fecha();\r\n Estrutura_Fecha();\r\n Estrutura_Fecha();\r\n Rodape();\r\n}", "function affichageErreur()\n\t{\n\t}", "function XSACreditNote($InvoiceNo, $orderno, $debtorno, $TypeInvoice,$tag,$serie,$folio, &$db)\n{\n\t$charelectronic='01';\n\t$charelectronic=$charelectronic.'|'.$serie;\n\t$serieelect=$serie;\n\t//$serieelect=$TypeInvoice.'-'.$_SESSION['Tagref'];\n\t$folioelect=$folio;//$InvoiceNoTAG;\n\t//$folioelect=$InvoiceNo;\n\t$charelectronic=$charelectronic.'|'.$serieelect;\n\t$charelectronic=$charelectronic.'|'.$folioelect;\n\t// consulto datos de la factura\n\t$imprimepublico=0;\n\t$InvoiceHeaderSQL = \"SELECT DISTINCT\n\t\t\t\treplace(debtortrans.trandate,'-','/') as trandate,\n\t\t\t\t(debtortrans.ovamount*-1) as ovamount,\n\t\t\t\t(debtortrans.ovdiscount*-1) as ovdiscount,\n\t\t\t\t(debtortrans.ovgst*-1) as ovgst,\n\t\t\t\tdebtorsmaster.name,\n\t\t\t\tdebtorsmaster.address1,debtorsmaster.address2,\n\t\t\t\tdebtorsmaster.address3,debtorsmaster.address4,debtorsmaster.address5,\n\t\t\t\tdebtorsmaster.address6,debtorsmaster.invaddrbranch,\n\t\t\t\tcustbranch.taxid as rfc,\n\t\t\t\tcustbranch.brname,\n\t\t\t\tcustbranch.braddress1,custbranch.braddress2,custbranch.braddress3,\n\t\t\t\tcustbranch.braddress4,custbranch.braddress5,custbranch.braddress6,\n\t\t\t\tcustbranch.brpostaddr1,custbranch.brpostaddr2,custbranch.brpostaddr3,\n\t\t\t\tcustbranch.brpostaddr4,custbranch.brpostaddr5,custbranch.brpostaddr6,\n\t\t\t\tdebtortrans.debtorno,debtortrans.branchcode,debtortrans.folio,\n\t\t\t\treplace(origtrandate,'-','/') as origtrandate,\n\t\t\t\tdebtortrans.currcode,\n\t\t\t\tcustbranch.branchcode,\n\t\t\t\tdebtortrans.tpe,\n\t\t\t\tdebtortrans.shipvia,\n\t\t\t\t(debtortrans.ovfreight*-1) as ovfreight,\n\t\t\t\tdebtortrans.rate AS cambio,\n\t\t\t\tdebtorsmaster.currcode,\n\t\t\t\tcustbranch.defaultlocation,\n\t\t\t\tcustbranch.brnumext,\n\t\t\t\tcustbranch.brnumint,\n\t\t\t\t\";\n\t$InvoiceHeaderSQL = $InvoiceHeaderSQL . \"\n\t\t\t\tlocations.taxprovinceid,\n\t\t\t\tdebtortrans.tagref,\n\t\t\t\tcustbranch.phoneno as telofi,\n\t\t\t\tdebtortrans.paymentname,\n\t\t\tdebtortrans.nocuenta\n\t\t\tFROM debtortrans INNER JOIN debtorsmaster ON\n\t\t\t\tdebtortrans.debtorno = debtorsmaster.debtorno\n\t\t\t\tINNER JOIN custbranch ON\n\t\t\t\tdebtortrans.branchcode = custbranch.branchcode\n\t\t\t\tAND debtortrans.debtorno = custbranch.debtorno\n\t\t\t\tINNER JOIN currencies ON\n\t\t\t\tdebtorsmaster.currcode = currencies.currabrev\n\t\t\t\tINNER JOIN stockmoves ON\n\t\t\t\tstockmoves.transno=debtortrans.transno\n\t\t\t\tINNER JOIN locations ON\n\t\t\t\tstockmoves.loccode = locations.loccode\n\t\t\tWHERE debtortrans.transno = \" . $InvoiceNo . \"\n\t\t\t\tAND debtortrans.type=11\n\t\t\t\tAND stockmoves.type=11\";\n\t$Result=DB_query($InvoiceHeaderSQL,$db);\n\tif (DB_num_rows($Result)>0) {\n\t\t$myrow = DB_fetch_array($Result);\n\t\t// fecha emision\n\t\t$fechainvoice=$myrow['origtrandate'];\n\t\t$UserRegister=$myrow['UserRegister'];\n\t\t$charelectronic=$charelectronic.'|'.$fechainvoice;\n\t\t// subtotal\n\t\t$rfccliente=str_replace(\"-\",\"\",$myrow['rfc']);\n\t\t$rfccliente=str_replace(\" \",\"\",$rfccliente);\n\t\t$nombre=$myrow['name'];\n\t\t$subtotal= FormatNumberERP($myrow['ovamount']);\n\t\tif (strlen($rfccliente)<12){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$imprimepublico=1;\n\t\t}elseif(strlen($rfccliente)>=14){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$imprimepublico=1;\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$subtotal;\n\t\t// total factura\n\t\t$total=FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t$charelectronic=$charelectronic.'|'.$total;\n\t\t// total de iva\n\t\t$iva=FormatNumberERP($myrow['ovgst']);\n\t\t// transladado\n\t\t$charelectronic=$charelectronic.'|'.$iva;\n\t\t// retenido\n\t\t$ivaret=0;\n\t\t$charelectronic=$charelectronic.'|'.$ivaret;\n\t\t//descuento\n\t\t$descuento=FormatNumberERP($myrow['ovdiscount']);\n\t\t$charelectronic=$charelectronic.'|'.$descuento;\n\t\t//motivo descuento\n\t\t$charelectronic=$charelectronic.'|';\n\t\t// tipo de moneda\n\t\t$moneda=$myrow['currcode'];\n\t\t// CANTIDAD CON LETRAS\n\t\t$totaletras=$myrow['ovamount']+$myrow['ovgst'];\n\t\t$totalx=str_replace(',' ,'', FormatNumberERP($totaletras));\n\t\t$separa=explode(\".\",$totalx);\n\t\t$montoletra = $separa[0];\n\t\t$separa2=explode(\".\", FormatNumberERP($total));\n\t\t$montoctvs2 = $separa2[1];\n\t\t$montoletra=Numbers_Words::toWords($montoletra, 'es');\n\t\t\n\t\t$zeroPad = \"\";\n\t\tif (empty($_SESSION['Decimals'])) {\n\t\t\t$zeroPad = str_pad($zeroPad, 4, 0, STR_PAD_RIGHT);\n\t\t} else {\n\t\t\t$zeroPad = str_pad($zeroPad, $_SESSION['Decimals'], 0, STR_PAD_RIGHT);\n\t\t}\n\t\t\n\t\tif ($moneda == 'MXN') {\n\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\"/1$zeroPad M.N.\";\n\t\t} else {\n\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/1$zeroPad USD\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$montoletra;\n\t\t// tipo moneda\n\t\t$charelectronic=$charelectronic.'|'.$moneda;\n\t\t// tipo de cambio\n\t\t$rate=FormatRateNumberERP($myrow['cambio']);\n\t\t$charelectronic=$charelectronic.'|'.$rate;\n\t\t// numero de orden para referencia\n\t\t$ordenref=$myrow['orderno'];\n\t\t$charelectronic=$charelectronic.'|'.$ordenref;\n\t\t// observaciones 1: vendedores\n\t\t$vendedor=\"\";\n\t\t$SQL=\" SELECT *\n\t\t FROM salesman\n\t\t WHERE salesmancode='\".$myrow['salesman'].\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowsales = DB_fetch_array($Result);\n\t\t\t$vendedor=$myrowsales['salesmanname'];\n\t\t}\n\t\t$observaciones1='Vendedor: '.$myrow['salesman'].' '.$vendedor;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones1;\n\t\t// observaciones 2\n\t\t$SQL=\" SELECT l.telephone,l.comments,t.tagdescription\n\t\t FROM legalbusinessunit l, tags t\n\t\t WHERE l.legalid=t.legalid AND tagref='\".$tag.\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowtags = DB_fetch_array($Result);\n\t\t\t$telephone=trim($myrowtags['telephone']);\n\t\t\t$comments=trim($myrowtags['comments']);\n\t\t}\n\t\t$observaciones2=\" Atencion a clientes \" .$telephone;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones2;\n\t\t$metodopago = $myrow['paymentname'];\n\t\tif ($metodopago==\"\") {\n\t\t\t$metodopago = \"No Identificado\";\n\t\t}\n\n\t\t$nocuenta = $myrow['nocuenta'];\n\t\tif ($nocuenta==\"\") {\n\t\t\t$nocuenta = \"No Identificado\";\n\t\t}\n\n\n\t\t// observaciones 3\n\t\t$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones3;\n\n\t\t//$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$nocuenta;\n\t\t// datos de la forma de pago\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'02';\n\n\t\t$terminospago=$myrow['terms'];\n\t\t$SQL=\" SELECT *\n\t\t FROM debtortrans\n\t\t WHERE debtortrans.type=70\n\t\t\tAND debtortrans.order_=\" . $InvoiceNo ;\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==0) {\n\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t}else{\n\t\t\t$Tipopago=\"Parcialidades\";\n\t\t}\n\t\t$Tipopago=$Tipopago.' '.$terminospago;\n\t\t//$Tipopago=$terminospago;\n\t\t$charelectronic=$charelectronic.'|'.$Tipopago;\n\t\t// condiciones de pago\n\t\t$charelectronic=$charelectronic.'|Genera Interes Moratorio 3 % mensual/credito';\n\t\t// metodo de pago\n\t\t//\t$metodopago='varios';\n\t\t$charelectronic=$charelectronic.'|'.$metodopago;\n\t\t// fecha vencimiento\n\t\t$fechavence=$myrow['trandate'];\n\t\t$charelectronic=$charelectronic.'|'.$fechavence;\n\t\t// observaciones 4\n\t\t$observaciones4=$observaciones3;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones4;\n\t\t// datos del cliente\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'03';\n\t\t$branch=$myrow['debtorno'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$calle=$myrow['address1'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$colonia=$myrow['address2'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$municipio=$myrow['address3'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$edo=$myrow['address4'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$cp=$myrow['address5'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t// datos del custbranch\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'04';\n\t\t$branch=$myrow['branchcode'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t//$rfc=$myrow['rfc'];\n\t\t//$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$nombre=$myrow['name'];\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0) {\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=$myrow['braddress1'];\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=$myrow['braddress6'];\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=$myrow['braddress2'];\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=$myrow['braddress4'];\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\n\t}\n\t// cadena para datos de los productos\n\t// productos vendidos\n\t$charelectronicdetail='';\n\t$charelectronicinidet='|'.chr(13).chr(10).'05';\n\t// datos de ivas\n\t$charelectronictaxs='';\n\t$charelectronictaxsini='|'.chr(13).chr(10).'07';\n\t\n\tif ($rfccliente!=\"XAXX010101000\"){\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))- totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\t$nolinea=0;\n\t\t$descrprop=\"\";\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=FormatNumberERP($myrow2['quantity']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT distinct p.InvoiceValue as val,sp.label\n\t\t\t FROM salesstockproperties p, stockcatproperties sp, stockmaster sm\n\t\t\t WHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.typedocument=11\n\t\t\t\t \tAND sp.reqatprint=1\n\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0){\n\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t}else{\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\n\t\t\t$descrnarrative=\"\";\n\t\t\t$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM notesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrownarrative['narrative']));\n\t\t\t}\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescrip.$descrprop.$descrnarrative;\n\t\t\t$stockprecio=FormatNumberERP($myrow2['fxprice']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=FormatNumberERP($myrow2['fxnet']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=FormatNumberERP($myrow2['discountpercent']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=FormatNumberERP($myrow2['discountpercent1']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=FormatNumberERP($myrow2['discountpercent2']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$nameaduana='';\n\t\t\t$numberaduana='';\n\t\t\t$fechaaduana='';\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$nolinea=$nolinea+1;\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,\n\t\t\t\t\t\ttaxcalculationorder,taxontax,\n\t\t\t\t\t\ttaxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=FormatNumberERP($myrow3['taxrate']*100);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=FormatNumberERP($myrow3['taxrate']*($myrow2['subtotal']));\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\n\t\t}\n\t}else{\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))-totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t\t(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)))) AS fxnet,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))))-totaldescuento as subtotal,\n\t\t\t\t\t\t(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t stockcategory.MensajePV\n\t\t\t\t\tFROM stockmoves inner join stockmaster ON stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\t\t\t\tinner join stockcategory on stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\t\t\t\t\tleft JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid';\n\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=FormatNumberERP($myrow2['quantity']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT distinct p.InvoiceValue as val,sp.label\n\t\t\t FROM salesstockproperties p, stockcatproperties sp, stockmaster sm\n\t\t\t WHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.typedocument=\" . $TypeInvoice . \"\n\t\t\t\t \t\tAND sp.reqatprint=1\n\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0){\n\t\t\t\t\t\t\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t}else{\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){//\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\t\t\tif($myrow2['MensajePV'] <> \"\"){\n\t\t\t\t$descrprop = $descrprop.$myrow2['MensajePV'];\n\t\t\t}\n\t\t\t$descrnarrative=\"\";\n\t\t\t/*$sqlnarrative=\"SELECT narrative\n\t\t\t FROM salesorderdetails p\n\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\tAND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t$descrnarrative=$myrownarrative['narrative'];\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t}*/\n\n\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrow2['narrative']));\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\t\t\tif($myrow2['showdescription']==1){\n\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t}else{\n\t\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescripuno=$descrnarrative;\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t$stockprecio=FormatNumberERP($myrow2['fxprice']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=FormatNumberERP($myrow2['fxnet']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=FormatNumberERP($myrow2['discountpercent']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=FormatNumberERP($myrow2['discountpercent1']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=FormatNumberERP($myrow2['discountpercent2']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t//$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t// consulta de aduana\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$almacen=$myrow2['almacen'];\n\t\t\t\t\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,taxcalculationorder,taxontax,taxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=FormatNumberERP($myrow3['taxrate']*100);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=FormatNumberERP($myrow3['taxrate']*($myrow2['subtotal']));\n\t\t\t\t//$taxtotalratex=$myrow3['taxrate']*($myrow2['fxnet']*$myrow2['fxprice']);\n\t\t\t\t$taxtotalratex=$myrow3['taxrate']*($myrow2['subtotal']);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\t\t\t\t\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t\t\n\t\t\t\t\n\t\t\t$sqladuana=\"SELECT stockserialitems.customs as aduana,customs_number as noaduana,\n\t\t\t\t\tpedimento, DATE_FORMAT(customs_date,'%Y-%m-%d') as fechaaduana\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$numberaduana=\"\";\n\t\t\t\t$fechaaduana=\"\";\n\t\t\t}else{\n\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t$aduana=$myrowaduana['aduana'];\n\t\t\t\t$separaaduana=explode(\"|\",$aduana);\n\t\t\t\t$nameaduana = $separaaduana[0];\n\t\t\t\t$numberaduana= $separaaduana[1];\n\t\t\t\t$fechaaduana= $separaaduana[2];\n\t\t\t\tif (strlen($nameaduana)==0 or strlen($numberaduana)==0 /*or !Is_Date($fechaaduana)*/){\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$numberaduana=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t}\n\t}\n\t// ivas retenidos\n\t$charelectronictaxsret='|'.chr(13).chr(10);//.'07|ISR|0.00';\n\tif ($rfccliente==\"XAXX010101000\"){\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronicEmbarque;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\t}else{\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxs.$charelectronictaxsret.$charelectronicEmbarque;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\n\t}\n\t//echo '<pre><br>'.$cadenaenviada;\n\treturn $cadenaenviada;\n}", "function extrae($cadena,$num_caracteres){\n $cadena_ext = substr($cadena,0, $num_caracteres);\n //Si el extracto ya viene con palabra completa no necesita buscar la siguiente palabra\n if($cadena[$num_caracteres] != \" \"){\n $sub_cadena = substr($cadena,$num_caracteres, ($tam_cadena - $num_caracteres));\n $miarray = explode (' ', $sub_cadena);\n $res_sub_cadena = $miarray[0];\n }\n $cad = $cadena_ext.$res_sub_cadena; \n return $cad; \n }", "function adicionar($codigo,$descricao,$papeis,$dbhw){\n\tglobal $esquemaadmin;\n\ttry{\n\t\t$dataCol = array(\n\t\t\t\"descricao\" => ''\n\t\t);\n\t\t$id_operacao = i3GeoAdminInsertUnico($dbhw,\"i3geousr_operacoes\",$dataCol,\"descricao\",\"id_operacao\");\n\t\t$retorna = alterar($id_operacao,$codigo,$descricao,$papeis,$dbhw);\n\t\treturn $retorna;\n\t}\n\tcatch (PDOException $e){\n\t\treturn false;\n\t}\n}", "function insertarUcedifobracivil(){\n\t\t$this->procedimiento='snx.ft_ucedifobracivil_ime';\n\t\t$this->transaccion='SNX_UDOC_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('id_ucedifsubgrupo','id_ucedifsubgrupo','int4');\n\t\t$this->setParametro('cantidadobracivil','cantidadobracivil','numeric');\n\t\t$this->setParametro('id_obracivilmoe','id_obracivilmoe','int4');\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 limpiar($cadena){\n\t\t$cadena=str_replace(\"_\",\" \",$cadena);//alt + 15\n\t\t$cadena=str_replace(\"|\",\"=\",$cadena);//alt + 10\n\t\treturn $cadena=str_replace(\"*\",\"'\",$cadena);//alt + 16\n\t}", "function fncValidaDI_26($IdEstado, $GestorErr, $NumReg, $Campo)\n{\n\t \n\t$Bandera = CERO;\n\n\t$DI_26 = \"(26)Municipio\";\n\t$DI_26_ErrTam = \"Tamaño de campo Municipio debe ser a 3 Dígitos\";\n\t$DI_26_Mpio \t = \"El Municipio no es parte del catalogo de DGRH\";\n\t\n\t// agregar catalogo de Municpios\n\nif($IdEstado == \"01\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\");\n} //fin de if($IdEstado == \"01\")\n\nif($IdEstado == \"02\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\");\n} //fin de if($IdEstado == \"02\")\n\nif($IdEstado == \"03\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"008\",\"009\");\n} //fin de if($IdEstado == \"03\")\n\nif($IdEstado == \"04\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\");\n} //fin de if($IdEstado == \"04\")\n\nif($IdEstado == \"05\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\");\n} //fin de if($IdEstado == \"05\")\n\nif($IdEstado == \"06\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\");\n} //fin de if($IdEstado == \"06\")\n\nif($IdEstado == \"07\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\",\"039\",\"040\",\"041\",\"042\",\"043\",\"044\",\"045\",\"046\",\"047\",\"048\",\"049\",\"050\",\"051\",\"052\",\"053\",\"054\",\"055\",\"056\",\"057\",\"058\",\"059\",\"060\",\"061\",\"062\",\"063\",\"064\",\"065\",\"066\",\"067\",\"068\",\"069\",\"070\",\"071\",\"072\",\"073\",\"074\",\"075\",\"076\",\"077\",\"078\",\"079\",\"080\",\"081\",\"082\",\"083\",\"084\",\"085\",\"086\",\"087\",\"088\",\"089\",\"090\",\"091\",\"092\",\"093\",\"094\",\"096\",\"097\",\"098\",\"099\",\"100\",\"101\",\"102\",\"103\",\"104\",\"105\",\"106\",\"107\",\"108\",\"109\",\"110\",\"111\",\"112\",\"113\",\"114\",\"115\",\"116\",\"117\",\"118\",\"119\");\n} //fin de if($IdEstado == \"07\")\n\nif($IdEstado == \"08\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\",\"039\",\"040\",\"041\",\"042\",\"043\",\"044\",\"045\",\"046\",\"047\",\"048\",\"049\",\"050\",\"051\",\"052\",\"053\",\"054\",\"055\",\"056\",\"057\",\"058\",\"059\",\"060\",\"061\",\"062\",\"063\",\"064\",\"065\",\"066\",\"067\");\n} //fin de if($IdEstado == \"08\")\n\nif($IdEstado == \"09\"){\n\t$Mpio = array(\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\");\n} //fin de if($IdEstado == \"09\")\n\nif($IdEstado == \"10\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\",\"039\");\n} //fin de if($IdEstado == \"10\")\n\nif($IdEstado == \"11\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\",\"039\",\"040\",\"041\",\"042\",\"043\",\"044\",\"045\",\"046\");\n} //fin de if($IdEstado == \"11\")\n\nif($IdEstado == \"12\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\",\"039\",\"040\",\"041\",\"042\",\"043\",\"044\",\"045\",\"046\",\"047\",\"048\",\"049\",\"050\",\"051\",\"052\",\"053\",\"054\",\"055\",\"056\",\"057\",\"058\",\"059\",\"060\",\"061\",\"062\",\"063\",\"064\",\"065\",\"066\",\"067\",\"068\",\"069\",\"070\",\"071\",\"072\",\"073\",\"074\",\"075\",\"076\",\"077\",\"078\",\"079\",\"080\",\"081\");\n} //fin de if($IdEstado == \"12\")\n\nif($IdEstado == \"13\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\",\"039\",\"040\",\"041\",\"042\",\"043\",\"044\",\"045\",\"046\",\"047\",\"048\",\"049\",\"050\",\"051\",\"052\",\"053\",\"054\",\"055\",\"056\",\"057\",\"058\",\"059\",\"060\",\"061\",\"062\",\"063\",\"064\",\"065\",\"066\",\"067\",\"068\",\"069\",\"070\",\"071\",\"072\",\"073\",\"074\",\"075\",\"076\",\"077\",\"078\",\"079\",\"080\",\"081\",\"082\",\"083\",\"084\");\n} //fin de if($IdEstado == \"13\")\n\nif($IdEstado == \"14\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\",\"039\",\"040\",\"041\",\"042\",\"043\",\"044\",\"045\",\"046\",\"047\",\"048\",\"049\",\"050\",\"051\",\"052\",\"053\",\"054\",\"055\",\"056\",\"057\",\"058\",\"059\",\"060\",\"061\",\"062\",\"063\",\"064\",\"065\",\"066\",\"067\",\"068\",\"069\",\"070\",\"071\",\"072\",\"073\",\"074\",\"075\",\"076\",\"077\",\"078\",\"079\",\"080\",\"081\",\"082\",\"083\",\"084\",\"085\",\"086\",\"087\",\"088\",\"089\",\"090\",\"091\",\"092\",\"093\",\"094\",\"095\",\"096\",\"097\",\"098\",\"099\",\"100\",\"101\",\"102\",\"103\",\"104\",\"105\",\"106\",\"107\",\"108\",\"109\",\"110\",\"111\",\"112\",\"113\",\"114\",\"115\",\"116\",\"117\",\"118\",\"119\",\"120\",\"121\",\"122\",\"123\",\"124\",\"125\");\n} //fin de if($IdEstado == \"14\")\n\nif($IdEstado == \"15\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\",\"039\",\"040\",\"041\",\"042\",\"043\",\"044\",\"045\",\"046\",\"047\",\"048\",\"049\",\"050\",\"051\",\"052\",\"053\",\"054\",\"055\",\"056\",\"057\",\"058\",\"059\",\"060\",\"061\",\"062\",\"063\",\"064\",\"065\",\"066\",\"067\",\"068\",\"069\",\"070\",\"071\",\"072\",\"073\",\"074\",\"075\",\"076\",\"077\",\"078\",\"079\",\"080\",\"081\",\"082\",\"083\",\"084\",\"085\",\"086\",\"087\",\"088\",\"089\",\"090\",\"091\",\"092\",\"093\",\"094\",\"095\",\"096\",\"097\",\"098\",\"099\",\"100\",\"101\",\"102\",\"103\",\"104\",\"105\",\"106\",\"107\",\"108\",\"109\",\"110\",\"111\",\"112\",\"113\",\"114\",\"115\",\"116\",\"117\",\"118\",\"119\",\"120\",\"121\",\"122\",\"123\",\"124\",\"125\");\n} //fin de if($IdEstado == \"15\")\n\nif($IdEstado == \"16\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\",\"039\",\"040\",\"041\",\"042\",\"043\",\"044\",\"045\",\"046\",\"047\",\"048\",\"049\",\"050\",\"051\",\"052\",\"053\",\"054\",\"055\",\"056\",\"057\",\"058\",\"059\",\"060\",\"061\",\"062\",\"063\",\"064\",\"065\",\"066\",\"067\",\"068\",\"069\",\"070\",\"071\",\"072\",\"073\",\"074\",\"075\",\"076\",\"077\",\"078\",\"079\",\"080\",\"081\",\"082\",\"083\",\"084\",\"085\",\"086\",\"087\",\"088\",\"089\",\"090\",\"091\",\"092\",\"093\",\"094\",\"095\",\"096\",\"097\",\"098\",\"099\",\"100\",\"101\",\"102\",\"103\",\"104\",\"105\",\"106\",\"107\",\"108\",\"108\",\"109\",\"110\",\"111\",\"112\",\"113\");\n} //fin de if($IdEstado == \"16\")\n\nif($IdEstado == \"17\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\");\n} //fin de if($IdEstado == \"17\")\n\nif($IdEstado == \"18\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\");\n} //fin de if($IdEstado == \"18\")\n\nif($IdEstado == \"19\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\",\"039\",\"040\",\"041\",\"042\",\"043\",\"044\",\"045\",\"046\",\"047\",\"048\",\"049\",\"050\",\"051\");\n} //fin de if($IdEstado == \"19\")\n\nif($IdEstado == \"20\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\",\"039\",\"040\",\"041\",\"042\",\"043\",\"044\",\"045\",\"046\",\"047\",\"048\",\"049\",\"050\",\"051\",\"052\",\"053\",\"054\",\"055\",\"056\",\"057\",\"058\",\"059\",\"060\",\"061\",\"062\",\"063\",\"064\",\"065\",\"066\",\"067\",\"068\",\"069\",\"070\",\"071\",\"072\",\"073\",\"074\",\"075\",\"076\",\"077\",\"078\",\"079\",\"080\",\"081\",\"082\",\"083\",\"084\",\"085\",\"086\",\"087\",\"088\",\"089\",\"090\",\"091\",\"092\",\"093\",\"094\",\"095\",\"096\",\"097\",\"098\",\"099\",\"100\",\"101\",\"102\",\"103\",\"104\",\"105\",\"106\",\"107\",\"108\",\"109\",\"110\",\"111\",\"112\",\"113\",\"114\",\"115\",\"116\",\"117\",\"118\",\"119\",\"120\",\"121\",\"122\",\"123\",\"124\",\"125\",\"126\",\"127\",\"128\",\"129\",\"130\",\"131\",\"132\",\"133\",\"134\",\"135\",\"136\",\"137\",\"138\",\"139\",\"140\",\"141\",\"142\",\"143\",\"144\",\"145\",\"146\",\"147\",\"148\",\"149\",\"150\",\"151\",\"152\",\"153\",\"154\",\"155\",\"156\",\"157\",\"158\",\"159\",\"160\",\"161\",\"162\",\"163\",\"164\",\"165\",\"166\",\"167\",\"168\",\"169\",\"170\",\"171\",\"172\",\"173\",\"174\",\"175\",\"176\",\"177\",\"178\",\"179\",\"180\",\"181\",\"182\",\"183\",\"184\",\"185\",\"186\",\"187\",\"188\",\"189\",\"190\",\"191\",\"192\",\"193\",\"194\",\"195\",\"196\",\"197\",\"198\",\"199\",\"200\",\"201\",\"202\",\"203\",\"204\",\"205\",\"206\",\"207\",\"208\",\"209\",\"210\",\"211\",\"212\",\"213\",\"214\",\"215\",\"216\",\"217\",\"218\",\"219\",\"220\",\"221\",\"222\",\"223\",\"224\",\"225\",\"226\",\"227\",\"228\",\"229\",\"230\",\"231\",\"232\",\"233\",\"234\",\"235\",\"236\",\"237\",\"238\",\"239\",\"240\",\"241\",\"242\",\"243\",\"244\",\"245\",\"246\",\"247\",\"248\",\"249\",\"250\",\"251\",\"252\",\"253\",\"254\",\"255\",\"256\",\"257\",\"258\",\"259\",\"260\",\"261\",\"262\",\"263\",\"264\",\"265\",\"266\",\"267\",\"268\",\"269\",\"270\",\"271\",\"272\",\"273\",\"274\",\"275\",\"276\",\"277\",\"278\",\"279\",\"280\",\"281\",\"282\",\"283\",\"284\",\"285\",\"286\",\"287\",\"288\",\"289\",\"290\",\"291\",\"292\",\"293\",\"294\",\"295\",\"296\",\"297\",\"298\",\"299\",\"300\",\"301\",\"302\",\"303\",\"304\",\"305\",\"306\",\"307\",\"308\",\"309\",\"310\",\"311\",\"312\",\"313\",\"314\",\"315\",\"316\",\"317\",\"318\",\"319\",\"320\",\"321\",\"322\",\"323\",\"324\",\"325\",\"326\",\"327\",\"328\",\"329\",\"330\",\"331\",\"332\",\"333\",\"334\",\"335\",\"336\",\"337\",\"338\",\"339\",\"340\",\"341\",\"342\",\"343\",\"344\",\"345\",\"346\",\"347\",\"348\",\"349\",\"350\",\"351\",\"352\",\"353\",\"354\",\"355\",\"356\",\"357\",\"358\",\"359\",\"360\",\"361\",\"362\",\"363\",\"364\",\"365\",\"366\",\"367\",\"368\",\"369\",\"370\",\"371\",\"372\",\"373\",\"374\",\"375\",\"376\",\"377\",\"378\",\"379\",\"380\",\"381\",\"382\",\"383\",\"384\",\"385\",\"386\",\"387\",\"388\",\"389\",\"390\",\"391\",\"392\",\"393\",\"394\",\"395\",\"396\",\"397\",\"398\",\"399\",\"400\",\"401\",\"402\",\"403\",\"404\",\"405\",\"406\",\"407\",\"408\",\"409\",\"410\",\"411\",\"412\",\"413\",\"414\",\"415\",\"416\",\"417\",\"418\",\"419\",\"420\",\"421\",\"422\",\"423\",\"424\",\"425\",\"426\",\"427\",\"428\",\"429\",\"430\",\"431\",\"432\",\"433\",\"434\",\"435\",\"436\",\"437\",\"438\",\"439\",\"440\",\"441\",\"442\",\"443\",\"444\",\"445\",\"446\",\"447\",\"448\",\"449\",\"450\",\"451\",\"452\",\"453\",\"454\",\"455\",\"456\",\"457\",\"458\",\"459\",\"460\",\"461\",\"462\",\"463\",\"464\",\"465\",\"466\",\"467\",\"468\",\"469\",\"470\",\"471\",\"472\",\"473\",\"474\",\"475\",\"476\",\"477\",\"478\",\"479\",\"480\",\"481\",\"482\",\"483\",\"484\",\"485\",\"486\",\"487\",\"488\",\"489\",\"490\",\"491\",\"492\",\"493\",\"494\",\"495\",\"496\",\"497\",\"498\",\"499\",\"500\",\"501\",\"502\",\"503\",\"504\",\"505\",\"506\",\"507\",\"508\",\"509\",\"510\",\"511\",\"512\",\"513\",\"514\",\"515\",\"516\",\"517\",\"518\",\"519\",\"520\",\"521\",\"522\",\"523\",\"524\",\"525\",\"526\",\"527\",\"528\",\"529\",\"530\",\"531\",\"532\",\"533\",\"534\",\"535\",\"536\",\"537\",\"538\",\"539\",\"540\",\"541\",\"542\",\"543\",\"544\",\"545\",\"546\",\"547\",\"548\",\"549\",\"550\",\"551\",\"552\",\"553\",\"554\",\"555\",\"556\",\"557\",\"558\",\"559\",\"560\",\"561\",\"562\",\"563\",\"564\",\"565\",\"566\",\"567\",\"568\",\"569\",\"570\");\n} //fin de if($IdEstado == \"20\")\n\nif($IdEstado == \"21\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\",\"039\",\"040\",\"041\",\"042\",\"043\",\"044\",\"045\",\"046\",\"047\",\"048\",\"049\",\"050\",\"051\",\"052\",\"053\",\"054\",\"055\",\"056\",\"057\",\"058\",\"059\",\"060\",\"061\",\"062\",\"063\",\"064\",\"065\",\"066\",\"067\",\"068\",\"069\",\"070\",\"071\",\"072\",\"073\",\"074\",\"075\",\"076\",\"077\",\"078\",\"079\",\"080\",\"081\",\"082\",\"083\",\"084\",\"085\",\"086\",\"087\",\"088\",\"089\",\"090\",\"091\",\"092\",\"093\",\"094\",\"095\",\"096\",\"097\",\"098\",\"099\",\"100\",\"101\",\"102\",\"103\",\"104\",\"105\",\"106\",\"107\",\"108\",\"109\",\"110\",\"111\",\"112\",\"113\",\"114\",\"115\",\"116\",\"117\",\"118\",\"119\",\"120\",\"121\",\"122\",\"123\",\"124\",\"125\",\"126\",\"127\",\"128\",\"129\",\"130\",\"131\",\"132\",\"133\",\"134\",\"135\",\"136\",\"137\",\"138\",\"139\",\"140\",\"141\",\"142\",\"143\",\"144\",\"145\",\"146\",\"147\",\"148\",\"149\",\"150\",\"151\",\"152\",\"153\",\"154\",\"155\",\"156\",\"157\",\"158\",\"159\",\"160\",\"161\",\"162\",\"163\",\"164\",\"165\",\"166\",\"167\",\"168\",\"169\",\"170\",\"171\",\"172\",\"173\",\"174\",\"175\",\"176\",\"177\",\"178\",\"179\",\"180\",\"181\",\"182\",\"183\",\"184\",\"185\",\"186\",\"187\",\"188\",\"189\",\"190\",\"191\",\"192\",\"193\",\"194\",\"195\",\"196\",\"197\",\"198\",\"199\",\"200\",\"201\",\"202\",\"203\",\"204\",\"205\",\"206\",\"207\",\"208\",\"209\",\"210\",\"211\",\"212\",\"213\",\"214\",\"215\",\"216\",\"217\");\n} //fin de if($IdEstado == \"21\")\n\nif($IdEstado == \"22\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\");\n} //fin de if($IdEstado == \"22\")\n\nif($IdEstado == \"23\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\");\n} //fin de if($IdEstado == \"23\")\n\nif($IdEstado == \"24\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\",\"039\",\"040\",\"041\",\"042\",\"043\",\"044\",\"045\",\"046\",\"047\",\"048\",\"049\",\"050\",\"051\",\"052\",\"053\",\"054\",\"055\",\"056\",\"057\",\"058\");\n} //fin de if($IdEstado == \"24\")\n\nif($IdEstado == \"25\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\");\n} //fin de if($IdEstado == \"25\")\n\nif($IdEstado == \"26\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\",\"039\",\"040\",\"041\",\"042\",\"043\",\"044\",\"045\",\"046\",\"047\",\"048\",\"049\",\"050\",\"051\",\"052\",\"053\",\"054\",\"055\",\"056\",\"057\",\"058\",\"059\",\"060\",\"061\",\"062\",\"063\",\"064\",\"065\",\"066\",\"067\",\"068\",\"069\",\"070\",\"071\",\"072\");\n} //fin de if($IdEstado == \"26\")\n\nif($IdEstado == \"27\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\");\n} //fin de if($IdEstado == \"27\")\n\nif($IdEstado == \"28\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\",\"039\",\"040\",\"041\",\"042\",\"043\");\n} //fin de if($IdEstado == \"28\")\n\nif($IdEstado == \"29\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\",\"039\",\"040\",\"041\",\"042\",\"043\",\"044\",\"045\",\"046\",\"047\",\"048\",\"049\",\"050\",\"051\",\"052\",\"053\",\"054\",\"055\",\"056\",\"057\",\"058\",\"059\",\"060\");\n} //fin de if($IdEstado == \"29\")\n\nif($IdEstado == \"30\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\",\"039\",\"040\",\"041\",\"042\",\"043\",\"044\",\"045\",\"046\",\"047\",\"048\",\"049\",\"050\",\"051\",\"052\",\"053\",\"054\",\"055\",\"056\",\"057\",\"058\",\"059\",\"060\",\"061\",\"062\",\"063\",\"064\",\"065\",\"066\",\"067\",\"068\",\"069\",\"070\",\"071\",\"072\",\"073\",\"074\",\"075\",\"076\",\"077\",\"078\",\"079\",\"080\",\"081\",\"082\",\"083\",\"084\",\"085\",\"086\",\"087\",\"088\",\"089\",\"090\",\"091\",\"092\",\"093\",\"094\",\"095\",\"096\",\"097\",\"098\",\"099\",\"100\",\"101\",\"102\",\"103\",\"104\",\"105\",\"106\",\"107\",\"108\",\"109\",\"110\",\"111\",\"112\",\"113\",\"114\",\"115\",\"116\",\"117\",\"118\",\"119\",\"120\",\"121\",\"122\",\"123\",\"124\",\"125\",\"126\",\"127\",\"128\",\"129\",\"130\",\"131\",\"132\",\"133\",\"134\",\"135\",\"136\",\"137\",\"138\",\"139\",\"140\",\"141\",\"142\",\"143\",\"144\",\"145\",\"146\",\"147\",\"148\",\"149\",\"150\",\"151\",\"152\",\"153\",\"154\",\"155\",\"156\",\"157\",\"158\",\"159\",\"160\",\"161\",\"162\",\"163\",\"164\",\"165\",\"166\",\"167\",\"168\",\"169\",\"170\",\"171\",\"172\",\"173\",\"174\",\"175\",\"176\",\"177\",\"178\",\"179\",\"180\",\"181\",\"182\",\"183\",\"184\",\"185\",\"186\",\"187\",\"188\",\"189\",\"190\",\"191\",\"192\",\"193\",\"194\",\"195\",\"196\",\"197\",\"198\",\"199\",\"200\",\"201\",\"202\",\"203\",\"204\",\"205\",\"206\",\"207\",\"208\",\"209\",\"210\",\"211\",\"212\");\n} //fin de if($IdEstado == \"30\")\n\nif($IdEstado == \"31\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\",\"039\",\"040\",\"041\",\"042\",\"043\",\"044\",\"045\",\"046\",\"047\",\"048\",\"049\",\"050\",\"051\",\"052\",\"053\",\"054\",\"055\",\"056\",\"057\",\"058\",\"059\",\"060\",\"061\",\"062\",\"063\",\"064\",\"065\",\"066\",\"067\",\"068\",\"069\",\"070\",\"071\",\"072\",\"073\",\"074\",\"075\",\"076\",\"077\",\"078\",\"079\",\"080\",\"081\",\"082\",\"083\",\"084\",\"085\",\"086\",\"087\",\"088\",\"089\",\"090\",\"091\",\"092\",\"093\",\"094\",\"095\",\"096\",\"097\",\"098\",\"099\",\"100\",\"101\",\"102\",\"103\",\"104\",\"105\",\"106\");\n} //fin de if($IdEstado == \"31\")\n\nif($IdEstado == \"32\"){\n\t$Mpio = array(\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\",\"011\",\"012\",\"013\",\"014\",\"015\",\"016\",\"017\",\"018\",\"019\",\"020\",\"021\",\"022\",\"023\",\"024\",\"025\",\"026\",\"027\",\"028\",\"029\",\"030\",\"031\",\"032\",\"033\",\"034\",\"035\",\"036\",\"037\",\"038\",\"039\",\"040\",\"041\",\"042\",\"043\",\"044\",\"045\",\"046\",\"047\",\"048\",\"049\",\"050\",\"051\",\"052\",\"053\",\"054\",\"055\",\"056\",\"057\",\"058\");\n} //fin de if($IdEstado == \"32\")\n\n\n\n\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == TRES)\n\t{\n\t\tif(!in_array($LocCampo,$Mpio))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_26.\"|\".$LocCampo.\"|\" . $DI_26_Mpio.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\t$Error = $NumReg .\"|\".$DI_26.\"|\".$LocCampo.\"|\" . $DI_26_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "function gagal() {\n echo $_err = ErrorMsg(\"Login Gagal\", \"Kode Login dan Password salah!!!\n <hr size=1 color=#3b5998>\n Perhatikan Anda Login sebagai siapa dan pastikan Anda memasukan Kode Login dan password dengan benar.\n\t <hr size=1 color=#3b5998>\n Untuk informasi lebih lanjut hubungi Administrator.\n\t <hr size=1 color=#3b5998>\n Silahkan <a href='index.php'>Coba Lagi</a>\");\n}", "public function dig()\r\n\t{\r\n\t\techo \"Dug a hole \";\r\n\t}", "function msgError($cadena = '', $printMsg = TRUE) {\r\n\t$echo = \"<div style=\\\"background:#FFFBE6;border:1px dotted #ccc;padding:5px;margin:5px 0;font:12px tahoma;\\\">\".$cadena.\"</div>\";\r\n\tif ($printMsg === TRUE) {\r\n\t\techo ($echo);\r\n\t} else {\r\n\t\treturn $echo;\r\n\t}\r\n}", "function delete_desa($id)\n\t{\n\t\t//--> hapus data desa\n\t\t$this->db->delete('sub_instansi', array('id' => $id));\n\n \t\treturn true;\n\t}" ]
[ "0.60263354", "0.5740359", "0.56125563", "0.5595033", "0.5550792", "0.5546501", "0.5527708", "0.55199057", "0.5504964", "0.5492563", "0.548664", "0.54574996", "0.54550743", "0.5449072", "0.5439263", "0.54296976", "0.5426049", "0.54183483", "0.5414306", "0.5402282", "0.5397226", "0.5384479", "0.5381633", "0.5380714", "0.53734124", "0.53656507", "0.5365594", "0.5364815", "0.5335736", "0.5335598", "0.53352845", "0.5326862", "0.5326754", "0.53055054", "0.5294448", "0.5274918", "0.5269029", "0.52682763", "0.52663857", "0.5264241", "0.52575743", "0.52563626", "0.5252131", "0.52423257", "0.5242097", "0.5234087", "0.521885", "0.5213553", "0.51981884", "0.5197681", "0.519593", "0.5181232", "0.51790947", "0.5179077", "0.5179062", "0.5178424", "0.5177686", "0.5176921", "0.51734024", "0.5169185", "0.5168236", "0.5167023", "0.51639473", "0.51624435", "0.5160264", "0.5159768", "0.5159603", "0.5159373", "0.5158294", "0.5153219", "0.51502174", "0.5149977", "0.5147864", "0.5147432", "0.51470524", "0.51295584", "0.5125367", "0.5114921", "0.5111634", "0.51113325", "0.51104486", "0.5105233", "0.50904715", "0.5085566", "0.508313", "0.50816053", "0.50803554", "0.5078746", "0.5078159", "0.5077902", "0.5075709", "0.50751686", "0.5070741", "0.5068549", "0.5066779", "0.5064994", "0.5060833", "0.5057808", "0.50567466", "0.5055986", "0.50559664" ]
0.0
-1
Test all primary routes These are routes that do not redirect or are not legacy These are all anonymouse pages so no authentication is needed
public function testPrimaryRoutes() { /* //Filters disabled during unit tests unless you enable them //I need them enabled because they log the user in as anonymous Route::enableFilters(); // Test base route // Should show post id 1 $response = $this->call('GET', '/'); $post = $response->original['post']; $this->assertResponseOk(); $this->assertViewHas('post'); $this->assertEquals(1, $post->id); $this->assertEquals('9d3e171a-62a9-e958-bdfa-d6f224ca8cad', $post->uuid); // Test /home is post 1 $clicksBefore = Router::where('slug', '=', 'home')->first()->clicks; $response = $this->call('GET', '/home'); $post = $response->original['post']; $this->assertResponseOk(); $this->assertViewHas('post'); $this->assertEquals(1, $post->id); $this->assertEquals('9d3e171a-62a9-e958-bdfa-d6f224ca8cad', $post->uuid); $clicksAfter = Router::where('slug', '=', 'home')->first()->clicks; $this->assertEquals(++$clicksBefore, $clicksAfter); // Test /about is post 2 $response = $this->call('GET', '/about'); $post = $response->original['post']; $this->assertResponseOk(); $this->assertViewHas('post'); $this->assertEquals(2, $post->id); $this->assertEquals('f1112648-782e-aad3-785d-640fcfefaa9b', $post->uuid); // ##### Login as mReschke ##### Auth::login(User::find(2)); Auth::user()->login(); // Test /13/mreschke-home-page (non named route) $response = $this->call('GET', '/13/mreschke-home-page'); $post = $response->original['post']; $this->assertResponseOk(); $this->assertViewHas('post'); $this->assertEquals(13, $post->id); $this->assertEquals('1a52e0e3-3174-7b2b-a582-03a39e52e34a', $post->uuid); // Test /14/squaethem-home-page (non named route) $response = $this->call('GET', '/14/squaethem-home-page'); $post = $response->original['post']; $this->assertResponseOk(); $this->assertViewHas('post'); $this->assertEquals(14, $post->id); $this->assertEquals('e80e907e-50d4-8ed4-70f7-5d1815672966', $post->uuid); */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testOtherRoutes()\n\t{\n\t\t/*//Filters disabled during unit tests unless you enable them\n\t\t//I need them enabled because they log the user in as anonymous\n\t\tRoute::enableFilters();\n\n\t\t// /google redirects to http://google.com\n\t\t$clicksBefore = Router::where('slug', '=', 'google')->first()->clicks;\n\t\t$this->call('GET', '/google');\n\t\t$this->assertRedirectedTo('http://google.com');\n\t\t$clicksAfter = Router::where('slug', '=', 'google')->first()->clicks;\n\t\t$this->assertEquals(++$clicksBefore, $clicksAfter);\n\n\t\t// /google2 is a disabled route\n\t\t$this->call('GET', '/google2');\n\t\t$this->assertResponseStatus(404);\n\n\t\t$this->call('GET', '/99/invalid');\n\t\t$this->assertResponseStatus(404);\n\n\t\t$this->call('GET', '/this/is/invalid');\n\t\t$this->assertResponseStatus(404);\n\t\t\n\n\t\t// Test search route\n\t\t// ??\n\n\t\t// Test net route\n\t\t// ??\n\n\t\t// Test login route\n\t\t$this->call('GET', '/login');\n\t\t$this->assertResponseOk();\n\n\t\t// Test logout route redirects to /\n\t\t$this->call('GET', '/logout');\n\t\t$this->assertRedirectedTo('/');\n\t\t*/\n\n\t}", "public function testLegacyRoutes()\n\t{\n\t\t/*//Filters disabled during unit tests unless you enable them\n\t\t//I need them enabled because they log the user in as anonymous\n\t\tRoute::enableFilters();\n\n\t\t// Test /topic/1 redirects to /home\n\t\t$this->call('GET', '/topic/1');\n\t\t$this->assertRedirectedTo('/home');\n\t\t$this->call('GET', '/topic/1/doesnt/matter');\n\t\t$this->assertRedirectedTo('/home');\n\n\t\t// ?? files/1 does not currently redirect\n\t\t// not sure if it should or not yet\n\t\t*/\n\n\t}", "public function testSecondaryRoutes()\n\t{\n\t\t/*//Filters disabled during unit tests unless you enable them\n\t\t//I need them enabled because they log the user in as anonymous\n\t\tRoute::enableFilters();\n\n\t\t// Test /1 redirects to /home\n\t\t$this->call('GET', '/1');\n\t\t$this->assertRedirectedTo('/home');\n\n\t\t// Test /1/anything/here redirects to /home\n\t\t$this->call('GET', '/1/anything/here');\n\t\t$this->assertRedirectedTo('/home');\n\n\t\t// Test /1 redirects to /home\n\t\t$this->call('GET', '/post/1');\n\t\t$this->assertRedirectedTo('/home');\n\n\t\t// Test /9d3e171a-62a9-e958-bdfa-d6f224ca8cad redirects to /home\n\t\t$this->call('GET', '/9d3e171a-62a9-e958-bdfa-d6f224ca8cad');\n\t\t$this->assertRedirectedTo('/home');\n\n\t\t// Test /home2 is post 1 (this is an optional route to post 1)\n\t\t// /home2 displays post 1, it does not redirect to /home\n\t\t$clicksBefore = Router::where('slug', '=', 'home2')->first()->clicks;\n\t\t$response = $this->call('GET', '/home2');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(1, $post->id);\n\t\t$this->assertEquals('9d3e171a-62a9-e958-bdfa-d6f224ca8cad', $post->uuid);\n\t\t$clicksAfter = Router::where('slug', '=', 'home2')->first()->clicks;\n\t\t$this->assertEquals(++$clicksBefore, $clicksAfter);\n\n\n\t\t// Test /home3 which is a disabled route\n\t\t$this->call('GET', '/home3');\n\t\t$this->assertResponseStatus(404);\n\n\n\t\t// ##### Login as mReschke #####\n\t\tAuth::login(User::find(2)); Auth::user()->login();\n\n\t\t// Test /13/blah redirects to /13/mreschke-home-page\n\t\t$this->call('GET', '/13/blah');\n\t\t$this->assertRedirectedTo('/13/mreschke-home-page');\n\n\t\t// Test /13 and /13/ redirects to /13/mreschke-home-page\n\t\t$this->call('GET', '/13');\n\t\t$this->assertRedirectedTo('/13/mreschke-home-page');\n\t\t$this->call('GET', '/13/');\n\t\t$this->assertRedirectedTo('/13/mreschke-home-page');\n\n\t\t// Test /13 redirects to /13/mreschke-home-page\n\t\t$this->call('GET', '/post/13');\n\t\t$this->assertRedirectedTo('/13/mreschke-home-page');\n\t\t*/\n\n\t}", "public function test_AllRoutesNoAuthAvailable()\n {\n //should be possible without any DB entry\n\n Session::start();\n $token = session('_token');\n\n $credentials = array(\n 'email' => '[email protected]',\n 'password' => 'wrongpass',\n '_token' => $token\n );\n\n $session = array(\n '_token' => $token\n );\n\n //index has redirect\n $this->get('/')->assertStatus(302);\n\n //index redirect to login page\n $this->followingRedirects()->get('/')\n ->assertStatus(200)\n ->assertViewIs('auth.login')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //Auth Login\n $this->get('/login')->assertStatus(200)\n ->assertViewIs('auth.login')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n $this->followingRedirects()->post('/login', $credentials)->assertStatus(200)\n ->assertViewIs('auth.login');\n\n //Auth Logout POST\n $this->followingRedirects()->post('/logout', ['_token' => $token])->assertStatus(200)\n ->assertViewIs('auth.login')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //Auth Logout GET\n $this->get('/logout')->assertStatus(302);\n $this->followingRedirects()->get('/logout')->assertStatus(200)\n ->assertViewIs('auth.login')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //Register Message GET\n $this->get('/auth/success')->assertStatus(200)\n ->assertSee('Dein Benutzer muss erst freigeschaltet werden. Du wirst per E-Mail benachrichtigt.')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n // impressum\n $this->get('/impressum')->assertStatus(200)->assertSee('Impressum')->assertSee('Datenschutz');;\n\n // datenschutz\n $this->get('/datenschutz')->assertStatus(200)->assertSee('Impressum')->assertSee('Datenschutz');\n\n // order\n $this->get('/order')->assertStatus(200)\n ->assertSee('Dein Dienstplan')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->get('/order/create/basic')->assertStatus(200)\n ->assertSee('Basis Paket')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->get('/order/create/module')->assertStatus(200)\n ->assertSee('Modulares Paket')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->get('/order/create/support')->assertStatus(200)\n ->assertSee('Support Paket')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //following sites should not be available for guests and redirect to login\n\n //home\n $this->followingRedirects()->get('/home')->assertStatus(200)->assertViewIs('auth.login');\n\n //mailtest\n $this->followingRedirects()->get('/mailtest')->assertStatus(200)->assertViewIs('auth.login');\n\n //pdf extract\n $this->followingRedirects()->get('/pdf')->assertStatus(200)->assertViewIs('auth.login');\n\n //sendService PDF\n $this->followingRedirects()->get('/sendServicePDF')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/sendServicePDF', $session)->assertStatus(419);\n\n //userguide\n $this->followingRedirects()->get('/userguide')->assertStatus(200)->assertViewIs('auth.login');\n\n //superadmin user\n $this->followingRedirects()->get('/superadmin/user')->assertStatus(200)->assertViewIs('auth.login');\n\n //qualification (resource)\n $this->followingRedirects()->get('/qualification')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/qualification', $session)->assertStatus(419);\n $this->followingRedirects()->get('/qualification/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/qualification/1', $session)->assertStatus(419);\n $this->delete('/qualification/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/qualification/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/qualification/create')->assertStatus(200)->assertViewIs('auth.login');\n\n //user (resource)\n $this->followingRedirects()->get('/user')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/user', $session)->assertStatus(419);\n $this->followingRedirects()->get('/user/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/user/1', $session)->assertStatus(419);\n $this->delete('/user/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/user/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/user/create')->assertStatus(200)->assertViewIs('auth.login');\n\n //user approve\n $this->followingRedirects()->get('/user/approve/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/user/approve/1', $session)->assertStatus(419);\n\n //client (resource)\n $this->followingRedirects()->get('/client')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/client', $session)->assertStatus(419);\n $this->followingRedirects()->get('/client/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/client/1', $session)->assertStatus(419);\n $this->delete('/client/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/client/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/client/create')->assertStatus(200)->assertViewIs('auth.login');\n\n // client apply\n $this->followingRedirects()->get('/clientapply')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/client/1/apply')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/client/1/apply', $session)->assertStatus(419);\n $this->delete('/client/1/apply', $session)->assertStatus(419);\n $this->put('/client/1/apply', $session)->assertStatus(419);\n $this->followingRedirects()->get('/client/1/apply/revert')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/client/1/apply/revert', $session)->assertStatus(419);\n $this->delete('/client/1/apply/revert', $session)->assertStatus(419);\n $this->put('/client/1/apply/revert', $session)->assertStatus(419);\n $this->followingRedirects()->get('/client/1/removeuser/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/client/1/removeuser/1', $session)->assertStatus(419);\n $this->delete('/client/1/removeuser/1', $session)->assertStatus(419);\n $this->put('/client/1/removeuser/1', $session)->assertStatus(419);\n\n //client update module\n $this->followingRedirects()->get('/client/module')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/client/module', $session)->assertStatus(419);\n $this->delete('/client/module', $session)->assertStatus(419);\n $this->put('/client/module', $session)->assertStatus(419);\n\n //change client\n $this->followingRedirects()->get('/changeclient/1')->assertStatus(200)->assertViewIs('auth.login');\n\n //service (resource)\n $this->followingRedirects()->get('/service')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/servicehistory')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/service/finalize/1')->assertStatus(200)->assertViewIs('auth.login');\n\n $this->post('/service', $session)->assertStatus(419);\n $this->followingRedirects()->get('/service/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/service/1', $session)->assertStatus(419);\n $this->delete('/service/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/service/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/service/create')->assertStatus(200)->assertViewIs('auth.login');\n\n $this->followingRedirects()->get('/service/1/delete')->assertStatus(200)->assertViewIs('auth.login');\n\n //training (resource)\n $this->followingRedirects()->get('/training')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/training', $session)->assertStatus(419);\n $this->followingRedirects()->get('/training/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/training/1', $session)->assertStatus(419);\n $this->delete('/training/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/training/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/training/create')->assertStatus(200)->assertViewIs('auth.login');\n\n $this->followingRedirects()->get('/training/1/delete')->assertStatus(200)->assertViewIs('auth.login');\n\n //training user\n $this->followingRedirects()->get('/training/training_user/1/delete')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/training/training_user/1/delete', $session)->assertStatus(419);\n $this->delete('/training/training_user/1/delete', $session)->assertStatus(419);\n $this->put('/training/training_user/1/delete', $session)->assertStatus(419);\n\n //news (resource)\n $this->followingRedirects()->get('/news')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/news', $session)->assertStatus(419);\n $this->followingRedirects()->get('/news/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/news/1', $session)->assertStatus(419);\n $this->delete('/news/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/news/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/news/create')->assertStatus(200)->assertViewIs('auth.login');\n\n $this->followingRedirects()->get('/news/1/delete')->assertStatus(200)->assertViewIs('auth.login');\n\n //holiday (resource)\n $this->followingRedirects()->get('/holiday')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/holiday', $session)->assertStatus(419);\n $this->followingRedirects()->get('/holiday/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/holiday/1', $session)->assertStatus(419);\n $this->delete('/holiday/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/holiday/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/holiday/create')->assertStatus(200)->assertViewIs('auth.login');\n\n $this->followingRedirects()->get('/holiday/storeservice/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/holiday/storetraining/1')->assertStatus(200)->assertViewIs('auth.login');\n\n // Qualification <-> User\n $this->post('/qualification_user/create', $session)->assertStatus(419);\n $this->followingRedirects()->get('/qualification_user/delete/1/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/qualification_user/delete/1/1', $session)->assertStatus(419);\n\n // Client <-> User\n $this->post('/client_user/admin', $session)->assertStatus(419);\n $this->post('/client_user/trainingeditor', $session)->assertStatus(419);\n\n //Position\n $this->followingRedirects()->get('/position/1/subscribe')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/subscribe', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/1/subscribe_user/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/subscribe_user/1', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/1/unsubscribe')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/unsubscribe', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/1/unsubscribe_user/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/unsubscribe_user/1', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/1/authorize')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/authorize', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/1/deauthorize')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/deauthorize', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/list_notAuthorized')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/list_notAuthorized', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/1/position_user')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/position_user', $session)->assertStatus(419);\n\n //Statistic\n $this->followingRedirects()->get('/statistic')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/statistic', $session)->assertStatus(419);\n\n //Calendar\n $this->followingRedirects()->get('/calendar')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/calendar', $session)->assertStatus(419);\n $this->followingRedirects()->get('/calendar/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/calendar/1', $session)->assertStatus(419);\n $this->delete('/calendar/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/calendar/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/calendar/1/delete')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/calendar/create')->assertStatus(200)->assertViewIs('auth.login');\n\n //Survey\n $this->followingRedirects()->get('/survey')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/survey', $session)->assertStatus(419);\n $this->followingRedirects()->get('/survey/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/survey/1', $session)->assertStatus(419);\n $this->delete('/survey/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/survey/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/survey/create')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->post('/survey/vote/1')->assertStatus(419);\n $this->followingRedirects()->get('/survey/postpone/1')->assertStatus(200)->assertViewIs('auth.login');\n }", "public function testNonPublicPages()\n {\n $this->get('/home')->assertStatus(302);\n $this->get('/routes')->assertStatus(302);\n $this->get('/themes')->assertStatus(302);\n $this->get('/users')->assertStatus(302);\n $this->get('/users/create')->assertStatus(302);\n $this->get('/phpinfo')->assertStatus(302);\n $this->get('/profile/create')->assertStatus(302);\n }", "public function test_admin_auth_routes(){\n Event::fake();\n $this->get('admin/dashboard')->assertStatus(403);\n }", "public function testPublicPagesAllowed()\n {\n $this->get('/')->assertStatus(200);\n $this->get('/login')->assertStatus(200);\n $this->get('/password/reset')->assertStatus(200);\n $this->get('/register')->assertStatus(200);\n }", "public function testUrlCatchAllRoute(): void\n {\n Router::createRouteBuilder('/')\n ->connect('/*', ['controller' => 'Categories', 'action' => 'index']);\n $result = Router::url(['controller' => 'Categories', 'action' => 'index', '0']);\n $this->assertSame('/0', $result);\n\n $expected = [\n 'plugin' => null,\n 'controller' => 'Categories',\n 'action' => 'index',\n 'pass' => ['0'],\n '_matchedRoute' => '/*',\n ];\n $result = Router::parseRequest($this->makeRequest('/0', 'GET'));\n unset($result['_route']);\n $this->assertEquals($expected, $result);\n\n $result = Router::parseRequest($this->makeRequest('0', 'GET'));\n unset($result['_route']);\n $this->assertEquals($expected, $result);\n }", "public function testCanSendRoute()\n {\n $this->assertEmpty([]);\n\n $routes = $this->app->getRoutes();\n\n foreach ($routes as $route) {\n if ($route->getName() == 'api.oauth') {\n $this->assertContains('POST', $route->getAllowedMethods());\n $this->assertEquals('/api/oauth', $route->getPath());\n }\n }\n }", "public function assertApiRoutesAreProtectedWhenUnauthorized()\n {\n $assertion = true;\n $routes = $this->getApiRoutes();\n\n foreach ($routes as $route) {\n if (!$this->assertApiRouteIsProtectedWhenUnauthorized($route)) {\n $assertion = false;\n break;\n }\n }\n\n $this->assertTrue($assertion);\n }", "public function beforeRoute()\n {\n if (!Session::get('userid')) {\n \\BarkaneArts\\redirect('/login');\n }\n parent::beforeRoute();\n }", "public function test_route_override() {\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' ),\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t'should_exist' => false,\n\t\t\t)\n\t\t);\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( 'POST' ),\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t'should_exist' => true,\n\t\t\t),\n\t\t\ttrue\n\t\t);\n\n\t\t// Check we only have one route.\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$endpoint = $endpoints['/test-ns/test'];\n\t\t$this->assertCount( 1, $endpoint );\n\n\t\t// Check it's the right one.\n\t\t$this->assertArrayHasKey( 'should_exist', $endpoint[0] );\n\t\t$this->assertTrue( $endpoint[0]['should_exist'] );\n\t}", "private function _allowTestRoutes()\n {\n // [taz] See if the main config file is already loaded, so we can tell whether to remove testing routes.\n $mainConfig = Zend_Registry::getInstance()->get('CONFIG');\n \n // [taz] If $mainConfig isn't set, disallow test routes by default.\n if (!$mainConfig) {\n \treturn false;\n }\n \n // [taz] Return the setting of debug.allow_test_routes.\n return $mainConfig->debug->allow_test_routes; \n }", "public function testBasicRouteMatching() {\n\t\tRouter::connect('/hello', ['controller' => 'Posts', 'action' => 'index']);\n\t\t$expected = ['controller' => 'Posts', 'action' => 'index'];\n\n\t\tforeach (['/hello/', '/hello', 'hello/', 'hello'] as $url) {\n\t\t\t$this->request->url = $url;\n\t\t\t$result = Router::parse($this->request);\n\t\t\t$this->assertEqual($expected, $result->params);\n\t\t\t$this->assertEqual(['controller'], $result->persist);\n\t\t}\n\t}", "public function testSimpleRoutes() {\n\t\t$rules = array(\n\t\t\t'Index/Index' => '/',\n\t\t\t'Index/Simple' => '/test/simple',\n\t\t\t'Index/Language' => '/test/en',\n\t\t\t'Index/WithoutSlash' => '/test'\n\t\t);\n\n\t\t$controller = null;\n\t\t$action = null;\n\n\t\tforeach ($this->languages as $language) {\n\t\t\tforeach ($rules as $controllerAction => $uri) {\n\t\t\t\t$route = $this->getRouter('/' . $language . $uri, $rules)->getRoute($controller, $action);\n\n\t\t\t\t$this->assertEquals($controllerAction, $route, 'The route for an empty request does not match');\n\t\t\t\t$this->assertEquals($route, $controller . '/' . $action,\n\t\t\t\t\t'The outgoing parameters do not match the returned route');\n\t\t\t}\n\t\t}\n\t}", "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 }", "function _route()\n\t{\n\t\t// if the user login redirect to base\n\t\tif(\\lib\\permission::access('enter:another:session'))\n\t\t{\n\t\t\t// the admin can login by another session\n\t\t\t// never redirect to main\n\t\t}\n\t\telse\n\t\t{\n\t\t\tparent::if_login_not_route();\n\t\t}\n\n\t\t// check remeber me is set\n\t\t// if remeber me is set: login!\n\t\tparent::check_remember_me();\n\n\t\t// save all param-* | param_* in $_GET | $_POST\n\t\t$this->save_param();\n\n\t\tif(self::get_request_method() === 'get')\n\t\t{\n\t\t\t$this->get(false, 'enter')->ALL();\n\t\t}\n\t\telseif(self::get_request_method() === 'post')\n\t\t{\n\t\t\t$this->post('enter')->ALL();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tself::error_method('home');\n\t\t}\n\t}", "public function testGetRoutes()\n {\n $this->disableExceptionHandling();\n\n $this->visit(route('voyager.login'));\n $this->type('[email protected]', 'email');\n $this->type('password', 'password');\n $this->press(__('voyager::generic.login'));\n\n $urls = [\n route('voyager.dashboard'),\n route('voyager.media.index'),\n route('voyager.settings.index'),\n route('voyager.roles.index'),\n route('voyager.roles.create'),\n route('voyager.roles.show', 1),\n route('voyager.roles.edit', 1),\n route('voyager.users.index'),\n route('voyager.users.create'),\n route('voyager.users.show', 1),\n route('voyager.users.edit', 1),\n route('voyager.posts.index'),\n route('voyager.posts.create'),\n route('voyager.posts.show', 1),\n route('voyager.posts.edit', 1),\n route('voyager.pages.index'),\n route('voyager.pages.create'),\n route('voyager.pages.show', 1),\n route('voyager.pages.edit', 1),\n route('voyager.categories.index'),\n route('voyager.categories.create'),\n route('voyager.categories.show', 1),\n route('voyager.categories.edit', 1),\n route('voyager.menus.index'),\n route('voyager.menus.create'),\n route('voyager.menus.show', 1),\n route('voyager.menus.edit', 1),\n route('voyager.database.index'),\n route('voyager.bread.edit', 'categories'),\n route('voyager.database.edit', 'categories'),\n route('voyager.database.create'),\n ];\n\n foreach ($urls as $url) {\n $response = $this->call('GET', $url);\n $this->assertEquals(200, $response->status(), $url.' did not return a 200');\n }\n }", "public function testFindAllByRoute()\n {\n $this->markTestIncomplete('WebTestCases are not implemented yet.');\n }", "public function test_AllRoutesAsUserAvailable()\n {\n //fill DB with demo data to act like a User\n $this->artisan('demo:createDemoClient');\n\n //session\n Session::start();\n $token = session('_token');\n $credentials = array(\n 'email' => '[email protected]',\n 'password' => 'user',\n '_token' => $token\n );\n\n //act as User\n $user = User::where('name', '=', \"User\")->first();\n\n //Login as User\n //GET|HEAD | login\n $this->get('/login')->assertStatus(200)\n ->assertViewIs('auth.login')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //POST | login\n $this->followingRedirects()->post('/login', $credentials)->assertStatus(200)\n ->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //Login: redirect to home\n $this->actingAs($user)->followingRedirects()->get('/login')\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n\n //GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | /\n $this->actingAs($user)->followingRedirects()->get('/')\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->actingAs($user)->followingRedirects()->post('/', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->actingAs($user)->followingRedirects()->put('/', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->actingAs($user)->followingRedirects()->patch('/', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->actingAs($user)->followingRedirects()->delete('/', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->actingAs($user)->followingRedirects()->options('/', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | auth/success\n $this->actingAs($user)->followingRedirects()->get('/auth/success')\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | captcha/api/{config?}\n $this->actingAs($user)->followingRedirects()->get('/captcha/api/')\n ->assertStatus(200);\n\n //GET|HEAD | captcha/{config?}\n $this->actingAs($user)->followingRedirects()->get('/captcha')\n ->assertStatus(200);\n\n //GET|HEAD | changeclient/{client}\n $this->actingAs($user)->followingRedirects()->get('/changeclient/'.($user->currentclient_id))->assertStatus(200);\n $this->actingAs($user)->followingRedirects()->get('/changeclient/'.($user->currentclient_id+1))->assertStatus(500);\n\n //POST | client\n $this->actingAs($user)->followingRedirects()->post('/client', ['_token' => $token])->assertStatus(402); //not allowed in demo mode\n\n //GET|HEAD | client\n $this->actingAs($user)->followingRedirects()->get('/client')->assertStatus(402); //only as superadmin\n\n //GET|HEAD | client/create\n $this->actingAs($user)->followingRedirects()->get('/client/create')->assertStatus(402); //only as superadmin\n\n //GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | client/module\n $this->actingAs($user)->followingRedirects()->get('/client/module')->assertStatus(402); //only as superadmin\n $this->actingAs($user)->followingRedirects()->post('/client/module', ['_token' => $token,])->assertStatus(402); //only as superadmin\n $this->actingAs($user)->followingRedirects()->put('/client/module', ['_token' => $token])->assertStatus(402); //only as superadmin\n $this->actingAs($user)->followingRedirects()->patch('/client/module', ['_token' => $token])->assertStatus(402); //only as superadmin\n $this->actingAs($user)->followingRedirects()->delete('/client/module', ['_token' => $token])->assertStatus(402); //only as superadmin\n $this->actingAs($user)->followingRedirects()->options('/client/module')->assertStatus(402); //only as superadmin\n\n //GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | client/{clientid}/apply\n $this->actingAs($user)->get('/client/'.$user->currentclient_id.'/apply')->assertStatus(302);\n $this->actingAs($user)->post('/client/'.$user->currentclient_id.'/apply', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->put('/client/'.$user->currentclient_id.'/apply', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->patch('/client/'.$user->currentclient_id.'/apply', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->delete('/client/'.$user->currentclient_id.'/apply', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->options('/client/'.$user->currentclient_id.'/apply')->assertStatus(302);\n\n //GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | client/{clientid}/apply/revert\n $this->actingAs($user)->get('/client/'.$user->currentclient_id.'/apply/revert')->assertStatus(302);\n $this->actingAs($user)->post('/client/'.$user->currentclient_id.'/apply/revert', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->put('/client/'.$user->currentclient_id.'/apply/revert', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->patch('/client/'.$user->currentclient_id.'/apply/revert', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->delete('/client/'.$user->currentclient_id.'/apply/revert', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->options('/client/'.$user->currentclient_id.'/apply/revert')->assertStatus(302);\n\n //GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | client/{clientid}/removeuser/{userid}\n $this->actingAs($user)->get('/client/'.$user->currentclient_id.'/removeuser/'.$user->id)->assertStatus(402); //only if admin of client and not in demo mode\n $this->actingAs($user)->post('/client/'.$user->currentclient_id.'/removeuser/'.$user->id, ['_token' => $token])->assertStatus(402); //only if admin of client and not in demo mode\n $this->actingAs($user)->put('/client/'.$user->currentclient_id.'/removeuser/'.$user->id, ['_token' => $token])->assertStatus(402); //only if admin of client and not in demo mode\n $this->actingAs($user)->patch('/client/'.$user->currentclient_id.'/removeuser/'.$user->id, ['_token' => $token])->assertStatus(402); //only if admin of client and not in demo mode\n $this->actingAs($user)->delete('/client/'.$user->currentclient_id.'/removeuser/'.$user->id, ['_token' => $token])->assertStatus(402); //only if admin of client and not in demo mode\n $this->actingAs($user)->options('/client/'.$user->currentclient_id.'/removeuser/'.$user->id)->assertStatus(402); //only if admin of client and not in demo mode\n\n //PUT|PATCH | client/{client}\n $this->actingAs($user)->put('/client/'.$user->currentclient_id, ['_token' => $token])->assertStatus(402); //only if admin of client or superadmin and not in demo mode\n $this->actingAs($user)->patch('/client/'.$user->currentclient_id, ['_token' => $token])->assertStatus(402); //only if admin of client or superadmin and not in demo mode\n\n //GET|HEAD | client/{client}\n $this->actingAs($user)->get('/client/'.$user->currentclient_id)->assertStatus(402); //only if admin of client or superadmin\n\n //DELETE | client/{client}\n $this->actingAs($user)->delete('/client/'.$user->currentclient_id, ['_token' => $token])->assertStatus(402); //only if superadmin and not in demo mode\n\n //GET|HEAD | client/{client}/edit\n $this->actingAs($user)->get('/client/'.$user->currentclient_id.'/edit')->assertStatus(402); //only if admin of client or superadmin\n\n //POST | client_user/admin\n $this->actingAs($user)->post('/client_user/admin', ['_token' => $token, 'client_id' => $user->currentclient_id, 'user_id' => $user->id])\n ->assertStatus(402); //only if admin of client or superadmin\n\n //POST | client_user/trainingeditor\n $this->actingAs($user)->post('/client_user/trainingeditor', ['_token' => $token, 'client_id' => $user->currentclient_id, 'user_id' => $user->id])\n ->assertStatus(402); //only if admin of client or superadmin\n\n //GET|HEAD | clientapply\n $this->actingAs($user)->get('/clientapply')\n ->assertStatus(200)->assertViewIs('client.apply')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | datenschutz\n $this->actingAs($user)->get('/datenschutz')\n ->assertStatus(200)->assertViewIs('legal.datenschutz')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //POST | holiday\n $this->actingAs($user)->followingRedirects()->post('/holiday', ['_token' => $token, 'from' => Carbon::now(), 'to' => Carbon::now()->addDay()])\n ->assertStatus(200);\n\n //GET|HEAD | holiday\n $this->actingAs($user)->get('/holiday')\n ->assertStatus(200)->assertViewIs('holiday.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | holiday/create\n $this->actingAs($user)->get('/holiday/create')\n ->assertStatus(200)->assertViewIs('holiday.create')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | holiday/storeservice/{service}\n $this->actingAs($user)->followingRedirects()->get('/holiday/storeservice/'.Service::first()->id)\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | holiday/storetraining/{training}\n $this->actingAs($user)->followingRedirects()->get('/holiday/storetraining/'.Training::first()->id)\n ->assertStatus(200)->assertViewIs('training.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | holiday/{holiday}\n $this->actingAs($user)->get('/holiday/'.Holiday::first()->id)\n ->assertStatus(200);\n\n //PUT|PATCH | holiday/{holiday}\n $this->actingAs($user)->followingRedirects()->put('/holiday/'.Holiday::first()->id, ['_token' => $token])\n ->assertStatus(200);\n $this->actingAs($user)->followingRedirects()->patch('/holiday/'.Holiday::first()->id, ['_token' => $token])\n ->assertStatus(200);\n\n //GET|HEAD | holiday/{holiday}/edit\n $this->actingAs($user)->followingRedirects()->get('/holiday/'.Training::first()->id.'/edit')\n ->assertStatus(200)->assertViewIs('holiday.edit')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //DELETE | holiday/{holiday}\n $this->actingAs($user)->get('/holiday/'.Holiday::first()->id)\n ->assertStatus(200);\n\n //GET|HEAD | home\n $this->actingAs($user)->get('/home')\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | impressum\n $this->actingAs($user)->get('/impressum')\n ->assertStatus(200)->assertViewIs('legal.impressum')\n ->assertSee('Impressum')->assertSee('Datenschutz')\n ->assertSee('Inhaltlich Verantwortlicher gem. ');\n\n //GET|HEAD | mailtest\n $this->actingAs($user)->followingRedirects()->get('/mailtest')\n ->assertStatus(200)->assertViewIs('email.serviceslist')\n ->assertSee('Stand')->assertSee('Uhr')->assertSee('Datum');\n\n //GET|HEAD | news\n $this->actingAs($user)->get('/news')\n ->assertStatus(200)->assertViewIs('news.index');\n\n //POST | news\n $this->actingAs($user)->post('/news', ['_token' => $token])->assertStatus(402); //only admin of client\n\n //GET|HEAD | news/create\n $this->actingAs($user)->get('/news/create')->assertStatus(402); //only admin of client\n\n //GET|HEAD | news/{news}\n $this->actingAs($user)->get('/news/'.News::first()->id)->assertStatus(200);\n\n //DELETE | news/{news}\n $this->actingAs($user)->delete('/news/'.News::first()->id, ['_token' => $token])->assertStatus(402); //only admin of client\n\n //PUT|PATCH | news/{news}\n $this->actingAs($user)->put('/news/'.News::first()->id, ['_token' => $token])->assertStatus(402); //only admin of client\n $this->actingAs($user)->patch('/news/'.News::first()->id, ['_token' => $token])->assertStatus(402); //only admin of client\n\n //GET|HEAD | news/{news}/delete\n $this->actingAs($user)->get('/news/'.News::first()->id.'/delete')->assertStatus(402); //only admin of client\n\n //GET|HEAD | news/{news}/edit\n $this->actingAs($user)->get('/news/'.News::first()->id.'/edit')->assertStatus(402); //only admin of client\n\n //GET|HEAD | order\n $this->actingAs($user)->get('/order')\n ->assertStatus(200)->assertViewIs('order.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | order/create/{package}\n $this->actingAs($user)->get('/order/create/basic')\n ->assertStatus(200)->assertViewIs('order.order')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //POST | order/{package}\n\n //POST | password/email\n $this->actingAs($user)->followingRedirects()->post('/password/email', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | password/reset\n $this->actingAs($user)->followingRedirects()->get('/password/reset')\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //POST | password/reset\n $this->actingAs($user)->followingRedirects()->post('/password/reset', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | password/reset/{token}\n\n //GET|HEAD | pdf\n $response = $this->actingAs($user)->get('/pdf');\n self::assertTrue($response->headers->get(\"content-type\") == \"application/pdf\");\n\n //GET|POST|HEAD | position/list_notAuthorized\n $this->actingAs($user)->get('/position/list_notAuthorized')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/position/list_notAuthorized', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|POST|HEAD | position/{id}/authorize\n $this->actingAs($user)->get('/position/1/authorize')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/position/1/authorize', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|POST|HEAD | position/{id}/deauthorize\n $this->actingAs($user)->get('/position/1/deauthorize')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/position/1/deauthorize', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|POST|HEAD | position/{id}/position_user\n $this->actingAs($user)->get('/position/1/position_user')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/position/1/position_user', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|POST|HEAD | position/{id}/subscribe\n $this->actingAs($user)->get('/position/1/subscribe')->assertStatus(200);\n $this->actingAs($user)->post('/position/1/subscribe', ['_token' => $token])->assertStatus(200);\n\n //GET|POST|HEAD | position/{id}/unsubscribe\n $this->actingAs($user)->get('/position/1/unsubscribe')->assertStatus(200);\n $this->actingAs($user)->post('/position/1/unsubscribe', ['_token' => $token])->assertStatus(200);\n\n //GET|POST|HEAD | position/{positionid}/subscribe_user/{userid}\n $this->actingAs($user)->get('/position/1/subscribe_user/1')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/position/1/subscribe_user/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|POST|HEAD | position/{positionid}/unsubscribe_user/{userid}\n $this->actingAs($user)->get('/position/1/subscribe_user/1')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/position/1/subscribe_user/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //POST | qualification\n $this->actingAs($user)->post('/qualification', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|HEAD | qualification\n $this->actingAs($user)->get('/qualification')->assertStatus(402);//only as admin\n\n //GET|HEAD | qualification/create\n $this->actingAs($user)->get('/qualification/create')->assertStatus(402);//only as admin\n\n //PUT|PATCH | qualification/{qualification}\n $this->actingAs($user)->put('/qualification/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //DELETE | qualification/{qualification}\n $this->actingAs($user)->delete('/qualification/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|HEAD | qualification/{qualification}\n $this->actingAs($user)->get('/qualification/1')->assertStatus(402);//only as admin\n\n //GET|HEAD | qualification/{qualification}/edit\n $this->actingAs($user)->get('/qualification/1/edit')->assertStatus(402);//only as admin\n\n //POST | qualification_user/create\n $this->actingAs($user)->post('/qualification_user/create', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|POST|HEAD | qualification_user/delete/{user_id}/{qualification_id}\n $this->actingAs($user)->get('/qualification_user/delete/1/1')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/qualification_user/delete/1/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|HEAD | register\n $this->actingAs($user)->followingRedirects()->get('/register')\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //POST | register\n $this->actingAs($user)->followingRedirects()->post('/register', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|POST|HEAD | sendServicePDF\n $this->actingAs($user)->get('/sendServicePDF')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/sendServicePDF', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|HEAD | service\n $this->actingAs($user)->get('/service')\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD\n $this->actingAs($user)->get('/servicehistory')->assertStatus(402); //only as admin\n //GET|HEAD\n $this->actingAs($user)->get('/service/finalize/1')->assertStatus(402); //only as admin\n\n //POST | service\n $this->actingAs($user)->post('/service', ['_token' => $token])->assertStatus(403); //only as admin\n\n //GET|HEAD | service/create\n $this->actingAs($user)->get('/service/create')->assertStatus(402);//only as admin\n\n //DELETE | service/{service}\n $this->actingAs($user)->delete('/service/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //PUT|PATCH | service/{service}\n $this->actingAs($user)->put('/service/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|HEAD | service/{service}\n $this->actingAs($user)->get('/service/1')->assertStatus(402);//only as admin\n\n //GET|HEAD | service/{service}/delete\n $this->actingAs($user)->get('/service/1/delete')->assertStatus(402);//only as admin\n\n //GET|HEAD | service/{service}/edit\n $this->actingAs($user)->get('/service/1/edit')->assertStatus(402);//only as admin\n\n //GET|POST|HEAD | statistic\n $this->actingAs($user)->get('/statistic')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/statistic', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|HEAD | superadmin/user\n $this->actingAs($user)->get('/superadmin/user')->assertStatus(402);//only as superadmin\n\n //POST | training\n $this->actingAs($user)->followingRedirects()->post('/training', ['_token' => $token])->assertStatus(402); //only as admin or trainingseditor\n\n //GET|HEAD | training\n $this->actingAs($user)->get('/training')\n ->assertStatus(200)->assertViewIs('training.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | training/create\n $this->actingAs($user)->get('/training/create')->assertStatus(402);//only as admin\n\n //GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | training/training_user/{training_userid}/delete\n $training_user = Training_user::first();\n $this->actingAs($user)->followingRedirects()->get('/training/training_user/'.$training_user->id.'/delete')\n ->assertStatus(402);//only as admin\n $this->actingAs($user)->followingRedirects()->post('/training/training_user/'.$training_user->id.'/delete', ['_token' => $token])\n ->assertStatus(402);//only as admin\n $this->actingAs($user)->followingRedirects()->put('/training/training_user/'.$training_user->id.'/delete', ['_token' => $token])\n ->assertStatus(402);//only as admin\n $this->actingAs($user)->followingRedirects()->patch('/training/training_user/'.$training_user->id.'/delete', ['_token' => $token])\n ->assertStatus(402);//only as admin\n $this->actingAs($user)->followingRedirects()->delete('/training/training_user/'.$training_user->id.'/delete', ['_token' => $token])\n ->assertStatus(402);//only as admin\n\n //GET|HEAD | training/{training}\n $this->actingAs($user)->get('/training/1')->assertStatus(402);//only as admin or trainingeditor\n\n //PUT|PATCH | training/{training}\n $this->actingAs($user)->put('/training/1', ['_token' => $token])->assertStatus(402);//only as admin or trainingeditor\n\n //DELETE | training/{training}\n $this->actingAs($user)->delete('/training/1', ['_token' => $token])->assertStatus(402);//only as admin or trainingeditor\n\n //GET|HEAD | training/{training}/delete\n $this->actingAs($user)->get('/training/1/delete')->assertStatus(402);//only as admin or trainingeditor\n\n //GET|HEAD | training/{training}/edit\n $this->actingAs($user)->get('/training/1/edit')->assertStatus(402);//only as admin or trainingeditor\n\n //POST | user\n $this->actingAs($user)->post('/user', ['_token' => $token])->assertStatus(402);//not implemented\n\n //GET|HEAD | user\n $this->actingAs($user)->get('/user')->assertStatus(402);//only as admin\n\n //GET|POST|HEAD | user/approve/{id}\n $this->actingAs($user)->get('/user/approve/1')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/user/approve/1', ['_token' => $token])->assertStatus(402);//only as admin\n\n //GET|HEAD | user/create\n $this->actingAs($user)->get('/user/create')->assertStatus(402);//not implemented\n\n //PUT|PATCH | user/{user}\n //Not allowed in Demo Mode :(\n\n //GET|HEAD | user/{user}\n $this->actingAs($user)->get('/user/1')\n ->assertStatus(200)->assertViewIs('user.profile')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //DELETE | user/{user}\n $this->actingAs($user)->delete('/user/1', ['_token' => $token])->assertStatus(402);//only as superadmin\n\n //GET|HEAD | user/{user}/edit\n $this->actingAs($user)->get('/user/1/edit')->assertStatus(402);//only as admin\n\n //GET|HEAD | userguide\n $response = $this->actingAs($user)->get('/userguide');\n self::assertTrue($response->headers->get(\"content-type\") == \"application/pdf\");\n\n //Calendar\n //GET|HEAD | calendar\n $this->actingAs($user)->followingRedirects()->get('/calendar')\n ->assertStatus(200)->assertViewIs('calendar.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n //POST | Calendar\n $this->actingAs($user)->followingRedirects()->post('/calendar', ['_token' => $token])->assertStatus(200)->assertViewIs('calendar.index'); //only as admin or trainingseditor\n //GET | calendar/{calendar}\n $this->actingAs($user)->get('/calendar/1')->assertStatus(402); //only as admin or trainingseditor\n //PUT | calendar/{calendar}\n $this->actingAs($user)->put('/calendar/1', ['_token' => $token])->assertStatus(402); //only as admin or trainingseditor\n //DELETE | calendar/{calendar}\n $this->actingAs($user)->delete('/calendar/1', ['_token' => $token])->assertStatus(402); //only as admin or trainingseditor\n //GET | calendar/{calendar}\n $this->actingAs($user)->get('/calendar/1/edit')->assertStatus(402); //only as admin or trainingseditor\n //GET | calendar/{calendar}\n $this->actingAs($user)->get('/calendar/1/delete')->assertStatus(402); //only as admin or trainingseditor\n //GET|HEAD | alendar/create\n $this->actingAs($user)->get('/calendar/create')->assertStatus(402); //only as admin or trainingseditor\n\n //Survey\n //GET|HEAD survey\n $this->actingAs($user)->get('/survey')->assertStatus(402); //only if admin of client\n //POST survey\n $this->actingAs($user)->post('/survey', ['_token' => $token])->assertStatus(402); //only if admin of client\n //GET|HEAD survey/create\n $this->actingAs($user)->get('/survey/create')->assertStatus(402); //only if admin of client\n //GET|HEAD survey/postpone/{surveyid}\n $this->actingAs($user)->get('/survey/postpone/1')->assertRedirect()->assertCookieMissing('errormessage'); //redirect back on success\n //POST survey/vote/{surveyid}\n $this->actingAs($user)->post('/survey/vote/1', ['_token' => $token, 'value' => \"accept\"])->assertRedirect('/survey/1');\n //GET|HEAD survey/{survey} //set dateStart to yesterday to access a currently activ survey\n $survey = Survey::find(1);\n $survey->dateStart = Carbon::yesterday();\n $survey->save();\n $this->actingAs($user)->get('/survey/1')->assertOk();\n //PUT|PATCH survey/{survey}\n $this->actingAs($user)->put('/survey/1', ['_token' => $token])->assertStatus(402); //only if admin of client\n //DELETE survey/{survey}\n $this->actingAs($user)->delete('/survey/1', ['_token' => $token])->assertStatus(402); //only if admin of client\n //GET|HEAD survey/{survey}/edit\n $this->actingAs($user)->get('/survey/1/edit')->assertStatus(402); //only if admin of client\n\n //POST | logout\n $this->actingAs($user)->followingRedirects()->post('/logout', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('auth.login');\n\n //GET|HEAD | logout\n $this->actingAs($user)->followingRedirects()->get('/logout')\n ->assertStatus(200)->assertViewIs('auth.login');\n }", "public function testRoutes()\n {\n foreach ($this->testRoutes as $method => $testRoutes) {\n switch ($method) {\n case 'GET':\n foreach ($testRoutes as $path => $param) {\n $response = $this->json($method, '/' . $path . $param);\n $response->assertJsonStructure(['error']);\n }\n break;\n case 'PUT':\n case 'POST':\n case 'DELETE':\n foreach ($testRoutes as $path => $params) {\n $response = $this->json($method, '/' . $path . $params['path_params'], $params['request_params']);\n dump($response->getContent());\n $response->assertJsonStructure(['message']);\n }\n break;\n }\n }\n }", "public function beforeRoute() {\n \n F3::set('v', Cfg::instance()->v);\n F3::set('app_dir', Cfg::instance()->app_dir);\n F3::set('master_url', Cfg::instance()->master_url);\n \n // logged in to the game?\n if (FB::instance()->me) {\n $c = new UsersController();\n F3::set('user', $c->getCurrentUser());\n } else {\n echo F3::render('templates/notloggedin.php');\n return FALSE;\n }\n \n // whitelisting\n if (!App::isWhitelisted(FB::instance()->user_id)) {\n F3::error(404);\n return FALSE;\n }\n \n // Sanitizing Fat-Free's REQUEST global also sanitizes PHP's $_REQUEST\n F3::set('REQUEST', F3::scrub($_REQUEST));\n\n }", "public function setUpRoutes()\n {\n Route::group(['middleware' => AddCustomProvider::class], function () {\n Passport::routes(function ($router) {\n return $router->forAccessTokens();\n });\n });\n\n Route::middleware('auth:api')->get('/user', function (Request $request) {\n return $request->user();\n });\n\n Route::middleware('auth:company')->get('/company', function (Request $request) {\n return $request->user();\n });\n\n Route::middleware('auth:api,company')->get('/users', function (Request $request) {\n return [\n $request->user('api'),\n $request->user('company'),\n $request->user(),\n Auth::user(),\n Auth::guard('api')->user(),\n Auth::guard('company')->user(),\n Auth::check(),\n Auth::id(),\n ];\n });\n\n Route::middleware('auth:api')->get('/just_user', function (Request $request) {\n return [\n $request->user('api'),\n $request->user('company'),\n $request->user(),\n Auth::user(),\n Auth::guard('api')->user(),\n Auth::guard('company')->user(),\n Auth::check(),\n Auth::id(),\n ];\n });\n\n Route::middleware('auth:company')->get('/just_company', function (Request $request) {\n return [\n $request->user('api'),\n $request->user('company'),\n $request->user(),\n Auth::user(),\n Auth::guard('api')->user(),\n Auth::guard('company')->user(),\n Auth::check(),\n Auth::id(),\n ];\n });\n\n Route::middleware('auth')->get('/no_guards', function (Request $request) {\n return $request->user();\n });\n }", "public static function ignoreRoutes()\n {\n static::$registersRoutes = false;\n }", "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 test_client_page_auth_check()\n {\n $response = $this->get(route('client.index'))->assertStatus(302);\n }", "public function testIndexDenyNotHrAndAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'GET',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'index',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function test_making_sure_that_get_requests_redirects_to_login_if_user_is_not_authenticated(){\n $response = $this->get('/home');\n $response->assertRedirect('/login');\n }", "public function testPointIndexRouteNoAuth()\n {\n $response = $this->get('/city/' . $this->city->id . '/point');\n\n $response\n ->assertStatus(302)\n ->assertRedirect('/login');\n }", "public function test_making_get_request_to_slash_home_with_no_authentication_fails_and_redirects() {\n $response = $this->get('http://127.0.0.1:8000/home');\n $response->assertStatus(302);\n }", "public function routes()\n {\n return [\n 'GET' => [\n 'main' => [\n 'index' => [\n 'name' => 'index'\n ],\n 'services' => [\n 'name' => 'services'\n ],\n 'contacts' => [\n 'name' => 'contacts'\n ],\n 'typography' => [\n 'name' => 'typography'\n ],\n 'test' => [\n 'name' => 'test'\n ],\n 'test1' => [\n 'name' => 'test1'\n ]\n ],\n 'blog' => [\n 'index' => [\n 'name' => 'index'\n ],\n 'create' => [\n 'name' => 'create',\n 'required' => [\n 'auth' => true\n ]\n ],\n 'view' => [\n 'name' => 'view',\n 'required' => [\n 'param' => true\n ]\n ],\n 'edit' => [\n 'name' => 'view',\n 'required' => [\n 'auth' => true,\n 'param' => true\n ]\n ]\n ],\n 'user' => [\n //'index' => 'index',\n 'login' => [\n 'name' => 'login'\n ],\n 'register' => [\n 'name' => 'register'\n ],\n 'logout' => [\n 'name' => 'logout',\n 'required' => [\n 'auth' => true\n ],\n ],\n 'change-password' => [\n 'name' => 'change-password',\n 'required' => [\n 'auth' => true\n ],\n ],\n 'forget-password' => [\n 'name' => 'forget-password',\n 'required' => [\n 'auth' => true\n ],\n ]\n ],\n 'auth' => [\n 'vk' => [\n 'name' => 'vk'\n ]\n ],\n 'config' => [\n 'index' => [\n 'name' => 'index',\n 'required' => [\n 'auth' => true\n ]\n ],\n 'sitemap' => [\n 'name' => 'sitemap',\n 'required' => [\n 'auth' => true\n ]\n ]\n ],\n 'portfolio' => [\n 'view' => [\n 'name' => 'view',\n 'required' => [\n 'param' => true\n ]\n ]\n ],\n 'ajax' => [\n 'template' => [\n 'name' => 'template',\n 'required' => [\n 'ajax' => true\n ]\n ],\n 'test' => [\n 'name' => 'test',\n 'required' => [\n 'ajax' => true\n ]\n ]\n ]\n ],\n 'POST' => [\n 'ajax' => [\n 'form-feedback' => [\n 'name' => 'form-feedback',\n 'required' => [\n 'refer' => 'https://uiweb.ru/'\n ]\n ],\n 'form-backcall' => [\n 'name' => 'form-backcall',\n 'required' => [\n 'refer' => 'https://uiweb.ru/main/contacts'\n ]\n ],\n 'form-login' => [\n 'name' => 'form-login'\n ],\n 'form-register' => [\n 'name' => 'form-register'\n ],\n 'form-change-password' => [\n 'name' => 'form-change-password'\n ]\n ],\n 'blog' => [\n 'create' => [\n 'name' => 'create',\n 'required' => [\n 'auth' => true\n ]\n ],\n 'edit' => [\n 'name' => 'create',\n 'required' => [\n 'auth' => true,\n 'param' => true\n ]\n ]\n ]\n ],\n 'PUT',\n 'PATCH',\n 'TRACE',\n 'DELETE',\n 'HEAD',\n 'OPTIONS'\n ];\n }", "public function test_route_merge() {\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' ),\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\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( '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// Check both routes exist.\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$endpoint = $endpoints['/test-ns/test'];\n\t\t$this->assertCount( 2, $endpoint );\n\t}", "protected function preReRouting()\n {\n\n }", "public function test404PagesLoggedIn()\n {\n $this->loginAsSuperadmin();\n $testUrls = [\n $this->Slug->getProductDetail(4234, 'not valid product name'),\n $this->Slug->getCategoryDetail(4234, 'not valid category name')\n ];\n $this->assertPagesFor404($testUrls);\n $this->logout();\n }", "public function matchRoute() {\n\t\tforeach($this->routes as $pattern => $callback) {\n\t\t\tif (preg_match('{^' . $pattern . '$}', $this->url) === 1) {\n\t\t\t\tif(!isset($_SESSION)){ session_start(); }\n\t\t\t\t// Parameters\n\t\t\t\t$params = array();\n\t\t\t\tif (isset($callback['params'])) {\n\t\t\t\t\t$url = explode('/', $this->url);\n\t\t\t\t\t$url = array_slice($url, -1 * count($callback['params']));\n\t\t\t\t\t$params = array_combine(array_keys($callback['params']), $url);\n\t\t\t\t}\n\t\t\t\t// Secured (Backend)\n\t\t\t\tif (isset($callback['secured'])) {\n\t\t\t\t\tif (isset($_SESSION['auth']) && $_SESSION['auth'] === true) {\n\t\t\t\t\t\t$this->dispatch($callback['controller'], $callback['action'], $params);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->url = 'http://' . $_SERVER['SERVER_NAME'] . '/login';\n\t\t\t\t\t\theader('location:' . $this->url);\n\t\t\t\t\t}\n\t\t\t\t// Secured (Frontend)\n\t\t\t\t} elseif (isset($callback['clientsecured'])) {\n\t\t\t\t\tif (isset($_SESSION['fauth']) && $_SESSION['fauth'] === true) {\n\t\t\t\t\t\t$this->dispatch($callback['controller'], $callback['action'], $params);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->url = 'home/login';\n\t\t\t\t\t\theader('location:' . $this->url);\n\t\t\t\t\t}\n\t\t\t\t// Simple\n\t\t\t\t} else {\n\t\t\t\t\t$this->dispatch($callback['controller'], $callback['action'], $params);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// No match\n\t\t$this->dispatch('Default', 'error', array('code' => 404));\n\t\treturn;\n\t}", "public function test_route_canonicalized_multiple() {\n\t\tregister_rest_route(\n\t\t\t'test-ns',\n\t\t\t'/test',\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => array( 'GET' ),\n\t\t\t\t\t'callback' => '__return_null',\n\t\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => array( 'POST' ),\n\t\t\t\t\t'callback' => '__return_null',\n\t\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t// Check the route was registered correctly.\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_raw_endpoint_data();\n\t\t$this->assertArrayHasKey( '/test-ns/test', $endpoints );\n\n\t\t// Check the route was wrapped in an array.\n\t\t$endpoint = $endpoints['/test-ns/test'];\n\t\t$this->assertArrayNotHasKey( 'callback', $endpoint );\n\t\t$this->assertArrayHasKey( 'namespace', $endpoint );\n\t\t$this->assertSame( 'test-ns', $endpoint['namespace'] );\n\n\t\t$filtered_endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$endpoint = $filtered_endpoints['/test-ns/test'];\n\t\t$this->assertCount( 2, $endpoint );\n\n\t\t// Check for both methods.\n\t\tforeach ( array( 0, 1 ) as $key ) {\n\t\t\t$this->assertArrayHasKey( 'callback', $endpoint[ $key ] );\n\t\t\t$this->assertArrayHasKey( 'methods', $endpoint[ $key ] );\n\t\t\t$this->assertArrayHasKey( 'args', $endpoint[ $key ] );\n\t\t}\n\t}", "public function prevent_non_logged_in_users_from_seeing_service_index()\n {\n $response = $this->get('/service');\n\n $this->withoutMiddleware();\n $response->assertRedirect('login');\n }", "public function assertApiRoutesAreAccessibleWhenAuthorized()\n {\n $assertion = true;\n $user = $this->createApiUser();\n $routes = $this->getApiRoutes();\n\n foreach ($routes as $route) {\n if (!$this->assertApiRouteIsAccessibleWhenAuthorized($user, $route)) {\n $assertion = false;\n break;\n }\n }\n\n $this->assertTrue($assertion);\n }", "public function checkingRoute()\n {\n\n global $route;\n $request = new Request;\n $requested_url = $request->server('QUERY_STRING');\n //!TEST\n // echo $requested_url;\n // echo '<br />';\n $requested_method = $request->server('REQUEST_METHOD');\n //! TEST\n // echo $requested_method;\n /* \n // $server_all = $request->serverAll();\n // echo '<pre>';\n // print_r($server_all);\n // echo '</pre>' ;\n // $route_object = new Route;\n */\n $all_routes = $route->getRoutingTable();\n\n // NOTE\n /*\n ! ezzay ana shayf Class Web and Route min 3'eer use key word \n ? routes/web.php & Core/Route.php\n */\n //!TEST\n // echo '<pre>';\n // print_r($all_routes);\n // echo '</pre>';\n\n foreach ($all_routes as $url => $info) {\n\n /* !//? to test $url returns\n echo '<pre>';\n print_r($url);\n echo '</pre>' ;\n */\n // // if ($requested_url == $url){\n if (preg_match($url,$requested_url , $matches )){\n if( $requested_method == strtolower($info['method'])) {\n $this->controller = $info['controller'];\n $this->action = $info['action'];\n $this->params = array_slice($matches , 1);\n return true ;\n }else{\n die(\"405 method does not exist\");\n }\n /* //!deprecated if statement (wrong else statement)\n // if ($requested_url != $single_route) {\n // die('404 url not found');\n // }\n // elseif ($requested_method != $info['method']) {\n // die('405 method not allowed');\n // }\n // else {\n // $this->controller = $info['controller'];\n // $this->method = $info['method'];\n // }\n */\n }\n // echo $this->controller;\n // echo '<br />';\n // echo $this->action ;\n // echo '<br />';\n }\n die(\"404 not found\");\n }", "protected function _connectDefaultRoutes(): void\n {\n Router::scope('/', function (RouteBuilder $routes): void {\n $routes->fallbacks('InflectedRoute');\n });\n }", "public function testIndexFailNotLoggedIn()\n {\n $this->get($this->indexUrl);\n $this->assertRedirectContains(Router::url([\n 'prefix' => false,\n 'controller' => 'Users',\n 'action' => 'login'\n ]));\n }", "public function testMatchingEmptyRoute() {\n\t\tRouter::connect('/', 'Users::view');\n\n\t\t$request = new Request(['base' => '/']);\n\t\t$url = Router::match(['controller' => 'users', 'action' => 'view'], $request);\n\t\t$this->assertIdentical('/', $url);\n\n\t\t$request = new Request(['base' => '']);\n\t\t$url = Router::match(['controller' => 'users', 'action' => 'view'], $request);\n\t\t$this->assertIdentical('/', $url);\n\t}", "public function testNotAuthenticated()\n {\n $response = $this->get('/api/v1/contacts');\n\n $response->assertStatus(302);\n\n $response = $this->get('/api/v1/contacts/1');\n\n $response->assertStatus(302);\n\n $response = $this->get('/api/v1/contacts/search/asdad');\n\n $response->assertStatus(302);\n }", "public function _before(\\FunctionalTester $I)\n {\n $I->amOnRoute('site/login');\n }", "function beforeRoute() {\n\t\tif ($this->app->get('SESSION.user')) {\n\t\t\t$this->app->set('loggedIN', true);\n\t\t}\n\t}", "public function test_route_reject_empty_route() {\n\t\tregister_rest_route(\n\t\t\t'/test-empty-route',\n\t\t\t'',\n\t\t\tarray(\n\t\t\t\t'methods' => array( '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\ttrue\n\t\t);\n\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$this->assertFalse( isset( $endpoints['/test-empty-route'] ) );\n\t}", "private function protectedRoute($openIdClient) {\n return !$openIdClient->userAuthenticated() && $this->method === 'PrivateRoute';\n }", "public function testBasicTest()\n {\n /** @var \\UserFrosting\\Sprinkle\\Core\\Router $router */\n $router = $this->ci->router;\n\n // Get all routes. We should have more than 0 in a default install\n $routes = $router->getRoutes();\n $this->assertNotCount(0, $routes);\n\n // Try to get a path\n $path = $router->pathFor('index');\n $this->assertEquals('/', $path);\n }", "private function should_use_absolute_route_for_auth(): bool {\n\t\treturn config( 'browser-testing.domain' ) !== null;\n\t}", "protected function check_auth( )\n\t{\n\t\t$page = $this->uri->segment( 2);\n\t\t$section = $this->uri->segment(1);\t\t\n\t\t$function = $this->uri->segment(3);\n\t\t\n\t\tif( $section == 'api' and $page == 'users' and $function == 'login' )\n\t\t\treturn;\n\n\t\t$logged_in = $this->is_logged_in();\n\t\t$excused_uri = array('login' , 'recover_password' , 'auth_help' , 'token_login');\n\t\tif( ! $logged_in )\n\t\t{\n\t\t\t//if in app mode\n\t\t\tif( $this->_app_mode == 'json' and $section != 'admin' )\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$this->output->set_status_header('401');\n\t\t\t\texit;\n\t\t\t}\n\t\t\t//check if is login page\n\t\t\tif( $section == 'admin' and ( ! in_array($page, $excused_uri) ) )\n\t\t\t{\n\t\t\t\theader('Location: /admin/login');\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\n\t\t\n\n\t\treturn;\n\t}", "private function _needsAuthentication() {\n\t\tif(isset(Environment::$api->noAuthRoutes) && is_array(Environment::$api->noAuthRoutes) && is_array($this->request->params)) {\n\t\t\t$requestRoute = implode('/', $this->request->params);\n\t\t\tforeach (Environment::$api->noAuthRoutes as $key => $route) {\n\t\t\t\tif($route===$requestRoute) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(Environment::$api->noAuth) { \n\t\t\treturn false;\n\t\t}\n\t\tif($this->method==='OPTIONS') {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function testIndexFailNotAdmin()\n {\n $this->setUserSession();\n $this->get($this->indexUrl);\n $this->assertRedirect('/');\n }", "protected function checkRedirect() {}", "public function testVisitingRolesAsNonAdminRedirectsHome()\n {\n $response = $this->get('/admin/Role')\n ->assertRedirect('/');\n }", "public function test_teams_index_unauthenticated_redirects_to_login(){\n $response = $this->get(route('teams.index'));\n $response->assertStatus(302);\n $response->assertRedirect(route('login'));\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}", "public function testUserControllerBasic()\n {\n $route = new Route();\n\n $route->set(null, \"user\", null, \"Anax\\Route\\MockHandlerController\");\n\n $path = \"user\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"indexActionGET\", $res);\n\n $path = \"user/\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"indexActionGET\", $res);\n\n $path = \"user/create\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"createAction\", $res);\n\n $path = \"user/list\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"listAction\", $res);\n }", "public function testNoAuth() : void\n {\n $response = $this->get(action('HomeController@index'));\n\n $response->assertStatus(200);\n }", "protected function _loadRoutes()\n\t{\n\t\t$this->_routes['/^\\/login\\/?$/'] = '/account/login';\n\t}", "public static function isRouteValid()\n {\n global $Routes;\n $uri = $_SERVER['REQUEST_URI'];\n if (!in_array(explode('?', $uri)[0], $Routes, true)) {\n return 0;\n } else {\n return 1;\n }\n }", "protected function routes()\n {\n Nova::routes()\n ->withAuthenticationRoutes()\n ->withPasswordResetRoutes()\n ->register();\n }", "protected function routes()\n {\n Nova::routes()\n ->withAuthenticationRoutes()\n ->withPasswordResetRoutes()\n ->register();\n }", "public function testAdminApp()\n {\n $client = static::createClient();\n $client->request('GET', '/admin');\n $this->assertEquals(301, $client->getResponse()->getStatusCode());\n\n //regular user should be redirected\n $client = $this->createAuthClient('[email protected]', 'user');\n $client->request('GET', '/admin', [], [], ['HTTPS' => true]);\n $this->assertEquals(403, $client->getResponse()->getStatusCode());\n\n //admins are allowed\n $client = $this->createAuthClient('[email protected]', 'admin');\n $crawler = $client->request('GET', '/admin');\n $response = $client->getResponse();\n $this->assertEquals(301, $response->getStatusCode());\n $this->assertTrue(0 === strpos($response->getTargetUrl(), 'https'));\n\n\n //https and authentication loads page\n $client = $this->createAuthClient('[email protected]', 'admin');\n $crawler = $client->request('GET', '/admin', [], [], ['HTTPS' => true]);\n $this->assertTrue($crawler->filter('html:contains(\"Loading ...\")')->count() > 0);\n }", "public function testSuperUserAllDefaultControllerActions()\n {\n $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');\n\n //Test all default controller actions that do not require any POST/GET variables to be passed.\n //This does not include portlet controller actions.\n $this->runControllerWithNoExceptionsAndGetContent('home/default');\n $this->runControllerWithNoExceptionsAndGetContent('home/default/index');\n $this->runControllerWithNoExceptionsAndGetContent('home/default/createDashboard');\n\n //Default Controller actions requiring some sort of parameter via POST or GET\n //Load Model Edit Views\n $superDashboard = Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);\n $this->setGetArray(array('id' => $superDashboard->id));\n $this->runControllerWithNoExceptionsAndGetContent('home/default/editDashboard');\n //Save dashboard.\n $superDashboard = Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);\n $this->assertEquals('Dashboard', $superDashboard->name);\n $this->setPostArray(array('Dashboard' => array('name' => '456765421')));\n $this->runControllerWithRedirectExceptionAndGetContent('home/default/editDashboard');\n $superDashboard = Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);\n $this->assertEquals('456765421', $superDashboard->name);\n //Test having a failed validation on the dashboard during save.\n $this->setGetArray (array('id' => $superDashboard->id));\n $this->setPostArray(array('Dashboard' => array('name' => '')));\n $content = $this->runControllerWithNoExceptionsAndGetContent('home/default/editDashboard');\n $this->assertFalse(strpos($content, 'Name cannot be blank') === false);\n\n //Load Model Detail Views\n $this->setGetArray(array('id' => -1));\n $this->resetPostArray();\n $this->runControllerWithNoExceptionsAndGetContent('home/default/dashboardDetails');\n $this->setGetArray(array('id' => $superDashboard->id));\n $this->resetPostArray();\n $this->runControllerWithNoExceptionsAndGetContent('home/default/dashboardDetails');\n\n //Add second dashboard for use in deletion tests.\n $secondDashboard = DashboardTestHelper::createDashboardByNameForOwner('Dashboard2', $super);\n $this->assertTrue($secondDashboard->isDefault == 0);\n $this->assertFalse($secondDashboard->isDefault === 0); //Just to prove it does not evaluate to this.\n //Attempt to delete the default dashboard and have it through an exception.\n $dashboards = Dashboard::getRowsByUserId($super->id);\n $this->assertEquals(2, count($dashboards));\n $this->setGetArray(array('dashboardId' => $superDashboard->id));\n $this->resetPostArray();\n $this->runControllerWithNotSupportedExceptionAndGetContent('home/default/deleteDashboard');\n\n //Delete dashboard that you can delete.\n $dashboards = Dashboard::getRowsByUserId($super->id);\n $this->assertEquals(2, count($dashboards));\n $this->setGetArray(array('dashboardId' => $secondDashboard->id));\n $this->resetPostArray();\n $this->runControllerWithRedirectExceptionAndGetContent('home/default/deleteDashboard');\n $dashboards = Dashboard::getRowsByUserId($super->id);\n $this->assertEquals(1, count($dashboards));\n\n //Add a dashboard via the create dashboard action.\n $this->assertEquals(1, count(Dashboard::getAll()));\n $this->resetGetArray();\n $this->setPostArray(array('Dashboard' => array(\n 'name' => 'myTestDashboard',\n 'layoutType' => '50,50'))); // Not Coding Standard\n $this->runControllerWithRedirectExceptionAndGetContent('home/default/createDashboard');\n $dashboards = Dashboard::getAll();\n $this->assertEquals(2, count($dashboards));\n $this->assertEquals('myTestDashboard', $dashboards[1]->name);\n $this->assertEquals($super, $dashboards[1]->owner);\n $this->assertEquals('50,50', $dashboards[1]->layoutType); // Not Coding Standard\n\n //Portlet Controller Actions\n $uniqueLayoutId = 'HomeDashboard' . $superDashboard->layoutId;\n $this->setGetArray(array(\n 'dashboardId' => $superDashboard->id,\n 'uniqueLayoutId' => $uniqueLayoutId));\n $this->resetPostArray();\n $this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/addList');\n\n //Add AccountsMyList Portlet to dashboard\n $this->setGetArray(array(\n 'dashboardId' => $superDashboard->id,\n 'portletType' => 'AccountsMyList',\n 'uniqueLayoutId' => $uniqueLayoutId));\n $this->resetPostArray();\n $this->runControllerWithRedirectExceptionAndGetContent('home/defaultPortlet/add');\n\n //Save a layout change. Collapse all portlets\n //At this point portlets for this view should be created because we have already loaded the 'details' page in a request above.\n $portlets = Portlet::getByLayoutIdAndUserSortedByColumnIdAndPosition($uniqueLayoutId, $super->id, array());\n $this->assertEquals(6, count($portlets[1]));\n $this->assertEquals(3, count($portlets[2]));\n $portletPostData = array();\n $portletCount = 0;\n foreach ($portlets as $column => $columnPortlets)\n {\n foreach ($columnPortlets as $position => $portlet)\n {\n $this->assertEquals('0', $portlet->collapsed);\n $portletPostData['HomeDashboard1_' . $portlet->id] = array(\n 'collapsed' => 'true',\n 'column' => 0,\n 'id' => 'HomeDashboard1_' . $portlet->id,\n 'position' => $portletCount,\n );\n $portletCount++;\n }\n }\n //There should have been a total of 3 portlets. Checking positions as 4 will confirm this.\n $this->assertEquals(9, $portletCount);\n $this->resetGetArray();\n $this->setPostArray(array(\n 'portletLayoutConfiguration' => array(\n 'portlets' => $portletPostData,\n 'uniqueLayoutId' => $uniqueLayoutId,\n )\n ));\n $this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/saveLayout', true);\n //Now test that all the portlets are collapsed.\n $portlets = Portlet::getByLayoutIdAndUserSortedByColumnIdAndPosition(\n $uniqueLayoutId, $super->id, array());\n $this->assertEquals (9, count($portlets[1]) );\n $this->assertFalse (array_key_exists(8, $portlets) );\n foreach ($portlets as $column => $columns)\n {\n foreach ($columns as $position => $positionPortlets)\n {\n $this->assertEquals('1', $positionPortlets->collapsed);\n }\n }\n\n //Load up modal config edit view.\n $this->assertTrue($portlets[1][1]->id > 0);\n $this->assertEquals('AccountsMyList', $portlets[1][1]->viewType);\n $this->setGetArray(array(\n 'portletId' => $portlets[1][1]->id,\n 'uniqueLayoutId' => $uniqueLayoutId,\n ));\n $this->resetPostArray();\n $this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/modalConfigEdit');\n\n //Now validate the form.\n $this->setGetArray(array(\n 'portletId' => $portlets[1][1]->id,\n 'uniqueLayoutId' => $uniqueLayoutId,\n ));\n $this->setPostArray(array(\n 'ajax' => 'modal-edit-form',\n 'AccountsSearchForm' => array()));\n $this->runControllerWithExitExceptionAndGetContent('home/defaultPortlet/modalConfigEdit');\n\n //save changes to the portlet title\n $this->setGetArray(array(\n 'portletId' => $portlets[1][1]->id,\n 'uniqueLayoutId' => $uniqueLayoutId,\n ));\n $this->setPostArray(array(\n 'MyListForm' => array('title' => 'something new'),\n 'AccountsSearchForm' => array()));\n $this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/modalConfigSave');\n //Now confirm the title change was successful.\n $portlet = Portlet::getById($portlets[1][1]->id);\n $this->assertEquals('something new', $portlet->getView()->getTitle());\n\n //Refresh a portlet modally.\n $this->setGetArray(array(\n 'portletId' => $portlets[1][1]->id,\n 'uniqueLayoutId' => $uniqueLayoutId,\n 'redirectUrl' => 'home/default'));\n $this->resetPostArray();\n $this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/modalRefresh');\n //Load Home Dashboard View again to make sure everything is ok after the layout change.\n $this->resetGetArray();\n $this->resetPostArray();\n $this->runControllerWithNoExceptionsAndGetContent('home/default');\n }", "public function testGetUsersPageWithoutAuth()\n\t{\n\t\t$response = $this->call('orchestra::users@index');\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\t\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::login'), \n\t\t\t$response->foundation->headers->get('location'));\n\t}", "public function beforeLoadRoutes() {\n if ($this->beforeConfig) {\n $this->createRoutes($this->m->Routing->routes);\n $current = $this->m->Routing->route;\n if (is_array($current) and isset($current['priority'])) {\n if ($current['priority'] > $this->priority)\n return;\n }\n if ($this->checkPath($this->request->path)) {\n \n }\n }\n }", "public static function preRouter(){\n\t\t\n\t}", "public function testRouteContinuations() {\n\t\tRouter::connect('/{:locale:en|de|it|jp}/{:args}', [], ['continue' => true]);\n\t\tRouter::connect('/{:controller}/{:action}/{:id:[0-9]+}');\n\n\t\t$request = new Request(['url' => '/en/posts/view/1138']);\n\t\t$result = Router::process($request)->params;\n\t\t$expected = [\n\t\t\t'controller' => 'Posts', 'action' => 'view', 'id' => '1138', 'locale' => 'en'\n\t\t];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$request = new Request(['url' => '/en/foo/bar/baz']);\n\t\t$this->assertNull(Router::parse($request));\n\n\t\tRouter::reset();\n\t\tRouter::connect('/{:args}/{:locale:en|de|it|jp}', [], ['continue' => true]);\n\t\tRouter::connect('/{:controller}/{:action}/{:id:[0-9]+}');\n\n\t\t$request = new Request(['url' => '/posts/view/1138/en']);\n\t\t$result = Router::process($request)->params;\n\t\t$this->assertEqual($expected, $result);\n\n\t\tRouter::reset();\n\t\tRouter::connect('/{:locale:en|de|it|jp}/{:args}', [], ['continue' => true]);\n\t\tRouter::connect('/', 'Pages::view');\n\n\t\t$request = new Request(['url' => '/en']);\n\t\t$result = Router::process($request)->params;\n\t\t$expected = ['locale' => 'en', 'controller' => 'Pages', 'action' => 'view'];\n\t\t$this->assertEqual($expected, $result);\n\t}", "public function test_bad_index_route()\n {\n //incorrect uri\n $response = $this->get('api/students/1234');\n $response->assertStatus(404);\n }", "public function isAdminRoute();", "public function testRequiredAuthentication()\n {\n $response = $this->get('/');\n\n $response->assertStatus(Response::HTTP_FOUND);\n $response->assertRedirect(route('auth.login'));\n }", "protected function routes()\n\t{\n\t\tif ($this->app->routesAreCached()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tRoute::middleware(['nova', Authorize::class])\n\t\t\t->prefix('nova-vendor/nova-permissions')\n\t\t\t->group(__DIR__ . '/../routes/api.php');\n\t}", "public function testGetRequestWithoutParametersIsRoutedToIndexAction()\n\t{\n\t\t$this->request->setMethod('GET');\n\t\t$this->dispatch('/api/event');\n\n\t\t$this->assertModule('api');\n\t\t$this->assertController('event');\n\t\t$this->assertAction('index');\t\t\n\t}", "public function testIndexAuthTest()\n {\n $response = $this->get('/images');\n\n $this->assertGuest($guard = null);\n $response->assertStatus(302);\n }", "public function testRoutes()\n\t{\n\t\t$routes = new Routes();\n\n\t\t$result = $routes->process(array('test', 'test'));\n\n\t\t$this->assertEquals('test', $result);\n\t}", "public static function isRouteValid() {\r\n global $Routes;\r\n $uri = $_SERVER['REQUEST_URI'];\r\n\r\n if (!in_array(explode('?',$uri)[0], $Routes)) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n }", "public function testRequestRootIsAndIndex() {\n\n\t\t$r1 = new Nether\\Avenue\\Router(static::$RequestData['Root']);\n\t\t$r2 = new Nether\\Avenue\\Router(static::$RequestData['Index']);\n\n\t\t(new Verify(\n\t\t\t'path / request runs as /index',\n\t\t\t$r1->GetPath()\n\t\t))->equals('/index');\n\n\t\t(new Verify(\n\t\t\t'path /index runs as /index',\n\t\t\t$r2->GetPath()\n\t\t))->equals('/index');\n\n\n\t\treturn;\n\t}", "private static function setupRoutes()\n {\n $container = self::$kernel->getContainer();\n $router = $container->get('router');\n self::$login_url = $router->generate('fos_user_security_login');\n }", "public function initializeRoutes()\n {\n $this->get(\"/\", \"index\");\n }", "public function testAdministratorAccessAllPages()\n\t{\n\t\t$this->login($this->users['sample1']['varName'], $this->passwordAdmin);\n\n\t\t$this->open('accounting');\n\t\t$this->assertTextNotPresent('You don\\'t have access to this section.');\n\t\t$this->assertTextNotPresent('Unable to resolve the request');\n\n\t\t$this->open('user');\n\t\t$this->assertTextNotPresent('You don\\'t have access to this section.');\n\t\t$this->assertTextNotPresent('Unable to resolve the request');\n\n\t\t$this->open('setting');\n\t\t$this->assertTextNotPresent('You don\\'t have access to this section.');\n\t\t$this->assertTextNotPresent('Unable to resolve the request');\n\n\t\t// edit himself information\n\t\t$this->open('/user/edit/' . $this->users['sample1']['intUserID']);\n\t\t$this->assertTextNotPresent('You don\\'t have access to this section.');\n\t\t$this->assertTextNotPresent('Unable to resolve the request');\n\t\t$this->assertTextPresent('Edit user');\n\n\t\t// edit manager information\n\t\t$this->open('/user/edit/' . $this->users['sample2']['intUserID']);\n\t\t$this->assertTextNotPresent('You don\\'t have access to this section.');\n\t\t$this->assertTextNotPresent('Unable to resolve the request');\n\t\t$this->assertTextPresent('Edit user');\n\t}", "public function user_route()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200);\n }", "public function routes()\n {\n register_rest_route('can', '/donation-forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'fundraisingPages'\n ],\n ]);\n\n register_rest_route('can', '/forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'forms'\n ],\n ]);\n\n register_rest_route('can', '/petitions', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'petitions'\n ],\n ]);\n\n register_rest_route('can', '/person/add', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'addPerson'\n ],\n ]);\n }", "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 test_vessels_route_without_token()\n {\n $response = $this->get('/api/vessels');\n\n $response->assertStatus(401);\n }", "public function test_route_canonicalized() {\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' ),\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// Check the route was registered correctly.\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_raw_endpoint_data();\n\t\t$this->assertArrayHasKey( '/test-ns/test', $endpoints );\n\n\t\t// Check the route was wrapped in an array.\n\t\t$endpoint = $endpoints['/test-ns/test'];\n\t\t$this->assertArrayNotHasKey( 'callback', $endpoint );\n\t\t$this->assertArrayHasKey( 'namespace', $endpoint );\n\t\t$this->assertSame( 'test-ns', $endpoint['namespace'] );\n\n\t\t// Grab the filtered data.\n\t\t$filtered_endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$this->assertArrayHasKey( '/test-ns/test', $filtered_endpoints );\n\t\t$endpoint = $filtered_endpoints['/test-ns/test'];\n\t\t$this->assertCount( 1, $endpoint );\n\t\t$this->assertArrayHasKey( 'callback', $endpoint[0] );\n\t\t$this->assertArrayHasKey( 'methods', $endpoint[0] );\n\t\t$this->assertArrayHasKey( 'args', $endpoint[0] );\n\t}", "function ci_use_route(){\n\t\t$c_uri=$this->uri->segments;\n\t\t$c_ruri=$this->uri->rsegments;\n\n\t\t//--- we re-introduice the directori in RURI\n\t\tif($this->router->directory!=''){\n\t\t\tarray_unshift($c_ruri , trim($this->router->directory,'/'));\n\t\t\t$i = 1;\n\t\t\tforeach ($c_ruri as $val) $c_ruri[$i++] = $val;\n\t\t\tunset($c_ruri[0]);\n\t\t}\n\n\t\tif(count($c_uri) > count($c_ruri))return true;\n\t\t//--- Now if URI == RURI => there is no used route.\n\t\tif(count($c_uri) == count($c_ruri)) return (implode('/',$c_uri)==implode('/',$c_ruri))? false:true;\n\n\t\tfor($i=1;$i <= count($c_uri);$i++) {\n\t\t\tif($c_uri[$i]!=$c_ruri[$i]) return true;\n\t\t}\n\t\treturn false;\n\t}", "protected function loadBackendRoutes() {}", "public function testRouteHandler() {\n\t\tRouter::connect('/login', 'Users::login');\n\n\t\tRouter::connect('/users/login', [], function($request) {\n\t\t\treturn new Response([\n\t\t\t\t'location' => ['controller' => 'Users', 'action' => 'login']\n\t\t\t]);\n\t\t});\n\n\t\t$result = Router::process(new Request(['url' => '/users/login']));\n\t\t$this->assertInstanceOf('lithium\\action\\Response', $result);\n\n\t\t$headers = ['Location' => '/login'];\n\t\t$this->assertEqual($headers, $result->headers);\n\t}", "function create_initial_rest_routes()\n {\n }", "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 }", "public function testOverrideUserRoutes() {\n\n $this->drupalLogin($this->overrideUser);\n\n $basicKeyRoutes = [\n 'entity.key.collection' => [],\n 'entity.key.add_form' => [],\n 'entity.key.edit_form' => ['key' => 'key_foo'],\n 'entity.key.delete_form' => ['key' => 'key_foo'],\n ];\n\n $overrideKeyRoutes = [\n 'entity.key_config_override.collection' => [],\n 'entity.key_config_override.add_form' => [],\n 'entity.key_config_override.delete_form' => ['key_config_override' => 'test_override'],\n ];\n\n $this->routeAccessTest($basicKeyRoutes, 403);\n $this->routeAccessTest($overrideKeyRoutes, 200);\n }", "public function index()\n {\n if(auth()->check()){\n if(Gate::allows('papelaria')){\n return redirect()->route('papelaria.carregamentos.idAluno');\n }\n elseif(Gate::allows('bar')){\n return redirect()->route('bar.idAluno');\n }\n elseif(Gate::allows('portaria')){\n return redirect()->route('portaria.index');\n }\n else{\n return redirect()->route('alunos.index');\n }\n } \n }", "public function route()\n {\n $this->dashboardRouting($this->relativeCmsUri);\n $this->logOffRouting($this->request, $this->relativeCmsUri);\n $this->apiRouting($this->relativeCmsUri);\n $this->documentRouting($this->userRights, $this->relativeCmsUri);\n $this->valuelistsRouting($this->userRights, $this->relativeCmsUri);\n $this->sitemapRouting($this->userRights, $this->relativeCmsUri);\n $this->redirectRouting($this->userRights, $this->relativeCmsUri);\n $this->imageRouting($this->userRights, $this->relativeCmsUri);\n $this->filesRouting($this->userRights, $this->relativeCmsUri);\n $this->configurationRouting($this->userRights, $this->relativeCmsUri);\n $this->searchRouting($this->relativeCmsUri);\n }", "public function testAllSuperadminUrls()\n {\n $this->loginAsSuperadmin();\n\n $testUrls = [\n $this->Slug->getAdminHome(),\n $this->Slug->getCartDetail(),\n $this->Slug->getOrderDetailsList(),\n $this->Slug->getOrderDetailsList().'?groupBy=customer&pickupDay[]=02.02.2018',\n $this->Slug->getOrderDetailsList().'?groupBy=manufacturer&pickupDay[]=02.02.2018',\n $this->Slug->getOrderDetailsList().'?groupBy=product&pickupDay[]=02.02.2018',\n $this->Slug->getOrderLists(),\n $this->Slug->getActionLogsList(),\n $this->Slug->getPagesListAdmin(),\n $this->Slug->getPageAdd(),\n $this->Slug->getPageEdit(3),\n $this->Slug->getDepositList(4),\n $this->Slug->getDepositOverviewDiagram(),\n $this->Slug->getDepositDetail(4, '2016-11'),\n $this->Slug->getCreditBalance(88),\n $this->Slug->getCreditBalanceSum(),\n $this->Slug->getChangePassword(),\n $this->Slug->getCustomerListAdmin(),\n $this->Slug->getCustomerProfile(),\n $this->Slug->getCustomerEdit(88),\n $this->Slug->getProductAdmin(),\n $this->Slug->getProductAdmin('all'),\n $this->Slug->getReport('product'),\n $this->Slug->getReport('payback'),\n $this->Slug->getReport('deposit'),\n $this->Slug->getPaymentEdit(1),\n $this->Slug->getBlogPostListAdmin(),\n $this->Slug->getBlogPostAdd(),\n $this->Slug->getBlogPostEdit(2),\n $this->Slug->getManufacturerAdmin(),\n $this->Slug->getManufacturerList(),\n $this->Slug->getManufacturerAdd(),\n $this->Slug->getManufacturerEdit(5),\n $this->Slug->getManufacturerEditOptions(5),\n $this->Slug->getAttributesList(),\n $this->Slug->getAttributeAdd(),\n $this->Slug->getAttributeEdit(33),\n $this->Slug->getCategoriesList(),\n $this->Slug->getCategoryAdd(),\n $this->Slug->getCategoryEdit(16),\n $this->Slug->getTaxesList(),\n $this->Slug->getTaxAdd(),\n $this->Slug->getTaxEdit(2),\n $this->Slug->getSlidersList(),\n $this->Slug->getSliderAdd(),\n $this->Slug->getSliderEdit(6),\n $this->Slug->getStatistics(4),\n $this->Network->getSyncDomainAdd(),\n $this->Network->getSyncDomainEdit(1),\n $this->Slug->getConfigurationsList(),\n $this->Slug->getConfigurationEdit(544),\n ];\n\n $this->assertPagesForErrors($testUrls);\n\n $this->logout();\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 beforeFilter(){\n\t\t//redirect to top page in case of only input http://{url}/\n\t\tif(empty($this->params ['controller']) == TRUE){\n\t\t\t$this->redirect(array('controller' => 'home', 'action' => 'index'));\n\t\t}\n\t\t//redirect to top page in case of only input http://{url}/admin/\n\t\t\n\t\tif($this->params ['controller'] == 'admin'){\n\t\t\t$this->redirect(array('controller' => 'admin/users', 'action' => 'index'));\n\t\t}\n\t\t// if admin url requested, check the existing of session\n\t\telseif((isset($this->params ['admin']) == TRUE) && ($this->params ['controller']) != 'users'){\n\t\t\t// check user is logged in\n\t\t\tif(!$this->Session->check(SYS_LOG_000)){\n\t\t\t\t//if not, redirect to login page\n\t\t\t\t$url = Router::url(NULL, true);// get all url\n\t\t\t\tif(!preg_match('/login|logout/i', $url)){\n\t\t\t\t\t$this->Session->write('lastUrl',$url);\n\t\t\t\t}\n\t\t\t\t$this->Session->setFlash(array(Configure::read(SYS_LOG_000.'.SessionTimeout')),'flash_session', array(),'bad');\n\t\t\t\t$this->redirect(array('controller' => 'users', 'action' => 'index'));\n\t\t\t}\n\t\t\t//if user has logged in\n\t\t\t//$this->redirect(array('controller' => 'users', 'action' => 'default'));\n\t\t\t$this->layout='/admin/default';\n\t\t}\n\t\t\n \t//$this->requireNonSSL('');\n\t}", "public function testViewDenyNotHrAndAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'GET',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'view',\n\t\t\t\t'1'\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function testRouteMatchingWithNoInserts() {\n\t\tRouter::connect('/login', ['controller' => 'sessions', 'action' => 'add']);\n\t\t$result = Router::match(['controller' => 'sessions', 'action' => 'add']);\n\t\t$this->assertIdentical('/login', $result);\n\n\t\t$expected = \"No parameter match found for URL `('controller' => 'Sessions', \";\n\t\t$expected .= \"'action' => 'index')`.\";\n\t\t$this->assertException($expected, function() {\n\t\t\tRouter::match(['controller' => 'sessions', 'action' => 'index']);\n\t\t});\n\t}", "public function testUnauthorizedAccess()\n {\n $this->get('/properties/1');\n\n $this->assertGuest();\n }", "public function test_cant_show_all_notes_without_auth()\n {\n $response = $this->get('/notes');\n\n $response->assertStatus(Response::HTTP_FOUND);\n\n $response->assertRedirect(route('login'));\n }" ]
[ "0.7635416", "0.75495064", "0.72012395", "0.7131753", "0.679797", "0.64963436", "0.64317816", "0.6409451", "0.6356825", "0.63330024", "0.6329054", "0.6320729", "0.62511474", "0.62154156", "0.6175246", "0.61190987", "0.6111697", "0.6094165", "0.60707617", "0.60170734", "0.6000672", "0.59948623", "0.59740394", "0.5970419", "0.596553", "0.59633374", "0.5925201", "0.58546084", "0.58347684", "0.58181655", "0.5815886", "0.5812855", "0.57910055", "0.5786701", "0.57845604", "0.5776989", "0.5761039", "0.57471836", "0.57460105", "0.5741395", "0.5735287", "0.57308733", "0.57140166", "0.57109135", "0.5705805", "0.568399", "0.5683921", "0.5678705", "0.5677236", "0.56617695", "0.5656321", "0.56545687", "0.56525296", "0.56487083", "0.5635035", "0.5631463", "0.56291056", "0.56178564", "0.5615735", "0.56134975", "0.5604031", "0.5604031", "0.5602115", "0.56020284", "0.5595477", "0.55807227", "0.55803543", "0.5566664", "0.55665964", "0.5563026", "0.55546653", "0.55532044", "0.55418277", "0.55370533", "0.5531685", "0.55235636", "0.55233157", "0.5521297", "0.5519563", "0.551549", "0.55136126", "0.5511512", "0.55072236", "0.5504323", "0.5496653", "0.5488676", "0.5486118", "0.5481366", "0.54796535", "0.54796505", "0.54777783", "0.547638", "0.5476053", "0.54758865", "0.54728764", "0.5471441", "0.54619753", "0.5459875", "0.5455342", "0.54536164" ]
0.7303038
2
Test all secondary routes These are the routes that redirect to the primarys Like /guid, or /post/1 or even /1 if static route enabled
public function testSecondaryRoutes() { /*//Filters disabled during unit tests unless you enable them //I need them enabled because they log the user in as anonymous Route::enableFilters(); // Test /1 redirects to /home $this->call('GET', '/1'); $this->assertRedirectedTo('/home'); // Test /1/anything/here redirects to /home $this->call('GET', '/1/anything/here'); $this->assertRedirectedTo('/home'); // Test /1 redirects to /home $this->call('GET', '/post/1'); $this->assertRedirectedTo('/home'); // Test /9d3e171a-62a9-e958-bdfa-d6f224ca8cad redirects to /home $this->call('GET', '/9d3e171a-62a9-e958-bdfa-d6f224ca8cad'); $this->assertRedirectedTo('/home'); // Test /home2 is post 1 (this is an optional route to post 1) // /home2 displays post 1, it does not redirect to /home $clicksBefore = Router::where('slug', '=', 'home2')->first()->clicks; $response = $this->call('GET', '/home2'); $post = $response->original['post']; $this->assertResponseOk(); $this->assertViewHas('post'); $this->assertEquals(1, $post->id); $this->assertEquals('9d3e171a-62a9-e958-bdfa-d6f224ca8cad', $post->uuid); $clicksAfter = Router::where('slug', '=', 'home2')->first()->clicks; $this->assertEquals(++$clicksBefore, $clicksAfter); // Test /home3 which is a disabled route $this->call('GET', '/home3'); $this->assertResponseStatus(404); // ##### Login as mReschke ##### Auth::login(User::find(2)); Auth::user()->login(); // Test /13/blah redirects to /13/mreschke-home-page $this->call('GET', '/13/blah'); $this->assertRedirectedTo('/13/mreschke-home-page'); // Test /13 and /13/ redirects to /13/mreschke-home-page $this->call('GET', '/13'); $this->assertRedirectedTo('/13/mreschke-home-page'); $this->call('GET', '/13/'); $this->assertRedirectedTo('/13/mreschke-home-page'); // Test /13 redirects to /13/mreschke-home-page $this->call('GET', '/post/13'); $this->assertRedirectedTo('/13/mreschke-home-page'); */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testOtherRoutes()\n\t{\n\t\t/*//Filters disabled during unit tests unless you enable them\n\t\t//I need them enabled because they log the user in as anonymous\n\t\tRoute::enableFilters();\n\n\t\t// /google redirects to http://google.com\n\t\t$clicksBefore = Router::where('slug', '=', 'google')->first()->clicks;\n\t\t$this->call('GET', '/google');\n\t\t$this->assertRedirectedTo('http://google.com');\n\t\t$clicksAfter = Router::where('slug', '=', 'google')->first()->clicks;\n\t\t$this->assertEquals(++$clicksBefore, $clicksAfter);\n\n\t\t// /google2 is a disabled route\n\t\t$this->call('GET', '/google2');\n\t\t$this->assertResponseStatus(404);\n\n\t\t$this->call('GET', '/99/invalid');\n\t\t$this->assertResponseStatus(404);\n\n\t\t$this->call('GET', '/this/is/invalid');\n\t\t$this->assertResponseStatus(404);\n\t\t\n\n\t\t// Test search route\n\t\t// ??\n\n\t\t// Test net route\n\t\t// ??\n\n\t\t// Test login route\n\t\t$this->call('GET', '/login');\n\t\t$this->assertResponseOk();\n\n\t\t// Test logout route redirects to /\n\t\t$this->call('GET', '/logout');\n\t\t$this->assertRedirectedTo('/');\n\t\t*/\n\n\t}", "public function testPrimaryRoutes()\n\t{\n\t/*\t//Filters disabled during unit tests unless you enable them\n\t\t//I need them enabled because they log the user in as anonymous\n\t\tRoute::enableFilters();\n\n\t\t// Test base route\n\t\t// Should show post id 1\n\t\t$response = $this->call('GET', '/');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(1, $post->id);\n\t\t$this->assertEquals('9d3e171a-62a9-e958-bdfa-d6f224ca8cad', $post->uuid);\n\n\t\t// Test /home is post 1\n\t\t$clicksBefore = Router::where('slug', '=', 'home')->first()->clicks;\n\t\t$response = $this->call('GET', '/home');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(1, $post->id);\n\t\t$this->assertEquals('9d3e171a-62a9-e958-bdfa-d6f224ca8cad', $post->uuid);\n\t\t$clicksAfter = Router::where('slug', '=', 'home')->first()->clicks;\n\t\t$this->assertEquals(++$clicksBefore, $clicksAfter);\n\n\t\t// Test /about is post 2\n\t\t$response = $this->call('GET', '/about');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(2, $post->id);\n\t\t$this->assertEquals('f1112648-782e-aad3-785d-640fcfefaa9b', $post->uuid);\n\n\n\t\t// ##### Login as mReschke #####\n\t\tAuth::login(User::find(2)); Auth::user()->login();\n\n\t\t// Test /13/mreschke-home-page (non named route)\n\t\t$response = $this->call('GET', '/13/mreschke-home-page');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(13, $post->id);\n\t\t$this->assertEquals('1a52e0e3-3174-7b2b-a582-03a39e52e34a', $post->uuid);\n\n\t\t// Test /14/squaethem-home-page (non named route)\n\t\t$response = $this->call('GET', '/14/squaethem-home-page');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(14, $post->id);\n\t\t$this->assertEquals('e80e907e-50d4-8ed4-70f7-5d1815672966', $post->uuid);\n\t\t*/\n\n\t}", "public function testLegacyRoutes()\n\t{\n\t\t/*//Filters disabled during unit tests unless you enable them\n\t\t//I need them enabled because they log the user in as anonymous\n\t\tRoute::enableFilters();\n\n\t\t// Test /topic/1 redirects to /home\n\t\t$this->call('GET', '/topic/1');\n\t\t$this->assertRedirectedTo('/home');\n\t\t$this->call('GET', '/topic/1/doesnt/matter');\n\t\t$this->assertRedirectedTo('/home');\n\n\t\t// ?? files/1 does not currently redirect\n\t\t// not sure if it should or not yet\n\t\t*/\n\n\t}", "public function test_route_merge() {\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' ),\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\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( '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// Check both routes exist.\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$endpoint = $endpoints['/test-ns/test'];\n\t\t$this->assertCount( 2, $endpoint );\n\t}", "public function test_route_override() {\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' ),\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t'should_exist' => false,\n\t\t\t)\n\t\t);\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( 'POST' ),\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t'should_exist' => true,\n\t\t\t),\n\t\t\ttrue\n\t\t);\n\n\t\t// Check we only have one route.\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$endpoint = $endpoints['/test-ns/test'];\n\t\t$this->assertCount( 1, $endpoint );\n\n\t\t// Check it's the right one.\n\t\t$this->assertArrayHasKey( 'should_exist', $endpoint[0] );\n\t\t$this->assertTrue( $endpoint[0]['should_exist'] );\n\t}", "public function testBasicRouteMatching() {\n\t\tRouter::connect('/hello', ['controller' => 'Posts', 'action' => 'index']);\n\t\t$expected = ['controller' => 'Posts', 'action' => 'index'];\n\n\t\tforeach (['/hello/', '/hello', 'hello/', 'hello'] as $url) {\n\t\t\t$this->request->url = $url;\n\t\t\t$result = Router::parse($this->request);\n\t\t\t$this->assertEqual($expected, $result->params);\n\t\t\t$this->assertEqual(['controller'], $result->persist);\n\t\t}\n\t}", "public function test_route_canonicalized_multiple() {\n\t\tregister_rest_route(\n\t\t\t'test-ns',\n\t\t\t'/test',\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => array( 'GET' ),\n\t\t\t\t\t'callback' => '__return_null',\n\t\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => array( 'POST' ),\n\t\t\t\t\t'callback' => '__return_null',\n\t\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t// Check the route was registered correctly.\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_raw_endpoint_data();\n\t\t$this->assertArrayHasKey( '/test-ns/test', $endpoints );\n\n\t\t// Check the route was wrapped in an array.\n\t\t$endpoint = $endpoints['/test-ns/test'];\n\t\t$this->assertArrayNotHasKey( 'callback', $endpoint );\n\t\t$this->assertArrayHasKey( 'namespace', $endpoint );\n\t\t$this->assertSame( 'test-ns', $endpoint['namespace'] );\n\n\t\t$filtered_endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$endpoint = $filtered_endpoints['/test-ns/test'];\n\t\t$this->assertCount( 2, $endpoint );\n\n\t\t// Check for both methods.\n\t\tforeach ( array( 0, 1 ) as $key ) {\n\t\t\t$this->assertArrayHasKey( 'callback', $endpoint[ $key ] );\n\t\t\t$this->assertArrayHasKey( 'methods', $endpoint[ $key ] );\n\t\t\t$this->assertArrayHasKey( 'args', $endpoint[ $key ] );\n\t\t}\n\t}", "function _parse_routes()\n {\n // Do we even have any custom routing to deal with?\n // There is a default scaffolding trigger, so we'll look just for 1\n if (count($this->routes) == 1)\n {\n $this->_set_request($this->uri->segments);\n return;\n }\n\n // Turn the segment array into a URI string\n $uri = implode('/', $this->uri->segments);\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri]))\n {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n\n //Art\n $i = $this->_search_by_key($this->routes, self::MAIN, $uri);\n if ($i !== FALSE)\n {\n $this->_set_request(explode('/', $this->routes[$i][self::ROUTE]));\n return;\n }\n\n // Loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val)\n {\n if(is_int($key))\n {\n $key = $val[self::MAIN];\n $val = $val[self::ROUTE];\n }\n // Convert wild-cards to RegEx\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri))\n {\n // Do we have a back-reference?\n if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE)\n {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request($this->uri->segments);\n }", "public function testSimpleRoutes() {\n\t\t$rules = array(\n\t\t\t'Index/Index' => '/',\n\t\t\t'Index/Simple' => '/test/simple',\n\t\t\t'Index/Language' => '/test/en',\n\t\t\t'Index/WithoutSlash' => '/test'\n\t\t);\n\n\t\t$controller = null;\n\t\t$action = null;\n\n\t\tforeach ($this->languages as $language) {\n\t\t\tforeach ($rules as $controllerAction => $uri) {\n\t\t\t\t$route = $this->getRouter('/' . $language . $uri, $rules)->getRoute($controller, $action);\n\n\t\t\t\t$this->assertEquals($controllerAction, $route, 'The route for an empty request does not match');\n\t\t\t\t$this->assertEquals($route, $controller . '/' . $action,\n\t\t\t\t\t'The outgoing parameters do not match the returned route');\n\t\t\t}\n\t\t}\n\t}", "public function registerSiteRoutes()\n\t{\n\t\t// NOTE: the second route is used to capture files in subdirectories as well\n\t\treturn array(\n\t\t\t'internal/(?P<id>.\\d*)' => array('action' => 'AssetManagement/Assets/findById'),\n\t\t\t'internal/(?P<directory>.*)/(?P<name>.*)' => array('action' => 'AssetManagement/Assets/findInDirectory')\n\t\t);\n\t}", "public function testUrlCatchAllRoute(): void\n {\n Router::createRouteBuilder('/')\n ->connect('/*', ['controller' => 'Categories', 'action' => 'index']);\n $result = Router::url(['controller' => 'Categories', 'action' => 'index', '0']);\n $this->assertSame('/0', $result);\n\n $expected = [\n 'plugin' => null,\n 'controller' => 'Categories',\n 'action' => 'index',\n 'pass' => ['0'],\n '_matchedRoute' => '/*',\n ];\n $result = Router::parseRequest($this->makeRequest('/0', 'GET'));\n unset($result['_route']);\n $this->assertEquals($expected, $result);\n\n $result = Router::parseRequest($this->makeRequest('0', 'GET'));\n unset($result['_route']);\n $this->assertEquals($expected, $result);\n }", "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 }", "protected function preReRouting()\n {\n\n }", "private function uri_reroute()\n {\n $match = false;\n\n $uri = parse_url($_SERVER['REQUEST_URI']);\n if (isset($uri['path']) && $uri['path'] !== \"/\") {\n $_ = preg_split(\"|/|\", $uri['path'], -1, PREG_SPLIT_NO_EMPTY);\n\n $i = 0;\n $route = null;\n $router = null;\n // while ($match === false) {\n // $path = $_[$i];\n\n // if (isset($this->configuration['ROUTES']['/' . $path])) {\n // $match = true;\n // $route = \"/$path\";\n // $router = $this->configuration['ROUTES']['/' . $path];\n // $this->route_map = $route;\n // }\n\n // if (isset($this->configuration['ROUTES'][$path])) {\n // $match = true;\n // $route = \"$path\";\n // $router = $this->configuration['ROUTES'][$path];\n // $this->route_map = $route;\n // }\n\n // ++$i;\n // }\n\n // unset($_);\n // unset($i);\n // unset($uri);\n // unset($path);\n\n if (isset($_) && is_array($_) && count($_) > 0) {\n $path = \"\";\n foreach ($_ as $k => $v) {\n $path .= \"/\" . $v;\n\n if (isset($this->configuration['ROUTES'][$path])) {\n $match = true;\n $route = \"$path\";\n $router = $this->configuration['ROUTES'][$path];\n $this->route_map = $route;\n\n // if(is_array($router['params'])){\n\n // }elseif($router['params'] == \"*\"){\n // break;\n // }\n\n break;\n }\n }\n }\n\n if (isset($router['controller'])) {\n $this->controller = $router['controller'];\n } else {\n $this->controller = \"main\";\n }\n\n if (isset($router['method'])) {\n $this->method = $router['method'];\n } else {\n $this->method = \"index\";\n }\n\n if (isset($router['action']) && isset($this->http)) {\n if (trim(strtolower($router['action'])) != strtolower($this->http->action)) {\n $this->http->http_error(403);\n }\n }\n \n if (isset($router['type']) && isset($router['type'])){\n if (trim(strtolower($router['type'])) == \"json\" && $this->http->type != \"json\"){\n $this->http->http_error(406, \"Form \" . $this->http->action . \" data is not json\");\n }\n }\n\n if (isset($router['params'])) {\n if (is_array($router['params'])) {\n $uri = preg_split(\"|/|\", str_replace($route, \"\", $_SERVER['REQUEST_URI']), -1, PREG_SPLIT_NO_EMPTY);\n\n if (is_array($router['params'])) {\n $_ = $router['params'];\n unset($router['params']);\n\n $router['params'][] = $_;\n unset($_);\n }\n\n $nums_params = count($router['params'][0]);\n\n if ($nums_params > 0) {\n foreach ($router['params'][0] as $k => $v) {\n $this->params[$v] = trim(urldecode($uri[$k]));\n }\n }\n\n $i = 0;\n $x = 0;\n while ($nums_params < $i) {\n if (isset($uri[$x]) && is_value($uri[$x])) {\n $this->params[$router['params'][$i]] = trim(urldecode($uri[$x]));\n ++$i;\n }\n ++$x;\n }\n\n } elseif ($router['params'] != \"*\") {\n return $this->http->http_error(404);\n }\n } else {\n $uri = preg_split(\"|/|\", str_replace($route, \"\", $_SERVER['REQUEST_URI']), -1, PREG_SPLIT_NO_EMPTY);\n\n if (count($uri) > 0) {\n return $this->http->http_error(404);\n }\n }\n\n unset($uri);\n unset($i);\n unset($x);\n unset($route);\n unset($router);\n }\n\n return $match;\n }", "function route_match() {\n global $route;\n global $html;\n global $config;\n global $matched_route;\n\n $url = explode('index.php', $_SERVER['REQUEST_URI']);\n $url = @str_replace('.', '', substr($url[1], 1));\n if(strpos($url, '?') !== false) {\n $url = explode('?', $url);\n $url = $url[0];\n }\n\n if(!$url) {\n $matched_route = 'ROOT';\n require_once __DIR__ . '/app/' . $route['ROOT'];\n return true;\n }\n\n if(substr($url, -1) == '/') {\n $url = substr($url, 0, -1);\n }\n\n // Check for simple route match\n if(array_key_exists($url, $route)) {\n $matched_route = $url;\n require_once __DIR__ . '/app/' . $route[$url];\n return true;\n }\n\n // Check for regex\n foreach($route as $r => $page) {\n $matches = array();\n\n if(preg_match('#' . $r . '$#', $url, $matches)) {\n array_shift($matches);\n\n $_GET['custom_arguments'] = $matches;\n\n $matched_route = $r;\n require_once __DIR__ . '/app/' . $page;\n return true;\n }\n }\n\n return false;\n}", "public function hookDefineRoutes($args)\n {\n if (is_admin_theme() && !get_option('clean_url_use_admin')) {\n return;\n }\n\n $router = $args['router'];\n\n $mainPath = get_option('clean_url_main_path');\n $collectionGeneric = get_option('clean_url_collection_generic');\n $itemGeneric = get_option('clean_url_item_generic');\n $fileGeneric = get_option('clean_url_file_generic');\n\n $allowedForItems = unserialize(get_option('clean_url_item_alloweds'));\n $allowedForFiles = unserialize(get_option('clean_url_file_alloweds'));\n\n // Note: order of routes is important: Zend checks from the last one\n // (most specific) to the first one (most generic).\n\n // Get all collections identifiers with one query.\n $collectionsIdentifiers = get_view()->getRecordTypeIdentifiers('Collection', false);\n\n if (!empty($collectionsIdentifiers)) {\n // Use one regex for all collections. Default is case insensitve.\n $collectionsRegex = array_map('preg_quote', $collectionsIdentifiers);\n // To avoid a bug with identifiers that contain a \"/\", that is not\n // escaped with preg_quote().\n $collectionsRegex = '(' . str_replace('/', '\\/', implode('|', $collectionsRegex)) . ')';\n\n // Add a collection route.\n $route = $mainPath . $collectionGeneric;\n $router->addRoute('cleanUrl_collections', new Zend_Controller_Router_Route(\n $route . ':record_identifier',\n array(\n 'module' => 'clean-url',\n 'controller' => 'index',\n 'action' => 'collection-show',\n ),\n array(\n 'record_identifier' => $collectionsRegex,\n )));\n\n // Add a collection route for files.\n if (in_array('collection', $allowedForFiles)) {\n $router->addRoute('cleanUrl_collections_file', new Zend_Controller_Router_Route(\n $route . ':collection_identifier/:record_identifier',\n array(\n 'module' => 'clean-url',\n 'controller' => 'index',\n 'action' => 'route-collection-file',\n ),\n array(\n 'collection_identifier' => $collectionsRegex,\n )));\n }\n\n // Add a collection / item route for files.\n if (in_array('collection_item', $allowedForFiles)) {\n $router->addRoute('cleanUrl_collections_item_file', new Zend_Controller_Router_Route(\n $route . ':collection_identifier/:item_identifier/:record_identifier',\n array(\n 'module' => 'clean-url',\n 'controller' => 'index',\n 'action' => 'route-collection-item-file',\n ),\n array(\n 'collection_identifier' => $collectionsRegex,\n )));\n }\n\n // Add a collection route for items.\n if (in_array('collection', $allowedForItems)) {\n $router->addRoute('cleanUrl_collections_item', new Zend_Controller_Router_Route(\n $route . ':collection_identifier/:record_identifier',\n array(\n 'module' => 'clean-url',\n 'controller' => 'index',\n 'action' => 'route-collection-item',\n ),\n array(\n 'collection_identifier' => $collectionsRegex,\n )));\n }\n }\n\n // Add a generic route for files.\n if (in_array('generic', $allowedForFiles)) {\n $route = $mainPath . $fileGeneric;\n $router->addRoute('cleanUrl_generic_file', new Zend_Controller_Router_Route(\n $route . ':record_identifier',\n array(\n 'module' => 'clean-url',\n 'controller' => 'index',\n 'action' => 'route-file',\n 'collection_id' => NULL,\n )));\n }\n\n // Add a generic / item route for files.\n if (in_array('generic_item', $allowedForFiles)) {\n $route = $mainPath . $itemGeneric;\n $router->addRoute('cleanUrl_generic_item_file', new Zend_Controller_Router_Route(\n $route . ':item_identifier/:record_identifier',\n array(\n 'module' => 'clean-url',\n 'controller' => 'index',\n 'action' => 'route-item-file',\n 'collection_id' => NULL,\n )));\n }\n\n // Add a generic route for items.\n if (in_array('generic', $allowedForItems)) {\n $route = $mainPath . trim($itemGeneric, '/');\n $router->addRoute('cleanUrl_generic_items_browse', new Zend_Controller_Router_Route(\n $route,\n array(\n 'module' => 'clean-url',\n 'controller' => 'index',\n 'action' => 'items-browse',\n )));\n $router->addRoute('cleanUrl_generic_item', new Zend_Controller_Router_Route(\n $route . '/:record_identifier',\n array(\n 'module' => 'clean-url',\n 'controller' => 'index',\n 'action' => 'route-item',\n 'collection_id' => NULL,\n )));\n }\n }", "public function matchRoute() {\n\t\tforeach($this->routes as $pattern => $callback) {\n\t\t\tif (preg_match('{^' . $pattern . '$}', $this->url) === 1) {\n\t\t\t\tif(!isset($_SESSION)){ session_start(); }\n\t\t\t\t// Parameters\n\t\t\t\t$params = array();\n\t\t\t\tif (isset($callback['params'])) {\n\t\t\t\t\t$url = explode('/', $this->url);\n\t\t\t\t\t$url = array_slice($url, -1 * count($callback['params']));\n\t\t\t\t\t$params = array_combine(array_keys($callback['params']), $url);\n\t\t\t\t}\n\t\t\t\t// Secured (Backend)\n\t\t\t\tif (isset($callback['secured'])) {\n\t\t\t\t\tif (isset($_SESSION['auth']) && $_SESSION['auth'] === true) {\n\t\t\t\t\t\t$this->dispatch($callback['controller'], $callback['action'], $params);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->url = 'http://' . $_SERVER['SERVER_NAME'] . '/login';\n\t\t\t\t\t\theader('location:' . $this->url);\n\t\t\t\t\t}\n\t\t\t\t// Secured (Frontend)\n\t\t\t\t} elseif (isset($callback['clientsecured'])) {\n\t\t\t\t\tif (isset($_SESSION['fauth']) && $_SESSION['fauth'] === true) {\n\t\t\t\t\t\t$this->dispatch($callback['controller'], $callback['action'], $params);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->url = 'home/login';\n\t\t\t\t\t\theader('location:' . $this->url);\n\t\t\t\t\t}\n\t\t\t\t// Simple\n\t\t\t\t} else {\n\t\t\t\t\t$this->dispatch($callback['controller'], $callback['action'], $params);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// No match\n\t\t$this->dispatch('Default', 'error', array('code' => 404));\n\t\treturn;\n\t}", "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 _checkRoutes($segments)\n {\n $routes = $this->_routes;//Config::getInstance()->get('routes');\n $max = count($segments);\n if ($max === 1){\n foreach ($routes as $key=>$value) {\n if ($key == $segments[0]) {\n $segments[0] = $value;\n }\n } \n } else {\n $url = $this->_createUrl($segments);\n foreach ($routes as $key=>$value) {\n if ($key === $url) {\n $url = $value;\n }\n }\n $segments = $this->uri->explodeUrl($url);\n }\n \n $this->_segments = $segments;\n }", "public function routes()\n {\n return [\n 'GET' => [\n 'main' => [\n 'index' => [\n 'name' => 'index'\n ],\n 'services' => [\n 'name' => 'services'\n ],\n 'contacts' => [\n 'name' => 'contacts'\n ],\n 'typography' => [\n 'name' => 'typography'\n ],\n 'test' => [\n 'name' => 'test'\n ],\n 'test1' => [\n 'name' => 'test1'\n ]\n ],\n 'blog' => [\n 'index' => [\n 'name' => 'index'\n ],\n 'create' => [\n 'name' => 'create',\n 'required' => [\n 'auth' => true\n ]\n ],\n 'view' => [\n 'name' => 'view',\n 'required' => [\n 'param' => true\n ]\n ],\n 'edit' => [\n 'name' => 'view',\n 'required' => [\n 'auth' => true,\n 'param' => true\n ]\n ]\n ],\n 'user' => [\n //'index' => 'index',\n 'login' => [\n 'name' => 'login'\n ],\n 'register' => [\n 'name' => 'register'\n ],\n 'logout' => [\n 'name' => 'logout',\n 'required' => [\n 'auth' => true\n ],\n ],\n 'change-password' => [\n 'name' => 'change-password',\n 'required' => [\n 'auth' => true\n ],\n ],\n 'forget-password' => [\n 'name' => 'forget-password',\n 'required' => [\n 'auth' => true\n ],\n ]\n ],\n 'auth' => [\n 'vk' => [\n 'name' => 'vk'\n ]\n ],\n 'config' => [\n 'index' => [\n 'name' => 'index',\n 'required' => [\n 'auth' => true\n ]\n ],\n 'sitemap' => [\n 'name' => 'sitemap',\n 'required' => [\n 'auth' => true\n ]\n ]\n ],\n 'portfolio' => [\n 'view' => [\n 'name' => 'view',\n 'required' => [\n 'param' => true\n ]\n ]\n ],\n 'ajax' => [\n 'template' => [\n 'name' => 'template',\n 'required' => [\n 'ajax' => true\n ]\n ],\n 'test' => [\n 'name' => 'test',\n 'required' => [\n 'ajax' => true\n ]\n ]\n ]\n ],\n 'POST' => [\n 'ajax' => [\n 'form-feedback' => [\n 'name' => 'form-feedback',\n 'required' => [\n 'refer' => 'https://uiweb.ru/'\n ]\n ],\n 'form-backcall' => [\n 'name' => 'form-backcall',\n 'required' => [\n 'refer' => 'https://uiweb.ru/main/contacts'\n ]\n ],\n 'form-login' => [\n 'name' => 'form-login'\n ],\n 'form-register' => [\n 'name' => 'form-register'\n ],\n 'form-change-password' => [\n 'name' => 'form-change-password'\n ]\n ],\n 'blog' => [\n 'create' => [\n 'name' => 'create',\n 'required' => [\n 'auth' => true\n ]\n ],\n 'edit' => [\n 'name' => 'create',\n 'required' => [\n 'auth' => true,\n 'param' => true\n ]\n ]\n ]\n ],\n 'PUT',\n 'PATCH',\n 'TRACE',\n 'DELETE',\n 'HEAD',\n 'OPTIONS'\n ];\n }", "public function routes()\n {\n register_rest_route('can', '/donation-forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'fundraisingPages'\n ],\n ]);\n\n register_rest_route('can', '/forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'forms'\n ],\n ]);\n\n register_rest_route('can', '/petitions', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'petitions'\n ],\n ]);\n\n register_rest_route('can', '/person/add', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'addPerson'\n ],\n ]);\n }", "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 }", "private function parseRoutes()\n {\n // Turn the segment array into a URI string\n $uri = implode('/', $this->uri->getSegments());\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri])) {\n return $this->setRequest(explode('/', $this->routes[$uri]));\n }\n\n // Loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val) {\n // Convert wild-cards to RegEx\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri)) {\n // Do we have a back-reference?\n if (strpos($val, '$') !== false && strpos($key, '(') !== false) {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n\n return $this->setRequest(explode('/', $val));\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->setRequest($this->uri->getSegments());\n }", "public function route()\n {\n $this->dashboardRouting($this->relativeCmsUri);\n $this->logOffRouting($this->request, $this->relativeCmsUri);\n $this->apiRouting($this->relativeCmsUri);\n $this->documentRouting($this->userRights, $this->relativeCmsUri);\n $this->valuelistsRouting($this->userRights, $this->relativeCmsUri);\n $this->sitemapRouting($this->userRights, $this->relativeCmsUri);\n $this->redirectRouting($this->userRights, $this->relativeCmsUri);\n $this->imageRouting($this->userRights, $this->relativeCmsUri);\n $this->filesRouting($this->userRights, $this->relativeCmsUri);\n $this->configurationRouting($this->userRights, $this->relativeCmsUri);\n $this->searchRouting($this->relativeCmsUri);\n }", "protected function _parse_routes()\n\t{\n\t\t$uri = implode('/', $this->uri->segments);\n\n\t\t// Get HTTP verb\n\t\t$http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n\t\t// Loop through the route array looking for wildcards\n\t\tforeach ($this->routes as $key => $val)\n\t\t{\n\t\t\t// Check if route format is using HTTP verbs\n\t\t\tif (is_array($val))\n\t\t\t{\n\t\t\t\t$val = array_change_key_case($val, CASE_LOWER);\n\t\t\t\tif (isset($val[$http_verb]))\n\t\t\t\t{\n\t\t\t\t\t$val = $val[$http_verb];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Convert wildcards to RegEx\n\t\t\t$key = str_replace(array(':any', ':num',':all'), array('[^/]+', '[0-9]+','(?!(Techsystem|techsystem|Vindex\\/tech5sManagerControl).*$).*'), $key);\n\t\t\t// $key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n\t\t\t// Does the RegEx match?\n\t\t\tif (preg_match('#^'.$key.'$#', $uri, $matches))\n\t\t\t{\n\t\t\t\t// Are we using callbacks to process back-references?\n\t\t\t\tif ( ! is_string($val) && is_callable($val))\n\t\t\t\t{\n\t\t\t\t\t// Remove the original string from the matches array.\n\t\t\t\t\tarray_shift($matches);\n\n\t\t\t\t\t// Execute the callback using the values in matches as its parameters.\n\t\t\t\t\t$val = call_user_func_array($val, $matches);\n\t\t\t\t}\n\t\t\t\t// Are we using the default routing method for back-references?\n\t\t\t\telseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$val = preg_replace('#^'.$key.'$#', $val, $uri);\n\t\t\t\t}\n\n\t\t\t\t$this->_set_request(explode('/', $val));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\n\t\t// If we got this far it means we didn't encounter a\n\t\t// matching route so we'll set the site default route\n\t\t$this->_set_request(array_values($this->uri->segments));\n\t}", "public function hookDefineRoutes($args)\n {\n $router = $args['router'];\n // Only apply custom routes on public theme.\n // The wildcards on both routes make these routes always apply for the\n // annotation controller.\n\n // get the base path\n/* $bp = get_option('annotation_page_path');\n $router->addRoute('annotationDefault',\n new Zend_Controller_Router_Route('annotation/:action/*',\n array('module' => 'annotation',\n 'controller' => 'annotation',\n 'action' => 'annotate')));\n*/\n if(is_admin_theme()){\n/* $router->addRoute('annotationAdmin',\n new Zend_Controller_Router_Route('annotation/:controller/:action/*',\n array('module' => 'annotation',\n 'controller' => 'index',\n 'action' => 'index')));\n*/\n/* $router->addRoute('cloneAdmin',\n new Zend_Controller_Router_Route('annotation/clone/:action/*',\n array('module' => 'annotation',\n 'controller' => 'clone',\n 'action' => 'clone')));\n*/\n\n }\n }", "function match_against_router() {\n\n require_once APP_PATH . '/config/routing.php';\n\n if (isset($routes)) {\n $base_url = $this->get_base_url();\n\n foreach ($routes as $key => $val) {\n if ($key == $base_url) {\n return $val;\n }\n }\n }\n return false;\n }", "function defineRoutes(&$router) {\n \n // Main\n $router->map('mobile_access', 'm', array('controller' => 'mobile_access', 'action' => 'index'));\n \n $router->map('mobile_access_login', 'm/login', array('controller' => 'mobile_access_auth', 'action' => 'login'));\n $router->map('mobile_access_logout', 'm/logout', array('controller' => 'mobile_access_auth', 'action' => 'logout'));\n $router->map('mobile_access_forgot_password', 'm/forgot-password', array('controller' => 'mobile_access_auth', 'action' => 'forgot_password'));\n \n // Quick Add\n $router->map('mobile_access_quick_add', 'm/starred', array('controller' => 'mobile_access', 'action' => 'quick_add'));\n \n // Assignments\n $router->map('mobile_access_assignments', 'm/assignments', array('controller' => 'mobile_access', 'action' => 'assignments'));\n \n // Starred\n $router->map('mobile_access_starred', 'm/starred', array('controller' => 'mobile_access', 'action' => 'starred'));\n \n // People\n $router->map('mobile_access_people', 'm/people', array('controller' => 'mobile_access_people', 'action' => 'index'));\n $router->map('mobile_access_view_company', 'm/people/:object_id', array('controller' => 'mobile_access_people', 'action' => 'company'), array('object_id' => '\\d+'));\n $router->map('mobile_access_view_user', 'm/people/users/:object_id', array('controller' => 'mobile_access_people', 'action' => 'user'), array('object_id' => '\\d+'));\n \n \n // Projects\n $router->map('mobile_access_projects', 'm/projects', array('controller' => 'mobile_access_projects', 'action' => 'index'));\n \n // Project\n $router->map('mobile_access_view_project', 'm/project/:project_id', array('controller' => 'mobile_access_project', 'action' => 'index'), array('project_id' => '\\d+'));\n \n // Project discusions\n $router->map('mobile_access_view_discussions', 'm/project/:project_id/discussions', array('controller' => 'mobile_access_project_discussions', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_discussion', 'm/project/:project_id/discussions/:object_id', array('controller' => 'mobile_access_project_discussions', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project milestones\n $router->map('mobile_access_view_milestones', 'm/project/:project_id/milestones', array('controller' => 'mobile_access_project_milestones', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_milestone', 'm/project/:project_id/milestones/:object_id', array('controller' => 'mobile_access_project_milestones', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project files\n $router->map('mobile_access_view_files', 'm/project/:project_id/files', array('controller' => 'mobile_access_project_files', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_file', 'm/project/:project_id/files/:object_id', array('controller' => 'mobile_access_project_files', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+')); \n \n // Project checklists\n $router->map('mobile_access_view_checklists', 'm/project/:project_id/checklists', array('controller' => 'mobile_access_project_checklists', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_checklist', 'm/project/:project_id/checklists/:object_id', array('controller' => 'mobile_access_project_checklists', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+')); \n \n // Project pages\n $router->map('mobile_access_view_pages', 'm/project/:project_id/pages', array('controller' => 'mobile_access_project_pages', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_page', 'm/project/:project_id/pages/:object_id', array('controller' => 'mobile_access_project_pages', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n $router->map('mobile_access_view_page_version', 'm/project/:project_id/pages/:object_id/version/:version', array('controller' => 'mobile_access_project_pages', 'action' => 'version'), array('project_id' => '\\d+', 'object_id' => '\\d+', 'version' => '\\d+'));\n \n // Project tickets\n $router->map('mobile_access_view_tickets', 'm/project/:project_id/tickets', array('controller' => 'mobile_access_project_tickets', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_ticket', 'm/project/:project_id/tickets/:object_id', array('controller' => 'mobile_access_project_tickets', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project timerecords\n $router->map('mobile_access_view_timerecords', 'm/project/:project_id/timerecords', array('controller' => 'mobile_access_project_timetracking', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_timerecord', 'm/project/:project_id/timerecords/:object_id', array('controller' => 'mobile_access_project_timetracking', 'action' => 'index'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project subobjects\n $router->map('mobile_access_view_task', 'm/project/:project_id/task/:object_id', array('controller' => 'mobile_access', 'action' => 'view_parent_object'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n $router->map('mobile_access_view_comment', 'm/project/:project_id/comment/:object_id', array('controller' => 'mobile_access', 'action' => 'view_parent_object'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n $router->map('mobile_access_add_comment', 'm/project/:project_id/comment/add', array('controller' => 'mobile_access_project', 'action' => 'add_comment'));\n \n // Common\n $router->map('mobile_access_view_category', 'm/category/:object_id', array('controller' => 'mobile_access', 'action' => 'view_category', array('object_id' => '\\d+')));\n $router->map('mobile_access_toggle_object_completed_status', 'm/project/:project_id/toggle-completed/:object_id', array('controller' => 'mobile_access', 'action' => 'toggle_completed', array('project_id' => '\\d+', 'object_id' => '\\d+')));\n }", "function _route()\n\t{\n\t\t// if the user login redirect to base\n\t\tif(\\lib\\permission::access('enter:another:session'))\n\t\t{\n\t\t\t// the admin can login by another session\n\t\t\t// never redirect to main\n\t\t}\n\t\telse\n\t\t{\n\t\t\tparent::if_login_not_route();\n\t\t}\n\n\t\t// check remeber me is set\n\t\t// if remeber me is set: login!\n\t\tparent::check_remember_me();\n\n\t\t// save all param-* | param_* in $_GET | $_POST\n\t\t$this->save_param();\n\n\t\tif(self::get_request_method() === 'get')\n\t\t{\n\t\t\t$this->get(false, 'enter')->ALL();\n\t\t}\n\t\telseif(self::get_request_method() === 'post')\n\t\t{\n\t\t\t$this->post('enter')->ALL();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tself::error_method('home');\n\t\t}\n\t}", "public static function check_store($url,$controller,$methode){\n foreach($GLOBALS[\"route_url\"] as $key => $value){\n if(explode(\"/\",$key)[1] === $url && $value[\"controller\"] === $controller && $value[\"method\"] === $methode ){\n\n Wrong::_404(\"route; DOUBLE ROUTING \");\n\n }\n if($key === $url && $value[\"controller\"] === $controller && $value[\"method\"] === $methode ){\n Wrong::_404(\"route; DOUBLE ROUTING \");\n \n \n\n }\n \n \n }\n\n\n\n }", "function create_initial_rest_routes()\n {\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 }", "function endpoints() {\r\n\t\tadd_rewrite_endpoint( 'backers', EP_PERMALINK | EP_PAGES );\r\n\t}", "function ci_use_route(){\n\t\t$c_uri=$this->uri->segments;\n\t\t$c_ruri=$this->uri->rsegments;\n\n\t\t//--- we re-introduice the directori in RURI\n\t\tif($this->router->directory!=''){\n\t\t\tarray_unshift($c_ruri , trim($this->router->directory,'/'));\n\t\t\t$i = 1;\n\t\t\tforeach ($c_ruri as $val) $c_ruri[$i++] = $val;\n\t\t\tunset($c_ruri[0]);\n\t\t}\n\n\t\tif(count($c_uri) > count($c_ruri))return true;\n\t\t//--- Now if URI == RURI => there is no used route.\n\t\tif(count($c_uri) == count($c_ruri)) return (implode('/',$c_uri)==implode('/',$c_ruri))? false:true;\n\n\t\tfor($i=1;$i <= count($c_uri);$i++) {\n\t\t\tif($c_uri[$i]!=$c_ruri[$i]) return true;\n\t\t}\n\t\treturn false;\n\t}", "public function beforeLoadRoutes() {\n if ($this->beforeConfig) {\n $this->createRoutes($this->m->Routing->routes);\n $current = $this->m->Routing->route;\n if (is_array($current) and isset($current['priority'])) {\n if ($current['priority'] > $this->priority)\n return;\n }\n if ($this->checkPath($this->request->path)) {\n \n }\n }\n }", "protected function _loadRoutes()\n\t{\n\t\t$this->_routes['/^\\/login\\/?$/'] = '/account/login';\n\t}", "public function initializeRoutes()\n {\n $this->get(\"/\", \"index\");\n }", "public function testCanSendRoute()\n {\n $this->assertEmpty([]);\n\n $routes = $this->app->getRoutes();\n\n foreach ($routes as $route) {\n if ($route->getName() == 'api.oauth') {\n $this->assertContains('POST', $route->getAllowedMethods());\n $this->assertEquals('/api/oauth', $route->getPath());\n }\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 function afterLoadRoutes() {\n if (!$this->beforeConfig) {\n $this->createRoutes($this->m->Routing->routes);\n $current = $this->m->Routing->route;\n if (is_array($current) and isset($current['priority'])) {\n if ($current['priority'] > $this->priority)\n return;\n }\n if ($this->checkPath($this->request->path)) {\n \n }\n }\n }", "public function testRoutes()\n {\n foreach ($this->testRoutes as $method => $testRoutes) {\n switch ($method) {\n case 'GET':\n foreach ($testRoutes as $path => $param) {\n $response = $this->json($method, '/' . $path . $param);\n $response->assertJsonStructure(['error']);\n }\n break;\n case 'PUT':\n case 'POST':\n case 'DELETE':\n foreach ($testRoutes as $path => $params) {\n $response = $this->json($method, '/' . $path . $params['path_params'], $params['request_params']);\n dump($response->getContent());\n $response->assertJsonStructure(['message']);\n }\n break;\n }\n }\n }", "protected function detect_rest_item_route($post)\n {\n }", "private function route(): void\n {\n $url = $this->getUrlAsArray();\n $size = \\sizeof($url);\n $section = $this->section;\n\n for ($i = 0; $i < $size; $i++) {\n if ($i < ($size - 1)) {\n $section = $section->searchInSections($url[$i]);\n if ($section instanceof Section) {\n }\n } else {\n $route = $section->searchInRoutes($url[$i]);\n // TODO: Show view and use models\n if ($route instanceof Route) {\n\n }\n }\n }\n }", "public function testRouterAddByAddTwoRoutesOneHandler()\n {\n $router = new Router();\n\n $router->add([\"\", \"about\"], function () {\n return \"yes\";\n });\n\n $res = $router->handle(\"\");\n $this->assertEquals(\"yes\", $res);\n\n $last = $router->getLastRoute();\n $this->assertEquals(\"\", $last);\n\n $res = $router->handle(\"about\");\n $this->assertEquals(\"yes\", $res);\n\n $last = $router->getLastRoute();\n $this->assertEquals(\"about\", $last);\n\n $routes = $router->getAll();\n $this->assertEquals(2, count($routes));\n }", "public function testUriStrategyRouteReceivesCorrectArguments()\n {\n $collection = new Route\\RouteCollection;\n $collection->setStrategy(new UriStrategy);\n\n $collection->get('/route/{id}/{name}', function ($id, $name) {\n $this->assertEquals('2', $id);\n $this->assertEquals('phil', $name);\n });\n\n $dispatcher = $collection->getDispatcher();\n $response = $dispatcher->dispatch('GET', '/route/2/phil');\n }", "protected function loadBackendRoutes() {}", "public function testRouteContinuations() {\n\t\tRouter::connect('/{:locale:en|de|it|jp}/{:args}', [], ['continue' => true]);\n\t\tRouter::connect('/{:controller}/{:action}/{:id:[0-9]+}');\n\n\t\t$request = new Request(['url' => '/en/posts/view/1138']);\n\t\t$result = Router::process($request)->params;\n\t\t$expected = [\n\t\t\t'controller' => 'Posts', 'action' => 'view', 'id' => '1138', 'locale' => 'en'\n\t\t];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$request = new Request(['url' => '/en/foo/bar/baz']);\n\t\t$this->assertNull(Router::parse($request));\n\n\t\tRouter::reset();\n\t\tRouter::connect('/{:args}/{:locale:en|de|it|jp}', [], ['continue' => true]);\n\t\tRouter::connect('/{:controller}/{:action}/{:id:[0-9]+}');\n\n\t\t$request = new Request(['url' => '/posts/view/1138/en']);\n\t\t$result = Router::process($request)->params;\n\t\t$this->assertEqual($expected, $result);\n\n\t\tRouter::reset();\n\t\tRouter::connect('/{:locale:en|de|it|jp}/{:args}', [], ['continue' => true]);\n\t\tRouter::connect('/', 'Pages::view');\n\n\t\t$request = new Request(['url' => '/en']);\n\t\t$result = Router::process($request)->params;\n\t\t$expected = ['locale' => 'en', 'controller' => 'Pages', 'action' => 'view'];\n\t\t$this->assertEqual($expected, $result);\n\t}", "protected function mapWebRoutes()\n {\n $this->mapDefaultWebRoutes();\n\n $this->mapUnauthenticatedWebRoutes();\n\n $this->mapAuthenticatedWebRoutes();\n $this->mapAdminAuthenticatedWebRoutes();\n $this->mapClientAuthenticatedWebRoutes();\n\n $this->mapPaginationRoutes();\n $this->mapAdminPaginationRoutes();\n $this->mapClientPaginationRoutes();\n\n $this->mapAjaxRoutes();\n $this->mapAdminAjaxRoutes();\n $this->mapClientAjaxRoutes();\n }", "public function handled($rt = '')\n {\n $uriSegmentsInThisRoute = explode('/', $this->urlToMatch);\n $uriSegmentsInRequestedRoute = explode('/', $rt);\n\n if (count($uriSegmentsInRequestedRoute) == count($uriSegmentsInThisRoute)) {\n $thisUrlUpToFirstDollarSign = explode('/$',$this->urlToMatch)[0];\n $numberOfSegmentsUpToFirstDollarSign = count( explode('/',$thisUrlUpToFirstDollarSign) );\n $theyMatch = true;\n for( $i=0; $i<$numberOfSegmentsUpToFirstDollarSign; $i++ ) {\n if ( strcmp($uriSegmentsInThisRoute[$i],$uriSegmentsInRequestedRoute[$i]) <> 0 ) {\n $theyMatch = false;\n break;\n }\n }\n\n if ( $theyMatch ) {\n if ($this->processMiddleWare()==true) {\n // have to explode these two again, in case middleware changed anything\n $uriSegmentsInThisRoute = explode('/',$this->urlToMatch);\n $uriSegmentsInRequestedRoute = explode('/', $rt);\n $NumberOfParams = count(explode('$',$this->urlToMatch)) - 1;\n $params = array();\n for ($i = count($uriSegmentsInThisRoute) - $NumberOfParams; $i < count($uriSegmentsInThisRoute); $i++) {\n $params[] = $uriSegmentsInRequestedRoute[$i];\n }\n \\ipinga\\log::ipinga('Route {'. $this->identifier .'} ('. $this->urlToMatch. ') fired!');\n self::launchController($this->controller, $this->method, $params);\n $this->fired = true;\n return true;\n } else {\n \\ipinga\\log::ipinga('Route {'. $this->identifier .'} middcleware refused');\n }\n }\n\n }\n\n return false;\n\n }", "public function testTypeBasedRouting() {\n\t\tRouter::connect('/{:controller}/{:id:[0-9]+}', [\n\t\t\t'action' => 'index', 'type' => 'html', 'id' => null\n\t\t]);\n\t\tRouter::connect('/{:controller}/{:id:[0-9]+}.{:type}', [\n\t\t\t'action' => 'index', 'id' => null\n\t\t]);\n\n\t\tRouter::connect('/{:controller}/{:action}/{:id:[0-9]+}', [\n\t\t\t'type' => 'html', 'id' => null\n\t\t]);\n\t\tRouter::connect('/{:controller}/{:action}/{:id:[0-9]+}.{:type}', ['id' => null]);\n\n\t\t$url = Router::match(['controller' => 'posts', 'type' => 'html']);\n\t\t$this->assertIdentical('/posts', $url);\n\n\t\t$url = Router::match(['controller' => 'posts', 'type' => 'json']);\n\t\t$this->assertIdentical('/posts.json', $url);\n\t}", "public function checkingRoute()\n {\n\n global $route;\n $request = new Request;\n $requested_url = $request->server('QUERY_STRING');\n //!TEST\n // echo $requested_url;\n // echo '<br />';\n $requested_method = $request->server('REQUEST_METHOD');\n //! TEST\n // echo $requested_method;\n /* \n // $server_all = $request->serverAll();\n // echo '<pre>';\n // print_r($server_all);\n // echo '</pre>' ;\n // $route_object = new Route;\n */\n $all_routes = $route->getRoutingTable();\n\n // NOTE\n /*\n ! ezzay ana shayf Class Web and Route min 3'eer use key word \n ? routes/web.php & Core/Route.php\n */\n //!TEST\n // echo '<pre>';\n // print_r($all_routes);\n // echo '</pre>';\n\n foreach ($all_routes as $url => $info) {\n\n /* !//? to test $url returns\n echo '<pre>';\n print_r($url);\n echo '</pre>' ;\n */\n // // if ($requested_url == $url){\n if (preg_match($url,$requested_url , $matches )){\n if( $requested_method == strtolower($info['method'])) {\n $this->controller = $info['controller'];\n $this->action = $info['action'];\n $this->params = array_slice($matches , 1);\n return true ;\n }else{\n die(\"405 method does not exist\");\n }\n /* //!deprecated if statement (wrong else statement)\n // if ($requested_url != $single_route) {\n // die('404 url not found');\n // }\n // elseif ($requested_method != $info['method']) {\n // die('405 method not allowed');\n // }\n // else {\n // $this->controller = $info['controller'];\n // $this->method = $info['method'];\n // }\n */\n }\n // echo $this->controller;\n // echo '<br />';\n // echo $this->action ;\n // echo '<br />';\n }\n die(\"404 not found\");\n }", "private static function setupRoutes()\n {\n $container = self::$kernel->getContainer();\n $router = $container->get('router');\n self::$login_url = $router->generate('fos_user_security_login');\n }", "protected function _parse_routes()\n {\n $uri = implode('/', $this->uri->segments);\n\n // only for test\n // sometime js file has map file but not found in server\n if (ENVIRONMENT === 'development') {\n log_message('error', json_encode($uri));\n }\n\n // Get HTTP verb\n $http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n // Loop through the route array looking for wildcards\n foreach ($this->routes as $key => $val)\n {\n // Check if route format is using HTTP verbs\n if (is_array($val))\n {\n $val = array_change_key_case($val, CASE_LOWER);\n if (isset($val[$http_verb]))\n {\n $val = $val[$http_verb];\n }\n else\n {\n continue;\n }\n }\n\n // Convert wildcards to RegEx\n $key = str_replace(array(':any', ':num'), array('.+', '[0-9]+'), $key);\n\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri, $matches))\n {\n // Are we using callbacks to process back-references?\n if ( ! is_string($val) && is_callable($val))\n {\n // Remove the original string from the matches array.\n array_shift($matches);\n\n // Execute the callback using the values in matches as its parameters.\n $val = call_user_func_array($val, $matches);\n }\n // Are we using the default routing method for back-references?\n elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)\n {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request(array_values($this->uri->segments));\n }", "function routeByURI($uri) {\n\t\t\tstr_replace(API_ROOT, '', $uri);\n\t\t\t$querystring = '';\n\t\t\t\n\t\t\t$pathArray = explode('/', $uri);\n\t\t\t//Remove querystring\n\t\t\tif(strstr($pathArray[count($pathArray) - 1], '?') !== false) {\n\t\t\t\t$querystring = array_pop($pathArray);\n\t\t\t}\t\t\n\t\t\t\n\t\t\t//Remove trailing slash\n\t\t\tif($pathArray[count($pathArray) - 1] == '') {\n\t\t\t\tarray_pop($pathArray);\n\t\t\t}\n\n\t\t\t$idCount = 2;\n\n\t\t\t//Extract the numeric IDs, then generalise them for a search\n\t\t\t//FIXME: This means we can only accept numeric IDs. I don;t like this. HACK HACK HACK\n\t\t\tfor($n = 0; $n < count($pathArray); $n++) {\n\t\t\t\tif(is_numeric($pathArray[$n])) {\n\t\t\t\t\tif($idCount == 2) {\n\t\t\t\t\t\t$this->request[\"id\"] = $pathArray[$n];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->request[\"id\".$idCount] = $pathArray[$n];\n\t\t\t\t\t}\n\t\t\t\t\t$idCount++;\n\t\t\t\t\t\n\t\t\t\t\t$pathArray[$n] = ':id';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\n\t\t\t\n\t\t\t$modURI = implode('/', $pathArray);\n\t\t\t\n\t\t\t//This is wildly inefficient, but HACK HACK HACK\n\t\t\tforeach($this->routes[\"endpoints\"] as $endpoint) {\n\t\t\t\tif(($endpoint[\"uri\"] == $modURI) && (strtolower($_SERVER['REQUEST_METHOD']) == strtolower($endpoint[\"method\"]))) {\n\t\t\t\t\t//Then pass this on to the right controller\n\t\t\t\t\t$this->controller = $endpoint[\"controller\"];\n\t\t\t\t\t$this->action = $endpoint[\"action\"];\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "protected function _connectDefaultRoutes(): void\n {\n Router::scope('/', function (RouteBuilder $routes): void {\n $routes->fallbacks('InflectedRoute');\n });\n }", "public static function ignoreRoutes()\n {\n static::$registersRoutes = false;\n }", "private function _allowTestRoutes()\n {\n // [taz] See if the main config file is already loaded, so we can tell whether to remove testing routes.\n $mainConfig = Zend_Registry::getInstance()->get('CONFIG');\n \n // [taz] If $mainConfig isn't set, disallow test routes by default.\n if (!$mainConfig) {\n \treturn false;\n }\n \n // [taz] Return the setting of debug.allow_test_routes.\n return $mainConfig->debug->allow_test_routes; \n }", "protected function _parse_routes()\n {\n $uri = implode('/', $this->uri->segments);\n\n // Get HTTP verb\n $http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri])) {\n // Check default routes format\n if (is_string($this->routes[$uri])) {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n // Is there a matching http verb?\n elseif (is_array($this->routes[$uri]) && isset($this->routes[$uri][$http_verb])) {\n $this->_set_request(explode('/', $this->routes[$uri][$http_verb]));\n return;\n }\n }\n\n // decryption of module/controller/function name in admin\n if ($this->config->item('is_admin') == 1) {\n if ($this->config->item('ADMIN_URL_ENCRYPTION') == 'Y') {\n $uri_t = str_replace('admin/', '', $uri);\n if ($uri_t != \"\") {\n require_once(APPPATH . '/libraries/Ci_encrypt.php');\n $CI_Enc = new Ci_encrypt();\n $uri_t_decode = $CI_Enc->decrypt($uri_t, true);\n $CI_Enc->convertEncryptedVars();\n }\n $uri = 'admin/' . $uri_t_decode;\n }\n }\n // Loop through the route array looking for wildcards\n foreach ($this->routes as $key => $val) {\n // Check if route format is using http verb\n if (is_array($val)) {\n if (isset($val[$http_verb])) {\n $val = $val[$http_verb];\n } else {\n continue;\n }\n }\n\n // Convert wildcards to RegEx\n #$key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // Does the RegEx match?\n if (preg_match('#^' . $key . '$#', $uri, $matches)) {\n // Are we using callbacks to process back-references?\n if (!is_string($val) && is_callable($val)) {\n // Remove the original string from the matches array.\n array_shift($matches);\n\n // Execute the callback using the values in matches as its parameters.\n $val = call_user_func_array($val, $matches);\n }\n // Are we using the default routing method for back-references?\n elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE) {\n $val = preg_replace('#^' . $key . '$#', $val, $uri);\n }\n\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request(array_values($this->uri->segments));\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapACLRoutes(); \n //\n }", "public function fixHomeRedirect(){\n\n \t$check = $this->modx->getObject('modContextSetting',[\n 'key'=>'base_url',\n 'value:LIKE'=>'%'.$_GET[$this->modx->getOption('request_param_alias')].'%'\n ]);\n \n if($check){ //if new route is valid\n\n $siteStart = $this->modx->getObject('modContextSetting',[\n 'key' => 'site_start',\n 'context_key' => $check->get('context_key')\n ]);\n \n \n if($this->modx->getObject('modResource',$siteStart->get('value'))->get('published') == 1) \n $this->modx->sendRedirect($this->modx->makeUrl($siteStart->get('value')),['responseCode' => 'HTTP/1.1 301 Moved Permanently']);\n }\n }", "public static function routes(): void\n {\n //\n }", "public function testRouteMatchingWithInsertsAndDefaults() {\n\t\tRouter::connect('/{:controller}/{:action}', ['action' => 'archive']);\n\t\t$this->assertIdentical('/posts/index', Router::match(['controller' => 'posts']));\n\n\t\t$result = Router::match(['controller' => 'posts', 'action' => 'archive']);\n\t\t$this->assertIdentical('/posts', $result);\n\n\t\tRouter::reset();\n\t\tRouter::connect('/{:controller}/{:action}', ['controller' => 'users']);\n\n\t\t$result = Router::match(['action' => 'view']);\n\t\t$this->assertIdentical('/users/view', $result);\n\n\t\t$result = Router::match(['controller' => 'posts', 'action' => 'view']);\n\t\t$this->assertIdentical('/posts/view', $result);\n\n\t\t$ex = \"No parameter match found for URL \";\n\t\t$ex .= \"`('controller' => 'Posts', 'action' => 'view', 'id' => '2')`.\";\n\t\t$this->assertException($ex, function() {\n\t\t\tRouter::match(['controller' => 'posts', 'action' => 'view', 'id' => '2']);\n\t\t});\n\t}", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapFrontWebRoutes();\n $this->mapBackWebRoutes();\n //\n }", "public function test_route_canonicalized() {\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' ),\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// Check the route was registered correctly.\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_raw_endpoint_data();\n\t\t$this->assertArrayHasKey( '/test-ns/test', $endpoints );\n\n\t\t// Check the route was wrapped in an array.\n\t\t$endpoint = $endpoints['/test-ns/test'];\n\t\t$this->assertArrayNotHasKey( 'callback', $endpoint );\n\t\t$this->assertArrayHasKey( 'namespace', $endpoint );\n\t\t$this->assertSame( 'test-ns', $endpoint['namespace'] );\n\n\t\t// Grab the filtered data.\n\t\t$filtered_endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$this->assertArrayHasKey( '/test-ns/test', $filtered_endpoints );\n\t\t$endpoint = $filtered_endpoints['/test-ns/test'];\n\t\t$this->assertCount( 1, $endpoint );\n\t\t$this->assertArrayHasKey( 'callback', $endpoint[0] );\n\t\t$this->assertArrayHasKey( 'methods', $endpoint[0] );\n\t\t$this->assertArrayHasKey( 'args', $endpoint[0] );\n\t}", "public function route() {\n\t\t$route = $this->sets[':default']->route();\n\t\tif (!$route&&sizeof($this->route_extra)==0) return false;\n\t\tif (!$route) $route = new CMS_Navigation3_LinkSet();\n\t\t$n = $route->count();\n\t\tforeach($this->route_extra as $r) {\n\t\t\t$item = $r[1];\n\t\t\t$item['id'] = $n;\n\t\t\t$n++;\n\t\t\t$route->add($r[0],$item);\n\t\t}\t\n\t\treturn $route;\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 }", "abstract public function getRoute();", "public function initRoutes()\r\n {\r\n $route = new Route();\r\n\r\n $routesConf = include __DIR__ . '/../../config/routes.inc.php';\r\n\r\n foreach ($routesConf as $routeConf) {\r\n\r\n $uri = $routeConf['uri'];\r\n\r\n if (preg_match_all('/\\$(.*?(?=\\/)|.*?$)/', $routeConf['uri'], $matches)) {\r\n $uri = preg_replace('/\\$(.*?(?=\\/)|.*?$)/', '.*', $routeConf['uri']);\r\n }\r\n\r\n $route->add($uri, $routeConf, $matches[1], function($params) {\r\n $this->config->route = $params['config'];\r\n\r\n $args = [];\r\n if (isset($params['arguments'])) {\r\n $args = $params['arguments'];\r\n }\r\n\r\n $controller = new $params['config']['controller']($this->config, $this->db, $args);\r\n\r\n $controller->indexAction();\r\n });\r\n }\r\n\r\n $findUrl = $route->submit();\r\n\r\n if (!$findUrl) {\r\n header('HTTP/1.0 404 Not Found');\r\n include_once __DIR__ . '/../../../src/Views/errors/404_de.html';\r\n }\r\n }", "public function testRouteParamDefaults(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/cache/*', ['prefix' => false, 'plugin' => true, 'controller' => 0, 'action' => 1]);\n\n $url = Router::url(['prefix' => '0', 'plugin' => '1', 'controller' => '0', 'action' => '1', 'test']);\n $expected = '/cache/test';\n $this->assertSame($expected, $url);\n\n try {\n Router::url(['controller' => '0', 'action' => '1', 'test']);\n $this->fail('No exception raised');\n } catch (Exception $e) {\n $this->assertTrue(true, 'Exception was raised');\n }\n\n try {\n Router::url(['prefix' => '1', 'controller' => '0', 'action' => '1', 'test']);\n $this->fail('No exception raised');\n } catch (Exception $e) {\n $this->assertTrue(true, 'Exception was raised');\n }\n }", "public function mapRoutes()\n {\n Router::loadRouteFiles(\"web.php\");\n Router::loadRouteFiles('patients.php');\n }", "protected function registerRoutes() {\n\n $this->get('/crossword', 'getCrossword');\n $this->post('/crossword', 'saveUserState');\n //not used\n //$this->get('/crossword', 'getCrossword');\n //$this->get('/wordData', 'getWordData');\n //);\n }", "public function testRouteRetrieval() {\n\t\t$expected = Router::connect('/hello', ['controller' => 'posts', 'action' => 'index']);\n\t\t$result = Router::get(0, true);\n\t\t$this->assertIdentical($expected, $result);\n\n\t\tlist($result) = Router::get(null, true);\n\t\t$this->assertIdentical($expected, $result);\n\t}", "public function testRoutes()\n\t{\n\t\t$routes = new Routes();\n\n\t\t$result = $routes->process(array('test', 'test'));\n\n\t\t$this->assertEquals('test', $result);\n\t}", "function defineRoutes() {\n Router::map('homepage', '', array('controller' => DEFAULT_CONTROLLER, 'action' => DEFAULT_ACTION, 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('admin', 'admin', array('controller' => 'admin', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('public', 'public', array('controller' => 'public', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('wireframe_updates', 'wireframe-updates', array('controller' => 'backend', 'action' => 'wireframe_updates', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('menu_refresh_url', 'refresh-menu', array('controller' => 'backend', 'action' => 'refresh_menu', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('quick_add', 'quick-add', array('controller' => 'backend', 'action' => 'quick_add', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // API\n Router::map('info', 'info', array('controller' => 'api', 'action' => 'info', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Disk Space\n Router::map('disk_space_admin', 'admin/disk-space', array('controller' => 'disk_space_admin', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_usage', 'admin/disk-space/usage', array('controller' => 'disk_space_admin', 'action' => 'usage', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_admin_settings', 'admin/disk-space/settings', array('controller' => 'disk_space_admin', 'action' => 'settings', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_application_cache', 'admin/disk-space/tools/remove-application-cache', array('controller' => 'disk_space_admin', 'action' => 'remove_application_cache', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_logs', 'admin/disk-space/tools/remove-logs', array('controller' => 'disk_space_admin', 'action' => 'remove_logs', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_old_application_versions', 'admin/disk-space/tools/remove-old-application-versions', array('controller' => 'disk_space_admin', 'action' => 'remove_old_application_versions', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Appearance\n Router::map('appearance_admin', 'admin/appearance', array('controller' => 'appearance', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_add_scheme', 'admin/appearance/add-scheme', array('controller' => 'appearance', 'action' => 'add', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_edit_scheme', 'admin/appearance/:scheme_id/edit', array('controller' => 'appearance', 'action' => 'edit', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_rename_scheme', 'admin/appearance/:scheme_id/rename', array('controller' => 'appearance', 'action' => 'rename', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_delete_scheme', 'admin/appearance/:scheme_id/delete', array('controller' => 'appearance', 'action' => 'delete', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_set_as_default_scheme', 'admin/appearance/:scheme_id/set-as-default', array('controller' => 'appearance', 'action' => 'set_as_default', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Scheduled Tasks Admin\n Router::map('scheduled_tasks_admin', 'admin/scheduled-tasks', array('controller' => 'scheduled_tasks_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Network settings\n Router::map('network_settings', 'admin/network', array('controller' => 'network_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // Indices admin\n Router::map('indices_admin', 'admin/indices', array('controller' => 'indices_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('indices_admin_rebuild', 'admin/indices/rebuild', array('controller' => 'indices_admin', 'action' => 'rebuild', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('indices_admin_rebuild_finish', 'admin/indices/rebuild/finish', array('controller' => 'indices_admin', 'action' => 'rebuild_finish', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n Router::map('object_contexts_admin_rebuild', 'admin/indices/object-contexts/rebuild', array('controller' => 'object_contexts_admin', 'action' => 'rebuild', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('object_contexts_admin_clean', 'admin/indices/object-contexts/clean', array('controller' => 'object_contexts_admin', 'action' => 'clean', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // Scheduled tasks\n Router::map('frequently', 'frequently', array('controller' => 'scheduled_tasks', 'action' => 'frequently', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('hourly', 'hourly', array('controller' => 'scheduled_tasks', 'action' => 'hourly', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('daily', 'daily', array('controller' => 'scheduled_tasks', 'action' => 'daily', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // trash related\n Router::map('trash', 'trash', array('controller' => 'trash', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('trash_section', 'trash/:section_name', array('controller' => 'trash', 'action' => 'section', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('trash_empty', 'trash/empty', array('controller' => 'trash', 'action' => 'empty_trash', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('object_untrash', 'trash/untrash-object', array('controller' => 'trash', 'action' => 'untrash_object', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO), array('object_id' => Router::MATCH_ID));\n Router::map('object_delete', 'trash/delete-object', array('controller' => 'trash', 'action' => 'delete_object', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO), array('object_id' => Router::MATCH_ID));\n\n // Control Tower\n Router::map('control_tower', 'control-tower', array('controller' => 'control_tower', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_empty_cache', 'control-tower/empty-cache', array('controller' => 'control_tower', 'action' => 'empty_cache', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_delete_compiled_templates', 'control-tower/delete-compiled-templates', array('controller' => 'control_tower', 'action' => 'delete_compiled_templates', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_rebuild_images', 'control-tower/rebuild-images', array('controller' => 'control_tower', 'action' => 'rebuild_images', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_rebuild_localization', 'control-tower/rebuild-localization', array('controller' => 'control_tower', 'action' => 'rebuild_localization', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('control_tower_settings', 'admin/control-tower', array('controller' => 'control_tower', 'action' => 'settings', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n\t // Firewall\n\t Router::map('firewall', 'admin/firewall', array('controller' => 'firewall', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n }", "public function testTypeRoute()\n {\n $response = $this->get('/type/view/2');\n $response->assertStatus(302);\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}", "private function route() {\n\n// if (!in_array($_GET['page'], $pages)) {\n// echo \"bad\";\n// exit;\n// }\n\n if (!empty($_GET['page']) && file_exists( __ROOT__.'controller/'.$_GET['page'].'.php')) {\n include __ROOT__.'controller/'.$_GET['page'].'.php';\n } else {\n include __ROOT__.'controller/home.php';\n }\n include __ROOT__.'public/footer.html';\n }", "protected function setUpRoutes()\n {\n parent::setUpRoutes();\n $this->setRoutes([\n 'createInvitationLink' => 'private/product-reviews/business-units/{businessUnitId}/invitation-links?token={token}',\n 'findPrivate' => 'private/product-reviews/business-units/{businessUnitId}/reviews?token={token}'\n ]);\n }", "public function testStackedContinuationRoutes() {\n\t\tRouter::connect('/admin/{:args}', ['admin' => true], ['continue' => true]);\n\t\tRouter::connect('/{:locale:en|de|it|jp}/{:args}', [], ['continue' => true]);\n\t\tRouter::connect('/{:controller}/{:action}/{:id:[0-9]+}', ['id' => null]);\n\n\t\t$request = new Request(['url' => '/en/foo/bar/5']);\n\t\t$expected = ['controller' => 'Foo', 'action' => 'bar', 'id' => '5', 'locale' => 'en'];\n\t\t$this->assertEqual($expected, Router::process($request)->params);\n\n\t\t$request = new Request(['url' => '/admin/foo/bar/5']);\n\t\t$expected = ['controller' => 'Foo', 'action' => 'bar', 'id' => '5', 'admin' => true];\n\t\t$this->assertEqual($expected, Router::process($request)->params);\n\n\t\t$request = new Request(['url' => '/admin/de/foo/bar/5']);\n\t\t$expected = [\n\t\t\t'controller' => 'Foo', 'action' => 'bar', 'id' => '5', 'locale' => 'de', 'admin' => true\n\t\t];\n\t\t$this->assertEqual($expected, Router::process($request)->params);\n\n\t\t$request = new Request(['url' => '/en/admin/foo/bar/5']);\n\t\t$this->assertEmpty(Router::process($request)->params);\n\n\t\t$result = Router::match(['Foo::bar', 'id' => 5]);\n\t\t$this->assertIdentical('/foo/bar/5', $result);\n\n\t\t$result = Router::match(['Foo::bar', 'id' => 5, 'admin' => true]);\n\t\t$this->assertIdentical('/admin/foo/bar/5', $result);\n\n\t\t$result = Router::match(['Foo::bar', 'id' => 5, 'admin' => true, 'locale' => 'jp']);\n\t\t$this->assertIdentical('/admin/jp/foo/bar/5', $result);\n\t}", "public function setUpRoutes()\n {\n Route::group(['middleware' => AddCustomProvider::class], function () {\n Passport::routes(function ($router) {\n return $router->forAccessTokens();\n });\n });\n\n Route::middleware('auth:api')->get('/user', function (Request $request) {\n return $request->user();\n });\n\n Route::middleware('auth:company')->get('/company', function (Request $request) {\n return $request->user();\n });\n\n Route::middleware('auth:api,company')->get('/users', function (Request $request) {\n return [\n $request->user('api'),\n $request->user('company'),\n $request->user(),\n Auth::user(),\n Auth::guard('api')->user(),\n Auth::guard('company')->user(),\n Auth::check(),\n Auth::id(),\n ];\n });\n\n Route::middleware('auth:api')->get('/just_user', function (Request $request) {\n return [\n $request->user('api'),\n $request->user('company'),\n $request->user(),\n Auth::user(),\n Auth::guard('api')->user(),\n Auth::guard('company')->user(),\n Auth::check(),\n Auth::id(),\n ];\n });\n\n Route::middleware('auth:company')->get('/just_company', function (Request $request) {\n return [\n $request->user('api'),\n $request->user('company'),\n $request->user(),\n Auth::user(),\n Auth::guard('api')->user(),\n Auth::guard('company')->user(),\n Auth::check(),\n Auth::id(),\n ];\n });\n\n Route::middleware('auth')->get('/no_guards', function (Request $request) {\n return $request->user();\n });\n }", "function rest_theme_routes() {\n $routes = array();\n\n $query = new WP_Query( array(\n 'post_type' => 'any',\n 'post_status' => 'publish',\n 'posts_per_page' => -1,\n ) );\n\n if ( $query->have_posts() ) {\n while ( $query->have_posts() ) {\n $query->the_post();\n $routes[] = array(\n 'id' => get_the_ID(),\n 'type' => get_post_type(),\n 'slug' => basename( get_permalink() ),\n 'link' => str_replace( site_url(), '', get_permalink() ),\n 'template' => get_page_template_slug()\n );\n }\n }\n\n wp_reset_postdata();\n\n return $routes;\n}", "public function registerCpSiteRoutes()\n\t{\n\t\treturn array();\n\t}", "public function isActiveRoute();", "protected function _initRoutes()\n {\n $front = Zend_Controller_Front::getInstance();\n $router = $front->getRouter();\n\n $route = new Zend_Controller_Router_Route('login/:provider',\n array(\n 'controller' => 'user',\n 'action' => 'login'\n ));\n $router->addRoute('login/:provider', $route);\n\n $route = new Zend_Controller_Router_Route_Static('login',\n array(\n 'controller' => 'user',\n 'action' => 'login'\n ));\n $router->addRoute('login', $route);\n\n $route = new Zend_Controller_Router_Route_Static('logout',\n array(\n 'controller' => 'user',\n 'action' => 'logout'\n ));\n $router->addRoute('logout', $route);\n }", "public function map()\n {\n //wap端路由为了防止和web端路由冲突一定要放到前面\n $this->mapWapRoutes();\n //web端路由\n $this->mapWebRoutes();\n //api路由\n $this->mapApiRoutes();\n //Backend路由\n $this->mapBackendRoutes();\n }", "public function register_routes() {\n\n\t\t\\add_filter( 'do_parse_request', array( $this, 'handle_routing' ) );\n\n\t}", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function isOnRoute(): bool\n {\n $lang = $this->grav['language']->getActive();\n\n $path = $this->grav['uri']->rootUrl() ?: '/';\n $routes = $this->config->get('plugins.' . $this->name . '.routes');\n\n foreach ($routes as $route) {\n ['blog' => $blog, 'items' => $items] = $route;\n if ($path === $blog || str_starts_with($path, $items)) {\n if ($lang) {\n $route['blog'] = '/' . $lang . $route['blog'];\n $route['items'] = '/' . $lang . $route['items'];\n }\n $this->routes = $route;\n\n return true;\n }\n }\n\n return false;\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}", "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 }", "public function testGetRoutes()\n {\n $this->disableExceptionHandling();\n\n $this->visit(route('voyager.login'));\n $this->type('[email protected]', 'email');\n $this->type('password', 'password');\n $this->press(__('voyager::generic.login'));\n\n $urls = [\n route('voyager.dashboard'),\n route('voyager.media.index'),\n route('voyager.settings.index'),\n route('voyager.roles.index'),\n route('voyager.roles.create'),\n route('voyager.roles.show', 1),\n route('voyager.roles.edit', 1),\n route('voyager.users.index'),\n route('voyager.users.create'),\n route('voyager.users.show', 1),\n route('voyager.users.edit', 1),\n route('voyager.posts.index'),\n route('voyager.posts.create'),\n route('voyager.posts.show', 1),\n route('voyager.posts.edit', 1),\n route('voyager.pages.index'),\n route('voyager.pages.create'),\n route('voyager.pages.show', 1),\n route('voyager.pages.edit', 1),\n route('voyager.categories.index'),\n route('voyager.categories.create'),\n route('voyager.categories.show', 1),\n route('voyager.categories.edit', 1),\n route('voyager.menus.index'),\n route('voyager.menus.create'),\n route('voyager.menus.show', 1),\n route('voyager.menus.edit', 1),\n route('voyager.database.index'),\n route('voyager.bread.edit', 'categories'),\n route('voyager.database.edit', 'categories'),\n route('voyager.database.create'),\n ];\n\n foreach ($urls as $url) {\n $response = $this->call('GET', $url);\n $this->assertEquals(200, $response->status(), $url.' did not return a 200');\n }\n }", "protected function loadRoute()\n {\n $this->post('/task', 'task.controller:saveAction');\n\n // Url for update task\n $this->put('/task/{id}', 'task.controller:updateAction');\n\n // Url for see one task\n $this->get('/task/{id}', 'task.controller:getAction');\n\n // Url for delete task\n $this->delete('/task/{id}', 'task.controller:deleteAction');\n\n // Url for list of tasks\n $this->get('/task', 'task.controller:listAction');\n\n //Get Tag list\n $this->get('/tags', 'tag.controller:listAction');\n\n //Add tag to task\n $this->post('/addTag', 'tag.controller:setTagAction');\n\n //Add tag to tag list\n $this->post('/tag', 'tag.controller:saveAction');\n\n //Search by tag\n $this->get('/search/tag', 'tag.controller:searchAction'); \n\n // Url for delete tag in tag list\n $this->delete('/tag', 'tag.controller:deleteAction');\n \n // Url for auth github\n $this->post('/github', 'github.controller:authAction'); \n }", "public static function isRouteValid() {\r\n global $Routes;\r\n $uri = $_SERVER['REQUEST_URI'];\r\n\r\n if (!in_array(explode('?',$uri)[0], $Routes)) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n }", "public static function validRoutes(){\n $routes = self::$urled;\n $urlroute = $_GET['url'];\n $response1 = 0;\n\n\n foreach ($routes as $route) {\n if($urlroute == $route){\n $response1 += 1;\n }\n }\n if($response1 == 0){\n $response = ['error'=>'404 - not valid url'];\n echo json_encode($response);\n\n }\n }", "public function map()\n {\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n $this->mapAdminRoutes();\n //\n }", "public static function isRouteValid()\n {\n global $Routes;\n $uri = $_SERVER['REQUEST_URI'];\n if (!in_array(explode('?', $uri)[0], $Routes, true)) {\n return 0;\n } else {\n return 1;\n }\n }", "public static function preRouter(){\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 register_routes()\n {\n }", "public function register_routes()\n {\n }" ]
[ "0.7204182", "0.6919818", "0.6698115", "0.6589368", "0.6526395", "0.63424766", "0.6289119", "0.618975", "0.6177964", "0.6166853", "0.6137895", "0.6047036", "0.6030814", "0.5938619", "0.59225214", "0.5891399", "0.586563", "0.58331573", "0.58331037", "0.58169955", "0.5803621", "0.5801889", "0.5770774", "0.57635015", "0.57522905", "0.5742939", "0.57123315", "0.57060546", "0.56945467", "0.5694277", "0.5686625", "0.5677678", "0.56694937", "0.5667297", "0.56656975", "0.5658831", "0.5658465", "0.56553286", "0.56481326", "0.56447786", "0.56447583", "0.5644209", "0.5640221", "0.56358796", "0.5624782", "0.5617804", "0.56125975", "0.560865", "0.56005883", "0.5596859", "0.55943394", "0.5593381", "0.55931497", "0.5586054", "0.5585602", "0.5584118", "0.55618685", "0.5551558", "0.55242425", "0.5522086", "0.55213195", "0.5520537", "0.5505994", "0.5504518", "0.5501256", "0.5498546", "0.5490624", "0.5489877", "0.54821026", "0.5478742", "0.5475369", "0.54715693", "0.5470003", "0.54622215", "0.5461913", "0.5457555", "0.54543215", "0.54502535", "0.54499215", "0.5436704", "0.5434106", "0.54313296", "0.54312533", "0.5430161", "0.542538", "0.54242635", "0.54195726", "0.5416727", "0.5415749", "0.5411146", "0.5407783", "0.5405409", "0.54042155", "0.53973186", "0.53945506", "0.5391771", "0.5374052", "0.5373456", "0.5371387", "0.5371387" ]
0.7643486
0
Test all legacy routes These are old mrcore4 routes like /topic/1 or /files/1
public function testLegacyRoutes() { /*//Filters disabled during unit tests unless you enable them //I need them enabled because they log the user in as anonymous Route::enableFilters(); // Test /topic/1 redirects to /home $this->call('GET', '/topic/1'); $this->assertRedirectedTo('/home'); $this->call('GET', '/topic/1/doesnt/matter'); $this->assertRedirectedTo('/home'); // ?? files/1 does not currently redirect // not sure if it should or not yet */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testOtherRoutes()\n\t{\n\t\t/*//Filters disabled during unit tests unless you enable them\n\t\t//I need them enabled because they log the user in as anonymous\n\t\tRoute::enableFilters();\n\n\t\t// /google redirects to http://google.com\n\t\t$clicksBefore = Router::where('slug', '=', 'google')->first()->clicks;\n\t\t$this->call('GET', '/google');\n\t\t$this->assertRedirectedTo('http://google.com');\n\t\t$clicksAfter = Router::where('slug', '=', 'google')->first()->clicks;\n\t\t$this->assertEquals(++$clicksBefore, $clicksAfter);\n\n\t\t// /google2 is a disabled route\n\t\t$this->call('GET', '/google2');\n\t\t$this->assertResponseStatus(404);\n\n\t\t$this->call('GET', '/99/invalid');\n\t\t$this->assertResponseStatus(404);\n\n\t\t$this->call('GET', '/this/is/invalid');\n\t\t$this->assertResponseStatus(404);\n\t\t\n\n\t\t// Test search route\n\t\t// ??\n\n\t\t// Test net route\n\t\t// ??\n\n\t\t// Test login route\n\t\t$this->call('GET', '/login');\n\t\t$this->assertResponseOk();\n\n\t\t// Test logout route redirects to /\n\t\t$this->call('GET', '/logout');\n\t\t$this->assertRedirectedTo('/');\n\t\t*/\n\n\t}", "public function test_route_override() {\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' ),\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t'should_exist' => false,\n\t\t\t)\n\t\t);\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( 'POST' ),\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t'should_exist' => true,\n\t\t\t),\n\t\t\ttrue\n\t\t);\n\n\t\t// Check we only have one route.\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$endpoint = $endpoints['/test-ns/test'];\n\t\t$this->assertCount( 1, $endpoint );\n\n\t\t// Check it's the right one.\n\t\t$this->assertArrayHasKey( 'should_exist', $endpoint[0] );\n\t\t$this->assertTrue( $endpoint[0]['should_exist'] );\n\t}", "public function testUrlCatchAllRoute(): void\n {\n Router::createRouteBuilder('/')\n ->connect('/*', ['controller' => 'Categories', 'action' => 'index']);\n $result = Router::url(['controller' => 'Categories', 'action' => 'index', '0']);\n $this->assertSame('/0', $result);\n\n $expected = [\n 'plugin' => null,\n 'controller' => 'Categories',\n 'action' => 'index',\n 'pass' => ['0'],\n '_matchedRoute' => '/*',\n ];\n $result = Router::parseRequest($this->makeRequest('/0', 'GET'));\n unset($result['_route']);\n $this->assertEquals($expected, $result);\n\n $result = Router::parseRequest($this->makeRequest('0', 'GET'));\n unset($result['_route']);\n $this->assertEquals($expected, $result);\n }", "public function testBasicRouteMatching() {\n\t\tRouter::connect('/hello', ['controller' => 'Posts', 'action' => 'index']);\n\t\t$expected = ['controller' => 'Posts', 'action' => 'index'];\n\n\t\tforeach (['/hello/', '/hello', 'hello/', 'hello'] as $url) {\n\t\t\t$this->request->url = $url;\n\t\t\t$result = Router::parse($this->request);\n\t\t\t$this->assertEqual($expected, $result->params);\n\t\t\t$this->assertEqual(['controller'], $result->persist);\n\t\t}\n\t}", "public function testPrimaryRoutes()\n\t{\n\t/*\t//Filters disabled during unit tests unless you enable them\n\t\t//I need them enabled because they log the user in as anonymous\n\t\tRoute::enableFilters();\n\n\t\t// Test base route\n\t\t// Should show post id 1\n\t\t$response = $this->call('GET', '/');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(1, $post->id);\n\t\t$this->assertEquals('9d3e171a-62a9-e958-bdfa-d6f224ca8cad', $post->uuid);\n\n\t\t// Test /home is post 1\n\t\t$clicksBefore = Router::where('slug', '=', 'home')->first()->clicks;\n\t\t$response = $this->call('GET', '/home');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(1, $post->id);\n\t\t$this->assertEquals('9d3e171a-62a9-e958-bdfa-d6f224ca8cad', $post->uuid);\n\t\t$clicksAfter = Router::where('slug', '=', 'home')->first()->clicks;\n\t\t$this->assertEquals(++$clicksBefore, $clicksAfter);\n\n\t\t// Test /about is post 2\n\t\t$response = $this->call('GET', '/about');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(2, $post->id);\n\t\t$this->assertEquals('f1112648-782e-aad3-785d-640fcfefaa9b', $post->uuid);\n\n\n\t\t// ##### Login as mReschke #####\n\t\tAuth::login(User::find(2)); Auth::user()->login();\n\n\t\t// Test /13/mreschke-home-page (non named route)\n\t\t$response = $this->call('GET', '/13/mreschke-home-page');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(13, $post->id);\n\t\t$this->assertEquals('1a52e0e3-3174-7b2b-a582-03a39e52e34a', $post->uuid);\n\n\t\t// Test /14/squaethem-home-page (non named route)\n\t\t$response = $this->call('GET', '/14/squaethem-home-page');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(14, $post->id);\n\t\t$this->assertEquals('e80e907e-50d4-8ed4-70f7-5d1815672966', $post->uuid);\n\t\t*/\n\n\t}", "public function testRoutes()\n {\n foreach ($this->testRoutes as $method => $testRoutes) {\n switch ($method) {\n case 'GET':\n foreach ($testRoutes as $path => $param) {\n $response = $this->json($method, '/' . $path . $param);\n $response->assertJsonStructure(['error']);\n }\n break;\n case 'PUT':\n case 'POST':\n case 'DELETE':\n foreach ($testRoutes as $path => $params) {\n $response = $this->json($method, '/' . $path . $params['path_params'], $params['request_params']);\n dump($response->getContent());\n $response->assertJsonStructure(['message']);\n }\n break;\n }\n }\n }", "public function testSecondaryRoutes()\n\t{\n\t\t/*//Filters disabled during unit tests unless you enable them\n\t\t//I need them enabled because they log the user in as anonymous\n\t\tRoute::enableFilters();\n\n\t\t// Test /1 redirects to /home\n\t\t$this->call('GET', '/1');\n\t\t$this->assertRedirectedTo('/home');\n\n\t\t// Test /1/anything/here redirects to /home\n\t\t$this->call('GET', '/1/anything/here');\n\t\t$this->assertRedirectedTo('/home');\n\n\t\t// Test /1 redirects to /home\n\t\t$this->call('GET', '/post/1');\n\t\t$this->assertRedirectedTo('/home');\n\n\t\t// Test /9d3e171a-62a9-e958-bdfa-d6f224ca8cad redirects to /home\n\t\t$this->call('GET', '/9d3e171a-62a9-e958-bdfa-d6f224ca8cad');\n\t\t$this->assertRedirectedTo('/home');\n\n\t\t// Test /home2 is post 1 (this is an optional route to post 1)\n\t\t// /home2 displays post 1, it does not redirect to /home\n\t\t$clicksBefore = Router::where('slug', '=', 'home2')->first()->clicks;\n\t\t$response = $this->call('GET', '/home2');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(1, $post->id);\n\t\t$this->assertEquals('9d3e171a-62a9-e958-bdfa-d6f224ca8cad', $post->uuid);\n\t\t$clicksAfter = Router::where('slug', '=', 'home2')->first()->clicks;\n\t\t$this->assertEquals(++$clicksBefore, $clicksAfter);\n\n\n\t\t// Test /home3 which is a disabled route\n\t\t$this->call('GET', '/home3');\n\t\t$this->assertResponseStatus(404);\n\n\n\t\t// ##### Login as mReschke #####\n\t\tAuth::login(User::find(2)); Auth::user()->login();\n\n\t\t// Test /13/blah redirects to /13/mreschke-home-page\n\t\t$this->call('GET', '/13/blah');\n\t\t$this->assertRedirectedTo('/13/mreschke-home-page');\n\n\t\t// Test /13 and /13/ redirects to /13/mreschke-home-page\n\t\t$this->call('GET', '/13');\n\t\t$this->assertRedirectedTo('/13/mreschke-home-page');\n\t\t$this->call('GET', '/13/');\n\t\t$this->assertRedirectedTo('/13/mreschke-home-page');\n\n\t\t// Test /13 redirects to /13/mreschke-home-page\n\t\t$this->call('GET', '/post/13');\n\t\t$this->assertRedirectedTo('/13/mreschke-home-page');\n\t\t*/\n\n\t}", "public function testSimpleRoutes() {\n\t\t$rules = array(\n\t\t\t'Index/Index' => '/',\n\t\t\t'Index/Simple' => '/test/simple',\n\t\t\t'Index/Language' => '/test/en',\n\t\t\t'Index/WithoutSlash' => '/test'\n\t\t);\n\n\t\t$controller = null;\n\t\t$action = null;\n\n\t\tforeach ($this->languages as $language) {\n\t\t\tforeach ($rules as $controllerAction => $uri) {\n\t\t\t\t$route = $this->getRouter('/' . $language . $uri, $rules)->getRoute($controller, $action);\n\n\t\t\t\t$this->assertEquals($controllerAction, $route, 'The route for an empty request does not match');\n\t\t\t\t$this->assertEquals($route, $controller . '/' . $action,\n\t\t\t\t\t'The outgoing parameters do not match the returned route');\n\t\t\t}\n\t\t}\n\t}", "public function test_route_canonicalized_multiple() {\n\t\tregister_rest_route(\n\t\t\t'test-ns',\n\t\t\t'/test',\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => array( 'GET' ),\n\t\t\t\t\t'callback' => '__return_null',\n\t\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => array( 'POST' ),\n\t\t\t\t\t'callback' => '__return_null',\n\t\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t// Check the route was registered correctly.\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_raw_endpoint_data();\n\t\t$this->assertArrayHasKey( '/test-ns/test', $endpoints );\n\n\t\t// Check the route was wrapped in an array.\n\t\t$endpoint = $endpoints['/test-ns/test'];\n\t\t$this->assertArrayNotHasKey( 'callback', $endpoint );\n\t\t$this->assertArrayHasKey( 'namespace', $endpoint );\n\t\t$this->assertSame( 'test-ns', $endpoint['namespace'] );\n\n\t\t$filtered_endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$endpoint = $filtered_endpoints['/test-ns/test'];\n\t\t$this->assertCount( 2, $endpoint );\n\n\t\t// Check for both methods.\n\t\tforeach ( array( 0, 1 ) as $key ) {\n\t\t\t$this->assertArrayHasKey( 'callback', $endpoint[ $key ] );\n\t\t\t$this->assertArrayHasKey( 'methods', $endpoint[ $key ] );\n\t\t\t$this->assertArrayHasKey( 'args', $endpoint[ $key ] );\n\t\t}\n\t}", "private function uri_reroute()\n {\n $match = false;\n\n $uri = parse_url($_SERVER['REQUEST_URI']);\n if (isset($uri['path']) && $uri['path'] !== \"/\") {\n $_ = preg_split(\"|/|\", $uri['path'], -1, PREG_SPLIT_NO_EMPTY);\n\n $i = 0;\n $route = null;\n $router = null;\n // while ($match === false) {\n // $path = $_[$i];\n\n // if (isset($this->configuration['ROUTES']['/' . $path])) {\n // $match = true;\n // $route = \"/$path\";\n // $router = $this->configuration['ROUTES']['/' . $path];\n // $this->route_map = $route;\n // }\n\n // if (isset($this->configuration['ROUTES'][$path])) {\n // $match = true;\n // $route = \"$path\";\n // $router = $this->configuration['ROUTES'][$path];\n // $this->route_map = $route;\n // }\n\n // ++$i;\n // }\n\n // unset($_);\n // unset($i);\n // unset($uri);\n // unset($path);\n\n if (isset($_) && is_array($_) && count($_) > 0) {\n $path = \"\";\n foreach ($_ as $k => $v) {\n $path .= \"/\" . $v;\n\n if (isset($this->configuration['ROUTES'][$path])) {\n $match = true;\n $route = \"$path\";\n $router = $this->configuration['ROUTES'][$path];\n $this->route_map = $route;\n\n // if(is_array($router['params'])){\n\n // }elseif($router['params'] == \"*\"){\n // break;\n // }\n\n break;\n }\n }\n }\n\n if (isset($router['controller'])) {\n $this->controller = $router['controller'];\n } else {\n $this->controller = \"main\";\n }\n\n if (isset($router['method'])) {\n $this->method = $router['method'];\n } else {\n $this->method = \"index\";\n }\n\n if (isset($router['action']) && isset($this->http)) {\n if (trim(strtolower($router['action'])) != strtolower($this->http->action)) {\n $this->http->http_error(403);\n }\n }\n \n if (isset($router['type']) && isset($router['type'])){\n if (trim(strtolower($router['type'])) == \"json\" && $this->http->type != \"json\"){\n $this->http->http_error(406, \"Form \" . $this->http->action . \" data is not json\");\n }\n }\n\n if (isset($router['params'])) {\n if (is_array($router['params'])) {\n $uri = preg_split(\"|/|\", str_replace($route, \"\", $_SERVER['REQUEST_URI']), -1, PREG_SPLIT_NO_EMPTY);\n\n if (is_array($router['params'])) {\n $_ = $router['params'];\n unset($router['params']);\n\n $router['params'][] = $_;\n unset($_);\n }\n\n $nums_params = count($router['params'][0]);\n\n if ($nums_params > 0) {\n foreach ($router['params'][0] as $k => $v) {\n $this->params[$v] = trim(urldecode($uri[$k]));\n }\n }\n\n $i = 0;\n $x = 0;\n while ($nums_params < $i) {\n if (isset($uri[$x]) && is_value($uri[$x])) {\n $this->params[$router['params'][$i]] = trim(urldecode($uri[$x]));\n ++$i;\n }\n ++$x;\n }\n\n } elseif ($router['params'] != \"*\") {\n return $this->http->http_error(404);\n }\n } else {\n $uri = preg_split(\"|/|\", str_replace($route, \"\", $_SERVER['REQUEST_URI']), -1, PREG_SPLIT_NO_EMPTY);\n\n if (count($uri) > 0) {\n return $this->http->http_error(404);\n }\n }\n\n unset($uri);\n unset($i);\n unset($x);\n unset($route);\n unset($router);\n }\n\n return $match;\n }", "public function testGetRoutes()\n {\n $this->disableExceptionHandling();\n\n $this->visit(route('voyager.login'));\n $this->type('[email protected]', 'email');\n $this->type('password', 'password');\n $this->press(__('voyager::generic.login'));\n\n $urls = [\n route('voyager.dashboard'),\n route('voyager.media.index'),\n route('voyager.settings.index'),\n route('voyager.roles.index'),\n route('voyager.roles.create'),\n route('voyager.roles.show', 1),\n route('voyager.roles.edit', 1),\n route('voyager.users.index'),\n route('voyager.users.create'),\n route('voyager.users.show', 1),\n route('voyager.users.edit', 1),\n route('voyager.posts.index'),\n route('voyager.posts.create'),\n route('voyager.posts.show', 1),\n route('voyager.posts.edit', 1),\n route('voyager.pages.index'),\n route('voyager.pages.create'),\n route('voyager.pages.show', 1),\n route('voyager.pages.edit', 1),\n route('voyager.categories.index'),\n route('voyager.categories.create'),\n route('voyager.categories.show', 1),\n route('voyager.categories.edit', 1),\n route('voyager.menus.index'),\n route('voyager.menus.create'),\n route('voyager.menus.show', 1),\n route('voyager.menus.edit', 1),\n route('voyager.database.index'),\n route('voyager.bread.edit', 'categories'),\n route('voyager.database.edit', 'categories'),\n route('voyager.database.create'),\n ];\n\n foreach ($urls as $url) {\n $response = $this->call('GET', $url);\n $this->assertEquals(200, $response->status(), $url.' did not return a 200');\n }\n }", "public function test_route_merge() {\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' ),\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\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( '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// Check both routes exist.\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$endpoint = $endpoints['/test-ns/test'];\n\t\t$this->assertCount( 2, $endpoint );\n\t}", "public function checkingRoute()\n {\n\n global $route;\n $request = new Request;\n $requested_url = $request->server('QUERY_STRING');\n //!TEST\n // echo $requested_url;\n // echo '<br />';\n $requested_method = $request->server('REQUEST_METHOD');\n //! TEST\n // echo $requested_method;\n /* \n // $server_all = $request->serverAll();\n // echo '<pre>';\n // print_r($server_all);\n // echo '</pre>' ;\n // $route_object = new Route;\n */\n $all_routes = $route->getRoutingTable();\n\n // NOTE\n /*\n ! ezzay ana shayf Class Web and Route min 3'eer use key word \n ? routes/web.php & Core/Route.php\n */\n //!TEST\n // echo '<pre>';\n // print_r($all_routes);\n // echo '</pre>';\n\n foreach ($all_routes as $url => $info) {\n\n /* !//? to test $url returns\n echo '<pre>';\n print_r($url);\n echo '</pre>' ;\n */\n // // if ($requested_url == $url){\n if (preg_match($url,$requested_url , $matches )){\n if( $requested_method == strtolower($info['method'])) {\n $this->controller = $info['controller'];\n $this->action = $info['action'];\n $this->params = array_slice($matches , 1);\n return true ;\n }else{\n die(\"405 method does not exist\");\n }\n /* //!deprecated if statement (wrong else statement)\n // if ($requested_url != $single_route) {\n // die('404 url not found');\n // }\n // elseif ($requested_method != $info['method']) {\n // die('405 method not allowed');\n // }\n // else {\n // $this->controller = $info['controller'];\n // $this->method = $info['method'];\n // }\n */\n }\n // echo $this->controller;\n // echo '<br />';\n // echo $this->action ;\n // echo '<br />';\n }\n die(\"404 not found\");\n }", "public function testFindAllByRoute()\n {\n $this->markTestIncomplete('WebTestCases are not implemented yet.');\n }", "public function testRoutes()\n\t{\n\t\t$routes = new Routes();\n\n\t\t$result = $routes->process(array('test', 'test'));\n\n\t\t$this->assertEquals('test', $result);\n\t}", "protected function _parse_routes()\n {\n $uri = implode('/', $this->uri->segments);\n\n // Get HTTP verb\n $http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri])) {\n // Check default routes format\n if (is_string($this->routes[$uri])) {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n // Is there a matching http verb?\n elseif (is_array($this->routes[$uri]) && isset($this->routes[$uri][$http_verb])) {\n $this->_set_request(explode('/', $this->routes[$uri][$http_verb]));\n return;\n }\n }\n\n // decryption of module/controller/function name in admin\n if ($this->config->item('is_admin') == 1) {\n if ($this->config->item('ADMIN_URL_ENCRYPTION') == 'Y') {\n $uri_t = str_replace('admin/', '', $uri);\n if ($uri_t != \"\") {\n require_once(APPPATH . '/libraries/Ci_encrypt.php');\n $CI_Enc = new Ci_encrypt();\n $uri_t_decode = $CI_Enc->decrypt($uri_t, true);\n $CI_Enc->convertEncryptedVars();\n }\n $uri = 'admin/' . $uri_t_decode;\n }\n }\n // Loop through the route array looking for wildcards\n foreach ($this->routes as $key => $val) {\n // Check if route format is using http verb\n if (is_array($val)) {\n if (isset($val[$http_verb])) {\n $val = $val[$http_verb];\n } else {\n continue;\n }\n }\n\n // Convert wildcards to RegEx\n #$key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // Does the RegEx match?\n if (preg_match('#^' . $key . '$#', $uri, $matches)) {\n // Are we using callbacks to process back-references?\n if (!is_string($val) && is_callable($val)) {\n // Remove the original string from the matches array.\n array_shift($matches);\n\n // Execute the callback using the values in matches as its parameters.\n $val = call_user_func_array($val, $matches);\n }\n // Are we using the default routing method for back-references?\n elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE) {\n $val = preg_replace('#^' . $key . '$#', $val, $uri);\n }\n\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request(array_values($this->uri->segments));\n }", "function routes($http, $uri) {\n\n $dispatcher = FastRoute\\simpleDispatcher(function(FastRoute\\RouteCollector $r) {\n $r->addRoute('GET', '/question', 'questions#get_answer');\n $r->addRoute('GET', '/hello', 'questions#get_hello');\n $r->addRoute('GET', '/question/{name}/{id}/', 'questions#get_answer');\n $r->addRoute('GET', '/question/{name}/{id}', 'questions#get_answer');\n });\n\n\n// Strip query string (?foo=bar) and decode URI\n if (false !== $pos = strpos($uri, '?')) {\n $uri = substr($uri, 0, $pos);\n }\n\n $uri = rawurldecode($uri);\n $uri = str_replace(BASENAME_DIR . '/', '', $uri);\n $routeInfo = $dispatcher->dispatch($http, $uri);\n\n switch ($routeInfo[0]) {\n case FastRoute\\Dispatcher::NOT_FOUND:\n core\\basebuild::view('error/404');\n break;\n case FastRoute\\Dispatcher::METHOD_NOT_ALLOWED:\n $allowedMethods = $routeInfo[1];\n echo 'allowed not found';\n break;\n case FastRoute\\Dispatcher::FOUND:\n\n $handler = explode('#', $routeInfo[1]);\n $build = $handler[0];\n $function = $handler[1];\n $vars = $routeInfo[2];\n $interfaces = APP_INTERFACE . $build;\n $interfaces = new $interfaces();\n $interfaces->$function();\n break;\n }\n}", "public function testCanSendRoute()\n {\n $this->assertEmpty([]);\n\n $routes = $this->app->getRoutes();\n\n foreach ($routes as $route) {\n if ($route->getName() == 'api.oauth') {\n $this->assertContains('POST', $route->getAllowedMethods());\n $this->assertEquals('/api/oauth', $route->getPath());\n }\n }\n }", "function _parse_routes()\n {\n // Do we even have any custom routing to deal with?\n // There is a default scaffolding trigger, so we'll look just for 1\n if (count($this->routes) == 1)\n {\n $this->_set_request($this->uri->segments);\n return;\n }\n\n // Turn the segment array into a URI string\n $uri = implode('/', $this->uri->segments);\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri]))\n {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n\n //Art\n $i = $this->_search_by_key($this->routes, self::MAIN, $uri);\n if ($i !== FALSE)\n {\n $this->_set_request(explode('/', $this->routes[$i][self::ROUTE]));\n return;\n }\n\n // Loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val)\n {\n if(is_int($key))\n {\n $key = $val[self::MAIN];\n $val = $val[self::ROUTE];\n }\n // Convert wild-cards to RegEx\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri))\n {\n // Do we have a back-reference?\n if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE)\n {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request($this->uri->segments);\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}", "function ci_use_route(){\n\t\t$c_uri=$this->uri->segments;\n\t\t$c_ruri=$this->uri->rsegments;\n\n\t\t//--- we re-introduice the directori in RURI\n\t\tif($this->router->directory!=''){\n\t\t\tarray_unshift($c_ruri , trim($this->router->directory,'/'));\n\t\t\t$i = 1;\n\t\t\tforeach ($c_ruri as $val) $c_ruri[$i++] = $val;\n\t\t\tunset($c_ruri[0]);\n\t\t}\n\n\t\tif(count($c_uri) > count($c_ruri))return true;\n\t\t//--- Now if URI == RURI => there is no used route.\n\t\tif(count($c_uri) == count($c_ruri)) return (implode('/',$c_uri)==implode('/',$c_ruri))? false:true;\n\n\t\tfor($i=1;$i <= count($c_uri);$i++) {\n\t\t\tif($c_uri[$i]!=$c_ruri[$i]) return true;\n\t\t}\n\t\treturn false;\n\t}", "public function testModuleRoute()\n {\n $modules = 'user|my-admin';\n\n $manager = $this->getUrlManager([\n 'rules' => [\n \"<module:$modules>\" => '<module>',\n \"<module:$modules>/<controller>\" => '<module>/<controller>',\n \"<module:$modules>/<controller>/<action>\" => '<module>/<controller>/<action>',\n '<url:[a-zA-Z0-9-/]+>' => 'site/index',\n ],\n ]);\n\n $result = $manager->parseRequest($this->getRequest('user'));\n $this->assertEquals(['user', []], $result);\n $result = $manager->parseRequest($this->getRequest('user/somecontroller'));\n $this->assertEquals(['user/somecontroller', []], $result);\n $result = $manager->parseRequest($this->getRequest('user/somecontroller/someaction'));\n $this->assertEquals(['user/somecontroller/someaction', []], $result);\n\n $result = $manager->parseRequest($this->getRequest('users/somecontroller/someaction'));\n $this->assertEquals(['site/index', ['url' => 'users/somecontroller/someaction']], $result);\n\n }", "public function testProductRoutes()\n\t{\n\t\t//$response = $this->call('GET', '/admin/website/2/products');\n\t\t\n\t\t//$this->assertEquals(200, $response->status());\n\t}", "public function test_bad_index_route()\n {\n //incorrect uri\n $response = $this->get('api/students/1234');\n $response->assertStatus(404);\n }", "protected function loadBackendRoutes() {}", "public static function getRoutes()\n {\n $routes = new \\FreeFW\\Router\\RouteCollection();\n $paths = [];\n $paths[] = __DIR__ . '/../resource/routes/restful/routes.php';\n foreach ($paths as $onePath) {\n $apiRoutes = @include($onePath);\n if (is_array($apiRoutes)) {\n foreach ($apiRoutes as $routeId => $apiRoute) {\n $myRoute = new \\FreeFW\\Router\\Route();\n $myRoute\n ->setId($routeId)\n ->setMethod($apiRoute[\\FreeFW\\Router\\Route::ROUTE_METHOD])\n ->setUrl($apiRoute[\\FreeFW\\Router\\Route::ROUTE_URL])\n ->setController($apiRoute[\\FreeFW\\Router\\Route::ROUTE_CONTROLLER])\n ->setFunction($apiRoute[\\FreeFW\\Router\\Route::ROUTE_FUNCTION])\n ;\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_ROLE, $apiRoute)) {\n $myRoute->setRole($apiRoute[\\FreeFW\\Router\\Route::ROUTE_ROLE]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_AUTH, $apiRoute)) {\n $myRoute->setAuth($apiRoute[\\FreeFW\\Router\\Route::ROUTE_AUTH]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_INCLUDE, $apiRoute)) {\n $myRoute->setInclude($apiRoute[\\FreeFW\\Router\\Route::ROUTE_INCLUDE]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_MODEL, $apiRoute)) {\n $myRoute->setDefaultModel($apiRoute[\\FreeFW\\Router\\Route::ROUTE_MODEL]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_COLLECTION, $apiRoute)) {\n $myRoute->setCollection($apiRoute[\\FreeFW\\Router\\Route::ROUTE_COLLECTION]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_COMMENT, $apiRoute)) {\n $myRoute->setComment($apiRoute[\\FreeFW\\Router\\Route::ROUTE_COMMENT]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_PARAMETERS, $apiRoute)) {\n $myRoute->setParameters($apiRoute[\\FreeFW\\Router\\Route::ROUTE_PARAMETERS]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_RESULTS, $apiRoute)) {\n $myRoute->setResponses($apiRoute[\\FreeFW\\Router\\Route::ROUTE_RESULTS]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_SCOPE, $apiRoute)) {\n $myRoute->setScope($apiRoute[\\FreeFW\\Router\\Route::ROUTE_SCOPE]);\n }\n $routes->addRoute($myRoute);\n }\n }\n }\n return $routes;\n }", "public function test_route_canonicalized() {\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' ),\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// Check the route was registered correctly.\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_raw_endpoint_data();\n\t\t$this->assertArrayHasKey( '/test-ns/test', $endpoints );\n\n\t\t// Check the route was wrapped in an array.\n\t\t$endpoint = $endpoints['/test-ns/test'];\n\t\t$this->assertArrayNotHasKey( 'callback', $endpoint );\n\t\t$this->assertArrayHasKey( 'namespace', $endpoint );\n\t\t$this->assertSame( 'test-ns', $endpoint['namespace'] );\n\n\t\t// Grab the filtered data.\n\t\t$filtered_endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$this->assertArrayHasKey( '/test-ns/test', $filtered_endpoints );\n\t\t$endpoint = $filtered_endpoints['/test-ns/test'];\n\t\t$this->assertCount( 1, $endpoint );\n\t\t$this->assertArrayHasKey( 'callback', $endpoint[0] );\n\t\t$this->assertArrayHasKey( 'methods', $endpoint[0] );\n\t\t$this->assertArrayHasKey( 'args', $endpoint[0] );\n\t}", "function create_initial_rest_routes()\n {\n }", "public function testRouteSetsPattern()\n {\n $route1 = new \\Slim\\Route('/foo/bar', function () {});\n $this->assertEquals('/foo/bar', $route1->getPattern());\n }", "public function testUriStrategyRouteReceivesCorrectArguments()\n {\n $collection = new Route\\RouteCollection;\n $collection->setStrategy(new UriStrategy);\n\n $collection->get('/route/{id}/{name}', function ($id, $name) {\n $this->assertEquals('2', $id);\n $this->assertEquals('phil', $name);\n });\n\n $dispatcher = $collection->getDispatcher();\n $response = $dispatcher->dispatch('GET', '/route/2/phil');\n }", "function defineRoutes() {\n Router::map('homepage', '', array('controller' => DEFAULT_CONTROLLER, 'action' => DEFAULT_ACTION, 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('admin', 'admin', array('controller' => 'admin', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('public', 'public', array('controller' => 'public', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('wireframe_updates', 'wireframe-updates', array('controller' => 'backend', 'action' => 'wireframe_updates', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('menu_refresh_url', 'refresh-menu', array('controller' => 'backend', 'action' => 'refresh_menu', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('quick_add', 'quick-add', array('controller' => 'backend', 'action' => 'quick_add', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // API\n Router::map('info', 'info', array('controller' => 'api', 'action' => 'info', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Disk Space\n Router::map('disk_space_admin', 'admin/disk-space', array('controller' => 'disk_space_admin', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_usage', 'admin/disk-space/usage', array('controller' => 'disk_space_admin', 'action' => 'usage', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_admin_settings', 'admin/disk-space/settings', array('controller' => 'disk_space_admin', 'action' => 'settings', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_application_cache', 'admin/disk-space/tools/remove-application-cache', array('controller' => 'disk_space_admin', 'action' => 'remove_application_cache', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_logs', 'admin/disk-space/tools/remove-logs', array('controller' => 'disk_space_admin', 'action' => 'remove_logs', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_old_application_versions', 'admin/disk-space/tools/remove-old-application-versions', array('controller' => 'disk_space_admin', 'action' => 'remove_old_application_versions', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Appearance\n Router::map('appearance_admin', 'admin/appearance', array('controller' => 'appearance', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_add_scheme', 'admin/appearance/add-scheme', array('controller' => 'appearance', 'action' => 'add', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_edit_scheme', 'admin/appearance/:scheme_id/edit', array('controller' => 'appearance', 'action' => 'edit', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_rename_scheme', 'admin/appearance/:scheme_id/rename', array('controller' => 'appearance', 'action' => 'rename', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_delete_scheme', 'admin/appearance/:scheme_id/delete', array('controller' => 'appearance', 'action' => 'delete', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_set_as_default_scheme', 'admin/appearance/:scheme_id/set-as-default', array('controller' => 'appearance', 'action' => 'set_as_default', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Scheduled Tasks Admin\n Router::map('scheduled_tasks_admin', 'admin/scheduled-tasks', array('controller' => 'scheduled_tasks_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Network settings\n Router::map('network_settings', 'admin/network', array('controller' => 'network_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // Indices admin\n Router::map('indices_admin', 'admin/indices', array('controller' => 'indices_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('indices_admin_rebuild', 'admin/indices/rebuild', array('controller' => 'indices_admin', 'action' => 'rebuild', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('indices_admin_rebuild_finish', 'admin/indices/rebuild/finish', array('controller' => 'indices_admin', 'action' => 'rebuild_finish', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n Router::map('object_contexts_admin_rebuild', 'admin/indices/object-contexts/rebuild', array('controller' => 'object_contexts_admin', 'action' => 'rebuild', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('object_contexts_admin_clean', 'admin/indices/object-contexts/clean', array('controller' => 'object_contexts_admin', 'action' => 'clean', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // Scheduled tasks\n Router::map('frequently', 'frequently', array('controller' => 'scheduled_tasks', 'action' => 'frequently', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('hourly', 'hourly', array('controller' => 'scheduled_tasks', 'action' => 'hourly', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('daily', 'daily', array('controller' => 'scheduled_tasks', 'action' => 'daily', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // trash related\n Router::map('trash', 'trash', array('controller' => 'trash', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('trash_section', 'trash/:section_name', array('controller' => 'trash', 'action' => 'section', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('trash_empty', 'trash/empty', array('controller' => 'trash', 'action' => 'empty_trash', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('object_untrash', 'trash/untrash-object', array('controller' => 'trash', 'action' => 'untrash_object', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO), array('object_id' => Router::MATCH_ID));\n Router::map('object_delete', 'trash/delete-object', array('controller' => 'trash', 'action' => 'delete_object', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO), array('object_id' => Router::MATCH_ID));\n\n // Control Tower\n Router::map('control_tower', 'control-tower', array('controller' => 'control_tower', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_empty_cache', 'control-tower/empty-cache', array('controller' => 'control_tower', 'action' => 'empty_cache', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_delete_compiled_templates', 'control-tower/delete-compiled-templates', array('controller' => 'control_tower', 'action' => 'delete_compiled_templates', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_rebuild_images', 'control-tower/rebuild-images', array('controller' => 'control_tower', 'action' => 'rebuild_images', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_rebuild_localization', 'control-tower/rebuild-localization', array('controller' => 'control_tower', 'action' => 'rebuild_localization', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('control_tower_settings', 'admin/control-tower', array('controller' => 'control_tower', 'action' => 'settings', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n\t // Firewall\n\t Router::map('firewall', 'admin/firewall', array('controller' => 'firewall', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n }", "public function test_AllRoutesNoAuthAvailable()\n {\n //should be possible without any DB entry\n\n Session::start();\n $token = session('_token');\n\n $credentials = array(\n 'email' => '[email protected]',\n 'password' => 'wrongpass',\n '_token' => $token\n );\n\n $session = array(\n '_token' => $token\n );\n\n //index has redirect\n $this->get('/')->assertStatus(302);\n\n //index redirect to login page\n $this->followingRedirects()->get('/')\n ->assertStatus(200)\n ->assertViewIs('auth.login')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //Auth Login\n $this->get('/login')->assertStatus(200)\n ->assertViewIs('auth.login')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n $this->followingRedirects()->post('/login', $credentials)->assertStatus(200)\n ->assertViewIs('auth.login');\n\n //Auth Logout POST\n $this->followingRedirects()->post('/logout', ['_token' => $token])->assertStatus(200)\n ->assertViewIs('auth.login')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //Auth Logout GET\n $this->get('/logout')->assertStatus(302);\n $this->followingRedirects()->get('/logout')->assertStatus(200)\n ->assertViewIs('auth.login')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //Register Message GET\n $this->get('/auth/success')->assertStatus(200)\n ->assertSee('Dein Benutzer muss erst freigeschaltet werden. Du wirst per E-Mail benachrichtigt.')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n // impressum\n $this->get('/impressum')->assertStatus(200)->assertSee('Impressum')->assertSee('Datenschutz');;\n\n // datenschutz\n $this->get('/datenschutz')->assertStatus(200)->assertSee('Impressum')->assertSee('Datenschutz');\n\n // order\n $this->get('/order')->assertStatus(200)\n ->assertSee('Dein Dienstplan')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->get('/order/create/basic')->assertStatus(200)\n ->assertSee('Basis Paket')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->get('/order/create/module')->assertStatus(200)\n ->assertSee('Modulares Paket')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->get('/order/create/support')->assertStatus(200)\n ->assertSee('Support Paket')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //following sites should not be available for guests and redirect to login\n\n //home\n $this->followingRedirects()->get('/home')->assertStatus(200)->assertViewIs('auth.login');\n\n //mailtest\n $this->followingRedirects()->get('/mailtest')->assertStatus(200)->assertViewIs('auth.login');\n\n //pdf extract\n $this->followingRedirects()->get('/pdf')->assertStatus(200)->assertViewIs('auth.login');\n\n //sendService PDF\n $this->followingRedirects()->get('/sendServicePDF')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/sendServicePDF', $session)->assertStatus(419);\n\n //userguide\n $this->followingRedirects()->get('/userguide')->assertStatus(200)->assertViewIs('auth.login');\n\n //superadmin user\n $this->followingRedirects()->get('/superadmin/user')->assertStatus(200)->assertViewIs('auth.login');\n\n //qualification (resource)\n $this->followingRedirects()->get('/qualification')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/qualification', $session)->assertStatus(419);\n $this->followingRedirects()->get('/qualification/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/qualification/1', $session)->assertStatus(419);\n $this->delete('/qualification/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/qualification/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/qualification/create')->assertStatus(200)->assertViewIs('auth.login');\n\n //user (resource)\n $this->followingRedirects()->get('/user')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/user', $session)->assertStatus(419);\n $this->followingRedirects()->get('/user/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/user/1', $session)->assertStatus(419);\n $this->delete('/user/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/user/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/user/create')->assertStatus(200)->assertViewIs('auth.login');\n\n //user approve\n $this->followingRedirects()->get('/user/approve/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/user/approve/1', $session)->assertStatus(419);\n\n //client (resource)\n $this->followingRedirects()->get('/client')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/client', $session)->assertStatus(419);\n $this->followingRedirects()->get('/client/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/client/1', $session)->assertStatus(419);\n $this->delete('/client/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/client/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/client/create')->assertStatus(200)->assertViewIs('auth.login');\n\n // client apply\n $this->followingRedirects()->get('/clientapply')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/client/1/apply')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/client/1/apply', $session)->assertStatus(419);\n $this->delete('/client/1/apply', $session)->assertStatus(419);\n $this->put('/client/1/apply', $session)->assertStatus(419);\n $this->followingRedirects()->get('/client/1/apply/revert')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/client/1/apply/revert', $session)->assertStatus(419);\n $this->delete('/client/1/apply/revert', $session)->assertStatus(419);\n $this->put('/client/1/apply/revert', $session)->assertStatus(419);\n $this->followingRedirects()->get('/client/1/removeuser/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/client/1/removeuser/1', $session)->assertStatus(419);\n $this->delete('/client/1/removeuser/1', $session)->assertStatus(419);\n $this->put('/client/1/removeuser/1', $session)->assertStatus(419);\n\n //client update module\n $this->followingRedirects()->get('/client/module')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/client/module', $session)->assertStatus(419);\n $this->delete('/client/module', $session)->assertStatus(419);\n $this->put('/client/module', $session)->assertStatus(419);\n\n //change client\n $this->followingRedirects()->get('/changeclient/1')->assertStatus(200)->assertViewIs('auth.login');\n\n //service (resource)\n $this->followingRedirects()->get('/service')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/servicehistory')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/service/finalize/1')->assertStatus(200)->assertViewIs('auth.login');\n\n $this->post('/service', $session)->assertStatus(419);\n $this->followingRedirects()->get('/service/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/service/1', $session)->assertStatus(419);\n $this->delete('/service/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/service/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/service/create')->assertStatus(200)->assertViewIs('auth.login');\n\n $this->followingRedirects()->get('/service/1/delete')->assertStatus(200)->assertViewIs('auth.login');\n\n //training (resource)\n $this->followingRedirects()->get('/training')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/training', $session)->assertStatus(419);\n $this->followingRedirects()->get('/training/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/training/1', $session)->assertStatus(419);\n $this->delete('/training/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/training/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/training/create')->assertStatus(200)->assertViewIs('auth.login');\n\n $this->followingRedirects()->get('/training/1/delete')->assertStatus(200)->assertViewIs('auth.login');\n\n //training user\n $this->followingRedirects()->get('/training/training_user/1/delete')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/training/training_user/1/delete', $session)->assertStatus(419);\n $this->delete('/training/training_user/1/delete', $session)->assertStatus(419);\n $this->put('/training/training_user/1/delete', $session)->assertStatus(419);\n\n //news (resource)\n $this->followingRedirects()->get('/news')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/news', $session)->assertStatus(419);\n $this->followingRedirects()->get('/news/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/news/1', $session)->assertStatus(419);\n $this->delete('/news/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/news/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/news/create')->assertStatus(200)->assertViewIs('auth.login');\n\n $this->followingRedirects()->get('/news/1/delete')->assertStatus(200)->assertViewIs('auth.login');\n\n //holiday (resource)\n $this->followingRedirects()->get('/holiday')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/holiday', $session)->assertStatus(419);\n $this->followingRedirects()->get('/holiday/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/holiday/1', $session)->assertStatus(419);\n $this->delete('/holiday/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/holiday/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/holiday/create')->assertStatus(200)->assertViewIs('auth.login');\n\n $this->followingRedirects()->get('/holiday/storeservice/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/holiday/storetraining/1')->assertStatus(200)->assertViewIs('auth.login');\n\n // Qualification <-> User\n $this->post('/qualification_user/create', $session)->assertStatus(419);\n $this->followingRedirects()->get('/qualification_user/delete/1/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/qualification_user/delete/1/1', $session)->assertStatus(419);\n\n // Client <-> User\n $this->post('/client_user/admin', $session)->assertStatus(419);\n $this->post('/client_user/trainingeditor', $session)->assertStatus(419);\n\n //Position\n $this->followingRedirects()->get('/position/1/subscribe')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/subscribe', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/1/subscribe_user/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/subscribe_user/1', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/1/unsubscribe')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/unsubscribe', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/1/unsubscribe_user/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/unsubscribe_user/1', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/1/authorize')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/authorize', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/1/deauthorize')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/deauthorize', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/list_notAuthorized')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/list_notAuthorized', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/1/position_user')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/position_user', $session)->assertStatus(419);\n\n //Statistic\n $this->followingRedirects()->get('/statistic')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/statistic', $session)->assertStatus(419);\n\n //Calendar\n $this->followingRedirects()->get('/calendar')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/calendar', $session)->assertStatus(419);\n $this->followingRedirects()->get('/calendar/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/calendar/1', $session)->assertStatus(419);\n $this->delete('/calendar/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/calendar/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/calendar/1/delete')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/calendar/create')->assertStatus(200)->assertViewIs('auth.login');\n\n //Survey\n $this->followingRedirects()->get('/survey')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/survey', $session)->assertStatus(419);\n $this->followingRedirects()->get('/survey/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/survey/1', $session)->assertStatus(419);\n $this->delete('/survey/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/survey/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/survey/create')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->post('/survey/vote/1')->assertStatus(419);\n $this->followingRedirects()->get('/survey/postpone/1')->assertStatus(200)->assertViewIs('auth.login');\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 }", "protected function _parse_routes()\n\t{\n\t\t$uri = implode('/', $this->uri->segments);\n\n\t\t// Get HTTP verb\n\t\t$http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n\t\t// Loop through the route array looking for wildcards\n\t\tforeach ($this->routes as $key => $val)\n\t\t{\n\t\t\t// Check if route format is using HTTP verbs\n\t\t\tif (is_array($val))\n\t\t\t{\n\t\t\t\t$val = array_change_key_case($val, CASE_LOWER);\n\t\t\t\tif (isset($val[$http_verb]))\n\t\t\t\t{\n\t\t\t\t\t$val = $val[$http_verb];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Convert wildcards to RegEx\n\t\t\t$key = str_replace(array(':any', ':num',':all'), array('[^/]+', '[0-9]+','(?!(Techsystem|techsystem|Vindex\\/tech5sManagerControl).*$).*'), $key);\n\t\t\t// $key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n\t\t\t// Does the RegEx match?\n\t\t\tif (preg_match('#^'.$key.'$#', $uri, $matches))\n\t\t\t{\n\t\t\t\t// Are we using callbacks to process back-references?\n\t\t\t\tif ( ! is_string($val) && is_callable($val))\n\t\t\t\t{\n\t\t\t\t\t// Remove the original string from the matches array.\n\t\t\t\t\tarray_shift($matches);\n\n\t\t\t\t\t// Execute the callback using the values in matches as its parameters.\n\t\t\t\t\t$val = call_user_func_array($val, $matches);\n\t\t\t\t}\n\t\t\t\t// Are we using the default routing method for back-references?\n\t\t\t\telseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$val = preg_replace('#^'.$key.'$#', $val, $uri);\n\t\t\t\t}\n\n\t\t\t\t$this->_set_request(explode('/', $val));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\n\t\t// If we got this far it means we didn't encounter a\n\t\t// matching route so we'll set the site default route\n\t\t$this->_set_request(array_values($this->uri->segments));\n\t}", "public function routes()\n {\n return [\n 'GET' => [\n 'main' => [\n 'index' => [\n 'name' => 'index'\n ],\n 'services' => [\n 'name' => 'services'\n ],\n 'contacts' => [\n 'name' => 'contacts'\n ],\n 'typography' => [\n 'name' => 'typography'\n ],\n 'test' => [\n 'name' => 'test'\n ],\n 'test1' => [\n 'name' => 'test1'\n ]\n ],\n 'blog' => [\n 'index' => [\n 'name' => 'index'\n ],\n 'create' => [\n 'name' => 'create',\n 'required' => [\n 'auth' => true\n ]\n ],\n 'view' => [\n 'name' => 'view',\n 'required' => [\n 'param' => true\n ]\n ],\n 'edit' => [\n 'name' => 'view',\n 'required' => [\n 'auth' => true,\n 'param' => true\n ]\n ]\n ],\n 'user' => [\n //'index' => 'index',\n 'login' => [\n 'name' => 'login'\n ],\n 'register' => [\n 'name' => 'register'\n ],\n 'logout' => [\n 'name' => 'logout',\n 'required' => [\n 'auth' => true\n ],\n ],\n 'change-password' => [\n 'name' => 'change-password',\n 'required' => [\n 'auth' => true\n ],\n ],\n 'forget-password' => [\n 'name' => 'forget-password',\n 'required' => [\n 'auth' => true\n ],\n ]\n ],\n 'auth' => [\n 'vk' => [\n 'name' => 'vk'\n ]\n ],\n 'config' => [\n 'index' => [\n 'name' => 'index',\n 'required' => [\n 'auth' => true\n ]\n ],\n 'sitemap' => [\n 'name' => 'sitemap',\n 'required' => [\n 'auth' => true\n ]\n ]\n ],\n 'portfolio' => [\n 'view' => [\n 'name' => 'view',\n 'required' => [\n 'param' => true\n ]\n ]\n ],\n 'ajax' => [\n 'template' => [\n 'name' => 'template',\n 'required' => [\n 'ajax' => true\n ]\n ],\n 'test' => [\n 'name' => 'test',\n 'required' => [\n 'ajax' => true\n ]\n ]\n ]\n ],\n 'POST' => [\n 'ajax' => [\n 'form-feedback' => [\n 'name' => 'form-feedback',\n 'required' => [\n 'refer' => 'https://uiweb.ru/'\n ]\n ],\n 'form-backcall' => [\n 'name' => 'form-backcall',\n 'required' => [\n 'refer' => 'https://uiweb.ru/main/contacts'\n ]\n ],\n 'form-login' => [\n 'name' => 'form-login'\n ],\n 'form-register' => [\n 'name' => 'form-register'\n ],\n 'form-change-password' => [\n 'name' => 'form-change-password'\n ]\n ],\n 'blog' => [\n 'create' => [\n 'name' => 'create',\n 'required' => [\n 'auth' => true\n ]\n ],\n 'edit' => [\n 'name' => 'create',\n 'required' => [\n 'auth' => true,\n 'param' => true\n ]\n ]\n ]\n ],\n 'PUT',\n 'PATCH',\n 'TRACE',\n 'DELETE',\n 'HEAD',\n 'OPTIONS'\n ];\n }", "public function testExtensionsWithScopedRoutes(): void\n {\n Router::extensions(['json']);\n\n $routes = Router::createRouteBuilder('/');\n $routes->scope('/', function (RouteBuilder $routes): void {\n $routes->setExtensions('rss');\n $routes->connect('/', ['controller' => 'Pages', 'action' => 'index']);\n\n $routes->scope('/api', function (RouteBuilder $routes): void {\n $routes->setExtensions('xml');\n $routes->connect('/docs', ['controller' => 'ApiDocs', 'action' => 'index']);\n });\n });\n\n $this->assertEquals(['json', 'rss', 'xml'], array_values(Router::extensions()));\n }", "private function load_routes() {\n\n // 1. plugins routes\n foreach($this->context->plugins() as $plugin) {\n \n if(false === $plugin->is_type('IRoutesPlugin')) continue;\n\n foreach($plugin->routes() as $route_value) {\n $this->routes[]= $route_value;\n }\n }\n\n // 2. config.xml routes\n $config_routes= $this->context->config()->routes();\n // XXX: review, maybe Route[] should be returned by configurator?\n foreach( $config_routes as $r ) {\n // xxx. requirements\n $this->routes[]= new Route( \n (string)trim($r['name']), // name\n (string)trim($r['value']), // definition\n $this->context->config()->route_defaults($r) // array with defaults\n );\n }\n\n // Medick::dump($this->routes);\n\n // xxx: throw exception if 0 routes?\n }", "public function 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 getSystemRoutes();", "public function testAddingDefinedRoutes() {\n\n\t\t$router = new Nether\\Avenue\\Router(static::$RequestData['Test']);\n\n\t\t$router->AddRoute('(@)//index','Nether\\Avenue\\RouteTest::Index');\n\t\t$router->AddRoute('(@)//test','Nether\\Avenue\\RouteTest::Test');\n\t\t$routes = $router->GetRoutes();\n\n\t\t(new Verify(\n\t\t\t'check that AddRoute() added the routes',\n\t\t\tcount($routes)\n\t\t))->equals(2);\n\n\t\t(new Verify(\n\t\t\t'check that the route domain condition translated right',\n\t\t\tcurrent($routes)->GetDomain()\n\t\t))->equals('`^(.+?)$`');\n\n\t\t(new Verify(\n\t\t\t'check that the route path condition translated right',\n\t\t\tcurrent($routes)->GetPath()\n\t\t))->equals('`^\\/index$`');\n\n\t\t(new Verify(\n\t\t\t'check that GetRoute() returns an object.',\n\t\t\tis_object($router->GetRoute())\n\t\t))->true();\n\n\t\t(new Verify(\n\t\t\t'check that GetRoute() selected the right route.',\n\t\t\t($router->GetRoute() instanceof Nether\\Avenue\\RouteHandler)\n\t\t))->true();\n\n\t\t(new Verify(\n\t\t\t'check that TranslateRouteHandler() parsed the class right.',\n\t\t\t\"Class: {$router->GetRoute()->GetClass()}, Method: {$router->GetRoute()->GetMethod()}\"\n\t\t))->equals('Class: Nether\\Avenue\\RouteTest, Method: Test');\n\n\t\t(new Verify(\n\t\t\t'check that GetRoute() found the arguments.',\n\t\t\t$router->GetRoute()->GetArgv()[0]\n\t\t))->equals('www.nether.io');\n\n\t\treturn;\n\t}", "protected function mapRoutes()\n {\n $this->loadRoutesFrom(__DIR__.'/../../routes/api/base.php');\n $this->loadRoutesFrom(__DIR__.'/../../routes/api/admin.php');\n // $this->loadRoutesFrom(__DIR__.'/../../routes/web.php');\n $this->loadRoutesFrom(__DIR__.'/../../routes/auth.php');\n }", "protected function preReRouting()\n {\n\n }", "function routeByURI($uri) {\n\t\t\tstr_replace(API_ROOT, '', $uri);\n\t\t\t$querystring = '';\n\t\t\t\n\t\t\t$pathArray = explode('/', $uri);\n\t\t\t//Remove querystring\n\t\t\tif(strstr($pathArray[count($pathArray) - 1], '?') !== false) {\n\t\t\t\t$querystring = array_pop($pathArray);\n\t\t\t}\t\t\n\t\t\t\n\t\t\t//Remove trailing slash\n\t\t\tif($pathArray[count($pathArray) - 1] == '') {\n\t\t\t\tarray_pop($pathArray);\n\t\t\t}\n\n\t\t\t$idCount = 2;\n\n\t\t\t//Extract the numeric IDs, then generalise them for a search\n\t\t\t//FIXME: This means we can only accept numeric IDs. I don;t like this. HACK HACK HACK\n\t\t\tfor($n = 0; $n < count($pathArray); $n++) {\n\t\t\t\tif(is_numeric($pathArray[$n])) {\n\t\t\t\t\tif($idCount == 2) {\n\t\t\t\t\t\t$this->request[\"id\"] = $pathArray[$n];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->request[\"id\".$idCount] = $pathArray[$n];\n\t\t\t\t\t}\n\t\t\t\t\t$idCount++;\n\t\t\t\t\t\n\t\t\t\t\t$pathArray[$n] = ':id';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\n\t\t\t\n\t\t\t$modURI = implode('/', $pathArray);\n\t\t\t\n\t\t\t//This is wildly inefficient, but HACK HACK HACK\n\t\t\tforeach($this->routes[\"endpoints\"] as $endpoint) {\n\t\t\t\tif(($endpoint[\"uri\"] == $modURI) && (strtolower($_SERVER['REQUEST_METHOD']) == strtolower($endpoint[\"method\"]))) {\n\t\t\t\t\t//Then pass this on to the right controller\n\t\t\t\t\t$this->controller = $endpoint[\"controller\"];\n\t\t\t\t\t$this->action = $endpoint[\"action\"];\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "protected function add_legacy_default_routes($builder) {\n $builder->match('/:controller/:action/:id');\n $builder->match('/:controller/:action');\n $builder->match('/:controller');\n }", "public function testHttpMethodBasedRouting() {\n\t\tRouter::connect('/{:controller}/{:id:[0-9]+}', [\n\t\t\t'http:method' => 'GET', 'action' => 'view'\n\t\t]);\n\t\tRouter::connect('/{:controller}/{:id:[0-9]+}', [\n\t\t\t'http:method' => 'PUT', 'action' => 'edit'\n\t\t]);\n\n\t\t$request = new Request(['url' => '/posts/13', 'env' => [\n\t\t\t'REQUEST_METHOD' => 'GET'\n\t\t]]);\n\t\t$params = Router::process($request)->params;\n\t\t$expected = ['controller' => 'Posts', 'action' => 'view', 'id' => '13'];\n\t\t$this->assertEqual($expected, $params);\n\n\t\t$this->assertIdentical('/posts/13', Router::match($params));\n\n\t\t$request = new Request(['url' => '/posts/13', 'env' => [\n\t\t\t'REQUEST_METHOD' => 'PUT'\n\t\t]]);\n\t\t$params = Router::process($request)->params;\n\t\t$expected = ['controller' => 'Posts', 'action' => 'edit', 'id' => '13'];\n\t\t$this->assertEqual($expected, $params);\n\n\t\t$request = new Request(['url' => '/posts/13', 'env' => [\n\t\t\t'REQUEST_METHOD' => 'POST'\n\t\t]]);\n\t\t$params = Router::process($request)->params;\n\t\t$this->assertEmpty($params);\n\t}", "public function testRouteParamDefaults(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/cache/*', ['prefix' => false, 'plugin' => true, 'controller' => 0, 'action' => 1]);\n\n $url = Router::url(['prefix' => '0', 'plugin' => '1', 'controller' => '0', 'action' => '1', 'test']);\n $expected = '/cache/test';\n $this->assertSame($expected, $url);\n\n try {\n Router::url(['controller' => '0', 'action' => '1', 'test']);\n $this->fail('No exception raised');\n } catch (Exception $e) {\n $this->assertTrue(true, 'Exception was raised');\n }\n\n try {\n Router::url(['prefix' => '1', 'controller' => '0', 'action' => '1', 'test']);\n $this->fail('No exception raised');\n } catch (Exception $e) {\n $this->assertTrue(true, 'Exception was raised');\n }\n }", "function route_match() {\n global $route;\n global $html;\n global $config;\n global $matched_route;\n\n $url = explode('index.php', $_SERVER['REQUEST_URI']);\n $url = @str_replace('.', '', substr($url[1], 1));\n if(strpos($url, '?') !== false) {\n $url = explode('?', $url);\n $url = $url[0];\n }\n\n if(!$url) {\n $matched_route = 'ROOT';\n require_once __DIR__ . '/app/' . $route['ROOT'];\n return true;\n }\n\n if(substr($url, -1) == '/') {\n $url = substr($url, 0, -1);\n }\n\n // Check for simple route match\n if(array_key_exists($url, $route)) {\n $matched_route = $url;\n require_once __DIR__ . '/app/' . $route[$url];\n return true;\n }\n\n // Check for regex\n foreach($route as $r => $page) {\n $matches = array();\n\n if(preg_match('#' . $r . '$#', $url, $matches)) {\n array_shift($matches);\n\n $_GET['custom_arguments'] = $matches;\n\n $matched_route = $r;\n require_once __DIR__ . '/app/' . $page;\n return true;\n }\n }\n\n return false;\n}", "public function testDispatcherHandles404CorrectlyOnStandardStrategies()\n {\n $this->setExpectedException('League\\Route\\Http\\Exception\\NotFoundException', 'Not Found', 0);\n\n $collection = new Route\\RouteCollection;\n $dispatcher = $collection->getDispatcher();\n $response = $dispatcher->dispatch('GET', '/route');\n }", "public function testRouteNameCasing(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/articles/{id}', ['controller' => 'Articles', 'action' => 'view']);\n $routes->connect('/{controller}/{action}/*', [], ['routeClass' => 'InflectedRoute']);\n $result = Router::url(['controller' => 'Articles', 'action' => 'view', 'id' => 10]);\n $expected = '/articles/10';\n $this->assertSame($expected, $result);\n }", "public function testDispatcherHandles405CorrectlyOnStandardStrategies()\n {\n $this->setExpectedException('League\\Route\\Http\\Exception\\MethodNotAllowedException', 'Method Not Allowed', 0);\n\n $collection = new Route\\RouteCollection;\n\n $collection->post('/route', 'handler');\n $collection->put('/route', 'handler');\n $collection->delete('/route', 'handler');\n\n $dispatcher = $collection->getDispatcher();\n $response = $dispatcher->dispatch('GET', '/route');\n }", "public function test_match_withUnsupportedMethod()\n {\n $route = new Route('GET', '/home', 'test');\n $this->assertFalse(\n $route->match('POST', '/home'),\n 'match() must return false method provided is not supported by the route.'\n );\n }", "public function testGetRoutePath()\n {\n $this->assertEquals('/default', $this->uut->getRoutePath('default'));\n }", "abstract protected function getListRoute() : string;", "public function testRouteDoesNotMatchResourceWithWildcard()\n {\n $resource = '/hello';\n $route = new \\Slim\\Route('/hello/:path+', function () {});\n $result = $route->matches($resource);\n $this->assertFalse($result);\n $this->assertEquals(array(), $route->getParams());\n }", "abstract public function getRouteMatch();", "public function testStringActions() {\n\t\tRouter::connect('/login', ['controller' => 'sessions', 'action' => 'create']);\n\t\tRouter::connect('/{:controller}/{:action}');\n\n\t\t$result = Router::match(\"Sessions::create\");\n\t\t$this->assertIdentical('/login', $result);\n\n\t\t$result = Router::match(\"Posts::index\");\n\t\t$this->assertIdentical('/posts', $result);\n\n\t\t$result = Router::match(\"ListItems::archive\");\n\t\t$this->assertIdentical('/list_items/archive', $result);\n\t}", "public static function ignoreRoutes()\n {\n static::$registersRoutes = false;\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}", "protected function _parse_routes()\n {\n $uri = implode('/', $this->uri->segments);\n\n // only for test\n // sometime js file has map file but not found in server\n if (ENVIRONMENT === 'development') {\n log_message('error', json_encode($uri));\n }\n\n // Get HTTP verb\n $http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n // Loop through the route array looking for wildcards\n foreach ($this->routes as $key => $val)\n {\n // Check if route format is using HTTP verbs\n if (is_array($val))\n {\n $val = array_change_key_case($val, CASE_LOWER);\n if (isset($val[$http_verb]))\n {\n $val = $val[$http_verb];\n }\n else\n {\n continue;\n }\n }\n\n // Convert wildcards to RegEx\n $key = str_replace(array(':any', ':num'), array('.+', '[0-9]+'), $key);\n\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri, $matches))\n {\n // Are we using callbacks to process back-references?\n if ( ! is_string($val) && is_callable($val))\n {\n // Remove the original string from the matches array.\n array_shift($matches);\n\n // Execute the callback using the values in matches as its parameters.\n $val = call_user_func_array($val, $matches);\n }\n // Are we using the default routing method for back-references?\n elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)\n {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request(array_values($this->uri->segments));\n }", "public function testWithNonExistentLanguage() {\n\t\t$rules = array(\n\t\t\t'Index/Index' => '/',\n\t\t\t'Index/Simple' => '/test/simple',\n\t\t\t'Index/Language' => '/test/en',\n\t\t\t'Index/WithoutSlash' => '/test'\n\t\t);\n\n\t\t$controller = null;\n\t\t$action = null;\n\n\t\tforeach ($rules as $uri) {\n\t\t\ttry {\n\t\t\t\t$this->getRouter('/pl' . $uri, $rules)->getRoute($controller, $action);\n\t\t\t\t$this->fail('Should drop en Exception in case of non-existent language');\n\t\t\t}\n\t\t\tcatch (RouterException $e) {\n\t\t\t}\n\t\t}\n\t}", "protected function _connectDefaultRoutes(): void\n {\n Router::scope('/', function (RouteBuilder $routes): void {\n $routes->fallbacks('InflectedRoute');\n });\n }", "public function testTestModuleRoutesLoaded()\n {\n $client = $this->createClient();\n $client->request('POST', '/test_module_loaded');\n $this->assertTrue($client->getResponse()->isOk());\n\n $client = $this->createClient();\n $client->request('GET', '/test_module_loaded');\n $this->assertTrue($client->getResponse()->isOk());\n }", "private function getRoutesToReplace()\n {\n return [\n 'contactus_page' => 'web_contactus',\n 'promotion_homepage' => 'deal_homepage',\n 'web_terms' => '/' . $this->container->getParameter('alias_terms_url_divisor'),\n 'web_privacy' => '/' . $this->container->getParameter('alias_privacy_url_divisor'),\n 'web_sitemap' => '/' . $this->container->getParameter('alias_sitemap_url_divisor')\n ];\n }", "public function testUrlGenerationWithAutoPrefixes(): void\n {\n Router::reload();\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/protected/{controller}/{action}/*', ['prefix' => 'Protected']);\n $routes->connect('/admin/{controller}/{action}/*', ['prefix' => 'Admin']);\n $routes->connect('/{controller}/{action}/*');\n\n $request = new ServerRequest([\n 'url' => '/images/index',\n 'params' => [\n 'plugin' => null, 'controller' => 'Images', 'action' => 'index',\n 'prefix' => null, 'protected' => false, 'url' => ['url' => 'images/index'],\n ],\n ]);\n Router::setRequest($request);\n\n $result = Router::url(['controller' => 'Images', 'action' => 'add']);\n $expected = '/Images/add';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['controller' => 'Images', 'action' => 'add', 'prefix' => 'Protected']);\n $expected = '/protected/Images/add';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['controller' => 'Images', 'action' => 'add_protected_test', 'prefix' => 'Protected']);\n $expected = '/protected/Images/add_protected_test';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['action' => 'edit', 1]);\n $expected = '/Images/edit/1';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['action' => 'edit', 1, 'prefix' => 'Protected']);\n $expected = '/protected/Images/edit/1';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['action' => 'protectedEdit', 1, 'prefix' => 'Protected']);\n $expected = '/protected/Images/protectedEdit/1';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['action' => 'edit', 1, 'prefix' => 'Protected']);\n $expected = '/protected/Images/edit/1';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['controller' => 'Others', 'action' => 'edit', 1]);\n $expected = '/Others/edit/1';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['controller' => 'Others', 'action' => 'edit', 1, 'prefix' => 'Protected']);\n $expected = '/protected/Others/edit/1';\n $this->assertSame($expected, $result);\n }", "private function _allowTestRoutes()\n {\n // [taz] See if the main config file is already loaded, so we can tell whether to remove testing routes.\n $mainConfig = Zend_Registry::getInstance()->get('CONFIG');\n \n // [taz] If $mainConfig isn't set, disallow test routes by default.\n if (!$mainConfig) {\n \treturn false;\n }\n \n // [taz] Return the setting of debug.allow_test_routes.\n return $mainConfig->debug->allow_test_routes; \n }", "public function testUsingCustomRouteClass(): void\n {\n $routes = Router::createRouteBuilder('/');\n $this->loadPlugins(['TestPlugin']);\n $routes->connect(\n '/{slug}',\n ['plugin' => 'TestPlugin', 'action' => 'index'],\n ['routeClass' => 'PluginShortRoute', 'slug' => '[a-z_-]+']\n );\n $result = Router::parseRequest($this->makeRequest('/the-best', 'GET'));\n unset($result['_route']);\n $expected = [\n 'plugin' => 'TestPlugin',\n 'controller' => 'TestPlugin',\n 'action' => 'index',\n 'slug' => 'the-best',\n 'pass' => [],\n '_matchedRoute' => '/{slug}',\n ];\n $this->assertEquals($expected, $result);\n }", "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 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 }", "public function registerRoutes(Map $map)\n {\n $map->attach('legacy.', '/', function (Map $map) {\n\n // Admin\n //$map->get('admin.index', 'admin/', $this->controller(AdminController::class, 'index'))->allows(['POST']);\n $map->get('admin.assets', 'admin/assets/{asset}', $this->controller(AdminController::class, 'assets'))\n ->tokens(['asset' => '.+']);\n $map->get('admin.page', 'admin/', $this->controller(AdminController::class, 'index'))->allows(['POST'])\n ->wildcard('page');\n\n // Index\n $map->get('index', '', $this->controller(PagesController::class, 'index'))->allows(['POST']);\n\n // Named article\n $map->get('article', '{name}.html', $this->controller(PagesController::class, 'articles'))\n ->tokens(['name' => '[^/.]+'])\n ->allows(['POST']);\n\n // Pages\n $map->get('affiliates', 'affiliates/', $this->page('affiliates'))->allows(['POST']);\n $map->get('articles', 'articles/', $this->page('articles'))->allows(['POST']);\n $map->get('captcha', 'captcha/', $this->page('captcha'))->allows(['POST']);\n $map->get('comments', 'comments/', $this->page('comments'))->allows(['POST']);\n $map->get('confirm', 'confirm/', $this->page('confirm'))->allows(['POST']);\n $map->get('dlfile', 'dlfile/', $this->page('dlfile'))->allows(['POST']);\n $map->get('download', 'download/', $this->page('download'))->allows(['POST']);\n $map->get('feed', 'feed/', $this->page('feed'))->allows(['POST']);\n $map->get('gallery', 'gallery/', $this->page('gallery'))->allows(['POST']);\n $map->get('login', 'login/', $this->page('login'))->allows(['POST']);\n $map->get('logout', 'logout/', $this->page('logout'))->allows(['POST']);\n $map->get('news', 'news/', $this->page('news'))->allows(['POST']);\n $map->get('news_search', 'news_search/', $this->page('news_search'))->allows(['POST']);\n $map->get('press', 'press/', $this->page('press'))->allows(['POST']);\n $map->get('register', 'register/', $this->page('register'))->allows(['POST']);\n $map->get('search', 'search/', $this->page('search'))->allows(['POST']);\n $map->get('shop', 'shop/', $this->page('shop'))->allows(['POST']);\n $map->get('style_selection/', 'style_selection/', $this->page('style_selection'))->allows(['POST']);\n $map->get('user', 'user/', $this->page('user'))->allows(['POST']);\n $map->get('user_edit', 'user_edit/', $this->page('user_edit'))->allows(['POST']);\n $map->get('user_list', 'user_list/', $this->page('user_list'))->allows(['POST']);\n $map->get('viewer', 'viewer/', $this->page('viewer'))->allows(['POST']);\n });\n }", "private function registerRoutes(){\n $appRouter = require_once __DIR__.'/../../routes/app.php';\n $this->registerApplicationRoutes($appRouter);\n $this->registerApplicationRoutes($appRouter, false);\n $this->registerAuthenticationRoutes();\n }", "public function 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 testDefaultRouteClass(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/{controller}', ['action' => 'index']);\n $result = Router::url(['controller' => 'FooBar', 'action' => 'index']);\n $this->assertSame('/FooBar', $result);\n\n // This is needed because tests/bootstrap.php sets App.namespace to 'App'\n static::setAppNamespace();\n\n Router::defaultRouteClass('DashedRoute');\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/cake/{controller}', ['action' => 'cake']);\n $result = Router::url(['controller' => 'FooBar', 'action' => 'cake']);\n $this->assertSame('/cake/foo-bar', $result);\n\n $result = Router::url(['controller' => 'FooBar', 'action' => 'index']);\n $this->assertSame('/FooBar', $result);\n\n Router::reload();\n Router::defaultRouteClass('DashedRoute');\n $routes = Router::createRouteBuilder('/');\n $routes->fallbacks();\n\n $result = Router::url(['controller' => 'FooBar', 'action' => 'index']);\n $this->assertSame('/foo-bar', $result);\n }", "public function testUrlGenerationWithRoutePathWithContext(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/articles', 'Articles::index');\n $routes->connect('/articles/view/*', 'Articles::view');\n $routes->connect('/admin/articles', 'Admin/Articles::index');\n $routes->connect('/cms/articles', 'Cms.Articles::index');\n $routes->connect('/cms/admin/articles', 'Cms.Admin/Articles::index');\n\n $request = new ServerRequest([\n 'params' => [\n 'plugin' => 'Cms',\n 'prefix' => 'Admin',\n 'controller' => 'Articles',\n 'action' => 'edit',\n 'pass' => ['3'],\n ],\n 'url' => '/admin/articles/edit/3',\n ]);\n Router::setRequest($request);\n\n $expected = '/articles';\n $result = Router::pathUrl('Articles::index');\n $this->assertSame($result, $expected);\n $result = Router::url(['_path' => 'Articles::index']);\n $this->assertSame($result, $expected);\n\n $expected = '/articles/view/3';\n $result = Router::pathUrl('Articles::view', [3]);\n $this->assertSame($result, $expected);\n $result = Router::url(['_path' => 'Articles::view', 3]);\n $this->assertSame($result, $expected);\n\n $expected = '/admin/articles';\n $result = Router::pathUrl('Admin/Articles::index');\n $this->assertSame($result, $expected);\n $result = Router::url(['_path' => 'Admin/Articles::index']);\n $this->assertSame($result, $expected);\n\n $expected = '/cms/admin/articles';\n $result = Router::pathUrl('Cms.Admin/Articles::index');\n $this->assertSame($result, $expected);\n $result = Router::url(['_path' => 'Cms.Admin/Articles::index']);\n $this->assertSame($result, $expected);\n\n $expected = '/cms/articles';\n $result = Router::pathUrl('Cms.Articles::index');\n $this->assertSame($result, $expected);\n $result = Router::url(['_path' => 'Cms.Articles::index']);\n $this->assertSame($result, $expected);\n }", "public function test_admin_auth_routes(){\n Event::fake();\n $this->get('admin/dashboard')->assertStatus(403);\n }", "public static function routes(): void\n {\n //\n }", "public function testBasicTest()\n {\n /** @var \\UserFrosting\\Sprinkle\\Core\\Router $router */\n $router = $this->ci->router;\n\n // Get all routes. We should have more than 0 in a default install\n $routes = $router->getRoutes();\n $this->assertNotCount(0, $routes);\n\n // Try to get a path\n $path = $router->pathFor('index');\n $this->assertEquals('/', $path);\n }", "private function parseRoutes()\n {\n // Turn the segment array into a URI string\n $uri = implode('/', $this->uri->getSegments());\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri])) {\n return $this->setRequest(explode('/', $this->routes[$uri]));\n }\n\n // Loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val) {\n // Convert wild-cards to RegEx\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri)) {\n // Do we have a back-reference?\n if (strpos($val, '$') !== false && strpos($key, '(') !== false) {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n\n return $this->setRequest(explode('/', $val));\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->setRequest($this->uri->getSegments());\n }", "static public function invalidUriMethodProvider()\n {\n return array(\n array('some crap', 'GET'),\n array('*', 'POST'),\n array('ftp://example.com/baz/bar', 'GET'),\n array('host:433', 'HEAD'),\n array('http://example.com/path', 'CONNECT')\n );\n }", "public function testInvalidRouteAction()\n {\n $res = $this->controller->catchAll();\n $body = $res->getBody();\n $this->assertStringContainsString(\"Route not found\", $body);\n }", "public function testNonPublicPages()\n {\n $this->get('/home')->assertStatus(302);\n $this->get('/routes')->assertStatus(302);\n $this->get('/themes')->assertStatus(302);\n $this->get('/users')->assertStatus(302);\n $this->get('/users/create')->assertStatus(302);\n $this->get('/phpinfo')->assertStatus(302);\n $this->get('/profile/create')->assertStatus(302);\n }", "private function getRoute(){\n\t}", "public function testUrlWritingWithPrefixesAndCustomRoutes(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect(\n '/admin/login',\n ['controller' => 'Users', 'action' => 'login', 'prefix' => 'Admin']\n );\n $request = new ServerRequest([\n 'url' => '/',\n 'params' => [\n 'plugin' => null,\n 'controller' => 'Posts',\n 'action' => 'index',\n 'prefix' => 'Admin',\n ],\n 'webroot' => '/',\n ]);\n Router::setRequest($request);\n $result = Router::url(['controller' => 'Users', 'action' => 'login']);\n $this->assertSame('/admin/login', $result);\n\n $result = Router::url(['controller' => 'Users', 'action' => 'login']);\n $this->assertSame('/admin/login', $result);\n }", "public function testUrlGenerationWithRegexQualifiedParams(): void\n {\n $routes = Router::createRouteBuilder('/');\n\n $routes->connect(\n '{language}/galleries',\n ['controller' => 'Galleries', 'action' => 'index'],\n ['language' => '[a-z]{3}']\n );\n\n $routes->connect(\n '/{language}/{admin}/{controller}/{action}/*',\n ['admin' => 'admin'],\n ['language' => '[a-z]{3}', 'admin' => 'admin']\n );\n\n $routes->connect(\n '/{language}/{controller}/{action}/*',\n [],\n ['language' => '[a-z]{3}']\n );\n\n $result = Router::url(['admin' => false, 'language' => 'dan', 'action' => 'index', 'controller' => 'Galleries']);\n $expected = '/dan/galleries';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['admin' => false, 'language' => 'eng', 'action' => 'index', 'controller' => 'Galleries']);\n $expected = '/eng/galleries';\n $this->assertSame($expected, $result);\n\n Router::reload();\n $routes = Router::createRouteBuilder('/');\n $routes->connect(\n '/{language}/pages',\n ['controller' => 'Pages', 'action' => 'index'],\n ['language' => '[a-z]{3}']\n );\n $routes->connect('/{language}/{controller}/{action}/*', [], ['language' => '[a-z]{3}']);\n\n $result = Router::url(['language' => 'eng', 'action' => 'index', 'controller' => 'Pages']);\n $expected = '/eng/pages';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['language' => 'eng', 'controller' => 'Pages']);\n $this->assertSame($expected, $result);\n\n $result = Router::url(['language' => 'eng', 'controller' => 'Pages', 'action' => 'add']);\n $expected = '/eng/Pages/add';\n $this->assertSame($expected, $result);\n\n Router::reload();\n $routes = Router::createRouteBuilder('/');\n $routes->connect(\n '/forestillinger/{month}/{year}/*',\n ['plugin' => 'Shows', 'controller' => 'Shows', 'action' => 'calendar'],\n ['month' => '0[1-9]|1[012]', 'year' => '[12][0-9]{3}']\n );\n\n $result = Router::url([\n 'plugin' => 'Shows',\n 'controller' => 'Shows',\n 'action' => 'calendar',\n 'month' => '10',\n 'year' => '2007',\n 'min-forestilling',\n ]);\n $expected = '/forestillinger/10/2007/min-forestilling';\n $this->assertSame($expected, $result);\n\n Router::reload();\n $routes = Router::createRouteBuilder('/');\n $routes->connect(\n '/kalender/{month}/{year}/*',\n ['plugin' => 'Shows', 'controller' => 'Shows', 'action' => 'calendar'],\n ['month' => '0[1-9]|1[012]', 'year' => '[12][0-9]{3}']\n );\n $routes->connect('/kalender/*', ['plugin' => 'Shows', 'controller' => 'Shows', 'action' => 'calendar']);\n\n $result = Router::url(['plugin' => 'Shows', 'controller' => 'Shows', 'action' => 'calendar', 'min-forestilling']);\n $expected = '/kalender/min-forestilling';\n $this->assertSame($expected, $result);\n\n $result = Router::url([\n 'plugin' => 'Shows',\n 'controller' => 'Shows',\n 'action' => 'calendar',\n 'year' => '2007',\n 'month' => '10',\n 'min-forestilling',\n ]);\n $expected = '/kalender/10/2007/min-forestilling';\n $this->assertSame($expected, $result);\n }", "public function GetRouteGetRequestsOnly ();", "public function testGetRoutePathMissing()\n {\n $this->assertEquals('', $this->uut->getRoutePath('unknown'));\n }", "protected function add_legacy_configured_routes($builder) {\n // routes/default => root\n $class = Cfg::get('routes/default');\n if ($class)\n $builder->root(array('controller'=>$this->controller_name($class)));\n \n // routes/404 => /404\n $class = Cfg::get('routes/404');\n if ($class)\n $builder->match('/404', array('controller'=>$this->controller_name($class)));\n }", "abstract public function getRoute();", "protected function _rebuildRoutes() {\n \\Drupal::service('router.builder')->rebuild();\n }", "public function testRouteContinuations() {\n\t\tRouter::connect('/{:locale:en|de|it|jp}/{:args}', [], ['continue' => true]);\n\t\tRouter::connect('/{:controller}/{:action}/{:id:[0-9]+}');\n\n\t\t$request = new Request(['url' => '/en/posts/view/1138']);\n\t\t$result = Router::process($request)->params;\n\t\t$expected = [\n\t\t\t'controller' => 'Posts', 'action' => 'view', 'id' => '1138', 'locale' => 'en'\n\t\t];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$request = new Request(['url' => '/en/foo/bar/baz']);\n\t\t$this->assertNull(Router::parse($request));\n\n\t\tRouter::reset();\n\t\tRouter::connect('/{:args}/{:locale:en|de|it|jp}', [], ['continue' => true]);\n\t\tRouter::connect('/{:controller}/{:action}/{:id:[0-9]+}');\n\n\t\t$request = new Request(['url' => '/posts/view/1138/en']);\n\t\t$result = Router::process($request)->params;\n\t\t$this->assertEqual($expected, $result);\n\n\t\tRouter::reset();\n\t\tRouter::connect('/{:locale:en|de|it|jp}/{:args}', [], ['continue' => true]);\n\t\tRouter::connect('/', 'Pages::view');\n\n\t\t$request = new Request(['url' => '/en']);\n\t\t$result = Router::process($request)->params;\n\t\t$expected = ['locale' => 'en', 'controller' => 'Pages', 'action' => 'view'];\n\t\t$this->assertEqual($expected, $result);\n\t}", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }" ]
[ "0.68819845", "0.6517291", "0.6515215", "0.64230275", "0.63861775", "0.637783", "0.6365655", "0.6297713", "0.6234368", "0.6229927", "0.6049419", "0.6035521", "0.6035405", "0.59113884", "0.5872114", "0.5870536", "0.5868843", "0.5864645", "0.5854764", "0.58521515", "0.5803533", "0.57803166", "0.5777471", "0.5777134", "0.57770914", "0.5773484", "0.5771265", "0.574474", "0.5693633", "0.56914", "0.56487757", "0.5645495", "0.56403154", "0.56383324", "0.56373054", "0.5630217", "0.56262857", "0.56201804", "0.560029", "0.55860966", "0.55832976", "0.55737776", "0.55710876", "0.5570345", "0.5566636", "0.55650866", "0.5557245", "0.5552591", "0.55481315", "0.5544312", "0.5541083", "0.5511169", "0.55033296", "0.54987663", "0.5489245", "0.5486536", "0.5485206", "0.5478992", "0.5477163", "0.5468711", "0.54674846", "0.54660463", "0.54581165", "0.5452438", "0.54445595", "0.54430777", "0.54428494", "0.544092", "0.5438902", "0.5438631", "0.54364765", "0.54342747", "0.5433563", "0.54241586", "0.5422381", "0.541204", "0.54120374", "0.54098296", "0.53950566", "0.5394188", "0.5391632", "0.5387925", "0.53871953", "0.53856844", "0.538472", "0.5384131", "0.537544", "0.53739774", "0.5368364", "0.53673327", "0.53673327", "0.53673327", "0.53673327", "0.53673327", "0.53673327", "0.53673327", "0.53673327", "0.53673327", "0.53673327", "0.53673327" ]
0.818495
0
Test all other routes
public function testOtherRoutes() { /*//Filters disabled during unit tests unless you enable them //I need them enabled because they log the user in as anonymous Route::enableFilters(); // /google redirects to http://google.com $clicksBefore = Router::where('slug', '=', 'google')->first()->clicks; $this->call('GET', '/google'); $this->assertRedirectedTo('http://google.com'); $clicksAfter = Router::where('slug', '=', 'google')->first()->clicks; $this->assertEquals(++$clicksBefore, $clicksAfter); // /google2 is a disabled route $this->call('GET', '/google2'); $this->assertResponseStatus(404); $this->call('GET', '/99/invalid'); $this->assertResponseStatus(404); $this->call('GET', '/this/is/invalid'); $this->assertResponseStatus(404); // Test search route // ?? // Test net route // ?? // Test login route $this->call('GET', '/login'); $this->assertResponseOk(); // Test logout route redirects to / $this->call('GET', '/logout'); $this->assertRedirectedTo('/'); */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testSecondaryRoutes()\n\t{\n\t\t/*//Filters disabled during unit tests unless you enable them\n\t\t//I need them enabled because they log the user in as anonymous\n\t\tRoute::enableFilters();\n\n\t\t// Test /1 redirects to /home\n\t\t$this->call('GET', '/1');\n\t\t$this->assertRedirectedTo('/home');\n\n\t\t// Test /1/anything/here redirects to /home\n\t\t$this->call('GET', '/1/anything/here');\n\t\t$this->assertRedirectedTo('/home');\n\n\t\t// Test /1 redirects to /home\n\t\t$this->call('GET', '/post/1');\n\t\t$this->assertRedirectedTo('/home');\n\n\t\t// Test /9d3e171a-62a9-e958-bdfa-d6f224ca8cad redirects to /home\n\t\t$this->call('GET', '/9d3e171a-62a9-e958-bdfa-d6f224ca8cad');\n\t\t$this->assertRedirectedTo('/home');\n\n\t\t// Test /home2 is post 1 (this is an optional route to post 1)\n\t\t// /home2 displays post 1, it does not redirect to /home\n\t\t$clicksBefore = Router::where('slug', '=', 'home2')->first()->clicks;\n\t\t$response = $this->call('GET', '/home2');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(1, $post->id);\n\t\t$this->assertEquals('9d3e171a-62a9-e958-bdfa-d6f224ca8cad', $post->uuid);\n\t\t$clicksAfter = Router::where('slug', '=', 'home2')->first()->clicks;\n\t\t$this->assertEquals(++$clicksBefore, $clicksAfter);\n\n\n\t\t// Test /home3 which is a disabled route\n\t\t$this->call('GET', '/home3');\n\t\t$this->assertResponseStatus(404);\n\n\n\t\t// ##### Login as mReschke #####\n\t\tAuth::login(User::find(2)); Auth::user()->login();\n\n\t\t// Test /13/blah redirects to /13/mreschke-home-page\n\t\t$this->call('GET', '/13/blah');\n\t\t$this->assertRedirectedTo('/13/mreschke-home-page');\n\n\t\t// Test /13 and /13/ redirects to /13/mreschke-home-page\n\t\t$this->call('GET', '/13');\n\t\t$this->assertRedirectedTo('/13/mreschke-home-page');\n\t\t$this->call('GET', '/13/');\n\t\t$this->assertRedirectedTo('/13/mreschke-home-page');\n\n\t\t// Test /13 redirects to /13/mreschke-home-page\n\t\t$this->call('GET', '/post/13');\n\t\t$this->assertRedirectedTo('/13/mreschke-home-page');\n\t\t*/\n\n\t}", "public function testPrimaryRoutes()\n\t{\n\t/*\t//Filters disabled during unit tests unless you enable them\n\t\t//I need them enabled because they log the user in as anonymous\n\t\tRoute::enableFilters();\n\n\t\t// Test base route\n\t\t// Should show post id 1\n\t\t$response = $this->call('GET', '/');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(1, $post->id);\n\t\t$this->assertEquals('9d3e171a-62a9-e958-bdfa-d6f224ca8cad', $post->uuid);\n\n\t\t// Test /home is post 1\n\t\t$clicksBefore = Router::where('slug', '=', 'home')->first()->clicks;\n\t\t$response = $this->call('GET', '/home');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(1, $post->id);\n\t\t$this->assertEquals('9d3e171a-62a9-e958-bdfa-d6f224ca8cad', $post->uuid);\n\t\t$clicksAfter = Router::where('slug', '=', 'home')->first()->clicks;\n\t\t$this->assertEquals(++$clicksBefore, $clicksAfter);\n\n\t\t// Test /about is post 2\n\t\t$response = $this->call('GET', '/about');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(2, $post->id);\n\t\t$this->assertEquals('f1112648-782e-aad3-785d-640fcfefaa9b', $post->uuid);\n\n\n\t\t// ##### Login as mReschke #####\n\t\tAuth::login(User::find(2)); Auth::user()->login();\n\n\t\t// Test /13/mreschke-home-page (non named route)\n\t\t$response = $this->call('GET', '/13/mreschke-home-page');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(13, $post->id);\n\t\t$this->assertEquals('1a52e0e3-3174-7b2b-a582-03a39e52e34a', $post->uuid);\n\n\t\t// Test /14/squaethem-home-page (non named route)\n\t\t$response = $this->call('GET', '/14/squaethem-home-page');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(14, $post->id);\n\t\t$this->assertEquals('e80e907e-50d4-8ed4-70f7-5d1815672966', $post->uuid);\n\t\t*/\n\n\t}", "public function testBasicRouteMatching() {\n\t\tRouter::connect('/hello', ['controller' => 'Posts', 'action' => 'index']);\n\t\t$expected = ['controller' => 'Posts', 'action' => 'index'];\n\n\t\tforeach (['/hello/', '/hello', 'hello/', 'hello'] as $url) {\n\t\t\t$this->request->url = $url;\n\t\t\t$result = Router::parse($this->request);\n\t\t\t$this->assertEqual($expected, $result->params);\n\t\t\t$this->assertEqual(['controller'], $result->persist);\n\t\t}\n\t}", "public function testRoutes()\n {\n foreach ($this->testRoutes as $method => $testRoutes) {\n switch ($method) {\n case 'GET':\n foreach ($testRoutes as $path => $param) {\n $response = $this->json($method, '/' . $path . $param);\n $response->assertJsonStructure(['error']);\n }\n break;\n case 'PUT':\n case 'POST':\n case 'DELETE':\n foreach ($testRoutes as $path => $params) {\n $response = $this->json($method, '/' . $path . $params['path_params'], $params['request_params']);\n dump($response->getContent());\n $response->assertJsonStructure(['message']);\n }\n break;\n }\n }\n }", "public function testLegacyRoutes()\n\t{\n\t\t/*//Filters disabled during unit tests unless you enable them\n\t\t//I need them enabled because they log the user in as anonymous\n\t\tRoute::enableFilters();\n\n\t\t// Test /topic/1 redirects to /home\n\t\t$this->call('GET', '/topic/1');\n\t\t$this->assertRedirectedTo('/home');\n\t\t$this->call('GET', '/topic/1/doesnt/matter');\n\t\t$this->assertRedirectedTo('/home');\n\n\t\t// ?? files/1 does not currently redirect\n\t\t// not sure if it should or not yet\n\t\t*/\n\n\t}", "public function testFindAllByRoute()\n {\n $this->markTestIncomplete('WebTestCases are not implemented yet.');\n }", "public function testUrlCatchAllRoute(): void\n {\n Router::createRouteBuilder('/')\n ->connect('/*', ['controller' => 'Categories', 'action' => 'index']);\n $result = Router::url(['controller' => 'Categories', 'action' => 'index', '0']);\n $this->assertSame('/0', $result);\n\n $expected = [\n 'plugin' => null,\n 'controller' => 'Categories',\n 'action' => 'index',\n 'pass' => ['0'],\n '_matchedRoute' => '/*',\n ];\n $result = Router::parseRequest($this->makeRequest('/0', 'GET'));\n unset($result['_route']);\n $this->assertEquals($expected, $result);\n\n $result = Router::parseRequest($this->makeRequest('0', 'GET'));\n unset($result['_route']);\n $this->assertEquals($expected, $result);\n }", "public function test_route_override() {\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' ),\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t'should_exist' => false,\n\t\t\t)\n\t\t);\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( 'POST' ),\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t'should_exist' => true,\n\t\t\t),\n\t\t\ttrue\n\t\t);\n\n\t\t// Check we only have one route.\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$endpoint = $endpoints['/test-ns/test'];\n\t\t$this->assertCount( 1, $endpoint );\n\n\t\t// Check it's the right one.\n\t\t$this->assertArrayHasKey( 'should_exist', $endpoint[0] );\n\t\t$this->assertTrue( $endpoint[0]['should_exist'] );\n\t}", "public function testGetRoutes()\n {\n $this->disableExceptionHandling();\n\n $this->visit(route('voyager.login'));\n $this->type('[email protected]', 'email');\n $this->type('password', 'password');\n $this->press(__('voyager::generic.login'));\n\n $urls = [\n route('voyager.dashboard'),\n route('voyager.media.index'),\n route('voyager.settings.index'),\n route('voyager.roles.index'),\n route('voyager.roles.create'),\n route('voyager.roles.show', 1),\n route('voyager.roles.edit', 1),\n route('voyager.users.index'),\n route('voyager.users.create'),\n route('voyager.users.show', 1),\n route('voyager.users.edit', 1),\n route('voyager.posts.index'),\n route('voyager.posts.create'),\n route('voyager.posts.show', 1),\n route('voyager.posts.edit', 1),\n route('voyager.pages.index'),\n route('voyager.pages.create'),\n route('voyager.pages.show', 1),\n route('voyager.pages.edit', 1),\n route('voyager.categories.index'),\n route('voyager.categories.create'),\n route('voyager.categories.show', 1),\n route('voyager.categories.edit', 1),\n route('voyager.menus.index'),\n route('voyager.menus.create'),\n route('voyager.menus.show', 1),\n route('voyager.menus.edit', 1),\n route('voyager.database.index'),\n route('voyager.bread.edit', 'categories'),\n route('voyager.database.edit', 'categories'),\n route('voyager.database.create'),\n ];\n\n foreach ($urls as $url) {\n $response = $this->call('GET', $url);\n $this->assertEquals(200, $response->status(), $url.' did not return a 200');\n }\n }", "public function test_AllRoutesNoAuthAvailable()\n {\n //should be possible without any DB entry\n\n Session::start();\n $token = session('_token');\n\n $credentials = array(\n 'email' => '[email protected]',\n 'password' => 'wrongpass',\n '_token' => $token\n );\n\n $session = array(\n '_token' => $token\n );\n\n //index has redirect\n $this->get('/')->assertStatus(302);\n\n //index redirect to login page\n $this->followingRedirects()->get('/')\n ->assertStatus(200)\n ->assertViewIs('auth.login')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //Auth Login\n $this->get('/login')->assertStatus(200)\n ->assertViewIs('auth.login')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n $this->followingRedirects()->post('/login', $credentials)->assertStatus(200)\n ->assertViewIs('auth.login');\n\n //Auth Logout POST\n $this->followingRedirects()->post('/logout', ['_token' => $token])->assertStatus(200)\n ->assertViewIs('auth.login')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //Auth Logout GET\n $this->get('/logout')->assertStatus(302);\n $this->followingRedirects()->get('/logout')->assertStatus(200)\n ->assertViewIs('auth.login')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //Register Message GET\n $this->get('/auth/success')->assertStatus(200)\n ->assertSee('Dein Benutzer muss erst freigeschaltet werden. Du wirst per E-Mail benachrichtigt.')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n // impressum\n $this->get('/impressum')->assertStatus(200)->assertSee('Impressum')->assertSee('Datenschutz');;\n\n // datenschutz\n $this->get('/datenschutz')->assertStatus(200)->assertSee('Impressum')->assertSee('Datenschutz');\n\n // order\n $this->get('/order')->assertStatus(200)\n ->assertSee('Dein Dienstplan')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->get('/order/create/basic')->assertStatus(200)\n ->assertSee('Basis Paket')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->get('/order/create/module')->assertStatus(200)\n ->assertSee('Modulares Paket')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->get('/order/create/support')->assertStatus(200)\n ->assertSee('Support Paket')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //following sites should not be available for guests and redirect to login\n\n //home\n $this->followingRedirects()->get('/home')->assertStatus(200)->assertViewIs('auth.login');\n\n //mailtest\n $this->followingRedirects()->get('/mailtest')->assertStatus(200)->assertViewIs('auth.login');\n\n //pdf extract\n $this->followingRedirects()->get('/pdf')->assertStatus(200)->assertViewIs('auth.login');\n\n //sendService PDF\n $this->followingRedirects()->get('/sendServicePDF')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/sendServicePDF', $session)->assertStatus(419);\n\n //userguide\n $this->followingRedirects()->get('/userguide')->assertStatus(200)->assertViewIs('auth.login');\n\n //superadmin user\n $this->followingRedirects()->get('/superadmin/user')->assertStatus(200)->assertViewIs('auth.login');\n\n //qualification (resource)\n $this->followingRedirects()->get('/qualification')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/qualification', $session)->assertStatus(419);\n $this->followingRedirects()->get('/qualification/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/qualification/1', $session)->assertStatus(419);\n $this->delete('/qualification/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/qualification/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/qualification/create')->assertStatus(200)->assertViewIs('auth.login');\n\n //user (resource)\n $this->followingRedirects()->get('/user')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/user', $session)->assertStatus(419);\n $this->followingRedirects()->get('/user/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/user/1', $session)->assertStatus(419);\n $this->delete('/user/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/user/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/user/create')->assertStatus(200)->assertViewIs('auth.login');\n\n //user approve\n $this->followingRedirects()->get('/user/approve/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/user/approve/1', $session)->assertStatus(419);\n\n //client (resource)\n $this->followingRedirects()->get('/client')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/client', $session)->assertStatus(419);\n $this->followingRedirects()->get('/client/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/client/1', $session)->assertStatus(419);\n $this->delete('/client/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/client/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/client/create')->assertStatus(200)->assertViewIs('auth.login');\n\n // client apply\n $this->followingRedirects()->get('/clientapply')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/client/1/apply')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/client/1/apply', $session)->assertStatus(419);\n $this->delete('/client/1/apply', $session)->assertStatus(419);\n $this->put('/client/1/apply', $session)->assertStatus(419);\n $this->followingRedirects()->get('/client/1/apply/revert')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/client/1/apply/revert', $session)->assertStatus(419);\n $this->delete('/client/1/apply/revert', $session)->assertStatus(419);\n $this->put('/client/1/apply/revert', $session)->assertStatus(419);\n $this->followingRedirects()->get('/client/1/removeuser/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/client/1/removeuser/1', $session)->assertStatus(419);\n $this->delete('/client/1/removeuser/1', $session)->assertStatus(419);\n $this->put('/client/1/removeuser/1', $session)->assertStatus(419);\n\n //client update module\n $this->followingRedirects()->get('/client/module')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/client/module', $session)->assertStatus(419);\n $this->delete('/client/module', $session)->assertStatus(419);\n $this->put('/client/module', $session)->assertStatus(419);\n\n //change client\n $this->followingRedirects()->get('/changeclient/1')->assertStatus(200)->assertViewIs('auth.login');\n\n //service (resource)\n $this->followingRedirects()->get('/service')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/servicehistory')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/service/finalize/1')->assertStatus(200)->assertViewIs('auth.login');\n\n $this->post('/service', $session)->assertStatus(419);\n $this->followingRedirects()->get('/service/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/service/1', $session)->assertStatus(419);\n $this->delete('/service/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/service/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/service/create')->assertStatus(200)->assertViewIs('auth.login');\n\n $this->followingRedirects()->get('/service/1/delete')->assertStatus(200)->assertViewIs('auth.login');\n\n //training (resource)\n $this->followingRedirects()->get('/training')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/training', $session)->assertStatus(419);\n $this->followingRedirects()->get('/training/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/training/1', $session)->assertStatus(419);\n $this->delete('/training/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/training/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/training/create')->assertStatus(200)->assertViewIs('auth.login');\n\n $this->followingRedirects()->get('/training/1/delete')->assertStatus(200)->assertViewIs('auth.login');\n\n //training user\n $this->followingRedirects()->get('/training/training_user/1/delete')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/training/training_user/1/delete', $session)->assertStatus(419);\n $this->delete('/training/training_user/1/delete', $session)->assertStatus(419);\n $this->put('/training/training_user/1/delete', $session)->assertStatus(419);\n\n //news (resource)\n $this->followingRedirects()->get('/news')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/news', $session)->assertStatus(419);\n $this->followingRedirects()->get('/news/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/news/1', $session)->assertStatus(419);\n $this->delete('/news/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/news/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/news/create')->assertStatus(200)->assertViewIs('auth.login');\n\n $this->followingRedirects()->get('/news/1/delete')->assertStatus(200)->assertViewIs('auth.login');\n\n //holiday (resource)\n $this->followingRedirects()->get('/holiday')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/holiday', $session)->assertStatus(419);\n $this->followingRedirects()->get('/holiday/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/holiday/1', $session)->assertStatus(419);\n $this->delete('/holiday/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/holiday/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/holiday/create')->assertStatus(200)->assertViewIs('auth.login');\n\n $this->followingRedirects()->get('/holiday/storeservice/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/holiday/storetraining/1')->assertStatus(200)->assertViewIs('auth.login');\n\n // Qualification <-> User\n $this->post('/qualification_user/create', $session)->assertStatus(419);\n $this->followingRedirects()->get('/qualification_user/delete/1/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/qualification_user/delete/1/1', $session)->assertStatus(419);\n\n // Client <-> User\n $this->post('/client_user/admin', $session)->assertStatus(419);\n $this->post('/client_user/trainingeditor', $session)->assertStatus(419);\n\n //Position\n $this->followingRedirects()->get('/position/1/subscribe')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/subscribe', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/1/subscribe_user/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/subscribe_user/1', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/1/unsubscribe')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/unsubscribe', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/1/unsubscribe_user/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/unsubscribe_user/1', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/1/authorize')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/authorize', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/1/deauthorize')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/deauthorize', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/list_notAuthorized')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/list_notAuthorized', $session)->assertStatus(419);\n\n $this->followingRedirects()->get('/position/1/position_user')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/position/1/position_user', $session)->assertStatus(419);\n\n //Statistic\n $this->followingRedirects()->get('/statistic')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/statistic', $session)->assertStatus(419);\n\n //Calendar\n $this->followingRedirects()->get('/calendar')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/calendar', $session)->assertStatus(419);\n $this->followingRedirects()->get('/calendar/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/calendar/1', $session)->assertStatus(419);\n $this->delete('/calendar/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/calendar/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/calendar/1/delete')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/calendar/create')->assertStatus(200)->assertViewIs('auth.login');\n\n //Survey\n $this->followingRedirects()->get('/survey')->assertStatus(200)->assertViewIs('auth.login');\n $this->post('/survey', $session)->assertStatus(419);\n $this->followingRedirects()->get('/survey/1')->assertStatus(200)->assertViewIs('auth.login');\n $this->put('/survey/1', $session)->assertStatus(419);\n $this->delete('/survey/1', $session)->assertStatus(419);\n $this->followingRedirects()->get('/survey/1/edit')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->get('/survey/create')->assertStatus(200)->assertViewIs('auth.login');\n $this->followingRedirects()->post('/survey/vote/1')->assertStatus(419);\n $this->followingRedirects()->get('/survey/postpone/1')->assertStatus(200)->assertViewIs('auth.login');\n }", "public function test_route_merge() {\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' ),\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\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( '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// Check both routes exist.\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$endpoint = $endpoints['/test-ns/test'];\n\t\t$this->assertCount( 2, $endpoint );\n\t}", "public function testCanSendRoute()\n {\n $this->assertEmpty([]);\n\n $routes = $this->app->getRoutes();\n\n foreach ($routes as $route) {\n if ($route->getName() == 'api.oauth') {\n $this->assertContains('POST', $route->getAllowedMethods());\n $this->assertEquals('/api/oauth', $route->getPath());\n }\n }\n }", "public function testRoutes()\n\t{\n\t\t$routes = new Routes();\n\n\t\t$result = $routes->process(array('test', 'test'));\n\n\t\t$this->assertEquals('test', $result);\n\t}", "public function testSimpleRoutes() {\n\t\t$rules = array(\n\t\t\t'Index/Index' => '/',\n\t\t\t'Index/Simple' => '/test/simple',\n\t\t\t'Index/Language' => '/test/en',\n\t\t\t'Index/WithoutSlash' => '/test'\n\t\t);\n\n\t\t$controller = null;\n\t\t$action = null;\n\n\t\tforeach ($this->languages as $language) {\n\t\t\tforeach ($rules as $controllerAction => $uri) {\n\t\t\t\t$route = $this->getRouter('/' . $language . $uri, $rules)->getRoute($controller, $action);\n\n\t\t\t\t$this->assertEquals($controllerAction, $route, 'The route for an empty request does not match');\n\t\t\t\t$this->assertEquals($route, $controller . '/' . $action,\n\t\t\t\t\t'The outgoing parameters do not match the returned route');\n\t\t\t}\n\t\t}\n\t}", "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 }", "public function test_example()\n {\n $response = $this->get('/');\n $response->assertStatus(302);\n\n $response = $this->get('/dashboard');\n $response->assertStatus(302);\n\n $response = $this->get('/institution');\n $response->assertStatus(302);\n\n $response = $this->get('/institution/create');\n $response->assertStatus(302);\n\n $response = $this->get('/bookings');\n $response->assertStatus(302);\n\n $response = $this->get('/bookings/create');\n $response->assertStatus(302);\n\n $response = $this->get('/bookings/create/rooms');\n $response->assertStatus(302);\n\n $response = $this->get('/rooms/edit');\n $response->assertStatus(302);\n\n $response = $this->get('/rooms/editseats');\n $response->assertStatus(302);\n\n $response = $this->get('/rooms/selectEdit');\n $response->assertStatus(302);\n\n $response = $this->get('/trackAndTrace');\n $response->assertStatus(302);\n\n $response = $this->get('/trackThenTrace');\n $response->assertStatus(404);\n\n $response = $this->get('/editRoom');\n $response->assertStatus(404);\n\n $response = $this->get('/booking');\n $response->assertStatus(404);\n\n $response = $this->get('/showbooking');\n $response->assertStatus(404);\n\n $this->assertTrue(true);\n\n }", "public function test_AllRoutesAsUserAvailable()\n {\n //fill DB with demo data to act like a User\n $this->artisan('demo:createDemoClient');\n\n //session\n Session::start();\n $token = session('_token');\n $credentials = array(\n 'email' => '[email protected]',\n 'password' => 'user',\n '_token' => $token\n );\n\n //act as User\n $user = User::where('name', '=', \"User\")->first();\n\n //Login as User\n //GET|HEAD | login\n $this->get('/login')->assertStatus(200)\n ->assertViewIs('auth.login')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //POST | login\n $this->followingRedirects()->post('/login', $credentials)->assertStatus(200)\n ->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //Login: redirect to home\n $this->actingAs($user)->followingRedirects()->get('/login')\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n\n //GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | /\n $this->actingAs($user)->followingRedirects()->get('/')\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->actingAs($user)->followingRedirects()->post('/', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->actingAs($user)->followingRedirects()->put('/', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->actingAs($user)->followingRedirects()->patch('/', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->actingAs($user)->followingRedirects()->delete('/', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->actingAs($user)->followingRedirects()->options('/', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | auth/success\n $this->actingAs($user)->followingRedirects()->get('/auth/success')\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | captcha/api/{config?}\n $this->actingAs($user)->followingRedirects()->get('/captcha/api/')\n ->assertStatus(200);\n\n //GET|HEAD | captcha/{config?}\n $this->actingAs($user)->followingRedirects()->get('/captcha')\n ->assertStatus(200);\n\n //GET|HEAD | changeclient/{client}\n $this->actingAs($user)->followingRedirects()->get('/changeclient/'.($user->currentclient_id))->assertStatus(200);\n $this->actingAs($user)->followingRedirects()->get('/changeclient/'.($user->currentclient_id+1))->assertStatus(500);\n\n //POST | client\n $this->actingAs($user)->followingRedirects()->post('/client', ['_token' => $token])->assertStatus(402); //not allowed in demo mode\n\n //GET|HEAD | client\n $this->actingAs($user)->followingRedirects()->get('/client')->assertStatus(402); //only as superadmin\n\n //GET|HEAD | client/create\n $this->actingAs($user)->followingRedirects()->get('/client/create')->assertStatus(402); //only as superadmin\n\n //GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | client/module\n $this->actingAs($user)->followingRedirects()->get('/client/module')->assertStatus(402); //only as superadmin\n $this->actingAs($user)->followingRedirects()->post('/client/module', ['_token' => $token,])->assertStatus(402); //only as superadmin\n $this->actingAs($user)->followingRedirects()->put('/client/module', ['_token' => $token])->assertStatus(402); //only as superadmin\n $this->actingAs($user)->followingRedirects()->patch('/client/module', ['_token' => $token])->assertStatus(402); //only as superadmin\n $this->actingAs($user)->followingRedirects()->delete('/client/module', ['_token' => $token])->assertStatus(402); //only as superadmin\n $this->actingAs($user)->followingRedirects()->options('/client/module')->assertStatus(402); //only as superadmin\n\n //GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | client/{clientid}/apply\n $this->actingAs($user)->get('/client/'.$user->currentclient_id.'/apply')->assertStatus(302);\n $this->actingAs($user)->post('/client/'.$user->currentclient_id.'/apply', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->put('/client/'.$user->currentclient_id.'/apply', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->patch('/client/'.$user->currentclient_id.'/apply', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->delete('/client/'.$user->currentclient_id.'/apply', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->options('/client/'.$user->currentclient_id.'/apply')->assertStatus(302);\n\n //GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | client/{clientid}/apply/revert\n $this->actingAs($user)->get('/client/'.$user->currentclient_id.'/apply/revert')->assertStatus(302);\n $this->actingAs($user)->post('/client/'.$user->currentclient_id.'/apply/revert', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->put('/client/'.$user->currentclient_id.'/apply/revert', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->patch('/client/'.$user->currentclient_id.'/apply/revert', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->delete('/client/'.$user->currentclient_id.'/apply/revert', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->options('/client/'.$user->currentclient_id.'/apply/revert')->assertStatus(302);\n\n //GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | client/{clientid}/removeuser/{userid}\n $this->actingAs($user)->get('/client/'.$user->currentclient_id.'/removeuser/'.$user->id)->assertStatus(402); //only if admin of client and not in demo mode\n $this->actingAs($user)->post('/client/'.$user->currentclient_id.'/removeuser/'.$user->id, ['_token' => $token])->assertStatus(402); //only if admin of client and not in demo mode\n $this->actingAs($user)->put('/client/'.$user->currentclient_id.'/removeuser/'.$user->id, ['_token' => $token])->assertStatus(402); //only if admin of client and not in demo mode\n $this->actingAs($user)->patch('/client/'.$user->currentclient_id.'/removeuser/'.$user->id, ['_token' => $token])->assertStatus(402); //only if admin of client and not in demo mode\n $this->actingAs($user)->delete('/client/'.$user->currentclient_id.'/removeuser/'.$user->id, ['_token' => $token])->assertStatus(402); //only if admin of client and not in demo mode\n $this->actingAs($user)->options('/client/'.$user->currentclient_id.'/removeuser/'.$user->id)->assertStatus(402); //only if admin of client and not in demo mode\n\n //PUT|PATCH | client/{client}\n $this->actingAs($user)->put('/client/'.$user->currentclient_id, ['_token' => $token])->assertStatus(402); //only if admin of client or superadmin and not in demo mode\n $this->actingAs($user)->patch('/client/'.$user->currentclient_id, ['_token' => $token])->assertStatus(402); //only if admin of client or superadmin and not in demo mode\n\n //GET|HEAD | client/{client}\n $this->actingAs($user)->get('/client/'.$user->currentclient_id)->assertStatus(402); //only if admin of client or superadmin\n\n //DELETE | client/{client}\n $this->actingAs($user)->delete('/client/'.$user->currentclient_id, ['_token' => $token])->assertStatus(402); //only if superadmin and not in demo mode\n\n //GET|HEAD | client/{client}/edit\n $this->actingAs($user)->get('/client/'.$user->currentclient_id.'/edit')->assertStatus(402); //only if admin of client or superadmin\n\n //POST | client_user/admin\n $this->actingAs($user)->post('/client_user/admin', ['_token' => $token, 'client_id' => $user->currentclient_id, 'user_id' => $user->id])\n ->assertStatus(402); //only if admin of client or superadmin\n\n //POST | client_user/trainingeditor\n $this->actingAs($user)->post('/client_user/trainingeditor', ['_token' => $token, 'client_id' => $user->currentclient_id, 'user_id' => $user->id])\n ->assertStatus(402); //only if admin of client or superadmin\n\n //GET|HEAD | clientapply\n $this->actingAs($user)->get('/clientapply')\n ->assertStatus(200)->assertViewIs('client.apply')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | datenschutz\n $this->actingAs($user)->get('/datenschutz')\n ->assertStatus(200)->assertViewIs('legal.datenschutz')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //POST | holiday\n $this->actingAs($user)->followingRedirects()->post('/holiday', ['_token' => $token, 'from' => Carbon::now(), 'to' => Carbon::now()->addDay()])\n ->assertStatus(200);\n\n //GET|HEAD | holiday\n $this->actingAs($user)->get('/holiday')\n ->assertStatus(200)->assertViewIs('holiday.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | holiday/create\n $this->actingAs($user)->get('/holiday/create')\n ->assertStatus(200)->assertViewIs('holiday.create')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | holiday/storeservice/{service}\n $this->actingAs($user)->followingRedirects()->get('/holiday/storeservice/'.Service::first()->id)\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | holiday/storetraining/{training}\n $this->actingAs($user)->followingRedirects()->get('/holiday/storetraining/'.Training::first()->id)\n ->assertStatus(200)->assertViewIs('training.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | holiday/{holiday}\n $this->actingAs($user)->get('/holiday/'.Holiday::first()->id)\n ->assertStatus(200);\n\n //PUT|PATCH | holiday/{holiday}\n $this->actingAs($user)->followingRedirects()->put('/holiday/'.Holiday::first()->id, ['_token' => $token])\n ->assertStatus(200);\n $this->actingAs($user)->followingRedirects()->patch('/holiday/'.Holiday::first()->id, ['_token' => $token])\n ->assertStatus(200);\n\n //GET|HEAD | holiday/{holiday}/edit\n $this->actingAs($user)->followingRedirects()->get('/holiday/'.Training::first()->id.'/edit')\n ->assertStatus(200)->assertViewIs('holiday.edit')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //DELETE | holiday/{holiday}\n $this->actingAs($user)->get('/holiday/'.Holiday::first()->id)\n ->assertStatus(200);\n\n //GET|HEAD | home\n $this->actingAs($user)->get('/home')\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | impressum\n $this->actingAs($user)->get('/impressum')\n ->assertStatus(200)->assertViewIs('legal.impressum')\n ->assertSee('Impressum')->assertSee('Datenschutz')\n ->assertSee('Inhaltlich Verantwortlicher gem. ');\n\n //GET|HEAD | mailtest\n $this->actingAs($user)->followingRedirects()->get('/mailtest')\n ->assertStatus(200)->assertViewIs('email.serviceslist')\n ->assertSee('Stand')->assertSee('Uhr')->assertSee('Datum');\n\n //GET|HEAD | news\n $this->actingAs($user)->get('/news')\n ->assertStatus(200)->assertViewIs('news.index');\n\n //POST | news\n $this->actingAs($user)->post('/news', ['_token' => $token])->assertStatus(402); //only admin of client\n\n //GET|HEAD | news/create\n $this->actingAs($user)->get('/news/create')->assertStatus(402); //only admin of client\n\n //GET|HEAD | news/{news}\n $this->actingAs($user)->get('/news/'.News::first()->id)->assertStatus(200);\n\n //DELETE | news/{news}\n $this->actingAs($user)->delete('/news/'.News::first()->id, ['_token' => $token])->assertStatus(402); //only admin of client\n\n //PUT|PATCH | news/{news}\n $this->actingAs($user)->put('/news/'.News::first()->id, ['_token' => $token])->assertStatus(402); //only admin of client\n $this->actingAs($user)->patch('/news/'.News::first()->id, ['_token' => $token])->assertStatus(402); //only admin of client\n\n //GET|HEAD | news/{news}/delete\n $this->actingAs($user)->get('/news/'.News::first()->id.'/delete')->assertStatus(402); //only admin of client\n\n //GET|HEAD | news/{news}/edit\n $this->actingAs($user)->get('/news/'.News::first()->id.'/edit')->assertStatus(402); //only admin of client\n\n //GET|HEAD | order\n $this->actingAs($user)->get('/order')\n ->assertStatus(200)->assertViewIs('order.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | order/create/{package}\n $this->actingAs($user)->get('/order/create/basic')\n ->assertStatus(200)->assertViewIs('order.order')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //POST | order/{package}\n\n //POST | password/email\n $this->actingAs($user)->followingRedirects()->post('/password/email', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | password/reset\n $this->actingAs($user)->followingRedirects()->get('/password/reset')\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //POST | password/reset\n $this->actingAs($user)->followingRedirects()->post('/password/reset', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | password/reset/{token}\n\n //GET|HEAD | pdf\n $response = $this->actingAs($user)->get('/pdf');\n self::assertTrue($response->headers->get(\"content-type\") == \"application/pdf\");\n\n //GET|POST|HEAD | position/list_notAuthorized\n $this->actingAs($user)->get('/position/list_notAuthorized')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/position/list_notAuthorized', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|POST|HEAD | position/{id}/authorize\n $this->actingAs($user)->get('/position/1/authorize')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/position/1/authorize', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|POST|HEAD | position/{id}/deauthorize\n $this->actingAs($user)->get('/position/1/deauthorize')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/position/1/deauthorize', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|POST|HEAD | position/{id}/position_user\n $this->actingAs($user)->get('/position/1/position_user')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/position/1/position_user', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|POST|HEAD | position/{id}/subscribe\n $this->actingAs($user)->get('/position/1/subscribe')->assertStatus(200);\n $this->actingAs($user)->post('/position/1/subscribe', ['_token' => $token])->assertStatus(200);\n\n //GET|POST|HEAD | position/{id}/unsubscribe\n $this->actingAs($user)->get('/position/1/unsubscribe')->assertStatus(200);\n $this->actingAs($user)->post('/position/1/unsubscribe', ['_token' => $token])->assertStatus(200);\n\n //GET|POST|HEAD | position/{positionid}/subscribe_user/{userid}\n $this->actingAs($user)->get('/position/1/subscribe_user/1')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/position/1/subscribe_user/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|POST|HEAD | position/{positionid}/unsubscribe_user/{userid}\n $this->actingAs($user)->get('/position/1/subscribe_user/1')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/position/1/subscribe_user/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //POST | qualification\n $this->actingAs($user)->post('/qualification', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|HEAD | qualification\n $this->actingAs($user)->get('/qualification')->assertStatus(402);//only as admin\n\n //GET|HEAD | qualification/create\n $this->actingAs($user)->get('/qualification/create')->assertStatus(402);//only as admin\n\n //PUT|PATCH | qualification/{qualification}\n $this->actingAs($user)->put('/qualification/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //DELETE | qualification/{qualification}\n $this->actingAs($user)->delete('/qualification/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|HEAD | qualification/{qualification}\n $this->actingAs($user)->get('/qualification/1')->assertStatus(402);//only as admin\n\n //GET|HEAD | qualification/{qualification}/edit\n $this->actingAs($user)->get('/qualification/1/edit')->assertStatus(402);//only as admin\n\n //POST | qualification_user/create\n $this->actingAs($user)->post('/qualification_user/create', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|POST|HEAD | qualification_user/delete/{user_id}/{qualification_id}\n $this->actingAs($user)->get('/qualification_user/delete/1/1')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/qualification_user/delete/1/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|HEAD | register\n $this->actingAs($user)->followingRedirects()->get('/register')\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //POST | register\n $this->actingAs($user)->followingRedirects()->post('/register', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|POST|HEAD | sendServicePDF\n $this->actingAs($user)->get('/sendServicePDF')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/sendServicePDF', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|HEAD | service\n $this->actingAs($user)->get('/service')\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD\n $this->actingAs($user)->get('/servicehistory')->assertStatus(402); //only as admin\n //GET|HEAD\n $this->actingAs($user)->get('/service/finalize/1')->assertStatus(402); //only as admin\n\n //POST | service\n $this->actingAs($user)->post('/service', ['_token' => $token])->assertStatus(403); //only as admin\n\n //GET|HEAD | service/create\n $this->actingAs($user)->get('/service/create')->assertStatus(402);//only as admin\n\n //DELETE | service/{service}\n $this->actingAs($user)->delete('/service/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //PUT|PATCH | service/{service}\n $this->actingAs($user)->put('/service/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|HEAD | service/{service}\n $this->actingAs($user)->get('/service/1')->assertStatus(402);//only as admin\n\n //GET|HEAD | service/{service}/delete\n $this->actingAs($user)->get('/service/1/delete')->assertStatus(402);//only as admin\n\n //GET|HEAD | service/{service}/edit\n $this->actingAs($user)->get('/service/1/edit')->assertStatus(402);//only as admin\n\n //GET|POST|HEAD | statistic\n $this->actingAs($user)->get('/statistic')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/statistic', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|HEAD | superadmin/user\n $this->actingAs($user)->get('/superadmin/user')->assertStatus(402);//only as superadmin\n\n //POST | training\n $this->actingAs($user)->followingRedirects()->post('/training', ['_token' => $token])->assertStatus(402); //only as admin or trainingseditor\n\n //GET|HEAD | training\n $this->actingAs($user)->get('/training')\n ->assertStatus(200)->assertViewIs('training.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | training/create\n $this->actingAs($user)->get('/training/create')->assertStatus(402);//only as admin\n\n //GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | training/training_user/{training_userid}/delete\n $training_user = Training_user::first();\n $this->actingAs($user)->followingRedirects()->get('/training/training_user/'.$training_user->id.'/delete')\n ->assertStatus(402);//only as admin\n $this->actingAs($user)->followingRedirects()->post('/training/training_user/'.$training_user->id.'/delete', ['_token' => $token])\n ->assertStatus(402);//only as admin\n $this->actingAs($user)->followingRedirects()->put('/training/training_user/'.$training_user->id.'/delete', ['_token' => $token])\n ->assertStatus(402);//only as admin\n $this->actingAs($user)->followingRedirects()->patch('/training/training_user/'.$training_user->id.'/delete', ['_token' => $token])\n ->assertStatus(402);//only as admin\n $this->actingAs($user)->followingRedirects()->delete('/training/training_user/'.$training_user->id.'/delete', ['_token' => $token])\n ->assertStatus(402);//only as admin\n\n //GET|HEAD | training/{training}\n $this->actingAs($user)->get('/training/1')->assertStatus(402);//only as admin or trainingeditor\n\n //PUT|PATCH | training/{training}\n $this->actingAs($user)->put('/training/1', ['_token' => $token])->assertStatus(402);//only as admin or trainingeditor\n\n //DELETE | training/{training}\n $this->actingAs($user)->delete('/training/1', ['_token' => $token])->assertStatus(402);//only as admin or trainingeditor\n\n //GET|HEAD | training/{training}/delete\n $this->actingAs($user)->get('/training/1/delete')->assertStatus(402);//only as admin or trainingeditor\n\n //GET|HEAD | training/{training}/edit\n $this->actingAs($user)->get('/training/1/edit')->assertStatus(402);//only as admin or trainingeditor\n\n //POST | user\n $this->actingAs($user)->post('/user', ['_token' => $token])->assertStatus(402);//not implemented\n\n //GET|HEAD | user\n $this->actingAs($user)->get('/user')->assertStatus(402);//only as admin\n\n //GET|POST|HEAD | user/approve/{id}\n $this->actingAs($user)->get('/user/approve/1')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/user/approve/1', ['_token' => $token])->assertStatus(402);//only as admin\n\n //GET|HEAD | user/create\n $this->actingAs($user)->get('/user/create')->assertStatus(402);//not implemented\n\n //PUT|PATCH | user/{user}\n //Not allowed in Demo Mode :(\n\n //GET|HEAD | user/{user}\n $this->actingAs($user)->get('/user/1')\n ->assertStatus(200)->assertViewIs('user.profile')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //DELETE | user/{user}\n $this->actingAs($user)->delete('/user/1', ['_token' => $token])->assertStatus(402);//only as superadmin\n\n //GET|HEAD | user/{user}/edit\n $this->actingAs($user)->get('/user/1/edit')->assertStatus(402);//only as admin\n\n //GET|HEAD | userguide\n $response = $this->actingAs($user)->get('/userguide');\n self::assertTrue($response->headers->get(\"content-type\") == \"application/pdf\");\n\n //Calendar\n //GET|HEAD | calendar\n $this->actingAs($user)->followingRedirects()->get('/calendar')\n ->assertStatus(200)->assertViewIs('calendar.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n //POST | Calendar\n $this->actingAs($user)->followingRedirects()->post('/calendar', ['_token' => $token])->assertStatus(200)->assertViewIs('calendar.index'); //only as admin or trainingseditor\n //GET | calendar/{calendar}\n $this->actingAs($user)->get('/calendar/1')->assertStatus(402); //only as admin or trainingseditor\n //PUT | calendar/{calendar}\n $this->actingAs($user)->put('/calendar/1', ['_token' => $token])->assertStatus(402); //only as admin or trainingseditor\n //DELETE | calendar/{calendar}\n $this->actingAs($user)->delete('/calendar/1', ['_token' => $token])->assertStatus(402); //only as admin or trainingseditor\n //GET | calendar/{calendar}\n $this->actingAs($user)->get('/calendar/1/edit')->assertStatus(402); //only as admin or trainingseditor\n //GET | calendar/{calendar}\n $this->actingAs($user)->get('/calendar/1/delete')->assertStatus(402); //only as admin or trainingseditor\n //GET|HEAD | alendar/create\n $this->actingAs($user)->get('/calendar/create')->assertStatus(402); //only as admin or trainingseditor\n\n //Survey\n //GET|HEAD survey\n $this->actingAs($user)->get('/survey')->assertStatus(402); //only if admin of client\n //POST survey\n $this->actingAs($user)->post('/survey', ['_token' => $token])->assertStatus(402); //only if admin of client\n //GET|HEAD survey/create\n $this->actingAs($user)->get('/survey/create')->assertStatus(402); //only if admin of client\n //GET|HEAD survey/postpone/{surveyid}\n $this->actingAs($user)->get('/survey/postpone/1')->assertRedirect()->assertCookieMissing('errormessage'); //redirect back on success\n //POST survey/vote/{surveyid}\n $this->actingAs($user)->post('/survey/vote/1', ['_token' => $token, 'value' => \"accept\"])->assertRedirect('/survey/1');\n //GET|HEAD survey/{survey} //set dateStart to yesterday to access a currently activ survey\n $survey = Survey::find(1);\n $survey->dateStart = Carbon::yesterday();\n $survey->save();\n $this->actingAs($user)->get('/survey/1')->assertOk();\n //PUT|PATCH survey/{survey}\n $this->actingAs($user)->put('/survey/1', ['_token' => $token])->assertStatus(402); //only if admin of client\n //DELETE survey/{survey}\n $this->actingAs($user)->delete('/survey/1', ['_token' => $token])->assertStatus(402); //only if admin of client\n //GET|HEAD survey/{survey}/edit\n $this->actingAs($user)->get('/survey/1/edit')->assertStatus(402); //only if admin of client\n\n //POST | logout\n $this->actingAs($user)->followingRedirects()->post('/logout', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('auth.login');\n\n //GET|HEAD | logout\n $this->actingAs($user)->followingRedirects()->get('/logout')\n ->assertStatus(200)->assertViewIs('auth.login');\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 testAddingDefinedRoutes() {\n\n\t\t$router = new Nether\\Avenue\\Router(static::$RequestData['Test']);\n\n\t\t$router->AddRoute('(@)//index','Nether\\Avenue\\RouteTest::Index');\n\t\t$router->AddRoute('(@)//test','Nether\\Avenue\\RouteTest::Test');\n\t\t$routes = $router->GetRoutes();\n\n\t\t(new Verify(\n\t\t\t'check that AddRoute() added the routes',\n\t\t\tcount($routes)\n\t\t))->equals(2);\n\n\t\t(new Verify(\n\t\t\t'check that the route domain condition translated right',\n\t\t\tcurrent($routes)->GetDomain()\n\t\t))->equals('`^(.+?)$`');\n\n\t\t(new Verify(\n\t\t\t'check that the route path condition translated right',\n\t\t\tcurrent($routes)->GetPath()\n\t\t))->equals('`^\\/index$`');\n\n\t\t(new Verify(\n\t\t\t'check that GetRoute() returns an object.',\n\t\t\tis_object($router->GetRoute())\n\t\t))->true();\n\n\t\t(new Verify(\n\t\t\t'check that GetRoute() selected the right route.',\n\t\t\t($router->GetRoute() instanceof Nether\\Avenue\\RouteHandler)\n\t\t))->true();\n\n\t\t(new Verify(\n\t\t\t'check that TranslateRouteHandler() parsed the class right.',\n\t\t\t\"Class: {$router->GetRoute()->GetClass()}, Method: {$router->GetRoute()->GetMethod()}\"\n\t\t))->equals('Class: Nether\\Avenue\\RouteTest, Method: Test');\n\n\t\t(new Verify(\n\t\t\t'check that GetRoute() found the arguments.',\n\t\t\t$router->GetRoute()->GetArgv()[0]\n\t\t))->equals('www.nether.io');\n\n\t\treturn;\n\t}", "public function testRouteRetrieval() {\n\t\t$expected = Router::connect('/hello', ['controller' => 'posts', 'action' => 'index']);\n\t\t$result = Router::get(0, true);\n\t\t$this->assertIdentical($expected, $result);\n\n\t\tlist($result) = Router::get(null, true);\n\t\t$this->assertIdentical($expected, $result);\n\t}", "public function testCatchAll()\n {\n // Setup the controller\n $controller = new LocWeatherController();\n $controller->setDI($this->di);\n\n // Test the controller action\n $res = $controller->catchAll();\n $body = $res->getBody();\n $this->assertStringContainsString(\"<h1>Route not found.</h1>\", $body);\n }", "public function testRequestRootIsAndIndex() {\n\n\t\t$r1 = new Nether\\Avenue\\Router(static::$RequestData['Root']);\n\t\t$r2 = new Nether\\Avenue\\Router(static::$RequestData['Index']);\n\n\t\t(new Verify(\n\t\t\t'path / request runs as /index',\n\t\t\t$r1->GetPath()\n\t\t))->equals('/index');\n\n\t\t(new Verify(\n\t\t\t'path /index runs as /index',\n\t\t\t$r2->GetPath()\n\t\t))->equals('/index');\n\n\n\t\treturn;\n\t}", "public function checkingRoute()\n {\n\n global $route;\n $request = new Request;\n $requested_url = $request->server('QUERY_STRING');\n //!TEST\n // echo $requested_url;\n // echo '<br />';\n $requested_method = $request->server('REQUEST_METHOD');\n //! TEST\n // echo $requested_method;\n /* \n // $server_all = $request->serverAll();\n // echo '<pre>';\n // print_r($server_all);\n // echo '</pre>' ;\n // $route_object = new Route;\n */\n $all_routes = $route->getRoutingTable();\n\n // NOTE\n /*\n ! ezzay ana shayf Class Web and Route min 3'eer use key word \n ? routes/web.php & Core/Route.php\n */\n //!TEST\n // echo '<pre>';\n // print_r($all_routes);\n // echo '</pre>';\n\n foreach ($all_routes as $url => $info) {\n\n /* !//? to test $url returns\n echo '<pre>';\n print_r($url);\n echo '</pre>' ;\n */\n // // if ($requested_url == $url){\n if (preg_match($url,$requested_url , $matches )){\n if( $requested_method == strtolower($info['method'])) {\n $this->controller = $info['controller'];\n $this->action = $info['action'];\n $this->params = array_slice($matches , 1);\n return true ;\n }else{\n die(\"405 method does not exist\");\n }\n /* //!deprecated if statement (wrong else statement)\n // if ($requested_url != $single_route) {\n // die('404 url not found');\n // }\n // elseif ($requested_method != $info['method']) {\n // die('405 method not allowed');\n // }\n // else {\n // $this->controller = $info['controller'];\n // $this->method = $info['method'];\n // }\n */\n }\n // echo $this->controller;\n // echo '<br />';\n // echo $this->action ;\n // echo '<br />';\n }\n die(\"404 not found\");\n }", "public function test_route_canonicalized_multiple() {\n\t\tregister_rest_route(\n\t\t\t'test-ns',\n\t\t\t'/test',\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => array( 'GET' ),\n\t\t\t\t\t'callback' => '__return_null',\n\t\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => array( 'POST' ),\n\t\t\t\t\t'callback' => '__return_null',\n\t\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t// Check the route was registered correctly.\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_raw_endpoint_data();\n\t\t$this->assertArrayHasKey( '/test-ns/test', $endpoints );\n\n\t\t// Check the route was wrapped in an array.\n\t\t$endpoint = $endpoints['/test-ns/test'];\n\t\t$this->assertArrayNotHasKey( 'callback', $endpoint );\n\t\t$this->assertArrayHasKey( 'namespace', $endpoint );\n\t\t$this->assertSame( 'test-ns', $endpoint['namespace'] );\n\n\t\t$filtered_endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$endpoint = $filtered_endpoints['/test-ns/test'];\n\t\t$this->assertCount( 2, $endpoint );\n\n\t\t// Check for both methods.\n\t\tforeach ( array( 0, 1 ) as $key ) {\n\t\t\t$this->assertArrayHasKey( 'callback', $endpoint[ $key ] );\n\t\t\t$this->assertArrayHasKey( 'methods', $endpoint[ $key ] );\n\t\t\t$this->assertArrayHasKey( 'args', $endpoint[ $key ] );\n\t\t}\n\t}", "public function testBasicTest()\n {\n /** @var \\UserFrosting\\Sprinkle\\Core\\Router $router */\n $router = $this->ci->router;\n\n // Get all routes. We should have more than 0 in a default install\n $routes = $router->getRoutes();\n $this->assertNotCount(0, $routes);\n\n // Try to get a path\n $path = $router->pathFor('index');\n $this->assertEquals('/', $path);\n }", "public function testGetRequestWithoutParametersIsRoutedToIndexAction()\n\t{\n\t\t$this->request->setMethod('GET');\n\t\t$this->dispatch('/api/event');\n\n\t\t$this->assertModule('api');\n\t\t$this->assertController('event');\n\t\t$this->assertAction('index');\t\t\n\t}", "public function testGetRouteCollection(): void\n {\n $collection = Router::getRouteCollection();\n $this->assertInstanceOf(RouteCollection::class, $collection);\n $this->assertCount(0, $collection->routes());\n }", "public function testCatchAllGet()\n {\n $res = $this->controller->catchAll();\n $this->assertNull($res);\n }", "public function testAction(){\n $router = $this->get('router.default');\n $rutas = $router->getRouteCollection();\n foreach ($rutas as $ruta) {\n if ($ruta instanceof Route)\n $pathVariables = $ruta->compile()->getPathVariables();\n ld(array(\n 'Ruta' => $ruta->getPath(),\n 'Variables' => $pathVariables\n ));\n }\n ldd();\n }", "public static function routes(): void\n {\n //\n }", "public function testIndex()\n\t{\n\t\t// correct route for posts\n\t\t$this->call('GET', '/api/posts');\n\t}", "public function testRouteParamDefaults(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/cache/*', ['prefix' => false, 'plugin' => true, 'controller' => 0, 'action' => 1]);\n\n $url = Router::url(['prefix' => '0', 'plugin' => '1', 'controller' => '0', 'action' => '1', 'test']);\n $expected = '/cache/test';\n $this->assertSame($expected, $url);\n\n try {\n Router::url(['controller' => '0', 'action' => '1', 'test']);\n $this->fail('No exception raised');\n } catch (Exception $e) {\n $this->assertTrue(true, 'Exception was raised');\n }\n\n try {\n Router::url(['prefix' => '1', 'controller' => '0', 'action' => '1', 'test']);\n $this->fail('No exception raised');\n } catch (Exception $e) {\n $this->assertTrue(true, 'Exception was raised');\n }\n }", "public function test_admin_auth_routes(){\n Event::fake();\n $this->get('admin/dashboard')->assertStatus(403);\n }", "public function testMatchingEmptyRoute() {\n\t\tRouter::connect('/', 'Users::view');\n\n\t\t$request = new Request(['base' => '/']);\n\t\t$url = Router::match(['controller' => 'users', 'action' => 'view'], $request);\n\t\t$this->assertIdentical('/', $url);\n\n\t\t$request = new Request(['base' => '']);\n\t\t$url = Router::match(['controller' => 'users', 'action' => 'view'], $request);\n\t\t$this->assertIdentical('/', $url);\n\t}", "public function testNonPublicPages()\n {\n $this->get('/home')->assertStatus(302);\n $this->get('/routes')->assertStatus(302);\n $this->get('/themes')->assertStatus(302);\n $this->get('/users')->assertStatus(302);\n $this->get('/users/create')->assertStatus(302);\n $this->get('/phpinfo')->assertStatus(302);\n $this->get('/profile/create')->assertStatus(302);\n }", "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 }", "private function _allowTestRoutes()\n {\n // [taz] See if the main config file is already loaded, so we can tell whether to remove testing routes.\n $mainConfig = Zend_Registry::getInstance()->get('CONFIG');\n \n // [taz] If $mainConfig isn't set, disallow test routes by default.\n if (!$mainConfig) {\n \treturn false;\n }\n \n // [taz] Return the setting of debug.allow_test_routes.\n return $mainConfig->debug->allow_test_routes; \n }", "public function testGetSitesTestsAll()\n {\n $this->sitesController->shouldReceive('retrieve')->once()->andReturn('Get Site 10 Mocked');\n $this->testsController->shouldReceive('index')->once()->andReturn('All Tests Mocked');\n\n $output = $this->behatRoutes->getSitesTests(array(1, 'tests', null, null));\n $this->assertEquals('All Tests Mocked', $output);\n }", "public function testTypeRoute()\n {\n $response = $this->get('/type/view/2');\n $response->assertStatus(302);\n }", "public function testArrayUrlsEmptyRouter(): void\n {\n Router::reload();\n $this->assertEmpty(Router::getRouteCollection()->routes());\n\n $this->get(['controller' => 'Posts', 'action' => 'index']);\n $this->assertResponseOk();\n $this->assertSame('value', $this->viewVariable('test'));\n }", "public function testProductRoutes()\n\t{\n\t\t//$response = $this->call('GET', '/admin/website/2/products');\n\t\t\n\t\t//$this->assertEquals(200, $response->status());\n\t}", "public function testRouteHandler() {\n\t\tRouter::connect('/login', 'Users::login');\n\n\t\tRouter::connect('/users/login', [], function($request) {\n\t\t\treturn new Response([\n\t\t\t\t'location' => ['controller' => 'Users', 'action' => 'login']\n\t\t\t]);\n\t\t});\n\n\t\t$result = Router::process(new Request(['url' => '/users/login']));\n\t\t$this->assertInstanceOf('lithium\\action\\Response', $result);\n\n\t\t$headers = ['Location' => '/login'];\n\t\t$this->assertEqual($headers, $result->headers);\n\t}", "public function testRootGetRoute()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200);\n $response->assertSee('Enter url to crawl');\n $response->assertSee('Last Pages Crawled');\n }", "public final function tearDown(){\n\n \\Disco\\classes\\Router::processRoutes();\n\n /**\n * did this requested URI not find a match? If so thats a 404.\n */\n if(!\\Disco\\classes\\Router::$routeMatch){\n $this['View']->serve(404);\n }//if\n else {\n $this['View']->serve();\n }//el\n\n }", "public function testUserControllerBasic()\n {\n $route = new Route();\n\n $route->set(null, \"user\", null, \"Anax\\Route\\MockHandlerController\");\n\n $path = \"user\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"indexActionGET\", $res);\n\n $path = \"user/\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"indexActionGET\", $res);\n\n $path = \"user/create\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"createAction\", $res);\n\n $path = \"user/list\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"listAction\", $res);\n }", "public function testFarms(): void\n {\n $response = $this->get('/farms');\n\n $response->assertOk();\n }", "public function user_route()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200);\n }", "public function testGetOnHitReturnsRoutesWithMethodAction(): void\n {\n $routes = new RouteCollection([\n new Route(\n new UriTemplate('foo'),\n new MethodRouteAction('Foo', 'bar'),\n [$this->createMock(IRouteConstraint::class)],\n [new MiddlewareBinding('foo')]\n )\n ]);\n $this->cache->set($routes);\n $this->assertEquals($routes, $this->cache->get());\n }", "public function testOnRoute()\n {\n// $mock = $this->getMock(\n// get_class($this->mvcKeeper),\n// [\n// 'hasAccess'\n// ],\n// [\n// $this->mvcKeeper->getRbac(),\n// $this->mvcKeeper->getAuthenticationService(),\n// $this->mvcKeeper->getAuthorizeBuilder()\n// ]\n// );\n $mock = $this->mvcKeeper;\n\n// $mock->expects($this->any())\n// ->method('hasAccess')\n// ->will($this->returnValue(false));\n\n\n \\Bootstrap::getServiceManager()->setAllowOverride(true)->setService('ControllerManager', $this->cm);\n\n $event = new MvcEvent();\n $routeMatch = new RouteMatch(['controller' => 'ControllerTestA', 'action' => 'someSpecificCustom']);\n $response = new Response();\n $application = new Application([], \\Bootstrap::getServiceManager());\n $event->setApplication($application);\n $event->setRouteMatch($routeMatch);\n $event->setResponse($response);\n\n $mock->onRoute($event);\n $this->assertEquals(403, $event->getResponse()->getStatusCode());\n }", "public function testRouteContinuations() {\n\t\tRouter::connect('/{:locale:en|de|it|jp}/{:args}', [], ['continue' => true]);\n\t\tRouter::connect('/{:controller}/{:action}/{:id:[0-9]+}');\n\n\t\t$request = new Request(['url' => '/en/posts/view/1138']);\n\t\t$result = Router::process($request)->params;\n\t\t$expected = [\n\t\t\t'controller' => 'Posts', 'action' => 'view', 'id' => '1138', 'locale' => 'en'\n\t\t];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$request = new Request(['url' => '/en/foo/bar/baz']);\n\t\t$this->assertNull(Router::parse($request));\n\n\t\tRouter::reset();\n\t\tRouter::connect('/{:args}/{:locale:en|de|it|jp}', [], ['continue' => true]);\n\t\tRouter::connect('/{:controller}/{:action}/{:id:[0-9]+}');\n\n\t\t$request = new Request(['url' => '/posts/view/1138/en']);\n\t\t$result = Router::process($request)->params;\n\t\t$this->assertEqual($expected, $result);\n\n\t\tRouter::reset();\n\t\tRouter::connect('/{:locale:en|de|it|jp}/{:args}', [], ['continue' => true]);\n\t\tRouter::connect('/', 'Pages::view');\n\n\t\t$request = new Request(['url' => '/en']);\n\t\t$result = Router::process($request)->params;\n\t\t$expected = ['locale' => 'en', 'controller' => 'Pages', 'action' => 'view'];\n\t\t$this->assertEqual($expected, $result);\n\t}", "public function testGetRoutePath()\n {\n $this->assertEquals('/default', $this->uut->getRoutePath('default'));\n }", "public function testIndex()\n {\n $requestInstance = null;\n\n $this->router->get('/customers/{id}/relationships/{relationship}', [\n 'middleware' => ['request', 'response'],\n function(\\Luminary\\Http\\Requests\\Index $request, $id, $relationship) use(&$requestInstance) {\n $requestInstance = $request;\n }\n ]);\n\n $this->get('/customers/1234/relationships/location');\n\n $this->assertResponseOk();\n $this->assertInstanceOf(\\Luminary\\Http\\Requests\\Index::class, $requestInstance);\n $this->assertInstanceOf(CustomerAuthorize::class, $requestInstance->getAuthorize());\n }", "function route_match() {\n global $route;\n global $html;\n global $config;\n global $matched_route;\n\n $url = explode('index.php', $_SERVER['REQUEST_URI']);\n $url = @str_replace('.', '', substr($url[1], 1));\n if(strpos($url, '?') !== false) {\n $url = explode('?', $url);\n $url = $url[0];\n }\n\n if(!$url) {\n $matched_route = 'ROOT';\n require_once __DIR__ . '/app/' . $route['ROOT'];\n return true;\n }\n\n if(substr($url, -1) == '/') {\n $url = substr($url, 0, -1);\n }\n\n // Check for simple route match\n if(array_key_exists($url, $route)) {\n $matched_route = $url;\n require_once __DIR__ . '/app/' . $route[$url];\n return true;\n }\n\n // Check for regex\n foreach($route as $r => $page) {\n $matches = array();\n\n if(preg_match('#' . $r . '$#', $url, $matches)) {\n array_shift($matches);\n\n $_GET['custom_arguments'] = $matches;\n\n $matched_route = $r;\n require_once __DIR__ . '/app/' . $page;\n return true;\n }\n }\n\n return false;\n}", "public function testNoRouteFound() {\n\n\t\t$router = new Nether\\Avenue\\Router(static::$RequestData['TestDeep']);\n\t\t$router->AddRoute('{@}//index','herp::derp');\n\t\t(new Verify(\n\t\t\t'no routes found return null',\n\t\t\t$router->GetRoute()\n\t\t))->equals(null);\n\n\t\treturn;\n\t}", "public function test_route_reject_empty_route() {\n\t\tregister_rest_route(\n\t\t\t'/test-empty-route',\n\t\t\t'',\n\t\t\tarray(\n\t\t\t\t'methods' => array( '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\ttrue\n\t\t);\n\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$this->assertFalse( isset( $endpoints['/test-empty-route'] ) );\n\t}", "public function testMethodIndexAction()\n {\n $route = new Route();\n\n $route->set(null, null, null, \"Anax\\Route\\MockHandlerController\");\n $this->assertTrue($route->match(\"\"));\n $res = $route->handle(\"\");\n $this->assertEquals(\"indexAction\", $res);\n\n $route->set(null, null, \"\", \"Anax\\Route\\MockHandlerController\");\n $this->assertTrue($route->match(\"\"));\n $res = $route->handle(\"\");\n $this->assertEquals(\"indexAction\", $res);\n\n $route->set(null, \"\", null, \"Anax\\Route\\MockHandlerController\");\n $this->assertTrue($route->match(\"\"));\n $res = $route->handle(\"\");\n $this->assertEquals(\"indexAction\", $res);\n }", "public function testGetUsingApplicationWithDefaultRoutes(): void\n {\n // first clean routes to have Router::$initialized === false\n Router::reload();\n\n $this->configApplication(Configure::read('App.namespace') . '\\ApplicationWithDefaultRoutes', null);\n\n $this->get('/some_alias');\n $this->assertResponseOk();\n $this->assertSame('5', $this->_getBodyAsString());\n }", "public function test_bad_index_route()\n {\n //incorrect uri\n $response = $this->get('api/students/1234');\n $response->assertStatus(404);\n }", "public function assertApiHasRoutes()\n {\n $hasApiRoutes = !empty($this->getApiRoutes());\n\n $this->assertTrue($hasApiRoutes);\n }", "public function testModuleRoute()\n {\n $modules = 'user|my-admin';\n\n $manager = $this->getUrlManager([\n 'rules' => [\n \"<module:$modules>\" => '<module>',\n \"<module:$modules>/<controller>\" => '<module>/<controller>',\n \"<module:$modules>/<controller>/<action>\" => '<module>/<controller>/<action>',\n '<url:[a-zA-Z0-9-/]+>' => 'site/index',\n ],\n ]);\n\n $result = $manager->parseRequest($this->getRequest('user'));\n $this->assertEquals(['user', []], $result);\n $result = $manager->parseRequest($this->getRequest('user/somecontroller'));\n $this->assertEquals(['user/somecontroller', []], $result);\n $result = $manager->parseRequest($this->getRequest('user/somecontroller/someaction'));\n $this->assertEquals(['user/somecontroller/someaction', []], $result);\n\n $result = $manager->parseRequest($this->getRequest('users/somecontroller/someaction'));\n $this->assertEquals(['site/index', ['url' => 'users/somecontroller/someaction']], $result);\n\n }", "public function testMethods0()\n{\n\n $actual = $this->route->methods();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function initializeRoutes()\n {\n $this->get(\"/\", \"index\");\n }", "function match_against_router() {\n\n require_once APP_PATH . '/config/routing.php';\n\n if (isset($routes)) {\n $base_url = $this->get_base_url();\n\n foreach ($routes as $key => $val) {\n if ($key == $base_url) {\n return $val;\n }\n }\n }\n return false;\n }", "public function testPublicPagesAllowed()\n {\n $this->get('/')->assertStatus(200);\n $this->get('/login')->assertStatus(200);\n $this->get('/password/reset')->assertStatus(200);\n $this->get('/register')->assertStatus(200);\n }", "public function matchRoute() {\n\t\tforeach($this->routes as $pattern => $callback) {\n\t\t\tif (preg_match('{^' . $pattern . '$}', $this->url) === 1) {\n\t\t\t\tif(!isset($_SESSION)){ session_start(); }\n\t\t\t\t// Parameters\n\t\t\t\t$params = array();\n\t\t\t\tif (isset($callback['params'])) {\n\t\t\t\t\t$url = explode('/', $this->url);\n\t\t\t\t\t$url = array_slice($url, -1 * count($callback['params']));\n\t\t\t\t\t$params = array_combine(array_keys($callback['params']), $url);\n\t\t\t\t}\n\t\t\t\t// Secured (Backend)\n\t\t\t\tif (isset($callback['secured'])) {\n\t\t\t\t\tif (isset($_SESSION['auth']) && $_SESSION['auth'] === true) {\n\t\t\t\t\t\t$this->dispatch($callback['controller'], $callback['action'], $params);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->url = 'http://' . $_SERVER['SERVER_NAME'] . '/login';\n\t\t\t\t\t\theader('location:' . $this->url);\n\t\t\t\t\t}\n\t\t\t\t// Secured (Frontend)\n\t\t\t\t} elseif (isset($callback['clientsecured'])) {\n\t\t\t\t\tif (isset($_SESSION['fauth']) && $_SESSION['fauth'] === true) {\n\t\t\t\t\t\t$this->dispatch($callback['controller'], $callback['action'], $params);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->url = 'home/login';\n\t\t\t\t\t\theader('location:' . $this->url);\n\t\t\t\t\t}\n\t\t\t\t// Simple\n\t\t\t\t} else {\n\t\t\t\t\t$this->dispatch($callback['controller'], $callback['action'], $params);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// No match\n\t\t$this->dispatch('Default', 'error', array('code' => 404));\n\t\treturn;\n\t}", "public function testIndexRoute()\n {\n $user = factory(User::class)->create();\n\n $this->actingAs($user)\n ->seeIsAuthenticatedAs($user)\n ->get(route('events.index'))\n ->assertStatus(200);\n }", "public function testGETRoute()\n {\n\n $response = $this->get('/api/role');\n\n $response->assertStatus(200);\n// $response->assertSee(\"Role management page\");\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 }", "private function route(): void\n {\n $url = $this->getUrlAsArray();\n $size = \\sizeof($url);\n $section = $this->section;\n\n for ($i = 0; $i < $size; $i++) {\n if ($i < ($size - 1)) {\n $section = $section->searchInSections($url[$i]);\n if ($section instanceof Section) {\n }\n } else {\n $route = $section->searchInRoutes($url[$i]);\n // TODO: Show view and use models\n if ($route instanceof Route) {\n\n }\n }\n }\n }", "public function routes()\n {\n register_rest_route('can', '/donation-forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'fundraisingPages'\n ],\n ]);\n\n register_rest_route('can', '/forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'forms'\n ],\n ]);\n\n register_rest_route('can', '/petitions', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'petitions'\n ],\n ]);\n\n register_rest_route('can', '/person/add', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'addPerson'\n ],\n ]);\n }", "public function testGetSpecificRouteHttpServer(): void\n {\n $this->get('/get/request_action/test_request_action');\n $this->assertResponseOk();\n $this->assertSame('This is a test', (string)$this->_response->getBody());\n }", "public function testIndexActionCanBeAccessed()\n {\n $this->dispatch('/venue');\n $this->assertResponseStatusCode(200);\n }", "public function testHttpOnly0()\n{\n\n $actual = $this->route->httpOnly();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testRun3()\n{\n\n // Traversed conditions\n // if ($this->isControllerAction()) == false (line 168)\n\n $actual = $this->route->run();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testRun4()\n{\n\n // Traversed conditions\n // if ($this->isControllerAction()) == false (line 168)\n\n $actual = $this->route->run();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testRouteMatchingWithNoInserts() {\n\t\tRouter::connect('/login', ['controller' => 'sessions', 'action' => 'add']);\n\t\t$result = Router::match(['controller' => 'sessions', 'action' => 'add']);\n\t\t$this->assertIdentical('/login', $result);\n\n\t\t$expected = \"No parameter match found for URL `('controller' => 'Sessions', \";\n\t\t$expected .= \"'action' => 'index')`.\";\n\t\t$this->assertException($expected, function() {\n\t\t\tRouter::match(['controller' => 'sessions', 'action' => 'index']);\n\t\t});\n\t}", "private function load_routes() {\n\n // 1. plugins routes\n foreach($this->context->plugins() as $plugin) {\n \n if(false === $plugin->is_type('IRoutesPlugin')) continue;\n\n foreach($plugin->routes() as $route_value) {\n $this->routes[]= $route_value;\n }\n }\n\n // 2. config.xml routes\n $config_routes= $this->context->config()->routes();\n // XXX: review, maybe Route[] should be returned by configurator?\n foreach( $config_routes as $r ) {\n // xxx. requirements\n $this->routes[]= new Route( \n (string)trim($r['name']), // name\n (string)trim($r['value']), // definition\n $this->context->config()->route_defaults($r) // array with defaults\n );\n }\n\n // Medick::dump($this->routes);\n\n // xxx: throw exception if 0 routes?\n }", "public function test_good_index_route()\n {\n //correct uri\n $response = $this->get('api/students');\n $response \n ->assertStatus(200)\n ->assertJson([['first_name'=> 'Chadwick'], ['first_name'=> 'Evelyn']]);\n }", "public function testIndex()\n {\n $this->call('GET', '/');\n $this->assertResponseOk();\n }", "public function testUriStrategyRouteReceivesCorrectArguments()\n {\n $collection = new Route\\RouteCollection;\n $collection->setStrategy(new UriStrategy);\n\n $collection->get('/route/{id}/{name}', function ($id, $name) {\n $this->assertEquals('2', $id);\n $this->assertEquals('phil', $name);\n });\n\n $dispatcher = $collection->getDispatcher();\n $response = $dispatcher->dispatch('GET', '/route/2/phil');\n }", "public function testRouteIndexClienteOk()\n {\n $this->call('GET', 'cliente');\n $this->assertResponseOk();\n }", "public function test_home()\n {\n $response = $this->get('/');\n $response->assertResponseOk();\n }", "public function getRoutes() {}", "public function testInvalidRouteAction()\n {\n $res = $this->controller->catchAll();\n $body = $res->getBody();\n $this->assertStringContainsString(\"Route not found\", $body);\n }", "public function testIndexActionCanBeAccessed()\n\t{\n\t\t$this->dispatch('/');\n\t\t$this->assertResponseStatusCode(200);\n\t\t$this->assertModuleName('DEC');\n\t\t$this->assertControllerName('DEC\\Controller\\Index');\n\t\t$this->assertControllerClass('IndexController');\n\t\t$this->assertMatchedRouteName('home');\n\t}", "protected function routes()\n {\n Nova::routes()\n ->withAuthenticationRoutes()\n ->withPasswordResetRoutes()\n ->register();\n }", "protected function routes()\n {\n Nova::routes()\n ->withAuthenticationRoutes()\n ->withPasswordResetRoutes()\n ->register();\n }", "public function testRun6()\n{\n\n // Traversed conditions\n // if ($this->isControllerAction()) == true (line 168)\n\n $actual = $this->route->run();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public static function register_rest_routes() {\n\t\tforeach (static::$apis as $api) {\n\t\t\t$api->register_rest_route();\n\t\t}\n }", "public function testGetUsingApplicationWithPluginRoutes(): void\n {\n // first clean routes to have Router::$initailized === false\n Router::reload();\n $this->clearPlugins();\n\n $this->configApplication(Configure::read('App.namespace') . '\\ApplicationWithPluginRoutes', null);\n\n $this->get('/test_plugin');\n $this->assertResponseOk();\n }", "public function testRouteConditionQueryVars() {\n\n\t\t$_GET['omg'] = 'true';\n\t\t$_GET['bbq'] = 'yey';\n\n\t\t$router = new Nether\\Avenue\\Router(static::$RequestData['TestQuery']);\n\n\t\t$router->ClearRoutes()->AddRoute('{@}//test??tacobell','herp::derp');\n\t\t$route = $router->GetRoute();\n\t\t(new Verify(\n\t\t\t'this route fails because there is no tacobell in get.',\n\t\t\t($route instanceof Nether\\Avenue\\RouteHandler)\n\t\t))->false();\n\n\t\t$router->ClearRoutes()->AddRoute('{@}//test??omg','herp::derp');\n\t\t$route = $router->GetRoute();\n\t\t(new Verify(\n\t\t\t'this route passes because we had omg',\n\t\t\t($route instanceof Nether\\Avenue\\RouteHandler)\n\t\t))->true();\n\n\t\t$router->ClearRoutes()->AddRoute('{@}//test??omg&bbq','herp::derp');\n\t\t$route = $router->GetRoute();\n\t\t(new Verify(\n\t\t\t'this route passes because we had omg and bbq',\n\t\t\t($route instanceof Nether\\Avenue\\RouteHandler)\n\t\t))->true();\n\n\t\t$router->ClearRoutes()->AddRoute('{@}//test??omg&wtf&bbq','herp::derp');\n\t\t$route = $router->GetRoute();\n\t\t(new Verify(\n\t\t\t'this route fails because we had omg and bbq, but no wtf.',\n\t\t\t($route instanceof Nether\\Avenue\\RouteHandler)\n\t\t))->false();\n\n\t\treturn;\n\t}", "public function assertApiRoutesAreAccessibleWhenAuthorized()\n {\n $assertion = true;\n $user = $this->createApiUser();\n $routes = $this->getApiRoutes();\n\n foreach ($routes as $route) {\n if (!$this->assertApiRouteIsAccessibleWhenAuthorized($user, $route)) {\n $assertion = false;\n break;\n }\n }\n\n $this->assertTrue($assertion);\n }", "public function testRouteSetsPattern()\n {\n $route1 = new \\Slim\\Route('/foo/bar', function () {});\n $this->assertEquals('/foo/bar', $route1->getPattern());\n }", "public function testSetupRoutingDebug(): void\n {\n $routes = $this->getExpectedDefaultRoutes();\n $routes['GET']['/debugbar/[{filePath:.*}]'] = DebugBarController::class . '::staticFileAction';\n $this->checkRoutes($routes, ['settings.debug' => true]);\n }", "public function testRun7()\n{\n\n // Traversed conditions\n // if ($this->isControllerAction()) == true (line 168)\n\n $actual = $this->route->run();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testIndex()\n {\n $this->get(route('index'))\n ->assertResponseStatus(200);\n }", "public function _before(\\FunctionalTester $I)\n {\n $I->amOnRoute('site/login');\n }", "public static function ignoreRoutes()\n {\n static::$registersRoutes = false;\n }", "public function testIndex(): void\n {\n $response = $this\n ->actingAs($this->user)\n ->get('/');\n $response->assertViewIs('home');\n $response->assertSeeText('Сообщения от всех пользователей');\n }", "public function testStackedContinuationRoutes() {\n\t\tRouter::connect('/admin/{:args}', ['admin' => true], ['continue' => true]);\n\t\tRouter::connect('/{:locale:en|de|it|jp}/{:args}', [], ['continue' => true]);\n\t\tRouter::connect('/{:controller}/{:action}/{:id:[0-9]+}', ['id' => null]);\n\n\t\t$request = new Request(['url' => '/en/foo/bar/5']);\n\t\t$expected = ['controller' => 'Foo', 'action' => 'bar', 'id' => '5', 'locale' => 'en'];\n\t\t$this->assertEqual($expected, Router::process($request)->params);\n\n\t\t$request = new Request(['url' => '/admin/foo/bar/5']);\n\t\t$expected = ['controller' => 'Foo', 'action' => 'bar', 'id' => '5', 'admin' => true];\n\t\t$this->assertEqual($expected, Router::process($request)->params);\n\n\t\t$request = new Request(['url' => '/admin/de/foo/bar/5']);\n\t\t$expected = [\n\t\t\t'controller' => 'Foo', 'action' => 'bar', 'id' => '5', 'locale' => 'de', 'admin' => true\n\t\t];\n\t\t$this->assertEqual($expected, Router::process($request)->params);\n\n\t\t$request = new Request(['url' => '/en/admin/foo/bar/5']);\n\t\t$this->assertEmpty(Router::process($request)->params);\n\n\t\t$result = Router::match(['Foo::bar', 'id' => 5]);\n\t\t$this->assertIdentical('/foo/bar/5', $result);\n\n\t\t$result = Router::match(['Foo::bar', 'id' => 5, 'admin' => true]);\n\t\t$this->assertIdentical('/admin/foo/bar/5', $result);\n\n\t\t$result = Router::match(['Foo::bar', 'id' => 5, 'admin' => true, 'locale' => 'jp']);\n\t\t$this->assertIdentical('/admin/jp/foo/bar/5', $result);\n\t}" ]
[ "0.79910094", "0.7811927", "0.75201195", "0.732454", "0.7244227", "0.71635914", "0.714568", "0.71409196", "0.71266437", "0.711719", "0.7026858", "0.7017001", "0.68593204", "0.6837021", "0.6762935", "0.66284937", "0.659048", "0.65550375", "0.65054977", "0.64900243", "0.6480425", "0.647926", "0.6424198", "0.641931", "0.6404338", "0.63967144", "0.63594735", "0.63302964", "0.6319515", "0.63150144", "0.63018394", "0.6289678", "0.6263663", "0.6252909", "0.62505496", "0.6236792", "0.62296385", "0.62135905", "0.6191366", "0.6185007", "0.61595255", "0.61511916", "0.61397094", "0.6135469", "0.61268944", "0.6119491", "0.6117507", "0.61086094", "0.6107558", "0.61036134", "0.60902655", "0.6088985", "0.6062492", "0.60528606", "0.6050499", "0.6049372", "0.60346794", "0.60298693", "0.60041577", "0.6002852", "0.59984934", "0.5985805", "0.598518", "0.59735227", "0.5951036", "0.5948373", "0.59465635", "0.59413517", "0.59320056", "0.593182", "0.5929083", "0.5923414", "0.5921864", "0.591704", "0.5914352", "0.5910984", "0.5903534", "0.5900693", "0.58964545", "0.58954835", "0.58927786", "0.58886886", "0.588828", "0.58874893", "0.5878641", "0.5864878", "0.5864878", "0.58601534", "0.58578306", "0.5855899", "0.5854035", "0.58501047", "0.58476734", "0.5846717", "0.58455664", "0.58405954", "0.58388597", "0.5838575", "0.5834547", "0.5827683" ]
0.86215246
0
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }", "public function isAuthorized() {}", "public function authorize()\n {\n return request()->loggedin_role === 1;\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized() {\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return \\Auth::check() ? true : false;\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function isAuthorized() {\n\t\t\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }", "public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }", "public function authorize()\n {\n return $this->auth->check();\n }", "public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function isAuthorized($request) {\n return true;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return TRUE;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }", "public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\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 authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }" ]
[ "0.8399528", "0.83755803", "0.83755803", "0.8342532", "0.8252005", "0.8246491", "0.82114965", "0.81451535", "0.81095713", "0.80819905", "0.799094", "0.79885143", "0.79823685", "0.7959513", "0.7950321", "0.7947592", "0.7925319", "0.7914417", "0.7899287", "0.7892423", "0.788904", "0.7888573", "0.7859566", "0.7840388", "0.7840388", "0.7837057", "0.7822922", "0.78116244", "0.7807664", "0.7791735", "0.7785959", "0.77811456", "0.77799726", "0.7762375", "0.7753727", "0.7719034", "0.7719034", "0.771513", "0.77119666", "0.77024996", "0.7692876", "0.76920134", "0.76908916", "0.7689253", "0.7672893", "0.7666128", "0.7665256", "0.76551706", "0.76500374", "0.76414853", "0.7641037", "0.7640742", "0.763345", "0.7629214", "0.7628391", "0.76269794", "0.76197463", "0.76197463", "0.76123273", "0.7602711", "0.7602425", "0.76015925", "0.76015925", "0.76007396", "0.7597639", "0.75951606", "0.7587452", "0.7584679", "0.7579657", "0.7562462", "0.7552138", "0.7551783", "0.75504583", "0.754368", "0.7541822", "0.75382096", "0.75371224", "0.75285393", "0.75156033", "0.7512623", "0.7499459", "0.74951875", "0.7494698", "0.74913925", "0.74869126", "0.7486122", "0.74787915", "0.7476152", "0.7471878", "0.7470218", "0.7464096", "0.74636215", "0.7463019", "0.74618673", "0.74608135", "0.7448682", "0.74387354", "0.743482", "0.74337745", "0.74311817", "0.7422809" ]
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ "title" => "required|string", "description" => "required|string", "feature_image" => "required|image", "tags" => "required|array", "tags.*" => "required|numeric|exists:tags,id", "categories" => "required|array", "categories.*" => "required|numeric|exists:categories,id", ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public function getRules()\n {\n return $this->validation_rules;\n }", "public function getValidationRules()\n {\n return [];\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }", "public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }", "public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }", "public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }", "protected function getValidRules()\n {\n return $this->validRules;\n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }", "public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n { \n return $this->rules;\n }", "public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }", "public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }", "public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }", "public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n return static::$rules;\n }", "function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}", "public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }", "public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "abstract protected function getValidationRules();", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }", "public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }", "public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }", "public function rules()\n {\n\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }", "public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }", "public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }", "public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }", "public function getValidationRules() : array;", "public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }", "public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }", "public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }", "public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }", "public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }", "protected function get_validation_rules()\n {\n }", "public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }", "public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules(Request $request)\n {\n return Qc::$rules;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }", "public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }" ]
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7675849", "0.76724476", "0.76665044", "0.7657698", "0.7641827", "0.7630892", "0.76293766", "0.7617708", "0.76102096", "0.7607475", "0.7602442", "0.7598732", "0.7597544", "0.75924", "0.75915384", "0.7588146", "0.7581354", "0.7555758", "0.755526", "0.7551423", "0.7546329", "0.7541439", "0.75366044", "0.75363225", "0.7530296", "0.7517988", "0.75155175", "0.7508439", "0.75069886", "0.7505724", "0.749979", "0.7495976", "0.74949056", "0.7492888", "0.7491117", "0.74901396", "0.7489651", "0.7486808", "0.7486108", "0.7479687", "0.7478561", "0.7469412", "0.74635684", "0.74619836", "0.7461325", "0.74591017", "0.7455279", "0.745352", "0.7453257", "0.7449877", "0.74486", "0.7441391", "0.7440429", "0.7435489", "0.7435326", "0.74341524", "0.7430354", "0.7429103", "0.7423808", "0.741936", "0.74152505", "0.7414828", "0.741382", "0.74126065", "0.74105227", "0.740555", "0.7404385", "0.74040926", "0.74015605", "0.73905706", "0.73837525", "0.73732615", "0.7371123", "0.7369176", "0.73619753", "0.73554605", "0.73448825", "0.7344659", "0.73427117", "0.73357755" ]
0.0
-1
Returns a piece of html code that can be used to represent this attribute in an HTML form.
function edit($record="", $fieldprefix="") { global $config_atkroot; $theme = &atkTheme::getInstance(); $page = &atkPage::getInstance(); $page->register_script($config_atkroot."atk/javascript/newwindow.js"); $page->register_script($config_atkroot."atk/javascript/class.atktoolbar.js"); $res = '<a href="javascript:modifySelection(\'<b>\',\'</b>\');"><img src="'.$theme->iconPath("bold","toolbar").'" border="0" alt="Vet"></a> '; $res .= '<a href="javascript:modifySelection(\'<i>\',\'</i>\');"><img src="'.$theme->iconPath("italic","toolbar").'" border="0" alt="Schuin"></a> '; $res .= '<a href="javascript:modifySelection(\'<u>\',\'</u>\');"><img src="'.$theme->iconPath("underline","toolbar").'" border="0" alt="Onderstreept"></a>'; // TODO/FIXME:This is platform specific code and should not be here // I think is still needed for older platform version (M1, M2) $res .= '&nbsp;<img src="'.$theme->iconPath("delimiter","toolbar").'" border="0">&nbsp;'; $res .= '<a href="javascript:popupSelection(\'pagesel.php\',\'pagesel\');" onmouseover="selectie=document.selection.createRange();"><img src="'.$theme->iconPath("link","toolbar").'" border="0" alt="Link"></a>'; return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHtml()\n {\n $attributes = $this->getAttributes();\n $attributes['value'] = htmlspecialchars($this->getValue());\n $attributes['type'] = 'hidden';\n $attributesStr = $this->_buildAttributeStr($attributes);\n\n $html = '<input ' . $attributesStr . ' />';\n return $html;\n }", "public function getHtmlAttribute() :string{\n return trim(call_user_func([$this, $this->formats[$this->syntax]]));\n }", "public function renderAttributeString()\n {\n $rendered = '';\n foreach ($this->attributes as $name => $value) {\n if ($name == 'name'\n && $this->hasAttribute('multiple')\n && substr($value, -2) != '[]'\n ) {\n $value .= '[]';\n }\n if (is_array($value)) {\n // arrays can be used for class attributes, space separated\n $set = '=\"' . htmlspecialchars(implode(' ', $value), ENT_QUOTES) .'\"';\n } elseif ($value===null) {\n // null indicates name only, like autofocus or readonly\n $set = '';\n } else {\n $set = '=\"' . htmlspecialchars($value, ENT_QUOTES) .'\"';\n }\n $rendered .= $name . $set . ' ';\n }\n return $rendered;\n }", "public function getHtmlAttributes() {}", "public function getHtmlAttributes() {}", "public function getHtmlAttributes();", "public function getMapAttributesHTML()\n {\n return $this->getAttributesHTML($this->getMapAttributes());\n }", "function get_string() {\n\t\t$attribs = $this->__attribs();\n\t\t$str = $this->__str();\n\t\t$str = '<a'.$attribs.'>'.$this->label.$str.'</a>';\n\t\treturn $str;\n\t}", "protected function renderAttributes()\n {\n $html = '';\n $no_key = ['loading'];\n\n foreach ($this->attributes as $key => $value) {\n if ($value === null) {\n continue;\n }\n\n if (is_numeric($key)) {\n $key = $value;\n }\n if (is_array($value)) {\n $value = implode(' ', $value);\n }\n\n if (in_array($key, $no_key, true)) {\n $element = htmlentities($value, ENT_QUOTES, 'UTF-8', false);\n } else {\n $element = $key . '=\"' . htmlentities($value, ENT_QUOTES, 'UTF-8', false) . '\"';\n }\n\n $html .= ' ' . $element;\n }\n\n return $html;\n }", "public function getHtml() {\n\t\t$html = '<' . $this->type;\n\t\t\n\t\tforeach($this->attributes as $name => $data) {\n\t\t\t$html .= $this->getHtmlAttribute($name, $data);\n\t\t}\n\t\t\n\t\tif( in_array($this->type, array('input', 'img', 'hr', 'br', 'meta', 'link')) ) {\n\t\t\t$html .= '/>';\n\t\t} else {\n\t\t\t$html .= '>';\n\t\t\t$html .= $this->getInnerHtml();\n\t\t\t$html .= '</' . $this->type . '>';\n\t\t}\n\t\t\n\t\treturn $html;\n\t}", "public function getAttributeString(){\n return $this->_form->getAttributeString($this->_attributes);\n }", "public function asHTML() {\n return \"$this->before<$this->tag_name$this->attributes />$this->after\";\n }", "public function __toString(){\n $this->attributes['id'] = $this->getId();\n $this->attributes['name'] = $this->getName();\n $value = get::array_def($this->attributes, 'value', '');\n $html = sprintf('<textarea%s>%s</textarea>', get::formattedAttributes($this->getAttributes()), get::entities($value));\n if( is::existset($this->attributes, 'autofocus') )\n $html .= $this->getAutoFocusScript($this->attributes['id']);\n return $html;\n }", "public function getElementHtml() {\n\t\t$html = '<button ';\n\t\t$html .= $this->getAttributesString();\n\t\t$html .= ' />';\n\t\t$html .= $this->value;\n\t\t$html .= '</button>';\n\n\t\treturn $html;\n\t}", "public function getAttribs(): string {\n\n $attribs = '';\n\n foreach ($this->attributes as $key => $value) {\n $key = strtolower($key);\n if ($value) {\n if ($key == 'value') {\n if (is_array($value)) {\n foreach ($value as $k => $i) {\n $value[$k] = htmlspecialchars($i);\n }\n }\n else {\n $value = htmlspecialchars($value);\n }\n }\n elseif ($key == 'href') {\n // For security reasons, we escape the values! They could be user-supplied hence skeptical.\n $value = urlencode($value);\n }\n $attribs .= $key . '=\"' . $value . '\" ';\n }\n else {\n $attribs .= $key . ' ';\n }\n }\n return trim($attribs);\n }", "public function __toString() {\n $str = \"<{$this->name} \";\n foreach ($this->attributes as $key => $val) {\n $str .= \"$key=\\\"$val\\\" \";\n }\n $str = rtrim($str) . \">\" . $this->value . \"</{$this->name}>\";\n\n return $str;\n }", "public function html()\n {\n return ($this->isEncrypted()) ? $this->encryptedField() : $this->regularField();\n }", "function toHtml()\n {\n $arr_return = parent::toHtml();\n $arr_return['html'] = '';\n $arr_radios = array();\n $arr_radios = $this->getAttribute('radios');\n $checked = $this->getAttribute('checked');\n $id = $this->getAttribute('id');\n if (is_array($arr_radios))\n {\n foreach ($arr_radios as $key => $value)\n {\n $encode_key = str_replace(' ', '_', $key);\n \n $arr_return['html'] .= '<input {attr_name=attr_value} {extra_attr} id=\"'\n .\"${id}_$encode_key\".'\" value=\"'.$key.'\"';\n $arr_return['html'] .= ($key == $checked)? ' checked' : '';\n $arr_return['html'] .= '%id|checked|radios|separator% />';\n $arr_return['html'] .= ($value != '')? \n '<label for=\"{attr_id}_'.$encode_key.'\">'.$value.'</label>' : '';\n $arr_return['html'] .= $this->arr_attr['separator'].\"\\n\";\n }\n }\n return $arr_return;\n }", "public function __toString()\n {\n\n $attributes = array();\n \n $tag = '<'.$this->name;\n \n $attr = array();\n \n foreach( $this->attributes as $key => $value ) \n {\n if ( is_array($value) )\n {\n $value = str_replace('\"', \"'\", json_encode($value));\n }\n \n $attr[] = $key.'='.'\"'.$value.'\"';\n }\n\n $attr = implode(' ',$attr);\n \n $tag .= ' '.$attr;\n \n if ( (isset($this->content) && !is_null($this->content)) || ($this->name == 'textarea'))\n {\n $tag .= '>'.$this->content.'</'.$this->name.'>';\n }\n else\n { \n $tag .= ' />';\n }\n \n return $tag;\n }", "public function render()\r\n { \r\n $val = \"\";\r\n\t\tif(isset($_POST[$this->get_name()])) \r\n\t\t\t$val = htmlspecialchars($this->get_value());\r\n\t\telse $val = '';\r\n\t\t$html = array();\r\n \t$html[] = sprintf(\r\n '<textarea name=\"%s\" id=\"%1$s\" %s>'. $val .'</textarea>',\r\n $this->name,\r\n $this->attributestorage->get_attributes()\r\n );\r\n return implode('\\n', $html);\r\n }", "public function getHtmlAttribute()\n {\n switch ($this->tipo) {\n case self::TIPO_IMAGE:\n return \"<img src='\".$this->json_behance->src.\"' alt='\".$this->nomeProjeto.\"'>\";\n break;\n\n case self::TIPO_TEXT:\n return $this->json_behance->text; \n break;\n\n case self::TIPO_VIDEO:\n return \"<video src='\".$this->json_behance->src.\"'>\"; \n break;\n\n case self::TIPO_EMBED:\n return $this->json_behance->embed; \n break;\n\n case self::TIPO_AUDIO:\n return $this->json_behance->embed; \n break;\n }\n\n\n return null;\n }", "public function renderTagAttributes(){\n $row = '';\n foreach($this->tag_attributes as $key => $attribute)\n $row .= \"$key=\\\"$attribute\\\" \";\n return $row;\n }", "public function raw()\n {\n return $this->attr_raw;\n }", "protected function getAttributes() : string\n {\n $content = '';\n foreach ($this->attributes as $key => $value) {\n $content .= $key.'=\"'.$value.'\" ';\n }\n\n return trim($content);\n }", "public function toHtml(): HtmlString\n {\n $this->vars[\"__value\"] = collect($this->determineValue());\n\n return parent::toHtml();\n }", "public function getHtml() {\n return '<textarea' .\n $this->getIdHtml() .\n $this->getNameHtml() .\n $this->getClassHtml() .\n $this->getAttributesHtml() .\n $this->getIsDisabledHtml() .\n '>' .\n htmlspecialchars($this->getDisplayValue(), ENT_NOQUOTES) .\n '</textarea>';\n }", "public function asHTML() {\n return \"$this->before<$this->tag_name$this->attributes>$this->content</$this->tag_name>$this->after\";\n }", "public function overlayUserdefinedHtmlAttributeValues() {}", "public function renderAttributes($htmlOptions) {\n\t\t$specialAttributes = array(\n\t\t\t'checked' => 1,\n\t\t\t'declare' => 1,\n\t\t\t'defer' => 1,\n\t\t\t'disabled' => 1,\n\t\t\t'ismap' => 1,\n\t\t\t'multiple' => 1,\n\t\t\t'nohref' => 1,\n\t\t\t'noresize' => 1,\n\t\t\t'readonly' => 1,\n\t\t\t'selected' => 1,\n\t\t);\n\n\t\tif ($htmlOptions === array())\n\t\t\treturn '';\n\t\t$html = '';\n\t\tif (isset($htmlOptions['encode'])) {\n\t\t\t$raw = !$htmlOptions['encode'];\n\t\t\tunset($htmlOptions['encode']);\n\t\t}\n\t\telse\n\t\t\t$raw = false;\n\n\n\t\tif ($raw) {\n\t\t\tforeach ($htmlOptions as $name => $value) {\n\t\t\t\tif (isset($specialAttributes[$name])) {\n\t\t\t\t\tif ($value)\n\t\t\t\t\t\t$html .= ' ' . $name . '=\"' . $name . '\"';\n\t\t\t\t}\n\t\t\t\telse if ($value !== null)\n\t\t\t\t\t$html .= ' ' . $name . '=\"' . $value . '\"';\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tforeach ($htmlOptions as $name => $value) {\n\n\t\t\t\tif (isset($specialAttributes[$name])) {\n\t\t\t\t\tif ($value)\n\t\t\t\t\t\t$html .= ' ' . $name . '=\"' . $name . '\"';\n\t\t\t\t}\n\t\t\t\telse if ($value !== null)\n\t\t\t\t\t$html .= ' ' . $name . '=\"' . self::encode($value) . '\"';\n\t\t\t}\n\t\t}\n\t\treturn $html;\n\t}", "public function getHTML() : string\n {\n $strStyle = '';\n if ($this->oFlags->isSet(FormFlags::ALIGN_CENTER)) {\n $strStyle = 'text-align: center;';\n } else if ($this->oFlags->isSet(FormFlags::ALIGN_RIGHT)) {\n $strStyle = 'text-align: right;';\n }\n $strHTML = $this->buildContainerDiv($strStyle);\n\n $strHTML .= '<input type=\"button\" ';\n $strHTML .= $this->buildID();\n $strHTML .= $this->buildStyle();\n $strHTML .= $this->buildAttributes();\n $strHTML .= ' value=\"' . $this->strBtnText . '\"></div>' . PHP_EOL;\n\n return $strHTML;\n }", "public function toHtml() {\n\t\techo '<output '.$this->getAttributes().'/>';\n\t}", "protected function toHtml()\n\t{\n\t\t// parameter is hexadecimal number\n\t\treturn \"&#x{$this->parameter};\";\n\t}", "public function renderField() : string {\n $out = '<textarea ' .\n 'name=\"' . $this->name . '\" ' .\n 'id=\"' . $this->id . '\"';\n \n // Tag Attributes\n $out .= $this->renderTagAttributes();\n // Tag schließen\n $out .= '>';\n $out .= $this->value;\n $out .= '</textarea>';\n\n return $out;\n }", "public function __toString(): string\n {\n $html = '<input';\n foreach ($this->attributes as $name => $value) {\n $html .= ' '.htmlspecialchars($name).'=\"'.htmlspecialchars($value).'\"';\n }\n $html .= '/>';\n\n try {\n if ($this->renderer !== null) {\n return strval(call_user_func($this->renderer, $this, $html));\n }\n } catch (\\Exception $e) {\n return $e->getMessage();\n }\n\n return $html;\n }", "public function __toString() {\n\t\t\t$html = \"<{$this->tag}\";\n\n\t\t\t// Add all the attributes\n\t\t\tforeach ($this->attributes as $key => $value) {\n\t\t\t\t$html .= \" {$key}=\\\"{$value}\\\"\";\n\t\t\t}\n\t\t\t$html .= \">\";\n\n\t\t\t// Add the inner html\n\t\t\t$html .= $this->inner;\n\n\t\t\t// Add children\n\t\t\tforeach ($this->children as $element) {\n\t\t\t\t$html .= $element;\n\t\t\t}\n\n\t\t\t// Close the tag\n\t\t\t$html .= \"</{$this->tag}>\";\n\n\t\t\treturn $html;\n\t\t}", "public function getHtmlAttributes()\n {\n return [\n 'data-password-min-character-sets',\n 'data-password-min-length',\n 'type',\n 'title',\n 'class',\n 'style',\n 'onclick',\n 'onchange',\n 'disabled',\n 'readonly',\n 'tabindex',\n 'placeholder',\n 'data-form-part',\n 'data-role',\n 'data-action',\n 'checked',\n ];\n }", "public static function renderAttributes($htmlOptions = array()) {\n static $specialAttributes = array(\n 'autofocus' => 1,\n 'autoplay' => 1,\n 'controls' => 1,\n 'declare' => 1,\n 'default' => 1,\n 'disabled' => 1,\n 'ismap' => 1,\n 'loop' => 1,\n 'muted' => 1,\n 'playsinline' => 1,\n 'webkit-playsinline' => 1,\n 'nohref' => 1,\n 'noresize' => 1,\n 'novalidate' => 1,\n 'open' => 1,\n 'reversed' => 1,\n 'scoped' => 1,\n 'seamless' => 1,\n 'selected' => 1,\n 'typemustmatch' => 1,\n 'lazyload' => 1,\n ), $specialAttributesNoValue = array(\n 'defer' => 1,\n 'async' => 1\n );\n\n if ($htmlOptions === array()) return '';\n\n $html = '';\n if (isset($htmlOptions['encode'])) {\n $raw = !$htmlOptions['encode'];\n unset($htmlOptions['encode']);\n } else\n $raw = false;\n\n foreach ($htmlOptions as $name => $value) {\n if (isset($specialAttributes[$name])) {\n if ($value) {\n $html .= ' ' . $name;\n if (self::$renderSpecialAttributesValue) $html .= '=\"' . $name . '\"';\n }\n } else if (isset($specialAttributesNoValue[$name])) {\n $html .= ' ' . $name;\n } else if ($value !== null) $html .= ' ' . $name . '=\"' . ($raw ? $value : self::encodeAttribute($value)) . '\"';\n }\n\n return $html;\n }", "function HTMLValue() {\n $value = parent::HTMLValue();\n if ((! empty($this->value)) && $this->isvalid($this->value)) {\n switch ($this->contentAccess()) {\n case 'sql':\n $id = urlencode($this->form->recordID);\n $value = \"<img id='{$this->id}_img' src='fetchasset.php5?&i={$id}' />\";\n break;\n case 'file':\n default:\n $webpath = $this->webpath($this->value);\n // Need explicit width because Firefox seems to cache the width based on the path!\n list($width, $height, $image_type) = getimagesize($this->filepath($this->value));\n $value = \"<img id='{$this->id}_img' src='{$webpath}' width='${width}' height='{$height}'>\";\n break;\n }\n }\n return $value;\n }", "public function __toString()\n {\n $attributes = '';\n\n if ($this->data) {\n ksort($this->data);\n foreach ($this->data as $name => $value) {\n $attributes .= \" $name=\\\"$value\\\"\";\n }\n }\n\n if ($this->tag) {\n return '<' . $this->tag . $attributes . (($this->selfclose) ? \" />\" : '>');\n }\n\n return $attributes;\n }", "public function __toString()\n {\n $result = \"<{$this->getTagName()}\";\n foreach ($this->getAttributes() as $key => $value) {\n $result .= \" {$key}=\\\"\" . Util::escape($value) . \"\\\"\";\n }\n if ($this->hasChild()) {\n $result .= '>';\n foreach ($this->getChildren() as $node) {\n $result .= $node->toString();\n }\n $result .= \"</{$this->getTagName()}>\";\n } else {\n $result .= ' />';\n }\n return $result;\n }", "public function __toString()\n {\n return sprintf(\n '<div class=\"mb-6\">\n\t\t\t\t %s\n\t\t\t\t <div class=\"m-2 p-2 inline-block font-medium text-xs leading-tight\">\n\t\t\t\t <p class=\"text-red-500 hover:text-red-700\"> %s</p>\n\t\t\t\t </div>\n </div>',\n $this->renderInput(),\n $this->model->getFirstError($this->attribute)\n );\n }", "function getValueHTML()\n\t{\n\t\t$value = $this->_getTypeValue($this->type, $this->value);\n\n\t\tswitch($this->type)\n\t\t{\n\t\t\tcase 'homepage' :\n\t\t\t\treturn ($value) ? (sprintf('<a href=\"%s\" target=\"_blank\">%s</a>', $value, strlen($value) > 60 ? substr($value, 0, 40) . '...' . substr($value, -10) : $value)) : \"\";\n\n\t\t\tcase 'email_address' :\n\t\t\t\treturn ($value) ? sprintf('<a href=\"mailto:%s\">%s</a>', $value, $value) : \"\";\n\n\t\t\tcase 'tel' :\n\t\t\t\treturn sprintf('%s-%s-%s', $value[0], $value[1], $value[2]);\n\t\t\t\t\n\t\t\tcase 'textarea' :\n\t\t\t\treturn nl2br($value);\n\t\t\t\t\n\t\t\tcase 'date' :\n\t\t\t\treturn zdate($value, \"Y-m-d\");\n\n\t\t\tcase 'checkbox' :\n\t\t\tcase 'select' :\n\t\t\tcase 'radio' :\n\t\t\t\tif(is_array($value))\n\t\t\t\t{\n\t\t\t\t\treturn implode(',', $value);\n\t\t\t\t}\n\t\t\t\treturn $value;\n\n\t\t\tcase 'kr_zip' :\n\t\t\t\tif(is_array($value))\n\t\t\t\t{\n\t\t\t\t\treturn implode(' ', $value);\n\t\t\t\t}\n\t\t\t\treturn $value;\n\n\t\t\t// case 'text' :\n\t\t\tdefault :\n\t\t\t\treturn $value;\n\t\t}\n\t}", "public function __toString()\n {\n $attributes = [];\n foreach ($this->attributes as $key => $value) {\n // Make sure to transform arrays to json and esacpe the\n // output accordingly so we don't mess up the markup\n $value = is_array($value) ? json_encode($value) : e($value);\n\n $attributes[] = sprintf(\"data-item-%s='%s'\", $key, $value);\n }\n\n return implode(\" \", $attributes);\n }", "public function html(){\n\t\treturn '<div class=\"form-group\">'.$this->label.$this->input.'</div>';\n\t}", "static function get_html_attributes( $attributes ) {\n $attr = '';\n foreach ( $attributes as $key => $value ) {\n if ( !is_null( $value ) ) {\n $attr .= \" data-$key='$value'\";\n }\n }\n return $attr;\n }", "public function get_html()\n\t{\n\t\tif ( empty($this->html) && $this->name ){\n\t\t\t\n\t\t\t$this->html .= '<'.$this->tag.' name=\"'.$this->name.'\"';\n\t\t\t\n\t\t\tif ( isset($this->id) ){\n\t\t\t\t$this->html .= ' id=\"'.$this->id.'\"';\n\t\t\t}\n\t\t\t\n\t\t\tif ( $this->tag === 'input' && isset($this->options['type']) ){\n\t\t\t\t$this->html .= ' type=\"'.$this->options['type'].'\"';\n\t\t\t\t\n\t\t\t\tif ( $this->options['type'] === 'text' || $this->options['type'] === 'number' || $this->options['type'] === 'password' || $this->options['type'] === 'email' ){\n\t\t\t\t\tif ( isset($this->options['maxlength']) && ( $this->options['maxlength'] > 0 ) && $this->options['maxlength'] <= 1000 ){\n\t\t\t\t\t\t$this->html .= ' maxlength=\"'.$this->options['maxlength'].'\"';\n\t\t\t\t\t}\n\t\t\t\t\tif ( isset($this->options['minlength']) && ( $this->options['minlength'] > 0 ) && $this->options['minlength'] <= 1000 && ( \n\t\t\t\t\t( isset($this->options['maxlength']) && $this->options['maxlength'] > $this->options['minlength'] ) || !isset($this->options['maxlength']) ) ){\n\t\t\t\t\t\t$this->html .= ' minlength=\"'.$this->options['minlength'].'\"';\n\t\t\t\t\t}\n\t\t\t\t\tif ( isset($this->options['size']) && ( $this->options['size'] > 0 ) && $this->options['size'] <= 100 ){\n\t\t\t\t\t\t$this->html .= ' size=\"'.$this->options['size'].'\"';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( $this->options['type'] === 'checkbox' ){\n\t\t\t\t\tif ( !isset($this->options['value']) ){\n\t\t\t\t\t\t$this->options['value'] = 1;\n\t\t\t\t\t}\n\t\t\t\t\t$this->html .= ' value=\"'.htmlentities($this->options['value']).'\"';\n\t\t\t\t\tif ( $this->value == $this->options['value'] ){\n\t\t\t\t\t\t$this->html .= ' checked=\"checked\"';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if ( $this->options['type'] === 'radio' ){\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$this->html .= ' value=\"'.htmlentities($this->value).'\"';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( isset($this->options['title']) ){\n\t\t\t\t$this->html .= ' title=\"'.$this->options['title'].'\"';\n\t\t\t}\n\t\t\t\n\t\t\t$class = '';\n\t\t\t\n\t\t\tif ( isset($this->options['cssclass']) ){\n\t\t\t\t$class .= $this->options['cssclass'].' ';\n\t\t\t}\n\n\t\t\tif ( $this->required ){\n\t\t\t\t$class .= 'required ';\n\t\t\t}\n\t\t\tif ( isset($this->options['email']) ){\n\t\t\t\t$class .= 'email ';\n\t\t\t}\n\t\t\tif ( isset($this->options['url']) ){\n\t\t\t\t$class .= 'url ';\n\t\t\t}\n\t\t\tif ( isset($this->options['number']) ){\n\t\t\t\t$class .= 'number ';\n\t\t\t}\n\t\t\tif ( isset($this->options['digits']) ){\n\t\t\t\t$class .= 'digits ';\n\t\t\t}\n\t\t\tif ( isset($this->options['creditcard']) ){\n\t\t\t\t$class .= 'creditcard ';\n\t\t\t}\n\t\t\t\n\t\t\tif ( !empty($class) ){\n\t\t\t\t$this->html .= ' class=\"'.trim($class).'\"';\n\t\t\t}\n\t\t\t\n\t\t\t$this->html .= '>';\n\t\t\t\n\t\t\tif ( $this->tag === 'select' || $this->tag === 'textarea' ){\n\t\t\t\t$this->html .= '</'.$this->tag.'>';\n\t\t\t}\n\t\t\t\n\t\t\tif ( isset($this->options['placeholder']) && strpos($this->options['placeholder'],'%s') !== false ){\n\t\t\t\t$this->html = sprintf($this->options['placeholder'], $this->html);\n\t\t\t}\n\t\t}\n\t\treturn $this->html;\n\t}", "public function render(): string\n {\n $image_attributes = '';\n foreach ($this->attributes as $attribute => $value) {\n if (\n is_string($attribute) &&\n is_string($value) &&\n in_array($attribute, Settings::ignoredCustomAttributes()) === false\n ) {\n $image_attributes .= \"{$attribute}=\\\"{$value}\\\" \";\n }\n }\n return \"<img src=\\\"{$this->insert}\\\" {$image_attributes}/>\";\n }", "public function __toString()\n {\n $text = '<'.$this->getType().$this->getAttributeList().'>';\n foreach ($this->getChildren() as $child) {\n $text .= (string) $child;\n }\n $text .= '</'.$this->getType().'>';\n\n return $text;\n }", "public function html(): string {\n\t\treturn \"<input type=\\\"time\\\"\" . $this->emitAttributes() . \" />\";\n\t}", "protected function attributesToString()\n {\n $string = '';\n $XMLConvention = in_array(\n static::$outputLanguage,\n array(ENT_XML1, ENT_XHTML)\n );\n if (!empty($this->attributeList)) {\n foreach ($this->attributeList as $key => &$value) {\n if ($value !== null\n && ($value!==false\n || $XMLConvention)\n ) {\n $string .= sprintf(\n ' %s',\n $key\n );\n if ($value === true) {\n if ($XMLConvention) {\n $value = $key;\n } else {\n continue;\n }\n }\n $string .= sprintf(\n '=\"%s\"',\n implode(\n ' ',\n array_map(\n (\n static::$avoidXSS ?\n 'static:unXSS' :\n 'strval'\n ),\n (\n is_array($value) ?\n $value :\n array($value)\n )\n )\n )\n );\n }\n }\n }\n return $string;\n }", "protected function getLabelHtml()\n {\n $classAttribute = $this->getCustomAttributes()->getLabelClass();\n $classAttribute = $classAttribute ? ' class=\"' . $classAttribute . '\"' : \"\";\n\n $forAttribute = sprintf(' for=\"%s\"', $this->getIdAttribute());\n\n $output = '<label' . $classAttribute . $forAttribute . '>';\n $output .= $this->getLabel();\n $output .= '</label>';\n $output .= PHP_EOL;\n\n return $output;\n }", "protected function pakHrefAttr(): string\n {\n return \"href='{$this->link}'\";\n }", "private function HtmlAttributes($attributes)\r\n {\r\n $formatted = join(' ', array_map(function ($key) use ($attributes) {\r\n if (is_bool($attributes[$key])) {\r\n return $attributes[$key] ? $key : '';\r\n }\r\n return $key . '=\"' . $attributes[$key] . '\"';\r\n }, array_keys($attributes)));\r\n return $formatted;\r\n }", "public function getFieldHtml()\n {\n $this->dateElement->setData([\n 'extra_params' => $this->getHtmlExtraParams(),\n 'name' => $this->getHtmlId(),\n 'id' => $this->getHtmlId(),\n 'class' => $this->getHtmlClass(),\n 'value' => $this->getValue(),\n 'date_format' => $this->getDateFormat(),\n 'image' => $this->getViewFileUrl('Magento_Theme::calendar.png'),\n 'years_range' => '-120y:c+nn',\n 'max_date' => '-1d',\n 'change_month' => 'true',\n 'change_year' => 'true',\n 'show_on' => 'both',\n 'first_day' => $this->getFirstDay()\n ]);\n\n return $this->dateElement->getHtml();\n }", "public function get(): string\n {\n $attributes = [];\n foreach ($this->attributes as $k => $v) {\n if (is_string($v)) {\n $attributes[] = \"$k:\\\"$v\\\"\";\n } elseif ($v instanceof Closure) {\n $attributes[] = \"$k:\".$v();\n } elseif (is_bool($v)) {\n $attributes[] = \"$k:\".($v ? 'true' : 'false');\n } else {\n $attributes[] = \"$k:\".intval($v);\n }\n }\n\n return '{'.implode(',', $attributes).'}';\n }", "public function getFieldHtml()\n {\n $this->dateElement->setData([\n 'name' => $this->getHtmlId(),\n 'id' => $this->getHtmlId(),\n 'class' => $this->getHtmlClass(),\n 'value' => $this->getValue(),\n 'date_format' => $this->getDateFormat(),\n 'image' => $this->getViewFileUrl('Magento_Theme::calendar.png'),\n ]);\n return $this->dateElement->getHtml();\n }", "protected function attributeTableHTML($field)\r\n\t{\r\n\t\t$attributes = json_decode($field->attributes);\r\n\t\t\r\n\t\tif(empty($attributes))\r\n\t\t\t$attributes = array(\"\" => \"\");\r\n\t\t\r\n\t\t?>\r\n\t\t<input name=\"attributes[]\" type=\"hidden\"/>\r\n\t\t<table class=\"attributes\">\r\n\t\t\t<tbody>\r\n\t\t\t\t<?php\r\n\t\t\t\tforeach($attributes as $key => $value)\r\n\t\t\t\t{\r\n\t\t\t\t?>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<input\r\n\t\t\t\t\t\t\t\tplaceholder=\"<?php _e('Name', 'wp-google-maps'); ?>\"\r\n\t\t\t\t\t\t\t\tclass=\"attribute-name\"\r\n\t\t\t\t\t\t\t\tvalue=\"<?php echo $key; ?>\"\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<input \r\n\t\t\t\t\t\t\t\tplaceholder=\"<?php _e('Value', 'wp-google-maps'); ?>\"\r\n\t\t\t\t\t\t\t\tclass=\"attribute-value\"\r\n\t\t\t\t\t\t\t\tvalue=\"<?php echo $value; ?>\"\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t\t?>\r\n\t\t\t</tbody>\r\n\t\t</table>\r\n\t\t<?php\r\n\t}", "public function __toString(): string\r\n {\r\n $toPrint = '<textarea type=\"'.$this->type.'\" name=\"'.$this->name.'\" '.$this->getAttributesToFiled().' />'.$this->value.'</textarea>';\r\n return $toPrint;\r\n }", "public function escapeAttr($value)\n {\n return $this->_encode($value);\n }", "public static function label()\n {\n return __('Attributes');\n }", "public function getHtmlOutputAttribute()\n {\n return nl2br(e($this->description));\n }", "public function getFormattedValue(): HtmlString\n {\n return new HtmlString($this->value ?? '');\n }", "protected function getAttributesAsString() {\n\t\t\n\t\t$String = '';\n\t\tforeach ( $this->attributes as $Name => $Value )\n\t\t\t$String .= \"$Name=\\\"$Value\\\" \";\n\t\t\n\t\tif ( $this->Debug )\n\t\t\tDebugger::echoMessage( get_class() . '::getAttributesAsString() String=' .$String);\t\n\t\treturn $this->replaceSpecialChars( $String );\n\t\t\n\t}", "public function getAttr(): string\r\n {\r\n return $this->attr;\r\n }", "public function __toString() {\n return $this->buildHtml( $this->getId() );\n }", "public function __toString() {\n\t\treturn $this->getHtml();\n\t}", "public function getFormattedNameAttribute(): string\n {\n return $this->open_tag . $this->name . $this->close_tag;\n }", "public function render()\n {\n $boton = '<button type=\"' . $this->_type . '\" value=\"' . $this->_value . '\"';\n if ($this->_form) {\n $boton .= ' form=\"' . $this->_form . '\" ';\n }\n if ($this->_name) {\n $boton .= ' name=\"' . $this->_name. '\" ';\n }\n if ($this->_autoFocus) {\n $boton .= ' autofocus=\"' . $this->_autoFocus. '\" ';\n }\n if ($this->_disabled) {\n $boton .= ' disabled ';\n }\n if ($this->getClass()) {\n $boton .= 'class=\"' . $this->getClass() . '\" ';\n }\n if ($this->_id) {\n $boton .= 'id=\"' . $this->_id . '\" ';\n }\n \n $boton .= '>' . $this->_value . '</button>' . \"\\n\";\n $boton = str_replace(\" \", \" \", $boton);\n return $boton;\n }", "public function __toString()\n {\n return sprintf(self::TEMPLATE, $this->value->type(), $this->role, $this->type);\n }", "public function asHtml()\n {\n return $this->getTypeElementHtml()\n . Mage::helper('bronto_reminder')->__('Item SKU %s %s ',\n $this->getOperatorElementHtml(), $this->getValueElementHtml())\n . $this->getRemoveLinkHtml();\n }", "public function getHTML(){\n $twig = get_instance()->twig->getTwig();\n $template = $twig->load('sistema/theme/default/lib/field.twig');\n \n return $template->render(array(\n 'element_type' => $this->getElementName()\n , 'type' => $this->getFieldType()\n , 'id' => $this->getId()\n , 'name' => $this->getName()\n , 'title' => $this->getAttr('title')\n , 'class' => $this->getClass()\n , 'form_name' => $this->getFormName()\n , 'error_name' => $this->getErrorName()\n , 'attributes' => $this->getTagAttributes()\n , 'disabled' => $this->hasDisabled()\n ));\n }", "public function toString()\n {\n return 'Attribute was found in Advanced Search Page.';\n }", "public function renderWidget()\n {\n if ($this->data !== null) {\n $this->htmlAttributes['value'] = $this->data;\n }\n\n // And to be sure to generate a proper html text input with the proper name...\n $this->htmlAttributes['type'] = $this->type;\n $this->htmlAttributes['name'] = $this->name;\n $this->htmlAttributes['id'] = $this->getId();\n\n $output = '<input ';\n\n $output .= $this->renderHtmlAttributes();\n\n $output .= '/>';\n\n return $output;\n }", "public function get_option_label_html(){\n\t\t$html = \"\";\n\t\t$classes = $this->get_label_html_classes();\n\t\t$required = $this->required ? \"*\" : \"\";\n\t\t$html .= \"<{$this->element} class='$classes' for='{$this->id}'>{$this->label}{$required}</{$this->element}>\";\n\t\treturn $html;\n\t}", "public function asHtml()\n {\n $html = $this->getTypeElement()->getHtml() .\n Mage::helper('giftpromo')->__(\n \"If the %s %s %s\", self::TOTAL_TYPE,\n $this->getOperatorElement()->getHtml(),\n $this->getValueElement()->getHtml()\n );\n if ($this->getId() != '1') {\n $html .= $this->getRemoveLinkHtml();\n }\n\n return $html;\n }", "public function getAttribute(): string\n {\n return $this->attribute;\n }", "function attributesToHtml($attributes) {\n $html='';\n if (is_array($attributes))\n foreach ($attributes as $attrName=>$attrValue) {\n $html.=' '.$attrName.'=\"'.$attrValue.'\"';\n } elseif(is_string($attributes))\n \t$html=$attributes;\n return $html;\n }", "protected function get_formatted_attributes(): string\n\t{\n\t\treturn $this->unsigned ? 'UNSIGNED' : '';\n\t}", "function getHtmlCode(){\n\t\treturn we_baseCollection::getHtmlCode($this);\n\t}", "public function generate()\n\t{\n\t\treturn sprintf('<input type=\"text\" name=\"%s\" id=\"ctrl_%s\" class=\"captcha mandatory%s\" value=\"\"%s%s',\n\t\t\t\t\t\t$this->strCaptchaKey,\n\t\t\t\t\t\t$this->strId,\n\t\t\t\t\t\t(($this->strClass != '') ? ' ' . $this->strClass : ''),\n\t\t\t\t\t\t$this->getAttributes(),\n\t\t\t\t\t\t$this->strTagEnding) . $this->addSubmit();\n\t}", "public function toHtml() : string\n {\n $htmlLocalName = $this->localName;\n $htmlAttributes = $this->attributesToHtml();\n $htmlChildeNodes = $this->childNodesToHtml();\n return \"<{$htmlLocalName}{$htmlAttributes}>$htmlChildeNodes</$htmlLocalName>\";\n }", "public function __toString()\n {\n $textLabels = $this->_getTextLabels();\n $out = array();\n\n foreach ($this->_attr as $attr => $value) {\n if (isset($textLabels[$attr])) {\n if (in_array($attr, array(\n self::EXPIRE_MONTH,\n self::EXPIRE_YEAR,\n self::NUMBER\n ))) {\n $out[] = sprintf('%15s %s (Encrypted: %s)',\n $textLabels[$attr] . ':',\n $value,\n substr($this->get($attr, true), 0, 8) . '...'\n );\n } else {\n $out[] = sprintf('%15s %s', $textLabels[$attr] . ':', $value);\n }\n }\n }\n\n return implode(\"\\n\", $out) . \"\\n\";\n }", "protected function build()\r\n {\r\n $tag = array_shift($this->attributes);\r\n $content = implode('', $this->childs);\r\n if (empty($tag) || $tag == 'dummy') {\r\n return $content;\r\n }\r\n $spaces = $this->tagdep != 0 ? PHP_EOL.str_repeat(\" \",abs($this->tagdep)) : '';\r\n $strTag = $spaces.'<'.$tag;\r\n foreach ($this->attributes as $key => $value) {\r\n if (is_object($value) && !method_exists($value, '__toString')) {\r\n $strTag .= ' error=\"Attribute value is object ('.get_class($value).')\"';\r\n continue;\r\n }\r\n $strTag .= ' '.$key.'=\"'.htmlspecialchars($value, ENT_QUOTES).'\"';\r\n // la conversione del contentuto degli attributi viene fornita da Tag in modo\r\n // tale che non debba essere gestito dai suoi figli\r\n /*$strTag .= ' '.$key.'=\"'.$val.'\"';*/\r\n }\r\n $strTag .= '>';\r\n \r\n if (!in_array($tag, ['input', 'img', 'link', 'meta'])) {\r\n $strTag .= $content . ($this->tagdep < 0 ? $spaces : '') .\"</{$tag}>\";\r\n }\r\n return $strTag;\r\n }", "public function render()\r\n\t{\r\n\t\t$content = \"\";\r\n\t\t\r\n\t\tif (!empty($this->id)) \r\n\t\t{\r\n\t\t\t$content .= \"id='\" . $this->id . \"' \";\r\n\t\t}\r\n\t\t\r\n\t\tif (!empty($this->name)) \r\n\t\t{\r\n\t\t\t$content .= \"name='\" . $this->name . \"' \";\r\n\t\t}\r\n\t\t\r\n\t\tif (!empty($this->className)) \r\n\t\t{\r\n\t\t\t$content .= \"class='\" . $this->className . \"' \";\r\n\t\t}\r\n\t\t\r\n\t\treturn $content;\r\n\t}", "public function getInput()\n\t{\n\t\t$html = '<div>';\n\t\t$html .= $this->getMegaSettings();\n\t\t$html .= '<input type=\"hidden\" name=\"' . $this->name . '\" id=\"' . $this->id . '\" value=\"' . $this->value . '\">';\n\t\t$html .= '</div>';\n\n\t\treturn $html;\n\t}", "protected function emitAttributes(): string {\n\t\t$ret = \"\";\n\n\t\tforeach($this->m_attributes as $name => $attr) {\n\t\t\tif(!isset($attr) || (is_array($attr) && empty($attr))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$ret .= $this->emitAttribute($name, $attr);\n\t\t}\n\n\t\treturn $ret;\n\t}", "function get_tag()\n {\n\t $id = 'id=\"'.$this->OP_[id]->get().'\"';\n\t $name='name=\"'.$this->OP_[name]->get().'\"';\n\t $value='value=\"'.$this->OP_[value]->get().'\"';\n\t $type='type=\"hidden\"';\n\t $my_value = \"<input $id $name $type $value>\";\n\t return $my_value;\n }", "function render_attribute($key, $contents, $selected)\r\n\t{\r\n\t\techo '<option value=\"';\r\n\t\techo htmlspecialchars($key, ENT_QUOTES);\r\n\t\techo '\"';\r\n\t\tif ($selected)\r\n\t\t{\r\n\t\t\techo \" selected\";\r\n\t\t} \r\n\t\techo '>';\r\n\t\tif (empty($contents))\r\n\t\t{\r\n\t\t\techo htmlspecialchars($key, ENT_QUOTES);\r\n\t\t} \r\n\t\telse\r\n\t\t{\r\n\t\t\techo $contents;\r\n\t\t} \r\n\t\techo '</option>';\r\n\t}", "public function Render(): string\r\n {\r\n $callback = fn (?string $k, ?string $v): string => $k.'=\"'.\\htmlentities($v ?? '').'\"';\r\n $attributes = array_map($callback, \\array_keys($this->Attributes), \\array_values($this->Attributes));\r\n\r\n $children = '';\r\n if (count($this->Children) > 0) {\r\n $this->IsContainer = true;\r\n $children = implode('', $this->Children);\r\n }\r\n\r\n return '<'.strtolower($this->TagName).' '.implode(' ', $attributes).($this->IsContainer ? '' : '/').'>'.$children.($this->IsContainer ? '</'.\\strtolower($this->TagName).'>' : '');\r\n }", "public function htmlValue() \n\t{ \n $stri_html = $this->toJson() . $this->jQueryValue() . $this->obj_tr->htmlValue();\n \n \n return $stri_html;\n\t}", "protected function generateHTML(array $attrs)\r\n {\r\n $html = '<span';\r\n\r\n foreach ($attrs as $key => $value) {\r\n $html .= ' ' . $key . '=\"' . $value . '\"';\r\n }\r\n\r\n $html .= '></span>';\r\n\r\n return $html;\r\n }", "public function getHtmlEncode()\n {\n return $this->htmlEncode;\n }", "public function getHtmlEncode()\n {\n return $this->htmlEncode;\n }", "public function htmlValue($field) {\n return htmlentities($this->value($field), ENT_COMPAT, 'UTF-8'); \n }", "public function _toHtml()\n {\n if(Mage::helper('aplazame')->isEnabled())\n {\n return parent::_toHtml();\n }\n\n return '';\n }", "public function asHtml()\n {\n return $this->asStatic();\n }", "public function build()\n\t{\n\t\t$result = '';\n\t\t$attrs = $this->getAll();\n\t\tforeach ($attrs as $attr => $value) {\n\t\t\tif (null === $value) {\n\t\t\t\t$result .= \"$attr \";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$result .= \"$attr=\\\"$value\\\" \";\n\t\t\t}\n\t\t}\n\n\t\treturn trim($result);\n\t}", "public function html($attributes = array()) {\n\t\t\t$properties = '';\n\t\t\tif (is_array($attributes)) {\n\t\t\t\tforeach ($attributes as $key => $val) {\n\t\t\t\t\t$properties .= \"{$key}=\\\"{$val}\\\" \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$html = '<img src=\"' . $this->toEncodedURI() . '\" ' . $properties . '/>';\n\t\t\treturn $html;\n\t\t}", "public function attributeToString($attrs) {//{{{\n $html = array();\n if (empty($attrs)) return \"\";\n $n = $attrs->length;\n for ($i = 0 ;$i < $n; $i++) {\n $attr = $attrs->item($i);\n if ($attr->value == \"-\") {\n $html[] = $attr->name;\n } else {\n $html[] = $attr->name . \"=\\\"\" . $attr->value . \"\\\"\";\n }\n }\n if (empty($html)) return \"\";\n\n return \" \" . implode(\" \", $html);\n }", "public function render(){\n\t\t$out = \"<img\".($this->getID() ? \" id=\\\"\".$this->getID().\"\\\"\" : \"\");\n\t\t\n\t\t$out .= \" src=\\\"\".$this->link.\"\\\"\";\n\t\t\n\t\tforeach( $this->getProperties() as $key => $value ) {\n\t\t\t$out .= \" \".$key.\"=\\\"\".$value.\"\\\"\"; //example: _width=\"100px\"\n\t\t}\n\t\t$out .= \" />\"; //end of opening html tag and html properties\n\t\t\n\t\treturn $out;\n\t}", "public function getValueAfterElementHtml()\n {\n $html = '';\n\n switch ($this->getAttribute()) {\n case 'category_ids':\n $image = $this->_assetRepo->getUrl('images/rule_chooser_trigger.gif');\n break;\n }\n\n if (!empty($image)) {\n $html = '<a href=\"javascript:void(0)\" class=\"rule-chooser-trigger\"><img src=\"' .\n $image .\n '\" alt=\"\" class=\"v-middle rule-chooser-trigger\" title=\"' .\n __(\n 'Open Chooser'\n ) . '\" /></a>';\n }\n return $html;\n }" ]
[ "0.768959", "0.75875455", "0.7459536", "0.7262452", "0.7262452", "0.72188574", "0.71481836", "0.70739156", "0.7048384", "0.70387965", "0.70116943", "0.70078874", "0.6993859", "0.6989263", "0.6961465", "0.69199276", "0.6918598", "0.6843283", "0.6837678", "0.6827859", "0.67920756", "0.67715335", "0.6742464", "0.6701799", "0.66974926", "0.66872287", "0.6629526", "0.6617121", "0.66085976", "0.6605421", "0.6591371", "0.6577468", "0.65624434", "0.65582734", "0.65569043", "0.6550026", "0.65485215", "0.6547529", "0.65455973", "0.65375024", "0.65284127", "0.65161115", "0.65064776", "0.6497469", "0.6480384", "0.6462461", "0.64619476", "0.64439887", "0.64374506", "0.64196837", "0.6411112", "0.63934755", "0.63865834", "0.63690805", "0.63660115", "0.6328318", "0.6327908", "0.6322724", "0.630942", "0.6294333", "0.6293823", "0.6291156", "0.6290466", "0.62882465", "0.62787247", "0.6276921", "0.6276594", "0.6273399", "0.6241527", "0.62382287", "0.62321055", "0.62215155", "0.6216645", "0.6205615", "0.62025124", "0.61971706", "0.61840713", "0.6179589", "0.6179231", "0.6166711", "0.6165125", "0.61639744", "0.61611784", "0.61525863", "0.61511546", "0.6133927", "0.61322606", "0.61155427", "0.61144537", "0.61136764", "0.6111548", "0.6108536", "0.6108536", "0.6105844", "0.60974145", "0.6096073", "0.60910714", "0.60749745", "0.6073655", "0.60603523", "0.60472465" ]
0.0
-1
Returns the requested restore point for restoring an objects previous state.
public function getRestorePoint($id) { return $this->find('first', array( 'conditions' => array( 'RestorePoint.id' => $id ), 'fields' => array( 'RestorePoint.id', 'RestorePoint.model', 'RestorePoint.entity_id', 'RestorePoint.json_object' ), 'contain' => array() )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getPreviousPartitionStep()\n\t{\n\t\t// Fetch the partition steps and wanted partitioning of the last saved action\n\t\t$undoStep = array_pop($this->undoArray);\n\n\t\t// If it is NULL, there are no undo steps\n\t\tif (is_null($undoStep))\n\t\t\treturn(NULL);\n\n\t\t// If the current partition steps are equal to the last saved partition steps => go back another step in the history\n\t\tif ($this->getUndoMd5() == md5(serialize($undoStep['ps'])))\n\t\t{\n\t\t\t// Fetch the partition steps and wanted partitioning of the (2nd) last saved action\n\t\t\t$undoStep = array_pop($this->undoArray);\n\n\t\t\t// If it is NULL, there are no undo steps (now)\n\t\t\tif (is_null($undoStep))\n\t\t\t\treturn(NULL);\n\t\t}\n\n\t\treturn($undoStep);\n\t}", "public function getRestore(){\n\t\treturn $this->restore;\n\t}", "public function getPreviousState();", "function getPreviousState();", "public function getPreviousObject()\n {\n return $this->__object;\n }", "public function backToPreviousPartitionStep()\n\t{\n\t\t// Get the previous partition steps and wanted partitioning from the last action\n\t\t$undoStep = $this->getPreviousPartitionStep();\n\n\t\t// Check, if there is a previous action\n\t\tif ($undoStep !== NULL)\n\t\t{\n\t\t\t// Revert changes\n\t\t\t$this->wantedPartitioning = $undoStep['wp'];\n\t\t\t$this->partitionStepsForShift = $this->partitionSteps = $undoStep['ps'];\n\t\t}\n\t\telse\n\t\t\t$this->resetWantedPartitioningAndSteps();\n\n\t\t// Get the EFI boot partition of the client (if set)\n\t\t$EFIBootPartDev = $this->getEFIBootPartDev();\n\n\t\t// Check, if it was set\n\t\tif ($EFIBootPartDev != false)\n\t\t{\n\t\t\t$this->dev2VDiskVPart($EFIBootPartDev, $vDisk, $vPart);\n\n\t\t\t// Unset the EFI boot partition, if it doesn't exist anymore\n\t\t\tif (($vDisk == false) || ( false == $vPart))\n\t\t\t\t$this->unsetEFIBootPartDev();\n\t\t}\n\t}", "protected function GetPreviousStep()\n {\n static $oPreviousStep;\n if (!$oPreviousStep) {\n $oPreviousStep = TdbShopOrderStepList::GetPreviousStep($this);\n }\n\n return $oPreviousStep;\n }", "public function back()\n {\n $steps = array_reverse($this->getSteps());\n $current = $this->current();\n foreach ($steps as $i => $step) {\n if ($step == $current) {\n return isset($steps[$i + 1]) ? $steps[$i + 1] : $steps[$i];\n }\n }\n }", "public function getRestoreId() {\n\n return $this->restore_id;\n\n }", "function restore()\n {\n }", "public function prev()\n {\n return prev($this->steps);\n }", "protected function previousStep()\r\n {\r\n $index = array_search($this->_currentStep, array_values($this->_steps)) - 1;\r\n $this->redirect(array_values($this->_steps)[($index > 0 ? $index : 0)]);\r\n }", "public function getPreviousUrl() {\r\n\t\treturn $this->Session->read('history.current');\r\n\t}", "public function get_previous() { return $this->getPrevious(); }", "final public function getPrevious() {\n\t\treturn null;\n\t}", "public function getPrevious() {\r\n $previousDate = $this->getStartDate();\r\n $previousDate->modify('-1 ' . $this->getMode());\r\n\r\n return $previousDate->getTimestamp();\r\n }", "public function previousItem() {\n\t\treturn $this->previous()->current();\n\t}", "public function restore(string $state);", "public function getPrevious()\n {\n return $this->previous;\n }", "public function getPrevious()\n {\n return $this->previous;\n }", "public function previous(): int;", "public function previous() {\r\n return prev($this->collection);\r\n }", "public function restore() {}", "public function getPreviousValue();", "protected static function restore() {}", "public function getPreviousVersion()\n {\n $versions = $this->getVersions();\n\n return count($versions) > 1 ? $versions[1] : 0;\n }", "public function restore();", "public function restoreByTimestamp ($timestamp)\n {\n $filename = $this->getFileByTimestamp( $timestamp );\n $GLOBALS [ 'log' ]->debug ( get_class ( $this ) . \": restoring from $filename to {$this->_previewFilename}\" ) ;\n\n if (file_exists ( $filename ))\n {\n $this->savePreview($filename);\n return $timestamp ;\n }\n return null ;\n }", "public function getPreviousUrl(): ?string\n {\n // Any records haven't been saved so far\n if (!is_array($this->session->getSession()['url-history'])) {\n return null;\n }\n\n // -1 -> convert to numbering from 0, -1 -> move to penultimate key\n $penultimateUrlKey = count($this->session->getSession()['url-history']) - 2;\n\n if ($penultimateUrlKey >= 0) {\n return $this->session->getUrlHistory()[$penultimateUrlKey];\n } else {\n return null;\n }\n }", "function getPreviousStep($step)\r\n {\r\n $ret = null;\r\n $steps = array_keys($this->_steps);\r\n\r\n $done = false;\r\n foreach ($steps as $s) {\r\n if ($s == $step) {\r\n $done = true;\r\n break;\r\n }\r\n $ret = $s;\r\n }\r\n\r\n return $ret;\r\n }", "public function getPrevious();", "public function prev_entry()\n\t{\n\t\treturn $this->_prev_next('prev');\n\t}", "public function GetPrevLevel()\n {\n return $this->prevLevel;\n }", "function get_previous_item($item = null)\n{\n if (!$item) {\n $item = get_current_record('item');\n }\n return $item->previous();\n}", "public function restore()\n {\n }", "public function getPreviousPosition(string $string): ?int;", "public function getPrevious() {}", "public function getPrevMarker()\n {\n $this->currentMarker--;\n if($this->currentMarker<0) return false;\n else return $this->getCurrentMarker();\n }", "public function getPreviousSource() {\n\t\t$cookieName = 'multiauth_source_' . $this->authId;\n\t\tif(array_key_exists($cookieName, $_COOKIE)) {\n\t\t\treturn $_COOKIE[$cookieName];\n\t\t} else {\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function previous_step() {\r\n\t\t$this->step --;\r\n\t}", "public function restoring(Wallet $wallet)\n {\n //\n }", "private function previous()\n {\n $this->m--;\n $this->init();\n }", "public function restore()\n {\n //\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 back() {\n if ($this->parent === null) {\n throw new IllegalStateException(\"can't go back - no parent image\");\n }\n return $this->parent;\n }", "public function getRestoreDate()\n {\n return $this->restoreDate;\n }", "public function backData()\n {\n return prev($this->configuration);\n }", "public function previousVersion()\n {\n return $this->versions()->orderBy(Version::CREATED_AT, 'DESC')->limit(1)->offset(1)->first();\n }", "public function Previous()\n {\n $item = false;\n if ($this->getItemPointer() >= 0) {\n $item = $this->Current();\n $this->setItemPointer($this->getItemPointer() - 1);\n }\n\n return $item;\n }", "public function getPreviousRoute()\r\n {\r\n if ($this->_currentStep == reset($this->_steps)) {\r\n return false;\r\n }\r\n return [$this->owner->id . '/' . $this->owner->action->id] + [$this->queryParam => $this->_currentStep, $this->previousButton => ''];\r\n }", "public function get_previous_crop($attachment)\n {\n }", "public function testRestoreState()\n {\n $load = new Load(new Memento());\n $load->pickup();\n $load->enroute();\n $load->deliver();\n\n // Check the last state of the load\n $this->assertSame(State::STATE_DELIVER, $load->getCurrentState());\n\n // Undo the previous state of the load\n $load->undo();\n $this->assertSame(State::STATE_ENTOUTE, $load->getCurrentState());\n\n // Restore the first state of the load\n $load->restore(0);\n $this->assertSame(State::STATE_PICKUP, $load->getCurrentState());\n }", "public function Previous()\n {\n return parent::Previous();\n }", "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 getPreviousID($id) {\n\t\t\t$hash = $this->execSQL(\"\n\t\t\t\tSELECT (t.stdrefid, t.area)::varchar AS f\n\t\t\t\t FROM webset.std_backup AS t\n\t\t\t\t WHERE refid = \" . $id . \"\n\t\t\t\")->getOne();\n\n\t\t\t$prev_id = $this->execSQL(\"\n\t\t\t\tSELECT refid\n\t\t\t\t FROM webset.std_backup\n\t\t\t\t WHERE (stdrefid, area)::varchar = '\" . $hash . \"'\n\t\t\t\t AND refid < \" . $id . \"\n\t\t\t\t ORDER BY 1 DESC LIMIT 1\n\t\t\t\")->getOne();\n\t\t\t\n\t\t\treturn (int)$prev_id;\n\t\t}", "public function previous_day()\n {\n return $this->subDay();\n }", "function prevPage() {\n\t\treturn $this->hasPrevPage() ? $this->url(array('p' => $this->p + 1)) : null;\n\t}", "public function loadPreviousSibling()\n {\n $id = $this->_cache->getBackend()->getPreviousSiblingId($this);\n return $this->setPreviousSiblingId($id);\n }", "public function getPrevBlock()\n {\n return $this->prevBlock;\n }", "public function getPreviousPage()\n\t{\n\t\treturn $this->previousPage;\n\t}", "public function previous_row($type = 'object')\n\t{\n\t\t$n = ($this->current_row !== 0) ? $this->current_row - 1 : 0;\n\t\treturn $this->row($n, $type);\n\t}", "public function restored(Edit $edit)\n {\n //\n }", "static public function getPrevPage() {\n\t\treturn self::$prev_page;\n\t}", "public function previousEnvironment() :? EnvironmentInterface;", "#[\\ReturnTypeWillChange]\n public function prev()\n {\n $value = prev($this->_data);\n return key($this->_data) !== null ? $value : null;\n }", "public function getPreviousVersionID()\n {\n return $this->previousVersionID;\n }", "public function restoring($model)\n\t{\n\t}", "public function prevpage() {\n return $this->current_page - 1;\n }", "public function getPreviousArticle() {\n return ArticleLanguageVersion::join('article', 'translated_article.article_id', '=', 'article.id')\n ->where('article.created', '<', $this->article->created)\n ->where('translated_article.language', $this->articleLanguageVersion->language)\n ->where('translated_article.published', true)\n ->orderBy('article.created', 'DESC')\n ->first();\n }", "public function getPrevious()\n {\n return $this->hasPrevious() ? $this->curPage - 1 : null;\n }", "public function PreviousOf($item)\n {\n return $item->GetPrevious();\n }", "public function restored(Remission $remission)\n {\n //\n }", "public function restored(Candidate $candidate)\n {\n //\n }", "public function getPreviousValue()\n {\n return $this->previousValue instanceof ParcelBuilder ? $this->previousValue->build() : $this->previousValue;\n }", "public function getPrevPage()\n {\n return $this->prevPage;\n }", "public function getPrevBlock();", "public function previousElement();", "public function getPreviousMonth()\n {\n return $this->calendarMonth->getPreviousMonth();\n }", "public function getPreviousRow(string $type = 'object')\n {\n $result = $this->getResult($type);\n if (empty($result)) {\n return null;\n }\n\n if (isset($result[$this->currentRow - 1])) {\n $this->currentRow--;\n }\n\n return $result[$this->currentRow];\n }", "public function restored(Stock $stock)\n {\n //\n }", "public function previousPage()\n {\n return$this->currentPage - 1;\n }", "public function getBackUrl()\n {\n $url = $this->helperWizard()->getPreviousPageUrlAsString();\n return $this->getUrl($url, array('_current' => true));\n }", "public function restore_previous_locale() {\n\t\t$previous_locale = array_pop( $this->locales );\n\n\t\tif ( null === $previous_locale ) {\n\t\t\t// The stack is empty, bail.\n\t\t\treturn false;\n\t\t}\n\n\t\t$locale = end( $this->locales );\n\n\t\tif ( ! $locale ) {\n\t\t\t// There's nothing left in the stack: go back to the original locale.\n\t\t\t$locale = $this->original_locale;\n\t\t}\n\n\t\t$this->change_locale( $locale );\n\n\t\t/**\n\t\t * Fires when the locale is restored to the previous one.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param string $locale The new locale.\n\t\t * @param string $previous_locale The previous locale.\n\t\t */\n\t\tdo_action( 'restore_previous_locale', $locale, $previous_locale );\n\n\t\treturn $locale;\n\t}", "public function prev()\n {\n $current = $this->current();\n\n if ($current) {\n $this->current = $current->getBefore();\n }\n }", "private function _rollbackSavepoint($savepoint = 'MAIN_TRANSACTION') {\n if($savepoint == 'MAIN_TRANSACTION') {\n $this->sqlite->query(\"ROLLBACK\");\n return;\n }\n $this->sqlite->query('ROLLBACK TO SAVEPOINT \"'.$savepoint.'\"');\n }", "public function rollBackSavepoint($name)\n {\n try {\n parent::rollBackSavepoint($name);\n } catch (Exception $e) {\n // Specifically look for a \"No such savepoint\" error.\n if ($e->getCode() == 3 && isset($e->errorInfo[0]) && isset($e->errorInfo[1]) && $e->errorInfo[0] === '3B001' && $e->errorInfo[1] == 7) {\n Craft::warning('Tried to roll back a savepoint, but it does not exist: ' . $e->getMessage(), __METHOD__);\n } else {\n throw $e;\n }\n }\n }", "public function previousPageUrl()\n {\n $previousPage = $this->structure->getPreviousPage($this->currentPage);\n if ($previousPage) {\n return $this->structure->getUrl($this->currentPage, $previousPage);\n }\n\n return;\n }", "public function previous($fallback = false)\n {\n return $this->url->previous($fallback);\n }", "public function back()\n {\n return prev($this->tokens);\n }", "public function restoring(assignment $assignment)\n {\n //code...\n }", "public function getPrev() {\n\t\treturn $this->pagefiles->getPrev($this); \n\t}", "public function previousAttribute();", "public function restored(Lote $lote)\n {\n //\n }", "public function restore($id);", "public function restore($id);", "public function restore($id);", "public function restore($id);", "public function getPreviousPage() {\n\t\tif (($this->currentPage - 1) <= 0) {\n\t\t\t$this->currentPage = $this->countPages();\n\t\t\treturn $this->currentPage;\n\t\t} else {\n\t\t\treturn --$this->currentPage;\n\t\t}\n\t}", "public function getCurStage()\n {\n return $this->get(self::_CUR_STAGE);\n }", "public function getPreviousBalance()\n {\n return $this->previous_balance;\n }" ]
[ "0.64847505", "0.6366852", "0.62068486", "0.61878693", "0.6185421", "0.5793385", "0.5787758", "0.568686", "0.5645128", "0.5561892", "0.55159336", "0.5510167", "0.55079216", "0.55077875", "0.5480652", "0.5460727", "0.54588354", "0.54580903", "0.54289234", "0.54289234", "0.54228634", "0.539136", "0.5376061", "0.5370297", "0.53584534", "0.5330207", "0.53184307", "0.53149366", "0.53134215", "0.53132266", "0.53080237", "0.52962303", "0.5287325", "0.52796334", "0.5275218", "0.52707493", "0.5268485", "0.52640384", "0.52607536", "0.52522236", "0.5244395", "0.52416044", "0.5233684", "0.5225711", "0.52200747", "0.5218646", "0.52182025", "0.52107203", "0.5208615", "0.5208195", "0.520687", "0.5196604", "0.51949704", "0.51885515", "0.5165635", "0.5152486", "0.5146125", "0.5130389", "0.5124434", "0.51228875", "0.510606", "0.50938267", "0.50924647", "0.50912327", "0.5089999", "0.5085942", "0.50814533", "0.50799733", "0.507455", "0.506885", "0.5050519", "0.50500673", "0.5048956", "0.50459296", "0.5027983", "0.5016486", "0.50161403", "0.50149316", "0.5009509", "0.50012374", "0.50005084", "0.49740028", "0.49705532", "0.49686062", "0.49604937", "0.49593112", "0.49439976", "0.4942872", "0.49423167", "0.4922004", "0.49218842", "0.49179167", "0.4915875", "0.49131757", "0.49131757", "0.49131757", "0.49131757", "0.4910481", "0.490395", "0.49016836" ]
0.5014429
78
Display a listing of the resource.
public function index() { // return response("2"); }
{ "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 {\n $modules = Module::all();\n return Resource::collection($modules);\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 // 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 index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\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 $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 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 $this->indexPage('list-product', 'List Product');\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "function listing() {\r\n\r\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\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}", "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 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 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 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 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.7446377", "0.7361922", "0.72984487", "0.7248631", "0.7162871", "0.7148215", "0.7131838", "0.71028054", "0.7102395", "0.70988023", "0.7048243", "0.6993516", "0.6989079", "0.69341344", "0.69001913", "0.6899167", "0.68920904", "0.6887188", "0.68661547", "0.6849159", "0.683002", "0.6801792", "0.6796645", "0.67952746", "0.678579", "0.6760132", "0.6741144", "0.67304057", "0.6726034", "0.6723304", "0.6723304", "0.6723304", "0.67188966", "0.67061126", "0.67046595", "0.67042124", "0.6664004", "0.6663109", "0.66603667", "0.66595376", "0.6656908", "0.66536283", "0.6648508", "0.6619696", "0.66191936", "0.66145146", "0.66056865", "0.6600895", "0.66007215", "0.6593214", "0.6587006", "0.6585572", "0.6584028", "0.65802413", "0.65751636", "0.6574276", "0.6572553", "0.65703243", "0.6569474", "0.6563628", "0.6563418", "0.65516967", "0.655156", "0.65460885", "0.65367365", "0.6533626", "0.6533064", "0.6527408", "0.65251255", "0.6524834", "0.65202224", "0.6517302", "0.65167385", "0.6516062", "0.65148616", "0.6506742", "0.65018", "0.6501768", "0.6494415", "0.64921784", "0.6486631", "0.6485237", "0.6484199", "0.64841217", "0.6479556", "0.6478558", "0.6469807", "0.646858", "0.64683306", "0.6466808", "0.64637285", "0.64616066", "0.6458575", "0.6457558", "0.64535207", "0.64534074", "0.64524984", "0.64491946", "0.6448726", "0.6447211", "0.64461327" ]
0.0
-1
Show the form for creating a new resource.
public function create() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // return $request; //return response("sucsssadsadasdcess"); // $dt = Carbon::now(); //$data = array('balance' => 52525 ); // $data['time'] = '2020-10-02'; $mytime = \Carbon\Carbon::now(+2); $time = $mytime->toDateTimeString(); $bus = Bus::where('DeviceNumber', $request->id)->first(); $bus_id =$bus->id; $lastBalance = Balance::where('bus_id',$bus_id)->latest()->first();; // dd($lastBalance->secretNum); //if($request['id'] == "V155"){ ///device id $data = $request->balance ; $dataAr =explode(',',$data); // dd($dataAr[1]); if($lastBalance->secretNum == $dataAr[1] ){ if($lastBalance->amount == $dataAr[0]){ return response("success"); } else{ $form_data = array( 'secretNum' => $dataAr[1], 'bus_id' => $bus_id, 'amount' => $dataAr[0] ); $lastBalance->update($form_data); return response("success"); } } else{ if($dataAr[0] == 0) { return response("success"); } else { $form_data = array( 'secretNum' => $dataAr[1], 'bus_id' => $bus_id, 'amount' => $dataAr[0] ); Balance::create($form_data); return response("success"); } } //toast(__('Odeme Added Successfully'), 'success'); /* return array( 'b' => 41, //max number is 9999 'a' => 16 , 'l' => 60 , 'e' => "2021-11-09 54:72:47" ); */ return $request; // } /* else if($request['id'] == "6344F814"){ ///card id return array( 'b' => 270, //max number is 9999 'e' => "2021-01-18 33:36:52" ); } else{ return response("error"); } */ // dd($request); // $request['name'] = "post"; //return "ATCSQ"; return response("success"); return $request; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { return response("2"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $id=8; $data = "AT"; // return "AAA"; // return $id; return response("edit"); }
{ "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(Form $form)\n {\n //\n }", "public function edit()\n { \n return view('admin.control.edit');\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($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($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(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()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\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($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($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit()\n {\n return view('initializer::edit');\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 edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.7855416", "0.769519", "0.72748375", "0.724256", "0.7173659", "0.7064689", "0.70549816", "0.6985127", "0.6949479", "0.69474626", "0.694228", "0.6929372", "0.6903047", "0.6899655", "0.6899655", "0.688039", "0.68649715", "0.68618995", "0.68586665", "0.68477386", "0.68366665", "0.6812782", "0.6807947", "0.68078786", "0.6803727", "0.6796845", "0.67935634", "0.67935634", "0.67894953", "0.67862976", "0.67815566", "0.6777874", "0.67700446", "0.6764179", "0.6747784", "0.6747784", "0.67476946", "0.6746584", "0.67417157", "0.67370653", "0.6727131", "0.6714694", "0.66953164", "0.6693583", "0.6690321", "0.66898996", "0.6689058", "0.66865313", "0.6684526", "0.66717213", "0.6670211", "0.6666833", "0.6666833", "0.66633433", "0.6663041", "0.6661699", "0.6658396", "0.6657984", "0.665473", "0.6644314", "0.66343915", "0.6633082", "0.6629606", "0.6629606", "0.6620677", "0.6620635", "0.66180485", "0.66171867", "0.6612161", "0.6610249", "0.660762", "0.6597593", "0.6596027", "0.6595597", "0.65925545", "0.65920216", "0.65896076", "0.65822965", "0.6581996", "0.65817595", "0.65770084", "0.65768373", "0.6575926", "0.65713066", "0.6569505", "0.656938", "0.65680295", "0.65636957", "0.65636957", "0.65624565", "0.65597314", "0.6559697", "0.65576696", "0.65573514", "0.65564495", "0.6556307", "0.655628", "0.65558994", "0.6549784", "0.6549675", "0.65461886" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Create a new CompanyIndex instance.
public function __construct(array $response) { $this->recent = new CompanyCollection($response['recent']); $this->featured = new CompanyCollection($response['featured']); $this->featuredCovered = new CompanyCollection($response['featured_cover']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createIndex(): void;", "protected function createIndex(): IndexInterface {\n return Index::create([\n 'name' => $this->getRandomGenerator()->string(),\n 'id' => $this->getRandomGenerator()->name(),\n 'status' => 1,\n 'datasource_settings' => [\n 'entity:entity_test' => [],\n ],\n 'tracker_settings' => [\n 'default' => [],\n ],\n 'server' => $this->server->id(),\n 'options' => ['index_directly' => TRUE],\n ]);\n }", "public function create(Company $company)\n {\n //\n }", "public function create(Company $company)\n {\n //\n }", "public function index(Company $company)\n {\n //\n }", "public function index(Company $company)\n {\n //\n }", "public static function createAuthenticationCompany(){\n\t\t$continent_id = ModelTestHelper::createContinent();\n\t\t$currency_id = ModelTestHelper::createCurrency();\n\t\t$country_id = ModelTestHelper::createCountry($continent_id, $currency_id);\n\t\t$company_id = ModelTestHelper::createCompany($country_id, $currency_id, \"AUTH\");\n\t\t$company = Company::find($company_id);\n\t\treturn $company;\n\t}", "public function index()\n {\n return view('company.create');\n }", "public function buildIndex();", "public function __construct(Company $company)\n {\n $this->companies= $company;\n\n }", "public static function createIndex()\n {\n $db = static::getDb();\n $command = $db->createCommand();\n $command->createIndex(static::index(), [\n // Empty php arrays are converted to JSON arrays. Elasticsearch expects JSON object literals.\n // Epmty arrays leads to Java exception: \"elasticsearch java.util.ArrayList cannot be cast to java.util.Map\".\n// 'settings' => [ /* ... */ ],\n 'mappings' => static::mapping(),\n //'warmers' => [ /* ... */ ],\n //'aliases' => [ /* ... */ ],\n 'creation_date' => date('Y-m-d H:i:s'),\n ]);\n }", "public function __construct(Company $company)\n {\n $this->company = $company;\n }", "public function create()\n {\n $this->authorize('create', new Company);\n return view('companies.create');\n }", "abstract protected function makeIndex(string $table, DoctrineDBALIndex $index): Index;", "function createCompany() {\n\t\t\t\t\t$addForm = new h2o('views/addCompany.html');\n\t\t\t\t\techo $addForm->render();\n\t\t\t\t}", "public function __construct() {\r\n $this->model = new CompanyModel();\r\n }", "public function createIndex($name, array $fields)\n {\n $index = new Index($name);\n $index->setFields($fields);\n $index->resetFieldsSize();\n\n $this->addIndex($index);\n\n return $index;\n }", "public function index()\n {\n return Company::all();\n }", "public function index()\n {\n return Company::all();\n }", "public function createCompany($companyData) {\n return $this->createRecord('company', $companyData);\n }", "public function create(Company $company)\n {\n return $this->form(new Branch, $company);\n }", "public function createEntity()\n {\n $createdCompany = new Company();\n $createdCompany->setTitle('Test Company')\n ->setIco('11025848744')\n ->setDic('1258745968444')\n ->setStreet('Cesta 125')\n ->setZip('021478')\n ->setCity('Bratislava')\n ->setCountry('Slovenska Republika');\n\n $this->em->persist($createdCompany);\n $this->em->flush();\n\n return $createdCompany;\n }", "public function buildIndexCreator()\n {\n $indexCreator = $this->createIndexCreator();\n $indexCreator->setPath($this->path);\n $indexCreator->setFileName($this->filenamePrefix);\n $indexCreator->setLimit($this->limit);\n $indexCreator->setSitemapsCount($this->sitemapsCount);\n $indexCreator->useFormatCustom($this->format, $this->extension);\n\n return $indexCreator;\n }", "public function actionCreate()\n {\n $model = new CompanyForm();\n\n if ($model->load(Yii::$app->request->post()) && ($company = $model->create())) {\n return $this->redirect(['view', 'id' => $company->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "function createIndex()\n {\n try\n {\n $response = $this->elasticClient->indices()->create($this->mapping);\n }\n catch(Exception $e)\n {\n // print_r($e->getMessage());\n }\n\n }", "public function actionIndex()\n {\n $searchModel = new CompanySearch();\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 {\n $searchModel = new CompanySearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function __construct($company) {\n $this->company = $company;\n }", "public function __construct($company)\n {\n $this->company = $company;\n }", "public function index(Company $company)\n {\n return view('branches.index', compact('company'));\n }", "private function getIndex($indexPath, $create = false)\n {\n $index = new Index($indexPath, $create);\n $index->setHideException($this->hideIndexException);\n\n return $index;\n }", "public function create()\n {\n return view('companies.create',[\n 'companies' => Companies::all()\n ]);\n }", "public function index()\n {\n return view('company.index');\n }", "public function create()\n {\n return view('Admin.pages.company.create');\n }", "public function create()\n {\n return view('dashboard.companies.create', [\n 'title' => 'Add new Company',\n ]);\n }", "protected function createIndex(string $index, array $options = []): void\n {\n $engine = $this->app->make(EngineManager::class)->engine();\n $task = $engine->createIndex($index, $options);\n $engine->waitForTask($task['taskUid']);\n }", "function __construct() {\n\t\t//upon initialize, also instaintiate new Company object\n \t$this->Company = new Company();\n }", "public function create()\n {\n return view('admin.create-company');\n }", "public function create()\n {\n return view('company.companycreate' );\n }", "public function create()\n {\n return $this->index();\n }", "public function create()\n {\n return view('v1.colorpro.admin.create_company');\n }", "public function create( $company_id = null )\n {\n\n $companies = Company::all();\n\n return view('clients.projects.create',['companies'=>$companies]);\n }", "public function create()\n {\n if (! Gate::allows('company_create')) {\n return abort(401);\n }\n \n $vivode_ids = \\App\\Vivodeship::get()->pluck('name', 'id');\n\n $trades_ids = \\App\\Trade::get()->pluck('name', 'id');\n\n $nomiyear_ids = \\App\\Year::get()->pluck('name', 'id');\n\n $users = \\App\\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n\n return view('admin.companies.create', compact('vivode_ids', 'trades_ids', 'nomiyear_ids', 'users'));\n }", "public function makeIndex()\n {\n //Admin panel\n if (!TTO_IS_ADMIN) {\n return;\n }\n\n //Index contents\n $count = $this->search->getEngine()->indexContents();\n\n //Update counter\n $index = Search::getIndex();\n TeaThemeOptions::setConfigs($index.'-count', $count);\n }", "public function create()\n {\n return view('admin.company.create');\n }", "public function create()\n {\n //\n return view('admin.companies.create');\n\n }", "public function index()\n {\n return view('company.index',[\n 'companies' => Company::orderBy('created_at', 'desc')->paginate(10)\n ]);\n }", "public function index()\n {\n return view('companies.index',[\n 'companies' => Companies::all()\n ]);\n }", "public function create($company)\n {\n return view('admin.project-management.create')->with('company', $company);\n }", "public function create()\n {\n\t\treturn view('companies.create');\n //\n }", "public function index()\n {\n $title = trans('company.companies');\n return view('user.company.index', compact('title'));\n }", "public function create()\n {\n if (! Gate::allows('Admin_Manage')) {\n return abort(401);\n }\n return view('system.company.create');\n }", "public function create()\n {\n $company_categories = CompanyCategory::all();\n return view('company.create')->with(['company_categories' => $company_categories]);\n }", "public function create()\n {\n abort_if(!$this->user->can('add_company'), 403);\n return view('admin.company.create', $this->data);\n }", "public function index()\n {\n $companies = Company::orderBy('name', 'asc')->paginate(10);\n return view('company.index')->with('companies', $companies);\n }", "public function index()\n {\n return view('companies.index', [ 'companies' => Company::all() ]);\n }", "public function create()\n\t{\n\t\tif (auth()->user()->can(\"company.create\")){\n\t\t\t$data = new Companies;\n\t\t\t$data->COMPANY_TYPE = \"B\";\n\t\t\treturn response()->view('companies.form', [\"data\" => $data,\n\t\t\t\t\t\t\t\t\t\t \"action\" => 'add']);\n\t\t}\n\t\telse {\t\t\t\n\t\t\treturn response(\"\", 403);\n\t\t}\n\t}", "public function create()\n {\n return view('company.create');\n }", "public function create()\n {\n return view('companies.create');\n }", "public function __construct(Model $company)\n {\n $this->company = $company;\n }", "public function index()\n {\n $companies = $this->repository->orderBy('name')->paginate('8');\n\n return view('company.index', compact('companies'));\n }", "public function create()\n {\n return view('company.create');\n }", "public function create()\n {\n return view('company.create');\n }", "public function create()\n {\n return view('company.create');\n }", "public function create()\n {\n return view('company.create');\n }", "public function create()\n {\n return view('company.create');\n }", "public function create()\n {\n return view('company.create');\n }", "public function create()\n {\n return view('company.create');\n }", "public function create()\n {\n return view('company.create');\n }", "public function create()\n {\n return view('company.create');\n }", "public function create()\n {\n return view('company.create');\n }", "public function create()\n {\n return view('company.create');\n }", "public function create()\n {\n return view('companies.create');\n }", "public function create()\n {\n return view('admin.companies.create');\n }", "public function create()\n {\n return view('admin.companies.create');\n }", "public function create() {\n return view('insurance_companies.create');\n }", "public function create()\n {\n return view('airline_companies.create');\n }", "public function create($company_id=null)\n { \n $companies = null;\n if(!$company_id){\n $companies = Company::where('user_id', Auth::user()->id)->get();\n }\n return view('projects.create',['company_id'=>$company_id,'companies'=>$companies]);\n }", "public function create()\n {\n return view('admin.home.aboutCompany.create');\n }", "public function create()\n {\n $title = trans('company.new');\n\n $this->generateParams();\n\n return view('user.company.create', compact('title'));\n }", "public function create()\n {\n //create new Cmp_No\n $Cmp_No = 0;\n if(count(MainCompany::all()) == 0){\n $Cmp_No = 1;\n }\n else{\n $last_cmp = MainCompany::orderBy('Cmp_No', 'desc')->first();\n if($last_cmp == null){\n $Cmp_No = 1;\n }\n else{\n $Cmp_No = $last_cmp->Cmp_No + 1;\n }\n }\n\n $company = MainCompany::findOrFail(MainCompany::create([\n 'Cmp_NmAr' => '',\n ])->ID_No);\n\n if (!empty($company)){\n $company->Cmp_No = $Cmp_No;\n $company->save();\n }\n return redirect(aurl('companies/' . $company->ID_No . '/edit'));\n }", "public function index()\n {\n $companies = Company::orderBy('created_at', 'desc')->paginate(10);\n return view('Admin.pages.company.index')->with('companies', $companies);\n }", "public function create()\n {\n return view('companies.create')\n ->with('categories', Category::all())\n ->with('countries', Country::all());\n }", "public function create()\n {\n return view('companies.create');\n\n }", "public function index()\n {\n \n $companies = Company::latest()->paginate(10);\n return view('company.index',compact('companies'))\n ->with('i', (request()->input('page', 1) - 1) * 10);\n }", "public function index()\n {\n $companies = Company::paginate(10);\n\n return view('company.index', [\n 'companies' => $companies,\n ]);\n\n }", "public function index()\n {\n return Company::paginate(10);\n }", "public function __construct(Company $company, array $data)\n {\n $this->company = $company;\n $this->data = Collection::make($data);\n }", "public function actionNew()\n {\n $model = new Company;\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 index()\n {\n $order = $this->get->get('order', 'ASC');\n $by = $this->get->get('by', 'name');\n $companies = $this->company->orderBy($by, $order)->paginate($this->totalPage);\n return view('admin.company.index', compact('companies'));\n }", "protected function newIndex()\n {\n if (!isset($this->client)) {\n $this->client = $this->newClient();\n }\n\n return $this->client->getIndex($this->config['index']);\n }", "public function create()\n {\n //\n $Companies=Company::lists('name','id');\n// dd($Companies);\n return view('loan.create')->with(['companies'=>$Companies]);\n }", "public function index()\n {\n return view('company');\n }", "public function create()\n {\n return view('companies.create');\n }", "public function create()\n {\n return view('companies.create');\n }", "public function create()\n {\n return view('companies.create');\n }", "public function create()\n {\n return view('companies.create');\n }", "public function create()\n {\n return view('companies.create');\n }", "public function create()\n {\n return view('companies.create');\n }", "public function store(CreateCompanyRequest $request)\n {\n $this->company->createCompany($request);\n return response(['message'=>\"Company created successfully\",'success'=>true]);\n }", "public function create()\n {\n $categories = Category::all();\n return view(\n 'account.company.create',\n [\n 'categories' => $categories\n ]\n );\n }" ]
[ "0.6576632", "0.6568153", "0.6346636", "0.6346636", "0.6239895", "0.6239895", "0.6052615", "0.59345174", "0.59209967", "0.59182644", "0.58549917", "0.5755459", "0.57452416", "0.5714463", "0.57019055", "0.5698787", "0.5695306", "0.56741893", "0.56741893", "0.56726176", "0.5666864", "0.5648339", "0.56212926", "0.56159604", "0.5589505", "0.5584284", "0.5584284", "0.55820215", "0.5567092", "0.5553548", "0.55473065", "0.5524298", "0.5512201", "0.55045617", "0.5496998", "0.5483474", "0.547797", "0.54761004", "0.54726005", "0.54658765", "0.54635584", "0.54632413", "0.5430133", "0.5429388", "0.5426366", "0.54244775", "0.5424043", "0.5422241", "0.54192543", "0.54136014", "0.5409999", "0.5404641", "0.54016036", "0.5398607", "0.53953093", "0.5388528", "0.5383991", "0.53794163", "0.5373639", "0.53729695", "0.53677195", "0.53543085", "0.53543085", "0.53543085", "0.53543085", "0.53543085", "0.53543085", "0.53543085", "0.53543085", "0.53543085", "0.53543085", "0.53543085", "0.53494924", "0.53304255", "0.53304255", "0.53273624", "0.5323666", "0.5321169", "0.53190845", "0.53107756", "0.5299838", "0.52992225", "0.5287942", "0.52869827", "0.52869356", "0.5279291", "0.52736944", "0.52729934", "0.52729833", "0.52709043", "0.52584577", "0.5250969", "0.5250617", "0.52503294", "0.52503294", "0.52503294", "0.52503294", "0.52503294", "0.52503294", "0.52485466", "0.5246515" ]
0.0
-1
Get the last 4 companies created.
public function getRecent(): CompanyCollection { return $this->recent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findLastRegistered()\n {\n $qb = $this->createQueryBuilder('u')\n ->select('u')\n ->orderBy('u.createdAt', 'DESC')\n ->setMaxResults(4);\n\n return $qb->getQuery()->getResult();\n }", "public function getlatestCompanies()\n {\n $AdminDashboardModel = $this->model('AdminDashboardModel');\n $this->latestCompanies = $AdminDashboardModel->getLatestCompanies();\n }", "private function getLastUsers() {\n $last_five_users = array();\n $result = db_select('users_field_data', 'u')\n ->fields('u', array('uid', 'name', 'mail', 'created'))\n ->condition('u.created', REQUEST_TIME - 3600, '>')\n ->orderBy('created', 'DESC')\n ->range(0, 15)\n ->execute();\n\n $count = 0;\n foreach ($result as $record) {\n $last_five_users[$count]['uid'] = $record->uid;\n $last_five_users[$count]['name'] = $record->name;\n $last_five_users[$count]['email'] = $record->mail;\n $last_five_users[$count]['created'] = $record->created;\n $count++;\n }\n\n return $last_five_users;\n }", "public function get_recent_doctors(){\n $query = $this->m->port->p->query('SELECT * FROM quickblox WHERE regid !=\" '. $this->m->user_value('regid').'\" and role =\"'.M::ROLE_DOCTOR. '\" and (lastlogin>date_sub(now(), Interval 11 second) OR logout_time>date_sub(now(),Interval 10 second))');\n $doctors = array();\n $temp = array();\n foreach ($query->result() as $row){\n $temp['id'] = $row->id;\n $temp['regid'] = $row->regid;\n $temp['name'] = $row->name;\n $temp['status'] = $row->status;\n array_push($doctors, $temp);\n }\n return $doctors;\n }", "public static function latestSkills(Company $company): array\n {\n $skillsCount = $company->skills()->count();\n\n $skills = $company->skills()\n ->select('id', 'name')\n ->latest()\n ->take(5)\n ->get();\n\n $skillsCollection = collect([]);\n foreach ($skills as $skill) {\n $skillsCollection->push([\n 'name' => $skill->name,\n 'url' => route('company.skills.show', [\n 'company' => $company,\n 'skill' => $skill,\n ]),\n ]);\n }\n\n return [\n 'count' => $skillsCount,\n 'view_all_url' => route('company.skills.index', [\n 'company' => $company->id,\n ]),\n 'skills' => $skillsCollection,\n ];\n }", "public function companies()\n {\n return $this->belongsToMany('App\\Company')->withTimestamps();\n }", "public function getCompany();", "public function getCompanyWithUsers();", "public static function latestQuestions(Company $company): array\n {\n $questionsCount = DB::table('questions')\n ->where('company_id', $company->id)\n ->count();\n\n // get the 3 latest questions asked to every employee of the company\n $latestQuestions = DB::table('questions')\n ->join('answers', 'questions.id', '=', 'answers.question_id')\n ->where('company_id', '=', $company->id)\n ->where('questions.active', false)\n ->groupBy('questions.id', 'questions.title')\n ->orderByDesc('questions.id')\n ->limit(3)\n ->select('questions.id', 'questions.title')\n ->selectRaw('count(answers.id) as count')\n ->get();\n\n // building a collection of questions\n $questionCollection = $latestQuestions->filter(function ($question) {\n return $question->count > 0;\n })->map(function ($question) use ($company) {\n return [\n 'id' => $question->id,\n 'title' => $question->title,\n 'number_of_answers' => $question->count,\n 'active' => false,\n 'url' => route('company.questions.show', [\n 'company' => $company,\n 'question' => $question->id,\n ]),\n ];\n });\n\n // get the active question, if it exists\n $activeQuestion = Question::where('company_id', $company->id)\n ->active()\n ->withCount('answers')\n ->first();\n\n if ($activeQuestion) {\n $activeQuestion = [\n 'id' => $activeQuestion->id,\n 'title' => $activeQuestion->title,\n 'number_of_answers' => (int) $activeQuestion->answers_count,\n 'active' => true,\n 'url' => route('company.questions.show', [\n 'company' => $company,\n 'question' => $activeQuestion->id,\n ]),\n ];\n }\n\n return [\n 'total_number_of_questions' => $questionsCount,\n 'all_questions_url' => route('company.questions.index', [\n 'company' => $company->id,\n ]),\n 'questions' => $questionCollection,\n 'active_question' => $activeQuestion ? $activeQuestion : null,\n ];\n }", "public function getCompany() {}", "public function companies(): Collection\n {\n return Company::all();\n }", "public function last3Registers(){\n $mysql= $this->database->databaseConnect();\n $sql = 'SELECT * FROM (\n SELECT * FROM client ORDER BY id DESC LIMIT 3\n ) as r ORDER BY name';\n $query = mysqli_query($mysql, $sql) or die(mysqli_connect_error());\n $this->database->databaseClose();\n\n while($row = mysqli_fetch_assoc($query)){\n $this->last_registers[] = $row;\n }\n\n return $this->last_registers;\n }", "public function getCompaniesForSelect()\n {\n return Company::whereNull('deleted_at')->pluck('name', 'id');\n }", "public function getCompany() {\n return Companies::findById($this->company_id);\n }", "public static function latestNews(Company $company): array\n {\n $totalCompanyNews = $company->news()->count();\n\n $news = $company->news()\n ->orderBy('id', 'desc')\n ->take(3)\n ->get();\n\n $newsCollection = collect([]);\n foreach ($news as $new) {\n $newsCollection->push([\n 'id' => $new->id,\n 'title' => $new->title,\n 'extract' => StringHelper::parse(Str::words($new->content, 20, ' ...')),\n 'author_name' => $new->author_name,\n ]);\n }\n\n return [\n 'count' => $totalCompanyNews,\n 'news' => $newsCollection,\n 'view_all_url' => route('company.news.index', [\n 'company' => $company,\n ]),\n ];\n }", "public function recentAlbums(){\n return DB::select('select * from albums order by albums.album_created_at DESC limit 5');\n }", "public function findLatest($limit = 4)\n {\n return $this->createQueryBuilder('pc')\n \t\t->where('pc.mangopayIsSucceeded = :mangopayIsSucceeded')\n \t\t->setParameter('mangopayIsSucceeded', true)\n \t\t->andWhere('pc.mangopayIsCompleted = :mangopayIsCompleted')\n \t\t->setParameter('mangopayIsCompleted', true)\n ->orderBy('pc.id', 'DESC')\n ->setMaxResults($limit)\n ->getQuery()\n ->getResult();\n }", "public function allCompanies()\n {\n return Company::all();\n }", "function getMostRecentCourses(){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT id, name, author, image FROM Course ORDER BY creationDate LIMIT 3\";\n\n\t\t$result = $conn->query($query);\n\n\t\treturn fetch_all($result);\n\t}", "function Companies(){\n\t\t\t\treturn $this->companies;\n\t\t\t}", "public function index()\n {\n $company = $this->repository->all();\n return $company;\n }", "function getNewestProducts()\n {\n $sql = self::$connection->prepare(\"SELECT * FROM products ORDER BY created_at DESC LIMIT 3\");\n $sql->execute();//return an object\n $items = array();\n $items = $sql->get_result()->fetch_all(MYSQLI_ASSOC);\n return $items; //return an array\n }", "public function getListRecents(){\n\t\t$resultsUsers = [];\n\t\t$q = $this->pdo->query('SELECT * FROM utilisateur ORDER BY dateCreation DESC LIMIT 4');\n\t\twhile ($donnee = $q->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$resultsUsers[] = new Utilisateur($donnee);\n\t\t}\n\t\treturn $resultsUsers;\n\t}", "function GetCompanies()\n{\n\t$CompArr=array();\n\t$Query = \"SELECT * FROM \".PFX.\"_tracker_client ORDER BY NAME ASC\";\n\t$Sql = new Query($Query);\n\twhile ($Row=$Sql->Row()) {\n\t\t$CompArr[$Sql->Position]['Name']=htmlspecialchars(stripslashes($Row->NAME));\n\t\t$CompArr[$Sql->Position]['Value']=$Row->ID;\n\t}\n\treturn $CompArr;\n}", "public function getRecentCreatedUsers()\n {\n $result = $this\n ->_model\n ->orderBy('created_at', 'desc')\n ->get();\n\n return $result;\n }", "public static function latestShips(Company $company): Collection\n {\n $ships = DB::table('ships')\n ->join('teams', 'ships.team_id', '=', 'teams.id')\n ->join('companies', 'teams.company_id', '=', 'companies.id')\n ->select('ships.id', 'ships.title', 'ships.team_id')\n ->where('companies.id', $company->id)\n ->orderBy('ships.created_at', 'desc')\n ->take(3)\n ->get();\n\n $shipsCollection = collect([]);\n foreach ($ships as $ship) {\n $shipsCollection->push([\n 'url' => route('ships.show', [\n 'company' => $company,\n 'team' => $ship->team_id,\n 'ship' => $ship->id,\n ]),\n 'title' => $ship->title,\n ]);\n }\n\n return $shipsCollection;\n }", "public function company()\n {\n return $this->author()->company();\n }", "public function getAllCompanies(){\n\t\t$path=\"../db/data.json\";\n\t\t$file=$this->getData($path);\n\t\n\t\t$arrayFile = json_decode($file, true);\n\t\n\t\treturn $arrayFile['companies'];\n\t}", "function get_deleted_companies() {\n return get_view_data('org_list_archived');\n}", "public function getCompanyWithUniqueLogins();", "public function getLastYearData() {\n\t\t$dates = getPeriods('LastYear');\n\t\treturn $this->getDataByInterval($dates['startMonth'], $dates['startYear'], $dates['endMonth'], $dates['endYear'], 12);\t\t\n\t}", "public function companyOfUser(){\n\n $company = Auth::user()->companies;\n $location = Location::where('id', Auth::user()->company_location)->get();\n \n foreach($company as $c){\n $c['locations'] = $location;\n }\n\n return $company;\n }", "public function getCompaniesToSuspend() {\n return $this->createQuery('c')\n ->select('c.*')\n ->from('Companies_Model_Company c')\n ->where('c.status = ?', Companies_Model_Company::STATUS_EXPIRED)\n ->addWhere('c.payment_date IS NOT NULL AND ADDDATE(c.payment_date, 8) < NOW()')\n ->execute();\n }", "public function index ()\n {\n $company = Company::orderBy('created_at', 'desc')->paginate(5);\n return CompanyResource::collection($company);\n }", "public function allCompanies()\n {\n\n $companies = $this->core_companies;\n\n $items = [];\n foreach ($companies as $company) {\n\n $companyItem = new CompanyCardItem();\n $companyItem->id = $company->id;\n $companyItem->name = $company->name;\n //$companyItem->amount = $catalog->amount;\n $companyItem->title = $company->title;\n if (\\Dash\\count($company->photo))\n $companyItem->image = '/uploaz/eyuf/UserCompany/photo/' . $company->id . '/' . $company->photo[0];\n $companyItem->url = ZUrl::to([\n 'customer/markets/show',\n 'id' => $company->id\n ]);\n $companyItem->distence = \"12km\";\n //$companyItem->image = $catalog->price;\n //$companyItem->price = $catalog->price_old;\n //$companyItem->currency = \"$\";\n //$companyItem->cart_amount = 0;\n\n $items[] = $companyItem;\n }\n return $items;\n }", "public function getPersonelAdd() {\n $companies = Companies::all();\n return $companies;\n }", "function getAllLatestCompany($connection)\n{\n $companyQuery = 'SELECT * FROM company ORDER BY company_ID desc LIMIT 10';\n $companyList = $connection->query($companyQuery);\n while ($resultSet = $companyList->fetch_assoc()) {\n echo ' <tr>' .\n '<td>' . $resultSet['company_ID'] . '</td>' .\n '<td>' . $resultSet['p_ID'] . '</td>' .\n '<td>' . ' <img src=\"../../assets/images/upload/' . $resultSet['image']\n . '\" alt=\"seekerProfile\" width=\"50px\" height=\"50px\"\n style=\"background-position: 50% 50%;background-size: cover;\">' . '</td>' .\n '<td>' . $resultSet['company_name'] . '</td>' .\n '<td>' . $resultSet['email'] . '</td>' .\n '<td>' . $resultSet['web_url'] . '</td>' .\n '<td>' . $resultSet['address'] . '</td>' .\n '<td>' . $resultSet['description'] . '</td>' .\n '<td>' . $resultSet['status'] . '</td>' .\n '<td>' .\n '&nbsp; &nbsp;<i class=\"fas fa-trash-alt\" style=\"color: red;cursor: pointer;\"></i>&nbsp; &nbsp;' .\n '<i class=\"fas fa-edit\" style=\"color: #F0BB11;cursor: pointer;\"></i> &nbsp; &nbsp;' .\n '</td>' .\n '</tr>';\n }\n}", "public function get_company() \n {\n return $this->company;\n }", "public static function latest($limit = 60){\n $key = self::$prefix['list'].\"latest\";\n $cartoons = [];\n if(Cache::exists($key)){\n $list = Cache::fetch($key);\n }else {\n $list = Functions::api_fetch(\"/cartoon/latest\");\n Cache::save($key, $list, RECENT_UPDATE_TIME);\n }\n $list = array_slice($list->cartoons,0,$limit);\n foreach ($list as $cartoon){\n $cartoons[] = Cartoon::get($cartoon->id);\n }\n return $cartoons;\n }", "public function getUserCompany()\n {\n $user_company = \\App\\User::with(['company'])->where('id', Auth::user()->id)->first();\n return $user_company ? $user_company : null;\n }", "public function latest($limit = 10)\n {\n return $this->orderBy('created_at', 'DESC')->limit($limit)->get();\n }", "public static function recentProducts(){\n $recent = Product::find()\n ->where(['>=','actual_date',time()]) // show before actual_date\n ->orderBy(['created_at'=>SORT_DESC, 'updated_at'=>SORT_DESC])\n ->limit( self::SHOW_NUMBER_OF_FOOTER_PRODUCT)\n ->all();\n return $recent;\n }", "public function findDataLast()\n {\n return $this->getEntityManager()\n ->createQuery(\"SELECT DISTINCT t.number, f.id as finance, f.price as cost, f.gotcarq as gotcarqId\n FROM GazMainBundle:Terminal t\n JOIN GazMainBundle:Finance f WITH f.terminal = t\n\t\t\t\t\t\t\tWHERE (f.gotcarq IS NOT NULL AND f.gotcarq != 0)\n\t\t\t\t\t\t\t AND f.created = (SELECT MIN(f1.created) FROM GazMainBundle:Finance f1\n LEFT JOIN f1.terminal t1\n WHERE t1.id = t.id AND f1.financeType = FALSE)\n\t\t\t\t\t\t\tORDER BY t.number ASC\n \")\n ->getResult();\n }", "public static function newHiresThisWeek(Company $company): Collection\n {\n $now = Carbon::now();\n $employees = $company->employees()\n ->where('locked', false)\n ->whereNotNull('hired_at')\n ->whereDate('hired_at', '>=', $now->copy()->startOfWeek(Carbon::MONDAY))\n ->whereDate('hired_at', '<=', $now->copy()->endOfWeek(Carbon::SUNDAY))\n ->with('position')\n ->orderBy('hired_at', 'asc')\n ->get();\n\n $newHiresCollection = collect([]);\n foreach ($employees as $employee) {\n $date = $employee->hired_at;\n $position = $employee->position;\n\n if ($position) {\n $dateString = $date->isPast() ?\n trans('company.new_hires_date_with_position_past', [\n 'date' => DateHelper::formatDayAndMonthInParenthesis($date),\n 'position' => $position->title,\n ]) : trans('company.new_hires_date_with_position_future', [\n 'date' => DateHelper::formatDayAndMonthInParenthesis($date),\n 'position' => $position->title,\n ]);\n } else {\n $dateString = $date->isPast() ?\n trans('company.new_hires_date_past', [\n 'date' => DateHelper::formatDayAndMonthInParenthesis($date),\n ]) : trans('company.new_hires_date_future', [\n 'date' => DateHelper::formatDayAndMonthInParenthesis($date),\n ]);\n }\n\n $newHiresCollection->push([\n 'id' => $employee->id,\n 'url' => route('employees.show', [\n 'company' => $company,\n 'employee' => $employee->id,\n ]),\n 'name' => $employee->name,\n 'avatar' => ImageHelper::getAvatar($employee, 35),\n 'hired_at' => $dateString,\n ]);\n }\n\n return $newHiresCollection;\n }", "function get_vehicles_by_year() {\n global $db;\n $query = 'SELECT * FROM vehicles\n ORDER BY year DESC';\n $statement = $db->prepare($query);\n $statement->execute();\n $vehicles = $statement->fetchAll();\n $statement->closeCursor();\n return $vehicles;\n }", "public function getRecentCreatedCourses()\n {\n $result = $this\n ->_model\n ->orderBy('created_at', 'desc')\n ->get();\n\n return $result;\n }", "public function getAvailableCompanies()\n {\n return $this->createQuery('c')\n ->select('c.*')\n ->addSelect(\n \"(SELECT ROUND(AVG(r.rating), 2)\n FROM Companies_Model_Review r\n WHERE r.status = '\" . Companies_Model_Review::STATUS_PUBLISHED . \"'\n AND r.company_id = c.id) as rating\"\n )\n ->addSelect(\"(SELECT COUNT(rc.id)\n FROM Companies_Model_Review rc\n WHERE rc.status = '\" . Companies_Model_Review::STATUS_PUBLISHED . \"'\n AND rc.company_id = c.id) as review_count\")\n ->whereIn('c.status', Companies_Model_Company::getActiveStatuses())\n ->orderBy('rating DESC')\n ->execute();\n }", "function getCompanyFollowers()\n{\n\t//the defaults starts\n\tglobal $myStaticVars;\n\textract($myStaticVars); // make static vars local\n\t$member_default_avatar \t\t= $member_default_avatar;\n\t$member_default_cover\t\t= $member_default_cover;\n\t$member_default\t\t\t\t= $member_default;\n\t$company_default_cover\t\t= $company_default_cover;\n\t$company_default_avatar\t\t= $company_default_avatar;\n\t$events_default\t\t\t\t= $events_default;\n\t$event_default_poster\t\t= $event_default_poster;\n\t//the defaults ends\n\t\t\n\t$companyUserName=validate_input($_GET['company']);\n\t$companyid=getCompanyIdfromCompanyUserName($companyUserName);\t\n\t\n\t$session_values=get_user_session();\n\t$my_session_id\t= $session_values['id'];\n\t\n\t$data= array();\t\n\t\n\t$data=fetch_company_information_from_companyid($companyid);\n\t\n\tif($my_session_id)\n\t{\n\t\t$data['followed']= doIFollowThisCompany($my_session_id,$companyid);\n\t}\n\t\n\t$data['followersObjects']\t\t= getThisCompanyfollowerObjects($companyid);\n\t\n\treturn $data;\n\t/*\t\n\tdata = {\n\t\t\t\"id\": 1,\n\t\t\t\"companyUserName\": \"nbbit\",\n\t\t\t\"profilePhoto\": \"company01.jpg\",\n\t\t\t\"coverPhoto\": \"memberCover01.jpg\",\n\t\t\t\"name\": \"Pet Studio.com\",\n\t\t\t\"location\": \"Fort Legend Tower\",\n\t\t\t\"followed\": true,\n\t\t\t\"followers\": \"1\",\n\t\t\t\"following\": \"1\",\n\t\t\t\"followersObjects\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"username\": \"jordan\",\n\t\t\t\t\t\"avatar\": \"member01.jpg\",\n\t\t\t\t\t\"coverPhoto\": \"memberCover01.jpg\",\n\t\t\t\t\t\"firstName\": \"Jordan\",\n\t\t\t\t\t\"lastName\": \"Rains\",\n\t\t\t\t\t\"position\": \"Office Assistant\",\n\t\t\t\t\t\"company\": [{\n\t\t\t\t\t\t\"companyName\": \"Pet Studio.com\",\n\t\t\t\t\t\t\"companyDesc\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit.\"\n\t\t\t\t\t}]\n\t\t\t\t}\n\t\t\t]\n\t\t};\t\n\t*/\n\n}", "public function getCompany()\n {\n return $this->company;\n }", "function getRecents() {\n\t\t$link = getDbConnect();\n\t\t$preparedStatement = $link->prepare(\"SELECT * FROM urls ORDER BY id DESC LIMIT 30;\");\n\t\t$preparedStatement->execute(array());\n\t\treturn parseFullResults($preparedStatement->fetchAll());\n\t}", "public function get_last_posts(){\n\t\t$this->db->order_by('posts.created_at', 'DESC');\n\t\t$this->db->where('validated', 1);\n\t\t$this->db->join('categories', 'categories.id = posts.category_id');\n\t\t$this->db->limit(3);\n\t\t$query = $this->db->get('posts');\n\t\treturn $query->result_array();\n\t}", "public function getLast4()\n\t{\n\t\treturn $this->last4;\n\t}", "public function getLatestProduct()\n {\n $this->db->connect();\n $sql = \"SELECT * FROM $this->table ORDER BY added LIMIT 4;\";\n $product = $this->db->executeFetchAll($sql);\n return $product;\n }", "private function getNewest($count = 5) {\n return Posts::where('status', 'public')->orderBy('id', 'desc')->take($count)->get();\n }", "public function companies()\n {\n return $this->morphedByMany('App\\Company', 'taggable');\n }", "public function index()\n {\n return Company::all();\n }", "public function index()\n {\n return Company::all();\n }", "public function getAuthorcompany() {}", "public function getHistory()\n {\n \treturn QuizResult::where('user_id', '=', Auth::user()->id)->orderBy('id', 'DESC')->limit(5)->get();\n }", "public function recentVisits_get()\n {\n $em = $this->doctrine->em;\n $morevisitsRepo = $em->getRepository('Entities\\Service');\n $morevisits = $morevisitsRepo->findBy(array(), array('visit_at' => 'DESC'), 4);\n\n foreach ($morevisits as $service) {\n $service->loadRelatedData(null, null, site_url());\n }\n\n if ($morevisits) {\n $response[\"desc\"] = \"Servicios mas visitados\";\n $response[\"count\"] = count($morevisits);\n $response[\"data\"] = $morevisits;\n } else {\n $response[\"desc\"] = 'No existen servicios mas visitados';\n $response[\"count\"] = 0;\n $response[\"data\"] = array();\n }\n $this->set_response($response, REST_Controller::HTTP_OK);\n }", "public function get_lastThree() {\n\n $query = $this->db->query('SELECT * FROM recipes WHERE recipes.published ORDER BY recipes.lastModDate DESC LIMIT 3');\n\n return $result = $query->result();\n }", "public function getallCreditCustomers() \n\t{ \n\t $cid = $this->gasolinereceived_model->getCompanyId();\n\t\t $cid1 = $cid['0']->c_id;\n\t\t \n\t\t $this->db->where('c_id',$cid1);\n\t\t \n\t\t $this->db->order_by('date_created','DESC');\n\t\t $query = $this->db->get('credit_customer')->result();\n\t $q=$this->db->last_query($query );\n\t\t// print_r($q); die('err');\n\t return $query;\n\t \n\t}", "public static function employees(Company $company): array\n {\n // number of employees in total\n $totalNumberOfEmployees = $company->employees()->notLocked()->count();\n\n // 10 random employees\n $tenRandomEmployeesCollection = collect([]);\n $allEmployees = $company->employees()\n ->notLocked()\n ->with('picture')\n ->inRandomOrder()\n ->take(10)\n ->get();\n\n foreach ($allEmployees as $employee) {\n $tenRandomEmployeesCollection->push([\n 'id' => $employee->id,\n 'name' => $employee->name,\n 'avatar' => ImageHelper::getAvatar($employee, 32),\n 'url' => route('employees.show', [\n 'company' => $company,\n 'employee' => $employee,\n ]),\n ]);\n }\n\n // ten random employees\n\n // number of employees hired in the current year\n $employeesHiredInTheCurrentYear = $company->employees()\n ->notLocked()\n ->whereYear('hired_at', (string) Carbon::now()->year)\n ->count();\n\n return [\n 'employees_hired_in_the_current_year' => $employeesHiredInTheCurrentYear,\n 'ten_random_employees' => $tenRandomEmployeesCollection,\n 'number_of_employees_left' => $totalNumberOfEmployees - $tenRandomEmployeesCollection->count(),\n 'view_all_url' => route('employees.index', [\n 'company' => $company,\n ]),\n ];\n }", "public static function all() {\n\n $db = Zend_Registry::get('dbAdapter');\n $result = $db->query('select id from companys')->fetchAll();\n $companys = new SplObjectStorage();\n foreach ($result as $c) {\n try {\n $company = new Yourdelivery_Model_Company($c['id']);\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n continue;\n }\n $companys->attach($company);\n }\n return $companys;\n }", "public function indexCompany()\n {\n return TimelineResource::collection(\n $this->user->company->timeline()\n ->with(['pictures', 'videos', 'geo', 'links'])\n ->paginate(request()->get('per_page') ?? 15)->appends(request()->all())\n );\n }", "public function getFinishedCompanyTasks(Company $company): Collection {\n return CompanyTask::where('company_tasks.status', CompanyTask::STATUS_FINISHED)\n ->join('company_task_user_applies', 'company_tasks.id', '=', 'company_task_user_applies.company_task_id')\n ->where('company_task_user_applies.company_id', $company->id)\n ->where('company_task_user_applies.status', CompanyTaskUserApply::STATUS_ASSIGNED)\n ->orderBy('company_task_user_applies.id' ,'asc')\n ->limit(3)\n ->get();\n }", "public function getAllCompanyByPage($filter, $page = 1, $page_size = 20, $orderby = '') {\n $regulatorToCompanyModel = new Model_Jiafuyun_RegulatorToCustomer();\n// $companyModel = new Model_Zhianbao_Company();\n $companyModel = new Model_Jiafuyun_Company();\n $rs = $regulatorToCompanyModel->getAll ( '*', $filter, $page, $page_size, $orderby );\n foreach ( $rs as $key => $value){\n $rs[$key]['create_time'] = strtotime($value['create_time']) == 0 ? '-': $value['create_time'];\n $rs[$key]['last_modify'] = strtotime($value['last_modify']) == 0 ? '-': $value['last_modify'];\n $companyInfo = $companyModel->get($value['company_id']);\n $rs[$key]['company_info'] = $companyInfo;\n }\n return $rs;\n }", "public function index()\n {\n $companies = Company::latest()->paginate(5);\n return view('company.index', compact('companies'));\n }", "public function findLatest(): array\n {\n\n return $this->createQueryBuilder('p')\n ->orderBy('p.created_at', 'DESC')\n ->setMaxResults(8)\n ->getQuery()\n ->getResult();\n }", "public function getLatestQuotationData($companyId)\n\t{\t\n\t\t//database selection\n\t\t$database = \"\";\n\t\t$constantDatabase = new ConstantClass();\n\t\t$databaseName = $constantDatabase->constantDatabase();\n\t\t\n\t\tDB::beginTransaction();\t\n\t\t$raw = DB::connection($databaseName)->select(\"SELECT \n\t\tquotation_id,\n\t\tquotation_label,\n\t\tquotation_type,\n\t\tstart_at,\n\t\tend_at,\n\t\tcreated_at,\n\t\tupdated_at,\n\t\tcompany_id\t\t\n\t\tFROM quotation_dtl \n\t\twhere company_id='\".$companyId.\"' and \n\t\tdeleted_at='0000-00-00 00:00:00' \n\t\tgroup by quotation_id desc limit 1\");\n\t\tDB::commit();\n\t\t\n\t\t//get exception message\n\t\t$exception = new ExceptionMessage();\n\t\t$exceptionArray = $exception->messageArrays();\n\t\tif(count($raw)==0)\n\t\t{\n\t\t\treturn $exceptionArray['204'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$enocodedData = json_encode($raw);\n\t\t\treturn $enocodedData;\n\t\t}\n\t}", "private function value_company($data){\n $dataArray = array();\n $dataArray['id'] = $this->value_source_uid($data);\n $dataArray['name'] = $this->get_name($data);\n $dataArray['angellist_url'] = $this->get_angellist_url($data);\n $dataArray['logo_url'] = $this->get_logo_url($data);\n $dataArray['thumb_url'] = $this->get_thumb_url($data);\n $dataArray['launch_date'] = $this->get_launch_date($data);\n $dataArray['quality'] = $this->get_quality($data);\n $dataArray['product_desc'] = $this->get_product_desc($data);\n $dataArray['high_concept'] = $this->get_high_concept($data);\n $dataArray['follower_count'] = $this->get_follower_count($data);\n $dataArray['company_url'] = $this->get_company_url($data);\n $dataArray['created_at'] = $this->get_created_at($data);\n $dataArray['updated_at'] = $this->get_updated_at($data);\n $dataArray['twitter_url'] = $this->get_twitter_url($data);\n $dataArray['blog_url'] = $this->get_blog_url($data);\n $dataArray['video_url'] = $this->get_video_url($data);\n $dataArray['crunchbase_url'] = $this->get_crunchbase_url($data);\n $dataArray['status'] = $this->get_status($data);\n \n \n return $dataArray;\n }", "public function get_recent($limit = 3){\n\t\t$limit = (int) $limit;\n\t\t//$this->set_published();\n\t\t$this->db->limit($limit);\n\t\treturn parent::get();\n\t}", "public static function recent($max=10) \n {\n $sql = <<<END_SQL\n select users.user_id, users.first_name, users.last_name, posts.created, posts.text\n from posts\n inner join users on posts.user_id = users.user_id\n order by posts.created desc\n limit $max\nEND_SQL;\n $posts = DB::instance(DB_NAME)->select_rows($sql, \"object\");\n return $posts;\n }", "function get_recent_collections($num = 10)\n{\n return get_records('Collection', array('sort_field' => 'added', 'sort_dir' => 'd'), $num);\n}", "public function getAll()\n {\n if (Auth::user()->id_role == 1) \n {\n $company_id = GetSession::getCompanyId();\n }elseif(Auth::user()->id_role == 2)\n {\n $company_id = Auth::user()->id_company;\n }\n \n return Product::where('id_company', $company_id)->orderBy('created_at','desc')->get();\n }", "public function getAllCompanyAccounts()\n { \n // select all fields and columns form the 'companies' table and return is as an array of objects\n $companies = Company::all();\n\n // if the length of array of company objects is greater than 0 (contains elements)\n if (count($companies) > 0) {\n // loop through each company, get the token from the 'company_activation_codes' table and update the object\n foreach ($companies as $key => $value) {\n $token = CompanyActivationCode::where('company_id', $value['id'])->first()->activation_code;\n $value['token'] = $token;\n $companies[$key] = $value;\n }\n }\n \n // send a response to the requester of the data\n $response_message = array('success' => true, 'message' => 'Data fetched', 'data' => $companies);\n return response()->json($response_message);\n }", "public function retrieve_company() {\n $this->db->select('*');\n $this->db->from('company_information');\n $this->db->limit('1');\n $query = $this->db->get();\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return false;\n }", "public function retrieve_company() {\n $this->db->select('*');\n $this->db->from('company_information');\n $this->db->limit('1');\n $query = $this->db->get();\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return false;\n }", "public function getTwentyFirstClients() {\n // On récupère tout le contenu de la table clients\n $queryResult = $this->database->query('SELECT * FROM clients LIMIT 20'); \n $twentyFirstClientsData = $queryResult->fetchAll(PDO::FETCH_OBJ);\n return $twentyFirstClientsData;\n }", "public function getRecentRecord($count)\n\t{\n\t\treturn $this->model->orderBy('created_at', 'DESC')\n\t\t ->take($count)\n\t\t ->get();\n\t}", "function select_all_company() {\n\t\t$qury=\"SELECT * FROM company\";\n\t\t$requet=mysqli_query($link,$qury);\n\t\t\n\t\twhile($res=mysqli_fetch_assoc($requet)) {\n\t\t\t$data[]=$res;\n\t\t}\n\t\treturn $data;\n\t}", "public static function birthdaysThisWeek(Company $company): array\n {\n $employees = $company->employees()\n ->where('locked', false)\n ->whereNotNull('birthdate')\n ->get();\n\n $now = Carbon::now();\n $minDate = $now->copy()->startOfWeek(Carbon::MONDAY);\n $maxDate = $now->copy()->endOfWeek(Carbon::SUNDAY);\n\n $birthdaysCollection = collect([]);\n foreach ($employees as $employee) {\n $birthdateWithCurrentYear = $employee->birthdate->copy()->year($now->year);\n\n if (BirthdayHelper::isBirthdayInRange($birthdateWithCurrentYear, $minDate, $maxDate)) {\n $birthdaysCollection->push([\n 'id' => $employee->id,\n 'name' => $employee->name,\n 'avatar' => ImageHelper::getAvatar($employee, 35),\n 'birthdate' => DateHelper::formatMonthAndDay($birthdateWithCurrentYear),\n 'sort_key' => Carbon::createFromDate($now->year, $birthdateWithCurrentYear->month, $birthdateWithCurrentYear->day)->format('Y-m-d'),\n 'url' => route('employees.show', [\n 'company' => $company,\n 'employee' => $employee->id,\n ]),\n ]);\n }\n }\n\n // sort the entries by soonest birthdates\n // we need to use values()->all() so it resets the keys properly.\n $birthdaysCollection = $birthdaysCollection->sortBy('sort_key')->values()->all();\n\n return $birthdaysCollection;\n }", "public function last(): array\n {\n return $this->single('date DESC');\n }", "public function getByMostRecent()\n\t{\n\t\t$sql = \"SELECT * FROM \".TABLE_PREFIX.\"courses \n\t\t WHERE access='public'\n\t\t ORDER BY modified_date DESC, created_date DESC\";\n\t\treturn $this->execute($sql);\n\t}", "public function getMostRecentAll()\n {\n return $this->selectRecentAll();\n }", "public function findLatest() : array\n {\n return $this\n ->findNotSoldQuery()\n ->setMaxResults(4)\n ->getQuery()\n ->getResult();\n }", "public function getRecentInvoices(int $limit = 5): array\n {\n $qb = $this->createQueryBuilder('i');\n\n $qb\n ->innerJoin('i.client', 'c')\n ->orderBy('i.created', Criteria::DESC)\n ->setMaxResults($limit);\n\n return $qb->getQuery()->getResult();\n }", "public function getLastEvents(){\n\t\t$sql = \"SELECT\n\t\t\t\t\tevents.id as id,\n\t\t\t\t\tevents.date_begin as date_begin,\n\t\t\t\t\tevents.date_end as date_end,\n events.time_begin as time_begin,\n\t\t\t\t\tevents.time_end as time_end,\n\t\t\t\t\tevents.name as title,\n\t\t\t\t\tevent_types.color as type_color,\n\t\t\t\t\tevent_types.name as type_name\n\t\t\t\tFROM ag_events as events\n\t\t\t\tINNER JOIN ag_eventtypes as event_types ON event_types.id = events.id_type\n\t\t\t\torder by date_end DESC LIMIT 3;\";\n\t\t$user = $this->runRequest($sql);\n\t\treturn $user->fetchAll();\n\t}", "function get_recent_tags($limit = 10)\n{\n return get_records('Tag', array('sort_field' => 'time', 'sort_dir' => 'd'), $limit);\n}", "public static function current() {\n\t\treturn CompYear::orderBy('year', 'desc')->first();\n\t}", "public static function Get_four_Notify()\n{\n $notfit= NotificationBackent::where('seen',0)->orderBy('created_at','desc')->take(7)->get();\n return $notfit;\n}", "public function get_last_ten_entries()\r\n\t{\r\n\t\t$query = $this->db->get(\"email_workflow\", 10);\r\n\r\n\t\treturn $query->result();\r\n\t}", "public function index()\n {\n\n $company = Company::latest()->paginate(5);\n return view('company.index', ['company'=>$company]);\n\n\n }", "function get_companies_list() {\n return get_view_data('org_list');\n}", "public function company()\n {\n return $this->business();\n }", "public function getHighestYear() {\n\t\t$query = $this->createQuery();\n\t\t$query->getQuerySettings()->setRespectStoragePage(FALSE);\n\t\t$query->statement(\"SELECT MAX(year) as year FROM `tx_wxlottery_domain_model_partnerlog`\");\n\t\treturn $query->execute()->getFirst()->getYear();\n }", "function find_last_entries(){\n\t$server = \"localhost\";\n\t$username = \"root\";\n\t$password = \"\";\n\t$database = \"01_php_blog_project\";\n\n\n\t$db = mysqli_connect($server, $username, $password, $database);\n\n\t$sql = \"SELECT e. *, c.name_cat FROM entries e INNER JOIN categories c ON e.ID_cat = c.ID_cat ORDER BY e.ID_ent DESC LIMIT 4\";\n\n\t$entries = mysqli_query($db, $sql);\n\n\t$result = array();\n\n\tif ($entries && mysqli_num_rows($entries) >= 1){\n\t\t$result = $entries;\n\t}\n\n\treturn $result;\n}", "public function index()\n {\n return view('company.index',[\n 'companies' => Company::orderBy('created_at', 'desc')->paginate(10)\n ]);\n }", "public function getCompany() : \\App\\Domain\\Model\\Company\n {\n return $this->getRef('from__company_id__to__table__companies__columns__id', 'products');\n }", "public function companies() {\n return $this->belongsToMany(Company::class, 'company_user', 'user_id', 'company_id');\n }" ]
[ "0.65214723", "0.6336903", "0.5817458", "0.56683236", "0.5655572", "0.56279004", "0.55829984", "0.55439615", "0.55360633", "0.54879475", "0.54395276", "0.54077363", "0.54054815", "0.5404265", "0.53994584", "0.5391355", "0.53852004", "0.5341393", "0.5310871", "0.53099066", "0.52653265", "0.5258825", "0.52446324", "0.52317053", "0.5224825", "0.5218429", "0.5212994", "0.52114266", "0.520484", "0.5193779", "0.51878333", "0.5186926", "0.5179013", "0.51633614", "0.51598006", "0.5148513", "0.5145695", "0.51045364", "0.50931966", "0.5091065", "0.50776994", "0.5060998", "0.504651", "0.5041004", "0.5038387", "0.50376785", "0.5014992", "0.5007419", "0.50009066", "0.4997011", "0.49924195", "0.4990988", "0.49706367", "0.49658114", "0.49500284", "0.49413702", "0.49413702", "0.49399263", "0.4935954", "0.49333632", "0.49292612", "0.4923415", "0.49229187", "0.48911202", "0.48876628", "0.4887632", "0.48875034", "0.4887036", "0.48855737", "0.48783904", "0.48569077", "0.48548654", "0.48529238", "0.48504978", "0.48483062", "0.48468497", "0.48453456", "0.48453456", "0.4845049", "0.48360616", "0.48355186", "0.48353902", "0.4833592", "0.48320588", "0.48263115", "0.48246023", "0.48190776", "0.48187864", "0.4817992", "0.48152566", "0.48145726", "0.481294", "0.48113966", "0.4803733", "0.48028105", "0.48008606", "0.4800857", "0.4800254", "0.47969607", "0.47968185" ]
0.6167649
2
Get the featured companies on the VTC page.
public function getFeatured(): CompanyCollection { return $this->featured; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFeaturedCovered(): CompanyCollection\n {\n return $this->featuredCovered;\n }", "public function getfeaturedCities(){\n\t\t $featuredTestimonial = array();\n\t\t $tData = $this->find('all',array('conditions'=>array('CmsCity.is_display'=>1),\n\t\t\t\t\t\t\t\t\t\t\t'fields'=>array('CmsCity.*'),\n\t\t\t\t\t\t\t\t));\n\t\t if(isset($tData) && !empty($tData)){\n\t\t\t\tforeach($tData as $key=>$testiData){\n\t\t\t\t\tif(isset($testiData['CmsCity']['image']))\n\t\t\t\t\t\t$testiData['CmsCity']['image'] = (!empty($testiData['CmsCity']['image'])) ? Router::url('/'.CMS_IMAGE_URL.$testiData['CmsCity']['image'],true) : \"\";\n\t\t\t\t\t$featuredTestimonial[] = $testiData;\n\t\t\t\t}\t\n\t\t\t}\n\t\treturn $featuredTestimonial;\t\n\t}", "public function featured()\n {\n if($this->isFeatured())\n {\n $featuredObj = FeaturedCompany::where('company_id', $this->id)->first();\n return $featuredObj;\n }\n return false;\n }", "public function index()\n {\n return new FeaturedCollection(FeaturedResource::collection((Product::where('featured', '=', 1)->take(15)->get())));\n }", "public function companies()\n {\n return $this->morphedByMany('App\\Company', 'taggable');\n }", "public function getAllFeaturedProducts()\n {\n $products = Product::/* where('category_id', $id)-> */where('is_featured', 1)->get();\n\n return view('frontend.pages.featuredproduct', compact('products'));\n }", "public function companies(): Collection\n {\n return Company::all();\n }", "public function get_featured_cca_list() \n {\n $this->db->from('cca');\n $this->db->where('featured','1');\n $query = $this->db->get();\n return $query->result();\n }", "public function get_featured_products()\n\t{\n\t\t$this->db->select('product.*, category.category_name, brand.brand_name')->from('product, category, brand')->where(\"product.product_status = 1 AND product.category_id = category.category_id AND product.brand_id = brand.brand_id AND product.featured = 1 AND product.product_balance > 0\")->order_by(\"created\", 'DESC');\n\t\t$query = $this->db->get('',8);\n\t\t\n\t\treturn $query;\n\t}", "public function getFeaturedProducts(): Collection\n\t{\n\t\treturn $this->db->filter(fn (Product $product) => $product->isFeatured);\n\t}", "public function getFeaturedbrand(){\n\t\t \n\t\t $collections = Mage::getModel('brand/brand')->getCollection()\n\t\t\t\t\t\t->addFieldToFilter('is_feature',1);\n\t\t\t\t\n\t\treturn $collections;\n\t }", "function get_service_list() {\n\t\tglobal $wpdb;\n\t\t\n\t\t$services = $wpdb->get_results( \n\t\t\t\"\n\t\t\tSELECT ID, Title\n\t\t\tFROM cp_Categories\n\t\t\tWHERE 1\n\t\t\t\",\n\t\t\tARRAY_A\n\t\t);\n\t\t\n\t\treturn $services;\n\t}", "public function featured($marketplace_name = 'themeforest')\n {\n $url = preg_replace('/set/i', 'features:' . $marketplace_name, $this->public_url);\n return $this->curl($url)->features;\n }", "public function getFeaturedProductCollection()\n {\n return $this->_getProductCollection();\n }", "function get_companies_list() {\n return get_view_data('org_list');\n}", "public function getCompany();", "function ve_get_company_navigation() {\n\n\t/**\n\t * Arguments for get posts:\n\t */\n\t\n\t$args = array(\n\t\t'orderby'\t\t\t=>\t'title',\n\t\t'order'\t\t\t\t=>\t'ASC',\n\t\t'post_type'\t\t\t=>\t'companies',\n\t\t'post_status'\t\t=>\t'publish',\n\t\t'posts_per_page'\t=>\t-1\n\t\t);\n\t$companies = get_posts( $args );\n\n\tforeach ( $companies as $company ) {\n\t\t$company_url = get_permalink($company->ID);\n\t\t$company_title = $company->post_title;\n\t\t?>\n\t\t<li>\n\t\t\t<a class=\"turquoise-hover\" href=\"<?php echo $company_url; ?>\"><?php echo $company_title ?></a>\n\t\t</li>\n\t<?php\n\t}\n}", "public function getFreeCompanies() { return $this->FreeCompanies; }", "public function getProductors ()\n {\n if (empty($this->production)) {\n $this->getCompanyCredits();\n }\n\n return $this->production;\n }", "public function getAvailableCompanies()\n {\n return $this->createQuery('c')\n ->select('c.*')\n ->addSelect(\n \"(SELECT ROUND(AVG(r.rating), 2)\n FROM Companies_Model_Review r\n WHERE r.status = '\" . Companies_Model_Review::STATUS_PUBLISHED . \"'\n AND r.company_id = c.id) as rating\"\n )\n ->addSelect(\"(SELECT COUNT(rc.id)\n FROM Companies_Model_Review rc\n WHERE rc.status = '\" . Companies_Model_Review::STATUS_PUBLISHED . \"'\n AND rc.company_id = c.id) as review_count\")\n ->whereIn('c.status', Companies_Model_Company::getActiveStatuses())\n ->orderBy('rating DESC')\n ->execute();\n }", "public function indexCompany()\n {\n return TimelineResource::collection(\n $this->user->company->timeline()\n ->with(['pictures', 'videos', 'geo', 'links'])\n ->paginate(request()->get('per_page') ?? 15)->appends(request()->all())\n );\n }", "public function isFeatured()\n {\n $isFeatured = FeaturedCompany::where([\n ['company_id', '=', $this->id],\n ['end_date', '>=', \\Carbon\\Carbon::now()],\n ])->get();\n if(!$isFeatured->isEmpty())\n {\n return true;\n };\n return false;\n }", "function Companies(){\n\t\t\t\treturn $this->companies;\n\t\t\t}", "public function index()\n {\n return Company::all();\n }", "public function index()\n {\n return Company::all();\n }", "public function allCompanies()\n {\n return Company::all();\n }", "public function allCompanies()\n {\n\n $companies = $this->core_companies;\n\n $items = [];\n foreach ($companies as $company) {\n\n $companyItem = new CompanyCardItem();\n $companyItem->id = $company->id;\n $companyItem->name = $company->name;\n //$companyItem->amount = $catalog->amount;\n $companyItem->title = $company->title;\n if (\\Dash\\count($company->photo))\n $companyItem->image = '/uploaz/eyuf/UserCompany/photo/' . $company->id . '/' . $company->photo[0];\n $companyItem->url = ZUrl::to([\n 'customer/markets/show',\n 'id' => $company->id\n ]);\n $companyItem->distence = \"12km\";\n //$companyItem->image = $catalog->price;\n //$companyItem->price = $catalog->price_old;\n //$companyItem->currency = \"$\";\n //$companyItem->cart_amount = 0;\n\n $items[] = $companyItem;\n }\n return $items;\n }", "function get_featured_travelinfo() {\n $sql = \"SELECT * FROM news WHERE parentid='' AND featured='1' ORDER BY id DESC LIMIT 7\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "public function getRecent(): CompanyCollection\n {\n return $this->recent;\n }", "public function getCompany() {}", "public function featured() {\n\n $this->checkPlugin();\n\n if ( $_SERVER['REQUEST_METHOD'] === 'GET' ){\n //get featured products\n $limit = 0;\n\n if (isset($this->request->get['limit']) && ctype_digit($this->request->get['limit']) && $this->request->get['limit'] > 0) {\n $limit = $this->request->get['limit'];\n }\n\n $this->getFeaturedProducts($limit);\n }\n }", "public function index()\n {\n return Company::paginate(10);\n }", "function getFeaturedCourses(){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT id, name, author, image FROM Course ORDER BY popularity LIMIT 3\";\n\n\t\t$result = $conn->query($query);\n\n\t\treturn fetch_all($result);\n\t}", "public function index()\n {\n $company = $this->repository->all();\n return $company;\n }", "private function get_featured_films() {\r\n $home_page_id = get_option('page_on_front');\r\n $featured = get_field('film_carousel', $home_page_id);\r\n\r\n return $featured;\r\n }", "public function showcases()\n {\n return $this->morphedByMany(Portfolio::class, 'taggable', 'taxonomy_relationships')->withTimestamps();\n }", "public function getActivatedVendors();", "function ccdev_hosting_list_entities() {\n module_load_include('inc','ccHosting','includes/entity_load');\n module_load_include('inc','ccHosting','includes/lib');\n global $user;\n\n ctools_include('modal');\n ctools_modal_add_js();\n\n $content = array();\n $rows = array();\n\n $header = array(\n 'site_name' => array(\n 'data' => t('Site Name'),\n 'type' => 'property',\n 'specifier' => 'site_name',\n 'field' => 'site_name'\n ),\n 'site_description' => array(\n 'data' => t('Description'),\n 'type' => 'property',\n 'specifier' => 'total_balance',\n 'field' => 'total_balance'\n ),\n 'site_domain' => array(\n 'data' => t('Domain'),\n 'type' => 'property',\n 'specifier' => 'site_domain',\n 'field' => 'site_domain'\n ),\n 'site_cms' => array(\n 'data' => t('CMS'),\n 'type' => 'property',\n 'specifier' => 'site_cms',\n 'field' => 'site_cms'\n ),\n );\n\n\n $entities = ccdev_hosting_load_multiple(FALSE, array(), FALSE, $header);\n if (!empty($entities)) {\n foreach ($entities as $entity) {\n\tif($user->uid == $entity->user_id || user_access('administer ccdev_hosting entities')) {\n\t // Create tabular rows for our entities.\n\t $rows[] = array(\n\t\t'data' => array(\n\t\t'site_name' => l($entity->site_name, 'ccMods/ccHosting/basic/' . $entity->site_name),\n\t\t'site_description' => $entity->site_description,\n\t\t'site_domain' => $entity->site_domain,\n\t\t'site_cms' => $entity->site_cms,\n\t\t'manage' => _ccHosting_make_link(array('site_id' => $entity->basic_id,'title' => 'Manage')),\n\t\t),\n\t );\n\t}\n }\n\n // Put our entities into a themed table. See theme_table() for details.\n $content['entity_table'] = array(\n '#theme' => 'table',\n '#rows' => $rows,\n '#header' => $header,\n '#attributes' => array(\n 'id' => 'sort-table')\n );\n\n //Add pagination to table\n $content['pager'] = array(\n '#theme' => 'pager');\n\n }\n else {\n // There were no entities. Tell the user.\n $content[] = array(\n '#type' => 'item',\n '#markup' => t('No ccdev_hosting entities currently exist.'),\n );\n }\n return $content;\n}", "public function getCompanyWithUsers();", "public function get_engines() {\n return $this->get_items_by_type(static::$ENGINES);\n }", "public function companylist() {\r\n $companies = $this->model->getCompanies();\r\n return $this->view('company/companylist', $companies);\r\n }", "function findFeaturedProducts($count) {\n $sql = \"select * from product where is_featured=1 order by entered_date limit $count\";\n $command = $this->db->prepare($sql);\n $command->execute();\n $result = $command->fetchAll();\n $command->closeCursor();\n return $result;\n }", "function GetCompanies()\n{\n\t$CompArr=array();\n\t$Query = \"SELECT * FROM \".PFX.\"_tracker_client ORDER BY NAME ASC\";\n\t$Sql = new Query($Query);\n\twhile ($Row=$Sql->Row()) {\n\t\t$CompArr[$Sql->Position]['Name']=htmlspecialchars(stripslashes($Row->NAME));\n\t\t$CompArr[$Sql->Position]['Value']=$Row->ID;\n\t}\n\treturn $CompArr;\n}", "function otm_show_featured_posts() {\n\n\t$my_query = new WP_Query( array( \n\t\t'meta_key' \t\t\t\t=> 'is_featured',\n\t\t'post_type'\t\t\t\t=> 'post',\n\t\t'meta_value'\t\t\t=> true,\n\t\t'numberposts' \t\t=> 3\n\t) );\n\n\t// If our query has posts\n\tif ( $my_query->have_posts() ) :\n\t\twhile ( $my_query->have_posts() ) : $my_query->the_post();\n\n\t\t\t// Get specific template-part\n\t\t\tget_template_part( 'template-parts/post/content-featured' );\n\n\t\tendwhile;\n\tendif;\n\n\twp_reset_query();\n}", "function get_featured_slider() {\n $sql = \"SELECT * FROM slider WHERE publish='1'\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "public function get_featured_sites() {\n $this->db->select(\"site.site_ref, site.remarks\");\n $this->db->join(\"site\", \"site.site_ref = featured.site_ref\");\n $res = $this->db->get(\"featured\");\n if ($res) {\n return $res->result_array();\n }\n return false;\n }", "public function companies()\n {\n return $this->belongsToMany('Villato\\Company', 'company_region_product', 'product_id', 'company_id');\n }", "private function _getCompanySelector()\n {\n $sSearch = getValue('q');\n if(empty($sSearch))\n return json_encode(array());\n\n $oDB = CDependency::getComponentByName('database');\n\n $sQuery = 'SELECT * FROM company WHERE status = 1 AND lower(company_name) LIKE '.$oDB->dbEscapeString('%'.strtolower($sSearch).'%').' ORDER BY company_name desc';\n $oDbResult = $oDB->ExecuteQuery($sQuery);\n $bRead = $oDbResult->readFirst();\n if(!$bRead)\n return json_encode(array());\n\n $asJsonData = array();\n while($bRead)\n {\n $asData['name'] = $oDbResult->getFieldValue('company_name');\n $asJsonData[] = json_encode($asData);\n $bRead = $oDbResult->readNext();\n }\n echo '['.implode(',', $asJsonData).']';\n }", "public function getFeatured($limit = 8)\n {\n return $this->articlesRepo->byFeatured($limit);\n }", "function acf_get_sites()\n{\n}", "function get_company_feature_listing($feature_id) {\n\t\t $str = \"SELECT feature_name FROM feature_listing WHERE feature_id = $feature_id\"; \n\t\t$fea = mysqli_query($link,$str);\n\t\t$res = mysqli_fetch_assoc($fea);\n\t\treturn $res;\n\t}", "public function getConstructionSiteEquipments()\n {\n return self::getCollection('/construction_site_equipments');\n }", "function otm_get_featured_posts() {\n\n\t$my_query = new WP_Query( array( \n\t\t'meta_key' \t\t\t\t=> 'is_featured',\n\t\t'post_type'\t\t\t\t=> 'post',\n\t\t'meta_value'\t\t\t=> true,\n\t\t'numberposts' \t\t=> 3\n\t) );\n\n\t// If our query has posts\n\tif ( $my_query->have_posts() ) :\n\t\treturn true;\n\t\twp_reset_query();\n\telse :\n\t\twp_reset_query();\n\t\treturn;\n\tendif;\n}", "public function hasBeenFeatured()\n {\n $isFeatured = FeaturedCompany::where([\n ['company_id', '=', $this->id],\n ['end_date', '<', \\Carbon\\Carbon::now()],\n ])->get();\n if(!$isFeatured->isEmpty())\n {\n return true;\n };\n return false;\n }", "function get_companies_linked_to_group_of_company() {\n\tglobal $post;\n\t/**\n\t * Check if there are companies linked to the post:\n\t */\n\tif (get_post_meta($post->ID, 'company_checkbox_meta', true)) {\n\t\t/**\n\t\t * Arguments for get posts:\n\t\t */\n\t\t$args = array(\n\t\t\t'orderby'\t\t =>\t'title',\n\t\t\t'order'\t\t\t =>\t'ASC',\n\t\t\t'post_type' => 'companies',\n\t\t\t'post_status' => 'publish',\n\t\t\t'posts_per_page' => -1\n\t\t);\n\t\t$companies = get_posts($args);\n\t\t$linked_companies_ids = get_post_meta($post->ID, 'company_checkbox_meta', true);\n\t\t?>\n\t\t<div class=\"company-isotope\">\n\t\t\t<?php\n\t\t\t/**\n\t\t\t * Go through all the posts:\n\t\t\t */\n\t\t\tforeach ($companies as $company) {\n\t\t\t\t/**\n\t\t\t\t * Go through all the linked id's\n\t\t\t\t */\n\t\t\t\tforeach ($linked_companies_ids as $linked_company_id) {\n\t\t\t\t\t/**\n\t\t\t\t\t * if linked company id == company id, then generate company card.\n\t\t\t\t\t */\n\t\t\t\t\tif ($linked_company_id == $company->ID) {\n\t\t\t\t\t\t$company_url = get_permalink($company->ID);\n\t\t\t\t\t\t$company_title = $company->post_title;\n\t\t\t\t\t\t$company_logo_url = get_field('company_logo', $company->ID);\n\t\t\t\t\t\t$company_title_length = strlen($company_title);\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<a href=\"<?php echo $company_url ?>\" class=\"company-box col-xs-12 col-sm-6 col-md-4\">\n\t\t\t\t\t\t\t<div class=\"item-card\">\n\t\t\t\t\t\t\t\t<div class=\"item-card-thumbnail\">\n\t\t\t\t\t\t\t\t\t<img src=\"<?php echo $company_logo_url; ?>\" class=\"item-card-image\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"item-card-title white-bg\">\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ($company_title_length <= 32) {\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<span class=\"item-title black-text\"><?php echo $company_title; ?></span>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<span class=\"item-title black-text\" style=\"font-size:16px!important\"><?php echo $company_title; ?></span>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// do nothing.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}\n\t/**\n\t * If there are no linked companies\n\t */\n\telse {\n\t\t// do nothing.\n\t}\n}", "public function company()\n {\n return $this->business();\n }", "function get_contacts_by_company($id) {\n return get_view_data_where('org_contact_list', $id);\n}", "public function index ()\n {\n $company = Company::orderBy('created_at', 'desc')->paginate(5);\n return CompanyResource::collection($company);\n }", "public function getFeaturesList(){\n return $this->_get(1);\n }", "function select_all_company() {\n\t\t$qury=\"SELECT * FROM company\";\n\t\t$requet=mysqli_query($link,$qury);\n\t\t\n\t\twhile($res=mysqli_fetch_assoc($requet)) {\n\t\t\t$data[]=$res;\n\t\t}\n\t\treturn $data;\n\t}", "public function updateFeatured()\n {\n $s = App::make('Lib\\Services\\Scraping\\Scraper');\n $s->featured();\n\n $fet = $this->where('featured', 1)->limit(8)->orderBy('created_at', 'asc')->get();\n\n return $fet;\n }", "function ve_get_group_of_companies_navigation() {\n\n\t/**\n\t * Arguments for get posts:\n\t */\n\t\n\t$args = array(\n\t\t'orderby'\t\t\t=>\t'title',\n\t\t'order'\t\t\t\t=>\t'ASC',\n\t\t'post_type'\t\t\t=>\t'group_of_companies',\n\t\t'post_status'\t\t=>\t'publish',\n\t\t'posts_per_page'\t=>\t-1\n\t\t);\n\t$companies = get_posts( $args );\n\n\tforeach ( $companies as $company ) {\n\t\t$company_url = get_permalink($company->ID);\n\t\t$company_title = $company->post_title;\n\t\t?>\n\t\t<li>\n\t\t\t<a class=\"purple-hover\" href=\"<?php echo $company_url; ?>\"><?php echo $company_title ?></a>\n\t\t</li>\n\t<?php\n\t}\n}", "function delivery_featured_content() {\n\tglobal $post;\n\n\t// Return if on singular page.\n\tif ( is_singular() ) {\n\t\treturn;\n\t}\n\t\n\t// Get the user selected tag for the featured posts.\n\t$tag = get_theme_mod( 'delivery_featured_posts', 'featured' );\n\t$num = get_theme_mod( 'delivery_featured_posts_num', 4 );\n\n\t// Check if the tag is not empty.\n\tif ( empty( $tag ) ) {\n\t\treturn;\n\t}\n\n\t// Get any existing copy of our transient data.\n\tif ( false === ( $featured = get_transient( 'delivery_featured_posts' ) ) ) {\n\t\t// It wasn't there, so regenerate the data and save the transient.\n\t\t\n\t\t// Posts query arguments.\n\t\t$args = array(\n\t\t\t'post_type' => 'post',\n\t\t\t'posts_per_page' => absint( $num ),\n\t\t\t'tag' => $tag\n\t\t);\n\n\t\t// The post query\n\t\t$featured = new WP_Query( $args );\n\n\t\t// Store the transient.\n\t\tset_transient( 'delivery_featured_posts', $featured );\n\t}\n\n\t// Check if the post(s) exist.\n\tif ( $featured->have_posts() ) :\n\n\t\t$html = '<div class=\"featured-slider\">';\n\n\t\t\t$html .= '<div id=\"slider\" class=\"flexslider\">';\n\t\t\t\t$html .= '<ul class=\"slides\">';\n\t\t\t\twhile ( $featured->have_posts() ) : $featured->the_post();\n\n\t\t\t\t\t$html .= '<li>';\n\t\t\t\t\t\tif ( has_post_thumbnail( $post->ID ) ) {\n\t\t\t\t\t\t\t$html .= '<a href=\"' . esc_url( get_permalink( $post->ID ) ) . '\" rel=\"bookmark\">' . get_the_post_thumbnail( $post->ID, 'delivery-featured', array( 'alt' => esc_attr( get_the_title( $post->ID ) ) ) ) . '</a>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$html .= '<header class=\"entry-header\">';\n\t\t\t\t\t\t\t$html .= '<h1 class=\"entry-title\"><a href=\"' . esc_url( get_permalink( $post->ID ) ) . '\" rel=\"bookmark\">' . esc_attr( get_the_title( $post->ID ) ) . '</a></h1>';\n\t\t\t\t\t\t\t$html .= '<div class=\"entry-meta\">' . delivery_get_posted_on() . '</div>';\n\t\t\t\t\t\t$html .= '</header>';\n\t\t\t\t\t\t$html .= '<div class=\"entry-summary\">' . get_the_excerpt() . '</div>';\n\t\t\t\t\t$html .= '</li>';\n\n\t\t\t\tendwhile;\n\n\t\t\t\t// Restore original post data.\n\t\t\t\twp_reset_postdata();\n\n\t\t\t\t$html .= '</ul>';\n\t\t\t$html .= '</div>';\n\n\t\t\t$html .= '<div id=\"carousel\" class=\"flexslider\">';\n\t\t\t\t$html .= '<ul class=\"slides\">';\n\t\t\t\twhile ( $featured->have_posts() ) : $featured->the_post();\n\n\t\t\t\t\t$html .= '<li>';\n\t\t\t\t\t\t$html .= '<div>';\n\t\t\t\t\t\tif ( has_post_thumbnail( $post->ID ) ) {\n\t\t\t\t\t\t\t$html .= get_the_post_thumbnail( $post->ID, 'delivery-thumb', array( 'alt' => esc_attr( get_the_title( $post->ID ) ) ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$html .= '<p>' . esc_attr( get_the_title( $post->ID ) ) . '</p>';\n\t\t\t\t\t\t$html .= '</div>';\n\t\t\t\t\t$html .= '</li>';\n\n\t\t\t\tendwhile;\n\n\t\t\t\t// Restore original post data.\n\t\t\t\twp_reset_postdata();\n\n\t\t\t\t$html .= '</ul>';\n\t\t\t$html .= '</div>';\n\n\t\t$html .= '</div><!-- .featured-slider -->';\n\n\t// End check.\n\tendif;\n\n\t// Display the featured content.\n\tif ( ! empty( $html ) ) {\n\t\techo $html;\n\t}\n\n}", "public function companySuppliers($company_id)\n {\n $company = Company::find($company_id);\n\n return Inertia::render('Provider/Index',[\n 'providers' => $company->getProviders($company),\n ]);\n \n }", "function get_company_detail($id) {\n return get_view_data_where('org_detail', $id);\n}", "public function sitemapCompanies(){\n $links = array();\n $models = ORM::factory('CatalogCompany')->where('enable','=','1')->find_all();\n foreach($models as $model)\n $links[] = $model->getUri();\n return $links;\n }", "private function getCompanyCredits ()\n {\n $content = Utils::getContent($this->_strUrl . \"companycredits\");\n\n // get the uls order\n $order = [];\n foreach ($content->find(\"#company_credits_content h4\") as $title) {\n $order[] = $title->attr(\"id\");\n }\n\n $ulList = $content->find(\"#company_credits_content ul\");\n\n // get the uls order\n foreach ($order as $pos => $type)\n {\n foreach ($ulList[$pos]->find(\"li\") as $company)\n {\n $a = $company->find(\"a\")[0];\n\n preg_match(\"/\\/company\\/co([0-9]+)\\?/\", $a->attr(\"href\"), $matches);\n\n if (isset($matches[1]) && !empty($matches[1]))\n {\n $basicData = [\n \"id\" => $matches[1],\n \"name\" => $a->text(),\n ];\n\n if ($type == \"distributors\")\n {\n // Hispano Foxfilms S.A.E. (2009) (Spain) (theatrical) => (2009) (Spain) (theatrical)\n $remainingText = str_replace($basicData[\"name\"], \"\", $company->text());\n\n preg_match(\"/\\(([0-9]{4})-?\\) \\(([A-Za-z0-9_.]+)\\) \\((?:theatrical|TV)\\)/\", $remainingText, $matches);\n\n if (!empty($matches)) {\n $basicData[\"year\"] = (int)$matches[1];\n $basicData[\"country\"] = $matches[2];\n $this->{$type}[] = $basicData;\n }\n } else {\n $this->{$type}[] = $basicData;\n }\n }\n }\n }\n }", "public function companies()\n {\n return $this->belongsToMany(Company::class);\n }", "function index() {\n if($this->request->isApiCall()) {\n $this->serveData(Companies::findByIds($this->logged_user->visibleCompanyIds()), 'companies');\n } else {\n $page = (integer) $this->request->get('page');\n if($page < 1) {\n $page = 1;\n } // if\n \n list($companies, $pagination) = Companies::paginateActive($this->logged_user, $page, 30);\n \n $this->smarty->assign(array(\n 'companies' => $companies,\n 'pagination' => $pagination,\n ));\n } // if\n }", "public function index()\n {\n $company = Auth::user()->company;\n $services = CorpFinService::where('company_id', $company->id)->paginate(10);//$company->corpFinServices;\n return view('CorpFIN.panel.view_service', ['company'=>$company, 'services' => $services]);\n }", "public function getCompany() {\n return Companies::findById($this->company_id);\n }", "public function index()\n {\n return product_client::all();\n }", "function getOfferSpecial2() {\n\t$db =& JFactory::getDBO();\n\t$query = \"SELECT p.*, pf.file_url FROM\n\t\t#__cp_category c JOIN \n\t\t(#__cp_products p JOIN\n\t\t#__cp_product_files pf ON pf.product_id = p.product_id)\n\t\tON c.category_id=p.category_id \n\t\tWHERE p.`featured` = 1 AND p.`published` = 1 \".getWhere().\" GROUP BY p.product_id\";\n\n\t$db->setQuery($query);\n\t$rows = $db->loadObjectList();\n\treturn $rows;\n}", "function ve_get_linked_companies_section(){\n\tglobal $post;\n\t/**\n\t * Default colors:\n\t */\n\t$background_color = \"black\";\n\t$text_color = \"white\";\n\tif (get_field('companies_background_color')){\n\t\t$background_color = get_field('companies_background_color');\n\t}\n\tif (get_field('companies_text_color')){\n\t\t$text_color = get_field('companies_text_color');\n\t}\n\tif (get_post_meta($post->ID, 'company_checkbox_meta', true)) {\n\t\t?>\n\t\t<div class=\"full-width linked-companies padded-top-bottom grey-bg\" style=\"background-color: <?php echo $background_color; ?>\">\n\t\t\t<div class=\"container\">\n\t\t\t\t<div class=\"row\">\n\t\t\t\t\t<div class=\"col-lg-12 text-center padded-bottom black-text\" style=\"color: <?php echo $text_color;?>\">\n\t\t\t\t\t\t<span class=\"section-title-text\" id=\"front-page-companies-title-text\">\n\t\t\t\t\t\t\t<?php echo __('Companies', 'threedee-expo') ?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"col-lg-12\">\n\t\t\t\t\t\t<?php get_companies_linked_to_group_of_company(); ?>\n\t\t\t\t\t</div>\n\t\t\t\t</div> <!-- row -->\n\t\t\t</div> <!-- container -->\n\t\t</div> <!-- linked-companies -->\n\t\t<?php\n\t} else {\n\t\t// Do nothing, when there are no companies linked to group of company\n\t}\n}", "public static function coming(){\r\n\r\n $coming = static::whereHas('category', function($query){\r\n $query->where('name','LIKE','A venir');\r\n })\r\n ->where('featured',1)\r\n ->take(4)\r\n ->get();\r\n return $coming;\r\n }", "public function index()\n {\n $order = $this->get->get('order', 'ASC');\n $by = $this->get->get('by', 'name');\n $companies = $this->company->orderBy($by, $order)->paginate($this->totalPage);\n return view('admin.company.index', compact('companies'));\n }", "public function index(iCompanyService $companyService)\n {\n \n if (!in_array('Bedrijvengids', config('activeModules'))) {\n return abort(404);\n }\n // Ophalen gegevens\n\n\n $companies = $companyService->getCompanyCity();\n // dd($companies);\n\n foreach ($companies as $key => $company) {\n if (!empty($company->website)) {\n $company->website = explode(\",\", $company->website);\n } else {\n $companies[$key]->website = [];\n }\n }\n\n $cities = City::where(\"group_id\", config(\"siteGroup\"))->get();\n $types = CompanyType::wherenull('deleted_at')->get();\n $categories = Companycategory::wherenull('deleted_at')->get();\n $subcategories = CompanySubCategory::wherenull('deleted_at')->get();\n $sitename = config('siteName');\n $sitedomain = config('domain');\n\n $openGraph = [\n 'title' => 'Bedrijvengids',\n 'description' => 'Op deze pagina vindt u alle bedrijven binnen ' . config('siteName') . '.',\n 'image' => config('siteLogo'),\n 'type' => 'website'\n ];\n\n // View doorsturen met alle data\n return view('company_overview')\n ->with(['companies' => $companies, 'cities' => $cities, 'types' => $types, 'categories' => $categories, 'subcategories' => $subcategories, 'sitename' => $sitename, 'sitedomain' => $sitedomain, 'openGraph' => $openGraph]);\n }", "public function index()\n {\n $companies = Company::orderBy('created_at', 'desc')->paginate(10);\n return view('Admin.pages.company.index')->with('companies', $companies);\n }", "public function getContactUs()\n {\n return SiteFeature::first();\n }", "public function getCompaniesCrmSearchUrl()\n {\n $type = 'company' ;\n return $this->getEntitiesCrmSearchUrl( $type ) ;\n }", "private function get_venue_options() {\n\t\t// more info: http://codex.wordpress.org/Template_Tags/get_posts\n\t\t$posts = get_posts( 'numberposts=-1&orderyby=post_title&post_status=publish&post_type=tribe_venue' );\n\n\t\t$choices = array(\n\t\t\t[\n\t\t\t\t'text' => 'Insert New Venue Or Select One',\n\t\t\t\t'value' => '0',\n\t\t\t],\n\t\t);\n\n\t\tforeach ( $posts as $post ) {\n\t\t\t$choices[] = array( 'text' => $post->post_title, 'value' => $post->ID );\n\t\t}\n\n\t\treturn $choices;\n\t}", "public function index()\n {\n return view('company.index',[\n 'companies' => Company::orderBy('created_at', 'desc')->paginate(10)\n ]);\n }", "function thrive_dashboard_get_integrations_products()\n{\n $products = array();\n\n $products = apply_filters('thrive_dashboard_integrations_products', $products);\n\n return $products;\n}", "public function getProdCompany()\n {\n return $this->prod_company;\n }", "function get_companies_or_group_of_companies($post_type_indicator) {\n\t/**\n\t * Arguments for get posts:\n\t */\n\t$args = array(\n\t\t'orderby'\t\t =>\t'title',\n\t\t'order'\t\t\t =>\t'ASC',\n\t\t'post_type' => $post_type_indicator,\n\t\t'post_status' => 'publish',\n\t\t'posts_per_page' => -1\n\t);\n\tif ($post_type_indicator == 'companies') {\n\t\t$companies = get_posts($args);\n\t\t?>\n\t\t<div class=\"company-isotope\">\n\t\t\t<?php\n\t\t\tforeach ($companies as $company) {\n\t\t\t\t$company_url = get_permalink($company->ID);\n\t\t\t\t$company_title = $company->post_title;\n\t\t\t\t$company_title_length = strlen($company_title);\n\t\t\t\t$company_logo_url = get_field('company_logo', $company->ID);\n\t\t\t\t?>\n\t\t\t\t<a href=\"<?php echo $company_url ?>\" class=\"company-box col-xs-12 col-sm-6 col-md-4\">\n\t\t\t\t\t<div class=\"item-card\">\n\t\t\t\t\t\t<div class=\"item-card-thumbnail\">\n\t\t\t\t\t\t\t<img src=\"<?php echo $company_logo_url; ?>\" class=\"item-card-image\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"item-card-title purple-bg\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ($company_title_length <= 32) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<span class=\"item-title white-text\"><?php echo $company_title; ?></span>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<span class=\"item-title white-text\" style=\"font-size:16px!important\"><?php echo $company_title; ?></span>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</a>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}\n\tif ($post_type_indicator == 'group_of_companies') {\n\t\t$group_of_companies = get_posts($args);\n\t\t?>\n\t\t<div class=\"group-of-companies-isotope\">\n\t\t\t<?php\n\t\t\tforeach ($group_of_companies as $group_of_company) {\n\t\t\t\t$group_of_companies_url = get_permalink($group_of_company->ID);\n\t\t\t\t$group_of_companies_title = $group_of_company->post_title;\n\t\t\t\t$group_of_companies_title_length = strlen($group_of_companies_title);\n\t\t\t\t$group_of_companies_logo_url = get_field('group_of_companies_logo', $group_of_company->ID);\n\t\t\t\t?>\n\t\t\t\t<a href=\"<?php echo $group_of_companies_url ?>\" class=\"group-of-companies-box col-xs-12 col-sm-6 col-md-4\">\n\t\t\t\t\t<div class=\"item-card\">\n\t\t\t\t\t\t<div class=\"item-card-thumbnail\">\n\t\t\t\t\t\t\t<img src=\"<?php echo $group_of_companies_logo_url; ?>\" class=\"item-card-image\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"item-card-title turquoise-bg\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ($group_of_companies_title_length <= 32) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<span class=\"item-title white-text\"><?php echo $group_of_companies_title; ?></span>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<span class=\"item-title white-text\" style=\"font-size:16px!important\"><?php echo $group_of_companies_title; ?></span>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</a>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}\n\telse {\n\t\t// do nothing\n\t}\n}", "public function getAllForCustonObj() {\n $query = $this->db->query(\"SELECT * FROM $this->table ORDER BY shortname;\");\n $this->allcpny = $query->custom_result_object('entity\\Company');\n // print \"<pre>\";\n // print_r($this->cpny);\n // print \"</pre>\";\n // exit();\n return $this->allcpny;\n }", "function get_internships_by_company($id) {\n return get_view_data_where('internships', $id);\n}", "public function index(){\n return Responser::ok('Projects available',Auth::user()->companies->reduce(function($carry,$company){\n $company->projects->each(function($project) use(&$carry){\n $project->load('company');\n $carry[] = $project;\n });\n\n return $carry;\n },[]));\n }", "public function getFeaturedProduct(){\n\t\t$sql = \"SELECT * FROM tbl_product WHERE type = '1' ORDER BY pid DESC LIMIT 4\";\n\t\t$result = $this->db->select($sql);\n\t\treturn $result;\n\t}", "public function featured_all($cat_type_id)\n\t{\n\t\t// $featuredExperiences = $this->ExecuteQuery($sel_featuredExp);\n\t\t// return $featuredExperiences;\n\t}", "public function projectsFeaturedGet(string $platform = null, string $max_version = null, int $limit = 20, int $offset = 0, string $flavor = null, &$responseCode, array &$responseHeaders);", "public function getFacets()\n {\n return $this->facets;\n }", "public function getFacets()\n {\n return $this->facets;\n }", "function pro_featured_products()\n{\n\t$args = array( 'type' => 'product', 'orderby' => 'name', 'taxonomy' => 'product_cat' );\n\t$categories = get_categories( $args );\n\t$cats = array();\n\t\n\tforeach ( $categories as $category )\n\t{\n\t\t$cat_name = $category->name;\n\t\t$cats[$cat_name] = $cat_name;\n\t}\n\t\n\treturn $cats;\n}", "public function getlatestCompanies()\n {\n $AdminDashboardModel = $this->model('AdminDashboardModel');\n $this->latestCompanies = $AdminDashboardModel->getLatestCompanies();\n }", "public function getProducts() {\n\t\treturn $this->requester->request('GET', $this->url);\n\t}", "private function getMastheadItems()\n {\n $this->db->select('*', '`bf_item_tags`')\n ->where('`masthead` = 1 AND `masthead_image_path` <> \\'\\'')\n ->order('name', 'asc')\n ->execute();\n \n // Collect Item Tags\n $mastheadCollection = array();\n while($item = $this->db->next())\n {\n $mastheadCollection[] = array(\n 'name' => $item->name,\n 'link' => '/?option=tag&id=' . $item->id,\n 'url' => $item->masthead_image_path\n );\n }\n \n return $mastheadCollection;\n }", "function featuredItems()\n{\n \treturn query(\"SELECT titel, beschrijving, b.bodBedrag\n \t\t\t\tfrom tblVoorwerp v\n \t\t\t\tinner join (select voorwerpNummer, max(bodBedrag) as bodBedrag\n \t\t\t\tfrom tblBod\n \t\t\t\tgroup by voorwerpNummer) b on v.voorwerpNummer=b.voorwerpNummer\n where v.voorwerpNummer in (select top 5 v.voorwerpNummer\n \t\t\t\tfrom tblVoorwerp v\n \t\t\t\tinner join (select voorwerpNummer, max(bodBedrag) as bodBedrag\n \t\t\t\tfrom tblBod\n \t\t\t\tgroup by voorwerpNummer) b on v.voorwerpNummer=b.voorwerpNummer\n \t\t\t\torder by startPrijs/bodBedrag*100 desc)\");\n}", "public function index()\n {\n $search = request()->query('search');\n if ($search) {\n $company = Company::where('name', 'LIKE', \"%{$search}%\")->simplePaginate(10);\n } else {\n $company = Company::simplePaginate(10);\n }\n\n if (Company::onlyTrashed()->get()->count() > 0) {\n $trashed_button = true;\n }\n\n return view('companies.index')\n ->with('companies', $company)\n ->with('title', 'Agencies')\n ->with('trashed_button', $trashed_button ?? false);\n }", "public function companies()\n {\n return $this->belongsToMany('App\\Company')->withTimestamps();\n }" ]
[ "0.66041654", "0.62949586", "0.5998069", "0.5930802", "0.5925925", "0.5887295", "0.5881822", "0.57872397", "0.5750885", "0.5621846", "0.562016", "0.5538192", "0.55300665", "0.55181867", "0.5509221", "0.54950464", "0.5485105", "0.5473954", "0.5455649", "0.544388", "0.5436083", "0.5425311", "0.54195803", "0.5411562", "0.5411562", "0.5406832", "0.5403363", "0.5397426", "0.5390592", "0.53879404", "0.53837925", "0.5337627", "0.5334282", "0.533004", "0.5328065", "0.53213656", "0.5309418", "0.5286284", "0.5276573", "0.52704257", "0.5255426", "0.5252847", "0.5247526", "0.5241481", "0.5238854", "0.5227131", "0.52221966", "0.52078754", "0.5204156", "0.5196167", "0.51911515", "0.51854855", "0.51641303", "0.51629835", "0.5148817", "0.51357037", "0.5115162", "0.5108027", "0.50971514", "0.5093877", "0.50887847", "0.5085645", "0.5080496", "0.5079403", "0.50730956", "0.5072486", "0.5068413", "0.5068028", "0.5063441", "0.5057925", "0.50518656", "0.5047917", "0.50380355", "0.5033844", "0.5032893", "0.50237024", "0.5017196", "0.50114167", "0.50068253", "0.5006172", "0.5005594", "0.50032485", "0.4999015", "0.49951127", "0.49945024", "0.49927825", "0.49897656", "0.49896747", "0.49796474", "0.49775186", "0.49758455", "0.49649683", "0.49649683", "0.49647546", "0.4960475", "0.4959421", "0.49582744", "0.4953264", "0.49474669", "0.49429527" ]
0.73709166
0
Get the companies with featured cover images on the VTC page.
public function getFeaturedCovered(): CompanyCollection { return $this->featuredCovered; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFeatured(): CompanyCollection\n {\n return $this->featured;\n }", "public function getfeaturedCities(){\n\t\t $featuredTestimonial = array();\n\t\t $tData = $this->find('all',array('conditions'=>array('CmsCity.is_display'=>1),\n\t\t\t\t\t\t\t\t\t\t\t'fields'=>array('CmsCity.*'),\n\t\t\t\t\t\t\t\t));\n\t\t if(isset($tData) && !empty($tData)){\n\t\t\t\tforeach($tData as $key=>$testiData){\n\t\t\t\t\tif(isset($testiData['CmsCity']['image']))\n\t\t\t\t\t\t$testiData['CmsCity']['image'] = (!empty($testiData['CmsCity']['image'])) ? Router::url('/'.CMS_IMAGE_URL.$testiData['CmsCity']['image'],true) : \"\";\n\t\t\t\t\t$featuredTestimonial[] = $testiData;\n\t\t\t\t}\t\n\t\t\t}\n\t\treturn $featuredTestimonial;\t\n\t}", "function company_photos()\n\t\t{\n\t\t\t$type = $this->uri->segment(5);\n\t\t\t$data = $this->photo->company_photos();\n\t\t\t$this->directPageDetails(\"gallery_company/list_photo_company\",\"\",$data);\n\t\t}", "public function getCover()\n {\n return $this->makeEntity(CoverImage::class, 'cover');\n }", "public function getUnsplashCollectionPhotos(){\n $images = $this->unsplash->unsplashCollectionPhotos();\n return $images;\n }", "public function getFeaturedImage()\n {\n return $this->images()->orderBy('is_featured', 'desc')->orderBy('position', 'asc')->first();\n }", "private function getMastheadItems()\n {\n $this->db->select('*', '`bf_item_tags`')\n ->where('`masthead` = 1 AND `masthead_image_path` <> \\'\\'')\n ->order('name', 'asc')\n ->execute();\n \n // Collect Item Tags\n $mastheadCollection = array();\n while($item = $this->db->next())\n {\n $mastheadCollection[] = array(\n 'name' => $item->name,\n 'link' => '/?option=tag&id=' . $item->id,\n 'url' => $item->masthead_image_path\n );\n }\n \n return $mastheadCollection;\n }", "public function getCover()\n {\n return $this->data['fields']['cover'];\n }", "public function getCover()\n\t\t{\n\t\t\tif(is_null($this->data))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tif(!array_key_exists('cover', $this->data))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\treturn $this->data['cover']['large'];\n\t\t}", "private function get_featured_films() {\r\n $home_page_id = get_option('page_on_front');\r\n $featured = get_field('film_carousel', $home_page_id);\r\n\r\n return $featured;\r\n }", "public function getCategoriesWithImages() {\n return $this->categoryMapper->fetchCategoriesWithImages();\n }", "function getFeaturedCourses(){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT id, name, author, image FROM Course ORDER BY popularity LIMIT 3\";\n\n\t\t$result = $conn->query($query);\n\n\t\treturn fetch_all($result);\n\t}", "public function index()\n {\n return new FeaturedCollection(FeaturedResource::collection((Product::where('featured', '=', 1)->take(15)->get())));\n }", "public function getImages()\n {\n return $this->hasMany(Image::className(), ['venueId' => 'id']);\n }", "public function cloud()\n {\n return $this->hasOne(Cloud::class)->select(['cover']);\n }", "public function getImagenesIndexCategorias(){\n foreach($this->indexContent as $content){\n //echo \"--------------------- Imagenes --------------<br>\";\n $vectorImagenes = array();\n $dom = new DOMDocument();\n $dom->loadHTML(\"$content\");\n $xpath = new DOMXPath($dom);\n $tag = \"div\";\n $class = \"home-category-box\";\n $consulta = \"//\".$tag.\"[@class='\".$class.\"']\";\n $resultados = $xpath->query($consulta);\n if ($resultados->length > 0){\n $contador = 0;\n foreach($resultados as $imagenes){\n if ($contador == 0){\n $todasImagenes = $imagenes->getElementsByTagName(\"img\");\n if ($todasImagenes->length > 0){\n foreach($todasImagenes as $imagen){\n $urlImagen = $imagen->getAttribute(\"src\");\n //echo \"url imagen categorias padre: \".$urlImagen.\"<br>\";\n array_push($vectorImagenes,$urlImagen);\n }\n }\n }\n $contador++;\n }\n }\n //echo \"--------------------- Fin Imagenes --------------<br>\";\n }\n return $vectorImagenes;\n }", "public function get_featured_cca_list() \n {\n $this->db->from('cca');\n $this->db->where('featured','1');\n $query = $this->db->get();\n return $query->result();\n }", "public function imagenes() {\n return $imagenes = ImagenesProducto::where('fk_producto',$this->codigo) -> orderBy('featured','desc') -> get(); //para mostrar las imagenes ordenadas por las destacada\n }", "public function getMarketingImages()\n {\n return $this->marketing_images;\n }", "function ve_get_360_photo_section() {\n\tif (is_singular('companies')) {\n\t\tif (have_rows('company_threesixty_photos_repeater')){\n\t\t\t?>\n\t\t\t<div class=\"full-width threesixty-photos-section black-bg\">\n\t\t\t\t<?php ve_get_360_photos(); ?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t} elseif (is_singular('group_of_companies')) {\n\t\tif (have_rows('group_of_companies_threesixty_photos_repeater')) {\n\t\t\t?>\n\t\t\t<div class=\"full-width threesixty-photos-section black-bg\">\n\t\t\t\t<?php ve_get_360_photos(); ?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t}\n}", "function wgom_get_featured_overlay() {\n\t$tag_images = array(\n\t\t'Guest DJ' => '<img class=\"overlay\" width=\"249\" height=\"71\" src=\"/wp-content/uploads/2013/12/guest-dj.jpg\" />',\n\t\t'Theme Week' => '<img class=\"overlay\" src=\"/wp-content/uploads/2014/06/TmWk.png\" />',\n\t\t'e-6 bait' => '<img class=\"overlay\" src=\"/wp-content/uploads/2014/01/e-6-bait.jpg\" />',\n\t\t'facebook watch game' => '<img class=\"overlay\" src=\"/wp-content/uploads/2018/12/fb-watch-game.png\" />',\n\t\t'new music' => '<img class=\"overlay\" src=\"/wp-content/uploads/2018/07/NewMusic.png\" />',\n\t\t'RIP' => '<img class=\"overlay\" src=\"/wp-content/uploads/2015/06/candle.png\" />',\n\t\t'SXSW 2014' => '<img class=\"overlay\" src=\"/wp-content/uploads/2014/03/SXSW.png\" />',\n\t\t'SXSW 2015' => '<img class=\"overlay\" src=\"/wp-content/uploads/2015/04/SXSW-2015.png\" />',\n\t\t'MLB.TV Free Game Of The Day' => '<img class=\"overlay\" src=\"/wp-content/uploads/2018/07/MLBFGotD.png\" />',\n\t\t'NSFW' => '<img class=\"overlay-left\" src=\"/wp-content/uploads/2015/08/NSFW.jpg\" />',\n\t\t'Best of' => '<img class=\"overlay-left\" src=\"/wp-content/uploads/2015/12/best-of-fs8.png\" />',\n\t);\n\n\t$the_tags = get_the_tags();\n\t$tags = array();\n\tif (!empty($the_tags)) {\n\t\tforeach ($the_tags as $t) {\n\t\t\tif (array_key_exists($t->name, $tag_images)) {\n\t\t\t\techo $tag_images[$t->name];\n\t\t\t}\n\t\t}\n\t}\n}", "public function commercialCoverages()\n {\n return $this->hasMany('App\\SelectedCommercialCoverage');\n }", "public function getHeadCover()\n {\n return $this->getData('head_cover');\n }", "public function getPhotos();", "public function getCover()\n {\n return $this->cover;\n }", "public function getCover()\n {\n return $this->cover;\n }", "public function getFeaturedbrand(){\n\t\t \n\t\t $collections = Mage::getModel('brand/brand')->getCollection()\n\t\t\t\t\t\t->addFieldToFilter('is_feature',1);\n\t\t\t\t\n\t\treturn $collections;\n\t }", "public function getCover()\n {\n return $this->coverLink;\n }", "protected function fetchImagesInContent(){\n if(isset($this->images)){\n return;\n }\n $texts = array(\n 'text' => $this->Article->text, \n 'full' => $this->Article->fulltext, \n 'intro' => $this->Article->introtext);\n $images = array();\n foreach ($texts as $key => $text) {\n if($text != ''){\n $fetchedImages = $this->extractImageFromHTML($text, $key);\n if($fetchedImages){\n $images = array_merge($images, $fetchedImages);\n }\n }\n }\n if(!empty($images)){\n $this->images = $images;\n }\n }", "function getCover () {\n\n}", "function getImages($coverUrls)\n{\n\t//Create array to hold cURL's\n\t$chs = array();\n\t//Array for HTTP responses\n\t$responses = array();\n\t//Boolean to note if the downloads are still progressing.\n\t$running = null;\n\t$mh = curl_multi_init();\n\t$i = 0;\n\tforeach($coverUrls as $url)\n\t{\n\t\t$chs[$i] = curl_init($url['url']);\n\t\tcurl_setopt($chs[$i], CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($chs[$i], CURLOPT_USERAGENT, 'www.paddez.com/lastfm/');\n curl_setopt($chs[$i], CURLOPT_CONNECTTIMEOUT, 20);\n curl_setopt($chs[$i], CURLOPT_TIMEOUT, 120);\n\t\tcurl_multi_add_handle($mh, $chs[$i]);\n\t\t$i++;\n\t}\n\tdo\n\t{\n\t\tcurl_multi_exec($mh, $running);\n\t\tcurl_multi_select($mh);\n\t} while($running > 0);\n\n\t$i = 0;\n\tforeach($chs as $ch)\n\t{\n\t\t$images[$i]['data'] = curl_multi_getcontent($ch);\n\t\t$images[$i]['artist'] = $coverUrls[$i]['artist'];\n\t\t$images[$i]['album'] = $coverUrls[$i]['album'];\n\t\t$images[$i]['playcount'] = $coverUrls[$i]['playcount'];\n\t\tcurl_multi_remove_handle($mh, $ch);\n\t\t$i++;\n\t}\n\n\tcurl_multi_close($mh);\n\treturn $images;\n}", "protected function getImageCandidates()\n\t{\n\t\t$result = array();\n\t\tforeach ($this->imgElements as $imgElement)\n\t\t{\n\t\t\t$imageDimensions = $this->getImageDimensions($imgElement);\n\t\t\tif($imageDimensions['width'] >= self::MIN_IMAGE_WIDTH && $imageDimensions['height'] >= self::MIN_IMAGE_HEIGHT)\n\t\t\t{\n\t\t\t\t$result[] = $imgElement['src'];\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "function block_core_post_template_uses_featured_image($inner_blocks)\n {\n }", "function getImages ( $searchTerms )\n {\n if(!is_null($searchTerms))\n {\n $imagesForProject = array();\n foreach ($searchTerms as $value) {\n $query_param = preg_replace('/\\s+/', '', $value);\n $images = Image::join('imageclasslabels', 'images.id','=','imageclasslabels.image_id')\n -> join('classlabel', 'imageclasslabels.class_id','=','classlabel.id')\n -> where('classlabel.title', 'like', '%'.$value.'%')\n -> orWhere('tags', 'like', '%'.$value.'%')\n -> select('images.*')\n -> get();\n Log::info(count($images));\n foreach ($images as $image) {\n array_push($imagesForProject, (array)$image);\n }\n }\n return $imagesForProject;\n }\n return false;\n }", "public function getCoverUrl()\n {\n return Url::to(\"/img/covers/{$this->avatar}\");\n }", "function getOfferSpecial2() {\n\t$db =& JFactory::getDBO();\n\t$query = \"SELECT p.*, pf.file_url FROM\n\t\t#__cp_category c JOIN \n\t\t(#__cp_products p JOIN\n\t\t#__cp_product_files pf ON pf.product_id = p.product_id)\n\t\tON c.category_id=p.category_id \n\t\tWHERE p.`featured` = 1 AND p.`published` = 1 \".getWhere().\" GROUP BY p.product_id\";\n\n\t$db->setQuery($query);\n\t$rows = $db->loadObjectList();\n\treturn $rows;\n}", "function set_cover_image( $id ) {\n\treturn class_exists( 'MultiPostThumbnails' ) && MultiPostThumbnails::has_post_thumbnail( 'project', 'cover-image', $id ) ?\n\t\tMultiPostThumbnails::get_post_thumbnail_url( 'project', 'cover-image', $id, 'large' ) :\n\t\t\tset_featured_image( $id );\n}", "function nb_get_image_src( $object, $field_name, $request ) {\n $featured_img_array = wp_get_attachment_image_src( $object[ 'featured_media'], 'full', true);\n return $featured_img_array[0];\n}", "function get_images() \t{\n \t\treturn $this->getImages();\n \t}", "function getCoverImageID() {\n\t\treturn $this->_CoverImageID;\n\t}", "function wgom_get_featured_image() {\n\t// This is the usual code that gets executed.\n\tif ( has_post_thumbnail() ) {\n\t\tif ( 'grid' == get_theme_mod( 'featured_content_layout' ) )\n\t\t\tthe_post_thumbnail();\n\t\telse\n\t\t\tthe_post_thumbnail( 'twentyfourteen-full-width' );\n\t}\n\telse {\n\t\t// This is the WGOM extension part.\n\t\t$image_html = wgom_video_post_featured_image();\n\t\tif (!empty($image_html)) {\n\t\t\techo $image_html;\n\t\t}\n\t}\n\n\twgom_get_featured_overlay();\n}", "function &getCVs() {\n $suppFileDao =& DAORegistry::getDAO('SuppFileDAO');\n return $suppFileDao->getSuppFilesByArticleTypeAndAssocId($this->getArticleId(), SUPP_FILE_CV, $this->getId());\n\t}", "public function images()\n {\n return $this->hasMany(ClinicImage::class);\n }", "public function getFeaturedProductCollection()\n {\n return $this->_getProductCollection();\n }", "public function showcases()\n {\n return $this->morphedByMany(Portfolio::class, 'taggable', 'taxonomy_relationships')->withTimestamps();\n }", "function _campaign_resource_load_gallery($nid, $count = 25, $start = 0) {\n $params = array(\n 'nid' => $nid,\n 'status' => 'approved',\n );\n return dosomething_api_get_reportback_files($params, $count, $start);\n}", "public function featured()\n {\n if($this->isFeatured())\n {\n $featuredObj = FeaturedCompany::where('company_id', $this->id)->first();\n return $featuredObj;\n }\n return false;\n }", "public function homepagebanner()\n\t {\n\t\t\n\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t$connection = $resource->getConnection();\n\t\t$sql = \"Select * FROM custom_productbanner where status=1 order by productbanner_id asc\";\n\t\t$result1 = $connection->fetchAll($sql);\t\n\n if(!empty($result1))\n\t\t{\t\t\t\n\t\t\t\n\t\tforeach ($result1 as $data) {\n\t\t$banner_id=$data['productbanner_id'];\n $image_name=$data['name'];\n\t\t$image_background=$data['background'];\n\t\t$image_caption=$data['imagecaption'];\n\t\t$result[]=array('homepagebanner'=>array(array('Id'=>$banner_id,'Image Name'=>$image_name,'img'=>'http://localhost/markateplace/pub/media/Gridpart4/background/image'.$image_background.'','Image Caption'=>$image_caption)));\t\n\t\t\t\n\t\t}\t\t\t\n\t\t}\t\n\t\telse\n\t\t{\n\t\t\t$result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"error\"));\n\t\t\t\n\t\t}\n\n\t\t\t\t\n\t return $result; \n\t\n\t }", "function ve_get_360_photos() {\n\t$field_name_repeater = '';\n\t$photo_url_field = '';\n\tif ( is_singular( 'companies' ) ) {\n\t\t$field_name_repeater = 'company_threesixty_photos_repeater';\n\t\t$photo_url_field = 'company_threesixty_photo_url';\n\t}\n\tif ( is_singular( 'group_of_companies' ) ) {\n\t\t$field_name_repeater = 'group_of_companies_threesixty_photos_repeater';\n\t\t$photo_url_field = 'group_of_companies_threesixty_photo_url';\n\t}\n\tif (have_rows($field_name_repeater) ) {\n\t\t/**\n\t\t * Go through all the data in company_youtube_repeater field:\n\t\t */\n\t\t?>\n\t\t<div id=\"owl-threesixty-photos\" class=\"owl-carousel owl-theme\">\n\t\t\t<?php\n\t\t\twhile (have_rows($field_name_repeater) ) {\n\t\t\t\tthe_row();\n\t\t\t\t?>\n\t\t\t\t<div class=\"item\">\n\t\t\t\t\t<blockquote data-mode=\"click2play\" data-width=\"100%\" data-height=\"500px\" class=\"ricoh-theta-spherical-image\" ><?php echo get_sub_field($photo_url_field); ?><a href=\"<?php echo get_sub_field($photo_url_field); ?>\" target=\"_blank\"></a></blockquote>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\t\t<script async src=\"https://theta360.com/widgets.js\" charset=\"utf-8\"></script>\n\t\t<?php\n\t}\n\t/**\n\t * If there are NO 360 photos:\n\t */\n\telse {\n\t\t// Do nothing\n\t}\n}", "function vt_prod_cat_get_masthead_url() {\n\n\t$image_id = get_field( 'prod_cat_masthead_image', get_queried_object() );\n\n\tif ( false === $image_id ) {\n\n\t\t//Get fallback image from options\n\t\t$image_id = get_field( 'product_category_masthead_fallback', 'option' );\n\n\t}\n\n\t$image_url = wp_get_attachment_image_url( $image_id, 'cl_product_cat_masthead' );\n\n\treturn $image_url;\n}", "public function getOffer_images()\n {\n return $this->offer_images;\n }", "public function cropCoverages()\n {\n return $this->hasMany('App\\SelectedCropCoverage');\n }", "public function additional_images() {\n\t\t$image_list = array();\n\t\t\n\t\tif (is_single () || is_page ()) {\n\t\t\t$fb_image1 = get_post_meta ( get_the_ID(), 'essb_post_og_image1', true );\n\t\t\t$fb_image2 = get_post_meta ( get_the_ID(), 'essb_post_og_image2', true );\n\t\t\t$fb_image3 = get_post_meta ( get_the_ID(), 'essb_post_og_image3', true );\n\t\t\t$fb_image4 = get_post_meta ( get_the_ID(), 'essb_post_og_image4', true );\n\t\t\t\n\t\t\tif (!empty($fb_image1) && is_string($fb_image1)) {\n\t\t\t\t$image_list[] = $fb_image1;\n\t\t\t}\n\n\t\t\tif (!empty($fb_image2) && is_string($fb_image2)) {\n\t\t\t\t$image_list[] = $fb_image2;\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($fb_image3) && is_string($fb_image3)) {\n\t\t\t\t$image_list[] = $fb_image3;\n\t\t\t}\n\t\t\t\t\n\t\t\tif (!empty($fb_image4) && is_string($fb_image4)) {\n\t\t\t\t$image_list[] = $fb_image4;\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\n\t\treturn $image_list;\n\t}", "public function getDisplayStockPhotos()\n {\n return $this->displayStockPhotos;\n }", "function C95_columns_content($column_name, $post_ID) {\n if ($column_name == 'featured_image') {\n $post_featured_image = C95_get_featured_image($post_ID);\n if ($post_featured_image) {\n echo '<img style=\"width:100%;\" src=\"' . $post_featured_image . '\" />';\n }\n }\n}", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "public function getTenLatestPhotos();", "public function secondaryImages()\n {\n return $this->images()->where('main_img', '=', '0');\n }", "function get_slupy_page_cover( $class_name = false ) {\n $is_cover = false;\n $val = '';\n\n if( ts_get_option('ph_bg') && ts_get_option('ph_cover_color') && ts_get_option('ph_cover_alpha') ) {\n $is_cover = true;\n }\n\n if( $is_cover ) {\n $val = $class_name ? '<div class=\"section-cover\"></div>' : ' is-media-container';\n }\n\n return $val;\n\n}", "public function findDistinctUrlPics()\n {\n return $this->createStandardQueryBuilder()->distinct('pics.url')->sort('public_date', 1)->getQuery()->execute();\n }", "public function get_big_four_cities(){\n $cities = $this->get_data('cities');\n $this->get_banner('cities');\n echo '\n <!--Hero Image -->\n <div class=\"container\">';\n echo '<div class=\"row\">'; \n echo '<div class=\"col-sm-2\"></div>';\n echo '<section class=\"callout col-sm-8 mt-4\">';\n echo '<h1 id=\"big4\" class=\"text-center\">The Big 4</h1>';\n foreach($cities as $product => $item): \n echo '<div class=\"row\">'; \n echo ' <section class=\"calloutBoxImage fl col-sm-4\">\n <img class=\"w-100\" src=\"images/'.$cities[$product]['image'].'\" alt=\"'.$cities[$product]['alt'].'\">\n </section>\n <section class=\"calloutBoxText fr col-sm-8\">';\n echo '<h2>'.$cities[$product]['city'].'</h2>';\n echo '<p>'.$cities[$product]['description'].'</p>\n </section>\n <br />\n </div>';\n endforeach;\n echo '</section>';\n echo '<div class=\"col-sm-2\"></div>';\n echo \"</div>\";\n echo '</div>';\n }", "function get_featured_travelinfo() {\n $sql = \"SELECT * FROM news WHERE parentid='' AND featured='1' ORDER BY id DESC LIMIT 7\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "protected function getBannerItems()\n {\n $self = $this;\n\n return Cache::remember(\n 'home_banner_items',\n config('kosher.cache_expiration_time'),\n function () use ($self) {\n $recipes = Recipe::banner()->with('categories')->get();\n $articles = Article::banner()->published()->with('category')->get();\n $shows = Show::banner()->get();\n\n $banner = $recipes->merge($articles)\n ->merge($shows)\n ->shuffle()\n ->take(config('kosher.pagination.home_banner_items'));\n\n if (0 == $banner->count()) {\n $recipes = Recipe::featured()->with('categories')->get();\n $articles = Article::featured()->published()->with('category')->get();\n $shows = Show::featured()->get();\n\n $banner = $recipes->merge($articles)\n ->merge($shows)\n ->shuffle()\n ->take(config('kosher.pagination.home_banner_items'));\n }\n\n if (0 == $banner->count()) {\n $banner = Recipe::published()\n ->with('categories')\n ->take(config('kosher.pagination.home_banner_items'))\n ->get();\n $self->mergeReceivedRecipes($banner);\n } else {\n $recipes = collect();\n foreach ($banner as $item) {\n if ($item->isRecipe()) {\n $recipes->push($item);\n }\n }\n $self->mergeReceivedRecipes($recipes);\n }\n\n return $banner;\n }\n );\n }", "function get_companies_or_group_of_companies($post_type_indicator) {\n\t/**\n\t * Arguments for get posts:\n\t */\n\t$args = array(\n\t\t'orderby'\t\t =>\t'title',\n\t\t'order'\t\t\t =>\t'ASC',\n\t\t'post_type' => $post_type_indicator,\n\t\t'post_status' => 'publish',\n\t\t'posts_per_page' => -1\n\t);\n\tif ($post_type_indicator == 'companies') {\n\t\t$companies = get_posts($args);\n\t\t?>\n\t\t<div class=\"company-isotope\">\n\t\t\t<?php\n\t\t\tforeach ($companies as $company) {\n\t\t\t\t$company_url = get_permalink($company->ID);\n\t\t\t\t$company_title = $company->post_title;\n\t\t\t\t$company_title_length = strlen($company_title);\n\t\t\t\t$company_logo_url = get_field('company_logo', $company->ID);\n\t\t\t\t?>\n\t\t\t\t<a href=\"<?php echo $company_url ?>\" class=\"company-box col-xs-12 col-sm-6 col-md-4\">\n\t\t\t\t\t<div class=\"item-card\">\n\t\t\t\t\t\t<div class=\"item-card-thumbnail\">\n\t\t\t\t\t\t\t<img src=\"<?php echo $company_logo_url; ?>\" class=\"item-card-image\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"item-card-title purple-bg\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ($company_title_length <= 32) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<span class=\"item-title white-text\"><?php echo $company_title; ?></span>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<span class=\"item-title white-text\" style=\"font-size:16px!important\"><?php echo $company_title; ?></span>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</a>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}\n\tif ($post_type_indicator == 'group_of_companies') {\n\t\t$group_of_companies = get_posts($args);\n\t\t?>\n\t\t<div class=\"group-of-companies-isotope\">\n\t\t\t<?php\n\t\t\tforeach ($group_of_companies as $group_of_company) {\n\t\t\t\t$group_of_companies_url = get_permalink($group_of_company->ID);\n\t\t\t\t$group_of_companies_title = $group_of_company->post_title;\n\t\t\t\t$group_of_companies_title_length = strlen($group_of_companies_title);\n\t\t\t\t$group_of_companies_logo_url = get_field('group_of_companies_logo', $group_of_company->ID);\n\t\t\t\t?>\n\t\t\t\t<a href=\"<?php echo $group_of_companies_url ?>\" class=\"group-of-companies-box col-xs-12 col-sm-6 col-md-4\">\n\t\t\t\t\t<div class=\"item-card\">\n\t\t\t\t\t\t<div class=\"item-card-thumbnail\">\n\t\t\t\t\t\t\t<img src=\"<?php echo $group_of_companies_logo_url; ?>\" class=\"item-card-image\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"item-card-title turquoise-bg\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ($group_of_companies_title_length <= 32) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<span class=\"item-title white-text\"><?php echo $group_of_companies_title; ?></span>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<span class=\"item-title white-text\" style=\"font-size:16px!important\"><?php echo $group_of_companies_title; ?></span>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</a>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}\n\telse {\n\t\t// do nothing\n\t}\n}", "public function cover_image() {\n return $this->morphOne('App\\File', 'fileable')->where('category', 'cover');\n }", "public function companies(): Collection\n {\n return Company::all();\n }", "public function get_featured_products()\n\t{\n\t\t$this->db->select('product.*, category.category_name, brand.brand_name')->from('product, category, brand')->where(\"product.product_status = 1 AND product.category_id = category.category_id AND product.brand_id = brand.brand_id AND product.featured = 1 AND product.product_balance > 0\")->order_by(\"created\", 'DESC');\n\t\t$query = $this->db->get('',8);\n\t\t\n\t\treturn $query;\n\t}", "public function getAllFeaturedProducts()\n {\n $products = Product::/* where('category_id', $id)-> */where('is_featured', 1)->get();\n\n return view('frontend.pages.featuredproduct', compact('products'));\n }", "public function images()\n {\n return $this->hasMany(BusinessListingImage::class);\n }", "private function getPictures( $count ){\n\t\t$flickr_group_id = Yii::$app->params['flickr-group-id'];\n\t\t$flickr_api_key = Yii::$app->params['flickr-api-key'];\n\n\t\t$flickr_url = 'https://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' . urlencode( $flickr_api_key ) . '&group_id=' . urlencode($flickr_group_id) . '&per_page=' . urlencode($count) . '&format=json&nojsoncallback=1&extras=url_q';\n\t\t$json_array = $this->getFromApi( $flickr_url );\n\n\t\tif( isset($json_array['photos']) && isset($json_array['photos']['photo']) ){\n\t\t\tif( isset($_GET['debug']) ){\n\t\t\t\tvar_dump($json_array['photos']['photo']);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\treturn $json_array['photos']['photo'];\n\t\t}\n\n\t\treturn array();\n\t}", "function random_featured_collection()\n{\n $collection = get_random_featured_collection();\n if ($collection) {\n $html = get_view()->partial('collections/single.php', array('collection' => $collection));\n release_object($collection);\n } else {\n $html = '<p>' . __('No featured collections are available.') . '</p>';\n }\n return $html;\n}", "public function featuredPhoto() {\n return $this->hasOne('App\\Models\\ProductPhoto')->whereFeatured(true);\n }", "public function view_banner_photos($args)\n {\n $this->registry->template->Title = \"HiiFan News Portal :: Admin Home Page : View Banner Photos\";\n $bannerPhotoListArray = $this->registry->model->run(\"getAllBannerPhotoList\", $args);\n $this->registry->template->PresentPage = $args['start_page'];\n $this->registry->template->BannerPhotoListArray = $bannerPhotoListArray;\n $this->registry->template->show(\"view_banner_photos\");\n }", "public function bannerPhotos() {\n return $this->hasMany('App\\FlyerBanner');\n }", "public function mainImage()\n {\n return $this->images()->where('main_img', '=', '1');\n }", "function getTeaserImages() \t{\n \t\treturn $this->teaserImagesArray;\n \t}", "public function listadoHijosNietosImagenes($content){\n $contador = 0;\n $vectorImagenes = array();\n $dom = new DOMDocument();\n $dom->loadHTML(\"$content\");\n $xpath = new DOMXPath($dom);\n $tag = \"div\";\n $class = \"widget em-widget-new-products-grid\";\n $consulta = \"//\".$tag.\"[@class='\".$class.\"']\";\n $widget = $xpath->query($consulta);\n //var_dump($widget);\n if ($widget->length > 0){\n foreach($widget as $res){\n if ($contador == 0){\n $resultados = $res->getElementsByTagName(\"img\");\n if ($resultados->length > 0){\n foreach($resultados as $img){\n $urlImagen = $img->getAttribute(\"src\");\n array_push($vectorImagenes,$urlImagen);\n }\n }\n }\n $contador++;\n }\n }\n return $vectorImagenes;\n }", "public function getFeaturedImage()\n {\n $img = $this->images()->orderBy('is_featured', 'desc')->orderBy('position', 'asc')->first();\n\n if ($img) return $img;\n\n // If no featured image, RETURN one, anyway\n return new Image();\n }", "function zm_getathomeforbookshelf()\n{\n $zedPage = get_page_by_path('bookshelf-book-club');\n $atHome = get_field('at_home', $zedPage->ID);\n $atHomeStack = array();\n foreach ($atHome as $postID) {\n $someObj = new stdClass;\n $atHomePost = get_post($postID);\n $someObj->post_title = $atHomePost->post_title;\n $someObj->subtitle = get_field('subtitle', $postID);\n $someObj->permalink = str_replace(home_url(), \"\", get_permalink($postID));\n $someObj->category = getZedCatsbookshelf($atHomePost);\n $post_thumbnail_id = get_post_thumbnail_id($postID);\n if (isset($post_thumbnail_id)) {\n $someObj->thumbnail = zm_get_attachment_image($post_thumbnail_id, 'teaser_square');\n } else {\n $someObj->thumbnail = false;\n }\n array_push($atHomeStack, $someObj);\n }\n return $atHomeStack;\n}", "public function images()\n {\n return get_field('images');\n }", "public function get_product_images() : array {\n\t\tpreg_match( '/imageBigViewURL=\\[\\n(.*?)\\r?\\n?\\];/si', $this->request, $matches );\n\n\t\tif ( empty( $matches[1] ) ) {\n\t\t\treturn [ 'product_images' => [] ];\n\t\t}\n\n\t\t$matched_urls = array_map( 'trim', explode( ',', str_replace( '\"', '', $matches[1] ) ) );\n\t\tif ( empty( $matched_urls ) ) {\n\t\t\treturn [ 'product_images' => [] ];\n\t\t}\n\n\t\treturn [ 'product_images' => array_map( 'esc_url_raw', $matched_urls ) ];\n\t}", "protected function getExistingImages($bunch)\n {\n return $this->mediaProcessor->getExistingImages($bunch);\n }", "function get_companies_linked_to_group_of_company() {\n\tglobal $post;\n\t/**\n\t * Check if there are companies linked to the post:\n\t */\n\tif (get_post_meta($post->ID, 'company_checkbox_meta', true)) {\n\t\t/**\n\t\t * Arguments for get posts:\n\t\t */\n\t\t$args = array(\n\t\t\t'orderby'\t\t =>\t'title',\n\t\t\t'order'\t\t\t =>\t'ASC',\n\t\t\t'post_type' => 'companies',\n\t\t\t'post_status' => 'publish',\n\t\t\t'posts_per_page' => -1\n\t\t);\n\t\t$companies = get_posts($args);\n\t\t$linked_companies_ids = get_post_meta($post->ID, 'company_checkbox_meta', true);\n\t\t?>\n\t\t<div class=\"company-isotope\">\n\t\t\t<?php\n\t\t\t/**\n\t\t\t * Go through all the posts:\n\t\t\t */\n\t\t\tforeach ($companies as $company) {\n\t\t\t\t/**\n\t\t\t\t * Go through all the linked id's\n\t\t\t\t */\n\t\t\t\tforeach ($linked_companies_ids as $linked_company_id) {\n\t\t\t\t\t/**\n\t\t\t\t\t * if linked company id == company id, then generate company card.\n\t\t\t\t\t */\n\t\t\t\t\tif ($linked_company_id == $company->ID) {\n\t\t\t\t\t\t$company_url = get_permalink($company->ID);\n\t\t\t\t\t\t$company_title = $company->post_title;\n\t\t\t\t\t\t$company_logo_url = get_field('company_logo', $company->ID);\n\t\t\t\t\t\t$company_title_length = strlen($company_title);\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<a href=\"<?php echo $company_url ?>\" class=\"company-box col-xs-12 col-sm-6 col-md-4\">\n\t\t\t\t\t\t\t<div class=\"item-card\">\n\t\t\t\t\t\t\t\t<div class=\"item-card-thumbnail\">\n\t\t\t\t\t\t\t\t\t<img src=\"<?php echo $company_logo_url; ?>\" class=\"item-card-image\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"item-card-title white-bg\">\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ($company_title_length <= 32) {\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<span class=\"item-title black-text\"><?php echo $company_title; ?></span>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<span class=\"item-title black-text\" style=\"font-size:16px!important\"><?php echo $company_title; ?></span>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// do nothing.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}\n\t/**\n\t * If there are no linked companies\n\t */\n\telse {\n\t\t// do nothing.\n\t}\n}", "public function getPhotos()\n {\n return $this->photos;\n }", "function select_gallery_data($cid)\n\t{\n\t\tglobal $db;\n\n\t\t//Process Each Gallery Image For This Vehicle\n\t\t$sql = \"SELECT gallery.*, images.*\n \t\t\tFROM \" . GARAGE_GALLERY_TABLE . \" AS gallery\n \t\t\tLEFT JOIN \" . GARAGE_IMAGES_TABLE . \" AS images ON images.attach_id = gallery.image_id \n \t\tWHERE gallery.garage_id = $cid\n\t\t\tGROUP BY gallery.id\";\n\n \t\tif ( !($result = $db->sql_query($sql)) )\n \t\t{\n \t\tmessage_die(GENERAL_ERROR, 'Could Not Select Image Data', '', __LINE__, __FILE__, $sql);\n \t\t}\n\n\t\twhile ($row = $db->sql_fetchrow($result) )\n\t\t{\n\t\t\t$rows[] = $row;\n\t\t}\n\t\t$db->sql_freeresult($result);\n\t\n\t\treturn $rows;\n\t}", "public function featured_img() {\n\n $featured_img = wp_get_attachment_image_src(\n get_post_thumbnail_id( get_the_ID() ), 'large'\n );\n\n return $featured_img[0];\n }", "public function getCaninBitImg()\n {\n\n $cannabits_doc = new \\DOMDocument();\n $html = @file_get_contents('https://newfrontierdata.com/tag/cannabits/');\n libxml_use_internal_errors(TRUE);\n\n if (!empty($html)) {\n\n $cannabits_doc->loadHTML($html);\n libxml_clear_errors();\n $cannabits_xpath = new \\DOMXPath($cannabits_doc);\n $cannabits_row = $cannabits_xpath->query('//article[@id]');\n\n if ($cannabits_row->length > 0) {\n $count = 0;\n foreach ($cannabits_row as $row) {\n\n $aHref = $row->getElementsByTagName(\"a\")->item(0)->getAttribute('href');\n $imgSrc = $row->getElementsByTagName(\"img\")->item(0)->getAttribute('src');\n $h2Title = $row->getElementsByTagName(\"h2\")->item(0)->nodeValue;\n\n foreach ($row->getElementsByTagName(\"div\") as $div) {\n if ($div->getAttribute('class') == 'post-content nz-clearfix') {\n $textContent = trim($div->nodeValue);\n }\n }\n\n $cannabits_list[] = array('imageUrl' => $imgSrc, 'articleUrl' => $aHref, 'headline' => $h2Title,\n 'fullStory' => $textContent, 'num' => $count);\n $count += 1;\n }\n\n return ($cannabits_list);\n }\n\n }\n\n }", "function otm_show_featured_posts() {\n\n\t$my_query = new WP_Query( array( \n\t\t'meta_key' \t\t\t\t=> 'is_featured',\n\t\t'post_type'\t\t\t\t=> 'post',\n\t\t'meta_value'\t\t\t=> true,\n\t\t'numberposts' \t\t=> 3\n\t) );\n\n\t// If our query has posts\n\tif ( $my_query->have_posts() ) :\n\t\twhile ( $my_query->have_posts() ) : $my_query->the_post();\n\n\t\t\t// Get specific template-part\n\t\t\tget_template_part( 'template-parts/post/content-featured' );\n\n\t\tendwhile;\n\tendif;\n\n\twp_reset_query();\n}", "public function getLogoImages()\n {\n return $this->logo_images;\n }", "public function companies()\n {\n return $this->morphedByMany('App\\Company', 'taggable');\n }", "protected function fetchAllImages(){\n $this->fetchImagesInContent();\n $this->fetchFullTextImage();\n $this->fetchIntroImage();\n $this->fetchFirstImageInContent();\n }", "function random_featured_items($count = 5, $hasImage = null)\n{\n $items = get_random_featured_items($count, $hasImage);\n if ($items) {\n $html = '';\n foreach ($items as $item) {\n $html .= get_view()->partial('items/single.php', array('item' => $item));\n release_object($item);\n }\n } else {\n $html = '<p>' . __('No featured items are available.') . '</p>';\n }\n return $html;\n}", "public function featured_all($cat_type_id)\n\t{\n\t\t// $featuredExperiences = $this->ExecuteQuery($sel_featuredExp);\n\t\t// return $featuredExperiences;\n\t}", "public function index()\n {\n return new BannerCollection(Banner::orderBy('created_at', 'desc')->get());\n }", "function get_random_featured_collection()\n{\n return get_db()->getTable('Collection')->findRandomFeatured();\n}", "function fsf_port_getCategoryImageThumbnails($fsfcms_category_slug,$fsfcms_page,$fsfcms_items)\n {\n $fsf_port_getCategoryImageThumbnails_content = \"\";\n\n global $fsfcms_api_url;\n\n $fsf_api_file = \"fsf.port.getCategoryImageThumbnails.php\";\n $fsf_api_options = \"?categorySlug=\" . urlencode($fsfcms_category_slug); \n\n if($fsfcms_items !=\"\")\n {\n $fsf_api_options_i = \"&items=\" . $fsfcms_items; \n if($fsfcms_page != \"\")\n {\n $fsf_api_options_p = \"&page=\" . $fsfcms_page;\n } else {\n $fsf_api_options_p = \"&page=1\";\n }\n } else {\n $fsf_api_options_p = \"\";\n $fsf_api_options_i = \"\";\n }\n\n $fsf_api_options .= $fsf_api_options_p . $fsf_api_options_i;\n\n $fsf_port_getCategoryImageThumbnails_json = fsf_preacher_curl($fsfcms_api_url, $fsf_api_file, $fsf_api_options);\n $fsf_port_getCategoryImageThumbnails_thumbnails = json_decode($fsf_port_getCategoryImageThumbnails_json, true);\n $fsf_port_getCategoryImageThumbnails_content = fsf_port_category_thumbnail_links($fsf_port_getCategoryImageThumbnails_thumbnails,$fsfcms_category_slug);\n return $fsf_port_getCategoryImageThumbnails_content; \n }", "function get_featured_image( $id ) {\n\treturn wp_get_attachment_image_src( get_post_thumbnail_id( $id ), IMAGE_CAPTIONS_IMAGE_SIZE )[0];\n}", "public function headshots()\n {\n $compositeKey = [\n 'ezt_user_id' => $this->ezt_user_id,\n 'image_type' => 2\n ];\n\n return Image::where($compositeKey)->get();\n }", "public function getPicturesInSlider(): PictureCollection;", "public function get_uploaded_header_images()\n {\n }" ]
[ "0.6695556", "0.6511657", "0.5851061", "0.584675", "0.58007216", "0.5646993", "0.5573313", "0.54981416", "0.5433945", "0.5427657", "0.5417266", "0.53894633", "0.5386941", "0.5381477", "0.53778076", "0.5364768", "0.5359612", "0.53527004", "0.5304717", "0.527311", "0.5241324", "0.523159", "0.5211516", "0.520956", "0.51923186", "0.51923186", "0.5173263", "0.51391786", "0.5117696", "0.510803", "0.50922626", "0.50836545", "0.50718224", "0.50691354", "0.50653297", "0.5057486", "0.5056388", "0.5054768", "0.5052259", "0.5051318", "0.50445294", "0.50269026", "0.5025528", "0.5012927", "0.49919274", "0.49861604", "0.49789464", "0.49726948", "0.49702317", "0.4949266", "0.4948067", "0.49397296", "0.4934892", "0.492408", "0.49228108", "0.4920135", "0.49143264", "0.49135956", "0.4911007", "0.49108043", "0.48966417", "0.48951533", "0.48894987", "0.48849013", "0.48746893", "0.48706952", "0.48660877", "0.48609287", "0.48567927", "0.4854274", "0.48541144", "0.4847144", "0.48455793", "0.48418686", "0.48365137", "0.4832943", "0.48327744", "0.48277566", "0.4825159", "0.48238054", "0.48219433", "0.48099753", "0.4803969", "0.48004696", "0.47975093", "0.4796535", "0.47933143", "0.47901294", "0.47844177", "0.4778815", "0.4776255", "0.47728372", "0.47727564", "0.47697407", "0.47677663", "0.47670615", "0.47667152", "0.4765579", "0.47569942", "0.4756937" ]
0.7157424
0
Parse a given string and returns a DOMNode tree. This method must throw a ParsingFailedException if parsing failed in order for the sanitizer to catch it and return an empty string.
public function parse($html);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function parse()\n {\n $parserResolver = new ParserResolver();\n $parserResolver->setXMLElement(new \\SimpleXMLElement($this->xmlString));\n \n $parser = $parserResolver->getParser();\n \n return $parser->parse();\n }", "public static function fromString($string, $c= __CLASS__) {\n $parser= new XMLParser();\n $tree= new $c();\n\n $parser->setCallback($tree);\n $parser->parse($string, 1);\n\n // Fetch actual encoding from parser\n $tree->setEncoding($parser->getEncoding());\n\n delete($parser);\n return $tree;\n }", "protected function string_to_xmlelement(string $string) : \\SimpleXMLElement {\n $tidy = new \\tidy();\n $config = array_merge(Config::$TIDY, [\n 'output-xml' => true,\n 'output-html' => false,\n ]);\n $repaired = $tidy->repairString($string, $config, 'utf8');\n $repaired = str_replace(' xmlns=\"http://www.w3.org/1999/xhtml\"', '', $repaired);\n $repaired = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' . $repaired;\n \n return new \\SimpleXMLElement($repaired);\n }", "function read_xml_string( $str )\n {\n $this->init();\n $this->parser = xml_parser_create($this->encoding);\n xml_set_object( $this->parser, $this );\n xml_set_element_handler( $this->parser, \"_tag_open\", \"_tag_close\" );\n xml_set_character_data_handler( $this->parser, \"_cdata\" );\n xml_parse( $this->parser, $str );\n xml_parser_free( $this->parser );\n }", "public function parseString(?Tree $oldTree, string $string): Tree\n {\n $tree = API::ffi()->ts_parser_parse_string(\n $this->data,\n $oldTree?->data,\n $string,\n strlen($string),\n );\n\n return new Tree($tree);\n }", "public static function parse(string $string): self;", "public function fromString($string)\n {\n if (empty($string)) {\n return [];\n }\n $this->reader = new XMLReader();\n\n $this->reader->xml($string, null, LIBXML_XINCLUDE);\n\n $this->directory = null;\n\n set_error_handler(\n function ($error, $message = '') {\n throw new Exception\\RuntimeException(\n sprintf('Error reading XML string: %s', $message),\n $error\n );\n },\n E_WARNING\n );\n $return = $this->process();\n restore_error_handler();\n $this->reader->close();\n\n return $return;\n }", "abstract public function parse($string);", "public static function xmlParseString($string)\n {\n self::_checkXmlParser();\n\n return @simplexml_load_string($string);\n }", "public static function xmlParseString($string)\n {\n self::_checkXmlParser();\n\n return @simplexml_load_string($string);\n }", "static public function getFromString(){\n set_error_handler(array('\\Draeli\\RssBridge\\Utils', 'set_error_handler'));\n $result = call_user_func_array( array('\\Sunra\\PhpSimple\\HtmlDomParser', 'str_get_html'), func_get_args() );\n restore_error_handler ();\n\n return $result;\n }", "protected function parse($str) {\n return $this->fixture->parse(new StringInputSource($str));\n }", "public function parse($string);", "public function loadString( $string )\n {\n // Use internal error handling to handle XML errors manually.\n $oldXmlErrorHandling = libxml_use_internal_errors( true );\n libxml_clear_errors();\n\n // Load XML document\n $this->document = new DOMDocument();\n $this->document->registerNodeClass( 'DOMElement', 'ezcDocumentPropertyContainerDomElement' );\n\n $this->document->loadXml( $string );\n\n $errors = ( $this->options->failOnError ?\n libxml_get_errors() :\n null );\n\n libxml_clear_errors();\n libxml_use_internal_errors( $oldXmlErrorHandling );\n\n // If there are errors and the error handling is activated throw an\n // exception with the occured errors.\n if ( $errors )\n {\n throw new ezcDocumentErroneousXmlException( $errors );\n }\n }", "private function parseXML($string)\r\n {\r\n $object = simplexml_load_string($string);\r\n return $object;\r\n }", "public function parseString($string) {\n\t\t// Compile file\n\t\t$code = $this->compiler->compileString($string);\n\n\t\t// Buffer\n\t\tob_start();\n\n\t\t// Define a soft handler for undefined variables\n\t\tset_error_handler(function($errno, $errstr, $errfile, $errline) {\n\t\t\techo str_replace(array('Undefined index: ', 'Undefined variable: '), 'WT!', $errstr);\n\t\t}, E_NOTICE);\n\n\t\ttry { // Critical section\n\t\t\t// Adds the php close balise at the begining because it is a whole php file being evaluated\n\t\t\t$eval_result = eval('?>'.$code);\n\t\t} catch (Exception $e) {\n\t\t\t// Just stores the exception into $e to throw it later\n\t\t}\n\n\t\trestore_error_handler();\n\n\t\t$buffer = ob_get_contents();\n\t\tob_end_clean();\n\n\t\t// Throw exception if any\n\t\tif (!empty($e)) {\n\t\t\tthrow $e;\n\t\t} else if ($eval_result === false) {\n\t\t\tthrow new Exception(\"WTemplate::parse(): File $href encountered an error during evaluation :\".$buffer);\n\t\t}\n\n\t\treturn $buffer;\n\t}", "public function testXmlParser() {\n $xmlElement = new SimpleDOM('<?xml version=\"1.0\"?><test/>');\n $xml = $xmlElement->asXML();\n $this->assertNotFalse($xml);\n }", "public static function loadString(string $content, $schemaOrCallable = null): DOMDocument\n {\n if (\\trim($content) === '') {\n throw new InvalidArgumentException('Content does not contain valid XML, it is empty.');\n }\n\n $internalErrors = \\libxml_use_internal_errors(true);\n $disableEntities = \\libxml_disable_entity_loader();\n\n \\libxml_clear_errors();\n\n $dom = new DOMDocument();\n $dom->validateOnParse = true;\n\n if ($dom->loadXML($content, \\LIBXML_NONET | (\\defined('LIBXML_COMPACT') ? \\LIBXML_COMPACT : 0)) === false) {\n \\libxml_disable_entity_loader($disableEntities);\n\n if (\\count($errors = XliffUtils::validateSchema($dom)) !== 0) {\n throw new InvalidArgumentException(self::getErrorsAsString($errors));\n }\n }\n\n $dom->normalizeDocument();\n\n \\libxml_use_internal_errors($internalErrors);\n \\libxml_disable_entity_loader($disableEntities);\n\n foreach ($dom->childNodes as $child) {\n if ($child->nodeType === \\XML_DOCUMENT_TYPE_NODE) {\n throw new InvalidArgumentException('Document types are not allowed.');\n }\n }\n\n if ($schemaOrCallable !== null) {\n self::validateXmlDom($dom, $schemaOrCallable);\n }\n\n \\libxml_clear_errors();\n \\libxml_use_internal_errors($internalErrors);\n\n return $dom;\n }", "function preparse($s) {\n\t$d = DOMDocument::loadXML($s);\n\tforeach ($d->childNodes as $c) {\n\t\tif ($c->nodeType === XML_DOCUMENT_TYPE_NODE) {\n\t\t\t$d->removeChild($c);\n\t\t}\n\t}\n\treturn $d->saveXML();\n}", "function tidy_str($str)\n\t{\n\t\tglobal $_CONFIG;\n\t\tif ($_CONFIG->tidy_html__or(true)) {\n\t\t\t$tidy = new tidy();\n\t\t\t$tidy->parseString($str, $_CONFIG->tidy_config__or(array()));\n\t\t\tif ($tidy->cleanRepair()) {\n\t\t\t\tfb(tidy_get_error_buffer($tidy), 'Tidy Errors');\n\t\t\t\treturn (string)$tidy;\n\t\t\t}\n\t\t}\n\t\treturn $str;\n\t}", "public function loadHTML($string) {\n $input = new HTML5_Inputstream_String($string);\n\n return $this->parse($input);\n }", "public static function fromXml($string)\n {\n $xml = new \\SimpleXMLElement($string);\n\n $data = static::xmlToArray($xml);\n\n return static::decompile($data);\n }", "public function apply($str)\n\t{\n\t\tif (extension_loaded('tidy') && class_exists('tidy'))\n\t\t{\n\t\t\t$config = array(\n\t\t\t\t'doctype' => 'strict',\n\t\t\t\t'drop-proprietary-attributes' => true,\n\t\t\t\t'drop-font-tags' => true,\n\t\t\t\t'escape-cdata' => true,\n\t\t\t\t'indent' => false,\n\t\t\t\t'join-classes' => false,\n\t\t\t\t'join-styles' => true,\n\t\t\t\t'lower-literals' => true,\n\t\t\t\t'output-xhtml' => true,\n\t\t\t\t'show-body-only' => true,\n\t\t\t\t'wrap' => 80\n\t\t\t);\n\t\t\t\n\t\t\t$str = '<p>tt</p>'.$str; // Fixes a big issue\n\t\t\t\n\t\t\t$tidy = new tidy;\n\t\t\t$tidy->parseString($str, $config, 'utf8');\n\t\t\t$tidy->cleanRepair();\n\t\t\t\n\t\t\t$str = (string) $tidy;\n\t\t\t\n\t\t\t$str = preg_replace('#^<p>tt</p>\\s?#','',$str);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$str = $this->miniTidy($str);\n\t\t}\n\t\t\n\t\t# Removing open comments, open CDATA and processing instructions\n\t\t$str = preg_replace('%<!--.*?-->%msu','',$str);\n\t\t$str = str_replace('<!--','',$str);\n\t\t$str = preg_replace('%<!\\[CDATA\\[.*?\\]\\]>%msu','',$str);\n\t\t$str = str_replace('<![CDATA[','',$str);\n\t\t\n\t\t# Transform processing instructions\n\t\t$str = str_replace('<?','&gt;?',$str);\n\t\t$str = str_replace('?>','?&lt;',$str);\n\t\t\n\t\t$str = html::decodeEntities($str,true);\n\t\t\n\t\t$this->content = '';\n\t\txml_parse($this->parser,'<all>'.$str.'</all>');\n\t\treturn $this->content;\n\t}", "function parse($string) {\n return \\Michelf\\Markdown::defaultTransform($string);\n}", "public function loadHTMLFragment($string) {\n $input = new HTML5_Inputstream_String($string);\n\n return $this->parseFragment($input);\n }", "public function parse()\n {\n $root = new SyntaxTreeNode('root');\n $nsMapping = new SyntaxTreeNode('nsMappings');\n $nodeTypes = new SyntaxTreeNode('nodeTypes');\n $root->addChild($nsMapping);\n $root->addChild($nodeTypes);\n\n while (!$this->tokenQueue->isEof()) {\n\n $this->debugSection('PARSER CYCLE');\n\n while ($this->checkToken(Token::TK_SYMBOL, '<')) {\n $nsMapping->addChild($this->parseNamespaceMapping());\n }\n\n if (!$this->tokenQueue->isEof()) {\n $nodeTypes->addChild($this->parseNodeTypeDef());\n }\n\n }\n\n return $root;\n }", "public static function importString($string)\n {\n $dom = new DOMDocument;\n try {\n $dom = Zend_Xml_Security::scan($string, $dom);\n } catch (Zend_Xml_Exception $e) {\n require_once 'Zend/Feed/Exception.php';\n throw new Zend_Feed_Exception(\n $e->getMessage()\n );\n }\n if (!$dom) {\n // Build error message\n $error = libxml_get_last_error();\n if ($error && $error->message) {\n $errormsg = \"DOMDocument cannot parse XML: {$error->message}\";\n } else {\n $errormsg = \"DOMDocument cannot parse XML: Please check the XML document's validity\";\n }\n\n require_once 'Zend/Feed/Exception.php';\n throw new Zend_Feed_Exception($errormsg);\n }\n\n $type = self::detectType($dom);\n\n self::_registerCoreExtensions();\n\n if (substr($type, 0, 3) == 'rss') {\n $reader = new Zend_Feed_Reader_Feed_Rss($dom, $type);\n } elseif (substr($type, 8, 5) == 'entry') {\n $reader = new Zend_Feed_Reader_Entry_Atom($dom->documentElement, 0, Zend_Feed_Reader::TYPE_ATOM_10);\n } elseif (substr($type, 0, 4) == 'atom') {\n $reader = new Zend_Feed_Reader_Feed_Atom($dom, $type);\n } else {\n require_once 'Zend/Feed/Exception.php';\n throw new Zend_Feed_Exception('The URI used does not point to a '\n . 'valid Atom, RSS or RDF feed that Zend_Feed_Reader can parse.');\n }\n return $reader;\n }", "public static function tryParse(string $string): ?self;", "public function parse(string $input);", "public function parse(DOMElement $node);", "function tidy_parse_string($input, $config = null, $encoding = null) {}", "public function testConstructInvalidHTML(string $html)\n {\n (new Dom($html));\n }", "public function parseString( $str ) {\n\t\t\n\t\t$allowed_tags = '<a><b><i><u><em><strong><sup><sub><small>';\n\t\t\n\t\treturn strip_tags( $this->parse($str), $allowed_tags );\n\t\t\n\t}", "public static function is_xml(string $str)\n {\n if ( ! defined('LIBXML_COMPACT'))\n {\n throw new \\Exception('libxml is required to use Str::is_xml()');\n }\n\n $internal_errors = libxml_use_internal_errors();\n libxml_use_internal_errors(true);\n $result = simplexml_load_string($str) !== false;\n libxml_use_internal_errors($internal_errors);\n\n return $result;\n }", "public function sanitize($string)\n {\n $transformer = new SanitizeHTMLTransformer(\n implode(',', $this->htmlTagProvider->getAllowedElements()),\n $this->cacheDir\n );\n\n return $transformer->transform($string);\n }", "protected function parse($string)\n {\n $this->setStringToBeParsed($string);\n\n // save for source map generation\n // $this->env->setFileContent($this->env->currentFileInfo->importedFile->getPath(), $this->input);\n\n $rules = $this->parsePrimary();\n // has the whole string been parsed?\n if ($this->position < $this->length) {\n throw new ILess_Exception_Parser(sprintf('There was an error while parsing the string. Near `%s`.',\n // FIXME: what about utf8?\n substr($this->input, $this->position, strpos($this->input, \"\\n\", $this->position) - $this->position)),\n null, $this->position, $this->env->currentFileInfo);\n }\n\n return $rules;\n }", "public static function importString($string)\n {\n // Load the feed as an XML DOMDocument object\n @ini_set('track_errors', 1);\n $doc = new DOMDocument();\n $success = @$doc->loadXML($string);\n @ini_restore('track_errors');\n\n if (! $success) {\n throw new Zend_Feed_Exception(\"DOMDocument cannot parse XML: $php_errormsg\");\n }\n\n // Try to find the base feed element or a single <entry> of an Atom feed\n if ($doc->getElementsByTagName('feed')->item(0) ||\n $doc->getElementsByTagName('entry')->item(0)) {\n // return a newly created Zend_Feed_Atom object\n return new Zend_Feed_Atom(null, $string);\n }\n\n // Try to find the base feed element of an RSS feed\n if ($doc->getElementsByTagName('channel')->item(0)) {\n // return a newly created Zend_Feed_Rss object\n return new Zend_Feed_Rss(null, $string);\n }\n\n // $string does not appear to be a valid feed of the supported types\n throw new Zend_Feed_Exception('Invalid or unsupported feed format');\n }", "function fix_html($string) {\n // ready our stats\n $this->stats = new tp_parserstats();\n // handler for possible json (buddypress)\n if ($this->might_json) {\n if ($string[0] == '{') {\n $jsoner = json_decode($string);\n if ($jsoner != null) {\n tp_logger(\"json detected (buddypress?)\", 4);\n // currently we only handle contents (which buddypress heavily use)\n if ($jsoner->contents) {\n $jsoner->contents = $this->fix_html($jsoner->contents);\n }\n if ($jsoner->fragments->{'div.widget_shopping_cart_content'}) {\n $jsoner->fragments->{'div.widget_shopping_cart_content'} = $this->fix_html($jsoner->fragments->{'div.widget_shopping_cart_content'});\n }\n if ($jsoner->fragments->{'div.kt-header-mini-cart-refreash'}) {\n $jsoner->fragments->{'div.kt-header-mini-cart-refreash'} = $this->fix_html($jsoner->fragments->{'div.kt-header-mini-cart-refreash'});\n }\n if ($jsoner->fragments->{'a.cart-contents'}) {\n $jsoner->fragments->{'a.cart-contents'} = $this->fix_html($jsoner->fragments->{'a.cart-contents'});\n }\n if ($jsoner->fragments->{'.woocommerce-checkout-review-order-table'}) {\n $jsoner->fragments->{'.woocommerce-checkout-review-order-table'} = $this->fix_html($jsoner->fragments->{'.woocommerce-checkout-review-order-table'});\n }\n if ($jsoner->fragments->{'.woocommerce-checkout-payment'}) {\n $jsoner->fragments->{'.woocommerce-checkout-payment'} = $this->fix_html($jsoner->fragments->{'.woocommerce-checkout-payment'});\n }\n return json_encode($jsoner); // now any attempted json will actually return a json \n }\n }\n }\n\n // create our dom\n $string = str_replace(chr(0xC2) . chr(0xA0), ' ', $string); // annoying NBSPs?\n $this->html = str_get_html($string, false); // false for RSS?\n //$this->stats->do_timing();\n //Log::info(\"Stats Build dom:\" . $this->stats->time);\n // mark translateable elements\n if ($this->html->find('html', 0))\n $this->html->find('html', 0)->lang = ''; // Document defined lang may be preset to correct lang, but should be ignored TODO: Better?\n $this->translate_tagging($this->html->root);\n //$this->stats->do_timing();\n //Log::info(\"Stats Done tagging:\" . $this->stats->time);\n // first fix the html tag itself - we might need to to the same for all such attributes with flipping\n if ($this->html->find('html', 0)) {\n if ($this->dir_rtl)\n $this->html->find('html', 0)->dir = 'rtl';\n else\n $this->html->find('html', 0)->dir = 'ltr';\n }\n\n if ($this->lang) {\n if ($this->html->find('html', 0))\n $this->html->find('html', 0)->lang = $this->lang;\n // add support for <meta name=\"language\" content=\"<lang>\">\n if ($this->html->find('meta[name=language]')) {\n @$this->html->find('meta[name=language]')->content = $this->lang;\n }\n }\n\n // not much point in further processing if we don't have a function that does it\n if ($this->fetch_translate_func == null) {\n return $this->html;\n }\n\n // fix feed\n if ($this->feed_fix) {\n // fix urls on feed\n tp_logger('fixing rss feed', 3);\n foreach (array('link', 'wfw:commentrss', 'comments') as $tag) {\n foreach ($this->html->find($tag) as $e) {\n $e->innertext = htmlspecialchars(call_user_func_array($this->url_rewrite_func, array($e->innertext)));\n // no need to translate anything here\n unset($e->nodes);\n }\n }\n // guid is not really a url -- in some future, we can check if permalink is true and probably falsify it\n foreach ($this->html->find('guid') as $e) {\n $e->innertext = $e->innertext . '-' . $this->lang;\n unset($e->nodes);\n }\n // fix feed language\n @$this->html->find('language', 0)->innertext = $this->lang;\n unset($this->html->find('language', 0)->nodes);\n } else {\n // since this is not a feed, we might have references to such in the <link rel=\"alternate\">\n foreach ($this->html->find('link') as $e) {\n if (strcasecmp($e->rel, 'alternate') == 0 || strcasecmp($e->rel, 'canonical') == 0) {\n if (!$e->hreflang) \n $e->href = call_user_func_array($this->url_rewrite_func, array($e->href));\n }\n }\n }\n\n // try some prefetching... (//todo - maybe move directly to the phrase create)\n// $originals = array();\n if ($this->prefetch_translate_func != null) {\n /* foreach ($this->html->find('text') as $e) {\n foreach ($e->nodes as $ep) {\n if ($ep->phrase) $originals[$ep->phrase] = true;\n }\n }\n foreach (array('title', 'value', 'placeholder', 'alt') as $title) {\n foreach ($this->html->find('[' . $title . ']') as $e) {\n if (isset($e->nodes))\n foreach ($e->nodes as $ep) {\n if ($ep->phrase) $originals[$ep->phrase] = true;\n }\n }\n }\n foreach ($this->html->find('[content]') as $e) {\n foreach ($e->nodes as $ep) {\n if ($ep->phrase) $originals[$ep->phrase] = true;\n }\n } */\n // if we should split, we will split some urls for translation prefetching\n if ($this->split_url_func != null) {\n foreach ($this->atags as $e) {\n foreach (call_user_func_array($this->split_url_func, array($e->href)) as $part) {\n $this->prefetch_phrases[$part] = true;\n }\n }\n foreach ($this->otags as $e) {\n foreach (call_user_func_array($this->split_url_func, array($e->value)) as $part) {\n $this->prefetch_phrases[$part] = true;\n }\n }\n }\n call_user_func_array($this->prefetch_translate_func, array($this->prefetch_phrases, $this->lang));\n }\n\n //fix urls more\n // WORK IN PROGRESS\n /* foreach ($this->atags as $e) {\n $hrefspans = '';\n foreach (call_user_func_array($this->split_url_func, array($e->href)) as $part) {\n // fix - not for dashes\n list ($source, $translated_text) = call_user_func_array($this->fetch_translate_func, array($part, $this->lang));\n $hrefspans .= $this->create_edit_span($part, $translated_text, $source, true);\n }\n $e->href = call_user_func_array($this->url_rewrite_func, array($e->href));\n $e->outertext .= $hrefspans;\n } */\n\n // fix src for items\n if ($this->fix_src_tag_func !== null) {\n foreach ($this->html->find('[src]') as $e) {\n $e->src = call_user_func_array($this->fix_src_tag_func, array($e->src));\n }\n\n foreach ($this->html->find('link') as $e) {\n $e->href = call_user_func_array($this->fix_src_tag_func, array($e->href));\n }\n }\n\n // fix urls...\n foreach ($this->atags as $e) {\n if ($e->href)\n $e->href = call_user_func_array($this->url_rewrite_func, array($e->href));\n }\n foreach ($this->otags as $e) {\n if ($e->value)\n $e->value = call_user_func_array($this->url_rewrite_func, array($e->value));\n }\n\n // this is used to reserve spans we cannot add directly (out of body, metas, etc)\n $hiddenspans = '';\n $savedspan = '';\n\n // actually translate tags\n // texts are first\n foreach ($this->html->find('text') as $e) {\n $replace = array();\n foreach ($e->nodes as $ep) {\n list ($source, $translated_text) = call_user_func_array($this->fetch_translate_func, array($ep->phrase, $this->lang));\n //stats\n $this->stats->total_phrases++;\n if ($translated_text) {\n $this->stats->translated_phrases++;\n if ($source == 0)\n $this->stats->human_translated_phrases++;\n }\n if (($this->is_edit_mode || ($this->is_auto_translate && $translated_text == null))/* && $ep->inbody */) {\n if ($ep->inselect) {\n $savedspan .= $this->create_edit_span($ep->phrase, $translated_text, $source, true, $ep->srclang);\n } elseif (!$ep->inbody) {\n $hiddenspans .= $this->create_edit_span($ep->phrase, $translated_text, $source, true, $ep->srclang);\n } else {\n $translated_text = $this->create_edit_span($ep->phrase, $translated_text, $source, false, $ep->srclang);\n }\n }\n // store replacements\n if ($translated_text) {\n $replace[] = array($translated_text, $ep);\n }\n }\n // do replacements in reverse\n foreach (array_reverse($replace) as $epag) {\n list($replacetext, $epg) = $epag;\n $e->outertext = substr_replace($e->outertext, $replacetext, $epg->start, $epg->len);\n }\n\n // this adds saved spans to the first not in select element which is in the body\n if ($e->nodes && !$ep->inselect && $savedspan && $ep->inbody) { // (TODO: might not be...?)\n $e->outertext = $savedspan . $e->outertext;\n $savedspan = '';\n }\n }\n\n // now we handle the title attributes (and the value of submit buttons)\n $hidden_phrases = array();\n foreach (array('title', 'value', 'placeholder', 'alt') as $title) {\n foreach ($this->html->find('[' . $title . ']') as $e) {\n $replace = array();\n $span = '';\n // when we already have a parent outertext we'll have to update it directly\n if (isset($e->parent->_[HDOM_INFO_OUTER])) {\n $saved_outertext = $e->outertext;\n }\n tp_logger(\"$title-original: $e->$title}\", 4);\n if (isset($e->nodes))\n foreach ($e->nodes as $ep) {\n if ($ep->tag == 'phrase') {\n list ($source, $translated_text) = call_user_func_array($this->fetch_translate_func, array($ep->phrase, $this->lang));\n // more stats\n $this->stats->total_phrases++;\n if ($ep->inbody)\n $this->stats->hidden_phrases++;\n else\n $this->stats->meta_phrases++;\n if ($translated_text) {\n $this->stats->translated_phrases++;\n if ($ep->inbody)\n $this->stats->hidden_translated_phrases++;\n else\n $this->stats->meta_translated_phrases++;\n if ($source == 0)\n $this->stats->human_translated_phrases++;\n }\n if (($this->is_edit_mode || ($this->is_auto_translate && $translated_text == null)) && $ep->inbody) {\n // prevent duplicate translation (title = text)\n if (strpos($e->innertext, $ep->phrase /* Transposh_utils::base64_url_encode($ep->phrase) */) === false) {\n// if (strpos($e->innertext, transposh_utils::base64_url_encode($ep->phrase)) === false) {\n //no need to translate span the same hidden phrase more than once\n if (!in_array($ep->phrase, $hidden_phrases)) {\n $this->stats->hidden_translateable_phrases++;\n $span .= $this->create_edit_span($ep->phrase, $translated_text, $source, true, $ep->srclang);\n // logger ($span);\n $hidden_phrases[] = $ep->phrase;\n }\n }\n }\n // if we need to replace, we store this\n if ($translated_text) {\n $replace[$translated_text] = $ep;\n }\n }\n }\n // and later replace\n foreach (array_reverse($replace, true) as $replace => $epg) {\n $e->$title = substr_replace($e->$title, $replace, $epg->start, $epg->len);\n }\n\n $e->outertext .= $span;\n // this is where we update in the outercase issue\n if (isset($e->parent->_[HDOM_INFO_OUTER])) {\n $e->parent->outertext = implode($e->outertext, explode($saved_outertext, $e->parent->outertext, 2));\n }\n }\n }\n\n // now we handle the meta content - which is simpler because they can't be edited or auto-translated in place\n // we also don't expect any father modifications here\n // so we now add all those spans right before the <body> tag end\n foreach ($this->html->find('[content]') as $e) {\n $right = '';\n $newtext = '';\n\n foreach ($e->nodes as $ep) {\n if ($ep->tag == 'phrase') {\n // even more stats\n $this->stats->total_phrases++;\n $this->stats->meta_phrases++;\n list ($source, $translated_text) = call_user_func_array($this->fetch_translate_func, array($ep->phrase, $this->lang));\n if ($translated_text) {\n $this->stats->translated_phrases++;\n $this->stats->meta_translated_phrases++;\n if ($source == 0)\n $this->stats->human_translated_phrases++;\n list ($left, $right) = explode($ep->phrase, $e->content, 2);\n $newtext .= $left . $translated_text;\n $e->content = $right;\n }\n if ($this->is_edit_mode) {\n $hiddenspans .= $this->create_edit_span($ep->phrase, $translated_text, $source, true, $ep->srclang);\n }\n if (!$translated_text && $this->is_auto_translate && !$this->is_edit_mode) {\n tp_logger('untranslated meta for ' . $ep->phrase . ' ' . $this->lang);\n if ($this->is_edit_mode || $this->is_auto_translate) { // FIX\n }\n }\n }\n }\n if ($newtext) {\n $e->content = $newtext . $right;\n tp_logger(\"content-phrase: $newtext\", 4);\n }\n }\n\n if ($hiddenspans) {\n $body = $this->html->find('body', 0);\n if ($body != null)\n $body->lastChild()->outertext .= $hiddenspans;\n }\n \n // we might show an ad for transposh in some cases\n if (($this->allow_ad && !$this->default_lang && mt_rand(1, 100) > 95) || // 5 of 100 for translated non default language pages\n ($this->allow_ad && $this->default_lang && mt_rand(1, 100) > 99) || // 1 of 100 for translated default languages pages\n (!$this->allow_ad && mt_rand(1, 1000) > 999)) { // 1 of 1000 otherwise\n $this->do_ad_switch();\n }\n \n // This adds a meta tag with our statistics json-encoded inside...\n// $this->stats->do_timing();\n// Log::info(\"Stats Done:\" . $this->stats->time);\n\n $head = $this->html->find('head', 0);\n if ($this->edit_span_created) {\n if ($head != null) {\n $head->lastChild()->outertext .= $this->added_header;\n }\n }\n //exit;\n if ($head != null)\n $head->lastChild()->outertext .= \"\\n<meta name=\\\"translation-stats\\\" content='\" . json_encode($this->stats) . \"'/>\";\n\n // we make sure that the result is clear from our shananigans\n return str_replace(array(TP_GTXT_BRK, TP_GTXT_IBRK, TP_GTXT_BRK_CLOSER, TP_GTXT_IBRK_CLOSER), '', $this->html->outertext);\n // Changed because of places where tostring failed\n //return $this->html;\n //return $this->html->outertext;\n }", "public function checkXmlString($value)\n {\n return new Result(\n $this->canParse($value),\n '{name} must be a valid xml document'\n );\n }", "public function generate_tree($string)\r\n\t{\r\n\t\tunset($this->current);\r\n\t\tunset($this->stack);\r\n\t\t\r\n\t\t$this->current = array();\r\n\t\t$this->stack = array(array('content' => &$this->current));\r\n\t\t\r\n\t\t$this->pre_parse($string);\r\n\t\t\r\n\t\treturn $this->current;\r\n\t}", "public function parse($templateString, $templateIdentifier = null)\n {\n if (!is_string($templateString)) {\n throw new Exception('Parse requires a template string as argument, ' . gettype($templateString) . ' given.', 1224237899);\n }\n try {\n $this->reset();\n\n $templateString = $this->preProcessTemplateSource($templateString);\n\n $splitTemplate = $this->splitTemplateAtDynamicTags($templateString);\n $parsingState = $this->buildObjectTree($splitTemplate, self::CONTEXT_OUTSIDE_VIEWHELPER_ARGUMENTS);\n } catch (Exception $error) {\n throw $this->createParsingRelatedExceptionWithContext($error, $templateIdentifier);\n }\n $this->parsedTemplates[$templateIdentifier] = $parsingState;\n return $parsingState;\n }", "private static function _get_parsed_dom($content) {\n $dom = new DOMDocument();\n libxml_use_internal_errors(TRUE);\n $dom->loadHTML($content);\n $libxml_errors = libxml_get_errors();\n $actual_errors = array();\n foreach ($libxml_errors as $error) {\n if ($error->level == LIBXML_ERR_ERROR || $error->level == LIBXML_ERR_FATAL) {\n $msg = $error->message;\n $line = $error->line;\n self::$error_msg[] = \"HTML Parse Error: $msg (Line $line)\";\n }\n }\n libxml_clear_errors(); // clear error buffer\n if (count($actual_errors) !== 0) {\n return new DOMDocument();\n }\n return $dom;\n }", "function string_parse($string, $data = array(), $return = FALSE)\n\t{\n\t\treturn $this->_parse($string, $data, $return);\n }", "public function parse(string $value);", "function parse($strInputXML) {\n\n\t\t$this->objParser = xml_parser_create();\n\t\txml_set_object($this->objParser, $this);\n\t\txml_set_element_handler($this->objParser, \"tagOpen\", \"tagClosed\");\n\n\t\txml_set_character_data_handler($this->objParser, \"tagData\");\n\n\t\t$this->strXmlData = xml_parse($this->objParser, $strInputXML);\n\t\tif (!$this->strXmlData) {\n\t\t\tdie(sprintf(\"XML error: %s at line %d\",\n\t\t\t\txml_error_string(xml_get_error_code($this->objParser)),\n\t\t\t\txml_get_current_line_number($this->objParser)));\n\t\t}\n\n\t\txml_parser_free($this->objParser);\n\n\t\treturn $this->arrOutput;\n\t}", "function Parse()\n {\n //Create the parser resource\n $this->parser = xml_parser_create(\"UTF-8\");\n \n //Set the handlers\n xml_set_object($this->parser, $this);\n xml_set_element_handler($this->parser, 'StartElement', 'EndElement');\n xml_set_character_data_handler($this->parser, 'CharacterData');\n\n //Error handling\n if (!xml_parse($this->parser, $this->xml))\n $this->HandleError(xml_get_error_code($this->parser), xml_get_current_line_number($this->parser), xml_get_current_column_number($this->parser));\n\n //Free the parser\n xml_parser_free($this->parser);\n }", "public function parse($html)\n {\n $html = ltrim($html);\n\n // Get token position.\n $positionArray = PagstractTokenizer::getPosition($html);\n $this->setLine($positionArray['line']);\n $this->setPosition($positionArray['position']);\n\n // Parse name.\n $this->name = $this->parseElementName($html);\n \n // Parse attributes.\n $remainingHtml = mb_substr($html, mb_strlen($this->name) + ($this->isClosing ? 2 : 1));\n \n while ( (mb_strpos($remainingHtml, '>') !== false) && \n (preg_match(\"/^\\s*[\\/]?>/\", $remainingHtml) === 0) ) {\n $remainingHtml = $this->parseAttribute($remainingHtml);\n }\n\n // Find position of end of tag.\n $posOfClosingBracket = mb_strpos($remainingHtml, '>');\n if ($posOfClosingBracket === false) {\n if ($this->getThrowOnError()) {\n throw new TokenizerException(\n 'Invalid element: missing closing bracket '.\n 'in line: '.$this->getLine().', position: '.$this->getPosition().''\n );\n }\n\n return '';\n }\n\n // Is self-closing?\n $posOfSelfClosingBracket = mb_strpos($remainingHtml, '/>');\n \n $remainingHtml = mb_substr($remainingHtml, $posOfClosingBracket + 1);\n \n if (($posOfSelfClosingBracket !== false) \n && ($posOfSelfClosingBracket == $posOfClosingBracket - 1) \n ) {\n // Self-closing element.\n return $remainingHtml;\n }\n\n \n // Lets close those closed-only elements that are left open.\n $closedOnlyElements = array(\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr'\n );\n if (array_search($this->name, $closedOnlyElements) !== false) {\n return $remainingHtml;\n }\n $nested = $this->nested();\n if (!$nested) { \n return $remainingHtml;\n }\n \n // Open element.\n return $this->parseContents($remainingHtml);\n }", "public function testExceptionThrownWithNestedUnsanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1)\n ];\n $this->parser->parse($tokens);\n }", "public function importXML($xmlString)\n {\n $this->_dom = new \\DOMDocument($this->_version, $this->_encoding);\n $this->_dom->loadXML($xmlString);\n\n $this->_rootNode = $this->_dom->firstChild;\n\n $this->parse();\n }", "public static function isValidXml ($string) {\n try {\n DOMDocument::loadXML($string);\n return true;\n } \n catch (FrameEx $ex) {\n return false;\n }\n }", "protected function parse($str)\n {\n }", "public function parse($str)\r\n\t{\r\n\t\t$str = preg_replace('/[\\r\\n|\\r]/', \"\\n\", $str);\r\n\t\t$len = strlen($str);\r\n\t\t$tag_open = false;\r\n\t\t$tag_text = '';\r\n\t\t$tag = '';\r\n\t\t\r\n\t\t// set the document as the current tag.\r\n\t\t$this->current_tag = $this;\r\n\r\n\t\tfor($i=0; $i<$len; ++$i)\r\n\t\t{\r\n\t\t\tif($str[$i] === '[')\r\n\t\t\t{\r\n\t\t\t\tif($tag_open)\r\n\t\t\t\t\t$tag_text .= '[' . $tag;\r\n\t\t\t\t\r\n\t\t\t\t$tag_open = true;\r\n\t\t\t\t$tag = '';\r\n\t\t\t}\r\n\t\t\telse if($str[$i] === ']' && $tag_open)\r\n\t\t\t{\r\n\t\t\t\tif($tag !== '')\r\n\t\t\t\t{\r\n\t\t\t\t\t$bits = preg_split('/([ =])/', trim($tag), 2, PREG_SPLIT_DELIM_CAPTURE);\r\n\t\t\t\t\t$tag_attrs = (isset($bits[2]) ? $bits[1] . $bits[2] : '');\r\n\t\t\t\t\t$tag_closing = ($bits[0][0] === '/');\r\n\t\t\t\t\t$tag_name = ($bits[0][0] === '/' ? substr($bits[0], 1) : $bits[0]);\r\n\r\n\t\t\t\t\tif(isset($this->bbcodes[$tag_name]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->tag_text($tag_text);\r\n\t\t\t\t\t\t$tag_text = '';\r\n\r\n\t\t\t\t\t\tif($tag_closing)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(!$this->tag_close($tag_name))\r\n\t\t\t\t\t\t\t\t$tag_text = \"[{$tag}]\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(!$this->tag_open($tag_name, $this->parse_attribs($tag_attrs)))\r\n\t\t\t\t\t\t\t\t$tag_text = \"[{$tag}]\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$tag_text .= \"[{$tag}]\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t$tag_text .= '[]';\r\n\t\t\t\t\r\n\t\t\t\t$tag_open = false;\r\n\t\t\t\t$tag = '';\r\n\t\t\t}\r\n\t\t\telse if($tag_open)\r\n\t\t\t\t$tag .= $str[$i];\r\n\t\t\telse\r\n\t\t\t\t$tag_text .= $str[$i];\r\n\t\t}\r\n\t\t\r\n\t\t$this->tag_text($tag_text);\r\n\r\n\t\tif($this->throw_errors && !$this->current_tag instanceof SBBCodeParser_Document)\r\n\t\t\tthrow new SBBCodeParser_MissingEndTagException(\"Missing closing tag for tag [{$this->current_tag->tag()}]\");\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "static function str_get_html($str, $lowercase=true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)\n\t{\n\t\t$dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);\n\t\tif (empty($str) || strlen($str) > MAX_FILE_SIZE)\n\t\t{\n\t\t\t$dom->clear();\n\t\t\treturn false;\n\t\t}\n\t\t$dom->load($str, $lowercase, $stripRN);\n\t\treturn $dom;\n\t}", "public function appendXML($str) {\n if (!parent::appendXML($str)) {\n throw new fDOMException('Appending xml string failed', fDOMException::ParseError);\n }\n return true;\n }", "public function testParsingSanitizedTag()\n {\n $tokens = [\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1),\n ];\n $tagNode = new SanitizedTagNode();\n $tagNode->addChild(new ExpressionNode('foo'));\n $this->ast->getCurrentNode()\n ->addChild($tagNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function getParsedContent(): string\n {\n return $this->XMLTree;\n }", "function parseHTML($url) {\n $html = getHTML($url);\n // php says this is some broken-ass html\n // attemtping to repair enough to make usable\n $dom = handleBrokenHTML($html);\n return simplexml_import_dom($dom);\n}", "public function testExceptionThrownWithNestedSanitizedTag()\n {\n $this->expectException(RuntimeException::class);\n $tokens = [\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_OPEN, '{{', 1),\n new Token(TokenTypes::T_EXPRESSION, 'bar', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1),\n new Token(TokenTypes::T_SANITIZED_TAG_CLOSE, '}}', 1)\n ];\n $this->parser->parse($tokens);\n }", "function parse ($text) {\r\n if ($this->_parsing) {\r\n return false;\r\n }\r\n \r\n // zolex\r\n $text = preg_replace(\"/\\[([^:\\]]+):[^:\\]]*\\]/\", \"[$1]\", $text);\r\n // !zolex\r\n \r\n $this->_parsing = true;\r\n $this->_text = $this->_applyPrefilters ($text);\r\n $this->_output = null;\r\n $this->_length = strlen ($this->_text);\r\n $this->_cpos = 0;\r\n unset ($this->_stack);\r\n $this->_stack = array ();\r\n if (is_object ($this->_root)) {\r\n StringParser_Node::destroyNode ($this->_root);\r\n }\r\n unset ($this->_root);\r\n $this->_root = new StringParser_Node_Root ();\r\n $this->_stack[0] =& $this->_root;\r\n \r\n $this->_parserInit ();\r\n \r\n $finished = false;\r\n \r\n while (!$finished) {\r\n switch ($this->_parserMode) {\r\n case STRINGPARSER_MODE_SEARCH:\r\n $res = $this->_searchLoop ();\r\n if (!$res) {\r\n $this->_parsing = false;\r\n return false;\r\n }\r\n break;\r\n case STRINGPARSER_MODE_LOOP:\r\n $res = $this->_loop ();\r\n if (!$res) {\r\n $this->_parsing = false;\r\n return false;\r\n }\r\n break;\r\n default:\r\n $this->_parsing = false;\r\n return false;\r\n }\r\n \r\n $res = $this->_closeRemainingBlocks ();\r\n if (!$res) {\r\n if ($this->strict) {\r\n $this->_parsing = false;\r\n return false;\r\n } else {\r\n $res = $this->_reparseAfterCurrentBlock ();\r\n if (!$res) {\r\n $this->_parsing = false;\r\n return false;\r\n }\r\n continue;\r\n }\r\n }\r\n $finished = true;\r\n }\r\n \r\n $res = $this->_modifyTree ();\r\n \r\n if (!$res) {\r\n $this->_parsing = false;\r\n return false;\r\n }\r\n \r\n $res = $this->_outputTree ();\r\n \r\n if (!$res) {\r\n $this->_parsing = false;\r\n return false;\r\n }\r\n \r\n if (is_null ($this->_output)) {\r\n $root =& $this->_root;\r\n unset ($this->_root);\r\n $this->_root = null;\r\n while (count ($this->_stack)) {\r\n unset ($this->_stack[count($this->_stack)-1]);\r\n }\r\n $this->_stack = array ();\r\n $this->_parsing = false;\r\n return $root;\r\n }\r\n \r\n $res = StringParser_Node::destroyNode ($this->_root);\r\n if (!$res) {\r\n $this->_parsing = false;\r\n return false;\r\n }\r\n unset ($this->_root);\r\n $this->_root = null;\r\n while (count ($this->_stack)) {\r\n unset ($this->_stack[count($this->_stack)-1]);\r\n }\r\n $this->_stack = array ();\r\n \r\n $this->_parsing = false;\r\n return $this->_output;\r\n }", "protected function parse_inputdata(string $inputdata) {\n /* Convert text to SimpleXmlElement. */\n $xmltext = $this->fix_html_errors_in_string($inputdata);\n $xml = $this->string_to_xmlelement($xmltext);\n $this->fix_xmlelement_errors($xml);\n \n /* Find main tag. */\n $main = $xml;\n if (isset($this->app->config->main))\n $main = $this->xpath_one($xml, $this->app->config->main);\n \n /* Return ref to main tag. */\n return $main;\n }", "protected function pre_parse($string)\r\n\t{\r\n\t\t$preg = preg_match('%([\\w\\W]*?)(<' . $this->tag_prefix . ':([\\w:]+?)(\\s+(?:\\w+\\s*=\\s*(?:\"[^\"]*?\"|\\'[^\\']*?\\')\\s*)*|)>|</' . $this->tag_prefix . ':([\\w:]+?)\\s*>)([\\w\\W]*)%', $string, $data);\r\n\t\t\r\n\t\t// actually faster with recursion instead of a while loop\r\n\t\tif ($preg)\r\n\t\t{\r\n\t\t\tlist(, $pre_match, $match, $start_tag, $args, $end_tag, $post_match) = $data;\r\n\t\t\t$this->current[] = $pre_match;\r\n\t\t\t\r\n\t\t\tif($start_tag)\r\n\t\t\t{\r\n\t\t\t\t// create new block\r\n\t\t\t\t$data = array(\r\n\t\t\t\t\t'name' => $start_tag,\r\n\t\t\t\t\t'args' => $this->parse_args($args),\r\n\t\t\t\t\t'content' => array()\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\t// add it to the tree\r\n\t\t\t\t$this->current[] =& $data;\r\n\t\t\t\t$this->stack[] =& $data;\r\n\t\t\t\t\r\n\t\t\t\t// move deeper\r\n\t\t\t\t$this->current =& $data['content'];\r\n\t\t\t\t\r\n\t\t\t\t// continue parsing\r\n\t\t\t\t$this->pre_parse($post_match);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// close the current block\r\n\t\t\t\tunset($this->current);\r\n\t\t\t\t$tmp =& array_pop($this->stack);\r\n\t\t\t\t\r\n\t\t\t\tif($end_tag == $tmp['name'])\r\n\t\t\t\t{\r\n\t\t\t\t\t// move up in the tree\r\n\t\t\t\t\t$parent =& $this->stack[count($this->stack) - 1];\r\n\t\t\t\t\t$this->current =& $parent['content'];\r\n\t\t\t\t\t\r\n\t\t\t\t\t// continue parsing\r\n\t\t\t\t\t$this->pre_parse($post_match);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new RuntimeException('Missing End tag for \"'.$end_tag.'\"');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->current[] = $string;\r\n\t\t}\r\n\t}", "function &fromXmlString($data, $state, $file, $archive = false)\n {\n if (preg_match('/<package[^>]+version=[\\'\"]([0-9]+\\.[0-9]+)[\\'\"]/', $data, $packageversion)) {\n if (!in_array($packageversion[1], array('1.0', '2.0', '2.1'))) {\n return PEAR::raiseError('package.xml version \"' . $packageversion[1] .\n '\" is not supported, only 1.0, 2.0, and 2.1 are supported.');\n }\n\n $object = &$this->parserFactory($packageversion[1]);\n if ($this->_logger) {\n $object->setLogger($this->_logger);\n }\n\n $object->setConfig($this->_config);\n $pf = $object->parse($data, $file, $archive);\n if (PEAR::isError($pf)) {\n return $pf;\n }\n\n if ($this->_rawReturn) {\n return $pf;\n }\n\n if (!$pf->validate($state)) {;\n if ($this->_config->get('verbose') > 0\n && $this->_logger && $pf->getValidationWarnings(false)\n ) {\n foreach ($pf->getValidationWarnings(false) as $warning) {\n $this->_logger->log(0, 'ERROR: ' . $warning['message']);\n }\n }\n\n $a = PEAR::raiseError('Parsing of package.xml from file \"' . $file . '\" failed',\n 2, null, null, $pf->getValidationWarnings());\n return $a;\n }\n\n if ($this->_logger && $pf->getValidationWarnings(false)) {\n foreach ($pf->getValidationWarnings() as $warning) {\n $this->_logger->log(0, 'WARNING: ' . $warning['message']);\n }\n }\n\n if (method_exists($pf, 'flattenFilelist')) {\n $pf->flattenFilelist(); // for v2\n }\n\n return $pf;\n } elseif (preg_match('/<package[^>]+version=[\\'\"]([^\"\\']+)[\\'\"]/', $data, $packageversion)) {\n $a = PEAR::raiseError('package.xml file \"' . $file .\n '\" has unsupported package.xml <package> version \"' . $packageversion[1] . '\"');\n return $a;\n } else {\n if (!class_exists('PEAR_ErrorStack')) {\n require_once 'PEAR/ErrorStack.php';\n }\n\n PEAR_ErrorStack::staticPush('PEAR_PackageFile',\n PEAR_PACKAGEFILE_ERROR_NO_PACKAGEVERSION,\n 'warning', array('xml' => $data), 'package.xml \"' . $file .\n '\" has no package.xml <package> version');\n $object = &$this->parserFactory('1.0');\n $object->setConfig($this->_config);\n $pf = $object->parse($data, $file, $archive);\n if (PEAR::isError($pf)) {\n return $pf;\n }\n\n if ($this->_rawReturn) {\n return $pf;\n }\n\n if (!$pf->validate($state)) {\n $a = PEAR::raiseError('Parsing of package.xml from file \"' . $file . '\" failed',\n 2, null, null, $pf->getValidationWarnings());\n return $a;\n }\n\n if ($this->_logger && $pf->getValidationWarnings(false)) {\n foreach ($pf->getValidationWarnings() as $warning) {\n $this->_logger->log(0, 'WARNING: ' . $warning['message']);\n }\n }\n\n if (method_exists($pf, 'flattenFilelist')) {\n $pf->flattenFilelist(); // for v2\n }\n\n return $pf;\n }\n }", "private function cleanForXML($string)\n {\n $string = strip_tags($string);\n $string = htmlentities($string, ENT_QUOTES, \"UTF-8\");\n $string = preg_replace(\"/&#?[a-z0-9]{2,8};/i\", \"\", $string);\n return $string;\n }", "private function cleanForXML($string)\n {\n $string = strip_tags($string);\n $string = htmlentities($string, ENT_QUOTES, \"UTF-8\");\n $string = preg_replace(\"/&#?[a-z0-9]{2,8};/i\", \"\", $string);\n return $string;\n }", "static public function parse($str)\n {\n $str = preg_replace(\n array(\n '/\\s*\\[quote\\]\\s*/m',\n '/\\s*\\[\\/quote\\]\\s*/m',\n '/(?:\\r?\\n){3,}/'\n ),\n array(\n \"\\n\\n[quote]\\n\\n\",\n \"\\n\\n[/quote]\\n\\n\",\n \"\\n\\n\"\n )\n , $str);\n $str = trim($str);\n $blocks = preg_split('/(?:\\r?\\n){2}/', $str);\n \n $html = array_map(function($block) {\n if (preg_match('/^(h[1-6])\\.\\s*(.+)$/', $block, $m)) {\n $tag = $m[1];\n $content = $m[2];\n return '<'.$tag.'>' . DText::parse_inline($content) . '</'.$tag.'>';\n } elseif (preg_match('/^\\s*\\*+ /', $block))\n return DText::parse_list($block);\n elseif ($block == '[quote]')\n return '<blockquote>';\n elseif ($block == '[/quote]')\n return '</blockquote>';\n else {\n return '<p>' . DText::parse_inline($block) . '</p>';\n }\n }, $blocks);\n \n return implode('', $html);\n }", "function Failed(){\n return new Parser(function($s){return new Maybe(null);});\n }", "function handleBrokenHTML($html) {\n $old = libxml_use_internal_errors(true);\n $dom = new DOMDocument;\n $dom->loadHTML($html);\n libxml_use_internal_errors($old);\n return $dom;\n}", "public function toString($parse = true)\n {\n $doc = $this->getDocument($parse);\n $str = $doc->saveXML($doc->documentElement);\n // Cleanup Document\n if (substr($str, 0, 5) == '<?xml') { // Remove xml declaration\n $str = substr($str, strpos($str, \"\\n\") + 1);\n }\n if ($this->isHtml5 && strtolower(substr($str, 0, 15)) != '<!doctype html>') {\n $str = \"<!DOCTYPE html>\\n\" . $str;\n }\n // fix allowable non closeable tags\n $str = preg_replace_callback('#<(\\w+)([^>]*)\\s*/>#s', \n function ($m) {\n $xhtml_tags = array(\"br\", \"hr\", \"input\", \"frame\", \"img\", \"area\", \"link\", \"col\", \"base\", \"basefont\", \"param\", \"meta\");\n return in_array($m[1], $xhtml_tags) ? \"<$m[1]$m[2] />\" : \"<$m[1]$m[2]></$m[1]>\";\n }, $str );\n \n if ($this->cdataRemove)\n $str = str_replace(array('><![CDATA[', ']]><'), array('>', '<'), $str);\n if ($this->newlineReplace)\n $str = preg_replace ('/\\s+$/m', \"\\n\", $str);\n \n return $str;\n }", "public static function parse(){\n self::$time_start = self::time();\n if(self::$state != self::STATE_READY){\n self::$error = 'Parser is not in a ready stage, current state: '.self::$state;\n self::$state = self::STATE_ERROR;\n return false;\n }\n if(self::$body == ''){\n self::$state = self::STATE_ERROR;\n self::$error = 'Body is empty';\n return false;\n }\n self::$state = self::STATE_ACTIVE;\n \n $run = true;\n while($run){\n $found = false;\n $find_open = strpos(self::$body, PARSER_OPEN_TOKEN);\n if($find_open !== false){\n $find_close = strpos(self::$body, PARSER_CLOSE_TOKEN, $find_open);\n if($find_close !== false){\n $found = true;\n $tag = substr(self::$body, $find_open, (($find_close-$find_open)+strlen(PARSER_CLOSE_TOKEN)) );\n $content = self::parse_tag($tag);\n self::$body = str_replace($tag, $content, self::$body);\n }\n }\n if(!$found){\n $run = false;\n }\n }\n self::$state = self::STATE_PARSED;\n self::time_exec();\n }", "function parseToXML($htmlStr){ \n\t\t$xmlStr=str_replace('<','&lt;',$htmlStr); \n\t\t$xmlStr=str_replace('>','&gt;',$xmlStr); \n\t\t$xmlStr=str_replace('\"','&quot;',$xmlStr); \n\t\t$xmlStr=str_replace(\"'\",'&#39;',$xmlStr); \n\t\t$xmlStr=str_replace(\"&\",'&amp;',$xmlStr); \n\treturn $xmlStr; \n}", "public function parse(string $content);", "public function parse(string $content);", "public static function parse_str($str)\n {\n }", "public function testXmlString()\n {\n $dom = Dom::createFromString(file_get_contents(self::$fixture.'books.xml'));\n $this->assertInstanceOf(DOMDocument::class, $dom);\n $this->assertEquals('catalog', $dom->documentElement->localName);\n }", "protected function dom_init() {\r\n\t\t\r\n\t\t// severe hack!\r\n\t\t//$this->code = preg_replace(' xmlns=\"[^\"]*?\"', '', $this->code);\r\n\t\t/*print('XXX9o9beep19o9XXX\r\n');\r\n\t\tprint('$this->code in dom_init: ' . $this->code);\r\n\t\tprint('\r\nXXX9o9beep29o9XXX\r\n');*/\r\n\t\tif($this->dom) {\r\n\t\t\treturn $this->xpath_init();\r\n\t\t}\r\n\t\tif($this->xpath) {\r\n\t\t\t$this->xpath = false;\r\n\t\t}\r\n\t\t// HTML5?\r\n\t\tif($this->config['use_local_DTD']) {\r\n\t\t\tpreg_match('/(<!DOCTYPE\\s*html\\s*PUBLIC\\s*\"[^\"]*\"\\s*\")([^\"]*)(\">)/is', $this->code, $matches);\r\n\t\t\t$this->temp_DTD_file = $matches[2];\r\n\t\t\t$this->code = str_replace($matches[1] . $matches[2] . $matches[3], $matches[1] . DTD::getDTDfile() . $matches[3], $this->code);\r\n\t\t}\r\n\t\t//print('this->config[\\'encoding\\'] 1: ');var_dump($this->config['encoding']);\r\n\t\t//ReTidy::updateEncoding();\r\n\t\t//ReTidy::convert_to($this->config['encoding']);\r\n\t\t//print('this->config[\\'encoding\\'] 2: ');var_dump($this->config['encoding']);\r\n\t\t//$this->dom = new DOMDocument('1.0', $this->config['encoding']);\r\n\t\t//$this->dom = new DOMDocument('1.0', $this->config['encoding']);\r\n\t\t$this->dom = new DOMDocument('1.0', 'utf-8');\r\n\t\tif(!$this->dom) {\r\n\t\t\t$this->logMsg(self::$lang['dom_init_error']);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$this->dom->resolveExternals = true;\r\n\t\t\r\n\t\t//$this->dom->preserveWhiteSpace = false;\r\n\t\tif(!$this->dom->loadXML($this->code)) {\r\n\t\t\t$this->dom->loadHTML($this->code);\r\n\t\t}\r\n\t\t//$this->dom->formatOutput = true;\r\n\t\t//if(isset($this->config['encoding'])) {\r\n\t\t//\t// this should be set by cleanCode\r\n\t\t//\t$this->dom->encoding = $this->config['encoding'];\r\n\t\t//} else {\r\n\t\t//\t$this->dom->encoding = 'iso-8859-1';\r\n\t\t//}\r\n\r\n\t\t$this->logMsg('dom_init = true');\r\n\t\treturn $this->xpath_init();\r\n\t}", "public function testHtml5String()\n {\n $dom = Dom::createFromString(file_get_contents(self::$fixture.'html5.html'));\n $this->assertInstanceOf(DOMDocument::class, $dom);\n $this->assertEquals('html', $dom->documentElement->localName);\n $this->assertEquals('http://www.w3.org/1999/xhtml', $dom->documentElement->namespaceURI);\n $this->assertTrue($dom->documentElement->isDefaultNamespace('http://www.w3.org/1999/xhtml'));\n }", "function parseXML() {\r\n\t\t$xmlString = getFileStr();\r\n\r\n\t\tif (!strstr($xmlString, \"<?xml version='1.0' ?>\")) {\r\n\t\t\tparseBin();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$xmlParser = xml_parser_create();\r\n\t\txml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, FALSE);\r\n\t\txml_set_element_handler($xmlParser, \"startElement\", \"endElement\");\r\n\r\n\t\txml_parse($xmlParser, $xmlString);\r\n\t\txml_parser_free($xmlParser);\r\n\r\n\t\txmlToObj();\r\n\t}", "public function testParsingUnsanitizedTag()\n {\n $tokens = [\n new Token(TokenTypes::T_UNSANITIZED_TAG_OPEN, '{{!', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_UNSANITIZED_TAG_CLOSE, '!}}', 1),\n ];\n $tagNode = new UnsanitizedTagNode();\n $tagNode->addChild(new ExpressionNode('foo'));\n $this->ast->getCurrentNode()\n ->addChild($tagNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function testThrowsExceptionOnInvalidReport()\n {\n $parser = new Parser($this->createTwig(), \"This is an invalid string\");\n }", "public function str_get_html($str, $lowercase = true, $forceTagsClosed = true, $target_charset = 'UTF-8', $stripRN = true, $defaultBRText = \"\\r\\n\", $defaultSpanText = \" \") {\n $dom = new \\simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);\n if (empty($str) || strlen($str) > 600000) {\n $dom->clear();\n return false;\n }\n $dom->load($str, $lowercase, $stripRN);\n return $dom;\n }", "public function toDomElement(DOMDocument $document): DOMElement\n {\n $element = $document->createElement('error');\n $element->appendChild($document->createElement('summary', $this->getSummary()));\n\n // Optional\n if (! empty($this->getDetail())) {\n $element->appendChild($document->createElement('detail', $this->getDetail()));\n }\n\n return $element;\n }", "static public function loadString($sXml)\n\t{\n\t\t// Enable user error handling (disables libxml error handling, which can cause fatals)\n\t\tlibxml_use_internal_errors(true);\n\n\t\t$oSimpleXMLElement = simplexml_load_string($sXml);\n\n\t\tstatic::handleErrors();\n\n\t\t// Return SimpleXMLElement.\n\t\treturn $oSimpleXMLElement;\n\t}", "public function parse_as_nested($string, $php_data = FALSE)\r\n\t{\r\n\t\t// unset the current parser, so we won't interfere and maybe replace it\r\n\t\t$tmp = $this->context->parser;\r\n\t\tunset($this->context->parser);\r\n\r\n\t\t$parser = new FTL_Parser(array\r\n\t\t(\r\n\t\t\t'context' => $this->context,\r\n\t\t\t'tag_prefix' => $tmp->tag_prefix,\r\n\t\t\t'php_data' => $php_data\r\n\t\t));\r\n\r\n\t\t$str = $parser->parse($string, $php_data);\r\n\t\t\r\n\t\t// reset\r\n\t\t$this->context->parser = $tmp;\r\n\t\t\r\n\t\treturn $str;\r\n\t}", "function parseToXML($htmlStr)\n{\n$xmlStr=str_replace('<','&lt;',$htmlStr);\n$xmlStr=str_replace('>','&gt;',$xmlStr);\n$xmlStr=str_replace('\"','&quot;',$xmlStr);\n$xmlStr=str_replace(\"'\",'&#39;',$xmlStr);\n$xmlStr=str_replace(\"&\",'&amp;',$xmlStr);\nreturn $xmlStr;\n}", "public function parse(): PhpCss\\Ast\\Node {\n }", "public function parseStringEncoding(?Tree $oldTree, string $string, InputEncoding $encoding): Tree\n {\n return API::ffi()->ts_parser_parse_string_encoding($this->data, $oldTree, $string, strlen($string));\n }", "private function parse()\n {\n $this->parseChildrenNodes($this->_dom, $this->_rootNode);\n }", "function create_parser() {}", "private function _parse($uriString)\n {\n //Having all properties in the constructor sucks as well, when they\n //are all strings anyways. So we rather take the parse_url overhead\n\n $parsed = parse_url($uriString);\n\n if (!is_array($parsed))\n throw new \\InvalidArgumentException(\n \"Passed URI string doesn't seem to be a valid URI\"\n );\n\n $parts = array_replace([\n 'scheme' => null,\n 'user' => null,\n 'pass' => null,\n 'host' => null,\n 'port' => null,\n 'path' => null,\n 'query' => null,\n 'fragment' => null\n ], $parsed);\n\n $this->_scheme = !empty($parts['scheme'])\n ? strtolower($parts['scheme'])\n : null;\n $this->_user = $parts['user'];\n $this->_password = $parts['password'];\n $this->_host = !empty($parts['host'])\n ? strtolower($parts['host'])\n : null;\n $this->_port = !empty($parts['port'])\n ? intval($parts['port'])\n : null;\n $this->_path = $parts['path'];\n $this->_query = $parts['query'];\n $this->_fragment = $parts['fragment'];\n }", "public function parseFromXml($strXml)\n {\n throw new OssException(\"Not implemented.\");\n }", "public static function simple(String $data)\n {\n $data = preg_replace('/<xml(.*?)>/', '', $data);\n\n return uselib('SimpleXMLElement', [$data]);\n }", "public function xmlToArray( $string )\n {\n\n $doc = new DOMDocument();\n $doc->loadXML( $string );\n $root = $doc->documentElement;\n\n return $this->DomNodeToArray( $root );\n }", "public function executeDom()\n {\n $xml = $this->execute();\n\n // create new DOMDocument and load the response text.\n $dom = new \\DOMDocument();\n $dom->loadXML($xml);\n\n return $dom;\n }", "public function isValidHtml($string) \n\t{\n\t\t$start = strpos($string, '<');\n\t\t$end = strrpos($string, '>',$start);\n\n\t\t$len=strlen($string);\n\t\t\n\t\tif ($end !== false) {\n\t\t\t$string = substr($string, $start);\n\t\t} else {\n\t\t\t$string = substr($string, $start, $len-$start);\n\t\t}\n\t\t\n\t\tlibxml_use_internal_errors(true);\n\t\tlibxml_clear_errors();\n\t\t$xml = simplexml_load_string($string);\n\t\t\n\t\treturn count(libxml_get_errors())==0;\n\t}", "public function read($string)\n\t{\n\t\tif ( ! is_string($string)) {\n\t\t\tthrow new \\InvalidArgumentException(\n\t\t\t\t__METHOD__.\"() expects parameter one, string, to be a string\"\n\t\t\t);\t\n\t\t}\n\t\t\n\t\t// fake the snippet as a \"root\" group\n\t\t$string = '{'.$string.'}';\n\t\t\n\t\t// instantiate the string's chunker and stream\n\t\t$chunker = new \\Jstewmc\\Chunker\\Text($string);\n\t\t$stream = new \\Jstewmc\\Stream\\Stream($chunker);\t\n\t\t\n\t\t// lex the stream\n\t\t$tokens = (new Lexer())->lex($stream);\n\t\t\n\t\t// parse and render the tokens\n\t\t$group = (new Renderer())->render((new Parser())->parse($tokens));\n\t\t\n\t\t// set the snippet's properties from the group\n\t\t$this->parent = null;\n\t\t$this->children = $group->getChildren();\n\t\t$this->style = $group->getStyle();\n\t\t$this->isRendered = true;\n\t\t\n\t\treturn (bool) $group;\n\t}", "public function getString()\n {\n if (!$name = strtolower(trim($this->name))) {\n throw new \\InvalidArgumentException('请设置标签元素的名称!');\n }\n\n $attrString = $this->getAttrs(true);\n $content = $this->_handleChildAndContent();\n\n $eleString = sprintf(\"\\n<{$name}%s>%s\", $attrString, $content);\n $eleString .= $this->isAloneTag($name) ? \"\\n\" : \"</{$name}>\\n\";\n\n // has parent\n if ($parent = $this->parent) {\n\n if ($this->isAloneTag($parent->name)) {\n throw new \\InvalidArgumentException('不能设置单标签元素 ' . $parent->name . '为父元素!');\n }\n\n $parent->setContent($eleString);\n $eleString = $parent->getString();\n }\n\n unset($name, $attrString, $content, $parent);\n\n return $eleString;\n }", "function loadString($s)\n{\n\t$templ = $this->parser->parse($s);\t\n\t$this->elements = $templ[0];\n\t$this->document = $templ[1];\n}", "public function fromString(string $string);", "public static function tryParse(?string $str): ?self\n {\n return self::all()->first(\n fn (self $r) => $r->code === $str || (string)$r->value === $str\n );\n }", "public function parse(string $string): array;", "function isStr($str) {\n return new Parser(function($s) use($str){\n $cnt = strlen($str);\n $cmp = substr($s, 0, $cnt);\n if(!$cmp or $cmp === \"\") {\n return new Maybe(null);\n } else {\n if($str !== $cmp){\n return new Maybe(null);\n } else {\n return new Maybe(new Tuple(substr($s, $cnt), $str));\n }\n }\n });\n }" ]
[ "0.57187355", "0.54517233", "0.5328172", "0.53069144", "0.53008246", "0.5285999", "0.5256355", "0.52395767", "0.52389276", "0.52389276", "0.52331984", "0.5211894", "0.5162238", "0.5115577", "0.5109923", "0.5071678", "0.5058049", "0.50428796", "0.50325835", "0.501811", "0.5012769", "0.49948296", "0.496542", "0.49112648", "0.49057934", "0.4904672", "0.48829028", "0.48776504", "0.4767897", "0.47296447", "0.472413", "0.47110838", "0.46987778", "0.46907428", "0.46871117", "0.4655551", "0.46136782", "0.46117043", "0.45977008", "0.45782882", "0.45664737", "0.45548034", "0.45538434", "0.45489782", "0.45479736", "0.4531156", "0.451906", "0.45160252", "0.45085257", "0.45005602", "0.44850793", "0.44834402", "0.44583163", "0.44509837", "0.4450756", "0.44314602", "0.44205675", "0.44088715", "0.4399979", "0.43967763", "0.43930906", "0.4388766", "0.43812612", "0.43812612", "0.43811813", "0.43717492", "0.43693602", "0.43685284", "0.43681228", "0.43640167", "0.43554175", "0.43554175", "0.43549618", "0.43531668", "0.43489188", "0.43324822", "0.43282348", "0.4323128", "0.43177447", "0.4316011", "0.43112284", "0.42946663", "0.42908302", "0.4278785", "0.42730114", "0.4271382", "0.42664182", "0.42640573", "0.42638615", "0.42551774", "0.42511654", "0.42462006", "0.42431304", "0.4233914", "0.4230837", "0.42285457", "0.42285454", "0.4228172", "0.4213903", "0.42108113", "0.42058247" ]
0.0
-1
Run the database seeds.
public function run() { DB::table('users')->delete(); User::create([ 'id'=> '1', 'content'=> '曲项向天歌,白毛浮绿水,红掌拨清波', 'is_top'=> '0', 'times'=>'1', ],[ 'id'=> '2', 'content'=> '春眠不觉晓,处处闻啼鸟', 'is_top'=> '0', 'times'=>'2', ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }", "public function isAuthorized() {}", "public function authorize()\n {\n return request()->loggedin_role === 1;\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized() {\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return \\Auth::check() ? true : false;\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function isAuthorized() {\n\t\t\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }", "public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }", "public function authorize()\n {\n return $this->auth->check();\n }", "public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function isAuthorized($request) {\n return true;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return TRUE;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }", "public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\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 authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }" ]
[ "0.8399528", "0.83755803", "0.83755803", "0.8342532", "0.8252005", "0.8246491", "0.82114965", "0.81451535", "0.81095713", "0.80819905", "0.799094", "0.79885143", "0.79823685", "0.7959513", "0.7950321", "0.7947592", "0.7925319", "0.7914417", "0.7899287", "0.7892423", "0.788904", "0.7888573", "0.7859566", "0.7840388", "0.7840388", "0.7837057", "0.7822922", "0.78116244", "0.7807664", "0.7791735", "0.7785959", "0.77811456", "0.77799726", "0.7762375", "0.7753727", "0.7719034", "0.7719034", "0.771513", "0.77119666", "0.77024996", "0.7692876", "0.76920134", "0.76908916", "0.7689253", "0.7672893", "0.7666128", "0.7665256", "0.76551706", "0.76500374", "0.76414853", "0.7641037", "0.7640742", "0.763345", "0.7629214", "0.7628391", "0.76269794", "0.76197463", "0.76197463", "0.76123273", "0.7602711", "0.7602425", "0.76015925", "0.76015925", "0.76007396", "0.7597639", "0.75951606", "0.7587452", "0.7584679", "0.7579657", "0.7562462", "0.7552138", "0.7551783", "0.75504583", "0.754368", "0.7541822", "0.75382096", "0.75371224", "0.75285393", "0.75156033", "0.7512623", "0.7499459", "0.74951875", "0.7494698", "0.74913925", "0.74869126", "0.7486122", "0.74787915", "0.7476152", "0.7471878", "0.7470218", "0.7464096", "0.74636215", "0.7463019", "0.74618673", "0.74608135", "0.7448682", "0.74387354", "0.743482", "0.74337745", "0.74311817", "0.7422809" ]
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ 'title' => 'required|min:4|max:300', 'campana' => 'required', 'fecha' => 'required', 'color' => 'required', 'time' => 'required', 'colortitulos' => 'required', 'colorcontenido' => 'required', ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public function getRules()\n {\n return $this->validation_rules;\n }", "public function getValidationRules()\n {\n return [];\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }", "public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }", "public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }", "public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }", "protected function getValidRules()\n {\n return $this->validRules;\n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }", "public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n { \n return $this->rules;\n }", "public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }", "public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }", "public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }", "public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n return static::$rules;\n }", "function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}", "public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }", "public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "abstract protected function getValidationRules();", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }", "public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }", "public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }", "public function rules()\n {\n\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }", "public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }", "public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }", "public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }", "public function getValidationRules() : array;", "public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }", "public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }", "public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }", "public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }", "public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }", "protected function get_validation_rules()\n {\n }", "public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }", "public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules(Request $request)\n {\n return Qc::$rules;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }", "public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }" ]
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7675849", "0.76724476", "0.76665044", "0.7657698", "0.7641827", "0.7630892", "0.76293766", "0.7617708", "0.76102096", "0.7607475", "0.7602442", "0.7598732", "0.7597544", "0.75924", "0.75915384", "0.7588146", "0.7581354", "0.7555758", "0.755526", "0.7551423", "0.7546329", "0.7541439", "0.75366044", "0.75363225", "0.7530296", "0.7517988", "0.75155175", "0.7508439", "0.75069886", "0.7505724", "0.749979", "0.7495976", "0.74949056", "0.7492888", "0.7491117", "0.74901396", "0.7489651", "0.7486808", "0.7486108", "0.7479687", "0.7478561", "0.7469412", "0.74635684", "0.74619836", "0.7461325", "0.74591017", "0.7455279", "0.745352", "0.7453257", "0.7449877", "0.74486", "0.7441391", "0.7440429", "0.7435489", "0.7435326", "0.74341524", "0.7430354", "0.7429103", "0.7423808", "0.741936", "0.74152505", "0.7414828", "0.741382", "0.74126065", "0.74105227", "0.740555", "0.7404385", "0.74040926", "0.74015605", "0.73905706", "0.73837525", "0.73732615", "0.7371123", "0.7369176", "0.73619753", "0.73554605", "0.73448825", "0.7344659", "0.73427117", "0.73357755" ]
0.0
-1
Run the database seeds.
public function run() { //Se ingresan los primeras profesiones. DB::table('professions')->insert([ 'title'=>'Desarrollador - BackEnd', ]); DB::table('professions')->insert([ 'title'=>'Desarrollador - FrontEnd', ]); DB::table('professions')->insert([ 'title'=>'Desarrollador - DiseñadorWEB', ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
TODO A voir ?
public function upload(RegistryInterface $doctrine) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "public function AggiornaPrezzi(){\n\t}", "private function _i() {\n }", "public function serch()\n {\n }", "abstract public function getPasiekimai();", "public function boleta()\n\t{\n\t\t//\n\t}", "public function masodik()\n {\n }", "public function obtener()\n {\n }", "public function nadar()\n {\n }", "public function __init(){}", "private function __construct()\t{}", "final function velcom(){\n }", "private function __construct () {}", "public function ogs()\r\n {\r\n }", "public function elso()\n {\n }", "final private function __construct(){\r\r\n\t}", "private function __() {\n }", "protected function __init__() { }", "private function __construct() {\r\n\t\t\r\n\t}", "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 custom()\n\t{\n\t}", "private function __construct() {\r\n\t\r\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "private function __construct()\r\n {\r\n }", "private function __construct()\r\n {\r\n }", "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() {}" ]
[ "0.5916912", "0.59140253", "0.57476854", "0.5641819", "0.5637305", "0.56211185", "0.55811477", "0.5572063", "0.55565256", "0.5538672", "0.55300677", "0.5506529", "0.5502241", "0.5498927", "0.548769", "0.5486198", "0.5478459", "0.5467363", "0.54562503", "0.5419758", "0.5419758", "0.5419758", "0.5419758", "0.5419758", "0.5419758", "0.5419758", "0.5419758", "0.5419758", "0.5419758", "0.5419758", "0.5419758", "0.5419758", "0.5419758", "0.5419758", "0.5419758", "0.5419758", "0.54179186", "0.5400237", "0.53842896", "0.53842896", "0.53842896", "0.53842896", "0.53842896", "0.53823537", "0.53823537", "0.5378185", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195", "0.53769195" ]
0.0
-1
Seed the application's database.
public function run() { // $this->call(UsersTableSeeder::class); for ($i = 0; $i < 5; $i++) { $user = factory(User::class)->create(); factory(Event::class, rand(1, 10))->create(['user_id' => $user->id])->each(function ($event) use ($user) { factory(Comment::class, rand(1, 5))->make()->each(function ($comment) use ($user, $event) { $comment->user_id = $user->id; $comment->event_id = $event->id; $event->comments()->save($comment); }); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function dbSeed(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Turn foreign key checks off\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0;');// <- USE WITH CAUTION!\n\t\t\t//Seed tables\n\t\t\tArtisan::call('db:seed');\n\t\t\t//Turn foreign key checks on\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=1;');// <- SHOULD RESET ANYWAY BUT JUST TO MAKE SURE!\n\t\t}\n\t}", "protected function seedDB()\n {\n $ans = $this->ask('Seed your database?: ', 'y');\n\n // Check if the answer is true\n if (preg_match('/^y/', $ans))\n {\n $this->call('db:seed');\n $this->comment('');\n $this->comment('Database successfully seeded.');\n $this->comment('=====================================');\n echo \"Your app is now ready!\";\n }\n }", "protected function seedDatabase(): void\n {\n $this->seedProductCategories();\n $this->seedProducts();\n }", "public function setupDatabase()\n {\n Artisan::call('migrate:refresh');\n Artisan::call('db:seed');\n\n self::$setupDatabase = false;\n }", "public function run()\n {\n $this->seed('FormsMenuItemsTableSeeder');\n $this->seed('FormsDataTypesTableSeeder');\n $this->seed('FormsDataRowsTableSeeder');\n $this->seed('FormsPermissionsTableSeeder');\n $this->seed('FormsSettingsTableSeeder');\n $this->seed('FormsTableSeeder');\n }", "public function run()\n {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"\\n--- Seeding ---\\n\", TRUE));\n\n if (App::environment('production')) {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- ERROR: Seeding in Production is prohibited ---\\n\", TRUE));\n return;\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(ConfigsTableSeeder::class);\n $this->call(ConfigContentsTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n if (defined('STDERR')) fwrite(STDERR, print_r(\"Set FOREIGN_KEY_CHECKS=1 --- DONE\\n\", TRUE));\n\n // \\Artisan::call('command:regenerate-user-feeds');\n\n \\Cache::flush();\n\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- End Seeding ---\\n\\n\", TRUE));\n }", "protected function setupDatabase()\n {\n $this->call('migrate');\n $this->call('db:seed');\n\n $this->info('Database migrated and seeded.');\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function seedDatabase(): void\n {\n echo \"Running seeds\";\n\n // Folder where all the seeds are.\n $folder = __DIR__ . '/../seeds/';\n\n // Scan all files/folders inside database.\n $files = \\scandir($folder);\n\n $seeders = [];\n foreach ($files as $key => $file) {\n\n // All files that don't start with a dot.\n if ($file[0] !== '.') {\n\n // Load the file.\n require_once $folder . $file;\n\n // We have to call the migrations after because\n // some seeds are dependant from other seeds.\n $seeders[] = explode('.', $file)[0];\n }\n }\n\n // Run all seeds.\n foreach ($seeders as $seeder) {\n (new $seeder)->run();\n }\n }", "protected function seedDatabase()\n {\n //$this->app->make('db')->table(static::TABLE_NAME)->delete();\n\n TestExtendedModel::create([\n 'unique_field' => '999',\n 'second_field' => null,\n 'name' => 'unchanged',\n 'active' => true,\n 'hidden' => 'invisible',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1234567',\n 'second_field' => '434',\n 'name' => 'random name',\n 'active' => false,\n 'hidden' => 'cannot see me',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1337',\n 'second_field' => '12345',\n 'name' => 'special name',\n 'active' => true,\n 'hidden' => 'where has it gone?',\n ]);\n }", "public function initDatabase()\n {\n $this->call('migrate');\n\n $userModel = config('admin.database.users_model');\n\n if ($userModel::count() == 0) {\n $this->call('db:seed', ['--class' => AdminSeeder::class]);\n }\n }", "public function run ()\n {\n if (App::environment() === 'production') {\n exit('Seed should be run only in development/debug environment.');\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('role_user')->truncate();\n\n // Root user\n $user = User::find(1);\n $user->assignRole('owner');\n\n $user = User::find(2);\n $user->assignRole('admin');\n\n $user = User::find(3);\n $user->assignRole('admin');\n\n $user = User::find(4);\n $user->assignRole('moderator');\n\n $user = User::find(5);\n $user->assignRole('moderator');\n \n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n Model::unguard();\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(EntrustTableSeeder::class);\n\n $this->call(AccounttypeSeeder::class);\n $this->call(AppUserTableSeeder::class);\n $this->call(AppEmailUserTableSeeder::class);\n\n\n $this->call(CountryTableSeeder::class);\n $this->call(CityTableSeeder::class);\n\n\n $this->call(PostTypeTableSeeder::class);\n $this->call(PostSubTypeTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(AppPostSolvedTableSeeder::class);\n\n\n $this->call(AppCommentTypeTableSeeder::class);\n // $this->call(AppCommentTableSeeder::class);\n // $this->call(AppSubCommentTableSeeder::class);\n\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }\n\n Model::reguard();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('users')->truncate();\n DB::table('password_resets')->truncate();\n DB::table('domains')->truncate();\n DB::table('folders')->truncate();\n DB::table('bookmarks')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n $this->seedUserAccount('[email protected]');\n $this->seedUserAccount('[email protected]');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n // $this->call(UsersTableSeeder::class);\n /* Schema::dropIfExists('employees');\n Schema::dropIfExists('users');\n Schema::dropIfExists('requests');\n Schema::dropIfExists('requeststatus');*/\n User::truncate();\n InstallRequest::truncate();\n RequestStatus::truncate();\n\n $cantidadEmployyes = 20;\n $cantidadUsers = 20;\n $cantidadRequestStatus = 3;\n $cantidadRequests = 200;\n\n factory(User::class, $cantidadUsers)->create();\n factory(RequestStatus::class, $cantidadRequestStatus)->create();\n factory(InstallRequest::class, $cantidadRequests)->create();\n }", "public function run()\n {\n Model::unguard();\n foreach (glob(__DIR__ . '/seeds/*.php') as $filename) {\n require_once($filename);\n }\n // $this->call(UserTableSeeder::class);\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n// $this->call('CustomerTableSeeder');\n $this->call('PhotoTableSeeder');\n// $this->call('ProductTableSeeder');\n// $this->call('StaffTableSeeder');\n// $this->call('PasswordResetsTableSeeder');\n// $this->call('UsersTableSeeder');\n $this->call('CustomersTableSeeder');\n $this->call('EmployeesTableSeeder');\n $this->call('InventoryTransactionTypesTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrderDetailsStatusTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('InvoicesTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrdersStatusTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n\n $this->call('OrdersTaxStatusTableSeeder');\n $this->call('PrivilegesTableSeeder');\n $this->call('EmployeePrivilegesTableSeeder');\n $this->call('ProductsTableSeeder');\n $this->call('InventoryTransactionsTableSeeder');\n $this->call('PurchaseOrderDetailsTableSeeder');\n\n $this->call('PurchaseOrderStatusTableSeeder');\n $this->call('PurchaseOrdersTableSeeder');\n $this->call('SalesReportsTableSeeder');\n $this->call('ShippersTableSeeder');\n $this->call('StringsTableSeeder');\n $this->call('SuppliersTableSeeder');\n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n Model::reguard();\n }", "public function run()\n\t{\n $this->cleanDatabase();\n\n Eloquent::unguard();\n\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('CartsTableSeeder');\n $this->call('StoreTableSeeder');\n $this->call('AdvertisementsTableSeeder');\n \n\t}", "public function run()\n {\n \tDB::table('seeds')->truncate();\n\n $seeds = array(\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_18_2013',\n ),\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_20_2013',\n ),\n );\n\n // Uncomment the below to run the seeder\n DB::table('seeds')->insert($seeds);\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "protected function setUp(): void\n {\n $db = new DB;\n\n $db->addConnection([\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n ]);\n\n $db->bootEloquent();\n $db->setAsGlobal();\n\n $this->createSchema();\n }", "public function run()\n {\n //$this->call('UserTableSeeder');\n //$this->call('ProjectTableSeeder');\n //$this->call('TaskTableSeeder');\n\n /**\n * Prepare seeding\n */\n $faker = Faker::create();\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Model::unguard();\n\n /**\n * Seeding user table\n */\n App\\User::truncate();\n factory(App\\User::class)->create([\n 'name' => 'KCK',\n 'email' => '[email protected]',\n 'password' => bcrypt('password')\n ]);\n\n /*factory(App\\User::class, 9)->create();\n $this->command->info('users table seeded');*/\n\n /**\n * Seeding roles table\n */\n Spatie\\Permission\\Models\\Role::truncate();\n DB::table('model_has_roles')->truncate();\n $superAdminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '최고 관리자'\n ]);\n $adminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '관리자'\n ]);\n $regularRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '정회원'\n ]);\n $associateRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '준회원'\n ]);\n\n App\\User::where('email', '!=', '[email protected]')->get()->map(function ($user) use ($regularRole) {\n $user->assignRole($regularRole);\n });\n\n App\\User::whereEmail('[email protected]')->get()->map(function ($user) use ($superAdminRole) {\n $user->assignRole($superAdminRole);\n });\n $this->command->info('roles table seeded');\n\n /**\n * Seeding articles table\n */\n App\\Article::truncate();\n $users = App\\User::all();\n\n $users->each(function ($user) use ($faker) {\n $user->articles()->save(\n factory(App\\Article::class)->make()\n );\n });\n $this->command->info('articles table seeded');\n\n /**\n * Seeding comments table\n */\n App\\Comment::truncate();\n $articles = App\\Article::all();\n\n $articles->each(function ($article) use ($faker, $users) {\n for ($i = 0; $i < 10; $i++) {\n $article->comments()->save(\n factory(App\\Comment::class)->make([\n 'author_id' => $faker->randomElement($users->pluck('id')->toArray()),\n //'parent_id' => $article->id\n ])\n );\n };\n });\n $this->command->info('comments table seeded');\n\n /**\n * Seeding tags table\n */\n App\\Tag::truncate();\n DB::table('article_tag')->truncate();\n $articles->each(function ($article) use ($faker) {\n $article->tags()->save(\n factory(App\\Tag::class)->make()\n );\n });\n $this->command->info('tags table seeded');\n\n /**\n * Seeding attachments table\n */\n App\\Attachment::truncate();\n if (!File::isDirectory(attachment_path())) {\n File::deleteDirectory(attachment_path(), true);\n }\n\n $articles->each(function ($article) use ($faker) {\n $article->attachments()->save(\n factory(App\\Attachment::class)->make()\n );\n });\n\n //$files = App\\Attachment::pluck('name');\n\n if (!File::isDirectory(attachment_path())) {\n File::makeDirectory(attachment_path(), 777, true);\n }\n\n /*\n foreach ($files as $file) {\n File::put(attachment_path($file), '');\n }\n */\n\n $this->command->info('attachments table seeded');\n\n /**\n * Close seeding\n */\n Model::reguard();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(CountriesTableSeeder::class);\n $this->call(StatesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n\n factory(Group::class)->create();\n factory(Contact::class, 5000)->create();\n }", "public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t// $this->call('AdminTableSeeder');\n\t\t// $this->call('UserTableSeeder');\n\t\t// $this->call('MenuTableSeeder');\n\t\t// $this->call('ProductTableSeeder');\n\t\t// $this->call('CategoryTableSeeder');\n\t\t// $this->call('OptionTableSeeder');\n\t\t// $this->call('OptionGroupTableSeeder');\n\t\t// $this->call('TypeTableSeeder');\n\t\t// $this->call('LayoutTableSeeder');\n\t\t// $this->call('LayoutDetailTableSeeder');\n\t\t// $this->call('BannerTableSeeder');\n\t\t// $this->call('ConfigureTableSeeder');\n\t\t// $this->call('PageTableSeeder');\n\t\t// $this->call('ImageTableSeeder');\n\t\t// $this->call('ImageableTableSeeder');\n\t\t// ======== new Seed =======\n\t\t$this->call('AdminsTableSeeder');\n\t\t$this->call('BannersTableSeeder');\n\t\t$this->call('CategoriesTableSeeder');\n\t\t$this->call('ConfiguresTableSeeder');\n\t\t$this->call('ImageablesTableSeeder');\n\t\t$this->call('ImagesTableSeeder');\n\t\t$this->call('LayoutsTableSeeder');\n\t\t$this->call('LayoutDetailsTableSeeder');\n\t\t$this->call('MenusTableSeeder');\n\t\t$this->call('OptionablesTableSeeder');\n\t\t$this->call('OptionsTableSeeder');\n\t\t$this->call('OptionGroupsTableSeeder');\n\t\t$this->call('PagesTableSeeder');\n\t\t$this->call('PriceBreaksTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('ProductsCategoriesTableSeeder');\n\t\t$this->call('SizeListsTableSeeder');\n\t\t$this->call('TypesTableSeeder');\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ContactsTableSeeder');\n\t\t$this->call('RolesTableSeeder');\n\t\t$this->call('PermissionsTableSeeder');\n\t\t$this->call('PermissionRoleTableSeeder');\n\t\t$this->call('AssignedRolesTableSeeder');\n\t\t$this->call('OrdersTableSeeder');\n\t\t$this->call('OrderDetailsTableSeeder');\n\t\tCache::flush();\n\t\t// BackgroundProcess::copyFromVI();\n\t}", "public function run()\n {\n Model::unguard();\n\n User::create([\n 'email' => '[email protected]',\n 'name' => 'admin',\n 'password' => Hash::make('1234'),\n 'email_verified_at' => Carbon::now()\n ]);\n\n factory(User::class, 200)->create();\n\n // $this->call(\"OthersTableSeeder\");\n }", "public function run()\n {\n $this->seedRegularUsers();\n $this->seedAdminUser();\n }", "public function run()\n {\n if (\\App::environment() === 'local') {\n\n // Delete existing data\n\n\n Eloquent::unguard();\n\n //disable foreign key check for this connection before running seeders\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // Truncate all tables, except migrations\n $tables = array_except(DB::select('SHOW TABLES'), ['migrations']);\n foreach ($tables as $table) {\n $tables_in_database = \"Tables_in_\" . Config::get('database.connections.mysql.database');\n DB::table($table->$tables_in_database)->truncate();\n }\n\n // supposed to only apply to a single connection and reset it's self\n // but I like to explicitly undo what I've done for clarity\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n //get roles\n $this->call('AccountSeeder');\n $this->call('CountrySeeder');\n $this->call('StateSeeder');\n $this->call('CitySeeder');\n $this->call('OptionSeeder');\n $this->call('TagSeeder');\n $this->call('PrintTemplateSeeder');\n $this->call('SettingsSeeder');\n\n\n\n if(empty($web_installer)) {\n $admin = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"admin\",\n 'first_name' => 'Admin',\n 'last_name' => 'Doe',\n ));\n $admin->user_id = $admin->id;\n $admin->save();\n\n $adminRole = Sentinel::findRoleById(1);\n $adminRole->users()->attach($admin);\n }\n else {\n $admin = Sentinel::findById(1);\n }\n\n //add dummy staff and customer\n $staff = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"staff\",\n 'first_name' => 'Staff',\n 'last_name' => 'Doe',\n ));\n $admin->users()->save($staff);\n\n foreach ($this->getPermissions() as $permission) {\n $staff->addPermission($permission);\n }\n $staff->save();\n\n $customer = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"customer\",\n 'first_name' => 'Customer',\n 'last_name' => 'Doe',\n ));\n Customer::create(array('user_id' => $customer->id, 'belong_user_id' => $staff->id));\n $staff->users()->save($customer);\n\n //add respective roles\n\n $staffRole = Sentinel::findRoleById(2);\n $staffRole->users()->attach($staff);\n $customerRole = Sentinel::findRoleById(3);\n $customerRole->users()->attach($customer);\n\n\n\n DB::table('sales_teams')->truncate();\n DB::table('opportunities')->truncate();\n\n //Delete existing seeded users except the first 4 users\n User::where('id', '>', 3)->get()->each(function ($user) {\n $user->forceDelete();\n });\n\n //Get the default ADMIN\n $user = User::find(1);\n $staffRole = Sentinel::getRoleRepository()->findByName('staff');\n $customerRole = Sentinel::getRoleRepository()->findByName('customer');\n\n //Seed Sales teams for default ADMIN\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($user->id, $j, $user);\n $this->createOpportunity($user, $user->id, $j);\n }\n\n\n //Get the default STAFF\n $staff = User::find(2);\n $this->createSalesTeam($staff->id, 1, $staff);\n $this->createSalesTeam($staff->id, 2, $staff);\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $staff->id, $j);\n }\n\n foreach (range(1, 3) as $i) {\n $staff = $this->createStaff($i);\n $user->users()->save($staff);\n $staffRole->users()->attach($staff);\n\n $customer = $this->createCustomer($i);\n $staff->users()->save($customer);\n $customerRole->users()->attach($customer);\n $customer->customer()->save(factory(\\App\\Models\\Customer::class)->make());\n\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 5) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $i, $j);\n }\n\n }\n\n //finally call it installation is finished\n file_put_contents(storage_path('installed'), 'Welcome to LCRM');\n }\n }", "public function run()\n {\n if (env('DB_DATABASE') == 'connection') {\n Connection::create([\n \"ruc\" => \"12312312312\",\n \"basedata\" => \"nbdata2018_1\",\n ]);\n \n Connection::create([\n \"ruc\" => \"12312312315\",\n \"basedata\" => \"nbdata2018_2\",\n ]);\n \n $this->call(ConnectionTableSeeder::class);\n } else {\n $this->call(AppSeeder::class);\n }\n }", "public function setupDatabase()\n {\n exec('rm ' . storage_path() . '/testdb.sqlite');\n exec('cp ' . 'database/database.sqlite ' . storage_path() . '/testdb.sqlite');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n # truncates tables before seeding\n foreach ($this->toTruncate as $table) {\n DB::table($table)->delete();\n }\n\n factory(App\\Models\\Product::class, 25)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Post::truncate();\n Comment::truncate();\n // CommentReply::truncate();\n \n\n\n factory(User::class,10)->create();\n factory(Post::class,20)->create();\n factory(Comment::class,30)->create();\n // factory(CommentReply::class,30)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n\t{\n \n Eloquent::unguard();\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\t\t$this->call('UserTableSeeder');\n\t $this->call('LayerTableSeeder');\n $this->call('UserLevelTableSeeder');\n $this->call('RoleUserTableSeeder');\n $this->call('RoleLayerTableSeeder');\n $this->call('BookmarkTableSeeder');\n \n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\t}", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n DB::statement('SET foreign_key_checks = 0');\n DB::table('topics')->truncate();\n\n factory(\\App\\Topic::class, 100)->create();\n // ->each(function($topic) {\n\n // // Seed para a relação com group\n // $topic->group()->save(factory(App\\Group::class)->make());\n\n // // Seed para a relação com topicMessages\n // $topic->topicMessages()->save(factory(App\\TopicMessage::class)->make());\n\n // // Seed para a relação com user\n // $topic->user()->save(factory(App\\User::class)->make());\n // });\n \n DB::statement('SET foreign_key_checks = 1');\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n Categoria::truncate();\n Atractivo::truncate();\n Galeria::truncate();\n User::truncate();\n\n $this->call(CategoriasTableSeeder::class);\n $this->call(AtractivosTableSeeder::class);\n $this->call(GaleriasTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n }", "public function run(Faker $faker)\n {\n Schema::disableForeignKeyConstraints();\n DB::table('users')->insert([\n 'name' => $faker->name(),\n 'email' => '[email protected]',\n 'password' => Hash::make('12345678'),\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n\t $this->call(CategoryTableSeed::class);\n\t $this->call(ProductTableSeed::class);\n\t $this->call(UserTableSeed::class);\n }", "public function run()\n {\n \t// DB::table('webapps')->delete();\n\n $webapps = array(\n\n );\n\n // Uncomment the below to run the seeder\n // DB::table('webapps')->insert($webapps);\n }", "public function run()\n {\n $this->cleanDatabase();\n\n factory(User::class, 50)->create();\n factory(Document::class, 30)->create();\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $tables = array(\n 'users',\n 'companies',\n 'stands',\n 'events',\n 'visitors',\n 'api_keys'\n );\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n }\n\n foreach ($tables as $table) {\n DB::table($table)->truncate();\n }\n\n $this->call(UsersTableSeeder::class);\n $this->call(EventsTableSeeder::class);\n $this->call(CompaniesTableSeeder::class);\n $this->call(StandsTableSeeder::class);\n $this->call(VisitorsTableSeeder::class);\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n $clear = $this->command->confirm('Wil je de database leegmaken? (Dit haalt alle DATA weg)');\n\n if ($clear):\n $this->command->callSilent('migrate:refresh');\n $this->command->info('Database Cleared, starting seeding');\n endif;\n\n $this->call([\n SeedSeeder::class,\n RoleSeeder::class,\n UserSeeder::class,\n // BoardgameSeeder::class,\n BoardgamesTableSeeder::class,\n StatusSeeder::class,\n TournamentSeeder::class,\n AchievementsSeeder::class,\n TournamentUsersSeeder::class,\n ]);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n $this->call(PaisSeeder::class);\n $this->call(DepartamentoSeeder::class);\n $this->call(MunicipioSeeder::class);\n $this->call(PersonaSeeder::class);\n }", "public function run()\n {\n //\n if (App::environment() === 'production') {\n exit('Do not seed in production environment');\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // disable foreign key constraints\n\n DB::table('events')->truncate();\n \n Event::create([\n 'id' => 1,\n 'name' => 'Spot Registration For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n Event::create([\n 'id' => 2,\n 'name' => 'Spot Screening For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'screen',\n 'formId'\t\t=> 1,\n ]);\n \n Event::create([\n 'id' => 3,\n 'name' => 'Spot Registration For Skin Cancer',\n 'cancerId' => 2,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n\n Event::create([\n 'id' => 3,\n 'name' => 'Registration cum Screening camp for Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addWeeks(1),\n 'eventType'\t\t=> 'register_screen',\n 'formId'\t\t=> 1,\n ]);\n \n DB::statement('SET FOREIGN_KEY_CHECKS = 1'); // enable foreign key constraints\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // Para que no verifique el control de claves foráneas al hacer el truncate haremos:\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n\t\t// Primero hacemos un truncate de las tablas para que no se estén agregando datos\n\t\t// cada vez que ejecutamos el seeder.\n\t\t//Foto::truncate();\n\t\t//Album::truncate();\n\t\t//Usuario::truncate();\n DB::table('users')->delete();\n DB::table('ciudades')->delete();\n DB::table('tiendas')->delete();\n DB::table('ofertas')->delete();\n DB::table('ventas')->delete();\n\n\n\t\t// Es importante el orden de llamada.\n\t\t$this->call('UserSeeder');\n $this->call('CiudadSeeder');\n\t\t$this->call('TiendaSeeder');\n $this->call('OfertaSeeder');\n $this->call('VentaSeeder');\n }", "public function run()\n {\n $this->call(\\Database\\Seeders\\GroupByRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\SingleIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\MultiIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\JoinFiveTablesSeeder::class);\n\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// // 試しに一回流す\n// $data = $this->makeData(0, 'userFactory', 1);\n// DB::table('users')->insert($data);\n// $data = $this->makeData(0, 'userDetailFactory', 1);\n// DB::table('user_details')->insert($data);\n//\n// // $this->call(UsersTableSeeder::class);\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userFactory', 2500);\n// DB::table('users')->insert($data);\n// }\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userDetailFactory', 2500);\n// DB::table('user_details')->insert($data);\n// }\n }", "public function run()\n {\n $this->truncateTables([\n 'users',\n 'categories',\n 'types',\n 'courses',\n 'classrooms',\n 'contents',\n 'companies',\n ]);\n\n $this->call(CompanyTableSeeder::class);\n $this->call(TypeTableSeeder::class);\n $this->call(RoleTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(CoursesTableSeeder::class);\n $this->call(PermissionTableSeeder::class);\n $this->call(ContentTableSeeder::class);\n $this->call(UserTableSeeder::class);\n $this->call(ClassroomTableSeeder::class);\n $this->call(TestTableSeeder::class);\n $this->call(BankTableSeeder::class);\n\n\n // factory(\\App\\User::class, 50)\n // ->create()\n // ->each(function ($user) {\n // // $user->companies()->save();\n // $company = \\App\\Company::inRandomOrder()->first();\n // $user->companies()->attach($company->id);\n // $user->assignRole(['participante']);\n // });\n /*\n factory(\\App\\User::class, 50)\n ->create()\n ->each(function ($user) {\n $user->assignRole(['participante']);\n });*/\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n User::truncate();\n Question::truncate();\n Option::truncate();\n// Answer::truncate();\n Quiz::truncate();\n QuizQuestion::truncate();\n\n //for admin\n $admin = factory(User::class)->create([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'is_admin' => 1,\n ]);\n\n //for user\n $user = factory(User::class)->create([\n 'name' => 'User',\n 'email' => '[email protected]',\n ]);\n\n factory(Question::class, 100)->create()->each(function ($question) {\n factory(Option::class, mt_rand(2, 4))->create([\n 'question_id' => $question->id,\n ]);\n });\n\n factory(Quiz::class, 10)->create()->each(function ($quiz) {\n\n factory(QuizQuestion::class, mt_rand(5, 10))->create();\n });\n\n\n }", "public function run()\n {\n $this->call([\n SiteSettingsSeeder::class,\n LaratrustSeeder::class,\n CountrySeeder::class,\n GovernorateSeeder::class,\n FaqSeeder::class,\n SitePageSeeder::class,\n UsersSeeder::class,\n ]);\n\n Country::whereiso(\"EG\")->update(['enable_shipping' => true]);\n\n factory(User::class, 400)->create();\n\n Category::create([\n 'en' => [\n 'name' => \"cake tools\"\n ]\n ]);\n\n Category::create([\n 'en' => [\n 'name' => \"Party Supplies\"\n ]\n ]);\n\n $this->call([\n ProductCategorySeeder::class,\n ProductSeeder::class\n ]);\n }", "public function run()\n {\n $this->call(PermissionsTableSeeder::class);\n\n if (App::environment('local')) {\n $this->call(FakeUsersTableSeeder::class);\n $this->call(FakeArticlesTableSeeder::class);\n $this->call(FakeEventsTableSeeder::class);\n }\n }", "public function run()\n {\n Model::unguard();\n\n $this->call(CategoryTypesTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(AccountTypesTableSeeder::class);\n $this->call(TransactionTypesTableSeeder::class);\n\n if (App::environment() !== 'production') {\n $this->call(UserTableSeeder::class);\n $this->call(AccountBudgetTableSeeder::class);\n $this->call(TransactionTableSeeder::class);\n }\n\n Model::reguard();\n }", "public function run()\n {\n User::truncate();\n Product::truncate();\n User::forceCreate([\n 'name' => 'foo',\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n ]);\n factory(User::class, 5)->create();\n factory(Product::class, 5)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n {\n $this->call([UsersTableSeeder::class]);\n $this->call([ContratosTableSeeder::class]);\n $this->call([UsuariosTableSeeder::class]);\n $this->call([UnidadesTableSeeder::class]);\n $this->call([AtestadosTableSeeder::class]);\n }", "public function run()\n {\n Model::unguard();\n\n // $this->call(\"OthersTableSeeder\");\n\n // DB::table('locations')->insert([\n // 'id' => 1,\n // 'name' => 'Default',\n // 'name' => 'district',\n // 'district_id' => 1,\n // 'province_id' => 1,\n // ]);\n }", "public function run()\n {\n $data = include env('DATA_SEED');\n\n \\Illuminate\\Support\\Facades\\DB::table('endpoints')->insert((array)$data);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('admins')->truncate();\n\n for ($i = 0; $i < 10; $i++)\n {\n $faker = Factory::create('en_US');\n $values = [\n 'name' => $faker->userName,\n 'email' => $faker->freeEmail,\n 'password' => bcrypt($faker->password),\n 'phone' => $faker->phoneNumber,\n 'status' => random_int(0,1)\n ];\n admin::create($values);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n \\DB::table('provinces')->delete();\n \\DB::table('cities')->delete();\n \\DB::table('districts')->delete();\n // import provinces and cities from sql file\n $sqlFile = app_path() . '/../database/raw/administrative_indonesia_without_districts.sql';\n DB::unprepared(file_get_contents($sqlFile));\n $this->command->info('Successfully seed Provinces and Cities!');\n\n // import districts with latitude and longitude from csv file\n $csvFile = app_path() . '/../database/raw/administrative_indonesia_districts_with_lat_lng.csv';\n $districts = $this->csvToArray($csvFile);\n // check if lat lng exists\n foreach ($districts as $i => $d) {\n if ($d['latitude'] == '') $districts[$i]['latitude'] = 0;\n if ($d['longitude'] == '') $districts[$i]['longitude'] = 0;\n }\n // insert it\n $insert = District::insert($districts);\n if ($insert) $this->command->info('Successfully seed Districts!');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n DB::beginTransaction();\n// $this->seed();\n DB::commit();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n User::create([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n ]);\n\n User::create([\n 'name' => 'Leonardo',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789')\n ]);\n\n // seed sin model\n /* DB::table('users')->insert([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s')\n ]); */\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(RegionsTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(SubDistrictsTableSeeder::class);\n $this->call(PostcodesTableSeeder::class);\n\n if (env('APP_ENV') !== 'production') {\n // Wipe up 5 churches, and each church has 5 cells, and each cell has 20 members associated with.\n // In other word, we wipe up 500 church members.\n for ($i = 0; $i < 2; $i++) {\n $church = factory(\\App\\Models\\Church::class)->create();\n\n $church->areas()->saveMany(factory(\\App\\Models\\Area::class, 2)->create([\n 'church_id' => $church->id\n ])->each(function($area) {\n $area->cells()->saveMany(factory(\\App\\Models\\Cell::class, 2)->create([\n 'area_id' => $area->id\n ])->each(function($cell) {\n $cell->members()->saveMany(factory(App\\Models\\Member::class, 10)->create([\n 'cell_id' => $cell\n ]));\n }));\n }));\n }\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n $this->environmentPath = env('APP_ENV') === 'production' ||\n env('APP_ENV') === 'qa' ||\n env('APP_ENV') === 'integration' ?\n 'Production':\n 'local';\n //disable FK\n Model::unguard();\n DB::statement(\"SET session_replication_role = 'replica';\");\n\n // $this->call(HrEmployeeTableSeeder::class);\n $this->call(\"Modules\\HR\\Database\\Seeders\\\\$this->environmentPath\\HrEmployeePosTableSeeder\");\n // $this->call(HrEmployeePresetsDiscountTableSeeder::class);\n\n // Enable FK\n DB::statement(\"SET session_replication_role = 'origin';\");\n Model::reguard();\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "protected static function seed()\n {\n foreach (self::fetch('database/seeds', false) as $file) {\n Bus::need($file);\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n $faker = F::create('App\\Proovedores');\n for($i=0; $i < 10; $i++){\n DB::table('users')->insert([\n 'usuario' => $i,\n 'password' => $i,\n 'email' => $faker->email,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Delete all records.\n DB::table('users')->delete();\n // Reset AUTO_INCREMENT.\n DB::table('users')->truncate();\n\n // Dev user.\n App\\Models\\User::create([\n 'email' => '[email protected]',\n 'password' => '$2y$10$t6q81nz.XrMrh20NHDvxUu/szwHBwgzPd.01e8uuP0qVy0mPa6H/e',\n 'first_name' => 'L5',\n 'last_name' => 'App',\n 'username' => 'l5-app',\n 'is_email_verified' => 1,\n ]);\n\n // Dummy users.\n TestDummy::times(10)->create('App\\Models\\User');\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n User::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // We did this for test purposes. Shouldn't be doing this for production\n $password = Hash::make('123456');\n\n User::create([\n 'name' => 'Administrator',\n 'email' => '[email protected]',\n 'password' => $password,\n ]);\n }", "public function run()\n {\n Model::unguard();\n \n factory('App\\User','admin')->create();\n factory('App\\Evento',100)->create();\n //factory('App\\User','miembro',10)->create();\n factory('App\\Telefono',13)->create();\n factory('App\\Notificacion',10)->create();\n factory('App\\Rubro',10)->create();\n factory('App\\Tecnologia',10)->create();\n factory('App\\Cultivo',10)->create();\n factory('App\\Etapa',10)->create();\n factory('App\\Variedad',10)->create();\n factory('App\\Caracteristica',10)->create();\n factory('App\\Practica',30)->create();\n factory('App\\Tag',15)->create();\n // $this->call(PracticaTableSeeder::class);\n $this->call(TrTableSeeder::class);\n $this->call(MesTableSeeder::class);\n $this->call(SemanasTableSeeder::class);\n $this->call(PsTableSeeder::class);\n $this->call(MsTableSeeder::class);\n $this->call(CeTableSeeder::class);\n $this->call(CvTableSeeder::class);\n $this->call(PtSeeder::class);\n \n\n Model::unguard();\n }", "public function run() {\n $this->call(UserSeeder::class);\n $this->call(PermissionSeeder::class);\n $this->call(CreateAdminUserSeeder::class);\n // $this->call(PhoneSeeder::class);\n // $this->call(AddressSeeder::class);\n\n $this->call(ContactFormSeeder::class);\n //$this->call(ContactSeeder::class);\n\n User::factory()->count(20)->create()->each(function ($user) {\n // Seed the relation with one address\n $address = Address::factory()->make();\n $user->address()->save($address);\n\n // Seed the relation with one phone\n $phone = Phone::factory()->make();\n $user->phone()->save($phone);\n\n // Seed the relation with 15 contacts\n $contact = Contact::factory()->count(25)->make();\n $user->contacts()->saveMany($contact);\n });\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Activity::truncate();\n User::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n $this->call(UserTableSeeder::class);\n $this->call(ActivityTableSeeder::class);\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n \\App\\User::truncate();\n \\App\\Category::truncate();\n \\App\\Product::truncate();\n \\App\\Transaction::truncate();\n DB::table('category_product')->truncate();\n\n \\App\\User::flushEventListeners();\n \\App\\Category::flushEventListeners();\n \\App\\Product::flushEventListeners();\n \\App\\Transaction::flushEventListeners();\n\n\n $usersQuentity = 1000;\n $categoriesQuentity = 30;\n $productsQuentity = 1000;\n $transactionsQuentity = 1000;\n\n factory(\\App\\User::class, $usersQuentity)->create();\n factory(\\App\\Category::class, $categoriesQuentity)->create();\n factory(\\App\\Product::class, $productsQuentity)->create()->each(\n function ($product){\n $categories = \\App\\Category::all()->random(mt_rand(1, 5))->pluck('id');\n\n $product->categories()->attach($categories);\n }\n );\n factory(\\App\\Transaction::class, $transactionsQuentity)->create();\n\n }", "public static function setUpBeforeClass()\n {\n parent::setUpBeforeClass();\n $app = require __DIR__ . '/../../bootstrap/app.php';\n /** @var \\Pterodactyl\\Console\\Kernel $kernel */\n $kernel = $app->make(Kernel::class);\n $kernel->bootstrap();\n $kernel->call('migrate:fresh');\n\n \\Artisan::call('db:seed');\n }", "public function run()\n {\n Eloquent::unguard();\n \n $this->call('AdminMemberTableSeeder');\n $this->call('BankInfoTableSeeder');\n $this->call('LocationLookUpTableSeeder');\n $this->call('OrderStatusTableSeeder');\n $this->call('AdminRoleTableSeeder');\n\n }", "public function run()\n {\n Model::unguard();\n\n if( !User::where('email', '[email protected]')->count() ) {\n User::create([\n 'nombre'=>'Nick'\n ,'apellidos'=>'Palomino'\n ,'email'=>'[email protected]'\n ,'password'=> Hash::make('1234567u')\n ,'celular'=>'966463589'\n ]);\n }\n\n $this->call('CategoriaTableSeeder');\n $this->call('WhateverSeeder');\n $this->call('ProductTableSeeder');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n Model::unguard();\n\n $this->command->info('seed start!');\n\n // 省市县\n $this->call('RegionTableSeeder');\n // 用户、角色\n $this->call('UserTableSeeder');\n // 权限\n $this->call('PurviewTableSeeder');\n // 博文分类\n $this->call('CategoryTableSeeder');\n // 博文、评论、标签\n $this->call('ArticleTableSeeder');\n // 心情\n $this->call('MoodTableSeeder');\n // 留言\n $this->call('MessageTableSeeder');\n // 文件\n $this->call('StorageTableSeeder');\n\n $this->command->info('seed end!');\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n {\n $this->call(RolesDatabaseSeeder::class);\n $this->call(UsersDatabaseSeeder::class);\n $this->call(LocalesDatabaseSeeder::class);\n $this->call(MainDatabaseSeeder::class);\n }", "public function run()\n {\n // DB::table('users')->insert([\n // ['id'=>1, 'email'=>'nhat','password'=>bcrypt(1234), 'lever'=>0]\n // ]);\n // $this->call(UsersTableSeeder::class);\n // $this->call(CatTableSeeder::class);\n // $this->call(TypeTableSeeder::class);\n // $this->call(AppTableSeeder::class);\n // $this->call(GameTableSeeder::class);\n \n \n }", "public function run()\n {\n\n Schema::disableForeignKeyConstraints(); //in order to execute truncate before seeding\n\n $this->call(UsersTableSeeder::class);\n $this->call(PostCategoriesSeeder::class);\n $this->call(TagsSeeder::class);\n $this->call(PostsSeeder::class);\n\n Schema::enableForeignKeyConstraints();\n\n\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n $this->seedUsers();\n $this->seedAdmins();\n $this->seedMeals();\n\n $this->seedOrder();\n $this->seedOrderlist();\n\n $this->seedReload();\n }", "public function run()\n\t{\n\t\t//composer require fzaninotto/faker\n\t\t\n\t\t$this->call(populateAllSeeder::class);\n\t\t\n\t}", "public function run()\n {\n Model::unguard();\n\n $faker =Faker\\Factory::create();\n\n // $this->call(UserTableSeeder::class);\n\n $this->seedTasks($faker);\n $this->seedTags($faker);\n\n Model::reguard($faker);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n\n $this->call([\n CountriesSeeder::class,\n ProvincesSeeder::class,\n SettingsSeeder::class,\n AdminsTableSeeder::class,\n ]);\n }" ]
[ "0.8065584", "0.7848217", "0.76748335", "0.7244791", "0.7217673", "0.7133266", "0.70984626", "0.70752525", "0.7050456", "0.69926506", "0.6988436", "0.6985116", "0.69669306", "0.68992233", "0.68682885", "0.6847507", "0.6831097", "0.68208444", "0.68041754", "0.68041754", "0.68032914", "0.6790816", "0.67898446", "0.6787946", "0.678716", "0.6777025", "0.6775358", "0.67726433", "0.67660606", "0.67634314", "0.6758109", "0.673368", "0.67331403", "0.6729675", "0.67294586", "0.67255825", "0.67230934", "0.6722171", "0.67213213", "0.6715509", "0.67079365", "0.67062575", "0.6703651", "0.670358", "0.6702433", "0.6702257", "0.66971296", "0.66941136", "0.6686706", "0.6684891", "0.6678387", "0.66765666", "0.66730577", "0.66660666", "0.66496396", "0.6641152", "0.66396993", "0.66393507", "0.66372746", "0.6633904", "0.6630109", "0.66281164", "0.66259885", "0.6617708", "0.66098803", "0.6602503", "0.66002655", "0.659939", "0.6597011", "0.6596365", "0.6592976", "0.65928084", "0.6592367", "0.6589387", "0.6581892", "0.6581305", "0.65805703", "0.6579974", "0.6576225", "0.65749776", "0.6574433", "0.6571225", "0.6569767", "0.6568897", "0.65635324", "0.65631485", "0.6559915", "0.6558022", "0.6556394", "0.65548515", "0.6551606", "0.6548489", "0.6548293", "0.65458405", "0.6545289", "0.6544641", "0.6543904", "0.6543258", "0.65430623", "0.6542044", "0.6539481" ]
0.0
-1
Adds as addItemResponseContainer One AddItemResponseContainer container is returned for each listing that was created with the AddItems call. Each container includes the ItemID of each newly created listings, the eBay category each item is listed under, the sellerdefined SKUs of the items (if any), the listing recommendations for each item (if applicable), the start and end time of each listing, and the estimated fees that each listing will incur.
public function addToAddItemResponseContainer(\Nogrod\eBaySDK\Trading\AddItemResponseContainerType $addItemResponseContainer) { $this->addItemResponseContainer[] = $addItemResponseContainer; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAddItemResponseContainer(array $addItemResponseContainer)\n {\n $this->addItemResponseContainer = $addItemResponseContainer;\n return $this;\n }", "public function getAddItemResponseContainer()\n {\n return $this->addItemResponseContainer;\n }", "public function add_item()\n {\n $request = new Types\\AddItemRequestType();\n\n // An user token is required when using the Trading service.\n $request->RequesterCredentials = new Types\\CustomSecurityHeaderType();\n $request->RequesterCredentials->eBayAuthToken = $this->config->item('authToken');\n\n\n // Begin creating the auction item.\n $item = new Types\\ItemType();\n\n $item->DispatchTimeMax = 3;\n /**\n * We want a single quantity auction.\n * Otherwise known as a Chinese auction.\n */\n $item->ListingType = Enums\\ListingTypeCodeType::C_CHINESE;\n $item->Quantity = 1;\n\n $item->ProductListingDetails = new Types\\ProductListingDetailsType();\n $item->ProductListingDetails->ISBN = $ISBN;\n $item->ProductListingDetails->UPC = $UPC;\n $item->ProductListingDetails->EAN = $EAN;\n\n $item->ProductListingDetails->BrandMPN = new DTS\\eBaySDK\\Trading\\Types\\BrandMPNType();\n $item->ProductListingDetails->BrandMPN->Brand = '';\n $item->ProductListingDetails->BrandMPN->MPN = '';\n\n $item->ListingDuration = Enums\\ListingDurationCodeType::C_DAYS_7;\n\n }", "protected function addItems()\n {\n $origin = 'stock';\n $code = 'cataloginventory';\n $message = Data::ERROR_QTY;\n $additionalData = null;\n $mockItems = [];\n\n for ($i = 0; $i < 2; $i++) {\n $mockItems[] = [\n 'origin' => $origin . $i,\n 'code' => $code,\n 'message' => $message . $i,\n 'additionalData' => $additionalData,\n ];\n $this->listStatus->addItem($origin . $i, $code, $message . $i, $additionalData);\n }\n return $mockItems;\n }", "public function Add()\n {\n if (isset($this->properties['ItemId']) && !is_null($this->properties['ItemId'])) {\n \tthrow new Services_Ebay_Exception('This item already has an ItemId and thus cannot be added.');\n }\n $call = Services_Ebay::loadAPICall('AddItem', array($this));\n \n return $call->call($this->session);\n }", "public static function add($response)\n\t{\n\t\tforeach ($response as $key => $value) {\n\t\t\tself::$response[$key] = $value;\n\t\t}\n\t}", "public function additem()\r\n {\r\n $shipping = array( 'ShippingServiceOptions' => array(\r\n\r\n 'ShippingService' => 'UPSGround',\r\n 'ShippingServiceCost' => 0.0,\r\n 'ShippingServiceAdditionalCost' => 0.0,\r\n 'ShippingServicePriority' => 1,\r\n 'ExpeditedService' => false,\r\n\r\n\r\n ),\r\n 'ShippingType' => 'Flat',\r\n );\r\n\r\n $returnPolicy = array(\r\n 'ReturnsAcceptedOption' => 'ReturnsAccepted',\r\n 'RefundOption' => 'MoneyBack',\r\n 'ReturnsWithinOption' => 'Days_30',\r\n 'Description ' =>'If you are not satisfied, return the item for refund.',\r\n 'ShippingCostPaidByOption' => 'Buyer',\r\n );\r\n\r\n $item = array(\r\n 'PrimaryCategory' => array('CategoryID' => 111422), // ok\r\n 'Title' => 'Miechu nowy',\r\n 'Description' => 'Testowy opis',\r\n 'StartPrice' => 100, //\r\n 'BuyItNowPrice' => 500,//\r\n 'ReservePrice' => 400,//\r\n 'Country' => 'US',//\r\n 'Currency' => 'USD',//\r\n 'ListingDuration' => 'Days_7',//\r\n 'PictureDetails' => 'dummy',//\r\n 'Site' => 'US',//\r\n 'Location' => 'San Jose',//\r\n 'PaymentMethods' => 'PayPal',//\r\n 'PayPalEmailAddress' => '[email protected]',//\r\n 'ShippingDetails' => $shipping,//\r\n 'DispatchTimeMax' => 3,//\r\n 'ConditionID' => 1000,//\r\n 'ReturnPolicy' => $returnPolicy,//\r\n\r\n );\r\n\r\n $params = array(\r\n 'Version' => 831,\r\n 'Item' => $item\r\n\r\n\r\n\r\n\r\n\r\n );\r\n $method = 'addItem';\r\n\r\n try{\r\n\r\n $resp = debay::sendRequest($method,$params);\r\n\r\n $this->load->model('ebay/debay');\r\n\r\n\r\n }\r\n catch(Exception $e)\r\n {\r\n echo $e->getMessage();\r\n }\r\n }", "public function addItem($item)\n {\n if ($item instanceof \\Fastbill\\Item\\Item)\n {\n $this['ITEMS'][] = $item;\n }\n else\n {\n $itemObj = new \\Fastbill\\Item\\Item();\n $itemObj->fillFromArray($item);\n $this['ITEMS'];\n }\n\n }", "public function add_item($zajlib_feed_item){\n\t\t$this->items[] = $zajlib_feed_item; \n\t}", "public function addItem($item) {\n\t\t$this->result .= '<li>' . $item . '</li>' . PHP_EOL;\n\t}", "public function addItems(){\n $this->validate($this->request, [\n 'title' => 'required|max:255',\n 'description' => 'string|max:255',\n 'isbn' => 'string',\n 'authorId' => 'required|integer|min:1',\n 'itemTypeId' => 'required|integer|min:1',\n 'categoryId' => 'required|integer|min:1',\n 'numberInStock' => 'required|integer|min:1',\n 'itemCondition' => 'required',\n 'itemStateId' => 'required|integer|min:1',\n ]);\n $items = array(\n 'title' => $this->request->input('title'),\n 'description' => $this->request->input('description'),\n 'isbn' => $this->request->input('isbn'),\n 'authorId' => $this->request->input( 'authorId'),\n 'catId' => $this->request->input('categoryId'),\n 'numOfItems' => $this->request->input('numberInStock'),\n 'itemCondition' => $this->request->input('itemCondition'),\n 'itemStateId' => $this->request->input('itemStateId'),\n 'itemTypeId' => $this->request->input('itemTypeId'),\n );\n\n try{\n $item = new ItemService();\n $result = $item->createNewItem($items);\n\n if ($result) {\n return response()->json([\n 'success' => true,\n 'data' => [\n 'itemId' => $result,\n ],\n 'message' => 'Item Added Successfully',\n ], 201);\n }\n return response()->json([\n 'success' => false,\n 'message' => 'item could not be added'\n ], 400);\n\n }catch(Exception $ex){\n return response()->json([\n 'success' => false,\n 'message' => 'Error Occured Adding Items. Ensure the IDs are Valid'\n ], 400);\n }\n }", "function appendItemMetadataList(&$item) {\n $mda = array();\n\n // Static metadata\n $mda = $this->getHardCodedMetadataList(true);\n foreach($mda as $md) {\n $md->setValue($item->getHardCodedMetadataValue($md->getLabel()));\n $item->addMetadata($md);\n unset($md);\n }\n \n // Dynamic metadata\n $mdIter = $this->getRealMetadataIterator(true);\n $mdIter->rewind();\n while($mdIter->valid()) {\n $md = $mdIter->current();\n $this->addMetadataValueToItem($item, $md);\n $mdIter->next();\n }\n }", "public function addDealsToCart( $itemMap ) {\r\n\t\t\t$params = array('session_cookie'=>$itemMap['cart_session'],'dealid'=>$itemMap['dealid']);\r\n\t\t\t$this->db->select('COUNT(*) as count')->from(TABLES::$ORDER_DEALS_CART)->where($params);\r\n\t\t\t$query = $this->db->get();\r\n\t\t\t$result = $query->result_array();\r\n\t\t\tif($result[0]['count'] <=0 ) {\r\n\t\t\t\t$params = array('session_cookie'=>$itemMap['cart_session'],'restid'=>$itemMap['restid'],'dealid'=>$itemMap['dealid']);\r\n\t\t\t\t/* New item */\r\n\t\t\t\t$this->db->insert(TABLES::$ORDER_DEALS_CART,$params);\r\n\t\t\t\t$map['message'] = 'Deal Applied To Cart';\r\n\t\t\t\t$map['status'] = 0;\r\n\t\t\t}else {\r\n// \t\t\t\t$this->updateDealsInCart( $itemMap );\r\n\t\t\t\t$map['message'] = 'Deal Applied To Cart';\r\n\t\t\t\t$map['status'] = 1;\r\n\t\t\t}\r\n\t\t\treturn $map;\r\n\t\t}", "public function prepare_item_for_response($item, $request)\n {\n return array();\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function add($item)\n {\n if ($item instanceof ItemInterface) {\n $this->items[] = $item;\n } else {\n $this->items[] = new PayPalItem($item);\n }\n }", "public function add($item)\n {\n $this->addArray('content', $item, array('ButtonContainer', 'Container', 'Form', 'Heading', 'HTML', 'Image', 'Checkbox', 'Email', 'HiddenField', 'Label', 'Password', 'Phone', 'RadioButtons', 'SelectMenu', 'TextInput', 'TextArea', 'Upload', 'XList', 'Table'));\n }", "public function prepare_item_for_response( $item, $request ) {\n return array();\n }", "public function addItem($feedItem)\n {\n $this->items[] = $feedItem;\n }", "public function addItem($item_id, $item_type) {\n $this->apiCall('items.json', 'POST', array('pio_iid' => $item_id, 'pio_itypes' => $item_type));\n }", "public function addResponseData(array $responseData = []);", "public function addItem(SagepayItem $item)\r\n {\r\n $this->_items[] = $item;\r\n }", "public static function items() {\r\n $doc = new DOMDocument ('1.0', 'UTF-8');\r\n $items_node = $doc->createElement(\"items\");\r\n $doc->appendChild($items_node);\r\n\r\n return new amvonetroom_XmlResponse($items_node);\r\n }", "public function addItem(Collection $collection, ItemCreateStruct $itemCreateStruct): Item;", "private function addItemsToFeed()\n {\n foreach ($this->items as $item) {\n /** @var SimpleXMLElement $feedItemNode */\n $feedItemNode = $this->feed->channel->addChild('item');\n foreach ($item->nodes() as $itemNode) {\n if (is_array($itemNode)) {\n foreach ($itemNode as $node) {\n $feedItemNode->addChild($node->get('name'), $node->get('value'), $node->get('_namespace'));\n }\n } else {\n $itemNode->attachNodeTo($feedItemNode);\n }\n }\n }\n }", "abstract public function add_item();", "public function addItem($item){\n $this->items[] = $item;\n }", "public function addBasketItemParams()\n {\n $oBasket = $this->getBasket();\n $oLang = $this->getLang();\n $oRequest = $this->getPayPalRequest();\n\n $iPos = 0;\n foreach ($oBasket->getContents() as $oBasketItem) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", getStr()->html_entity_decode($oBasketItem->getTitle()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasketItem->getUnitPrice()->getPrice()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", (int) $oBasketItem->getAmount());\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_ITEMURL{$iPos}\", $oBasketItem->getLink());\n\n $oBasketProduct = $oBasketItem->getArticle();\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NUMBER{$iPos}\", $oBasketProduct->oxarticles__oxartnum->value);\n\n $iPos++;\n }\n\n //adding payment costs as product\n if ($oBasket->getPayPalPaymentCosts() > 0) {\n $sPaymentTitle = $oLang->translateString(\"OEPAYPAL_SURCHARGE\") . \" \" . $oLang->translateString(\"OEPAYPAL_TYPE_OF_PAYMENT\");\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $sPaymentTitle);\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalPaymentCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n\n $iPos++;\n }\n\n //adding wrapping as product\n if ($oBasket->getPayPalWrappingCosts() > 0) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $oLang->translateString(\"OEPAYPAL_GIFTWRAPPER\"));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalWrappingCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n\n $iPos++;\n }\n\n //adding greeting card as product\n if ($oBasket->getPayPalGiftCardCosts() > 0) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $oLang->translateString(\"OEPAYPAL_GREETING_CARD\"));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalGiftCardCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n\n $iPos++;\n }\n\n //adding trusted shops protection as product\n if ($oBasket->getPayPalTsProtectionCosts() > 0) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $oLang->translateString(\"OEPAYPAL_TRUSTED_SHOP_PROTECTION\"));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalTsProtectionCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n }\n }", "public function addToItemResults(\\StructType\\ItemResult $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\StructType\\ItemResult) {\n throw new \\InvalidArgumentException(sprintf('The ItemResults property can only contain items of \\StructType\\ItemResult, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->ItemResults[] = $item;\n return $this;\n }", "public function addItemFromArray($item_array)\n {\n $this->items[] = new sfSitemapItem($item_array);\n \n return $this;\n }", "public function addItem($item)\n {\n if (!$this->getItems()) {\n return $this->setItems(array($item));\n } else {\n return $this->setItems(\n array_merge($this->getItems(), array($item))\n );\n }\n }", "protected function process_response() {\n\t\t\t$this->response['response']['Message'] = isset($this->response['response']['Message']) ? $this->response['response']['Message'] : '';\n\t\t\t$this->response['response']['error'] = (strpos(strtolower($this->response['response']['Message']), 'invalid') !== false) ? true : $this->response['response']['error'];\n\t\t\t$this->response['response']['error'] = (strpos(strtolower($this->response['response']['Message']), 'the item code was specified more than once') !== false) ? true : $this->response['response']['error'];\n\t\t\t$this->response['response']['Level1Code'] = $this->request['Level1Code'];\n\t\t\t\n\t\t\tif (!$this->response['response']['error']) { // IF Error is False\n\t\t\t\tif (in_array($this->response['server']['http_code'], array('200', '201', '202', '204'))) {\n\t\t\t\t\t$this->log_sendlogitem($this->request['Level1Code']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->log_error($this->response['response']['Message']);\n\t\t\t}\n\t\t}", "function addItem(){\r\n\t global $itemsArray;\r\n\r\n //when the user clicks add, I pass id to the URL bar as a query string, again I'm checking if it exist or not (if the user has \r\n\t //clicked the add button or not)\r\n\r\n\t//if it exists on the URL bar I begin the magic of adding items to the Cart\r\n\r\n\tif ( isset( $_GET[\"itemId\"] ) ) {\r\n\t\t\r\n\t\t//This is the session that stores the total Price of the items in the cart\r\n\t\t//here I'm initializing it to zero....only if it doesn't exists at this point in time\r\n\t\t//if I don't put the ! sign the session will always be zero coz it's gonna be re-initized to zero everytime the\r\n //page is refreshed (everytime the add button is clicked)\r\n\t\tif(!isset($_SESSION[\"total\"])){\r\n\t\t\t$_SESSION[\"total\"] = 0;\r\n\t\t}\r\n //does the same as the above code but for the number of items in the cart\r\n\t\tif(!isset($_SESSION[\"nuOfItems\"])){\r\n\t\t\t$_SESSION[\"nuOfItems\"] = 0;\r\n\t\t}\r\n\r\n\t\t//==================================================================================================\r\n\t\t\t\t//ADDING ITEM TO THE CART\r\n\t\t//==================================================================================================\r\n\t\t\t\r\n \r\n //The code below ads items to the cart.....I grab the itemID from the URL bar and assign to a varible named itemId\r\n\t\t$itemId = (int) $_GET[\"itemId\"];\r\n\t\t//I grab the price from the URL bar also\r\n\t\t$price = $_GET[\"price\"];\r\n\r\n\t\t\t\r\n\t\tif (!isset( $_SESSION[\"cart\"][$itemId] ) ) {\r\n\r\n \r\n //kinda hard to explain....when this scripts loads I store objects of all items in the datbase to the $itemsArray, \r\n\t\t\t //each object in the array is indexed by it's id...Ok...\r\n\t\t\t //ie object1 will be at index 3 if it's Id is 3 .... ($itemsArray[3] = object1;)\r\n //now the statement below says take whatever object that is stored at index $itemId , in the itemsArray object and store\r\n\t\t\t // to the cart\r\n\r\n\t\t\t//reference: Beginning PHP 5.3 by Matt Doyle (Downloadable from google) ,Page 284. - Create a Simple Shopping Cart\r\n\r\n\t\t\t$_SESSION[\"cart\"][$itemId] = $itemsArray[$itemId];\r\n\r\n\r\n\t\t\t$_SESSION[\"nuOfItems\"] = $_SESSION[\"nuOfItems\"]+1; //increments the number of items in the cart \r\n\t\t\t$_SESSION[\"total\"] = $_SESSION[\"total\"]+$price; //increments current total by the that is recived from the URL\r\n\r\n\r\n\t\t}\r\n\t\t\r\n \r\n\t\t\t\r\n\t\t\r\n\t}\r\n\tsession_write_close();\r\n\t//header( \"Location: index.php\" ); //redirects the user to the home page\r\n\r\n}", "public static function _register()\n {\n self::assignElements(['AddItemResponseContainer' => ['type' => 'AddItemResponseContainerType', 'xmlns' => self::XMLNS, 'cardinality' => '0..*']], parent::NAME);\n self::assignAttributes([]);\n }", "public function AddItem($item)\n {\n $this->_items[] = $item;\n }", "public function addItem($item)\n\t{\n\t\t$this->_items[] = $item;\n\t}", "public function addToBookResponseLeg(\\Fincallorca\\HitchHikerApi\\Wsdl\\v3_1_388_1\\StructType\\BookResponseLeg $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\Fincallorca\\HitchHikerApi\\Wsdl\\v3_1_388_1\\StructType\\BookResponseLeg) {\n throw new \\InvalidArgumentException(sprintf('The BookResponseLeg property can only contain items of \\Fincallorca\\HitchHikerApi\\Wsdl\\v3_1_388_1\\StructType\\BookResponseLeg, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->BookResponseLeg[] = $item;\n return $this;\n }", "function json_add_post() {\n\n\n $status = 0;\n $message = \"Product not processed successfully.\";\n $dealer = $this->post('sellerid');\n $user = $this->post('user');\n $item = $this->post('item');\n $role = $this->post('role');\n $dt = date(\"Y-m-d H:i:s\");\n $qty = $this->post('qty');\n $json_qty = $this->post('json_qty');\n $json_encode_array = json_decode($json_qty, true);\n $flag = false;\n $processed_items = 0;\n foreach ($json_encode_array as $key => $value) {\n $data = array(\"dealer\" => $dealer, \"branch_price_id\" => $key);\n $cart_qry = $this->model_all->getTableData(\"seller_cart_items\", $data);\n if ($cart_qry->num_rows() > 0) {\n $cart_rs = $cart_qry->row_array();\n $data[\"product_count\"] = $value;\n $data[\"modifiedon\"] = $dt;\n $data[\"added_by\"] = $user;\n $data[\"added_role\"] = $role;\n $aff_rows = $this->model_all->update($data, array(\"id\" => $cart_rs[\"id\"]), \"seller_cart_items\");\n if ($aff_rows) {\n $flag = true;\n $processed_items++;\n }\n } else {\n $data[\"product_count\"] = $value;\n $data[\"modifiedon\"] = $dt;\n $data[\"added_by\"] = $user;\n $data[\"added_role\"] = $role;\n $id = $this->model_all->save($data, \"seller_cart_items\");\n if ($id > 0) {\n $flag = true;\n $processed_items++;\n }\n }\n }\n\n\n\n\n\n\n $items_count_qry = $this->model_all->getTableData(\"seller_cart_items\", array(\"dealer\" => $dealer));\n if ($flag) {\n $status = 1;\n $message = $processed_items . \" Items Processed Successfully\";\n }\n\n\n $result[\"status\"] = $status;\n $result[\"message\"] = $message;\n $result[\"items_count\"] = $items_count_qry->num_rows();\n\n $this->response($result, 200);\n\n exit;\n }", "public function addContainer($data) {\n try {\n $client = new Zend_Soap_Client($this->CONTAINER_WSDL_URI);\n $options = array('soap_version' => SOAP_1_1,\n 'encoding' => 'ISO-8859-1',\n );\n $client->setOptions($options);\n $client->action = 'createContainer';\n $result = $client->createContainer(\n $this->toXml(\n array(\n 'backgroundColor' => $data['backgroundColor'],\n 'borderBottom' => $data['borderBottom'],\n 'borderBottomColor' => $data['borderBottomColor'],\n 'borderBottomStyle' => $data['borderBottomStyle'],\n 'borderBottomUnit ' => $data['borderBottomUnit'],\n 'borderLeft' => $data['borderLeft'],\n 'borderLeftColor' => $data['borderLeftColor'],\n 'borderLeftStyle' => $data['borderLeftStyle'],\n 'borderLeftUnit' => $data['borderLeftUnit'],\n 'borderRight' => $data['borderRight'],\n 'borderRightColor' => $data['borderRightColor'],\n 'borderRightStyle' => $data['borderRightStyle'],\n 'borderRightUnit' => $data['borderRightUnit'],\n 'borderTop' => $data['borderTop'],\n 'borderTopColor' => $data['borderTopColor'],\n 'borderTopStyle' => $data['borderTopStyle'],\n 'borderTopUnit' => $data['borderTopUnit'],\n 'bottomMargin' => $data['bottomMargin'],\n 'bottomMarginUnit' => $data['bottomMarginUnit'],\n 'bottomPadding' => $data['bottomPadding'],\n 'bottomPaddingUnit' => $data['bottomPaddingUnit'],\n 'containerHeight' => $data['containerHeight'],\n 'containerId' => $data['containerId'],\n 'containerName' => $data['containerName'],\n 'containerWidth' => $data['containerWidth'],\n 'containerXaxis' => $data['containerXaxis'],\n 'containerYaxis' => $data['containerYaxis'],\n 'css' => $data['css'],\n 'font' => $data['font'],\n 'fontAlignment' => $data['fontAlignment'],\n 'fontColor' => $data['fontColor'],\n 'fontSize' => $data['fontSize'],\n 'isActive' => true,\n 'isBold' => $data['isBold'],\n 'isBorderColorSameForAll' => $data['isBorderColorSameForAll'],\n 'isBorderStyleSameForAll' => $data['isBorderStyleSameForAll'],\n 'isBorderWidthSameForAll' => $data['isBorderWidthSameForAll'],\n 'isItalic' => $data['isItalic'],\n 'isMargineSameForAll' => $data['isMargineSameForAll'],\n 'isPaddingSameForAll' => $data['isPaddingSameForAll'],\n 'leftMargin' => $data['leftMargin'],\n 'leftMarginUnit' => $data['leftMarginUnit'],\n 'leftPadding' => $data['leftPadding'],\n 'leftPaddingUnit' => $data['leftPaddingUnit'],\n 'letterSpacing' => $data['letterSpacing'],\n 'lineHeight' => $data['lineHeight'],\n 'primaryKey' => 0,\n 'rightMargin' => $data['rightMargin'],\n 'rightMarginUnit' => $data['rightMarginUnit'],\n 'rightPadding' => $data['rightPadding'],\n 'rightPaddingUnit' => $data['rightPaddingUnit'],\n 'textDecoration' => $data['textDecoration'],\n 'topMargin' => $data['topMargin'],\n 'topMarginUnit' => $data['topMarginUnit'],\n 'topPadding' => $data['topPadding'],\n 'topPaddingUnit' => $data['topPaddingUnit'],\n 'updatedby' => $_SESSION['Username'],\n 'updatedt' => date('Y-m-d') . 'T' . date('H:i:s') . 'Z',\n 'wordSpacing' => $data['wordSpacing'],\n )\n ,$rootNodeName = 'AddContainer')\n );\n return $result;\n } catch (Exception $e) {\n // print_r($e);\n }\n }", "public function addPricesToCollection($response)\n {\n if (isset($response['Book'])) {\n foreach ($response['Book'] as $offer) {\n $offer = (object) $offer;\n $price = $this->createNewPrice();\n if (isset($offer->listingPrice)) {\n if (isset($offer->listingCondition) && strtolower($offer->listingCondition) == 'new book') {\n $price->condition = parent::CONDITION_NEW;\n } elseif (isset($offer->itemCondition)) {\n $price->condition = $this->getConditionFromString($offer->itemCondition);\n }\n if (empty($price->condition)) {\n $price->condition = parent::CONDITION_GOOD;\n }\n $price->isbn13 = $offer->isbn13;\n $price->price = $offer->listingPrice;\n $price->shipping_price = $offer->firstBookShipCost;\n $price->url = 'http://affiliates.abebooks.com/c/74871/77797/2029?u='.urlencode($offer->listingUrl);\n $price->retailer = self::RETAILER;\n $price->term = parent::TERM_PERPETUAL;\n }\n $this->addPriceToCollection($price);\n }\n }\n return $this;\n }", "protected function responseToItems($response)\n {\n $array = array();\n foreach($response->product as $current) {\n\n if( !isset($current->name) || \n !isset($current->regularPrice) || \n !isset($current->url) || \n !isset($current->productId) ) \n {\n //If any of the required info is not present skip this item.\n continue;\n }\n\n $item = new Item();\n $item->setName((string)$current->name);\n $item->setPrice(intval((string)$current->regularPrice), Item::CURRENCY_UNIT_DOLLAR);\n $item->setLink((string)$current->url);\n $item->setvendorId((string)$current->productId);\n \n if(isset($current->thumbnailImage))\n {\n $item->setSmallImage((string)$current->thumbnailImage);\n }\n \n if(isset($current->image))\n {\n $item->setMediumImage((string)$current->image);\n }\n \n $array[] = $item;\n }\n\n return $array;\n\n }", "public function addToItemID($itemID)\n {\n $this->itemID[] = $itemID;\n return $this;\n }", "public function addItem(array $item)\n {\n // if is multidimensional\n if (array_key_exists(1, $item)) {\n foreach ($item as $i) {\n $this->addItem($i);\n }\n return;\n }\n\n if ($this->shortening) {\n $append = (strlen($item['description']) > $this->shorteningLimit) ? '...' : '';\n $item['description'] = mb_substr($item['description'], 0, $this->shorteningLimit, 'UTF-8') . $append;\n }\n\n if (isset($item['title'])) {\n $item['title'] = htmlspecialchars(strip_tags($item['title']), ENT_COMPAT, 'UTF-8');\n }\n\n if (isset($item['subtitle'])) {\n $item['subtitle'] = htmlspecialchars(strip_tags($item['subtitle']), ENT_COMPAT, 'UTF-8');\n }\n\n $this->items[] = $item;\n }", "private function addPlaylistItem()\n {\n try\n {\n $request = $_POST;\n\n if( !isset($request['pid']) || $request['pid']==\"\" )\n throw_error_msg(\"playlist id not provided\");\n else if(!is_numeric($request['pid']))\n throw_error_msg(\"invalid playlist id\"); \n else\n $pid = (int)$request['pid'];\n\n if( !isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"videoid not provided\");\n else if(!is_numeric($request['videoid']))\n throw_error_msg(\"invalid videoid\"); \n else\n $id = (int)$request['videoid']; \n \n global $cbvid; \n $item_id = $cbvid->action->add_playlist_item($pid, $id);\n\n if( error() )\n {\n $error = error();\n throw_error_msg($error[0]); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'item has been added to playlist successfully', \"data\" => array());\n $this->response($this->json($data));\n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "function addItem($itemKey){\n\t\t\t//if the item already exsists in the cart, add one.\n\t\t\tif(isset($this->items[$itemKey])){\n\t\t\t\t$this->items[$itemKey]['quantity'] = $this->items[$itemKey]['quantity'] + 1; \n\t\t\t}\n\t\t\t\n\t\t\t//if the item is not already set in the cart.\n\t\t\t//Find the correct price off the item from the server side $products\n\t\t\t//note - I am looking up the prices server-side to protect from customers entering in their own prices in the html\n\t\t\telse{\n\t\t\t\t//find the corresponding product based on the product name (keys would be preferable)\n\t\t\t\tforeach($GLOBALS['products'] as $product){\t\t\n\t\t\t\t\tif($itemKey == $product['name']){\n\t\t\t\t\t\t//set the item price server-side\n\t\t\t\t\t\t$itemPrice = $product['price'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//if there is a valid product with that name (key) and therefore has a corresponding price.\n\t\t\t\t//add it to the cart otherwise ignore it\n\t\t\t\t//note - This protects the server from having items in the shopping cart that don't exsist server side. \n\t\t\t\tif(isset($itemPrice)){\n\t\t\t\t\t$this->items[$itemKey] = array( \"name\" => $itemKey, \"price\" => $itemPrice , \"quantity\" => 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\t\t\n\t\t\treturn;\n\t\t}", "public function addItems(array $items);", "public function addAction()\r\n {\r\n $form = $this->getEditItemForm();\r\n $response = $this->getResponse();\r\n $content = $this->renderViewModel('dots-nav-block/item-add', array('form' => $form));\r\n $response->setContent($content);\r\n return $response;\r\n }", "public function prepare_item_for_response( $item, $request ) {\n\t\t$data = $this->add_additional_fields_to_object( $item, $request );\n\t\t$data = $this->filter_response_by_context( $data, 'view' );\n\t\t$response = rest_ensure_response( $data );\n\n\t\t/**\n\t\t * Filter the list returned from the API.\n\t\t *\n\t\t * @param WP_REST_Response $response The response object.\n\t\t * @param array $item The original item.\n\t\t * @param WP_REST_Request $request Request used to generate the response.\n\t\t */\n\t\treturn apply_filters( 'woocommerce_rest_prepare_reports_import', $response, $item, $request );\n\t}", "function RenderItem( &$item, &$renderer, $isLast ) {\n\t\t$itemInfo['identifier'] = $item->getAttribute('identifier');\n\t\t\n\t\t$itemInfo['isLast'] = $isLast;\n\t\t\n\t\tif( $item->hasAttribute('identifierref') )\n\t\t\t$itemInfo['identifierref'] = $item->getAttribute('identifierref');\n\t\telse\n\t\t $itemInfo['identifierref'] = FALSE;\n\n\t\tif( $item->hasAttribute('isvisible') )\n\t\t $itemInfo['isvisible'] = ($item->getAttribute('isvisible')=='true')?TRUE:FALSE;\n\t\telse\n\t\t $itemInfo['isvisible'] = TRUE;\n\n\t\tif( $item->hasAttribute('parameters') )\n\t\t $itemInfo['parameters'] = $item->getAttribute('parameters');\n\t\telse\n\t\t $itemInfo['parameters'] = FALSE;\n\t\t\n\t\t$itemInfo['title'] = $this->getFirstElementValue($item, 'title');\n\t\t\n\t\t$itemInfo['adlcp_prerequisites'] = $this->getFirstElementValue($item, 'prerequisites', 'adlcp' );\n\t\t$itemInfo['adlcp_maxtimeallowed'] = $this->getFirstElementValue($item, 'maxtimeallowed', 'adlcp');\n\t\t$itemInfo['adlcp_timelimitaction'] = $this->getFirstElementValue($item, 'timelimitaction', 'adlcp');\n\t\t$itemInfo['adlcp_datafromlms'] = $this->getFirstElementValue($item, 'datafromlms', 'adlcp');\n\t\t$itemInfo['adlcp_masteryscore'] = $this->getFirstElementValue($item, 'masteryscore', 'adlcp');\n\t\t//$itemInfo['adlcp_completionthreshold'] = $this->getFirstElementValue($item, 'completionthreshold', 'adlcp');\n\t\t$threshold_elem = $this->getNodeElement($item, 'completionthreshold', 'adlcp');\n\t\tif( $threshold_elem && $threshold_elem->hasAttribute('minProgressMeasure') )\n\t\t $itemInfo['adlcp_completionthreshold'] = $threshold_elem->getAttribute('minProgressMeasure');\n\t\telse\n\t\t $itemInfo['adlcp_completionthreshold'] = '';\n\t\t\n $elem = $this->getFirstElementNode( $item, 'item');\n if( $elem )\n\t\t\t$itemInfo['isLeaf'] = FALSE;\n\t\telse\n\t\t $itemInfo['isLeaf'] = TRUE;\n\t\t \n\t\tif( $renderer == null ) {\n\t\t\tprint_r( $itemInfo );\n\t\t\t\n\t\t}\n\t\t$renderer->RenderStartItem(\t$this, $itemInfo );\n\t\t\n\t\twhile( $elem ) {\n\t\t\t$nextElem = $this->getNextElementNode( $elem );\n\t\t\t\n\t\t\t/* pass the info about the last element */\n\t\t\tif( $nextElem === NULL )\n\t\t\t $this->RenderItem( $elem, $renderer, true );\n\t\t\telse\n\t\t\t $this->RenderItem( $elem, $renderer, false );\n\t\t\t \n\t\t\t$elem = $nextElem;\n\t\t}\n\n $renderer->RenderStopItem( $this, $itemInfo );\n\n\t}", "function AddItem($item, $object = null, $itemkey = null)\r\n {\r\n if($object != null)\r\n {\r\n throw new Exception('ObjectNew1 functionallity for RadioGroup is not yet implemented.');\r\n }\r\n\r\n //Set the array to the end\r\n end($this->_items);\r\n\r\n //Adds the item as the last one\r\n if($itemkey != null)\r\n {\r\n $this->_items[$itemkey] = $item;\r\n }\r\n else\r\n {\r\n $this->_items[] = $item;\r\n }\r\n\r\n return ($this->Count);\r\n }", "function addItem(SitemapItem $item){\r\n $this->items[] = $item;\r\n }", "public function appendItem($item): CollectionInterface;", "public function addResponses(SurveyManager_Entity_Response $response)\n {\n $this->responses->add($response);\n $response->setSurvey($this);\n }", "public function rebuildItems() {\n\t\t##\n\t\t##\tRETURNS\n\t\t##\t\tThe last modified timestamp\n\t\t$lastModified = time();\n\t\t$addedIDs = array();\n\t\t$totalPages = $this->getTotalPages();\n\t\tif($totalPages) {\n\t\t\tfor($i=1;$i<=$totalPages;$i++) {\n\t\t\t\t$items = $this->getItems($i);\n\t\t\t\tif($items && count($items)) {\n\t\t\t\t\tforeach($items as $item) {\n\t\t\t\t\t\t$campaign_id = '';\n\t\t\t\t\t\tif(isset($item->offer_url)) {\n\t\t\t\t\t\t\t$parts = parse_url($item->offer_url);\n\t\t\t\t\t\t\t$query = array();\n\t\t\t\t\t\t\tparse_str($parts['query'],$query);\n\t\t\t\t\t\t\t$campaign_id = $query['cId'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t'id' => $item->id,\n\t\t\t\t\t\t\t'campaign_id' => $campaign_id,\n\t\t\t\t\t\t\t'artist_id' => $item->artist_id,\n\t\t\t\t\t\t\t'reporting_name' => $item->reporting_name,\n\t\t\t\t\t\t\t'embed_code' => $item->embed_code,\n\t\t\t\t\t\t\t'width' => $item->width,\n\t\t\t\t\t\t\t'height' => $item->height,\n\t\t\t\t\t\t\t'url' => $item->url,\n\t\t\t\t\t\t\t'poster_image' => $item->poster_image,\n\t\t\t\t\t\t\t'poster_image_source' => (isset($item->poster_image_source)) ? $item->poster_image_source : '',\n\t\t\t\t\t\t\t'product_type' => $item->product_type,\n\t\t\t\t\t\t\t'offer_type' => $item->offer_type,\n\t\t\t\t\t\t\t'description' => $item->description,\n\t\t\t\t\t\t\t'currency' => $item->currency,\n\t\t\t\t\t\t\t'price' => $item->price,\n\t\t\t\t\t\t\t'name' => $item->name,\n\t\t\t\t\t\t\t'campaign' => serialize($item->campaign),\n\t\t\t\t\t\t\t'offer_url' => (isset($item->offer_url)) ? $item->offer_url : '',\n\t\t\t\t\t\t\t'mobile_url' => (isset($item->mobile_url)) ? $item->mobile_url : '',\n\t\t\t\t\t\t\t'last_modified' => date('Y-m-d H:i:s',$lastModified)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$format = array('%d','%d','%d','%s','%s','%d','%d','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s');\n\t\n\t\t\t\t\t\t## Get Keys\n\t\t\t\t\t\t$tableFields = implode(',',array_keys($data));\n\t\t\t\t\t\t$tableFormat = implode(',',$format);\n\t\t\t\t\t\t$onDuplicateKeyUpdate = '';\n\t\t\t\t\t\t$keyIndex = 0;\n\t\t\t\t\t\tforeach($data as $key=>$field) {\n\t\t\t\t\t\t\tif($keyIndex>0) { $onDuplicateKeyUpdate .= ', '; }\n\t\t\t\t\t\t\t$onDuplicateKeyUpdate .= $key.'=VALUES('.$key.')';\n\t\t\t\t\t\t\t$keyIndex++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t## Add item\n\t\t\t\t\t\t$sql = <<<EOD\n\t\t\t\t\t\tINSERT INTO {$this->wpdb->prefix}topspin_items ({$tableFields}) VALUES ({$tableFormat})\n\t\t\t\t\t\tON DUPLICATE KEY UPDATE {$onDuplicateKeyUpdate}\nEOD;\n\t\t\t\t\t\t$this->wpdb->query($this->wpdb->prepare($sql,$data));\n\t\n\t\t\t\t\t\t##\tDeletes old item tags\n\t\t\t\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items_tags WHERE item_id = %d';\n\t\t\t\t\t\t$this->wpdb->query($this->wpdb->prepare($sql,array($item->id)));\n\t\t\t\t\t\t##\tAdds new item tag\n\t\t\t\t\t\tif(isset($item->tags) && is_array($item->tags)) {\n\t\t\t\t\t\t\t$tagFormat = array('%d','%s');\n\t\t\t\t\t\t\tforeach($item->tags as $tag) {\n\t\t\t\t\t\t\t\t$tagData = array(\n\t\t\t\t\t\t\t\t\t'item_id' => $item->id,\n\t\t\t\t\t\t\t\t\t'tag_name' => $tag\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$this->wpdb->insert($this->wpdb->prefix.'topspin_items_tags',$tagData,$tagFormat);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // end if tags exist\n\t\n\t\t\t\t\t\t##\tDeletes old item images\n\t\t\t\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items_images WHERE item_id = %d';\n\t\t\t\t\t\t$this->wpdb->query($this->wpdb->prepare($sql,array($item->id)));\n\t\t\t\t\t\t##\tAdds new item images\n\t\t\t\t\t\tif(isset($item->campaign->product->images) && is_array($item->campaign->product->images)) {\n\t\t\t\t\t\t\t$imageFormat = array('%d','%s','%s','%s','%s');\n\t\t\t\t\t\t\tforeach($item->campaign->product->images as $key=>$image) {\n\t\t\t\t\t\t\t\t$imageData = array(\n\t\t\t\t\t\t\t\t\t'item_id' => $item->id,\n\t\t\t\t\t\t\t\t\t'source_url' => $item->campaign->product->images[$key]->source_url,\n\t\t\t\t\t\t\t\t\t'small_url' => $item->campaign->product->images[$key]->small_url,\n\t\t\t\t\t\t\t\t\t'medium_url' => $item->campaign->product->images[$key]->medium_url,\n\t\t\t\t\t\t\t\t\t'large_url' => $item->campaign->product->images[$key]->large_url\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$this->wpdb->insert($this->wpdb->prefix.'topspin_items_images',$imageData,$imageFormat);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} //end if images exist\n\t\n\t\t\t\t\t\tarray_push($addedIDs,$item->id);\n\t\t\t\t\t} //end for each item\n\t\t\t\t} //end if items\n\t\t\t} //end for each page\n\n\t\t\t##\tRemoves all items that is not modified/inserted\n\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items WHERE last_modified < %s';\n\t\t\t$this->wpdb->query($this->wpdb->prepare($sql,array(date('Y-m-d H:i:s',$lastModified))));\n\n\t\t\t##\tRemoves all item tags that is not modified/inserted\n\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items_tags WHERE item_id NOT IN (SELECT id FROM '.$this->wpdb->prefix.'topspin_items)';\n\t\t\t$this->wpdb->query($this->wpdb->prepare($sql));\n\n\t\t\t##\tRemoves all item images that is not modified/inserted\n\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items_images WHERE item_id NOT IN (SELECT id FROM '.$this->wpdb->prefix.'topspin_items)';\n\t\t\t$this->wpdb->query($this->wpdb->prepare($sql));\n\t\t\treturn $lastModified;\n\t\t}\n\t}", "public function add($item)\n {\n $newCollection[] = $this->items;\n $newCollection[] = $item;\n $this->items = $newCollection;\n return $newCollection;\n }", "public function add($item)\n {\n\n $this->items[] = $item;\n return $this;\n\n }", "public function process(ContainerBuilder $container)\n {\n if (!$container->has(ResponseBuilder::class)) {\n return;\n }\n\n $builderDefinition = $container->findDefinition(ResponseBuilder::class);\n\n // it is unused for now, but can be useful for multiple serializers\n $serializerServices = $container->findTaggedServiceIds(SerializerInterface::TAG);\n foreach (array_keys($serializerServices) as $serializerService) {\n $builderDefinition->addMethodCall('addSerializer', [new Reference($serializerService)]);\n }\n }", "public function add($item)\n {\n $this->manuallyAddedData[] = $item;\n }", "public function addItemList($key, $value)\n {\n return $this->client->sAdd($key, $value);\n }", "public function addAction(Request $request, Context $context, EditToken $token, LayoutInterface $layout, int $containerId, string $itemType, string $itemId, int $position = 0, string $style = ItemInterface::STYLE_DEFAULT)\n {\n $this->ensureLayout($token, $layout);\n $item = $this->typeRegistry->getType($itemType, false)->create($itemId, $style);\n $item->setLayoutId($layout->getId());\n\n if ($containerId) {\n $container = $layout->findContainer($containerId);\n } else {\n $container = $layout->getTopLevelContainer();\n }\n\n if ($item instanceof ContainerInterface) {\n throw new GenericError(\"you cannot add a container into a container\");\n }\n if (!$container instanceof TopLevelContainer && !$container instanceof ColumnContainer) {\n throw new GenericError(\"you cannot add items into a non-vertical container\");\n }\n\n $container->addAt($item, $position);\n\n $context->getTokenStorage()->update($token->getToken(), $layout);\n\n $this->prepareResponse($request, $context, $token);\n\n return $this->handleResponse($request, ['success' => true, 'output' => $this->renderer->renderItemIn($item, $container, $position)]);\n }", "public function addItem($item)\n {\n // Push item into list of array\n array_push($this->items, $item);\n }", "public function addItemsDetails($description,$price,$quantity,$reference){\r\n\t\tif ( $this->_requestDetails==null )\r\n\t\t\t$this->_requestDetails = array();\r\n\t\t$nItem = count($this->_requestDetails);\r\n\t\tarray_push($this->_requestDetails, array(\"L_PAYMENTREQUEST_0_NAME\".$nItem=>$description,\"L_PAYMENTREQUEST_0_AMT\".$nItem=>$price,\"L_PAYMENTREQUEST_0_QTY\".$nItem=>$quantity,\"L_PAYMENTREQUEST_0_NUMBER\".$nItem=>$reference ));\r\n\t}", "public function addMultipleItems($items){\r\n if(!empty($items)){foreach($items as $item){ //lopp through the items\r\n $this->addSimpleItem($item); //And add them 1 by 1\r\n }}\r\n }", "public function addToCart()\n\t{\n\t\t$id \t= $this->request['item_id'];\n\t\t$number = intval($this->request['quantity']);\n\t\t\n\t\t#permission and enabled?\n\t\t$this->registry->ecoclass->canAccess('cart', false);\n\t\t\n\t\t#init\n\t\t$checks \t\t= array();\n\n\t\t#break up the item classification that we're adding to our cart\t\t\t \n\t\t$item_input_name = explode('_' , $id);\n\n\t\t$type \t\t\t= $item_input_name[0];\n\t\t$id \t\t\t= $item_input_name[1];\n\t\t$banktype \t\t= strtolower($item_input_name[2]);\n\n\t\t#loan hotfix\n\t\t$type\t\t\t= ( $banktype != 'loan' ) ? $type : $banktype;\n\t\t\n\t\t#grab this cart types class object\n\t\t$cartItemType = $this->registry->ecoclass->grabCartTypeClass($type);\n\n\t\t#format number a bit..\t\n\t\t$number = $this->registry->ecoclass->makeNumeric($number, true);\n\n\t\t#grab item from cache\n\t\t$theItem\t= $cartItemType->grabItemByID($id);\n\t\t\t\t\n\t\t#check for any illegal activity :shifty:\n\t\t$checks = $this->checkCartAdditions( $id, $type, $banktype, $number, $theItem, false, $cartItemType );\n\t\t\n\t\t#if after all that we have an error...\n\t\tif ( $checks['error'] )\n\t\t{\n\t\t\t$this->registry->output->showError( $checks['error'] );\n\t\t}\n\n\t\t#no error? Lets throw the item and number in our cart!\n\t\tif ( $checks['cartItem'] )\n\t\t{\n\t\t\t$add2Item = array('c_quantity' => $checks['cartItem']['c_quantity'] + $checks['number'] );\n\t\t\t\t\t\t\t\n\t\t\t$this->DB->update( 'eco_cart', $add2Item, 'c_member_id = ' .$this->memberData['member_id'].' AND c_id = '.$checks['cartItem'] ['c_id'] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$newItem = array( 'c_member_id' \t=> $this->memberData['member_id'],\n\t\t\t\t\t\t\t 'c_member_name'\t=> $this->memberData['members_display_name'],\n\t\t\t\t\t\t\t 'c_type' \t\t\t=> ( $type == 'loan' ) ? 'bank' : $type,\n\t\t\t\t\t\t\t 'c_type_id' \t\t=> $id,\n\t\t\t\t\t\t\t 'c_type_class' \t=> ( $type == 'bank' || $type == 'loan' ) ? $banktype : '',\n\t\t\t\t\t\t\t 'c_quantity'\t\t=> $checks['number'],\n\t\t\t\t\t\t\t);\n\t\t\t$this->DB->insert( 'eco_cart', $newItem );\n\t\t}\n\t\t\n\t\t#redirect message and show what we added\n\t\t$redirect_message = $cartItemType->add2CartRedirectMessage($checks, $theItem);\n\t\t\n\t\t$this->registry->output->redirectScreen( $redirect_message, $this->settings['base_url'] . \"app=ibEconomy&amp;tab=buy&amp;area=cart\" );\n\t}", "public function addToGetStoryInfoByGenartReturn(\\StructType\\ExtStoryListContainerV2 $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\StructType\\ExtStoryListContainerV2) {\n throw new \\InvalidArgumentException(sprintf('The getStoryInfoByGenartReturn property can only contain items of type \\StructType\\ExtStoryListContainerV2, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->getStoryInfoByGenartReturn[] = $item;\n return $this;\n }", "public function addItemStock()\n {\n $this->validate($this->request, [\n 'itemCondition' => 'required|string',\n 'itemStateId' => 'required|integer|min:1',\n ]);\n $items = array(\n 'itemStateId' => $this->request->input('itemStateId'),\n 'itemCondition' => $this->request->input( 'itemCondition'),\n );\n $id = $this->request->id;\n try {\n $item = new ItemService();\n $result = $item->addToItemStock($items, $id);\n\n if ($result) {\n return response()->json([\n 'success' => true,\n 'data' => [\n 'itemId' => $result,\n ],\n 'message' => 'Item Added Successfully',\n ], 200);\n }\n return response()->json([\n 'success' => false,\n 'message' => 'item could not be added'\n ], 400);\n } catch (Exception $ex) {\n return response()->json([\n 'success' => false,\n 'message' => 'Error Occured Adding Items. Ensure the IDs are Valid'\n ], 400);\n }\n }", "public function addSimpleItem($item){\t\t\r\n if( //Check the quantity and the name\r\n !empty($item['quantity']) \r\n && is_numeric($item['quantity']) \r\n && $item['quantity']>0 \r\n && !empty($item['name'])\r\n ){ //And add the item to the cart if it is correct\r\n $items = $this->items;\r\n $items[] = $item;\r\n $this->items = $items;\r\n }\r\n }", "public function addElement($item)\n {\n $this->items[$this->itemsCount] = $item;\n $this->itemsCount++;\n }", "public function add_item_cart($item){\r\n\t\t$cart_data = $this->main->connector->get_session('lumise_cart');\r\n\t\tif($cart_data == null)\r\n\t\t\t$cart_data['items'] = array();\r\n\t\t\t\r\n\t\t$cart_data['items'][$item['cart_id']] = $item;\r\n\t\t$this->main->connector->set_session('lumise_cart', $cart_data);\r\n\t}", "public function build_ssmlResponse($ssml, $displayText) {\n\t $response = array(\n\t\t 'simpleResponse' => array(\n\t\t\t 'ssml' => $ssml,\n\t\t\t 'displayText' => $displayText\n\t\t\t)\n\t\t);\n\t\t$this->items[] = $response;\n }", "public function testAddItems()\n {\n $addItems = [];\n $addItems[] = [\n 'sku' => 'test'\n ];\n $failedItems[] = [\n 'item' => [\n 'sku' => 'dummy'\n ]\n ];\n $quote = $this->getMockBuilder(\\Magento\\Quote\\Model\\Quote::class)\n ->disableOriginalConstructor()\n ->getMock();\n $this->cartFactory->expects($this->once())->method('create')->willReturn($this->cartMock);\n $this->cartMock->expects($this->once())->method('setQuote')->with($quote)->willReturnSelf();\n $this->cartMock->expects($this->once())\n ->method('setContext')\n ->with(\\Magento\\AdvancedCheckout\\Model\\Cart::CONTEXT_ADMIN_CHECKOUT)\n ->willReturnSelf();\n $this->cartMock->expects($this->once())->method('getFailedItems')->willReturn($failedItems);\n $this->cartMock->expects($this->once())->method('prepareAddProductsBySku')->with($addItems)->willReturnSelf();\n $this->cartMock->expects($this->once())\n ->method('saveAffectedProducts')\n ->with($this->cartMock, false)\n ->willReturnSelf();\n\n $this->assertTrue($this->cart->addItems($quote, $addItems));\n }", "public static function endEbayListing($items)\n\t{\n\t\t$results = array();\n\t\ttry {\n\t\t\t$endListingResultXML = ISC_ADMIN_EBAY_OPERATIONS::endItems($items);\n\t\t\tforeach ($endListingResultXML->EndItemResponseContainer as $item) {\n\t\t\t\t$results[] = new ISC_ADMIN_EBAY_END_ITEM_RESULT($item);\n\t\t\t}\n\t\t\treturn $results;\n\t\t} catch (ISC_EBAY_API_REQUEST_EXCEPTION $e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public function addItem($item)\n\t{\n\t\tif(is_array($item))\n\t\t{\n\t\t\t$this->items[] = $item;\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function add($item);", "public function add($item);", "public function add()\n {\n $item = new stdClass();\n $item->item_id = null;\n $item->barcode = null;\n $item->price = null;\n $item->stock = null;\n $item->name = null;\n $item->category_id = null;\n $query_category = $this->categorys_m->get();\n $query_unit = $this->units_m->get();\n $unit[null] = '-Pilih-';\n foreach ($query_unit->result() as $u) {\n\n $unit[$u->unit_id] = $u->name;\n };\n $data = [\n 'page' => 'add',\n 'row' => $item,\n 'category' => $query_category,\n 'unit' => $unit,\n 'selectedunit' => null\n ];\n $this->template->load('template', 'product/item/item_add', $data);\n }", "public function inventoryPush($itemData)\r\n {\r\n if (isset($itemData['records'])) {\r\n $itemData = $itemData['records'];\r\n }\r\n $response = array();\r\n $response['records'] = array();\r\n $resourceModel = Mage::getResourceModel('retailops_api/api');\r\n\r\n $orderQtys = array();\r\n if( !empty( $itemData ) ) {\r\n Mage::log('In', null, 'retailops.log');\r\n Mage::log(print_r($itemData, true), null, 'retailops.log');\r\n $orderQtys = $resourceModel->getRetailopsNonretrievedQtys();\r\n }\r\n $productIds = $this->getProductIds($itemData);\r\n\r\n foreach ($itemData as $item) {\r\n try {\r\n Mage::dispatchEvent(\r\n 'retailops_inventory_push_record',\r\n array('record' => $stockObj)\r\n );\r\n\r\n $stockObj = $resourceModel->subtractNonretrievedQtys($orderQtys, $item);\r\n\r\n Mage::dispatchEvent(\r\n 'retailops_inventory_push_record_qty_processed',\r\n array('record' => $stockObj)\r\n );\r\n\r\n $this->update($productIds[$stockObj->getSku()], $stockObj->getData());\r\n\r\n $result['status'] = RetailOps_Api_Helper_Data::API_STATUS_SUCCESS;\r\n } catch (Mage_Core_Exception $e) {\r\n $result['status'] = RetailOps_Api_Helper_Data::API_STATUS_FAIL;\r\n $result['error'] = array(\r\n 'code' => $e->getCode(),\r\n 'message' => $e->getMessage()\r\n );\r\n }\r\n $response['records'][] = $result;\r\n }\r\n\r\n return $response;\r\n }", "public function get_listings_details($dom){\t\n\t\t\t//push each entry into new array\n\t\t\t$update_item_array = array();\n\t\t\t$update_item_array['itemnumber'] = array();\n\t\t\t$update_item_array['customlabel'] = array();\n\t\t\t$update_item_array['quantity'] = array();\n\t\t\t$update_item_array['quantitysoldandavailable'] = array();\n\t\t\t$update_item_array['sellprice'] = array();\n\t\t\t$update_item_array['starttime'] = array();\n\t\t\t$update_item_array['endtime'] = array();\n\t\t\t$update_item_array['itemtitle'] = array();\n\t\t\t$update_item_array['stockcntrl'] = array();\n\t\t\t$update_item_array['listingtype'] = array();\n\n\n\t\t\t$update_item_response = $dom->getElementsByTagName(DOM_ELEMENT_LISTINGSSHOW_RESPONSE);\n\n\n\n\t\t\tforeach ($update_item_response as $item){\n\t \t\t\t\n\n\t\t\t\t$activelist = $item->getElementsByTagName(DOM_ELEMENT_LISTINGS_ACTIVELIST);\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tforeach ($activelist as $activelistshow){\n\t\t\t\t\t\n\t\t\t\t\t$itemarrays = $activelistshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMARRAY);\n\n\n\t\t\t\t\tforeach($itemarrays as $itemarray){\n\n\t\t\t\t\t\t$inditems = $itemarray->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMSS);\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\tforeach($inditems as $inditemshow){\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_LISTINGTYPE)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_LISTINGTYPE)->item(0)->nodeValue) : \"Listing Type - Error\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['listingtype'], $costers);\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMID)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMID)->item(0)->nodeValue) : \"Item Num - Error\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['itemnumber'], $costers);\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_SKU)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_SKU)->item(0)->nodeValue) : \"SKU - Error\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['customlabel'], $costers);\n\t\t\t\t\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_QUANTITY)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_QUANTITY)->item(0)->nodeValue) : \"0\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['quantity'], $costers);\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_TOTALQUANTITY)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_TOTALQUANTITY)->item(0)->nodeValue) : \"0\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['quantitysoldandavailable'], $costers);\n\n\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_CURRENTPRICE)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_CURRENTPRICE)->item(0)->nodeValue) : \"price sold - Error\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['sellprice'], $costers);\t\n\n\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STARTTIME)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STARTTIME)->item(0)->nodeValue) : \"0\";\n\n\n\t\t\t\t\t\t\tarray_push($update_item_array['starttime'], $costers);\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ENDTIME)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ENDTIME)->item(0)->nodeValue) : \"\";\n\n\n\t\t\t\t\t\t\tarray_push($update_item_array['endtime'], $costers);\n\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMTITLE)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMTITLE)->item(0)->nodeValue) : \"\";\n\n\n\t\t\t\t\t\t\tarray_push($update_item_array['itemtitle'], $costers);\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STOCKCNTRL)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STOCKCNTRL)->item(0)->nodeValue) : \"FALSE\";\n\n\n\t\t\t\t\t\t\tarray_push($update_item_array['stockcntrl'], $costers);\t\t\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\n\t\t\t\t}\t\t\n\n\n\t\t\t\t//errors\n\t\t\t\t$error_messages = $item->getElementsByTagName(DOM_ELEMENT_ERRORS);\n\n\t\t\t\tforeach ($error_messages as $errormsg){\n\t\t\t\t\t$error = trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) != \"\" ? trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) : \"No Error\";\n\t\t\t\t\tarray_push($update_item_array, $error);\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t}\n\n\t\t\treturn $update_item_array;\n\n\t\t//DOM_ELEMENT_SHORT_ERROR_MSG\n\t\t}", "public function addItem(FeedItem $item) {\n\t\tif (!array_key_exists('items', $this->feedElements)) {\n\t\t\t$this->feedElements['items'] = array();\n\t\t}\n\n\t\t$this->feedElements['items'][] = $item;\n\t}", "function wpbs_action_add_legend_item() {\n\n\t// Verify for nonce\n\tif( empty( $_POST['wpbs_token'] ) || ! wp_verify_nonce( $_POST['wpbs_token'], 'wpbs_add_legend_item' ) )\n\t\treturn;\n\n\t// Verify for the calendar id\n\tif( empty( $_GET['calendar_id'] ) ) {\n\n\t\twpbs_admin_notices()->register_notice( 'legend_item_calendar_id_missing', '<p>' . __( 'Something went wrong. Could not add the legend item.', 'wp-booking-system' ) . '</p>', 'error' );\n\t\twpbs_admin_notices()->display_notice( 'legend_item_calendar_id_missing' );\n\n\t\treturn;\n\n\t}\n\n\t// Verify for legend item name\n\tif( empty( $_POST['legend_item_name'] ) ) {\n\n\t\twpbs_admin_notices()->register_notice( 'legend_item_name_missing', '<p>' . __( 'Please add a name for your legend item.', 'wp-booking-system' ) . '</p>', 'error' );\n\t\twpbs_admin_notices()->display_notice( 'legend_item_name_missing' );\n\n\t\treturn;\n\n\t}\n\n\t// Verify for legend item type\n\tif( empty( $_POST['legend_item_type'] ) ) {\n\n\t\twpbs_admin_notices()->register_notice( 'legend_item_type_missing', '<p>' . __( 'Please select a type for your legend item.', 'wp-booking-system' ) . '</p>', 'error' );\n\t\twpbs_admin_notices()->display_notice( 'legend_item_type_missing' );\n\n\t\treturn;\n\n\t}\n\n\t// Remove empty values from the colors array\n\tif( isset( $_POST['legend_item_color'] ) && is_array( $_POST['legend_item_color'] ) )\n\t\t$_POST['legend_item_color'] = array_filter( $_POST['legend_item_color'] );\n\n\t// Verify for legend item type\n\tif( empty( $_POST['legend_item_color'] ) || ( $_POST['legend_item_type'] != 'single' && count( $_POST['legend_item_color'] ) <= 1 ) ) {\n\n\t\twpbs_admin_notices()->register_notice( 'legend_item_color_missing', '<p>' . __( 'Please select the color for your legend item.', 'wp-booking-system' ) . '</p>', 'error' );\n\t\twpbs_admin_notices()->display_notice( 'legend_item_color_missing' );\n\n\t\treturn;\n\n\t}\n\n\t// Get legend items to see if there are any added, if not we set this one to be the default one\n\t$legend_items = wpbs_get_legend_items( array( 'calendar_id' => absint( $_GET['calendar_id'] ), 'number' => 1 ) );\n\n\t// Prepare legend item data to be inserted into the database\n\t$legend_item_data = array(\n\t\t'name' \t => sanitize_text_field( $_POST['legend_item_name'] ),\n\t\t'type' \t => sanitize_text_field( $_POST['legend_item_type'] ),\n\t\t'color' \t => $_POST['legend_item_color'],\n\t\t'color_text' => ( ! empty( $_POST['legend_item_color_text'] ) ? sanitize_text_field( $_POST['legend_item_color_text'] ) : '' ),\n\t\t'is_visible' => 1,\n\t\t'is_bookable' => 1,\n\t\t'is_default' => ( empty( $legend_items ) ? 1 : 0 ),\n\t\t'calendar_id' => absint( $_GET['calendar_id'] )\n\t);\n\n\n\t// Insert the legend item\n\t$inserted = wpbs_insert_legend_item( $legend_item_data );\n\n\t// If the legend item could not be inserted show a message to the user\n\tif( ! $inserted ) {\n\n\t\twpbs_admin_notices()->register_notice( 'legend_item_insert_fail', '<p>' . __( 'Something went wrong. Could not add the legend item. Please try again.', 'wp-booking-system' ) . '</p>', 'error' );\n\t\twpbs_admin_notices()->display_notice( 'legend_item_insert_fail' );\n\n\t\treturn;\n\n\t}\n\n\t/**\n\t * Handle translations\n\t *\n\t */\n\t$settings \t\t = get_option( 'wpbs_settings', array() );\n\t$active_languages = ( ! empty( $settings['active_languages'] ) ? $settings['active_languages'] : array() );\n\n\tforeach( $active_languages as $code ) {\n\n\t\t// Add translation\n\t\tif( ! empty( $_POST['legend_item_translation_' . $code] ) )\n\t\t\twpbs_add_legend_item_meta( $inserted, 'translation_' . $code, sanitize_text_field( $_POST['legend_item_translation_' . $code] ) );\n\n\t}\n\n\t// Redirect to the edit page of the calendar with a success message\n\twp_redirect( add_query_arg( array( 'page' => 'wpbs-calendars', 'subpage' => 'view-legend', 'calendar_id' => absint( $_GET['calendar_id'] ), 'wpbs_message' => 'legend_item_insert_success' ), admin_url( 'admin.php' ) ) );\n\texit;\n\n}", "private function load(){\n\n $xml = simplexml_load_string($this->response);\n if($xml){\n if(!$this->isResponseSuccessFull($xml)) {\n\n $item = $xml->Items->Item;\n\n $this->data['title'] = $item->ItemAttributes->Title->__toString();\n $this->data['ean'] = $item->ItemAttributes->EAN->__toString();\n $this->data['brand'] = $item->ItemAttributes->Brand->__toString();\n $this->data['picture'] = $item->SmallImage->URL->__toString();\n $this->data['asin'] = $item->ASIN->__toString();\n $this->data['price'] = round(((int)$item->ItemAttributes->ListPrice->Amount->__toString()) / 100,2);\n }\n }else{\n $this->errorMessage[] = 'can not load xml.';\n }\n }" ]
[ "0.6491763", "0.5744059", "0.56799394", "0.5520069", "0.54321295", "0.5125817", "0.5084614", "0.50629765", "0.49899265", "0.4961322", "0.4931706", "0.4908887", "0.48641074", "0.48608473", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.47891033", "0.47874752", "0.4783159", "0.4768195", "0.47621095", "0.4731991", "0.47129562", "0.47006923", "0.46908858", "0.464894", "0.46401018", "0.46235386", "0.46154946", "0.46003133", "0.4568438", "0.45151907", "0.4503641", "0.44988096", "0.4484283", "0.44683278", "0.44664204", "0.44633418", "0.44614094", "0.44422725", "0.44419298", "0.44248345", "0.44229534", "0.44034785", "0.43978408", "0.43976492", "0.4395882", "0.4391481", "0.43843257", "0.43798283", "0.43558663", "0.4346482", "0.43450096", "0.4342456", "0.4319845", "0.43148723", "0.43146428", "0.43126175", "0.43109247", "0.43006942", "0.43000412", "0.42991397", "0.42986122", "0.4281758", "0.42775664", "0.4275594", "0.42716622", "0.42702138", "0.42688745", "0.42640942", "0.42613178", "0.4260083", "0.42580077", "0.42474225", "0.42471087", "0.42471087", "0.42440012", "0.42432866", "0.42431307", "0.42321673", "0.42310634", "0.42270032" ]
0.6877524
0
isset addItemResponseContainer One AddItemResponseContainer container is returned for each listing that was created with the AddItems call. Each container includes the ItemID of each newly created listings, the eBay category each item is listed under, the sellerdefined SKUs of the items (if any), the listing recommendations for each item (if applicable), the start and end time of each listing, and the estimated fees that each listing will incur.
public function issetAddItemResponseContainer($index) { return isset($this->addItemResponseContainer[$index]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAddItemResponseContainer(array $addItemResponseContainer)\n {\n $this->addItemResponseContainer = $addItemResponseContainer;\n return $this;\n }", "public function addToAddItemResponseContainer(\\Nogrod\\eBaySDK\\Trading\\AddItemResponseContainerType $addItemResponseContainer)\n {\n $this->addItemResponseContainer[] = $addItemResponseContainer;\n return $this;\n }", "public function getAddItemResponseContainer()\n {\n return $this->addItemResponseContainer;\n }", "protected function addItems()\n {\n $origin = 'stock';\n $code = 'cataloginventory';\n $message = Data::ERROR_QTY;\n $additionalData = null;\n $mockItems = [];\n\n for ($i = 0; $i < 2; $i++) {\n $mockItems[] = [\n 'origin' => $origin . $i,\n 'code' => $code,\n 'message' => $message . $i,\n 'additionalData' => $additionalData,\n ];\n $this->listStatus->addItem($origin . $i, $code, $message . $i, $additionalData);\n }\n return $mockItems;\n }", "public function add_item()\n {\n $request = new Types\\AddItemRequestType();\n\n // An user token is required when using the Trading service.\n $request->RequesterCredentials = new Types\\CustomSecurityHeaderType();\n $request->RequesterCredentials->eBayAuthToken = $this->config->item('authToken');\n\n\n // Begin creating the auction item.\n $item = new Types\\ItemType();\n\n $item->DispatchTimeMax = 3;\n /**\n * We want a single quantity auction.\n * Otherwise known as a Chinese auction.\n */\n $item->ListingType = Enums\\ListingTypeCodeType::C_CHINESE;\n $item->Quantity = 1;\n\n $item->ProductListingDetails = new Types\\ProductListingDetailsType();\n $item->ProductListingDetails->ISBN = $ISBN;\n $item->ProductListingDetails->UPC = $UPC;\n $item->ProductListingDetails->EAN = $EAN;\n\n $item->ProductListingDetails->BrandMPN = new DTS\\eBaySDK\\Trading\\Types\\BrandMPNType();\n $item->ProductListingDetails->BrandMPN->Brand = '';\n $item->ProductListingDetails->BrandMPN->MPN = '';\n\n $item->ListingDuration = Enums\\ListingDurationCodeType::C_DAYS_7;\n\n }", "public function additem()\r\n {\r\n $shipping = array( 'ShippingServiceOptions' => array(\r\n\r\n 'ShippingService' => 'UPSGround',\r\n 'ShippingServiceCost' => 0.0,\r\n 'ShippingServiceAdditionalCost' => 0.0,\r\n 'ShippingServicePriority' => 1,\r\n 'ExpeditedService' => false,\r\n\r\n\r\n ),\r\n 'ShippingType' => 'Flat',\r\n );\r\n\r\n $returnPolicy = array(\r\n 'ReturnsAcceptedOption' => 'ReturnsAccepted',\r\n 'RefundOption' => 'MoneyBack',\r\n 'ReturnsWithinOption' => 'Days_30',\r\n 'Description ' =>'If you are not satisfied, return the item for refund.',\r\n 'ShippingCostPaidByOption' => 'Buyer',\r\n );\r\n\r\n $item = array(\r\n 'PrimaryCategory' => array('CategoryID' => 111422), // ok\r\n 'Title' => 'Miechu nowy',\r\n 'Description' => 'Testowy opis',\r\n 'StartPrice' => 100, //\r\n 'BuyItNowPrice' => 500,//\r\n 'ReservePrice' => 400,//\r\n 'Country' => 'US',//\r\n 'Currency' => 'USD',//\r\n 'ListingDuration' => 'Days_7',//\r\n 'PictureDetails' => 'dummy',//\r\n 'Site' => 'US',//\r\n 'Location' => 'San Jose',//\r\n 'PaymentMethods' => 'PayPal',//\r\n 'PayPalEmailAddress' => '[email protected]',//\r\n 'ShippingDetails' => $shipping,//\r\n 'DispatchTimeMax' => 3,//\r\n 'ConditionID' => 1000,//\r\n 'ReturnPolicy' => $returnPolicy,//\r\n\r\n );\r\n\r\n $params = array(\r\n 'Version' => 831,\r\n 'Item' => $item\r\n\r\n\r\n\r\n\r\n\r\n );\r\n $method = 'addItem';\r\n\r\n try{\r\n\r\n $resp = debay::sendRequest($method,$params);\r\n\r\n $this->load->model('ebay/debay');\r\n\r\n\r\n }\r\n catch(Exception $e)\r\n {\r\n echo $e->getMessage();\r\n }\r\n }", "function RenderItem( &$item, &$renderer, $isLast ) {\n\t\t$itemInfo['identifier'] = $item->getAttribute('identifier');\n\t\t\n\t\t$itemInfo['isLast'] = $isLast;\n\t\t\n\t\tif( $item->hasAttribute('identifierref') )\n\t\t\t$itemInfo['identifierref'] = $item->getAttribute('identifierref');\n\t\telse\n\t\t $itemInfo['identifierref'] = FALSE;\n\n\t\tif( $item->hasAttribute('isvisible') )\n\t\t $itemInfo['isvisible'] = ($item->getAttribute('isvisible')=='true')?TRUE:FALSE;\n\t\telse\n\t\t $itemInfo['isvisible'] = TRUE;\n\n\t\tif( $item->hasAttribute('parameters') )\n\t\t $itemInfo['parameters'] = $item->getAttribute('parameters');\n\t\telse\n\t\t $itemInfo['parameters'] = FALSE;\n\t\t\n\t\t$itemInfo['title'] = $this->getFirstElementValue($item, 'title');\n\t\t\n\t\t$itemInfo['adlcp_prerequisites'] = $this->getFirstElementValue($item, 'prerequisites', 'adlcp' );\n\t\t$itemInfo['adlcp_maxtimeallowed'] = $this->getFirstElementValue($item, 'maxtimeallowed', 'adlcp');\n\t\t$itemInfo['adlcp_timelimitaction'] = $this->getFirstElementValue($item, 'timelimitaction', 'adlcp');\n\t\t$itemInfo['adlcp_datafromlms'] = $this->getFirstElementValue($item, 'datafromlms', 'adlcp');\n\t\t$itemInfo['adlcp_masteryscore'] = $this->getFirstElementValue($item, 'masteryscore', 'adlcp');\n\t\t//$itemInfo['adlcp_completionthreshold'] = $this->getFirstElementValue($item, 'completionthreshold', 'adlcp');\n\t\t$threshold_elem = $this->getNodeElement($item, 'completionthreshold', 'adlcp');\n\t\tif( $threshold_elem && $threshold_elem->hasAttribute('minProgressMeasure') )\n\t\t $itemInfo['adlcp_completionthreshold'] = $threshold_elem->getAttribute('minProgressMeasure');\n\t\telse\n\t\t $itemInfo['adlcp_completionthreshold'] = '';\n\t\t\n $elem = $this->getFirstElementNode( $item, 'item');\n if( $elem )\n\t\t\t$itemInfo['isLeaf'] = FALSE;\n\t\telse\n\t\t $itemInfo['isLeaf'] = TRUE;\n\t\t \n\t\tif( $renderer == null ) {\n\t\t\tprint_r( $itemInfo );\n\t\t\t\n\t\t}\n\t\t$renderer->RenderStartItem(\t$this, $itemInfo );\n\t\t\n\t\twhile( $elem ) {\n\t\t\t$nextElem = $this->getNextElementNode( $elem );\n\t\t\t\n\t\t\t/* pass the info about the last element */\n\t\t\tif( $nextElem === NULL )\n\t\t\t $this->RenderItem( $elem, $renderer, true );\n\t\t\telse\n\t\t\t $this->RenderItem( $elem, $renderer, false );\n\t\t\t \n\t\t\t$elem = $nextElem;\n\t\t}\n\n $renderer->RenderStopItem( $this, $itemInfo );\n\n\t}", "public function Add()\n {\n if (isset($this->properties['ItemId']) && !is_null($this->properties['ItemId'])) {\n \tthrow new Services_Ebay_Exception('This item already has an ItemId and thus cannot be added.');\n }\n $call = Services_Ebay::loadAPICall('AddItem', array($this));\n \n return $call->call($this->session);\n }", "public function prepare_item_for_response($item, $request)\n {\n return array();\n }", "public function prepare_item_for_response( $item, $request ) {\n return array();\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function addItemsDetails($description,$price,$quantity,$reference){\r\n\t\tif ( $this->_requestDetails==null )\r\n\t\t\t$this->_requestDetails = array();\r\n\t\t$nItem = count($this->_requestDetails);\r\n\t\tarray_push($this->_requestDetails, array(\"L_PAYMENTREQUEST_0_NAME\".$nItem=>$description,\"L_PAYMENTREQUEST_0_AMT\".$nItem=>$price,\"L_PAYMENTREQUEST_0_QTY\".$nItem=>$quantity,\"L_PAYMENTREQUEST_0_NUMBER\".$nItem=>$reference ));\r\n\t}", "public function addDealsToCart( $itemMap ) {\r\n\t\t\t$params = array('session_cookie'=>$itemMap['cart_session'],'dealid'=>$itemMap['dealid']);\r\n\t\t\t$this->db->select('COUNT(*) as count')->from(TABLES::$ORDER_DEALS_CART)->where($params);\r\n\t\t\t$query = $this->db->get();\r\n\t\t\t$result = $query->result_array();\r\n\t\t\tif($result[0]['count'] <=0 ) {\r\n\t\t\t\t$params = array('session_cookie'=>$itemMap['cart_session'],'restid'=>$itemMap['restid'],'dealid'=>$itemMap['dealid']);\r\n\t\t\t\t/* New item */\r\n\t\t\t\t$this->db->insert(TABLES::$ORDER_DEALS_CART,$params);\r\n\t\t\t\t$map['message'] = 'Deal Applied To Cart';\r\n\t\t\t\t$map['status'] = 0;\r\n\t\t\t}else {\r\n// \t\t\t\t$this->updateDealsInCart( $itemMap );\r\n\t\t\t\t$map['message'] = 'Deal Applied To Cart';\r\n\t\t\t\t$map['status'] = 1;\r\n\t\t\t}\r\n\t\t\treturn $map;\r\n\t\t}", "public function add_item($zajlib_feed_item){\n\t\t$this->items[] = $zajlib_feed_item; \n\t}", "public function get_listings_details($dom){\t\n\t\t\t//push each entry into new array\n\t\t\t$update_item_array = array();\n\t\t\t$update_item_array['itemnumber'] = array();\n\t\t\t$update_item_array['customlabel'] = array();\n\t\t\t$update_item_array['quantity'] = array();\n\t\t\t$update_item_array['quantitysoldandavailable'] = array();\n\t\t\t$update_item_array['sellprice'] = array();\n\t\t\t$update_item_array['starttime'] = array();\n\t\t\t$update_item_array['endtime'] = array();\n\t\t\t$update_item_array['itemtitle'] = array();\n\t\t\t$update_item_array['stockcntrl'] = array();\n\t\t\t$update_item_array['listingtype'] = array();\n\n\n\t\t\t$update_item_response = $dom->getElementsByTagName(DOM_ELEMENT_LISTINGSSHOW_RESPONSE);\n\n\n\n\t\t\tforeach ($update_item_response as $item){\n\t \t\t\t\n\n\t\t\t\t$activelist = $item->getElementsByTagName(DOM_ELEMENT_LISTINGS_ACTIVELIST);\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tforeach ($activelist as $activelistshow){\n\t\t\t\t\t\n\t\t\t\t\t$itemarrays = $activelistshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMARRAY);\n\n\n\t\t\t\t\tforeach($itemarrays as $itemarray){\n\n\t\t\t\t\t\t$inditems = $itemarray->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMSS);\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\tforeach($inditems as $inditemshow){\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_LISTINGTYPE)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_LISTINGTYPE)->item(0)->nodeValue) : \"Listing Type - Error\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['listingtype'], $costers);\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMID)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMID)->item(0)->nodeValue) : \"Item Num - Error\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['itemnumber'], $costers);\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_SKU)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_SKU)->item(0)->nodeValue) : \"SKU - Error\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['customlabel'], $costers);\n\t\t\t\t\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_QUANTITY)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_QUANTITY)->item(0)->nodeValue) : \"0\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['quantity'], $costers);\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_TOTALQUANTITY)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_TOTALQUANTITY)->item(0)->nodeValue) : \"0\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['quantitysoldandavailable'], $costers);\n\n\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_CURRENTPRICE)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_CURRENTPRICE)->item(0)->nodeValue) : \"price sold - Error\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['sellprice'], $costers);\t\n\n\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STARTTIME)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STARTTIME)->item(0)->nodeValue) : \"0\";\n\n\n\t\t\t\t\t\t\tarray_push($update_item_array['starttime'], $costers);\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ENDTIME)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ENDTIME)->item(0)->nodeValue) : \"\";\n\n\n\t\t\t\t\t\t\tarray_push($update_item_array['endtime'], $costers);\n\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMTITLE)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMTITLE)->item(0)->nodeValue) : \"\";\n\n\n\t\t\t\t\t\t\tarray_push($update_item_array['itemtitle'], $costers);\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STOCKCNTRL)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STOCKCNTRL)->item(0)->nodeValue) : \"FALSE\";\n\n\n\t\t\t\t\t\t\tarray_push($update_item_array['stockcntrl'], $costers);\t\t\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\n\t\t\t\t}\t\t\n\n\n\t\t\t\t//errors\n\t\t\t\t$error_messages = $item->getElementsByTagName(DOM_ELEMENT_ERRORS);\n\n\t\t\t\tforeach ($error_messages as $errormsg){\n\t\t\t\t\t$error = trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) != \"\" ? trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) : \"No Error\";\n\t\t\t\t\tarray_push($update_item_array, $error);\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t}\n\n\t\t\treturn $update_item_array;\n\n\t\t//DOM_ELEMENT_SHORT_ERROR_MSG\n\t\t}", "function appendItemMetadataList(&$item) {\n $mda = array();\n\n // Static metadata\n $mda = $this->getHardCodedMetadataList(true);\n foreach($mda as $md) {\n $md->setValue($item->getHardCodedMetadataValue($md->getLabel()));\n $item->addMetadata($md);\n unset($md);\n }\n \n // Dynamic metadata\n $mdIter = $this->getRealMetadataIterator(true);\n $mdIter->rewind();\n while($mdIter->valid()) {\n $md = $mdIter->current();\n $this->addMetadataValueToItem($item, $md);\n $mdIter->next();\n }\n }", "function addItem(){\r\n\t global $itemsArray;\r\n\r\n //when the user clicks add, I pass id to the URL bar as a query string, again I'm checking if it exist or not (if the user has \r\n\t //clicked the add button or not)\r\n\r\n\t//if it exists on the URL bar I begin the magic of adding items to the Cart\r\n\r\n\tif ( isset( $_GET[\"itemId\"] ) ) {\r\n\t\t\r\n\t\t//This is the session that stores the total Price of the items in the cart\r\n\t\t//here I'm initializing it to zero....only if it doesn't exists at this point in time\r\n\t\t//if I don't put the ! sign the session will always be zero coz it's gonna be re-initized to zero everytime the\r\n //page is refreshed (everytime the add button is clicked)\r\n\t\tif(!isset($_SESSION[\"total\"])){\r\n\t\t\t$_SESSION[\"total\"] = 0;\r\n\t\t}\r\n //does the same as the above code but for the number of items in the cart\r\n\t\tif(!isset($_SESSION[\"nuOfItems\"])){\r\n\t\t\t$_SESSION[\"nuOfItems\"] = 0;\r\n\t\t}\r\n\r\n\t\t//==================================================================================================\r\n\t\t\t\t//ADDING ITEM TO THE CART\r\n\t\t//==================================================================================================\r\n\t\t\t\r\n \r\n //The code below ads items to the cart.....I grab the itemID from the URL bar and assign to a varible named itemId\r\n\t\t$itemId = (int) $_GET[\"itemId\"];\r\n\t\t//I grab the price from the URL bar also\r\n\t\t$price = $_GET[\"price\"];\r\n\r\n\t\t\t\r\n\t\tif (!isset( $_SESSION[\"cart\"][$itemId] ) ) {\r\n\r\n \r\n //kinda hard to explain....when this scripts loads I store objects of all items in the datbase to the $itemsArray, \r\n\t\t\t //each object in the array is indexed by it's id...Ok...\r\n\t\t\t //ie object1 will be at index 3 if it's Id is 3 .... ($itemsArray[3] = object1;)\r\n //now the statement below says take whatever object that is stored at index $itemId , in the itemsArray object and store\r\n\t\t\t // to the cart\r\n\r\n\t\t\t//reference: Beginning PHP 5.3 by Matt Doyle (Downloadable from google) ,Page 284. - Create a Simple Shopping Cart\r\n\r\n\t\t\t$_SESSION[\"cart\"][$itemId] = $itemsArray[$itemId];\r\n\r\n\r\n\t\t\t$_SESSION[\"nuOfItems\"] = $_SESSION[\"nuOfItems\"]+1; //increments the number of items in the cart \r\n\t\t\t$_SESSION[\"total\"] = $_SESSION[\"total\"]+$price; //increments current total by the that is recived from the URL\r\n\r\n\r\n\t\t}\r\n\t\t\r\n \r\n\t\t\t\r\n\t\t\r\n\t}\r\n\tsession_write_close();\r\n\t//header( \"Location: index.php\" ); //redirects the user to the home page\r\n\r\n}", "public static function displayItemList($showSettings){\n\t\t\tif($showSettings && !User::isAdmin()){\n\t\t\t\t$showSettings = false;\n\t\t\t}\n\n\t\t\t$time_start = microtime(true);\n\n\t\t\t$itemCategories = LendingItem::getAllItems();\n\n\t\t\tforeach ($itemCategories as $categoryID => $category_items) {\n\t\t\t\t// For each category\n\t\t\t\t?>\n\t\t\t\t<div class=\"categoryContainer\">\n\t\t\t\t\t<h2 class=\"rubrikBooking\">\n\t\t\t\t\t\t<img class=\"categoryExpandImg\" src=\"../images/expand.gif\" />\n\t\t\t\t\t\t<img class=\"categoryContractImg\" src=\"../images/contract.gif\" />\n\t\t\t\t\t\t<?php echo(Language::itemCategory($categoryID)); ?>\n\t\t\t\t\t</h2>\n\t\t\t\t\t<div class=\"categoryItemHolder\">\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ($category_items as $item) {\n\t\t\t\t\t\t// For each item\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<div class='bookingFormItem'>\n\t\t\t\t\t\t\t<input type='hidden' class='bookingItemID' name='item' value='<?php echo($item['id']); ?>' />\n\t\t\t\t\t\t\t<input type='hidden' class='maxLendingPeriods' name='item' value='<?php echo($item['max_lending_periods']); ?>' />\n\n\t\t\t\t\t\t\t<p class=\"itemImage\">\n\t\t\t\t\t\t\t\t<?php if (file_exists(\"img/\".$item['id'].\".jpg\")) { ?>\n\t\t\t\t\t\t\t\t\t<img class=\"itemPic\" src=\"img/<?php echo($item['id']); ?>.jpg\" alt=\"<?php echo($item['name']); ?>\" />\n\t\t\t\t\t\t\t\t<?php }else{ ?>\n\t\t\t\t\t\t\t\t\t<img class=\"itemPic\" src=\"img/404img.png\" alt=\"Image not found\" />\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<h4 class='itemHeading' id='<?php echo(Language::itemName($item['id'])); ?>'><?php echo(Language::itemName($item['id'])); ?></h4>\n\t\t\t\t\t\t\t<div class='itemContent' >\n\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t<?php echo(nl2br(Language::itemDescription($item['id']))); ?>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<?php echo((nl2br(nl2br($item['deposit'] ? Language::text(\"booking_deposit\").\": \".$item['deposit'].\" SEK\" : \"\")))); ?>\n\t\t\t\t\t\t\t\t\t<?php echo((nl2br($item['fee'] ? Language::text(\"booking_fee\").\": \".$item['fee'].\" SEK\" : \"\"))); ?><br />\n\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"max_lending_time\")); ?> <?php echo($item['max_lending_periods']); ?><br />\n\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"item_descr_there_is\")); ?> <?php echo($item['num_items']); ?> <?php echo(Language::text(\"item_descr_num\")); ?>\n\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif($showSettings){\n\t\t\t\t\t\t\t\t\t//Display item options for admins\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<form action=\"item.php\" method=\"post\" enctype=\"multipart/form-data\">\n\t\t\t\t\t\t\t\t\t\t<fieldset style=\"padding: 0;\">\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"lending_item_id\" value=\"<?php echo($item['id']); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\t<b><?php echo(Language::text(\"edit_item\")); ?>:</b>\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Bildfil\"><?php echo(Language::text(\"picture\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"button_style\" id =\"picture_select_btn\" type=\"file\" name=\"image\" class=\"button_style\" />\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Internt Namn\"><?php echo(Language::text(\"internal_name\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form_style\" type=\"text\" name=\"name\" value=\"<?php echo($item['name']); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Antal\"><?php echo(Language::text(\"amount\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form_style\" type=\"text\" name=\"num_items\" value=\"<?php echo($item['num_items']); ?>\" size=\"3\" />\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Max att låna\"><?php echo(Language::text(\"max_to_lend\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form_style\" type=\"text\" name=\"max_lending_items\" value=\"<?php echo($item['max_lending_items']); ?>\" size=\"3\" /> <?php echo(Language::text(\"max_lend_info\")); ?>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Maxlånetid\"><?php echo(Language::text(\"max_time\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form_style\" type=\"text\" name=\"max_lending_periods\" value=\"<?php echo($item['max_lending_periods']); ?>\" size=\"3\" /> <?php echo(Language::text(\"max_time_info\")); ?>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Deposition\"><?php echo(Language::text(\"deposition\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form_style\" type=\"text\" name=\"deposit\" value=\"<?php echo($item['deposit']); ?>\" size=\"5\" /> kr\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Avgift\"><?php echo(Language::text(\"fee\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form_style\" type=\"text\" name=\"fee\" value=\"<?php echo($item['fee']); ?>\" size=\"5\" /> kr\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Ta bort bild\"><?php echo(Language::text(\"remove_pic\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"delete_image\" value=\"1\" />\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"button_style\" type=\"submit\" name=\"update_lending_item\" value=\"<?php echo(Language::text(\"update\")); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"button_style\" type=\"submit\" name=\"delete_lending_item\" value=\"<?php echo(Language::text(\"remove_item\")); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t\t\t<div class=\"togglable\">\n\t\t\t\t\t\t\t\t\t\t<p class=\"toggleButton\"><b><?php echo(Language::text(\"translations\")); ?></b></p>\n\t\t\t\t\t\t\t\t\t\t<div class=\"toggleContent\"><?php\n\n\t\t\t\t\t\t\t\t\t\tforeach (Language::getLanguages() as $language) { ?>\n\t\t\t\t\t\t\t\t\t\t\t<form action=\"item.php\" method=\"post\">\n\t\t\t\t\t\t\t\t\t\t\t\t<fieldset class=\"translateBox\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ($translation = ItemTranslation::getTranslation($item['id'], $language['id'])) { ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"item_translation_id\" value=\"<?php echo($translation['id']); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<legend><?php echo(Language::text(\"edit_language\")); ?> <?php echo($language['name']); ?></legend>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"name\")); ?>: <input type=\"text\" name=\"name\" value=\"<?php echo($translation['name']); ?>\" /><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"description\")); ?>:<br />\n\t <textarea name=\"description\" rows=\"3\" cols=\"25\"><?php echo($translation['description']); ?></textarea><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tEmail-text:<br />\n\t <textarea name=\"emailText\" rows=\"3\" cols=\"25\"><?php echo($translation['email_text']); ?></textarea><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button_style\" name=\"update_item_translation\" value=\"<?php echo(Language::text(\"update\")); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php } else { ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"item_id\" value=\"<?php echo($item['id']); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"language_id\" value=\"<?php echo($language['id']); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<legend><?php echo(Language::text(\"add_translation\")); ?> <?php echo($language['name']); ?></legend>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"name\")); ?>: <input type=\"text\" name=\"name\" value=\"\" /><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"description\")); ?>:<br />\n\t <textarea name=\"description\" rows=\"3\" cols=\"25\"></textarea><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tEmail-text:<br />\n\t <textarea name=\"emailText\" rows=\"3\" cols=\"25\"></textarea><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button_style\" name=\"create_item_translation\" value=\"<?php echo(Language::text(\"create\")); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t//Display calendar for booking\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<div class=\"calendarBooking\">\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\techo \"<input type='hidden' class='bookingItemID' name='item' value='\".$item['id'].\"' />\\n\";\n\t\t\t\t\t\t\t\t\t\t\techo \"<input type='hidden' class='maxLendingPeriods' name='item' value='\".$item['max_lending_periods'].\"' />\\n\";\n\t\t\t\t\t\t\t\t\t\t?><br />\n\t\t\t <div>\n\t\t\t <a href=\"#\" class=\"firstLoadButton\"><?php echo(nl2br(Language::text(\"booking_choose_period\"))); ?></a>\n\t\t\t </div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"calendar\">\n\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\t\t\t\t\tif ($item['max_lending_items'] != \"0\") {\n\t\t\t\t\t\t\t\t\t\t\t$max_lending_items = $item['max_lending_items'];\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$max_lending_items = $item['num_items'];\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\t\t<br />\n\t\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"booking_num_items\")); ?>:\n\t\t\t\t\t\t\t\t\t\t<select name=\"num_items\" class=\"numItemsSelector\">\n\t\t\t\t\t\t\t\t\t\t\t<?php for ($num_items = 1; $num_items <= $max_lending_items; $num_items++) { ?>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"<?php echo($num_items); ?>\"><?php echo($num_items); ?></option>\n\t\t\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t<br />\n\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"itemRowSeparator\"></div>\n\t\t\t\t\t<?php\n\t\t\t\t\t}\n\n\t\t\t\t\tif($showSettings){\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<!-- Item box for adding new item -->\n\t\t\t\t\t\t<div class=\"bookingFormItem\" style=\"background-color: #ff6600;\">\n\t\t\t\t\t\t\t<h4 class=\"itemHeading\"><?php echo(Language::text(\"add_item_to\")); ?> <b style=\"color:#0080ff\"><?php echo(Language::itemCategory($categoryID)); ?></b></h4>\n\t\t\t\t\t\t\t<div class=\"itemContent\">\n\t\t\t\t\t\t\t\t<form action=\"item.php\" method=\"post\">\n\t\t\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"lending_item_category_id\" value=\"<?php echo($categoryID); ?>\" />\n\t\t\t\t\t\t\t\t\t\t<legend><?php echo(Language::text(\"edit_item\")); ?>:</legend>\n\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Internt namn \"><?php echo(Language::text(\"internal_name\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_style\" name=\"name\" value=\"\" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Antal\"><?php echo(Language::text(\"amount\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_style\" name=\"num_items\" value=\"1\" /> st\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Max att låna\"><?php echo(Language::text(\"max_to_lend\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_style\" name=\"max_lending_items\" value=\"0\" /> <?php echo(Language::text(\"max_lend_info\")); ?>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Maxlånetid\"><?php echo(Language::text(\"max_time\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_style\" name=\"max_lending_periods\" value=\"4\" /> <?php echo(Language::text(\"max_time_info\")); ?>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Deposition\"><?php echo(Language::text(\"deposition\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_style\" name=\"deposit\" value=\"\" /> kr\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Avgift\"><?php echo(Language::text(\"fee\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_style\" name=\"fee\" value=\"\" /> kr\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button_style\" name=\"create_lending_item\" value=\"<?php echo(Language::text(\"create\")); ?>\" />\n\t\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"itemRowSeparator\"></div>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<?php\n\t\t\tif($showSettings){\n\t\t\t\t?>\n\t\t\t\t<!-- Translations of category -->\n\t\t\t\t<div class=\"togglable catTranslation\">\n\t\t\t\t\t<p class=\"toggleButton\"><b><?php echo(Language::text(\"translate_category\")); ?> <b style=\"color:#ff6600\"><?php echo(Language::itemCategory($categoryID)); ?></b></b></p>\n\t\t\t\t\t<div class=\"toggleContent\">\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach (Language::getLanguages() as $language) { ?>\n\t\t\t\t\t\t<form action=\"item.php\" method=\"post\">\n\t\t\t\t\t\t\t<fieldset class=\"box\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$translation = ItemCategoryTranslation::getTranslation($categoryID, $language['id']);\n\t\t\t\t\t\t\t\tif ($translation) { ?>\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"item_category_translation_id\" value=\"<?php echo($translation['id']); ?>\" />\n\t\t\t\t\t\t\t\t\t<legend><?php echo(Language::text(\"edit_language\")); ?> <?php echo($language['name']); ?></legend>\n\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"name\")); ?>: <input type=\"text\" name=\"name\" value=\"<?php echo($translation['name']); ?>\" /><br />\n\t\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button_style\" name=\"update_item_category_translation\" value=\"<?php echo(Language::text(\"update\")); ?>\" />\n\t\t\t\t\t\t\t\t<?php } else { ?>\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"category_id\" value=\"<?php echo($categoryID); ?>\" />\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"language_id\" value=\"<?php echo($language['id']); ?>\" />\n\t\t\t\t\t\t\t\t\t<legend><?php echo(Language::text(\"add_translation\")); ?> <?php echo($language['name']); ?></legend>\n\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"name\")); ?>: <input type=\"text\" name=\"name\" value=\"\" /><br />\n\t\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button_style\" name=\"create_item_category_translation\" value=\"<?php echo(Language::text(\"create\")); ?>\" />\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<!-- Deletion of category -->\n\t\t\t\t<div class=\"catDeleteBtn\">\n\t\t\t\t\t<form class=\"catDelForm\" action=\"item.php\" method=\"post\">\n\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"lending_item_category_id\" value=\"<?php echo($categoryID); ?>\" />\n\t\t\t\t\t\t\t<input type=\"submit\" class=\"button_style\" name=\"delete_lending_item_category\" value=\"<?php echo(Language::text(\"remove_category\")); ?>\" />\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t\t<script>\n\t\t\t\t\t$('.catDelForm').submit(function() {\n\t\t\t\t\t return confirm(\"<?php echo(Language::text(\"confirm_cat_del\")); ?>\");\n\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\t\t$time_end = microtime(true);\n\t\t\t$time = $time_end - $time_start;\n\t\t}", "private function load(){\n\n $xml = simplexml_load_string($this->response);\n if($xml){\n if(!$this->isResponseSuccessFull($xml)) {\n\n $item = $xml->Items->Item;\n\n $this->data['title'] = $item->ItemAttributes->Title->__toString();\n $this->data['ean'] = $item->ItemAttributes->EAN->__toString();\n $this->data['brand'] = $item->ItemAttributes->Brand->__toString();\n $this->data['picture'] = $item->SmallImage->URL->__toString();\n $this->data['asin'] = $item->ASIN->__toString();\n $this->data['price'] = round(((int)$item->ItemAttributes->ListPrice->Amount->__toString()) / 100,2);\n }\n }else{\n $this->errorMessage[] = 'can not load xml.';\n }\n }", "abstract public function add_item();", "public function addItems(){\n $this->validate($this->request, [\n 'title' => 'required|max:255',\n 'description' => 'string|max:255',\n 'isbn' => 'string',\n 'authorId' => 'required|integer|min:1',\n 'itemTypeId' => 'required|integer|min:1',\n 'categoryId' => 'required|integer|min:1',\n 'numberInStock' => 'required|integer|min:1',\n 'itemCondition' => 'required',\n 'itemStateId' => 'required|integer|min:1',\n ]);\n $items = array(\n 'title' => $this->request->input('title'),\n 'description' => $this->request->input('description'),\n 'isbn' => $this->request->input('isbn'),\n 'authorId' => $this->request->input( 'authorId'),\n 'catId' => $this->request->input('categoryId'),\n 'numOfItems' => $this->request->input('numberInStock'),\n 'itemCondition' => $this->request->input('itemCondition'),\n 'itemStateId' => $this->request->input('itemStateId'),\n 'itemTypeId' => $this->request->input('itemTypeId'),\n );\n\n try{\n $item = new ItemService();\n $result = $item->createNewItem($items);\n\n if ($result) {\n return response()->json([\n 'success' => true,\n 'data' => [\n 'itemId' => $result,\n ],\n 'message' => 'Item Added Successfully',\n ], 201);\n }\n return response()->json([\n 'success' => false,\n 'message' => 'item could not be added'\n ], 400);\n\n }catch(Exception $ex){\n return response()->json([\n 'success' => false,\n 'message' => 'Error Occured Adding Items. Ensure the IDs are Valid'\n ], 400);\n }\n }", "public function addBasketItemParams()\n {\n $oBasket = $this->getBasket();\n $oLang = $this->getLang();\n $oRequest = $this->getPayPalRequest();\n\n $iPos = 0;\n foreach ($oBasket->getContents() as $oBasketItem) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", getStr()->html_entity_decode($oBasketItem->getTitle()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasketItem->getUnitPrice()->getPrice()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", (int) $oBasketItem->getAmount());\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_ITEMURL{$iPos}\", $oBasketItem->getLink());\n\n $oBasketProduct = $oBasketItem->getArticle();\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NUMBER{$iPos}\", $oBasketProduct->oxarticles__oxartnum->value);\n\n $iPos++;\n }\n\n //adding payment costs as product\n if ($oBasket->getPayPalPaymentCosts() > 0) {\n $sPaymentTitle = $oLang->translateString(\"OEPAYPAL_SURCHARGE\") . \" \" . $oLang->translateString(\"OEPAYPAL_TYPE_OF_PAYMENT\");\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $sPaymentTitle);\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalPaymentCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n\n $iPos++;\n }\n\n //adding wrapping as product\n if ($oBasket->getPayPalWrappingCosts() > 0) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $oLang->translateString(\"OEPAYPAL_GIFTWRAPPER\"));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalWrappingCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n\n $iPos++;\n }\n\n //adding greeting card as product\n if ($oBasket->getPayPalGiftCardCosts() > 0) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $oLang->translateString(\"OEPAYPAL_GREETING_CARD\"));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalGiftCardCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n\n $iPos++;\n }\n\n //adding trusted shops protection as product\n if ($oBasket->getPayPalTsProtectionCosts() > 0) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $oLang->translateString(\"OEPAYPAL_TRUSTED_SHOP_PROTECTION\"));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalTsProtectionCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n }\n }", "public function addItem(Collection $collection, ItemCreateStruct $itemCreateStruct): Item;", "public function addItem($item)\n {\n if ($item instanceof \\Fastbill\\Item\\Item)\n {\n $this['ITEMS'][] = $item;\n }\n else\n {\n $itemObj = new \\Fastbill\\Item\\Item();\n $itemObj->fillFromArray($item);\n $this['ITEMS'];\n }\n\n }", "public static function add($response)\n\t{\n\t\tforeach ($response as $key => $value) {\n\t\t\tself::$response[$key] = $value;\n\t\t}\n\t}", "public static function items() {\r\n $doc = new DOMDocument ('1.0', 'UTF-8');\r\n $items_node = $doc->createElement(\"items\");\r\n $doc->appendChild($items_node);\r\n\r\n return new amvonetroom_XmlResponse($items_node);\r\n }", "public function rebuildItems() {\n\t\t##\n\t\t##\tRETURNS\n\t\t##\t\tThe last modified timestamp\n\t\t$lastModified = time();\n\t\t$addedIDs = array();\n\t\t$totalPages = $this->getTotalPages();\n\t\tif($totalPages) {\n\t\t\tfor($i=1;$i<=$totalPages;$i++) {\n\t\t\t\t$items = $this->getItems($i);\n\t\t\t\tif($items && count($items)) {\n\t\t\t\t\tforeach($items as $item) {\n\t\t\t\t\t\t$campaign_id = '';\n\t\t\t\t\t\tif(isset($item->offer_url)) {\n\t\t\t\t\t\t\t$parts = parse_url($item->offer_url);\n\t\t\t\t\t\t\t$query = array();\n\t\t\t\t\t\t\tparse_str($parts['query'],$query);\n\t\t\t\t\t\t\t$campaign_id = $query['cId'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t'id' => $item->id,\n\t\t\t\t\t\t\t'campaign_id' => $campaign_id,\n\t\t\t\t\t\t\t'artist_id' => $item->artist_id,\n\t\t\t\t\t\t\t'reporting_name' => $item->reporting_name,\n\t\t\t\t\t\t\t'embed_code' => $item->embed_code,\n\t\t\t\t\t\t\t'width' => $item->width,\n\t\t\t\t\t\t\t'height' => $item->height,\n\t\t\t\t\t\t\t'url' => $item->url,\n\t\t\t\t\t\t\t'poster_image' => $item->poster_image,\n\t\t\t\t\t\t\t'poster_image_source' => (isset($item->poster_image_source)) ? $item->poster_image_source : '',\n\t\t\t\t\t\t\t'product_type' => $item->product_type,\n\t\t\t\t\t\t\t'offer_type' => $item->offer_type,\n\t\t\t\t\t\t\t'description' => $item->description,\n\t\t\t\t\t\t\t'currency' => $item->currency,\n\t\t\t\t\t\t\t'price' => $item->price,\n\t\t\t\t\t\t\t'name' => $item->name,\n\t\t\t\t\t\t\t'campaign' => serialize($item->campaign),\n\t\t\t\t\t\t\t'offer_url' => (isset($item->offer_url)) ? $item->offer_url : '',\n\t\t\t\t\t\t\t'mobile_url' => (isset($item->mobile_url)) ? $item->mobile_url : '',\n\t\t\t\t\t\t\t'last_modified' => date('Y-m-d H:i:s',$lastModified)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$format = array('%d','%d','%d','%s','%s','%d','%d','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s');\n\t\n\t\t\t\t\t\t## Get Keys\n\t\t\t\t\t\t$tableFields = implode(',',array_keys($data));\n\t\t\t\t\t\t$tableFormat = implode(',',$format);\n\t\t\t\t\t\t$onDuplicateKeyUpdate = '';\n\t\t\t\t\t\t$keyIndex = 0;\n\t\t\t\t\t\tforeach($data as $key=>$field) {\n\t\t\t\t\t\t\tif($keyIndex>0) { $onDuplicateKeyUpdate .= ', '; }\n\t\t\t\t\t\t\t$onDuplicateKeyUpdate .= $key.'=VALUES('.$key.')';\n\t\t\t\t\t\t\t$keyIndex++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t## Add item\n\t\t\t\t\t\t$sql = <<<EOD\n\t\t\t\t\t\tINSERT INTO {$this->wpdb->prefix}topspin_items ({$tableFields}) VALUES ({$tableFormat})\n\t\t\t\t\t\tON DUPLICATE KEY UPDATE {$onDuplicateKeyUpdate}\nEOD;\n\t\t\t\t\t\t$this->wpdb->query($this->wpdb->prepare($sql,$data));\n\t\n\t\t\t\t\t\t##\tDeletes old item tags\n\t\t\t\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items_tags WHERE item_id = %d';\n\t\t\t\t\t\t$this->wpdb->query($this->wpdb->prepare($sql,array($item->id)));\n\t\t\t\t\t\t##\tAdds new item tag\n\t\t\t\t\t\tif(isset($item->tags) && is_array($item->tags)) {\n\t\t\t\t\t\t\t$tagFormat = array('%d','%s');\n\t\t\t\t\t\t\tforeach($item->tags as $tag) {\n\t\t\t\t\t\t\t\t$tagData = array(\n\t\t\t\t\t\t\t\t\t'item_id' => $item->id,\n\t\t\t\t\t\t\t\t\t'tag_name' => $tag\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$this->wpdb->insert($this->wpdb->prefix.'topspin_items_tags',$tagData,$tagFormat);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // end if tags exist\n\t\n\t\t\t\t\t\t##\tDeletes old item images\n\t\t\t\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items_images WHERE item_id = %d';\n\t\t\t\t\t\t$this->wpdb->query($this->wpdb->prepare($sql,array($item->id)));\n\t\t\t\t\t\t##\tAdds new item images\n\t\t\t\t\t\tif(isset($item->campaign->product->images) && is_array($item->campaign->product->images)) {\n\t\t\t\t\t\t\t$imageFormat = array('%d','%s','%s','%s','%s');\n\t\t\t\t\t\t\tforeach($item->campaign->product->images as $key=>$image) {\n\t\t\t\t\t\t\t\t$imageData = array(\n\t\t\t\t\t\t\t\t\t'item_id' => $item->id,\n\t\t\t\t\t\t\t\t\t'source_url' => $item->campaign->product->images[$key]->source_url,\n\t\t\t\t\t\t\t\t\t'small_url' => $item->campaign->product->images[$key]->small_url,\n\t\t\t\t\t\t\t\t\t'medium_url' => $item->campaign->product->images[$key]->medium_url,\n\t\t\t\t\t\t\t\t\t'large_url' => $item->campaign->product->images[$key]->large_url\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$this->wpdb->insert($this->wpdb->prefix.'topspin_items_images',$imageData,$imageFormat);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} //end if images exist\n\t\n\t\t\t\t\t\tarray_push($addedIDs,$item->id);\n\t\t\t\t\t} //end for each item\n\t\t\t\t} //end if items\n\t\t\t} //end for each page\n\n\t\t\t##\tRemoves all items that is not modified/inserted\n\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items WHERE last_modified < %s';\n\t\t\t$this->wpdb->query($this->wpdb->prepare($sql,array(date('Y-m-d H:i:s',$lastModified))));\n\n\t\t\t##\tRemoves all item tags that is not modified/inserted\n\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items_tags WHERE item_id NOT IN (SELECT id FROM '.$this->wpdb->prefix.'topspin_items)';\n\t\t\t$this->wpdb->query($this->wpdb->prepare($sql));\n\n\t\t\t##\tRemoves all item images that is not modified/inserted\n\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items_images WHERE item_id NOT IN (SELECT id FROM '.$this->wpdb->prefix.'topspin_items)';\n\t\t\t$this->wpdb->query($this->wpdb->prepare($sql));\n\t\t\treturn $lastModified;\n\t\t}\n\t}", "public function addContainer($data) {\n try {\n $client = new Zend_Soap_Client($this->CONTAINER_WSDL_URI);\n $options = array('soap_version' => SOAP_1_1,\n 'encoding' => 'ISO-8859-1',\n );\n $client->setOptions($options);\n $client->action = 'createContainer';\n $result = $client->createContainer(\n $this->toXml(\n array(\n 'backgroundColor' => $data['backgroundColor'],\n 'borderBottom' => $data['borderBottom'],\n 'borderBottomColor' => $data['borderBottomColor'],\n 'borderBottomStyle' => $data['borderBottomStyle'],\n 'borderBottomUnit ' => $data['borderBottomUnit'],\n 'borderLeft' => $data['borderLeft'],\n 'borderLeftColor' => $data['borderLeftColor'],\n 'borderLeftStyle' => $data['borderLeftStyle'],\n 'borderLeftUnit' => $data['borderLeftUnit'],\n 'borderRight' => $data['borderRight'],\n 'borderRightColor' => $data['borderRightColor'],\n 'borderRightStyle' => $data['borderRightStyle'],\n 'borderRightUnit' => $data['borderRightUnit'],\n 'borderTop' => $data['borderTop'],\n 'borderTopColor' => $data['borderTopColor'],\n 'borderTopStyle' => $data['borderTopStyle'],\n 'borderTopUnit' => $data['borderTopUnit'],\n 'bottomMargin' => $data['bottomMargin'],\n 'bottomMarginUnit' => $data['bottomMarginUnit'],\n 'bottomPadding' => $data['bottomPadding'],\n 'bottomPaddingUnit' => $data['bottomPaddingUnit'],\n 'containerHeight' => $data['containerHeight'],\n 'containerId' => $data['containerId'],\n 'containerName' => $data['containerName'],\n 'containerWidth' => $data['containerWidth'],\n 'containerXaxis' => $data['containerXaxis'],\n 'containerYaxis' => $data['containerYaxis'],\n 'css' => $data['css'],\n 'font' => $data['font'],\n 'fontAlignment' => $data['fontAlignment'],\n 'fontColor' => $data['fontColor'],\n 'fontSize' => $data['fontSize'],\n 'isActive' => true,\n 'isBold' => $data['isBold'],\n 'isBorderColorSameForAll' => $data['isBorderColorSameForAll'],\n 'isBorderStyleSameForAll' => $data['isBorderStyleSameForAll'],\n 'isBorderWidthSameForAll' => $data['isBorderWidthSameForAll'],\n 'isItalic' => $data['isItalic'],\n 'isMargineSameForAll' => $data['isMargineSameForAll'],\n 'isPaddingSameForAll' => $data['isPaddingSameForAll'],\n 'leftMargin' => $data['leftMargin'],\n 'leftMarginUnit' => $data['leftMarginUnit'],\n 'leftPadding' => $data['leftPadding'],\n 'leftPaddingUnit' => $data['leftPaddingUnit'],\n 'letterSpacing' => $data['letterSpacing'],\n 'lineHeight' => $data['lineHeight'],\n 'primaryKey' => 0,\n 'rightMargin' => $data['rightMargin'],\n 'rightMarginUnit' => $data['rightMarginUnit'],\n 'rightPadding' => $data['rightPadding'],\n 'rightPaddingUnit' => $data['rightPaddingUnit'],\n 'textDecoration' => $data['textDecoration'],\n 'topMargin' => $data['topMargin'],\n 'topMarginUnit' => $data['topMarginUnit'],\n 'topPadding' => $data['topPadding'],\n 'topPaddingUnit' => $data['topPaddingUnit'],\n 'updatedby' => $_SESSION['Username'],\n 'updatedt' => date('Y-m-d') . 'T' . date('H:i:s') . 'Z',\n 'wordSpacing' => $data['wordSpacing'],\n )\n ,$rootNodeName = 'AddContainer')\n );\n return $result;\n } catch (Exception $e) {\n // print_r($e);\n }\n }", "public function testGetListOfSpecificIds()\n {\n $itemIds = [];\n $response = $this->api->create($this->testPayload);\n $this->assertErrors($response);\n $itemIds[] = $response[$this->api->itemName()]['id'];\n $response = $this->api->create($this->testPayload);\n $this->assertErrors($response);\n $itemIds[] = $response[$this->api->itemName()]['id'];\n\n $search = 'ids:'.implode(',', $itemIds);\n\n $response = $this->api->getList($search);\n $this->assertErrors($response);\n $this->assertEquals(count($itemIds), $response['total']);\n\n foreach ($response['lists'] as $item) {\n $this->assertTrue(in_array($item['id'], $itemIds));\n $this->api->delete($item['id']);\n $this->assertErrors($response);\n }\n }", "protected function _decodeItems($parameters, $retrieveItems = false) {\n\t\t\t$response = array();\n\n\t\t\tif (!empty($parameters['items'])) {\n\t\t\t\tforeach ($parameters['items'] as $itemListName => $items) {\n\t\t\t\t\t$response[$itemListName] = array(\n\t\t\t\t\t\t'count' => count($items['data']),\n\t\t\t\t\t\t'data' => $items['data'],\n\t\t\t\t\t\t'name' => $itemListName,\n\t\t\t\t\t\t'table' => $items['table']\n\t\t\t\t\t);\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t!empty($items['data']) &&\n\t\t\t\t\t\t!empty($this->encode[$items['table']])\n\t\t\t\t\t) {\n\t\t\t\t\t\t$itemIndexes = array();\n\t\t\t\t\t\t$itemIndexLines = $items['data'];\n\t\t\t\t\t\t$itemIndex = $itemCount = 0;\n\n\t\t\t\t\t\tforeach ($itemIndexLines as $offsetIndex => $itemIndexLine) {\n\t\t\t\t\t\t\t$itemIndexLineChunks = explode('_', $itemIndexLine);\n\n\t\t\t\t\t\t\tforeach ($itemIndexLineChunks as $itemIndexLineChunk) {\n\t\t\t\t\t\t\t\t$itemStatus = substr($itemIndexLineChunk, 0, 1);\n\t\t\t\t\t\t\t\t$itemStatusCount = substr($itemIndexLineChunk, 1);\n\n\t\t\t\t\t\t\t\tif ($itemStatus) {\n\t\t\t\t\t\t\t\t\tif ($retrieveItems) {\n\t\t\t\t\t\t\t\t\t\tfor ($i = 0; $i < $itemStatusCount; $i++) {\n\t\t\t\t\t\t\t\t\t\t\t$itemIndexes[$itemIndex + $i] = 1;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$itemCount += $itemStatusCount;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$itemIndex += $itemStatusCount;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$response[$itemListName]['count'] = $itemCount;\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tempty($itemIndexes) ||\n\t\t\t\t\t\t\t!$itemCount\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($retrieveItems) {\n\t\t\t\t\t\t\t$dataTable = !empty($this->encode[$items['table']]['data_table']) ? $this->encode[$items['table']]['data_table'] : $items['table'];\n\t\t\t\t\t\t\t$itemParameters = array_merge($parameters, array(\n\t\t\t\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t\t\t\t'id'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'limit' => $itemIndex,\n\t\t\t\t\t\t\t\t'offset' => 0\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t\tif (!empty($this->encode[$items['table']]['sort'])) {\n\t\t\t\t\t\t\t\t$itemParameters['sort'] = $this->encode[$items['table']]['sort'];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$conditions = array(\n\t\t\t\t\t\t\t\t'id' => array()\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$itemIds = $this->fetch($dataTable, $itemParameters);\n\t\t\t\t\t\t\t$response[$itemListName] = array_merge($response[$itemListName], array(\n\t\t\t\t\t\t\t\t'parameters' => $itemParameters,\n\t\t\t\t\t\t\t\t'table' => $dataTable\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t\tif (!empty($itemIds['data'])) {\n\t\t\t\t\t\t\t\t$conditions['id'] = array_values(array_intersect_key($itemIds['data'], $itemIndexes));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!empty($parameters['data']['instant_replacement']) &&\n\t\t\t\t\t\t\t\t$parameters['action'] == 'replace'\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t$conditions[]['NOT']['AND'] = array(\n\t\t\t\t\t\t\t\t\t'status' => 'replaced'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$conditions[]['OR'] = array(\n\t\t\t\t\t\t\t\t\t'next_replacement_available' => null,\n\t\t\t\t\t\t\t\t\t'next_replacement_available <' => date('Y-m-d H:i:s', time())\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$response[$itemListName] = array_merge($response[$itemListName], $this->fetch($dataTable, array(\n\t\t\t\t\t\t\t\t'conditions' => $conditions,\n\t\t\t\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t\t\t\t'id'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $response;\n\t\t}", "function json_add_post() {\n\n\n $status = 0;\n $message = \"Product not processed successfully.\";\n $dealer = $this->post('sellerid');\n $user = $this->post('user');\n $item = $this->post('item');\n $role = $this->post('role');\n $dt = date(\"Y-m-d H:i:s\");\n $qty = $this->post('qty');\n $json_qty = $this->post('json_qty');\n $json_encode_array = json_decode($json_qty, true);\n $flag = false;\n $processed_items = 0;\n foreach ($json_encode_array as $key => $value) {\n $data = array(\"dealer\" => $dealer, \"branch_price_id\" => $key);\n $cart_qry = $this->model_all->getTableData(\"seller_cart_items\", $data);\n if ($cart_qry->num_rows() > 0) {\n $cart_rs = $cart_qry->row_array();\n $data[\"product_count\"] = $value;\n $data[\"modifiedon\"] = $dt;\n $data[\"added_by\"] = $user;\n $data[\"added_role\"] = $role;\n $aff_rows = $this->model_all->update($data, array(\"id\" => $cart_rs[\"id\"]), \"seller_cart_items\");\n if ($aff_rows) {\n $flag = true;\n $processed_items++;\n }\n } else {\n $data[\"product_count\"] = $value;\n $data[\"modifiedon\"] = $dt;\n $data[\"added_by\"] = $user;\n $data[\"added_role\"] = $role;\n $id = $this->model_all->save($data, \"seller_cart_items\");\n if ($id > 0) {\n $flag = true;\n $processed_items++;\n }\n }\n }\n\n\n\n\n\n\n $items_count_qry = $this->model_all->getTableData(\"seller_cart_items\", array(\"dealer\" => $dealer));\n if ($flag) {\n $status = 1;\n $message = $processed_items . \" Items Processed Successfully\";\n }\n\n\n $result[\"status\"] = $status;\n $result[\"message\"] = $message;\n $result[\"items_count\"] = $items_count_qry->num_rows();\n\n $this->response($result, 200);\n\n exit;\n }", "public function __construct(OB_API $api, $type, array $container, $total) \n\t{\n\t\tif( ! is_array($container))\n\t\t\tthrow new Kohana_Exception(\"API Collection must be set with an array result\");\n\n\t\t$this->container = $container;\n\t\t$this->_item_type = OB_API_Item::factory($api, $type);\n\n\t\t$this->_api = $api;\n\t\t$this->_type = $type;\n\t\t$this->_total = $total;\n\t}", "public function addMultipleItems($items){\r\n if(!empty($items)){foreach($items as $item){ //lopp through the items\r\n $this->addSimpleItem($item); //And add them 1 by 1\r\n }}\r\n }", "public static function endEbayListing($items)\n\t{\n\t\t$results = array();\n\t\ttry {\n\t\t\t$endListingResultXML = ISC_ADMIN_EBAY_OPERATIONS::endItems($items);\n\t\t\tforeach ($endListingResultXML->EndItemResponseContainer as $item) {\n\t\t\t\t$results[] = new ISC_ADMIN_EBAY_END_ITEM_RESULT($item);\n\t\t\t}\n\t\t\treturn $results;\n\t\t} catch (ISC_EBAY_API_REQUEST_EXCEPTION $e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public function addSimpleItem($item){\t\t\r\n if( //Check the quantity and the name\r\n !empty($item['quantity']) \r\n && is_numeric($item['quantity']) \r\n && $item['quantity']>0 \r\n && !empty($item['name'])\r\n ){ //And add the item to the cart if it is correct\r\n $items = $this->items;\r\n $items[] = $item;\r\n $this->items = $items;\r\n }\r\n }", "public static function _register()\n {\n self::assignElements(['AddItemResponseContainer' => ['type' => 'AddItemResponseContainerType', 'xmlns' => self::XMLNS, 'cardinality' => '0..*']], parent::NAME);\n self::assignAttributes([]);\n }", "function items() {\n\t\n if(isset($_GET['add_cart'])){\n\t\n\t global $db;\n\t \n\t $ip_add = getRealIpAddr();\n\t \n\t $get_items = \"SELECT * FROM cart WHERE ip_add = '$ip_add' \";\n\t \n\t $run_items = mysqli_query($db,$get_items);\n\n\t $count_items = mysqli_num_rows($run_items); /* Counting how many items user has added to cart*/\n\t }\t\n\t\n\telse \n\t{\n\t global $db;\n\t \n $ip_add = getRealIpAddr();\n\t \n\t $get_items = \"SELECT * FROM cart WHERE ip_add = '$ip_add' \";\n\t \n\t $run_items = mysqli_query($db,$get_items);\n\n\t $count_items = mysqli_num_rows($run_items); \t \n\t\t\n\t\t\n\t}\n\n\t echo $count_items;\n\t}", "public function getItemDetails($request, $response, $args)\n\t{\n\t\t$uri = $request->getUri();\n\t\t$baseUrl = $uri->getBaseUrl();\n\t\tif(!empty($args['item_id'])){\n\t\t\t$item_id = $args['item_id'];\t\n\t\t\ttry{\t\n\t\t\t\t$stmt = $this->c->db->prepare(\"SELECT * FROM c9_menu WHERE item_id ='\".$item_id.\"' AND is_active =1\");\n\t\t\t\t$stmt->execute(); \n\t\t\t\t$nRows = count($stmt->fetchAll());\n\t\t\t\tif($nRows > 0 ){\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t$foodItems = $stmt->fetchAll();\n\t\t\t\t\t$i=0;\n\t\t\t\t\tforeach($foodItems as $foodItem){\t\t\t\t\n\t\t\t\t\t\t$foodItems[$i]['image'] = $baseUrl.\"/uploads/menu/\".$foodItem['image'];\n\t\t\t\t\t\t$i++;\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t$json = array(\"error\" => false, \"message\" =>$foodItems);\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\t$json = array(\"error\" => false, \"message\" =>\"Not Found!\");\n\t\t\t\t}\n\t\t\t}catch(PDOException $e){\n\t\t\t\t\t\n\t\t\t\t$json = array(\"error\" => true, \"message\" => $e->getMessage());\n\t\t\t}\n\t\t}else{\n\t\t\t\n\t\t\t$json = array(\"error\" => false, \"message\" =>\"ItemID not empty!\");\n\t\t}\t\t\n\t\t$response->withHeader('Content-type', 'application/json');\n\t\treturn $response->withJson($json);\t\t\n\t}", "public function prepare_item_for_response($post, $request)\n {\n }", "public function addItem($item) {\n\t\t$this->result .= '<li>' . $item . '</li>' . PHP_EOL;\n\t}", "function addItem($itemKey){\n\t\t\t//if the item already exsists in the cart, add one.\n\t\t\tif(isset($this->items[$itemKey])){\n\t\t\t\t$this->items[$itemKey]['quantity'] = $this->items[$itemKey]['quantity'] + 1; \n\t\t\t}\n\t\t\t\n\t\t\t//if the item is not already set in the cart.\n\t\t\t//Find the correct price off the item from the server side $products\n\t\t\t//note - I am looking up the prices server-side to protect from customers entering in their own prices in the html\n\t\t\telse{\n\t\t\t\t//find the corresponding product based on the product name (keys would be preferable)\n\t\t\t\tforeach($GLOBALS['products'] as $product){\t\t\n\t\t\t\t\tif($itemKey == $product['name']){\n\t\t\t\t\t\t//set the item price server-side\n\t\t\t\t\t\t$itemPrice = $product['price'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//if there is a valid product with that name (key) and therefore has a corresponding price.\n\t\t\t\t//add it to the cart otherwise ignore it\n\t\t\t\t//note - This protects the server from having items in the shopping cart that don't exsist server side. \n\t\t\t\tif(isset($itemPrice)){\n\t\t\t\t\t$this->items[$itemKey] = array( \"name\" => $itemKey, \"price\" => $itemPrice , \"quantity\" => 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\t\t\n\t\t\treturn;\n\t\t}", "public function build_product_data( $item=array(), $old_item=array() ) {\n\n // summarize product details\n $retProd = array(\n 'ASIN' => isset($item['ASIN']) ? $item['ASIN'] : '',\n 'ParentASIN' => isset($item['ParentASIN']) ? $item['ParentASIN'] : '',\n \n 'ItemAttributes' => isset($item['ItemAttributes']) ? $item['ItemAttributes'] : array(),\n 'Title' => isset($item['ItemAttributes']['Title']) ? stripslashes($item['ItemAttributes']['Title']) : '',\n 'SKU' => isset($item['ItemAttributes']['SKU']) ? $item['ItemAttributes']['SKU'] : '',\n 'Feature' => isset($item['ItemAttributes']['Feature']) ? $item['ItemAttributes']['Feature'] : '',\n 'Brand' => isset($item['ItemAttributes']['Brand']) ? $item['ItemAttributes']['Brand'] : '',\n 'Binding' => isset($item['ItemAttributes']['Binding']) ? $item['ItemAttributes']['Binding'] : '',\n //'ListPrice' => isset($item['ItemAttributes']['ListPrice']['FormattedPrice']) ? $item['ItemAttributes']['ListPrice']['FormattedPrice'] : '',\n \n 'Variations' => isset($item['Variations']) ? $item['Variations'] : array(),\n 'VariationSummary' => isset($item['VariationSummary']) ? $item['VariationSummary'] : array(),\n 'BrowseNodes' => isset($item['BrowseNodes']) ? $item['BrowseNodes'] : array(),\n 'DetailPageURL' => isset($item['DetailPageURL']) ? $item['DetailPageURL'] : '',\n 'SalesRank' => isset($item['SalesRank']) ? $item['SalesRank'] : 999999,\n\n 'SmallImage' => isset($item['SmallImage']['URL']) ? trim( $item['SmallImage']['URL'] ) : '',\n 'LargeImage' => isset($item['LargeImage']['URL']) ? trim( $item['LargeImage']['URL'] ) : '',\n\n 'Offers' => isset($item['Offers']) ? $item['Offers'] : '',\n 'OfferSummary' => isset($item['OfferSummary']) ? $item['OfferSummary'] : '',\n 'EditorialReviews' => isset($item['EditorialReviews']['EditorialReview']['Content'])\n ? $item['EditorialReviews']['EditorialReview']['Content'] : '',\n \n\t\t\t\t'hasGallery'\t\t\t=> 'false',\n );\n\t\t\t\n\t\t\t// try to rebuid the description if is empty\n\t\t\tif( trim($retProd[\"EditorialReviews\"]) == \"\" ){\n\t\t\t\tif( isset($item['EditorialReviews']['EditorialReview']) && count($item['EditorialReviews']['EditorialReview']) > 0 ){\n\t\t\t\t\t\n\t\t\t\t\t$new_description = array();\n\t\t\t\t\tforeach ($item['EditorialReviews']['EditorialReview'] as $desc) {\n\t\t\t\t\t\tif( isset($desc['Content']) && isset($desc['Source']) ){\n\t\t\t\t\t\t\t//$new_description[] = '<h3>' . ( $desc['Source'] ) . ':</h3>';\n\t\t\t\t\t\t\t$new_description[] = $desc['Content'] . '<br />';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( isset($new_description) && count($new_description) > 0 ){\n\t\t\t\t\t$retProd[\"EditorialReviews\"] = implode( \"\\n\", $new_description );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n // CustomerReviews url\n if ( isset($item['CustomerReviews'], $item['CustomerReviews']['HasReviews'])\n && $item['CustomerReviews']['HasReviews'] ) {\n $retProd['CustomerReviewsURL'] = $item['CustomerReviews']['IFrameURL'];\n }\n\n // Images\n $retProd['images'] = $this->build_images_data( $item );\n if ( empty($retProd['images']['large']) ) {\n // no images found - if has variations, try to find first image from variations\n $retProd['images'] = $this->get_first_variation_image( $item );\n }\n \n if ( empty($retProd['SmallImage']) ) {\n if ( isset($retProd['images']['small']) && !empty($retProd['images']['small']) ) {\n $retProd['SmallImage'] = $retProd['images']['small'][0];\n }\n }\n if ( empty($retProd['LargeImage']) ) {\n if ( isset($retProd['images']['large']) && !empty($retProd['images']['large']) ) {\n $retProd['LargeImage'] = $retProd['images']['large'][0];\n }\n }\n\n\t\t\t// has gallery: get gallery images\n\t\t\tif ( isset($item['ImageSets']) && count($item['ImageSets']) > 0 ) {\n\t\t\t\tforeach ( $item['ImageSets'][\"ImageSet\"] as $key => $value ) {\n\t\t\t\t\tif ( isset($value['LargeImage']['URL']) ) {\n\t\t\t\t\t\t$retProd['hasGallery'] = 'true';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n return $retProd;\n }", "public function add($item)\n {\n $this->addArray('content', $item, array('ButtonContainer', 'Container', 'Form', 'Heading', 'HTML', 'Image', 'Checkbox', 'Email', 'HiddenField', 'Label', 'Password', 'Phone', 'RadioButtons', 'SelectMenu', 'TextInput', 'TextArea', 'Upload', 'XList', 'Table'));\n }", "public function setItem_list($item_list)\r\n {\r\n $this->item_list = $item_list;\r\n\r\n return $this;\r\n }", "private static function parse_items($items){\n $results = [];\n foreach($items as $item){\n $title = $item->find('.title a')[0];\n if(empty($title)){\n $title = $item->find('.featured-ad-title a')[0];\n }\n try{\n $item_data = [\n \"title\" => $title->text,\n \"date\" => $item->find('.date')[0]->text,\n \"url\" => $title->getAttribute(\"href\"),\n \"location\" => $item->find('.location')[0]->text\n ];\n\n $price = trim($item->find('.price')[0]->text);\n\n $m = explode(\" \", $price);\n if(count($m) > 1){\n $item_data[\"price\"] = intval(str_replace(\",\", \"\", $m[1]));\n $item_data[\"currency\"] = $m[0];\n }else{\n $item_data[\"price\"] = 0;\n $item_data[\"currency\"] = \"UNKNOWN\";\n }\n\n try{\n $category = $item->find('.description .breadcrumbs')[0];\n if(is_object($category)){\n $item_data[\"category\"] = $category->text;\n }else{\n $item_data[\"category\"] = $category;\n }\n }catch(Exception $e){\n $item_data[\"category\"] = \"\";\n }\n\n $photo_block = $item->find(\".thumb div\");\n if(!empty($photo_block)){\n $style = $photo_block->getAttribute(\"style\");\n preg_match(\"/http.*\\.\\w*/\", $style, $result);\n if(!empty($result)){\n $item_data[\"photo\"] = $result[0];\n }else{\n $item_data[\"photo\"] = \"\";\n }\n }else{\n $item_data[\"photo\"] = \"\";\n }\n\n\n array_push($results, $item_data);\n }catch(Exception $e){\n continue;\n }\n }\n return $results;\n }", "public function setItemList($item_list)\r\n {\r\n $this->item_list = $item_list;\r\n\r\n return $this;\r\n }", "public function prepare_response_for_collection($response)\n {\n }", "public function getItemBag() {\n $item_classname = $this->getItemClass();\n $item_bag_classname = $this->getItemBagClass();\n $items = new $item_bag_classname();\n $currency = NULL;\n foreach ($this->getPayment()->getLineItems() as $line_item) {\n $item = new $item_classname();\n $item->setPrice($line_item->getAmount());\n $item->setQuantity($line_item->getQuantity());\n $item->setDescription($line_item->getDescription());\n $item->setName($line_item->getName());\n $items->add($item);\n\n $line_item_currency = $line_item->getCurrencyCode();\n\n if ($line_item_currency != $currency) {\n if ($currency != NULL) {\n // This is the second time we are changing the currency which means\n // that our line items have mixed currencies. This ain't gonna work!\n drupal_set_message($this->t('Mixed currencies detected which is not yet supported.'), 'error');\n return new OperationResult(NULL);\n }\n $currency = $line_item_currency;\n }\n }\n $this->setCurrency($currency);\n return $items;\n }", "public function addItems(array $items);", "private function formatResponse($response) {\n\n $callback = function($item) {\n $formatted = [\n 'spotify_id' => $item['id'],\n 'name' => $item['name'],\n 'image_small' => null,\n 'image_large' => null,\n ];\n\n if (isset($item['images']) && count($item['images'])) {\n $smallImageIndex = (isset($item['images'][2]) && isset($item['images'][2]['width']) && $item['images'][2]['width'] < 170) ? 1 : 2;\n $formatted['image_small'] = $this->getImage($item['images'], $smallImageIndex);\n $formatted['image_large'] = $this->getImage($item['images']);\n }\n\n if (isset($item['popularity'])) {\n $formatted['spotify_popularity'] = $item['popularity'];\n }\n\n if (isset($item['duration_ms'])) {\n $formatted['duration'] = $item['duration_ms'];\n }\n\n if (isset($item['track_number'])) {\n $formatted['number'] = $item['track_number'];\n }\n\n if (isset($item['genres'])) {\n $formatted['genres'] = implode('|', $item['genres']);\n }\n\n if (isset($item['artists']) && count($item['artists'])) {\n $formatted['artists'] = $item['artists'];\n }\n\n if (isset($item['album']) && count($item['album'])) {\n $formatted['album'] = $item['album'];\n\n if ( ! isset($formatted['image'])) {\n if (isset($item['album']['images'][2]['url'])) {\n $formatted['image'] = $item['album']['images'][2]['url'];\n } else {\n $formatted['image'] = head($item['album']['images']);\n }\n\n }\n }\n\n return $formatted;\n };\n\n $formatted = ['albums' => [], 'tracks' => [], 'artists' => []];\n\n if ( ! isset($response['error'])) {\n $formatted['albums'] = $this->getAlbums(isset($response['albums']['items']) ? $response['albums']['items'] : []);\n $formatted['tracks'] = array_map($callback, isset($response['tracks']['items']) ? $response['tracks']['items'] : []);\n $formatted['artists'] = array_map($callback, isset($response['artists']['items']) ? $response['artists']['items'] : []);\n }\n\n return $formatted;\n }", "function ItemLookup($asin) {\n //Define the request\n//$request = \"http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=\".Access_Key_ID.\"&AssociateTag=\".Associate_tag.\"&Signature=\".Signature.\"&Timestamp=\".Timestamp.\"&Version=2009-03-31&Operation=ItemLookup&ItemId=$asin&ResponseGroup=Medium,Offers\";\n\n //$request = \"http://ecs.amazonaws.com/onca/xml?AWSAccessKeyId=AKIAJVJTIWZXTELKIJGQ&Keywords=harry%20potter&Operation=ItemSearch&SearchIndex=Books&Service=AWSECommerceService&Timestamp=2011-07-31T00%3A54%3A25.000Z&Version=2009-03-31&Signature=Bj1Snowi5S3ePnmChop3OsUZumzm62xcAkL3fHGnocc%3D\";\n\n\n /*$canonicalQuery = \"http://ecs.amazonaws.com/onca/xml?AWSAccessKeyId=\" . Access_Key_ID .\n \"&Keywords=harry%20potter\" .\n \"&Operation=ItemSearch\" .\n \"&SearchIndex=Books\" .\n \"&Service=AWSECommerceService\" .\n \"&Version=2009-03-31\";*/\n\n $canonicalQuery = \"http://ecs.amazonaws.com/onca/xml?AWSAccessKeyId=\" . Access_Key_ID .\n \"&ItemId=\" . $asin .\n \"&Operation=ItemLookup\" .\n \"&ResponseGroup=Images,ItemAttributes\" .\n \"&Service=AWSECommerceService\" .\n \"&Version=2009-03-31\";\n\n $url = signAmazonUrl($canonicalQuery, Secret_Access_Key);\n\n$session = curl_init($url);\n\tcurl_setopt($session, CURLOPT_HEADER, false);\n\tcurl_setopt($session, CURLOPT_RETURNTRANSFER, true);\n\t$response = curl_exec($session);\n\tcurl_close($session);\n\t//$response = file_get_contents($request);\n\t//$parsed_xml = simplexml_load_string($response);\n\n\theader(\"Content-Type:text/xml\");\n echo $response;\n}", "public function isListingItem()\n {\n return true;\n }", "public function get_category_item_specifics($categoryID)\n {\n\n // Create the request object.\n $request = new Types\\GetCategorySpecificsRequestType();\n\n // An user token is required when using the Trading service.\n $request->RequesterCredentials = $this->requester_credentials;\n\n /**\n * Check Item Specifics are Enabled\n */\n $this->CI->load->library('ebay_category_features', $categoryID);\n $mode = $this->ebay_category_features->get_ItemSpecificsMode();\n //var_dump($$mode);\n\n\n if ($categoryID && $mode !== 'Disabled') {\n $request->CategoryID = [$categoryID];\n $response = $this->trading_service->getCategorySpecifics($request);\n // Check errors\n $checkError = $this->get_response($response);\n if ($checkError != 0) {\n if (count($response->Recommendations)) {\n $name_value_arr = array();\n foreach ($response->Recommendations as $Recommendation) {\n foreach ($Recommendation->NameRecommendation as $NameRecommendation) {\n $values_arr = array();\n if ($NameRecommendation->ValidationRules->SelectionMode == 'SelectionOnly') {\n $values_arr['custom']['SelectionOnly'] = true;\n }\n\n if ($NameRecommendation->ValidationRules->MinValues >= 1) {\n /**\n * Required item specifics have * in Name of Specific\n */\n //$name = $NameRecommendation->Name . '<strong>*</strong>';\n $values_arr['custom']['MinValues'] = true;\n }\n\n /*\n |--------------------------------------------------------------------------\n | Finally Helped\n |--------------------------------------------------------------------------\n |http://prntscr.com/g5zzn5\n |https://stackoverflow.com/questions/5421426/php-xml-xpath-node-element-iteration-and-inserting-into-array\n */\n\n $name = $NameRecommendation->Name;\n\n foreach ($NameRecommendation->ValueRecommendation as $ValueRecommendation) {\n $values = (string)$ValueRecommendation->Value;\n array_push($values_arr, $values);\n //$converted_values = explode(\",\",$value);\n // echo print_r($converted_values);\n }\n $name_value_arr[$name] = $values_arr;\n }\n }\n\n //var_dump($name_value_arr);\n\n $browse = [];\n\n foreach ($name_value_arr as $key => $value) {\n $custom = $this->findKey($value, 'custom');\n $selection_only = $this->findKey($value, 'SelectionOnly');\n $min_values = $this->findKey($value, 'MinValues');\n\n // var_dump($custom);\n // var_dump($value);\n\n $key = ($min_values) ? $key . '<strong>*</strong>' : $key;\n unset($value['custom']);\n $browse[$key] = $value;\n }\n\n //var_dump($browse);\n return json_encode($browse);\n // return $browse;\n\n }\n }\n } else return false;\n }", "public static function addItem($conn, $sku, $title, $price, $quantity=\"1\", $taxable=\"0\", $tangible=\"0\", $available=\"0\", $listed=\"0\", $description=\"\", $notes =\"\")\n\t{\n\t\t// add the item entry\n\t\t$st = <<<sql\n\t\t\tinsert into Items (sku, title, price, quantity, taxable, tangible, available, listed, description, notes)\n\t\t\tvalues (:sku, :title, :price, :quantity, :taxable, :tangible, :available, :listed, :description, :notes);\n\t\tsql;\n\t\t\n\t\t// start transaction\n\t\t$conn->beginTransaction();\n\t\t\n\t\t$q = $conn->prepare($st);\n\t\t$q->execute([\n\t\t\t':sku' => $sku,\n\t\t\t':title' => $title,\n\t\t\t':price' => $price,\n\t\t\t':quantity' => $quantity,\n\t\t\t':taxable' => $taxable,\n\t\t\t':tangible' => $tangible,\n\t\t\t':available' => $available,\n\t\t\t':listed' => $listed,\n\t\t\t':description' => $description,\n\t\t\t':notes' => $notes,\n\t\t\t]);\n\t\t\n\t\t// get last ID entered and commit\n\t\t$id = $conn->query(\"select last_insert_id() as id from items\");\n\t\t$output = ($id->fetch())['id'];\n\t\t//die();\n\t\t$conn->commit();\n\t\t\n\t\treturn (int)$output;\n\t}", "public function getsingle($item_id){\n $resource = Mage::getSingleton('core/resource');\n \n /**\n * Retrieve the read connection\n */\n $readConnection = $resource->getConnection('core_read');\n \n $table = $resource->getTableName('core/config_data');\n \n /**\n * Set the product ID\n */\n \n $query = \"SELECT value FROM \" . $table . \" WHERE path='ebay/settings/app_name'\"; \n \n \n /**\n * Execute the query and store the results in $results\n */\n $results = $readConnection->fetchAll($query);\n \n /**\n * Print out the results\n */\n ;\n\n\n $passurl=\"http://open.api.ebay.com/shopping?callname=GetSingleItem&responseencoding=XML&appid=\".$results[0]['value'].\"&siteid=77&version=515&ItemID=\".$item_id.\"&IncludeSelector=Variations,Description,Details,ItemSpecifics,ShippingCosts,QuantitySold,Quantity\";\n \n $responseXml= file_get_contents($passurl);\n \n $responseDoc = new DomDocument();\n $responseDoc->loadXML($responseXml);\n \n \n $des = $responseDoc->getElementsByTagName('Description')->item(0)->nodeValue;\n $soldqty = $responseDoc->getElementsByTagName('QuantitySold')->item(0)->nodeValue;\n $qty = $responseDoc->getElementsByTagName('Quantity')->item(0)->nodeValue;\n \n $itemSpecific = $responseDoc->getElementsByTagName('ItemSpecifics')->item(0);\n $listElements = $itemSpecific->getElementsByTagName('NameValueList');\n $i=0;\n foreach($listElements as $listElement){\n $name=$listElement->getElementsByTagName('Name')->item(0)->nodeValue;\n $value=$listElement->getElementsByTagName('Value')->item(0)->nodeValue;\n $m = Mage::getModel('catalog/resource_eav_attribute')\n ->loadByCode('catalog_product',$name);\n\n if(null===$m->getId()) { $this->createAttribute($name, $name, \"text\", \"simple\"); }\n $name_value_list[$i]=array($name,$value);\n $i++;\n }//for each attribute\n \n $name_value_list=$name_value_list;\n \n /*---------------------------import variation------------------- */\n $option=$option_label=array();\n if($responseDoc->getElementsByTagName('Variation')){\n $variation_list = $responseDoc->getElementsByTagName('Variation');\n }\n $i=0;\n foreach($variation_list as $variation){\n $listElements = $variation->getElementsByTagName('NameValueList');\n $j=0;\n foreach($listElements as $listElement){\n $name=$listElement->getElementsByTagName('Name')->item(0)->nodeValue;\n $value=$listElement->getElementsByTagName('Value')->item(0)->nodeValue;\n $option[$j][$i]=$value; \n $option_label[$j]=$name;\n $j++;\n }\n \n $i++;\n }\n $data_arr1['option']=$option;\n $data_arr1['option_label']= $option_label;\n \n /*--------------------------------end------------------------- */\n \n \n $picture_url= $responseDoc->getElementsByTagName('PictureURL');\n $z=0;\n foreach ($picture_url as $p){\n $p_url[$z]=$p->nodeValue;\n $z++;\n break;\n }\n \n if(empty($p_url)){\n $p_url[0]='http://thumbs.ebaystatic.com/pict/3193577262_3.jpg';\n }\n \n $days = $responseDoc->getElementsByTagName('HandlingTime')->item(0)->nodeValue;\n if(!empty($p_url)){\n $importDir = Mage::getBaseDir('media') . DS . 'import' . DS;\n $i=0;\n foreach($p_url as $p){\n $content=@file_get_contents($p);\n $save = $item_id .$i. '.jpg'; \n $path[$i]=$importDir.''.$save;\n @file_put_contents($path[$i],$content);\n $i++;\n }//each photos\n \n $result['description'] = $des;\n $result['soldqty'] = $soldqty;\n $result['qty'] = $qty;\n $result['path'] = $path;\n $result['name_value_list'] = $name_value_list;\n $result['option'] = $option;\n $result['option_label'] = $option_label;\n \n return $result;\n \n }//if photos \n }", "public function printList($xmlContainer, $item, $data){\n \t$xmlParser=new XMLParser();\n \t$page=$xmlParser->getXMLSchema($xmlContainer);\n \tif($tableXML=$xmlParser->getNode($page,'list', $item)){\n\t \t$tableXML=$xmlParser->getNode($page,'list', $item);\t\t\t\t\n\t \t$fieldsXML= $xmlParser->getNode($tableXML, 'fields', 0);\n\t \t\n\t \t$tdColor= \"\";\n\t \t$list= \"<table \".$xmlParser->getChildNodeAttribute($tableXML, 'tableList', 'attr').\">\\n\";\t\n\t\t \tforeach ($xmlParser->getChildNodes($fieldsXML) as $field){\n\t\t\t\t\tif($xmlParser->getChildNodeValue($field, 'fieldView')==1){\n\t\t\t\t\t\tif($xmlParser->getChildNodeValue($tableXML, 'alternativeColor')==1){\n\t\t\t\t\t\t\tif($tdColor==\"tbl_c1\"){ $tdColor= \"tbl_c2\"; }else{ $tdColor= \"tbl_c1\"; }\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$tdColor=\"internal\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tswitch ($xmlParser->getNodeAttribute($field, 'typeView')) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase \"img\":\n\t\t\t\t\t\t\t\t$pathImg= GENERAL_FILE_STORE.\"images/\".$data[$xmlParser->getNodeAttribute($field, 'dataName')];\n\t\t\t\t\t\t\t\tif(is_file($pathImg)){\t\t\n\t\t\t\t\t\t\t\t\t$list.= \"<tr>\";\n\t\t\t\t\t\t\t \t$list.= \"<td valign=\\\"center\\\" class=\\\"\".$tdColor.\"\\\" width=\\\"\".$xmlParser->getChildNodeValue($field, 'fieldTblWidth').\"\\\"><b>\".$xmlParser->getChildNodeValue($field, 'label').\"</b></td>\\n\";\n\t\t\t\t\t\t\t \t$list.=\"<td class=\\\"\".$tdColor.\"\\\"><img src=\\\"\".GENERAL_FILE_STORE_URL.\"images/\".$data[$xmlParser->getNodeAttribute($field, 'dataName')].\"\\\"></td>\";\n\t\t\t\t\t\t\t \t$list.= \"</tr>\\n\";\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$list.= \"<tr>\";\n\t\t\t\t\t\t\t \t$list.= \"<td valign=\\\"center\\\" class=\\\"\".$tdColor.\"\\\" width=\\\"\".$xmlParser->getChildNodeValue($field, 'fieldTblWidth').\"\\\"><b>\".$xmlParser->getChildNodeValue($field, 'label').\"</b></td>\\n\";\n\t\t\t\t\t\t\t \t$list.=\"<td class=\\\"\".$tdColor.\"\\\">[no image]</td>\";\n\t\t\t\t\t\t\t \t$list.= \"</tr>\\n\";\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase \"data\":\n\t\t\t\t\t\t\t\t$list.= \"<tr>\";\n\t\t\t\t\t\t \t$list.= \"<td valign=\\\"top\\\" class=\\\"\".$tdColor.\"\\\" width=\\\"\".$xmlParser->getChildNodeValue($field, 'fieldTblWidth').\"\\\"><b>\".$xmlParser->getChildNodeValue($field, 'label').\"</b></td>\\n\";\n\t\t\t\t\t\t \t$list.=\"<td class=\\\"\".$tdColor.\"\\\">\".UserInterface::getDate($data[$xmlParser->getNodeAttribute($field, 'dataName')], '-').\"</td>\";\n\t\t\t\t\t\t \t$list.= \"</tr>\\n\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase \"label\":\n\t\t\t\t\t\t\t\t$list.= \"<tr>\";\n\t\t\t\t\t\t \t$list.= \"<td colspan=\\\"2\\\" align=\\\"left\\\" valign=\\\"top\\\" class=\\\"\".$tdColor.\"\\\" width=\\\"\".$xmlParser->getChildNodeValue($field, 'fieldTblWidth').\"\\\"><b><u>\".$xmlParser->getChildNodeValue($field, 'label').\"</u></b></td>\\n\";\n\t\t\t\t\t\t \t$list.= \"</tr>\\n\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase \"hr\":\n\t\t\t\t\t\t\t\t$list.= \"<tr>\";\n\t\t\t\t\t\t \t$list.= \"<td colspan=\\\"2\\\" valign=\\\"top\\\" class=\\\"\".$tdColor.\"\\\" width=\\\"\".$xmlParser->getChildNodeValue($field, 'fieldTblWidth').\"\\\"><hr \".$xmlParser->getNodeAttribute($field, 'attr').\"></td>\\n\";\n\t\t\t\t\t\t \t$list.= \"</tr>\\n\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$list.= \"<tr>\";\n\t\t\t\t\t\t \t$list.= \"<td valign=\\\"top\\\" class=\\\"\".$tdColor.\"\\\" width=\\\"\".$xmlParser->getChildNodeValue($field, 'fieldTblWidth').\"\\\"><b>\".$xmlParser->getChildNodeValue($field, 'label').\"</b></td>\\n\";\n\t\t\t\t\t\t \t$list.=\"<td class=\\\"\".$tdColor.\"\\\">\".$data[$xmlParser->getNodeAttribute($field, 'dataName')].\"</td>\";\n\t\t\t\t\t\t \t$list.= \"</tr>\\n\";\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}\n\t \t$list.= \"</table>\"; \t\n\t \treturn $list;\n \t}else{\n \t\treturn \"\";\t\n \t}\n }", "function getItems($testItems) {\n\t// echo $_SERVER[\"QUERY_STRING\"].\"\\r\\n\";\n\t$results = array();\n\t$location = array(\"latitude\" => $_GET[\"latitude\"], \"longitude\" => $_GET[\"longitude\"]);\n\t\n $query = array();\n if (isset($_GET[\"expiry\"])) {\n $expiry;\n if ($_GET[\"expiry\"] == 1) {\n $expiry = date(\"Y-m-d\");\n }\n else if ($_GET[\"expiry\"] == 2) {\n $expiry = new date(\"Y-m-d\", strtotime(\"+1 day\"));\n }\n else if ($_GET[\"expiry\"] == 3) {\n $expiry = new date(\"Y-m-d\", strtotime(\"+1 week\"));\n }\n else if ($_GET[\"expiry\"] == 4) {\n $expiry = new date(\"Y-m-d\", strtotime(\"+1 year\"));\n }\n $query[\"expiry\"] = $expiry;\n }\n\n if (isset($_GET[\"type\"])) {\n $type;\n if ($_GET[\"type\"] == 1) {\n $type = \"fruit\";\n }\n else if ($_GET[\"type\"] == 2) {\n $type = \"veg\"; \n }\n else if ($_GET[\"type\"] == 3) {\n $type = \"meat\";\n }\n $query[\"type\"] = $type;\n }\n\n if (isset($_GET[\"distance\"])) {\n foreach($testItems as $item) {\n $distance = getDistance($location, $item) * 0.000621371;\n\t\t\tif ($distance <= $_GET[\"distance\"]) {\n\t\t\t\t$item[\"distance\"] = round($distance, 2).\" miles\"; \n array_push($results, $item);\n\t\t\t}\n\t\t}\n return $results;\n }\n else {\n return $testItems;\n }\n}", "public abstract function printItemsWithContainer($containerTitle, ...$items);", "public function addToCart()\n\t{\n\t\t$id \t= $this->request['item_id'];\n\t\t$number = intval($this->request['quantity']);\n\t\t\n\t\t#permission and enabled?\n\t\t$this->registry->ecoclass->canAccess('cart', false);\n\t\t\n\t\t#init\n\t\t$checks \t\t= array();\n\n\t\t#break up the item classification that we're adding to our cart\t\t\t \n\t\t$item_input_name = explode('_' , $id);\n\n\t\t$type \t\t\t= $item_input_name[0];\n\t\t$id \t\t\t= $item_input_name[1];\n\t\t$banktype \t\t= strtolower($item_input_name[2]);\n\n\t\t#loan hotfix\n\t\t$type\t\t\t= ( $banktype != 'loan' ) ? $type : $banktype;\n\t\t\n\t\t#grab this cart types class object\n\t\t$cartItemType = $this->registry->ecoclass->grabCartTypeClass($type);\n\n\t\t#format number a bit..\t\n\t\t$number = $this->registry->ecoclass->makeNumeric($number, true);\n\n\t\t#grab item from cache\n\t\t$theItem\t= $cartItemType->grabItemByID($id);\n\t\t\t\t\n\t\t#check for any illegal activity :shifty:\n\t\t$checks = $this->checkCartAdditions( $id, $type, $banktype, $number, $theItem, false, $cartItemType );\n\t\t\n\t\t#if after all that we have an error...\n\t\tif ( $checks['error'] )\n\t\t{\n\t\t\t$this->registry->output->showError( $checks['error'] );\n\t\t}\n\n\t\t#no error? Lets throw the item and number in our cart!\n\t\tif ( $checks['cartItem'] )\n\t\t{\n\t\t\t$add2Item = array('c_quantity' => $checks['cartItem']['c_quantity'] + $checks['number'] );\n\t\t\t\t\t\t\t\n\t\t\t$this->DB->update( 'eco_cart', $add2Item, 'c_member_id = ' .$this->memberData['member_id'].' AND c_id = '.$checks['cartItem'] ['c_id'] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$newItem = array( 'c_member_id' \t=> $this->memberData['member_id'],\n\t\t\t\t\t\t\t 'c_member_name'\t=> $this->memberData['members_display_name'],\n\t\t\t\t\t\t\t 'c_type' \t\t\t=> ( $type == 'loan' ) ? 'bank' : $type,\n\t\t\t\t\t\t\t 'c_type_id' \t\t=> $id,\n\t\t\t\t\t\t\t 'c_type_class' \t=> ( $type == 'bank' || $type == 'loan' ) ? $banktype : '',\n\t\t\t\t\t\t\t 'c_quantity'\t\t=> $checks['number'],\n\t\t\t\t\t\t\t);\n\t\t\t$this->DB->insert( 'eco_cart', $newItem );\n\t\t}\n\t\t\n\t\t#redirect message and show what we added\n\t\t$redirect_message = $cartItemType->add2CartRedirectMessage($checks, $theItem);\n\t\t\n\t\t$this->registry->output->redirectScreen( $redirect_message, $this->settings['base_url'] . \"app=ibEconomy&amp;tab=buy&amp;area=cart\" );\n\t}", "function get_meals($output)\r\n{\r\n\t$info = array('ricettaName' => [],\r\n\t\t\t\t\t'ricettaImage' =>[],\r\n\t\t\t\t\t'ricettaCategory' => [],\r\n\t\t\t\t\t'ricettaInstructions' => [],\r\n\t\t\t\t\t'ricettaIngredient1' => [],\r\n\t\t\t\t\t'ricettaIngredient2' => [],\r\n\t\t\t\t\t'ricettaIngredient3' => [],\r\n\t\t\t\t\t'ricettaIngredient4' => [],\r\n\t\t\t\t\t'ricettaIngredient5' => [],\r\n\t\t\t\t\t'ricettaIngredient6' => [],\r\n\t\t\t\t\t'ricettaIngredient7' => [],\r\n\t\t\t\t\t'ricettaIngredient8' => [],\r\n\t\t\t\t\t'ricettaIngredient9' => [],\r\n\t\t\t\t\t'ricettaMeasure1' => [],\r\n\t\t\t\t\t'ricettaMeasure2' => [],\r\n\t\t\t\t\t'ricettaMeasure3' => [],\r\n\t\t\t\t\t'ricettaMeasure4' => [],\r\n\t\t\t\t\t'ricettaMeasure5' => [],\r\n\t\t\t\t\t'ricettaMeasure6' => [],\r\n\t\t\t\t\t'ricettaMeasure7' => [],\r\n\t\t\t\t\t'ricettaMeasure8' => [],\r\n\t\t\t\t\t'ricettaMeasure9' => []\r\n\t\t\t\t\t);\r\n\t\r\n\tfor ($i = 0; \r\n\t\t $i < count($output[\"meals\"]) ; \r\n\t\t $i++)\r\n\t{\r\n\t\t// se è presente\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strMeal\"]))\r\n\t\t\t// assegno il valore all'array\r\n\t\t\t$info['ricettaName'][$i] = $output[\"meals\"][$i][\"strMeal\"];\r\n\t\telse\r\n\t\t\t// altrimenti gli assegno null\r\n\t\t\t$info['ricettaName'][$i] = \"null\";\r\n\t\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strMealThumb\"]))\r\n\t\t\t$info['ricettaImage'][$i] = $output[\"meals\"][$i][\"strMealThumb\"];\r\n\t\telse\r\n\t\t\t$info['ricettaImage'][$i] = \"null\";\r\n\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strCategory\"]))\r\n\t\t\t$info['ricettaCategory'][$i] = $output[\"meals\"][$i][\"strCategory\"];\r\n\t\telse\r\n\t\t\t$info['ricettaCategory'][$i] = \"null\";\r\n\r\n\t\tif(!empty($output[\"meals\"][$i][\"strInstructions\"]))\r\n\t\t\t$info['ricettaInstructions'][$i] = $output[\"meals\"][$i][\"strInstructions\"];\r\n\t\telse\r\n\t\t\t$info['ricettaInstructions'][$i] = \"null\";\r\n\t\t\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strIngredient1\"]))\r\n\t\t\t$info['ricettaIngredient1'][$i] = $output[\"meals\"][$i][\"strIngredient1\"];\r\n\t\telse\r\n\t\t\t$info['ricettaIngredient1'][$i] = \"null\";\r\n\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strIngredient1\"]))\r\n\t\t\t$info['ricettaIngredient1'][$i] = $output[\"meals\"][$i][\"strIngredient1\"];\r\n\t\telse\r\n\t\t\t$info['ricettaIngredient1'][$i] = \"null\";\r\n\t\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strIngredient2\"]))\r\n\t\t\t$info['ricettaIngredient2'][$i] = $output[\"meals\"][$i][\"strIngredient2\"];\r\n\t\telse\r\n\t\t\t$info['ricettaIngredient2'][$i] = \"null\";\r\n\t\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strIngredient3\"]))\r\n\t\t\t$info['ricettaIngredient3'][$i] = $output[\"meals\"][$i][\"strIngredient3\"];\r\n\t\telse\r\n\t\t\t$info['ricettaIngredient3'][$i] = \"null\";\r\n\t\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strIngredient4\"]))\r\n\t\t\t$info['ricettaIngredient4'][$i] = $output[\"meals\"][$i][\"strIngredient4\"];\r\n\t\telse\r\n\t\t\t$info['ricettaIngredient4'][$i] = \"null\";\r\n\t\t\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strIngredient5\"]))\r\n\t\t\t$info['ricettaIngredient5'][$i] = $output[\"meals\"][$i][\"strIngredient5\"];\r\n\t\telse\r\n\t\t\t$info['ricettaIngredient5'][$i] = \"null\";\r\n\t\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strIngredient6\"]))\r\n\t\t\t$info['ricettaIngredient6'][$i] = $output[\"meals\"][$i][\"strIngredient6\"];\r\n\t\telse\r\n\t\t\t$info['ricettaIngredient6'][$i] = \"null\";\r\n\t\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strIngredient7\"]))\r\n\t\t\t$info['ricettaIngredient7'][$i] = $output[\"meals\"][$i][\"strIngredient7\"];\r\n\t\telse\r\n\t\t\t$info['ricettaIngredient7'][$i] = \"null\";\r\n\t\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strIngredient8\"]))\r\n\t\t\t$info['ricettaIngredient8'][$i] = $output[\"meals\"][$i][\"strIngredient8\"];\r\n\t\telse\r\n\t\t\t$info['ricettaIngredient8'][$i] = \"null\";\r\n\t\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strIngredient9\"]))\r\n\t\t\t$info['ricettaIngredient9'][$i] = $output[\"meals\"][$i][\"strIngredient9\"];\r\n\t\telse\r\n\t\t\t$info['ricettaIngredient9'][$i] = \"null\";\r\n\t\t\t\r\n\t\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strMeasure1\"]))\r\n\t\t\t$info['ricettaMeasure1'][$i] = $output[\"meals\"][$i][\"strMeasure1\"];\r\n\t\telse\r\n\t\t\t$info['ricettaMeasure1'][$i] = \"null\";\r\n\t\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strMeasure2\"]))\r\n\t\t\t$info['ricettaMeasure2'][$i] = $output[\"meals\"][$i][\"strMeasure2\"];\r\n\t\telse\r\n\t\t\t$info['ricettaMeasure2'][$i] = \"null\";\r\n\t\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strMeasure3\"]))\r\n\t\t\t$info['ricettaMeasure3'][$i] = $output[\"meals\"][$i][\"strMeasure3\"];\r\n\t\telse\r\n\t\t\t$info['ricettaMeasure3'][$i] = \"null\";\r\n\t\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strMeasure4\"]))\r\n\t\t\t$info['ricettaMeasure4'][$i] = $output[\"meals\"][$i][\"strMeasure4\"];\r\n\t\telse\r\n\t\t\t$info['ricettaMeasure4'][$i] = \"null\";\r\n\t\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strMeasure5\"]))\r\n\t\t\t$info['ricettaMeasure5'][$i] = $output[\"meals\"][$i][\"strMeasure5\"];\r\n\t\telse\r\n\t\t\t$info['ricettaMeasure5'][$i] = \"null\";\r\n\t\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strMeasure6\"]))\r\n\t\t\t$info['ricettaMeasure6'][$i] = $output[\"meals\"][$i][\"strMeasure6\"];\r\n\t\telse\r\n\t\t\t$info['ricettaMeasure6'][$i] = \"null\";\r\n\t\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strMeasure7\"]))\r\n\t\t\t$info['ricettaMeasure7'][$i] = $output[\"meals\"][$i][\"strMeasure7\"];\r\n\t\telse\r\n\t\t\t$info['ricettaMeasure7'][$i] = \"null\";\r\n\t\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strMeasure8\"]))\r\n\t\t\t$info['ricettaMeasure8'][$i] = $output[\"meals\"][$i][\"strMeasure8\"];\r\n\t\telse\r\n\t\t\t$info['ricettaMeasure8'][$i] = \"null\";\r\n\t\t\t\r\n\t\tif(!empty($output[\"meals\"][$i][\"strMeasure9\"]))\r\n\t\t\t$info['ricettaMeasure9'][$i] = $output[\"meals\"][$i][\"strMeasure9\"];\r\n\t\telse\r\n\t\t\t$info['ricettaMeasure9'][$i] = \"null\";\r\n\t\t\t\r\n\t}\r\n\t\treturn($info);\t\t\r\n}", "function displayItems(){\r\n\t\t\trequire \"connect.php\";\r\n\t\t\t$query = \"Select* from items\";\r\n\t\t \t$rows = $conn->query($query);\r\n\t\t \r\n\t\t\t\r\n global $itemsArray;\r\n \r\n $index = 0;\r\n\t\t\tforeach($rows as $row){\r\n\t\t\t\t$id = $row[\"id\"];\r\n\t\t\t\t$item_Name = $row[\"itemname\"];\r\n\t\t\t\t$item_Price = $row[\"itemprice\"];\r\n\t\t\t\t$image_URL = $row[\"imageurl\"];\r\n\t\t\t\t$isNew = $row[\"isNew\"];\r\n\t\t\t\t$catagory = \"Hardcoded catagory\";\r\n\t\t\t \r\n\t\t\t $item = new Item($id,$item_Name,$item_Price,$image_URL,$item_Price);\r\n\r\n \r\n\r\n\t\t\t ?>\r\n\t\t\t<div class=\"product-grid\">\t\t\t\t\t \r\n\t\t\t\t\t<div class=\"more-product-info\">\r\n\r\n\t\t\t\t\t \t<?php\r\n\t\t \t\t\t\t\tif($isNew ==1 ){\r\n\t\t\t \t\t\t\t\techo \"<span id ='isNew'>NEW</span>\";\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</div>\t\t\t\t\t\t\r\n\t\t\t\t\t<div class=\"product-img b-link-stripe b-animate-go thickbox\">\t\t\t\t\t\t \r\n\t\t\t\t\t\t<?php echo'<img src=\"'.$image_URL.'\" class=\"img-responsive\" alt=\"\"/>' ?>\r\n\t\t\t\t\t\t<div class=\"b-wrapper\">\r\n\t\t\t\t\t\t\t<h4 class=\"b-animate b-from-left b-delay03\">\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<button class=\"btns\">ORDER NOW</button>\r\n\t\t\t\t\t\t\t</h4>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\t\t\t\t\t\r\n\t\t\t\t\t<div class=\"product-info simpleCart_shelfItem\">\r\n\t\t\t\t\t\t<div class=\"product-info-cust\">\r\n\t\t\t\t\t\t\t<h4><?php echo $item->getItemName()?></h4>\r\n\t\t\t\t\t\t\t<span class=\"item_price\"><?php echo \"R\".$item->getPrice() ?></span>\r\n\t\t\t\t\t\t\t<input type=\"text\" class=\"item_quantity\" value=\"1\" />\r\n\t\t\t\t\t\t\t<a href = \"index.php?action=addItem&itemId=<?php echo\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$item->getItemId().\"&price=\".$item->getPrice() ?>\">\r\n\t\t\t\t\t\t\t\t<input type=\"button\" class=\"item_add\" value=\"ADD\">\r\n\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t<div class=\"clearfix\"> </div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\t\r\n\r\n\r\n\r\n\r\n <?php\r\n\r\n \t\t}\r\n\r\n\r\n\r\n\t}", "protected function _encodeItems($parameters) {\n\t\t\t$response = array();\n\n\t\t\tif (!empty($parameters['items'])) {\n\t\t\t\tforeach ($parameters['items'] as $itemListName => $items) {\n\t\t\t\t\t$response['tokens'][$itemListName] = array();\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tempty($items['parameters']) ||\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t!empty($parameters['processing']) &&\n\t\t\t\t\t\t\t$parameters['processing']['chunks'] > 1\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\t$response['items'][$itemListName] = array_merge($parameters['items'][$itemListName], array(\n\t\t\t\t\t\t\t'count' => 0,\n\t\t\t\t\t\t\t'data' => array()\n\t\t\t\t\t\t));\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$itemIds = $this->fetch($items['table'], $items['parameters']);\n\n\t\t\t\t\tif (!empty($itemIds['count'])) {\n\t\t\t\t\t\t$itemIndexes = array();\n\t\t\t\t\t\t$itemIndexLineIndex = $itemStatusCount = 0;\n\t\t\t\t\t\t$selectedItemIndexes = array_intersect($itemIds['data'], $parameters['items'][$itemListName]['data']);\n\t\t\t\t\t\t$unselectedItemIndexes = array_diff($itemIds['data'], $parameters['items'][$itemListName]['data']);\n\t\t\t\t\t\tarray_walk($selectedItemIndexes, function(&$selectedItemIdValue, $selectedItemIdKey) {\n\t\t\t\t\t\t\t$selectedItemIdValue = 1;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tarray_walk($unselectedItemIndexes, function(&$unselectedItemIdValue, $unselectedItemIdKey) {\n\t\t\t\t\t\t\t$unselectedItemIdValue = 0;\n\t\t\t\t\t\t});\n\t\t\t\t\t\t$allItemIndexes = $selectedItemIndexes + $unselectedItemIndexes;\n\t\t\t\t\t\tksort($allItemIndexes);\n\n\t\t\t\t\t\tforeach ($allItemIndexes as $itemIndex => $itemStatus) {\n\t\t\t\t\t\t\tif (((10000 * ($itemIndexLineIndex + 1)) - $itemIndex) === 1) {\n\t\t\t\t\t\t\t\t$itemIndexes[$itemIndexLineIndex][] = $itemStatus . $itemStatusCount;\n\t\t\t\t\t\t\t\t$itemStatusCount = 0;\n\t\t\t\t\t\t\t\t$itemIndexLineIndex++;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$itemStatusCount++;\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!isset($allItemIndexes[$itemIndex + 1]) ||\n\t\t\t\t\t\t\t\t$allItemIndexes[$itemIndex + 1] != $itemStatus\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t$itemIndexes[$itemIndexLineIndex][] = $itemStatus . $itemStatusCount;\n\t\t\t\t\t\t\t\t$itemStatusCount = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tforeach ($itemIndexes as $itemIndexLineIndex => $itemStatusCounts) {\n\t\t\t\t\t\t\t$itemIndexes[$itemIndexLineIndex] = implode('_', $itemStatusCounts);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$response['items'][$itemListName] = array_merge($parameters['items'][$itemListName], array(\n\t\t\t\t\t\t'count' => count($selectedItemIndexes),\n\t\t\t\t\t\t'data' => $itemIndexes\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $response;\n\t\t}", "function queryListing($page_no, $items_per_page, $offset, $s_item_type, $search_vars_r) {\n\t\t// reference to site item unique ID.\n\t\tif (strlen($search_vars_r['iblist_id']) > 0) {\n\t\t\t$this->addListingRow(NULL, NULL, NULL, array('iblist_id' => $search_vars_r['iblist_id']));\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t$search_clause = \"\";\n\t\tif (strlen($search_vars_r['author']) > 0)\n\t\t\t$search_clause = \"item=\" . urlencode($search_vars_r['author']);// . \"&author=on\";\n\t\telse if (strlen($search_vars_r['title']) > 0)\n\t\t\t$search_clause = \"item=\" . urlencode($search_vars_r['title']);// . \"&title=on\";\n\t\telse if (strlen($search_vars_r['isbn']) > 0)\n\t\t\t$search_clause = \"item=\" . urlencode($search_vars_r['isbn']);// . \"&isbn=on\";\n\t\telse if (strlen($search_vars_r['series']) > 0)\n\t\t\t$search_clause = \"item=\" . urlencode($search_vars_r['series']);// . \"&series=on\";\n\t\telse if (strlen($search_vars_r['description']) > 0)\n\t\t\t$search_clause = \"item=\" . urlencode($search_vars_r['description']);// . \"&description=on\";\n\n//\t\t$pageBuffer = $this->fetchURI(\"http://www.iblist.com/search/advanced_search.php?$search_clause&next=$offset\");\n\t\t$pageBuffer = $this->fetchURI(\"http://www.iblist.com/search/search.php?$search_clause&next=$offset\");\n\n\t\t// find out how many matches we have.\n//\t\tif (preg_match(\"!<b>\\[</b>([0-9]+) <b>-</b> ([0-9]+) <b>out of</b> ([0-9]+)<b>\\]</b>!i\", $pageBuffer, $matches)) {\n\t\tif (preg_match(\"!([0-9]+) - ([0-9]+) out of ([0-9]+)!i\", $pageBuffer, $matches)) {\n\t\t\t$this->setTotalCount($matches[3]);\n\n//\t\t\tif (preg_match_all(\"!<LI><A HREF=\\\"http://www.iblist.com/book([0-9]+).htm\\\">([^<]+)</A> by <A HREF=\\\"[^\\\"]+\\\">([^<]+)</A> </LI>!i\", $pageBuffer, $matches2)) {\n\t\t\tif (preg_match_all(\"!<LI><A HREF=\\\"http://www.iblist.com/book([0-9]+).htm\\\">([^<]+)</A> by <A HREF=\\\"[^\\\"]+\\\">([^<]+)</A></LI>!i\", $pageBuffer, $matches2)) {\n\t\t\t\tfor ($i = 0; $i < count($matches2[0]); $i++) {\n//\t\t\t\t\t$this->addListingRow($matches2[2][$i] . ' by ' . trim($matches2[3][$i]), \"http://www.iblist.com/images/covers/\" . $matches2[1][$i] . \".jpg\", NULL, array('iblist_id' => $matches2[1][$i]));\n// image id is wrong, so ignore the url\n\t\t\t\t\t$this->addListingRow($matches2[2][$i] . ' by ' . trim($matches2[3][$i]), '', NULL, array('iblist_id' => $matches2[1][$i]));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public function printItemsWithContainer($containerTitle, ...$items)\n {\n print '<fieldset class=\"c-fieldset\">';\n\n if ($containerTitle != \"\") {\n $this->printContainerTitle($containerTitle);\n }\n\n $this->printItems(...$items);\n\n print '</fieldset>';\n }", "public function get_all_items_by_api()\n {\n\n $data = array('token' =>'ayaolwan');//'type' => 'fees_category');\n $data_string = json_encode($data);\n $curl = curl_init(base_url() . 'webServices/Itemapi');\n\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"GET\");\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($data_string))\n );\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);\n\n $result = json_decode(curl_exec($curl), true);\n curl_close($curl);\n\n if ($result['status'])\n {\n echo json_encode($result['itemsList']);\n }\n\n\n }", "public function getData()\n {\n // The base data.\n $data = $this->getBaseData();\n\n // Add basket contents next.\n // It seems that we MUST have at least one item in\n // the cart to be valid.\n\n $items = $this->getItems();\n\n if (empty($items) || $items->count() == 0) {\n // No items in the basket, so we will have to make\n // one up. The Frontend API MUST have at least one cart item.\n // The basket MUST add up to the total payment amount, so\n // be aware of that.\n\n $item = new ExtendItem([\n 'id' => $this->defaultItemId,\n 'price' => $this->getAmountInteger(),\n 'quantity' => 1,\n 'name' => $this->getDescription(),\n 'vat' => null,\n ]);\n\n $items = new ItemBag;\n $items->add($item);\n\n // Add this dummy cart to the gateway cart.\n $this->setItems($items);\n }\n\n // Add the cart items to the data.\n $data += $this->getDataItems();\n\n if ($this->getDisplayName()) {\n $data['display_name'] = $this->getDisplayName();\n }\n\n if ($this->getDisplayAddress()) {\n $data['display_address'] = $this->getDisplayAddress();\n }\n\n if ($this->getInvoiceId()) {\n $data['invoiceid'] = $this->getInvoiceId();\n }\n\n // The errorurl does not appear in the Frontend documentation, but does\n // work and is implemented in other platform gateways.\n\n $data += $this->getDataUrl();\n\n if ($this->getTargetWindow()) {\n $data['targetwindow'] = $this->getTargetWindow();\n }\n\n if ($this->getParam() !== null) {\n $data['param'] = $this->getParam();\n }\n\n if ($this->getDescription()) {\n $data['narrative_text'] = $this->getDescription();\n }\n\n $data += $this->getDataPersonal();\n $data += $this->getDataShipping();\n\n if ($this->getLanguage()) {\n $data['language'] = $this->getLanguage();\n }\n\n if ($this->getWalletType()) {\n $data['wallettype'] = $this->getWalletType();\n }\n\n if ($this->getAutosubmit()) {\n $data['autosubmit'] = $this->getAutosubmit();\n }\n\n if ($this->getFinancingtype()) {\n $data['financingtype'] = $this->getFinancingtype();\n }\n\n // Create the hash for hashable fields.\n $data['hash'] = $this->hashArray($data);\n\n return $data;\n }", "function item_listing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $ret = array(\n 'content' => '',\n 'status' => 'fail'\n );\n if (!empty($_POST)) {\n $id = $_POST['id'];\n $searchData = $_POST['searchData'];\n // get top list data in homepage\n switch ($id) {\n case 1:\n\n $header = array(\"优惠券编号\", \"优惠券金额\", \"所属终端便利店账号\", \"终端便利店\", \"状态\", \"赠送时间\", \"使用时间\");\n $cols = 7;\n\n $contentList = $this->coupon_model->getItems($searchData);\n $footer = (count($contentList) == 0 || !isset($contentList)) ? $footer = \"没有优惠券.\" : '';\n break; // get top1\n }\n\n // end get\n $ret['header'] = $this->output_header($header);\n $ret['content'] = $this->output_content($contentList, $id);\n $ret['footer'] = $this->output_footer($footer, $cols);\n $ret['status'] = 'success';\n }\n echo json_encode($ret);\n }\n }", "private function addMetaItemSingle( \\Aimeos\\MShop\\Common\\Item\\Iface $item, array &$expires, array &$tags, $tagAll )\n\t{\n\t\t$domain = str_replace( '/', '_', $item->getResourceType() ); // maximum compatiblity\n\n\t\tif( $tagAll === true ) {\n\t\t\t$tags[] = $domain . '-' . $item->getId();\n\t\t} else {\n\t\t\t$tags[] = $domain;\n\t\t}\n\n\t\tif( $item instanceof \\Aimeos\\MShop\\Common\\Item\\Time\\Iface && ( $date = $item->getDateEnd() ) !== null ) {\n\t\t\t$expires[] = $date;\n\t\t}\n\t}", "public function add()\n {\n $item = new stdClass();\n $item->item_id = null;\n $item->barcode = null;\n $item->price = null;\n $item->stock = null;\n $item->name = null;\n $item->category_id = null;\n $query_category = $this->categorys_m->get();\n $query_unit = $this->units_m->get();\n $unit[null] = '-Pilih-';\n foreach ($query_unit->result() as $u) {\n\n $unit[$u->unit_id] = $u->name;\n };\n $data = [\n 'page' => 'add',\n 'row' => $item,\n 'category' => $query_category,\n 'unit' => $unit,\n 'selectedunit' => null\n ];\n $this->template->load('template', 'product/item/item_add', $data);\n }", "function totalItems(){\n\tif (isset($_GET['addCart'])) {\n\t\tglobal $conn;\n\t\t$ipAddr=getIp();\n\n\t\t$getItems=\"SELECT * FROM cart WHERE ipAddr='$ipAddr'\";\n\t\t$runGetItems=mysqli_query($conn, $getItems);\n\n\t\t$countItems=mysqli_num_rows($runGetItems);\n\t}else{\n\n\t\tglobal $conn;\n\t\t$ipAddr=getIp();\n\n\t\t$getItems=\"SELECT * FROM cart WHERE ipAddr='$ipAddr'\";\n\t\t$runGetItems=mysqli_query($conn, $getItems);\n\n\t\t$countItems=mysqli_num_rows($runGetItems);\n\t}\n\n\techo $countItems;\n}", "public function addItem($item_id, $item_type) {\n $this->apiCall('items.json', 'POST', array('pio_iid' => $item_id, 'pio_itypes' => $item_type));\n }", "public function add_all_session($session_items)\n\t\t{\n\t\t\tparent::add_all_items($session_items,'session_items');\n\t\t}", "public function get_items($request)\n {\n }", "public function get_items($request)\n {\n }", "public function addDetails(&$listings)\r\n\t{\r\n\t\tif (!empty($listings)) {\r\n\t\t\tforeach ($listings as $listingId => &$listing) {\r\n\t\t\t\t$listing = $this->getListing($listingId);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function _parseAdlibSingleItem($adlib_item) {\n $sources = $this->source_config['sources'];\n $item = array();\n // get mappings\n $mappings = $this->filterMappings(feeds_importer($this->id)->processor->config['mappings']);\n // get info about fields\n $all_fields = field_info_fields();\n // $source is the string with the replacement values, e.g. '<h2>[title]</h2>'\n foreach ($this->source_config['sources'] as $source_key => $source) {\n /*\n * Analyze the source. There are two possibilities:\n * 1) There is only one token\n * 2) There are more than one tokens\n */\n //$token_regexp = '/(\\[[a-zA-Z\\._]+:+[a-zA-Z\\._\\<\\>\\/]+\\]|\\[[a-zA-Z\\._]+\\])/';\n $token_regexp = '/\\[' . $this->field_regex . ':' . $this->separator_regex . '\\]|\\[' . $this->field_regex . '\\]/';\n $token_count = preg_match_all($token_regexp, $source, $tokens);\n $token_multiple = FALSE;\n if ($token_count > 1) {\n $token_multiple = TRUE;\n }\n /*\n * Analyze the target field. There are two possibilities\n * 1) It's a single field\n * 2) It's multiple field\n */\n // get info about cck_field\n $cck_multiple = FALSE;\n // D6 version $field_info = content_fields($this->mappings[$source_key]);\n\n $field_name = $mappings[$source_key];\n unset($field_info);\n if (isset($all_fields[$field_name])) {\n $field_info = $all_fields[$field_name];\n }\n if (isset($field_info) && $field_info['cardinality'] == -1) {\n $cck_multiple = TRUE;\n }\n // e.g. $value = '[creator] | [material]'\n $value = $source;\n foreach ($adlib_item as $adlib_key => $adlib_value) {\n /*\n * After analyzing, there are two possibilities:\n * 1) There is a multivalued cck field, and only one token which might be multivalued: multi\n * 2) The rest: single.\n *\n * In the first case we generate an array which can be mapped to the multivalued cck field\n * In the second case, we explode the multivalued tokens in one string and put this in place of the token.\n */\n //$adlib_value_regex = '/(\\[' . $adlib_key . ':+[a-zA-Z\\._\\<\\>\\/]+\\]|\\[' . $adlib_key . '\\])/';\n $adlib_value_regex = '/\\[' . $adlib_key . ':' . $this->separator_regex . '\\]|\\[' . $adlib_key . '\\]/';\n if ($cck_multiple && !$token_multiple) {\n $dummy = 'dummy';\n if (preg_match($adlib_value_regex, $value) > 0) {\n if (is_array($adlib_value)) {\n $value_array = array();\n foreach ($adlib_value as $val) {\n $value_array[] = preg_replace($adlib_value_regex, $val, $value);\n }\n $value = $value_array;\n }\n else {\n $value = preg_replace($adlib_value_regex, $adlib_value, $value);\n }\n // Leave the foreach for $adlib_item\n break;\n }\n }\n // All values must be put in single field.\n else {\n // If the adlib_value is an array, get the glue string\n if (is_array($adlib_value)) {\n $adlib_value_regex = '/\\[(' . $adlib_key . '):(' . $this->separator_regex . ')\\]/';\n $count = preg_match($adlib_value_regex, $source, $parts);\n // if count > 0 we have a field with separator, otherwise we do not have a separator\n if ($count == 0) {\n $adlib_value_regex = '/\\[' . $adlib_key . '\\]/';\n }\n $glue = (isset($parts[2])) ? $parts[2] : ' ';\n $glued_string = implode($glue, $adlib_value);\n $value = preg_replace($adlib_value_regex, $glued_string, $value);\n }\n else {\n $value = preg_replace($adlib_value_regex, $adlib_value, $value);\n }\n }\n }\n if (is_array($value)) {\n foreach ($value as $key => $val) {\n // if we have any more [<tags>] remove them here\n $value[$key] = preg_replace('/\\[.*?\\]/', '', $val);\n // remove redundant spaces\n $value[$key] = trim($value[$key]);\n }\n }\n else {\n // if we have any more [<tags>] remove them here\n $value = preg_replace('/\\[.*?\\]/', '', $value);\n // remove redundant spaces\n $value = trim($value);\n // Replace token characters again\n $value = $this->replaceTokenCharacters($value, TRUE);\n }\n\n $item[$source_key] = $value;\n }\n return $item;\n }", "public function prepare_item_for_response( $item, $request ) {\n\t\t$data = $this->add_additional_fields_to_object( $item, $request );\n\t\t$data = $this->filter_response_by_context( $data, 'view' );\n\t\t$response = rest_ensure_response( $data );\n\n\t\t/**\n\t\t * Filter the list returned from the API.\n\t\t *\n\t\t * @param WP_REST_Response $response The response object.\n\t\t * @param array $item The original item.\n\t\t * @param WP_REST_Request $request Request used to generate the response.\n\t\t */\n\t\treturn apply_filters( 'woocommerce_rest_prepare_reports_import', $response, $item, $request );\n\t}", "function addItem(){\n\n\t//Database connection\n\tglobal $mysqli;\n\t\n\t//Hrefs\n\tglobal $cms_library;\n\tglobal $cms_attribute;\n\tglobal $cms_addItem;\n\n\t//Selected continent and attribute\n\t$continent_id=$_GET[\"continent_id\"];\n\t$continent_name=$_GET[\"continent_name\"];\n\t$attribute_id=$_GET[\"attribute_id\"];\n\t$attribute_name=$_GET[\"attribute_name\"];\n\t\n\t//Add item form handles\n\t$pg=$_POST[\"pg\"];\n\t$title=$_POST[\"title\"];\t\n\t$image_path=\"\".$continent_name.\"/\".$attribute_name.\"/\".$title.\"/\".basename($_FILES[\"image\"][\"name\"]).\"\";\n\t$description=$_POST[\"description\"];\n\t$ux=$_POST[\"ux\"];\n\t$submit=$_POST[\"submit\"];\n\n\t//Submit button trigger\n\tif(isset($submit)){\n\n\t\t//To create a folder and move the uploaded files into it\n\t\tmkdir(\"../\".$continent_name.\"/\".$attribute_name.\"/\".$title.\"\");\n\t\tmove_uploaded_file($_FILES[\"image\"][\"tmp_name\"], \"../\".$image_path.\"\");\n\t\t$description_path=\"\".$continent_name.\"/\".$attribute_name.\"/\".$title.\"/description.txt\";\n\t\tfile_put_contents(\"../\".$description_path.\"\", $description);\n\n\t\t//Corresponding database entry\n\t\t$sql_addItem=\"INSERT INTO items(continent_id, continent_name, \";\n\t\t$sql_addItem.=\"attribute_id, attribute_name, title, image_path, description_path, ux, pg) \";\n\t\t$sql_addItem.=\"VALUES(\".d($mysqli, $continent_id).\", '\".d($mysqli, $continent_name).\"', \";\n\t\t$sql_addItem.=\"\".d($mysqli, $attribute_id).\", '\".d($mysqli, $attribute_name).\"', '\".d($mysqli, $title).\"', \";\n\t\t$sql_addItem.=\"'\".d($mysqli, $image_path).\"', '\".d($mysqli, $description_path).\"', '\".$ux.\"', '\".d($mysqli, $pg).\"');\";\n\t\t$res_addItem=mysqli_query($mysqli, $sql_addItem);\n\n\t\t\n\n\t}\n\n\tif($res_addItem){\n\t\tpage_redirect(\"\".$cms_attribute.\"?continent_id=\".$continent_id.\"&continent_name=\".$continent_name.\"&attribute_id=\".$attribute_id.\"&attribute_name=\".$attribute_name.\"\");\n\t}else{\n\t\tpage_redirect($cms_addItem);\n\t}\n\n\t$res_addItem->close(); \n\t$mysqli->close();\n\t\n}", "public function build_carousel($simpleResponseText, $items) {\n\t $this->build_simpleResponse($simpleResponseText, $simpleResponseText);\n\t $carousel = array(\n\t \t\t'carouselSelect' => array(\n\t\t\t 'items' => $items\n\t\t )\n\t );\n\t $this->items[] = $carousel;\n }", "public function addPricesToCollection($response)\n {\n if (isset($response['Book'])) {\n foreach ($response['Book'] as $offer) {\n $offer = (object) $offer;\n $price = $this->createNewPrice();\n if (isset($offer->listingPrice)) {\n if (isset($offer->listingCondition) && strtolower($offer->listingCondition) == 'new book') {\n $price->condition = parent::CONDITION_NEW;\n } elseif (isset($offer->itemCondition)) {\n $price->condition = $this->getConditionFromString($offer->itemCondition);\n }\n if (empty($price->condition)) {\n $price->condition = parent::CONDITION_GOOD;\n }\n $price->isbn13 = $offer->isbn13;\n $price->price = $offer->listingPrice;\n $price->shipping_price = $offer->firstBookShipCost;\n $price->url = 'http://affiliates.abebooks.com/c/74871/77797/2029?u='.urlencode($offer->listingUrl);\n $price->retailer = self::RETAILER;\n $price->term = parent::TERM_PERPETUAL;\n }\n $this->addPriceToCollection($price);\n }\n }\n return $this;\n }", "function theme_thumbwhere_contentcollectionitem_add_list($variables) {\n\n\n //$content = $variables['content'];\n $output = '';\n /*\n if ($content) {\n $output = '<dl class=\"thumbwhere_contentcollectionitem-type-list\">';\n foreach ($content as $item) {\n $output .= '<dt>' . l($item['title'], $item['href']) . '</dt>';\n $output .= '<dd>' . filter_xss_admin($item['description']) . '</dd>';\n }\n $output .= '</dl>';\n }\n else {\n if (user_access('administer thumbwhere_contentcollectionitem types')) {\n $output = '<p>' . t('ThumbWhereContentCollectionItem Entities cannot be added because you have not created any thumbwhere_contentcollectionitem types yet. Go to the <a href=\"@create-thumbwhere_contentcollectionitem-type\">thumbwhere_contentcollectionitem type creation page</a> to add a new thumbwhere_contentcollectionitem type.', array('@create-thumbwhere_contentcollectionitem-type' => url('admin/structure/thumbwhere_contentcollectionitem_types/add'))) . '</p>';\n }\n else {\n $output = '<p>' . t('No thumbwhere_contentcollectionitem types have been created yet for you to use.') . '</p>';\n }\n }\n */\n return $output;\n}" ]
[ "0.60423565", "0.5940875", "0.5757014", "0.5498631", "0.54922956", "0.51727355", "0.50700945", "0.49999502", "0.49951154", "0.49199077", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.4874755", "0.47943327", "0.4787226", "0.47742832", "0.4760435", "0.47464237", "0.4717765", "0.47013807", "0.4693607", "0.46925053", "0.46738258", "0.46319547", "0.46038762", "0.4600008", "0.45885432", "0.4558057", "0.45557213", "0.45528516", "0.45461386", "0.4532602", "0.4528484", "0.45179972", "0.45174447", "0.45173874", "0.44530693", "0.44345254", "0.44337836", "0.4414331", "0.44007158", "0.44006783", "0.43889016", "0.43804932", "0.43577307", "0.43502238", "0.43474856", "0.43465284", "0.434244", "0.43395022", "0.43339399", "0.43337983", "0.43232232", "0.4320393", "0.43199947", "0.4307066", "0.43048435", "0.42979982", "0.42961198", "0.4283114", "0.42791617", "0.42778566", "0.4270963", "0.42689762", "0.42686898", "0.42667735", "0.42557082", "0.4245596", "0.4244458", "0.42376307", "0.4234148", "0.4232792", "0.42312145", "0.42310506", "0.42310506", "0.42274764", "0.42252073", "0.4223091", "0.42215756", "0.42177582", "0.42125708", "0.42069277" ]
0.46338952
41
unset addItemResponseContainer One AddItemResponseContainer container is returned for each listing that was created with the AddItems call. Each container includes the ItemID of each newly created listings, the eBay category each item is listed under, the sellerdefined SKUs of the items (if any), the listing recommendations for each item (if applicable), the start and end time of each listing, and the estimated fees that each listing will incur.
public function unsetAddItemResponseContainer($index) { unset($this->addItemResponseContainer[$index]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAddItemResponseContainer(array $addItemResponseContainer)\n {\n $this->addItemResponseContainer = $addItemResponseContainer;\n return $this;\n }", "public function addToAddItemResponseContainer(\\Nogrod\\eBaySDK\\Trading\\AddItemResponseContainerType $addItemResponseContainer)\n {\n $this->addItemResponseContainer[] = $addItemResponseContainer;\n return $this;\n }", "public function getAddItemResponseContainer()\n {\n return $this->addItemResponseContainer;\n }", "protected function addItems()\n {\n $origin = 'stock';\n $code = 'cataloginventory';\n $message = Data::ERROR_QTY;\n $additionalData = null;\n $mockItems = [];\n\n for ($i = 0; $i < 2; $i++) {\n $mockItems[] = [\n 'origin' => $origin . $i,\n 'code' => $code,\n 'message' => $message . $i,\n 'additionalData' => $additionalData,\n ];\n $this->listStatus->addItem($origin . $i, $code, $message . $i, $additionalData);\n }\n return $mockItems;\n }", "public function prepare_item_for_response($item, $request)\n {\n return array();\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response( $item, $request ) {\n return array();\n }", "public function add_item()\n {\n $request = new Types\\AddItemRequestType();\n\n // An user token is required when using the Trading service.\n $request->RequesterCredentials = new Types\\CustomSecurityHeaderType();\n $request->RequesterCredentials->eBayAuthToken = $this->config->item('authToken');\n\n\n // Begin creating the auction item.\n $item = new Types\\ItemType();\n\n $item->DispatchTimeMax = 3;\n /**\n * We want a single quantity auction.\n * Otherwise known as a Chinese auction.\n */\n $item->ListingType = Enums\\ListingTypeCodeType::C_CHINESE;\n $item->Quantity = 1;\n\n $item->ProductListingDetails = new Types\\ProductListingDetailsType();\n $item->ProductListingDetails->ISBN = $ISBN;\n $item->ProductListingDetails->UPC = $UPC;\n $item->ProductListingDetails->EAN = $EAN;\n\n $item->ProductListingDetails->BrandMPN = new DTS\\eBaySDK\\Trading\\Types\\BrandMPNType();\n $item->ProductListingDetails->BrandMPN->Brand = '';\n $item->ProductListingDetails->BrandMPN->MPN = '';\n\n $item->ListingDuration = Enums\\ListingDurationCodeType::C_DAYS_7;\n\n }", "public function additem()\r\n {\r\n $shipping = array( 'ShippingServiceOptions' => array(\r\n\r\n 'ShippingService' => 'UPSGround',\r\n 'ShippingServiceCost' => 0.0,\r\n 'ShippingServiceAdditionalCost' => 0.0,\r\n 'ShippingServicePriority' => 1,\r\n 'ExpeditedService' => false,\r\n\r\n\r\n ),\r\n 'ShippingType' => 'Flat',\r\n );\r\n\r\n $returnPolicy = array(\r\n 'ReturnsAcceptedOption' => 'ReturnsAccepted',\r\n 'RefundOption' => 'MoneyBack',\r\n 'ReturnsWithinOption' => 'Days_30',\r\n 'Description ' =>'If you are not satisfied, return the item for refund.',\r\n 'ShippingCostPaidByOption' => 'Buyer',\r\n );\r\n\r\n $item = array(\r\n 'PrimaryCategory' => array('CategoryID' => 111422), // ok\r\n 'Title' => 'Miechu nowy',\r\n 'Description' => 'Testowy opis',\r\n 'StartPrice' => 100, //\r\n 'BuyItNowPrice' => 500,//\r\n 'ReservePrice' => 400,//\r\n 'Country' => 'US',//\r\n 'Currency' => 'USD',//\r\n 'ListingDuration' => 'Days_7',//\r\n 'PictureDetails' => 'dummy',//\r\n 'Site' => 'US',//\r\n 'Location' => 'San Jose',//\r\n 'PaymentMethods' => 'PayPal',//\r\n 'PayPalEmailAddress' => '[email protected]',//\r\n 'ShippingDetails' => $shipping,//\r\n 'DispatchTimeMax' => 3,//\r\n 'ConditionID' => 1000,//\r\n 'ReturnPolicy' => $returnPolicy,//\r\n\r\n );\r\n\r\n $params = array(\r\n 'Version' => 831,\r\n 'Item' => $item\r\n\r\n\r\n\r\n\r\n\r\n );\r\n $method = 'addItem';\r\n\r\n try{\r\n\r\n $resp = debay::sendRequest($method,$params);\r\n\r\n $this->load->model('ebay/debay');\r\n\r\n\r\n }\r\n catch(Exception $e)\r\n {\r\n echo $e->getMessage();\r\n }\r\n }", "public static function items() {\r\n $doc = new DOMDocument ('1.0', 'UTF-8');\r\n $items_node = $doc->createElement(\"items\");\r\n $doc->appendChild($items_node);\r\n\r\n return new amvonetroom_XmlResponse($items_node);\r\n }", "public function prepare_response_for_collection($response)\n {\n }", "public function prepare_item_for_response( $item, $request ) {\n\t\t$data = $this->add_additional_fields_to_object( $item, $request );\n\t\t$data = $this->filter_response_by_context( $data, 'view' );\n\t\t$response = rest_ensure_response( $data );\n\n\t\t/**\n\t\t * Filter the list returned from the API.\n\t\t *\n\t\t * @param WP_REST_Response $response The response object.\n\t\t * @param array $item The original item.\n\t\t * @param WP_REST_Request $request Request used to generate the response.\n\t\t */\n\t\treturn apply_filters( 'woocommerce_rest_prepare_reports_import', $response, $item, $request );\n\t}", "function RenderItem( &$item, &$renderer, $isLast ) {\n\t\t$itemInfo['identifier'] = $item->getAttribute('identifier');\n\t\t\n\t\t$itemInfo['isLast'] = $isLast;\n\t\t\n\t\tif( $item->hasAttribute('identifierref') )\n\t\t\t$itemInfo['identifierref'] = $item->getAttribute('identifierref');\n\t\telse\n\t\t $itemInfo['identifierref'] = FALSE;\n\n\t\tif( $item->hasAttribute('isvisible') )\n\t\t $itemInfo['isvisible'] = ($item->getAttribute('isvisible')=='true')?TRUE:FALSE;\n\t\telse\n\t\t $itemInfo['isvisible'] = TRUE;\n\n\t\tif( $item->hasAttribute('parameters') )\n\t\t $itemInfo['parameters'] = $item->getAttribute('parameters');\n\t\telse\n\t\t $itemInfo['parameters'] = FALSE;\n\t\t\n\t\t$itemInfo['title'] = $this->getFirstElementValue($item, 'title');\n\t\t\n\t\t$itemInfo['adlcp_prerequisites'] = $this->getFirstElementValue($item, 'prerequisites', 'adlcp' );\n\t\t$itemInfo['adlcp_maxtimeallowed'] = $this->getFirstElementValue($item, 'maxtimeallowed', 'adlcp');\n\t\t$itemInfo['adlcp_timelimitaction'] = $this->getFirstElementValue($item, 'timelimitaction', 'adlcp');\n\t\t$itemInfo['adlcp_datafromlms'] = $this->getFirstElementValue($item, 'datafromlms', 'adlcp');\n\t\t$itemInfo['adlcp_masteryscore'] = $this->getFirstElementValue($item, 'masteryscore', 'adlcp');\n\t\t//$itemInfo['adlcp_completionthreshold'] = $this->getFirstElementValue($item, 'completionthreshold', 'adlcp');\n\t\t$threshold_elem = $this->getNodeElement($item, 'completionthreshold', 'adlcp');\n\t\tif( $threshold_elem && $threshold_elem->hasAttribute('minProgressMeasure') )\n\t\t $itemInfo['adlcp_completionthreshold'] = $threshold_elem->getAttribute('minProgressMeasure');\n\t\telse\n\t\t $itemInfo['adlcp_completionthreshold'] = '';\n\t\t\n $elem = $this->getFirstElementNode( $item, 'item');\n if( $elem )\n\t\t\t$itemInfo['isLeaf'] = FALSE;\n\t\telse\n\t\t $itemInfo['isLeaf'] = TRUE;\n\t\t \n\t\tif( $renderer == null ) {\n\t\t\tprint_r( $itemInfo );\n\t\t\t\n\t\t}\n\t\t$renderer->RenderStartItem(\t$this, $itemInfo );\n\t\t\n\t\twhile( $elem ) {\n\t\t\t$nextElem = $this->getNextElementNode( $elem );\n\t\t\t\n\t\t\t/* pass the info about the last element */\n\t\t\tif( $nextElem === NULL )\n\t\t\t $this->RenderItem( $elem, $renderer, true );\n\t\t\telse\n\t\t\t $this->RenderItem( $elem, $renderer, false );\n\t\t\t \n\t\t\t$elem = $nextElem;\n\t\t}\n\n $renderer->RenderStopItem( $this, $itemInfo );\n\n\t}", "public function Add()\n {\n if (isset($this->properties['ItemId']) && !is_null($this->properties['ItemId'])) {\n \tthrow new Services_Ebay_Exception('This item already has an ItemId and thus cannot be added.');\n }\n $call = Services_Ebay::loadAPICall('AddItem', array($this));\n \n return $call->call($this->session);\n }", "public function get_listings_details($dom){\t\n\t\t\t//push each entry into new array\n\t\t\t$update_item_array = array();\n\t\t\t$update_item_array['itemnumber'] = array();\n\t\t\t$update_item_array['customlabel'] = array();\n\t\t\t$update_item_array['quantity'] = array();\n\t\t\t$update_item_array['quantitysoldandavailable'] = array();\n\t\t\t$update_item_array['sellprice'] = array();\n\t\t\t$update_item_array['starttime'] = array();\n\t\t\t$update_item_array['endtime'] = array();\n\t\t\t$update_item_array['itemtitle'] = array();\n\t\t\t$update_item_array['stockcntrl'] = array();\n\t\t\t$update_item_array['listingtype'] = array();\n\n\n\t\t\t$update_item_response = $dom->getElementsByTagName(DOM_ELEMENT_LISTINGSSHOW_RESPONSE);\n\n\n\n\t\t\tforeach ($update_item_response as $item){\n\t \t\t\t\n\n\t\t\t\t$activelist = $item->getElementsByTagName(DOM_ELEMENT_LISTINGS_ACTIVELIST);\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tforeach ($activelist as $activelistshow){\n\t\t\t\t\t\n\t\t\t\t\t$itemarrays = $activelistshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMARRAY);\n\n\n\t\t\t\t\tforeach($itemarrays as $itemarray){\n\n\t\t\t\t\t\t$inditems = $itemarray->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMSS);\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\tforeach($inditems as $inditemshow){\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_LISTINGTYPE)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_LISTINGTYPE)->item(0)->nodeValue) : \"Listing Type - Error\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['listingtype'], $costers);\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMID)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMID)->item(0)->nodeValue) : \"Item Num - Error\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['itemnumber'], $costers);\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_SKU)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_SKU)->item(0)->nodeValue) : \"SKU - Error\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['customlabel'], $costers);\n\t\t\t\t\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_QUANTITY)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_QUANTITY)->item(0)->nodeValue) : \"0\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['quantity'], $costers);\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_TOTALQUANTITY)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_TOTALQUANTITY)->item(0)->nodeValue) : \"0\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['quantitysoldandavailable'], $costers);\n\n\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_CURRENTPRICE)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_CURRENTPRICE)->item(0)->nodeValue) : \"price sold - Error\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['sellprice'], $costers);\t\n\n\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STARTTIME)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STARTTIME)->item(0)->nodeValue) : \"0\";\n\n\n\t\t\t\t\t\t\tarray_push($update_item_array['starttime'], $costers);\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ENDTIME)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ENDTIME)->item(0)->nodeValue) : \"\";\n\n\n\t\t\t\t\t\t\tarray_push($update_item_array['endtime'], $costers);\n\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMTITLE)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMTITLE)->item(0)->nodeValue) : \"\";\n\n\n\t\t\t\t\t\t\tarray_push($update_item_array['itemtitle'], $costers);\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STOCKCNTRL)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STOCKCNTRL)->item(0)->nodeValue) : \"FALSE\";\n\n\n\t\t\t\t\t\t\tarray_push($update_item_array['stockcntrl'], $costers);\t\t\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\n\t\t\t\t}\t\t\n\n\n\t\t\t\t//errors\n\t\t\t\t$error_messages = $item->getElementsByTagName(DOM_ELEMENT_ERRORS);\n\n\t\t\t\tforeach ($error_messages as $errormsg){\n\t\t\t\t\t$error = trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) != \"\" ? trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) : \"No Error\";\n\t\t\t\t\tarray_push($update_item_array, $error);\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t}\n\n\t\t\treturn $update_item_array;\n\n\t\t//DOM_ELEMENT_SHORT_ERROR_MSG\n\t\t}", "public static function endEbayListing($items)\n\t{\n\t\t$results = array();\n\t\ttry {\n\t\t\t$endListingResultXML = ISC_ADMIN_EBAY_OPERATIONS::endItems($items);\n\t\t\tforeach ($endListingResultXML->EndItemResponseContainer as $item) {\n\t\t\t\t$results[] = new ISC_ADMIN_EBAY_END_ITEM_RESULT($item);\n\t\t\t}\n\t\t\treturn $results;\n\t\t} catch (ISC_EBAY_API_REQUEST_EXCEPTION $e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public static function add($response)\n\t{\n\t\tforeach ($response as $key => $value) {\n\t\t\tself::$response[$key] = $value;\n\t\t}\n\t}", "function appendItemMetadataList(&$item) {\n $mda = array();\n\n // Static metadata\n $mda = $this->getHardCodedMetadataList(true);\n foreach($mda as $md) {\n $md->setValue($item->getHardCodedMetadataValue($md->getLabel()));\n $item->addMetadata($md);\n unset($md);\n }\n \n // Dynamic metadata\n $mdIter = $this->getRealMetadataIterator(true);\n $mdIter->rewind();\n while($mdIter->valid()) {\n $md = $mdIter->current();\n $this->addMetadataValueToItem($item, $md);\n $mdIter->next();\n }\n }", "function addItem(){\r\n\t global $itemsArray;\r\n\r\n //when the user clicks add, I pass id to the URL bar as a query string, again I'm checking if it exist or not (if the user has \r\n\t //clicked the add button or not)\r\n\r\n\t//if it exists on the URL bar I begin the magic of adding items to the Cart\r\n\r\n\tif ( isset( $_GET[\"itemId\"] ) ) {\r\n\t\t\r\n\t\t//This is the session that stores the total Price of the items in the cart\r\n\t\t//here I'm initializing it to zero....only if it doesn't exists at this point in time\r\n\t\t//if I don't put the ! sign the session will always be zero coz it's gonna be re-initized to zero everytime the\r\n //page is refreshed (everytime the add button is clicked)\r\n\t\tif(!isset($_SESSION[\"total\"])){\r\n\t\t\t$_SESSION[\"total\"] = 0;\r\n\t\t}\r\n //does the same as the above code but for the number of items in the cart\r\n\t\tif(!isset($_SESSION[\"nuOfItems\"])){\r\n\t\t\t$_SESSION[\"nuOfItems\"] = 0;\r\n\t\t}\r\n\r\n\t\t//==================================================================================================\r\n\t\t\t\t//ADDING ITEM TO THE CART\r\n\t\t//==================================================================================================\r\n\t\t\t\r\n \r\n //The code below ads items to the cart.....I grab the itemID from the URL bar and assign to a varible named itemId\r\n\t\t$itemId = (int) $_GET[\"itemId\"];\r\n\t\t//I grab the price from the URL bar also\r\n\t\t$price = $_GET[\"price\"];\r\n\r\n\t\t\t\r\n\t\tif (!isset( $_SESSION[\"cart\"][$itemId] ) ) {\r\n\r\n \r\n //kinda hard to explain....when this scripts loads I store objects of all items in the datbase to the $itemsArray, \r\n\t\t\t //each object in the array is indexed by it's id...Ok...\r\n\t\t\t //ie object1 will be at index 3 if it's Id is 3 .... ($itemsArray[3] = object1;)\r\n //now the statement below says take whatever object that is stored at index $itemId , in the itemsArray object and store\r\n\t\t\t // to the cart\r\n\r\n\t\t\t//reference: Beginning PHP 5.3 by Matt Doyle (Downloadable from google) ,Page 284. - Create a Simple Shopping Cart\r\n\r\n\t\t\t$_SESSION[\"cart\"][$itemId] = $itemsArray[$itemId];\r\n\r\n\r\n\t\t\t$_SESSION[\"nuOfItems\"] = $_SESSION[\"nuOfItems\"]+1; //increments the number of items in the cart \r\n\t\t\t$_SESSION[\"total\"] = $_SESSION[\"total\"]+$price; //increments current total by the that is recived from the URL\r\n\r\n\r\n\t\t}\r\n\t\t\r\n \r\n\t\t\t\r\n\t\t\r\n\t}\r\n\tsession_write_close();\r\n\t//header( \"Location: index.php\" ); //redirects the user to the home page\r\n\r\n}", "public function add_item($zajlib_feed_item){\n\t\t$this->items[] = $zajlib_feed_item; \n\t}", "protected function _decodeItems($parameters, $retrieveItems = false) {\n\t\t\t$response = array();\n\n\t\t\tif (!empty($parameters['items'])) {\n\t\t\t\tforeach ($parameters['items'] as $itemListName => $items) {\n\t\t\t\t\t$response[$itemListName] = array(\n\t\t\t\t\t\t'count' => count($items['data']),\n\t\t\t\t\t\t'data' => $items['data'],\n\t\t\t\t\t\t'name' => $itemListName,\n\t\t\t\t\t\t'table' => $items['table']\n\t\t\t\t\t);\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t!empty($items['data']) &&\n\t\t\t\t\t\t!empty($this->encode[$items['table']])\n\t\t\t\t\t) {\n\t\t\t\t\t\t$itemIndexes = array();\n\t\t\t\t\t\t$itemIndexLines = $items['data'];\n\t\t\t\t\t\t$itemIndex = $itemCount = 0;\n\n\t\t\t\t\t\tforeach ($itemIndexLines as $offsetIndex => $itemIndexLine) {\n\t\t\t\t\t\t\t$itemIndexLineChunks = explode('_', $itemIndexLine);\n\n\t\t\t\t\t\t\tforeach ($itemIndexLineChunks as $itemIndexLineChunk) {\n\t\t\t\t\t\t\t\t$itemStatus = substr($itemIndexLineChunk, 0, 1);\n\t\t\t\t\t\t\t\t$itemStatusCount = substr($itemIndexLineChunk, 1);\n\n\t\t\t\t\t\t\t\tif ($itemStatus) {\n\t\t\t\t\t\t\t\t\tif ($retrieveItems) {\n\t\t\t\t\t\t\t\t\t\tfor ($i = 0; $i < $itemStatusCount; $i++) {\n\t\t\t\t\t\t\t\t\t\t\t$itemIndexes[$itemIndex + $i] = 1;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$itemCount += $itemStatusCount;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$itemIndex += $itemStatusCount;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$response[$itemListName]['count'] = $itemCount;\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tempty($itemIndexes) ||\n\t\t\t\t\t\t\t!$itemCount\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($retrieveItems) {\n\t\t\t\t\t\t\t$dataTable = !empty($this->encode[$items['table']]['data_table']) ? $this->encode[$items['table']]['data_table'] : $items['table'];\n\t\t\t\t\t\t\t$itemParameters = array_merge($parameters, array(\n\t\t\t\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t\t\t\t'id'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'limit' => $itemIndex,\n\t\t\t\t\t\t\t\t'offset' => 0\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t\tif (!empty($this->encode[$items['table']]['sort'])) {\n\t\t\t\t\t\t\t\t$itemParameters['sort'] = $this->encode[$items['table']]['sort'];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$conditions = array(\n\t\t\t\t\t\t\t\t'id' => array()\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$itemIds = $this->fetch($dataTable, $itemParameters);\n\t\t\t\t\t\t\t$response[$itemListName] = array_merge($response[$itemListName], array(\n\t\t\t\t\t\t\t\t'parameters' => $itemParameters,\n\t\t\t\t\t\t\t\t'table' => $dataTable\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t\tif (!empty($itemIds['data'])) {\n\t\t\t\t\t\t\t\t$conditions['id'] = array_values(array_intersect_key($itemIds['data'], $itemIndexes));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!empty($parameters['data']['instant_replacement']) &&\n\t\t\t\t\t\t\t\t$parameters['action'] == 'replace'\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t$conditions[]['NOT']['AND'] = array(\n\t\t\t\t\t\t\t\t\t'status' => 'replaced'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$conditions[]['OR'] = array(\n\t\t\t\t\t\t\t\t\t'next_replacement_available' => null,\n\t\t\t\t\t\t\t\t\t'next_replacement_available <' => date('Y-m-d H:i:s', time())\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$response[$itemListName] = array_merge($response[$itemListName], $this->fetch($dataTable, array(\n\t\t\t\t\t\t\t\t'conditions' => $conditions,\n\t\t\t\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t\t\t\t'id'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $response;\n\t\t}", "public function addDealsToCart( $itemMap ) {\r\n\t\t\t$params = array('session_cookie'=>$itemMap['cart_session'],'dealid'=>$itemMap['dealid']);\r\n\t\t\t$this->db->select('COUNT(*) as count')->from(TABLES::$ORDER_DEALS_CART)->where($params);\r\n\t\t\t$query = $this->db->get();\r\n\t\t\t$result = $query->result_array();\r\n\t\t\tif($result[0]['count'] <=0 ) {\r\n\t\t\t\t$params = array('session_cookie'=>$itemMap['cart_session'],'restid'=>$itemMap['restid'],'dealid'=>$itemMap['dealid']);\r\n\t\t\t\t/* New item */\r\n\t\t\t\t$this->db->insert(TABLES::$ORDER_DEALS_CART,$params);\r\n\t\t\t\t$map['message'] = 'Deal Applied To Cart';\r\n\t\t\t\t$map['status'] = 0;\r\n\t\t\t}else {\r\n// \t\t\t\t$this->updateDealsInCart( $itemMap );\r\n\t\t\t\t$map['message'] = 'Deal Applied To Cart';\r\n\t\t\t\t$map['status'] = 1;\r\n\t\t\t}\r\n\t\t\treturn $map;\r\n\t\t}", "public function rebuildItems() {\n\t\t##\n\t\t##\tRETURNS\n\t\t##\t\tThe last modified timestamp\n\t\t$lastModified = time();\n\t\t$addedIDs = array();\n\t\t$totalPages = $this->getTotalPages();\n\t\tif($totalPages) {\n\t\t\tfor($i=1;$i<=$totalPages;$i++) {\n\t\t\t\t$items = $this->getItems($i);\n\t\t\t\tif($items && count($items)) {\n\t\t\t\t\tforeach($items as $item) {\n\t\t\t\t\t\t$campaign_id = '';\n\t\t\t\t\t\tif(isset($item->offer_url)) {\n\t\t\t\t\t\t\t$parts = parse_url($item->offer_url);\n\t\t\t\t\t\t\t$query = array();\n\t\t\t\t\t\t\tparse_str($parts['query'],$query);\n\t\t\t\t\t\t\t$campaign_id = $query['cId'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t'id' => $item->id,\n\t\t\t\t\t\t\t'campaign_id' => $campaign_id,\n\t\t\t\t\t\t\t'artist_id' => $item->artist_id,\n\t\t\t\t\t\t\t'reporting_name' => $item->reporting_name,\n\t\t\t\t\t\t\t'embed_code' => $item->embed_code,\n\t\t\t\t\t\t\t'width' => $item->width,\n\t\t\t\t\t\t\t'height' => $item->height,\n\t\t\t\t\t\t\t'url' => $item->url,\n\t\t\t\t\t\t\t'poster_image' => $item->poster_image,\n\t\t\t\t\t\t\t'poster_image_source' => (isset($item->poster_image_source)) ? $item->poster_image_source : '',\n\t\t\t\t\t\t\t'product_type' => $item->product_type,\n\t\t\t\t\t\t\t'offer_type' => $item->offer_type,\n\t\t\t\t\t\t\t'description' => $item->description,\n\t\t\t\t\t\t\t'currency' => $item->currency,\n\t\t\t\t\t\t\t'price' => $item->price,\n\t\t\t\t\t\t\t'name' => $item->name,\n\t\t\t\t\t\t\t'campaign' => serialize($item->campaign),\n\t\t\t\t\t\t\t'offer_url' => (isset($item->offer_url)) ? $item->offer_url : '',\n\t\t\t\t\t\t\t'mobile_url' => (isset($item->mobile_url)) ? $item->mobile_url : '',\n\t\t\t\t\t\t\t'last_modified' => date('Y-m-d H:i:s',$lastModified)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$format = array('%d','%d','%d','%s','%s','%d','%d','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s');\n\t\n\t\t\t\t\t\t## Get Keys\n\t\t\t\t\t\t$tableFields = implode(',',array_keys($data));\n\t\t\t\t\t\t$tableFormat = implode(',',$format);\n\t\t\t\t\t\t$onDuplicateKeyUpdate = '';\n\t\t\t\t\t\t$keyIndex = 0;\n\t\t\t\t\t\tforeach($data as $key=>$field) {\n\t\t\t\t\t\t\tif($keyIndex>0) { $onDuplicateKeyUpdate .= ', '; }\n\t\t\t\t\t\t\t$onDuplicateKeyUpdate .= $key.'=VALUES('.$key.')';\n\t\t\t\t\t\t\t$keyIndex++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t## Add item\n\t\t\t\t\t\t$sql = <<<EOD\n\t\t\t\t\t\tINSERT INTO {$this->wpdb->prefix}topspin_items ({$tableFields}) VALUES ({$tableFormat})\n\t\t\t\t\t\tON DUPLICATE KEY UPDATE {$onDuplicateKeyUpdate}\nEOD;\n\t\t\t\t\t\t$this->wpdb->query($this->wpdb->prepare($sql,$data));\n\t\n\t\t\t\t\t\t##\tDeletes old item tags\n\t\t\t\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items_tags WHERE item_id = %d';\n\t\t\t\t\t\t$this->wpdb->query($this->wpdb->prepare($sql,array($item->id)));\n\t\t\t\t\t\t##\tAdds new item tag\n\t\t\t\t\t\tif(isset($item->tags) && is_array($item->tags)) {\n\t\t\t\t\t\t\t$tagFormat = array('%d','%s');\n\t\t\t\t\t\t\tforeach($item->tags as $tag) {\n\t\t\t\t\t\t\t\t$tagData = array(\n\t\t\t\t\t\t\t\t\t'item_id' => $item->id,\n\t\t\t\t\t\t\t\t\t'tag_name' => $tag\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$this->wpdb->insert($this->wpdb->prefix.'topspin_items_tags',$tagData,$tagFormat);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // end if tags exist\n\t\n\t\t\t\t\t\t##\tDeletes old item images\n\t\t\t\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items_images WHERE item_id = %d';\n\t\t\t\t\t\t$this->wpdb->query($this->wpdb->prepare($sql,array($item->id)));\n\t\t\t\t\t\t##\tAdds new item images\n\t\t\t\t\t\tif(isset($item->campaign->product->images) && is_array($item->campaign->product->images)) {\n\t\t\t\t\t\t\t$imageFormat = array('%d','%s','%s','%s','%s');\n\t\t\t\t\t\t\tforeach($item->campaign->product->images as $key=>$image) {\n\t\t\t\t\t\t\t\t$imageData = array(\n\t\t\t\t\t\t\t\t\t'item_id' => $item->id,\n\t\t\t\t\t\t\t\t\t'source_url' => $item->campaign->product->images[$key]->source_url,\n\t\t\t\t\t\t\t\t\t'small_url' => $item->campaign->product->images[$key]->small_url,\n\t\t\t\t\t\t\t\t\t'medium_url' => $item->campaign->product->images[$key]->medium_url,\n\t\t\t\t\t\t\t\t\t'large_url' => $item->campaign->product->images[$key]->large_url\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$this->wpdb->insert($this->wpdb->prefix.'topspin_items_images',$imageData,$imageFormat);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} //end if images exist\n\t\n\t\t\t\t\t\tarray_push($addedIDs,$item->id);\n\t\t\t\t\t} //end for each item\n\t\t\t\t} //end if items\n\t\t\t} //end for each page\n\n\t\t\t##\tRemoves all items that is not modified/inserted\n\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items WHERE last_modified < %s';\n\t\t\t$this->wpdb->query($this->wpdb->prepare($sql,array(date('Y-m-d H:i:s',$lastModified))));\n\n\t\t\t##\tRemoves all item tags that is not modified/inserted\n\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items_tags WHERE item_id NOT IN (SELECT id FROM '.$this->wpdb->prefix.'topspin_items)';\n\t\t\t$this->wpdb->query($this->wpdb->prepare($sql));\n\n\t\t\t##\tRemoves all item images that is not modified/inserted\n\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items_images WHERE item_id NOT IN (SELECT id FROM '.$this->wpdb->prefix.'topspin_items)';\n\t\t\t$this->wpdb->query($this->wpdb->prepare($sql));\n\t\t\treturn $lastModified;\n\t\t}\n\t}", "protected function responseToItems($response)\n {\n $array = array();\n foreach($response->product as $current) {\n\n if( !isset($current->name) || \n !isset($current->regularPrice) || \n !isset($current->url) || \n !isset($current->productId) ) \n {\n //If any of the required info is not present skip this item.\n continue;\n }\n\n $item = new Item();\n $item->setName((string)$current->name);\n $item->setPrice(intval((string)$current->regularPrice), Item::CURRENCY_UNIT_DOLLAR);\n $item->setLink((string)$current->url);\n $item->setvendorId((string)$current->productId);\n \n if(isset($current->thumbnailImage))\n {\n $item->setSmallImage((string)$current->thumbnailImage);\n }\n \n if(isset($current->image))\n {\n $item->setMediumImage((string)$current->image);\n }\n \n $array[] = $item;\n }\n\n return $array;\n\n }", "public function prepare_item_for_response($post, $request)\n {\n }", "public function addPricesToCollection($response)\n {\n if (isset($response['Book'])) {\n foreach ($response['Book'] as $offer) {\n $offer = (object) $offer;\n $price = $this->createNewPrice();\n if (isset($offer->listingPrice)) {\n if (isset($offer->listingCondition) && strtolower($offer->listingCondition) == 'new book') {\n $price->condition = parent::CONDITION_NEW;\n } elseif (isset($offer->itemCondition)) {\n $price->condition = $this->getConditionFromString($offer->itemCondition);\n }\n if (empty($price->condition)) {\n $price->condition = parent::CONDITION_GOOD;\n }\n $price->isbn13 = $offer->isbn13;\n $price->price = $offer->listingPrice;\n $price->shipping_price = $offer->firstBookShipCost;\n $price->url = 'http://affiliates.abebooks.com/c/74871/77797/2029?u='.urlencode($offer->listingUrl);\n $price->retailer = self::RETAILER;\n $price->term = parent::TERM_PERPETUAL;\n }\n $this->addPriceToCollection($price);\n }\n }\n return $this;\n }", "public function rewind(): void\n {\n \\reset($this->responseData->_embedded->items);\n }", "public function setItemList($item_list)\r\n {\r\n $this->item_list = $item_list;\r\n\r\n return $this;\r\n }", "private function formatResponse($response) {\n\n $callback = function($item) {\n $formatted = [\n 'spotify_id' => $item['id'],\n 'name' => $item['name'],\n 'image_small' => null,\n 'image_large' => null,\n ];\n\n if (isset($item['images']) && count($item['images'])) {\n $smallImageIndex = (isset($item['images'][2]) && isset($item['images'][2]['width']) && $item['images'][2]['width'] < 170) ? 1 : 2;\n $formatted['image_small'] = $this->getImage($item['images'], $smallImageIndex);\n $formatted['image_large'] = $this->getImage($item['images']);\n }\n\n if (isset($item['popularity'])) {\n $formatted['spotify_popularity'] = $item['popularity'];\n }\n\n if (isset($item['duration_ms'])) {\n $formatted['duration'] = $item['duration_ms'];\n }\n\n if (isset($item['track_number'])) {\n $formatted['number'] = $item['track_number'];\n }\n\n if (isset($item['genres'])) {\n $formatted['genres'] = implode('|', $item['genres']);\n }\n\n if (isset($item['artists']) && count($item['artists'])) {\n $formatted['artists'] = $item['artists'];\n }\n\n if (isset($item['album']) && count($item['album'])) {\n $formatted['album'] = $item['album'];\n\n if ( ! isset($formatted['image'])) {\n if (isset($item['album']['images'][2]['url'])) {\n $formatted['image'] = $item['album']['images'][2]['url'];\n } else {\n $formatted['image'] = head($item['album']['images']);\n }\n\n }\n }\n\n return $formatted;\n };\n\n $formatted = ['albums' => [], 'tracks' => [], 'artists' => []];\n\n if ( ! isset($response['error'])) {\n $formatted['albums'] = $this->getAlbums(isset($response['albums']['items']) ? $response['albums']['items'] : []);\n $formatted['tracks'] = array_map($callback, isset($response['tracks']['items']) ? $response['tracks']['items'] : []);\n $formatted['artists'] = array_map($callback, isset($response['artists']['items']) ? $response['artists']['items'] : []);\n }\n\n return $formatted;\n }", "public function setItem_list($item_list)\r\n {\r\n $this->item_list = $item_list;\r\n\r\n return $this;\r\n }", "public function addItem($item) {\n\t\t$this->result .= '<li>' . $item . '</li>' . PHP_EOL;\n\t}", "public function addItem($item)\n {\n if ($item instanceof \\Fastbill\\Item\\Item)\n {\n $this['ITEMS'][] = $item;\n }\n else\n {\n $itemObj = new \\Fastbill\\Item\\Item();\n $itemObj->fillFromArray($item);\n $this['ITEMS'];\n }\n\n }", "public function Relist()\n {\n $args = array(\n 'ItemId' => $this->properties['Id']\n );\n $call = Services_Ebay::loadAPICall('RelistItem');\n $call->setArgs($args);\n \n return $call->call($this->session);\n }", "function json_add_post() {\n\n\n $status = 0;\n $message = \"Product not processed successfully.\";\n $dealer = $this->post('sellerid');\n $user = $this->post('user');\n $item = $this->post('item');\n $role = $this->post('role');\n $dt = date(\"Y-m-d H:i:s\");\n $qty = $this->post('qty');\n $json_qty = $this->post('json_qty');\n $json_encode_array = json_decode($json_qty, true);\n $flag = false;\n $processed_items = 0;\n foreach ($json_encode_array as $key => $value) {\n $data = array(\"dealer\" => $dealer, \"branch_price_id\" => $key);\n $cart_qry = $this->model_all->getTableData(\"seller_cart_items\", $data);\n if ($cart_qry->num_rows() > 0) {\n $cart_rs = $cart_qry->row_array();\n $data[\"product_count\"] = $value;\n $data[\"modifiedon\"] = $dt;\n $data[\"added_by\"] = $user;\n $data[\"added_role\"] = $role;\n $aff_rows = $this->model_all->update($data, array(\"id\" => $cart_rs[\"id\"]), \"seller_cart_items\");\n if ($aff_rows) {\n $flag = true;\n $processed_items++;\n }\n } else {\n $data[\"product_count\"] = $value;\n $data[\"modifiedon\"] = $dt;\n $data[\"added_by\"] = $user;\n $data[\"added_role\"] = $role;\n $id = $this->model_all->save($data, \"seller_cart_items\");\n if ($id > 0) {\n $flag = true;\n $processed_items++;\n }\n }\n }\n\n\n\n\n\n\n $items_count_qry = $this->model_all->getTableData(\"seller_cart_items\", array(\"dealer\" => $dealer));\n if ($flag) {\n $status = 1;\n $message = $processed_items . \" Items Processed Successfully\";\n }\n\n\n $result[\"status\"] = $status;\n $result[\"message\"] = $message;\n $result[\"items_count\"] = $items_count_qry->num_rows();\n\n $this->response($result, 200);\n\n exit;\n }", "public function addItems(){\n $this->validate($this->request, [\n 'title' => 'required|max:255',\n 'description' => 'string|max:255',\n 'isbn' => 'string',\n 'authorId' => 'required|integer|min:1',\n 'itemTypeId' => 'required|integer|min:1',\n 'categoryId' => 'required|integer|min:1',\n 'numberInStock' => 'required|integer|min:1',\n 'itemCondition' => 'required',\n 'itemStateId' => 'required|integer|min:1',\n ]);\n $items = array(\n 'title' => $this->request->input('title'),\n 'description' => $this->request->input('description'),\n 'isbn' => $this->request->input('isbn'),\n 'authorId' => $this->request->input( 'authorId'),\n 'catId' => $this->request->input('categoryId'),\n 'numOfItems' => $this->request->input('numberInStock'),\n 'itemCondition' => $this->request->input('itemCondition'),\n 'itemStateId' => $this->request->input('itemStateId'),\n 'itemTypeId' => $this->request->input('itemTypeId'),\n );\n\n try{\n $item = new ItemService();\n $result = $item->createNewItem($items);\n\n if ($result) {\n return response()->json([\n 'success' => true,\n 'data' => [\n 'itemId' => $result,\n ],\n 'message' => 'Item Added Successfully',\n ], 201);\n }\n return response()->json([\n 'success' => false,\n 'message' => 'item could not be added'\n ], 400);\n\n }catch(Exception $ex){\n return response()->json([\n 'success' => false,\n 'message' => 'Error Occured Adding Items. Ensure the IDs are Valid'\n ], 400);\n }\n }", "public function addBasketItemParams()\n {\n $oBasket = $this->getBasket();\n $oLang = $this->getLang();\n $oRequest = $this->getPayPalRequest();\n\n $iPos = 0;\n foreach ($oBasket->getContents() as $oBasketItem) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", getStr()->html_entity_decode($oBasketItem->getTitle()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasketItem->getUnitPrice()->getPrice()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", (int) $oBasketItem->getAmount());\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_ITEMURL{$iPos}\", $oBasketItem->getLink());\n\n $oBasketProduct = $oBasketItem->getArticle();\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NUMBER{$iPos}\", $oBasketProduct->oxarticles__oxartnum->value);\n\n $iPos++;\n }\n\n //adding payment costs as product\n if ($oBasket->getPayPalPaymentCosts() > 0) {\n $sPaymentTitle = $oLang->translateString(\"OEPAYPAL_SURCHARGE\") . \" \" . $oLang->translateString(\"OEPAYPAL_TYPE_OF_PAYMENT\");\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $sPaymentTitle);\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalPaymentCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n\n $iPos++;\n }\n\n //adding wrapping as product\n if ($oBasket->getPayPalWrappingCosts() > 0) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $oLang->translateString(\"OEPAYPAL_GIFTWRAPPER\"));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalWrappingCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n\n $iPos++;\n }\n\n //adding greeting card as product\n if ($oBasket->getPayPalGiftCardCosts() > 0) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $oLang->translateString(\"OEPAYPAL_GREETING_CARD\"));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalGiftCardCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n\n $iPos++;\n }\n\n //adding trusted shops protection as product\n if ($oBasket->getPayPalTsProtectionCosts() > 0) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $oLang->translateString(\"OEPAYPAL_TRUSTED_SHOP_PROTECTION\"));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalTsProtectionCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n }\n }", "public function addItemsDetails($description,$price,$quantity,$reference){\r\n\t\tif ( $this->_requestDetails==null )\r\n\t\t\t$this->_requestDetails = array();\r\n\t\t$nItem = count($this->_requestDetails);\r\n\t\tarray_push($this->_requestDetails, array(\"L_PAYMENTREQUEST_0_NAME\".$nItem=>$description,\"L_PAYMENTREQUEST_0_AMT\".$nItem=>$price,\"L_PAYMENTREQUEST_0_QTY\".$nItem=>$quantity,\"L_PAYMENTREQUEST_0_NUMBER\".$nItem=>$reference ));\r\n\t}", "protected function process_response() {\n\t\t\t$this->response['response']['Message'] = isset($this->response['response']['Message']) ? $this->response['response']['Message'] : '';\n\t\t\t$this->response['response']['error'] = (strpos(strtolower($this->response['response']['Message']), 'invalid') !== false) ? true : $this->response['response']['error'];\n\t\t\t$this->response['response']['error'] = (strpos(strtolower($this->response['response']['Message']), 'the item code was specified more than once') !== false) ? true : $this->response['response']['error'];\n\t\t\t$this->response['response']['Level1Code'] = $this->request['Level1Code'];\n\t\t\t\n\t\t\tif (!$this->response['response']['error']) { // IF Error is False\n\t\t\t\tif (in_array($this->response['server']['http_code'], array('200', '201', '202', '204'))) {\n\t\t\t\t\t$this->log_sendlogitem($this->request['Level1Code']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->log_error($this->response['response']['Message']);\n\t\t\t}\n\t\t}", "public static function _register()\n {\n self::assignElements(['AddItemResponseContainer' => ['type' => 'AddItemResponseContainerType', 'xmlns' => self::XMLNS, 'cardinality' => '0..*']], parent::NAME);\n self::assignAttributes([]);\n }", "public function handle_collection($response)\n {\n foreach ($response->items as &$value) {\n $value = new ContactList(new Response($value));\n }\n }", "public static function removeItem($item_id) {\n global $lC_Database, $lC_Language, $lC_Currencies, $lC_Customer, $lC_ShoppingCart, $lC_Image;\n\n $result = array();\n \n $lC_ShoppingCart->remove($item_id);\n \n // crete the new order total text\n $otText = '';\n foreach ($lC_ShoppingCart->getOrderTotals() as $module) {\n $otText .= '<tr>' .\n ' <td class=\"align_left' . (($module['code'] == 'sub_total') ? ' sc_sub_total' : null) . (($module['code'] == 'total') ? ' sc_total' : null) . '\" style=\"padding-right:10px;\">' . $module['title'] . '</td>' .\n ' <td class=\"align_right' . (($module['code'] == 'sub_total') ? ' sc_sub_total' : null) . (($module['code'] == 'total') ? ' sc_total' : null) . '\">' . $module['text'] . '</td>' .\n '</tr>';\n }\n \n $result['otText'] = $otText;\n \n // create the new mini-cart text\n $mcText = '';\n if ($lC_ShoppingCart->hasContents()) {\n $mcText .= '<a href=\"#\" class=\"minicart_link\">' . \n ' <span class=\"item\"><b>' . $lC_ShoppingCart->numberOfItems() . '</b> ' . ($lC_ShoppingCart->numberOfItems() > 1 ? strtoupper($lC_Language->get('text_cart_items')) : strtoupper($lC_Language->get('text_cart_item'))) . ' /</span> <span class=\"price\"><b>' . $lC_Currencies->format($lC_ShoppingCart->getSubTotal()) . '</b></span>' . \n '</a>' .\n '<div class=\"cart_drop\">' .\n ' <span class=\"darw\"></span>' .\n ' <ul>';\n\n foreach ($lC_ShoppingCart->getProducts() as $products) {\n $mcText .= '<li>' . $lC_Image->show($products['image'], $products['name'], null, 'mini') . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $products['keyword']), '(' . $products['quantity'] . ') x ' . $products['name']) . ' <span class=\"price\">' . $lC_Currencies->format($products['price']) . '</span></li>';\n } \n \n $mcText .= '</ul>' .\n '<div class=\"cart_bottom\">' .\n '<div class=\"subtotal_menu\">' .\n '<small>' . $lC_Language->get('box_shopping_cart_subtotal') . '</small>' .\n '<big>' . $lC_Currencies->format($lC_ShoppingCart->getSubTotal()) . '</big>' .\n '</div>' .\n '<a href=\"' . lc_href_link(FILENAME_CHECKOUT, null, 'SSL') . '\">' . $lC_Language->get('text_checkout') . '</a>' .\n '</div>' .\n '</div>';\n $result['redirect'] = '0';\n } else {\n $mcText .= $lC_Language->get('box_shopping_cart_empty');\n $result['redirect'] = '1';\n } \n \n $result['mcText'] = $mcText;\n \n \n return $result;\n }", "public function addSimpleItem($item){\t\t\r\n if( //Check the quantity and the name\r\n !empty($item['quantity']) \r\n && is_numeric($item['quantity']) \r\n && $item['quantity']>0 \r\n && !empty($item['name'])\r\n ){ //And add the item to the cart if it is correct\r\n $items = $this->items;\r\n $items[] = $item;\r\n $this->items = $items;\r\n }\r\n }", "public function addItem(Collection $collection, ItemCreateStruct $itemCreateStruct): Item;", "private function load(){\n\n $xml = simplexml_load_string($this->response);\n if($xml){\n if(!$this->isResponseSuccessFull($xml)) {\n\n $item = $xml->Items->Item;\n\n $this->data['title'] = $item->ItemAttributes->Title->__toString();\n $this->data['ean'] = $item->ItemAttributes->EAN->__toString();\n $this->data['brand'] = $item->ItemAttributes->Brand->__toString();\n $this->data['picture'] = $item->SmallImage->URL->__toString();\n $this->data['asin'] = $item->ASIN->__toString();\n $this->data['price'] = round(((int)$item->ItemAttributes->ListPrice->Amount->__toString()) / 100,2);\n }\n }else{\n $this->errorMessage[] = 'can not load xml.';\n }\n }", "function processListingItem( $item, $order ) {\n\t\tglobal $wpdb;\n\n\t\t// abort if item data is invalid\n\t\tif ( ! isset( $item->ASIN ) && ! isset( $item->QuantityOrdered ) ) {\n\t\t\t$history_message = \"Error fetching order line items - request throttled?\";\n\t\t\t$history_details = array();\n\t\t\tself::addHistory( $order->AmazonOrderId, 'request_throttled', $history_message, $history_details );\n\t\t\treturn false;\n\t\t}\n\n\t\tdo_action( 'wpla_before_process_listing_item', $item, $order );\n\n\t\t$order_id = $order->AmazonOrderId;\n\t\t$asin = $item->ASIN;\n\t\t$sku = $item->SellerSKU;\n\t\t$quantity_purchased = $item->QuantityOrdered;\n\t\t\n\t\t// get listing item\n\t\t$lm = new WPLA_ListingsModel();\n\t\t$listing = $lm->getItemBySKU( $sku );\n\n\t\t// skip if this listing does not exist in WP-Lister\n\t\tif ( ! $listing ) {\n\t\t\t$history_message = \"Skipped unknown SKU {$sku} ({$asin})\";\n\t\t\t$history_details = array( 'sku' => $sku, 'asin' => $asin );\n\t\t\tself::addHistory( $order_id, 'skipped_item', $history_message, $history_details );\n\t\t\treturn true;\n\t\t}\n\n\n\t\t// handle FBA orders\n\t\tif ( $order->FulfillmentChannel == 'AFN' ) {\n\n\t\t\t// update quantity for FBA orders\n\t\t\t$fba_quantity = $listing->fba_quantity - $quantity_purchased;\n\t\t\t$quantity_sold = $listing->quantity_sold + $quantity_purchased;\n\n\t\t\t$wpdb->update( $wpdb->prefix.'amazon_listings', \n\t\t\t\tarray( \n\t\t\t\t\t'fba_quantity' => $fba_quantity,\n\t\t\t\t\t'quantity_sold' => $quantity_sold \n\t\t\t\t), \n\t\t\t\tarray( 'sku' => $sku ) \n\t\t\t);\n\n\t\t\t// add history record\n\t\t\t$history_message = \"FBA quantity reduced by $quantity_purchased for listing {$sku} ({$asin}) - FBA stock $fba_quantity ($quantity_sold sold)\";\n\t\t\t$history_details = array( 'fba_quantity' => $fba_quantity, 'sku' => $sku, 'asin' => $asin, 'qty_purchased' => $quantity_purchased, 'listing_id' => $listing->id );\n\t\t\tself::addHistory( $order_id, 'reduce_stock', $history_message, $history_details );\n\n\t\t} else {\n\n\t\t\t// update quantity for non-FBA orders\n\t\t\t$quantity_total = $listing->quantity - $quantity_purchased;\n\t\t\t$quantity_sold = $listing->quantity_sold + $quantity_purchased;\n\t\t\t$wpdb->update( $wpdb->prefix.'amazon_listings', \n\t\t\t\tarray( \n\t\t\t\t\t'quantity' => $quantity_total,\n\t\t\t\t\t'quantity_sold' => $quantity_sold \n\t\t\t\t), \n\t\t\t\tarray( 'sku' => $sku ) \n\t\t\t);\n\n\t\t\t// add history record\n\t\t\t$history_message = \"Quantity reduced by $quantity_purchased for listing {$sku} ({$asin}) - new stock: $quantity_total ($quantity_sold sold)\";\n\t\t\t$history_details = array( 'newstock' => $quantity_total, 'sku' => $sku, 'asin' => $asin, 'qty_purchased' => $quantity_purchased, 'listing_id' => $listing->id );\n\t\t\tself::addHistory( $order_id, 'reduce_stock', $history_message, $history_details );\n\n\t\t}\n\n\n\n\t\t// mark listing as sold when last item is sold\n\t\t// if ( $quantity_total == 0 ) {\n\t\t// \t$wpdb->update( $wpdb->prefix.'amazon_listings', \n\t\t// \t\tarray( 'status' => 'sold', 'date_finished' => $data['date_created'], ), \n\t\t// \t\tarray( 'sku' => $sku ) \n\t\t// \t);\n\t\t// \tWPLA()->logger->info( 'marked item '.$sku.' as SOLD ');\n\t\t// }\n\n\n\n\t\treturn true;\n\t}", "private static function parse_items($items){\n $results = [];\n foreach($items as $item){\n $title = $item->find('.title a')[0];\n if(empty($title)){\n $title = $item->find('.featured-ad-title a')[0];\n }\n try{\n $item_data = [\n \"title\" => $title->text,\n \"date\" => $item->find('.date')[0]->text,\n \"url\" => $title->getAttribute(\"href\"),\n \"location\" => $item->find('.location')[0]->text\n ];\n\n $price = trim($item->find('.price')[0]->text);\n\n $m = explode(\" \", $price);\n if(count($m) > 1){\n $item_data[\"price\"] = intval(str_replace(\",\", \"\", $m[1]));\n $item_data[\"currency\"] = $m[0];\n }else{\n $item_data[\"price\"] = 0;\n $item_data[\"currency\"] = \"UNKNOWN\";\n }\n\n try{\n $category = $item->find('.description .breadcrumbs')[0];\n if(is_object($category)){\n $item_data[\"category\"] = $category->text;\n }else{\n $item_data[\"category\"] = $category;\n }\n }catch(Exception $e){\n $item_data[\"category\"] = \"\";\n }\n\n $photo_block = $item->find(\".thumb div\");\n if(!empty($photo_block)){\n $style = $photo_block->getAttribute(\"style\");\n preg_match(\"/http.*\\.\\w*/\", $style, $result);\n if(!empty($result)){\n $item_data[\"photo\"] = $result[0];\n }else{\n $item_data[\"photo\"] = \"\";\n }\n }else{\n $item_data[\"photo\"] = \"\";\n }\n\n\n array_push($results, $item_data);\n }catch(Exception $e){\n continue;\n }\n }\n return $results;\n }", "public function getItemBag() {\n $item_classname = $this->getItemClass();\n $item_bag_classname = $this->getItemBagClass();\n $items = new $item_bag_classname();\n $currency = NULL;\n foreach ($this->getPayment()->getLineItems() as $line_item) {\n $item = new $item_classname();\n $item->setPrice($line_item->getAmount());\n $item->setQuantity($line_item->getQuantity());\n $item->setDescription($line_item->getDescription());\n $item->setName($line_item->getName());\n $items->add($item);\n\n $line_item_currency = $line_item->getCurrencyCode();\n\n if ($line_item_currency != $currency) {\n if ($currency != NULL) {\n // This is the second time we are changing the currency which means\n // that our line items have mixed currencies. This ain't gonna work!\n drupal_set_message($this->t('Mixed currencies detected which is not yet supported.'), 'error');\n return new OperationResult(NULL);\n }\n $currency = $line_item_currency;\n }\n }\n $this->setCurrency($currency);\n return $items;\n }", "private function _parseAdlibSingleItem($adlib_item) {\n $sources = $this->source_config['sources'];\n $item = array();\n // get mappings\n $mappings = $this->filterMappings(feeds_importer($this->id)->processor->config['mappings']);\n // get info about fields\n $all_fields = field_info_fields();\n // $source is the string with the replacement values, e.g. '<h2>[title]</h2>'\n foreach ($this->source_config['sources'] as $source_key => $source) {\n /*\n * Analyze the source. There are two possibilities:\n * 1) There is only one token\n * 2) There are more than one tokens\n */\n //$token_regexp = '/(\\[[a-zA-Z\\._]+:+[a-zA-Z\\._\\<\\>\\/]+\\]|\\[[a-zA-Z\\._]+\\])/';\n $token_regexp = '/\\[' . $this->field_regex . ':' . $this->separator_regex . '\\]|\\[' . $this->field_regex . '\\]/';\n $token_count = preg_match_all($token_regexp, $source, $tokens);\n $token_multiple = FALSE;\n if ($token_count > 1) {\n $token_multiple = TRUE;\n }\n /*\n * Analyze the target field. There are two possibilities\n * 1) It's a single field\n * 2) It's multiple field\n */\n // get info about cck_field\n $cck_multiple = FALSE;\n // D6 version $field_info = content_fields($this->mappings[$source_key]);\n\n $field_name = $mappings[$source_key];\n unset($field_info);\n if (isset($all_fields[$field_name])) {\n $field_info = $all_fields[$field_name];\n }\n if (isset($field_info) && $field_info['cardinality'] == -1) {\n $cck_multiple = TRUE;\n }\n // e.g. $value = '[creator] | [material]'\n $value = $source;\n foreach ($adlib_item as $adlib_key => $adlib_value) {\n /*\n * After analyzing, there are two possibilities:\n * 1) There is a multivalued cck field, and only one token which might be multivalued: multi\n * 2) The rest: single.\n *\n * In the first case we generate an array which can be mapped to the multivalued cck field\n * In the second case, we explode the multivalued tokens in one string and put this in place of the token.\n */\n //$adlib_value_regex = '/(\\[' . $adlib_key . ':+[a-zA-Z\\._\\<\\>\\/]+\\]|\\[' . $adlib_key . '\\])/';\n $adlib_value_regex = '/\\[' . $adlib_key . ':' . $this->separator_regex . '\\]|\\[' . $adlib_key . '\\]/';\n if ($cck_multiple && !$token_multiple) {\n $dummy = 'dummy';\n if (preg_match($adlib_value_regex, $value) > 0) {\n if (is_array($adlib_value)) {\n $value_array = array();\n foreach ($adlib_value as $val) {\n $value_array[] = preg_replace($adlib_value_regex, $val, $value);\n }\n $value = $value_array;\n }\n else {\n $value = preg_replace($adlib_value_regex, $adlib_value, $value);\n }\n // Leave the foreach for $adlib_item\n break;\n }\n }\n // All values must be put in single field.\n else {\n // If the adlib_value is an array, get the glue string\n if (is_array($adlib_value)) {\n $adlib_value_regex = '/\\[(' . $adlib_key . '):(' . $this->separator_regex . ')\\]/';\n $count = preg_match($adlib_value_regex, $source, $parts);\n // if count > 0 we have a field with separator, otherwise we do not have a separator\n if ($count == 0) {\n $adlib_value_regex = '/\\[' . $adlib_key . '\\]/';\n }\n $glue = (isset($parts[2])) ? $parts[2] : ' ';\n $glued_string = implode($glue, $adlib_value);\n $value = preg_replace($adlib_value_regex, $glued_string, $value);\n }\n else {\n $value = preg_replace($adlib_value_regex, $adlib_value, $value);\n }\n }\n }\n if (is_array($value)) {\n foreach ($value as $key => $val) {\n // if we have any more [<tags>] remove them here\n $value[$key] = preg_replace('/\\[.*?\\]/', '', $val);\n // remove redundant spaces\n $value[$key] = trim($value[$key]);\n }\n }\n else {\n // if we have any more [<tags>] remove them here\n $value = preg_replace('/\\[.*?\\]/', '', $value);\n // remove redundant spaces\n $value = trim($value);\n // Replace token characters again\n $value = $this->replaceTokenCharacters($value, TRUE);\n }\n\n $item[$source_key] = $value;\n }\n return $item;\n }", "public function prepare_items() {\n\t\t$this->items = array();\n\t\t$posts_per_page = $this->get_items_per_page( $this->request_type . '_requests_per_page' );\n\t\t$args = array(\n\t\t\t'post_type' => $this->post_type,\n\t\t\t'post_name__in' => array( $this->request_type ),\n\t\t\t'posts_per_page' => $posts_per_page,\n\t\t\t'offset' => isset( $_REQUEST['paged'] ) ? max( 0, absint( $_REQUEST['paged'] ) - 1 ) * $posts_per_page : 0,\n\t\t\t'post_status' => 'any',\n\t\t\t's' => isset( $_REQUEST['s'] ) ? sanitize_text_field( $_REQUEST['s'] ) : '',\n\t\t);\n\n\t\t$orderby_mapping = array(\n\t\t\t'requester' => 'post_title',\n\t\t\t'requested' => 'post_date',\n\t\t);\n\n\t\tif ( isset( $_REQUEST['orderby'] ) && isset( $orderby_mapping[ $_REQUEST['orderby'] ] ) ) {\n\t\t\t$args['orderby'] = $orderby_mapping[ $_REQUEST['orderby'] ];\n\t\t}\n\n\t\tif ( isset( $_REQUEST['order'] ) && in_array( strtoupper( $_REQUEST['order'] ), array( 'ASC', 'DESC' ), true ) ) {\n\t\t\t$args['order'] = strtoupper( $_REQUEST['order'] );\n\t\t}\n\n\t\tif ( ! empty( $_REQUEST['filter-status'] ) ) {\n\t\t\t$filter_status = isset( $_REQUEST['filter-status'] ) ? sanitize_text_field( $_REQUEST['filter-status'] ) : '';\n\t\t\t$args['post_status'] = $filter_status;\n\t\t}\n\n\t\t$requests_query = new WP_Query( $args );\n\t\t$requests = $requests_query->posts;\n\n\t\tforeach ( $requests as $request ) {\n\t\t\t$this->items[] = wp_get_user_request( $request->ID );\n\t\t}\n\n\t\t$this->items = array_filter( $this->items );\n\n\t\t$this->set_pagination_args(\n\t\t\tarray(\n\t\t\t\t'total_items' => $requests_query->found_posts,\n\t\t\t\t'per_page' => $posts_per_page,\n\t\t\t)\n\t\t);\n\t}", "public function __construct(OB_API $api, $type, array $container, $total) \n\t{\n\t\tif( ! is_array($container))\n\t\t\tthrow new Kohana_Exception(\"API Collection must be set with an array result\");\n\n\t\t$this->container = $container;\n\t\t$this->_item_type = OB_API_Item::factory($api, $type);\n\n\t\t$this->_api = $api;\n\t\t$this->_type = $type;\n\t\t$this->_total = $total;\n\t}", "public function issetAddItemResponseContainer($index)\n {\n return isset($this->addItemResponseContainer[$index]);\n }", "public function addContainer($data) {\n try {\n $client = new Zend_Soap_Client($this->CONTAINER_WSDL_URI);\n $options = array('soap_version' => SOAP_1_1,\n 'encoding' => 'ISO-8859-1',\n );\n $client->setOptions($options);\n $client->action = 'createContainer';\n $result = $client->createContainer(\n $this->toXml(\n array(\n 'backgroundColor' => $data['backgroundColor'],\n 'borderBottom' => $data['borderBottom'],\n 'borderBottomColor' => $data['borderBottomColor'],\n 'borderBottomStyle' => $data['borderBottomStyle'],\n 'borderBottomUnit ' => $data['borderBottomUnit'],\n 'borderLeft' => $data['borderLeft'],\n 'borderLeftColor' => $data['borderLeftColor'],\n 'borderLeftStyle' => $data['borderLeftStyle'],\n 'borderLeftUnit' => $data['borderLeftUnit'],\n 'borderRight' => $data['borderRight'],\n 'borderRightColor' => $data['borderRightColor'],\n 'borderRightStyle' => $data['borderRightStyle'],\n 'borderRightUnit' => $data['borderRightUnit'],\n 'borderTop' => $data['borderTop'],\n 'borderTopColor' => $data['borderTopColor'],\n 'borderTopStyle' => $data['borderTopStyle'],\n 'borderTopUnit' => $data['borderTopUnit'],\n 'bottomMargin' => $data['bottomMargin'],\n 'bottomMarginUnit' => $data['bottomMarginUnit'],\n 'bottomPadding' => $data['bottomPadding'],\n 'bottomPaddingUnit' => $data['bottomPaddingUnit'],\n 'containerHeight' => $data['containerHeight'],\n 'containerId' => $data['containerId'],\n 'containerName' => $data['containerName'],\n 'containerWidth' => $data['containerWidth'],\n 'containerXaxis' => $data['containerXaxis'],\n 'containerYaxis' => $data['containerYaxis'],\n 'css' => $data['css'],\n 'font' => $data['font'],\n 'fontAlignment' => $data['fontAlignment'],\n 'fontColor' => $data['fontColor'],\n 'fontSize' => $data['fontSize'],\n 'isActive' => true,\n 'isBold' => $data['isBold'],\n 'isBorderColorSameForAll' => $data['isBorderColorSameForAll'],\n 'isBorderStyleSameForAll' => $data['isBorderStyleSameForAll'],\n 'isBorderWidthSameForAll' => $data['isBorderWidthSameForAll'],\n 'isItalic' => $data['isItalic'],\n 'isMargineSameForAll' => $data['isMargineSameForAll'],\n 'isPaddingSameForAll' => $data['isPaddingSameForAll'],\n 'leftMargin' => $data['leftMargin'],\n 'leftMarginUnit' => $data['leftMarginUnit'],\n 'leftPadding' => $data['leftPadding'],\n 'leftPaddingUnit' => $data['leftPaddingUnit'],\n 'letterSpacing' => $data['letterSpacing'],\n 'lineHeight' => $data['lineHeight'],\n 'primaryKey' => 0,\n 'rightMargin' => $data['rightMargin'],\n 'rightMarginUnit' => $data['rightMarginUnit'],\n 'rightPadding' => $data['rightPadding'],\n 'rightPaddingUnit' => $data['rightPaddingUnit'],\n 'textDecoration' => $data['textDecoration'],\n 'topMargin' => $data['topMargin'],\n 'topMarginUnit' => $data['topMarginUnit'],\n 'topPadding' => $data['topPadding'],\n 'topPaddingUnit' => $data['topPaddingUnit'],\n 'updatedby' => $_SESSION['Username'],\n 'updatedt' => date('Y-m-d') . 'T' . date('H:i:s') . 'Z',\n 'wordSpacing' => $data['wordSpacing'],\n )\n ,$rootNodeName = 'AddContainer')\n );\n return $result;\n } catch (Exception $e) {\n // print_r($e);\n }\n }", "protected function _encodeItems($parameters) {\n\t\t\t$response = array();\n\n\t\t\tif (!empty($parameters['items'])) {\n\t\t\t\tforeach ($parameters['items'] as $itemListName => $items) {\n\t\t\t\t\t$response['tokens'][$itemListName] = array();\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tempty($items['parameters']) ||\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t!empty($parameters['processing']) &&\n\t\t\t\t\t\t\t$parameters['processing']['chunks'] > 1\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\t$response['items'][$itemListName] = array_merge($parameters['items'][$itemListName], array(\n\t\t\t\t\t\t\t'count' => 0,\n\t\t\t\t\t\t\t'data' => array()\n\t\t\t\t\t\t));\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$itemIds = $this->fetch($items['table'], $items['parameters']);\n\n\t\t\t\t\tif (!empty($itemIds['count'])) {\n\t\t\t\t\t\t$itemIndexes = array();\n\t\t\t\t\t\t$itemIndexLineIndex = $itemStatusCount = 0;\n\t\t\t\t\t\t$selectedItemIndexes = array_intersect($itemIds['data'], $parameters['items'][$itemListName]['data']);\n\t\t\t\t\t\t$unselectedItemIndexes = array_diff($itemIds['data'], $parameters['items'][$itemListName]['data']);\n\t\t\t\t\t\tarray_walk($selectedItemIndexes, function(&$selectedItemIdValue, $selectedItemIdKey) {\n\t\t\t\t\t\t\t$selectedItemIdValue = 1;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tarray_walk($unselectedItemIndexes, function(&$unselectedItemIdValue, $unselectedItemIdKey) {\n\t\t\t\t\t\t\t$unselectedItemIdValue = 0;\n\t\t\t\t\t\t});\n\t\t\t\t\t\t$allItemIndexes = $selectedItemIndexes + $unselectedItemIndexes;\n\t\t\t\t\t\tksort($allItemIndexes);\n\n\t\t\t\t\t\tforeach ($allItemIndexes as $itemIndex => $itemStatus) {\n\t\t\t\t\t\t\tif (((10000 * ($itemIndexLineIndex + 1)) - $itemIndex) === 1) {\n\t\t\t\t\t\t\t\t$itemIndexes[$itemIndexLineIndex][] = $itemStatus . $itemStatusCount;\n\t\t\t\t\t\t\t\t$itemStatusCount = 0;\n\t\t\t\t\t\t\t\t$itemIndexLineIndex++;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$itemStatusCount++;\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!isset($allItemIndexes[$itemIndex + 1]) ||\n\t\t\t\t\t\t\t\t$allItemIndexes[$itemIndex + 1] != $itemStatus\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t$itemIndexes[$itemIndexLineIndex][] = $itemStatus . $itemStatusCount;\n\t\t\t\t\t\t\t\t$itemStatusCount = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tforeach ($itemIndexes as $itemIndexLineIndex => $itemStatusCounts) {\n\t\t\t\t\t\t\t$itemIndexes[$itemIndexLineIndex] = implode('_', $itemStatusCounts);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$response['items'][$itemListName] = array_merge($parameters['items'][$itemListName], array(\n\t\t\t\t\t\t'count' => count($selectedItemIndexes),\n\t\t\t\t\t\t'data' => $itemIndexes\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $response;\n\t\t}", "public function addItem($feedItem)\n {\n $this->items[] = $feedItem;\n }", "public function inventoryPush($itemData)\r\n {\r\n if (isset($itemData['records'])) {\r\n $itemData = $itemData['records'];\r\n }\r\n $response = array();\r\n $response['records'] = array();\r\n $resourceModel = Mage::getResourceModel('retailops_api/api');\r\n\r\n $orderQtys = array();\r\n if( !empty( $itemData ) ) {\r\n Mage::log('In', null, 'retailops.log');\r\n Mage::log(print_r($itemData, true), null, 'retailops.log');\r\n $orderQtys = $resourceModel->getRetailopsNonretrievedQtys();\r\n }\r\n $productIds = $this->getProductIds($itemData);\r\n\r\n foreach ($itemData as $item) {\r\n try {\r\n Mage::dispatchEvent(\r\n 'retailops_inventory_push_record',\r\n array('record' => $stockObj)\r\n );\r\n\r\n $stockObj = $resourceModel->subtractNonretrievedQtys($orderQtys, $item);\r\n\r\n Mage::dispatchEvent(\r\n 'retailops_inventory_push_record_qty_processed',\r\n array('record' => $stockObj)\r\n );\r\n\r\n $this->update($productIds[$stockObj->getSku()], $stockObj->getData());\r\n\r\n $result['status'] = RetailOps_Api_Helper_Data::API_STATUS_SUCCESS;\r\n } catch (Mage_Core_Exception $e) {\r\n $result['status'] = RetailOps_Api_Helper_Data::API_STATUS_FAIL;\r\n $result['error'] = array(\r\n 'code' => $e->getCode(),\r\n 'message' => $e->getMessage()\r\n );\r\n }\r\n $response['records'][] = $result;\r\n }\r\n\r\n return $response;\r\n }", "public static function displayItemList($showSettings){\n\t\t\tif($showSettings && !User::isAdmin()){\n\t\t\t\t$showSettings = false;\n\t\t\t}\n\n\t\t\t$time_start = microtime(true);\n\n\t\t\t$itemCategories = LendingItem::getAllItems();\n\n\t\t\tforeach ($itemCategories as $categoryID => $category_items) {\n\t\t\t\t// For each category\n\t\t\t\t?>\n\t\t\t\t<div class=\"categoryContainer\">\n\t\t\t\t\t<h2 class=\"rubrikBooking\">\n\t\t\t\t\t\t<img class=\"categoryExpandImg\" src=\"../images/expand.gif\" />\n\t\t\t\t\t\t<img class=\"categoryContractImg\" src=\"../images/contract.gif\" />\n\t\t\t\t\t\t<?php echo(Language::itemCategory($categoryID)); ?>\n\t\t\t\t\t</h2>\n\t\t\t\t\t<div class=\"categoryItemHolder\">\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ($category_items as $item) {\n\t\t\t\t\t\t// For each item\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<div class='bookingFormItem'>\n\t\t\t\t\t\t\t<input type='hidden' class='bookingItemID' name='item' value='<?php echo($item['id']); ?>' />\n\t\t\t\t\t\t\t<input type='hidden' class='maxLendingPeriods' name='item' value='<?php echo($item['max_lending_periods']); ?>' />\n\n\t\t\t\t\t\t\t<p class=\"itemImage\">\n\t\t\t\t\t\t\t\t<?php if (file_exists(\"img/\".$item['id'].\".jpg\")) { ?>\n\t\t\t\t\t\t\t\t\t<img class=\"itemPic\" src=\"img/<?php echo($item['id']); ?>.jpg\" alt=\"<?php echo($item['name']); ?>\" />\n\t\t\t\t\t\t\t\t<?php }else{ ?>\n\t\t\t\t\t\t\t\t\t<img class=\"itemPic\" src=\"img/404img.png\" alt=\"Image not found\" />\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<h4 class='itemHeading' id='<?php echo(Language::itemName($item['id'])); ?>'><?php echo(Language::itemName($item['id'])); ?></h4>\n\t\t\t\t\t\t\t<div class='itemContent' >\n\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t<?php echo(nl2br(Language::itemDescription($item['id']))); ?>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<?php echo((nl2br(nl2br($item['deposit'] ? Language::text(\"booking_deposit\").\": \".$item['deposit'].\" SEK\" : \"\")))); ?>\n\t\t\t\t\t\t\t\t\t<?php echo((nl2br($item['fee'] ? Language::text(\"booking_fee\").\": \".$item['fee'].\" SEK\" : \"\"))); ?><br />\n\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"max_lending_time\")); ?> <?php echo($item['max_lending_periods']); ?><br />\n\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"item_descr_there_is\")); ?> <?php echo($item['num_items']); ?> <?php echo(Language::text(\"item_descr_num\")); ?>\n\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif($showSettings){\n\t\t\t\t\t\t\t\t\t//Display item options for admins\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<form action=\"item.php\" method=\"post\" enctype=\"multipart/form-data\">\n\t\t\t\t\t\t\t\t\t\t<fieldset style=\"padding: 0;\">\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"lending_item_id\" value=\"<?php echo($item['id']); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\t<b><?php echo(Language::text(\"edit_item\")); ?>:</b>\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Bildfil\"><?php echo(Language::text(\"picture\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"button_style\" id =\"picture_select_btn\" type=\"file\" name=\"image\" class=\"button_style\" />\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Internt Namn\"><?php echo(Language::text(\"internal_name\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form_style\" type=\"text\" name=\"name\" value=\"<?php echo($item['name']); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Antal\"><?php echo(Language::text(\"amount\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form_style\" type=\"text\" name=\"num_items\" value=\"<?php echo($item['num_items']); ?>\" size=\"3\" />\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Max att låna\"><?php echo(Language::text(\"max_to_lend\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form_style\" type=\"text\" name=\"max_lending_items\" value=\"<?php echo($item['max_lending_items']); ?>\" size=\"3\" /> <?php echo(Language::text(\"max_lend_info\")); ?>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Maxlånetid\"><?php echo(Language::text(\"max_time\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form_style\" type=\"text\" name=\"max_lending_periods\" value=\"<?php echo($item['max_lending_periods']); ?>\" size=\"3\" /> <?php echo(Language::text(\"max_time_info\")); ?>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Deposition\"><?php echo(Language::text(\"deposition\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form_style\" type=\"text\" name=\"deposit\" value=\"<?php echo($item['deposit']); ?>\" size=\"5\" /> kr\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Avgift\"><?php echo(Language::text(\"fee\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form_style\" type=\"text\" name=\"fee\" value=\"<?php echo($item['fee']); ?>\" size=\"5\" /> kr\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Ta bort bild\"><?php echo(Language::text(\"remove_pic\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"delete_image\" value=\"1\" />\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"button_style\" type=\"submit\" name=\"update_lending_item\" value=\"<?php echo(Language::text(\"update\")); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"button_style\" type=\"submit\" name=\"delete_lending_item\" value=\"<?php echo(Language::text(\"remove_item\")); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t\t\t<div class=\"togglable\">\n\t\t\t\t\t\t\t\t\t\t<p class=\"toggleButton\"><b><?php echo(Language::text(\"translations\")); ?></b></p>\n\t\t\t\t\t\t\t\t\t\t<div class=\"toggleContent\"><?php\n\n\t\t\t\t\t\t\t\t\t\tforeach (Language::getLanguages() as $language) { ?>\n\t\t\t\t\t\t\t\t\t\t\t<form action=\"item.php\" method=\"post\">\n\t\t\t\t\t\t\t\t\t\t\t\t<fieldset class=\"translateBox\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ($translation = ItemTranslation::getTranslation($item['id'], $language['id'])) { ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"item_translation_id\" value=\"<?php echo($translation['id']); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<legend><?php echo(Language::text(\"edit_language\")); ?> <?php echo($language['name']); ?></legend>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"name\")); ?>: <input type=\"text\" name=\"name\" value=\"<?php echo($translation['name']); ?>\" /><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"description\")); ?>:<br />\n\t <textarea name=\"description\" rows=\"3\" cols=\"25\"><?php echo($translation['description']); ?></textarea><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tEmail-text:<br />\n\t <textarea name=\"emailText\" rows=\"3\" cols=\"25\"><?php echo($translation['email_text']); ?></textarea><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button_style\" name=\"update_item_translation\" value=\"<?php echo(Language::text(\"update\")); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php } else { ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"item_id\" value=\"<?php echo($item['id']); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"language_id\" value=\"<?php echo($language['id']); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<legend><?php echo(Language::text(\"add_translation\")); ?> <?php echo($language['name']); ?></legend>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"name\")); ?>: <input type=\"text\" name=\"name\" value=\"\" /><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"description\")); ?>:<br />\n\t <textarea name=\"description\" rows=\"3\" cols=\"25\"></textarea><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tEmail-text:<br />\n\t <textarea name=\"emailText\" rows=\"3\" cols=\"25\"></textarea><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button_style\" name=\"create_item_translation\" value=\"<?php echo(Language::text(\"create\")); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t//Display calendar for booking\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<div class=\"calendarBooking\">\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\techo \"<input type='hidden' class='bookingItemID' name='item' value='\".$item['id'].\"' />\\n\";\n\t\t\t\t\t\t\t\t\t\t\techo \"<input type='hidden' class='maxLendingPeriods' name='item' value='\".$item['max_lending_periods'].\"' />\\n\";\n\t\t\t\t\t\t\t\t\t\t?><br />\n\t\t\t <div>\n\t\t\t <a href=\"#\" class=\"firstLoadButton\"><?php echo(nl2br(Language::text(\"booking_choose_period\"))); ?></a>\n\t\t\t </div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"calendar\">\n\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\t\t\t\t\tif ($item['max_lending_items'] != \"0\") {\n\t\t\t\t\t\t\t\t\t\t\t$max_lending_items = $item['max_lending_items'];\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$max_lending_items = $item['num_items'];\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\t\t<br />\n\t\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"booking_num_items\")); ?>:\n\t\t\t\t\t\t\t\t\t\t<select name=\"num_items\" class=\"numItemsSelector\">\n\t\t\t\t\t\t\t\t\t\t\t<?php for ($num_items = 1; $num_items <= $max_lending_items; $num_items++) { ?>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"<?php echo($num_items); ?>\"><?php echo($num_items); ?></option>\n\t\t\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t<br />\n\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"itemRowSeparator\"></div>\n\t\t\t\t\t<?php\n\t\t\t\t\t}\n\n\t\t\t\t\tif($showSettings){\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<!-- Item box for adding new item -->\n\t\t\t\t\t\t<div class=\"bookingFormItem\" style=\"background-color: #ff6600;\">\n\t\t\t\t\t\t\t<h4 class=\"itemHeading\"><?php echo(Language::text(\"add_item_to\")); ?> <b style=\"color:#0080ff\"><?php echo(Language::itemCategory($categoryID)); ?></b></h4>\n\t\t\t\t\t\t\t<div class=\"itemContent\">\n\t\t\t\t\t\t\t\t<form action=\"item.php\" method=\"post\">\n\t\t\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"lending_item_category_id\" value=\"<?php echo($categoryID); ?>\" />\n\t\t\t\t\t\t\t\t\t\t<legend><?php echo(Language::text(\"edit_item\")); ?>:</legend>\n\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Internt namn \"><?php echo(Language::text(\"internal_name\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_style\" name=\"name\" value=\"\" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Antal\"><?php echo(Language::text(\"amount\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_style\" name=\"num_items\" value=\"1\" /> st\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Max att låna\"><?php echo(Language::text(\"max_to_lend\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_style\" name=\"max_lending_items\" value=\"0\" /> <?php echo(Language::text(\"max_lend_info\")); ?>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Maxlånetid\"><?php echo(Language::text(\"max_time\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_style\" name=\"max_lending_periods\" value=\"4\" /> <?php echo(Language::text(\"max_time_info\")); ?>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Deposition\"><?php echo(Language::text(\"deposition\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_style\" name=\"deposit\" value=\"\" /> kr\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Avgift\"><?php echo(Language::text(\"fee\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_style\" name=\"fee\" value=\"\" /> kr\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button_style\" name=\"create_lending_item\" value=\"<?php echo(Language::text(\"create\")); ?>\" />\n\t\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"itemRowSeparator\"></div>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<?php\n\t\t\tif($showSettings){\n\t\t\t\t?>\n\t\t\t\t<!-- Translations of category -->\n\t\t\t\t<div class=\"togglable catTranslation\">\n\t\t\t\t\t<p class=\"toggleButton\"><b><?php echo(Language::text(\"translate_category\")); ?> <b style=\"color:#ff6600\"><?php echo(Language::itemCategory($categoryID)); ?></b></b></p>\n\t\t\t\t\t<div class=\"toggleContent\">\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach (Language::getLanguages() as $language) { ?>\n\t\t\t\t\t\t<form action=\"item.php\" method=\"post\">\n\t\t\t\t\t\t\t<fieldset class=\"box\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$translation = ItemCategoryTranslation::getTranslation($categoryID, $language['id']);\n\t\t\t\t\t\t\t\tif ($translation) { ?>\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"item_category_translation_id\" value=\"<?php echo($translation['id']); ?>\" />\n\t\t\t\t\t\t\t\t\t<legend><?php echo(Language::text(\"edit_language\")); ?> <?php echo($language['name']); ?></legend>\n\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"name\")); ?>: <input type=\"text\" name=\"name\" value=\"<?php echo($translation['name']); ?>\" /><br />\n\t\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button_style\" name=\"update_item_category_translation\" value=\"<?php echo(Language::text(\"update\")); ?>\" />\n\t\t\t\t\t\t\t\t<?php } else { ?>\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"category_id\" value=\"<?php echo($categoryID); ?>\" />\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"language_id\" value=\"<?php echo($language['id']); ?>\" />\n\t\t\t\t\t\t\t\t\t<legend><?php echo(Language::text(\"add_translation\")); ?> <?php echo($language['name']); ?></legend>\n\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"name\")); ?>: <input type=\"text\" name=\"name\" value=\"\" /><br />\n\t\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button_style\" name=\"create_item_category_translation\" value=\"<?php echo(Language::text(\"create\")); ?>\" />\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<!-- Deletion of category -->\n\t\t\t\t<div class=\"catDeleteBtn\">\n\t\t\t\t\t<form class=\"catDelForm\" action=\"item.php\" method=\"post\">\n\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"lending_item_category_id\" value=\"<?php echo($categoryID); ?>\" />\n\t\t\t\t\t\t\t<input type=\"submit\" class=\"button_style\" name=\"delete_lending_item_category\" value=\"<?php echo(Language::text(\"remove_category\")); ?>\" />\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t\t<script>\n\t\t\t\t\t$('.catDelForm').submit(function() {\n\t\t\t\t\t return confirm(\"<?php echo(Language::text(\"confirm_cat_del\")); ?>\");\n\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\t\t$time_end = microtime(true);\n\t\t\t$time = $time_end - $time_start;\n\t\t}", "public function response_items()\n {\n return $this->hasMany(ResponseItem::class)->with('sub_category')->unDeleted()->orderBy('id', 'desc');\n }", "public function printList($xmlContainer, $item, $data){\n \t$xmlParser=new XMLParser();\n \t$page=$xmlParser->getXMLSchema($xmlContainer);\n \tif($tableXML=$xmlParser->getNode($page,'list', $item)){\n\t \t$tableXML=$xmlParser->getNode($page,'list', $item);\t\t\t\t\n\t \t$fieldsXML= $xmlParser->getNode($tableXML, 'fields', 0);\n\t \t\n\t \t$tdColor= \"\";\n\t \t$list= \"<table \".$xmlParser->getChildNodeAttribute($tableXML, 'tableList', 'attr').\">\\n\";\t\n\t\t \tforeach ($xmlParser->getChildNodes($fieldsXML) as $field){\n\t\t\t\t\tif($xmlParser->getChildNodeValue($field, 'fieldView')==1){\n\t\t\t\t\t\tif($xmlParser->getChildNodeValue($tableXML, 'alternativeColor')==1){\n\t\t\t\t\t\t\tif($tdColor==\"tbl_c1\"){ $tdColor= \"tbl_c2\"; }else{ $tdColor= \"tbl_c1\"; }\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$tdColor=\"internal\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tswitch ($xmlParser->getNodeAttribute($field, 'typeView')) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase \"img\":\n\t\t\t\t\t\t\t\t$pathImg= GENERAL_FILE_STORE.\"images/\".$data[$xmlParser->getNodeAttribute($field, 'dataName')];\n\t\t\t\t\t\t\t\tif(is_file($pathImg)){\t\t\n\t\t\t\t\t\t\t\t\t$list.= \"<tr>\";\n\t\t\t\t\t\t\t \t$list.= \"<td valign=\\\"center\\\" class=\\\"\".$tdColor.\"\\\" width=\\\"\".$xmlParser->getChildNodeValue($field, 'fieldTblWidth').\"\\\"><b>\".$xmlParser->getChildNodeValue($field, 'label').\"</b></td>\\n\";\n\t\t\t\t\t\t\t \t$list.=\"<td class=\\\"\".$tdColor.\"\\\"><img src=\\\"\".GENERAL_FILE_STORE_URL.\"images/\".$data[$xmlParser->getNodeAttribute($field, 'dataName')].\"\\\"></td>\";\n\t\t\t\t\t\t\t \t$list.= \"</tr>\\n\";\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$list.= \"<tr>\";\n\t\t\t\t\t\t\t \t$list.= \"<td valign=\\\"center\\\" class=\\\"\".$tdColor.\"\\\" width=\\\"\".$xmlParser->getChildNodeValue($field, 'fieldTblWidth').\"\\\"><b>\".$xmlParser->getChildNodeValue($field, 'label').\"</b></td>\\n\";\n\t\t\t\t\t\t\t \t$list.=\"<td class=\\\"\".$tdColor.\"\\\">[no image]</td>\";\n\t\t\t\t\t\t\t \t$list.= \"</tr>\\n\";\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase \"data\":\n\t\t\t\t\t\t\t\t$list.= \"<tr>\";\n\t\t\t\t\t\t \t$list.= \"<td valign=\\\"top\\\" class=\\\"\".$tdColor.\"\\\" width=\\\"\".$xmlParser->getChildNodeValue($field, 'fieldTblWidth').\"\\\"><b>\".$xmlParser->getChildNodeValue($field, 'label').\"</b></td>\\n\";\n\t\t\t\t\t\t \t$list.=\"<td class=\\\"\".$tdColor.\"\\\">\".UserInterface::getDate($data[$xmlParser->getNodeAttribute($field, 'dataName')], '-').\"</td>\";\n\t\t\t\t\t\t \t$list.= \"</tr>\\n\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase \"label\":\n\t\t\t\t\t\t\t\t$list.= \"<tr>\";\n\t\t\t\t\t\t \t$list.= \"<td colspan=\\\"2\\\" align=\\\"left\\\" valign=\\\"top\\\" class=\\\"\".$tdColor.\"\\\" width=\\\"\".$xmlParser->getChildNodeValue($field, 'fieldTblWidth').\"\\\"><b><u>\".$xmlParser->getChildNodeValue($field, 'label').\"</u></b></td>\\n\";\n\t\t\t\t\t\t \t$list.= \"</tr>\\n\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase \"hr\":\n\t\t\t\t\t\t\t\t$list.= \"<tr>\";\n\t\t\t\t\t\t \t$list.= \"<td colspan=\\\"2\\\" valign=\\\"top\\\" class=\\\"\".$tdColor.\"\\\" width=\\\"\".$xmlParser->getChildNodeValue($field, 'fieldTblWidth').\"\\\"><hr \".$xmlParser->getNodeAttribute($field, 'attr').\"></td>\\n\";\n\t\t\t\t\t\t \t$list.= \"</tr>\\n\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$list.= \"<tr>\";\n\t\t\t\t\t\t \t$list.= \"<td valign=\\\"top\\\" class=\\\"\".$tdColor.\"\\\" width=\\\"\".$xmlParser->getChildNodeValue($field, 'fieldTblWidth').\"\\\"><b>\".$xmlParser->getChildNodeValue($field, 'label').\"</b></td>\\n\";\n\t\t\t\t\t\t \t$list.=\"<td class=\\\"\".$tdColor.\"\\\">\".$data[$xmlParser->getNodeAttribute($field, 'dataName')].\"</td>\";\n\t\t\t\t\t\t \t$list.= \"</tr>\\n\";\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}\n\t \t$list.= \"</table>\"; \t\n\t \treturn $list;\n \t}else{\n \t\treturn \"\";\t\n \t}\n }", "public function prepare_item_for_response( $item, $request ) {\n $activities = get_post_meta($item->ID, 'activities');\n return [\n 'day' => $item,\n 'act' => array_map(function($act) {\n $act_obj = json_decode(html_entity_decode($act));\n $act_obj->img_url = get_the_post_thumbnail_url($act_obj->id, 'large');\n return $act_obj;\n }, $activities)\n ];\n }", "function displayItems(){\r\n\t\t\trequire \"connect.php\";\r\n\t\t\t$query = \"Select* from items\";\r\n\t\t \t$rows = $conn->query($query);\r\n\t\t \r\n\t\t\t\r\n global $itemsArray;\r\n \r\n $index = 0;\r\n\t\t\tforeach($rows as $row){\r\n\t\t\t\t$id = $row[\"id\"];\r\n\t\t\t\t$item_Name = $row[\"itemname\"];\r\n\t\t\t\t$item_Price = $row[\"itemprice\"];\r\n\t\t\t\t$image_URL = $row[\"imageurl\"];\r\n\t\t\t\t$isNew = $row[\"isNew\"];\r\n\t\t\t\t$catagory = \"Hardcoded catagory\";\r\n\t\t\t \r\n\t\t\t $item = new Item($id,$item_Name,$item_Price,$image_URL,$item_Price);\r\n\r\n \r\n\r\n\t\t\t ?>\r\n\t\t\t<div class=\"product-grid\">\t\t\t\t\t \r\n\t\t\t\t\t<div class=\"more-product-info\">\r\n\r\n\t\t\t\t\t \t<?php\r\n\t\t \t\t\t\t\tif($isNew ==1 ){\r\n\t\t\t \t\t\t\t\techo \"<span id ='isNew'>NEW</span>\";\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</div>\t\t\t\t\t\t\r\n\t\t\t\t\t<div class=\"product-img b-link-stripe b-animate-go thickbox\">\t\t\t\t\t\t \r\n\t\t\t\t\t\t<?php echo'<img src=\"'.$image_URL.'\" class=\"img-responsive\" alt=\"\"/>' ?>\r\n\t\t\t\t\t\t<div class=\"b-wrapper\">\r\n\t\t\t\t\t\t\t<h4 class=\"b-animate b-from-left b-delay03\">\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<button class=\"btns\">ORDER NOW</button>\r\n\t\t\t\t\t\t\t</h4>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\t\t\t\t\t\r\n\t\t\t\t\t<div class=\"product-info simpleCart_shelfItem\">\r\n\t\t\t\t\t\t<div class=\"product-info-cust\">\r\n\t\t\t\t\t\t\t<h4><?php echo $item->getItemName()?></h4>\r\n\t\t\t\t\t\t\t<span class=\"item_price\"><?php echo \"R\".$item->getPrice() ?></span>\r\n\t\t\t\t\t\t\t<input type=\"text\" class=\"item_quantity\" value=\"1\" />\r\n\t\t\t\t\t\t\t<a href = \"index.php?action=addItem&itemId=<?php echo\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$item->getItemId().\"&price=\".$item->getPrice() ?>\">\r\n\t\t\t\t\t\t\t\t<input type=\"button\" class=\"item_add\" value=\"ADD\">\r\n\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t<div class=\"clearfix\"> </div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\t\r\n\r\n\r\n\r\n\r\n <?php\r\n\r\n \t\t}\r\n\r\n\r\n\r\n\t}", "public function action_item_remove(Request $request, Response $response)\n\t{\n\t\t$values = $request->query();\n\n\t\t$restock = ORM::factory('Store_Restock', $values['restock_id']);\n\n\t\tif(!$restock->loaded())\n\t\t{\n\t\t\tRD::set(RD::ERROR, 'No restock record found.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$restock->delete();\n\t\t\tRD::set(RD::SUCCESS, 'Item successfully removed from the store\\'s stock');\n\t\t}\n\t}", "public function __itemTotals() {\n\n //$this->request->data['items'] = array_values($this->request->data['items']);\n\n $itemsCount = isset($this->request->data['items']) ? count($this->request->data['items']) : 0;\n\n// pr($this->request->data['Item']);\n// die('asdas');\n\n\n\n for ($i = 0; $i < $itemsCount; $i++) {\n\n\n\n\n\n\n\n $this->request->data['items'][$i]['total'] = $this->__lineItemTotal($this->request->data['items'][$i]['qty'], $this->request->data['items'][$i]['price'], $this->request->data['items'][$i]['rate']);\n\n\n\n // collect unit name from unit model\n\n $unit = $this->Papers->Items->Units->find()\n ->where(['id'=>$this->request->data['items'][$i]['unit_id']])\n ->select(['name'])\n ->first()\n ->toArray();\n\n $this->request->data['items'][$i]['name'] = $unit['name'];\n }\n }", "function wpbs_action_add_legend_item() {\n\n\t// Verify for nonce\n\tif( empty( $_POST['wpbs_token'] ) || ! wp_verify_nonce( $_POST['wpbs_token'], 'wpbs_add_legend_item' ) )\n\t\treturn;\n\n\t// Verify for the calendar id\n\tif( empty( $_GET['calendar_id'] ) ) {\n\n\t\twpbs_admin_notices()->register_notice( 'legend_item_calendar_id_missing', '<p>' . __( 'Something went wrong. Could not add the legend item.', 'wp-booking-system' ) . '</p>', 'error' );\n\t\twpbs_admin_notices()->display_notice( 'legend_item_calendar_id_missing' );\n\n\t\treturn;\n\n\t}\n\n\t// Verify for legend item name\n\tif( empty( $_POST['legend_item_name'] ) ) {\n\n\t\twpbs_admin_notices()->register_notice( 'legend_item_name_missing', '<p>' . __( 'Please add a name for your legend item.', 'wp-booking-system' ) . '</p>', 'error' );\n\t\twpbs_admin_notices()->display_notice( 'legend_item_name_missing' );\n\n\t\treturn;\n\n\t}\n\n\t// Verify for legend item type\n\tif( empty( $_POST['legend_item_type'] ) ) {\n\n\t\twpbs_admin_notices()->register_notice( 'legend_item_type_missing', '<p>' . __( 'Please select a type for your legend item.', 'wp-booking-system' ) . '</p>', 'error' );\n\t\twpbs_admin_notices()->display_notice( 'legend_item_type_missing' );\n\n\t\treturn;\n\n\t}\n\n\t// Remove empty values from the colors array\n\tif( isset( $_POST['legend_item_color'] ) && is_array( $_POST['legend_item_color'] ) )\n\t\t$_POST['legend_item_color'] = array_filter( $_POST['legend_item_color'] );\n\n\t// Verify for legend item type\n\tif( empty( $_POST['legend_item_color'] ) || ( $_POST['legend_item_type'] != 'single' && count( $_POST['legend_item_color'] ) <= 1 ) ) {\n\n\t\twpbs_admin_notices()->register_notice( 'legend_item_color_missing', '<p>' . __( 'Please select the color for your legend item.', 'wp-booking-system' ) . '</p>', 'error' );\n\t\twpbs_admin_notices()->display_notice( 'legend_item_color_missing' );\n\n\t\treturn;\n\n\t}\n\n\t// Get legend items to see if there are any added, if not we set this one to be the default one\n\t$legend_items = wpbs_get_legend_items( array( 'calendar_id' => absint( $_GET['calendar_id'] ), 'number' => 1 ) );\n\n\t// Prepare legend item data to be inserted into the database\n\t$legend_item_data = array(\n\t\t'name' \t => sanitize_text_field( $_POST['legend_item_name'] ),\n\t\t'type' \t => sanitize_text_field( $_POST['legend_item_type'] ),\n\t\t'color' \t => $_POST['legend_item_color'],\n\t\t'color_text' => ( ! empty( $_POST['legend_item_color_text'] ) ? sanitize_text_field( $_POST['legend_item_color_text'] ) : '' ),\n\t\t'is_visible' => 1,\n\t\t'is_bookable' => 1,\n\t\t'is_default' => ( empty( $legend_items ) ? 1 : 0 ),\n\t\t'calendar_id' => absint( $_GET['calendar_id'] )\n\t);\n\n\n\t// Insert the legend item\n\t$inserted = wpbs_insert_legend_item( $legend_item_data );\n\n\t// If the legend item could not be inserted show a message to the user\n\tif( ! $inserted ) {\n\n\t\twpbs_admin_notices()->register_notice( 'legend_item_insert_fail', '<p>' . __( 'Something went wrong. Could not add the legend item. Please try again.', 'wp-booking-system' ) . '</p>', 'error' );\n\t\twpbs_admin_notices()->display_notice( 'legend_item_insert_fail' );\n\n\t\treturn;\n\n\t}\n\n\t/**\n\t * Handle translations\n\t *\n\t */\n\t$settings \t\t = get_option( 'wpbs_settings', array() );\n\t$active_languages = ( ! empty( $settings['active_languages'] ) ? $settings['active_languages'] : array() );\n\n\tforeach( $active_languages as $code ) {\n\n\t\t// Add translation\n\t\tif( ! empty( $_POST['legend_item_translation_' . $code] ) )\n\t\t\twpbs_add_legend_item_meta( $inserted, 'translation_' . $code, sanitize_text_field( $_POST['legend_item_translation_' . $code] ) );\n\n\t}\n\n\t// Redirect to the edit page of the calendar with a success message\n\twp_redirect( add_query_arg( array( 'page' => 'wpbs-calendars', 'subpage' => 'view-legend', 'calendar_id' => absint( $_GET['calendar_id'] ), 'wpbs_message' => 'legend_item_insert_success' ), admin_url( 'admin.php' ) ) );\n\texit;\n\n}", "public function prepare_items()\r\n\t{\r\n\t\t$columns = $this->get_columns();\r\n\t\t$hidden = $this->get_hidden_columns();\r\n\t\t$sortable = $this->get_sortable_columns();\r\n\r\n\t\t$currentPage = $this->get_pagenum();\r\n\r\n\t\t$this->total = Lead::count();\r\n\t\t$data = Lead::take( $this->per_page )->skip( ( $currentPage - 1 ) * $this->per_page )\r\n\t\t ->get()->toArray();\r\n\r\n\t\t$this->set_pagination_args( [\r\n\t\t\t'total_items' => $this->total,\r\n\t\t\t'per_page' => $this->per_page\r\n\t\t] );\r\n\r\n\t\t$this->_column_headers = [ $columns, $hidden, $sortable ];\r\n\r\n\t\t$this->items = $data;\r\n\t}", "function addItem($itemKey){\n\t\t\t//if the item already exsists in the cart, add one.\n\t\t\tif(isset($this->items[$itemKey])){\n\t\t\t\t$this->items[$itemKey]['quantity'] = $this->items[$itemKey]['quantity'] + 1; \n\t\t\t}\n\t\t\t\n\t\t\t//if the item is not already set in the cart.\n\t\t\t//Find the correct price off the item from the server side $products\n\t\t\t//note - I am looking up the prices server-side to protect from customers entering in their own prices in the html\n\t\t\telse{\n\t\t\t\t//find the corresponding product based on the product name (keys would be preferable)\n\t\t\t\tforeach($GLOBALS['products'] as $product){\t\t\n\t\t\t\t\tif($itemKey == $product['name']){\n\t\t\t\t\t\t//set the item price server-side\n\t\t\t\t\t\t$itemPrice = $product['price'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//if there is a valid product with that name (key) and therefore has a corresponding price.\n\t\t\t\t//add it to the cart otherwise ignore it\n\t\t\t\t//note - This protects the server from having items in the shopping cart that don't exsist server side. \n\t\t\t\tif(isset($itemPrice)){\n\t\t\t\t\t$this->items[$itemKey] = array( \"name\" => $itemKey, \"price\" => $itemPrice , \"quantity\" => 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\t\t\n\t\t\treturn;\n\t\t}", "public function build_product_data( $item=array(), $old_item=array() ) {\n\n // summarize product details\n $retProd = array(\n 'ASIN' => isset($item['ASIN']) ? $item['ASIN'] : '',\n 'ParentASIN' => isset($item['ParentASIN']) ? $item['ParentASIN'] : '',\n \n 'ItemAttributes' => isset($item['ItemAttributes']) ? $item['ItemAttributes'] : array(),\n 'Title' => isset($item['ItemAttributes']['Title']) ? stripslashes($item['ItemAttributes']['Title']) : '',\n 'SKU' => isset($item['ItemAttributes']['SKU']) ? $item['ItemAttributes']['SKU'] : '',\n 'Feature' => isset($item['ItemAttributes']['Feature']) ? $item['ItemAttributes']['Feature'] : '',\n 'Brand' => isset($item['ItemAttributes']['Brand']) ? $item['ItemAttributes']['Brand'] : '',\n 'Binding' => isset($item['ItemAttributes']['Binding']) ? $item['ItemAttributes']['Binding'] : '',\n //'ListPrice' => isset($item['ItemAttributes']['ListPrice']['FormattedPrice']) ? $item['ItemAttributes']['ListPrice']['FormattedPrice'] : '',\n \n 'Variations' => isset($item['Variations']) ? $item['Variations'] : array(),\n 'VariationSummary' => isset($item['VariationSummary']) ? $item['VariationSummary'] : array(),\n 'BrowseNodes' => isset($item['BrowseNodes']) ? $item['BrowseNodes'] : array(),\n 'DetailPageURL' => isset($item['DetailPageURL']) ? $item['DetailPageURL'] : '',\n 'SalesRank' => isset($item['SalesRank']) ? $item['SalesRank'] : 999999,\n\n 'SmallImage' => isset($item['SmallImage']['URL']) ? trim( $item['SmallImage']['URL'] ) : '',\n 'LargeImage' => isset($item['LargeImage']['URL']) ? trim( $item['LargeImage']['URL'] ) : '',\n\n 'Offers' => isset($item['Offers']) ? $item['Offers'] : '',\n 'OfferSummary' => isset($item['OfferSummary']) ? $item['OfferSummary'] : '',\n 'EditorialReviews' => isset($item['EditorialReviews']['EditorialReview']['Content'])\n ? $item['EditorialReviews']['EditorialReview']['Content'] : '',\n \n\t\t\t\t'hasGallery'\t\t\t=> 'false',\n );\n\t\t\t\n\t\t\t// try to rebuid the description if is empty\n\t\t\tif( trim($retProd[\"EditorialReviews\"]) == \"\" ){\n\t\t\t\tif( isset($item['EditorialReviews']['EditorialReview']) && count($item['EditorialReviews']['EditorialReview']) > 0 ){\n\t\t\t\t\t\n\t\t\t\t\t$new_description = array();\n\t\t\t\t\tforeach ($item['EditorialReviews']['EditorialReview'] as $desc) {\n\t\t\t\t\t\tif( isset($desc['Content']) && isset($desc['Source']) ){\n\t\t\t\t\t\t\t//$new_description[] = '<h3>' . ( $desc['Source'] ) . ':</h3>';\n\t\t\t\t\t\t\t$new_description[] = $desc['Content'] . '<br />';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( isset($new_description) && count($new_description) > 0 ){\n\t\t\t\t\t$retProd[\"EditorialReviews\"] = implode( \"\\n\", $new_description );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n // CustomerReviews url\n if ( isset($item['CustomerReviews'], $item['CustomerReviews']['HasReviews'])\n && $item['CustomerReviews']['HasReviews'] ) {\n $retProd['CustomerReviewsURL'] = $item['CustomerReviews']['IFrameURL'];\n }\n\n // Images\n $retProd['images'] = $this->build_images_data( $item );\n if ( empty($retProd['images']['large']) ) {\n // no images found - if has variations, try to find first image from variations\n $retProd['images'] = $this->get_first_variation_image( $item );\n }\n \n if ( empty($retProd['SmallImage']) ) {\n if ( isset($retProd['images']['small']) && !empty($retProd['images']['small']) ) {\n $retProd['SmallImage'] = $retProd['images']['small'][0];\n }\n }\n if ( empty($retProd['LargeImage']) ) {\n if ( isset($retProd['images']['large']) && !empty($retProd['images']['large']) ) {\n $retProd['LargeImage'] = $retProd['images']['large'][0];\n }\n }\n\n\t\t\t// has gallery: get gallery images\n\t\t\tif ( isset($item['ImageSets']) && count($item['ImageSets']) > 0 ) {\n\t\t\t\tforeach ( $item['ImageSets'][\"ImageSet\"] as $key => $value ) {\n\t\t\t\t\tif ( isset($value['LargeImage']['URL']) ) {\n\t\t\t\t\t\t$retProd['hasGallery'] = 'true';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n return $retProd;\n }", "function ItemLookup($asin) {\n //Define the request\n//$request = \"http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=\".Access_Key_ID.\"&AssociateTag=\".Associate_tag.\"&Signature=\".Signature.\"&Timestamp=\".Timestamp.\"&Version=2009-03-31&Operation=ItemLookup&ItemId=$asin&ResponseGroup=Medium,Offers\";\n\n //$request = \"http://ecs.amazonaws.com/onca/xml?AWSAccessKeyId=AKIAJVJTIWZXTELKIJGQ&Keywords=harry%20potter&Operation=ItemSearch&SearchIndex=Books&Service=AWSECommerceService&Timestamp=2011-07-31T00%3A54%3A25.000Z&Version=2009-03-31&Signature=Bj1Snowi5S3ePnmChop3OsUZumzm62xcAkL3fHGnocc%3D\";\n\n\n /*$canonicalQuery = \"http://ecs.amazonaws.com/onca/xml?AWSAccessKeyId=\" . Access_Key_ID .\n \"&Keywords=harry%20potter\" .\n \"&Operation=ItemSearch\" .\n \"&SearchIndex=Books\" .\n \"&Service=AWSECommerceService\" .\n \"&Version=2009-03-31\";*/\n\n $canonicalQuery = \"http://ecs.amazonaws.com/onca/xml?AWSAccessKeyId=\" . Access_Key_ID .\n \"&ItemId=\" . $asin .\n \"&Operation=ItemLookup\" .\n \"&ResponseGroup=Images,ItemAttributes\" .\n \"&Service=AWSECommerceService\" .\n \"&Version=2009-03-31\";\n\n $url = signAmazonUrl($canonicalQuery, Secret_Access_Key);\n\n$session = curl_init($url);\n\tcurl_setopt($session, CURLOPT_HEADER, false);\n\tcurl_setopt($session, CURLOPT_RETURNTRANSFER, true);\n\t$response = curl_exec($session);\n\tcurl_close($session);\n\t//$response = file_get_contents($request);\n\t//$parsed_xml = simplexml_load_string($response);\n\n\theader(\"Content-Type:text/xml\");\n echo $response;\n}", "public static function createEmpty(): ResponseItem\n {\n return new static(new \\stdClass());\n }", "public function prepare_items() {\n\t\t$per_page = $this->get_items_per_page( 'cert_dashboards_per_page', 1 );\n\t\t$this->items = self::get_cert_dashboards( $per_page );\n\t}", "function prepare_items( $items = false ) {\n \n // process bulk actions\n $this->process_bulk_action();\n \n // get pagination state\n $current_page = $this->get_pagenum();\n $per_page = $this->get_items_per_page('listings_per_page', 20);\n \n // define columns\n $this->_column_headers = $this->get_column_info();\n \n // fetch listings from model - if no parameter passed\n if ( ! $items ) {\n\n $listingsModel = new WPLA_ListingsModel();\n $this->items = $listingsModel->getPageItems( $current_page, $per_page );\n $this->total_items = $listingsModel->total_items;\n\n } else {\n\n $this->items = $items;\n $this->total_items = count($items);\n\n }\n\n // register our pagination options & calculations.\n $this->set_pagination_args( array(\n 'total_items' => $this->total_items,\n 'per_page' => $per_page,\n 'total_pages' => ceil($this->total_items/$per_page)\n ) );\n\n }", "public function add_all_session($session_items)\n\t\t{\n\t\t\tparent::add_all_items($session_items,'session_items');\n\t\t}", "public function addToBookResponseLeg(\\Fincallorca\\HitchHikerApi\\Wsdl\\v3_1_388_1\\StructType\\BookResponseLeg $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\Fincallorca\\HitchHikerApi\\Wsdl\\v3_1_388_1\\StructType\\BookResponseLeg) {\n throw new \\InvalidArgumentException(sprintf('The BookResponseLeg property can only contain items of \\Fincallorca\\HitchHikerApi\\Wsdl\\v3_1_388_1\\StructType\\BookResponseLeg, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->BookResponseLeg[] = $item;\n return $this;\n }", "public function get_all_items_by_api()\n {\n\n $data = array('token' =>'ayaolwan');//'type' => 'fees_category');\n $data_string = json_encode($data);\n $curl = curl_init(base_url() . 'webServices/Itemapi');\n\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"GET\");\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($data_string))\n );\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);\n\n $result = json_decode(curl_exec($curl), true);\n curl_close($curl);\n\n if ($result['status'])\n {\n echo json_encode($result['itemsList']);\n }\n\n\n }", "public function toArray($request)\n {\n // return parent::toArray($request);\n return [\n 'type' => 'carts',\n 'id' => (string)$this->id,\n 'is_checkedout' => $this->is_checkedout,\n 'attributes' => [\n 'item_id' => (string)$this->item_id,\n 'item_slug' => $this->item->slug,\n 'item_name' => $this->item->name,\n 'item_images' => $this->item->images->pluck('thumbnail'),\n 'item_qty' => $this->item->qty,\n 'item_srp' => number_format($this->item->srp, 2),\n 'item_discountedSrp' => number_format($this->item->accuratePrice(), 2),\n 'discountType' => $this->item->discountType(),\n 'cart_qty' => $this->qty,\n 'validQty' => $this->validMaxQty(),\n 'subtotal_per_item' => $this->cartTotal(),\n 'date_placed' => $this->created_at->toDayDateTimeString(),\n 'status' => $this->status,\n 'cancellable' => $this->cancellable(),\n 'returnable' => $this->returnable(),\n 'services' => $this->getServiceDetails(),\n 'subtotal_with_service_total' => $this->getSubtotalWithServiceTotal(),\n 'checkedout_subtotal' => number_format($this->checkedoutSubTotal(),2)\n ],\n 'item' => new ItemResource($this->item)\n ];\n }", "function items() {\n\t\n if(isset($_GET['add_cart'])){\n\t\n\t global $db;\n\t \n\t $ip_add = getRealIpAddr();\n\t \n\t $get_items = \"SELECT * FROM cart WHERE ip_add = '$ip_add' \";\n\t \n\t $run_items = mysqli_query($db,$get_items);\n\n\t $count_items = mysqli_num_rows($run_items); /* Counting how many items user has added to cart*/\n\t }\t\n\t\n\telse \n\t{\n\t global $db;\n\t \n $ip_add = getRealIpAddr();\n\t \n\t $get_items = \"SELECT * FROM cart WHERE ip_add = '$ip_add' \";\n\t \n\t $run_items = mysqli_query($db,$get_items);\n\n\t $count_items = mysqli_num_rows($run_items); \t \n\t\t\n\t\t\n\t}\n\n\t echo $count_items;\n\t}", "public function testAddItemsFailed()\n {\n $addItems = [];\n $addItems[] = [\n 'sku' => 'dummy'\n ];\n $failedItems[] = [\n 'item' => [\n 'sku' => 'dummy'\n ]\n ];\n $quote = $this->getMockBuilder(\\Magento\\Quote\\Model\\Quote::class)\n ->disableOriginalConstructor()\n ->getMock();\n $this->cartFactory->expects($this->once())->method('create')->willReturn($this->cartMock);\n $this->cartMock->expects($this->once())->method('setQuote')->with($quote)->willReturnSelf();\n $this->cartMock->expects($this->once())\n ->method('setContext')\n ->with(\\Magento\\AdvancedCheckout\\Model\\Cart::CONTEXT_ADMIN_CHECKOUT)\n ->willReturnSelf();\n $this->cartMock->expects($this->once())->method('getFailedItems')->willReturn($failedItems);\n $this->cartMock->expects($this->once())->method('prepareAddProductsBySku')->with($addItems)->willReturnSelf();\n $this->cartMock->expects($this->once())\n ->method('saveAffectedProducts')\n ->with($this->cartMock, false)\n ->willReturnSelf();\n\n $this->assertFalse($this->cart->addItems($quote, $addItems));\n }", "function makeNewResponseArray($response, $oldResponse){\n\t\t$newResponse = $oldResponse;\n\t\tforeach($response as $responseAttribute => $value){\n\t\t\tif($value != null){\n\t\t\t\t$newResponse[$responseAttribute] = $value;\n\t\t\t}\n\t\t}\n\t\treturn $newResponse;\n\t}", "function prepare_items() {\n\t\t$columns = $this->get_columns();\n\t\t$hidden = array();\n\t\t$sortable = $this->get_sortable_columns();\n\t\t$this->_column_headers = array( $columns, $hidden, $sortable );\n\n\t\t$ubc_di_sites = $this->ubc_di_get_assessment_results();\n\n\t\tusort( $ubc_di_sites, array( &$this, 'usort_reorder' ) );\n\n\t\t$per_page = 50;\n\t\t$current_page = $this->get_pagenum();\n\t\t$total_items = count( $ubc_di_sites );\n\t\t// only ncessary because we have sample data\n\t\t$ubc_di_sites_subset = array_slice( $ubc_di_sites, ( ( $current_page - 1 ) * $per_page ), $per_page );\n\t\t$this->set_pagination_args( array(\n\t\t\t'total_items' => $total_items, //WE have to calculate the total number of items\n\t\t\t'per_page' => $per_page, //WE have to determine how many items to show on a page\n\t\t) );\n\t\t$this->items = $ubc_di_sites_subset;\n\t}", "public function addItem(SagepayItem $item)\r\n {\r\n $this->_items[] = $item;\r\n }", "public function appendItem($item): CollectionInterface;", "public function action_item_save(Request $request, Response $response)\n\t{\n\t\t$values = $request->post();\n\n\t\tif(isset($values['store_id']))\n\t\t{\n\t\t\t$store = ORM::factory('Store', $values['store_id']);\n\t\t}\n\t\telse if(isset($values['store_name']))\n\t\t{\n\t\t\t$store = ORM::factory('Store')\n\t\t\t\t->where('title', '=', $values['store_name'])\n\t\t\t\t->find();\n\t\t}\n\n\n\t\tif(!$store->loaded())\n\t\t{\n\t\t\tRD::set(RD::ERROR, 'No store found to add this item to.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$item = ORM::factory('Item')\n\t\t\t\t->where('item.name', '=', $values['item_name'])\n\t\t\t\t->find();\n\n\t\t\tif(!$item->loaded())\n\t\t\t{\n\t\t\t\tRD::set(RD::ERROR, 'No item found by the name of \"'.$values['item_name'].'\".');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry {\n\t\t\t\t\t$values['store_id'] = $store->id;\n\t\t\t\t\t$values['item_id'] = $item->id;\n\n\t\t\t\t\tif($values['id'] == '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$restock = ORM::factory('Store_Restock')\n\t\t\t\t\t\t\t->values($values, ['item_id', 'store_id', 'min_price', 'max_price', 'min_amount', 'max_amount', 'cap_amount', 'frequency'])\n\t\t\t\t\t\t\t->save();\n\n\t\t\t\t\t\tRD::set(RD::SUCCESS, $item->name.' has been added to the \"'.$store->title.'\" store\\'s stock.', null, array_merge($restock->as_array(), ['item_name' => $item->name]));\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$restock = ORM::factory('Store_Restock', $values['id'])\n\t\t\t\t\t\t\t->values($values, ['item_id', 'store_id', 'min_price', 'max_price', 'min_amount', 'max_amount', 'cap_amount', 'frequency'])\n\t\t\t\t\t\t\t->save();\n\n\t\t\t\t\t\tRD::set(RD::SUCCESS, $item->name.' has been added updated.', null, array_merge($restock->as_array(), ['item_name' => $item->name]));\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tcatch(ORM_Validation_Exception $e)\n\t\t\t\t{\n\t\t\t\t\tRD::set(RD::ERROR, 'Problem validating form', null, array('errors' => $e->errors('orm'), 'submit_data' => $values));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.62544614", "0.59904194", "0.5827661", "0.535107", "0.52057153", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51253796", "0.5088436", "0.48187885", "0.4642476", "0.46069697", "0.45879203", "0.457954", "0.45766908", "0.45450824", "0.45402575", "0.45389205", "0.45319024", "0.45218664", "0.45204246", "0.44880572", "0.44853526", "0.4478831", "0.44427407", "0.44183907", "0.44153824", "0.4366689", "0.4363251", "0.43448573", "0.4330811", "0.4327533", "0.43220305", "0.43083593", "0.43006665", "0.42973807", "0.42864257", "0.42841005", "0.42761812", "0.4264058", "0.4263212", "0.42376062", "0.42237666", "0.4223175", "0.4218237", "0.4202604", "0.4196452", "0.41664404", "0.41299486", "0.41189477", "0.41175774", "0.41172743", "0.410039", "0.40856028", "0.40850574", "0.40711161", "0.4070995", "0.40699497", "0.40664887", "0.40647903", "0.40622428", "0.40609068", "0.40604523", "0.40597042", "0.40531138", "0.40524873", "0.40518326", "0.40502435", "0.4045887", "0.40298253", "0.40184233", "0.40070865", "0.40040255", "0.3994941", "0.39921352", "0.39888376", "0.3981851", "0.39794388", "0.39769438", "0.39751196", "0.3972966", "0.39711973" ]
0.50198215
27
Gets as addItemResponseContainer One AddItemResponseContainer container is returned for each listing that was created with the AddItems call. Each container includes the ItemID of each newly created listings, the eBay category each item is listed under, the sellerdefined SKUs of the items (if any), the listing recommendations for each item (if applicable), the start and end time of each listing, and the estimated fees that each listing will incur.
public function getAddItemResponseContainer() { return $this->addItemResponseContainer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addToAddItemResponseContainer(\\Nogrod\\eBaySDK\\Trading\\AddItemResponseContainerType $addItemResponseContainer)\n {\n $this->addItemResponseContainer[] = $addItemResponseContainer;\n return $this;\n }", "public function setAddItemResponseContainer(array $addItemResponseContainer)\n {\n $this->addItemResponseContainer = $addItemResponseContainer;\n return $this;\n }", "protected function addItems()\n {\n $origin = 'stock';\n $code = 'cataloginventory';\n $message = Data::ERROR_QTY;\n $additionalData = null;\n $mockItems = [];\n\n for ($i = 0; $i < 2; $i++) {\n $mockItems[] = [\n 'origin' => $origin . $i,\n 'code' => $code,\n 'message' => $message . $i,\n 'additionalData' => $additionalData,\n ];\n $this->listStatus->addItem($origin . $i, $code, $message . $i, $additionalData);\n }\n return $mockItems;\n }", "public function add_item()\n {\n $request = new Types\\AddItemRequestType();\n\n // An user token is required when using the Trading service.\n $request->RequesterCredentials = new Types\\CustomSecurityHeaderType();\n $request->RequesterCredentials->eBayAuthToken = $this->config->item('authToken');\n\n\n // Begin creating the auction item.\n $item = new Types\\ItemType();\n\n $item->DispatchTimeMax = 3;\n /**\n * We want a single quantity auction.\n * Otherwise known as a Chinese auction.\n */\n $item->ListingType = Enums\\ListingTypeCodeType::C_CHINESE;\n $item->Quantity = 1;\n\n $item->ProductListingDetails = new Types\\ProductListingDetailsType();\n $item->ProductListingDetails->ISBN = $ISBN;\n $item->ProductListingDetails->UPC = $UPC;\n $item->ProductListingDetails->EAN = $EAN;\n\n $item->ProductListingDetails->BrandMPN = new DTS\\eBaySDK\\Trading\\Types\\BrandMPNType();\n $item->ProductListingDetails->BrandMPN->Brand = '';\n $item->ProductListingDetails->BrandMPN->MPN = '';\n\n $item->ListingDuration = Enums\\ListingDurationCodeType::C_DAYS_7;\n\n }", "public function Add()\n {\n if (isset($this->properties['ItemId']) && !is_null($this->properties['ItemId'])) {\n \tthrow new Services_Ebay_Exception('This item already has an ItemId and thus cannot be added.');\n }\n $call = Services_Ebay::loadAPICall('AddItem', array($this));\n \n return $call->call($this->session);\n }", "public static function items() {\r\n $doc = new DOMDocument ('1.0', 'UTF-8');\r\n $items_node = $doc->createElement(\"items\");\r\n $doc->appendChild($items_node);\r\n\r\n return new amvonetroom_XmlResponse($items_node);\r\n }", "public function prepare_item_for_response($item, $request)\n {\n return array();\n }", "public function additem()\r\n {\r\n $shipping = array( 'ShippingServiceOptions' => array(\r\n\r\n 'ShippingService' => 'UPSGround',\r\n 'ShippingServiceCost' => 0.0,\r\n 'ShippingServiceAdditionalCost' => 0.0,\r\n 'ShippingServicePriority' => 1,\r\n 'ExpeditedService' => false,\r\n\r\n\r\n ),\r\n 'ShippingType' => 'Flat',\r\n );\r\n\r\n $returnPolicy = array(\r\n 'ReturnsAcceptedOption' => 'ReturnsAccepted',\r\n 'RefundOption' => 'MoneyBack',\r\n 'ReturnsWithinOption' => 'Days_30',\r\n 'Description ' =>'If you are not satisfied, return the item for refund.',\r\n 'ShippingCostPaidByOption' => 'Buyer',\r\n );\r\n\r\n $item = array(\r\n 'PrimaryCategory' => array('CategoryID' => 111422), // ok\r\n 'Title' => 'Miechu nowy',\r\n 'Description' => 'Testowy opis',\r\n 'StartPrice' => 100, //\r\n 'BuyItNowPrice' => 500,//\r\n 'ReservePrice' => 400,//\r\n 'Country' => 'US',//\r\n 'Currency' => 'USD',//\r\n 'ListingDuration' => 'Days_7',//\r\n 'PictureDetails' => 'dummy',//\r\n 'Site' => 'US',//\r\n 'Location' => 'San Jose',//\r\n 'PaymentMethods' => 'PayPal',//\r\n 'PayPalEmailAddress' => '[email protected]',//\r\n 'ShippingDetails' => $shipping,//\r\n 'DispatchTimeMax' => 3,//\r\n 'ConditionID' => 1000,//\r\n 'ReturnPolicy' => $returnPolicy,//\r\n\r\n );\r\n\r\n $params = array(\r\n 'Version' => 831,\r\n 'Item' => $item\r\n\r\n\r\n\r\n\r\n\r\n );\r\n $method = 'addItem';\r\n\r\n try{\r\n\r\n $resp = debay::sendRequest($method,$params);\r\n\r\n $this->load->model('ebay/debay');\r\n\r\n\r\n }\r\n catch(Exception $e)\r\n {\r\n echo $e->getMessage();\r\n }\r\n }", "public function prepare_item_for_response( $item, $request ) {\n return array();\n }", "public function addItems(){\n $this->validate($this->request, [\n 'title' => 'required|max:255',\n 'description' => 'string|max:255',\n 'isbn' => 'string',\n 'authorId' => 'required|integer|min:1',\n 'itemTypeId' => 'required|integer|min:1',\n 'categoryId' => 'required|integer|min:1',\n 'numberInStock' => 'required|integer|min:1',\n 'itemCondition' => 'required',\n 'itemStateId' => 'required|integer|min:1',\n ]);\n $items = array(\n 'title' => $this->request->input('title'),\n 'description' => $this->request->input('description'),\n 'isbn' => $this->request->input('isbn'),\n 'authorId' => $this->request->input( 'authorId'),\n 'catId' => $this->request->input('categoryId'),\n 'numOfItems' => $this->request->input('numberInStock'),\n 'itemCondition' => $this->request->input('itemCondition'),\n 'itemStateId' => $this->request->input('itemStateId'),\n 'itemTypeId' => $this->request->input('itemTypeId'),\n );\n\n try{\n $item = new ItemService();\n $result = $item->createNewItem($items);\n\n if ($result) {\n return response()->json([\n 'success' => true,\n 'data' => [\n 'itemId' => $result,\n ],\n 'message' => 'Item Added Successfully',\n ], 201);\n }\n return response()->json([\n 'success' => false,\n 'message' => 'item could not be added'\n ], 400);\n\n }catch(Exception $ex){\n return response()->json([\n 'success' => false,\n 'message' => 'Error Occured Adding Items. Ensure the IDs are Valid'\n ], 400);\n }\n }", "public function getItems()\n {\n $items = Item::all();\n return response($items, 200);\n }", "public function addItem(Collection $collection, ItemCreateStruct $itemCreateStruct): Item;", "function appendItemMetadataList(&$item) {\n $mda = array();\n\n // Static metadata\n $mda = $this->getHardCodedMetadataList(true);\n foreach($mda as $md) {\n $md->setValue($item->getHardCodedMetadataValue($md->getLabel()));\n $item->addMetadata($md);\n unset($md);\n }\n \n // Dynamic metadata\n $mdIter = $this->getRealMetadataIterator(true);\n $mdIter->rewind();\n while($mdIter->valid()) {\n $md = $mdIter->current();\n $this->addMetadataValueToItem($item, $md);\n $mdIter->next();\n }\n }", "public static function endEbayListing($items)\n\t{\n\t\t$results = array();\n\t\ttry {\n\t\t\t$endListingResultXML = ISC_ADMIN_EBAY_OPERATIONS::endItems($items);\n\t\t\tforeach ($endListingResultXML->EndItemResponseContainer as $item) {\n\t\t\t\t$results[] = new ISC_ADMIN_EBAY_END_ITEM_RESULT($item);\n\t\t\t}\n\t\t\treturn $results;\n\t\t} catch (ISC_EBAY_API_REQUEST_EXCEPTION $e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public function rebuildItems() {\n\t\t##\n\t\t##\tRETURNS\n\t\t##\t\tThe last modified timestamp\n\t\t$lastModified = time();\n\t\t$addedIDs = array();\n\t\t$totalPages = $this->getTotalPages();\n\t\tif($totalPages) {\n\t\t\tfor($i=1;$i<=$totalPages;$i++) {\n\t\t\t\t$items = $this->getItems($i);\n\t\t\t\tif($items && count($items)) {\n\t\t\t\t\tforeach($items as $item) {\n\t\t\t\t\t\t$campaign_id = '';\n\t\t\t\t\t\tif(isset($item->offer_url)) {\n\t\t\t\t\t\t\t$parts = parse_url($item->offer_url);\n\t\t\t\t\t\t\t$query = array();\n\t\t\t\t\t\t\tparse_str($parts['query'],$query);\n\t\t\t\t\t\t\t$campaign_id = $query['cId'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t'id' => $item->id,\n\t\t\t\t\t\t\t'campaign_id' => $campaign_id,\n\t\t\t\t\t\t\t'artist_id' => $item->artist_id,\n\t\t\t\t\t\t\t'reporting_name' => $item->reporting_name,\n\t\t\t\t\t\t\t'embed_code' => $item->embed_code,\n\t\t\t\t\t\t\t'width' => $item->width,\n\t\t\t\t\t\t\t'height' => $item->height,\n\t\t\t\t\t\t\t'url' => $item->url,\n\t\t\t\t\t\t\t'poster_image' => $item->poster_image,\n\t\t\t\t\t\t\t'poster_image_source' => (isset($item->poster_image_source)) ? $item->poster_image_source : '',\n\t\t\t\t\t\t\t'product_type' => $item->product_type,\n\t\t\t\t\t\t\t'offer_type' => $item->offer_type,\n\t\t\t\t\t\t\t'description' => $item->description,\n\t\t\t\t\t\t\t'currency' => $item->currency,\n\t\t\t\t\t\t\t'price' => $item->price,\n\t\t\t\t\t\t\t'name' => $item->name,\n\t\t\t\t\t\t\t'campaign' => serialize($item->campaign),\n\t\t\t\t\t\t\t'offer_url' => (isset($item->offer_url)) ? $item->offer_url : '',\n\t\t\t\t\t\t\t'mobile_url' => (isset($item->mobile_url)) ? $item->mobile_url : '',\n\t\t\t\t\t\t\t'last_modified' => date('Y-m-d H:i:s',$lastModified)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$format = array('%d','%d','%d','%s','%s','%d','%d','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s');\n\t\n\t\t\t\t\t\t## Get Keys\n\t\t\t\t\t\t$tableFields = implode(',',array_keys($data));\n\t\t\t\t\t\t$tableFormat = implode(',',$format);\n\t\t\t\t\t\t$onDuplicateKeyUpdate = '';\n\t\t\t\t\t\t$keyIndex = 0;\n\t\t\t\t\t\tforeach($data as $key=>$field) {\n\t\t\t\t\t\t\tif($keyIndex>0) { $onDuplicateKeyUpdate .= ', '; }\n\t\t\t\t\t\t\t$onDuplicateKeyUpdate .= $key.'=VALUES('.$key.')';\n\t\t\t\t\t\t\t$keyIndex++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t## Add item\n\t\t\t\t\t\t$sql = <<<EOD\n\t\t\t\t\t\tINSERT INTO {$this->wpdb->prefix}topspin_items ({$tableFields}) VALUES ({$tableFormat})\n\t\t\t\t\t\tON DUPLICATE KEY UPDATE {$onDuplicateKeyUpdate}\nEOD;\n\t\t\t\t\t\t$this->wpdb->query($this->wpdb->prepare($sql,$data));\n\t\n\t\t\t\t\t\t##\tDeletes old item tags\n\t\t\t\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items_tags WHERE item_id = %d';\n\t\t\t\t\t\t$this->wpdb->query($this->wpdb->prepare($sql,array($item->id)));\n\t\t\t\t\t\t##\tAdds new item tag\n\t\t\t\t\t\tif(isset($item->tags) && is_array($item->tags)) {\n\t\t\t\t\t\t\t$tagFormat = array('%d','%s');\n\t\t\t\t\t\t\tforeach($item->tags as $tag) {\n\t\t\t\t\t\t\t\t$tagData = array(\n\t\t\t\t\t\t\t\t\t'item_id' => $item->id,\n\t\t\t\t\t\t\t\t\t'tag_name' => $tag\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$this->wpdb->insert($this->wpdb->prefix.'topspin_items_tags',$tagData,$tagFormat);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // end if tags exist\n\t\n\t\t\t\t\t\t##\tDeletes old item images\n\t\t\t\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items_images WHERE item_id = %d';\n\t\t\t\t\t\t$this->wpdb->query($this->wpdb->prepare($sql,array($item->id)));\n\t\t\t\t\t\t##\tAdds new item images\n\t\t\t\t\t\tif(isset($item->campaign->product->images) && is_array($item->campaign->product->images)) {\n\t\t\t\t\t\t\t$imageFormat = array('%d','%s','%s','%s','%s');\n\t\t\t\t\t\t\tforeach($item->campaign->product->images as $key=>$image) {\n\t\t\t\t\t\t\t\t$imageData = array(\n\t\t\t\t\t\t\t\t\t'item_id' => $item->id,\n\t\t\t\t\t\t\t\t\t'source_url' => $item->campaign->product->images[$key]->source_url,\n\t\t\t\t\t\t\t\t\t'small_url' => $item->campaign->product->images[$key]->small_url,\n\t\t\t\t\t\t\t\t\t'medium_url' => $item->campaign->product->images[$key]->medium_url,\n\t\t\t\t\t\t\t\t\t'large_url' => $item->campaign->product->images[$key]->large_url\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$this->wpdb->insert($this->wpdb->prefix.'topspin_items_images',$imageData,$imageFormat);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} //end if images exist\n\t\n\t\t\t\t\t\tarray_push($addedIDs,$item->id);\n\t\t\t\t\t} //end for each item\n\t\t\t\t} //end if items\n\t\t\t} //end for each page\n\n\t\t\t##\tRemoves all items that is not modified/inserted\n\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items WHERE last_modified < %s';\n\t\t\t$this->wpdb->query($this->wpdb->prepare($sql,array(date('Y-m-d H:i:s',$lastModified))));\n\n\t\t\t##\tRemoves all item tags that is not modified/inserted\n\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items_tags WHERE item_id NOT IN (SELECT id FROM '.$this->wpdb->prefix.'topspin_items)';\n\t\t\t$this->wpdb->query($this->wpdb->prepare($sql));\n\n\t\t\t##\tRemoves all item images that is not modified/inserted\n\t\t\t$sql = 'DELETE FROM '.$this->wpdb->prefix.'topspin_items_images WHERE item_id NOT IN (SELECT id FROM '.$this->wpdb->prefix.'topspin_items)';\n\t\t\t$this->wpdb->query($this->wpdb->prepare($sql));\n\t\t\treturn $lastModified;\n\t\t}\n\t}", "public static function get_items_returns() {\n return new external_single_structure(\n array(\n 'items' => new external_multiple_structure(\n feedback_item_exporter::get_read_structure()\n ),\n 'warnings' => new external_warnings(),\n )\n );\n }", "public function get_all_items_by_api()\n {\n\n $data = array('token' =>'ayaolwan');//'type' => 'fees_category');\n $data_string = json_encode($data);\n $curl = curl_init(base_url() . 'webServices/Itemapi');\n\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"GET\");\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($data_string))\n );\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);\n\n $result = json_decode(curl_exec($curl), true);\n curl_close($curl);\n\n if ($result['status'])\n {\n echo json_encode($result['itemsList']);\n }\n\n\n }", "public function add($item)\n {\n $newCollection[] = $this->items;\n $newCollection[] = $item;\n $this->items = $newCollection;\n return $newCollection;\n }", "public static function displayItemList($showSettings){\n\t\t\tif($showSettings && !User::isAdmin()){\n\t\t\t\t$showSettings = false;\n\t\t\t}\n\n\t\t\t$time_start = microtime(true);\n\n\t\t\t$itemCategories = LendingItem::getAllItems();\n\n\t\t\tforeach ($itemCategories as $categoryID => $category_items) {\n\t\t\t\t// For each category\n\t\t\t\t?>\n\t\t\t\t<div class=\"categoryContainer\">\n\t\t\t\t\t<h2 class=\"rubrikBooking\">\n\t\t\t\t\t\t<img class=\"categoryExpandImg\" src=\"../images/expand.gif\" />\n\t\t\t\t\t\t<img class=\"categoryContractImg\" src=\"../images/contract.gif\" />\n\t\t\t\t\t\t<?php echo(Language::itemCategory($categoryID)); ?>\n\t\t\t\t\t</h2>\n\t\t\t\t\t<div class=\"categoryItemHolder\">\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ($category_items as $item) {\n\t\t\t\t\t\t// For each item\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<div class='bookingFormItem'>\n\t\t\t\t\t\t\t<input type='hidden' class='bookingItemID' name='item' value='<?php echo($item['id']); ?>' />\n\t\t\t\t\t\t\t<input type='hidden' class='maxLendingPeriods' name='item' value='<?php echo($item['max_lending_periods']); ?>' />\n\n\t\t\t\t\t\t\t<p class=\"itemImage\">\n\t\t\t\t\t\t\t\t<?php if (file_exists(\"img/\".$item['id'].\".jpg\")) { ?>\n\t\t\t\t\t\t\t\t\t<img class=\"itemPic\" src=\"img/<?php echo($item['id']); ?>.jpg\" alt=\"<?php echo($item['name']); ?>\" />\n\t\t\t\t\t\t\t\t<?php }else{ ?>\n\t\t\t\t\t\t\t\t\t<img class=\"itemPic\" src=\"img/404img.png\" alt=\"Image not found\" />\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<h4 class='itemHeading' id='<?php echo(Language::itemName($item['id'])); ?>'><?php echo(Language::itemName($item['id'])); ?></h4>\n\t\t\t\t\t\t\t<div class='itemContent' >\n\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t<?php echo(nl2br(Language::itemDescription($item['id']))); ?>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<?php echo((nl2br(nl2br($item['deposit'] ? Language::text(\"booking_deposit\").\": \".$item['deposit'].\" SEK\" : \"\")))); ?>\n\t\t\t\t\t\t\t\t\t<?php echo((nl2br($item['fee'] ? Language::text(\"booking_fee\").\": \".$item['fee'].\" SEK\" : \"\"))); ?><br />\n\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"max_lending_time\")); ?> <?php echo($item['max_lending_periods']); ?><br />\n\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"item_descr_there_is\")); ?> <?php echo($item['num_items']); ?> <?php echo(Language::text(\"item_descr_num\")); ?>\n\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif($showSettings){\n\t\t\t\t\t\t\t\t\t//Display item options for admins\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<form action=\"item.php\" method=\"post\" enctype=\"multipart/form-data\">\n\t\t\t\t\t\t\t\t\t\t<fieldset style=\"padding: 0;\">\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"lending_item_id\" value=\"<?php echo($item['id']); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\t<b><?php echo(Language::text(\"edit_item\")); ?>:</b>\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Bildfil\"><?php echo(Language::text(\"picture\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"button_style\" id =\"picture_select_btn\" type=\"file\" name=\"image\" class=\"button_style\" />\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Internt Namn\"><?php echo(Language::text(\"internal_name\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form_style\" type=\"text\" name=\"name\" value=\"<?php echo($item['name']); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Antal\"><?php echo(Language::text(\"amount\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form_style\" type=\"text\" name=\"num_items\" value=\"<?php echo($item['num_items']); ?>\" size=\"3\" />\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Max att låna\"><?php echo(Language::text(\"max_to_lend\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form_style\" type=\"text\" name=\"max_lending_items\" value=\"<?php echo($item['max_lending_items']); ?>\" size=\"3\" /> <?php echo(Language::text(\"max_lend_info\")); ?>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Maxlånetid\"><?php echo(Language::text(\"max_time\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form_style\" type=\"text\" name=\"max_lending_periods\" value=\"<?php echo($item['max_lending_periods']); ?>\" size=\"3\" /> <?php echo(Language::text(\"max_time_info\")); ?>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Deposition\"><?php echo(Language::text(\"deposition\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form_style\" type=\"text\" name=\"deposit\" value=\"<?php echo($item['deposit']); ?>\" size=\"5\" /> kr\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Avgift\"><?php echo(Language::text(\"fee\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"form_style\" type=\"text\" name=\"fee\" value=\"<?php echo($item['fee']); ?>\" size=\"5\" /> kr\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Ta bort bild\"><?php echo(Language::text(\"remove_pic\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"delete_image\" value=\"1\" />\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"button_style\" type=\"submit\" name=\"update_lending_item\" value=\"<?php echo(Language::text(\"update\")); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"button_style\" type=\"submit\" name=\"delete_lending_item\" value=\"<?php echo(Language::text(\"remove_item\")); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t\t\t<div class=\"togglable\">\n\t\t\t\t\t\t\t\t\t\t<p class=\"toggleButton\"><b><?php echo(Language::text(\"translations\")); ?></b></p>\n\t\t\t\t\t\t\t\t\t\t<div class=\"toggleContent\"><?php\n\n\t\t\t\t\t\t\t\t\t\tforeach (Language::getLanguages() as $language) { ?>\n\t\t\t\t\t\t\t\t\t\t\t<form action=\"item.php\" method=\"post\">\n\t\t\t\t\t\t\t\t\t\t\t\t<fieldset class=\"translateBox\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ($translation = ItemTranslation::getTranslation($item['id'], $language['id'])) { ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"item_translation_id\" value=\"<?php echo($translation['id']); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<legend><?php echo(Language::text(\"edit_language\")); ?> <?php echo($language['name']); ?></legend>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"name\")); ?>: <input type=\"text\" name=\"name\" value=\"<?php echo($translation['name']); ?>\" /><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"description\")); ?>:<br />\n\t <textarea name=\"description\" rows=\"3\" cols=\"25\"><?php echo($translation['description']); ?></textarea><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tEmail-text:<br />\n\t <textarea name=\"emailText\" rows=\"3\" cols=\"25\"><?php echo($translation['email_text']); ?></textarea><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button_style\" name=\"update_item_translation\" value=\"<?php echo(Language::text(\"update\")); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php } else { ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"item_id\" value=\"<?php echo($item['id']); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"language_id\" value=\"<?php echo($language['id']); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<legend><?php echo(Language::text(\"add_translation\")); ?> <?php echo($language['name']); ?></legend>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"name\")); ?>: <input type=\"text\" name=\"name\" value=\"\" /><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"description\")); ?>:<br />\n\t <textarea name=\"description\" rows=\"3\" cols=\"25\"></textarea><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tEmail-text:<br />\n\t <textarea name=\"emailText\" rows=\"3\" cols=\"25\"></textarea><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button_style\" name=\"create_item_translation\" value=\"<?php echo(Language::text(\"create\")); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t//Display calendar for booking\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<div class=\"calendarBooking\">\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\techo \"<input type='hidden' class='bookingItemID' name='item' value='\".$item['id'].\"' />\\n\";\n\t\t\t\t\t\t\t\t\t\t\techo \"<input type='hidden' class='maxLendingPeriods' name='item' value='\".$item['max_lending_periods'].\"' />\\n\";\n\t\t\t\t\t\t\t\t\t\t?><br />\n\t\t\t <div>\n\t\t\t <a href=\"#\" class=\"firstLoadButton\"><?php echo(nl2br(Language::text(\"booking_choose_period\"))); ?></a>\n\t\t\t </div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"calendar\">\n\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\t\t\t\t\tif ($item['max_lending_items'] != \"0\") {\n\t\t\t\t\t\t\t\t\t\t\t$max_lending_items = $item['max_lending_items'];\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$max_lending_items = $item['num_items'];\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\t\t<br />\n\t\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"booking_num_items\")); ?>:\n\t\t\t\t\t\t\t\t\t\t<select name=\"num_items\" class=\"numItemsSelector\">\n\t\t\t\t\t\t\t\t\t\t\t<?php for ($num_items = 1; $num_items <= $max_lending_items; $num_items++) { ?>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"<?php echo($num_items); ?>\"><?php echo($num_items); ?></option>\n\t\t\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t<br />\n\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"itemRowSeparator\"></div>\n\t\t\t\t\t<?php\n\t\t\t\t\t}\n\n\t\t\t\t\tif($showSettings){\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<!-- Item box for adding new item -->\n\t\t\t\t\t\t<div class=\"bookingFormItem\" style=\"background-color: #ff6600;\">\n\t\t\t\t\t\t\t<h4 class=\"itemHeading\"><?php echo(Language::text(\"add_item_to\")); ?> <b style=\"color:#0080ff\"><?php echo(Language::itemCategory($categoryID)); ?></b></h4>\n\t\t\t\t\t\t\t<div class=\"itemContent\">\n\t\t\t\t\t\t\t\t<form action=\"item.php\" method=\"post\">\n\t\t\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"lending_item_category_id\" value=\"<?php echo($categoryID); ?>\" />\n\t\t\t\t\t\t\t\t\t\t<legend><?php echo(Language::text(\"edit_item\")); ?>:</legend>\n\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Internt namn \"><?php echo(Language::text(\"internal_name\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_style\" name=\"name\" value=\"\" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Antal\"><?php echo(Language::text(\"amount\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_style\" name=\"num_items\" value=\"1\" /> st\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Max att låna\"><?php echo(Language::text(\"max_to_lend\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_style\" name=\"max_lending_items\" value=\"0\" /> <?php echo(Language::text(\"max_lend_info\")); ?>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Maxlånetid\"><?php echo(Language::text(\"max_time\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_style\" name=\"max_lending_periods\" value=\"4\" /> <?php echo(Language::text(\"max_time_info\")); ?>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Deposition\"><?php echo(Language::text(\"deposition\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_style\" name=\"deposit\" value=\"\" /> kr\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"pure-control-group\">\n\t\t\t\t\t\t\t\t\t\t<label style=\"width: 6em;\" for=\"Avgift\"><?php echo(Language::text(\"fee\")); ?></label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form_style\" name=\"fee\" value=\"\" /> kr\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button_style\" name=\"create_lending_item\" value=\"<?php echo(Language::text(\"create\")); ?>\" />\n\t\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"itemRowSeparator\"></div>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<?php\n\t\t\tif($showSettings){\n\t\t\t\t?>\n\t\t\t\t<!-- Translations of category -->\n\t\t\t\t<div class=\"togglable catTranslation\">\n\t\t\t\t\t<p class=\"toggleButton\"><b><?php echo(Language::text(\"translate_category\")); ?> <b style=\"color:#ff6600\"><?php echo(Language::itemCategory($categoryID)); ?></b></b></p>\n\t\t\t\t\t<div class=\"toggleContent\">\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach (Language::getLanguages() as $language) { ?>\n\t\t\t\t\t\t<form action=\"item.php\" method=\"post\">\n\t\t\t\t\t\t\t<fieldset class=\"box\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$translation = ItemCategoryTranslation::getTranslation($categoryID, $language['id']);\n\t\t\t\t\t\t\t\tif ($translation) { ?>\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"item_category_translation_id\" value=\"<?php echo($translation['id']); ?>\" />\n\t\t\t\t\t\t\t\t\t<legend><?php echo(Language::text(\"edit_language\")); ?> <?php echo($language['name']); ?></legend>\n\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"name\")); ?>: <input type=\"text\" name=\"name\" value=\"<?php echo($translation['name']); ?>\" /><br />\n\t\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button_style\" name=\"update_item_category_translation\" value=\"<?php echo(Language::text(\"update\")); ?>\" />\n\t\t\t\t\t\t\t\t<?php } else { ?>\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"category_id\" value=\"<?php echo($categoryID); ?>\" />\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"language_id\" value=\"<?php echo($language['id']); ?>\" />\n\t\t\t\t\t\t\t\t\t<legend><?php echo(Language::text(\"add_translation\")); ?> <?php echo($language['name']); ?></legend>\n\t\t\t\t\t\t\t\t\t<?php echo(Language::text(\"name\")); ?>: <input type=\"text\" name=\"name\" value=\"\" /><br />\n\t\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button_style\" name=\"create_item_category_translation\" value=\"<?php echo(Language::text(\"create\")); ?>\" />\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<!-- Deletion of category -->\n\t\t\t\t<div class=\"catDeleteBtn\">\n\t\t\t\t\t<form class=\"catDelForm\" action=\"item.php\" method=\"post\">\n\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"lending_item_category_id\" value=\"<?php echo($categoryID); ?>\" />\n\t\t\t\t\t\t\t<input type=\"submit\" class=\"button_style\" name=\"delete_lending_item_category\" value=\"<?php echo(Language::text(\"remove_category\")); ?>\" />\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t\t<script>\n\t\t\t\t\t$('.catDelForm').submit(function() {\n\t\t\t\t\t return confirm(\"<?php echo(Language::text(\"confirm_cat_del\")); ?>\");\n\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\t\t$time_end = microtime(true);\n\t\t\t$time = $time_end - $time_start;\n\t\t}", "public function get_listings_details($dom){\t\n\t\t\t//push each entry into new array\n\t\t\t$update_item_array = array();\n\t\t\t$update_item_array['itemnumber'] = array();\n\t\t\t$update_item_array['customlabel'] = array();\n\t\t\t$update_item_array['quantity'] = array();\n\t\t\t$update_item_array['quantitysoldandavailable'] = array();\n\t\t\t$update_item_array['sellprice'] = array();\n\t\t\t$update_item_array['starttime'] = array();\n\t\t\t$update_item_array['endtime'] = array();\n\t\t\t$update_item_array['itemtitle'] = array();\n\t\t\t$update_item_array['stockcntrl'] = array();\n\t\t\t$update_item_array['listingtype'] = array();\n\n\n\t\t\t$update_item_response = $dom->getElementsByTagName(DOM_ELEMENT_LISTINGSSHOW_RESPONSE);\n\n\n\n\t\t\tforeach ($update_item_response as $item){\n\t \t\t\t\n\n\t\t\t\t$activelist = $item->getElementsByTagName(DOM_ELEMENT_LISTINGS_ACTIVELIST);\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tforeach ($activelist as $activelistshow){\n\t\t\t\t\t\n\t\t\t\t\t$itemarrays = $activelistshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMARRAY);\n\n\n\t\t\t\t\tforeach($itemarrays as $itemarray){\n\n\t\t\t\t\t\t$inditems = $itemarray->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMSS);\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\tforeach($inditems as $inditemshow){\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_LISTINGTYPE)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_LISTINGTYPE)->item(0)->nodeValue) : \"Listing Type - Error\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['listingtype'], $costers);\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMID)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMID)->item(0)->nodeValue) : \"Item Num - Error\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['itemnumber'], $costers);\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_SKU)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_SKU)->item(0)->nodeValue) : \"SKU - Error\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['customlabel'], $costers);\n\t\t\t\t\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_QUANTITY)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_QUANTITY)->item(0)->nodeValue) : \"0\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['quantity'], $costers);\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_TOTALQUANTITY)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_TOTALQUANTITY)->item(0)->nodeValue) : \"0\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['quantitysoldandavailable'], $costers);\n\n\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_CURRENTPRICE)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_CURRENTPRICE)->item(0)->nodeValue) : \"price sold - Error\";\n\n\t\t\t\t\t\t\tarray_push($update_item_array['sellprice'], $costers);\t\n\n\n\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STARTTIME)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STARTTIME)->item(0)->nodeValue) : \"0\";\n\n\n\t\t\t\t\t\t\tarray_push($update_item_array['starttime'], $costers);\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ENDTIME)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ENDTIME)->item(0)->nodeValue) : \"\";\n\n\n\t\t\t\t\t\t\tarray_push($update_item_array['endtime'], $costers);\n\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMTITLE)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_ITEMTITLE)->item(0)->nodeValue) : \"\";\n\n\n\t\t\t\t\t\t\tarray_push($update_item_array['itemtitle'], $costers);\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$costers = trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STOCKCNTRL)->item(0)->nodeValue) != \"\" ? trim($inditemshow->getElementsByTagName(DOM_ELEMENT_LISTINGS_STOCKCNTRL)->item(0)->nodeValue) : \"FALSE\";\n\n\n\t\t\t\t\t\t\tarray_push($update_item_array['stockcntrl'], $costers);\t\t\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\n\t\t\t\t}\t\t\n\n\n\t\t\t\t//errors\n\t\t\t\t$error_messages = $item->getElementsByTagName(DOM_ELEMENT_ERRORS);\n\n\t\t\t\tforeach ($error_messages as $errormsg){\n\t\t\t\t\t$error = trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) != \"\" ? trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) : \"No Error\";\n\t\t\t\t\tarray_push($update_item_array, $error);\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t}\n\n\t\t\treturn $update_item_array;\n\n\t\t//DOM_ELEMENT_SHORT_ERROR_MSG\n\t\t}", "protected function _decodeItems($parameters, $retrieveItems = false) {\n\t\t\t$response = array();\n\n\t\t\tif (!empty($parameters['items'])) {\n\t\t\t\tforeach ($parameters['items'] as $itemListName => $items) {\n\t\t\t\t\t$response[$itemListName] = array(\n\t\t\t\t\t\t'count' => count($items['data']),\n\t\t\t\t\t\t'data' => $items['data'],\n\t\t\t\t\t\t'name' => $itemListName,\n\t\t\t\t\t\t'table' => $items['table']\n\t\t\t\t\t);\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t!empty($items['data']) &&\n\t\t\t\t\t\t!empty($this->encode[$items['table']])\n\t\t\t\t\t) {\n\t\t\t\t\t\t$itemIndexes = array();\n\t\t\t\t\t\t$itemIndexLines = $items['data'];\n\t\t\t\t\t\t$itemIndex = $itemCount = 0;\n\n\t\t\t\t\t\tforeach ($itemIndexLines as $offsetIndex => $itemIndexLine) {\n\t\t\t\t\t\t\t$itemIndexLineChunks = explode('_', $itemIndexLine);\n\n\t\t\t\t\t\t\tforeach ($itemIndexLineChunks as $itemIndexLineChunk) {\n\t\t\t\t\t\t\t\t$itemStatus = substr($itemIndexLineChunk, 0, 1);\n\t\t\t\t\t\t\t\t$itemStatusCount = substr($itemIndexLineChunk, 1);\n\n\t\t\t\t\t\t\t\tif ($itemStatus) {\n\t\t\t\t\t\t\t\t\tif ($retrieveItems) {\n\t\t\t\t\t\t\t\t\t\tfor ($i = 0; $i < $itemStatusCount; $i++) {\n\t\t\t\t\t\t\t\t\t\t\t$itemIndexes[$itemIndex + $i] = 1;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$itemCount += $itemStatusCount;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$itemIndex += $itemStatusCount;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$response[$itemListName]['count'] = $itemCount;\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tempty($itemIndexes) ||\n\t\t\t\t\t\t\t!$itemCount\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($retrieveItems) {\n\t\t\t\t\t\t\t$dataTable = !empty($this->encode[$items['table']]['data_table']) ? $this->encode[$items['table']]['data_table'] : $items['table'];\n\t\t\t\t\t\t\t$itemParameters = array_merge($parameters, array(\n\t\t\t\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t\t\t\t'id'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'limit' => $itemIndex,\n\t\t\t\t\t\t\t\t'offset' => 0\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t\tif (!empty($this->encode[$items['table']]['sort'])) {\n\t\t\t\t\t\t\t\t$itemParameters['sort'] = $this->encode[$items['table']]['sort'];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$conditions = array(\n\t\t\t\t\t\t\t\t'id' => array()\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$itemIds = $this->fetch($dataTable, $itemParameters);\n\t\t\t\t\t\t\t$response[$itemListName] = array_merge($response[$itemListName], array(\n\t\t\t\t\t\t\t\t'parameters' => $itemParameters,\n\t\t\t\t\t\t\t\t'table' => $dataTable\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t\tif (!empty($itemIds['data'])) {\n\t\t\t\t\t\t\t\t$conditions['id'] = array_values(array_intersect_key($itemIds['data'], $itemIndexes));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!empty($parameters['data']['instant_replacement']) &&\n\t\t\t\t\t\t\t\t$parameters['action'] == 'replace'\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t$conditions[]['NOT']['AND'] = array(\n\t\t\t\t\t\t\t\t\t'status' => 'replaced'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$conditions[]['OR'] = array(\n\t\t\t\t\t\t\t\t\t'next_replacement_available' => null,\n\t\t\t\t\t\t\t\t\t'next_replacement_available <' => date('Y-m-d H:i:s', time())\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$response[$itemListName] = array_merge($response[$itemListName], $this->fetch($dataTable, array(\n\t\t\t\t\t\t\t\t'conditions' => $conditions,\n\t\t\t\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t\t\t\t'id'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $response;\n\t\t}", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function getData()\n {\n // The base data.\n $data = $this->getBaseData();\n\n // Add basket contents next.\n // It seems that we MUST have at least one item in\n // the cart to be valid.\n\n $items = $this->getItems();\n\n if (empty($items) || $items->count() == 0) {\n // No items in the basket, so we will have to make\n // one up. The Frontend API MUST have at least one cart item.\n // The basket MUST add up to the total payment amount, so\n // be aware of that.\n\n $item = new ExtendItem([\n 'id' => $this->defaultItemId,\n 'price' => $this->getAmountInteger(),\n 'quantity' => 1,\n 'name' => $this->getDescription(),\n 'vat' => null,\n ]);\n\n $items = new ItemBag;\n $items->add($item);\n\n // Add this dummy cart to the gateway cart.\n $this->setItems($items);\n }\n\n // Add the cart items to the data.\n $data += $this->getDataItems();\n\n if ($this->getDisplayName()) {\n $data['display_name'] = $this->getDisplayName();\n }\n\n if ($this->getDisplayAddress()) {\n $data['display_address'] = $this->getDisplayAddress();\n }\n\n if ($this->getInvoiceId()) {\n $data['invoiceid'] = $this->getInvoiceId();\n }\n\n // The errorurl does not appear in the Frontend documentation, but does\n // work and is implemented in other platform gateways.\n\n $data += $this->getDataUrl();\n\n if ($this->getTargetWindow()) {\n $data['targetwindow'] = $this->getTargetWindow();\n }\n\n if ($this->getParam() !== null) {\n $data['param'] = $this->getParam();\n }\n\n if ($this->getDescription()) {\n $data['narrative_text'] = $this->getDescription();\n }\n\n $data += $this->getDataPersonal();\n $data += $this->getDataShipping();\n\n if ($this->getLanguage()) {\n $data['language'] = $this->getLanguage();\n }\n\n if ($this->getWalletType()) {\n $data['wallettype'] = $this->getWalletType();\n }\n\n if ($this->getAutosubmit()) {\n $data['autosubmit'] = $this->getAutosubmit();\n }\n\n if ($this->getFinancingtype()) {\n $data['financingtype'] = $this->getFinancingtype();\n }\n\n // Create the hash for hashable fields.\n $data['hash'] = $this->hashArray($data);\n\n return $data;\n }", "private static function parse_items($items){\n $results = [];\n foreach($items as $item){\n $title = $item->find('.title a')[0];\n if(empty($title)){\n $title = $item->find('.featured-ad-title a')[0];\n }\n try{\n $item_data = [\n \"title\" => $title->text,\n \"date\" => $item->find('.date')[0]->text,\n \"url\" => $title->getAttribute(\"href\"),\n \"location\" => $item->find('.location')[0]->text\n ];\n\n $price = trim($item->find('.price')[0]->text);\n\n $m = explode(\" \", $price);\n if(count($m) > 1){\n $item_data[\"price\"] = intval(str_replace(\",\", \"\", $m[1]));\n $item_data[\"currency\"] = $m[0];\n }else{\n $item_data[\"price\"] = 0;\n $item_data[\"currency\"] = \"UNKNOWN\";\n }\n\n try{\n $category = $item->find('.description .breadcrumbs')[0];\n if(is_object($category)){\n $item_data[\"category\"] = $category->text;\n }else{\n $item_data[\"category\"] = $category;\n }\n }catch(Exception $e){\n $item_data[\"category\"] = \"\";\n }\n\n $photo_block = $item->find(\".thumb div\");\n if(!empty($photo_block)){\n $style = $photo_block->getAttribute(\"style\");\n preg_match(\"/http.*\\.\\w*/\", $style, $result);\n if(!empty($result)){\n $item_data[\"photo\"] = $result[0];\n }else{\n $item_data[\"photo\"] = \"\";\n }\n }else{\n $item_data[\"photo\"] = \"\";\n }\n\n\n array_push($results, $item_data);\n }catch(Exception $e){\n continue;\n }\n }\n return $results;\n }", "public function prepare_item_for_response( $item, $request ) {\n\t\t$data = $this->add_additional_fields_to_object( $item, $request );\n\t\t$data = $this->filter_response_by_context( $data, 'view' );\n\t\t$response = rest_ensure_response( $data );\n\n\t\t/**\n\t\t * Filter the list returned from the API.\n\t\t *\n\t\t * @param WP_REST_Response $response The response object.\n\t\t * @param array $item The original item.\n\t\t * @param WP_REST_Request $request Request used to generate the response.\n\t\t */\n\t\treturn apply_filters( 'woocommerce_rest_prepare_reports_import', $response, $item, $request );\n\t}", "public function add_item($zajlib_feed_item){\n\t\t$this->items[] = $zajlib_feed_item; \n\t}", "public function addItem($item)\n {\n if ($item instanceof \\Fastbill\\Item\\Item)\n {\n $this['ITEMS'][] = $item;\n }\n else\n {\n $itemObj = new \\Fastbill\\Item\\Item();\n $itemObj->fillFromArray($item);\n $this['ITEMS'];\n }\n\n }", "function RenderItem( &$item, &$renderer, $isLast ) {\n\t\t$itemInfo['identifier'] = $item->getAttribute('identifier');\n\t\t\n\t\t$itemInfo['isLast'] = $isLast;\n\t\t\n\t\tif( $item->hasAttribute('identifierref') )\n\t\t\t$itemInfo['identifierref'] = $item->getAttribute('identifierref');\n\t\telse\n\t\t $itemInfo['identifierref'] = FALSE;\n\n\t\tif( $item->hasAttribute('isvisible') )\n\t\t $itemInfo['isvisible'] = ($item->getAttribute('isvisible')=='true')?TRUE:FALSE;\n\t\telse\n\t\t $itemInfo['isvisible'] = TRUE;\n\n\t\tif( $item->hasAttribute('parameters') )\n\t\t $itemInfo['parameters'] = $item->getAttribute('parameters');\n\t\telse\n\t\t $itemInfo['parameters'] = FALSE;\n\t\t\n\t\t$itemInfo['title'] = $this->getFirstElementValue($item, 'title');\n\t\t\n\t\t$itemInfo['adlcp_prerequisites'] = $this->getFirstElementValue($item, 'prerequisites', 'adlcp' );\n\t\t$itemInfo['adlcp_maxtimeallowed'] = $this->getFirstElementValue($item, 'maxtimeallowed', 'adlcp');\n\t\t$itemInfo['adlcp_timelimitaction'] = $this->getFirstElementValue($item, 'timelimitaction', 'adlcp');\n\t\t$itemInfo['adlcp_datafromlms'] = $this->getFirstElementValue($item, 'datafromlms', 'adlcp');\n\t\t$itemInfo['adlcp_masteryscore'] = $this->getFirstElementValue($item, 'masteryscore', 'adlcp');\n\t\t//$itemInfo['adlcp_completionthreshold'] = $this->getFirstElementValue($item, 'completionthreshold', 'adlcp');\n\t\t$threshold_elem = $this->getNodeElement($item, 'completionthreshold', 'adlcp');\n\t\tif( $threshold_elem && $threshold_elem->hasAttribute('minProgressMeasure') )\n\t\t $itemInfo['adlcp_completionthreshold'] = $threshold_elem->getAttribute('minProgressMeasure');\n\t\telse\n\t\t $itemInfo['adlcp_completionthreshold'] = '';\n\t\t\n $elem = $this->getFirstElementNode( $item, 'item');\n if( $elem )\n\t\t\t$itemInfo['isLeaf'] = FALSE;\n\t\telse\n\t\t $itemInfo['isLeaf'] = TRUE;\n\t\t \n\t\tif( $renderer == null ) {\n\t\t\tprint_r( $itemInfo );\n\t\t\t\n\t\t}\n\t\t$renderer->RenderStartItem(\t$this, $itemInfo );\n\t\t\n\t\twhile( $elem ) {\n\t\t\t$nextElem = $this->getNextElementNode( $elem );\n\t\t\t\n\t\t\t/* pass the info about the last element */\n\t\t\tif( $nextElem === NULL )\n\t\t\t $this->RenderItem( $elem, $renderer, true );\n\t\t\telse\n\t\t\t $this->RenderItem( $elem, $renderer, false );\n\t\t\t \n\t\t\t$elem = $nextElem;\n\t\t}\n\n $renderer->RenderStopItem( $this, $itemInfo );\n\n\t}", "public function getItemBag() {\n $item_classname = $this->getItemClass();\n $item_bag_classname = $this->getItemBagClass();\n $items = new $item_bag_classname();\n $currency = NULL;\n foreach ($this->getPayment()->getLineItems() as $line_item) {\n $item = new $item_classname();\n $item->setPrice($line_item->getAmount());\n $item->setQuantity($line_item->getQuantity());\n $item->setDescription($line_item->getDescription());\n $item->setName($line_item->getName());\n $items->add($item);\n\n $line_item_currency = $line_item->getCurrencyCode();\n\n if ($line_item_currency != $currency) {\n if ($currency != NULL) {\n // This is the second time we are changing the currency which means\n // that our line items have mixed currencies. This ain't gonna work!\n drupal_set_message($this->t('Mixed currencies detected which is not yet supported.'), 'error');\n return new OperationResult(NULL);\n }\n $currency = $line_item_currency;\n }\n }\n $this->setCurrency($currency);\n return $items;\n }", "public function addDealsToCart( $itemMap ) {\r\n\t\t\t$params = array('session_cookie'=>$itemMap['cart_session'],'dealid'=>$itemMap['dealid']);\r\n\t\t\t$this->db->select('COUNT(*) as count')->from(TABLES::$ORDER_DEALS_CART)->where($params);\r\n\t\t\t$query = $this->db->get();\r\n\t\t\t$result = $query->result_array();\r\n\t\t\tif($result[0]['count'] <=0 ) {\r\n\t\t\t\t$params = array('session_cookie'=>$itemMap['cart_session'],'restid'=>$itemMap['restid'],'dealid'=>$itemMap['dealid']);\r\n\t\t\t\t/* New item */\r\n\t\t\t\t$this->db->insert(TABLES::$ORDER_DEALS_CART,$params);\r\n\t\t\t\t$map['message'] = 'Deal Applied To Cart';\r\n\t\t\t\t$map['status'] = 0;\r\n\t\t\t}else {\r\n// \t\t\t\t$this->updateDealsInCart( $itemMap );\r\n\t\t\t\t$map['message'] = 'Deal Applied To Cart';\r\n\t\t\t\t$map['status'] = 1;\r\n\t\t\t}\r\n\t\t\treturn $map;\r\n\t\t}", "function getAllItem()\n\t{\n\t\t\n\t\t$query=\"SELECT * FROM list_items ORDER BY item_name\";\n\t\t$result = $this->db->query($query);\n\t\t$item=\"\";\n\t\t\n\t\tforeach ($result->result_array() as $row) {\n\t\t\t$daily_price=$row['daily_rate'];\n\t\t\t$weekly_price=$row['weekly_rate'];\n\t\t\t$weekend_price=$row['weekend_rate'];\n\t\t\t$monthly_price=$row['monthly_rate'];\n\t\t\t$bond_price=$row['bond_rate'];\n\n\t\t\tif($daily_price=='0.00'){$daily_price=\"NA\";}\n\t\t\tif($weekly_price=='0.00'){$weekly_price=\"NA\";}\n\t\t\tif($weekend_price=='0.00'){$weekend_price=\"NA\";}\n\t\t\tif($monthly_price=='0.00'){$monthly_price=\"NA\";}\n\t\t\tif($bond_price=='0.00'){$bond_price=\"NA\";}\n\n\t\t\t$extra=array(\n\t\t\t\t'item_id'\t=>\t$row['item_id'],\n\t\t\t\t'item_pictures'\t=>\t$row['item_pictures'],\n\t\t\t\t'item_name'\t=>\t$row['item_name'],\n\t\t\t\t'cat_name'\t=>\t$row['cat_name'],\n\t\t\t\t'user_addr'\t=>\t$row['user_addr'],\n\t\t\t\t'isLive'\t=>\t$row['isLive'],\n\t\t\t\t'user_name'\t=>\t$row['user_name'],\n\t\t\t\t'daily_rate'\t=>\t$row['daily_rate'],\n\t\t\t\t'weekly_rate'\t=>\t$row['weekly_rate'],\n\t\t\t\t'weekend_rate'\t=>\t$row['weekend_rate'],\n\t\t\t\t'monthly_rate'\t=>\t$row['monthly_rate'],\n\t\t\t\t'bond_rate'\t=>\t$row['bond_rate']\t\t\t\t\n\t\t\t);\n\t\t\t$item[]=$extra;\n\t\t}\n\n\t\treturn json_encode($item);\n\t}", "function item_listing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $ret = array(\n 'content' => '',\n 'status' => 'fail'\n );\n if (!empty($_POST)) {\n $id = $_POST['id'];\n $searchData = $_POST['searchData'];\n // get top list data in homepage\n switch ($id) {\n case 1:\n\n $header = array(\"优惠券编号\", \"优惠券金额\", \"所属终端便利店账号\", \"终端便利店\", \"状态\", \"赠送时间\", \"使用时间\");\n $cols = 7;\n\n $contentList = $this->coupon_model->getItems($searchData);\n $footer = (count($contentList) == 0 || !isset($contentList)) ? $footer = \"没有优惠券.\" : '';\n break; // get top1\n }\n\n // end get\n $ret['header'] = $this->output_header($header);\n $ret['content'] = $this->output_content($contentList, $id);\n $ret['footer'] = $this->output_footer($footer, $cols);\n $ret['status'] = 'success';\n }\n echo json_encode($ret);\n }\n }", "private function addItemsToFeed()\n {\n foreach ($this->items as $item) {\n /** @var SimpleXMLElement $feedItemNode */\n $feedItemNode = $this->feed->channel->addChild('item');\n foreach ($item->nodes() as $itemNode) {\n if (is_array($itemNode)) {\n foreach ($itemNode as $node) {\n $feedItemNode->addChild($node->get('name'), $node->get('value'), $node->get('_namespace'));\n }\n } else {\n $itemNode->attachNodeTo($feedItemNode);\n }\n }\n }\n }", "public function Items() {\n\t\t$output = new ArrayList();\n\t\t$output->merge($this->getPages());\n\t\t$output->merge($this->getDataObjects());\n\n\t\t$this->extend('updateItems', $output);\n\n\t\treturn $output;\n\t}", "public function appendItem($item): CollectionInterface;", "protected function responseToItems($response)\n {\n $array = array();\n foreach($response->product as $current) {\n\n if( !isset($current->name) || \n !isset($current->regularPrice) || \n !isset($current->url) || \n !isset($current->productId) ) \n {\n //If any of the required info is not present skip this item.\n continue;\n }\n\n $item = new Item();\n $item->setName((string)$current->name);\n $item->setPrice(intval((string)$current->regularPrice), Item::CURRENCY_UNIT_DOLLAR);\n $item->setLink((string)$current->url);\n $item->setvendorId((string)$current->productId);\n \n if(isset($current->thumbnailImage))\n {\n $item->setSmallImage((string)$current->thumbnailImage);\n }\n \n if(isset($current->image))\n {\n $item->setMediumImage((string)$current->image);\n }\n \n $array[] = $item;\n }\n\n return $array;\n\n }", "protected function _encodeItems($parameters) {\n\t\t\t$response = array();\n\n\t\t\tif (!empty($parameters['items'])) {\n\t\t\t\tforeach ($parameters['items'] as $itemListName => $items) {\n\t\t\t\t\t$response['tokens'][$itemListName] = array();\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tempty($items['parameters']) ||\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t!empty($parameters['processing']) &&\n\t\t\t\t\t\t\t$parameters['processing']['chunks'] > 1\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\t$response['items'][$itemListName] = array_merge($parameters['items'][$itemListName], array(\n\t\t\t\t\t\t\t'count' => 0,\n\t\t\t\t\t\t\t'data' => array()\n\t\t\t\t\t\t));\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$itemIds = $this->fetch($items['table'], $items['parameters']);\n\n\t\t\t\t\tif (!empty($itemIds['count'])) {\n\t\t\t\t\t\t$itemIndexes = array();\n\t\t\t\t\t\t$itemIndexLineIndex = $itemStatusCount = 0;\n\t\t\t\t\t\t$selectedItemIndexes = array_intersect($itemIds['data'], $parameters['items'][$itemListName]['data']);\n\t\t\t\t\t\t$unselectedItemIndexes = array_diff($itemIds['data'], $parameters['items'][$itemListName]['data']);\n\t\t\t\t\t\tarray_walk($selectedItemIndexes, function(&$selectedItemIdValue, $selectedItemIdKey) {\n\t\t\t\t\t\t\t$selectedItemIdValue = 1;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tarray_walk($unselectedItemIndexes, function(&$unselectedItemIdValue, $unselectedItemIdKey) {\n\t\t\t\t\t\t\t$unselectedItemIdValue = 0;\n\t\t\t\t\t\t});\n\t\t\t\t\t\t$allItemIndexes = $selectedItemIndexes + $unselectedItemIndexes;\n\t\t\t\t\t\tksort($allItemIndexes);\n\n\t\t\t\t\t\tforeach ($allItemIndexes as $itemIndex => $itemStatus) {\n\t\t\t\t\t\t\tif (((10000 * ($itemIndexLineIndex + 1)) - $itemIndex) === 1) {\n\t\t\t\t\t\t\t\t$itemIndexes[$itemIndexLineIndex][] = $itemStatus . $itemStatusCount;\n\t\t\t\t\t\t\t\t$itemStatusCount = 0;\n\t\t\t\t\t\t\t\t$itemIndexLineIndex++;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$itemStatusCount++;\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!isset($allItemIndexes[$itemIndex + 1]) ||\n\t\t\t\t\t\t\t\t$allItemIndexes[$itemIndex + 1] != $itemStatus\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t$itemIndexes[$itemIndexLineIndex][] = $itemStatus . $itemStatusCount;\n\t\t\t\t\t\t\t\t$itemStatusCount = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tforeach ($itemIndexes as $itemIndexLineIndex => $itemStatusCounts) {\n\t\t\t\t\t\t\t$itemIndexes[$itemIndexLineIndex] = implode('_', $itemStatusCounts);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$response['items'][$itemListName] = array_merge($parameters['items'][$itemListName], array(\n\t\t\t\t\t\t'count' => count($selectedItemIndexes),\n\t\t\t\t\t\t'data' => $itemIndexes\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $response;\n\t\t}", "public function getItemsInfo()\n {\n $data = [];\n foreach ($this->getOrder()->getAllItems() as $item) {\n if ($this->getDisplayWrappingBothPrices()) {\n $temp['price_excl_tax'] = $this->_preparePrices($item->getGwBasePrice(), $item->getGwPrice());\n $temp['price_incl_tax'] = $this->_preparePrices(\n $item->getGwBasePrice() + $item->getGwBaseTaxAmount(),\n $item->getGwPrice() + $item->getGwTaxAmount()\n );\n } elseif ($this->getDisplayWrappingPriceInclTax()) {\n $temp['price'] = $this->_preparePrices(\n $item->getGwBasePrice() + $item->getGwBaseTaxAmount(),\n $item->getGwPrice() + $item->getGwTaxAmount()\n );\n } else {\n $temp['price'] = $this->_preparePrices($item->getGwBasePrice(), $item->getGwPrice());\n }\n $temp['design'] = $item->getGwId();\n $data[$item->getId()] = $temp;\n }\n return new \\Magento\\Framework\\DataObject($data);\n }", "public function items()\n {\n $items = $this->getCache(__FUNCTION__, []);\n\n if($items) return $items;\n\n try {\n\n $reader = new Reader;\n $resource = $reader->download('https://sentinel.christianscience.com/layout/set/rss/content/view/full/272173');\n\n $parser = $reader->getParser(\n $resource->getUrl(),\n $resource->getContent(),\n $resource->getEncoding()\n );\n\n $feed = $parser->execute();\n\n $thumb = $this->thumb;\n\n foreach ($feed->getItems() as $item)\n {\n //most of the shows require a login, only first one doesn't, usually\n $url = $item->getEnclosureUrl();\n if(!$url) continue;\n\n $dt = $item->getPublishedDate();\n $day = $dt->format('F j, Y');\n\n $podcast = [\n 'type' => 'track',\n 'url' => $url,\n 'title' => $item->getTitle(),\n 'summary' => $day . ': ' . $item->getContent(),\n 'thumb' => $thumb,\n 'date' => $dt->getTimestamp()\n ];\n\n $items[] = $podcast;\n }\n }\n catch (\\Exception $e)\n {\n\n }\n\n if($items)\n {\n $this->putCache(__FUNCTION__, $items, 360);\n }\n\n return $items;\n }", "public function addToGetStoryInfoByGenartReturn(\\StructType\\ExtStoryListContainerV2 $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\StructType\\ExtStoryListContainerV2) {\n throw new \\InvalidArgumentException(sprintf('The getStoryInfoByGenartReturn property can only contain items of type \\StructType\\ExtStoryListContainerV2, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->getStoryInfoByGenartReturn[] = $item;\n return $this;\n }", "public function setItemList($item_list)\r\n {\r\n $this->item_list = $item_list;\r\n\r\n return $this;\r\n }", "function getAllItem_byCategory($category)\n\t{\n\t\t\n\t\t$query=\"SELECT * FROM list_items WHERE cat_name='$category' || cat_name LIKE '%$category%' \";\n\t\t\n\t\t$result = $this->db->query($query);\n\t\t$item=\"\";\n\t\t\n\t\tforeach ($result->result_array() as $row) {\n\t\t\t$daily_price=$row['daily_rate'];\n\t\t\t$weekly_price=$row['weekly_rate'];\n\t\t\t$weekend_price=$row['weekend_rate'];\n\t\t\t$monthly_price=$row['monthly_rate'];\n\t\t\t$bond_price=$row['bond_rate'];\n\t\t\t\n\t\t\tif($daily_price=='0.00'){$daily_price=\"NA\";}\n\t\t\tif($weekly_price=='0.00'){$weekly_price=\"NA\";}\n\t\t\tif($weekend_price=='0.00'){$weekend_price=\"NA\";}\n\t\t\tif($monthly_price=='0.00'){$monthly_price=\"NA\";}\n\t\t\tif($bond_price=='0.00'){$bond_price=\"NA\";}\n\n\t\t\t$extra=array(\n\t\t\t\t'item_id'\t=>\t$row['item_id'],\n\t\t\t\t'item_pictures'\t=>\t$row['item_pictures'],\n\t\t\t\t'item_name'\t=>\t$row['item_name'],\n\t\t\t\t'cat_name'\t=>\t$row['cat_name'],\n\t\t\t\t'user_addr'\t=>\t$row['user_addr'],\n\t\t\t\t'isLive'\t=>\t$row['isLive'],\n\t\t\t\t'user_name'\t=>\t$row['user_name'],\n\t\t\t\t'daily_rate'\t=>\t$row['daily_rate'],\n\t\t\t\t'weekly_rate'\t=>\t$row['weekly_rate'],\n\t\t\t\t'weekend_rate'\t=>\t$row['weekend_rate'],\n\t\t\t\t'monthly_rate'\t=>\t$row['monthly_rate'],\n\t\t\t\t'bond_rate'\t=>\t$row['bond_rate']\t\t\t\t\n\t\t\t);\n\t\t\t$item[]=$extra;\n\t\t}\n\n\t\treturn json_encode($item);\n\t}", "protected function create_items($itemIDs) {\n\t\t\t$responses = array();\n\t\t\tforeach ($itemIDs as $itemID) {\n\t\t\t\t$item = get_item($itemID);\n\t\t\t\t$item_response = $this->create_listitem($this->listID, $item);\n\t\t\t\t$responses[] = $item_response;\n\t\t\t}\n\t\t\treturn $responses;\n\t\t}", "private function load(){\n\n $xml = simplexml_load_string($this->response);\n if($xml){\n if(!$this->isResponseSuccessFull($xml)) {\n\n $item = $xml->Items->Item;\n\n $this->data['title'] = $item->ItemAttributes->Title->__toString();\n $this->data['ean'] = $item->ItemAttributes->EAN->__toString();\n $this->data['brand'] = $item->ItemAttributes->Brand->__toString();\n $this->data['picture'] = $item->SmallImage->URL->__toString();\n $this->data['asin'] = $item->ASIN->__toString();\n $this->data['price'] = round(((int)$item->ItemAttributes->ListPrice->Amount->__toString()) / 100,2);\n }\n }else{\n $this->errorMessage[] = 'can not load xml.';\n }\n }", "public function addAction()\r\n {\r\n $form = $this->getEditItemForm();\r\n $response = $this->getResponse();\r\n $content = $this->renderViewModel('dots-nav-block/item-add', array('form' => $form));\r\n $response->setContent($content);\r\n return $response;\r\n }", "public function addBasketItemParams()\n {\n $oBasket = $this->getBasket();\n $oLang = $this->getLang();\n $oRequest = $this->getPayPalRequest();\n\n $iPos = 0;\n foreach ($oBasket->getContents() as $oBasketItem) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", getStr()->html_entity_decode($oBasketItem->getTitle()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasketItem->getUnitPrice()->getPrice()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", (int) $oBasketItem->getAmount());\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_ITEMURL{$iPos}\", $oBasketItem->getLink());\n\n $oBasketProduct = $oBasketItem->getArticle();\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NUMBER{$iPos}\", $oBasketProduct->oxarticles__oxartnum->value);\n\n $iPos++;\n }\n\n //adding payment costs as product\n if ($oBasket->getPayPalPaymentCosts() > 0) {\n $sPaymentTitle = $oLang->translateString(\"OEPAYPAL_SURCHARGE\") . \" \" . $oLang->translateString(\"OEPAYPAL_TYPE_OF_PAYMENT\");\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $sPaymentTitle);\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalPaymentCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n\n $iPos++;\n }\n\n //adding wrapping as product\n if ($oBasket->getPayPalWrappingCosts() > 0) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $oLang->translateString(\"OEPAYPAL_GIFTWRAPPER\"));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalWrappingCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n\n $iPos++;\n }\n\n //adding greeting card as product\n if ($oBasket->getPayPalGiftCardCosts() > 0) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $oLang->translateString(\"OEPAYPAL_GREETING_CARD\"));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalGiftCardCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n\n $iPos++;\n }\n\n //adding trusted shops protection as product\n if ($oBasket->getPayPalTsProtectionCosts() > 0) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $oLang->translateString(\"OEPAYPAL_TRUSTED_SHOP_PROTECTION\"));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalTsProtectionCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n }\n }", "public function addItem($item) {\n\t\t$this->result .= '<li>' . $item . '</li>' . PHP_EOL;\n\t}", "public function toArray($request)\n {\n // return parent::toArray($request);\n return [\n 'type' => 'carts',\n 'id' => (string)$this->id,\n 'is_checkedout' => $this->is_checkedout,\n 'attributes' => [\n 'item_id' => (string)$this->item_id,\n 'item_slug' => $this->item->slug,\n 'item_name' => $this->item->name,\n 'item_images' => $this->item->images->pluck('thumbnail'),\n 'item_qty' => $this->item->qty,\n 'item_srp' => number_format($this->item->srp, 2),\n 'item_discountedSrp' => number_format($this->item->accuratePrice(), 2),\n 'discountType' => $this->item->discountType(),\n 'cart_qty' => $this->qty,\n 'validQty' => $this->validMaxQty(),\n 'subtotal_per_item' => $this->cartTotal(),\n 'date_placed' => $this->created_at->toDayDateTimeString(),\n 'status' => $this->status,\n 'cancellable' => $this->cancellable(),\n 'returnable' => $this->returnable(),\n 'services' => $this->getServiceDetails(),\n 'subtotal_with_service_total' => $this->getSubtotalWithServiceTotal(),\n 'checkedout_subtotal' => number_format($this->checkedoutSubTotal(),2)\n ],\n 'item' => new ItemResource($this->item)\n ];\n }", "public function retrieveItems() {\n $this->all = array();\n $this->_backlog = array();\n $this->_progress = array();\n $this->_done = array();\n $table_name = \"items\";\n $connection = db_connect();\n if ($connection->connect_error) {\n die(\"Connection failed: \" . $connection->connect_error);\n }\n $sql = \"SELECT * FROM $table_name ORDER BY id\";\n $result = @mysqli_query($connection, $sql) or die(mysqli_error($connection));\n while ($row = mysqli_fetch_array($result)) {\n $id = $row['id'];\n $category = $row['category'];\n $text = $row['text'];\n $item = new Item($id, $category, $text);\n array_push($this->all, $item);\n if ($category == 1) {\n array_push($this->_backlog, $item);\n } else if ($category == 2) {\n array_push($this->_progress, $item);\n } else if ($category == 3) {\n array_push($this->_done, $item);\n }\n }\n }", "function item_listing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n // get top10 datas\n // id: 1-top1, 2-top2, 3-top3, 4-top4, 5-top5\n $ret = array(\n 'content' => '',\n 'status' => 'fail'\n );\n if (!empty($_POST)) {\n $id = $_POST['id'];\n // get top list data in homepage\n switch ($id) {\n case 1:\n $header = array(\"序号\", \"轮播图片\", \"类型\", \"单品活动/餐装活动/区域总代理\", \"排序\", \"新增日期\", \"操作\",);\n $cols = 7;\n $contentList = $this->carousel_model->getItems();\n $footer = (count($contentList) == 0||$contentList=='') ? $footer = \"没有轮播图项目.\" : '';\n break; // get top1\n }\n\n // end get\n $ret['header'] = $this->output_header($header);\n $ret['content'] = $this->output_content($contentList, $id);\n $ret['footer'] = $this->output_footer($footer, $cols);\n $ret['status'] = 'success';\n }\n echo json_encode($ret);\n }\n }", "public function addItemList($key, $value)\n {\n return $this->client->sAdd($key, $value);\n }", "public function get_category_item_specifics($categoryID)\n {\n\n // Create the request object.\n $request = new Types\\GetCategorySpecificsRequestType();\n\n // An user token is required when using the Trading service.\n $request->RequesterCredentials = $this->requester_credentials;\n\n /**\n * Check Item Specifics are Enabled\n */\n $this->CI->load->library('ebay_category_features', $categoryID);\n $mode = $this->ebay_category_features->get_ItemSpecificsMode();\n //var_dump($$mode);\n\n\n if ($categoryID && $mode !== 'Disabled') {\n $request->CategoryID = [$categoryID];\n $response = $this->trading_service->getCategorySpecifics($request);\n // Check errors\n $checkError = $this->get_response($response);\n if ($checkError != 0) {\n if (count($response->Recommendations)) {\n $name_value_arr = array();\n foreach ($response->Recommendations as $Recommendation) {\n foreach ($Recommendation->NameRecommendation as $NameRecommendation) {\n $values_arr = array();\n if ($NameRecommendation->ValidationRules->SelectionMode == 'SelectionOnly') {\n $values_arr['custom']['SelectionOnly'] = true;\n }\n\n if ($NameRecommendation->ValidationRules->MinValues >= 1) {\n /**\n * Required item specifics have * in Name of Specific\n */\n //$name = $NameRecommendation->Name . '<strong>*</strong>';\n $values_arr['custom']['MinValues'] = true;\n }\n\n /*\n |--------------------------------------------------------------------------\n | Finally Helped\n |--------------------------------------------------------------------------\n |http://prntscr.com/g5zzn5\n |https://stackoverflow.com/questions/5421426/php-xml-xpath-node-element-iteration-and-inserting-into-array\n */\n\n $name = $NameRecommendation->Name;\n\n foreach ($NameRecommendation->ValueRecommendation as $ValueRecommendation) {\n $values = (string)$ValueRecommendation->Value;\n array_push($values_arr, $values);\n //$converted_values = explode(\",\",$value);\n // echo print_r($converted_values);\n }\n $name_value_arr[$name] = $values_arr;\n }\n }\n\n //var_dump($name_value_arr);\n\n $browse = [];\n\n foreach ($name_value_arr as $key => $value) {\n $custom = $this->findKey($value, 'custom');\n $selection_only = $this->findKey($value, 'SelectionOnly');\n $min_values = $this->findKey($value, 'MinValues');\n\n // var_dump($custom);\n // var_dump($value);\n\n $key = ($min_values) ? $key . '<strong>*</strong>' : $key;\n unset($value['custom']);\n $browse[$key] = $value;\n }\n\n //var_dump($browse);\n return json_encode($browse);\n // return $browse;\n\n }\n }\n } else return false;\n }", "public function getAllItems()\n\t{\n\n\t\t// Get the all the parent category\n\t\t$parentCategory = Category::where('parent_id','=', NULL)->get(); \n\t\n\t\t// Get all items with paginate \n\t\t$items = Item::orderBy('created_at', 'DESC')->normal()->paginate(12);\n\t\t$trigger = TRUE;\n\n\t\tforeach($items as $item)\n\t\t{\n\t\t\t// Add the newest price to the item array\n\t\t\t$priceArray = Item::find($item->id)->prices->first(); \n\t\t\t$newestPrice = $priceArray['price'];\n\t\t\tarray_add($item, 'price',$newestPrice);\n\n\t\t\t// Add the main picture to the item array;\n\t\t\t$itemPicture = Item::find($item->id)->pictures()->where('status','=','1')->first();\n\t\t\t$pictureName = $itemPicture['picture_name'];\n\t\t\tarray_add($item, \"picture_name\", $pictureName);\n\n\n\n\t\t\t// Add the parent_category_id to the item array;\n\t\t\t$category = Item::find($item->id)->category()->first(); \n\t\t\twhile($category->parent_id != NULL)\n\t\t\t{\n\t\t\t\t// Get the current category collection\n\t\t\t\t$category = Category::find($category->parent_id);\t\t\t\t\n\t\t\t}\n\n\t\t\tarray_add($item, 'parent_category_id', $category->id);\n\t\t}\n\n\n\t\t// Check the if ajax request\n\t\tif(Request::ajax()) {\n\t\t\treturn Response::json(View::make('ajax/item-ajax', compact('items', 'parentCategory', 'trigger'))->render());\n\t\t}\n\n\n\n\n\n\n\t\treturn View::make('frontend/item/view-item-list', compact('items', 'parentCategory', 'trigger'));\t\n\t}", "public function build(): BatchRetrieveInventoryCountsResponse\n {\n return CoreHelper::clone($this->instance);\n }", "public function addCartOneItem(AddCartRequest $request)\n {\n $data = Cart::addToCart($request);\n return response()->json($data);\n }", "public function itemsSummaryData()\n {\n $items = Item::all();\n $batches = Batch::all();\n $deficitItems = $items->filter(function ($item) {\n return $item->stock <= $item->reorder_level;\n });\n $deficitItemsCount = $deficitItems->count();\n $expiredItems = $batches->filter(function ($batch) {\n return $batch->expire_date <= now()->toDateString();\n });\n $expiredItemsCount = $expiredItems->count();\n return ResponseHelper::findSuccess('Items Summary Data', [\n 'deficitItems' => ItemSuppliersResource::collection($deficitItems),\n 'deficitItemsCount' => $deficitItemsCount,\n 'expiredItems' => BatchResource::collection($expiredItems),\n 'expiredItemsCount' => $expiredItemsCount\n ]);\n }", "abstract public function add_item();", "public function addItem($item)\n {\n if (!$this->getItems()) {\n return $this->setItems(array($item));\n } else {\n return $this->setItems(\n array_merge($this->getItems(), array($item))\n );\n }\n }", "function item_listing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $ret = array(\n 'content' => '',\n 'status' => 'fail'\n );\n if (!empty($_POST)) {\n $id = $_POST['id'];\n $searchData = $_POST['searchData'];\n $searchData['provider_id'] =$this->user_model->getProviderId($this->global['login_id']);\n\n // get top list data in homepage\n switch ($id) {\n case 1:\n if($this->isTicketter() == FALSE){\n $header = array(\"序号\", \"订单号\", \"终端便利店\", \"收货人\", \"联系电话\", \"付款方式\", \"订单状态\", \"配送员\", \"提交时间\", \"操作\");\n $cols = 10;\n }else if($this->isAdmin() == FALSE){\n $header = array(\"序号\", \"订单号\", \"终端便利店\", \"收货人\", \"联系电话\", \"付款方式\", \"订单状态\", \"所属区域总代理\", \"提交时间\", \"操作\");\n $cols = 10;\n }\n\n $contentList = $this->order_model->getItems($searchData);\n// foreach ($contentList as $item){\n// // get activity information\n// $activity = $this->activity_model->getItemById($item->activity_ids);\n// $activity->products = $this->activity_model->getProductsFromIds($activity->product_id, $activity->provider_id);\n//\n// $orderinfo = array(\n// 'id' => $item->id,\n// 'product_info' => json_encode($activity->products)\n// );\n// $this->order_model->update($orderinfo, $item->id);\n// }\n\n $footer = (count($contentList) == 0 || !isset($contentList)) ? $footer = \"没有订单.\" : '';\n break; // get top1\n }\n\n // end get\n $ret['header'] = $this->output_header($header);\n $ret['content'] = $this->output_content($contentList, $id);\n $ret['footer'] = $this->output_footer($footer, $cols);\n $ret['status'] = 'success';\n }\n echo json_encode($ret);\n }\n }", "public function get_items(){\n $list = get_post_meta( $this->ID, 'eazy_owl_carousel_repeat_group' );\n\n foreach ( $list[0] AS $i => $item ){\n array_push($this->items, (object) $item);\n }\n }", "public function addToItemResults(\\StructType\\ItemResult $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\StructType\\ItemResult) {\n throw new \\InvalidArgumentException(sprintf('The ItemResults property can only contain items of \\StructType\\ItemResult, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->ItemResults[] = $item;\n return $this;\n }", "public function addItem($item_id, $item_type) {\n $this->apiCall('items.json', 'POST', array('pio_iid' => $item_id, 'pio_itypes' => $item_type));\n }", "public function addToItemID($itemID)\n {\n $this->itemID[] = $itemID;\n return $this;\n }", "public function getItems()\n {\n $pageSize = $this->request->query('pageSize') ?? 30;\n $page = $this->request->query('page') ?? 1;\n $sortBy = $this->request->query('sort') ?? 'title_asc';\n $search = $this->request->has('search') ? $this->request->query('search') : null;\n $allowedFields = ['title', 'author', 'isbn'];\n $allowedOrder = ['asc', 'desc'];\n $sort = ControllerHelpers::deserializeSort($sortBy, $allowedFields, $allowedOrder);\n if (!$sort) {\n return response()->json([\n 'success' => false,\n 'message' => 'Please enter a valid sort params'\n ], 400);\n }\n\n $items = new ItemService();\n try {\n $result = $items->getItems($page, $pageSize, $search, $sort);\n if ($result) {\n return response()->json([\n 'success' => true,\n 'items' => $result\n ], 200);\n }\n } catch (Exception $ex) {\n return response()->json([\n 'success' => false,\n 'message' => 'your request could not be completed'\n ], 400);\n }\n\n }", "public function add()\n {\n $item = new stdClass();\n $item->item_id = null;\n $item->barcode = null;\n $item->price = null;\n $item->stock = null;\n $item->name = null;\n $item->category_id = null;\n $query_category = $this->categorys_m->get();\n $query_unit = $this->units_m->get();\n $unit[null] = '-Pilih-';\n foreach ($query_unit->result() as $u) {\n\n $unit[$u->unit_id] = $u->name;\n };\n $data = [\n 'page' => 'add',\n 'row' => $item,\n 'category' => $query_category,\n 'unit' => $unit,\n 'selectedunit' => null\n ];\n $this->template->load('template', 'product/item/item_add', $data);\n }", "public function addPricesToCollection($response)\n {\n if (isset($response['Book'])) {\n foreach ($response['Book'] as $offer) {\n $offer = (object) $offer;\n $price = $this->createNewPrice();\n if (isset($offer->listingPrice)) {\n if (isset($offer->listingCondition) && strtolower($offer->listingCondition) == 'new book') {\n $price->condition = parent::CONDITION_NEW;\n } elseif (isset($offer->itemCondition)) {\n $price->condition = $this->getConditionFromString($offer->itemCondition);\n }\n if (empty($price->condition)) {\n $price->condition = parent::CONDITION_GOOD;\n }\n $price->isbn13 = $offer->isbn13;\n $price->price = $offer->listingPrice;\n $price->shipping_price = $offer->firstBookShipCost;\n $price->url = 'http://affiliates.abebooks.com/c/74871/77797/2029?u='.urlencode($offer->listingUrl);\n $price->retailer = self::RETAILER;\n $price->term = parent::TERM_PERPETUAL;\n }\n $this->addPriceToCollection($price);\n }\n }\n return $this;\n }", "private function _GetEbayListingList(&$Queries, $Start, $SortField, $SortOrder, &$NumResults)\n\t{\n\t\t// Return an array containing details about news.\n\t\t// Takes into account search too.\n\n\t\t$query = \"SELECT ei.*,\n\t\t\t(\n\t\t\t\tSELECT IF(COUNT(orderprodid)>1,'Multiple',orderorderid)\n\t\t\t\tFROM [|PREFIX|]order_products op\n\t\t\t\tWHERE op.ebay_item_id = ei.ebay_item_id\n\t\t\t) AS order_no\n\t\t\tFROM [|PREFIX|]ebay_items ei\";\n\t\t$countQuery = \"SELECT COUNT(id) FROM [|PREFIX|]ebay_items ei\";\n\n\t\t$queryWhere = '';\n\t\tif(!empty($Queries)) {\n\t\t\t$conditions = array();\n\t\t\tif (!empty ($Queries['searchQueryListing'])) {\n\t\t\t\t$conditions[] = \" ei.title LIKE '%\".$GLOBALS['ISC_CLASS_DB']->Quote($Queries['searchQueryListing']).\"%' \";\n\t\t\t}\n\t\t\tif (!empty ($Queries['listingType'])) {\n\t\t\t\t$conditions[] = \" ei.listing_type = '\".$GLOBALS['ISC_CLASS_DB']->Quote($Queries['listingType']).\"' \";\n\t\t\t}\n\t\t\tif (!empty ($Queries['listingStatus'])) {\n\t\t\t\t$conditions[] = \" ei.listing_status = '\".$GLOBALS['ISC_CLASS_DB']->Quote($Queries['listingStatus']).\"' \";\n\t\t\t}\n\t\t\tif (!empty ($conditions)) {\n\t\t\t\t$queryWhere .= ' WHERE ' . implode(' AND ', $conditions);\n\t\t\t}\n\t\t}\n\n\t\t// Add any conditions on to the query\n\t\t$query .= $queryWhere;\n\t\t$countQuery .= $queryWhere;\n\n\t\tif ($SortField != '') {\n\t\t\t$query .= \" ORDER BY \".$SortField.\" \".$SortOrder;\n\t\t}\n\n\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($countQuery);\n\t\t$NumResults = $GLOBALS['ISC_CLASS_DB']->FetchOne($result);\n\n\t\t// Add the limit\n\t\t$query .= $GLOBALS[\"ISC_CLASS_DB\"]->AddLimit($Start, ISC_EBAY_LISTING_PER_PAGE);\n\t\t$result = $GLOBALS[\"ISC_CLASS_DB\"]->Query($query);\n\t\treturn $result;\n\t}", "public function getsingle($item_id){\n $resource = Mage::getSingleton('core/resource');\n \n /**\n * Retrieve the read connection\n */\n $readConnection = $resource->getConnection('core_read');\n \n $table = $resource->getTableName('core/config_data');\n \n /**\n * Set the product ID\n */\n \n $query = \"SELECT value FROM \" . $table . \" WHERE path='ebay/settings/app_name'\"; \n \n \n /**\n * Execute the query and store the results in $results\n */\n $results = $readConnection->fetchAll($query);\n \n /**\n * Print out the results\n */\n ;\n\n\n $passurl=\"http://open.api.ebay.com/shopping?callname=GetSingleItem&responseencoding=XML&appid=\".$results[0]['value'].\"&siteid=77&version=515&ItemID=\".$item_id.\"&IncludeSelector=Variations,Description,Details,ItemSpecifics,ShippingCosts,QuantitySold,Quantity\";\n \n $responseXml= file_get_contents($passurl);\n \n $responseDoc = new DomDocument();\n $responseDoc->loadXML($responseXml);\n \n \n $des = $responseDoc->getElementsByTagName('Description')->item(0)->nodeValue;\n $soldqty = $responseDoc->getElementsByTagName('QuantitySold')->item(0)->nodeValue;\n $qty = $responseDoc->getElementsByTagName('Quantity')->item(0)->nodeValue;\n \n $itemSpecific = $responseDoc->getElementsByTagName('ItemSpecifics')->item(0);\n $listElements = $itemSpecific->getElementsByTagName('NameValueList');\n $i=0;\n foreach($listElements as $listElement){\n $name=$listElement->getElementsByTagName('Name')->item(0)->nodeValue;\n $value=$listElement->getElementsByTagName('Value')->item(0)->nodeValue;\n $m = Mage::getModel('catalog/resource_eav_attribute')\n ->loadByCode('catalog_product',$name);\n\n if(null===$m->getId()) { $this->createAttribute($name, $name, \"text\", \"simple\"); }\n $name_value_list[$i]=array($name,$value);\n $i++;\n }//for each attribute\n \n $name_value_list=$name_value_list;\n \n /*---------------------------import variation------------------- */\n $option=$option_label=array();\n if($responseDoc->getElementsByTagName('Variation')){\n $variation_list = $responseDoc->getElementsByTagName('Variation');\n }\n $i=0;\n foreach($variation_list as $variation){\n $listElements = $variation->getElementsByTagName('NameValueList');\n $j=0;\n foreach($listElements as $listElement){\n $name=$listElement->getElementsByTagName('Name')->item(0)->nodeValue;\n $value=$listElement->getElementsByTagName('Value')->item(0)->nodeValue;\n $option[$j][$i]=$value; \n $option_label[$j]=$name;\n $j++;\n }\n \n $i++;\n }\n $data_arr1['option']=$option;\n $data_arr1['option_label']= $option_label;\n \n /*--------------------------------end------------------------- */\n \n \n $picture_url= $responseDoc->getElementsByTagName('PictureURL');\n $z=0;\n foreach ($picture_url as $p){\n $p_url[$z]=$p->nodeValue;\n $z++;\n break;\n }\n \n if(empty($p_url)){\n $p_url[0]='http://thumbs.ebaystatic.com/pict/3193577262_3.jpg';\n }\n \n $days = $responseDoc->getElementsByTagName('HandlingTime')->item(0)->nodeValue;\n if(!empty($p_url)){\n $importDir = Mage::getBaseDir('media') . DS . 'import' . DS;\n $i=0;\n foreach($p_url as $p){\n $content=@file_get_contents($p);\n $save = $item_id .$i. '.jpg'; \n $path[$i]=$importDir.''.$save;\n @file_put_contents($path[$i],$content);\n $i++;\n }//each photos\n \n $result['description'] = $des;\n $result['soldqty'] = $soldqty;\n $result['qty'] = $qty;\n $result['path'] = $path;\n $result['name_value_list'] = $name_value_list;\n $result['option'] = $option;\n $result['option_label'] = $option_label;\n \n return $result;\n \n }//if photos \n }", "function addItem(){\r\n\t global $itemsArray;\r\n\r\n //when the user clicks add, I pass id to the URL bar as a query string, again I'm checking if it exist or not (if the user has \r\n\t //clicked the add button or not)\r\n\r\n\t//if it exists on the URL bar I begin the magic of adding items to the Cart\r\n\r\n\tif ( isset( $_GET[\"itemId\"] ) ) {\r\n\t\t\r\n\t\t//This is the session that stores the total Price of the items in the cart\r\n\t\t//here I'm initializing it to zero....only if it doesn't exists at this point in time\r\n\t\t//if I don't put the ! sign the session will always be zero coz it's gonna be re-initized to zero everytime the\r\n //page is refreshed (everytime the add button is clicked)\r\n\t\tif(!isset($_SESSION[\"total\"])){\r\n\t\t\t$_SESSION[\"total\"] = 0;\r\n\t\t}\r\n //does the same as the above code but for the number of items in the cart\r\n\t\tif(!isset($_SESSION[\"nuOfItems\"])){\r\n\t\t\t$_SESSION[\"nuOfItems\"] = 0;\r\n\t\t}\r\n\r\n\t\t//==================================================================================================\r\n\t\t\t\t//ADDING ITEM TO THE CART\r\n\t\t//==================================================================================================\r\n\t\t\t\r\n \r\n //The code below ads items to the cart.....I grab the itemID from the URL bar and assign to a varible named itemId\r\n\t\t$itemId = (int) $_GET[\"itemId\"];\r\n\t\t//I grab the price from the URL bar also\r\n\t\t$price = $_GET[\"price\"];\r\n\r\n\t\t\t\r\n\t\tif (!isset( $_SESSION[\"cart\"][$itemId] ) ) {\r\n\r\n \r\n //kinda hard to explain....when this scripts loads I store objects of all items in the datbase to the $itemsArray, \r\n\t\t\t //each object in the array is indexed by it's id...Ok...\r\n\t\t\t //ie object1 will be at index 3 if it's Id is 3 .... ($itemsArray[3] = object1;)\r\n //now the statement below says take whatever object that is stored at index $itemId , in the itemsArray object and store\r\n\t\t\t // to the cart\r\n\r\n\t\t\t//reference: Beginning PHP 5.3 by Matt Doyle (Downloadable from google) ,Page 284. - Create a Simple Shopping Cart\r\n\r\n\t\t\t$_SESSION[\"cart\"][$itemId] = $itemsArray[$itemId];\r\n\r\n\r\n\t\t\t$_SESSION[\"nuOfItems\"] = $_SESSION[\"nuOfItems\"]+1; //increments the number of items in the cart \r\n\t\t\t$_SESSION[\"total\"] = $_SESSION[\"total\"]+$price; //increments current total by the that is recived from the URL\r\n\r\n\r\n\t\t}\r\n\t\t\r\n \r\n\t\t\t\r\n\t\t\r\n\t}\r\n\tsession_write_close();\r\n\t//header( \"Location: index.php\" ); //redirects the user to the home page\r\n\r\n}", "public function add($item)\n {\n\n $this->items[] = $item;\n return $this;\n\n }", "public function addItemStock()\n {\n $this->validate($this->request, [\n 'itemCondition' => 'required|string',\n 'itemStateId' => 'required|integer|min:1',\n ]);\n $items = array(\n 'itemStateId' => $this->request->input('itemStateId'),\n 'itemCondition' => $this->request->input( 'itemCondition'),\n );\n $id = $this->request->id;\n try {\n $item = new ItemService();\n $result = $item->addToItemStock($items, $id);\n\n if ($result) {\n return response()->json([\n 'success' => true,\n 'data' => [\n 'itemId' => $result,\n ],\n 'message' => 'Item Added Successfully',\n ], 200);\n }\n return response()->json([\n 'success' => false,\n 'message' => 'item could not be added'\n ], 400);\n } catch (Exception $ex) {\n return response()->json([\n 'success' => false,\n 'message' => 'Error Occured Adding Items. Ensure the IDs are Valid'\n ], 400);\n }\n }", "public function Relist()\n {\n $args = array(\n 'ItemId' => $this->properties['Id']\n );\n $call = Services_Ebay::loadAPICall('RelistItem');\n $call->setArgs($args);\n \n return $call->call($this->session);\n }", "public function GetImItemList($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }", "public function addItem($feedItem)\n {\n $this->items[] = $feedItem;\n }", "public function setItem_list($item_list)\r\n {\r\n $this->item_list = $item_list;\r\n\r\n return $this;\r\n }", "function processListingItem( $item, $order ) {\n\t\tglobal $wpdb;\n\n\t\t// abort if item data is invalid\n\t\tif ( ! isset( $item->ASIN ) && ! isset( $item->QuantityOrdered ) ) {\n\t\t\t$history_message = \"Error fetching order line items - request throttled?\";\n\t\t\t$history_details = array();\n\t\t\tself::addHistory( $order->AmazonOrderId, 'request_throttled', $history_message, $history_details );\n\t\t\treturn false;\n\t\t}\n\n\t\tdo_action( 'wpla_before_process_listing_item', $item, $order );\n\n\t\t$order_id = $order->AmazonOrderId;\n\t\t$asin = $item->ASIN;\n\t\t$sku = $item->SellerSKU;\n\t\t$quantity_purchased = $item->QuantityOrdered;\n\t\t\n\t\t// get listing item\n\t\t$lm = new WPLA_ListingsModel();\n\t\t$listing = $lm->getItemBySKU( $sku );\n\n\t\t// skip if this listing does not exist in WP-Lister\n\t\tif ( ! $listing ) {\n\t\t\t$history_message = \"Skipped unknown SKU {$sku} ({$asin})\";\n\t\t\t$history_details = array( 'sku' => $sku, 'asin' => $asin );\n\t\t\tself::addHistory( $order_id, 'skipped_item', $history_message, $history_details );\n\t\t\treturn true;\n\t\t}\n\n\n\t\t// handle FBA orders\n\t\tif ( $order->FulfillmentChannel == 'AFN' ) {\n\n\t\t\t// update quantity for FBA orders\n\t\t\t$fba_quantity = $listing->fba_quantity - $quantity_purchased;\n\t\t\t$quantity_sold = $listing->quantity_sold + $quantity_purchased;\n\n\t\t\t$wpdb->update( $wpdb->prefix.'amazon_listings', \n\t\t\t\tarray( \n\t\t\t\t\t'fba_quantity' => $fba_quantity,\n\t\t\t\t\t'quantity_sold' => $quantity_sold \n\t\t\t\t), \n\t\t\t\tarray( 'sku' => $sku ) \n\t\t\t);\n\n\t\t\t// add history record\n\t\t\t$history_message = \"FBA quantity reduced by $quantity_purchased for listing {$sku} ({$asin}) - FBA stock $fba_quantity ($quantity_sold sold)\";\n\t\t\t$history_details = array( 'fba_quantity' => $fba_quantity, 'sku' => $sku, 'asin' => $asin, 'qty_purchased' => $quantity_purchased, 'listing_id' => $listing->id );\n\t\t\tself::addHistory( $order_id, 'reduce_stock', $history_message, $history_details );\n\n\t\t} else {\n\n\t\t\t// update quantity for non-FBA orders\n\t\t\t$quantity_total = $listing->quantity - $quantity_purchased;\n\t\t\t$quantity_sold = $listing->quantity_sold + $quantity_purchased;\n\t\t\t$wpdb->update( $wpdb->prefix.'amazon_listings', \n\t\t\t\tarray( \n\t\t\t\t\t'quantity' => $quantity_total,\n\t\t\t\t\t'quantity_sold' => $quantity_sold \n\t\t\t\t), \n\t\t\t\tarray( 'sku' => $sku ) \n\t\t\t);\n\n\t\t\t// add history record\n\t\t\t$history_message = \"Quantity reduced by $quantity_purchased for listing {$sku} ({$asin}) - new stock: $quantity_total ($quantity_sold sold)\";\n\t\t\t$history_details = array( 'newstock' => $quantity_total, 'sku' => $sku, 'asin' => $asin, 'qty_purchased' => $quantity_purchased, 'listing_id' => $listing->id );\n\t\t\tself::addHistory( $order_id, 'reduce_stock', $history_message, $history_details );\n\n\t\t}\n\n\n\n\t\t// mark listing as sold when last item is sold\n\t\t// if ( $quantity_total == 0 ) {\n\t\t// \t$wpdb->update( $wpdb->prefix.'amazon_listings', \n\t\t// \t\tarray( 'status' => 'sold', 'date_finished' => $data['date_created'], ), \n\t\t// \t\tarray( 'sku' => $sku ) \n\t\t// \t);\n\t\t// \tWPLA()->logger->info( 'marked item '.$sku.' as SOLD ');\n\t\t// }\n\n\n\n\t\treturn true;\n\t}", "private function generateItems()\n {\n $entries = $this->item;\n if ( $entries === null )\n {\n return;\n }\n\n foreach ( $entries as $entry )\n {\n $entryTag = $this->xml->createElement( 'entry' );\n $this->channel->appendChild( $entryTag );\n \n if ( !is_null( $entry->language ) )\n {\n $this->addAttribute( $entryTag, 'xml:lang', $entry->language );\n }\n\n $elements = array( 'id', 'title', 'updated' );\n\n foreach ( $elements as $element )\n {\n $data = $entry->$element;\n\n if ( is_null( $data ) )\n {\n throw new ezcFeedRequiredMetaDataMissingException( \"/feed/entry/{$element}\" );\n }\n\n switch ( $element )\n {\n case 'id':\n $this->generateMetaData( $entryTag, $element, $data );\n break;\n\n case 'title':\n $this->generateTextNode( $entryTag, $element, $data );\n break;\n\n case 'updated':\n // Sample date: 2003-12-13T18:30:02-05:00\n $this->generateMetaData( $entryTag, $element, $data->date->format( 'c' ) );\n break;\n }\n }\n\n // ensure the ATOM rules are applied\n $content = $entry->content;\n $summary = $entry->description;\n $links = $entry->link;\n $contentPresent = !is_null( $content );\n $contentSrcPresent = $contentPresent && is_object( $content ) && !is_null( $content->src );\n $contentBase64 = true;\n if ( $contentPresent && is_object( $content )\n && ( in_array( $content->type, array( 'text', 'html', 'xhtml', null ) )\n || preg_match( '@[+/]xml$@i', $content->type ) !== 0\n || substr_compare( $content->type, 'text/', 0, 5, true ) === 0 ) )\n {\n $contentBase64 = false;\n }\n\n $summaryPresent = !is_null( $summary );\n $linkAlternatePresent = false;\n if ( $links !== null )\n {\n foreach ( $links as $link )\n {\n // if the rel attribute is not set or if it is \"alternate\"\n // then there is at least one rel=\"alternate\" link in the feed entry\n if ( !isset( $link->rel )\n || $link->rel === 'alternate' )\n {\n $linkAlternatePresent = true;\n break;\n }\n }\n }\n\n if ( !$contentPresent )\n {\n if ( !$linkAlternatePresent && !$summaryPresent )\n {\n throw new ezcFeedRequiredMetaDataMissingException( '/feed/entry/content' );\n }\n\n if ( !$linkAlternatePresent )\n {\n throw new ezcFeedRequiredMetaDataMissingException( '/feed/entry/link@rel=\"alternate\"' );\n }\n\n if ( !$summaryPresent )\n {\n throw new ezcFeedRequiredMetaDataMissingException( '/feed/entry/summary' );\n }\n }\n\n if ( $contentPresent )\n {\n if ( ( $contentSrcPresent || $contentBase64 ) && !$summaryPresent )\n {\n throw new ezcFeedRequiredMetaDataMissingException( '/feed/entry/summary' );\n }\n }\n\n $elements = array( 'author', 'content', 'link', 'description',\n 'category', 'contributor', 'published', 'copyright',\n 'source', 'enclosure' );\n\n if ( $entry->link !== null )\n {\n $this->checkLinks( $entryTag, $entry->link );\n }\n\n foreach ( $elements as $element )\n {\n $data = $entry->$element;\n\n if ( is_null( $data ) )\n {\n continue;\n }\n\n switch ( $element )\n {\n case 'description':\n $this->generateTextNode( $entryTag, 'summary', $data );\n break;\n\n case 'copyright':\n $this->generateTextNode( $entryTag, 'rights', $data );\n break;\n\n case 'content':\n $this->generateContentNode( $entryTag, $element, $data );\n break;\n\n case 'author':\n case 'contributor':\n foreach ( $data as $dataNode )\n {\n $this->generatePerson( $entryTag, $element, $dataNode );\n }\n break;\n\n case 'link':\n foreach ( $data as $dataNode )\n {\n $this->generateLink( $entryTag, $dataNode );\n }\n break;\n\n case 'published':\n // Sample date: 2003-12-13T18:30:02-05:00\n $this->generateMetaData( $entryTag, $element, $data->date->format( 'c' ) );\n break;\n\n case 'category':\n foreach ( $data as $dataNode )\n {\n $this->generateCategory( $entryTag, $dataNode );\n }\n break;\n\n case 'source':\n $this->generateSource( $entryTag, $data );\n break;\n\n case 'enclosure':\n // convert RSS2 enclosure elements in ATOM link elements\n foreach ( $data as $dataNode )\n {\n $link = new ezcFeedLinkElement();\n $link->href = $dataNode->url;\n $link->length = $dataNode->length;\n $link->type = $dataNode->type;\n $link->rel = 'enclosure';\n\n $this->generateLink( $entryTag, $link );\n }\n break;\n }\n }\n\n $this->generateItemModules( $entry, $entryTag );\n }\n }", "public function getCategoryItems_v1()\n\t{\n\t\tJSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN'));\n\n\t\t// Get API objects / data\n\t\t$app = Factory::getApplication();\n\t\t$user = Factory::getUser();\n\t\t$db = Factory::getDbo();\n\n\t\t// Get Access Levels of user\n\t\t$uacc = array_flip(JAccess::getAuthorisedViewLevels($user->id));\n\n\n\t\t// Get request variables\n\t\t$field_id = $app->input->get('field_id', 0, 'int');\n\t\t$item_id = $app->input->get('item_id', 0, 'int');\n\t\t$type_id = $app->input->get('type_id', 0, 'int');\n\t\t$lang_code = $app->input->get('lang_code', 0, 'cmd');\n\t\t$catid = $app->input->get('catid', 0, 'int');\n\t\t$customfilts = $app->input->get('customfilts', '', 'String');\n\n\t\t// Basic checks\n\t\t$response = array();\n\t\t$response['error'] = '';\n\t\t$response['options'] = array();\n\n\n\t\tif (!$field_id)\n\t\t{\n\t\t\t$response['error'] = 'Invalid field_id';\n\t\t}\n\n\t\telseif (!$catid)\n\t\t{\n\t\t\t$response['error'] = 'Invalid catid';\n\t\t}\n\n\t\tif ($response['error'])\n\t\t{\n\t\t\tjexit(json_encode($response));\n\t\t}\n\n\n\t\t/**\n\t\t * Load and check field\n\t\t */\n\n\t\t$field = JTable::getInstance($_type = 'flexicontent_fields', $_prefix = '', $_config = array());\n\n\t\tif (!$field->load($field_id))\n\t\t{\n\t\t\t$response['error'] = 'field not found';\n\t\t}\n\n\t\telseif ($field->field_type !== 'relation')\n\t\t{\n\t\t\t$response['error'] = 'field id is not a relation field';\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\t$is_editable = !$field->valueseditable || $user->authorise('flexicontent.editfieldvalues', 'com_flexicontent.field.' . $field->id);\n\n\t\t\tif (!$is_editable)\n\t\t\t{\n\t\t\t\t$response['error'] = 'you do not have permission to edit lthis field';\n\t\t\t}\n\t\t}\n\n\t\tif ($response['error'])\n\t\t{\n\t\t\tjexit(json_encode($response));\n\t\t}\n\n\n\t\t/**\n\t\t * Load and check item\n\t\t */\n\n\t\t$item = JTable::getInstance($_type = 'flexicontent_items', $_prefix = '', $_config = array());\n\n\t\tif (!$item_id)\n\t\t{\n\t\t\t$item->type_id = $type_id;\n\t\t\t$item->language = $lang_code;\n\t\t\t$item->created_by = $user->id;\n\t\t}\n\n\t\telseif (!$item->load($item_id))\n\t\t{\n\t\t\t$response['error'] = 'content item not found';\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\t$asset = 'com_content.article.' . $item->id;\n\t\t\t$isOwner = $item->created_by == $user->get('id');\n\t\t\t$canEdit = $user->authorise('core.edit', $asset) || ($user->authorise('core.edit.own', $asset) && $isOwner);\n\n\t\t\tif (!$canEdit)\n\t\t\t{\n\t\t\t\t$response['error'] = 'content item has non-allowed access level';\n\t\t\t}\n\t\t}\n\n\t\tif ($response['error'])\n\t\t{\n\t\t\tjexit(json_encode($response));\n\t\t}\n\n\n\t\t// ***\n\t\t// *** Load field configuration\n\t\t// ***\n\n\t\tFlexicontentFields::loadFieldConfig($field, $item);\n\t\t$field->item_id = $item_id;\n\n\t\t// Some needed parameters\n\t\t$maxtitlechars = $field->parameters->get('maxtitlechars', 40);\n\n\n\t\t// ***\n\t\t// *** SCOPE PARAMETERS\n\t\t// ***\n\n\t\t// NOTE: categories scope parameters ... not used here, since category scope is checked by calling getAllowedCategories()\n\n\t\t// types scope parameters\n\t\t$method_types = (int) $field->parameters->get('method_types', 1);\n\t\t$types = $field->parameters->get('types');\n\n\t\tif (empty($types))\n\t\t{\n\t\t\t$types = array();\n\t\t}\n\n\t\telseif (!is_array($types))\n\t\t{\n\t\t\t$types = explode('|', $types);\n\t\t}\n\n\t\t// other limits of scope parameters\n\t\t$samelangonly = (int) $field->parameters->get('samelangonly', 1);\n\t\t$onlypublished = (int) $field->parameters->get('onlypublished', 1);\n\t\t$ownedbyuser = (int) $field->parameters->get('ownedbyuser', 0);\n\n\n\t\t/**\n\t\t * Item retrieving query ... CREATE WHERE CLAUSE according to configured limitations SCOPEs\n\t\t */\n\t\t$where = array();\n\n\t\t// Exclude currently edited item\n\t\tif ($item_id)\n\t\t{\n\t\t\t$where[] = ' i.id <> ' . (int) $item_id;\n\t\t}\n\n\n\t\t/**\n\t\t * CATEGORY SCOPE\n\t\t */\n\n\t\t$allowed_cats = $this->getAllowedCategories($field);\n\n\t\tif (empty($allowed_cats))\n\t\t{\n\t\t\tjexit(json_encode(array(\n\t\t\t\t'error' => JText::_('FLEXI_CANNOT_EDIT_FIELD') . ': <br/> ' . JText::_('FLEXI_NO_ACCESS_TO_USE_CONFIGURED_CATEGORIES')\n\t\t\t)));\n\t\t}\n\n\t\t// Check given category (-ies) is in the allowed categories\n\t\t$request_catids = array($catid);\n\t\t$catids = array_intersect($allowed_cats, $request_catids);\n\n\t\tif (empty($catids))\n\t\t{\n\t\t\tjexit(json_encode(array(\n\t\t\t\t'error' => JText::_('FLEXI_RIFLD_CATEGORY_NOT_ALLOWED')\n\t\t\t)));\n\t\t}\n\n\t\t// Also include subcategory items\n\t\t$subcat_items = (int) $field->parameters->get('subcat_items', 1);\n\n\t\tif ($subcat_items)\n\t\t{\n\t\t\tglobal $globalcats;\n\t\t\t$_catids = array();\n\n\t\t\tforeach ($catids as $catid)\n\t\t\t{\n\t\t\t\t$subcats = $globalcats[$catid]->descendantsarray;\n\n\t\t\t\tforeach ($subcats as $subcat)\n\t\t\t\t{\n\t\t\t\t\t$_catids[(int) $subcat] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$catids = array_keys($_catids);\n\t\t}\n\n\t\t$where[] = ' rel.catid IN (' . implode(',', $catids) . ') ';\n\n\n\t\t/**\n\t\t * TYPE SCOPE\n\t\t */\n\n\t\tif (($method_types === 2 || $method_types === 3) && (!count($types) || empty($types[0])))\n\t\t{\n\t\t\tjexit(json_encode(array(\n\t\t\t\t'error' => 'Content Type scope is set to include/exclude but no Types are selected in field configuration, please set to \"ALL\" or select types to include/exclude'\n\t\t\t)));\n\t\t}\n\n\t\t// exclude method\n\t\tif ($method_types === 2)\n\t\t{\n\t\t\t$where[] = ' ie.type_id NOT IN (' . implode(',', $types) . ')';\n\t\t}\n\n\t\t// include method\n\t\telseif ($method_types === 3)\n\t\t{\n\t\t\t$where[] = ' ie.type_id IN (' . implode(',', $types) . ')';\n\t\t}\n\n\n\t\t/**\n\t\t * OTHER SCOPE LIMITATIONS\n\t\t */\n\n\t\tif ($samelangonly)\n\t\t{\n\t\t\t$where[] = !$item->language || $item->language === '*'\n\t\t\t\t? ' i.language = ' . $db->Quote('*')\n\t\t\t\t: ' (i.language = ' . $db->Quote($item->language) . ' OR i.language = ' . $db->Quote('*') . ') ';\n\t\t}\n\n\t\tif ($onlypublished)\n\t\t{\n\t\t\t$where[] = ' i.state IN (1, -5) ';\n\t\t}\n\n\t\tif ($ownedbyuser === 1)\n\t\t{\n\t\t\t$where[] = ' i.created_by = ' . (int) $user->id;\n\t\t}\n\t\telseif ($ownedbyuser === 2)\n\t\t{\n\t\t\t$where[] = ' i.created_by = ' . (int) $item->created_by;\n\t\t}\n\n\n\t\t/**\n\t\t * Item retrieving query ... CREATE ORDERBY CLAUSE\n\t\t */\n\n\t\t$order = $field->parameters->get('orderby_form', 'alpha');; // TODO: add more orderings: commented, rated\n\t\t$orderby = flexicontent_db::buildItemOrderBy(\n\t\t\t$field->parameters,\n\t\t\t$order, $request_var = '', $config_param = '',\n\t\t\t$item_tbl_alias = 'i', $relcat_tbl_alias = 'rel',\n\t\t\t$default_order = '', $default_order_dir = '', $sfx = '_form', $support_2nd_lvl = false\n\t\t);\n\n\t\t// Create JOIN for ordering items by a most rated\n\t\t$orderby_join = in_array('author', $order) || in_array('rauthor', $order)\n\t\t\t? ' LEFT JOIN #__users AS u ON u.id = i.created_by'\n\t\t\t: '';\n\n\t\t// Create JOIN for getting item types\n\t\t$types_join = $method_types > 1\n\t\t\t? ' LEFT JOIN #__flexicontent_items_ext AS ie ON i.id = ie.item_id '\n\t\t\t: '';\n\n\t\t// Custom filters\n\t\t$customfilts_join = '';\n\t\t$filter_ids = $this->getFilterIds($field);\n\t\tif ($filter_ids && $customfilts)\n\t\t{\n\t\t\tparse_str($customfilts,$values);\n\n\t\t\t$filters = $db->setQuery($db->getQuery(true)\n\t\t\t\t->select('id, field_type')->from('#__flexicontent_fields')->where('id IN (' . implode(',', $filter_ids) . ')')\n\t\t\t)->loadObjectList('id');\n\n\t\t\tforeach($values as $filt_name => $filt_vals)\n\t\t\t{\n\t\t\t\t$filt_id = str_replace('filter_', '', $filt_name);\n\n\t\t\t\t// Skip filters without value or missing filters\n\t\t\t\t$empty_filt_vals_array = is_array($filt_vals) && !strlen(trim(implode('',$filt_vals)));\n\t\t\t\t$empty_filt_vals_string = !is_array($filt_vals) && !strlen(trim($filt_vals));\n\n\t\t\t\tif ( $empty_filt_vals_array || $empty_filt_vals_string ) continue;\n\t\t\t\tif ( !isset($filters[$filt_id]) ) continue;\n\n\t\t\t\t$fval = 'fval_' . (int) $filt_id;\n\t\t\t\t$customfilts_join .= \" JOIN #__flexicontent_fields_item_relations AS {$fval} on i.id = {$fval}.item_id AND {$fval}.field_id = \" . (int) $filt_id;\n\t\t\t\t$quoted_vals = [];\n\t\t\t\tforeach ($filt_vals as $v) $quoted_vals[] = $db->q($v);\n\t\t\t\tif ($filters[(int) $filt_id]->field_type == 'relation')\n\t\t\t\t{\n\t\t\t\t\t$where[] = \" {$fval}.value_integer IN (\" . implode(', ', $quoted_vals) . \")\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$where[] = \" {$fval}.value IN (\" . implode(', ', $quoted_vals) . \")\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t/**\n\t\t * Item retrieving query ... put together and execute it\n\t\t */\n\n\t\t// Create the WHERE clause\n\t\t$where = !count($where)\n\t\t\t? ''\n\t\t\t: ' WHERE ' . implode(' AND ', $where);\n\n\t\t$query = 'SELECT i.id, i.catid, i.title, i.state, i.alias'\n\t\t\t. ' FROM #__content AS i '\n\t\t\t. $types_join\n\t\t\t. ' JOIN #__flexicontent_cats_item_relations AS rel on i.id=rel.itemid '\n\t\t\t. $orderby_join\n\t\t\t. $customfilts_join\n\t\t\t. $where\n\t\t\t. ' GROUP BY rel.itemid '\n\t\t\t. $orderby;\n\t\t$items_arr = $db->setQuery($query)->loadObjectList();\n\n\t\t// Some configuration\n\t\t$prepend_item_state = (int) $field->parameters->get('itemselector_prepend_item_state', 0);\n\t\t$append_field_ids = $field->parameters->get('itemselector_append_fields', []);\n\t\t$append_field_ids = FLEXIUtilities::paramToArray($append_field_ids);\n\t\t$state_shortname = array(1 => '', 0 => 'U', -1 => 'A', -3 => 'PE', -4 => 'OQ', -5 => 'IP');\n\n\t\tforeach ($items_arr as $itemdata)\n\t\t{\n\t\t\t$itemtitle = StringHelper::strlen($itemdata->title) > $maxtitlechars\n\t\t\t\t? StringHelper::substr($itemdata->title, 0, $maxtitlechars) . '...'\n\t\t\t\t: $itemdata->title;\n\t\t\t$append_field_text = [];\n\t\t\tforeach ($append_field_ids as $append_field)\n\t\t\t{\n\t\t\t\t$append_field_text[] = $append_field;\n\t\t\t}\n\t\t\t$itemtitle .= $append_field_text\n\t\t\t\t? ' [' . implode(', ', $append_field_text) . ']'\n\t\t\t\t: '';\n\n\t\t\tif ($prepend_item_state)\n\t\t\t{\n\t\t\t\t$statestr = $state_shortname[$itemdata->state] ?? '';\n\t\t\t\t$statestr = $statestr ? '[' . $statestr . ']' : '';\n\t\t\t\t$itemtitle = $statestr . $itemtitle . \" \";\n\t\t\t}\n\n\t\t\t$itemid = $itemdata->id;\n\n\t\t\t$response['options'][] = array('item_id' => $itemid, 'item_title' => $itemtitle);\n\t\t}\n\n\t\t//jexit(print_r($response, true));\n\n\t\t// Output the field\n\t\tjexit(json_encode($response));\n\t}", "public function prepare_item_for_response( $item, $request ) {\n $activities = get_post_meta($item->ID, 'activities');\n return [\n 'day' => $item,\n 'act' => array_map(function($act) {\n $act_obj = json_decode(html_entity_decode($act));\n $act_obj->img_url = get_the_post_thumbnail_url($act_obj->id, 'large');\n return $act_obj;\n }, $activities)\n ];\n }", "function get_item($item_id)\n\t{\n\t\tglobal $conn;\n\n\t\t$query=\"SELECT * FROM list_items WHERE item_id='$item_id' \";\n\t\t$result=mysqli_query($conn,$query);\n\n\t\t$item_data=\"\";\n\t\t\n\t\twhile($row = mysqli_fetch_array( $result))\n\t\t{\n\t\t\t$daily_price=$row['daily_rate'];\n\t\t\t$weekly_price=$row['weekly_rate'];\n\t\t\t$weekend_price=$row['weekend_rate'];\n\t\t\t$monthly_price=$row['monthly_rate'];\n\t\t\t$bond_price=$row['bond_rate'];\n\n\t\t\tif($daily_price=='0.00'){$daily_price=\"NA\";}\n\t\t\tif($weekly_price=='0.00'){$weekly_price=\"NA\";}\n\t\t\tif($weekend_price=='0.00'){$weekend_price=\"NA\";}\n\t\t\tif($monthly_price=='0.00'){$monthly_price=\"NA\";}\n\t\t\tif($bond_price=='0.00'){$bond_price=\"NA\";}\n\n\t\t\t$extra=array(\n\t\t\t\t'item_id'\t=>\t$row['item_id'],\n\t\t\t\t'item_pictures'\t=>\t$row['item_pictures'],\n\t\t\t\t'item_description'\t=>\t$row['item_description'],\n\t\t\t\t'item_name'\t=>\t$row['item_name'],\n\t\t\t\t'extra_option'\t=>\t$row['extra_option'],\t\t\t\t\n\t\t\t\t'user_id'\t=>\t$row['user_id'],\t\t\t\t\n\t\t\t\t'total_views'\t=>\t$row['total_views'],\t\t\t\t\n\t\t\t\t'cat_name'\t=>\t$row['cat_name'],\n\t\t\t\t'isLive'\t=>\t$row['isLive'],\n\t\t\t\t'user_name'\t=>\t$row['user_name'],\n\t\t\t\t'daily_rate'\t=>\t$daily_price,\n\t\t\t\t'weekly_rate'\t=>\t$weekly_price,\n\t\t\t\t'weekend_rate'\t=>\t$weekend_price,\n\t\t\t\t'monthly_rate'\t=>\t$monthly_price,\n\t\t\t\t'bond_rate'\t=>\t$bond_price\n\t\t\t);\n\t\t\t$item_data[]=$extra;\n\n\t\t}\n\n\t\tif(mysqli_query($conn, $query)){\n\t\t\t$response=array(\n\t\t\t\t'status' => 1,\n\t\t\t\t'items' => $item_data\t\t\t\t\t\t\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//insertion failure\n\t\t\t$response=array(\n\t\t\t\t'status' => 0,\n\t\t\t\t'status_message' =>'Item Details not found!!!'\t\t\t\n\t\t\t);\n\t\t}\n\t\theader('Content-Type: application/json');\n\t\techo json_encode($response);\n\t}", "public static function _register()\n {\n self::assignElements(['AddItemResponseContainer' => ['type' => 'AddItemResponseContainerType', 'xmlns' => self::XMLNS, 'cardinality' => '0..*']], parent::NAME);\n self::assignAttributes([]);\n }" ]
[ "0.5959775", "0.59046954", "0.5823438", "0.57163686", "0.5458576", "0.53723586", "0.5043326", "0.4992391", "0.49779144", "0.48841476", "0.47663286", "0.47312123", "0.47287688", "0.47039816", "0.4698875", "0.46446443", "0.46417227", "0.46344358", "0.46032843", "0.45956284", "0.45826307", "0.45628476", "0.45628476", "0.45628476", "0.45628476", "0.45628476", "0.45628476", "0.45628476", "0.45628476", "0.45628476", "0.45628476", "0.45628476", "0.45628476", "0.45628476", "0.45628476", "0.45628476", "0.45628476", "0.45628476", "0.45628476", "0.45628476", "0.45628476", "0.45470148", "0.45438644", "0.45336485", "0.45240524", "0.45140034", "0.45096534", "0.44715786", "0.44713503", "0.44560274", "0.44540864", "0.44333193", "0.44323704", "0.441666", "0.4403998", "0.4369242", "0.43591636", "0.4358248", "0.43464383", "0.4344182", "0.4342696", "0.43329293", "0.43299198", "0.43195558", "0.43108237", "0.43088645", "0.43075576", "0.43067598", "0.4298405", "0.42965156", "0.42857108", "0.42716628", "0.42666948", "0.42532644", "0.42441618", "0.42380267", "0.4230856", "0.42161164", "0.42122614", "0.42085183", "0.42070013", "0.4206158", "0.41924658", "0.41869354", "0.41858304", "0.41812482", "0.41782814", "0.41707617", "0.4168314", "0.41672507", "0.41641268", "0.4157236", "0.41557372", "0.41541657", "0.41537747", "0.41525072", "0.4150605", "0.41480535", "0.41432893", "0.414152" ]
0.6049604
0
Sets a new addItemResponseContainer One AddItemResponseContainer container is returned for each listing that was created with the AddItems call. Each container includes the ItemID of each newly created listings, the eBay category each item is listed under, the sellerdefined SKUs of the items (if any), the listing recommendations for each item (if applicable), the start and end time of each listing, and the estimated fees that each listing will incur.
public function setAddItemResponseContainer(array $addItemResponseContainer) { $this->addItemResponseContainer = $addItemResponseContainer; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addToAddItemResponseContainer(\\Nogrod\\eBaySDK\\Trading\\AddItemResponseContainerType $addItemResponseContainer)\n {\n $this->addItemResponseContainer[] = $addItemResponseContainer;\n return $this;\n }", "public function getAddItemResponseContainer()\n {\n return $this->addItemResponseContainer;\n }", "public function add_item()\n {\n $request = new Types\\AddItemRequestType();\n\n // An user token is required when using the Trading service.\n $request->RequesterCredentials = new Types\\CustomSecurityHeaderType();\n $request->RequesterCredentials->eBayAuthToken = $this->config->item('authToken');\n\n\n // Begin creating the auction item.\n $item = new Types\\ItemType();\n\n $item->DispatchTimeMax = 3;\n /**\n * We want a single quantity auction.\n * Otherwise known as a Chinese auction.\n */\n $item->ListingType = Enums\\ListingTypeCodeType::C_CHINESE;\n $item->Quantity = 1;\n\n $item->ProductListingDetails = new Types\\ProductListingDetailsType();\n $item->ProductListingDetails->ISBN = $ISBN;\n $item->ProductListingDetails->UPC = $UPC;\n $item->ProductListingDetails->EAN = $EAN;\n\n $item->ProductListingDetails->BrandMPN = new DTS\\eBaySDK\\Trading\\Types\\BrandMPNType();\n $item->ProductListingDetails->BrandMPN->Brand = '';\n $item->ProductListingDetails->BrandMPN->MPN = '';\n\n $item->ListingDuration = Enums\\ListingDurationCodeType::C_DAYS_7;\n\n }", "public static function add($response)\n\t{\n\t\tforeach ($response as $key => $value) {\n\t\t\tself::$response[$key] = $value;\n\t\t}\n\t}", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "protected function addItems()\n {\n $origin = 'stock';\n $code = 'cataloginventory';\n $message = Data::ERROR_QTY;\n $additionalData = null;\n $mockItems = [];\n\n for ($i = 0; $i < 2; $i++) {\n $mockItems[] = [\n 'origin' => $origin . $i,\n 'code' => $code,\n 'message' => $message . $i,\n 'additionalData' => $additionalData,\n ];\n $this->listStatus->addItem($origin . $i, $code, $message . $i, $additionalData);\n }\n return $mockItems;\n }", "public function addItem($item)\n {\n if ($item instanceof \\Fastbill\\Item\\Item)\n {\n $this['ITEMS'][] = $item;\n }\n else\n {\n $itemObj = new \\Fastbill\\Item\\Item();\n $itemObj->fillFromArray($item);\n $this['ITEMS'];\n }\n\n }", "public function Add()\n {\n if (isset($this->properties['ItemId']) && !is_null($this->properties['ItemId'])) {\n \tthrow new Services_Ebay_Exception('This item already has an ItemId and thus cannot be added.');\n }\n $call = Services_Ebay::loadAPICall('AddItem', array($this));\n \n return $call->call($this->session);\n }", "public function add_item($zajlib_feed_item){\n\t\t$this->items[] = $zajlib_feed_item; \n\t}", "public function add($item)\n {\n if ($item instanceof ItemInterface) {\n $this->items[] = $item;\n } else {\n $this->items[] = new PayPalItem($item);\n }\n }", "public function prepare_item_for_response($item, $request)\n {\n return array();\n }", "public function addItem($feedItem)\n {\n $this->items[] = $feedItem;\n }", "public function addItem($item) {\n\t\t$this->result .= '<li>' . $item . '</li>' . PHP_EOL;\n\t}", "public function addItemFromArray($item_array)\n {\n $this->items[] = new sfSitemapItem($item_array);\n \n return $this;\n }", "public function add($item)\n {\n $this->addArray('content', $item, array('ButtonContainer', 'Container', 'Form', 'Heading', 'HTML', 'Image', 'Checkbox', 'Email', 'HiddenField', 'Label', 'Password', 'Phone', 'RadioButtons', 'SelectMenu', 'TextInput', 'TextArea', 'Upload', 'XList', 'Table'));\n }", "public function additem()\r\n {\r\n $shipping = array( 'ShippingServiceOptions' => array(\r\n\r\n 'ShippingService' => 'UPSGround',\r\n 'ShippingServiceCost' => 0.0,\r\n 'ShippingServiceAdditionalCost' => 0.0,\r\n 'ShippingServicePriority' => 1,\r\n 'ExpeditedService' => false,\r\n\r\n\r\n ),\r\n 'ShippingType' => 'Flat',\r\n );\r\n\r\n $returnPolicy = array(\r\n 'ReturnsAcceptedOption' => 'ReturnsAccepted',\r\n 'RefundOption' => 'MoneyBack',\r\n 'ReturnsWithinOption' => 'Days_30',\r\n 'Description ' =>'If you are not satisfied, return the item for refund.',\r\n 'ShippingCostPaidByOption' => 'Buyer',\r\n );\r\n\r\n $item = array(\r\n 'PrimaryCategory' => array('CategoryID' => 111422), // ok\r\n 'Title' => 'Miechu nowy',\r\n 'Description' => 'Testowy opis',\r\n 'StartPrice' => 100, //\r\n 'BuyItNowPrice' => 500,//\r\n 'ReservePrice' => 400,//\r\n 'Country' => 'US',//\r\n 'Currency' => 'USD',//\r\n 'ListingDuration' => 'Days_7',//\r\n 'PictureDetails' => 'dummy',//\r\n 'Site' => 'US',//\r\n 'Location' => 'San Jose',//\r\n 'PaymentMethods' => 'PayPal',//\r\n 'PayPalEmailAddress' => '[email protected]',//\r\n 'ShippingDetails' => $shipping,//\r\n 'DispatchTimeMax' => 3,//\r\n 'ConditionID' => 1000,//\r\n 'ReturnPolicy' => $returnPolicy,//\r\n\r\n );\r\n\r\n $params = array(\r\n 'Version' => 831,\r\n 'Item' => $item\r\n\r\n\r\n\r\n\r\n\r\n );\r\n $method = 'addItem';\r\n\r\n try{\r\n\r\n $resp = debay::sendRequest($method,$params);\r\n\r\n $this->load->model('ebay/debay');\r\n\r\n\r\n }\r\n catch(Exception $e)\r\n {\r\n echo $e->getMessage();\r\n }\r\n }", "public function setItem_list($item_list)\r\n {\r\n $this->item_list = $item_list;\r\n\r\n return $this;\r\n }", "public function setItemList($item_list)\r\n {\r\n $this->item_list = $item_list;\r\n\r\n return $this;\r\n }", "public function prepare_item_for_response( $item, $request ) {\n return array();\n }", "public function addItem($item){\n $this->items[] = $item;\n }", "public function addItem(Collection $collection, ItemCreateStruct $itemCreateStruct): Item;", "public function addItem(SagepayItem $item)\r\n {\r\n $this->_items[] = $item;\r\n }", "public function addToItemResults(\\StructType\\ItemResult $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\StructType\\ItemResult) {\n throw new \\InvalidArgumentException(sprintf('The ItemResults property can only contain items of \\StructType\\ItemResult, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->ItemResults[] = $item;\n return $this;\n }", "public function addItems(){\n $this->validate($this->request, [\n 'title' => 'required|max:255',\n 'description' => 'string|max:255',\n 'isbn' => 'string',\n 'authorId' => 'required|integer|min:1',\n 'itemTypeId' => 'required|integer|min:1',\n 'categoryId' => 'required|integer|min:1',\n 'numberInStock' => 'required|integer|min:1',\n 'itemCondition' => 'required',\n 'itemStateId' => 'required|integer|min:1',\n ]);\n $items = array(\n 'title' => $this->request->input('title'),\n 'description' => $this->request->input('description'),\n 'isbn' => $this->request->input('isbn'),\n 'authorId' => $this->request->input( 'authorId'),\n 'catId' => $this->request->input('categoryId'),\n 'numOfItems' => $this->request->input('numberInStock'),\n 'itemCondition' => $this->request->input('itemCondition'),\n 'itemStateId' => $this->request->input('itemStateId'),\n 'itemTypeId' => $this->request->input('itemTypeId'),\n );\n\n try{\n $item = new ItemService();\n $result = $item->createNewItem($items);\n\n if ($result) {\n return response()->json([\n 'success' => true,\n 'data' => [\n 'itemId' => $result,\n ],\n 'message' => 'Item Added Successfully',\n ], 201);\n }\n return response()->json([\n 'success' => false,\n 'message' => 'item could not be added'\n ], 400);\n\n }catch(Exception $ex){\n return response()->json([\n 'success' => false,\n 'message' => 'Error Occured Adding Items. Ensure the IDs are Valid'\n ], 400);\n }\n }", "public static function _register()\n {\n self::assignElements(['AddItemResponseContainer' => ['type' => 'AddItemResponseContainerType', 'xmlns' => self::XMLNS, 'cardinality' => '0..*']], parent::NAME);\n self::assignAttributes([]);\n }", "public function addResponseData(array $responseData = []);", "public function addDealsToCart( $itemMap ) {\r\n\t\t\t$params = array('session_cookie'=>$itemMap['cart_session'],'dealid'=>$itemMap['dealid']);\r\n\t\t\t$this->db->select('COUNT(*) as count')->from(TABLES::$ORDER_DEALS_CART)->where($params);\r\n\t\t\t$query = $this->db->get();\r\n\t\t\t$result = $query->result_array();\r\n\t\t\tif($result[0]['count'] <=0 ) {\r\n\t\t\t\t$params = array('session_cookie'=>$itemMap['cart_session'],'restid'=>$itemMap['restid'],'dealid'=>$itemMap['dealid']);\r\n\t\t\t\t/* New item */\r\n\t\t\t\t$this->db->insert(TABLES::$ORDER_DEALS_CART,$params);\r\n\t\t\t\t$map['message'] = 'Deal Applied To Cart';\r\n\t\t\t\t$map['status'] = 0;\r\n\t\t\t}else {\r\n// \t\t\t\t$this->updateDealsInCart( $itemMap );\r\n\t\t\t\t$map['message'] = 'Deal Applied To Cart';\r\n\t\t\t\t$map['status'] = 1;\r\n\t\t\t}\r\n\t\t\treturn $map;\r\n\t\t}", "function appendItemMetadataList(&$item) {\n $mda = array();\n\n // Static metadata\n $mda = $this->getHardCodedMetadataList(true);\n foreach($mda as $md) {\n $md->setValue($item->getHardCodedMetadataValue($md->getLabel()));\n $item->addMetadata($md);\n unset($md);\n }\n \n // Dynamic metadata\n $mdIter = $this->getRealMetadataIterator(true);\n $mdIter->rewind();\n while($mdIter->valid()) {\n $md = $mdIter->current();\n $this->addMetadataValueToItem($item, $md);\n $mdIter->next();\n }\n }", "public function addToBookResponseLeg(\\Fincallorca\\HitchHikerApi\\Wsdl\\v3_1_388_1\\StructType\\BookResponseLeg $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\Fincallorca\\HitchHikerApi\\Wsdl\\v3_1_388_1\\StructType\\BookResponseLeg) {\n throw new \\InvalidArgumentException(sprintf('The BookResponseLeg property can only contain items of \\Fincallorca\\HitchHikerApi\\Wsdl\\v3_1_388_1\\StructType\\BookResponseLeg, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->BookResponseLeg[] = $item;\n return $this;\n }", "public function addToItemID($itemID)\n {\n $this->itemID[] = $itemID;\n return $this;\n }", "public static function items() {\r\n $doc = new DOMDocument ('1.0', 'UTF-8');\r\n $items_node = $doc->createElement(\"items\");\r\n $doc->appendChild($items_node);\r\n\r\n return new amvonetroom_XmlResponse($items_node);\r\n }", "public function addItem($item_id, $item_type) {\n $this->apiCall('items.json', 'POST', array('pio_iid' => $item_id, 'pio_itypes' => $item_type));\n }", "public function addPricesToCollection($response)\n {\n if (isset($response['Book'])) {\n foreach ($response['Book'] as $offer) {\n $offer = (object) $offer;\n $price = $this->createNewPrice();\n if (isset($offer->listingPrice)) {\n if (isset($offer->listingCondition) && strtolower($offer->listingCondition) == 'new book') {\n $price->condition = parent::CONDITION_NEW;\n } elseif (isset($offer->itemCondition)) {\n $price->condition = $this->getConditionFromString($offer->itemCondition);\n }\n if (empty($price->condition)) {\n $price->condition = parent::CONDITION_GOOD;\n }\n $price->isbn13 = $offer->isbn13;\n $price->price = $offer->listingPrice;\n $price->shipping_price = $offer->firstBookShipCost;\n $price->url = 'http://affiliates.abebooks.com/c/74871/77797/2029?u='.urlencode($offer->listingUrl);\n $price->retailer = self::RETAILER;\n $price->term = parent::TERM_PERPETUAL;\n }\n $this->addPriceToCollection($price);\n }\n }\n return $this;\n }", "public function addItem($item)\n\t{\n\t\t$this->_items[] = $item;\n\t}", "public function prepare_item_for_response( $item, $request ) {\n\t\t$data = $this->add_additional_fields_to_object( $item, $request );\n\t\t$data = $this->filter_response_by_context( $data, 'view' );\n\t\t$response = rest_ensure_response( $data );\n\n\t\t/**\n\t\t * Filter the list returned from the API.\n\t\t *\n\t\t * @param WP_REST_Response $response The response object.\n\t\t * @param array $item The original item.\n\t\t * @param WP_REST_Request $request Request used to generate the response.\n\t\t */\n\t\treturn apply_filters( 'woocommerce_rest_prepare_reports_import', $response, $item, $request );\n\t}", "public function add($item)\n {\n\n $this->items[] = $item;\n return $this;\n\n }", "public function AddItem($item)\n {\n $this->_items[] = $item;\n }", "public function prepare_response_for_collection($response)\n {\n }", "public function prepare_item_for_response($post, $request)\n {\n }", "private function addItemToCollection()\n {\n $this->collection->items[$this->cart_hash] = $this;\n\n }", "public function addResponses(SurveyManager_Entity_Response $response)\n {\n $this->responses->add($response);\n $response->setSurvey($this);\n }", "function RenderItem( &$item, &$renderer, $isLast ) {\n\t\t$itemInfo['identifier'] = $item->getAttribute('identifier');\n\t\t\n\t\t$itemInfo['isLast'] = $isLast;\n\t\t\n\t\tif( $item->hasAttribute('identifierref') )\n\t\t\t$itemInfo['identifierref'] = $item->getAttribute('identifierref');\n\t\telse\n\t\t $itemInfo['identifierref'] = FALSE;\n\n\t\tif( $item->hasAttribute('isvisible') )\n\t\t $itemInfo['isvisible'] = ($item->getAttribute('isvisible')=='true')?TRUE:FALSE;\n\t\telse\n\t\t $itemInfo['isvisible'] = TRUE;\n\n\t\tif( $item->hasAttribute('parameters') )\n\t\t $itemInfo['parameters'] = $item->getAttribute('parameters');\n\t\telse\n\t\t $itemInfo['parameters'] = FALSE;\n\t\t\n\t\t$itemInfo['title'] = $this->getFirstElementValue($item, 'title');\n\t\t\n\t\t$itemInfo['adlcp_prerequisites'] = $this->getFirstElementValue($item, 'prerequisites', 'adlcp' );\n\t\t$itemInfo['adlcp_maxtimeallowed'] = $this->getFirstElementValue($item, 'maxtimeallowed', 'adlcp');\n\t\t$itemInfo['adlcp_timelimitaction'] = $this->getFirstElementValue($item, 'timelimitaction', 'adlcp');\n\t\t$itemInfo['adlcp_datafromlms'] = $this->getFirstElementValue($item, 'datafromlms', 'adlcp');\n\t\t$itemInfo['adlcp_masteryscore'] = $this->getFirstElementValue($item, 'masteryscore', 'adlcp');\n\t\t//$itemInfo['adlcp_completionthreshold'] = $this->getFirstElementValue($item, 'completionthreshold', 'adlcp');\n\t\t$threshold_elem = $this->getNodeElement($item, 'completionthreshold', 'adlcp');\n\t\tif( $threshold_elem && $threshold_elem->hasAttribute('minProgressMeasure') )\n\t\t $itemInfo['adlcp_completionthreshold'] = $threshold_elem->getAttribute('minProgressMeasure');\n\t\telse\n\t\t $itemInfo['adlcp_completionthreshold'] = '';\n\t\t\n $elem = $this->getFirstElementNode( $item, 'item');\n if( $elem )\n\t\t\t$itemInfo['isLeaf'] = FALSE;\n\t\telse\n\t\t $itemInfo['isLeaf'] = TRUE;\n\t\t \n\t\tif( $renderer == null ) {\n\t\t\tprint_r( $itemInfo );\n\t\t\t\n\t\t}\n\t\t$renderer->RenderStartItem(\t$this, $itemInfo );\n\t\t\n\t\twhile( $elem ) {\n\t\t\t$nextElem = $this->getNextElementNode( $elem );\n\t\t\t\n\t\t\t/* pass the info about the last element */\n\t\t\tif( $nextElem === NULL )\n\t\t\t $this->RenderItem( $elem, $renderer, true );\n\t\t\telse\n\t\t\t $this->RenderItem( $elem, $renderer, false );\n\t\t\t \n\t\t\t$elem = $nextElem;\n\t\t}\n\n $renderer->RenderStopItem( $this, $itemInfo );\n\n\t}", "public function addItem($item)\n {\n if (!$this->getItems()) {\n return $this->setItems(array($item));\n } else {\n return $this->setItems(\n array_merge($this->getItems(), array($item))\n );\n }\n }", "function addItem(){\r\n\t global $itemsArray;\r\n\r\n //when the user clicks add, I pass id to the URL bar as a query string, again I'm checking if it exist or not (if the user has \r\n\t //clicked the add button or not)\r\n\r\n\t//if it exists on the URL bar I begin the magic of adding items to the Cart\r\n\r\n\tif ( isset( $_GET[\"itemId\"] ) ) {\r\n\t\t\r\n\t\t//This is the session that stores the total Price of the items in the cart\r\n\t\t//here I'm initializing it to zero....only if it doesn't exists at this point in time\r\n\t\t//if I don't put the ! sign the session will always be zero coz it's gonna be re-initized to zero everytime the\r\n //page is refreshed (everytime the add button is clicked)\r\n\t\tif(!isset($_SESSION[\"total\"])){\r\n\t\t\t$_SESSION[\"total\"] = 0;\r\n\t\t}\r\n //does the same as the above code but for the number of items in the cart\r\n\t\tif(!isset($_SESSION[\"nuOfItems\"])){\r\n\t\t\t$_SESSION[\"nuOfItems\"] = 0;\r\n\t\t}\r\n\r\n\t\t//==================================================================================================\r\n\t\t\t\t//ADDING ITEM TO THE CART\r\n\t\t//==================================================================================================\r\n\t\t\t\r\n \r\n //The code below ads items to the cart.....I grab the itemID from the URL bar and assign to a varible named itemId\r\n\t\t$itemId = (int) $_GET[\"itemId\"];\r\n\t\t//I grab the price from the URL bar also\r\n\t\t$price = $_GET[\"price\"];\r\n\r\n\t\t\t\r\n\t\tif (!isset( $_SESSION[\"cart\"][$itemId] ) ) {\r\n\r\n \r\n //kinda hard to explain....when this scripts loads I store objects of all items in the datbase to the $itemsArray, \r\n\t\t\t //each object in the array is indexed by it's id...Ok...\r\n\t\t\t //ie object1 will be at index 3 if it's Id is 3 .... ($itemsArray[3] = object1;)\r\n //now the statement below says take whatever object that is stored at index $itemId , in the itemsArray object and store\r\n\t\t\t // to the cart\r\n\r\n\t\t\t//reference: Beginning PHP 5.3 by Matt Doyle (Downloadable from google) ,Page 284. - Create a Simple Shopping Cart\r\n\r\n\t\t\t$_SESSION[\"cart\"][$itemId] = $itemsArray[$itemId];\r\n\r\n\r\n\t\t\t$_SESSION[\"nuOfItems\"] = $_SESSION[\"nuOfItems\"]+1; //increments the number of items in the cart \r\n\t\t\t$_SESSION[\"total\"] = $_SESSION[\"total\"]+$price; //increments current total by the that is recived from the URL\r\n\r\n\r\n\t\t}\r\n\t\t\r\n \r\n\t\t\t\r\n\t\t\r\n\t}\r\n\tsession_write_close();\r\n\t//header( \"Location: index.php\" ); //redirects the user to the home page\r\n\r\n}", "abstract public function add_item();", "public function unsetAddItemResponseContainer($index)\n {\n unset($this->addItemResponseContainer[$index]);\n }", "function addItem(SitemapItem $item){\r\n $this->items[] = $item;\r\n }", "private function addItemsToFeed()\n {\n foreach ($this->items as $item) {\n /** @var SimpleXMLElement $feedItemNode */\n $feedItemNode = $this->feed->channel->addChild('item');\n foreach ($item->nodes() as $itemNode) {\n if (is_array($itemNode)) {\n foreach ($itemNode as $node) {\n $feedItemNode->addChild($node->get('name'), $node->get('value'), $node->get('_namespace'));\n }\n } else {\n $itemNode->attachNodeTo($feedItemNode);\n }\n }\n }\n }", "public function add_item_cart($item){\r\n\t\t$cart_data = $this->main->connector->get_session('lumise_cart');\r\n\t\tif($cart_data == null)\r\n\t\t\t$cart_data['items'] = array();\r\n\t\t\t\r\n\t\t$cart_data['items'][$item['cart_id']] = $item;\r\n\t\t$this->main->connector->set_session('lumise_cart', $cart_data);\r\n\t}", "public function addContainer($data) {\n try {\n $client = new Zend_Soap_Client($this->CONTAINER_WSDL_URI);\n $options = array('soap_version' => SOAP_1_1,\n 'encoding' => 'ISO-8859-1',\n );\n $client->setOptions($options);\n $client->action = 'createContainer';\n $result = $client->createContainer(\n $this->toXml(\n array(\n 'backgroundColor' => $data['backgroundColor'],\n 'borderBottom' => $data['borderBottom'],\n 'borderBottomColor' => $data['borderBottomColor'],\n 'borderBottomStyle' => $data['borderBottomStyle'],\n 'borderBottomUnit ' => $data['borderBottomUnit'],\n 'borderLeft' => $data['borderLeft'],\n 'borderLeftColor' => $data['borderLeftColor'],\n 'borderLeftStyle' => $data['borderLeftStyle'],\n 'borderLeftUnit' => $data['borderLeftUnit'],\n 'borderRight' => $data['borderRight'],\n 'borderRightColor' => $data['borderRightColor'],\n 'borderRightStyle' => $data['borderRightStyle'],\n 'borderRightUnit' => $data['borderRightUnit'],\n 'borderTop' => $data['borderTop'],\n 'borderTopColor' => $data['borderTopColor'],\n 'borderTopStyle' => $data['borderTopStyle'],\n 'borderTopUnit' => $data['borderTopUnit'],\n 'bottomMargin' => $data['bottomMargin'],\n 'bottomMarginUnit' => $data['bottomMarginUnit'],\n 'bottomPadding' => $data['bottomPadding'],\n 'bottomPaddingUnit' => $data['bottomPaddingUnit'],\n 'containerHeight' => $data['containerHeight'],\n 'containerId' => $data['containerId'],\n 'containerName' => $data['containerName'],\n 'containerWidth' => $data['containerWidth'],\n 'containerXaxis' => $data['containerXaxis'],\n 'containerYaxis' => $data['containerYaxis'],\n 'css' => $data['css'],\n 'font' => $data['font'],\n 'fontAlignment' => $data['fontAlignment'],\n 'fontColor' => $data['fontColor'],\n 'fontSize' => $data['fontSize'],\n 'isActive' => true,\n 'isBold' => $data['isBold'],\n 'isBorderColorSameForAll' => $data['isBorderColorSameForAll'],\n 'isBorderStyleSameForAll' => $data['isBorderStyleSameForAll'],\n 'isBorderWidthSameForAll' => $data['isBorderWidthSameForAll'],\n 'isItalic' => $data['isItalic'],\n 'isMargineSameForAll' => $data['isMargineSameForAll'],\n 'isPaddingSameForAll' => $data['isPaddingSameForAll'],\n 'leftMargin' => $data['leftMargin'],\n 'leftMarginUnit' => $data['leftMarginUnit'],\n 'leftPadding' => $data['leftPadding'],\n 'leftPaddingUnit' => $data['leftPaddingUnit'],\n 'letterSpacing' => $data['letterSpacing'],\n 'lineHeight' => $data['lineHeight'],\n 'primaryKey' => 0,\n 'rightMargin' => $data['rightMargin'],\n 'rightMarginUnit' => $data['rightMarginUnit'],\n 'rightPadding' => $data['rightPadding'],\n 'rightPaddingUnit' => $data['rightPaddingUnit'],\n 'textDecoration' => $data['textDecoration'],\n 'topMargin' => $data['topMargin'],\n 'topMarginUnit' => $data['topMarginUnit'],\n 'topPadding' => $data['topPadding'],\n 'topPaddingUnit' => $data['topPaddingUnit'],\n 'updatedby' => $_SESSION['Username'],\n 'updatedt' => date('Y-m-d') . 'T' . date('H:i:s') . 'Z',\n 'wordSpacing' => $data['wordSpacing'],\n )\n ,$rootNodeName = 'AddContainer')\n );\n return $result;\n } catch (Exception $e) {\n // print_r($e);\n }\n }", "private function load(){\n\n $xml = simplexml_load_string($this->response);\n if($xml){\n if(!$this->isResponseSuccessFull($xml)) {\n\n $item = $xml->Items->Item;\n\n $this->data['title'] = $item->ItemAttributes->Title->__toString();\n $this->data['ean'] = $item->ItemAttributes->EAN->__toString();\n $this->data['brand'] = $item->ItemAttributes->Brand->__toString();\n $this->data['picture'] = $item->SmallImage->URL->__toString();\n $this->data['asin'] = $item->ASIN->__toString();\n $this->data['price'] = round(((int)$item->ItemAttributes->ListPrice->Amount->__toString()) / 100,2);\n }\n }else{\n $this->errorMessage[] = 'can not load xml.';\n }\n }", "public function add( $item )\n\t{\n\t\t$this->items[] = $item;\n\n\t\treturn $this;\n\t}", "function addItem($itemKey){\n\t\t\t//if the item already exsists in the cart, add one.\n\t\t\tif(isset($this->items[$itemKey])){\n\t\t\t\t$this->items[$itemKey]['quantity'] = $this->items[$itemKey]['quantity'] + 1; \n\t\t\t}\n\t\t\t\n\t\t\t//if the item is not already set in the cart.\n\t\t\t//Find the correct price off the item from the server side $products\n\t\t\t//note - I am looking up the prices server-side to protect from customers entering in their own prices in the html\n\t\t\telse{\n\t\t\t\t//find the corresponding product based on the product name (keys would be preferable)\n\t\t\t\tforeach($GLOBALS['products'] as $product){\t\t\n\t\t\t\t\tif($itemKey == $product['name']){\n\t\t\t\t\t\t//set the item price server-side\n\t\t\t\t\t\t$itemPrice = $product['price'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//if there is a valid product with that name (key) and therefore has a corresponding price.\n\t\t\t\t//add it to the cart otherwise ignore it\n\t\t\t\t//note - This protects the server from having items in the shopping cart that don't exsist server side. \n\t\t\t\tif(isset($itemPrice)){\n\t\t\t\t\t$this->items[$itemKey] = array( \"name\" => $itemKey, \"price\" => $itemPrice , \"quantity\" => 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\t\t\n\t\t\treturn;\n\t\t}", "public function addBasketItemParams()\n {\n $oBasket = $this->getBasket();\n $oLang = $this->getLang();\n $oRequest = $this->getPayPalRequest();\n\n $iPos = 0;\n foreach ($oBasket->getContents() as $oBasketItem) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", getStr()->html_entity_decode($oBasketItem->getTitle()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasketItem->getUnitPrice()->getPrice()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", (int) $oBasketItem->getAmount());\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_ITEMURL{$iPos}\", $oBasketItem->getLink());\n\n $oBasketProduct = $oBasketItem->getArticle();\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NUMBER{$iPos}\", $oBasketProduct->oxarticles__oxartnum->value);\n\n $iPos++;\n }\n\n //adding payment costs as product\n if ($oBasket->getPayPalPaymentCosts() > 0) {\n $sPaymentTitle = $oLang->translateString(\"OEPAYPAL_SURCHARGE\") . \" \" . $oLang->translateString(\"OEPAYPAL_TYPE_OF_PAYMENT\");\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $sPaymentTitle);\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalPaymentCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n\n $iPos++;\n }\n\n //adding wrapping as product\n if ($oBasket->getPayPalWrappingCosts() > 0) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $oLang->translateString(\"OEPAYPAL_GIFTWRAPPER\"));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalWrappingCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n\n $iPos++;\n }\n\n //adding greeting card as product\n if ($oBasket->getPayPalGiftCardCosts() > 0) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $oLang->translateString(\"OEPAYPAL_GREETING_CARD\"));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalGiftCardCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n\n $iPos++;\n }\n\n //adding trusted shops protection as product\n if ($oBasket->getPayPalTsProtectionCosts() > 0) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $oLang->translateString(\"OEPAYPAL_TRUSTED_SHOP_PROTECTION\"));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalTsProtectionCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n }\n }", "public function handle_collection($response)\n {\n foreach ($response->items as &$value) {\n $value = new ContactList(new Response($value));\n }\n }", "public function add($item)\n {\n $this->manuallyAddedData[] = $item;\n }", "public function issetAddItemResponseContainer($index)\n {\n return isset($this->addItemResponseContainer[$index]);\n }", "public function add($item): self\n {\n $this->items[] = $item;\n\n return $this;\n }", "protected function process_response() {\n\t\t\t$this->response['response']['Message'] = isset($this->response['response']['Message']) ? $this->response['response']['Message'] : '';\n\t\t\t$this->response['response']['error'] = (strpos(strtolower($this->response['response']['Message']), 'invalid') !== false) ? true : $this->response['response']['error'];\n\t\t\t$this->response['response']['error'] = (strpos(strtolower($this->response['response']['Message']), 'the item code was specified more than once') !== false) ? true : $this->response['response']['error'];\n\t\t\t$this->response['response']['Level1Code'] = $this->request['Level1Code'];\n\t\t\t\n\t\t\tif (!$this->response['response']['error']) { // IF Error is False\n\t\t\t\tif (in_array($this->response['server']['http_code'], array('200', '201', '202', '204'))) {\n\t\t\t\t\t$this->log_sendlogitem($this->request['Level1Code']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->log_error($this->response['response']['Message']);\n\t\t\t}\n\t\t}", "public function addElement($item)\n {\n $this->items[$this->itemsCount] = $item;\n $this->itemsCount++;\n }", "public function appendItem($item): CollectionInterface;", "public function addItem(array $item)\n {\n // if is multidimensional\n if (array_key_exists(1, $item)) {\n foreach ($item as $i) {\n $this->addItem($i);\n }\n return;\n }\n\n if ($this->shortening) {\n $append = (strlen($item['description']) > $this->shorteningLimit) ? '...' : '';\n $item['description'] = mb_substr($item['description'], 0, $this->shorteningLimit, 'UTF-8') . $append;\n }\n\n if (isset($item['title'])) {\n $item['title'] = htmlspecialchars(strip_tags($item['title']), ENT_COMPAT, 'UTF-8');\n }\n\n if (isset($item['subtitle'])) {\n $item['subtitle'] = htmlspecialchars(strip_tags($item['subtitle']), ENT_COMPAT, 'UTF-8');\n }\n\n $this->items[] = $item;\n }", "public function adopt($response)\n {\n if ($response instanceof Collection) {\n $response->setParent($this);\n\n $response->each->setParent($this);\n\n return $response;\n }\n\n return $response->setParent($this);\n }", "public function addItems(array $items);", "public function setItemListElement($itemListElement) {\n $this->properties['itemListElement'] = $itemListElement;\n\n return $this;\n }", "public function add($item)\n {\n $newCollection[] = $this->items;\n $newCollection[] = $item;\n $this->items = $newCollection;\n return $newCollection;\n }", "public function add($item);", "public function add($item);", "public function build_carousel($simpleResponseText, $items) {\n\t $this->build_simpleResponse($simpleResponseText, $simpleResponseText);\n\t $carousel = array(\n\t \t\t'carouselSelect' => array(\n\t\t\t 'items' => $items\n\t\t )\n\t );\n\t $this->items[] = $carousel;\n }", "public function addItem($item)\n {\n // Push item into list of array\n array_push($this->items, $item);\n }", "public function add(CollectionItemInterface $item);", "private final function addResponseCamerainformation()\n {\n $accessgrantedcameras = camera::getAccessableCamerasByUser(\n $this->snowman->getCameras(),\n $this->snowman->getLoginUser()\n );\n\n /** @noinspection PhpUndefinedFieldInspection */\n $this->snowmanresponse->camerainformation = new \\stdClass();\n /** @noinspection PhpUndefinedFieldInspection */\n $this->snowmanresponse->camerainformation->cameras = array();\n\n foreach ($accessgrantedcameras as $camera) {\n /** @var Camera $camera*/\n /** @noinspection PhpUndefinedFieldInspection */\n $currentcamera =\n $this->snowmanresponse->camerainformation->cameras[] =\n new \\stdClass;\n\n $currentcamera->url = urlencode($camera->getCCamera()->getName());\n $currentcamera->name = $camera->getCCamera()->getName();\n $currentcamera->refresh = $camera->getCCamera()->getRefresh();\n }\n }", "public function addToGetStoryInfoByGenartReturn(\\StructType\\ExtStoryListContainerV2 $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\StructType\\ExtStoryListContainerV2) {\n throw new \\InvalidArgumentException(sprintf('The getStoryInfoByGenartReturn property can only contain items of type \\StructType\\ExtStoryListContainerV2, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->getStoryInfoByGenartReturn[] = $item;\n return $this;\n }", "function addItem(SitemapItem $item)\r\n {\r\n $this->items[] = $item;\r\n }", "function AddItem($item, $object = null, $itemkey = null)\r\n {\r\n if($object != null)\r\n {\r\n throw new Exception('ObjectNew1 functionallity for RadioGroup is not yet implemented.');\r\n }\r\n\r\n //Set the array to the end\r\n end($this->_items);\r\n\r\n //Adds the item as the last one\r\n if($itemkey != null)\r\n {\r\n $this->_items[$itemkey] = $item;\r\n }\r\n else\r\n {\r\n $this->_items[] = $item;\r\n }\r\n\r\n return ($this->Count);\r\n }", "public function addItem(FeedItem $item) {\n\t\tif (!array_key_exists('items', $this->feedElements)) {\n\t\t\t$this->feedElements['items'] = array();\n\t\t}\n\n\t\t$this->feedElements['items'][] = $item;\n\t}", "private function addPlaylistItem()\n {\n try\n {\n $request = $_POST;\n\n if( !isset($request['pid']) || $request['pid']==\"\" )\n throw_error_msg(\"playlist id not provided\");\n else if(!is_numeric($request['pid']))\n throw_error_msg(\"invalid playlist id\"); \n else\n $pid = (int)$request['pid'];\n\n if( !isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"videoid not provided\");\n else if(!is_numeric($request['videoid']))\n throw_error_msg(\"invalid videoid\"); \n else\n $id = (int)$request['videoid']; \n \n global $cbvid; \n $item_id = $cbvid->action->add_playlist_item($pid, $id);\n\n if( error() )\n {\n $error = error();\n throw_error_msg($error[0]); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'item has been added to playlist successfully', \"data\" => array());\n $this->response($this->json($data));\n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function add($item): self\n {\n // validation for constraint: itemType\n if (!$item instanceof \\StructType\\EwsCDRDataType) {\n throw new InvalidArgumentException(sprintf('The CDRData property can only contain items of type \\StructType\\EwsCDRDataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n return parent::add($item);\n }", "public function addToSpecialReqDetails($item)\n {\n // validation for constraint: itemType\n if (!false) {\n throw new \\InvalidArgumentException(sprintf('The SpecialReqDetails property can only contain items of anyType, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->SpecialReqDetails[] = $item;\n return $this;\n }", "public function addAction(Request $request, Context $context, EditToken $token, LayoutInterface $layout, int $containerId, string $itemType, string $itemId, int $position = 0, string $style = ItemInterface::STYLE_DEFAULT)\n {\n $this->ensureLayout($token, $layout);\n $item = $this->typeRegistry->getType($itemType, false)->create($itemId, $style);\n $item->setLayoutId($layout->getId());\n\n if ($containerId) {\n $container = $layout->findContainer($containerId);\n } else {\n $container = $layout->getTopLevelContainer();\n }\n\n if ($item instanceof ContainerInterface) {\n throw new GenericError(\"you cannot add a container into a container\");\n }\n if (!$container instanceof TopLevelContainer && !$container instanceof ColumnContainer) {\n throw new GenericError(\"you cannot add items into a non-vertical container\");\n }\n\n $container->addAt($item, $position);\n\n $context->getTokenStorage()->update($token->getToken(), $layout);\n\n $this->prepareResponse($request, $context, $token);\n\n return $this->handleResponse($request, ['success' => true, 'output' => $this->renderer->renderItemIn($item, $container, $position)]);\n }", "function add($item) {\n\t\t\tif(!$this->contains($items)) {\n\t\t\t\tarray_push($this->items, $item);\n\t\t\t}\n\t\t}" ]
[ "0.7072615", "0.5942786", "0.54337716", "0.5295369", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5098202", "0.50621927", "0.50571", "0.500491", "0.48598257", "0.4819784", "0.48129448", "0.4769877", "0.4765341", "0.47608685", "0.47533455", "0.4744043", "0.4737558", "0.47362086", "0.47144943", "0.47086847", "0.47010228", "0.4700979", "0.46493304", "0.4640595", "0.46379146", "0.46223384", "0.46211362", "0.46194863", "0.4598694", "0.45962054", "0.45948297", "0.45778638", "0.4517765", "0.45150626", "0.45144522", "0.45032167", "0.45002547", "0.4463621", "0.44592127", "0.44588846", "0.4429045", "0.43965572", "0.43955535", "0.4392578", "0.43820694", "0.4376412", "0.4371841", "0.4370267", "0.4365186", "0.43651742", "0.43648735", "0.4345014", "0.43310922", "0.4330423", "0.43243384", "0.43150586", "0.42936185", "0.42929602", "0.42918637", "0.42755178", "0.42720184", "0.42641115", "0.4257841", "0.42540455", "0.4246296", "0.42457077", "0.42457077", "0.42360803", "0.42342198", "0.42193836", "0.42186752", "0.42172757", "0.4210221", "0.42100915", "0.42034864", "0.42029187", "0.4202436", "0.41977808", "0.41977566", "0.4192435" ]
0.70213115
1
mt_settings_page() displays the page content for the Test Settings submenu
function mt_settings_page() { echo '<h2>' . __('Footer Settings Configurations') . '</h2>'; include_once 'footer_settings_page.php'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function settings_page() {\r\n\t\tadd_submenu_page( 'edit.php?post_type=news', __( 'Settings', 'news-manager' ), __( 'Settings', 'news-manager' ), 'manage_options', 'news-settings', array( $this, 'options_page' ) );\r\n\t}", "public function render_settings_page()\n {\n }", "public function settings_page(){\n\t\t$page_base = $this->page_url();\n\t\tob_start();\n\t\t?>\n\t\t<div class=\"wp_lms settings\">\n\t\t\t<h1><?= $this::$name; ?> Settings Page</h1>\n\t\t\t\n\t\t</div>\n\t\t<?\n\t\tob_end_flush();\n\t}", "public function settings_page() { ?>\n\n <div class=\"wrap\">\n <?php $this->settings_api->settings_html(); ?>\n </div><?php\n }", "public function settings_page() {\n\t\tinclude_once( dirname( __FILE__ ) . '/class-vendor-admin-settings.php' );\n\t\tVendor_Admin_Settings::output();\n\t}", "public function settings_page()\r\n {\r\n add_submenu_page('giga',\r\n __('Notifications', 'giga-messenger-bots'),\r\n __('Notifications', 'giga-messenger-bots'),\r\n 'manage_options',\r\n 'notifications',\r\n [$this, 'render']\r\n );\r\n }", "public function add_settings_page() {\n\t\tadd_submenu_page(\n\t\t\t'case27/tools.php',\n\t\t\t_x( 'Map Services', 'Map Services page title in WP Admin', 'my-listing' ),\n\t\t\t_x( 'Map Services', 'Map Services page title in WP Admin', 'my-listing' ),\n\t\t\t'manage_options',\n\t\t\t'theme-mapservice-settings',\n\t\t\tfunction() {\n\t\t\t\t$config = $this->get_config();\n\t\t\t\trequire locate_template( 'templates/admin/theme-options/map-services.php' );\n\t\t\t}\n\t\t);\n\t}", "public function define_settings_page() {\n\t\t$this->hook_suffix = add_options_page(\n\t\t\t__( 'Top Story Options', 'top-story' ),\n\t\t\t__( 'Top Story', 'top-story' ),\n\t\t\t'manage_options',\n\t\t\t$this->menu_slug,\n\t\t\tarray( $this, 'option_page' )\n\t\t);\n\t}", "public function render_settings_page() {\n\t\tinclude( get_inc_dir() . '/templates/admin-settings.php' );\n\t}", "public function settings_page() {\n\t\t// Current tab.\n\t\t$tab = Template::current_tab();\n\n\t\t// Render settings header.\n\t\t$this->view( 'settings/common/header' );\n\n\t\t// Render settings page.\n\t\t$this->view( 'settings/settings', [\n\t\t\t'title' => Template::tabs()[ $tab ],\n\t\t\t'tab' => $tab,\n\t\t\t'form_url' => Template::settings_page(\n\t\t\t\t$tab,\n\t\t\t\t$this->is_network()\n\t\t\t),\n\t\t] );\n\n\t\t// Render settings footer.\n\t\t$this->view( 'settings/common/footer' );\n\t}", "function settings_page() { include($this->plugin_basename . '/core/admin/settings.php'); }", "public static function settings_page() {\r\n\t\treturn '';\r\n\t}", "public function display_page() {\n include_once JPID_PLUGIN_DIR . 'includes/admin/pages/views/html-jpid-admin-settings-page.php';\n }", "public function settingsPage()\n\t{\n\t\t$this->setForms();\n\t\tinclude( \\GFormProtected\\Helpers::view('settings/settings') );\n\t}", "public function settings_page()\n {\n\n // Build page HTML\n $html = '<div class=\"wrap\" id=\"' . $this->parent->_token . '_settings\">' . \"\\n\";\n $html .= '<h2>' . __('SUAPI Settings', 'wp-suapi') . '</h2>' . \"\\n\";\n\n $tab = '';\n if (isset($_GET['tab']) && $_GET['tab']) {\n $tab .= $_GET['tab'];\n }\n\n // Show page tabs\n if (is_array($this->settings) && 1 < count($this->settings)) {\n\n $html .= '<h2 class=\"nav-tab-wrapper\">' . \"\\n\";\n\n $c = 0;\n foreach ($this->settings as $section => $data) {\n\n // Set tab class\n $class = 'nav-tab';\n if (!isset($_GET['tab'])) {\n if (0 == $c) {\n $class .= ' nav-tab-active';\n }\n } else {\n if (isset($_GET['tab']) && $section == $_GET['tab']) {\n $class .= ' nav-tab-active';\n }\n }\n\n // Set tab link\n $tab_link = add_query_arg(array('tab' => $section));\n if (isset($_GET['settings-updated'])) {\n $tab_link = remove_query_arg('settings-updated', $tab_link);\n }\n\n // Output tab\n $html .= '<a href=\"' . $tab_link . '\" class=\"' . esc_attr($class) . '\">' . esc_html($data['title']) . '</a>' . \"\\n\";\n\n ++$c;\n }\n\n $html .= '</h2>' . \"\\n\";\n }\n\n $html .= '<form method=\"post\" action=\"options.php\" enctype=\"multipart/form-data\">' . \"\\n\";\n\n // Get settings fields\n ob_start();\n settings_fields($this->parent->_token . '_settings');\n do_settings_sections($this->parent->_token . '_settings');\n $html .= ob_get_clean();\n\n $html .= '<p class=\"submit\">' . \"\\n\";\n $html .= '<input type=\"hidden\" name=\"tab\" value=\"' . esc_attr($tab) . '\" />' . \"\\n\";\n $html .= '<input name=\"Submit\" type=\"submit\" class=\"button-primary\" value=\"' . esc_attr(__('Save Settings', 'wp-suapi')) . '\" />' . \"\\n\";\n $html .= '</p>' . \"\\n\";\n $html .= '</form>' . \"\\n\";\n $html .= '</div>' . \"\\n\";\n\n echo $html;\n }", "public static function menu_subpage_settings(){\n \t\t\n\t\t\tadd_submenu_page('edit.php?post_type='.self::$post_type, \n\t\t\t\t\t\t\t self::$page_title_settings, \n\t\t\t\t\t\t\t 'Settings', \n\t\t\t\t\t\t\t self::$capability,\n\t\t\t\t\t\t\t 'menu_settings',\n array( __CLASS__, 'menu_generator_settings'));\n\t\t\n\t\t}", "public function settings_page() {\r\n\t\tif ( ! isset( $this->hook_suffix ) )\r\n\t\t\treturn;\r\n\r\n\t\tadd_action( 'inf_member_settings_after_header_' . $this->hook_suffix, array( 'Inf_Member_App_Settings', 'after_header' ) );\r\n\r\n Inf_Member_Settings::settings_page_template( $this->hook_suffix, __( 'Inf Member Settings', 'inf-member' ) );\r\n\t}", "public function add_settings_page() {\n\t\t$this->settings_page_id = add_submenu_page(\n\t\t\t'edit.php?post_type=schedule',\n\t\t\t__( 'Conference Schedule Settings', 'conf-schedule' ),\n\t\t\t__( 'Settings', 'conf-schedule' ),\n\t\t\t'edit_posts',\n\t\t\t'conf-schedule-settings',\n\t\t\tarray( $this, 'print_settings_page' )\n \t);\n\t}", "public function setting_page() {\n\n\t\techo '<div class=\"wrap\">';\n\t\tsettings_errors();\n\n\t\t$this->setting->show_navigation();\n\t\t$this->setting->show_forms();\n\n\t\techo '</div>';\n\t}", "public function settings_page () {\n\n // Build page HTML\n $html = '<div class=\"wrap\" id=\"' . $this->_token . '_settings\">' . \"\\n\";\n $html .= '<h2>' . __( 'Plugin Settings' , 'listeo_core' ) . '</h2>' . \"\\n\";\n\n $tab = '';\n if ( isset( $_GET['tab'] ) && $_GET['tab'] ) {\n $tab .= $_GET['tab'];\n }\n\n // Show page tabs\n if ( is_array( $this->settings ) && 1 < count( $this->settings ) ) {\n\n $html .= '<h2 class=\"nav-tab-wrapper\">' . \"\\n\";\n\n $c = 0;\n foreach ( $this->settings as $section => $data ) {\n\n // Set tab class\n $class = 'nav-tab';\n if ( ! isset( $_GET['tab'] ) ) {\n if ( 0 == $c ) {\n $class .= ' nav-tab-active';\n }\n } else {\n if ( isset( $_GET['tab'] ) && $section == $_GET['tab'] ) {\n $class .= ' nav-tab-active';\n }\n }\n\n // Set tab link\n $tab_link = add_query_arg( array( 'tab' => $section ) );\n if ( isset( $_GET['settings-updated'] ) ) {\n $tab_link = remove_query_arg( 'settings-updated', $tab_link );\n }\n\n // Output tab\n $html .= '<a href=\"' . $tab_link . '\" class=\"' . esc_attr( $class ) . '\">' . esc_html( $data['title'] ) . '</a>' . \"\\n\";\n\n ++$c;\n }\n\n $html .= '</h2>' . \"\\n\";\n }\n\n $html .= '<form method=\"post\" action=\"options.php\" enctype=\"multipart/form-data\">' . \"\\n\";\n\n // Get settings fields\n ob_start();\n settings_fields( $this->_token . '_settings' );\n do_settings_sections( $this->_token . '_settings' );\n $html .= ob_get_clean();\n\n $html .= '<p class=\"submit\">' . \"\\n\";\n $html .= '<input type=\"hidden\" name=\"tab\" value=\"' . esc_attr( $tab ) . '\" />' . \"\\n\";\n $html .= '<input name=\"Submit\" type=\"submit\" class=\"button-primary\" value=\"' . esc_attr( __( 'Save Settings' , 'listeo_core' ) ) . '\" />' . \"\\n\";\n $html .= '</p>' . \"\\n\";\n $html .= '</form>' . \"\\n\";\n $html .= '</div>' . \"\\n\";\n\n echo $html;\n }", "public function show_settings_page() : void {\n\t\t\t$categories = self::get_categories();\n\n\t\t\tSFWD_LMS::get_view(\n\t\t\t\t'support/help',\n\t\t\t\tarray(\n\t\t\t\t\t'categories' => $categories,\n\t\t\t\t),\n\t\t\t\ttrue\n\t\t\t);\n\t\t}", "function settings_page() {\n global $wpdb, $wp_properties;\n\n include_once( __DIR__ . '/ui/settings-section.php' );\n\n }", "public function add_settings_page() {\n add_options_page( \n \"WP BXSlider Settings\", // $page_title\n \"WP BXSlider\", // $menu_title\n \"manage_options\", // $capability (ie: permissions)\n $this->name, // $menu_slug\n array($this, 'render_admin_page') // callback to render view\n );\n }", "public function create_plugin_settings_page() {\n\t\t$page_title = 'Boss Directory Settings';\n\t\t$menu_title = 'Settings';\n\t\t$capability = 'manage_options';\n\t\t$slug = 'boss_directory';\n\t\t$callback = array( $this, 'plugin_settings_page_content' );\n\t\t$icon = 'dashicons-admin-plugins';\n\t\t$position = 99;\n\n\t\tadd_submenu_page( 'edit.php?post_type=listing', $page_title, $menu_title, $capability, $slug, $callback );\n\t}", "function settings_page() {\n\t\textract( $this->group, EXTR_OVERWRITE ); ?>\n\n\t<div class=\"wrap\">\n\t\t<?php screen_icon(); ?>\n\t\t<h2><?php echo esc_html( $page_title ) ?></h2>\n\t\t<?php do_action( \"{$prefix}_kc_settings_page_before\", $this->group ) ?>\n\t\t<form action=\"options.php\" method=\"post\" id=\"kc-settings-form\">\n\t\t\t<?php\n\t\t\t\t# The hidden fields\n\t\t\t\tsettings_fields( \"{$prefix}_settings\" );\n\n\t\t\t\tswitch ( $this->group['display'] ) {\n\t\t\t\t\tcase 'metabox' :\n\t\t\t\t\t\t$this->metabox->display();\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'plain' :\n\t\t\t\t\t\tforeach ( $this->group['options'] as $section ) :\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<h3><?php echo esc_html( $section['title'] ) ?></h3>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$this->settings_section( $section );\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\tsubmit_button( __( 'Save Changes' ) );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t?>\n\t\t</form>\n\t\t<?php do_action( \"{$prefix}_kc_settings_page_after\", $this->group ) ?>\n\t</div>\n\t<?php }", "public function settings_page() {\n\t\tTheme_My_Login_Admin::settings_page( array(\n\t\t\t'title' => __( 'Theme My Login reCAPTCHA Settings', 'theme-my-login' ),\n\t\t\t'options_key' => $this->options_key\n\t\t) );\n\t}", "function submenu_add_pages() \n {\n add_submenu_page(\n 'edit.php?post_type=custompost',\n __( 'Test Settings', 'menu-test' ),\n __( 'Test Settings', 'menu-test' ),\n 'manage_options',\n 'testsettings',\n 'mt_settings_page');\n }", "public function main_options_page(){\n\t\t$page_base = $this->page_url();\n\t\tob_start();\n\t\t?>\n\t\t<div class=\"wp_lms settings\">\n\t\t\t<h1>GrandPubbah</h1>\n\n\t\t</div>\n\t\t<?\n\t\tob_end_flush();\n\t}", "public function plugin_settings_page() {\r\n\t\t\tif ( ! current_user_can( 'manage_options' ) ) {\r\n\t\t\t\twp_die( esc_html( 'You do not have sufficient permissions to access this page.' ) );\r\n\t\t\t}\r\n\r\n\t\t\t// Render the settings template.\r\n\t\t\tinclude( sprintf( '%s/templates/settings.php', dirname( __FILE__ ) ) );\r\n\t\t}", "public function options_page() {\n\t\t$this->render_settings();\n\t}", "public function add_settings_submenu(){\n //create new sub menu\n add_options_page('Google Map extension for Contact Form 7', 'CF7 Google Map', 'administrator','cf7-googleMap-settings', array($this,'show_settings_page') );\n }", "public function settings_page_content() {\n\t\t// Common items.\n\t\t$args = [\n\t\t\t'network' => $this->is_network(),\n\t\t];\n\n\t\t// Current tab.\n\t\t$tab = Template::current_tab();\n\n\t\t// Is plugin active network wide.\n\t\t$networkwide = General::is_networkwide();\n\n\t\tswitch ( $tab ) {\n\t\t\tcase 'reports':\n\t\t\t\t$roles = Permission::get_roles();\n\t\t\t\t// If subsites can not over write.\n\t\t\t\tif ( ! Permission::can_overwrite() && $networkwide ) {\n\t\t\t\t\t$selected = (array) beehive_analytics()->settings->get( 'roles', 'permissions', true, [] );\n\t\t\t\t} else {\n\t\t\t\t\t$selected = (array) beehive_analytics()->settings->get( 'roles', 'permissions', $this->is_network(), [] );\n\t\t\t\t}\n\t\t\t\tforeach ( $roles as $role => $data ) {\n\t\t\t\t\t// Leave administrators please. They are powerful.\n\t\t\t\t\tif ( 'administrator' === $role ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! in_array( $role, $selected, true ) ) {\n\t\t\t\t\t\tunset( $roles[ $role ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Only applicable on single/sub site.\n\t\t\t\t$args['roles'] = $roles;\n\t\t\t\t$args['dashboard_tree'] = Analytics_Settings::instance()->dashboard_tree();\n\t\t\t\t$args['statistics_tree'] = Analytics_Settings::instance()->statistics_tree();\n\t\t\t\t$args['dashboard_selected'] = beehive_analytics()->settings->get( 'dashboard', 'reports', false, [] );\n\t\t\t\t$args['statistics_selected'] = beehive_analytics()->settings->get( 'statistics', 'reports', false, [] );\n\t\t\t\tbreak;\n\t\t\tcase 'permissions':\n\t\t\t\t$args['roles'] = Permission::get_roles();\n\t\t\t\tbreak;\n\t\t\tcase 'tracking':\n\t\t\t\t$args['settings_page'] = Template::settings_page( 'general', $this->is_network() );\n\t\t\t\t$args['tracking'] = beehive_analytics()->settings->get( 'code', 'tracking' );\n\t\t\t\t$args['network_tracking'] = beehive_analytics()->settings->get( 'code', 'tracking', true );\n\t\t\t\t$args['auto_tracking'] = beehive_analytics()->settings->get( 'auto_track', 'google', $this->is_network() );\n\t\t\t\t$args['auto_tracking_code'] = beehive_analytics()->settings->get( 'auto_track', 'misc', $this->is_network() );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$anonymize_visible = true;\n\t\t\t\tif ( $networkwide && ! $this->is_network() ) {\n\t\t\t\t\tif ( beehive_analytics()->settings->get( 'anonymize', 'general', true )\n\t\t\t\t\t && beehive_analytics()->settings->get( 'force_anonymize', 'general', true )\n\t\t\t\t\t) {\n\t\t\t\t\t\t$anonymize_visible = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Get Pro Sites levels.\n\t\t\t\t$args['ps_levels'] = $this->is_network() ? Permission::get_ps_levels() : false;\n\t\t\t\t$args['anonymize_visible'] = $anonymize_visible;\n\t\t\t\t$args['networkwide'] = $networkwide;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Render network settings content.\n\t\t$this->view( \"settings/tabs/{$tab}\", $args );\n\t}", "function boj_menuexample_create_menu() {\r\n\t\r\n\t//create a submenu under Settings\r\n\tadd_options_page( 'Leo Plugin Settings Page', 'Menu Example Settings', 'manage_options', 'settings-submenu', 'boj_menuexample_settings_page' );\r\n\t\r\n}", "public function page(){\n\t\t$pageLoader = $this->plugin->library('Page');\n\t\t$pageLoader->load('admin/settings');\n\t}", "function admin_menu(){\t\tif(!empty($this->settings_manager->sections)){\n\t\t\tadd_theme_page(__('Theme Settings'), __('Theme Settings'), 'edit_theme_options', $this->options->option_name, array($this, 'theme_settings'));\n\t\t}\n\t}", "function do_settings_sections($page)\n {\n }", "function BitTicket_plugin_settings() {\r\n add_menu_page('BitTicket', 'BitTicket', 'administrator', 'BitTicket_settings', 'BitTicket_display_settings');\r\n}", "function hoopsai_wp_settings_do_page() {\n ?>\n <div id=\"hoopsai_wp_settings\"></div>\n <?php\n }", "public function settingsPage()\n {\n include 'views/admin.php';\n }", "public function grp_settings_page_init(){\n\t\t$settings_page = add_menu_page( 'GRP Settings', 'GRP Settings', 'edit_theme_options', 'grp-settings', array($this,'grp_settings_page') );\n\t\t//add this action to save your setting page data\n\t\tadd_action( \"load-{$settings_page}\", array( $this, 'grp_load_settings_page' ) );\n\t}", "public function initialize_settings_page()\n {\n }", "function get_page_hook() {\n\t\treturn add_submenu_page(\n\t\t\tnull,\n\t\t\t__( 'Jetpack Settings', 'jetpack' ),\n\t\t\t__( 'Settings', 'jetpack' ),\n\t\t\t'jetpack_manage_modules',\n\t\t\t'jetpack_modules',\n\t\t\tarray( $this, 'render' )\n\t\t);\n\t}", "function pafd_action_settings_page() {\n\n\tglobal $pafd_textdomain;\n\t\n\tregister_setting( 'pafd_options_group', 'pafd_options' );\n\n\tpafd_add_settings_field( 'columns', __( 'Visible columns', $pafd_textdomain ) );\n\tpafd_add_settings_field( 'download_link', __( 'Download link', $pafd_textdomain ) );\n\tpafd_add_settings_field( 'hide_table_header', __( 'Hide table header', $pafd_textdomain ) );\n\tpafd_add_settings_field( 'show_all_revisions', __( 'Show all file revisions', $pafd_textdomain ) );\n\tpafd_add_settings_field( 'show_file_status', __( 'Show file status', $pafd_textdomain ) );\n\tpafd_add_settings_field( 'show_icons', __( 'Show mime-type icons', $pafd_textdomain ) );\n\tpafd_add_settings_field( 'order_by', __( 'Order files by' ), $pafd_textdomain );\n\tpafd_add_settings_field( 'custom_css_code', __( 'Custom CSS code' ), $pafd_textdomain );\n}", "function showSettings() {\n global $objTemplate,$_ARRAYLANG;\n $template = new \\Cx\\Core\\Html\\Sigma();\n $objTemplate->addBlockfile('ADMIN_CONTENT', 'settings_system', 'settings.html');\n $templateObj = new \\Cx\\Core\\Html\\Sigma(ASCMS_CORE_PATH . '/Config/View/Template/Backend');\n $templateObj->loadTemplateFile('development_tools.html');\n $templateObj->setVariable(array(\n 'TXT_TITLE_SET5' => $_ARRAYLANG['TXT_SETTINGS_TITLE_DEVELOPMENT'],\n 'TXT_DEBUGGING_STATUS' => $_ARRAYLANG['TXT_DEBUGGING_STATUS'],\n 'TXT_DEBUGGING_FLAGS' => $_ARRAYLANG['TXT_DEBUGGING_FLAGS'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_LOG' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_LOG'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_PHP' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_PHP'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_DB' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_DB'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_DB_TRACE' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_DB_TRACE'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_DB_CHANGE' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_DB_CHANGE'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_DB_ERROR' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_DB_ERROR'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_LOG_FILE' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_LOG_FILE'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_LOG_FIREPHP' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_LOG_FIREPHP'],\n 'TXT_DEBUGGING_EXPLANATION' => $_ARRAYLANG['TXT_DEBUGGING_EXPLANATION'],\n 'TXT_SAVE_CHANGES' => $_ARRAYLANG['TXT_SAVE'],\n 'TXT_RADIO_ON' => $_ARRAYLANG['TXT_ACTIVATED'],\n 'TXT_RADIO_OFF' => $_ARRAYLANG['TXT_DEACTIVATED']\n ));\n if (in_array('SystemInfo', \\Env::get('cx')->getLicense()->getLegalComponentsList())) {\n if (isset($_POST['debugging'])) {\n $this->updateDebugSettings($_POST['debugging']);\n }\n $this->setDebuggingVariables($templateObj);\n }\n \\Cx\\Core\\Setting\\Controller\\Setting::init('Config', null, 'Yaml', null, \\Cx\\Core\\Setting\\Controller\\Setting::REPOPULATE);\n \\Cx\\Core\\Setting\\Controller\\Setting::storeFromPost();\n \n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'site');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n $_ARRAYLANG['TXT_CORE_CONFIG_SITE'],\n $_ARRAYLANG['TXT_CORE_CONFIG_SITE'],\n 'TXT_CORE_CONFIG_',\n !$this->isWritable()\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'contactInformation');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n $_ARRAYLANG['TXT_CORE_CONFIG_CONTACTINFORMATION'],\n $_ARRAYLANG['TXT_CORE_CONFIG_CONTACTINFORMATION'],\n 'TXT_CORE_CONFIG_',\n !$this->isWritable()\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'administrationArea');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n $_ARRAYLANG['TXT_CORE_CONFIG_ADMINISTRATIONAREA'], \n $_ARRAYLANG['TXT_CORE_CONFIG_ADMINISTRATIONAREA'], \n 'TXT_CORE_CONFIG_',\n !$this->isWritable()\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'security');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n $_ARRAYLANG['TXT_CORE_CONFIG_SECURITY'],\n $_ARRAYLANG['TXT_CORE_CONFIG_SECURITY'],\n 'TXT_CORE_CONFIG_',\n !$this->isWritable()\n );\n if (in_array('SystemInfo', \\Env::get('cx')->getLicense()->getLegalComponentsList())) {\n \\Cx\\Core\\Setting\\Controller\\Setting::show_external(\n $template,\n $_ARRAYLANG['TXT_SETTINGS_TITLE_DEVELOPMENT'],\n $templateObj->get()\n );\n }\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'otherConfigurations');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n $_ARRAYLANG['TXT_CORE_CONFIG_OTHERCONFIGURATIONS'],\n $_ARRAYLANG['TXT_CORE_CONFIG_OTHERCONFIGURATIONS'],\n 'TXT_CORE_CONFIG_',\n !$this->isWritable()\n );\n\n\n // show also hidden settins\n if ( in_array('SystemInfo', \\Env::get('cx')->getLicense()->getLegalComponentsList())\n && \\Permission::hasAllAccess()\n && isset($_GET['all'])\n ) {\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'core');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n 'CORE',\n 'CORE', \n 'TXT_CORE_CONFIG_',\n true\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'release');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n 'RELEASE',\n 'RELEASE',\n 'TXT_CORE_CONFIG_',\n true\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'component');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n 'COMPONENT',\n 'COMPONENT',\n 'TXT_CORE_CONFIG_',\n !$this->isWritable()\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'license');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n 'LICENSE', \n 'LICENSE', \n 'TXT_CORE_CONFIG_',\n true\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'cache');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n 'CACHE', \n 'CACHE', \n 'TXT_CORE_CONFIG_',\n true\n );\n }\n $this->checkFtpAccess();\n $objTemplate->setVariable('SETTINGS_TABLE', $template->get());\n $objTemplate->parse('settings_system');\n }", "public function adminPluginOptionsPage()\n {\n echo $this->_loadView('admin-settings-page');\n }", "public function add_settings_submenu() {\n add_options_page(\n 'Update Monitor Settings',\n 'Update Monitor',\n 'manage_options',\n 'update-monitor-menu',\n array($this, 'update_monitor_page')\n );\n }", "public function settings_menu(){\n // add_submenu_page($parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function = '')\n add_submenu_page('tools.php','Checksum Generator', 'MD5 Checksums', 'manage_options', 'checksum-generator', array($this, 'theme_options_page'));\n\n //call register settings function\n add_action( 'admin_init', array($this, 'register_settings' ));\n }", "function add_settings_page() {\n\tadd_menu_page( __( 'Theme Options' ), __( 'Theme Options' ), 'manage_options', 'settings', 'theme_settings_page');\n}", "function jlt_setup_menu() {\n\t add_submenu_page( 'edit.php?post_type=testimonial', 'Testimonials Settings', 'Testimonials Settings', 'manage_options', 'testimonials-settings', 'jlt_testimonials_settings_page' );\n }", "public function pluginSettingsMenu()\n {\n $hook_suffix = add_options_page(__('Rundizable WP Features', 'rundizable-wp-features'), __('Rundizable WP Features', 'rundizable-wp-features'), 'manage_options', 'rundizable-wp-features-settings', [$this, 'pluginSettingsPage']);\n add_action('load-' . $hook_suffix, [$this, 'registerScripts']);\n unset($hook_suffix);\n\n //add_options_page(__('Rundizable WP Features read settings value', 'rundizable-wp-features'), __('Rundizable WP Features read settings', 'rundizable-wp-features'), 'manage_options', 'rundizable-wp-features-read-settings', [$this, 'pluginReadSettingsPage']);\n }", "public function settings_admin_page()\n {\n add_action('wp_cspa_before_closing_header', [$this, 'back_to_optin_overview']);\n add_action('wp_cspa_before_post_body_content', array($this, 'optin_theme_sub_header'), 10, 2);\n add_filter('wp_cspa_main_content_area', [$this, 'optin_form_list']);\n\n $instance = Custom_Settings_Page_Api::instance();\n $instance->page_header(__('Add New', 'mailoptin'));\n $this->register_core_settings($instance);\n $instance->build(true, true);\n }", "function create_AdminPages()\n\t{\t\t\n\t\t$parentSlug = \"edit.php?post_type=imperial_topic\";\n\t\t$page_title=\"Settings\";\n\t\t$menu_title=\"Settings\";\n\t\t$menu_slug=\"topic-settings\";\n\t\t$function= array( $this, 'drawTopicSettings' );\n\t\t$myCapability = \"manage_options\";\n\t\tadd_submenu_page($parentSlug, $page_title, $menu_title, $myCapability, $menu_slug, $function);\n\n\t\t\n\t\t\n\t}", "public function admin_settings(){\n\t\t$this->menu_pages['main'] = add_menu_page( $this::$plugin_name, 'WP LMS Settings', 'manage_options', $this::$plugin_name, array( $this, 'main_options_page' ) );\n\t\t//add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position );\n\t\t\n\t\t//$this->menu_pages['schedule'] = add_submenu_page( \"edit.php?post_type=session\", 'WP LMS Schedule', 'Schedule Courses', 'manage_options', $this::$plugin_name.'_schedule', array( $this,\"schedule_page\" ), $this->plugin_img_url.'png/24/schedule.png' );\n\t\t//$this->menu_pages['assignments'] = add_submenu_page( \"edit.php?post_type=course\", 'WP LMS Assignments', 'Assignments', 'manage_options', $this::$plugin_name.'_assignment', array( $this,\"assignment_page\" ) );\n\t\t//$this->menu_pages['lectures'] = add_submenu_page( \"edit.php?post_type=course\", 'WP LMS Lectures', 'Lectures', 'manage_options', $this::$plugin_name.'_lecture', array( $this,\"lecture_page\" ) );\n\t\t//$this->menu_pages['settings'] = add_submenu_page( \"edit.php?post_type=course\", 'WP LMS Settings', 'Settings', 'manage_options', $this::$plugin_name.'_settings', array( $this,\"settings_page\" ) );\n\t\t//edit.php?post_type=student_directory\n\t\t$this->menu_pages['view-student'] = add_submenu_page( \"edit.php?post_type=student_directory\", 'WP LMS View Students', 'View Students', 'manage_options', $this::$plugin_name.'_view_student', array( $this,\"view_student\" ) );\n\t\t$this->menu_pages['student-attendance'] = add_submenu_page( \"edit.php?post_type=student_directory\", 'WP LMS Student attendance', 'Student Attendance', 'manage_options', $this::$plugin_name.'_student_attendance', array( $this,\"student_attendance\" ) );\n\t\t//$this->menu_pages['settings-student'] = add_submenu_page( \"edit.php?post_type=student_directory\", 'WP LMS Student Settings', 'Settings', 'manage_options', $this::$plugin_name.'_student_settings', array( $this,\"student_settings\" ) );\n\t\t$this->menu_pages['view-instructors'] = add_submenu_page( \"edit.php?post_type=instructor\", 'WP LMS View Instrustors', 'View Instrustors', 'manage_options', $this::$plugin_name.'_view_instructor', array( $this,\"view_instructor\" ) );\n\t\t//$this->menu_pages['view-course-students'] = add_submenu_page( \"edit.php?post_type=course\", 'WP LMS View Course Students', 'View Enrollment', 'manage_options', $this::$plugin_name.'_view_enrollment', array( $this,\"view_enrollment\" ) );\n\t\t//add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function );\n\t}", "public function settings_admin_page()\n {\n add_action('wp_cspa_before_closing_header', [$this, 'back_to_optin_overview']);\n add_action('wp_cspa_before_post_body_content', array($this, 'optin_theme_sub_header'), 10, 2);\n add_filter('wp_cspa_main_content_area', [$this, 'optin_form_list']);\n\n $instance = Custom_Settings_Page_Api::instance();\n $instance->page_header(__('Add New Optin', 'mailoptin'));\n $this->register_core_settings($instance, true);\n $instance->build(true);\n }", "public function register_settings_page() {\n\t\tif ( ! WPSEO_Capability_Utils::current_user_can( 'wpseo_manage_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$page_callback = array( $this->menu, 'load_page' );\n\n\t\tadd_menu_page(\n\t\t\t'Yoast SEO: ' . __( 'MultiSite Settings', 'wordpress-seo' ),\n\t\t\t__( 'SEO', 'wordpress-seo' ),\n\t\t\t'delete_users',\n\t\t\t$this->menu->get_page_identifier(),\n\t\t\tarray( $this, 'network_config_page' ),\n\t\t\tWPSEO_Utils::get_icon_svg()\n\t\t);\n\n\t\tif ( WPSEO_Utils::allow_system_file_edit() === true ) {\n\t\t\tadd_submenu_page(\n\t\t\t\t$this->menu->get_page_identifier(),\n\t\t\t\t'Yoast SEO: ' . __( 'Edit Files', 'wordpress-seo' ),\n\t\t\t\t__( 'Edit Files', 'wordpress-seo' ),\n\t\t\t\t'delete_users', 'wpseo_files',\n\t\t\t\t$page_callback\n\t\t\t);\n\t\t}\n\n\t\t// Add Extension submenu page.\n\t\tadd_submenu_page(\n\t\t\t$this->menu->get_page_identifier(),\n\t\t\t'Yoast SEO: ' . __( 'Extensions', 'wordpress-seo' ),\n\t\t\t__( 'Extensions', 'wordpress-seo' ),\n\t\t\t'delete_users',\n\t\t\t'wpseo_licenses',\n\t\t\t$page_callback\n\t\t);\n\t}", "function boj_menuexample_create_menu() {\n\tadd_options_page( 'My Plugin Settings Page', 'Menu Example Settings', 'manage_options', __FILE__, 'boj_menuexample_settings_page' );\n\t\n}", "public function create_plugin_settings_page() {\n \t$page_title = 'My Awesome Settings Page';\n \t$menu_title = 'Awesome Plugin';\n \t$capability = 'manage_options';\n \t$slug = 'smashing_fields';\n \t$callback = array( $this, 'plugin_settings_page_content' );\n \t$icon = 'dashicons-admin-plugins';\n \t$position = 100;\n\n \tadd_menu_page( $page_title, $menu_title, $capability, $slug, $callback, $icon, $position );\n }", "public function settings_page() {\n\n\t\t?>\n\n\t\t<div class=\"wrap schedule-a-visit-to-sherpa-settings\">\n\t\t\t\n\t\t\t<form id=\"schedule-a-visit-to-sherpa-form\" method=\"post\" action=\"options.php\">\n\t\t\t\t\n\t\t\t\t<?php echo wp_nonce_field( 'schedule_a_visit_to_sherpa_data', 'schedule_a_visit_to_sherpa_nonce' ); ?>\n\n\t\t\t\t<?php settings_fields( 'schedule_a_visit_to_sherpa_settings_section' ); ?>\n\n\t\t\t\t<?php do_settings_sections( 'schedule-a-visit-to-sherpa' ); ?>\n\t\t\t\t\n\t\t\t\t<?php submit_button(); ?>\n\n\t\t\t</form>\n\n </div>\n\n\t\t<?php\n\n\t}", "public function submenu_page() {\n\n\t\tadd_submenu_page(\n\t\t\t'options-general.php',\n\t\t\t_x( 'Schedule a Visit Leads to Sherpa', 'Admin Page Title', 'schedule-a-visit-to-sherpa' ),\n\t\t\t_x( 'Schedule a Visit to Sherpa', 'Admin Sub-Menu Title', 'schedule-a-visit-to-sherpa' ),\n\t\t\t'manage_options',\n\t\t\t'schedule-a-visit-to-sherpa',\n\t\t\tarray( $this, 'settings_page' )\n\t\t);\n\t\t\n\t\t// Move our menu from Settings to under Forms\n\t\t\n\t\tglobal $submenu;\n\n\t\t$settings_index = null;\n\t\tforeach ( $submenu['options-general.php'] as $key => $menu_item ) {\n\t\t\t\n\t\t\t// Index 2 is always the child page slug\n\t\t\tif ( $menu_item[2] == 'schedule-a-visit-to-sherpa' ) {\n\t\t\t\t$settings_index = $key;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// We need to make the path more absolute\n\t\t$submenu['options-general.php'][ $settings_index ][2] = 'options-general.php?page=schedule-a-visit-to-sherpa';\n\t\t\n\t\t// Move the Menu Item\n\t\t$submenu['gf_edit_forms'][] = $submenu['options-general.php'][ $settings_index ];\n\t\tunset( $submenu['options-general.php'][ $settings_index ] );\n\n\t}", "public function menu_item() {\n add_options_page('ShareFile API', 'ShareFile API', 'read', 'sharefile-api', array($this, 'settings_page'));\n }", "function gssettings_theme_options() {\n global $_gssettings_settings_pagehook;\n $_gssettings_settings_pagehook = add_submenu_page( 'genesis', 'Sandbox Settings', 'Sandbox Settings', 'edit_theme_options', GSSETTINGS_SETTINGS_FIELD, 'gssettings_theme_options_page' );\n \n //add_action( 'load-'.$_gssettings_settings_pagehook, 'gssettings_settings_styles' );\n add_action( 'load-'.$_gssettings_settings_pagehook, 'gssettings_settings_scripts' );\n add_action( 'load-'.$_gssettings_settings_pagehook, 'gssettings_settings_boxes' );\n }", "function coolRahulSoni_custom_settings_add_menu() {\n add_menu_page( 'CoolRahulSoni Custom Settings', 'CoolRahulSoni Custom Settings', 'manage_options', 'custom-settings', 'custom_settings_page', null, 99 );\n}", "public static function getPage()\n {\n ?>\n <div class=\"wrap\">\n <h2>LMS Settings</h2>\n <?php settings_errors(); ?>\n\n <?php\n $active_tab = 'mp-lms-header-options';\n if (isset($_GET['page']) && $_GET['page'] !== 'mp-lms-settings') {\n $active_tab = $_GET['page'];\n }\n ?>\n\n <h2 class=\"nav-tab-wrapper\">\n <a href=\"?page=mp-lms-header-options\" class=\"nav-tab <?php echo 'mp-lms-header-options' == $active_tab || 'mp-lms-settings' == $active_tab ? 'nav-tab-active' : '' ?>\">Header Options</a>\n <a href=\"?page=mp-lms-footer-options\" class=\"nav-tab <?php echo 'mp-lms-footer-options' == $active_tab ? 'nav-tab-active' : '' ?>\">Footer Options</a>\n </h2>\n\n <form action=\"options.php\" method=\"post\">\n <?php\n\n if ( 'mp-lms-header-options' == $active_tab )\n {\n // Render the settings for the header_section\n settings_fields('header_section');\n\n // Renders all of the settings for sections\n do_settings_sections('mp-lms-header-options');\n }\n\n if ( 'mp-lms-footer-options' == $active_tab )\n {\n // Render the settings for the header_section\n settings_fields('footer_section');\n\n // Renders all of the settings for sections\n do_settings_sections('mp-lms-footer-options');\n }\n\n // Add the submit button\n submit_button();\n\n ?>\n </form>\n </div>\n <?php\n }", "function templ_add_page_menu()\r\n{\r\n\tdo_action('tevolution_menu_before_general_settings');\r\n\t\r\n\t$menu_title2 = __('Settings', 'templatic-admin');\r\n\tadd_submenu_page('templatic_system_menu', $menu_title2, $menu_title2,'administrator', 'templatic_settings', 'my_page_templates_function');\r\n\t\r\n\t/*tevolution_menu_after_general_settings hook for add additional menu after general settings */\r\n\tdo_action('tevolution_menu_after_general_settings');\t\t\r\n}", "public function settings_page() {\n do_action( 'rewardpoint_settings_start' );\n $current_tab = empty( $_GET['tab'] ) ? 'behavior' : sanitize_title( $_GET['tab'] );\n $current_section = empty( $_REQUEST['section'] ) ? '' : sanitize_title( $_REQUEST['section'] );\n $tabs = apply_filters( 'woocommerce_settings_tabs_array', array(\n 'behavior' => 'Behaviors',\n 'purchase' => 'Purchases',\n 'referral' => 'Referrals',\n 'invite' => 'Invite and Share',\n 'user-point' => 'Use Reward Points',\n ) );\n include 'views/html-admin-page.php';\n\t}", "function aman_add_admin_page() {\n\t//Add admin page menu\n\tadd_menu_page('Theme Settings', 'Theme Settings', 'manage_options', 'aman_settings_page', 'aman_create_page');\n\tadd_submenu_page( 'aman_settings_page', 'Theme Settings', 'General', 'manage_options', 'aman_settings_page', 'aman_create_page' );\n\n\tadd_submenu_page( 'aman_settings_page', 'Social Links', 'Social', 'manage_options', 'social_settings_page', 'social_create_page' );\n\n\tadd_submenu_page( 'aman_settings_page', 'Content Settings', 'Content', 'manage_options', 'content_settings_page', 'content_settings_create_page' );\n\n\n}", "public function addMenuPage()\n {\n $hook = add_options_page(\n __('Wistia Integration Settings'),\n __('Wistia'),\n 'manage_options',\n self::ADMIN_PAGE_ID,\n [$this->renderer, 'renderSettingsPage']\n );\n error_log('hook: '. $hook);\n }", "public function all_settings_link() {\n \tadd_options_page(__('All Settings'), __('All Settings'), 'administrator', 'options.php');\n }", "function display_tsm_menu() {\n\t/* 页名称,菜单名称,访问级别,菜单别名,点击该菜单时的回调函数(用以显示设置页面) */\n\tadd_options_page('Set Shortcode Manager', 'Shorcode Manager Menu', 'administrator', 'display_tsm','display_tsm_html_page');\n}", "public function registerOptionsPage()\n {\n add_submenu_page(\n 'tools.php',\n 'PostmanCanFail Settings',\n 'PostmanCanFail',\n 'administrator',\n __FILE__,\n [$this, 'settingsPage']\n );\n }", "public function create_plugin_settings_page()\n {\n require_once 'views/settings.phtml';\n }", "function theme_options_add_page() {\t\n\tadd_submenu_page('options-general.php', 'Site Description', 'Site Description', 'edit_theme_options', 'theme_options', 'theme_options_do_page'); \n\tadd_submenu_page('options-general.php', 'Google Analytics', 'Google Analytics', 'edit_theme_options', 'ga_options', 'ga_do_page'); \n}", "public function add_options_page()\n {\n $parent_slug = null;\n $subpage_slug = $this->welcome_slug;\n\n //echo \">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> TEST: \" . FREEMIUS_NAVIGATION . '<br>';\n\n if (FREEMIUS_NAVIGATION === 'tabs') {\n // only show submenu page when tabs enabled if welcome tab is active\n if (isset($_GET['page']) && $_GET['page'] === $subpage_slug) {\n $parent_slug = $this->custom_plugin_data->parent_slug;\n }\n } else {\n // always use this if navigation is set to 'menu'\n $parent_slug = $this->custom_plugin_data->parent_slug;\n }\n\n if ($this->custom_plugin_data->menu_type === 'top') {\n $label = 'About';\n } else if ($this->custom_plugin_data->menu_type === 'sub') {\n $label = '<span class=\"fs-submenu-item fs-sub wpgo-plugins\">About</span>';\n }\n\n add_submenu_page($parent_slug, 'Welcome to ' . $this->custom_plugin_data->main_menu_label, $label, 'manage_options', $subpage_slug, array(&$this, 'render_sub_menu_form'));\n }", "public function display_plugin_admin_page() {\n\t\t\tinclude_once( 'views/settings-page.php' );\n\t\t}", "function vsb_crypto_calculator_admin_page_screen() {\n global $submenu;\r\n\n // access page settings\r\n $page_data = array();\r\n\n foreach ($submenu['options-general.php'] as $i => $menu_item) {\r\n if ($submenu['options-general.php'][$i][2] == 'vsb_crypto_calculator') {\n $page_data = $submenu['options-general.php'][$i];\r\n }\r\n }\r\n // output\r\n?>\r\n <div class=\"wrap\">\r\n <?php screen_icon(); ?>\r\n <h2><?php echo $page_data[3]; ?></h2>\r\n <form id=\"vsb_crypto_calculator_options\" action=\"options.php\" method=\"post\">\n <?php\r\n settings_fields('vsb_crypto_calculator_options');\n do_settings_sections('vsb_crypto_calculator');\n submit_button('Save options', 'primary', 'vsb_crypto_calculator_options_submit');\n ?>\r\n </form>\r\n </div>\r\n <?php\r\n}", "function settings_section() {\n\t\t}", "public function optionsdemo_create_settings() {\n\t\t\t$parent_slug = 'edit.php?post_type=optiondemo';\n\t\t\t$page_title = esc_html__( 'Settings', 'optionsdemo' );\n\t\t\t$menu_title = esc_html__( 'Settings', 'optionsdemo' );\n\t\t\t$capability = 'manage_options';\n\t\t\t$slug = 'optionsdemo';\n\t\t\t$callback = array( $this, 'optionsdemo_settings_content' );\n\t\t\t\n\t\t\t//add submenu to custom post\n\t\t\tadd_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $slug, $callback );\n\t\t}", "public function init_settings_page()\n\t\t{\n\n\t\t\t$this->template_header();\n\t\t\t$this->template_body();\n\t\t\t$this->template_footer();\n\n\t\t}", "public function general_settings_page() {\n include __DIR__ . \"/views/general_settings.php\";\n }", "function recurlywp_options_page() {\n add_submenu_page(\n 'options-general.php',\n 'Recurly API Settings',\n 'Recurly API',\n 'manage_options',\n 'recurlywp',\n 'recurlywp_options_page_html'\n );\n}", "function bn_project_options_page() {\n // add top level menu page\n if ( empty ( $GLOBALS['admin_page_hooks']['bn_options'] ) ) {\n add_menu_page(\n 'Komunikaty',\n 'Komunikaty',\n '',\n 'bn_options',\n '',\n plugins_url('brodnet-logo.png', __FILE__ )\n );\n }\n\tadd_submenu_page(\n\t\t'bn_options',\n\t\t__('Komunikaty', 'bn-netto'),\n\t\t__('Komunikaty', 'bn-netto'),\n\t\t'manage_options',\n\t\t'bn_project_options',\n\t\t'bn_project_options_page_html'\n\t);\n}", "function admin_settings_pages( $settings_pages )\n{\n $settings_pages[] = array(\n 'id' => 'general',\n 'option_name' => 'general_settings',\n 'menu_title' => __( 'Configuratie', 'textdomain' ),\n 'icon_url' => 'dashicons-layout',\n );\n // Register setting page: 'Option for site'\n $settings_pages[] = array(\n 'id' => 'admin_settings_general',\n 'option_name' => 'general_option',\n 'menu_title' => __( 'Option for site', 'textdomain' ),\n 'parent' => 'general',\n );\n return $settings_pages;\n}", "function showGeneralPageEditorSettingsObject()\n\t{\n\t\tglobal $tpl, $ilTabs;\n\n\t\t$this->addPageEditorSettingsSubTabs();\n\t\t$ilTabs->activateTab(\"adve_page_editor_settings\");\n\t\t\n\t\t$form = $this->initGeneralPageSettingsForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function admin_menu() {\n // Duplicate link into properties mgmt\n \tadd_submenu_page(\n \t\tself::SLUG,\n \t\t__('Settings'),\n \t\t__('Settings'),\n \t\t'manage_options',\n \t\tself::SLUG,\n \t\t1\n \t);\n }", "function endpost_add_settings_page_item() {\r\n\tadd_submenu_page('options-general.php', 'EndPost Options', 'EndPost', 'manage_options', 'endpost-options', 'endpost_show_options');\r\n}", "public function setup_options_page() {\n\t\tacf_add_options_sub_page( [\n\t\t\t'page_title' \t=> _x( 'Promotions', 'Promotions page title in WP Admin', 'my-listing' ),\n\t\t\t'menu_title'\t=> _x( 'Promotions', 'Promotions menu title in WP Admin', 'my-listing' ),\n\t\t\t'menu_slug' \t=> 'theme-promotions-settings',\n\t\t\t'capability'\t=> 'manage_options',\n\t\t\t'redirect'\t\t=> false,\n\t\t\t'parent_slug' => 'case27/tools.php',\n\t\t] );\n\t}", "public function index()\n\t{\n\t\t$this->set_page_title(_l('web_setup'));\n\t\t$data['settings'] = get_settings();\n\t\t$data['content'] = $this->load->view('admin/settings/index', $data, TRUE);\n\t\t$this->load->view('admin/layouts/index', $data);\n\t}", "public function options_page_html() {\n // check user capabilities\n if ( ! current_user_can( 'manage_options' ) ) {\n return;\n }\n\n // add error/update messages\n\n // check if the user have submitted the settings\n // wordpress will add the \"settings-updated\" $_GET parameter to the url\n if ( isset( $_GET['settings-updated'] ) ) {\n // add settings saved message with the class of \"updated\"\n add_settings_error( 'settcalc_messages', 'settcalc_message', __( 'Settings Saved', 'settcalc' ), 'updated' );\n }\n\n // show error/update messages\n settings_errors( 'settcalc_messages' );\n ?>\n <div class=\"wrap\">\n <h1><?php echo esc_html( get_admin_page_title() ); ?></h1>\n <form action=\"options.php\" method=\"post\">\n <?php\n // output security fields for the registered setting \"wporg\"\n settings_fields( 'settcalc' );\n // output setting sections and their fields\n // (sections are registered for \"wporg\", each field is registered to a specific section)\n do_settings_sections( 'settcalc' );\n // output save settings button\n submit_button( 'Save Settings' );\n ?>\n </form>\n </div>\n <?php\n }", "private function render_settings_page_report(MJKGenToolsPage $page): void {\r\n \r\n // Get the settings pages (instances of JKNSettingsPage)\r\n $settings_pages = $page->settings_pages(); \r\n if (!empty($settings_pages)) {\r\n \r\n printf('<br>When any of the following settings areas are updated,'\r\n . ' this page is automatically generated: ');\r\n\r\n // Turn each one into a link\r\n $spage_links = '';\r\n foreach($settings_pages as $settings_page) {\r\n $link = sprintf('<a class=\"%s_%s\" href=\"%s\" title=\"%s\">%s</a>',\r\n self::id_base, self::cl_a_spage,\r\n $settings_page->url(),\r\n $settings_page->page_title(),\r\n $settings_page->menu_title());\r\n\r\n $spage_links .= sprintf('%s, ', $link);\r\n }\r\n\r\n // Output\r\n printf('%s', substr($spage_links, 0, -2));\r\n }\r\n }", "function jn_admin_menu() {\n add_submenu_page('themes.php', 'Theme Settings', 'Theme Settings', 'manage_options', 'theme_settings', 'theme_settings_page');\n}", "public function settingsPage() {\n require_once 'form.phtml';\n }", "function theme_settings_page(){ \n\t?>\n\t<div class=\"wrap\">\n\t\t<h1>Virksomhedsinformation</h1>\n\t\t<p>Dette er globale virksomhedsoplysninger. Ændringer kan ses flere stedet på websitet</p>\n\t\t<form method=\"post\" action=\"options.php\">\n\t\t\t<?php\n\t\t\tsettings_fields(\"section\");\n\t\t\tdo_settings_sections(\"theme-options\");\n\t\t\tsubmit_button();\n\t\t\t?>\n\t\t</form>\n\t</div>\n\t\n\t<?php }", "function cpjr3_settings_page() {\n\n add_options_page( __( 'Click Points Settings', 'cpjr3' ), __( 'Click Points', 'cpjr3' ), 'administrator', __FILE__, 'cpjr3_settings_fn' );\n\n}", "public function maz_hspm_settings_content() {\n ?>\n <div class=\"wrap\">\n <h2>Halve Spacers On Mobile Settings</h2>\n <form method=\"post\" action=\"options.php\">\n <br>\n <hr>\n <br>Breakpoint configures the screen width in pixels when the spacers change size.\n <br>Ratio defines the amount of change. For example, 0.5 will halve the size, 2 will double it.\n <br>\n\n <?php\n # Places all the fields defined above and the submit button in the markup\n settings_fields( 'maz_hspm_fields' );\n do_settings_sections( 'maz_hspm_fields' );\n submit_button();\n ?>\n </form>\n <div class=\"\">\n A Plugin by Moritz Zimmer, 2020\n </div>\n </div>\n <?php\n }", "function display_my_page() {\n?>\n\t<div class=\"wrap\">\n\t\t<h2>Theme Options</h2>\n\t\t<form method=\"post\" action=\"options.php\">\n\t\t\t<?php settings_fields( 'my-options' ); ?>\n\t\t\t<?php do_settings_sections( 'my-page-id' ); ?>\n\t\t\t<?php submit_button( 'Ka-Pow!' ); ?>\n\t\t</form>\n\t</div>\n<?php\n}", "function achilles_theme_settings_page(){ ?>\n <div class=\"wrap\">\n <h2><?php printf(__('%s Settings', 'achilles'), wp_get_theme()); ?></h2>\n <div class=\"updated\">\n <p><?php _e('Enter in your property settings below.', 'achilles'); ?></p>\n </div>\n <?php settings_errors(); ?> \n \n <form action=\"options.php\" method=\"POST\">\n <?php settings_fields( 'achilles-settings-group' ); ?>\n <?php do_settings_sections( 'achilles' ); ?>\n <?php submit_button(); ?>\n </form>\n \n </div> <!-- end settings wrap -->\n \n\t\n<?php }", "public function page_init()\n { \n register_setting(\n 'my_option_group', // Option group\n 'my_option_name', // Option name\n array( $this, 'sanitize' ) // Sanitize\n );\n\n add_settings_section(\n 'setting_section_id', // ID\n 'CLAS DEPT Theme Settings', // Title\n array( $this, 'print_section_info' ), // Callback\n 'my-setting-admin' // Page\n ); \n\n add_settings_field(\n 'dept_address', // ID\n 'Department Address', // Title \n array( $this, 'dept_address_callback' ), // Callback\n 'my-setting-admin', // Page\n 'setting_section_id' // Section \n ); \n\n add_settings_field(\n 'title', \n 'Footer Title', \n array( $this, 'title_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'fb', \n 'Facebook Link', \n array( $this, 'fb_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'twitter', \n 'Twitter Link', \n array( $this, 'twitter_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'instagram', \n 'Instagram Link', \n array( $this, 'instagram_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'youtube', \n 'Youtube Link', \n array( $this, 'youtube_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'rss', \n 'RSS Link', \n array( $this, 'rss_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n \n }", "public function managesettingsview() {\r\n $this->logger->info(\"Action Manage Settings View \");\r\n $this->template->display('displaylistsettings', $this->combovalue, 'settings', '', '');\r\n }", "public function optionsdemo_settings_content() { ?>\n\t\t\t<div class=\"wrap\">\t\t\t\t\n\t\t\t\t<form method=\"POST\" action=\"options.php\">\n\t\t\t\t\t<?php\n\t\t\t\t\tsettings_fields( 'optionsdemo' );\n\t\t\t\t\tdo_settings_sections( 'optionsdemo' );\n\t\t\t\t\tsubmit_button();\n\t\t\t\t\t?>\n\t\t\t\t</form>\n\t\t\t</div> <?php\n\t\t}", "function strl_add_settings_page() {\n\t$strl_icon_svg = file_get_contents( get_template_directory() . '/assets/img/icon-STRL-wit.svg' );\n\n\tif ( function_exists( 'acf_add_options_page' ) ) {\n\t\tacf_add_options_page(\n\t\t\tarray(\n\t\t\t\t'page_title' => __( 'STRL Global', 'strl' ),\n\t\t\t\t'menu_title' => __( 'STRL Global', 'strl' ),\n\t\t\t\t'menu_slug' => 'strl-general-settings',\n\t\t\t\t'capability' => 'edit_posts',\n\t\t\t\t'redirect' => false,\n\t\t\t\t'icon_url' => 'data:image/svg+xml;base64,' . base64_encode( $strl_icon_svg ), // phpcs:disable\n\t\t\t)\n\t\t);\n\t}\n\n\t// Set up the layout fields for the blocks area.\n\t$strl_settings_fields = array(\n\t\t// General Settings.\n\t\tarray(\n\t\t\t'key' => 'strl-general-tab',\n\t\t\t'label' => __( 'General', 'strl' ),\n\t\t\t'name' => 'strl-general-tab',\n\t\t\t'type' => 'tab',\n\t\t\t'placement' => 'left',\n\t\t),\n\t\tarray(\n\t\t\t'key' => 'strl-general',\n\t\t\t'label' => __( 'General', 'strl' ),\n\t\t\t'name' => 'strl-general',\n\t\t\t'type' => 'group',\n\t\t),\n\t\t// Standard Pages.\n\t\tarray(\n\t\t\t'key' => 'strl-standard-pages-tab',\n\t\t\t'label' => __( 'Standard Pages', 'strl' ),\n\t\t\t'name' => 'strl-standard-pages-tab',\n\t\t\t'type' => 'tab',\n\t\t\t'placement' => 'left',\n\t\t),\n\t\tarray(\n\t\t\t'key' => 'strl-standard-pages',\n\t\t\t'label' => __( 'Standard Pages', 'strl' ),\n\t\t\t'name' => 'strl-standard-pages',\n\t\t\t'type' => 'group',\n\t\t\t'placement' => 'left',\n\t\t\t'sub_fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'key' => 'strl-standard-404',\n\t\t\t\t\t'label' => __( '404', 'strl' ),\n\t\t\t\t\t'instructions' => __( 'This is the page visitors will see when they visit a link that doesn\\'t exist (anymore).', 'strl' ),\n\t\t\t\t\t'name' => 'strl-standard-404',\n\t\t\t\t\t'type' => 'relationship',\n\t\t\t\t\t'post_type' => array(\n\t\t\t\t\t\t0 => 'page',\n\t\t\t\t\t),\n\t\t\t\t\t'filters' => array(\n\t\t\t\t\t\t0 => 'search',\n\t\t\t\t\t),\n\t\t\t\t\t'max' => 1,\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key' => 'strl-standard-search',\n\t\t\t\t\t'label' => __( 'Search', 'strl' ),\n\t\t\t\t\t'name' => 'strl-standard-search',\n\t\t\t\t\t'type' => 'relationship',\n\t\t\t\t\t'post_type' => array(\n\t\t\t\t\t\t0 => 'page',\n\t\t\t\t\t),\n\t\t\t\t\t'filters' => array(\n\t\t\t\t\t\t0 => 'search',\n\t\t\t\t\t),\n\t\t\t\t\t'max' => 1,\n\t\t\t\t)\n\t\t\t)\n\t\t),\n\t\t// Social Media Accounts.\n\t\tarray(\n\t\t\t'key' => 'strl-contact-tab',\n\t\t\t'label' => __( 'Contact Information', 'strl' ),\n\t\t\t'name' => 'strl-contact-tab',\n\t\t\t'type' => 'tab',\n\t\t\t'placement' => 'left',\n\t\t),\n\t\tarray(\n\t\t\t'key' => 'strl-socials',\n\t\t\t'label' => __( 'Socials', 'strl' ),\n\t\t\t'name' => 'strl-socials',\n\t\t\t'instructions' => __( 'Enter only your username. You can toggle social icons in the Footer settings.', 'strl' ),\n\t\t\t'type' => 'group',\n\t\t\t'sub_fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'key' => 'strl-socials-instagram',\n\t\t\t\t\t'label' => '<i class=\"fab fa-instagram\"></i>' . ' ' . __( 'Instagram', 'strl' ),\n\t\t\t\t\t'name' => 'strl-socials-instagram',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key' => 'strl-socials-facebook',\n\t\t\t\t\t'label' => '<i class=\"fab fa-facebook-f\"></i>' . ' ' . __( 'Facebook', 'strl' ),\n\t\t\t\t\t'name' => 'strl-socials-facebook',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t),\n\t\t\t)\n\t\t),\n\t\tarray(\n\t\t\t'key' => 'strl-contact-info',\n\t\t\t'label' => __( 'Contact Info', 'strl' ),\n\t\t\t'name' => 'strl-contact-info',\n\t\t\t'type' => 'group',\n\t\t\t'sub_fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'key' => 'strl-contact-phone',\n\t\t\t\t\t'label' => '<i class=\"fas fa-phone\"></i>' . ' ' . __( 'Phone No.', 'strl' ),\n\t\t\t\t\t'name' => 'strl-contact-phone',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key' => 'strl-contact-email',\n\t\t\t\t\t'label' => '<i class=\"fas fa-envelope\"></i>' . ' ' . __( 'Email', 'strl' ),\n\t\t\t\t\t'name' => 'strl-contact-email',\n\t\t\t\t\t'type' => 'email',\n\t\t\t\t),\n\t\t\t)\n\t\t),\n\t\t// Footer Settings.\n\t\tarray(\n\t\t\t'key' => 'strl-footer-tab',\n\t\t\t'label' => __( 'Footer', 'strl' ),\n\t\t\t'name' => 'strl-footer-tab',\n\t\t\t'type' => 'tab',\n\t\t\t'placement' => 'left',\n\t\t),\n\t\tarray(\n\t\t\t'key' => 'strl-footer-icons',\n\t\t\t'label' => __( 'Footer Icons', 'strl' ),\n\t\t\t'name' => 'strl-footer-icons',\n\t\t\t'type' => 'group',\n\t\t\t'sub_fields' => array (\n\t\t\t\tarray(\n\t\t\t\t\t'key' => 'strl-footer-toggle-socials',\n\t\t\t\t\t'label' => __( 'Show Socials', 'strl' ),\n\t\t\t\t\t'name' => 'strl-footer-toggle-socials',\n\t\t\t\t\t'required' => 1,\n\t\t\t\t\t'type' => 'radio',\n\t\t\t\t\t'choices' => array(\n\t\t\t\t\t\t'show' => __( 'Yes, show social icons in the footer.', 'strl' ),\n\t\t\t\t\t\t'hide' => __( 'No, don\\'t show social icons in the footer.', 'strl' ),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t);\n\n\t// Adds ACF blocks to the Edit Page screen.\n\tacf_add_local_field_group(\n\t\tarray(\n\t\t\t'key' => 'strl-settings-area',\n\t\t\t'title' => __( 'STRL Settings', 'strl' ),\n\t\t\t'fields' => $strl_settings_fields,\n\t\t\t'location' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'param' => 'options_page',\n\t\t\t\t\t\t'operator' => '===',\n\t\t\t\t\t\t'value' => 'strl-general-settings',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'position' => 'normal',\n\t\t)\n\t);\n}", "function adminPage() {\n // Args: title of page to create/tab title, title used in settings menu, necessary permissions, slug for new page, function to output html content\n add_options_page('Word Count Settings', esc_html__('Word Count', 'wcpdomain'), 'manage_options', 'word-count-settings-page', array($this, 'ourHTML'));\n }" ]
[ "0.7855251", "0.7832427", "0.7805795", "0.7789956", "0.7750117", "0.77395666", "0.7695139", "0.76718956", "0.76469487", "0.76038", "0.7589724", "0.75269854", "0.75242305", "0.7503729", "0.75036204", "0.75002176", "0.74980265", "0.7484816", "0.74529904", "0.7425605", "0.7384887", "0.7384761", "0.7383514", "0.7362179", "0.7356388", "0.7302646", "0.7280625", "0.72800624", "0.7247904", "0.72373086", "0.72204626", "0.7219047", "0.71966153", "0.7177552", "0.7177428", "0.71676505", "0.7165598", "0.7141675", "0.7133715", "0.7127008", "0.71266943", "0.71262985", "0.7121855", "0.71056473", "0.70989853", "0.70959526", "0.70901084", "0.7079433", "0.7066788", "0.70648706", "0.70525354", "0.7048959", "0.7048642", "0.7046749", "0.70351475", "0.7030494", "0.7025518", "0.7018744", "0.7010669", "0.7002956", "0.70023215", "0.69790417", "0.69771445", "0.69730145", "0.6962268", "0.69598264", "0.69479215", "0.69288796", "0.69274", "0.6922495", "0.6911594", "0.6906578", "0.69059885", "0.6905164", "0.6891215", "0.68769586", "0.68710935", "0.68690157", "0.6866652", "0.684859", "0.6847781", "0.6842921", "0.6839193", "0.683542", "0.68343157", "0.6831124", "0.68281233", "0.6823351", "0.6823256", "0.6821503", "0.6819268", "0.6818345", "0.68139726", "0.68007046", "0.6798862", "0.6798097", "0.6797893", "0.67969114", "0.67941076", "0.67865306", "0.67831177" ]
0.0
-1
Setup before running any test case
public static function setUpBeforeClass() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp ()\n {}", "protected function doSetup(): void\n {\n }", "protected function setUp() { }", "protected function setUp() { }", "public function setup() {}", "function setUp() {\n\t\t\n\t}", "function setUp() {\n\t\t\n\t}", "protected function setUp()\n {}", "public function setUp() {}", "public function setUp() {}", "public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }", "public function setUp() {}" ]
[ "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.84345204", "0.84345204", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.82915086", "0.8290926", "0.8224121", "0.8224121", "0.82144415", "0.82021075", "0.82021075", "0.8123121", "0.8108245", "0.81079835", "0.8106947", "0.8106289" ]
0.0
-1
Setup before running each test case
public function setUp() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "function setUp() {\n\t\t\n\t}", "function setUp() {\n\t\t\n\t}", "protected function doSetup(): void\n {\n }", "protected function setUp ()\n {}", "public function setUp(): void\n {\n $this->setUpWithNoResult();\n }", "protected function setUp() { }", "protected function setUp() { }", "public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}" ]
[ "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.81356287", "0.81356287", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.80421937", "0.80421937", "0.80289686", "0.8018776", "0.793929", "0.7926855", "0.7926855", "0.7909959", "0.7904265", "0.7904265", "0.7904265", "0.7904265" ]
0.0
-1
Clean up after running each test case
public function tearDown() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp();", "public function cleanUp();", "public function cleanUp();", "public function cleanup() {\n\t\t//TODO\n\t}", "public function cleanTestActivities()\n {\n\n $this->collectCurrentTestUsers();\n $this->cleanExerciseUploadPictures();\n $this->cleanDeviceUploadPictures();\n $this->resetDatabase();\n }", "protected function tearDown(): void {\n unset($this->integration);\n unset($this->ccm);\n unset($this->session);\n }", "public function teardown()\n {\n //\n }", "protected function tearDown(): void\n {\n $this->config = null;\n $this->container = null;\n $this->instance = null;\n }", "public function tearDown()\n {\n unset($this->db);\n unset($this->statement);\n unset($this->mockData);\n }", "protected function tearDown() {\n\n $this->client = null;\n $this->deleteTestLocations();\n $this->locIDs = null;\n reuse_generateXML();\n }", "public function cleanup()\n {\n }", "protected function tearDown(): void {\n\t\t$this->http_client = null;\n\t\t$this->process_transactions = array();\n\n\t\tif ( ! empty( $this->transactions ) ) {\n\t\t\t$this->transactions = array();\n\n\t\t\tCrudTable\\delete_rows( 'transactions', $this->key_pairs, 100 );\n\n\t\t\t$this->key_pairs['tag'] = $this->tag;\n\t\t\tCrudTable\\delete_rows( 'transactions', $this->key_pairs, 100 );\n\n\t\t\tTestHelpers::removeJsonFile( $this->process_tag );\n\t\t\tTestHelpers::removeJsonFile( $this->tag );\n\t\t}\n\t}", "protected function cleanUp()\n\t{\n\t\t// clean\n\t\t$this->killExceededTasks();\n\t\t$this->cleanHistory();\n\t}", "public function teardown()\n {\n }", "function __destruct() {\n if ($this->testDir) {\n $this->eraseTempDir();\n }\n $this->unsetMockSession();\n }", "public function tearDown()\n {\n unset($this->_standardLib);\n unset($this->_daughter);\n }", "public function tearDown(): void\n {\n parent::tearDown();\n unset($this->purifier);\n unset($this->em);\n unset($this->objectiveManager);\n unset($this->learningMaterialManager);\n unset($this->courseLearningMaterialManager);\n unset($this->sessionLearningMaterialManager);\n unset($this->sessionDescriptionManager);\n unset($this->commandTester);\n }", "public function cleanup()\n\t{\n\t}", "public function tearDown() {\n $this->container = null;\n $this->model = null;\n $this->request = null;\n $this->response = null;\n $this->responseHeaders = null;\n $this->responseWriter = null;\n }", "protected function tearDown()\n {\n unset($this->output);\n }", "public function tearDown(): void\n {\n parent::tearDown();\n unset($this->filesystem);\n unset($this->diskSpace);\n unset($this->commandTester);\n }", "protected function tearDown() {\n $this->osapiCollection = null;\n $this->list = null;\n parent::tearDown();\n }", "public function tearDown()\n {\n // delete your instance\n OGR_DS_Destroy($this->hSrcDataSource);\n\n delete_directory($this->strPathToOutputData);\n\n unset($this->strPathToOutputData);\n unset($this->strTmpDumpFile);\n unset($this->strPathToData);\n unset($this->strPathToStandardData);\n unset($this->bUpdate);\n unset($this->hOGRSFDriver);\n unset($this->hLayer);\n unset($this->iSpatialFilter);\n unset($this->hSrcDataSource);\n }", "public function cleanup()\n\t{\n\t\t\n\t}", "protected function tearDown()\r\n {\r\n DirectoryManager::recursiveRemoveDir('data/tests');\r\n }", "public function tearDown(): void\n {\n self::$environ->cleanupTestUploadFiles();\n self::$environ->clean();\n }", "public function tearDown() {\n $this->resource = null;\n $this->response = null;\n $this->database = null;\n $this->storage = null;\n $this->event = null;\n $this->manager = null;\n }", "public function tearDown()\n\t{\n\t\tunset($this->target);\n\t}", "protected function tearDown(): void\n {\n $this->provider = null;\n $this->response = null;\n }", "public function tearDown() : void {\n\t\tunset($this->ls); /* Kill circular references */\n\t\tunset($this->lsconn); /* Kill circular references */\n\t}", "public function cleanup(): void\n {\n }", "public function cleanup(): void\n {\n }", "protected function tearDown(): void\n\t{\n\t\tglobal $modSettings;\n\n\t\t// remove temporary test data\n\t\tunset($modSettings);\n\t}", "protected function tearDown() {\n gc_collect_cycles();\n }", "public function tearDown(): void {\n // Remove any temporary directories that were created.\n $filesystem = new Filesystem();\n foreach ($this->tmpDirs as $dir) {\n $filesystem->remove($dir);\n }\n // Clear out variables from the previous pass.\n $this->tmpDirs = [];\n $this->io = NULL;\n // Clear the composer cache dir, if it was set\n putenv('COMPOSER_CACHE_DIR=');\n }", "public function tearDown() {\n $this->transformation = null;\n }", "public function tearDown() {\n $this->transformation = null;\n }", "public function tearDown() {\n $this->transformation = null;\n }", "protected function tearDown()\n {\n $this->regular1 = null;\n $this->regular2 = null;\n $this->rental1 = null;\n $this->rental2 = null;\n }", "protected function tearDown()\n {\n $this->calculator = NULL;\n }", "protected function tearDown(): void {\n $this->parser = null;\n }", "public function teardown()\n {\n if ($this->csvFile) {\n unlink($this->csvFile);\n $this->csvFile = null;\n }\n\n if ($this->photoZip) {\n unlink($this->photoZip);\n $this->photoZip = null;\n }\n }", "public function tearDown()\n {\n unset(\n $this->plugins,\n $this->events,\n $this->connection,\n $this->config\n );\n }", "protected function tearDown()\n {\n session_destroy(); //req'd because Kml class sets a cookie\n $this->clearRequest();\n $this->clearTmpFiles();\n }", "public function Cleanup()\r\n\t{\r\n\t}", "protected function tearDown()\n {\n \tunset($this->object);\n }", "protected function tearDown()\n {\n \tunset($this->object);\n }", "protected function tearDown()\n {\n \tunset($this->object);\n }", "protected function tearDown()\n {\n \tunset($this->object);\n }", "public function tearDown() {\n\t\tFixtures::clear('db');\n\t\tGalleries::reset();\n\t\tImages::reset();\n\t}", "public function tearDown() {\r\n\t\tunset($this->ImgTblHelper, $this->Controller, $this->View);\r\n\t\tparent::tearDown();\r\n\t}", "protected function tearDown(): void\n {\n $this->autorizacao = null;\n $this->transacao = null;\n $this->object = null;\n }", "protected function tearDown() {\r\n\t\t$this->dbh = null;\r\n\t\t$this->storage = null;\r\n\t\tparent::tearDown ();\r\n\t}", "public function tearDown()\n {\n $this->objectManager->create(\\Magento\\Tax\\Test\\TestStep\\DeleteAllTaxRulesStep::class, [])->run();\n }", "protected function tearDown() {\n $this->stack = null;\n }" ]
[ "0.7987785", "0.7987785", "0.7987785", "0.7987785", "0.7987785", "0.7987785", "0.7987785", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7985815", "0.7985815", "0.7985815", "0.7985815", "0.7985815", "0.7985815", "0.7850843", "0.7850843", "0.7850843", "0.76951295", "0.7688187", "0.76663786", "0.76383704", "0.76116425", "0.76023465", "0.759858", "0.7592881", "0.7578189", "0.75721014", "0.7563723", "0.7532292", "0.7532245", "0.7510675", "0.7466052", "0.745502", "0.7447906", "0.7437516", "0.7432085", "0.7422239", "0.742056", "0.74127865", "0.7395499", "0.7393894", "0.73909515", "0.7390909", "0.7389362", "0.7387827", "0.7387827", "0.7384437", "0.7381771", "0.73808354", "0.73763293", "0.73763293", "0.73763293", "0.73758084", "0.7359128", "0.7354937", "0.7352378", "0.73359734", "0.7333032", "0.7329993", "0.7327933", "0.7327933", "0.7327933", "0.7327933", "0.73216355", "0.7312936", "0.7306989", "0.7304376", "0.7294614", "0.72820467" ]
0.0
-1
Clean up after running all test cases
public static function tearDownAfterClass() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp();", "public function cleanUp();", "public function cleanUp();", "public function cleanup() {\n\t\t//TODO\n\t}", "public function cleanTestActivities()\n {\n\n $this->collectCurrentTestUsers();\n $this->cleanExerciseUploadPictures();\n $this->cleanDeviceUploadPictures();\n $this->resetDatabase();\n }", "public function cleanup()\n {\n }", "protected function cleanUp()\n\t{\n\t\t// clean\n\t\t$this->killExceededTasks();\n\t\t$this->cleanHistory();\n\t}", "public function tearDown()\n {\n unset($this->db);\n unset($this->statement);\n unset($this->mockData);\n }", "public function tearDown()\n {\n unset($this->_standardLib);\n unset($this->_daughter);\n }", "public function teardown()\n {\n //\n }", "protected function tearDown(): void {\n unset($this->integration);\n unset($this->ccm);\n unset($this->session);\n }", "protected function tearDown() {\n\n $this->client = null;\n $this->deleteTestLocations();\n $this->locIDs = null;\n reuse_generateXML();\n }", "public function cleanup()\n\t{\n\t}", "protected function tearDown(): void\n {\n $this->config = null;\n $this->container = null;\n $this->instance = null;\n }", "public function tearDown(): void\n {\n parent::tearDown();\n unset($this->purifier);\n unset($this->em);\n unset($this->objectiveManager);\n unset($this->learningMaterialManager);\n unset($this->courseLearningMaterialManager);\n unset($this->sessionLearningMaterialManager);\n unset($this->sessionDescriptionManager);\n unset($this->commandTester);\n }", "public function teardown()\n {\n }", "public function cleanup()\n\t{\n\t\t\n\t}", "function __destruct() {\n if ($this->testDir) {\n $this->eraseTempDir();\n }\n $this->unsetMockSession();\n }", "protected function tearDown(): void {\n\t\t$this->http_client = null;\n\t\t$this->process_transactions = array();\n\n\t\tif ( ! empty( $this->transactions ) ) {\n\t\t\t$this->transactions = array();\n\n\t\t\tCrudTable\\delete_rows( 'transactions', $this->key_pairs, 100 );\n\n\t\t\t$this->key_pairs['tag'] = $this->tag;\n\t\t\tCrudTable\\delete_rows( 'transactions', $this->key_pairs, 100 );\n\n\t\t\tTestHelpers::removeJsonFile( $this->process_tag );\n\t\t\tTestHelpers::removeJsonFile( $this->tag );\n\t\t}\n\t}", "protected function tearDown()\r\n {\r\n DirectoryManager::recursiveRemoveDir('data/tests');\r\n }", "public function tearDown()\n {\n // delete your instance\n OGR_DS_Destroy($this->hSrcDataSource);\n\n delete_directory($this->strPathToOutputData);\n\n unset($this->strPathToOutputData);\n unset($this->strTmpDumpFile);\n unset($this->strPathToData);\n unset($this->strPathToStandardData);\n unset($this->bUpdate);\n unset($this->hOGRSFDriver);\n unset($this->hLayer);\n unset($this->iSpatialFilter);\n unset($this->hSrcDataSource);\n }", "protected function tearDown() {\n gc_collect_cycles();\n }", "public function tearDown() {\n $this->container = null;\n $this->model = null;\n $this->request = null;\n $this->response = null;\n $this->responseHeaders = null;\n $this->responseWriter = null;\n }", "public function tearDown(): void\n {\n parent::tearDown();\n unset($this->filesystem);\n unset($this->diskSpace);\n unset($this->commandTester);\n }", "public function tearDown(): void {\n // Remove any temporary directories that were created.\n $filesystem = new Filesystem();\n foreach ($this->tmpDirs as $dir) {\n $filesystem->remove($dir);\n }\n // Clear out variables from the previous pass.\n $this->tmpDirs = [];\n $this->io = NULL;\n // Clear the composer cache dir, if it was set\n putenv('COMPOSER_CACHE_DIR=');\n }", "public function cleanup(): void\n {\n }", "public function cleanup(): void\n {\n }", "public function Cleanup()\r\n\t{\r\n\t}", "public function tearDown() : void {\n\t\tunset($this->ls); /* Kill circular references */\n\t\tunset($this->lsconn); /* Kill circular references */\n\t}", "protected function tearDown()\n {\n unset($this->output);\n }", "public function tearDown(): void\n {\n self::$environ->cleanupTestUploadFiles();\n self::$environ->clean();\n }", "protected function tearDown() {\n $this->osapiCollection = null;\n $this->list = null;\n parent::tearDown();\n }", "protected function tearDown()\n {\n $this->calculator = NULL;\n }", "protected function tearDown(): void {\n $this->parser = null;\n }", "protected function tearDown()\n {\n $this->compilerPass = null;\n $this->container = null;\n parent::tearDown();\n }", "protected function tearDown()\n {\n $this->regular1 = null;\n $this->regular2 = null;\n $this->rental1 = null;\n $this->rental2 = null;\n }", "public function tearDown() {\n\t\tFixtures::clear('db');\n\t\tGalleries::reset();\n\t\tImages::reset();\n\t}", "protected function tearDown()\n {\n \\RPI\\Foundation\\Helpers\\FileUtils::delTree(__DIR__.\"/LESSPHPTest/ROOT\");\n }", "public function tearDown() {\n $this->resource = null;\n $this->response = null;\n $this->database = null;\n $this->storage = null;\n $this->event = null;\n $this->manager = null;\n }", "protected function tearDown(): void\n\t{\n\t\tglobal $modSettings;\n\n\t\t// remove temporary test data\n\t\tunset($modSettings);\n\t}", "public function tearDown() {\n if ($this->wedisabledgc) {\n gc_enable();\n }\n $this->wedisabledgc = false;\n }", "public function tearDown()\n {\n $fs = new SymfonyFileSystem();\n $fs->remove($this->fakeTestFileDir);\n\n unset($this->builder);\n unset($this->builder);\n unset($this->fs);\n m::close();\n }", "protected function tearDown(): void\n {\n $this->provider = null;\n $this->response = null;\n }", "function endTest() {\n unset($this->CalendarRecursion);\n unset($this->CalendarInstance);\n unset($this->Activity);\n ClassRegistry::flush();\n }", "public function tearDown()\n {\n unset(\n $this->plugins,\n $this->events,\n $this->connection,\n $this->config\n );\n }", "protected function tearDown()\n {\n session_destroy(); //req'd because Kml class sets a cookie\n $this->clearRequest();\n $this->clearTmpFiles();\n }", "public function tearDown() {\r\n\t\tunset($this->ImgTblHelper, $this->Controller, $this->View);\r\n\t\tparent::tearDown();\r\n\t}", "public function tearDown() {\n $this->transformation = null;\n }", "public function tearDown() {\n $this->transformation = null;\n }", "public function tearDown() {\n $this->transformation = null;\n }", "protected function tearDown() {\r\n\t\t$this->dbh = null;\r\n\t\t$this->storage = null;\r\n\t\tparent::tearDown ();\r\n\t}", "public function tearDown()\n\t{\n\t\tunset($this->target);\n\t}", "function tearDown() {\n\t\t$this->wfRecursiveRemoveDir( $this->tmpName );\n\t}", "protected function tearDown()\n {\n Phlash::clear();\n }", "public function tearDown()\n {\n unset($this->filterRepositoryMock);\n unset($this->notificationContextManagerMock);\n unset($this->notificationTranslatorMock);\n unset($this->filterManager);\n }" ]
[ "0.79781395", "0.79781395", "0.79781395", "0.79781395", "0.79781395", "0.79781395", "0.79781395", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976344", "0.7976344", "0.7976344", "0.7976344", "0.7976344", "0.7976344", "0.78772247", "0.78772247", "0.78772247", "0.77385294", "0.7622718", "0.7590846", "0.7581981", "0.75642306", "0.75500023", "0.7537886", "0.75273365", "0.7519937", "0.7509883", "0.7505579", "0.74835205", "0.74744475", "0.7472191", "0.7471073", "0.7448932", "0.74277306", "0.74264514", "0.7404205", "0.739177", "0.7386229", "0.7383461", "0.738092", "0.738092", "0.73677146", "0.73663706", "0.73597026", "0.734277", "0.7338558", "0.73383325", "0.7336859", "0.73303896", "0.7327291", "0.73259425", "0.7311458", "0.7303411", "0.7294846", "0.7285744", "0.7283386", "0.7278399", "0.7277675", "0.7275594", "0.72737646", "0.7273622", "0.7269152", "0.7269152", "0.7269152", "0.72667706", "0.72666764", "0.7249254", "0.7248658", "0.72467804" ]
0.0
-1
responds to POST to /phones/create and creates, adds, stores the phone number
public function store(Request $request) { // properly takes into account whether user is changing their own info or another user's info $this->currentPerson = Person::find(auth()->user()->id); for ($i = 1; $i <= 5; $i++) { $adType = 'phoneType-'.$i; $addr1 = 'phoneNumber-'.$i; $type = request()->input($adType); $ad1 = request()->input($addr1); if (! empty($ad1)) { // check to see if this is the database already (someone else's phone) if ($inDB = Phone::where('phoneNumber', $ad1)->first()) { // check that the phone in the database actually belongs to the personID getting edited if ($inDB->personID == request()->input('personID')) { $inDB->updaterID = $this->currentPerson->personID; $inDB->save(); } else { // something if the personIDs do not match } } else { $newAddr = new Phone; $newAddr->personID = request()->input('personID'); $newAddr->phoneType = $type; $newAddr->phoneNumber = $ad1; $newAddr->creatorID = $this->currentPerson->personID; $newAddr->updaterID = $this->currentPerson->personID; $newAddr->save(); } } } if ($this->currentPerson->personID == request()->input('personID')) { return redirect('/profile/my'); } else { return redirect('/profile/'.request()->input('personID')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store()\n\t{\n\t\t$user = $this->user->where('api_token', '=', $this->token)->first();\n\t\t$attr = Input::get('data');\n\t\t$rules = $this->phone->createRules;\n\n\t\t$validator = Validator::make($attr, $rules);\n\n\t\tif($validator->fails()){\n\t\t\t$errors = $validator->messages();\n\t\t\treturn Response::json(['success' => false, 'errors' => $errors], 400);\n\t\t}\n\n\t\t//after validation success, lets save the number (through relationship)\n\t\t$attr['user_id'] = $user->id;\n\t\t$phone = new $this->phone($attr);\n\t\t$user->phones()->save($phone);\n\n\t\treturn Response::json(['success' => true, 'data' => $phone], 220);\n\t}", "public function store(Request $request)\n {\n $phone = new PhoneNumber();\n $phone->method_id = $request->method_id;\n $phone->phone_number = $request->phone_number;\n $phone->save();\n return redirect()->back()->with('success', 'A phone number has been created.');\n }", "public function store(PhonesRequest $request)\n {\n\n $phone =new Phones();\n $phone->phoneName=$request->phoneName;\n $phone->phoneBrand=$request->phoneBrand;\n $phone->phonePrice=$request->phonePrice;\n\n $phone->save();\n\n return response([\n\n\t\t\t'data' => new PhonesResource($phone),\n\t\t], Response::HTTP_CREATED);\n }", "public function createNewRecord() {\n try {\n // Define classes that we need to use.\n $phoneUtil = PhoneNumberUtil::getInstance();\n $phoneNumberCarrier = PhoneNumberToCarrierMapper::getInstance();\n // Define PhoneNumber instance.\n $phoneNumber = $phoneUtil->parse($this->number);\n // Check if phone number is valid.\n if ($phoneUtil->isValidNumber($phoneNumber)) {\n // Get phone number parameters.\n $countryCode = $phoneUtil->getRegionCodeForNumber($phoneNumber);\n $carrier = $phoneNumberCarrier->getNameForNumber($phoneNumber, $countryCode);\n $countryDialingCode = $phoneNumber->getCountryCode();\n $subscriberNumber = $phoneNumber->getNationalNumber();\n\n // We will return this data to the view.\n $data = [\n 'mno' => $carrier,\n 'country_dialing_code' => $countryDialingCode,\n 'subscriber_number' => $subscriberNumber,\n 'country_code' => $countryCode,\n ];\n\n // Save new record into database.\n $record = Records::create([\n 'phone_number' => $this->number,\n 'data' => json_encode($data),\n ]);\n\n return $record;\n }\n } catch (NumberParseException $e) {\n throw new NumberParseException($e, $e->getMessage());\n }\n }", "public function store(PhoneRequest $request)\n {\n $this->authorize('create');\n $this->phone->create([\n 'phone' => $request->phone\n ]) ;\n\n return redirect()->back();\n\n }", "public function savephone() {\n if (isset($_POST['phone'])) {\n $userId = $this->session->userdata('user_id');\n $phone = $this->input->post('phone');\n $result = $this->Users->savephone($phone, $userId);\n if ($result) {\n $this->output\n ->set_content_type('application/json')\n ->set_output(json_encode(array('result' => 1)));\n } else {\n $this->output\n ->set_content_type('application/json')\n ->set_output(json_encode(array('result' => 0)));\n }\n }\n }", "public function store()\n\t{\n\t\t$data = Input::json();\n\n\t\t$utils = UtilController::getInstance();\n\t\t$numberStructure = $utils->nStruct;\n\n\t\t$newNumber = new ContactNumber;\n\t\tforeach ($data as $key => $value) {\n\t\t\t$newNumber->$numberStructure[$key] = $value;\n\t\t}\n\n\t\t$newNumber->save();\n\t\tif ($newNumber) {\n\t\t\treturn Response::json($newNumber) ;\n\t\t}else\n\t\t{\n\t\t\treturn Response::make(\"error\", 500);\n\t\t}\n\t}", "public function store(SmsNumberRequest $request)\n {\n alert()->success('Phone number', 'The record has been saved successfully.');\n SmsNumber::create($request->all());\n return redirect()->route('sms.index')->with('message', 'item added');\n }", "public function save()\n {\n $path = ($this->phone_id == null)\n ? '/admin/v1/phones' : '/admin/v1/phones/'.$this->phone_id;\n\n // \"number\" is required\n if ($this->number == null) {\n throw new \\InvalidArgumentException('The \"number\" property is required');\n }\n\n $params = array(\n 'number' => $this->number,\n 'name' => $this->name,\n 'extension' => $this->extension,\n 'type' => $this->type,\n 'platform' => $this->platform,\n 'predelay' => $this->predelay,\n 'postdelay' => $this->postdelay\n );\n\n $request = $this->getRequest('admin')\n ->setMethod('POST')->setParams($params)->setPath($path);\n\n $response = $request->send();\n\n if ($response->success() == true) {\n $body = $response->getBody();\n return $this->load($body);\n } else {\n return false;\n }\n }", "public function assign()\n {\n /** @var User $user */\n $user = Auth::user();\n if(!is_null($user->twilio_number)) return back()->with('error', 'You already have a Twilio number.');\n\n try{\n $phone = Number::create();\n $user->update(['twilio_phone' => $phone]);\n return back()->with('success', 'A phone number has been assigned to you.');\n }catch (\\Exception $exception){\n return back()->with('error', sprintf('Error: %s', $exception->getMessage()));\n }\n }", "public function store(Request $request)\n {\n $phone = PhoneType::create($request->all());\n\n\n return redirect()->route('phones.index');\n }", "public function create_person_phone($data) {\r\n \r\n $person_phone = new PersonPhones;\r\n $person_phone->attributes = $data;\r\n $person_phone->save();\r\n return $person_phone;\r\n }", "public function store(Request $request)\n {\n $phone = $request->validate([\n 'number' => 'required|integer'\n ]);\n\n return redirect()->back()->withSuccess('Phone successfully add');\n }", "public function addNewPhone()\n {\n $titre = 'New Phone';\n $this->render('achat','achatPhone', compact('titre'));\n }", "public function store(Request $request)\n {\n try {\n $phone = Phone::create($request->all());\n $phone->clients()->attach($request->client);\n return redirect()->route('client_phone.show', ['client' => $request->client, 'phone' => $phone->id])->with('success', ('created'));\n } catch (\\Exception $e) {\n return redirect()->route('clients.show', ['id' => $request->client])->with('error', $e->getMessage());\n }\n }", "public function store(PhoneRequest $request, Phone $model)\n {\n $this->storeData($request, $model);\n\n return back()->with('success' , 'Phone Saved Successfully') ;\n }", "public function create()\n {\n $methods = Method::all();\n $phones = PhoneNumber::all();\n return view('backend.phones.create')->with('methods',$methods)->with('phones',$phones);\n }", "public function &CreatePhone($type, $number)\n\t\t{\n\t\t\t$tel = new DataPushPhone($type, $number);\n\n\t\t\t$this->AddPhone($tel);\n\n\t\t\treturn $tel;\n\t\t}", "public function store(Request $request)\n {\n $number = new \\App\\Number;\n $number->user_id = \\Auth::user()->id;\n $number->name = $request->get('name');\n $number->number = $request->get('number');\n $number->email = $request->get('email');\n $number->address = $request->get('address');\n $number->save();\n\n return redirect('/numbers')->with('success', 'Number has been added');\n }", "public function create()\n\t{\n return View::make('mobilephones.create');\n\t}", "public function create()\n {\n return view('admin.phone.create');\n }", "public function Create() {\n\t\tvalid_only_single_method ( 'POST' );\n\t\trequire_authorization ();\n\n\t\t// Check the Phone number and Telephone number, then call the Notier model\n\t\t$courier_id\t\t\t\t= get_validated_courier_id ();\n\n\t\t$this->load->model ( 'delivery_session_model' );\n\t\t$delivery_session_id = $this->delivery_session_model->Create ( $courier_id );\n\n\n\t\tjson_response ( array ( 'response' => $this->config->item ( 'response_success' ),\n\t\t\t\t'delivery_session_id'\t=> $delivery_session_id ) );\n\t}", "public function store(Request $request)\n {\n //\n\n // $this->validate($request, [ // the new values should not be null\n // 'firstName' => 'required',\n // 'lastName' => 'required',\n // 'type' => 'required',\n // 'number' => 'required',\n // ]);\n \n // using db mysql*\n // $phone_book = new PhoneBooks;\n // $phone_book->name = $request->firstName .\" \". $request->lastName ; //user name = firstname + lastname\n // $phone_book->type = $request->type; // phone number type\n // $phone_book->number = $request->number; // phone number input\n // $phone_book->save(); //storing values as an object\n\n // using jsom file \n $data = json_encode( $request->query());\n $fileJson = file_get_contents('C:\\Users\\User\\Projects\\CodingTest\\public\\json\\phone-book.json');\n $tempArray = json_decode($fileJson, true);\n array_push($tempArray, $data);\n $jsonData = json_encode($tempArray);\n file_put_contents('C:\\Users\\User\\Projects\\CodingTest\\public\\json\\phone-book.json', $jsonData);\n\n \n return json_decode($data);\n \n\n }", "public function postCreate()\r\n\t{ \r\n $Data = Input::json()->all();\r\n $CourierId = isset($Data['courier_id']) ? (int)$Data['courier_id'] : 0;\r\n $Name = isset($Data['name']) ? $Data['name'] : null;\r\n $Code = isset($Data['code']) ? $Data['code'] : null;\r\n $Phone = isset($Data['phone']) ? $Data['phone'] : null;\r\n $Active = isset($Data['active']) ? (int)$Data['active'] : 0;\r\n \r\n $Model = new PostManModel;\r\n $statusCode = 200;\r\n \r\n if(empty($CourierId) || empty($Name) || empty($Phone)){\r\n $contents = array(\r\n 'error' => true, 'message' => 'values empty'\r\n );\r\n return Response::json($contents, $statusCode, array('Access-Control-Allow-Origin' => $this->domain));\r\n }\r\n \r\n $Id = $Model::insertGetId(\r\n array(\r\n 'courier_id' => $CourierId, \r\n 'name' => $Name, \r\n 'phone' => $Phone, \r\n 'code' => $Code, \r\n 'active' => $Active\r\n ));\r\n \r\n if($Id){\r\n $contents = array(\r\n 'error' => false,\r\n 'message' => 'success',\r\n 'id' => $Id\r\n );\r\n }else{\r\n $contents = array(\r\n 'error' => true,\r\n 'message' => 'insert false'\r\n );\r\n }\r\n \r\n return Response::json($contents, $statusCode, array('Access-Control-Allow-Origin' => $this->domain));\r\n\t}", "function add_mobile_number() {\n\n\t\t$this->authentication->is_user_logged_in(TRUE, 'user/login');\n\n\t\t$aUserMobileVerificationStatus = $this->config->item('user_mobile_verification_status');\n\n\t\t$iAccountNo = s('ACCOUNT_NO');\n\n\t\t$aWhere = array(\n\t\t\t\t\t\t'status' => $this->aUserStatus['active'],\n\t\t\t\t\t);\n\t\tif( ! $oUser = $this->user_model->getUserBy('account_no', $iAccountNo, 'basic', $aWhere) ) {\n\n\t\t\tsf('error_message', 'You cannot access this section right now');\n\t\t\tredirect('home');\n\t\t}\n\n\n\t\tif( $oUser->mobile_number ) {\n\n\t\t\tswitch($oUser->mobile_verification_status) {\n\n\t\t\t\tcase $aUserMobileVerificationStatus['sms_sent']:\n\t\t\t\tcase $aUserMobileVerificationStatus['no_sms_verification_done']:\n\n\t\t\t\t\tsf('error_message', 'click to resend the mobile number verification code');\n\t\t\t\t\tredirect('profile/edit');\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $aUserMobileVerificationStatus['sms_verified']:\n\n\t\t\t\t\tsf('error_message', 'you can update your mobile number.');\n\t\t\t\t\tredirect('profile/edit');\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\n\t\tif ( isset($_POST) && ! empty($_POST) ) {\n\n\t\t\t$this->form_validation->set_rules('mobile_number',\n\t\t\t\t\t\t\t\t\t\t\t 'Mobile number',\n\t\t\t\t\t\t\t\t\t\t\t 'trim|required|min_length[10]|max_length[10]|is_natural',\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 'min_length' => 'Mobiler number should be a 10 digit number',\n\t\t\t\t\t\t\t\t\t\t\t\t 'max_length' => 'Mobiler number should be a 10 digit number',\n\t\t\t\t\t\t\t\t\t\t\t\t 'is_natural' => 'Mobiler number should have only numbers',\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\n\t\t\tif ($this->form_validation->run() == TRUE) {\n\n\t\t\t\t$sMobileNumber = safeText('mobile_number');\n\n\t\t\t\t// see if this mobile number is with us already\n\t\t\t\tif( ! $bisMobileNumExists = $this->user_model->isMobileNumExists($sMobileNumber) ) {\n\n\t\t\t\t\tif( $oUser->mobile_number ) {\n\n\t\t\t\t\t\t// move the mobile number to users history\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// update the user with the mobile number and mark the mobile number as not verified\n\t\t\t\t\t$this->db->set('mobile_number', $sMobileNumber);\n\t\t\t\t\t$this->db->set('mobile_verification_status', $aUserMobileVerificationStatus['no_sms_verification_done']);\n\t\t\t\t\t$this->db->where('account_no', $iAccountNo);\n\t\t\t\t\t$this->db->update('users');\n\n\t\t\t\t\t// initiate steps to verify mobile number\n\t\t\t\t\t$this->user_model->initiateMobileNumVerification($iAccountNo);\n\n\n\t\t\t\t\tredirect('verify_mobile_number?account_no='.$iAccountNo);\n\n\t\t\t\t} else {\n\t\t\t\t\t$this->merror['error'][] = 'The mobile number is already used.';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tloadTemplate('user/add_mobile_number');\n\t}", "function phoneid ($phone_number, array $fields = []) {\n return $this->post(sprintf(self::PHONEID_RESOURCE, $phone_number), $fields);\n }", "public function store(Request $request)\n {\n $contact = new Contact();\n $contact->Name = $request->Name;\n $contact->Address = $request->Address;\n $contact->Email = $request->EmailAddress;\n $contact->Website = $request->Website;\n $contact->TIN = $request->TIN;\n $contact->CreditLimit = $request->CreditLimit;\n $contact->PaymentTerm = $request->PaymentTerm;\n $contact->Type = count($request->Type)>1?'B':$request->Type[0];\n $contact->ContactPersons = json_encode($request->ContactPerson);\n $contact->save();\n\n if(count($request->ContactNumber)>0) {\n foreach($request->ContactNumber as $number){\n if($number!=null) {\n $entry = new PhonebookEntry();\n $entry->Type = 'C';\n $entry->Number = $number;\n $entry->ReferenceID = $contact->ID;\n $entry->save();\n }\n }\n }\n\n $name = explode(' ', $request->Name);\n $name = implode('-',$name);\n return redirect()->to('/stakeholder/view/'.$contact->ID.\"-\".$name);\n }", "public function store(Request $request)\n {\n // dd(Auth::user());\n // return \"yes store\";\n\n //validation\n $this->validate($request,[\n \n 'phone' => 'required|regex:/^([0-9\\s\\-\\+\\(\\)]*)$/|digits:11|numeric|unique:clients',\n // Rule::unique('users')->ignore($user->id)],\n 'address' => 'required'\n ]);\n //store\n // $client = new Client;\n // $client->phone = $request->phone;\n // $client->address = $request->address;\n // $client->client_id=Auth::id();\n // $client->username= Auth::user()->name;\n // $client->save();\n $r=$request->all();\n $r['client_id'] = Auth::id();\n $r['username'] = Auth::user()->name;\n // dd($request->all());\n Client::create($r);\n\n //redirect\n return redirect()->route('home')->with('success','Phone has been added successfully');\n }", "public function create(Request $request)\n {\n $all = $request->all();\n $id = $all['addId'];\n $phone = $all['addphone'];\n $data = new Formbuild();\n $data::where('id', $id)->update(array('phone' => $phone));\n return 'Successfully Added!';\n }", "public function store(Request $request)\n {\n $array_contacts = json_decode($request->input('contacts'));\n\n foreach($array_contacts as $contact) {\n //Check if first or last name are empty\n if(empty($contact->firstName) || empty($contact->lastName)) {\n return Response::json(array(\n 'success' => false,\n 'data' => 'You cannot add contact with empty first name or last name'\n ));\n }\n\n $new_contact_arr = [\n 'first_name' => $contact->firstName,\n 'last_name' => $contact->lastName\n ];\n //insert into table phones\n foreach ($contact->phones as $key => $phone) {\n //Check if type or number are empty\n if(empty($phone->type) || empty($phone->number)) {\n\n return Response::json(array(\n 'success' => false,\n 'data' => 'You cannot save contact without type or phone'\n ));\n }\n //insert into table contacts\n if ($key == 0) {\n $new_contact = Contact::create($new_contact_arr);\n }\n //Check if this number already exist\n $phones_all = Phone::where('phone', '=', $phone->number)->first();\n if(!empty($phones_all)) {\n return Response::json(array(\n 'success' => false,\n 'data' => 'Phone already exists'\n ));\n }\n //insert phone\n $phone = Phone::create([\n 'type'=> $phone->type,\n 'contact_id' => $new_contact->id,\n 'phone' => $phone->number\n ]);\n }\n }\n }", "public function setNewPhone($value)\n {\n return $this->set('NewPhone', $value);\n }", "public function actionaddUniquePhone()\n\t{\n\t\t\n\t\tif($this->isAjaxRequest())\n\t\t{\n\t\t\tif(isset($_POST['userphoneNumber'])) \n\t\t\t{\n\t\t\t\t$sessionArray['loginId']=Yii::app()->session['loginId'];\n\t\t\t\t$sessionArray['userId']=Yii::app()->session['userId'];\n\t\t\t\t$loginObj=new Login();\n\t\t\t\t$total=$loginObj->gettotalPhone($sessionArray['userId'],1);\n\t\t\t\tif($total > 1)\n\t\t\t\t{\n\t\t\t\t\techo \"Limit Exist!\";\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\t$totalUnverifiedPhone=$loginObj->gettotalUnverifiedPhone($sessionArray['userId'],1);\n\t\t\t\tif($totalUnverifiedPhone==1)\n\t\t\t\t{\n\t\t\t\t\techo \"Please first verify unverified phone.\";\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$result=$loginObj->addPhone($_POST,1,$sessionArray);\n\t\t\t\t\n\t\t\t\tif($result['status']==0)\n\t\t\t\t{\n\t\t\t\t\techo \"success\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo $result['message']; \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->render(\"/site/error\");\n\t\t}\n\t}", "public function store(CreateTelefonoRequest $request)\n {\n $input = $request->all();\n\n $telefono = $this->telefonoRepository->create($input);\n\n Flash::success('Telefono saved successfully.');\n\n return redirect(route('backend.telefonos.index'));\n }", "public function create(Array $data, $person_id)\n {\n $data['person_id'] = $person_id;\n $validator = $this->validator->validateData($data);\n\n if( $validator->fails() )\n return redirect()->route('phone.create', ['person_id'=>$person_id])->withErrors($validator)->withInput();\n\n $phone = $this->model->create($data);\n $letter = strtoupper(substr($phone->person->nickname,0,1));\n\n session(['success' => \"o telefone [{$phone->maskNumber}] foi criado com sucesso!\"]);\n\n return redirect()->route('notebook.letter', compact('letter'));\n }", "function insert_user( $userPhoneNumber)\n\t{\n\t\t$insert_stmt = sprintf(\"INSERT INTO users \n\t\t\t\t\t\t\t\t(usersPhoneNumber) \n\t\t\t\t\t\t\t\tVALUES ('%s')\", \n\t\t\t\t\t\t\t\t$userPhoneNumber);\n\t\t$results = $this->db->query($insert_stmt);\n\t\t\n\t\tif($results!=false)\n\t\t{\n\t\t\t$this->response->setResponse(true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response->setResponse(false,\"\",\"Failed to update any information to users\");\n\t\t}\n\t\treturn $this->response;\n\t}", "private function setTelephone()\n {\n \tif ( empty($_POST['telephone'] ) ) {\n $this->data['error']['telephone'] = 'Please provide a valid phone number.';\n $this->error = true;\n return;\n }\n\t\n $t = trim( $_POST['telephone'] );\n \n\t\t// Remove non-digits.\n\t\t$t = preg_replace('/[^0-9]/', '', $t);\n\t\n\t\t// Make sure it's 10 digits.\n\t\tif ( strlen($t) != 10 ) {\n\t\t\t$this->data['error']['telephone'] = 'Please provide a valid phone number.';\n $this->error = true;\n return;\n\t\t}\n\t\n $this->data['telephone'] = $t;\n }", "public function add() {\n\n\t\tif(isset($_POST['name']) && isset($_POST['age']) && $_POST['phoneNumber']) {\n\n\t\t\t$name = $_POST['name'];\n\t\t\t$age = $_POST['age'];\n\t\t\t$phoneNumber = $_POST['phoneNumber'];\n\n\t\t\t$results = Person::add($name, $age, $phoneNumber);\n\n\t\t\techo json_encode(array_merge($this->response, $results));\n\t\t} else {\n\t\t\techo json_encode(array_merge($this->response, array('error' => 1, 'message' => 'Please provide all request')));\n\t\t}\n\t}", "public function create()\n\t{\n\t\t\n\t\t$data['firstName'] = $this->input->post('firstName');\n\t\t$data['lastName'] = $this->input->post('lastName');\n\t\t$data['id'] = $this->input->post('id');\t\t\n\t\t$contacts_id = $this->contact_model->add_edit_contact($data);\n\t\t\n\t\tif($data['id'] == ''){\n\t\t\t$response = array('status' => true, 'message' => \"Contact inserted successfully\");\n\t\t}else{\n\t\t\t$response = array('status' => true, 'message' => \"Contact updated successfully\");\n\t\t}\n\t\techo json_encode($response);\n\t}", "function add_new_phonebook_contact($phonebook_data_type, $id, $name, $phone, $address, $email, $contactPerson, $contactType){\n\t\tif( isset($_POST[$phonebook_data_type]) ){\n\t\t\tglobal $base;\n\t\t\tswitch ($_POST[$phonebook_data_type]) {\n\t\t\t\tcase 'insert':\n\t\t\t\t\t$phonebook = new phonebook();\n\t\t\n\t\t\t\t\t$phonebook->phonebook_company_id \t= $_POST[$id];\n\t\t\t\t\t$phonebook->user_id \t\t\t\t= $base->clear_string($_SESSION['user_id']);\n\t\t\t\t\t$phonebook->phonebook_name \t\t\t= $_POST[$name];\n\t\t\t\t\t$phonebook->phonebook_phone \t\t= $_POST[$phone];\n\t\t\t\t\t$phonebook->phonebook_address \t\t= $_POST[$address];\n\t\t\t\t\t$phonebook->phonebook_email\t\t\t= $_POST[$email];\n\t\t\t\t\t$phonebook->phonebook_contactperson = $_POST[$contactPerson];\n\t\t\t\t\t$phonebook->contact_type \t\t\t= $_POST[$contactType];\n\n\t\t\t\t\t$phonebook->create();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'update':\n\t\t\t\t\tphonebook::update_phonebook_info($_POST[$id], $_POST[$name], $_POST[$phone], $_POST[$address], $_POST[$email], $_POST[$contactPerson], $_POST[$contactType]);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t}", "public function create_details()\n\t{\n\t\t\n\t\t$data['type'] = $this->input->post('type');\n\t\t$data['value'] = $this->input->post('value');\n\t\t$data['id'] = $this->input->post('id');\t\t\n\t\t$data['contact_id'] = $this->input->post('contact_id');\t\t\n\t\t$contacts_id = $this->contact_model->add_edit_contact_details($data);\n\t\t\n\t\tif($data['id'] == ''){\n\t\t\t$response = array('status' => true, 'message' => \"Contact details inserted successfully\");\n\t\t}else{\n\t\t\t$response = array('status' => true, 'message' => \"Contact details updated successfully\");\n\t\t}\n\t\techo json_encode($response);\n\t}", "public function store(Request $request)\n {\n //\n $request->validate([\n 'username' => 'required|min:4|max:190|unique:users',\n 'name' => 'required|min:3|max:190',\n 'email' => 'email',\n 'branch_id' => 'required|integer',\n 'password' => 'required|min:4|max:50',\n 'phones' => 'required|array|min:1|max:10',\n ]);\n if($request->has('branch_id') and !$branch = Branch::find($request->branch_id)){\n return $this->errorResponse(trans('app.error_branch_not_found'));\n }\n if(!checkPhones($request->phones))\n return $this->errorResponse(trans('user.error_phone'));\n // return $this->errorResponse(['test' => $request->phones[0]]);\n $data = $request->only([\n 'username' ,'name' ,'email' , 'branch_id'\n ]);\n $data['password'] = Hash::make($request->password);\n $data['group'] = 2;\n $data['status'] = 1;\n $employee = Employee::create($data);\n // store phones number\n $count = 0;\n foreach($request->phones as $phone):\n $data = [\n 'user_id' => $employee->id,\n 'number' => $phone['number'],\n 'primary' => $phone['primary']\n ];\n Phone::create($data);\n $count++;\n endforeach;\n\n // store activity\n $activity = new Activity([\n 'description' => trans('activity.create_employee' , ['user' => $employee->name]),\n 'type' => 'create', \n 'user_id' => $this->user->id,\n 'related_id' => $employee->id,\n \n ]);\n $employee->activities()->save($activity);\n $employee->phones = Phone::where('user_id' , $employee->id)->get();\n return $this->successResponse([\n 'success' => true,\n 'message' => trans('app.create_successfully'),\n 'data' => $employee\n ]);\n }", "public function store(Request $request)\n {\n // Twilio::message('+8801784622362', 'how are yo?');\n }", "function add_new_phonebook_contact_from_contact_form( $contactFromForm, $name, $phone, $address, $email, $contactPerson, $contactType){\n\t\tif( isset($_POST[$contactFromForm]) ){\n\t\t\tglobal $base;\n\t\t\t$phonebook = new phonebook();\n\n\t\t\t//$phonebook->phonebook_company_id \t= '0';\n\t\t\t$phonebook->user_id \t\t\t\t= $base->clear_string($_SESSION['user_id']);\n\t\t\t$phonebook->phonebook_name \t\t\t= $_POST[$name];\n\t\t\t$phonebook->phonebook_phone \t\t= $_POST[$phone];\n\t\t\t$phonebook->phonebook_address \t\t= $_POST[$address];\n\t\t\t$phonebook->phonebook_email\t\t\t= $_POST[$email];\n\t\t\t$phonebook->phonebook_contactperson = $_POST[$contactPerson];\n\t\t\t$phonebook->contact_type \t\t\t= $_POST[$contactType];\n\n\t\t\t$phonebook->create();\n\t\t}\n\t}", "public function store(CreateMakerRequest $request) // stroe method takes the CreateMakerRequest value or Request\n\t{\n\t\t$values = $request->only(['name','phone']); // verify the values we receive is only name and phone in an array\n\t\t\n\t\tMaker::create($values); // creating an instance of Maker, create will receive the values\n\t\treturn response()->json(['message'=>'Maker Correctly added'], 200); //message in json to notify the data was inserted correctly\n\n\t}", "protected function registerPhoneRequest($token, $phone)\n {\n // verify the required parameter 'token' is set\n if ($token === null || (is_array($token) && count($token) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $token when calling '\n );\n }\n // verify the required parameter 'phone' is set\n if ($phone === null || (is_array($phone) && count($phone) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $phone when calling '\n );\n }\n\n $resourcePath = '/rapi/register_phone';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // form params\n if ($token !== null) {\n $formParams['token'] = ObjectSerializer::toFormValue($token);\n }\n // form params\n if ($phone !== null) {\n $formParams['phone'] = ObjectSerializer::toFormValue($phone);\n }\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/x-www-form-urlencoded']\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\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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function store(Request $request)\n {\n $request->validate([\n 'number' => ['required' , config('phoneauth.validate') , 'exists:users,number'],\n ]);\n\n // We will send the number verification token to this user. Once we have attempted\n // to send the token, we will examine the response then see the message we\n // need to show to the user. Finally, we'll send out a proper response.\n $status = PhoneNumber::sendVerificationToken(\n $request->only('number')\n );\n\n if ($status == PhoneNumber::VERIFICATION_TOKEN_SENT) {\n return redirect(\n URL::temporarySignedRoute(\n 'password.create',\n now()->addMinutes(15),\n $request->only('number')\n )\n )->with('status', __($status));\n }\n\n throw ValidationException::withMessages([\n 'number' => [trans($status)],\n ]);\n }", "public function sendOTP_post()\n {\n $phone = $this->input->post('phone');\n $otp = $this->generateRandomString();\n $check = $this->User_model->select_data('*',\"tbl_otp\",array('phone'=>$phone));\n if (empty($check)) {\n $this->User_model->insert_data('tbl_otp',array('phone'=>$phone,'otp'=>$otp,'addedOn'=>date(\"Y-m-d H:i:s\")));\n } else {\n $this->User_model->update_data('tbl_otp',array('otp'=>$otp,'updatedOn'=>date(\"Y-m-d H:i:s\")),array('phone'=>$phone));\n }\n\n\n $msg = array('to'=>$phone,'body'=>\"Your verification code for Kudos is: $otp\");\n // print_r($this->twilioMessage()); die;\n $this->twilioMessage($msg);\n $status = 1;\n $response = array();\n\n if ( $status == 0 ) {\n $response['status'] = 'error';\n $response['message'] = 'This failed';\n } else {\n $response['status'] = 'success';\n $response['message'] = 'OTP sent successfully';\n $response['otp'] = $otp;\n }\n\n //echo json_encode($response);\n $this->set_response($response, REST_Controller::HTTP_OK);\n /* Twilio sms verification End */\n }", "public function store(CreateDomicilioRequest $request)\n {\n $input = $request->all();\n\n $domicilio = $this->domicilioRepository->create($input);\n\n Flash::success('Domicilio guardado exitosamente.');\n\n return redirect(route('domicilios.index'));\n }", "public function store()\n\t{\n\t\t\n\n\t\t$data = Input::all();\n\t\t$validation = Validator::make($data, Utility::commonRules());\n\t\tif($validation->fails()){\n\t\t\tRedirect::to('/')->withErrors($validation); \n\t\t}\n \n\t\t$image_path = \"\";\n\t\tif(Input::hasFile('image_path')){\n\t\t\t$file = Input::file('image_path');\n\t\t\t$filename = str_random(20).'.'.$file->getClientOriginalExtension();//;$file->getClientOriginalName();\n\t\t\t$destinationPath = 'uploads/';\n\t\t\t$image_path = $destinationPath.$filename;\n\t\t\t$uploadSuccess = $file->move($destinationPath, $filename);\n\t\t}\n\t\t\n\n\t\t$mobilephone = new Mobilephone;\n\t\t$mobilephone->category_id = Input::get('category_id');\n\t\t$mobilephone->poster_id = Auth::user()->id;\n\t\t$mobilephone->product_for = Input::get('product_for');\n\t\t$mobilephone->is_replica = Input::get('is_replica');\n\t\t$mobilephone->is_touch = Input::get('is_touch');\n\t\t$mobilephone->title = Input::get('title');\n\t\t$mobilephone->description = Input::get('description');\n\t\t$mobilephone->price = Input::get('price');\n\t\t$mobilephone->image_path = $image_path; \n\t\t$mobilephone->brand = Input::get('brand');\n\n\t\t$mobilephone->save();\n\n\t\treturn Redirect::to('/');\n\t}", "public function addPhone( $type, $number, $ext )\n\t{\n\t\t// database connection and sql query\n $core = Core::dbOpen();\n $sql = \"INSERT INTO user_phone (type, userID, phoneNum, ext ) VALUES ( :type, :userID, :number, :ext )\";\n $stmt = $core->dbh->prepare($sql);\n $stmt->bindParam(':type', $type);\n $stmt->bindParam(':userID', $this->userID);\n $stmt->bindParam(':number', $number);\n $stmt->bindParam(':ext', $ext);\n Core::dbClose();\n\n\t\ttry\n {\n if( $stmt->execute()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} catch ( PDOException $e ) {\n echo \"Add phone number failed!\";\n }\n\t\treturn false;\n\t}", "public static function create($first_name, $last_name, $password, $email, $phone, $user_name) {\n \n $response = Http::post(env('API_URL').'users/store', [\n 'first_name' => $first_name,\n 'last_name' => $last_name,\n 'password' => $password,\n 'email' => $email,\n 'phone' => $phone,\n 'user_name' => $user_name\n ]);\n \n if($response->status() == 200) {\n return \"\";\n }\n \n return ($response->json()['error']);\n }", "public function store(Request $request)\n {\n $person = new Client();\n $person->lastname = ucwords($request->LastName);\n $person->firstname = ucwords($request->FirstName);\n $person->middlename = ucwords($request->MiddleName);\n $person->email = $request->Email;\n $person->mobilenumber = $request->Mobile1Number;\n $person->phonenumber = 'N/A';\n $person->title = 'Mr./Ms.';\n $person->calltime = 0;\n $person->customcalltime = '';\n $person->contacted = false;\n $person->save();\n\n $ctpl = new CTPL();\n $ctpl->type = $request->Type;\n $ctpl->client = $person->id;\n $ctpl->plate = $request->PlateNo;\n $ctpl->engine = $request->Engine;\n $ctpl->chassis = $request->Chassis;\n $ctpl->mvfile = $request->MVFileNumber;\n $ctpl->manufacturer = $request->Manufacturer;\n $ctpl->model = ucwords($request->Model);\n $ctpl->variant = ucwords($request->Variant);\n $ctpl->year = $request->Year;\n $ctpl->color = ucwords($request->Color);\n $ctpl->street = $request->StreetLine1;\n $ctpl->province = $request->ProvinceId;\n $ctpl->city = $request->CityId;\n $ctpl->brgy = $request->BarangayId;\n $ctpl->village = $request->Village;\n $ctpl->zipcode = $request->ZipCode;\n $ctpl->generateReferenceNumber();\n $ctpl->save();\n\n return redirect()->to('');\n }", "public function store(TelefoneRequest $request)\n {\n $telefone = $this->objTelefone;\n\n $cad = $telefone->create([\n 'ddd' => $request->ddd,\n 'telefone' => $request->telefone,\n 'cliente_id' => $request->cliente_id,\n ]);\n\n if ($cad) {\n return redirect('/telefone/list/' . $request->cliente_id);\n }\n }", "private function getPhone($countryCode)\n {\n $phoneNumber = false;\n $client = Twilio::client();\n $lookups = Twilio::lookups();\n\n // looking for existent phone number\n $numbers = $client->account->incoming_phone_numbers;\n foreach($numbers as $number) {\n $lookup = $lookups->phone_numbers->get($number->phone_number);\n if($lookup->country_code === $countryCode) {\n $phoneNumber = $number->phone_number;\n break;\n }\n }\n\n // buy new number if not found\n if($phoneNumber === false) {\n $availableNumbers = $client->account->available_phone_numbers->getList($countryCode, 'Local', [\n //'SmsEnabled' => 'True',\n 'VoiceEnabled' => 'True',\n ]);\n try {\n $first = $availableNumbers->available_phone_numbers[0]->phone_number;\n $newNumber = $client->account->incoming_phone_numbers->create([\n 'PhoneNumber' => $first,\n 'VoiceUrl' => url('call/incoming'),\n 'StatusCallback' => url('call/completed'),\n 'SmsUrl' => url('sms/incoming'),\n 'VoiceMethod' => 'POST',\n 'StatusCallbackMethod' => 'POST',\n 'SmsMethod' => 'POST',\n ]);\n// $newNumber->update(array(\n// \"VoiceUrl\" => url('call/incoming'),\n// \"SmsUrl\" => url('sms/incoming'),\n// \"VoiceMethod\" => 'POST',\n// \"SmsMethod\" => 'POST',\n// ));\n $phoneNumber = $newNumber->phone_number;\n } catch(\\Exception $e) {\n Log::error($e->getMessage());\n return View::make('site._error');\n }\n }\n\n return View::make('site._phone', [\n 'number' => $phoneNumber,\n ]);\n }", "public function post_create() {\n\t\t$ext = 'json';\n\t\t$header = 'application/json';\n\n\t\tif (Request::accepts('text/xml')) {\n\t\t\t$ext = 'xml';\n\t\t\t$header = 'text/xml';\n\t\t}\n\n\t\t$todo = new Todo;\n\t\t$todo->title = Input::get('title');\n\t\t$todo->task = Input::get('task');\n\t\t$todo->due_date = Input::get('due_date');\n\t\t$todo->done = Input::get('done');\n\t\t$todo->save();\n\n\t\treturn Response::make('', '201',\n\t\t\t\tarray('Content-Type' => $header, 'Location' => 'todos/'\n\t\t\t\t\t\t. $todo->id));\n\t}", "public function store(Request $request)\n {\n \n //validate data \n $validation=$this->validate($request, [\n 'first_name' => 'required|max:50',\n 'last_name' => 'required|max:50', \n 'email' => 'required|email|max:50' ,\n 'phone_number'=> ['required','digits:10','regex:/^(07\\d{8})$/'], \n 'cadre_id' => 'required|numeric' \n ]); \n\n \n $person = new Personnel;\n\n $person->first_name = $request->first_name;\n $person->last_name = $request->last_name;\n $person->email = $request->email;\n $person->telephone = $request->phone_number;\n $person->cadre_id = $request->cadre_id;\n\n $person->save(); \n\n // redirect\n Session::flash('message', 'Successfully added the record!');\n Session::flash('alert-type', 'success');\n \n return Redirect::to('personnel');\n\n }", "function addContact() {\n\t$request = Slim::getInstance()->request();\n\t$cont = json_decode($request->getBody());\n\n\t$sql = \"call AddContact(:p_name, :p_phone, :p_address)\";\n\ttry {\n\t\t$db = DB_Connection();\n\t\t$stmt = $db->prepare($sql); \n\t\t$stmt->bindParam(':p_name',$cont->name,PDO::PARAM_STR,30);\n\t\t$stmt->bindParam(':p_phone',$cont->phone,PDO::PARAM_STR,15);\n\t\t$stmt->bindParam(':p_address',$cont->address,PDO::PARAM_STR,100);\n\t\t$stmt->execute();\n\t\t$db = null;\n\t\techo json_encode($cont); \n\t} catch(PDOException $e) {\n\t\techo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n\t}\n}", "public function setPhone($value)\n {\n return $this->set('Phone', $value);\n }", "public function setPhone($value)\n {\n return $this->set(self::PHONE, $value);\n }", "public function setPhone($value)\n {\n return $this->set(self::PHONE, $value);\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'title'=>'required',\n 'problem_id'=>'required',\n 'tele_number'=>'required',\n 'discription'=>'required'\n ]);\n\n //Create and save Call\n $call = new Call;\n $call->title = $request->input('title');\n $call->problem_id = $request->input('problem_id');\n $call->discription = $request->input('discription');\n $call->tele_number = $request->input('tele_number');\n $call->user_id = auth()->user()->id;\n $call->caller_name = auth()->user()->name;;\n $call->save();\n \n\n return redirect('/problems/'.$call->problem_id)->with('success','Call Created');\n \n }", "public function store(Request $request)\n {\n $telefono = new Telefono();\n $telefono->numero = $request->get('numero');\n $telefono->tipo_id = $request->get('tipo');\n $telefono->persona_id = $request->get('persona');\n $telefono->save();\n return redirect('/telefonos');\n }", "public function store(Request $request)\n\t{\n\t\t$this->validate($request, [\n\t\t\t'name' => 'required',\n\t\t\t'phone' => 'required',\n\t\t]);\n\n\t\ttry {\n\t\t\t$data = $request->input();\n\t\t\t$exists = User::all()->where('phone', $data['phone'])->first() != null;\n\n\t\t\tif (!$exists) {\n\t\t\t\t$password = Str::random(8);\n\t\t\t\t$data['password'] = Hash::make($password);\n\n\t\t\t\t$user = new User($data);\n\t\t\t\t$user->saveOrFail();\n\t\t\t\t\n\t\t\t\t$client = new Client();\n\t\t\t\t\n\t\t\t\t// Send password to user via SMS\n\t\t\t\t$message = \"Bienvenue sur DayCash, votre compte a été créé avec succès. Votre mot de passe est: \" . $password;\n\t\t\t\t$phone = Str::startsWith($data['phone'], ['237', '+237']) ? $data['phone'] : '237' . $data['phone'];\n\t\t\t\t$client->get(\"http://obitsms.com/api/bulksms?username=\" . env('SMS_USER') . \"&password=\" . env('SMS_PASSWORD') . \"&sender=\" . env('SMS_SENDER') . \"&destination=\" . $phone . \"&message=\" . $message);\n\n\t\t\t\treturn response()->json(['message' => \"Votre compte a été ouvert avec succès. Vous recevrez le mot de passe par message sous peu.\", 'user' => $user], 201);\n\t\t\t} else {\n\t\t\t\treturn response()->json((['message' => \"Vous possédez déjà un compte, veuillez vous connecter.\"]), 500);\n\t\t\t}\n\t\t} catch (\\Exception $e) {\n\t\t\treturn response()->json(['message' => \"Une erreur est survenue lors de la création du compte.\", 'exception' => $e->getMessage()], 500);\n\t\t}\n\t}", "public function store(Request $request)\n {\n $this->validate($request, [\n 'number' => 'required|string|max:250',\n ]);\n\n\n Line::create([\n 'number' => $request['number'],\n 'airtime_id' => $request['airtime_id'],\n ]);\n\n $status = 'Number added successfuly';\n //return redirect()->route('leave')->withErrors(['You have left the class']);\n return redirect()->back()->with('success', $status );\n }", "public function addData()\n {\n $phone = new Phone();\n $phone->phone = '01517167619';\n\n $student = new Student();\n $student->name = 'SI-2';\n $student->email = '[email protected]';\n $student->save();\n $student->phone()->save($phone);\n\n return 'Data Insert Successfully';\n }", "public function store()\n\t{\n\n\n $rules = array(\n 'first_name' => 'required',\n 'last_name' => 'required',\n 'email' => 'required|email|unique:contacts', // required and must be unique in the contacts table\n 'address' => 'required'\n );\n\n $input = Input::all();\n\n $validator = Validator::make($input, $rules);\n\n if($validator->fails())\n {\n //return $this->response->errorBadRequest('Failed Validation. All Requirements were not met.');\n throw new Dingo\\Api\\Exception\\StoreResourceFailedException('Could not create new contact.', $validator->errors());\n }\n\n contact::create(Input::all());\n\n return $this->response->created();\n\t}", "public function store(CreateContactRequest $request): JsonResponse\n {\n $contact = $this->phoneBookService->createContact($request->dataTransferObject());\n\n return ContactResource::make($contact)\n ->additional(['message' => 'Created.'])\n ->response();\n }", "public function store($name, $phone, $address, $email) {\n return $this->model->create(compact('name', 'phone', 'address', 'email'));\n }", "public function post_create() {\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\t$radio = NULL;\n\n\t\ttry {\n\n\t\t\t// ##### Validation #####\n\n\t\t\t\t$input = $this->params['data'];\n\n\t\t\t\t$required = array('name' => NULL, 'contries_id' => NULL);\n\n\t\t\t\tif (!$this->validation($input, $required, 'radios')) {\n\t\t\t\t\treturn $this->sendError($this->constants['invalidParameter'], \"POST\", \"RADIOS\");\n\t\t\t\t}\n\n\t\t\t// ##### Registration #####\n\n\t\t\t\t$radio = new Radio();\n\t\t\t\tforeach ($input as $key => $item) {\n\t\t\t\t\t$radio->{$item['field']} = $item['value'];\n\t\t\t\t}\n\t\t\t\t$radio->save();\n\n\t\t\t\treturn $this->sendSuccess($this->constants['success'], \n\t\t\t\t\t\t\t\t\t\t \"GET\", \n\t\t\t\t\t\t\t\t\t\t \"RADIOS\",\n\t\t\t\t\t\t\t\t\t\t $input);\n\n\t\t}\n\t\tcatch(\\Exception $e) {\n\n\t\t\t// Delete record just created\n\n\t\t\tif ($radio!==NULL) {\n\t\t\t\tRadio::where('id', $radio->id)->delete();\n\t\t\t}\n\n\t\t\t/* PER DEBUG */ print_r($e->getMessage());\n\t\t\treturn $this->sendError($this->constants['generic'], \"GET\", \"RADIOS\");\n\t\t}\n\t}", "public function create_post(){\n\n $this->form_validation->set_rules('domicilio[latitud]', 'Latitud del Domicilio', 'required|trim');\n $this->form_validation->set_rules('domicilio[longitud]', 'Longitud del Domicilio', 'required|trim');\n $this->form_validation->set_rules('domicilio[image]', 'Imagen del Mapa', 'required|trim');\n\n\t\tif( $this->form_validation->run() == true){\n \n $data = $this->security->xss_clean($this->input->post()); # XSS filtering\n\n $token = $this->security->xss_clean($this->input->post('auth', TRUE)); //token de authentication\n $is_valid_token = $this->authorization_token->validateToken($token);\n\n if(null !== $is_valid_token && $is_valid_token['status'] === TRUE){\n $usuario = $this->Usuario_model->getByTokenJWT($is_valid_token['data']);\n $domicilio = $data[\"domicilio\"];\n\n if (array_key_exists('persona', $data)) {\n $domicilio['id_persona'] = $data[\"persona\"]['id'];\n }\n $domicilio['id_usuario'] = $usuario->id;\n $out_domicilio = $this->Domicilio_model->create( $domicilio );\n\n if($out_domicilio != null){\n\n $this->response([\n 'status' => true,\n 'message' => $this->lang->line('item_was_has_add'),\n $this->lang->line('domicilio') => $out_domicilio\n ], REST_Controller::HTTP_OK);\n }else{\n $this->response([\n 'status' => false,\n 'message' => $this->lang->line('no_item_was_has_add')\n ], REST_Controller::HTTP_CREATED);\n }\n }else{\n $this->response([\n 'status' => false,\n 'message' => $this->lang->line('token_is_invalid'),\n ], REST_Controller::HTTP_NETWORK_AUTHENTICATION_REQUIRED); // NOT_FOUND (400) being the HTTP response code\n }\n\t\t}else{\n $this->response([\n 'status' => false,\n 'message' => validation_errors()\n ], REST_Controller::HTTP_ACCEPTED); \n\t\t}\n $this->set_response($this->lang->line('server_successfully_create_new_resource'), REST_Controller::HTTP_RESET_CONTENT);\n }", "public function setPhones($phones)\n {\n $this->phones = $phones;\n }", "public function createAction()\n\t{\n\t\t$contact = new Contacts();\n\t\t$success = $contact->save($this->request->getPost(), array('name', 'phone', 'email'));\n\n\t\tif ($success) {\n\t\t\t$this->flash->success(\"Contact Successfully Saved!\");\n\t\t\t$this->dispatcher->forward(['action' => 'index']);\n\t\t}\n\t\telse {\n\t\t\t$this->flash->error(\"Following Errors occurred: <br/>\");\n\n\t\t\tforeach ($contact->getMessages() as $message) {\n\t\t\t\t$this->flash->error($message);\n\t\t\t}\n\n\t\t\t$this->dispatcher->forward(['action' => 'new']);\n\t\t}\n\t}", "public function setPhoneNumber($value)\n {\n return $this->setParameter('phoneNumber', $value);\n }", "public function store(AddressBookRequest $request)\n {\n foreach($request->get('phone_type') as $k=>$v){\n $this->validate($request, [\n 'phone_type.'.$k => 'numeric|exists:phone_types,id',\n 'phone.'.$k => 'min:10|max:15'\n ]);\n }\n \n DB::beginTransaction();\n try {\n $AddressBook = AddressBook::create([\n 'user_id' => Auth::user()->id,\n 'name' => $request->get('name'),\n 'email' => $request->get('email'),\n 'zip_code' => $request->get('zip_code'),\n 'address' => $request->get('address'),\n 'number' => $request->get('number'),\n 'complement' => $request->get('complement'),\n 'district' => $request->get('district'),\n 'city' => $request->get('city'),\n 'state' => $request->get('state')\n ]);\n\n foreach($this->joinPhoneData($request->get('phone_type'), $request->get('phone')) as $k => $PhoneData){\n \n $PhoneNumber = PhoneNumber::create([\n 'address_book_id' => $AddressBook->id,\n 'phone_type_id' => $PhoneData['phoneType'],\n 'phone' => $PhoneData['phoneNumber']\n ]);\n }\n } catch (Exception $e) {\n DB::rollback();\n return back()->withInput();\n }\n \n DB::commit();\n return redirect('contact')->with('AlertSuccess', '<p>Contato Craiado com sucesso!</p>');\n }", "public function create(\n string $name, \n string $email, \n string $phone, \n string $id_card\n ) : Model;", "function customer_phonegroup_create(){\r\n\t\t//POST varible here\r\n\t\t//auto increment, don't accept anything from form values\r\n\t\t$hapus_cust = trim(@$_POST[\"hapus_cust\"]);\r\n\t\t\r\n\t\t$phonegroup_nama=trim(@$_POST[\"phonegroup_nama\"]);\r\n\t\t$phonegroup_nama=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$phonegroup_nama);\r\n\t\t$phonegroup_nama=str_replace(\"'\", \"''\",$phonegroup_nama);\r\n\t\t$phonegroup_id=trim(@$_POST[\"phonegroup_id\"]);\r\n\t\t$phonegroup_id=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$phonegroup_id);\r\n\t\t$phonegroup_id=str_replace(\"'\", \"''\",$phonegroup_id);\r\n\t\t\r\n\t\t$cust_id=trim(@$_POST[\"cust_id\"]);\r\n\t\t$cust_no=trim(@$_POST[\"cust_no\"]);\r\n\t\t$cust_no=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_no);\r\n\t\t$cust_no=str_replace(\"'\", '\"',$cust_no);\r\n\t\t$cust_no_awal=trim(@$_POST[\"cust_no_awal\"]);\r\n\t\t$cust_no_awal=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_no_awal);\r\n\t\t$cust_no_awal=str_replace(\"'\", '\"',$cust_no_awal);\r\n\t\t$cust_no_akhir=trim(@$_POST[\"cust_no_akhir\"]);\r\n\t\t$cust_no_akhir=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_no_akhir);\r\n\t\t$cust_no_akhir=str_replace(\"'\", '\"',$cust_no_akhir);\r\n\t\t$cust_nama=trim(@$_POST[\"cust_nama\"]);\r\n\t\t$cust_nama=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_nama);\r\n\t\t$cust_nama=str_replace(\"'\", '\"',$cust_nama);\r\n\t\t$cust_panggilan=trim(@$_POST[\"cust_panggilan\"]);\r\n\t\t$cust_panggilan=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_panggilan);\r\n\t\t$cust_panggilan=str_replace(\"'\", '\"',$cust_panggilan);\r\n\t\t$cust_foreigner=trim(@$_POST[\"cust_foreigner\"]);\r\n\t\t$cust_foreigner=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_foreigner);\r\n\t\t$cust_foreigner=str_replace(\"'\", '\"',$cust_foreigner);\r\n\t\t$cust_kelamin=trim(@$_POST[\"cust_kelamin\"]);\r\n\t\t$cust_kelamin=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_kelamin);\r\n\t\t$cust_kelamin=str_replace(\"'\", '\"',$cust_kelamin);\r\n\t\t$cust_alamat=trim(@$_POST[\"cust_alamat\"]);\r\n\t\t$cust_alamat=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_alamat);\r\n\t\t$cust_alamat=str_replace(\"'\", '\"',$cust_alamat);\r\n\t\t$cust_alamat2=trim(@$_POST[\"cust_alamat2\"]);\r\n\t\t$cust_alamat2=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_alamat2);\r\n\t\t$cust_alamat2=str_replace(\"'\", '\"',$cust_alamat2);\r\n\t\t$cust_kota=trim(@$_POST[\"cust_kota\"]);\r\n\t\t$cust_kota=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_kota);\r\n\t\t$cust_kota=str_replace(\"'\", '\"',$cust_kota);\r\n\t\t$cust_kodepos=trim(@$_POST[\"cust_kodepos\"]);\r\n\t\t$cust_kodepos=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_kodepos);\r\n\t\t$cust_kodepos=str_replace(\"'\", '\"',$cust_kodepos);\r\n\t\t$cust_propinsi=trim(@$_POST[\"cust_propinsi\"]);\r\n\t\t$cust_propinsi=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_propinsi);\r\n\t\t$cust_propinsi=str_replace(\"'\", '\"',$cust_propinsi);\r\n\t\t$cust_negara=trim(@$_POST[\"cust_negara\"]);\r\n\t\t$cust_negara=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_negara);\r\n\t\t$cust_negara=str_replace(\"'\", '\"',$cust_negara);\r\n\t\t$cust_telprumah=trim(@$_POST[\"cust_telprumah\"]);\r\n\t\t$cust_telprumah=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_telprumah);\r\n\t\t$cust_telprumah=str_replace(\"'\", '\"',$cust_telprumah);\r\n\t\t$cust_telprumah2=trim(@$_POST[\"cust_telprumah2\"]);\r\n\t\t$cust_telprumah2=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_telprumah2);\r\n\t\t$cust_telprumah2=str_replace(\"'\", '\"',$cust_telprumah2);\r\n\t\t$cust_telpkantor=trim(@$_POST[\"cust_telpkantor\"]);\r\n\t\t$cust_telpkantor=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_telpkantor);\r\n\t\t$cust_telpkantor=str_replace(\"'\", '\"',$cust_telpkantor);\r\n\t\t$cust_hp=trim(@$_POST[\"cust_hp\"]);\r\n\t\t$cust_hp=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_hp);\r\n\t\t$cust_hp=str_replace(\"'\", '\"',$cust_hp);\r\n\t\t$cust_hp2=trim(@$_POST[\"cust_hp2\"]);\r\n\t\t$cust_hp2=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_hp2);\r\n\t\t$cust_hp2=str_replace(\"'\", '\"',$cust_hp2);\r\n\t\t$cust_hp3=trim(@$_POST[\"cust_hp3\"]);\r\n\t\t$cust_hp3=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_hp3);\r\n\t\t$cust_hp3=str_replace(\"'\", '\"',$cust_hp3);\r\n\t\t$cust_email=trim(@$_POST[\"cust_email\"]);\r\n\t\t$cust_email=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_email);\r\n\t\t$cust_email=str_replace(\"'\", '\"',$cust_email);\r\n\t\t$cust_agama=trim(@$_POST[\"cust_agama\"]);\r\n\t\t$cust_agama=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_agama);\r\n\t\t$cust_agama=str_replace(\"'\", '\"',$cust_agama);\r\n\t\t$cust_pendidikan=trim(@$_POST[\"cust_pendidikan\"]);\r\n\t\t$cust_pendidikan=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_pendidikan);\r\n\t\t$cust_pendidikan=str_replace(\"'\", '\"',$cust_pendidikan);\r\n\t\t$cust_profesi=trim(@$_POST[\"cust_profesi\"]);\r\n\t\t$cust_profesi=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_profesi);\r\n\t\t$cust_profesi=str_replace(\"'\", '\"',$cust_profesi);\r\n\t\t$cust_terdaftar=trim(@$_POST[\"cust_terdaftar\"]);\r\n\t\t$cust_tgldaftarend =(isset($_POST['cust_tgldaftarend']) ? @$_POST['cust_tgldaftarend'] : @$_GET['cust_tgldaftarend']);\r\n\t\t$cust_tgldaftarend=trim(@$_POST[\"cust_tgldaftarend\"]);\r\n\t\t\r\n\t\t$member_terdaftarstart=trim(@$_POST[\"member_terdaftarstart\"]);\r\n\t\t$member_terdaftarend=trim(@$_POST[\"member_terdaftarend\"]);\r\n\t\t\r\n\t\t$cust_tglawaltrans=trim(@$_POST[\"cust_tglawaltrans\"]);\r\n\t\t$cust_tglawaltransend =(isset($_POST['cust_tglawaltrans_end']) ? @$_POST['cust_tglawaltrans_end'] : @$_GET['cust_tglawaltrans_end']);\r\n\t\t$cust_tglawaltransend=trim(@$_POST[\"cust_tglawaltrans_end\"]);\r\n\t\t$cust_bb=trim(@$_POST[\"cust_bb\"]);\r\n\t\t$cust_bb=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_bb);\r\n\t\t$cust_bb=str_replace(\"'\", '\"',$cust_bb);\r\n\t\t$cust_tgllahir =(isset($_POST['cust_tgllahir']) ? @$_POST['cust_tgllahir'] : @$_GET['cust_tgllahir']);\r\n\t\t$cust_tgllahirend =(isset($_POST['cust_tgllahirend']) ? @$_POST['cust_tgllahirend'] : @$_GET['cust_tgllahirend']);\r\n\t\t$cust_tgllahirend=trim(@$_POST[\"cust_tgllahirend\"]);\r\n\t\t//$cust_hobi=trim(@$_POST[\"cust_hobi\"]);\r\n\t\t//$cust_hobi=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_hobi);\r\n\t\t//$cust_hobi=str_replace(\"'\", '\"',$cust_hobi);\r\n\t\t$cust_hobi_baca=trim(@$_POST[\"cust_hobi_baca\"]);\r\n\t\t$cust_hobi_olah=trim(@$_POST[\"cust_hobi_olah\"]);\r\n\t\t$cust_hobi_masak=trim(@$_POST[\"cust_hobi_masak\"]);\r\n\t\t$cust_hobi_travel=trim(@$_POST[\"cust_hobi_travel\"]);\r\n\t\t$cust_hobi_foto=trim(@$_POST[\"cust_hobi_foto\"]);\r\n\t\t$cust_hobi_lukis=trim(@$_POST[\"cust_hobi_lukis\"]);\r\n\t\t$cust_hobi_nari=trim(@$_POST[\"cust_hobi_nari\"]);\r\n\t\t$cust_hobi_lain=trim(@$_POST[\"cust_hobi_lain\"]);\r\n\t\t//$cust_hobi=trim(@$_POST[\"cust_hobi\"]);\r\n\t\t//$cust_hobi=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_hobi);\r\n\t\t//$cust_hobi=str_replace(\"'\", '\"',$cust_hobi);\r\n\t\t$cust_referensi=trim(@$_POST[\"cust_referensi\"]);\r\n\t\t$cust_referensi=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_referensi);\r\n\t\t$cust_referensi=str_replace(\"'\", '\"',$cust_referensi);\r\n\t\t$cust_referensilain=trim(@$_POST[\"cust_referensilain\"]);\r\n\t\t$cust_referensilain=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_referensilain);\r\n\t\t$cust_referensilain=str_replace(\"'\", '\"',$cust_referensilain);\r\n\t\t$cust_keterangan=trim(@$_POST[\"cust_keterangan\"]);\r\n\t\t$cust_keterangan=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_keterangan);\r\n\t\t$cust_keterangan=str_replace(\"'\", '\"',$cust_keterangan);\r\n\t\t$cust_member=trim(@$_POST[\"cust_member\"]);\r\n\t\t$cust_member=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_member);\r\n\t\t$cust_member=str_replace(\"'\", '\"',$cust_member);\r\n\t\t$cust_member2=trim(@$_POST[\"cust_member2\"]);\r\n\t\t$cust_member2=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_member2);\r\n\t\t$cust_member2=str_replace(\"'\", '\"',$cust_member2);\r\n\t\t\r\n\t\t$cust_statusnikah=trim(@$_POST[\"cust_statusnikah\"]);\r\n\t\t$cust_statusnikah=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_statusnikah);\r\n\t\t$cust_statusnikah=str_replace(\"'\", '\"',$cust_statusnikah);\r\n\t\t$cust_priority=trim(@$_POST[\"cust_priority\"]);\r\n\t\t$cust_priority=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_priority);\r\n\t\t$cust_priority=str_replace(\"'\", '\"',$cust_priority);\r\n\t\t$cust_jmlanak=trim(@$_POST[\"cust_jmlanak\"]);\r\n\t\t$cust_unit=trim(@$_POST[\"cust_unit\"]);\r\n\t\t$cust_unit=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_unit);\r\n\t\t$cust_unit=str_replace(\"'\", '\"',$cust_unit);\r\n\t\t$cust_aktif=trim(@$_POST[\"cust_aktif\"]);\r\n\t\t$cust_aktif=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_aktif);\r\n\t\t$cust_aktif=str_replace(\"'\", '\"',$cust_aktif);\r\n\t\t$sortby=trim(@$_POST[\"sortby\"]);\r\n\t\t$sortby=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$sortby);\r\n\t\t$sortby=str_replace(\"'\", '\"',$sortby);\r\n\t\t$cust_fretfulness=trim(@$_POST[\"cust_fretfulness\"]);\r\n\t\t$cust_fretfulness=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_fretfulness);\r\n\t\t$cust_fretfulness=str_replace(\"'\", '\"',$cust_fretfulness);\r\n\t\t$cust_umurstart=trim(@$_POST[\"cust_umurstart\"]);\r\n\t\t$cust_umurstart=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_umurstart);\r\n\t\t$cust_umurstart=str_replace(\"'\", '\"',$cust_umurstart);\r\n\t\t$cust_umurend=trim(@$_POST[\"cust_umurend\"]);\r\n\t\t$cust_umurend=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_umurend);\r\n\t\t$cust_umurend=str_replace(\"'\", '\"',$cust_umurend);\r\n\t\t\r\n\t\t$cust_umur=trim(@$_POST[\"cust_umur\"]);\r\n\t\t$cust_umur=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_umur);\r\n\t\t$cust_umur=str_replace(\"'\", '\"',$cust_umur);\r\n\t\t$cust_creator=trim(@$_POST[\"cust_creator\"]);\r\n\t\t$cust_creator=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_creator);\r\n\t\t$cust_creator=str_replace(\"'\", '\"',$cust_creator);\r\n\t\t$cust_date_create=trim(@$_POST[\"cust_date_create\"]);\r\n\t\t$cust_update=trim(@$_POST[\"cust_update\"]);\r\n\t\t$cust_update=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_update);\r\n\t\t$cust_update=str_replace(\"'\", '\"',$cust_update);\r\n\t\t$cust_date_update=trim(@$_POST[\"cust_date_update\"]);\r\n\t\t$cust_revised=trim(@$_POST[\"cust_revised\"]);\r\n\t\t\r\n\t\t$cust_tgl=trim(@$_POST[\"cust_tgl\"]);\r\n\t\t$cust_tgl=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_tgl);\r\n\t\t$cust_tgl=str_replace(\"'\", '\"',$cust_tgl);\r\n\t\t$cust_bulan=trim(@$_POST[\"cust_bulan\"]);\r\n\t\t$cust_bulan=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_bulan);\r\n\t\t$cust_bulan=str_replace(\"'\", '\"',$cust_bulan);\r\n\t\t$cust_tglEnd=trim(@$_POST[\"cust_tglEnd\"]);\r\n\t\t$cust_tglEnd=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_tglEnd);\r\n\t\t$cust_tglEnd=str_replace(\"'\", '\"',$cust_tglEnd);\r\n\t\t$cust_bulanEnd=trim(@$_POST[\"cust_bulanEnd\"]);\r\n\t\t$cust_bulanEnd=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_bulanEnd);\r\n\t\t$cust_bulanEnd=str_replace(\"'\", '\"',$cust_bulanEnd);\r\n\t\t\r\n\t\t$option=$_POST['currentlisting'];\r\n\t\t$filter=$_POST[\"query\"];\r\n\t\t$query = isset($_POST['query']) ? $_POST['query'] : \"\";\r\n\t\t\r\n\t\t$cust_transaksi_start=trim(@$_POST[\"cust_transaksi_start\"]);\r\n\t\t$cust_transaksi_end=trim(@$_POST[\"cust_transaksi_end\"]);\r\n\t\t$cust_tidak_transaksi_start=trim(@$_POST[\"cust_tidak_transaksi_start\"]);\r\n\t\t$cust_tidak_transaksi_end=trim(@$_POST[\"cust_tidak_transaksi_end\"]);\r\n\t\t\r\n\t\t//$phonegroup_data=@$_POST[\"phonegroup_data\"];\r\n\t\t$result=$this->m_customer->customer_phonegroup_create($query, $phonegroup_nama, $phonegroup_id, /*$phonegroup_data, */$cust_id ,$cust_no, $cust_no_awal ,$cust_no_akhir ,$cust_nama , $cust_panggilan, $cust_foreigner, $cust_kelamin ,$cust_alamat ,$cust_alamat2 ,$cust_kota ,$cust_kodepos ,$cust_propinsi ,$cust_negara ,$cust_telprumah ,$cust_telprumah2 ,$cust_telpkantor ,$cust_hp ,$cust_hp2 ,$cust_hp3 ,$cust_email ,$cust_agama ,$cust_pendidikan ,$cust_profesi ,$cust_tgllahir ,$cust_tgllahirend,$cust_referensi ,$cust_keterangan ,$cust_member ,$cust_member2, $cust_terdaftar ,$cust_tglawaltrans, $cust_statusnikah , $cust_priority , $cust_jmlanak ,$cust_unit ,$cust_aktif, $sortby,$cust_fretfulness,$cust_creator ,$cust_date_create ,$cust_update ,$cust_date_update ,$cust_revised ,$option,$filter, $cust_umurstart, $cust_umurend, $cust_umur, $cust_bb,$cust_tgldaftarend ,$cust_tglawaltransend, $cust_referensilain,$hapus_cust,$cust_transaksi_start, $cust_transaksi_end, $cust_tidak_transaksi_start, $cust_tidak_transaksi_end, $member_terdaftarstart, $member_terdaftarend,$cust_tgl, $cust_bulan,$cust_tglEnd, $cust_bulanEnd);\r\n\t\techo $result;\r\n\t}", "public function store(PersonalDetailValidate $request)\n {\n $army = PersonalDetail::create($request->all());\n session(['army' => $army->id]);\n $army->nok()->save(new NOKDetails([\n 'name' => $request->input('nok_name'),\n 'relation' => $request->input('nok_relation'),\n 'mobile' => $request->input('nok_mobile'),\n ]));\n $army->address()->save(new Address($request->all()));\n return redirect()->route('add.family', $army->id);\n }", "public function create()\n {\n $products = Product::selectRaw('id, title')\n ->toBase()\n ->get();\n\n\n return view('admin.phones.create', compact('products'));\n }", "public function store()\n {\n $attributes = request()->validate([\n 'email' => ['required', 'email:rfc,dns'],\n 'name' => ['required', 'string'],\n 'body' => ['required', 'string']\n ]);\n\n Contact::create($attributes);\n return back()->with('message', 'Message sent');\n }", "public function store(Request $request)\n {\n //This is the resource created\n $attributes = $request->validate([\n \"demo_name\" => [\"required\"],\n \"email_address\" => [\"required\", \"email\"],\n \"phone_number\" => [\"required\", \"phone:US\"],\n ]);\n\n DemoFormSubmit::create($attributes);\n\n $url = 'https://app.calldrip.com/api/newlead';\n\n $data = [\n 'source_id' => 300101, 'fname' => $attributes[\"demo_name\"], 'email' => $attributes[\"email_address\"], 'phone' => $attributes[\"phone_number\"],\n 'apikey' => \"098f6bcd4621d373cade4e832627b4f6098f6bcd4621d\", 'apiuser' => \"test\", 'apipass' => \"calldrip123\", 'notes' => null, 'whisper' => null];\n\n// From CALLDRIP - Forced Fix - Errors Found\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n $result = curl_exec($ch);\n curl_close($ch);\n\n session()->flash('formSubmitted', true);\n\n return redirect('/');\n\n }", "public function store(ContactRequest $request)\n {\n // Validation done via ContactRequest\n $validated_data = $request->validated();\n // Format the phone number with Kenyan Code\n $validated_data['phone_number'] = StringHelpers::ke_phone_number($validated_data['phone_number']);\n $contact = new Contact($validated_data);\n Auth::user()->contacts()->save($contact);\n return response()->json(['message' => 'Contact Created', 'contact' => new ContactResource($contact)], 201);\n }", "public function store(Request $request)\n {\n $user_id = Auth::user()->id;\n $contact = null;\n if(DB::table('contacts')->where('user_id', Auth::user()->id)->where('phone', $request->input('phone_1'))->doesntExist()){\n //contact does not exist execute\n $contact = Contact::create([\n 'name'=>$request->input('name_1'),\n 'country_code'=>$request->input('country_code'),\n 'email'=>$request->input('email_1'),\n 'phone'=>$request->input('phone_1'),\n 'user_id'=>$user_id\n ]);\n }\n if($contact){\n return redirect()->route('contacts.index')->with('success','Contact successfully created');\n }else {\n return redirect()->back()->withInput()->with('error','Contact already exist');\n }\n }", "public function phone($phone = null);", "public function setPhone($value)\n {\n $this->phone = $value;\n return $this;\n }", "public function store(Request $request)\n {\n \t$contact = new Contact($request->all());\n\n \t$billy = resolve('Billy');\n\n // prepare billy fields\n \t$fields = $billy->billy_fields($request->all());\n\n \ttry {\n\n // create contact in billy\n \t\t$billy_contact = $billy->create_object(\n array('contact' => $fields),\n 'contacts'\n );\n\n // set external_id with id from the newly created contact\n \t\t$contact->external_id = $billy_contact->contacts[0]->id;\n\n \t\t$contact->save();\n \t} catch (\\Exception $e) {\n \t\treturn redirect()->back()->withInput()->withErrors(['exception' => $e->getMessage()]);\n \t}\n \t\n\n \treturn redirect('/contacts');\n }", "public function add_post(){\n $response = $this->PersonM->add_person(\n $this->post('name'),\n $this->post('hp'),\n $this->post('email'),\n $this->post('message')\n );\n $this->response($response);\n }", "public function store(CreateEnquiryRequest $request)\n {\n $input = $request->all();\n $input['contact_no'] = preparePhoneNumber($input, 'contact_no');\n $this->enquiryRepository->store($input);\n Flash::success('Enquiry send successfully.');\n\n return redirect(route('contact'));\n }", "public static function phone()\n {\n return new TextNode('phone');\n }", "public function store(Request $request)\n {\n if (!Auth::check()) return Redirect::route('home');\n $mobiles =$request->number;\n foreach ($mobiles as $value) {\n $send = new send;\n $send->schedule_id = $request->campain;\n $send->user_id = Auth::id();\n $send->mobile = $value;\n $send->save();\n }\n $contact=user::find( Auth::id());\n return view('campain.sendSms',compact('contact'));\n }", "public function actionRegister()\n {\n if (isset($this->request['mobile'])) {\n $mobile = $this->request['mobile'];\n $user = Users::model()->find('username = :mobile', [':mobile' => $mobile]);\n\n $code = Controller::generateRandomInt();\n if (!$user) {\n $user = new Users();\n $user->username = $mobile;\n $user->password = $mobile;\n $user->status = Users::STATUS_PENDING;\n $user->mobile = $mobile;\n }\n\n $user->verification_token = $code;\n if ($user->save()) {\n $userDetails = UserDetails::model()->findByAttributes(['user_id' => $user->id]);\n $userDetails->credit = SiteSetting::getOption('base_credit');\n $userDetails->save();\n }\n\n Notify::SendSms(\"کد فعال سازی شما در آچارچی:\\n\" . $code, $mobile);\n\n $this->_sendResponse(200, CJSON::encode(['status' => true]));\n } else\n $this->_sendResponse(400, CJSON::encode(['status' => false, 'message' => 'Mobile variable is required.']));\n }", "public function new_patient_create()\n\t{\n\t\t\t$p_id = $this->input->post('p_id');\n\n\t\t\tif($this->input->post('med_history')!='')\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$med_history = implode(', ', $this->input->post('med_history'));\n\n\t\t\t}\n\n\t\t\t//print_r($med_history);\n\n\t\t\t//$med_history1 = explode('|', $med_history);\n\n\t\t\t//print_r($med_history1);\n\n\n if($this->admin_model->insert_patient_info())\n {\n \t$response['status'] = 'success';\n \t$response['p_id'] = $p_id;\n }\n else\n {\n \t$response['status'] = 'failed';\n }\n\n \t//Replying ajax request with validation response\n \techo json_encode($response);\n\t}", "public function create()\n {\n $PhoneTypes = PhoneType::all();\n return view('address_book.create', compact('PhoneTypes'));\n }", "public function setPhoneNumber($var)\n {\n GPBUtil::checkString($var, True);\n $this->phoneNumber = $var;\n\n return $this;\n }", "public function create()\n {\n return view('sms.create')->with('page_title', 'Create SMS Number')\n ->with('page_description', '');\n }", "function store()\n {\n $this->dbInit();\n query( \"INSERT INTO PhoneType set Name='$this->Name'\" );\n }", "function ambil_paket_phonegroup_create(){\r\n\t\t//POST varible here\r\n\t\t//auto increment, don't accept anything from form values\r\n\t\t$hapus_cust = trim(@$_POST[\"hapus_cust\"]);\r\n\t\t$phonegroup_id=trim(@$_POST[\"phonegroup_id\"]);\r\n\t\t$phonegroup_id=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$phonegroup_id);\r\n\t\t$phonegroup_id=str_replace(\"'\", \"''\",$phonegroup_id);\r\n\t\t$apaket_faktur=trim(@$_POST[\"apaket_faktur\"]);\r\n\t\t$apaket_faktur=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$apaket_faktur);\r\n\t\t$apaket_faktur=str_replace(\"'\", \"\\'\",$apaket_faktur);\r\n\t\t$apaket_cust=trim(@$_POST[\"apaket_cust\"]);\r\n\t\t$apaket_paket=trim(@$_POST[\"apaket_paket\"]);\r\n\t\t$apaket_sisa=trim(@$_POST[\"apaket_sisa\"]);\r\n\t\t$apaket_jenis=trim(@$_POST[\"apaket_jenis\"]);\r\n\t\t$apaket_kadaluarsa=trim(@$_POST[\"apaket_kadaluarsa\"]);\r\n\t\t$apaket_kadaluarsa_akhir=trim(@$_POST[\"apaket_kadaluarsa_akhir\"]);\r\n\t\t$apaket_tgl_faktur=trim(@$_POST[\"apaket_tgl_faktur\"]);\r\n\t\t$apaket_tgl_faktur_akhir=trim(@$_POST[\"apaket_tgl_faktur_akhir\"]);\r\n\t\t$apaket_jenis_kadaluarsa=trim(@$_POST[\"apaket_jenis_kadaluarsa\"]);\r\n\t\t$apaket_transaksi_start=trim(@$_POST[\"apaket_tgl_transaksi_start\"]);\r\n\t\t$apaket_transaksi_end=trim(@$_POST[\"apaket_tgl_transaksi_end\"]);\r\n\t\t$apaket_tidak_transaksi_start=trim(@$_POST[\"apaket_tidak_tgl_transaksi_start\"]);\r\n\t\t$apaket_tidak_transaksi_end=trim(@$_POST[\"apaket_tidak_tgl_transaksi_end\"]);\r\n\t\t\r\n\t\t$option=$_POST['currentlisting'];\r\n\t\t$filter=$_POST[\"query\"];\r\n\t\t//$start = (integer) (isset($_POST['start']) ? $_POST['start'] : $_GET['start']);\r\n\t\t//$end = (integer) (isset($_POST['limit']) ? $_POST['limit'] : $_GET['limit']);\r\n\t\t\r\n\t\t//$phonegroup_data=@$_POST[\"phonegroup_data\"];\r\n\t\t$result=$this->m_master_ambil_paket->ambil_paket_phonegroup_create($apaket_faktur, $apaket_cust, $apaket_paket, $apaket_kadaluarsa, $apaket_kadaluarsa_akhir, $apaket_tgl_faktur, $apaket_tgl_faktur_akhir, $apaket_sisa,$apaket_jenis, $apaket_jenis_kadaluarsa, $apaket_transaksi_start, $apaket_transaksi_end, $apaket_tidak_transaksi_start, $apaket_tidak_transaksi_end,$hapus_cust,$option,$filter,$phonegroup_id);\r\n\t\techo $result;\r\n\t}", "public function SaveModel($name,$phone){\n $this->guest_name = $name;\n $this->rq_phone = $phone;\n $this->save();\n }", "public function store(Request $request)\n {\n //\n // $endereco = $this->immobileaddressrepository->storeImobile($request->all());\n // return json_encode($endereco);\n $endereco = new immobiles_addresses();\n $endereco->logradouro = $request->input('logradouro');\n $endereco->numero = $request->input('numero');\n $endereco->bairro = $request->input('bairro');\n $endereco->cep = $request->input('cep');\n $endereco->city_id = $request->input('city_id');\n $endereco->state_id = $request->input('state_id');\n $endereco->save();\n return json_encode($endereco);\n }", "public function store()\n\t{\n\t\t//tomamos los datos que la el formulario mando en INPUT (POST) y lo guardamos en $data\n\t\t//$data = Input::all();\n\t\t$rules = array (\n 'names' => 'required|min:3|max:45',\n 'last_name' => 'min:3',\n 'document' => 'required|max:45|unique:people',\n 'telephone'=>'required|min:3|max:50|unique:people',\n );\n\t\t$messages = array(\n 'required' => ':attribute no puede ser vacio.',\n 'min' => ':attribute debe ser de por lo menos :min caracteres.',\n 'max' => ':attribute debe ser de por lo menos :max caracteres.',\n 'unique'\t=> 'el :attribute ya esta registrado'\n );\n\t\t//Validate data\n\t\t$validation = Validator::make (Input::all(), $rules, $messages);\n\t\t//If everything is correct than run passes.\n if ($validation->fails()){\n \treturn Redirect::to('person/create')->withErrors($validation)->withInput();\n }\n \t$person = new Person;\n \t//limpiaremos los datos con e()\n\t\t$person->names = e(Input::get('names'));\n\t\t$person->last_name = e(Input::get('last_name'));\n\t\t$person->document = e(Input::get('document'));\n\t\t$person->telephone = e(Input::get('telephone'));\n\t\t$person->save();\n\t\treturn Redirect::to('/')->with('flash', 'new person created!');\t\n\t\t//\n\t}", "public function actionCall()\n {\n $req = Yii::$app->request;\n \n $phoneTo = (int)$req->get('phoneTo');\n if (!is_numeric($phoneTo)) return 'Phone must be a number';\n\n $phoneFrom = self::PHONE_ADMIN;\n $sid = $req->get('sid');\n $token = $req->get('token');\n \n $twiloiSet = (isset($sid) && isset($token));\n if (!$twiloiSet) return \"Twilio API call. From: $phoneFrom To: $phoneTo\";\n\n $client = new Client($sid, $token);\n\n $call = $client->calls->create(\n $phoneTo,\n $phoneFrom,\n [\"url\" => \"http://demo.twilio.com/docs/voice.xml\"]\n );\n echo $call->sid;\n }" ]
[ "0.7541584", "0.73787135", "0.72263056", "0.71146005", "0.6986629", "0.6949744", "0.6864092", "0.679666", "0.67041075", "0.66784674", "0.6641394", "0.6570964", "0.65355873", "0.64588547", "0.64365685", "0.6387066", "0.6382849", "0.6372621", "0.6348331", "0.6319071", "0.6316977", "0.6311624", "0.63005173", "0.61636376", "0.61409664", "0.611001", "0.6073567", "0.6050325", "0.60482144", "0.60317415", "0.60153663", "0.5999672", "0.59905434", "0.5972687", "0.5963573", "0.59591305", "0.5957217", "0.592227", "0.59214884", "0.59021586", "0.5901347", "0.5889649", "0.58767885", "0.5875986", "0.5861488", "0.58245444", "0.58039755", "0.5802901", "0.5777909", "0.5767339", "0.5754645", "0.5740347", "0.57337296", "0.57329434", "0.57325584", "0.5727861", "0.5720532", "0.57195306", "0.56928504", "0.56928504", "0.5691293", "0.5654828", "0.56444126", "0.5640084", "0.56387675", "0.5635509", "0.5630342", "0.56188595", "0.5614415", "0.55894196", "0.55862856", "0.5583559", "0.55830204", "0.55762947", "0.55744296", "0.5570557", "0.5564881", "0.5544891", "0.5539801", "0.5538384", "0.5537228", "0.55360687", "0.5535636", "0.5530034", "0.55246574", "0.55223083", "0.55214864", "0.5517568", "0.55175203", "0.55017835", "0.55012596", "0.5492212", "0.54790753", "0.54731786", "0.5462164", "0.54566365", "0.54485536", "0.54479945", "0.5444998", "0.5443067" ]
0.572101
56
responds to POST /phone/id
public function update(Request $request, $id) { $email = Phone::find($id); $name = request()->input('name'); $value = request()->input('value'); $name = substr($name, 0, -1); $email->{$name} = $value; $email->save(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function savephone() {\n if (isset($_POST['phone'])) {\n $userId = $this->session->userdata('user_id');\n $phone = $this->input->post('phone');\n $result = $this->Users->savephone($phone, $userId);\n if ($result) {\n $this->output\n ->set_content_type('application/json')\n ->set_output(json_encode(array('result' => 1)));\n } else {\n $this->output\n ->set_content_type('application/json')\n ->set_output(json_encode(array('result' => 0)));\n }\n }\n }", "public function store()\n\t{\n\t\t$user = $this->user->where('api_token', '=', $this->token)->first();\n\t\t$attr = Input::get('data');\n\t\t$rules = $this->phone->createRules;\n\n\t\t$validator = Validator::make($attr, $rules);\n\n\t\tif($validator->fails()){\n\t\t\t$errors = $validator->messages();\n\t\t\treturn Response::json(['success' => false, 'errors' => $errors], 400);\n\t\t}\n\n\t\t//after validation success, lets save the number (through relationship)\n\t\t$attr['user_id'] = $user->id;\n\t\t$phone = new $this->phone($attr);\n\t\t$user->phones()->save($phone);\n\n\t\treturn Response::json(['success' => true, 'data' => $phone], 220);\n\t}", "function phoneid ($phone_number, array $fields = []) {\n return $this->post(sprintf(self::PHONEID_RESOURCE, $phone_number), $fields);\n }", "public function store(Request $request)\n {\n $phone = new PhoneNumber();\n $phone->method_id = $request->method_id;\n $phone->phone_number = $request->phone_number;\n $phone->save();\n return redirect()->back()->with('success', 'A phone number has been created.');\n }", "public function sendOTP_post()\n {\n $phone = $this->input->post('phone');\n $otp = $this->generateRandomString();\n $check = $this->User_model->select_data('*',\"tbl_otp\",array('phone'=>$phone));\n if (empty($check)) {\n $this->User_model->insert_data('tbl_otp',array('phone'=>$phone,'otp'=>$otp,'addedOn'=>date(\"Y-m-d H:i:s\")));\n } else {\n $this->User_model->update_data('tbl_otp',array('otp'=>$otp,'updatedOn'=>date(\"Y-m-d H:i:s\")),array('phone'=>$phone));\n }\n\n\n $msg = array('to'=>$phone,'body'=>\"Your verification code for Kudos is: $otp\");\n // print_r($this->twilioMessage()); die;\n $this->twilioMessage($msg);\n $status = 1;\n $response = array();\n\n if ( $status == 0 ) {\n $response['status'] = 'error';\n $response['message'] = 'This failed';\n } else {\n $response['status'] = 'success';\n $response['message'] = 'OTP sent successfully';\n $response['otp'] = $otp;\n }\n\n //echo json_encode($response);\n $this->set_response($response, REST_Controller::HTTP_OK);\n /* Twilio sms verification End */\n }", "public function phoneAction()\n {\n return $this->view('auth.verification.phone');\n }", "public function phone($phone = null);", "public function actionaddUniquePhone()\n\t{\n\t\t\n\t\tif($this->isAjaxRequest())\n\t\t{\n\t\t\tif(isset($_POST['userphoneNumber'])) \n\t\t\t{\n\t\t\t\t$sessionArray['loginId']=Yii::app()->session['loginId'];\n\t\t\t\t$sessionArray['userId']=Yii::app()->session['userId'];\n\t\t\t\t$loginObj=new Login();\n\t\t\t\t$total=$loginObj->gettotalPhone($sessionArray['userId'],1);\n\t\t\t\tif($total > 1)\n\t\t\t\t{\n\t\t\t\t\techo \"Limit Exist!\";\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\t$totalUnverifiedPhone=$loginObj->gettotalUnverifiedPhone($sessionArray['userId'],1);\n\t\t\t\tif($totalUnverifiedPhone==1)\n\t\t\t\t{\n\t\t\t\t\techo \"Please first verify unverified phone.\";\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$result=$loginObj->addPhone($_POST,1,$sessionArray);\n\t\t\t\t\n\t\t\t\tif($result['status']==0)\n\t\t\t\t{\n\t\t\t\t\techo \"success\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo $result['message']; \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->render(\"/site/error\");\n\t\t}\n\t}", "public function store(PhonesRequest $request)\n {\n\n $phone =new Phones();\n $phone->phoneName=$request->phoneName;\n $phone->phoneBrand=$request->phoneBrand;\n $phone->phonePrice=$request->phonePrice;\n\n $phone->save();\n\n return response([\n\n\t\t\t'data' => new PhonesResource($phone),\n\t\t], Response::HTTP_CREATED);\n }", "public function save()\n {\n $path = ($this->phone_id == null)\n ? '/admin/v1/phones' : '/admin/v1/phones/'.$this->phone_id;\n\n // \"number\" is required\n if ($this->number == null) {\n throw new \\InvalidArgumentException('The \"number\" property is required');\n }\n\n $params = array(\n 'number' => $this->number,\n 'name' => $this->name,\n 'extension' => $this->extension,\n 'type' => $this->type,\n 'platform' => $this->platform,\n 'predelay' => $this->predelay,\n 'postdelay' => $this->postdelay\n );\n\n $request = $this->getRequest('admin')\n ->setMethod('POST')->setParams($params)->setPath($path);\n\n $response = $request->send();\n\n if ($response->success() == true) {\n $body = $response->getBody();\n return $this->load($body);\n } else {\n return false;\n }\n }", "public function store()\n\t{\n\t\t$data = Input::json();\n\n\t\t$utils = UtilController::getInstance();\n\t\t$numberStructure = $utils->nStruct;\n\n\t\t$newNumber = new ContactNumber;\n\t\tforeach ($data as $key => $value) {\n\t\t\t$newNumber->$numberStructure[$key] = $value;\n\t\t}\n\n\t\t$newNumber->save();\n\t\tif ($newNumber) {\n\t\t\treturn Response::json($newNumber) ;\n\t\t}else\n\t\t{\n\t\t\treturn Response::make(\"error\", 500);\n\t\t}\n\t}", "public function addNewPhone()\n {\n $titre = 'New Phone';\n $this->render('achat','achatPhone', compact('titre'));\n }", "public function actionCall()\n {\n $req = Yii::$app->request;\n \n $phoneTo = (int)$req->get('phoneTo');\n if (!is_numeric($phoneTo)) return 'Phone must be a number';\n\n $phoneFrom = self::PHONE_ADMIN;\n $sid = $req->get('sid');\n $token = $req->get('token');\n \n $twiloiSet = (isset($sid) && isset($token));\n if (!$twiloiSet) return \"Twilio API call. From: $phoneFrom To: $phoneTo\";\n\n $client = new Client($sid, $token);\n\n $call = $client->calls->create(\n $phoneTo,\n $phoneFrom,\n [\"url\" => \"http://demo.twilio.com/docs/voice.xml\"]\n );\n echo $call->sid;\n }", "public function getPhoneNumber()\n {\n return $this->getParameter('phoneNumber');\n }", "function record_request($vendor_id, $item_id, $phone, $notify) {\n $new = make_post_call(\"request_ID\", [\"vendor_id\" => $vendor_id, \"item_id\" => $item_id, \"phone\" => $phone, \"notify\" => $notify]);\n return $new;\n }", "public function singlerecord_post() {\n $data = $this->input->post();\n if($data['id'] == NULL) {\n $this->set_response(array('response_code'=>400,'response_message'=>'Parameter missing','response_data'=>array()), REST_Controller::HTTP_NOT_FOUND);\n return; \n }\n $result = $this->Api_model->selectData('info', 'id, name, email',array('id' => $data['id']));\n if($result == NULL){\n $this->set_response(array('response_code'=>400,'response_message'=>'No Data Found','response_data'=>array()), REST_Controller::HTTP_OK); \n return; \n }\n $this->set_response(array('response_code'=>200,'response_message'=>'Success','response_data'=>$result), REST_Controller::HTTP_OK);\n return;\n }", "public function create()\n {\n \n echo \"Syntax: POST: /api?telefon=*telefon*&id_agencija=*id*<br>/api?email=*email*&id_agencija=*id*\";\n \n }", "public function getPhone();", "public function send(string $phone)\n {\n }", "public function askPhoneNumber()\n {\n $this->ask('Ваш номер телефона', function (Answer $answer) {\n\n try {\n $contact = $answer->getMessage()->getContact()->getPhoneNumber();\n $this->getBot()->userStorage()->save([\n 'phone_number' => $contact\n ]);\n }catch (\\Exception $e){\n $contact = $answer->getMessage()->getText();\n $this->getBot()->userStorage()->save([\n 'phone_number' => $contact\n ]);\n }\n\n $this->askLocation();\n }, [\n 'reply_markup' => json_encode([\n 'keyboard' => [\n [\n ['text' => 'Отправить контакт', 'request_contact' => true]\n ]\n ],\n 'one_time_keyboard' => true,\n 'resize_keyboard' => true\n ])\n ]);\n }", "public function setPhoneNumber($value)\n {\n return $this->setParameter('phoneNumber', $value);\n }", "public function get_telephone();", "public function create_details()\n\t{\n\t\t\n\t\t$data['type'] = $this->input->post('type');\n\t\t$data['value'] = $this->input->post('value');\n\t\t$data['id'] = $this->input->post('id');\t\t\n\t\t$data['contact_id'] = $this->input->post('contact_id');\t\t\n\t\t$contacts_id = $this->contact_model->add_edit_contact_details($data);\n\t\t\n\t\tif($data['id'] == ''){\n\t\t\t$response = array('status' => true, 'message' => \"Contact details inserted successfully\");\n\t\t}else{\n\t\t\t$response = array('status' => true, 'message' => \"Contact details updated successfully\");\n\t\t}\n\t\techo json_encode($response);\n\t}", "public function store(SmsNumberRequest $request)\n {\n alert()->success('Phone number', 'The record has been saved successfully.');\n SmsNumber::create($request->all());\n return redirect()->route('sms.index')->with('message', 'item added');\n }", "public function CheckPhoneNumber($phone, $id=\"\")\n\t\t{\n\t\t\t////////////////////////////////////////// The table(s) we'll work with in this script /////////////////////////////////////////////\n $phonebook = cred($index='tables', $key='phonebook');//$db->get_value($table_name=\"phonebook\");\n ///////////////////////////////////////////////// END OF TABLE(s) //////////////////////////////////////////////////////////////////\n\n\t\t\t$param = [$phone];\n\n\t\t\tif(empty($id))\n\t\t\t{\n\t\t\t\t$query = \"SELECT JSON_EXTRACT(data, '$.phone') AS phone FROM $phonebook WHERE JSON_EXTRACT(data, '$.phone') = ?\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$query = \"SELECT JSON_EXTRACT(data, '$.phone') AS phone FROM $phonebook WHERE JSON_EXTRACT(data, '$.phone') = ? AND id != ?\";\n\n\t\t\t\t$param []= $id;\n\t\t\t}\n\n $result = $this->prepare($query, $param, true);\n\n if(!empty($result))\n\t\t\t{\n\t\t\t\t(new Utility())->ajax(\"<p class='alert alert-danger'>Phone number already exists.</p>\", $return=false);\n }\n\t\t}", "private function setTelephone()\n {\n \tif ( empty($_POST['telephone'] ) ) {\n $this->data['error']['telephone'] = 'Please provide a valid phone number.';\n $this->error = true;\n return;\n }\n\t\n $t = trim( $_POST['telephone'] );\n \n\t\t// Remove non-digits.\n\t\t$t = preg_replace('/[^0-9]/', '', $t);\n\t\n\t\t// Make sure it's 10 digits.\n\t\tif ( strlen($t) != 10 ) {\n\t\t\t$this->data['error']['telephone'] = 'Please provide a valid phone number.';\n $this->error = true;\n return;\n\t\t}\n\t\n $this->data['telephone'] = $t;\n }", "public function store(Request $request)\n {\n $phone = $request->validate([\n 'number' => 'required|integer'\n ]);\n\n return redirect()->back()->withSuccess('Phone successfully add');\n }", "public function setPhone($value)\n {\n return $this->set('Phone', $value);\n }", "public function sendPhoneVerificationNotification();", "public function setPhone($value)\n {\n return $this->set(self::PHONE, $value);\n }", "public function setPhone($value)\n {\n return $this->set(self::PHONE, $value);\n }", "public function store(PhoneRequest $request)\n {\n $this->authorize('create');\n $this->phone->create([\n 'phone' => $request->phone\n ]) ;\n\n return redirect()->back();\n\n }", "public function store(Request $request)\n {\n $phone = PhoneType::create($request->all());\n\n\n return redirect()->route('phones.index');\n }", "public function getPhone(){\r\n\t\t\treturn $this->phone;\r\n\t\t}", "public function get_phone() {\r\n return $this->phone;\r\n }", "public function create_person_phone($data) {\r\n \r\n $person_phone = new PersonPhones;\r\n $person_phone->attributes = $data;\r\n $person_phone->save();\r\n return $person_phone;\r\n }", "public function getPhone()\r\n {\r\n return $this->phone;\r\n }", "protected function registerPhoneRequest($token, $phone)\n {\n // verify the required parameter 'token' is set\n if ($token === null || (is_array($token) && count($token) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $token when calling '\n );\n }\n // verify the required parameter 'phone' is set\n if ($phone === null || (is_array($phone) && count($phone) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $phone when calling '\n );\n }\n\n $resourcePath = '/rapi/register_phone';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // form params\n if ($token !== null) {\n $formParams['token'] = ObjectSerializer::toFormValue($token);\n }\n // form params\n if ($phone !== null) {\n $formParams['phone'] = ObjectSerializer::toFormValue($phone);\n }\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/x-www-form-urlencoded']\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\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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "private function getPhone($countryCode)\n {\n $phoneNumber = false;\n $client = Twilio::client();\n $lookups = Twilio::lookups();\n\n // looking for existent phone number\n $numbers = $client->account->incoming_phone_numbers;\n foreach($numbers as $number) {\n $lookup = $lookups->phone_numbers->get($number->phone_number);\n if($lookup->country_code === $countryCode) {\n $phoneNumber = $number->phone_number;\n break;\n }\n }\n\n // buy new number if not found\n if($phoneNumber === false) {\n $availableNumbers = $client->account->available_phone_numbers->getList($countryCode, 'Local', [\n //'SmsEnabled' => 'True',\n 'VoiceEnabled' => 'True',\n ]);\n try {\n $first = $availableNumbers->available_phone_numbers[0]->phone_number;\n $newNumber = $client->account->incoming_phone_numbers->create([\n 'PhoneNumber' => $first,\n 'VoiceUrl' => url('call/incoming'),\n 'StatusCallback' => url('call/completed'),\n 'SmsUrl' => url('sms/incoming'),\n 'VoiceMethod' => 'POST',\n 'StatusCallbackMethod' => 'POST',\n 'SmsMethod' => 'POST',\n ]);\n// $newNumber->update(array(\n// \"VoiceUrl\" => url('call/incoming'),\n// \"SmsUrl\" => url('sms/incoming'),\n// \"VoiceMethod\" => 'POST',\n// \"SmsMethod\" => 'POST',\n// ));\n $phoneNumber = $newNumber->phone_number;\n } catch(\\Exception $e) {\n Log::error($e->getMessage());\n return View::make('site._error');\n }\n }\n\n return View::make('site._phone', [\n 'number' => $phoneNumber,\n ]);\n }", "function editPhoneNumber($data){\n\t\t\t$conn = $this->connect();\n\t\t\t$uid = $_SESSION['userid'];\n\t\t\t$pid = $_SESSION['pid'];\n\t\t\t$ephone = $this->modify(mysqli_real_escape_string($conn, $data['ephone']));\n\t\t\tif(empty($ephone)) {\n\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[0][1](8|9|5|7|6)[0-9]+$/\", $ephone)) {\n\t\t\t\t\tif($this->length($ephone, 11, 11)) {\n\t\t\t\t\t\t$result = $this->changepost(\"newpost\", \"post_phone_number\", $ephone , $uid , $pid);\n\t\t\t\t\t\tif($result == false) {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Failed!\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Successfully_Changed\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&length=tooBigOrSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&invalid=number\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function add_mobile_number() {\n\n\t\t$this->authentication->is_user_logged_in(TRUE, 'user/login');\n\n\t\t$aUserMobileVerificationStatus = $this->config->item('user_mobile_verification_status');\n\n\t\t$iAccountNo = s('ACCOUNT_NO');\n\n\t\t$aWhere = array(\n\t\t\t\t\t\t'status' => $this->aUserStatus['active'],\n\t\t\t\t\t);\n\t\tif( ! $oUser = $this->user_model->getUserBy('account_no', $iAccountNo, 'basic', $aWhere) ) {\n\n\t\t\tsf('error_message', 'You cannot access this section right now');\n\t\t\tredirect('home');\n\t\t}\n\n\n\t\tif( $oUser->mobile_number ) {\n\n\t\t\tswitch($oUser->mobile_verification_status) {\n\n\t\t\t\tcase $aUserMobileVerificationStatus['sms_sent']:\n\t\t\t\tcase $aUserMobileVerificationStatus['no_sms_verification_done']:\n\n\t\t\t\t\tsf('error_message', 'click to resend the mobile number verification code');\n\t\t\t\t\tredirect('profile/edit');\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $aUserMobileVerificationStatus['sms_verified']:\n\n\t\t\t\t\tsf('error_message', 'you can update your mobile number.');\n\t\t\t\t\tredirect('profile/edit');\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\n\t\tif ( isset($_POST) && ! empty($_POST) ) {\n\n\t\t\t$this->form_validation->set_rules('mobile_number',\n\t\t\t\t\t\t\t\t\t\t\t 'Mobile number',\n\t\t\t\t\t\t\t\t\t\t\t 'trim|required|min_length[10]|max_length[10]|is_natural',\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 'min_length' => 'Mobiler number should be a 10 digit number',\n\t\t\t\t\t\t\t\t\t\t\t\t 'max_length' => 'Mobiler number should be a 10 digit number',\n\t\t\t\t\t\t\t\t\t\t\t\t 'is_natural' => 'Mobiler number should have only numbers',\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\n\t\t\tif ($this->form_validation->run() == TRUE) {\n\n\t\t\t\t$sMobileNumber = safeText('mobile_number');\n\n\t\t\t\t// see if this mobile number is with us already\n\t\t\t\tif( ! $bisMobileNumExists = $this->user_model->isMobileNumExists($sMobileNumber) ) {\n\n\t\t\t\t\tif( $oUser->mobile_number ) {\n\n\t\t\t\t\t\t// move the mobile number to users history\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// update the user with the mobile number and mark the mobile number as not verified\n\t\t\t\t\t$this->db->set('mobile_number', $sMobileNumber);\n\t\t\t\t\t$this->db->set('mobile_verification_status', $aUserMobileVerificationStatus['no_sms_verification_done']);\n\t\t\t\t\t$this->db->where('account_no', $iAccountNo);\n\t\t\t\t\t$this->db->update('users');\n\n\t\t\t\t\t// initiate steps to verify mobile number\n\t\t\t\t\t$this->user_model->initiateMobileNumVerification($iAccountNo);\n\n\n\t\t\t\t\tredirect('verify_mobile_number?account_no='.$iAccountNo);\n\n\t\t\t\t} else {\n\t\t\t\t\t$this->merror['error'][] = 'The mobile number is already used.';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tloadTemplate('user/add_mobile_number');\n\t}", "public function getPhone()\n {\n return $this->phone;\n }", "public function resend_otp_data_post()\n {\n $response = new StdClass();\n $result = new StdClass();\n $device_id =$this->input->post('device_id');\n $mobile_no =$this->input->post('mobile_no');\n $otpValue=mt_rand(1000, 9999);\n $data1->device_id = $device_id;\n $data1->mobile_no=$mobile_no;\n $data1->otp=$otpValue;\n $res = $this->Supervisor->send_otp($mobile_no,$otpValue);\n if(!empty($mobile_no))\n {\n $res1 = $this->Supervisor->resend_otp($data1);\n\n $data->message = 'success';\n $data->status = '1';\n array_push($result,$data);\n $response->data = $data;\n }\n\n else\n {\n $data->message = 'failed';\n $data->status = '0';\n array_push($result,$data);\n $response->data = $data;\n } \n echo json_output($response);\n }", "public function getPhone()\n {\n return $this->get('Phone');\n }", "public function assign()\n {\n /** @var User $user */\n $user = Auth::user();\n if(!is_null($user->twilio_number)) return back()->with('error', 'You already have a Twilio number.');\n\n try{\n $phone = Number::create();\n $user->update(['twilio_phone' => $phone]);\n return back()->with('success', 'A phone number has been assigned to you.');\n }catch (\\Exception $exception){\n return back()->with('error', sprintf('Error: %s', $exception->getMessage()));\n }\n }", "public function store(Request $request)\n {\n // Twilio::message('+8801784622362', 'how are yo?');\n }", "function update_user_phone()\n\t{\n\t\tlog_message('debug', 'Account/update_user_phone');\n\t\tcheck_access($this,'__redirect'); #redirect away from this function if user is not logged in\n\n\t\t$data = filter_forwarded_data($this);\n\t\t$result = FALSE;\n\t\t$data['msg'] = '';\n\t\tlog_message('debug', 'Account/update_user_phone:: [1] post='.json_encode($_POST));\n\t\tlog_message('debug', 'Account/update_user_phone:: [2] data='.json_encode($data));\n\t\t# a) The user is updating the telephone number\n\t\tif(!empty($_POST['telephone'])){\n\t\t\t$data['hasPosted'] = 'Y';\n\t\t\t$response = $this->_api->post('user/telephone', array(\n\t\t\t\t\t'telephone'=>$_POST['telephone'],\n\t\t\t\t\t'provider'=>$_POST['provider__provider'],\n\t\t\t\t\t'isPrimary'=>'Y'\n\t\t\t\t));\n\n\t\t\t# Update the user telephone and provider if sucessful\n\t\t\tif(!empty($response['result']) && $response['result']=='SUCCESS'){\n\t\t\t\t$this->native_session->set('__telephone', $_POST['telephone']);\n\t\t\t\t$this->native_session->set('__provider', $response['provider']);\n\t\t\t\t$this->native_session->set('__provider_id', $_POST['provider__provider']);\n\t\t\t\t$data['msg'] = 'Your phone number has been updated and verification code sent.';\n\t\t\t\t$result = TRUE;\n\t\t\t\t$data['area'] = 'verify_code_form';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$data['msg'] = 'ERROR: Your phone number could not be updated';\n\t\t\t\t$data['area'] = 'user_phone_details';\n\t\t\t}\n\t\t}\n\n\n\t\t# b) Verify telephone code\n\t\telse if(!empty($_POST['usercode'])){\n\t\t\t$data['hasPosted'] = 'Y';\n\t\t\t$response = $this->_api->post('account/verify', array(\n\t\t\t\t'code'=>$_POST['usercode'],\n\t\t\t\t'telephone'=>$this->native_session->get('__telephone'),\n\t\t\t\t'baseLink'=>base_url()\n\t\t\t));\n\n\t\t\tif(!empty($response['verified']) && $response['verified']=='Y'){\n\t\t\t\t$this->native_session->set('__telephone_verified', 'Y');\n\t\t\t\t$data['msg'] = '20 Points have been added to your Clout Score';\n\t\t\t\t$data['area'] = 'verify_code_results';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$data['msg'] = 'ERROR: Your phone could not be verified.<br>Please try again.';\n\t\t\t\t$data['area'] = 'verify_code_form';\n\t\t\t}\n\t\t}\n\n\n\t\t# c) the user has already verified their phone.\n\t\telse if($this->native_session->get('__telephone_verified') && $this->native_session->get('__telephone_verified') == 'Y'){\n\t\t\t# if this is a user with more privileges to view the network page take them to the network home instead\n\t\t\tif($this->native_session->get('__direct_invitation_count')\n\t\t\t\t&& $this->native_session->get('__direct_invitation_count') >= MINIMUM_INVITE_COUNT\n\t\t\t){\n\t\t\t\t$view = check_access($this,'can_view_invite_tools')? 'network/home': 'account/thank_you';\n\t\t\t}\n\t\t\telse $view = 'network/invite';\n\n\t\t\t# take to appropriate view\n\t\t\tredirect(base_url().$view);\n\t\t}\n\n\n\t\t# c) the user is coming to this page for first time OR they havent verified their phone yet\n\t\telse if(!(!empty($data['edit']) && $data['edit'] == 'Y') && $this->native_session->get('__telephone') && $this->native_session->get('__provider_id')\n\t\t\t&& (!$this->native_session->get('__telephone_verified') || ($this->native_session->get('__telephone_verified') && $this->native_session->get('__telephone_verified') == 'N'))\n\t\t){\n\t\t\t$response = $this->_api->post('user/telephone', array(\n\t\t\t\t\t'telephone'=>$this->native_session->get('__telephone'),\n\t\t\t\t\t'provider'=>$this->native_session->get('__provider_id'),\n\t\t\t\t\t'isPrimary'=>'Y'\n\t\t\t));\n\n\t\t\t# Prepare appropriate message\n\t\t\t$data['msg'] = (!empty($response['result']) && $response['result']=='SUCCESS')? 'A verification message has been sent to your phone. Enter the code here to confirm your phone number.': 'ERROR: A verification message could not be sent to your phone. <br>Click Resend to attempt sending it again, or Edit to change your phone details.';\n\t\t\t$result = TRUE;\n\t\t\t$data['area'] = 'verify_code_form';\n\t\t}\n\n\n\t\t# d) The user has to enter their phone details from scratch\n\t\telse $data['area'] = 'user_phone_details';\n\n\t\t$data = load_page_labels('link_card', $data);\n\t\t$this->load->view('account/verify_phone', $data);\n\t}", "public function store(PhoneRequest $request, Phone $model)\n {\n $this->storeData($request, $model);\n\n return back()->with('success' , 'Phone Saved Successfully') ;\n }", "public function create(Request $request)\n {\n $all = $request->all();\n $id = $all['addId'];\n $phone = $all['addphone'];\n $data = new Formbuild();\n $data::where('id', $id)->update(array('phone' => $phone));\n return 'Successfully Added!';\n }", "function verify_telephone()\n\t{\n\t\tlog_message('debug', 'Account/verify_telephone');\n\t\t$data = filter_forwarded_data($this);\n\t\tlog_message('debug', 'Account/verify_telephone:: [1] post='.json_encode($_POST));\n\n\t\tif(!empty($_POST)){\n\t\t\t$result = FALSE;\n\t\t\t$data['msg'] = '';\n\t\t\t$data['hasPosted'] = 'Y';\n\n\t\t\t# a) Is user updating their phone details?\n\t\t\tif(!empty($_POST['telephone'])){\n\t\t\t\t# Add or update phone and send verification code\n\t\t\t\t$response = $this->_api->post('user/telephone', array(\n\t\t\t\t\t'telephone'=>$_POST['telephone'],\n\t\t\t\t\t'provider'=>$_POST['provider__provider'],\n\t\t\t\t\t'isPrimary'=>'Y'\n\t\t\t\t));\n\n\t\t\t\t# Update the user telephone and provider if sucessful\n\t\t\t\tif(!empty($response['result']) && $response['result']=='SUCCESS'){\n\t\t\t\t\t$data['msg'] .= $this->native_session->get('__telephone') != $_POST['telephone']? 'Your phone number has been updated and a': 'A';\n\t\t\t\t\t$data['msg'] .= ' code has been sent for verification';\n\t\t\t\t\t$this->native_session->set('__telephone', $_POST['telephone']);\n\t\t\t\t\t$this->native_session->set('__provider', $response['provider']);\n\t\t\t\t\t$this->native_session->set('__provider_id', $_POST['provider__provider']);\n\t\t\t\t\t$result = TRUE;\n\t\t\t\t\t$data['area'] = 'verify_code_form';\n\t\t\t\t}\n\t\t\t\telse $data['msg'] .= 'ERROR: Your phone number could not be updated or code sent.';\n\t\t\t}\n\n\t\t\t# b) Verify telephone code\n\t\t\telse if(!empty($_POST['usercode'])){\n\t\t\t\t$response = $this->_api->post('account/verify', array(\n\t\t\t\t\t'code'=>$_POST['usercode'],\n\t\t\t\t\t'telephone'=>$this->native_session->get('__telephone'),\n\t\t\t\t\t'baseLink'=>base_url()\n\t\t\t\t));\n\n\t\t\t\tif(!empty($response['verified']) && $response['verified']=='Y'){\n\t\t\t\t\t$this->native_session->set('__telephone_verified', 'Y');\n\t\t\t\t\t$data['msg'] = '20 Points have been added to your Clout Score';\n\t\t\t\t\t$data['area'] = 'verify_code_results';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$data['msg'] = 'ERROR: Your phone could not be verified.<br>Please try again.';\n\t\t\t\t\t$data['area'] = 'verify_code_form';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$data['area'] = !empty($data['area'])? $data['area']: 'user_phone_details';\n\t\t$this->load->view('account/verify_phone', $data);\n\t}", "public function create()\n {\n return view('admin.phone.create');\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n\t{\n\t\treturn $this->phone;\n\t}", "public function callNumber($number, $from_number, $phone_type = 'mobile') {\n $this->_verifyPhoneType($phone_type);\n\n\t\t// Send HTTP POST request.\n return $this->_post(\n $this->_serverPath['call'],\n array(\n 'forwardingNumber' => $this->_formatNumber($from_number),\n 'outgoingNumber' => $this->_formatNumber($number),\n 'phoneType' => $this->_phoneTypes[$phone_type],\n 'remember' => '0',\n 'subscriberNumber' => 'undefined'\n )\n );\n\t}", "public function createNewRecord() {\n try {\n // Define classes that we need to use.\n $phoneUtil = PhoneNumberUtil::getInstance();\n $phoneNumberCarrier = PhoneNumberToCarrierMapper::getInstance();\n // Define PhoneNumber instance.\n $phoneNumber = $phoneUtil->parse($this->number);\n // Check if phone number is valid.\n if ($phoneUtil->isValidNumber($phoneNumber)) {\n // Get phone number parameters.\n $countryCode = $phoneUtil->getRegionCodeForNumber($phoneNumber);\n $carrier = $phoneNumberCarrier->getNameForNumber($phoneNumber, $countryCode);\n $countryDialingCode = $phoneNumber->getCountryCode();\n $subscriberNumber = $phoneNumber->getNationalNumber();\n\n // We will return this data to the view.\n $data = [\n 'mno' => $carrier,\n 'country_dialing_code' => $countryDialingCode,\n 'subscriber_number' => $subscriberNumber,\n 'country_code' => $countryCode,\n ];\n\n // Save new record into database.\n $record = Records::create([\n 'phone_number' => $this->number,\n 'data' => json_encode($data),\n ]);\n\n return $record;\n }\n } catch (NumberParseException $e) {\n throw new NumberParseException($e, $e->getMessage());\n }\n }", "public function post();", "public function post();", "public function post();", "public function setPhone($value)\n {\n $this->phone = $value;\n return $this;\n }", "public function updatePhone()\n {\n $titre = 'Update Phone';\n $this->render('achat','updatePhone', compact('titre'));\n }", "public function __construct($phone)\n {\n $this->phone = $phone;\n // $this->id = $id;\n }", "public function getPhoneNumber()\n {\n return $this->phone_number;\n }", "public function sendOtp($phone){\n $cc = \"+91\";\n $this->db->select('otp')->from('otp')->where('phone',$phone);\n $q = $this->db->get();\n if($q->num_rows() == 0){\n $otp = rand(1000,9999);\n $data = array(\n 'phone' => $phone,\n 'otp' => $otp\n );\n $this->db->insert('otp',$data);\n }else{\n $res = $q->result();\n $otp = $res[0]->otp;\n }\n \n // if send sms successful\n return 1;\n }", "public function getPhoneNumber()\n {\n return $this->phoneNumber;\n }", "public function getPhoneNumber()\n\t{\n\t\treturn $this->getIfSet('number', $this->data->phone);\n\t}", "public function postCreate()\r\n\t{ \r\n $Data = Input::json()->all();\r\n $CourierId = isset($Data['courier_id']) ? (int)$Data['courier_id'] : 0;\r\n $Name = isset($Data['name']) ? $Data['name'] : null;\r\n $Code = isset($Data['code']) ? $Data['code'] : null;\r\n $Phone = isset($Data['phone']) ? $Data['phone'] : null;\r\n $Active = isset($Data['active']) ? (int)$Data['active'] : 0;\r\n \r\n $Model = new PostManModel;\r\n $statusCode = 200;\r\n \r\n if(empty($CourierId) || empty($Name) || empty($Phone)){\r\n $contents = array(\r\n 'error' => true, 'message' => 'values empty'\r\n );\r\n return Response::json($contents, $statusCode, array('Access-Control-Allow-Origin' => $this->domain));\r\n }\r\n \r\n $Id = $Model::insertGetId(\r\n array(\r\n 'courier_id' => $CourierId, \r\n 'name' => $Name, \r\n 'phone' => $Phone, \r\n 'code' => $Code, \r\n 'active' => $Active\r\n ));\r\n \r\n if($Id){\r\n $contents = array(\r\n 'error' => false,\r\n 'message' => 'success',\r\n 'id' => $Id\r\n );\r\n }else{\r\n $contents = array(\r\n 'error' => true,\r\n 'message' => 'insert false'\r\n );\r\n }\r\n \r\n return Response::json($contents, $statusCode, array('Access-Control-Allow-Origin' => $this->domain));\r\n\t}", "public function changeContactNumber($id){\n $contactNo = Input::get('contact');\n try {\n DB::beginTransaction();\n $request= DB::table('appointmentRequests')\n ->where('id', $id)\n ->update(['contactNo' => $contactNo]);\n }catch (Exception $e){\n DB::rollBack();\n return Response::json(\"Insertion failed\",HttpResponse::HTTP_PARTIAL_CONTENT);\n }\n DB::commit();\n return Response::json($contactNo,HttpResponse::HTTP_OK);\n }", "public function getPhoneNumber()\n\t{\n\t\treturn $this->phone_number;\n\t}", "public function getPhone() {\n return $this->phone;\n }", "public function getPhone() {\n return $this->phone;\n }", "function getPhone() {\n return $this->phone;\n }", "public function getPhone()\n {\n $res = $this->getEntity()->getPhone();\n\t\tif($res === null)\n\t\t{\n\t\t\tSDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->create($this);\n\t\t\treturn $this->getEntity()->getPhone();\n\t\t}\n return $res;\n }", "function addContact() {\n\t$request = Slim::getInstance()->request();\n\t$cont = json_decode($request->getBody());\n\n\t$sql = \"call AddContact(:p_name, :p_phone, :p_address)\";\n\ttry {\n\t\t$db = DB_Connection();\n\t\t$stmt = $db->prepare($sql); \n\t\t$stmt->bindParam(':p_name',$cont->name,PDO::PARAM_STR,30);\n\t\t$stmt->bindParam(':p_phone',$cont->phone,PDO::PARAM_STR,15);\n\t\t$stmt->bindParam(':p_address',$cont->address,PDO::PARAM_STR,100);\n\t\t$stmt->execute();\n\t\t$db = null;\n\t\techo json_encode($cont); \n\t} catch(PDOException $e) {\n\t\techo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n\t}\n}", "function set_form_contacto(){\n\n\t\tif($this->input->post('id')){\n\n\t\t\t$user = $this->session->userdata('cliente_id');\n\n\t\t\t$mensaje = $this->load->view('frontend/comunes/form_contacto',null,true);\n\n\t\t\t$data_in = array(\n\t 'from_id' \t=> 0,\n\t 'to_id' \t=> $user,\n\t 'mensaje' => $mensaje,\n\t 'sin_fondo'\t=> 1,\n\t 'date'\t\t=> applib::fecha(),\n\t );\n\n\t applib::create(applib::$mensajes_table,$data_in);\n\n\t echo json_encode(array('res' => 'success'));\n\n\t\t}\n\n\t}", "public function getPhone() {\n\t\treturn $this->phone;\n\t}", "public function getReqMobilePhone()\n\t{\n\t\treturn $this->req_mobile_phone;\n\t}", "public function updatePhone()\n {\n $this->schol->updatePhone( $this->input->post('emp'), $this->input->post('phone'));\n return redirect('/affirs/Scholarship/show/'. $this->input->post('schol'));\n\n }", "public function setNewPhone($value)\n {\n return $this->set('NewPhone', $value);\n }", "public function update(Request $request, Phone $phone)\n {\n //\n }", "public function actionCreate($id) {\n $appointment = Appointment::find($id)->one();\n $model = new PortCallData();\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 'appointment' => $appointment,\n ]);\n }\n }", "public function getTelephone() {}", "public function setPhone($phone = \"\");", "public function Create() {\n\t\tvalid_only_single_method ( 'POST' );\n\t\trequire_authorization ();\n\n\t\t// Check the Phone number and Telephone number, then call the Notier model\n\t\t$courier_id\t\t\t\t= get_validated_courier_id ();\n\n\t\t$this->load->model ( 'delivery_session_model' );\n\t\t$delivery_session_id = $this->delivery_session_model->Create ( $courier_id );\n\n\n\t\tjson_response ( array ( 'response' => $this->config->item ( 'response_success' ),\n\t\t\t\t'delivery_session_id'\t=> $delivery_session_id ) );\n\t}", "public function getPhone()\n {\n return $this->get(self::PHONE);\n }", "public function getPhone()\r\n {\r\n return $this->_phone;\r\n }", "public function getPhoneNumber()\n {\n return $this->phoneNumber;\n }", "public function getPhoneNumber()\n {\n return $this->phoneNumber;\n }" ]
[ "0.71637064", "0.6726316", "0.6352079", "0.6347137", "0.6222432", "0.62209785", "0.61059386", "0.60315907", "0.5983558", "0.59538597", "0.5950735", "0.5924474", "0.5875218", "0.58472884", "0.5846381", "0.5844666", "0.5832172", "0.5777336", "0.57573754", "0.57351893", "0.57133865", "0.57045525", "0.5692691", "0.5691395", "0.56893754", "0.5688931", "0.56849223", "0.56816614", "0.5670631", "0.56506413", "0.56506413", "0.56325537", "0.562535", "0.5615791", "0.55674565", "0.5566072", "0.55573505", "0.5554131", "0.55525196", "0.55519277", "0.5551644", "0.5546742", "0.55371696", "0.5532369", "0.55274075", "0.5517298", "0.55089194", "0.54997116", "0.54986465", "0.5493221", "0.54923844", "0.5488242", "0.5488242", "0.5488242", "0.5488242", "0.5488242", "0.5488242", "0.5488242", "0.5488242", "0.5488242", "0.5488242", "0.5488242", "0.5488242", "0.5488242", "0.5488242", "0.5488242", "0.54848886", "0.5476718", "0.5474311", "0.54700214", "0.54700214", "0.54700214", "0.5464648", "0.546311", "0.54598504", "0.5454379", "0.54536116", "0.54457676", "0.54452825", "0.5444379", "0.5442667", "0.5441058", "0.543871", "0.543871", "0.5434675", "0.54344726", "0.54290116", "0.5427755", "0.5427208", "0.5419283", "0.5418555", "0.5418337", "0.54170567", "0.54131097", "0.5409214", "0.54085237", "0.53955466", "0.5392443", "0.5390747", "0.5382286", "0.5382286" ]
0.0
-1
responds to POST /phone/id/delete
public function destroy($id) { $personID = request()->input('personID'); $this->currentPerson = Person::find(auth()->user()->id); $phone = Phone::find($id); $phone->updaterID = $this->currentPerson->personID; $phone->save(); $phone->delete(); if (request()->input('personID') == $this->currentPerson->personID) { return redirect('/profile/my'); } else { return redirect('/profile/'.$personID); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy(Request $request, Phone $phone)\n {\n dd('here');\n $all = $request -> all();\n $id = $add['deleteId'];\n $data = new Formbuild();\n $data::where('id', $id)->update(array('phone' => ''));\n return 'Successfully Deleted!';\n }", "public function delete($id){\n \t$dms_master_phone = Master_phone::find($id);\n \t$dms_master_phone->delete();\n\n \t// sama aja kaya href setelak klik delete\n \t// mau pindah ke link mana setelah tombol submit di klik\n \treturn redirect('cms/master_phone');\n }", "public function delete_phonesclient(){\n\t\t$this->layout = 'ajax';\n\t\n\t\tif($this->request->is('post')){\n\t\t\t$phonesclient_id = $this->request->data['phonesclient_id'];\n\t\n\t\t\t$obj_phonesclient = $this->Phonesclient->findBy('IDPhoneclient', $phonesclient_id);\n\t\t\tif($obj_phonesclient->saveField('Status', 0)){\n\t\t\t\techo json_encode(array('success'=>true,'msg'=>__('Eliminado con &eacute;xito.')));\n\t\t\t\texit();\n\t\t\t}else{\n\t\t\t\techo json_encode(array('success'=>false,'msg'=>__('Error inesperado.')));\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\n\t}", "public function destroy($id)\n {\n $phone = PhoneType::find($id);\n\n $phone->delete();\n return redirect()->route('phones.index');\n }", "public function destroy($id)\n {\n $this->authorize('delete');\n $this->phone->where('id' , $id)->delete();\n\n return redirect()->back();\n }", "public function destroy(Phone $phone)\n {\n //\n }", "public function delete_contact()\n\t{\n\t\t\n\t\t$id = $this->input->post('id');\n\t\t$this->contact_model->delete_contact($id);\n\t\t$response = array('status' => true, 'message' => \"Contact deleted successfully\");\n\t\techo json_encode($response);\n\t}", "public function destroy($id)\n {\n $phone = PhoneNumber::find($id);\n $phone->delete();\n return redirect()->back()->with('success', 'A phone number has been deleted.');\n }", "public function destroy($id)\n {\n $sms = SmsNumber::find($id);\n $sms->delete();\n alert()->success('Phone number', 'The record has been removed successfully.');\n return redirect('sms')->with('success', 'Post Rmoved');\n }", "public function delete_contact_details()\n\t{\n\t\t\n\t\t$id = $this->input->post('id');\n\t\t$contact_id = $this->input->post('contact_id');\n\t\t$this->contact_model->delete_contact_details($id);\n\t\t$response = array('status' => true, 'message' => \"Contact details deleted successfully\",'contact_id'=>$contact_id);\n\t\techo json_encode($response);\n\t}", "public function phoneDelete($phone_id, CompanyPhones $companyPhones)\n {\n $phone = $companyPhones->findOrFail($phone_id);\n $company_id = $phone->company_id;\n\n $phone->delete();\n\n Flash::success('Telefón bol odstránený zo spoločnosti!');\n\n return redirect(route('admin.companies.phones', $company_id));\n }", "public function destroy(Phones $phone)\n {\n $phone->delete();\n\n\t\treturn response(null, Response::HTTP_NO_CONTENT);\n }", "function index_delete() {\n $id = $this->delete('id'); // Memanggil data berdasarkan arraynya\n $this->db->where('id', $id);\n $delete = $this->db->delete('telepon'); \n if ($delete) {\n $this->response(array('status' => 'success'), 201);// Jika berhasil maka akan tampil\n } else {\n $this->response(array('status' => 'fail', 502));// Jika gagal maka akan tampil\n }\n }", "public function destroy(Phone $phone)\n {\n $phone->delete();\n\n return back()->with('success' , 'Phone Updated Successfully') ;\n }", "public function destroy($person_id, $id)\n {\n $phone = $this->model->where(['person_id' => $person_id,'id' => $id])->first();\n $maskNumber = $phone->maskNumber;\n\n if( count($phone) != 1) return view('errors.404');\n\n if( $phone->delete() )\n session(['success' => \"o telefone [{$maskNumber}] foi removido com sucesso!\"]);\n else\n session(['error' => \"o telefone [{$maskNumber}] não foi removido!\"]);\n\n return redirect()->back();\n }", "public function actionDelete() {\n if (Yii::app()->request->isPostRequest) {\n //$ids = base64_decode($_POST['ids']);\n $ids = isset($_POST['ids']) ? $_POST['ids'] : 0;\n $res = new PERSONA;\n $arroout = $res->removerPersona($ids);\n header('Content-type: application/json');\n echo CJavaScript::jsonEncode($arroout);\n }\n }", "public function delete()\n\t{\n\t\t$data = json_decode(file_get_contents(\"php://input\")); \t \n\t\techo $this->home->delete($data);\n\t\t\n\t}", "public function delete_delete(){\n $response = $this->PersonM->delete_person(\n $this->delete('id')\n );\n $this->response($response);\n }", "public function delete() {\n\n $input_data = $this->request->getJsonRawBody();\n $id = isset($input_data->id) ? $input_data->id : '';\n if (empty($id)):\n return $this->response->setJsonContent(['status' => false, 'message' => 'Id is null']);\n else:\n $kidphysical_delete = NidaraKidPhysicalInfo::findFirstByid($id);\n if ($kidphysical_delete):\n if ($kidphysical_delete->delete()):\n return $this->response->setJsonContent(['status' => true, 'Message' => 'Record has been deleted succefully ']);\n else:\n return $this->response->setJsonContent(['status' => false, 'Message' => 'Data could not be deleted']);\n endif;\n else:\n return $this->response->setJsonContent(['status' => false, 'Message' => 'ID doesn\\'t']);\n endif;\n endif;\n }", "public function delete_post() {\n $data = $this->input->post();\n if($data['id'] == null) {\n $this->set_response(array('response_code'=>400, 'response_message'=>'Parameter missing', 'response_data'=>array()), REST_Controller::HTTP_OK);\n return;\n }\n $result = $this->Api_model->deleteData('info', array('id'=>$data['id']));\n if($result == 1) {\n $this->set_response(array('response_code'=>200,'response_message'=>'Success','response_data'=>$result), REST_Controller::HTTP_OK); \n return; \n }\n $this->set_response(array('response_code'=>400,'response_message'=>'Error occurs while process','response_data'=>array()), REST_Controller::HTTP_OK);\n return;\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 deleteMo()\n\t{\n\t\t$this->Checklogin();\n\t\t$mobileid=$this->input->post('mobileId');\n\t\t\n\t\tif(count($mobileid)>0)\n\t\t{\n\t\t\t$a=$this->setting_model->deleteMo($mobileid);\n\t\t\t\n\t\t\t$this->session->set_flashdata('success','Mobile Number has been deleted successfully');\n\t\t\tsetAActivityLogs('Transaction_activity','AAmoregistration_delete',\"Deleted Id is:-\".$mobileid);\n\t\t\techo true;\n\t\t}\t\n\t else \n\t {\n\t \t$this->session->set_flashdata('success','Something Went Wrong.......!');\n\t \techo true;\n\t }\t\n\t\t\t\t\n\t\n\t\t\t\n\t\n\t}", "public function destroy(Phone $phone)\n {\n Gate::authorize('can-destroy-phone', $phone->user_id);\n //\n }", "public function destroy(Phone $phone)\n {\n $phone->delete();\n\n return redirect()->back()->withSuccess('Phone successfully delete');\n }", "public function postDelete()\n\t{\n\t\t$id = '';\n\t\tif (Request::has('pwp_ids')) {\n\t\t\t$id = Request::input('pwp_ids');\n\t\t} elseif (Request::has('id')) {\n\t\t\t$id = Request::input('id');\n\t\t}\n\n\t\tif (is_numeric($id) || is_array($id)) {\n\t\t\tPwpProduct::destroy($id);\n\t\t\tSession::flash('success', 'The pwp product has been deleted successfully');\n\t\t\treturn new JsonResponse(['success' => 'TRUE']);\n\t\t}\n\t\tSession::flash('error', 'The pwp product has not been deleted. Please correct the errors');\n\t\treturn new JsonResponse(['error' => ['Invalid data posting']], 422);\n\t}", "public function destroy($id)\n {\n $contact = Contact::find($id);\n $phones = $contact->phones;\n //delete phones for this contact\n foreach ($phones as $phone) {\n $phone->delete();\n }\n $contact->delete();\n\n return redirect('/administration/contacts')->with('success', 'The contact is deleted successfully!');\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 delete($id){\n Partner::destroy($id);\n return response()->json(['success' => 'Your inquire is successfully sent']);\n }", "public function user_delete_post()\n { \n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n \n $id = $data['id'];\n $where = array(\n 'id' => $id\n );\n $this->model->delete('users', $where);\n $resp = array('rccode' => 200,'message' =>'success');\n $this->response($resp);\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 deleteHardwareinputProduct(){\n $response = $this->Hardwareinputproduct_model->delete($this->input->post('id'));\n if ($response==1) {\n echo json_encode(array('response'=>'success','message'=>sprintf(lang('deleted_successfully'),lang('page_hardwareinput_product')),'dataid'=>$this->input->post('id')));\n }else{\n echo json_encode(array('response'=>'error','message'=>$response,'dataid'=>$this->input->post('id')));\n }\n exit;\n }", "public function deleteAction(){\n $id = $this->params('id');\n $client = new Client();\n $ServerPort =\"\";\n if($_SERVER['SERVER_PORT']){\n $ServerPort = ':'.$_SERVER['SERVER_PORT'];\n }\n $client->setUri('http://'.$_SERVER['SERVER_NAME'].$ServerPort.'/order-rest/'.$id);\n $client->setOptions(array(\n 'maxredirects' => 5,\n 'timeout' => 30\n ));\n $client->setMethod( Request::METHOD_DELETE );\n $response = $client->send();\n if ($response->isSuccess()) {\n $result = json_decode( $response->getContent() , true);\n }\n return $this->redirect()->toRoute('ordermanagement', array('action' => 'index') );\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 }", "function delete_contact_from_phonebook($contact_id){\n\t\tif( isset($_POST[$contact_id]) ){\n\t\t\tphonebook::delete_phonebook_info($_POST[$contact_id]);\n\t\t}\n\t}", "function del()\n\t{\n\t $id = $this->uri->rsegment(3);\n\t $this->_del($id);\n\t\n\t //tạo ra nội dung thông báo\n\t $this->session->set_flashdata('message', 'không tồn tại liên hệ này');\n\t redirect(admin_url('contact'));\n\t}", "Public function delete() {\n// echo $_POST['_action'];\n // die($this->util_model->printr($_POST));\n $result = $this->ajax_model->delete($_POST);\n // $this->util_model->printr($result);\n echo json_encode(array('success' => $result[0], '_err_msg' => mysql_real_escape_string(isset($result[1])) ? $result[1] : ''));\n }", "public function delete() {\n if (isset($_POST) && !empty($_POST) && isset($_POST['delete']) && !empty($_POST['delete'])) {\n if (isset($_POST['token']) && $this->_model->compareTokens($_POST['token'])) {\n if (!$this->_model->delete(explode(\"/\", $this->_url)[1])) {\n echo \"error\";\n } else {\n echo \"good\";\n }\n }\n }\n }", "public static function delete(){\n\t\tif(isset($_POST['formId']) && isset($_POST['personnalInformationName'])){\n\t\t\t$data = array(\n\t\t\t\t\"formId\" => $_POST['formId'],\n\t\t\t\t\"personnalInformationName\" => $_POST['personnalInformationName']\n\t\t\t);\n\t\t\techo json_encode(ModelAssocFormPI::delete($data));\n\t\t}else{\n\t\t\techo json_encode(false);\n\t\t}\n\t}", "public function delete(){\n if (empty($this->pad)){\n msg('Your pad is empty.');\n closeNode();\n }else{\n msg('Please send the number of the note you want to delete from your pad :');\n bindNode('deleteNote');\n }\n\n\n }", "public function delete()\n {\n if ($_SERVER['REQUEST_METHOD'] == 'GET') {\n if (!isset($_GET['id'])) {\n call('pages', 'error');\n return;\n }\n // we use the given id to get the correct product\n show_view('views/admin/bodyparts/delete.php', ['bodyPart' => BodyPart::find($_GET['id'])]);\n } else { //case when we are writing the bodypart to the database\n $id = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_SPECIAL_CHARS);\n BodyPart::remove($id);\n redirect('body_parts', 'readAll');\n }\n }", "public function deleteAddress(){\n $key = $_REQUEST['id'];\n //$key = 2;\n $condition['id'] = $key;\n $form = M(\"addressinfo\");\n $data = $form->where($condition)->delete();\n //$this->display();\n }", "public function delete(){\n $id = $_POST['id'];\n Cita::destroy($id);\n }", "public function cliente_delete(){\n\t\t$cliente_id = $this->uri->segment(3);\n\n\t\t$respuesta = $this->Cliente_model->delete($cliente_id);\n\t\t\n\t\t$this->response($respuesta);\n\t}", "function delete_post()\n {\n\t\t$dataInfo = array();\n\t\t\n $fid = $this->input->post('fid', TRUE);\n\n $result = $this->MUGroup->delete_data($fid);\n\n if($result > 0)\n {\n $this->response([\n 'status' => TRUE,\n 'message' => 'Data is successfully deleted'\n ], REST_Controller::HTTP_OK);\n }\n else\n {\n $this->response([\n 'status' => FALSE,\n 'message' => 'Failed to delete data'\n ], REST_Controller::HTTP_OK);\n }\n }", "public function deletecontact(Request $request){\n\n if( isset($request->id) ){\n \n\n $this->brandcontacts->deletecontact($request->id);\n \n return redirect()->back()\n ->with('success','Contact successfully deleted.'); \n }else{\n return redirect()->back()->withErrors(['msg', 'Invalid request']);\n }\n\n \n }", "public function delete(int $id): void\n {\n $this->request(\n method: 'delete',\n path: 'contacts/'.$id\n );\n }", "function delete_record($_DELETE)\n {\n $delete_data = json_decode($_DELETE[\"0\"], true);\n if (isset($delete_data[\"id\"])) {\n $id = $delete_data[\"id\"];\n if ($id <= 0) {\n $this->invalid_data_format(array(\n 'error' => 'Invalid Data Format',\n 'SampleJsonDataFormat' => '[{\"id\":24}]'\n ));\n return;\n }\n } else {\n $statusCode = 400;\n $this->setHttpHeaders(\"application/json\", $statusCode);\n $rows = array(\n 'error' => 'Invalid Data Format Gopi',\n 'SampleJsonDataFormat' => '{\"id\":24}'\n );\n $response = json_encode($rows);\n echo $response;\n return;\n }\n $db = new DB();\n $conn = $db->connect();\n if (empty($conn)) {\n $statusCode = 404;\n $rawData = array(\n 'error' => 'No databases found!'\n );\n $response = json_encode($rawData);\n echo $response;\n return;\n } else {\n $statusCode = 200;\n }\n $stmt = $conn->prepare(\"Delete from user_agents where id=?\");\n $stmt->bind_param('i', $id);\n $stmt->execute();\n $conn->close();\n\n $this->setHttpHeaders(\"application/json\", $statusCode);\n }", "public function destroy(Request $request)\n {\n $id = $request->id;\n\n $contacts = Contacts::where('id', '=', $id)->delete();\n\n return response()->json(['success'=>'success']);\n\n }", "public function delete_record()\n {\n $id = $this->input->get('tpid');\n\n $result = $this->PumpModel->delete_data(array('tpid'=>$id));\n // print_r($result);die;\n redirect(base_url(). 'Pump');\n }", "public function delete()\n {\n $lessonId = $this->input->post(\"lessonId\");\n $resultLessonDelete = $this->Lesson_Model->delete($lessonId);\n echo json_encode($resultLessonDelete);\n }", "public function actionDelete()\n {\n if(isset($_POST['id'])){\n $id = $_POST['id'];\n $this->findModel($id)->delete();\n echo \"success\";\n }\n }", "function index_delete($id=null){\n\t\t$response['SUCCESS'] = array('status' => TRUE, 'message' => 'success delete mobil' );\n\n\t\t#Set response API if Fail\n\t\t$response['FAIL'] = array('status' => FALSE, 'message' => 'fail delete mobil' );\n\t\t\n\t\t#Set response API if mobil not found\n\t\t$response['NOT_FOUND']=array('status' => FALSE, 'message' => 'no mobil were found' );\n\n\n\t\t#Check available mobil\n\t\tif (!$this->validate($id))\n\t\t\t$this->response($response['NOT_FOUND'],REST_Controller::HTTP_NOT_FOUND);\n\t\t\n\n\t\tif (!empty($this->get('ID_MOBIL')))\n\t\t\t$id=$this->get('ID_MOBIL');\n\t\t\n\t\tif ($this->m_mobil->delete($id)) {\n\t\t\t\n\t\t\t#If success\n\t\t\t$this->response($response['SUCCESS'],REST_Controller::HTTP_CREATED);\n\t\t\n\t\t}else{\n\n\t\t\t#If Fail\n\t\t\t$this->response($response['FAIL'],REST_Controller::HTTP_CREATED);\n\t\t\t\n\t\t}\n\n\t}", "public function postDelete(Request $request)\n {\n if(!Auth::check() || Auth::user()->type != 1)\n {\n return Redirect::to('admin');\n }\n $id = $request->get('id');\n Contact::whereIn('id',$id)->delete();\n Session::flash('delete','success');\n return Redirect::to('admin/contact/list');\n }", "public function delete(Request $request)\n {\n $id = $request->input('id');\n try{\n $res = Patient::destroy((int)$id);\n\n return response()->json(['result' => true,'res' => $res]);\n\n }catch(Exception $e)\n {\n return response()->json(['patient' => $e->getMessage()]);\n\n }\n }", "public function deleteContactoAction()\n {\n \n $isAjax = $this->get('Request')->isXMLhttpRequest();\n \n $response = new JsonResponse();\n \n $idcontacto = $this->get('request')->request->get('idcontacto');\n \n \n foreach($idcontacto as $row){\n $em = $this->getDoctrine()->getManager();\n $detalleOrden = $em->getRepository('ERPAdminBundle:CrmContacto')->find($row);\n $em->remove($detalleOrden);\n $em->flush();\n \n }\n \n $response->setData(array(\n 'flag' => 0,\n \n )); \n return $response; \n \n \n \n \n }", "public function destroy($id)\n {\n $telefono = Telefono::find($id);\n $telefono->delete();\n return redirect('/telefonos');\n }", "function delete() : bool {\n empty($_GET)? $req = $_POST : $req = $_GET;\n if ($req['id'] === NULL) {http_response_code(400); return false;}\n $comment = new Post();\n $comment->delete(\"id\",$req['id']);\n http_response_code(200);\n return true;\n}", "function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }", "function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }", "public function destroy($userId, $phoneId)\n\t{\n\t\t$phone = $this->phone->findOrFail($phoneId);\n\t\t$phone->delete($phoneId);\n\t\treturn Response::json(['success' => true],200);\n\t}", "function customer_delete(){\r\n\t\t$ids = $_POST['ids']; // Get our array back and translate it :\r\n\t\t$pkid = json_decode(stripslashes($ids));\r\n\t\t$result=$this->m_customer->customer_delete($pkid);\r\n\t\techo $result;\r\n\t}", "public function deleteAction()\n {\n Extra_ErrorREST::setInvalidHTTPMethod($this->getResponse());\n }", "public function one_time_service_slots_delete() {\n $post_data = $this->input->post();\n $result = $this->Cs_vendor->one_time_service_slots_delete($post_data);\n echo json_encode('success');\n }", "public function destroy($id)\n {\n\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n //something posted\n\n if (isset($_POST['delCar'])) {\n \n $car=Cars::findOrFail($id);\n $car->delete();\n return redirect('/home');\n\n\n\n } else {\n\n $tire=Tires::findOrFail($id);\n $tire->delete();\n return redirect('/home');\n \n }\n}\n \n\n}", "public function post_delete(){\n\t\t\t\n\t\t$data \t= \tFiledb::_rawurldecode(json_decode(stripcslashes(Input::get('data')), true));\n\n\t\tif($data[\"delete\"] == 'delete'){\n\t\t\t\n\t\t\t$status = Users::delete($data[\"id\"]);\n\n\t\t\treturn ($status) ? Utilites::success_message(__('forms.deleted_word')) : Utilites::fail_message(__('forms_errors.undefined'));\n\t\t}\n\t}", "public function posteliminar() {\n $model = (new PaisRepository())->Obtener($_POST['id']);\n\n $rh = (new PaisRepository())->Eliminar($model);\n\n print_r(json_encode($rh));\n }", "public function xhrDeleteListing()\n {\n $id = (int) $_POST['id'];\n $this->db->delete('data', \"id = '$id'\");\n }", "public function postDelete($result) { }", "public function destroy(Client $client, Phone $phone)\n {\n try {\n $phone->delete();\n return redirect()->route('profile')->with('success',('destroyed'));\n } catch (\\Exception $e) {\n return redirect()->route('profile')->with('error',$e->getMessage());\n }\n }", "public function delete(Request $request, $id){\n $monster = Monster::findOrFail($id);\n $monster->delete();\n\n return 200;\n }", "public function delete($id) {\n \n //Check if an ID has been sent\n if ($id) {\n\n //Check if the contact actually exists\n $contact = $this->Contact->findById($id);\n if ($contact) {\n\n\t//Delete the contact\n\t$this->Contact->delete($id);\n\t$this->Session->setFlash(__('Contact Deleted'));\n\n }\n }\n return $this->redirect(array('action' => 'index'));\n }", "public function delete(Request $request)\n {\n //\n if($request->ajax())\n { \n $orden = OrdenTrabajo::findOrFail($request->orden_number);\n\n $orden->delete();\n\n $ot = OrdenTrabajoProducto::where('ot_producto_orden_trabajo',$request->orden_number)->findOrFail();\n\n $ot->delete();\n\n //respuesta al cliente\n return response()->json([\n \"ok\"\n ]);\n }\n }", "public function delete($id) {\n $this->contact_model->delete_contact($id);\n redirect(base_url());\n }", "public function delete() \n {\n $model = $this->model;\n $input = Input::all(); \n \n $arrayIdDelete = $input[$model::getPrimaryKey()];\n \n $result = array();\n foreach ($arrayIdDelete as $id) {\n $singleResult = $this->deleteSingleObject($id);\n $result[] = $singleResult;\n }\n \n return $jsend = JSend\\JSendResponse::success($result);\n }", "function delete( $id = FALSE )\n{\nswitch ( $_SERVER ['REQUEST_METHOD'] )\n{\ncase 'GET':\n$this->model_group->delete( $id );\nredirect( $_SERVER['HTTP_REFERER'] );\nbreak;\ncase 'POST':\n$this->model_group->delete( $this->input->post('delete_ids') );\nredirect( $_SERVER['HTTP_REFERER'] );\nbreak;\n}\n}", "public function delete()\n\t{\n\t\t$id = $this->input->post('primary_id');\n\t\tif($this->mdl_plant->delete($id)) {\n\t\t\techo true;\n\t\t} else {\n\t\t\techo false;\n\t\t}\n\t}", "public function delete(Request $request)\n {\n\n\t\t$id=$request->get('hdn_person_id');\n\n $person = Person::find($id);\n if ($person == null)\n {\n Flash::error('That person doesn\\'t exist.')->important();\n return Redirect::route('persons-home');\n }\n\n $input['is_active'] = 0;\n $input['deleted_userid'] = Auth::user()->id;\n $input['deleted_at'] = Carbon::now();\n\n // update into db\n $person->fill($input)->save();\n\n if( $request->ajax())\n {\n return array(\n 'success' => true,\n );\n }\n else\n {\n flash()->Success(\"Person deleted successfully.\")->important();\n return redirect()->back();\n }\n\n }", "public function delete() {\n\n $input_data = $this->request->getJsonRawBody();\n $id = isset($input_data->id) ? $input_data->id : '';\n if (empty($id)):\n return $this->response->setJsonContent(['status' => 'Error', 'message' => 'Id is null']);\n else:\n $collection = GuidedLearningGamesMap::findFirstByid($id);\n if ($collection):\n if ($collection->delete()):\n return $this->response->setJsonContent(['status' => 'OK', 'Message' => 'Record has been deleted succefully ']);\n else:\n return $this->response->setJsonContent(['status' => 'Error', 'Message' => 'Data could not be deleted']);\n endif;\n else:\n return $this->response->setJsonContent(['status' => 'Error', 'Message' => 'ID doesn\\'t']);\n endif;\n endif;\n }", "public function deleteOTP()\n {\n return $this->getOTPHandler()->delete();\n }", "public function delete(){\n $socialMediaId = $this->input->post(\"socialMediaId\");\n $resultSocialMediaDelete = $this->Social_Model->delete($socialMediaId);\n echo json_encode($resultSocialMediaDelete);\n }", "public function deleteAction()\n {\n $postdata = file_get_contents(\"php://input\");\n $request = json_decode($postdata);\n $details['id'] = $request;\n $model = new Application_Model_Mapper_Server($vars);\n $result = $model->mlsDelete($details);\n $this->view->assign('result', $result);\n $this->_helper->viewRenderer('index');\n }", "function delete(){\n $data = new RepairServiceModel();\n $data->RequestID = $_POST['RequestID'];\n if($data->deleteRequest()){\n $message = \"Success Delete!\";\n echo \"<script type='text/javascript'>alert('$message');\n window.location = '../../ApplicationLayer/RepairServiceModule/RequestList.php';</script>\";\n }\n }", "public function delete()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'detailfasilitaskesehatan', 'delete')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\tif (!empty($_POST)) {\n\t\t\t$query = $this->podb->deleteFrom('detailfasilitaskesehatan')->where('id', $this->postring->valid($_POST['id'], 'sql'));\n\t\t\t$query->execute();\n\t\t\t$this->poflash->success('Detailfasilitaskesehatan has been successfully deleted', 'admin.php?mod=detailfasilitaskesehatan');\n\t\t}\n\t}", "public function actionDelete()\n {\n $id = $_POST['id'];\n\n if($this->loadModel($id)->delete()){\n $_SESSION['delete'] = \"Service deleted successfully\";\n echo json_encode([\n 'token' => 1,\n ]);\n }\n else{\n echo json_encode([\n 'token' => 0,\n ]);\n }\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(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));*/\n }", "public function removePhone( $id )\n\t{\n\t\t// database connection and sql query\n $core = Core::dbOpen();\n $sql = \"DELETE FROM user_phone WHERE phoneID = :id\";\n $stmt = $core->dbh->prepare($sql);\n $stmt->bindParam(':id', $id);\n Core::dbClose();\n\n\t\ttry\n {\t\t\t\n if( $stmt->execute()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} catch ( PDOException $e ) {\n echo \"Remove phone number failed!\";\n }\n\t\treturn false;\n\t}", "public function delete(): void\n {\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n $id = trim($_POST['id']);\n $itemManager = new ItemManager();\n $itemManager->delete((int)$id);\n\n header('Location:/items');\n }\n }", "public function destroy(Request $request)\n {\n $data_delete = $request->all();\n // echo '<pre>';\n // print_r($data_delete);\n // die;\n $delete = MotorcycleTechnology::where('m_t_id', $data_delete['m_t_id'])->update(['operation' => 'D']);\n if ($delete) {\n return response()->json(['response' => 'El registro ha sido eliminado.', 'error' => '']);\n } else {\n return response()->json(['error' => 'No se pudo eliminar el registro']);\n }\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 destroy($delete,$contact)\n {\n $val = [\n \"delete\"=>$delete,\n \"contact\"=>$contact \n ];\n\n $validator = Validator::make($val, [\n 'delete' => 'required',\n 'contact' => 'required'\n ]);\n\n if ($validator->fails()) {\n return response()->json([\n \"error\" => true ,\n \"statusCode\" => 3 ,\n \"message\"=> \"can't delete data\",\n \"tasks\"=> []\n ] , 203);\n }else{\n\n try{ \n \n // $uid = $request['user']->uid; \n $credentials = $validator->validated();\n \n $responseData = DB::affectingStatement('CALL delete_contacts( ? , ? )',array( $credentials['contact'], $credentials['delete']));\n\n\n if($responseData >0){\n\n return response()->json([\n \"error\"=> false,\n \"statusCode\" => 1,\n \"message\"=> $credentials['delete'] == 1 ? \"contact deleted\" : \"contact recoverd\", \n \"tasks\"=>[]\n ],201);\n }else{\n return response()->json([\n \"error\"=> false,\n \"statusCode\" => 2,\n \"message\"=> $credentials['delete'] == 1 ? \"contact already deleted\" : \"contact already recoverd\" ,\n \"tasks\"=> []\n ],203);\n }\n\n\n\n }catch(\\PDOException $ex){\n return response()->json([\n \"error\" => true ,\n \"statusCode\" => 3 ,\n \"message\"=> \"can't delete data\",\n \"tasks\"=> []\n ] , 203);\n } \n\n }\n\n }", "public function delete(Request $request)\n {\n try {\n $data = $request->all();\n $user = $request->user();\n $user->contacts->delete();\n\n return response()->json(['data' => 'Contact Deleted'], 200);\n } catch (\\Throwable $exception) {\n return response()->json(['data' => 'Error appeared', 'error' => $exception->getMessage()], $exception->getCode());\n }\n }", "public function destroy(Request $request)\n {\n $id = $request->idD;\n $nateI = NoteInformation::where(\"idNoteI\", $id);\n $nateI->delete();\n return Redirect::route('noteInformation')->with('success',\"Personnel mis à jour !\");\n\n }", "function delete(Request &$request, Response &$response);", "function deleteCustomer()\n {\n $idCustomer = $_POST['idCustomer'];\n $nameCustomer = $_POST['nameCustomer'];\n\n //get data from Model\n $model = new CustomerModel();\n $deleteCustomer = $model->deleteCustomer($idCustomer);\n\n //check Exist Customer\n if ($deleteCustomer) {\n echo json_encode([\n 'status' => MESSAGE_DELETE_SUCCESS\n ]);\n } else {\n echo json_encode([\n 'status' => MESSAGE_DELETE_FAIL\n ]);\n }\n }", "public function destroy(Request $request)\n {\n $contact = $this->contact->findOrFail($request->get('id'));\n\n DB::transaction(function () use ($contact)\n {\n $contact->delete();\n });\n\n return response()->json([\n 'Result' => 'OK'\n ]);\n }", "public function deleteAction()\n {\n $result = [\n 'type' => 'error',\n 'message' => 'Missing parameters, this functionality expects a POST variable with `user_id` key!'\n ];\n if ($this->request->hasPost('user_id')) {\n $userId = filter_var($this->request->getPost('user_id'), FILTER_SANITIZE_NUMBER_INT);\n if ($userId > 0) {\n $result = (new UserService(new Users()))->deleteUser($userId);\n }\n }\n return $this->response->setJsonContent($result);\n }", "public function deleteanswer(Request $request)\n\t{\n\t\t$ans = \\App\\Answer::destroy($request->input('id'));\n\t}", "public function DELETE() {\n #\n }", "public function destroy(Request $request, $id)\n {\n try{\n $contact = Contact::find($id);\n $contact->delete();\n } catch (\\Exception $e) {\n return response()->json($e->getMessage(), 500);\n }\n }", "public function delete($id_telefono){\n\t\t$sql = 'DELETE FROM telefonos WHERE id_telefono = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id_telefono);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function destroy(Request $request)\n {\n $validation = Validator::make(\n $request->all(),\n [\n 'rightAnswer' => 'required|integer|numeric',\n ]\n );\n $errors = $validation->errors();\n\n if($validation->fails()){\n\n $response = array(\n \"message\" => \"Failed\",\n \"errors\" => $errors,\n\n );\n return response()->json($response);\n\n }\n else{\n\n if($request->isMethod(\"delete\")){\n\n $rightAnswer = RightAnswer::find($request->rightAnswer);\n $this->authorize('delete', $rightAnswer);\n $rightAnswer->delete();\n \n $response = array(\n \"message\" => \"Deleted\",\n \"request\" => $request->all(),\n );\n \n return response()->json($response);\n\n }\n\n }\n\n }" ]
[ "0.7349547", "0.7333479", "0.71504396", "0.6941135", "0.691386", "0.6870842", "0.68227524", "0.6714072", "0.6707353", "0.6688743", "0.6680144", "0.6636263", "0.6627223", "0.6591351", "0.6562789", "0.6550173", "0.65420365", "0.64737225", "0.6461968", "0.6454821", "0.64542466", "0.6438009", "0.6435645", "0.641957", "0.6396305", "0.6396213", "0.63880634", "0.63759273", "0.62966657", "0.62893254", "0.6275528", "0.6264929", "0.6259181", "0.62589675", "0.62468016", "0.62391335", "0.6228491", "0.61789656", "0.6168497", "0.6167425", "0.6159602", "0.6157386", "0.6153695", "0.614957", "0.6138421", "0.6133449", "0.6123107", "0.6114098", "0.6111279", "0.6104264", "0.61034346", "0.61019516", "0.6100253", "0.60997516", "0.6099242", "0.6094648", "0.60943127", "0.6089754", "0.6089754", "0.60824966", "0.6066789", "0.60659885", "0.60537636", "0.6029098", "0.60284215", "0.602017", "0.60180527", "0.6015288", "0.6013554", "0.6013134", "0.6012737", "0.60121673", "0.6011419", "0.60068524", "0.6004821", "0.6002448", "0.60006946", "0.59937733", "0.59930843", "0.5992675", "0.5980476", "0.5979328", "0.5970726", "0.5967367", "0.5966045", "0.5960365", "0.59572595", "0.595649", "0.5949097", "0.59403646", "0.5938673", "0.5938452", "0.5931446", "0.5929927", "0.5920991", "0.5916581", "0.5916138", "0.5914731", "0.59130746", "0.5912732" ]
0.6133787
45
zresetovanie id, aby zacinalo cislovanie od 1
function resetId(){ global $db; $query = "ALTER TABLE parameters auto_increment = 1"; $db->exec($query); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function resetId()\n {\n\n $this->id = null;\n\n }", "public static function reset()\n {\n self::$id = 0;\n }", "public function resetId(){\r\n\t\t$this->clientId = null;\r\n\t}", "public function resetIdInformazione($conn){\n\t\t$sth = $conn->prepare(\"set @num := 0\");\n\t\t$sth->execute();\n\t\t$sth = $conn->prepare(\"update Filmato_Presentazione set id = @num := (@num+1)\");\n\t\t$sth->execute();\n\t\t$sth = $conn->prepare(\"alter table Filmato_Presentazione auto_increment = 1\");\n\t\t$sth->execute();\n\t}", "function setId($id) {\r\n\t\t// Set id and wipe data\r\n\t\t$this->_id = $id;\r\n\t}", "function unsetID( )\n {\n unset( $this->ID );\n }", "function setId($id) {\n // Set id and wipe data\n $this->_id = $id;\n //die($id);\n $this->_data = null;\n }", "function resetIDs(){\n resetId(\"data\");\n resetId(\"place\");\n}", "public function reset()\n\t{\n\t\tparent::reset();\n\n\t\t// Reset the primary key\n\t\t$this->id = null;\n\t}", "public function reset()\n\t{\n\t\tparent::reset();\n\n\t\t// Reset the primary key\n\t\t$this->id = null;\n\t}", "function setId($id)\n\t{\n\t\t// Set id and wipe data\n\t\t$this->_id\t\t= $id;\n\t\t//$this->_data\t= null;\n\t}", "public function setId()\n\t{\n\t}", "function setId($id) {\r\n // Set id and wipe data\r\n $this->_id = $id;\r\n $this->_data = null;\r\n }", "public function nullId()\n {\n $this->id = null;\n }", "static public function setId($id){\n \tif (self::$_id != $id){\n \t\tself::$_id = $id;\n \t\tself::regenerate();\n \t}\n }", "public function reset()\n {\n $this->values[self::_ID] = array();\n }", "public function rechercherId($id)\n {\n }", "function SetId($value) { $this->id=$value; }", "public function updateId() {\n $this->Id = session_id();\n }", "function setId($id)\n\t{\n\t\t// Set id and wipe data\n\t\t$this->_id\t\t= $id;\n\t\t$this->_data\t= null;\n\t}", "private function resetInsertID() {\n $this->setInsertID(0);\n }", "function setId($id){\r\n\t\t$this->id = $id;\r\n\t}", "function setId($id){\n\t\t$this->id = $id;\n\t}", "function _set_id( $idGrupo ){\n \t\t$this->idGrupo = $idGrupo;\n }", "function setId($id) {\r\n $this->_id = $id;\r\n }", "function set_id($id) {\n\t\t$this->id = $id;\n\t}", "public function reset($id) {\r\r\n global $wpdb;\r\r\n $this->refresh = true;\r\r\n $id = $id + 0;\r\r\n\r\r\n $query = \"UPDATE \" . wd_asp()->db->table('main') . \"\r\r\n SET\r\r\n data='\" . wd_mysql_escape_mimic(json_encode(wd_asp()->options['asp_defaults'])) . \"'\r\r\n WHERE id=\" . $id;\r\r\n $wpdb->query($query);\r\r\n }", "function setID(){\n // $result = mysqli_query($connecttable,$sql); \n //result\n mysqli_query($connect,\"delete FROM book\") ; \n \n // $row = mysqli_fetch_assoc($maxid);\n // return ($maxid + 1);\n }", "public function setId($id){ $this->id=$id;}", "public function setId($id)\n {\n $this->_id = (int) $id;\n }", "public function setId($id)\n {\n $id = (int) $id;\n \n if ($id > 0)\n {\n $this->_id = $id;\n }\n }", "private function resetParams()\n {\n $this->id = null;\n }", "function setId($id) {\n\t\t$this->_id = $id;\n\t}", "public function set_id( $id ) {\n\t\t$this->id = absint( $id );\n\t}", "function setId($id)\r\n {\r\n $this->_id = $id;\r\n $this->_data = null;\r\n }", "public function setId($id)\n {\n $this->_id = (int) $id;\n }", "public function setId($x) { $this->id = $x; }", "public function removeId()\n {\n $this->id=null;\n return $this;\n }", "public function lastId($id)\n {\n $this->id = $id ;\n }", "public function setId($_id);", "public function setId(int $id)\n {\n }", "public function reset($id = null) {\n\t\t\tif (!isset($_SESSION)) {\n\t\t\t\tsession_start();\n\t\t\t}\n\t\t\tsession_reset();\n\t\t\tif ($id == null) {\n\t\t\t\t$id = session_id();\n\t\t\t}\n\t\t\t$this->set(\"id\", session_id($id));\n\t\t}", "function setId2($id)\n\t{\n\t\t// Set id and wipe data\n\t\t$this->_id2\t\t= $id2;\n\t\t//$this->_data\t= null;\n\t}", "public function reset()\n\t{\n\t\t$this->_id \t\t= '';\n\t\t$this->_label\t= '';\n\t}", "public function setId($id)\r\n {\r\n $this->_id = (int) $id;\r\n }", "public function clear()\n\t{\n\t\t$this->makeId();\n\t}", "public function setId($id){\n $this->_id = $id;\n }", "function set_id($id)\n {\n $this->id = $id;\n }", "function setId($value) {\n $this->_id = intval($value);\n }", "public function reset_rezultati()\n {\n $query = $this->query(\"SELECT * FROM rezultati;\");\n foreach ($query->getResultArray() as $row)\n {\n $this->delete($row['idrezultati']);\n }\n }", "public function renetid(){\n\n global $conn;\n\n $request_renet = \"ALTER TABLE langue AUTO_INCREMENT = 1\";\n $request_delete = \"DELETE FROM `langue`\"; \n\n $conn->query($request_delete);\n $conn->query($request_renet);\n\n }", "public function setId($id) ;", "public function setId($id)\n {\n # on parse la valeur de l'id en INT\n $this->_id = $id;\n // On vérifie que l id superieur à zéro\n if ($id > 0)\n {\n $this->_id = $id;\n }\n }", "private function set_id(int $id)\n {\n $this->_id = $id;\n }", "private function setID($id) {\r\n\t\t$this->id = $id;\r\n\t}", "public function set_id($id) {\n $this->_newid = preg_replace(\"/[^a-zA-Z0-9]/\", '', $id);\n }", "public function regenerateId(): self;", "function resetId($tableName){\n global $db;\n $query = \"ALTER TABLE {$tableName} auto_increment = 1\";\n $db->exec($query);\n}", "function setId($id)\n\t{\n\t\t// Set state ID and wipe data\n\t\t$this->_id\t\t\t= $id;\n\t\t$this->_state\t\t= null;\n\t\t$this->_suburbs\t\t= null;\n\t}", "public function set_id($id){\n $this->id = $id;\n }", "public function setId($id)\n {\n// // Si c'en était déjà un, rien ne changera.\n// // Sinon, la conversion donnera le nombre 0 (à quelques exceptions près, mais rien d'important ici).\n// $id = (int)$id;\n//\n// // On vérifie ensuite si ce nombre est bien strictement positif.\n// if ($id > 0) {\n// // Si c'est le cas, c'est tout bon, on assigne la valeur à l'attribut correspondant.\n// $this->_id = $id;\n// }\n }", "public function setId($id)\n {\n $this->_id = (int)$id;\n }", "public function setId(int $id)\n {\n $this->id = md5($id);\n }", "public function setId($id)\n\t{\n\t\t$this->id = (int) $id;\n\t}", "function resetHits($id)\r\n\t{\r\n\t\t$row =& $this->getTable('flexicontent_items', '');\r\n\t\t$row->load($id);\r\n\t\t$row->hits = 0;\r\n\t\t$row->store();\r\n\t\t$row->checkin();\r\n\t\treturn $row->id;\r\n\t}", "function setId($id) {\r\n\t\t// Set item id and wipe data\r\n\t\t$this->_id\t = $id;\r\n\t\t$this->_item\t\t= null;\r\n\t}", "public function setId(int $id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n\n \n }", "function getNewId();", "public function destroy($id)\n {\n $orden=Orden::find($id)->update(['status'=>0]);\n return 1;\n }", "public function setId($id) { $this->id = $id; }", "function setId($value){\n\t\t//echo \"setting ID to \".$value;\n\t\t$this->_id=$value;\n\t\t//echo \"ID set to \".$this->_id;\n\t\treturn $this;\n\t}", "public function regenerateId();", "public function regenerateId();", "function setId($id) {\n $this->id = $id;\n }", "function setId($id) {\n $this->id = $id;\n }", "public function setId($id) {\n\t\t$this->id = (integer)$id;\n\t}", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id){\n $this->id = $id;\n }", "public static function reset($id)\n {\n return self::action($id, 'reset');\n }", "public function setId($id){\n\t\tself::$_id[get_class($this)] = $id;\n\t}", "public function setId($id){\n $this->id=$id;\n }", "public function setId($var){\n\t\t$this->id=$var;\n\t}", "public function setId($id){\n\t\t$this->id = $id;\n\t}", "public function setId($id){\n\t\t\t\t$this->id=$id;\n\t\t\t}", "function setId($id)\n\t{\n\t\t// Set id\n\t\t$this->_id\t = $id;\n\t}", "function setId($id)\n {\n $this->id = $id;\n }", "function set_id( $id ){\n\t\t$this->id = $id;\n\t\t// this is add request. so number is 0\n\t\tif( $this->id == $this->id_base ){\n\t\t\t$this->number = 0;\n\t\t\t$this->is_new = true;\n\t\t}\n\t\t// parse number\n\t\telse{\n\t\t\t$this->number = str_replace($this->id_base.'-', '', $this->id);\n\n\t\t\t// load instance data\n\t\t\t$this->instance = jcf_field_settings_get( $this->id );\n\t\t\tif( !empty($this->instance) ){\n\t\t\t\t$this->slug = $this->instance['slug'];\n\t\t\t}\n\t\t}\n\t}", "public function setId($id)\n\t\t{\n\t\t\t$id = (int)$id;\n\t\t\t$this->_id = $id;\n\t\t}", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id){\t\r\n\t\t$this->_id = (int) $id;\r\n\t\treturn $this;\r\n\t}", "function get_id($id){\n\t\t$this->id = $id;\n\t}", "public function setID($_id) \n \t{\n \t\t$this->_id = $_id;\n \t}", "public function setID($id);", "public function setId_recette($id) {\n\n\t\t$id = (int) $id;\n\n \tif ($id>0) {\n\n \t\t$this->_id_recette = $id;\n\n \t}\n\n\t}", "public function datumDeleteFromId($id){\n $sql = \"select persnr,datum from dzeitsoll where id='$id'\";\n $res = $this->db->query($sql);\n $rows = $res->fetchAll();\n $row = $rows[0];\n $datum = $row['datum'];\n $persnr = $row['persnr'];\n // zjistim kolik takovych datumu pro daneho cloveka jeste mam\n $sql = \"select count(datum) as pocetdatumu from dzeitsoll where persnr='$persnr' and datum='$datum'\";\n $res = $this->db->query($sql);\n $pocetDatumu = $res->fetchSingle();\n if($pocetDatumu>1){\n // muzu dane id smazat\n $this->db->query(\"delete from dzeitsoll where id='$id' limit 1\");\n }\n else{\n // nebudu mazat ale nastavim stunden = 0, oe = -\n $sql = \"update dzeitsoll set stunden=0,oe='-' where id='$id'\";\n $this->db->query($sql);\n }\n }", "public function setId($id)\n {\n $this->id = $id ? $id : uniqid();\n }", "function setId($id)\n {\n $this->_id = $id;\n $this->_extension = null;\n }", "public function setId(string $id)\n\t{\n\t\t$this->id=$id; \n\t\t$this->keyModified['id'] = 1; \n\n\t}" ]
[ "0.8087279", "0.7703068", "0.72953516", "0.7042622", "0.69425", "0.6939763", "0.69217104", "0.69184357", "0.685537", "0.685537", "0.6783717", "0.6764147", "0.67019737", "0.6686583", "0.66456586", "0.6637565", "0.6626384", "0.65857273", "0.65784", "0.6573316", "0.6549753", "0.6531461", "0.649987", "0.64985114", "0.64982855", "0.6473769", "0.64618087", "0.64398706", "0.6439575", "0.6413996", "0.64130324", "0.6408449", "0.6400788", "0.6392339", "0.6391066", "0.6389291", "0.6387345", "0.6383248", "0.63807887", "0.63773346", "0.6374666", "0.6370228", "0.6365936", "0.63605124", "0.63578534", "0.63497365", "0.6345622", "0.63377917", "0.6330529", "0.6330333", "0.63228595", "0.6319104", "0.6305597", "0.62843835", "0.62757987", "0.62684137", "0.6265401", "0.62334174", "0.6226428", "0.62247616", "0.622352", "0.6221516", "0.62198263", "0.62189716", "0.6218113", "0.6214258", "0.6211283", "0.6210728", "0.6209698", "0.62086064", "0.6205944", "0.6200903", "0.6200165", "0.6200165", "0.61919284", "0.61919284", "0.6190363", "0.6187397", "0.6187397", "0.6187397", "0.6185029", "0.6171763", "0.61713284", "0.6168788", "0.616803", "0.616447", "0.6164181", "0.616138", "0.6149845", "0.61464703", "0.61418706", "0.6135689", "0.6132211", "0.6128528", "0.61256593", "0.6119942", "0.6119618", "0.61179453", "0.61171275", "0.61163217" ]
0.67118615
12
1 detalle muchos articulos
public function articulo(){ return $this->belongsTo('App\Models\Articulo'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function afficheArticle ($infosArticles) {\n\n foreach ($infosArticles as $key => $articles ) {\n\n if ($key === 0 or $key === 3) {\n $positionArticle = \"left\";\n }\n\n if ($key === 1 or $key === 4) {\n $positionArticle = \"center\";\n }\n\n if ($key === 2 or $key === 5) {\n $positionArticle = \"right\";\n }\n\n echo \"<div class='bloc_$positionArticle'>\";\n echo \"<div class='page_$positionArticle'>\";\n echo \"<div class='image_section_centrale'><img src=$articles[0] alt =$articles[1]></div>\";\n echo \"<div class='article_$positionArticle'>\";\n echo \"<h1 class='title_$positionArticle'>$articles[2]</h1>\";\n echo \"<p> $articles[3]<br> <a href=$articles[3]>$articles[4]</a></p>\";\n echo \"</div></div>\";\n echo \"<img src='../Images/logo_commitTree.png' class='logo_$positionArticle' alt='logo commit tree'>\";\n echo \"</div>\";\n\n }\n}", "public function articulo()\n\t{\t\n\t\t$article = $this->uri->segment(3,'42');\n\n\t\t$columnas = array('title','image','content','counter','create_date');\n\n\t\t$articulo['modal'] = $this->dbsitio->getRow('article',$columnas,'id_article = \\'' . $article . '\\'');\n\n\n\n\t\tif (empty($articulo['modal'])){\n\n\t\t\t$datos['0'] = array('title'=>'Artículo No encontrado!',\n\t\t\t\t'image' => 'img/sitio/delete.png',\n\t\t\t\t'content' => 'El artículo que busca no existe!.',\n\t\t\t\t'counter'=>rand(123,9876),\n\t\t\t\t'create_date' => '1987-07-01 12:00:00');\n\t\t\t$articulo['modal'] = $datos;\t \t\t\n\t\t}\n\t\t$string = $this->load->view('modal',$articulo,TRUE);\n\t\t$this->rating($article,$articulo);\n\t\tprint $string; \n\n\t}", "public function getDetalle();", "function showArticle($what)\n{\n\t$lim = 120;\n\tif(strlen($what[\"description\"])>$lim){\n\t\t$toto= \"\";\n\t\tfor($i=0;$i<$lim-1;$i++){\n\t\t\t$toto[$i]=$what[\"description\"][$i];\n\t\t}\n\t\t$toto[$lim]='.';\n $toto[$lim+1]='.';\n\t\t$toto[$lim+2]='.';\n\t\t$what[\"description\"]=$toto;\n\t}\necho \"<div id='articles'>\";\necho \"\t<table class='articleUniqueTab'>\n\n\t\t <tr>\n\t\t <td rowspan='2'><a href='singleArticle.php?ID=\" . $what['ID'] . \"'><img src='\".$what[\"photo\"].\"'width='100' height='100' style='float : left'/></a></td>\n\t\t <th class='articleDetail'><a href='singleArticle.php?ID=\" . $what['ID'] . \"' >\".$what[\"nom\"].\"</a></th>\n\t\t <td class='articleDetail'>prix : \".$what[\"prix\"].\"€</td>\n\t\t <td class='articleDetail'>note :\".$what[\"note\"].\"/5</td>\n\t\t <td class='articleDetail'>Quantité restante : \".$what['quantite'].\"</td>\n\t\t </tr>\n\n\t\t <tr>\n\t\t \t<td colspan='4'>\".$what[\"description\"].\"</td>\n\t\t </tr>\n\t\t</table> \";\necho \"</div>\";\n}", "function showSingleArticle($what){\n\n//remplir un tableau des variation ayant le artice_id=$what['ID']\n\t$variations = getVariationFctType($what['ID']);\n\t$taille = 5;\n\t$photoArticle=explode(\";\", $what['photo']);\n\t$imge=$photoArticle[0];\n\t$video = $what[\"video\"];\n\n/*\necho \"\t<table class='articleUniqueTab'>\n\t\t <tr>\n\t\t <td rowspan='\".$taille.\"'>\";\n\t\t\tminiatureImage($what);\n\t\t\techo\"</td>\n\t\t <td class='singleImage' rowspan='\".$taille.\"' >\n\t\t \t<img id='imagePrincipale' width='300' height='300' style='display: block' src='\".$imge.\"' />\n\t\t\t\t<iframe id='articleVideo' width='300' height='300' style='display: none' src='https://www.youtube.com/embed/\".$video.\"'></iframe>\n\t\t \t\n\t\t </td>\n\t\t <th class='singleArticle'>\".$what[\"nom\"].\"</th>\n\t\t <td rowspan='\".$taille.\"'> \n\t\t \t<table>\";\n\t\t \t\trepeatVariation($variations);\n\t\t echo\"</table>\n\t\t </td>\t\t\n\t\t </tr>\n\t\t <tr>\n\t\t \t<td class='singleArticle'>Quantité restante : \" . $what['quantite'].\"</td>\";\n\t\t \techo \"\n\t\t </tr>\n\t\t <tr>\n\t\t \t<td class='singleArticle'>prix :\" . $what[\"prix\"] . \"€</td>\n\t\t \t\t\t </tr>\n\t\t <tr>\n\t\t \t<td class='singleArticle'>\".$what[\"note\"].\"/5</td>\n\t\t </tr>\n\t\t <tr>\n\t\t \t<td class='singleArticle'>\".$what[\"description\"].\"</td>\n\t\t </tr>\t\t \n\t\t</table> \";\n\necho \"<table>\n\t\t<tr>\n\t\t\t<td>(Il reste \".$what[\"quantite\"].\" artticle(s))<br>Je commande : \";\n\t\t\taddToShopcartForm($what);\n\t\t\techo \"<td/>\n\t\t\t<td rowspan='2' style=' padding-left: 10%;\n width: 50%;'>mettez votre note sur 5<td/>\n\t\t</tr>\n\t </table>\";\n\n\necho \"<br><br><br>\";\n\necho \"</div>\";*/\n \n \n echo \"<div class='sarticle'>\n <table class='tab'>\n <tr>\n <td class='td1' rowspan='\".$taille.\"'>\"; miniatureImage($what); echo\"</td>\n <td class='td2' rowspan='\".$taille.\"'>\n\t\t\t\t<img id='imagePrincipale' src='\".$imge.\"' class='primg' style='margin:auto; margin-right:100%; margin-left:13%;'/>\n\t\t\t\t<iframe id='articleVideo' width='300' height='300' style='display: none' src='https://www.youtube.com/embed/\".$video.\"'></iframe>\n\t\t\t</td>\n <td class='td3 art_name'>\".$what[\"nom\"].\"</td>\n <td class='td4' rowspan='\".$taille.\"'>\";\n //Changer la quantite de prod\n if(!empty($_SESSION['username']) && $what['vendeur_username']==$_SESSION['username'])\n {\n echo\"<table class='int_table'>\n <td>\n Changer la quantité de produit : <br> \n <input class='field' type='number' name='prod_num_to_change' value='0'/>\n <input class='sarticle_btn' type='submit' name='add_quantity' value='Changer la quantité'/>\n </td>\n </table>\";\n }\n echo\"\n <table class='int_table'>\";repeatVariation($variations); echo \"</table><br><br>\n <table class='int_table'>\n <td>\n Il reste \".$what[\"quantite\"].\" artticle(s)<br>\n Je commande :\";\n\n addToShopcartForm($what);\n\n echo\"<td/>\n </table>\n </td>\n </tr>\n <tr>\n <td class='art_quant'>Quantité restante : \" . $what['quantite'].\"</td>\n </tr>\n <tr>\n <td class='art_price'>Prix : \" . $what[\"prix\"] . \"€</td>\n </tr>\n <tr>\n <td class='art_rate'>Note : \".$what[\"note\"].\"/5</td>\n </tr>\n <tr>\n <td class='art_desc'>\".$what[\"description\"].\"</td>\n </tr>\n <tr>\n <td colspan='\".$taille.\"'><a href='seller.php?user=\".$what['vendeur_username'].\" '><button>Page du vendeur</button></a></td>\n </tr>\n </table>\n</div>\";\n \n \n}", "function ler($nome) {\n $x = 1;\n\t while($x < $this->bd[0][0] && !$this->str_igual($nome, $this->bd[$x][2])) {$x++;}\n if($x >= $this->bd[0][0]) {return 0;}\n //comecando a setar tudo\n $this->id = $this->bd[$x][0];\n $this->maximo = $this->bd[$x][1];\n $this->nome = $this->bd[$x][2];\n $this->categoria = $this->bd[$x][3];\n $this->tipo = $this->bd[$x][4];\n $this->atributo = $this->bd[$x][5];\n $this->specie = $this->bd[$x][6];\n $this->lv = $this->bd[$x][7];\n $this->atk = $this->bd[$x][8];\n $this->def = $this->bd[$x][9];\n $this->preco = $this->bd[$x][10];\n $this->descricao = $this->bd[$x][11];\n $this->img = '../imgs/cards/'.$this->id.'.png';\nreturn 1;\n }", "function modelo_inmueble2($r)\n{\n for ($i = 0; $i < count($r); $i++) {\n $imagen = existeImagen(($r[$i]['foto1']));\n $codigo = str_ireplace(\"108-\", \"\", $r[$i]['Codigo_Inmueble']);\n $api = $r[$i];\n $descripcion = $api['descripcionlarga'];\n $limite_de_cadena = 90;\n // recortar cadena\n if (strlen($descripcion) >= $limite_de_cadena) {\n $descripcion = substr($descripcion, 0, $limite_de_cadena) . '...';\n } else {\n $descripcion = $descripcion . '<br>...';\n }\n echo '\n <div class=\"property-block col-12 col-sm-6 col-lg-4 col-xl-4\">\n <div class=\"inner-box\">\n <div class=\"image\">\n <a href=\"detalle-inmueble.php?co=' . $codigo . '\"><img src=\"' . $imagen . '\" alt=\"\"></a>\n <div class=\"sale\">' . $api['Gestion'] . ' </div>\n <div class=\"price\">$';\n if ($api['Gestion'] == 'Arriendo') {\n echo $api['Canon'];\n } else if ($api['Gestion'] == 'Venta') {\n echo $api['Venta'];\n } else {\n echo $api['Canon'] . '/ $' . $api['Venta'];\n }\n echo ' </div>\n </div>\n <div class=\"lower-content\">\n <div class=\"upper-box\" style=\"min-height: 9.3rem;\">\n <h3><a href=\"images/no_image.png\">' . $api['Tipo_Inmueble'] . '</a></h3>\n <div class=\"location\"><span class=\"icon flaticon-location-pin\"></span> ' . $api['Barrio'] . ', ' . $api['Ciudad'] . '</div>\n <div class=\"text-justify\">' . $descripcion . '</div>\n </div>\n <div class=\"lower-box clearfix\">\n <ul class=\"row justify-content-center\">\n <li class=\"col-auto\"><span class=\"icon flaticon-squares\"></span>' . $api['AreaConstruida'] . 'm<sup>2</li>\n <li class=\"col-auto\"><span class=\"icon flaticon-bed-1\"></span>' . $api['Alcobas'] . '</li>\n <li class=\"col-auto\"><span class=\"icon flaticon-bathtube-with-shower\"></span>' . $api['banios'] . '</li>\n <li class=\"col-auto\"><span class=\"icon flaticon-garage\"></span>' . $api['garaje'] . '</li>\n <li class=\"col-auto\">Codigo: ' . $codigo . '</li>\n </ul>\n </div>\n </div>\n </div>\n</div>\n ';\n }\n}", "function artista($idArtista){\n\n \t$sql = 'SELECT * FROM musica WHERE id ='.$idArtista;\n\t$resultado = mysql_query($sql);\n\n\twhile($row = mysql_fetch_array($resultado)){\n\t\tshowArtista($row);\n \t}\n}", "function modelo_inmueble($r, $cantidad_inmuebles)\n{\n for ($i = 0; $i < $cantidad_inmuebles; $i++) {\n $imagen = existeImagen(($r[$i]['foto1']));\n $codigo = str_ireplace(\"108-\", \"\", $r[$i]['Codigo_Inmueble']);\n $api = $r[$i];\n $descripcion = $api['descripcionlarga'];\n $limite_de_cadena = 90;\n // recortar cadena\n if (strlen($descripcion) >= $limite_de_cadena) {\n $descripcion = substr($descripcion, 0, $limite_de_cadena) . '...';\n } else {\n $descripcion = $descripcion . '...';\n }\n echo '\n <div class=\"property-block col-12 col-sm-6 col-lg-4 col-xl-4\">\n <div class=\"inner-box\">\n <div class=\"image\">\n <a href=\"detalle-inmueble.php?co=' . $codigo . '\"><img src=\"' . $imagen . '\" alt=\"\"></a>\n <div class=\"sale\">' . $api['Gestion'] . '</div>\n <div class=\"price\">';\n if ($api['Gestion'] == 'Arriendo/venta') {\n echo '$' . $api['Canon'] . ' <br>$' . $api['Venta'];\n } else if ($api['Gestion'] == 'Arriendo') {\n echo '$' . $api['Canon'];\n } else {\n echo '$' . $api['Venta'];\n }\n echo ' </div>\n </div>\n <div class=\"lower-content\">\n <div class=\"upper-box\" style=\"min-height: 9.3rem;\">\n <h3><a href=\"images/no_image.png\">' . $api['Tipo_Inmueble'] . '</a></h3>\n <div class=\"location\"><span class=\"icon flaticon-location-pin\"></span> ' . $api['Barrio'] . ', ' . $api['Ciudad'] . '</div>\n <div class=\"text-justify\">' . $descripcion . '</div>\n </div>\n <div class=\"lower-box clearfix\">\n <ul class=\"row justify-content-center\">\n <li class=\"col-auto\"><span class=\"icon flaticon-squares\"></span>' . $api['AreaConstruida'] . 'm<sup>2</sup></li>\n <li class=\"col-auto\"><span class=\"icon flaticon-bed-1\"></span>' . $api['Alcobas'] . '</li>\n <li class=\"col-auto\"><span class=\"icon flaticon-bathtube-with-shower\"></span>' . $api['banios'] . '</li>\n <li class=\"col-auto\"><span class=\"icon flaticon-garage\"></span>' . $api['garaje'] . '</li>\n <li class=\"col-auto\">Codigo: ' . $codigo . '</li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n\n ';\n }\n}", "function eml_aff_contenu() {\n \n $bd = em_bd_connecter();\n \n echo '<main>';\n \n // génération des 3 derniers articles publiés\n $sql0 = 'SELECT arID, arTitre FROM article \n ORDER BY arDatePublication DESC \n LIMIT 0, 3';\n $tab0 = eml_bd_select_articles($bd, $sql0);\n eml_aff_vignettes('&Agrave; la Une', $tab0);\n \n // génération des 3 articles les plus commentés\n $sql1 = 'SELECT arID, arTitre \n FROM article\n LEFT OUTER JOIN commentaire ON coArticle = arID \n GROUP BY arID \n ORDER BY COUNT(coArticle) DESC, rand() \n LIMIT 0, 3';\n $tab1 = eml_bd_select_articles($bd, $sql1);\n eml_aff_vignettes('L\\'info brûlante', $tab1);\n \n // génération des 3 articles parmi les articles restants \n $sql2 = 'SELECT arID, arTitre FROM article\n WHERE arID NOT IN (' . join(',',array_keys($tab0)) . ',' . join(',',array_keys($tab1)) . ') \n ORDER BY rand() LIMIT 0, 3';\n $tab2 = eml_bd_select_articles($bd, $sql2);\n eml_aff_vignettes('Les incontournables', $tab2);\n \n // affichage de l'horoscope \n eml_aff_horoscope();\n \n mysqli_close($bd);\n \n echo '</main>';\n \n}", "public function run()\n {\n $articles = [\n [\n 'title' => 'Utveckla konsten',\n 'body' => 'Intresset för att utveckla den offentliga konsten är stort. Spännande arbete pågår i stadsutvecklingsprocesser där kommunala, statliga och privata aktörer renoverar och bygger nya områden. Samtidigt arbetar många konstnärer med att omformulera vad den offentliga konsten kan vara. När vi på Statens konstråd producerar konst i gemensamma miljöer utvecklar vi löpande arbetet med konst och gestaltning. I våra pilotprojekt prövar vi nya metoder och olika sätt att arbeta. Projekten utgår oftast från en specifik situation och kan involvera allt från konst i planering, till sociala relationer eller visuella uttryck. Avgörande för utvecklingen är att olika aktörer kan inspirera varandra. Här vill vi därför dela med oss av våra erfarenheter och kunskaper för att stärka konstens roll i utformningen av våra gemensamma miljöer.',\n 'author' => 'Simon',\n 'media' => 'image.jpg'\n\n ],\n [\n 'title' => 'Tillfällig konst',\n 'body' => 'Konstnärer söker sig idag ofta till aktuella frågor om det gemensamma och om våra offentliga rum. Genom tillfälliga projekt får vi möjlighet att friare utforska olika format och samtidigt reflektera kring aktuella frågor. Vi utgår från dialogen mellan konstnär och curator och från den situation där verket tar form. Samtidigt fångar vi upp den utveckling som sker inom offentlig konst, både i Sverige och internationellt.',\n 'author' => 'Simon',\n 'media' => 'image.jpg'\n ],\n [\n 'title' => 'Hur går det till?',\n 'body' => 'Konstnären presenterar ett förslag på gestaltning efter att ha gjort en närmare undersökning av hela situationen, eller så utgår konstnären från en idé som sedan påverkar valet av plats. Alla delar i verket diskuteras med curatorn eller initiativtagaren till projektet. I arbetet med att ta fram en film kan processen till exempel ske i samarbete med boende på platsen. Konstnären tar del av deras berättelser om en situation eller hur de upplever platsen och skriver sedan ett filmmanus utifrån samtalen. Konstnären ansvarar för filminspelningen men utbyter idéer med deltagarna även under klipparbetet. Verket blir i det här fallet relevant genom att ge de boende en röst, en möjlighet att bli hörda.',\n 'author' => 'Simon',\n 'media' => 'image.jpg'\n ],\n [\n 'title' => 'Stadsutveckling',\n 'body' => 'Vad skapar en stad och dess miljöer? Vi utvecklar metoder för gestaltning av gemensamma miljöer genom samverkan mellan konstnärer, arkitekter, civilsamhälle, kommun och invånare. Genom att samla olika kompetenser kan vi arbeta för miljöer som både möter behov och väcker engagemang och känslor. Våra projekt där konstnärer medverkar i stadsutveckling omfattar allt från processer för medskapande och rätt till de offentliga rummen, till infrastruktur, stadsplanering och gestaltning.',\n 'author' => 'Simon',\n 'media' => 'image.jpg'\n ],\n [\n 'title' => 'Permanent konst',\n 'body' => 'Skulptur, rörlig bild, ljudverk och hela fasader… Vi producerar konst för nya och renoverade byggnader och miljöer i statlig verksamhet med utgångspunkten att konsten ska vara kvar, vara permanent. Den konstnärliga gestaltningen relaterar alltid till den specifika situationen eller verksamheten på platsen. Vi arbetar också med pilotprojekt där konstnärer kommer in tidigt i byggprocesser och därmed kan påverka hela miljöer.',\n 'author' => 'Simon',\n 'media' => 'image.jpg'\n ],\n [\n 'title' => 'Kunskapsnav offentlig konst',\n 'body' => 'Nu bygger vi upp ett kunskapsnav för offentlig konst. Målet med kunskapsnavet är att du ska kunna hitta konkret information i olika frågor som rör allt från hur man startar ett konstprojekt till hur man förverkligar det och hur man förvaltar det. Navet ska inspirera och stärka utvecklingen av offentlig konst i hela Sverige. Dessutom ska det hålla samtalet om den offentliga konstens roll i samhället levande. Det kommer att lyfta fram viktig kunskap som redan finns på olika håll i landet och ta fram ny kunskap som saknas. Kunskapsnav offentlig konst blir en samlande plattform för möten, erfarenheter och information. Här öppnas möjligheten att både få och ge kunskaper inom många olika områden och yrkesroller.',\n 'author' => 'Simon',\n 'media' => 'image.jpg'\n ]\n\n ];\n\n foreach($articles as $article){\n Article::create($article);\n }\n }", "function afficher_derniers_articles(){\n\t\tglobal $logger;\n\t\tif($logger){// si connecté, affiche article public et privé\n\t\t\t$requete = 'SELECT * FROM articles ORDER BY date DESC';\n\t\t}else{// sinon que public\n\t\t\t$requete = 'SELECT * FROM articles WHERE statut=\"0\" ORDER BY date DESC';\n\t\t}\n\t\t$donnees = connexion( $requete);\n\t\t$res = \"\";\n\t\t\n\t\tif(mysql_num_rows($donnees) < 1){\n\t\t\treturn \"<div>Aucun article récent trouvé</div>\";\n\t\t}else{\n\t\t\tfor($i =1; $i <= 4; $i++){\n\t\t\t\tif($ligne = mysql_fetch_assoc($donnees)){\n\t\t\t\t\t$res .= \"<article>\n\t\t\t\t\t\t\t\t<a href='index.php?where=article&amp;id={$ligne['id']}'><header>{$ligne['titre']}</header></a>\n\t\t\t\t\t\t\t\t<div class='article_auteur'>\n\t\t\t\t\t\t\t\t\t<img src='ressources/auteur.png' title='Auteur' alt='Auteur'>\n\t\t\t\t\t\t\t\t\tAuteur: <a href='index.php?where=profil&amp;id={$ligne['auteur']}'>\";\n\t\t\t\t\t$res .= \t\tnom_auteur($ligne[\"auteur\"]);\t\n\t\t\t\t\t$res .= \t'</a></div>\n\t\t\t\t\t\t\t<div class=\"article_date\">Le '.conversion_date($ligne['date']).'</div>\n\t\t\t\t\t\t\t<p>'.taille_description($ligne['text'], $ligne['id']).'</p>';\n\t\t\t\t\t$res .= \tarticle_statut($ligne['statut']);\n\t\t\t\t\t$res .= \"</article>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}", "function logo ()\n {\n global $connection;\n $sql = \"SELECT * FROM slike_logo sl ORDER BY sl.putanja_logo DESC LIMIT 0,1\";\n $sum = $connection->query($sql)->fetchAll();\n foreach($sum as $item) :\n echo \"<a href='index.php?page=pocetna'><img src=$item->putanja_logo alt=$item->ime_slike title='NanoSoft DeLux' width='177' height='106'/></a>\";\n endforeach;\n }", "function mes_articles(){\n\t\tglobal $infos_id;\n\t\t$requete = \"SELECT titre, id FROM articles WHERE auteur='{$infos_id['id']}'\";\n\t\t$donnees = connexion($requete);\n\t\tif(mysql_num_rows($donnees) >= 1){\n\t\t\t$res = '<ul>';\n\t\t\twhile($ligne = mysql_fetch_assoc($donnees)){\n\t\t\t$res .= \t\"<li>\".\n\t\t\t\t\t\t\t\"<a href='index.php?where=article&amp;id={$ligne['id']}'>\".$ligne['titre'].\"</a>\n\t\t\t\t\t\t</li>\";\n\t\t\t}\n\t\t\t$res .= \"</ul>\";\n\t\t\treturn $res;\n\t\t}else{\n\t\t\treturn \"<div>{$infos_id['prenom']} {$infos_id['nom']} a rédigé aucun article</div>\";\n\t\t}\n\t}", "function matricularVehiculo(){\r\n $matricula _aleatoria = rand();\r\n\r\n $encontrado = false;\r\n for ($i=0; $i< count ($this->vehiculos) && ($encontrado==false); $i++) {\r\n if ($this->vehiculos[$i] != null) {\r\n if($this->vehiculos[$i]->getMatricula() =='') {}\r\n $this->vehiculos[$i]->getMatricula($matricula_aleatoria);\r\n $encontrado = true;\r\n $pos = $i;\r\n }\r\n }\r\n }", "public function getAnchoPaneles()\r\n\t{\r\n\t\t$getPisosAletaVen = $this->getPisosAletaVen();\r\n\t\t$getPisosAletaAdicional7 = $this->getPisosAletaAdicional7();\r\n\t\t$getPisosAletaFlu = $this->getPisosAletaFlu();\r\n\t\t$getCantidadChapaIntermedia = $this->getCantidadChapaIntermedia();\r\n\t\t$getCantidadChapaPiso = $this->getCantidadChapaPiso();\r\n\t\t$getCantidadChapaAdicional = $this->getCantidadChapaAdicional();\r\n\t\t\r\n\t\t\t\t$anchoP1 = $getPisosAletaVen['pisosAletaVenP1'] * $this->getEspesorAletaVen() + $getPisosAletaAdicional7['pisosP1Aleta7'] * $this->espesorAire7Flu + \r\n\t\t\t\t$getPisosAletaFlu['pisosP1AletaFlu'] * $this->getEspesorAletaFlu() + $getCantidadChapaIntermedia['cantidadP1ChapaIntermedia'] * $this->getEspesorChapaIntermedia() +\r\n\t\t\t\t$getCantidadChapaPiso['cantP1Piso'] * $this->getEspesorChapaPiso() + $getCantidadChapaAdicional['cantP1PisoAd'] * $this->getEspesorChapaAdicional();\r\n\t\t\t\t\r\n\t\t\t\t$anchoP2 = $getPisosAletaVen['pisosAletaVenP2'] * $this->getEspesorAletaVen() + $getPisosAletaAdicional7['pisosP2Aleta7'] * $this->espesorAire7Flu + \r\n\t\t\t\t$getPisosAletaFlu['pisosP2AletaFlu'] * $this->getEspesorAletaFlu() + $getCantidadChapaIntermedia['cantidadP2ChapaIntermedia'] * $this->getEspesorChapaIntermedia() +\r\n\t\t\t\t$getCantidadChapaPiso['cantP2Piso'] * $this->getEspesorChapaPiso() + $getCantidadChapaAdicional['cantP2PisoAd'] * $this->getEspesorChapaAdicional();\r\n\t\t\t\t\r\n\t\t\t\t$anchoP3 = $getPisosAletaVen['pisosAletaVenP3'] * $this->getEspesorAletaVen() + $getPisosAletaAdicional7['pisosP3Aleta7'] * $this->espesorAire7Flu + \r\n\t\t\t\t$getPisosAletaFlu['pisosP3AletaFlu'] * $this->getEspesorAletaFlu() + $getCantidadChapaIntermedia['cantidadP3ChapaIntermedia'] * $this->getEspesorChapaIntermedia() +\r\n\t\t\t\t$getCantidadChapaPiso['cantP3Piso'] * $this->getEspesorChapaPiso() + $getCantidadChapaAdicional['cantP3PisoAd'] * $this->getEspesorChapaAdicional();\r\n\t\t\t\t\r\n\t\t\t\t$anchoP4 = $getPisosAletaVen['pisosAletaVenP4'] * $this->getEspesorAletaVen() + $getPisosAletaAdicional7['pisosP4Aleta7'] * $this->espesorAire7Flu + \r\n\t\t\t\t$getPisosAletaFlu['pisosP4AletaFlu'] * $this->getEspesorAletaFlu() + $getCantidadChapaIntermedia['cantidadP4ChapaIntermedia'] * $this->getEspesorChapaIntermedia() +\r\n\t\t\t\t$getCantidadChapaPiso['cantP4Piso'] * $this->getEspesorChapaPiso() + $getCantidadChapaAdicional['cantP4PisoAd'] * $this->getEspesorChapaAdicional();\r\n\t\t\t\t\n\t\t\t\t$res = array(\r\n\t\t\t\t\t'anchoTotal' => $anchoP1 + $anchoP2 + $anchoP3 + $anchoP4,\r\n\t\t\t\t\t'anchoP1' => $anchoP1,\r\n\t\t\t\t\t'anchoP2' => $anchoP2,\r\n\t\t\t\t\t'anchoP3' => $anchoP3,\r\n\t\t\t\t\t'anchoP4' => $anchoP4,\r\n\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\treturn $res;\t\t\r\n\t}", "public function articulos(){\n \n $articulos=Articulo::get();\n \n $pdf=PDF::loadview('pdf.articulos',compact('articulos'));\n return $pdf->stream('Articulos-SIS.pdf');\n }", "public function linea_colectivo();", "public function afficher_musique($id)\n{\n\n $db = $this->_db;\n $requete = $db->prepare(\"SELECT * FROM musiques WHERE id=$id\");\n $requete->execute();\n $resultat = $requete->fetchall();\n\n foreach($resultat as $musique)\n {\n $titre = $musique['titre'];\n $artiste = $musique['artiste'];\n $album = $musique['album'];\n $image = $musique['image'];\n\n echo\n \"<div class='card' style='width: 18rem;'>\n <img class='card-img-top' src='images-auto/$image' alt='Album $album'>\n <div class='card-body'>\n <h5 class='card-title'>Artiste :</h5><p class = 'anim'>$artiste</p>\n <h5 class='card-title'>Album : </h5><p class = 'anim'>$album</p>\n <h5 class='card-title'>Titre :</h5><p class = 'anim'> $titre</p> \n </div>\n </div>\";\n \n}\n}", "function rekamMedis($nomor_pasien)\n\t{\n\n\t}", "function promedios_por_materia($vector){\n echo \"<hr> ############# Promedios por materia #############\";\n $calificacion1=0;\n $calificacion2=0;\n $calificacion3=0;\n $calificacion4=0;\n $calificacion5=0;\n $calificacion6=0;\n foreach ($vector as $key => $value) {\n $calificacion1=$calificacion1+$vector[$key][0];\n $calificacion2=$calificacion2+$vector[$key][1];\n $calificacion3=$calificacion3+$vector[$key][2];\n $calificacion4=$calificacion4+$vector[$key][3];\n $calificacion5=$calificacion5+$vector[$key][4];\n $calificacion6=$calificacion6+$vector[$key][5];\n }\n $prom=$calificacion1/10;\n echo \"<br> Promedio materia 1: \".$prom;\n $prom=$calificacion2/10;\n echo \"<br> Promedio materia 2: \".$prom;\n $prom=$calificacion3/10;\n echo \"<br> Promedio materia 3: \".$prom;\n $prom=$calificacion4/10;\n echo \"<br> Promedio materia 4: \".$prom;\n $prom=$calificacion5/10;\n echo \"<br> Promedio materia 5: \".$prom;\n $prom=$calificacion6/10;\n echo \"<br> Promedio materia 6: \".$prom;\n }", "function votoMedio($nome) {\n\t$rows = selectVotoMedio($nome);\n\t$voto = 0;\n\tforeach ($rows as $row){\n\t\t$voto = $row[\"votoMedio\"];\n\t}\n\t$votoFormattato = number_format($voto, 1);\n\treturn $votoFormattato;\n}", "function recupereTitre(PDO $bdd){\n $req=\"SELECT * FROM article\";\n $resultat=$bdd->query($req);\n $n=0;\n while ($row=$resultat->fetch() AND $n<5){\n $n=$n+1;\n echo \"<a class='titre' id=\".$row['n°article'].\">\".$row['titre'].\"</a>\";\n echo \" \";\n echo \"<a class='date'>\".$row['date'].\"</a>\";\n echo \"<br>\";\n echo \"<a class='contenu'>\".substr($row['contenu'],0,80).\"</a>\";\n echo \"... <br>\";\n }\n }", "function Contenido($imagenlogo) {\n \t$this->SetMargins(10,10,151.5);\n\n \t//declaramos las fuentes a usar o tentativamente a usar ya que no sabemos cual es la original\n\t $this->AddFont('Gotham-B','','gotham-book.php');\n\t $this->AddFont('Gotham-B','B','gotham-book.php');\n\t $this->AddFont('Gotham-M','','gotham-medium.php');\n\t $this->AddFont('Helvetica','','helvetica.php');\n\n //variables locales\n $numero_de_presidiums=6;\n\n $presidium_orden=\"1\";\n $presidium_nombre=\"Cesar Gibran Cadena Espinosa de los Monteros\";\n $presidium_cargo=\"Dirigente de Redes y Enlaces \";\n\n \t//la imagen del PVEM\n \t$this->Image($imagenlogo, $this->GetX()+10, $this->GetY()+10, 100,40);\n\n \t//el primer espacio\n \t$this->Ln(3);\n $this->SetFillColor(231, 234,243); //color de fondo donde se va a rellenar los campos (como azul claro)\n $this->SetFont('Helvetica', '', 9); //font de cuando se va a rellenar la informacion\n $this->SetTextColor(0,0,0); //color gris para las letras\n $this->Cell(35, 5,utf8_decode(\"Distribución Logística:\"), 0,0, 'C', 1);\n\n $this->setY($this->GetY()+45);\n $this->Ln();\n $this->SetFillColor(231, 234,243); //color de fondo donde se va a rellenar los campos (como azul claro)\n $this->SetFont('Helvetica', '', 9); //font de cuando se va a rellenar la informacion\n $this->SetTextColor(0,0,0); //color gris para las letras\n $this->Cell(40, 5,utf8_decode(\"Presídium (Primera Fila):\"), 0,0, 'C', 1);\n\n $this->Ln(); \n $this->Ln(); \n\n $this->SetFillColor(160,68,68); //color de fondo donde se va a rellenar los campos (como azul claro)\n $this->SetTextColor(255); //color gris para las letras\n $tamano= ($numero_de_presidiums*7.5)/2;\n $this->setX((120/2)-$tamano);\n\n if ( ($numero_de_presidiums) % 2 ==1){ //es impar\n $candidato=($numero_de_presidiums/2)+.5;\n }else{\n $candidato=($numero_de_presidiums/2)+1;\n }\n\n for($i=0;$i<=$numero_de_presidiums;$i++){\n\n if ( ($i+1) == $candidato ){\n $this->Cell(7, 7,utf8_decode(\"*\"), 1, 0, 'C', 1);\n }else{\n $this->Cell(7, 7,utf8_decode(\"\"), 1, 0, 'C', 1); \n }\n }\n $this->Ln(); \n $this->Ln(5); \n\n\n //CONFIGURACION DE COLOR VERDE CON BLANCO\n $this->SetFont('Gotham-B','',6.5);\n $this->SetFillColor(73, 168, 63);\n $this->SetTextColor(255);\n $this->Cell(9, 5,utf8_decode(\"Orden\"), 'LR', 0, 'C', 1);\n $this->Cell(55, 5,utf8_decode(\"Nombre\"), 'LR', 0, 'C', 1);\n $this->Cell(0, 5,utf8_decode(\"Cargo\"), 'LR', 0, 'C', 1);\n\n\n $this->Ln(); \n\n\n //CONFIGURACION SIN COLOR de fondo\n $this->SetFont('Helvetica', '', 6.5); //font de cuando se va a rellenar la informacion\n $this->SetFillColor(255, 255, 255);\n $this->SetTextColor(0);\n\n\n //ESTO ES LO QUE IRIA EN UN FOR\n for($i=0;$i<=7;$i++){\n \n $this->Cell(9, 5,utf8_decode($presidium_orden), 1, 0, 'C', 1);\n $this->Cell(55, 5,utf8_decode($presidium_nombre), 1, 0, 'C', 1);\n $this->MultiCell(0, 5,utf8_decode($presidium_cargo), 1, 'C', 1);\n $this->Ln(1);\n } \n \n }", "public function articulos($id_compras_orden=false){\r\n\t\t$table \t\t\t\t= '';\r\n\t\t$accion \t\t\t= $this->tab['articulos'];\r\n\t\t$uso_interno\t\t= (!$id_compras_orden)?false:true;\r\n\t\t$id_compras_orden \t= (!$id_compras_orden)?$this->ajax_post('id_compras_orden'):$id_compras_orden;\r\n\t\t$detalle \t\t\t= $this->ordenes_model->get_orden_unico($id_compras_orden);\r\n\r\n\t\t$data_sql = array('id_compras_orden'=>$id_compras_orden);\r\n\t\t$data_listado=$this->db_model->db_get_data_orden_listado_registrado_unificado($data_sql);\r\n\t\t$moneda = $this->session->userdata('moneda');\r\n\t\tif(count($data_listado)>0){\r\n\t\t\t\t$style_table='display:block';\r\n\t\t\t\t$html='';\r\n\t\t\tfor($i=0;count($data_listado)>$i;$i++){\r\n\t\t\t\t// Lineas\r\n\t\t\t\t$peso_unitario = (substr($data_listado[$i]['peso_unitario'], strpos($data_listado[$i]['peso_unitario'], \".\" ))=='.000')?number_format($data_listado[$i]['peso_unitario'],0):$data_listado[$i]['peso_unitario'];\r\n\t\t\t\t$presentacion_x_embalaje = (substr($data_listado[$i]['presentacion_x_embalaje'], strpos($data_listado[$i]['presentacion_x_embalaje'], \".\" ))=='.000')?number_format($data_listado[$i]['presentacion_x_embalaje'],0):$data_listado[$i]['presentacion_x_embalaje'];\r\n\t\t\t\t$embalaje = ($data_listado[$i]['embalaje'])?$data_listado[$i]['embalaje'].' CON ':'';\r\n\r\n\t\t\t\t//print_debug($data_listado);\r\n\t\t\t\t$Data['consecutivo'] \t\t\t\t =\t ($i+1);\r\n\t\t\t\t$Data['id_compras_articulo_precios'] =\t $data_listado[$i]['id_compras_articulo_precios'];\r\n\t\t\t\t$Data['id_compras_articulo_presentacion'] =\t $data_listado[$i]['id_compras_articulo_presentacion'];\r\n\t\t\t\t$Data['id_compras_orden_articulo'] =\t $data_listado[$i]['id_compras_orden_articulo'];\r\n\t\t\t\t$Data['id_compras_articulo'] \t\t =\t $data_listado[$i]['id_compras_articulo'];\r\n\t\t\t\t$Data['id_articulo_tipo'] \t\t \t =\t $data_listado[$i]['id_articulo_tipo'];\r\n\t\t\t\t$Data['id_compras_um'] \t\t\t \t =\t $data_listado[$i]['id_compras_um'];\r\n\t\t\t\t$Data['um_x_embalaje'] \t\t\t \t =\t $data_listado[$i]['um_x_embalaje'];\r\n\t\t\t\t$Data['um_x_presentacion'] \t\t \t =\t $data_listado[$i]['um_x_presentacion'];\r\n\t\t\t\t$Data['unidad_minima'] \t\t\t \t =\t $data_listado[$i]['unidad_minima'];\r\n\t\t\t\t$Data['cl_um']\t\t\t\t\t \t =\t $data_listado[$i]['cl_um'];\r\n\t\t\t\t$Data['nombre_comercial']\t\t\t =\t $data_listado[$i]['nombre_comercial'];\r\n\t\t\t\t$Data['articulo']\t\t\t\t\t =\t $data_listado[$i]['articulo'].' - '.$data_listado[$i]['presentacion_detalle'];\r\n\t\t\t\t$Data['peso_unitario'] \t\t\t \t =\t $peso_unitario;\r\n\t\t\t\t$Data['upc'] \t\t\t\t\t\t =\t 'SKU:'.$data_listado[$i]['sku'].' UPC:'.$data_listado[$i]['upc'];\r\n\t\t\t\t$Data['presentacion_x_embalaje'] \t =\t $embalaje.$presentacion_x_embalaje;\r\n\t\t\t\t$Data['presentacion'] \t\t\t\t =\t $data_listado[$i]['presentacion'];\r\n\t\t\t\t$Data['costo_sin_impuesto'] \t\t =\t $data_listado[$i]['costo_sin_impuesto'];\r\n\t\t\t\t$Data['moneda'] \t\t\t\t\t =\t $moneda;\r\n\t\t\t\t$Data['cantidad'] \t\t\t\t\t =\t $data_listado[$i]['cantidad'];\r\n\t\t\t\t$Data['costo_x_cantidad'] \t\t\t =\t $data_listado[$i]['costo_x_cantidad'];\r\n\t\t\t\t$Data['descuento'] \t\t\t\t \t =\t $data_listado[$i]['descuento'];\r\n\t\t\t\t$Data['subtotal'] \t\t\t\t\t =\t $data_listado[$i]['subtotal'];\r\n\t\t\t\t$Data['impuesto_porcentaje'] \t\t =\t $data_listado[$i]['impuesto_porcentaje'];\r\n\t\t\t\t$Data['valor_impuesto']\t\t\t \t =\t $data_listado[$i]['valor_impuesto'];\r\n\t\t\t\t$Data['total'] \t\t\t\t\t \t =\t $data_listado[$i]['total'];\r\n\t\t\t\t$Data['number_costo_sin_impuesto'] =\t number_format($data_listado[$i]['costo_sin_impuesto'],2);\r\n\t\t\t\t$Data['number_cantidad'] \t\t\t =\t number_format($data_listado[$i]['cantidad'],0);\r\n\t\t\t\t$Data['number_costo_x_cantidad'] \t =\t number_format($data_listado[$i]['costo_x_cantidad'],2);\r\n\t\t\t\t$Data['number_descuento'] \t\t\t =\t number_format($data_listado[$i]['descuento'],0);\r\n\t\t\t\t$Data['number_subtotal']\t\t\t =\t number_format($data_listado[$i]['subtotal'],2);\r\n\t\t\t\t$Data['number_impuesto_porcentaje'] =\t number_format($data_listado[$i]['impuesto_porcentaje'],0);\r\n\t\t\t\t$Data['number_valor_impuesto']\t\t =\t number_format($data_listado[$i]['valor_impuesto'],2);\r\n\t\t\t\t$Data['number_total']\t\t\t\t =\t number_format($data_listado[$i]['total'],2);\r\n\r\n\t\t\t\t$url_listado_tpl = $this->modulo.'/'.$this->seccion.'/'.$this->submodulo.'/'.'entradas_recepcion_listado';\r\n\t\t\t\t$html.=$this->load_view_unique($url_listado_tpl ,$Data, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$style_table='display:none';\r\n\t\t\t$html='';\r\n\t\t}\r\n\t\t$data='';\r\n\t\t$proveedores = $this->ordenes_model->db_get_proveedores($data,$detalle[0]['id_proveedor']);\r\n\t\t$sucursales\t = $this->sucursales_model->get_orden_unico_sucursal($detalle[0]['id_sucursal']);\r\n\t\t$forma_pago\t = $this->formas_de_pago_model->get_orden_unico_formapago($detalle[0]['id_forma_pago']);\r\n\t\t$creditos\t = $this->creditos_model->get_orden_unico_credito($detalle[0]['id_credito']);\r\n\t\t$orden_tipo\t = $this->ordenes_model->db_get_tipo_orden($detalle[0]['id_orden_tipo']);\r\n\t\t\r\n\t\t$fec=explode('-',$detalle[0]['entrega_fecha']);\r\n\t\t$entrega_fecha=$fec[2].'/'.$fec[1].'/'.$fec[0];\r\n\t\t$fec2=explode('-',$detalle[0]['orden_fecha']);\r\n\t\t$orden_fecha=$fec2[2].'/'.$fec2[1].'/'.$fec2[0];\r\n\t\t$tabData['id_compras_orden']\t\t = $id_compras_orden;\r\n\t\t$tabData['orden_num'] \t\t\t = $this->lang_item(\"orden_num\",false);\r\n $tabData['proveedor'] \t \t\t\t = $this->lang_item(\"proveedor\",false);\r\n\t\t$tabData['sucursal'] \t\t\t = $this->lang_item(\"sucursal\",false);\r\n $tabData['orden_fecha'] \t\t = $this->lang_item(\"orden_fecha\",false);\r\n\t\t$tabData['entrega_fecha'] = $this->lang_item(\"entrega_fecha\",false);\r\n $tabData['observaciones'] \t = $this->lang_item(\"observaciones\",false);\r\n $tabData['forma_pago'] \t\t\t = $this->lang_item(\"forma_pago\",false);\r\n\t\t$tabData['articulo'] \t\t\t \t = $this->lang_item(\"articulo\",false);\r\n\t\t$tabData['costo_unitario']\t \t\t = $this->lang_item(\"costo_unitario\",false);\r\n\t\t$tabData['cantidad'] \t\t\t \t = $this->lang_item(\"cantidad\",false);\r\n\t\t$tabData['costo_cantidad'] \t = $this->lang_item(\"costo_cantidad\",false);\r\n\t\t$tabData['descuento'] \t\t\t \t = $this->lang_item(\"descuento\",false);\r\n\t\t$tabData['subtotal'] \t\t\t \t = $this->lang_item(\"subtotal\",false);\r\n\t\t$tabData['imp'] \t\t\t \t\t = $this->lang_item(\"imp\",false);\r\n\t\t$tabData['valor_imp'] \t\t\t \t = $this->lang_item(\"valor_imp\",false);\r\n\t\t$tabData['total'] \t\t\t \t\t = $this->lang_item(\"total\",false);\r\n\t\t$tabData['accion'] \t\t\t\t = $this->lang_item(\"accion\",false);\r\n\t\t$tabData['impuesto'] \t\t\t\t = $this->lang_item(\"impuesto\",false);\r\n\t\t$tabData['a_pagar'] \t\t\t\t = $this->lang_item(\"a_pagar\",false);\r\n\t\t$tabData['cerrar_orden'] \t\t \t = $this->lang_item(\"cerrar_orden\",false);\r\n\t\t$tabData['cancelar_orden']\t\t\t = $this->lang_item(\"cancelar_orden\",false);\r\n\t\t$tabData['presentacion']\t\t\t = $this->lang_item(\"embalaje\",false);\r\n\t\t$tabData['consecutivo']\t\t\t\t = $this->lang_item(\"consecutivo\",false);\r\n\t\t$tabData['moneda']\t\t\t\t \t = $moneda;\r\n\t\t$tabData['aceptar_orden']\t\t\t = $this->lang_item(\"aceptar_orden\",false);\r\n\t\t$tabData['devolucion_orden']\t\t = $this->lang_item(\"devolucion_orden\",false);\r\n\t\t$tabData['no_factura']\t\t \t\t = $this->lang_item(\"no_factura\",false);\r\n\t\t$tabData['fecha_factura']\t\t \t = $this->lang_item(\"fecha_factura\",false);\r\n\t\t$tabData['#']\t\t \t \t\t\t = $this->lang_item(\"#\",false);\r\n\t\t$tabData['costo_unitario']\t\t \t = $this->lang_item(\"costo_unitario\",false);\r\n\t\t$tabData['costo_cantidad']\t\t \t = $this->lang_item(\"costo_cantidad\",false);\r\n\t\t$tabData['valor_imp']\t\t \t \t = $this->lang_item(\"valor_imp\",false);\r\n\t\t$tabData['aceptar']\t\t \t \t\t = $this->lang_item(\"aceptar\",false);\r\n\t\t$tabData['comentarios_entrada']\t\t = $this->lang_item(\"comentarios_entrada\",false);\r\n\t\t$tabData['recibir_enetrada']\t\t = $this->lang_item(\"recibir_enetrada\",false);\r\n\t\t$tabData['rechazar_entrada']\t\t = $this->lang_item(\"rechazar_entrada\",false);\r\n\t\t$tabData['fecha_caducidad']\t\t \t = $this->lang_item(\"fecha_caducidad\",false);\r\n\t\t$tabData['acciones']\t\t \t \t = $this->lang_item(\"acciones\",false);\r\n\t\t$tabData['lote']\t\t \t \t \t = $this->lang_item(\"lote\",false);\r\n\t\t\r\n\r\n\t\t//DATA\r\n\t\t$tabData['orden_num_value']\t \t\t = $detalle[0]['orden_num'];\r\n\t\t$tabData['estatus']\t \t\t \t\t = $detalle[0]['estatus'];\r\n\t\t$tabData['observaciones_value']\t \t = $detalle[0]['observaciones'];\r\n\t\t$tabData['fecha_registro']\t \t \t = $detalle[0]['timestamp'];\r\n\t\t$tabData['list_sucursales']\t\t\t = $sucursales[0]['sucursal'];\r\n\t\t$tabData['orden_fecha_value']\t \t = $orden_fecha;\r\n\t\t$tabData['entrega_fecha_value']\t = $entrega_fecha;\r\n\t\t$tabData['list_forma_pago']\t\t\t = $forma_pago[0]['forma_pago'];\r\n\t\t$tabData['table']\t\t\t\t\t = $html;\r\n\t\t$tabData['style_table']\t\t\t\t = $style_table;\r\n\r\n\t\t$uri_view = $this->path.$this->submodulo.'/'.$accion;\r\n\t\tif(!$uso_interno){\r\n\t\t\techo json_encode( $this->load_view_unique($uri_view ,$tabData, true));\r\n\t\t}else{\r\n\t\t\t$includes['css'][] = array('name' => 'style.default', 'dirname' => '');\r\n\t\t\t$includes['css'][] = array('name' => 'estilos-custom', 'dirname' => '');\r\n\t\t\treturn $this->load_view_unique($uri_view ,$tabData, true, $includes);\r\n\t\t}\r\n\t}", "function tableau_visites_rubriques($date) {\r\n\tglobal $couleur_claire;\r\n\r\n\t$tab_rubart = rubriques_du_jour($date);\r\n\r\n\t$aff = '';\r\n\t$aff .= debut_cadre_relief('rubrique-24.gif', true);\r\n\t$aff .= \"<div class='cart_titre_bold verdana3'>\" . _T('actijour:repartition_visites_secteurs') . \"</div>\";\r\n\r\n\tif ($tab_rubart) {\r\n\t\t// add visites\r\n\t\t$nbr = 0;\r\n\t\tforeach ($tab_rubart as $s => $c) {\r\n\t\t\t$nbr += $c['vis'];\r\n\t\t}\r\n\r\n\t\t$ifond = 0;\r\n\r\n\t\t$aff .= \"<table cellpadding='2' cellspacing='0' width='100%' border='0'>\\n\";\r\n\r\n\t\tforeach ($tab_rubart as $sect => $cat) {\r\n\t\t\t$ifond = $ifond ^ 1;\r\n\t\t\t$couleur = ($ifond) ? '#FFFFFF' : $couleur_claire;\r\n\t\t\t$s_titre = typo(info_rubrique($sect));\r\n\t\t\t$prct_s = round(($cat['vis'] / $nbr) * 100, 1);\r\n\r\n\t\t\t$aff .= \"<tr bgcolor='$couleur'>\\n<td colspan='2'>\"\r\n\t\t\t\t. http_img_pack('secteur-12.gif', 'ico', 'align=\\'absmiddle\\'', '') . \"&nbsp;<b>\"\r\n\t\t\t\t. supprimer_numero($s_titre) . \"</b></td>\\n\"\r\n\t\t\t\t. \"<td width='8%'><div align='right'><b>\"\r\n\t\t\t\t. $cat['vis'] . \"</b></div></td>\\n\"\r\n\t\t\t\t. \"<td width='12%'><div class='verdana2 bold' align='right'>\"\r\n\t\t\t\t. $prct_s . \"%</div></td>\\n\"\r\n\t\t\t\t. \"</tr>\\n\";\r\n\r\n\t\t\tif ($cat['rub']) {\r\n\t\t\t\tforeach ($cat['rub'] as $idr => $vis) {\r\n\t\t\t\t\t$r_titre = typo(info_rubrique($idr));\r\n\t\t\t\t\t$prct_r = round(($vis / $nbr) * 100, 1);\r\n\r\n\t\t\t\t\t$aff .= \"<tr bgcolor='$couleur'>\\n<td width='2%'>&nbsp;</td>\"\r\n\t\t\t\t\t\t. \"<td>\"\r\n\t\t\t\t\t\t. http_img_pack('rubrique-12.gif', 'ico', 'align=\\'absmiddle\\'', '') . \"&nbsp;\"\r\n\t\t\t\t\t\t. supprimer_numero($r_titre) . \"</td>\\n\"\r\n\t\t\t\t\t\t. \"<td width='8%'><div align='right'>\"\r\n\t\t\t\t\t\t. $vis . \"</div></td>\\n\"\r\n\t\t\t\t\t\t. \"<td width='12%'><div class='verdana1' align='right'>\"\r\n\t\t\t\t\t\t. $prct_r . \"%</div></td>\\n</tr>\\n\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$aff .= \"</table>\\n\";\r\n\t}\r\n\t$aff .= fin_cadre_relief(true);\r\n\r\n\treturn $aff;\r\n}", "public function todaInfoProductos(){\n\n for($i = 0; $i < count($this -> listProducto); $i++){\n $this -> listProducto[$i][0] -> getInfoBasic();\n }\n }", "public function recupereDonnees (){\n\t\t$req = $this->bdd->prepare('SELECT gratuit, image, invisibleAuteur, idModerateur, moderation, affiche , titre, idAuteur, idCategorie, corps, DATE_FORMAT(date_creation, \\'%d/%m/%Y à %Hh%i\\') AS date_creation_fr FROM `Article` WHERE id = ?');\n\t\t$req->execute(array($this->id));\n\t\t$donnees = $req->fetch();\n\t\t$req->closeCursor(); \n\n\t\t$this->titre = $donnees['titre'];\n\t\t$this->idAuteur = $donnees['idAuteur'];\n\t\t$this->idModerateur = $donnees['idModerateur'];\n\t\t$this->idCategorie = $donnees['idCategorie'];\n\t\t$this->corps = $donnees['corps'];\n\t\t$this->extrait = $this->creationExtrait($this->corps,15); // Fixé arbitrairement à 15 mots dans l'extrait pour le moment.\n\t\t$this->extraitLong = $this->creationExtrait($this->corps,35); // Fixé arbitrairement à 35 mots dans l'extrait pour le moment.\n\n\t\t$this->image = $donnees['image'];\n\t\t/*\n\t\tif (isset($donnees['image'])) {\n\t\t\t$this->image = $donnees['image'];\n\t\t}else{\n\t\t\t$this->image = \"default.jpg\";\n\t\t}\n\t\t*/\n\n\t\t$this->date_creation_fr = $donnees['date_creation_fr'];\n\t\tif ($donnees['moderation'] == 0){\n\t\t\t$this->moderation = false;\n\t\t} else {\n\t\t\t$this->moderation = true;\n\t\t}\n\n\t\tif ($donnees['affiche'] == 0){\n\t\t\t$this->affiche = false;\n\t\t} else {\n\t\t\t$this->affiche = true;\n\t\t}\n\t\tif ($donnees['invisibleAuteur'] == 0){\n\t\t\t//echo \"false\";\n\t\t\t$this->invisibleAuteur = false;\n\t\t} else {\n\t\t\t//echo \"true\";\n\t\t\t$this->invisibleAuteur = true;\n\t\t}\n\t\tif ($donnees['gratuit'] == 0){\n\t\t\t$this->gratuit = false;\n\t\t} else {\n\t\t\t$this->gratuit = true;\n\t\t}\n\n\t\t// Recuperer le nombre de commentaire liés à cet article\n\t\t$req = $this->bdd->prepare('SELECT COUNT(id) FROM `Commentaire` WHERE idArticle = ? AND affiche = ?');\n\t\t$req->execute(array($this->id, \"1\"));\n\t\t$donnees = $req->fetch();\n\t\t$req->closeCursor();\n\t\t$this->nbCommentaire = $donnees[0];\n\t}", "public function getDemonstrativos();", "function alumnos_mayores_al_promedio_general($promedio,$vector){\n echo \"<hr> ############# Promedios mayores al promedio general #############\";\n $cont=0;\n foreach ($vector as $key => $value) {\n foreach ($value as $c => $n) {\n if($n>$promedio){\n $cont=$cont+1;\n echo \"<br>\".$c.\" -->Promedio: \".$n;\n }\n }\n }\n echo \"<br> Total: \".$cont;\n\n }", "public function hayCesta(){\r\n\t\t\treturn (count($this->listArticulos)>0)?1:0;\r\n\t\t}", "function index($page, $nombre_article) {\n $index = (($page - 1) * $nombre_article);\n return $index;\n}", "function get_title_lectura($lectura)\n{\n $cadena = $lectura->libro_nombre . ' ' . $lectura->capitulo . ': ' . $lectura->inicio\n . '-' . $lectura->final;\n\n return $cadena;\n}", "public function obtenerViajesplus();", "public function getidArt()\n\t {\n\t return $this->idArt;\n\t }", "public function getidArt()\n\t {\n\t return $this->idArt;\n\t }", "public function getidArt()\n\t {\n\t return $this->idArt;\n\t }", "function PintarListado($Img,$Tit,$Subt,$Creac,$Fact,$Client,$Rent,$Rep,$Cesta,$Destino){\n\t//$Tit -> es el titulo del negocio\n\t//$Subt -> es el subtitulo del negocio\n\t//$Creac -> es el año de creacion del negocio\n\t//$Fact -> es la facturacion del negocio\n\t//$Client -> son los clientes actuales del negocio\n\t//$Rent -> es el % rentabilidad del negocio\n\t//$Rep -> es el indice de repeticion de compra en el negocio\n\t//$Cesta -> es la cesta media del negocio\n\t//$Destino -> es el boton \"ver estadisticas\" que nos envia a la url detalle\n\t\n\t$color=array (\"#e6b0aa\",\"#af7ac5\",\"#1abc9c\",\"#2e86c1\",\"#cb4335\",\"#f1948a\",\"#f9e79f\",\"#82e0aa\",\"#f1c40f\",\"#28b463\",\"#f8c471\",\"#f0f3f4\",\"#95a5a6\",\"#229954\",\"#d7bde2\",\"#aeb6bf\",\"#5dade2\",\"#aed6f1\",\"#bb8fce\",\"#2e86c1\",\"#f5b041\",\"#f6ddcc\",\"#e5e8e8\",\"#808b96\",\"#616a6b\",\"#ba4a00\",\"#d1f2eb\",\"#f2d7d5\",\"#fadbd8\",\"#ebdef0\",\"#e8daef\",\"#d4e6f1\",\"#d6eaf8\",\"#d1f2eb\",\"#d0ece7\",\"#d4efdf\",\"#d5f5e3\",\"#fcf3cf\",\"#fdebd0\",\"#fae5d3\",\"#f6ddcc\",\"#f2f3f4\",\"#c0392b\",\"#e74c3c\",\"#9b59b6\",\"#3498db\",\"#16a085\",\"#27ae60\",\"#2ecc71\",\"#f39c12\",\"#e67e22\",\"#d35400\");\n\t$b= array_rand($color);\n\n\t$a='<div class=\"col-lg-4 col-sm-6 text-center\">';\n\t$a.='<div class=\"col-lg-4\" id=\"variables\">'.$valor.'</div>';\n\t$a.='<div style=\"background:'.$color[$b].';width: 200px;margin-left: auto;margin-right: auto;height: 200px;border-radius: 8em;\"></div>';\n\t$a.='<h3>'.$titulo.'</h3>';\n\t$a.='<p>'.$desc.'</p><br><b\n\tr>';\n\t$a.='</div>';\n\n\n\n\n\n/*\n\t <div class=\"row\">\n <div class=\"col-md-7\">\n <a href=\"#\">\n <img class=\"img-responsive img-thumbnail\" src=\"img/labiomania-logo.jpg\" alt=\"\">\n </a>\n </div>\n <div class=\"col-md-5\">\n <h3>Labiomanía</h3>\n <h4>Tienda de Tatuajes Labiales</h4>\n <ul class=\"b\">\n <li><strong>Año/Mes de Creación:</strong> xxx</li>\n <li><strong>Facturación:</strong> xxx</li>\n <li><strong>Clientes Actuales:</strong> xxx</li>\n <li><strong>% Rentabilidad:</strong> xxx</li>\n <li><strong>Índice de Repetición:</strong> xxx</li>\n <li><strong>Cesta Media:</strong> xxx</li> \n </ul>\n <p> \n </p>\n <a class=\"btn btn-primary\" href=\"#\">Ver Estadísticas <span class=\"glyphicon glyphicon-chevron-right\"></span></a>\n </div>\n </div>\n\n*/\n\n\n\n\n\techo $a;\n}", "public function getJadwalDimulai();", "function topten_articles_periode($periode) {\r\n\tglobal $couleur_claire;\r\n\r\n\tif ($periode == '8') {\r\n\t\t$top = $GLOBALS['actijour']['nbl_topsem'];\r\n\t} elseif ($periode == '30') {\r\n\t\t$top = $GLOBALS['actijour']['nbl_topmois'];\r\n\t} else {\r\n\t\t$top = '10';\r\n\t}\r\n\r\n\t$q = sql_select(\"sva.id_article, SUM(sva.visites) AS volume, \r\n\t\t\t\tMAX(sva.visites) AS picvis, sa.statut, sa.titre, sa.visites \r\n\t\t\t\tFROM spip_visites_articles sva \r\n\t\t\t\tLEFT JOIN spip_articles sa ON sva.id_article=sa.id_article \r\n\t\t\t\tWHERE sa.statut='publie' AND sva.date > DATE_SUB(NOW(),INTERVAL $periode DAY) \r\n\t\t\t\tGROUP BY sva.id_article \r\n\t\t\t\tORDER BY volume DESC \r\n\t\t\t\tLIMIT 0,$top\"\r\n\t);\r\n\t$ifond = 0;\r\n\t$aff = '';\r\n\r\n\t$aff .= debut_cadre_relief(\"article-24.gif\", true)\r\n\t\t. \"<table align='center' border='0' cellpadding='2' cellspacing='1' width='100%'>\\n\"\r\n\t\t. \"<tr><td colspan='5' class='cart_titre_bold verdana3'>\" . _T('actijour:top_ten_article_' . $periode . '_j')\r\n\t\t. \"</td></tr>\";\r\n\r\n\t$aff .= \"<tr class='legend_topten'><td>A</td><td>B</td><td>C</td><td>D</td><td>E</td></tr>\\n\";\r\n\r\n\twhile ($row = sql_fetch($q)) {\r\n\t\t$ifond = $ifond ^ 1;\r\n\t\t$couleur = ($ifond) ? $couleur_claire : '#FFFFFF';\r\n\r\n\t\t$aff .= \"<tr bgcolor='$couleur'><td width='7%'>\\n\"\r\n\t\t\t. \"<div align='right' class='verdana2'>\"\r\n\t\t\t. affiche_lien_graph($row['id_article'], $row['titre'], $row['statut'], 'spip')\r\n\t\t\t. \"</div></td>\\n\"\r\n\t\t\t. \"<td width='70%'>\\n<div align='left' class='verdana2'><b>\"\r\n\t\t\t. affiche_lien_graph($row['id_article'], $row['titre'], $row['statut'])\r\n\t\t\t. \"</b></div></td>\\n\"\r\n\t\t\t. \"<td width='6%'>\\n<div align='right' class='verdana1' style='margin-right:3px;'><b>\"\r\n\t\t\t. $row['volume'] . \"</b></div></td>\\n\"\r\n\t\t\t. \"<td width='7%'>\\n<div align='right' class='verdana1' style='margin-right:3px;'><b>\"\r\n\t\t\t. $row['picvis'] . \"</b></div>\\n</td>\\n\"\r\n\t\t\t. \"<td width='10%'>\\n<div align='right' class='verdana1' style='margin-right:3px;'><b>\"\r\n\t\t\t. $row['visites'] . \"</b></div>\\n</td>\\n</tr>\\n\";\r\n\t}\r\n\t$aff .= \"</table>\";\r\n\t$aff .= fin_cadre_relief(true);\r\n\r\n\treturn $aff;\r\n}", "public function viewArt(){\r\n\t\t\r\n\t\t$strTabla= \"<table border='1' id='customers'><tr> <th>ID</th><th>Nombre </th><th>correo</th><th>saldo </th><th>Dar de alta </th></tr>\";\r\n\t\t\t$articulos = $this->db->query(\"select * from Cliente WHERE alta like '0';\");\r\n\t\t\t//recorro los arituclos y los introduzco en la tabla\r\n\t\t\tforeach ($articulos->result() as $row)\r\n\t\t\t{\r\n\t\t\t\t$strTabla.= \"<tr><td>\". $row->ID .\"</td> <td>\". $row->nombre .\"</td> <td>\". $row->correo .\"</td> <td>\". $row->saldo .\"</td> <td><a href=\". base_url(\"index.php/Tiendamerch/alta/\". $row->ID .\"\") .\">DAR DE ALTA</a></td> </tr>\";\r\n\t\t\t}\r\n\t\t\t$strTabla.= \"</table>\";\r\n\t\treturn $strTabla;\r\n\t\t\r\n\t}", "public function run()\n {\n $about = [\n [\n 'title' => 'Quizás muchos pueden llegar a preguntarse como empezó a reunirse Centro Refugio Hefzi-bá.',\n \n 'content' => 'Pues aquí les cuento nuestros inicios. \n A principio del año 1998 en mi casa nos comenzamos a reunir mi esposa Nelly y yo con un grupo de\n hermanos a los cuales yo los había pastoreado un tiempo atrás, en una congregación de la localidad del\n Socorro en Valencia, Vzla. Pero debido que tenían tiempo que su congregación no funcionó mas, nos pidieron a\n Nelly y a mí si les podíamos pastorear, oramos a Dios y después de Él nos dió su respuesta de que si lo hiciéramos,\n empezamos a reunirnos.\n Después de varios días de reuniones, nos surgió la pregunta de como llamaríamos a la congregación que estaba\n naciendo. Dios nos llevó al libro de Isaías cap. 62 vers. 2 al 4 y allí nos decía que Él se deleitaba con la\n nueva congregación y por eso le debíamos poner HEFZI-BÁ, inmediatamente hubo la conexión divina de nosotros\n con el nombre que Dios nos había colocado como su pueblo que eramos.\n Is. 62,2-4: \"Entonces las naciones verán tu justicia,\n Y todos los reyes, tu gloria.\n Y te será dado un nombre nuevo,\n Que la boca de YHVH pronunciará.\n 3 Serás corona fúlgida en la mano de\n YHVH,\n Y diadema real en la palma de tu\n Dios.\n 4 Nunca más serás llamada la\n Desamparada,\n Ni tu tierra, la Desolada,\n Sino que serás llamada Hefzi-bá,° y\n tu país, Beula,°\n Porque el amor de YHVH estará\n contigo\n Y tu tierra tendrá marido,\"\n Así fueron nuestros inicios como congregación y ahora obedecemos a Dios y esperamos la segunda venida de\n nuestro Rey y Salvador Jesús.\n Mientras tanto hacemos su voluntad accionando en el ministerio de la reconciliación que Jesús nos dejo.\n ',\n \n 'img' => 'founder.jpg',\n \n 'url_video' => 'admin@admin',\n ],\n ];\n\n foreach ($about as $item) {\n Historyabout::create( $item );\n }\n }", "public function getMilage()\n {\n }", "public function lectureContenu ()\n {\n\n //$metadata = simplexml_load_file(\"xmoddledata/metadata.xml\");\n\n // on Vérifie si le cours existe\n\n /* @TODO Partie à décommenter lorsque le module de navigation sera intégré au reste de l'application */\n\n // $nbrCours = $metadata->attributes()->nbrCours;\n // $isFound = false;\n // $i = 0;\n // for ($i = 0; $i < $nbrCours; $i++) {\n // if ($metadata->cours[$i]->attributes()->title == $title && $metadata->cours[$i]->attributes()->id == $id) {\n // $isFound = true;\n // break;\n // }\n // }\n\n // if ($isFound) {\n //$cours = simplexml_load_file(\"xmoddledata/\" . $metadata->cours[$i]->attributes()->id . \"_\" . $metadata->cours[$i]->attributes()->title . \"/description.xml\"); \n\n $description = simplexml_load_file('xmoddledata/2_ModeleDeSupport2/description.xml');\n $notions = simplexml_load_file('xmoddledata/2_ModeleDeSupport2/descriptionNotions.xml');\n\n // Création d'un tableau associatif de notions avec l'id comme clé\n\n $notionsArray = $this->getNotions($notions);\n\n // Construction de la navigation\n $text_parties = \"\";\n $nav_parties = [];\n for ($i = 0; $i < $description->attributes()->nbrParties; $i++) {\n $text_parties = \"<div style='\";\n $text_parties .= $this->getStyle($description->partie[$i]->attributes());\n $text_parties .= \"'\";\n $text_parties .= \" id='\".$i.\"'>\";\n $nav_chapitres = [];\n $text_parties .= $description->partie[$i]->attributes()->title;\n $text_parties .= \"</div>\";\n $text_parties .= \"<br/><br/>\";\n $text_chapitres = \"\";\n for ($j = 0; $j < $description->partie[$i]->attributes()->nbrChapitres; $j++) {\n $text_chapitres .= \"<div style='\";\n $text_chapitres .= $this->getStyle($description->partie[$i]->chapitre[$j]->attributes());\n $text_chapitres .= \"'\";\n $text_chapitres .= \" id='\".$i.\"_\".$j.\"'>\";\n $nav_paragraphes = [];\n $text_chapitres .= $description->partie[$i]->chapitre[$j]->attributes()->title;\n $text_chapitres .= \"</div>\";\n $text_chapitres .= \"<br/><br/>\";\n $text_paragraphes = \"\";\n for ($k = 0; $k < $description->partie[$i]->chapitre[$j]->attributes()->nbrParagraphes; $k++) {\n // On renseigne le titre du paragraphe\n $text_paragraphes .= \"<div style='\";\n $text_paragraphes .= $this->getStyle($description->partie[$i]->chapitre[$j]->paragraphe[$k]->attributes());\n $text_paragraphes .= \"'\";\n // Ajout d'un ancre de navigation\n $text_paragraphes .= \" id='\".$i.\"_\".$j.\"_\".$k.\"'>\";\n $text_paragraphes .= $description->partie[$i]->chapitre[$j]->paragraphe[$k]->attributes()->title;\n $text_paragraphes .= \"</div>\";\n $text_paragraphes .= \"<br/>\";\n // Navigation avec paragraphes\n $nav_paragraphes[\"\".$i.\"_\".$j.\"_\".$k] = $description->partie[$i]->chapitre[$j]->paragraphe[$k]->attributes()->title;\n // On remplit les notions contenus dans le paragraphe\n for ($l = 0; $l < $description->partie[$i]->chapitre[$j]->paragraphe[$k]->attributes()->nbrNotions; $l++) {\n $text_paragraphes .= $notionsArray[\"\".$description->partie[$i]->chapitre[$j]->paragraphe[$k]->notion[$l]->attributes()->id];\n }\n }\n $text_chapitres .= $text_paragraphes;\n $nav_chapitres[\"\".$i.\"_\".$j] = $nav_paragraphes;\n }\n $text_parties .= $text_chapitres;\n $nav_parties[\"\".$i] = $nav_chapitres;\n }\n// dd($nav_parties);\n// dd($navigation);\n// dd($description);\n\n // Construction de la page web\n $titre = $description->attributes()->title;\n// dd($description);\n// forearch( $navigation->partie[] as $partie) {\n// dd($pantie);\n// }\n// dd($titre);\n\n\n // $notions = simplexml_load_file(\"../../../fichiersdestructuration/descriptionNotions.xml\");\n\n\n // $nbrNotions = $cours->attributes()->nbrNotions;\n // $notionsConvertis = array();\n // for ($i = 0; $i < $nbrNotions; $i++) {\n // $attributs = $cours->notion[$i]->attributes();\n // $style = \"\";\n // if ($attributs['font-weight'] != null) {\n // $style .= 'font-weight:' . $attributs['font-weight'] . \";\";\n // }\n // if ($attributs['font-size'] != null) {\n // $style .= 'font-size:' . $attributs['font-size'] . \";\";\n // }\n\n // if ($attributs['font-family'] != null) {\n // $style .= 'font-family:' . $attributs['font-family'] . \";\";\n // }\n\n // if ($attributs['color'] != null) {\n // $style .= 'color:' . $attributs['color'] . \";\";\n // }\n\n // if ($attributs['text-decoration'] != null) {\n // $style .= 'text-decoration:' . $attributs['text-decoration'] . \";\";\n // }\n\n // $text = \"\";\n // foreach ($cours->notion[$i]->children() as $child) {\n // $text .= $child->asXML();\n // }\n // $notionHtml = \"<div style='\";\n // $notionHtml .= $style;\n // $notionHtml .= \"'>\";\n // $notionHtml .= $text;\n // $notionHtml .= \"</div>\";\n\n\n // //dd(strval($text));\n // array_push($notionsConvertis, $notionHtml);\n\n // }\n // }else{\n // return view(\"/\");\n // }\n //$notions = $notionsConvertis;\n // return response()->json($notions,200);\n\n // return \"lecture cours\";\n return 0;\n }", "function mejor_promedio($vector){\n echo \"<hr> ############# Mejor promedio #############\";\n $promedio=0;\n $cadena;\n foreach ($vector as $key => $value) {\n foreach ($value as $c => $n) {\n if($n>$promedio){\n $promedio=$n;\n $cadena = \"<br>\".$c.\" -->Promedio: \".$n;\n }\n }\n }\n echo $cadena;\n }", "function articles_visites_semaine($nbj = '8') {\r\n\t# $nbj --> nombre de jours du tableau \r\n\t# par defaut 8 ; tableau de la semaine dans actijour_pg.php\r\n\r\n\tglobal $couleur_foncee, $couleur_claire;\r\n\r\n\t$q = sql_select(\r\n\t\t\"DATE_FORMAT(sva.date,'%d/%m') AS date_fr, \r\n\t\tCOUNT(sva.id_article) AS nbart, sv.visites, sva.date \r\n\t\tFROM spip_visites_articles sva LEFT JOIN spip_visites sv ON sva.date = sv.date \r\n\t\tWHERE sva.date > DATE_SUB(NOW(),INTERVAL $nbj DAY) \r\n\t\tGROUP BY sva.date \r\n\t\tORDER BY sva.date\"\r\n\t);\r\n\r\n\t# construit table semaine\r\n\t$semainier = array();\r\n\twhile ($row = sql_fetch($q)) {\r\n\t\t$key = strtotime($row['date']);\r\n\t\t$semainier[$key]['date_fr'] = $row['date_fr'];\r\n\t\t$semainier[$key]['nbart'] = $row['nbart'];\r\n\t\t$semainier[$key]['visites'] = $row['visites'];\r\n\t\t$i++;\r\n\t}\r\n\treset($semainier);\r\n#echo \"<pre>\"; print_r($semainier); echo \"</pre>\";\r\n\r\n\t# combler les jours sans visite\r\n\tif (count($semainier) < $nbj) {\r\n\t\tfor ($i = 0; $i < $nbj; $i++) {\r\n\t\t\tif (!array_key_exists($ante = ante_date_jour($i), $semainier)) {\r\n\t\t\t\t$semainier[$ante]['date_fr'] = ante_date_jour($i, true);\r\n\t\t\t\t$semainier[$ante]['nbart'] = '0';\r\n\t\t\t\t$semainier[$ante]['visites'] = '0';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n#echo \"2 - <pre>\"; print_r($semainier); echo \"</pre> - 2\";\r\n\tksort($semainier);\r\n\r\n\t#\r\n\t# affiche bloc stats semaine\r\n\t#\r\n\t$aff = debut_cadre_relief(\"cal-semaine.gif\", true);\r\n\t# prepa tableau\r\n\t$aff .= \"<span class='verdana3 bold'>\" . _T('actijour:huit_derniers_jours') . \"</span>\\n\"\r\n\t\t. \"<table width='100%' border='0' cellpadding='1' cellspacing='0'>\\n\"\r\n\t\t. \"<tr><td><div class='cell_huit_t' style='background-color:$couleur_foncee;'>\"\r\n\t\t. _T('actijour:jour') . \"</div>\\n\"\r\n\t\t. \"<div class='cell_huit_m'>\" . _T('actijour:nombre_art') . \"</div>\\n\"\r\n\t\t. \"<div class='cell_huit_p' style='background-color:$couleur_claire;'>\"\r\n\t\t. _T('actijour:visites') . \"</div>\\n</td>\";\r\n\r\n\t# les colonnes\r\n\t$add = 0;\r\n\tforeach ($semainier as $day => $vals) {\r\n\t\t$aff .= \"<td><div class='cell_huit_t' style='background-color:$couleur_foncee;'>\"\r\n\t\t\t. $vals['date_fr'] . \"</div>\\n\"\r\n\t\t\t. \"<div class='cell_huit_m'>\" . $vals['nbart'] . \"</div>\\n\"\r\n\t\t\t. \"<div class='cell_huit_p' style='background-color:$couleur_claire;'>\" . $vals['visites']\r\n\t\t\t. \"</div></td>\\n\";\r\n\t\t//calcul moyenne de la \"periode\"\r\n\t\t$add += $vals['visites'];\r\n\t}\r\n\t# moyenne visite semaine\r\n\t$moysem = round($add / 8);\r\n\r\n\t# derniere colonne affichage : moyenne periode\r\n\t$aff .= \"<td>\"\r\n\t\t. \"<div class='cell_huit_t'>&nbsp;</div>\"\r\n\t\t. \"<div class='cell_huit_m' style='background-color:$couleur_claire;'>\"\r\n\t\t. _T('actijour:moyenne_c')\r\n\t\t. \"<div class='cell_huit_p' style='background-color:$couleur_claire;'>\" . $moysem . \"</div>\"\r\n\t\t. \"</td></tr></table>\";\r\n\r\n\t$aff .= fin_cadre_relief(true);\r\n\r\n\treturn $aff;\r\n}", "public function afficherPanier(){ \n $txt = \"\";\n foreach($this->listeProduits as $value){\n\t$p = $value[0]; // objet produit\n\t$q = $value[1]; // quantité\n\t$txt .= $q . \" unités x \" . $p->getNomProduit() . \" à \" .\n\t$p->getPrixHTVA() . \" euros\\n\";\n\t}\t\n\treturn $txt;\n }", "public function peso_cesta(){\r\n\t\t\t$peso = 0;\r\n\t\t\tforeach ($this->listArticulos as $elArticulo){\r\n\t\t\t\t$peso+=($elArticulo->peso*$elArticulo->unidades);\r\n\t\t\t\tparent::$log->debug(\"Peso $elArticulo->articulo= $elArticulo->peso(kg) * $elArticulo->unidades(u) = \".($elArticulo->unidades*$elArticulo->peso).\" Peso acumulado de la cesta=\".$peso);\r\n\t\t\t}\r\n\t\t\treturn $peso;\r\n\t\t}", "public function cesta_sin_iva(){\r\n\t\t\t$total = 0;\r\n\t\t\tforeach ($this->listArticulos as $elArticulo){\r\n\t\t\t\t$precio = $elArticulo->oferta>0?$elArticulo->oferta:$elArticulo->precio;\r\n\t\t\t\t$total+= round($elArticulo->unidades*$precio,2);\t\t\t\t\r\n\t\t\t}\r\n\t\t\treturn $total;\r\n\t\t}", "public function Matriculados() {\n\t\treturn $this->getAlunos()->count();\n\t}", "function grafico_1_3( $desde, $hasta, $ua ){\n\t// aclarar al cliente que debe setear campos bien definidos y NO PERMITIR AMBIGUEDADES\n\t\n\t$query = \"select actor.nombre, actor.apellido, actor.id_partido, actor.id_campo, count(noticiasactor.id_actor) as cantidad from noticiascliente \"\n\t\t. \"inner join noticiasactor on noticiascliente.id_noticia = noticiasactor.id_noticia \"\n\t\t. \"inner join noticias on noticiasactor.id_noticia = noticias.id \"\n\t\t. \"inner join actor on noticiasactor.id_actor = actor.id \"\n\t\t. \"where \"\n\t\t\t. \"noticiascliente.id_cliente = \" . $ua . \" and \"\n\t\t\t. \"noticiascliente.elim = 0 and \"\n\t\t\t. \"noticias.fecha between '\" . $desde . \" 00:00:01' and '\" . $hasta . \" 23:59:59' \"\n\t\t\t// SOLO QUIENES TIENEN 3 Y 4 COMO CAMPO\n\t\t\t// . \" and ( actor.id_campo like '%3%' or actor.id_campo like '%4%' ) \"\n\t\t. \"group by noticiasactor.id_actor order by cantidad desc\";\n\t//echo $query;\n\t$main = R::getAll($query);\n\t$ua_nombre = R::findOne(\"cliente\",\"id LIKE ?\",[$ua])['nombre'];\n\n\t//var_dump($main);\n\t$tabla = [];\n\t// unidad de analisis, actor, partido, cantidad de menciones\n\t$i = -1;\n\t$partidos = [];\n\t\n\t$children_partidos = [];\n\t$i_actor = 0;\n\tforeach($main as $k=>$v){\n\t\t// obtengo el/los partidos\n\t\t$partidos_array = json_decode( $v['id_partido'], true);\n\t\tif( ! is_array($partidos_array) ) continue;\n\t\t\n\t\tforeach($partidos_array as $p){\n\t\t\t$partido_nombre = R::findOne('attr_partido','id LIKE ?',[$p])['nombre'];\n\t\t\t$tabla[ ++$i ] = [\n\t\t\t\t'ua' => $ua_nombre,\n\t\t\t\t'actor' => $v['nombre'] . ' ' . $v['apellido'],\n\t\t\t\t'partido' => $partido_nombre,\n\t\t\t\t'cantidad' => $v['cantidad']\n\t\t\t\t];\n\t\t\t\t// agrego el partido y el grafico\n\t\t\t\tif(! in_array($partido_nombre,$partidos)){\n\t\t\t\t\t$partidos[] = $partido_nombre;\n\t\t\t\t\t$x = new StdClass(); // objeto vacio\n\t\t\t\t\t$x->name = $partido_nombre;\n\t\t\t\t\t$x->rank = 0;\n\t\t\t\t\t$x->weight = count($partidos); //'Yellow'; cargar desde JS\n\t\t\t\t\t$x->id = 1;\n\t\t\t\t\t$x->children = [];\n\t\t\t\t\t$children_partidos[] = $x;\n\t\t\t\t}\n\t\t\t\t// obtengo el indice del partido y lo inserto\n\t\t\t\t$index = array_search($partido_nombre,$partidos);\n\t\t\t\t$t = new StdClass(); // objeto vacio\n\t\t\t\t$t->name = $v['nombre'] . ' ' . $v['apellido'] . \" (\" . $v['cantidad'] . \")\";\n\t\t\t\t$t->rank = $v['cantidad'];\n\t\t\t\t$t->weight = $i_actor; //'Yellow'; cargar desde JS\n\t\t\t\t$t->id = 1;\n\t\t\t\t$t->children = [];\n\t\t\t\t// lo agrego al padre correspondiente\n\t\t\t\t$children_partidos[ $index ]->children[] = $t;\n\t\t\t\t$children_partidos[ $index ]->rank += 1;\n\t\t\t}\n\t\t\t++$i_actor;\n\t}\n\t// grafico\n\t/*$oficialismo = new StdClass(); // objeto vacio\n\t$oficialismo->name = 'Oficialismo';\n\t$oficialismo->rank = 0;\n\t$oficialismo->weight = 'Yellow';\n\t$oficialismo->id = 1;\n\t$oficialismo->children = [];*/\n\t\n\t// creo los objetos partidos\n\t\n\t/*foreach($partidos as $p){\n\t\t$x = new StdClass(); // objeto vacio\n\t\t$x->name = $p;\n\t\t$x->rank = 0;\n\t\t$x->weight = 0; //'Yellow'; cargar desde JS\n\t\t$x->id = 1;\n\t\t$x->children = [];\n\t}*/\n\t\n\t$objeto = new StdClass(); // objeto vacio\n\t$objeto->name = 'Partidos';\n\t$objeto->rank = 0;\n\t$objeto->weight = 'Gray';\n\t$objeto->id = 1;\n\t$objeto->children = $children_partidos;\n\t\n\t\n\t/*foreach($tabla as $v){\n\t\t$sub = new StdClass(); // objeto vacio\n\t\t$sub->name = $v['actor'] . ' (' . $v['cantidad'] . ')';\n\t\t$sub->rank = $v['cantidad'];\n\t\t// $sub->weight = 0;\n\t\t$sub->cantidad = $v['cantidad'];\n\t\t$sub->id = 1;\n\t\t$sub->children = [ ];\n\t\tif($v['campo'] == 'oposicion'){\n\t\t\t$i_op += 1;\n\t\t\t$sub->weight = 'Blue';\n\t\t\t$oposicion->children[] = $sub;\n\t\t}\n\t\telse{ \n\t\t\t$i_of += 1;\n\t\t\t$sub->weight = 'White';\n\t\t\t$oficialismo->children[] = $sub;\n\t\t}\n\t}*/\n\t\n\t\n\treturn [\n\t\t'tabla' => $tabla,\n\t\t'grafico' => $objeto\n\t\t// ,'temas' => $temas\n\t\t];\n}", "public function obtenerArticulosPorTipo(){\n log_message('DEBUG', \"#TRAZA | #TRAZ-PROD-TRAZASOFT | Camion | obtenerArticulosPorTipo()\");\n $rsp = $this->Materias->listar('TODOS');\n if($rsp['status']){\n $materiasPrimas = json_decode($rsp['data']);\n $data['status'] = $rsp['status'];\n $data['data'] = selectBusquedaAvanzada(false, false, $materiasPrimas->articulos->articulo, 'arti_id', 'barcode',array('descripcion','um'));\n echo json_encode($data);\n }else{\n $rsp['msj'] = \"Fallo el servicio que obtiene los articulos tipo materia prima.\";\n json_encode($rsp);\n }\n }", "function showArtista($row){\n\t\techo '<div class=\"album\" id=\"album'.$row['id'].'\" onClick=\"eliminar('.$row['id'].')\">\n\t\t\t\t<div class=\"cover\">';\n\t\t//cover\n\t\tif ($row['cover'] == 'default'){\n\t\t\techo '<img class=\"imageCover\" src=\"images/album.png\" title=\"'.$row['artista'].'\">';\n\t\t}else{\n\t\t\techo '<img class=\"imageCover\" src=\"images/cover/'.$row['cover'].'\" title=\"'.$row['artista'].'\">';\n\t\t}\n\n\t\techo '</div>\n\t\t\t\t<div class=\"info\">\n\t\t\t\t\t<div class=\"contador\" id=\"contador'.$row['id'].'\">\n\t\t\t\t\t\t<span></span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"infosong\">\n\t\t\t\t\t\t<img src=\"images/disco.png\">';\n\t\t//artista\n\t\techo '<h2>'.$row['cancion'].'</h2>';\n\t\t//album\n\t\techo '<h3>'.$row['artista'].'</h3>';\n\n\t\techo '</div>\n\t\t\t\t\t<div class=\"infovotos\">\n\t\t\t\t\t\t<img src=\"images/like.png\">';\n\t\t//id para el jquery\n\t\techo '<img src=\"images/masDesactivo.png\" class=\"mas\" id=\"boton'.$row['id'].'\">';\n\t\t//votos\n\t\techo '<p id=\"votos'.$row['id'].'\">'.votos($row['id']).' votos</p>\n\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>';\n}", "public function pruebaAction() {\n// $articulos = $mica->getArticles();\n// $incollections = $mica->getIncollections();\n// $inproceedings = $mica->getInproceedings();\n// $books = $mica->getBooks();\n// $longitud = $mica->getLengthList();\n// $age = $mica->getAge();\n// $annual = $mica->getAnnual();\n// echo \"Age:\" -> $age;\n// echo \"Annual:\" -> $annual;\n// echo \"Incollections: \" -> $incollections->count() -> \"\\n\";\n// echo \"Books: \" -> $books->count() -> \"\\n\";\n// echo \"Inproceedings:\" -> $inproceedings->count() -> \"\\n\";\n// echo \"Articles: \" -> $articulos->count() -> \"\\n\";\n// echo $longitud;\n// var_dump(sizeof($inproceedings->toArray()));\n\n $author = $this->get(\"doctrine_mongodb\")->getRepository('MongoBundle:ImportantAuthor')->findOneByName(\"se Erdogan\");\n $articulos = $author->getArticles();\n// return $this->render(\"MongoBundle:Queries:prueba->html->twig\", array(\"articles\" => $articulos, \"author\" => $mica, \"incollections\" => $incollections, \"inproceedings\" => $inproceedings, \"books\" => $books));\n return $this->render(\"MongoBundle:Queries:prueba->html->twig\", array(\"articles\" => $articulos, \"author\" => $author));\n }", "function getEstadisticaDetallado() {\n\t\tglobal $mdb2;\n\t\tglobal $log;\n\t\tglobal $current_usuario_id;\n\t\tglobal $usr;\n\n\t\t# Variables para eventos especiales marcados por el cliente codigo 9.\n\t\t$event = new Event;\n\t\t$usr = new Usuario($current_usuario_id);\n\t\t$usr->__Usuario();\n\t\t$graficoSvg = new GraficoSVG();\n\n\n\t\t$timeZoneId = $usr->zona_horaria_id;\n\t\t$arrTime = Utiles::getNameZoneHor($timeZoneId); \t\t\n\t\t$timeZone = $arrTime[$timeZoneId];\n\t\t$tieneEvento = 'false';\n\t\t$arrayDateStart = array();\t\t\n\t\t$nameFunction = 'EstadisticaDet';\n\t\t$data = null;\n\t\t$ids = null;\n\n\t\t/* TEMPLATE DEL GRAFICO */\n\t\t$T =& new Template_PHPLIB(($this->extra[\"imprimir\"])?REP_PATH_PRINTTEMPLATES:REP_PATH_TABLETEMPLATES);\n\t\t$T->setFile('tpl_tabla', 'comparativo_resumen.tpl');\n\t\t$T->setBlock('tpl_tabla', 'BLOQUE_TITULO_HORARIOS', 'bloque_titulo_horarios');\n\t\t$T->setBlock('tpl_tabla', 'ES_PRIMERO_MONITOR', 'es_primero_monitor');\n\t\t$T->setBlock('tpl_tabla', 'ES_PRIMERO_TOTAL', 'es_primero_total');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_PASOS', 'lista_pasos');\n\t\t$T->setBlock('tpl_tabla', 'BLOQUE_TABLA', 'bloque_tabla');\n\n\t\t$T->setVar('__item_orden', $this->extra[\"item_orden\"]);\n\t\t# Variables para mantenimiento.\n\t\t$T->setVar('__path_jquery_ui', REP_PATH_JQUERY_UI);\n\t\n\t\t$horarios = array($usr->getHorario($this->horario_id));\n\t\tif ($this->horario_id != 0) {\n\t\t\t$horarios[] = $usr->getHorario(0);\n\t\t}\n\n\t\t$orden = 1;\n\t\t$T->setVar('bloque_titulo_horarios', '');\n\t\tforeach ($horarios as $horario) {\n\n\t\t\t/* OBTENER LOS DATOS Y PARSEARLO */\n\t\t\t$sql = \"SELECT * FROM reporte.comparativo_resumen_parcial(\".\n\t\t\t\t\tpg_escape_string($current_usuario_id).\",\".\n\t\t\t\t\tpg_escape_string($this->objetivo_id).\", \".\n\t\t\t\t\tpg_escape_string($horario->horario_id).\",' \".\n\t\t\t\t\tpg_escape_string($this->timestamp->getInicioPeriodo()).\"', '\".\n\t\t\t\t\tpg_escape_string($this->timestamp->getTerminoPeriodo()).\"')\";\n\t\t\t$res =& $mdb2->query($sql);\n// \t\t\tprint($sql);\n\t\t\tif (MDB2::isError($res)) {\n\t\t\t\t$log->setError($sql, $res->userinfo);\n\t\t\t\texit();\n\t\t\t}\n\n\t\t\t$row = $res->fetchRow();\n\t\t\t$dom = new DomDocument();\n\t\t\t$dom->preserveWhiteSpace = false;\n\t\t\t$dom->loadXML($row[\"comparativo_resumen_parcial\"]);\n\t\t\t$xpath = new DOMXpath($dom);\n\t\t\tunset($row[\"comparativo_resumen_parcial\"]);\n\n\t\t\tif ($xpath->query('//detalle[@paso_orden]/estadisticas/estadistica')->length == 0) {\n\t\t\t\t$this->resultado = $this->__generarContenedorSinDatos();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$conf_objetivo = $xpath->query('/atentus/resultados/propiedades/objetivos/objetivo')->item(0);\n\t\t\t$conf_pasos = $xpath->query(\"paso[@visible=1]\", $conf_objetivo);\n\t\t\t$conf_nodos = $xpath->query('//nodos/nodo');\n\n\t\t\tif(count($horarios) > 1) {\n\t\t\t\t$T->setVar('__item_horario', $this->extra[\"item_orden\"]);\n\t\t\t\t$T->setVar('__horario_orden', $orden);\n\t\t\t\t$T->setVar('__horario_nombre',$horario->nombre);\n\t\t\t\t$T->parse('bloque_titulo_horarios', 'BLOQUE_TITULO_HORARIOS', false);\n\t\t\t}\n\n\t\t\t\n\t\t\t# Obtención de los eventos especiales marcados por el cliente\n\t\t\tforeach ($xpath->query(\"/atentus/resultados/detalles_marcado/detalle/marcado\") as $tag_marcado) {\n\t\t\t$ids = $ids.','.$tag_marcado->getAttribute('mantenimiento_id');\n\t\t\t$marcado = true;\n\t\t\t}\t\t\n\t\t\t\n\t\t\t# Verifica que exista marcado evento cliente.\n\t\t\tif ($marcado == true) {\n\n\t\t\t\t$dataMant = $event->getData(substr($ids, 1), $timeZone);\n\t\t\t\t$character = array(\"{\", \"}\");\n\t\t\t\t$objetives = explode(',',str_replace($character,\"\",($dataMant[0]['objetivo_id'])));\n\t\t\t\t$tieneEvento = 'true';\n\t\t\t\t$encode = json_encode($dataMant);\n\t\t\t\t$nodoId = (string)0;\n\t\t\t\t$T->setVar('__tiene_evento', $tieneEvento);\n\t\t\t\t$T->setVar('__name', $nameFunction);\n\n\t\t\t}\n\n\t\t\t/* LISTA DE MONITORES */\n\t\t\t$linea = 1;\n\t\t\t$T->setVar('lista_pasos', '');\n\t\t\tforeach($conf_nodos as $conf_nodo) {\n\t\t\t\t$primero = true;\n\t\t\t\t$tag_nodo = $xpath->query('//detalle[@nodo_id='.$conf_nodo->getAttribute('nodo_id').']/estadisticas/estadistica')->item(0);\n\n\t\t\t\t/* LISTA DE PASOS */\n\t\t\t\tforeach($conf_pasos as $conf_paso) {\n\t\t\t\t\t$tag_dato = $xpath->query('//detalle[@nodo_id='.$conf_nodo->getAttribute('nodo_id').']/detalles/detalle[@paso_orden='.$conf_paso->getAttribute('paso_orden').']/estadisticas/estadistica')->item(0);\n\t\t\t\t\tif($tag_dato != null) {\n\t\t\t\t\t\t$T->setVar('__print_class', ($linea % 2 == 0)?\"celdaIteracion2\":\"celdaIteracion1\");\n\t\t\t\t\t\t$T->setVar('__class', ($linea % 2 == 0)?\"celdanegra15\":\"celdanegra10\");\n\n\t\t\t\t\t\t$T->setVar('es_primero_monitor', '');\n\t\t\t\t\t\t$T->setVar('es_primero_total', '');\n\t\t\t\t\t\tif ($primero) {\n\t\t\t\t\t\t\t$T->setVar('__monitor_nombre', $conf_nodo->getAttribute('nombre'));\n\t\t\t\t\t\t\t$T->setVar('__monitor_rowspan', $conf_pasos->length);\n\t\t\t\t\t\t\t$T->setVar('__monitor_total_monitoreo', $tag_nodo->getAttribute('cantidad'));\n\t\t\t\t\t\t\t$T->parse('es_primero_monitor', 'ES_PRIMERO_MONITOR', false);\n\t\t\t\t\t\t\t$T->parse('es_primero_total', 'ES_PRIMERO_TOTAL', false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$T->setVar('__paso_nombre', $conf_paso->getAttribute(\"nombre\"));\n\t\t\t\t\t\t$T->setVar('__paso_minimo', number_format($tag_dato->getAttribute('tiempo_min'), 3, ',', ''));\n\t\t\t\t\t\t$T->setVar('__paso_maximo', number_format($tag_dato->getAttribute('tiempo_max'), 3, ',', ''));\n\t\t\t\t\t\t$T->setVar('__paso_promedio', number_format($tag_dato->getAttribute('tiempo_prom'), 3, ',', ''));\n\t\t\t\t\t\t$T->setVar('__paso_uptime', number_format($tag_dato->getAttribute('uptime'), 3, ',', ''));\n\t\t\t\t\t\t$T->setVar('__paso_downtime', number_format($tag_dato->getAttribute('downtime'), 3, ',', ''));\n\t\t\t\t\t\t$T->setVar('__paso_no_monitoreo', number_format($tag_dato->getAttribute('sin_monitoreo'), 3, ',', ''));\n\t\t\t\t\t\t$T->setVar('__paso_evento_especial', number_format($tag_dato->getAttribute('marcado_cliente'), 3, ',', ''));\n\n\t\t\t\t\t\t$T->parse('lista_pasos', 'LISTA_PASOS', true);\n\t\t\t\t\t\t$primero = false;\n\t\t\t\t\t\t$linea++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$T->parse('bloque_tabla', 'BLOQUE_TABLA', true);\n\t\t\t$orden++;\n\t\t}\n\t\t$this->tiempo_expiracion = (strtotime($xpath->query(\"//fecha_expiracion\")->item(0)->nodeValue) - strtotime($xpath->query(\"//fecha\")->item(0)->nodeValue));\n\t\t$this->resultado = $T->parse('out', 'tpl_tabla');\n\n\t\t# Agrega el acordeon cuando existan eventos.\n\t\tif (count($dataMant)>0){\n\t\t\t$this->resultado.= $graficoSvg->getAccordion($encode,$nameFunction);\n\t\t}\n\t\treturn $this->resultado;\n\t}", "function getMontantTVAArticle($numserie) {\n // if ($this->calculmontant) return (sprintf(\"%.2f\", ($this->article[$numserie]['montantTTC'] - $this->article[$numserie]['montantHT'])));\n if (isset($this->calculmontant) && $this->calculmontant == true) return (sprintf(\"%.2f\", ($this->article[$numserie]['montantHT'] * ($this->TVA / 100))));\n else return 0;\n }", "public function obtenerLayoutParcial($id){\n $layout_parcial = LayoutParcial::find($id);\n\n $detalles = array();\n foreach($layout_parcial->detalles as $detalle){\n $linea = new \\stdClass();\n $maquina= Maquina::find($detalle->id_maquina);\n $linea->nro_admin = ['correcto' => true, 'valor' => $maquina->nro_admin , 'valor_antiguo' => ''] ;\n $linea->nro_isla = ['correcto' => true, 'valor' => $maquina->isla->nro_isla, 'valor_antiguo' => ''] ;\n $linea->marca = ['correcto' => true, 'valor' => $maquina->marca, 'valor_antiguo' => ''] ;\n if($maquina->id_tipo_maquina != null){\n $linea->tipo = ['correcto' => true, 'valor' => $maquina->tipoMaquina->descripcion, 'valor_antiguo' => ''] ;\n }else{\n $linea->tipo = ['correcto' => true, 'valor' => '-', 'valor_antiguo' => ''] ;\n }\n $linea->juego = ['correcto' => true, 'valor' => $maquina->juego_activo->nombre_juego, 'valor_antiguo' => ''] ;\n \n\n if($maquina->id_pack!=null){\n $pack=PackJuego::find($maquina->id_pack);\n $linea->tiene_pack_bandera=true;\n $juegos_pack_habilitados=array();\n foreach($maquina->juegos as $j){\n if($j->pivot->habilitado!=0){\n array_push( $juegos_pack_habilitados,$j);\n }\n }\n $linea->juegos_pack=$juegos_pack_habilitados;\n }else{\n $linea->tiene_pack_bandera=false;\n }\n \n $linea->nro_serie = ['correcto' => true, 'valor' => $maquina->nro_serie, 'valor_antiguo' => ''] ;\n $linea->id_maquina = $maquina->id_maquina;\n $progresivo = ProgresivoController::getInstancia()->obtenerProgresivoPorIdMaquina($maquina->id_maquina);\n\n if($progresivo['progresivo'] != null){\n $niveles = [];\n $linea->progresivo = new \\stdClass();\n $linea->progresivo->individual =['correcto' => true, 'valor' => $progresivo['progresivo']->individual, 'valor_antiguo' => ''] ;\n $linea->progresivo->nombre_progresivo =['correcto' => true, 'valor' => $progresivo['progresivo']->nombre_progresivo, 'valor_antiguo' => ''] ;\n $linea->progresivo->maximo = ['correcto' => true, 'valor' => $progresivo['progresivo']->maximo, 'valor_antiguo' => ''] ;\n $linea->progresivo->porc_recuperacion = ['correcto' => true, 'valor' => $progresivo['progresivo']->porc_recuperacion, 'valor_antiguo' => ''] ;\n $linea->progresivo->id_progresivo = $progresivo['progresivo']->id_progresivo;\n\n foreach ($progresivo['niveles'] as $nivel) {\n $nuevo_nivel = new \\stdClass();\n $base = $nivel['pivot_base'] != null ? $nivel['pivot_base'] : $nivel['nivel']->base;\n $nuevo_nivel->nombre_nivel = ['correcto' => true, 'valor' => $nivel['nivel']->nombre_nivel, 'valor_antiguo' => ''] ;\n $nuevo_nivel->nro_nivel = ['correcto' => true, 'valor' => $nivel['nivel']->nro_nivel, 'valor_antiguo' => ''] ;\n $nuevo_nivel->id_nivel = $nivel['nivel']->id_nivel_progresivo;\n $nuevo_nivel->base = ['correcto' => true, 'valor' => $base, 'valor_antiguo' => ''] ;\n $nuevo_nivel->porc_visible = ['correcto' => true, 'valor' => $nivel['nivel']->porc_visible, 'valor_antiguo' => ''] ;\n $nuevo_nivel->porc_oculto =['correcto' => true, 'valor' => $nivel['nivel']->porc_oculto , 'valor_antiguo' => ''] ;\n $niveles [] = $nuevo_nivel;\n }\n $linea->niveles = $niveles;\n }else{\n $linea->niveles = null;\n $linea->progresivo= null;\n }\n $detalles[] = $linea;\n }\n\n return ['layout_parcial' => $layout_parcial,\n 'casino' => $layout_parcial->sector->casino->nombre,\n 'id_casino' => $layout_parcial->sector->casino->id_casino,\n 'sector' => $layout_parcial->sector->descripcion,\n 'detalles' => $detalles,\n 'usuario_cargador' => $layout_parcial->usuario_cargador,\n 'usuario_fiscalizador' => $layout_parcial->usuario_fiscalizador,\n ];\n }", "function detailActeur($nom)\n {\n\n $file_db_acteurs_du_film = new PDO(\"sqlite:../../../BD/base_de_donnes_FILM.sqlite\");\n\n $id_film = $file_db_acteurs_du_film->query(\"SELECT code_film FROM films WHERE titre='$nom'\"); //---> sortie The mask : [2]\n\n $donnee = $id_film->fetch();\n\n //echo $donnee[0];\n\n $films = $file_db_acteurs_du_film->query(\"SELECT * FROM films WHERE code_film ='$donnee[0]'\"); // sortie toute les infos sur le film.\n\n $id_acteur = $file_db_acteurs_du_film ->query(\"SELECT * FROM ACTEURDANSFILM NATURAL JOIN acteurs WHERE ref_code_film ='$donnee[0]' and ref_code_acteur=code_indiv\"); // sort les id des acteurs en fonction de l'id du film au dessus.\n\n echo \"<fieldset id = 'blanc'> \";\n echo \"<h3 id='centrer'> -------------------------- ACTEUR(S) --------------------------</h3>\";\n echo \"<ul id='liste'><br>\";\n while($donnee2 = $id_acteur->fetch()){\n echo \"<a href='../Recherche/reponse_acteur.php?nom_recherche=\" . $donnee2['code_indiv'] . \"' ><li><br><br><h2> \" . $donnee2['prenom'] .\" \".$donnee2['nom'].\"</h2><br><img src = '../images/acteurs/\" . $donnee2['image'] .\" ' style = 'width:50%'><br><br></li></a><br>\";\n }\n $id_acteur->closeCursor();\n echo \"</ul><br>\";\n echo \"</fieldset> \";\n $file_db_acteurs_du_film = null;\n}", "public function imagen(){\n $imagenes = $this->imagenes;\n\n if ($imagenes->isNotEmpty()) {\n return $imagenes->sortBy('n_orden')->first()->imagen;\n }\n }", "function getQteArticle($numserie) {\n if (isset($this->article[$numserie]['qte'])) return ($this->article[$numserie]['qte']);\n else return 0;\n }", "function medicament($med){\n $don = json_decode($med);\n\n $this->SetFont('Arial','',15);\n $this->Cell(0,6,\"Tableau de consomation des medicaments \");\n $this->Ln();\n $this->SetFont('Times','B',12);\n $this->Cell(140,5,'Medicaments',1);\n $this->Cell(20,5,'Type',1,0,'C',0);\n $this->Cell(27,5,'Quantites',1,0,'C',0);\n $this->Ln(); \n\n $this->SetFont('Times','',12);\n foreach($don as $v){\n $this->Cell(140,5,utf8_decode($v->nom),1);\n $this->Cell(20,5,utf8_decode($v->types),1,0,'C',0);\n $this->Cell(27,5,$v->quantite,1,0,'C',0);\n $this->Ln(); \n }\n $this->Ln(); \n\n }", "public function bExamen_l(){\r\n\t\t $c=0;\r\n $sql=\"select * from texamen where descripcion like'$this->descripcion%' and tipo='LABORATORIO' \";\r\n\t\t$cursor=parent::ejecuta_sql($sql);\t\t \r\n\t\tif($row= parent::proxima_tupla($cursor))\r\n\t\t {\r\n\t\t\t DO{\r\n\t\t\t \t$fila[$c][1]=$row[\"id_examen\"];\r\n\t\t\t\t$fila[$c][2]=$row[\"descripcion\"];\r\n\t\t\t\t$fila[$c][3]=$row[\"tipo\"];\r\n\t\t\t\t$c++;\r\n\t\t\t\t}while($row= parent::proxima_tupla($cursor));\r\n\t\t }\t\t\r\n\t\tif ( $fila>0 )\r\n\t\t\treturn $fila;\r\n\t\telse\r\n\t\t\treturn -1;\r\n\t\t\t\r\n\t\t\tparent::cerrar_bd();\r\n }", "function pegaDadosEtiquetas()\n\t{\n\t\tif(!$this->layer){return \"erro\";}\n\t\t$itens = $this->layer->getmetadata(\"ITENS\");\n\t\t$itens = explode(\",\",$itens);\n\t\t$itensdesc = mb_convert_encoding($this->layer->getmetadata(\"ITENSDESC\"),\"UTF-8\",\"ISO-8859-1\");\n\t\t$itensdesc = explode(\",\",$itensdesc);\n\t\t$itenslink = $this->layer->getmetadata(\"ITENSLINK\");\n\t\t$itenslink = explode(\",\",$itenslink);\n\n\t\t$tips = $this->layer->getmetadata(\"TIP\");\n\n\t\t$res = array(\n\t\t\t\t\"itens\"=>$itens,\n\t\t\t\t\"itensdesc\"=>array_combine($itens,$itensdesc),\n\t\t\t\t\"itenslink\"=>array_combine($itens,$itenslink),\n\t\t\t\t\"tips\"=>explode(\",\",$tips),\n\t\t\t\t\"itembuscarapida\"=>$this->layer->getmetadata(\"itembuscarapida\")\n\t\t);\n\t\treturn($res);\n\t}", "public function articles_get(){\r\n if($this->dx_auth->is_logged_in())\r\n $__uri = $this->get(\"m_uri\");\r\n else\r\n $__uri=array(\"id\"=>0);\r\n\r\n // $art[\"domain\"] = $__uri[\"domain\"];\r\n $art[\"art\"] = $this->articles(\"\",\"\",$__uri[\"id\"]);\r\n\r\n foreach ($art[\"art\"] as $key => &$value) {\r\n $img=explode(\",\",$value[\"name\"]);\r\n $value[\"name\"]=site_url('application/assets/application/img/post/post_'.$__uri[\"id\"].'/'.$img[0]);\r\n $value[\"description\"]=strip_tags(html_entity_decode($value[\"description\"]),\"<p>\");\r\n $value[\"description\"]=substr(strip_tags(html_entity_decode($value[\"description\"])),0,150).(strlen(html_entity_decode($value[\"description\"]))>150?\"....\":\"\");\r\n //$value[\"video\"]=($value[\"video\"] ? html_entity_decode($value[\"video\"]) : \"\");\r\n // $value[\"url_title\"]=site_url($__uri[\"domain\"].\"/\".urls_amigables($value['category']).\"/$value[id]/\".urls_amigables($value['title']));\r\n //$value[\"url_cat\"]=site_url($__uri[\"domain\"].\"/\".urls_amigables($value['category']));\r\n \r\n }\r\n\r\n if(count($art[\"art\"])==0)\r\n $art=\"\";\r\n \r\n $_res = format_response($art,'success','ok',false);\r\n $this->response($_res,200); \r\n\r\n }", "function entetecarte($IDDNR,$TYPECARTE)\n {\n\t//1ere page\n\t//face droite\n\t$this->AddPage('p','A5');\n\t$this->SetDisplayMode('fullpage','single');//mode d affichage \n\t$this->Image('../public/images/photos/LOGOAO.GIF',105,25,15,15,0);//image (url,x,y,hauteur,largeur,0)\n\t$this->SetFont('Arial','B',6);\n\t$this->RoundedRect(78, 1, 70, 100, 2, $style = '');\n\t$this->SetTextColor(225,0,0); \n\t$this->Text(82,10,\"REPUBLIQUE ALGERIENNE DEMOCRATIQUE ET POPULAIRE \");\n\t$this->Text(96,15,\"AGENCE NATIONALE DU SANG\");\n\t$this->Text(90,20,\"AGENCE REGIONALE DU SANG \".$this->nbrtostring($this->db_name,\"ars\",\"IDARS\",$this->REGION(),\"WILAYAS\"));\n\t$this->SetTextColor(0,0,0); \n\t$this->Line(80 ,23 ,145 ,23 );\n\t$this->SetFont('Arial','B',14);\n\t$this->Text(104,48,\"CARTE\");\n\t$this->Text(88,53,$TYPECARTE);\n\t$this->SetFont('Arial','B',8);\n\t$this->Text(90,60,\"Structure de Transfusion Sanguine:\");\n\t$this->Text(90,65,$this->nbrtostring($this->db_name,\"cts\",\"IDCTS\",$this->STRUCTURE(),\"CTS\"));\n\t$this->Text(90,70,\"wilaya de \".$this->nbrtostring($this->db_name,\"wrs\",\"IDWIL\",$this->WILAYA(),\"WILAYAS\"));\n\t$this->SetFont('Arial','B',7);\n\t$this->Text(80,84,\"Numéro d'identification du donneur:\");//\n\t$this->Text(80,98,\"Delivrée le:\");\n\t$this->SetFont('Arial','B',8);\n\t$this->SetTextColor(225,0,0);\n\t$this->Text(93,98,date('d/m/Y'));\n\t$this->SetTextColor(0,0,0);\n\t$this->Code39(80,85 , $IDDNR, $baseline=0.5, $height=5);\n\t}", "public function especiais()\n {\n $metaTags = [\n 'title' => 'Displan Saúde - Planos empresariais',\n 'description' => 'Displan Seguros. Planos diferenciados para empresas, profissionais e individuais.',\n 'keywords' => 'Displan, Seguros, Preços'\n ];\n\n $dados = array(\n 'operadoras' => $this->operadoras->getByCategory('especiais'),\n 'categorias' => $this->categorias->all(),\n 'metaTags' => $metaTags,\n 'breadcrumb' => [\n ['title' => 'Home', 'url' => '/', 'class' => ''],\n ['title' => 'Planos para Profissionais', 'url' => 'planos-especiais/', 'class' => 'active']\n ]\n );\n\n $this->load->view('inc/header', $dados);\n $this->load->view('planos/especiais', $dados);\n $this->load->view('inc/footer');\n }", "public function imagenes() {\n return $imagenes = ImagenesProducto::where('fk_producto',$this->codigo) -> orderBy('featured','desc') -> get(); //para mostrar las imagenes ordenadas por las destacada\n }", "public function catalogos() \n\t{\n\t}", "function listar_producto_imagen2($localidad){\n\t\t$sql=\"SELECT * FROM producto, imagen WHERE categoria_pro='9' AND galeria_image=id_pro AND tabla_image='Producto' AND disponible_pro='1' AND \n\t\t\t(nombre_pro LIKE '%' '\".$localidad.\"' '%' OR \n\t descripcion_pro LIKE '%' '\".$localidad.\"' '%') \n\t\t\tGROUP BY id_pro ORDER BY RAND() ASC\";\n\t\t\n\t\t//echo $sql;\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$this->mensaje=\"si\";\n\t\t\tsetlocale(LC_ALL, 'es_ES');\n\t\t\t//$resultado['nombre_pro']=ucwords(strtolower($resultado['nombre_pro']));\n\t\t\t$resultado['detal_pro']=$this->convertir_moneda($resultado['detal_pro']);\n\t\t\t$resultado['mayor_pro']=$this->convertir_moneda($resultado['mayor_pro']);\n\t\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat'\";\n\t\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t\t\n\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t$temp=$resultado['limite_pro'];\n\t\t\t$resultado['limite_pro']=\"\";\n\t\t\t//echo \"Numero: \".$temp;\n\t\t\t\n\t\t\tfor($i=1;$i<=$temp;$i++){\n\t\t\t\tif($i<=12)\n\t\t\t\t\t$resultado['limite_pro'][]=$i;\n\t\t\t}\n\t\t\t$this->descripcion=$resultado['descripcion_pro'];\n\t\t\t$resultado['descripcion_pro']=strip_tags($resultado['descripcion_pro']);\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "public function id_tarjeta();", "function graficoLinha() {\n $maxValue = $this->desenhaBase();\n\n $labelY = $this->margem;\n $idx = 0;\n foreach ($this->vetor as $label => $item) {\n $idx++;\n $color = $this->getColor($idx);\n $this->desenhaLinha($item, $color, $maxValue);\n $this->desenhaLabel($label, $color, $labelY);\n $labelY += ($this->margem * 2);\n }\n }", "public function masodik()\n {\n }", "public function getIdArt()\n {\n return $this->idArt;\n }", "function listar_producto_nuevo2(){\n\t\t$sql=\"SELECT claves_pro, categoria_pro, id_pro, detal_pro, mayor_pro, directorio_image, nombre_image, marca_pro, nombre_pro, limite_pro, descripcion_pro FROM producto, imagen WHERE categoria_pro!='4' AND galeria_image=id_pro AND tabla_image='Producto' AND disponible_pro='1' AND nombre_image='portada' GROUP BY id_pro ORDER BY categoria_pro DESC, RAND() LIMIT 0,4\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$aux=\"\";\n\t\t\t$this->mensaje=\"si\";\n\t\t\t$resultado['detal_pro']=$this->mostrar_precio($this->convertir_moneda($resultado['detal_pro']));\n\t\t\t$resultado['mayor_pro']=$this->mostrar_precio($this->convertir_moneda($resultado['mayor_pro']));\n\t\t\t$resultado['descripcion_pro']=strip_tags($resultado['descripcion_pro']);\n\t\t\t\n\t\t\t$temp=$resultado['limite_pro'];\n\t\t\t$resultado['limite_pro']=\"\";\n\t\t\t//echo \"Numero: \".$temp;\n\t\t\t\n\t\t\tfor($i=1;$i<=$temp;$i++){\n\t\t\t\tif($i<=12) $resultado['limite_pro'][]=$i; else break;\n\t\t\t}\n\t\t\t\n\t\t\t\t$cat=$resultado['categoria_pro'];\n\t\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat'\";\n\t\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "function matricularVehiculo(){\r\n $mat_aleatoria= rand();\r\n\r\n $enc=false;\r\n $pos=0;\r\n for($i=0;$i<count($this->vehiculos)&&($enc==false;$i++){\r\n if($this->vehículos[$i]!= null){\r\n if($this->vehículos[$i]!= null){\r\n $this->vehiculos[$i]->setMatricula($mat_aleatoria);\r\n $enc=true;\r\n $pos=$i;\r\n }\r\n } \r\n } \r\n return $this->vehiculos[$pos];\r\n }", "function traiteFichierLieuDMF($t_filename,$t_idno_prefix,$nb_lignes_vides=0,$ligne_limite=0) {\n\tglobal $pn_locale_id, $VERBOSE, $DEBUG;\n\tglobal $vn_list_item_type_concept,$vn_list_item_label_synonym,$vn_place_other;\n\tglobal $t_list;\n\t\n\t$result= 0;\n\t$row = 1;\n\t$parent = array ();\n\t$nb_tab_pre=0;\n\t\n\t$explode_separator_array = array();\n\t$explode_separator_array[1][\"separator\"]=\" = \";\n\t$explode_separator_array[1][\"label_type\"]=$vn_list_item_label_synonym;\n\t\n\tprint \"traitement des lieux\\n\";\n\t\n\tif (($handle = fopen($t_filename, \"r\")) !== FALSE) {\n\t\t$contenu_fichier = file_get_contents($t_filename);\n\t\t$total=substr_count($contenu_fichier, \"\\n\");\n\t\t$contenu_fichier=\"\";\n\t\t\n\t\t$data=\"\";\n\t $parent_selected=1;\t\t\t\t\n\t\t\n\t while (($data = fgets($handle)) !== FALSE) {\n\t\t\t$libelle = str_replace(\"\\t\", \"\", $data);\n\t\t\t$libelle = str_replace(\"\\r\\n\", \"\", $libelle);\n\t\t\t\n\t\t\t// comptage du nb de tabulation pour connaître le terme parent\n\t\t\t$nb_tab = substr_count($data,\"\\t\");\n\t $row++;\n\t \n\t // Si aucune information n'est à afficher, on affiche une barre de progression\n\t if ((!$DEBUG) && (!$VERBOSE)) {\n\t \tshow_status($row, $total);\n\t }\n\t \n\t if (($row > $nb_lignes_vides + 1) && ($libelle !=\"\")) {\n\t\t \n\t\t if ($row == $ligne_limite) {\n\t\t \tprint \"limite atteinte : \".$ligne_limite.\" \\n\";\n\t\t \tbreak;\n\t\t \t//die();\n\t\t }\n\t\n\t\t\t\t// si plus d'une tabulation\n\t\t\t\tif (($nb_tab_pre != $nb_tab) && ($nb_tab > 0)) {\n\t\t\t\t\t$parent_selected=$parent[$nb_tab - 1];\n\t\t\t\t} elseif ($nb_tab == 0) {\n\t\t\t\t\t$parent_selected=1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// débuggage\n\t\t\t\tif ($DEBUG) print \"(\".$parent_selected.\") \".$nb_tab.\" \".$libelle;\n\t\t\t\t\n\t\t\t\t// insertion dans la liste\n\t\t\t\tif ($vn_place_id=getPlaceID($libelle, $t_idno_prefix.\"_\".($row-$nb_lignes_vides), $vn_place_other, $parent_selected, $explode_separator_array)) {\n\t\t\t\t} else {\n\t\t\t\t\tprint \"PLACE CREATION FAILED : \".$libelle.\" \";\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\n\t\t $parent[$nb_tab]=$vn_place_id;\n\t\t\t\t\n\t }\n\t \n\t $nb_tab_pre=$nb_tab;\n\t }\n\t fclose($handle);\n\t \tif ($VERBOSE) { print \"dmf_\".$t_idno_prefix.\" treated.\\n\";}\n\t \t$result = true;\n\t} else {\n\t\tprint \"le fichier n'a pu être ouvert.\";\n\t\t$result=false;\n\t} \n\treturn $result;\t\n}", "public function run()\n {\n $artistas = array('Alan Rickman','Alejandro G. Iñárritu','Alfie Allen','Amy Adams','Anthony Hopkins','Anya Taylor-Joy','Arnold Schwarzenegger','Ben Affleck','Bill Camp','Billy Zane','Bonnie Bedelia','Bruce Willis','Carrie-Anne Moss','Chad Stahelski','Charlize Theron','Chloe Pirrie','Chris Hemsworth','Chris Pine','Christopher Nolan','Christopher Walken','Connie Nielsen','Dafne Keen','Daniel Stern','Djimon Hounsou','Edward Furlong','Edward Zwick','Elliot Page','Gal Gadot','Gary Sinise','George Miller','Giancarlo Esposito','Gina Carano','Harrison Ford','Helen Hunt','Henry Cavill','Hugh Jackman','James Cameron','James Mangold','Jason Momoa','Jennifer Connelly','Jim Carrey','Joaquin Phoenix','Joe Pesci','John Hughes','John McTiernan','Jon Favreau','Jonah Hill','Joseph Gordon-Levitt','Kate Winslet','Keanu Reeves','Kelley','Kenneth Branagh','Kristen Wiig','Lana Wachowski','Laurence Fishburne','Leonardo DiCaprio','Linda Hamilton','Macaulay Culkin','Margot Robbie','Martin Scorsese','Michael Biehn ','Michael Nyqvist','Natalie Portman','Nicholas Hoult','Patrick Stewart','Patty Jenkins','Paul Sanchez','Pedro Pascal','Ridley Scott','Robert De Niro','Robert Zemeckis','Robin Wright','Ron Howard','Russell Crowe','Rutger Hauer','Scott Frank','Sean Young','Steven Spielberg','Taylor Momsen','Todd Phillips','Tom Hanks','Tom Hardy','Will Poulter','Zack Snyder','Zazie Beetz');\n foreach ($artistas as $nomArtista) {\n $artista = new Artista();\n $artista->nombre = $nomArtista;\n $artista->save();\n }\n }", "public function getArtikel(){\n $top = Informasi::select(\"*\")->orderBy(\"created_at\", \"desc\")->take(1)->get();\n $artikels = Informasi::select(\"*\")->orderBy(\"created_at\", \"desc\")->skip(1)->take(2)->get();\n return view('welcome', ['top'=>$top], ['artikels'=>$artikels]);\n }", "function pdf_index_planoestudo($id = null){\n Configure::write('debug',0); // Otherwise we cannot use this method while developing\n $planoestudo = $this->Planoestudo->findById($id);// quando quer trazer dados por id\n //$cursos = $this->Planoestudo->Curso->find('list',array('conditions'=>array('')));\n $disciplinas = $this->Planoestudo->getAllDisciplinasByPlanoEstudo($id);\n\t $this->set(compact('cursos','disciplinas','planoestudo'));\n\t\t//var_dump($disciplinas);\n\t\t//var_dump($planoestudo);\n $listas = array();\n $teste = array();\n $teste[] = $id;\n $teste[] = $planoestudo['Planoestudo']['name'];\n $teste[] = $planoestudo['Curso']['name'];\n foreach( $disciplinas as $m){\n $lista = array();\n $lista[] = $m['d']['codigo'];\n $lista[] = $m['d']['name'];\n\t $lista[] = $m['p']['ano'];\n $lista[] = $m['p']['semestre'];\n\t\t\t\t$lista[] = $m['p']['cargahorariateoricas'];\n\t\t\t\t$lista[] = $m['p']['cargahorariapraticas'];\n $listas[] =$lista;\n }\n\n\n\n\n // $teste[] = $this->data['Planoestudoano'][\"name\"];\n \n $this->set('teste1',$teste);\n $this->set('lista',$listas);\n $this->layout = 'pdf'; //this will use the pdf.ctp layout,comenta quando quer visualizar as variaveis\n //$this->render('/t0005planoestudos/pdf_teste');\n\t $this->render(); // comenta quando quer visualizar as variaveis\n }", "public function mostraVetrina()\n\t\t{\n\t\t\tif( isset($this->vetrine) )\n\t\t\t{\n\t\t\t\tif( ($listaVetrineTemp = array_keys($this->vetrine)) )\n\t\t\t\t{\n\t\t\t\t\t$this->caricaElementiVetrine();\n\t\t\t\t\t\n\t\t\t\t\tforeach( $listaVetrineTemp as $vetrina )\n\t\t\t\t\t\tif( !empty($this->vetrine[$vetrina]['listaElem']) )\n\t\t\t\t\t\t\t$listaVetrine[] = $vetrina;\n\t\t\t\t\t\n\t\t\t\t\tif( !isset($listaVetrine) ) return;\n\t\t\t\t\t\n\t\t\t\t\t$count = 0;\n\t\t\t\t\t$righe = (int)(count($listaVetrine)/NUMVETRINEPERRIGA);\n\t\t\t\t\t$resto = count($listaVetrine)%NUMVETRINEPERRIGA;\n\t\t\t\t\t\n\t\t\t\t\t//creo matrice , dove la riga n identifica la vetrina n-esima, la colonna m il file m-esimo, e all'incrocio il file m-esimo della vetrina n-esima\n\t\t\t\t\tfor($i = 0; $i < count($listaVetrine); $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$j=0;\n\t\t\t\t\t\t$tmp[$i][] = strtok($this->vetrine[$listaVetrine[$i]]['listaElem'], \":\");\n\t\t\t\t\t\twhile( $tmp[$i][$j] !== false )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$tmp[$i][] = strtok(\":\");\n\t\t\t\t\t\t\t$j++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\twhile( $righe > 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"<table class=\\\"vetrina\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\">\";\n\t\t\t\t\t\t\techo \"<tr>\";\n\t\t\t\t\t\t\t\tfor($i = 0; $i < NUMVETRINEPERRIGA; $i++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif( NUMVETRINEPERRIGA == 3 )\n\t\t\t\t\t\t\t\t\t\techo \"<td width=\\\"33%\\\" class=\\\"titolovetrina\\\" colspan=\\\"2\\\">\".$listaVetrine[(NUMVETRINEPERRIGA*$count)+$i].\"</td>\";\n\t\t\t\t\t\t\t\t\telse if( NUMVETRINEPERRIGA == 4 )\n\t\t\t\t\t\t\t\t\t\techo \"<td width=\\\"25%\\\" class=\\\"titolovetrina\\\" colspan=\\\"2\\\">\".$listaVetrine[(NUMVETRINEPERRIGA*$count)+$i].\"</td>\";\n\t\t\t\t\t\t\t\t\telse if( NUMVETRINEPERRIGA == 5 )\n\t\t\t\t\t\t\t\t\t\techo \"<td width=\\\"20%\\\" class=\\\"titolovetrina\\\" colspan=\\\"2\\\">\".$listaVetrine[(NUMVETRINEPERRIGA*$count)+$i].\"</td>\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\techo \"</tr>\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor($i = 0; $i < MAXELEMPERVETRINA; $i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo \"<tr>\";\n\t\t\t\t\t\t\t\t\tfor($j = 0; $j < NUMVETRINEPERRIGA; $j++)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif( !empty($tmp[(NUMVETRINEPERRIGA*$count)+$j][$i]) )\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$nomeElemento = $tmp[(NUMVETRINEPERRIGA*$count)+$j][$i];\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif( ($data = substr($nomeElemento, 0, 10)) !== false )\n\t\t\t\t\t\t\t\t\t\t\t\techo \"<td class=\\\"datavetrina\\\"><span class=\\\"day\\\">\".htmlentities(date(\"d\", strtotime($data))).\"</span><br><span class=\\\"month\\\">\".htmlentities(engtoita(date(\"M\", strtotime($data)))).\"</span></td>\";\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\techo \"<td class=\\\"datavetrina\\\"></td>\";\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif( NUMVETRINEPERRIGA == 3 )\n\t\t\t\t\t\t\t\t\t\t\t\techo \"<td width=\\\"33%\\\"><a class=\\\"titolo ricerca pos\".$i.\"\\\" href=\\\"#\\\">\".htmlentities(substr($nomeElemento, 19)).\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\telse if( NUMVETRINEPERRIGA == 4 )\n\t\t\t\t\t\t\t\t\t\t\t\techo \"<td width=\\\"25%\\\"><a class=\\\"titolo ricerca pos\".$i.\"\\\" href=\\\"#\\\">\".htmlentities(substr($nomeElemento, 19)).\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\telse if( NUMVETRINEPERRIGA == 5 )\n\t\t\t\t\t\t\t\t\t\t\t\techo \"<td width=\\\"20%\\\"><a class=\\\"titolo ricerca pos\".$i.\"\\\" href=\\\"#\\\">\".htmlentities(substr($nomeElemento, 19)).\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif( (INFO == \"si\") && (($count == 0) && ($j == 0)) )\n\t\t\t\t\t\t\t\t\t\t\t\techo \"<div><a class=\\\"trailer\\\" href=\\\"#\\\"><b>T</b>&nbsp;R&nbsp;A&nbsp;I&nbsp;L&nbsp;E&nbsp;R</a></div>\";\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo \"</td>\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\techo \"<td></td><td></td>\";\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\techo \"</tr>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"</table>\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t$righe--;\n\t\t\t\t\t\t$count++;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tif( $resto > 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"<table class=\\\"vetrina\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\">\";\n\t\t\t\t\t\t\techo \"<tr>\";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor($i = 0; $i < $resto; $i++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif( NUMVETRINEPERRIGA == 3 )\n\t\t\t\t\t\t\t\t\t\techo \"<td width=\\\"33%\\\" class=\\\"titolovetrina\\\" colspan=\\\"2\\\">\".$listaVetrine[(NUMVETRINEPERRIGA*$count)+$i].\"</td>\";\n\t\t\t\t\t\t\t\t\telse if( NUMVETRINEPERRIGA == 4 )\n\t\t\t\t\t\t\t\t\t\techo \"<td width=\\\"25%\\\" class=\\\"titolovetrina\\\" colspan=\\\"2\\\">\".$listaVetrine[(NUMVETRINEPERRIGA*$count)+$i].\"</td>\";\n\t\t\t\t\t\t\t\t\telse if( NUMVETRINEPERRIGA == 5 )\n\t\t\t\t\t\t\t\t\t\techo \"<td width=\\\"20%\\\" class=\\\"titolovetrina\\\" colspan=\\\"2\\\">\".$listaVetrine[(NUMVETRINEPERRIGA*$count)+$i].\"</td>\";\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfor($resto1 = $resto; $resto1 < NUMVETRINEPERRIGA; $resto1++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif( NUMVETRINEPERRIGA == 3 )\n\t\t\t\t\t\t\t\t\t\techo \"<td width=\\\"33%\\\" class=\\\"padding\\\"></td>\";\n\t\t\t\t\t\t\t\t\telse if( NUMVETRINEPERRIGA == 4 )\n\t\t\t\t\t\t\t\t\t\techo \"<td width=\\\"25%\\\" class=\\\"padding\\\"></td>\";\n\t\t\t\t\t\t\t\t\telse if( NUMVETRINEPERRIGA == 5 )\n\t\t\t\t\t\t\t\t\t\techo \"<td width=\\\"20%\\\" class=\\\"padding\\\"></td>\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\techo \"</tr>\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor($i = 0; $i < MAXELEMPERVETRINA; $i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo \"<tr>\";\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tfor($j = 0; $j < $resto; $j++)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif( !empty($tmp[(NUMVETRINEPERRIGA*$count)+$j][$i]) )\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$nomeElemento = $tmp[(NUMVETRINEPERRIGA*$count)+$j][$i];\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif( ($data = substr($nomeElemento, 0, 10)) !== false )\n\t\t\t\t\t\t\t\t\t\t\t\techo \"<td class=\\\"datavetrina\\\"><span class=\\\"day\\\">\".htmlentities(date(\"d\", strtotime($data))).\"</span><br><span class=\\\"month\\\">\".htmlentities(engtoita(date(\"M\", strtotime($data)))).\"</span></td>\";\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\techo \"<td class=\\\"datavetrina\\\"></td>\";\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif( NUMVETRINEPERRIGA == 3 )\n\t\t\t\t\t\t\t\t\t\t\t\techo \"<td width=\\\"33%\\\"><a class=\\\"titolo ricerca pos\".$i.\"\\\" href=\\\"#\\\">\".htmlentities(substr($nomeElemento, 19)).\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\telse if( NUMVETRINEPERRIGA == 4 )\n\t\t\t\t\t\t\t\t\t\t\t\techo \"<td width=\\\"25%\\\"><a class=\\\"titolo ricerca pos\".$i.\"\\\" href=\\\"#\\\">\".htmlentities(substr($nomeElemento, 19)).\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\telse if( NUMVETRINEPERRIGA == 5 )\n\t\t\t\t\t\t\t\t\t\t\t\techo \"<td width=\\\"20%\\\"><a class=\\\"titolo ricerca pos\".$i.\"\\\" href=\\\"#\\\">\".htmlentities(substr($nomeElemento, 19)).\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif( (INFO == \"si\") && (($count == 0) && ($j == 0)) )\n\t\t\t\t\t\t\t\t\t\t\t\techo \"<div><a class=\\\"trailer\\\" href=\\\"#\\\"><b>T</b>&nbsp;R&nbsp;A&nbsp;I&nbsp;L&nbsp;E&nbsp;R</a></div>\";\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo \"</td>\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\techo \"<td></td><td></td>\";\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\tfor($resto1 = $resto; $resto1 < NUMVETRINEPERRIGA; $resto1++)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif( NUMVETRINEPERRIGA == 3 )\n\t\t\t\t\t\t\t\t\t\t\techo \"<td width=\\\"33%\\\" class=\\\"padding\\\" align=\\\"center\\\" width=\\\"20%\\\"></td>\";\n\t\t\t\t\t\t\t\t\t\telse if( NUMVETRINEPERRIGA == 4 )\n\t\t\t\t\t\t\t\t\t\t\techo \"<td width=\\\"25%\\\" class=\\\"padding\\\" align=\\\"center\\\" width=\\\"20%\\\"></td>\";\n\t\t\t\t\t\t\t\t\t\telse if( NUMVETRINEPERRIGA == 5 )\n\t\t\t\t\t\t\t\t\t\t\techo \"<td width=\\\"20%\\\" class=\\\"padding\\\" align=\\\"center\\\" width=\\\"20%\\\"></td>\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo \"</tr>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"</table>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function show_article_short($order_id) {\n global $articles;\n foreach($articles as $article) {\n if ($article['order'] == $order_id) {\n echo render_article_short($article);\n break;\n }\n }\n}", "function slideProjeto($categoria, $pasta, $quantidadeFotos){\n\t\t$qtd = $quantidadeFotos;\n\t\t\n\t\tfor($i = 1; $i <= $qtd; $i++): ?>\n\t\t\t<li><img src=\"imagens/fotos/<?=$categoria?>/<?=$pasta?>/<?=$i?>.jpg\"/></li>\n\t\t<?php endfor;\n\t}", "public function magias1() {\n $magias = Magia::where('nivel', 'like', '%1%')->get();\n return $magias;\n }", "function __getSemaforoInvertido() {\n\t\tglobal $mdb2;\n\t\tglobal $log;\n\t\tglobal $current_usuario_id;\n\n\t\t/* OBTENER LOS DATOS Y PARSEARLO */\n\t\t$sql = \"SELECT * FROM reporte.semaforo(\".\n\t\t\t\tpg_escape_string($current_usuario_id).\")\";\n\t\t$res =& $mdb2->query($sql);\n\t\tif (MDB2::isError($res)) {\n\t\t\t$log->setError($sql, $res->userinfo);\n\t\t\texit();\n\t\t}\n\n\t\t$row = $res->fetchRow();\n\t\t$dom = new DomDocument();\n\t\t$dom->preserveWhiteSpace = false;\n\t\t$dom->loadXML($row[\"semaforo\"]);\n\t\t$xpath = new DOMXpath($dom);\n\t\tunset($row[\"semaforo\"]);\n\n\t\t/* SI NO HAY DATOS MOSTRAR MENSAJE */\n\t\tif (!$xpath->query('//datos/dato')->length) {\n\t\t\treturn $this->resultado = $this->__generarContenedorSinDatos();\n\t\t}\n\n\t\t$conf_objetivos = $xpath->query('//objetivos/objetivo[@objetivo_id>0]');\n\t\t$conf_nodos = $xpath->query('//propiedades/nodos/nodo[@nodo_id!=0]');\n\n\t\t/* TEMPLATE DEL GRAFICO */\n\t\t$T =& new Template_PHPLIB(($this->extra[\"imprimir\"])?REP_PATH_PRINTTEMPLATES:REP_PATH_TABLETEMPLATES);\n\t\t$T->setFile('tpl_tabla', 'semaforo_invertido.tpl');\n\t\t$T->setBlock('tpl_tabla', 'TIENE_TOOLTIP', 'tiene_tooltip');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_OBJETIVOS', 'lista_objetivos');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_OBJETIVOS0', 'lista_objetivos0');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_OBJETIVO_VACIO', 'lista_objetivo_vacio');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_MONITORES0', 'lista_monitores0');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_MONITORES', 'lista_monitores');\n\n\t\t$T->setVar('__item_id', $this->__item_id);\n\t\t$T->setVar('__item_id_nuevo', REP_ITEM_EVENTOS);\n\t\t$T->setVar('__ancho_tabla', ($this->extra[\"popup\"])?'':'514px');\n\t\t$T->setVar('__display_botones', ($this->extra[\"popup\"])?'none':'inline');\n\t\t$T->setVar('__popup', ($this->extra[\"popup\"])?'1':'0');\n\n\t\t$tooltip_id = 0;\n\t\t$num_monitor = 0;\n\t\t$T->setVar('lista_monitores_estado','');\n\t\tforeach ($conf_nodos as $conf_nodo) {\n\t\t\t$T->setVar('__monitor_id', $conf_nodo->getAttribute('nodo_id'));\n\t\t\t$T->setVar('__monitor_nombre', $conf_nodo->getAttribute('titulo'));\n\t\t\t$T->setVar('__monitor_ubicacion', $conf_nodo->getAttribute('subtitulo'));\n\t\t\t$T->setVar('__monitor_color', (($num_monitor % 2) == 0)?'e9e9e9':'d4d4d4');\n\t\t\t$T->setVar('lista_objetivos', '');\n\n\t\t\tforeach ($conf_objetivos as $conf_objetivo) {\n\t\t\t\t$T->setVar('__objetivo_id', $conf_objetivo->getAttribute('objetivo_id'));\n\t\t\t\t$T->setVar('__objetivo_nombre', $conf_objetivo->getAttribute('nombre'));\n\t\t\t\t$T->setVar('__objetivo_servicio', $conf_objetivo->getAttribute('servicio'));\n\t\t\t\t$T->setVar('__tooltip_id', $tooltip_id);\n\n\t\t\t\t$tag_dato = $xpath->query('//detalle[@objetivo_id='.$conf_objetivo->getAttribute('objetivo_id').']/detalles/detalle[@nodo_id='.$conf_nodo->getAttribute('nodo_id').']/datos/dato')->item(0);\n\n\t\t\t\tif ($tag_dato != null) {\n\t\t\t\t\t$conf_semaforo = $xpath->query('//semaforos/semaforo[@semaforo_id='.$tag_dato->getAttribute('semaforo_id').']')->item(0);\n\n\t\t\t\t\t$T->setVar('__evento_nombre', $conf_semaforo->getAttribute('nombre'));\n\t\t\t\t\t$T->setVar('__evento_descripcion', $conf_semaforo->getAttribute('descripcion'));\n\t\t\t\t\t$T->setVar('__evento_icono', REP_PATH_SPRITE_SEMAFORO.substr($conf_semaforo->getAttribute('icono'), 0, -4));\n\t\t\t\t\t$T->setVar('__evento_duracion', Utiles::formatDuracion($tag_dato->getAttribute('duracion'), 0));\n\t\t\t\t\t$T->parse('tiene_tooltip', 'TIENE_TOOLTIP', false);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$T->setVar('__evento_nombre', '');\n\t\t\t\t\t$T->setVar('__evento_icono', 'sprite sprite-vacio');\n\t\t\t\t\t$T->setVar('__evento_duracion', '');\n\t\t\t\t\t$T->setVar('tiene_tooltip', '');\n\t\t\t\t}\n\n\t\t\t\t$tooltip_id++;\n\t\t\t\t$T->parse('lista_objetivos', 'LISTA_OBJETIVOS', true);\n\n\t\t\t\tif ($num_monitor == 0) {\n\t\t\t\t\t$T->parse('lista_objetivos0', 'LISTA_OBJETIVOS0', true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$T->parse('lista_monitores0', 'LISTA_MONITORES0', true);\n\t\t\t$T->parse('lista_monitores', 'LISTA_MONITORES', true);\n\t\t\t$num_monitor++;\n\t\t}\n\n\t\t$T->setVar('lista_objetivo_vacio', '');\n\t\t$count_objetivo = $xpath->query('/atentus/resultados/propiedades/objetivos/objetivo[@objetivo_id>0]')->length;\n\t\tif (($count_objetivo % 6) != 0 and !$this->extra[\"popup\"]) {\n\t\t\tfor ($i = ($count_objetivo % 6); $i <= 6; $i++) {\n\t\t\t\t$T->parse('lista_objetivo_vacio', 'LISTA_OBJETIVO_VACIO', true);\n\t\t\t}\n\t\t}\n\t\t$this->tiempo_expiracion = (strtotime($xpath->query(\"//fecha_expiracion\")->item(0)->nodeValue) - strtotime($xpath->query(\"//fecha\")->item(0)->nodeValue));\n\n\t\treturn $T->parse('out', 'tpl_tabla');\n\t}", "public function RicercaPerIngredienti(){\n $pm = FPersistentManager::getInstance();\n $cibi = $pm->loadAllObjects();\n $view = new VRicerca();\n $view->mostraIngredienti($cibi);\n }", "private function checkOTOF($listeOT, $repo, $Art, $Creno) {\n\n $Horizon=10;\n //On va chercher les OT dans la CTJ pour chacun des CTO\n //On va commencer par regarder pour chaque OT de mon CTO si un OF existe dans mon CTJ\n $p=0;\n $TbDatasArt=[];\n foreach ($listeOT as $OTCTO) {\n //On cherche les articles liés à chaque OT\n $ArtOFCTJ=$Art->myFindByOT($OTCTO->getRef());\n // Cas des OT multi empreintes\n dump('Liste des articles composant l\\'OT'.$OTCTO->getRef());\n dump($ArtOFCTJ);\n if (sizeof($ArtOFCTJ)>1) {\n dump('Attention multi empreintes à traiter');\n $retourDatas=$this->checkOFChargMultiEmp($ArtOFCTJ, $Creno, $Horizon, $repo, $Art);\n } elseif (sizeof($ArtOFCTJ)==1) {\n //Il y a une seule pièce sur l'outillage\n $retourDatas[0]=$this->checkOFCharge($ArtOFCTJ[0], $Creno, $Horizon, $repo);\n //dump($TbDatasArt);\n }\n if (empty($retourDatas)==false) {\n $TbDatasArt[$OTCTO->getRef()]=$retourDatas;\n $p++;\n }\n $retourDatas=[];\n dump('Données à retourner correspondant à la charge et à l\\'OT');\n dump($TbDatasArt);\n }\n return $TbDatasArt;\n }", "function signatures_petitions_jour($date) {\r\n\t$r = sql_select(\"sa.id_article, \r\n\t\t\t\tCOUNT(DISTINCT ss.id_signature) AS nb_sign_pet, sa.titre \r\n\t\t\t\tFROM spip_signatures ss \r\n\t\t\t\tLEFT JOIN spip_petitions sp ON ss.id_petition = sp.id_petition\r\n\t\t\t\tLEFT JOIN spip_articles sa ON sp.id_article = sa.id_article \r\n\t\t\t\tWHERE DATE_FORMAT(ss.date_time,'%Y-%m-%d') = '$date' \r\n\t\t\t\tGROUP BY sa.id_article\"\r\n\t);\r\n\r\n\t$aff = debut_cadre_relief(\"\", true)\r\n\t\t. \"<div class='bouton_droite icone36'>\\n\"\r\n\t\t. \"<a href='\" . generer_url_ecrire(\"controle_petition\") . \"' title='\"\r\n\t\t. _T('actijour:voir_suivi_petitions') . \"'>\\n\"\r\n\t\t. http_img_pack('suivi-petition-24.gif', 'ico', '', '') . \"</a>\\n\"\r\n\t\t. \"</div>\\n\\n\"\r\n\t\t. \"<br /><span class='arial2 bold'>\" . _T('actijour:signatures_petitions') . \"</span>\\n\"\r\n\t\t. \"<div style='clear:both;'></div>\\n\"\r\n\t\t. \"<ol class='verdana1' style='padding-left:30px;'>\\n\";\r\n\r\n\tif (sql_count($r)) {\r\n\t\twhile ($t = sql_fetch($r)) {\r\n\t\t\t$aff .= \"<li value='\" . $t['id_article'] . \"'>\"\r\n\t\t\t\t. $t['titre'] . \" : <b>\" . $t['nb_sign_pet'] . \"</b>\"\r\n\t\t\t\t. \"</li>\\n\";\r\n\t\t}\r\n\t} else {\r\n\t\t$aff .= \"<li value='0'>\" . _T('actijour:aucune_moment') . \"</li>\";\r\n\t}\r\n\t$aff .= \"</ol>\\n\";\r\n\t$aff .= fin_cadre_relief(true);\r\n\r\n\treturn $aff;\r\n}", "function fct_titre_page ($mescriteres) {\n\t$titre_page = \"\";\n\tforeach ($mescriteres as $ref => $infoscritere) {\n\t\tif (($infoscritere['code'] >= 0) && ($infoscritere['libelle'] != \"\")) {\n\t\t\tif ($titre_page != \"\") $titre_page .= \", \";\n\t\t\t$titre_page .= $infoscritere['libelle'];\n\t\t}\n\t}\n\tif ($titre_page == \"\") $titre_page = \"Un expert vous aide Ó identifier un arbre\";\n\telse $titre_page = \"Fleurs correspondant Ó : \".$titre_page;\n\treturn $titre_page;\n}", "public function skeleton(){\n\t\t$articolo = $this->beanLocalita->A7B7Articolo[0]; \n\t\t\n\t\t// TITLE DESCRIPTION\n\t\tIsp_Loader::loadVistaObj(\"Snippets\",\"PageElements\",\"TitleDescription\");\n\t\t$this->add(new TitleDescription($articolo->A7Tea[0]->titolo_tea));\n\t\t\n\t\t// ABSTRACT + FOTO\n\t\tIsp_Loader::loadVistaObj(\"Bones\", null, \"SchedaAbstractFoto\");\n\t\t$highlight = new SchedaAbstractFoto($this->beanLocalita,\n\t\t\t\t\t\t\t\t\t\t\t\"localita\",\n\t\t\t\t\t\t\t\t\t\t\t$this->txt,\n\t\t\t\t\t\t\t\t\t\t\t$this->_urls->colors[$this->currentTab]);\n\t\t$this->add($highlight->snpOut);\t\t\t\n\t\t\t\n\t\t// ARTICLE EXPANSION\n\t\tIsp_Loader::loadVistaObj(\"Bones\", null, \"SchedaEspansioniArticolo\");\n\t\t$espansioni = new SchedaEspansioniArticolo(\t$articolo, \n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->thisPageUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->_urls->colors[$this->currentTab]);\n\t\t$this->add($espansioni->snpOut);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t// TECHNICAL CARD\n\t\t// waiting for ambra and dany..\n\t\t\n\t\t// ANTEPRIMA 4 FOTO\n\t\tIsp_Loader::loadVistaObj(\"Bones\", null, \"SchedaAnteprimaFoto\");\n\t\t$anteprima = new SchedaAnteprimaFoto(\t$this->beanLocalita, \n\t\t\t\t\t\t\t\t\t\t\t\t\"localita\", \n\t\t\t\t\t\t\t\t\t\t\t\t$this->txt,\n\t\t\t\t\t\t\t\t\t\t\t\t$this->_urls->colors[$this->currentTab]);\n\t\t\n\t\t$this->add($anteprima->anteprimaFoto);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t// RUN IN TEMPLATE\t\t\t\t\t\t\t\n\t\treturn $this->useDefaultTemplate();\n\t}", "function EdtDuJourVertical($tab_data, $jour, $flags) \r\n{\r\n $result = \"\";\r\n $entetes = ConstruireEnteteEDT();\r\n $creneaux = ConstruireCreneauxEDT();\r\n $hauteur_demicreneaux = 20;\r\n\t$hauteur_creneaux = $hauteur_demicreneaux * 2;\r\n\t$nb_creneaux = $creneaux['nb_creneaux'];\r\n if (($nb_creneaux == 0) OR ($nb_creneaux == 1)) {\r\n $height = \"94px\";\r\n }\r\n else {\r\n $height = $nb_creneaux*2*$hauteur_demicreneaux + $hauteur_demicreneaux+1;\r\n $height = $height.\"px;\";\r\n } \r\n while (!isset($entetes['entete'][$jour])) {\r\n $jour--;\r\n }\r\n $jour_sem = $entetes['entete'][$jour];\r\n\r\n $result .= \" <div class=\\\"fond\\\">\\n\";\r\n $result .= \"<div class=\\\"colonne\\\" style=\\\"height : \".$height.\"\\\">\\n\";\r\n $jour_sem = $entetes['entete'][$jour];\r\n $result .= \"<div class=\\\"entete\\\" style=\\\"height : \".$hauteur_demicreneaux.\"px;\\\"><div class=\\\"cadre\\\">\".$jour_sem.\"</div></div>\\n\";\r\n $index_box = 0;\r\n while (isset($tab_data[$jour]['type'][$index_box]))\r\n {\r\n if ($tab_data[$jour]['type'][$index_box] == \"vide\") {\r\n $hauteur = $tab_data[$jour]['duree_valeur'][$index_box] * $hauteur_demicreneaux * 2;\r\n $hauteur = $hauteur.\"px;\";\r\n if (strpos($tab_data[$jour]['duree'][$index_box], \"demi\") !== FALSE) {\r\n $result .= \"<div class=\\\"demicellule\\\" style=\\\"height : \".$hauteur.\";\\\">\";\r\n }\r\n elseif (strpos($tab_data[$jour]['duree'][$index_box], \"tiers\") !== FALSE) {\r\n $result .= \"<div class=\\\"tierscellule\\\" style=\\\"height : \".$hauteur.\";\\\">\";\r\n }\r\n else {\r\n $result .= \"<div class=\\\"cellule\\\" style=\\\"height : \".$hauteur.\";\\\">\";\r\n }\r\n $result .= \"<div style=\\\"display:none;\\\">\".$tab_data[$jour]['affiche_creneau'][$index_box].\" - durée = \".$tab_data[$jour]['duree_valeur'][$index_box].\" heure(s)</div>\\n\";\r\n \r\n if (strpos($tab_data[$jour]['couleur'][$index_box], \"Repas\") !== FALSE) {\r\n $result .= \"<div class=\\\"cadreRepas\\\">\\n\";\r\n }\r\n else {\r\n $result .= \"<div class=\\\"cadre\\\">\\n\";\r\n }\r\n if (isset($tab_data[$jour]['extras'][$index_box])) {\r\n $result .= \"Hello\".$tab_data[$jour]['extras'][$index_box];\r\n }\r\n $result .= \"</div></div>\\n\"; \r\n\r\n }\r\n else if ($tab_data[$jour]['type'][$index_box] == \"erreur\")\r\n {\r\n $hauteur = $tab_data[$jour]['duree_valeur'][$index_box] * $hauteur_demicreneaux * 2;\r\n $hauteur = $hauteur.\"px;\";\r\n if (strpos($tab_data[$jour]['duree'][$index_box], \"demi\") !== FALSE) {\r\n $result .= \"<div class=\\\"demicellule\\\" style=\\\"height : \".$hauteur.\";\\\">\";\r\n }\r\n elseif (strpos($tab_data[$jour]['duree'][$index_box], \"tiers\") !== FALSE) {\r\n $result .= \"<div class=\\\"tierscellule\\\" style=\\\"height : \".$hauteur.\";\\\">\";\r\n }\r\n else {\r\n $result .= \"<div class=\\\"cellule\\\" style = \\\"height : \".$hauteur.\";\\\">\";\r\n }\r\n $result .= \"<div style=\\\"display:none;\\\">\".$tab_data[$jour]['affiche_creneau'][$index_box].\" - durée = \".$tab_data[$jour]['duree_valeur'][$index_box].\" heure(s)</div>\\n\";\r\n $result .= \"<div class=\\\"cadreRouge\\\">\\n\";\r\n $result .= $tab_data[$jour]['contenu'][$index_box];\r\n $result .= \"</div></div>\\n\"; \r\n\r\n }\r\n else if ($tab_data[$jour]['type'][$index_box] == \"conteneur\")\r\n {\r\n $hauteur = $tab_data[$jour]['duree_valeur'][$index_box] * $hauteur_demicreneaux * 2;\r\n $hauteur = $hauteur.\"px;\";\r\n if (strpos($tab_data[$jour]['duree'][$index_box], \"demi\") !== FALSE) {\r\n $result .= \"<div class=\\\"demicellule\\\" style =\\\"height : \".$hauteur.\";\\\">\";\r\n }\r\n elseif (strpos($tab_data[$jour]['duree'][$index_box], \"tiers\") !== FALSE) {\r\n $result .= \"<div class=\\\"tierscellule\\\" style = \\\"height : \".$hauteur.\";\\\">\";\r\n }\r\n else {\r\n $result .= \"<div class=\\\"cellule\\\" style=\\\"height : \".$hauteur.\";\\\">\";\r\n }\r\n \r\n }\r\n else if ($tab_data[$jour]['type'][$index_box] == \"cours\")\r\n {\r\n $hauteur = $tab_data[$jour]['duree_valeur'][$index_box] * $hauteur_demicreneaux * 2;\r\n $hauteur = $hauteur.\"px;\";\r\n if (strpos($tab_data[$jour]['duree'][$index_box], \"demi\") !== FALSE) {\r\n $result .= \"<div class=\\\"demicellule\\\" style=\\\"height : \".$hauteur.\";\\\">\";\r\n }\r\n elseif (strpos($tab_data[$jour]['duree'][$index_box], \"tiers\") !== FALSE) {\r\n $result .= \"<div class=\\\"tierscellule\\\" style=\\\"height : \".$hauteur.\";\\\">\";\r\n }\r\n else {\r\n $result .= \"<div class=\\\"cellule\\\" style=\\\"height : \".$hauteur.\";\\\">\";\r\n }\r\n $result .= \"<div style=\\\"display:none;\\\">\".$tab_data[$jour]['affiche_creneau'][$index_box].\" - durée = \".$tab_data[$jour]['duree_valeur'][$index_box].\" heure(s)</div>\\n\";\r\n if (strpos($tab_data[$jour]['couleur'][$index_box], \"Couleur\") !== FALSE) {\r\n $result .= \"<div class=\\\"cadreCouleur\\\">\\n\";\r\n }\r\n else {\r\n $result .= \"<div class=\\\"cadre\\\">\\n\";\r\n }\r\n if (isset($tab_data[$jour]['extras'][$index_box])) {\r\n $result .= $tab_data[$jour]['extras'][$index_box];\r\n }\r\n if ($flags & INFOBULLE) {\r\n $lesson_content_1 = str_replace(\"<br />\", \" - \", $tab_data[$jour]['contenu'][$index_box]);\r\n $lesson_content_2 = str_replace(\"<i>\", \" \", $lesson_content_1);\r\n $lesson_content = str_replace(\"</i>\", \" \", $lesson_content_2);\r\n $result .=\"<div class=\\\"ButtonBar\\\"><div class=\\\"image\\\"><img src=\\\"../../templates/DefaultEDT/images/info.png\\\" title=\\\"\".$lesson_content.\"\\\" /></div></div>\";\r\n $result .= \"</div></div>\\n\";\r\n\r\n }\r\n else {\r\n $result .= $tab_data[$jour]['contenu'][$index_box];\r\n $result .= \"</div></div>\\n\";\r\n }\r\n\r\n }\r\n else if ($tab_data[$jour]['type'][$index_box] == \"fin_conteneur\")\r\n {\r\n $result .= \"</div>\\n\";\r\n }\r\n else \r\n {\r\n // ========= type de box non implémentée\r\n\r\n }\r\n\r\n\r\n $index_box++;\r\n }\r\n\r\n $result .= \"</div>\\n\";\r\n\r\n\tif ($flags & CRENEAUX_INVISIBLES) {\r\n\t\t$result .= '</div>';\r\n\t}\r\n\telse {\r\n\t\t// ===== affichage de la colonne créneaux\r\n\r\n\t\t$result .= \"<div class=\\\"colonne_creneaux\\\">\\n\";\r\n\t\t$result .= \"<div class=\\\"entete_creneaux\\\" style=\\\"height : \".$hauteur_demicreneaux.\"px;\\\">\";\r\n\t\tif (isset($tab_data['entete_creneaux'])) {\r\n\t\t\t$result .= $tab_data['entete_creneaux'];\r\n\t\t}\r\n\t\t$result .= \"</div>\\n\";\r\n\r\n\t\tfor ($i = 0; $i < $creneaux['nb_creneaux']; $i++)\r\n\t\t{\r\n\t\t\t$hauteur = 2 * $hauteur_demicreneaux;\r\n\t\t\t$hauteur = $hauteur.\"px;\";\r\n\t\t\t$result .= \"<div class=\\\"cellule\\\" style=\\\"height : \".$hauteur.\";\\\">\";\r\n\t\t\t$result .= \"<div class=\\\"cellule_creneaux\\\"><div class=\\\"cadre\\\">\".$creneaux['creneaux'][$i].\"</div></div>\\n\";\r\n\t\t\t$result .= \"</div>\";\r\n\t\t}\r\n\t}\r\n\t\t$result .= \"</div></div><div class=\\\"spacer\\\"></div>\";\r\n return $result;\r\n}", "function grafico_1( $desde, $hasta, $ua ){\n\t$query = \"select nested.id_cliente, noticiasactor.id_actor, nested.tema from \"\n\t. \"( select procesados.* from ( select noticiascliente.* from noticiascliente inner join proceso on noticiascliente.id_noticia = proceso.id_noticia where noticiascliente.id_cliente = \" . $ua . \" ) procesados \"\n\t. \"inner join noticia on noticia.id = procesados.id_noticia where noticia.fecha between '\" . $desde . \" 00:00:01' and '\" . $hasta . \" 23:59:59') nested \"\n\t. \"inner join noticiasactor on nested.id_noticia = noticiasactor.id_noticia order by id_actor asc \";\n\t$main = R::getAll($query);\n\t// obtengo el nombre de la unidad de analisis\n\t$ua_nombre = R::findOne(\"cliente\",\"id LIKE ?\",[$ua])['nombre'];\n\t// obtengo los nombres de todos los actores, para cruzar\n\t$actores_nombres = R::findOne(\"actor\",\"id LIKE ?\",[4]) ;\n\t//var_dump($actores_nombres['nombre'] . \" \" . $actores_nombres['apellido']);\n\n\t$tabla = [];\n\t$temas = [];\n\t$i = -1;\n\t// reemplazo actores por nombres y temas\n\tforeach($main as $k=>$v){\n\t\t$actores_nombres = R::findOne(\"actor\",\"id LIKE ?\",[ $v['id_actor'] ]);\n\t\t$main[$k]['id_cliente'] = $ua_nombre;\n\t\t// $main[$k]['id_actor'] = $actores_nombres['nombre'] . \" \" . $actores_nombres['apellido'];\n\t\t$main[$k]['id_actor'] = $v['id_actor'];\n\t\t$main[$k]['nombre'] = $actores_nombres['nombre'] . \" \" . $actores_nombres['apellido'];\n\t\t$id_tema = get_string_between($main[$k]['tema'],\"frm_tema_\",\"\\\"\");\n\t\t$tema = R::findOne(\"attr_temas\",\"id LIKE ?\",[$id_tema])['nombre'];\n\t\tif( is_null( $tema ) ) $tema = 'TEMA NO ASIGNADO';\n\t\t$main[$k]['tema'] = $tema;\n\t\t\n\t\t// if(array_search( [ $main[$k]['id_actor'],$tema], $tabla ) ) echo \"repetido\";\n\t\t// chequeo si ya existe alguno con este actor y tema, si es asi, sumo uno\n\t\t// TODO - FIXME : deberia ser mas eficiente, busqueda por dos valores\n\t\t$iter = true;\n\t\tforeach($tabla as $ka=>$va){\n\t\t\t// if($va['actor'] == $main[$k]['id_actor'] && $va['tema'] == $tema){\n\t\t\tif($va['actor'] == $main[$k]['nombre'] && $va['tema'] == $tema){\n\t\t\t\t$tabla[$ka]['cantidad'] += 1;\n\t\t\t\t$iter = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif($iter){\n\t\t\t$tabla[ ++$i ] = [ \n\t\t\t\t'unidad_analisis' => $ua_nombre,\n\t\t\t\t'actor' => $main[$k]['nombre'],\n\t\t\t\t'id_actor' => $main[$k]['id_actor'],\n\t\t\t\t'tema' => $tema,\n\t\t\t\t'cantidad' => 1\n\t\t\t\t];\n\t\t\t}\n\t\t// agrego los temas que van apareciendo en la tabla temas\n\t\t// UTIL para poder hacer el CRC32 por la cantidad de colores\n\t\tif(!in_array($tema,$temas)) $temas[] = $tema;\n\t}\n\t// la agrupacion de repetidos es por aca, por que repite y cuenta temas de igual id\n\n\t// en el grafico, los hijos, son arreglos de objetos, hago una conversion tabla -> objeto\n\t$objeto = new StdClass(); // objeto vacio\n\t$objeto->name = 'Actores';\n\t$objeto->rank = 0;\n\t$objeto->weight = 1;\n\t$objeto->id = 1;\n\t$objeto->children = [];\n\tforeach($tabla as $k=>$v){\n\t\t// me fijo si el actor existe, ineficiente pero por ahora\n\t\t$NoExiste = true;\n\t\tforeach($objeto->children as $ka=>$va){\n\t\t\t// si existe actor, le inserto el tema\n\t\t\tif($va->name == $v['actor']){\n\t\t\t\t$in = new StdClass();\n\t\t\t\t// $in->name = $v['tema'] . \" (\" . $v['cantidad'] . \") \" ; // lo construye JS\n\t\t\t\t$in->name = \"\";\n\t\t\t\t$in->tema = array_search($v['tema'],$temas);\n\t\t\t\t$in->tema_cantidad = $v['cantidad'];\n\t\t\t\t$in->rank = intval($v['cantidad']); // el tamaño del objeto \n\t\t\t\t$in->weight = 0; // lo asigna JS\n\t\t\t\t$in->id = $k;\n\t\t\t\t$in->children = [];\n\t\t\t\t$objeto->children[$ka]->children[] = $in;\n\t\t\t\t$objeto->children[$ka]->cantidad_temas = count($objeto->children[$ka]->children);\t\n\t\t\t\t$objeto->children[$ka]->rank = count($objeto->children[$ka]->children);\n\t\t\t\t$NoExiste = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif($NoExiste){\n\t\t\t$in = new StdClass();\n\t\t\t$in->name = $v['actor'];\n\t\t\t$in->rank = 1;\n\t\t\t$in->weight = 0; // lo asigna JS\n\t\t\t$in->id = $k;\n\t\t\t//$in->id = $v['id_actor'];\n\t\t\t$in->id_actor = $v['id_actor'];\n\t\t\t\t$t_in = new StdClass();\n\t\t\t\t// $t_in->name = $v['tema'] . \" (\" . $v['cantidad'] . \") \" ; // lo construye JS\n\t\t\t\t$t_in-> name = \"\";\n\t\t\t\t$t_in->tema = array_search($v['tema'],$temas);\n\t\t\t\t$t_in->tema_cantidad = $v['cantidad'];\n\t\t\t\t$t_in->rank = intval($v['cantidad']); // el tamaño del objeto \n\t\t\t\t$t_in->weight = 0; // lo asigna JS\n\t\t\t\t$t_in->id = $k;\n\t\t\t\t$t_in->children = [];\n\t\t\t$in->children = [ $t_in ];\n\t\t\t$objeto->children[] = $in;\n\t\t}\n\t}\n\treturn [\n\t\t'tabla' => $tabla,\n\t\t'grafico' => $objeto,\n\t\t'temas' => $temas\n\t\t];\n}", "function setCambiarTarjetas($tarjeta1,$tarjeta2,$tarjeta3,$tarjeta4,$tarjeta5,$partida){\n\t\t\t$cambio_afirmativo=0;\n\t\t\t\n\t\t\t$tarjetas=array(0=>$tarjeta1,1=>$tarjeta2,2=>$tarjeta3,3=>$tarjeta4,4=>$tarjeta5);\n\t\t\t\n\t\t\t$cantidad=0;\n\t\t\t\n\t\t\t$arreglo_tarjetas=array(0=>NULL,1=>NULL,2=>NULL);\n\t\t\t\t//meto en arreglo_tarjetas las tarjetas seleccionadas y cuentos cuantas son, si son mas de tres o menos de tres posteriormente retorno con 0\n\t\t\t$avanzar_arreglo=0;\n\t\t\t$veces_entre_foreach=0;\n\t\t\tforeach($tarjetas as $tarjeta){\n\t\t\t\tif($tarjeta == 1)\n\t\t\t\t\t\t\tif($partida->turno_usuario->getTarjeta($veces_entre_foreach)!=NULL){\n\t\t\t\t\t\t\t\t\t//digo que la tarjeta que esta en la posicion $avanzar_arreglo del usuario fue seleccionada\n\t\t\t\t\t\t\t\t$arreglo_tarjetas[$avanzar_arreglo]=$partida->turno_usuario->getTarjeta($veces_entre_foreach);\n\t\t\t\t\t\t\t\t$cantidad++;\n\t\t\t\t\t\t\t\t$avanzar_arreglo++;\n\t\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t$veces_entre_foreach++;\n\t\t\t}\n\t\t\t\t//envio mas o menos de tres tarjetas\n\t\t\tif($cantidad != 3){\n\t\t\t\treturn 1;\n\t\t\t\t\n\t\t\t}\n\t\t\telse{ //envio tres tarjetas\n\t\t\t\t\n\t\t\t\t\t//alguna de las tres es un comodin\n\t\t\t\t\t\n\t\t\t\tif($arreglo_tarjetas[0]->getLogo() == 3 || $arreglo_tarjetas[1]->getLogo() == 3 || $arreglo_tarjetas[2]->getLogo() == 3 )\t{\n\t\t\t\t\t\t//realizar si o si cambio\n\t\t\t\t\t$cambio_afirmativo=1;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\t//si son todas iguales\n\t\t\t\t\tif(($arreglo_tarjetas[0]->getLogo() == $arreglo_tarjetas[1]->getLogo()) && ($arreglo_tarjetas[0]->getLogo() == $arreglo_tarjetas[2]->getLogo())){\n\t\t\t\t\t\t//realizar cambio\n\t\t\t\t\t$cambio_afirmativo=1;\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//si son todas distintas\n\t\t\t\t\tif(($arreglo_tarjetas[0]->getLogo() != $arreglo_tarjetas[1]->getLogo()) && ($arreglo_tarjetas[0]->getLogo() != $arreglo_tarjetas[2]->getLogo()) && ($arreglo_tarjetas[1]->getLogo() != $arreglo_tarjetas[2]->getLogo()))\n\t\t\t\t\t\t//realizar cambio\n\t\t\t\t\t$cambio_afirmativo=1;\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\t///se pueden cambiar, devuelvo las tarjetas al arreglo y le entrego fichas al usuario\n\t\t\t\tif($cambio_afirmativo == 1){\n\t\t\t\t\tfor($i=0;$i<3;$i++)\n\t\t\t\t\t\t\t//devuelve todas las tarjetas\n\t\t\t\t\t\t\t$partida->turno_usuario->setDevolverTarjeta($arreglo_tarjetas[$i],$partida);\n\n\t\t\t\t\t$partida->turno_usuario->getObjetoIncorporar()->setCambio($partida->turno_usuario->getNumeroDeCambio());\n\t\t\t\t\t$partida->turno_usuario->setNumeroDeCambio();\t\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n}", "function getNombreArticle() {\n return ($this->nbarticle);\n }", "function grafico_1_2( $desde, $hasta, $ua ){\n\t// aclarar al cliente que debe setear campos bien definidos y NO PERMITIR AMBIGUEDADES\n\t\n\t$query = \"select actor.nombre, actor.apellido, actor.id_campo, count(noticiasactor.id_actor) as cantidad from noticiascliente \"\n\t\t. \"inner join noticiasactor on noticiascliente.id_noticia = noticiasactor.id_noticia \"\n\t\t. \"inner join noticias on noticiasactor.id_noticia = noticias.id \"\n\t\t. \"inner join actor on noticiasactor.id_actor = actor.id \"\n\t\t. \"where \"\n\t\t\t. \"noticiascliente.id_cliente = \" . $ua . \" and \"\n\t\t\t. \"noticiascliente.elim = 0 and \"\n\t\t\t. \"noticias.fecha between '\" . $desde . \" 00:00:01' and '\" . $hasta . \" 23:59:59' \"\n\t\t\t// SOLO QUIENES TIENEN 3 Y 4 COMO CAMPO\n\t\t\t. \" and ( actor.id_campo like '%3%' or actor.id_campo like '%4%' ) \"\n\t\t. \"group by noticiasactor.id_actor order by cantidad desc\";\n\t$main = R::getAll($query);\n\t$ua_nombre = R::findOne(\"cliente\",\"id LIKE ?\",[$ua])['nombre'];\n\n\t// var_dump($main);\n\t$tabla = [];\n\t// unidad de analisis, campo, actor, cantidad de menciones\n\t$i = -1;\n\tforeach($main as $k=>$v){\n\t\t// por ahora solo considero los dos posibles campos\n\t\t$tabla[ ++$i ] = [\n\t\t\t'ua' => $ua_nombre,\n\t\t\t'campo' => ( strpos( $v['id_campo'], '3' ) !== false ) ? 'oposicion' : 'oficialismo',\n\t\t\t'actor' => $v['apellido'] . ' ' . $v['nombre'],\n\t\t\t'cantidad' => $v['cantidad']\n\t\t\t];\n\t}\n\t// var_dump($tabla);\n\t\n\t// grafico\n\t$oficialismo = new StdClass(); // objeto vacio\n\t$oficialismo->name = 'Oficialismo';\n\t$oficialismo->rank = 0;\n\t$oficialismo->weight = 'Yellow';\n\t$oficialismo->id = 1;\n\t$oficialismo->children = [];\n\t\n\t$oposicion = new StdClass(); // objeto vacio\n\t$oposicion->name = 'Oposicion';\n\t$oposicion->rank = 0;\n\t$oposicion->weight = 'LightBlue';\n\t$oposicion->id = 1;\n\t$oposicion->children = [];\n\t\n\t$objeto = new StdClass(); // objeto vacio\n\t$objeto->name = 'Campos';\n\t$objeto->rank = 0;\n\t$objeto->weight = 'Gray';\n\t$objeto->id = 1;\n\t$objeto->children = [ $oficialismo, $oposicion ];\n\t\n\t$i_of = 0;\n\t$i_op = 0;\n\t\n\tforeach($tabla as $v){\n\t\t$sub = new StdClass(); // objeto vacio\n\t\t$sub->name = $v['actor'] . ' (' . $v['cantidad'] . ')';\n\t\t$sub->rank = $v['cantidad'];\n\t\t// $sub->weight = 0;\n\t\t$sub->cantidad = $v['cantidad'];\n\t\t$sub->id = 1;\n\t\t$sub->children = [ ];\n\t\tif($v['campo'] == 'oposicion'){\n\t\t\t$i_op += 1;\n\t\t\t$sub->weight = 'Blue';\n\t\t\t$oposicion->children[] = $sub;\n\t\t}\n\t\telse{ \n\t\t\t$i_of += 1;\n\t\t\t$sub->weight = 'White';\n\t\t\t$oficialismo->children[] = $sub;\n\t\t}\n\t}\n\t\n\t$oposicion->rank = $i_op;\n\t$oficialismo->rank = $i_of;\n\t\n\treturn [\n\t\t'tabla' => $tabla,\n\t\t'grafico' => $objeto\n\t\t// ,'temas' => $temas\n\t\t];\n\t\n}", "function listar_producto_nuevo(){\n\t\t$sql=\"SELECT claves_pro, categoria_pro, id_pro, detal_pro, mayor_pro, directorio_image, nombre_image, marca_pro, nombre_pro, limite_pro, descripcion_pro FROM producto, imagen WHERE galeria_image=id_pro AND tabla_image='Producto' AND disponible_pro='1' GROUP BY id_pro ORDER BY RAND() LIMIT 0 , 10\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$aux=\"\";\n\t\t\t$this->mensaje=\"si\";\n\t\t\t$resultado['detal_pro']=$this->mostrar_precio($this->convertir_moneda($resultado['detal_pro']));\n\t\t\t$resultado['mayor_pro']=$this->mostrar_precio($this->convertir_moneda($resultado['mayor_pro']));\n\t\t\t$resultado['descripcion_pro']=strip_tags($resultado['descripcion_pro']);\n\t\t\t\n\t\t\t$temp=$resultado['limite_pro'];\n\t\t\t$resultado['limite_pro']=\"\";\n\t\t\t//echo \"Numero: \".$temp;\n\t\t\t\n\t\t\tfor($i=1;$i<=$temp;$i++){\n\t\t\t\tif($i<=12) $resultado['limite_pro'][]=$i; else break;\n\t\t\t}\n\t\t\t\n\t\t\t\t$cat=$resultado['categoria_pro'];\n\t\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat'\";\n\t\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "public function getDirectriz()\n {\n $dir = false;\n if (self::getCod() === '110000') $dir='Enseñanzas Técnicas';\n if (self::getCod() === '120000') $dir='Enseñanzas Técnicas';\n if (self::getCod() === '210000') $dir='Enseñanzas Técnicas';\n if (self::getCod() === '220000') $dir='Ciencias Experimentales';\n if (self::getCod() === '230000') $dir='Ciencias Experimentales';\n if (self::getCod() === '240000') $dir='Ciencias de la Salud';\n if (self::getCod() === '250000') $dir='Ciencias Experimentales';\n if (self::getCod() === '310000') $dir='Ciencias Experimentales';\n if (self::getCod() === '320000') $dir='Ciencias de la Salud';\n if (self::getCod() === '330000') $dir='Enseñanzas Técnicas';\n if (self::getCod() === '510000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '520000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '530000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '540000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '550000') $dir='Humanidades';\n if (self::getCod() === '560000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '570000') $dir='Humanidades';\n if (self::getCod() === '580000') $dir='Humanidades';\n if (self::getCod() === '590000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '610000') $dir='Ciencias de la Salud';\n if (self::getCod() === '620000') $dir='Humanidades';\n if (self::getCod() === '630000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '710000') $dir='Humanidades';\n if (self::getCod() === '720000') $dir='Humanidades';\n return $dir;\n }", "function RellenarIndice()\r\n {\r\n $this->AddPage();\r\n\r\n $this->Imprimir('2. Revisión y Análisis de las siguientes interrupciones:', 20, 10);\r\n\r\n $cont_causa500 = 1;\r\n $cont_imp = 1;\r\n $cont_pro = 1;\r\n\r\n foreach ($this->eventos as $evento)\r\n {\r\n if (Doctrine_Core::getTable('SAF_EVENTO_CONVOCATORIA')->getEventoConvocatoria($evento, $this->convocatoria)->getStatus() == 'analizado')\r\n {\r\n $this->ImprimirSubtituloIndice($evento, $cont_causa500, $cont_imp, $cont_pro);\r\n\r\n $fecha_evento = strftime(\"%A, %d/%m/%Y\", strtotime($evento->getFHoraIni()));\r\n $text = \"RI. \" . $evento->getCEventoD() . \" - Circuito \" . $evento->getCircuito() . \". \" . $fecha_evento . '. MVAmin: ' . $evento->getMvaMin();\r\n $this->Imprimir($text, 40, 10);\r\n }\r\n }\r\n }", "function liste_articles_jour($date_jour, $nb_art_visites_jour, $date_maj_art, $prev_visites = '') {\r\n\tglobal $couleur_foncee, $couleur_claire;\r\n\r\n\t// fixer le nombre de ligne du tableau (tranche)\r\n\t$fl = $GLOBALS['actijour']['nbl_art'];\r\n\r\n\t// recup $vl dans URL\r\n\t$dl = intval(_request('vl'));\r\n\t$dl = ($dl + 0);\r\n\r\n\t//\r\n\t// requete liste article du jour\r\n\t$q = sql_select(\"sva.id_article, sva.date, sva.visites as visites_j, \r\n\t\t\tsa.titre, sa.visites, sa.popularite, sa.statut \r\n\t\t\tFROM spip_visites_articles sva \r\n\t\t\tLEFT JOIN spip_articles sa ON sva.id_article = sa.id_article \r\n\t\t\tWHERE sva.date='$date_jour' \r\n\t\t\tORDER BY visites_j DESC LIMIT $dl,$fl\");\r\n\r\n\t$nbart = sql_count($q);\r\n\r\n\r\n\t$aff = debut_cadre_relief(\"cal-jour.gif\", true);\r\n\r\n\t// bouton relance brut de la page\r\n\t// en attendant de passer a jquery !\r\n\tif ($date_jour == date('Y-m-d', mktime(0, 0, 0, date(\"m\"), date(\"d\"), date(\"Y\")))) {\r\n\t\t$aff .= \"<div class='bouton_maj'>\\n\"\r\n\t\t\t. \"<a href='\" . generer_url_ecrire(\"actijour_pg\") . \"'>\"\r\n\t\t\t. http_img_pack('puce-blanche.gif', 'ico', '', _T('actijour:mise_a_jour')) . \"</a>\\n\"\r\n\t\t\t. \"</div>\\n\";\r\n\t}\r\n\r\n\t// texte entete\r\n\tif (empty($date_maj_art)) {\r\n\t\t# La date du jour passé en 1er arg (jour, hier ...)\r\n\t\t$tbdate = recup_date($date_jour);\r\n\t\t$date_maj_art = date('d/m/y', mktime(0, 0, 0, $tbdate[1], $tbdate[2], $tbdate[0]));\r\n\t}\r\n\t$aff .= \"<div class='verdana3'>\"\r\n\t\t. _T('actijour:entete_tableau_art_jour', array(\r\n\t\t\t'nb_art_visites_jour' => $nb_art_visites_jour,\r\n\t\t\t'aff_date_now' => ' - ' . $date_maj_art\r\n\t\t))\r\n\t\t. \"</div>\\n\";\r\n\r\n\t// affichage tableau\r\n\tif (sql_count($q)) {\r\n\t\t// valeur de tranche affichꥉ\r\n\t\t$nba1 = $dl + 1;\r\n\t\t//\t\r\n\t\t$ifond = 0;\r\n\r\n\t\t// Presenter valeurs de la tranche de la requete\r\n\t\t$aff .= \"<div align='center' class='iconeoff verdana2 bold' style='clear:both;'>\\n\"\r\n\t\t\t. tranches_liste_art($nba1, $nb_art_visites_jour, $fl)\r\n\t\t\t. \"\\n</div>\\n\";\r\n\r\n\t\t// tableau\r\n\t\t$aff .= \"<table align='center' border='0' cellpadding='1' cellspacing='1' width='100%'>\\n\"\r\n\t\t\t. \"<tr bgcolor='$couleur_foncee' class='head_tbl'>\\n\"\r\n\t\t\t. \"<td width='7%'>\" . _T('actijour:numero_court') . \"</td>\\n\"\r\n\t\t\t. \"<td width='65%'>\" . _T('actijour:titre_article') . \"</td>\\n\"\r\n\t\t\t. \"<td width=9%>\" . _T('actijour:visites_jour') . \"</td>\\n\"\r\n\t\t\t. \"<td width=11%>\" . _T('actijour:total_visites') . \"</td>\\n\"\r\n\t\t\t. \"<td width=8%>\" . _T('actijour:popularite') . \"</td>\\n\"\r\n\t\t\t. \"</tr>\\n\";\r\n\r\n\t\t// corps du tableau\r\n\t\twhile ($row = sql_fetch($q)) {\r\n\t\t\t$visites_a = $row['visites'];\r\n\t\t\t$visites_j = $row['visites_j'];\r\n\t\t\t$id_art = $row['id_article'];\r\n\t\t\t$titre = $row['titre'];\r\n\t\t\t$etat = $row['statut'];\r\n\t\t\t// round sur popularit鍊\t\t\t$pop = round($row['popularite']);\r\n\t\t\t// Le total-visites de l'article\r\n\t\t\t#$tt_visit = $visit + $ipv;\r\n\r\n\t\t\t$ifond = $ifond ^ 1;\r\n\t\t\t$couleur = ($ifond) ? '#FFFFFF' : $couleur_claire;\r\n\r\n\t\t\t$aff .= \"<tr bgcolor='$couleur'><td width='7%'>\\n\"\r\n\t\t\t\t. \"<div align='right' class='verdana2'>\"\r\n\t\t\t\t. affiche_lien_graph($id_art, $titre, $etat, 'spip')\r\n\t\t\t\t. \"</div>\\n</td>\"\r\n\t\t\t\t. \"<td width='65%'>\\n\"\r\n\t\t\t\t. \"<div align='left' class='verdana1' style='margin-left:5px;'><b>\"\r\n\t\t\t\t. affiche_lien_graph($id_art, $titre, $etat)\r\n\t\t\t\t. \"</b></div></td>\\n\"\r\n\t\t\t\t. \"<td width='9%'>\\n\"\r\n\t\t\t\t. \"<div align='center' class='verdana2'><b>$visites_j</b></div></td>\\n\"\r\n\t\t\t\t. \"<td width='11%'>\\n\"\r\n\t\t\t\t. \"<div align='right' class='verdana1' style='margin-right:3px;'><b>$visites_a</b></div></td>\\n\"\r\n\t\t\t\t. \"<td width='8%'>\\n\"\r\n\t\t\t\t. \"<div align='center' class='verdana1'>$pop</div>\\n\"\r\n\t\t\t\t. \"</td></tr>\\n\";\r\n\t\t}\r\n\t\t$aff .= \"</table>\";\r\n\t} // aucun articles\r\n\telse {\r\n\t\t$aff .= \"<div align='center' class='iconeoff bold' style='clear:both;'>\"\r\n\t\t\t. _T('actijour:aucun_article_visite') . \"</div><br />\\n\";\r\n\t}\r\n\t$aff .= visites_pre_traitement($prev_visites);\r\n\t$aff .= fin_cadre_relief(true);\r\n\r\n\treturn $aff;\r\n}", "function calcul_panier() {\n\tglobal $a_tva;\n\n\t$montant = 0;\n\n\tif (isset($_SESSION['catalogue']['panier']['articles']) && is_array($_SESSION['catalogue']['panier']['articles'])) {\n\t\tinclude_once DIMS_APP_PATH.'/modules/catalogue/class_article.php';\n\n\t\tforeach ($_SESSION['catalogue']['panier']['articles'] as $ref => $fields) {\n\t\t\t$article = new article();\n\t\t\t$article->open($ref);\n\n\t\t\t$prix = catalogue_getprixarticle($article, $fields['qte']);\n\t\t\t$prixaff = catalogue_afficherprix($prix, $a_tva[$article->fields['PCTVA']]);\n\n\t\t\t$montant += $prixaff * $fields['qte'];\n\t\t}\n\t}\n\n\t$_SESSION['catalogue']['panier']['montant'] = $montant;\n}", "function showTroopAli_ctc($ali_id, $dtk_id, $art){\n\tglobal $db, $lang;\n\t$parse = $lang;\n\t\n\tfor($i=1; $i<=3; $i++){\n\t\t$parse['a_h_'.$i] = 0;\n\t\t$parse['a_h_c_'.$i] = \"c\";\t\t\n\t}\n\t\n\tfor($i=1; $i<=33; $i++){\n\t\t$parse['a_'.$i] = 0;\n\t\t$parse['a_c_'.$i] = \"c\";\n\t}\n\t\n\t//Lay thong tin hero\n\t$sql = \"SELECT\n\t\t\t\t\twg_heros.troop_id\n\t\t\t\tFROM\n\t\t\t\t\twg_heros ,\n\t\t\t\t\twg_ctc_heros ,\n\t\t\t\t\twg_villages ,\n\t\t\t\t\twg_users\n\t\t\t\tWHERE\n\t\t\t\t\twg_heros.id = wg_ctc_heros.hero_id AND\n\t\t\t\t\twg_ctc_heros.village_id = wg_villages.id AND\n\t\t\t\t\twg_villages.user_id = wg_users.id AND\n\t\t\t\t\twg_users.alliance_id = '$ali_id' AND\n\t\t\t\t\twg_ctc_heros.dtk_id = '$dtk_id'\n\t\t\t\tGROUP BY\n\t\t\t\t\twg_heros.id\";\n\t$db->setQuery($sql);\n\t$hs = $db->loadObjectList();\n\tif($hs){\n\t\tforeach($hs as $h){\n\t\t\tswitch($art[$h->troop_id]['nation_id']){\n\t\t\t\tcase 1:\n\t\t\t\t\t$parse['a_h_2']++;\n\t\t\t\t\tif($h->die==1){\n\t\t\t\t\t\t$parse['c_a_h_2']++;\n\t\t\t\t\t\t$parse['a_h_c_2'] = \"\";\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$parse['a_h_3']++;\n\t\t\t\t\tif($h->die==1){\n\t\t\t\t\t\t$parse['c_a_h_3']++;\n\t\t\t\t\t\t$parse['a_h_c_3'] = \"\";\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t$parse['a_h_1']++;\n\t\t\t\t\tif($h->die==1){\n\t\t\t\t\t\t$parse['c_a_h_1']++;\n\t\t\t\t\t\t$parse['a_h_c_1'] = \"\";\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//Lay thong tin linh\n\t$sql = \"SELECT\n\t\t\t\t\twg_ctc_troops.troop_id,\n\t\t\t\t\twg_ctc_troops.num\n\t\t\t\tFROM\n\t\t\t\t\twg_ctc_troops ,\n\t\t\t\t\twg_villages ,\n\t\t\t\t\twg_users\n\t\t\t\tWHERE\n\t\t\t\t\twg_ctc_troops.village_id = wg_villages.id AND\n\t\t\t\t\twg_villages.user_id = wg_users.id AND\n\t\t\t\t\twg_users.alliance_id = '$ali_id' AND\n\t\t\t\t\twg_ctc_troops.dtk_id = '$dtk_id'\n\t\t\t\tGROUP BY\n\t\t\t\t\twg_ctc_troops.id\";\n\t$db->setQuery($sql);//die($sql);\n\t$ts = $db->loadObjectList();\n\tif($ts){\n\t\tforeach($ts as $t){\n\t\t\tif($t->num>0){\n\t\t\t\t$parse['a_'.$t->troop_id] += $t->num;\n\t\t\t\t$parse['a_c_'.$t->troop_id] = \"\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//echo \"<pre>\"; print_r($hs); die();\n\t\n\treturn parsetemplate(gettemplate(\"ctc/ctc_troop_ali\"), $parse);\n}", "function courtjus_trouver_objet($id_rubrique, $objets_in_rubrique) {\n\n\t// Aller chercher les filtres\n\tinclude_spip('inc/filtres');\n\tinclude_spip('inc/config');\n\n\t// On récupère le configuration du plugin\n\t$config = lire_config('courtjus');\n\n\t// Maintenant qu'on a le tableau des objets de la rubrique on compte\n\t$nb_objet = count($objets_in_rubrique);\n\n\t// Si on est à 0 objet, on descend dans une sous rubrique\n\tif ($nb_objet <= 0) {\n\t\t// On renvoie false pour déclencher éventuellement la recherche dans une sous rubrique\n\t\treturn false;\n\t} elseif ($nb_objet == 1) {\n\t\t// Un seul objet dans la rubrique, on renvoie le tableau\n\t\treturn generer_url_entite($objets_in_rubrique[0]['id_objet'], $objets_in_rubrique[0]['objet'], '', '', true);\n\t} elseif ($nb_objet > 1\n\t\t\t and array_sum(array_column($objets_in_rubrique, 'num_titre')) > 0\n\t\t\t and $config['num_titre'] == 'on') {\n\t\t// S'il y plusieurs objets dans la rubrique et que le mode \"par num titre\"\n\t\t// est activé, on regiride sur le num titre le plus petit.\n\n\t\t// On créer un tableau avec uniquement les num titre\n\t\t$minmax = array_column($objets_in_rubrique, 'num_titre');\n\n\t\t// On va filtrer ce tableau pour n'avoir que des nombres à tester\n\t\t$minmax = array_filter($minmax, 'is_numeric');\n\n\t\t// On recherche l'index dans le tableau minmax\n\t\t$index = array_search(min($minmax), $minmax);\n\n\t\t// Créer l'URL de redirection\n\t\treturn generer_url_entite(\n\t\t\t$objets_in_rubrique[$index]['id_objet'],\n\t\t\t$objets_in_rubrique[$index]['objet'],\n\t\t\t'',\n\t\t\t'',\n\t\t\ttrue\n\t\t);\n\t} elseif ($nb_objet > 1\n\t\t\t and $config['recent'] == 'on') {\n\t\t// Si le mode par article le plus récent est activé\n\n\t\t// On créer un tableau avec uniquement les timestamps des dates\n\t\t$minmax = array_column($objets_in_rubrique, 'date');\n\n\t\t// On va filtrer ce tableau pour n'avoir que des nombres à tester\n\t\t$minmax = array_filter($minmax, 'is_numeric');\n\n\t\t// On recherche l'index avec le timestamp le plus grand\n\t\t$index = array_search(max($minmax), $minmax);\n\n\t\t// Créer l'URL de redirection\n\t\treturn generer_url_entite(\n\t\t\t$objets_in_rubrique[$index]['id_objet'],\n\t\t\t$objets_in_rubrique[$index]['objet'],\n\t\t\t'',\n\t\t\t'',\n\t\t\ttrue\n\t\t);\n\t}\n}" ]
[ "0.5988782", "0.5903291", "0.5830731", "0.5777779", "0.5772985", "0.57666725", "0.57552844", "0.56648", "0.5648377", "0.5643173", "0.5620033", "0.56093556", "0.5581485", "0.5579814", "0.5538583", "0.5518999", "0.5518848", "0.5505437", "0.5503941", "0.5466092", "0.5465621", "0.54182464", "0.53942883", "0.5392777", "0.53887415", "0.5373509", "0.5352945", "0.53511345", "0.53490746", "0.53340596", "0.53340095", "0.53218246", "0.5321777", "0.53056204", "0.5297142", "0.5297142", "0.5297142", "0.52939177", "0.5285668", "0.5283977", "0.5282312", "0.5274822", "0.5274684", "0.52690285", "0.5267291", "0.52667737", "0.5262218", "0.525889", "0.52546096", "0.5253192", "0.5244764", "0.5229504", "0.5217515", "0.521028", "0.5208055", "0.5204512", "0.5200782", "0.51955736", "0.51929545", "0.5189843", "0.5180104", "0.5180003", "0.51751286", "0.5174098", "0.5172765", "0.5172213", "0.51656467", "0.51621366", "0.5159289", "0.51586545", "0.5145557", "0.51452863", "0.51429987", "0.5141168", "0.5131721", "0.5130806", "0.5130056", "0.51277757", "0.51257896", "0.5120444", "0.51187396", "0.51156586", "0.511366", "0.5110389", "0.51089764", "0.51076245", "0.51022404", "0.5097847", "0.50970536", "0.50967336", "0.5095846", "0.5093695", "0.50926375", "0.5092366", "0.5092291", "0.5092184", "0.5082811", "0.5079326", "0.50783145", "0.50777686", "0.5077129" ]
0.0
-1